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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 #include "ipc/ipc_channel.h" | 6 #include "ipc/ipc_channel.h" |
7 #include "ipc/ipc_channel_mojo.h" | 7 #include "ipc/ipc_channel_mojo.h" |
8 #include "mojo/public/cpp/system/message_pipe.h" | 8 #include "mojo/public/cpp/system/message_pipe.h" |
9 | 9 |
10 namespace IPC { | 10 namespace IPC { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #if defined(OS_NACL_SFI) | 50 #if defined(OS_NACL_SFI) |
51 return Channel::Create(channel_handle, Channel::MODE_SERVER, listener); | 51 return Channel::Create(channel_handle, Channel::MODE_SERVER, listener); |
52 #else | 52 #else |
53 DCHECK(channel_handle.is_mojo_channel_handle()); | 53 DCHECK(channel_handle.is_mojo_channel_handle()); |
54 return ChannelMojo::Create( | 54 return ChannelMojo::Create( |
55 mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle), | 55 mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle), |
56 Channel::MODE_SERVER, listener, ipc_task_runner); | 56 Channel::MODE_SERVER, listener, ipc_task_runner); |
57 #endif | 57 #endif |
58 } | 58 } |
59 | 59 |
60 // static | |
61 void Channel::GenerateMojoChannelHandlePair( | |
62 const std::string& name_postfix, | |
63 IPC::ChannelHandle* handle0, | |
64 IPC::ChannelHandle* handle1) { | |
65 DCHECK_NE(handle0, handle1); | |
66 mojo::MessagePipe message_pipe; | |
67 *handle0 = ChannelHandle(message_pipe.handle0.release()); | |
68 *handle1 = ChannelHandle(message_pipe.handle1.release()); | |
69 } | |
70 | |
71 Channel::~Channel() { | 60 Channel::~Channel() { |
72 } | 61 } |
73 | 62 |
74 Channel::AssociatedInterfaceSupport* Channel::GetAssociatedInterfaceSupport() { | 63 Channel::AssociatedInterfaceSupport* Channel::GetAssociatedInterfaceSupport() { |
75 return nullptr; | 64 return nullptr; |
76 } | 65 } |
77 | 66 |
78 void Channel::Pause() { NOTREACHED(); } | 67 void Channel::Pause() { NOTREACHED(); } |
79 | 68 |
80 void Channel::Unpause(bool flush) { NOTREACHED(); } | 69 void Channel::Unpause(bool flush) { NOTREACHED(); } |
81 | 70 |
82 void Channel::Flush() { NOTREACHED(); } | 71 void Channel::Flush() { NOTREACHED(); } |
83 | 72 |
84 void Channel::WillConnect() { | 73 void Channel::WillConnect() { |
85 did_start_connect_ = true; | 74 did_start_connect_ = true; |
86 } | 75 } |
87 | 76 |
88 } // namespace IPC | 77 } // namespace IPC |
OLD | NEW |