[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "ipc/ipc_channel.h" |
| 6 | |
| 7 | namespace IPC { |
| 8 | |
| 9 | // static |
[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 10 | scoped_ptr<Channel> Channel::CreateClient( |
erikchen | 27aa7d8 | 2015-06-16 21:21:04 | [diff] [blame] | 11 | const IPC::ChannelHandle& channel_handle, |
erikchen | 30dc281 | 2015-09-24 03:26:38 | [diff] [blame^] | 12 | Listener* listener) { |
| 13 | return Channel::Create(channel_handle, Channel::MODE_CLIENT, listener); |
[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | // static |
| 17 | scoped_ptr<Channel> Channel::CreateNamedServer( |
erikchen | 27aa7d8 | 2015-06-16 21:21:04 | [diff] [blame] | 18 | const IPC::ChannelHandle& channel_handle, |
erikchen | 30dc281 | 2015-09-24 03:26:38 | [diff] [blame^] | 19 | Listener* listener) { |
| 20 | return Channel::Create(channel_handle, Channel::MODE_NAMED_SERVER, listener); |
[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | // static |
| 24 | scoped_ptr<Channel> Channel::CreateNamedClient( |
erikchen | 27aa7d8 | 2015-06-16 21:21:04 | [diff] [blame] | 25 | const IPC::ChannelHandle& channel_handle, |
erikchen | 30dc281 | 2015-09-24 03:26:38 | [diff] [blame^] | 26 | Listener* listener) { |
| 27 | return Channel::Create(channel_handle, Channel::MODE_NAMED_CLIENT, listener); |
[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | #if defined(OS_POSIX) |
| 31 | // static |
| 32 | scoped_ptr<Channel> Channel::CreateOpenNamedServer( |
erikchen | 27aa7d8 | 2015-06-16 21:21:04 | [diff] [blame] | 33 | const IPC::ChannelHandle& channel_handle, |
erikchen | 30dc281 | 2015-09-24 03:26:38 | [diff] [blame^] | 34 | Listener* listener) { |
erikchen | 27aa7d8 | 2015-06-16 21:21:04 | [diff] [blame] | 35 | return Channel::Create(channel_handle, Channel::MODE_OPEN_NAMED_SERVER, |
erikchen | 30dc281 | 2015-09-24 03:26:38 | [diff] [blame^] | 36 | listener); |
[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 37 | } |
| 38 | #endif |
| 39 | |
| 40 | // static |
| 41 | scoped_ptr<Channel> Channel::CreateServer( |
erikchen | 27aa7d8 | 2015-06-16 21:21:04 | [diff] [blame] | 42 | const IPC::ChannelHandle& channel_handle, |
erikchen | 30dc281 | 2015-09-24 03:26:38 | [diff] [blame^] | 43 | Listener* listener) { |
| 44 | return Channel::Create(channel_handle, Channel::MODE_SERVER, listener); |
[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 45 | } |
| 46 | |
[email protected] | 2f60c9b | 2014-06-06 20:13:51 | [diff] [blame] | 47 | Channel::~Channel() { |
| 48 | } |
[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 49 | |
morrita | b447214 | 2015-04-20 21:20:12 | [diff] [blame] | 50 | bool Channel::IsSendThreadSafe() const { |
| 51 | return false; |
| 52 | } |
| 53 | |
[email protected] | e482111a8 | 2014-05-30 03:58:59 | [diff] [blame] | 54 | } // namespace IPC |
| 55 | |