OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ipc/ipc_channel.h" | 5 #include "ipc/ipc_channel.h" |
6 | 6 |
7 namespace IPC { | 7 namespace IPC { |
8 | 8 |
9 // static | 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( | 10 scoped_ptr<Channel> Channel::CreateClient( |
18 const IPC::ChannelHandle &channel_handle, Listener* listener) { | 11 const IPC::ChannelHandle &channel_handle, Listener* listener) { |
19 return make_scoped_ptr( | 12 return Channel::Create(channel_handle, Channel::MODE_CLIENT, listener); |
20 new Channel(channel_handle, Channel::MODE_CLIENT, listener)); | |
21 } | 13 } |
22 | 14 |
23 // static | 15 // static |
24 scoped_ptr<Channel> Channel::CreateNamedServer( | 16 scoped_ptr<Channel> Channel::CreateNamedServer( |
25 const IPC::ChannelHandle &channel_handle, Listener* listener) { | 17 const IPC::ChannelHandle &channel_handle, Listener* listener) { |
26 return make_scoped_ptr( | 18 return Channel::Create(channel_handle, Channel::MODE_NAMED_SERVER, listener); |
27 new Channel(channel_handle, Channel::MODE_NAMED_SERVER, listener)); | |
28 } | 19 } |
29 | 20 |
30 // static | 21 // static |
31 scoped_ptr<Channel> Channel::CreateNamedClient( | 22 scoped_ptr<Channel> Channel::CreateNamedClient( |
32 const IPC::ChannelHandle &channel_handle, Listener* listener) { | 23 const IPC::ChannelHandle &channel_handle, Listener* listener) { |
33 return make_scoped_ptr( | 24 return Channel::Create(channel_handle, Channel::MODE_NAMED_CLIENT, listener); |
34 new Channel(channel_handle, Channel::MODE_NAMED_CLIENT, listener)); | |
35 } | 25 } |
36 | 26 |
37 #if defined(OS_POSIX) | 27 #if defined(OS_POSIX) |
38 // static | 28 // static |
39 scoped_ptr<Channel> Channel::CreateOpenNamedServer( | 29 scoped_ptr<Channel> Channel::CreateOpenNamedServer( |
40 const IPC::ChannelHandle &channel_handle, Listener* listener) { | 30 const IPC::ChannelHandle &channel_handle, Listener* listener) { |
41 return make_scoped_ptr( | 31 return Channel::Create(channel_handle, |
42 new Channel(channel_handle, Channel::MODE_OPEN_NAMED_SERVER, listener)); | 32 Channel::MODE_OPEN_NAMED_SERVER, |
| 33 listener); |
43 } | 34 } |
44 #endif | 35 #endif |
45 | 36 |
46 // static | 37 // static |
47 scoped_ptr<Channel> Channel::CreateServer( | 38 scoped_ptr<Channel> Channel::CreateServer( |
48 const IPC::ChannelHandle &channel_handle, Listener* listener) { | 39 const IPC::ChannelHandle &channel_handle, Listener* listener) { |
49 return make_scoped_ptr( | 40 return Channel::Create(channel_handle, Channel::MODE_SERVER, listener); |
50 new Channel(channel_handle, Channel::MODE_SERVER, listener)); | |
51 } | 41 } |
52 | 42 |
| 43 Channel::~Channel() { |
| 44 } |
53 | 45 |
54 } // namespace IPC | 46 } // namespace IPC |
55 | 47 |
OLD | NEW |