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

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: Fixing windows build, landing again. 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
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_posix_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 scoped_ptr<Channel> Channel::CreateByModeForProxy(
11 const IPC::ChannelHandle &channel_handle, Mode mode, Listener* listener) {
12 return make_scoped_ptr(
13 new Channel(channel_handle, mode, listener));
14 }
15
16 // static
17 scoped_ptr<Channel> Channel::CreateClient(
18 const IPC::ChannelHandle &channel_handle, Listener* listener) {
19 return make_scoped_ptr(
20 new Channel(channel_handle, Channel::MODE_CLIENT, listener));
21 }
22
23 // static
24 scoped_ptr<Channel> Channel::CreateNamedServer(
25 const IPC::ChannelHandle &channel_handle, Listener* listener) {
26 return make_scoped_ptr(
27 new Channel(channel_handle, Channel::MODE_NAMED_SERVER, listener));
28 }
29
30 // static
31 scoped_ptr<Channel> Channel::CreateNamedClient(
32 const IPC::ChannelHandle &channel_handle, Listener* listener) {
33 return make_scoped_ptr(
34 new Channel(channel_handle, Channel::MODE_NAMED_CLIENT, listener));
35 }
36
37 #if defined(OS_POSIX)
38 // static
39 scoped_ptr<Channel> Channel::CreateOpenNamedServer(
40 const IPC::ChannelHandle &channel_handle, Listener* listener) {
41 return make_scoped_ptr(
42 new Channel(channel_handle, Channel::MODE_OPEN_NAMED_SERVER, listener));
43 }
44 #endif
45
46 // static
47 scoped_ptr<Channel> Channel::CreateServer(
48 const IPC::ChannelHandle &channel_handle, Listener* listener) {
49 return make_scoped_ptr(
50 new Channel(channel_handle, Channel::MODE_SERVER, listener));
51 }
52
53
54 } // namespace IPC
55
OLDNEW
« no previous file with comments | « 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