forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce IPC::Channel::Create*() to ensure it being heap-allocated.
This change introduces IPC::Channel::Create*() API to turn IPC::Channel into a heap allocated object. This will allow us to make Channel a polymorphic class. This change also tries to hide Channel::Mode from public API so that we can simplify channel creation code paths cleaner in following changes. ChannelProxy has to follow same pattern to finish this cleanup. Such changes will follow. TEST=none BUG=377980 R=darin@chromium.org,cpu@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273575 Review URL: https://codereview.chromium.org/307653003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273713 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
morrita@chromium.org
committed
May 30, 2014
1 parent
1df3479
commit e482111
Showing
23 changed files
with
235 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ipc/ipc_channel.h" | ||
|
||
namespace IPC { | ||
|
||
// static | ||
scoped_ptr<Channel> Channel::CreateByModeForProxy( | ||
const IPC::ChannelHandle &channel_handle, Mode mode, Listener* listener) { | ||
return make_scoped_ptr( | ||
new Channel(channel_handle, mode, listener)); | ||
} | ||
|
||
// static | ||
scoped_ptr<Channel> Channel::CreateClient( | ||
const IPC::ChannelHandle &channel_handle, Listener* listener) { | ||
return make_scoped_ptr( | ||
new Channel(channel_handle, Channel::MODE_CLIENT, listener)); | ||
} | ||
|
||
// static | ||
scoped_ptr<Channel> Channel::CreateNamedServer( | ||
const IPC::ChannelHandle &channel_handle, Listener* listener) { | ||
return make_scoped_ptr( | ||
new Channel(channel_handle, Channel::MODE_NAMED_SERVER, listener)); | ||
} | ||
|
||
// static | ||
scoped_ptr<Channel> Channel::CreateNamedClient( | ||
const IPC::ChannelHandle &channel_handle, Listener* listener) { | ||
return make_scoped_ptr( | ||
new Channel(channel_handle, Channel::MODE_NAMED_CLIENT, listener)); | ||
} | ||
|
||
#if defined(OS_POSIX) | ||
// static | ||
scoped_ptr<Channel> Channel::CreateOpenNamedServer( | ||
const IPC::ChannelHandle &channel_handle, Listener* listener) { | ||
return make_scoped_ptr( | ||
new Channel(channel_handle, Channel::MODE_OPEN_NAMED_SERVER, listener)); | ||
} | ||
#endif | ||
|
||
// static | ||
scoped_ptr<Channel> Channel::CreateServer( | ||
const IPC::ChannelHandle &channel_handle, Listener* listener) { | ||
return make_scoped_ptr( | ||
new Channel(channel_handle, Channel::MODE_SERVER, listener)); | ||
} | ||
|
||
|
||
} // namespace IPC | ||
|
Oops, something went wrong.