Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: ipc/ipc_channel_common.cc

Issue 307653003: Introduce IPC::Channel::Create*() to ensure it being heap-allocated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ipc/ipc_channel.h"
6
7 namespace IPC {
8
9 // static
10 Channel* Channel::CreateByModeForProxy(
11 const IPC::ChannelHandle &channel_handle, Mode mode, Listener* listener) {
12 return new Channel(channel_handle, mode, listener);
13 }
14
15 // static
16 Channel* Channel::CreateClient(
17 const IPC::ChannelHandle &channel_handle, Listener* listener) {
18 return new Channel(channel_handle, Channel::MODE_CLIENT, listener);
19 }
20
21 // static
22 Channel* Channel::CreateNamedServer(
23 const IPC::ChannelHandle &channel_handle, Listener* listener) {
24 return new Channel(channel_handle, Channel::MODE_NAMED_SERVER, listener);
25 }
26
27 // static
28 Channel* Channel::CreateNamedClient(
29 const IPC::ChannelHandle &channel_handle, Listener* listener) {
30 return new Channel(channel_handle, Channel::MODE_NAMED_CLIENT, listener);
31 }
32
33 // static
34 Channel* Channel::CreateOpenNamedServer(
35 const IPC::ChannelHandle &channel_handle, Listener* listener) {
36 #if defined(OS_POSIX)
37 return new Channel(channel_handle, Channel::MODE_OPEN_NAMED_SERVER, listener);
38 #else
39 NOTIMPLEMENTED();
40 return NULL;
41 #endif
42 }
43
44 // static
45 Channel* Channel::CreateServer(
46 const IPC::ChannelHandle &channel_handle, Listener* listener) {
47 return new Channel(channel_handle, Channel::MODE_SERVER, listener);
48 }
49
50
51 } // namespace IPC
52
OLDNEW
« ipc/ipc_channel.h ('K') | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698