| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/edk/system/message_pipe_dispatcher.h" | 5 #include "mojo/edk/system/message_pipe_dispatcher.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "mojo/edk/system/configuration.h" | 10 #include "mojo/edk/system/configuration.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 DCHECK(port == 0 || port == 1); | 64 DCHECK(port == 0 || port == 1); |
| 65 | 65 |
| 66 message_pipe_ = std::move(message_pipe); | 66 message_pipe_ = std::move(message_pipe); |
| 67 port_ = port; | 67 port_ = port; |
| 68 } | 68 } |
| 69 | 69 |
| 70 Dispatcher::Type MessagePipeDispatcher::GetType() const { | 70 Dispatcher::Type MessagePipeDispatcher::GetType() const { |
| 71 return Type::MESSAGE_PIPE; | 71 return Type::MESSAGE_PIPE; |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool MessagePipeDispatcher::SupportsEntrypointClass( |
| 75 EntrypointClass entrypoint_class) const { |
| 76 return (entrypoint_class == EntrypointClass::MESSAGE_PIPE); |
| 77 } |
| 78 |
| 74 // static | 79 // static |
| 75 RefPtr<MessagePipeDispatcher> MessagePipeDispatcher::CreateRemoteMessagePipe( | 80 RefPtr<MessagePipeDispatcher> MessagePipeDispatcher::CreateRemoteMessagePipe( |
| 76 RefPtr<ChannelEndpoint>* channel_endpoint) { | 81 RefPtr<ChannelEndpoint>* channel_endpoint) { |
| 77 auto message_pipe = MessagePipe::CreateLocalProxy(channel_endpoint); | 82 auto message_pipe = MessagePipe::CreateLocalProxy(channel_endpoint); |
| 78 auto dispatcher = MessagePipeDispatcher::Create(kDefaultCreateOptions); | 83 auto dispatcher = MessagePipeDispatcher::Create(kDefaultCreateOptions); |
| 79 dispatcher->Init(std::move(message_pipe), 0); | 84 dispatcher->Init(std::move(message_pipe), 0); |
| 80 return dispatcher; | 85 return dispatcher; |
| 81 } | 86 } |
| 82 | 87 |
| 83 // static | 88 // static |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 224 |
| 220 MessagePipeDispatcherTransport::MessagePipeDispatcherTransport( | 225 MessagePipeDispatcherTransport::MessagePipeDispatcherTransport( |
| 221 DispatcherTransport transport) | 226 DispatcherTransport transport) |
| 222 : DispatcherTransport(transport) { | 227 : DispatcherTransport(transport) { |
| 223 DCHECK_EQ(message_pipe_dispatcher()->GetType(), | 228 DCHECK_EQ(message_pipe_dispatcher()->GetType(), |
| 224 Dispatcher::Type::MESSAGE_PIPE); | 229 Dispatcher::Type::MESSAGE_PIPE); |
| 225 } | 230 } |
| 226 | 231 |
| 227 } // namespace system | 232 } // namespace system |
| 228 } // namespace mojo | 233 } // namespace mojo |
| OLD | NEW |