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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 message_pipe_ = std::move(message_pipe); | 70 message_pipe_ = std::move(message_pipe); |
71 port_ = port; | 71 port_ = port; |
72 } | 72 } |
73 | 73 |
74 Dispatcher::Type MessagePipeDispatcher::GetType() const { | 74 Dispatcher::Type MessagePipeDispatcher::GetType() const { |
75 return Type::MESSAGE_PIPE; | 75 return Type::MESSAGE_PIPE; |
76 } | 76 } |
77 | 77 |
78 bool MessagePipeDispatcher::SupportsEntrypointClass( | 78 bool MessagePipeDispatcher::SupportsEntrypointClass( |
79 EntrypointClass entrypoint_class) const { | 79 EntrypointClass entrypoint_class) const { |
80 return (entrypoint_class == EntrypointClass::MESSAGE_PIPE); | 80 return (entrypoint_class == EntrypointClass::NONE || |
| 81 entrypoint_class == EntrypointClass::MESSAGE_PIPE); |
81 } | 82 } |
82 | 83 |
83 // static | 84 // static |
84 RefPtr<MessagePipeDispatcher> MessagePipeDispatcher::CreateRemoteMessagePipe( | 85 RefPtr<MessagePipeDispatcher> MessagePipeDispatcher::CreateRemoteMessagePipe( |
85 RefPtr<ChannelEndpoint>* channel_endpoint) { | 86 RefPtr<ChannelEndpoint>* channel_endpoint) { |
86 auto message_pipe = MessagePipe::CreateLocalProxy(channel_endpoint); | 87 auto message_pipe = MessagePipe::CreateLocalProxy(channel_endpoint); |
87 auto dispatcher = MessagePipeDispatcher::Create(kDefaultCreateOptions); | 88 auto dispatcher = MessagePipeDispatcher::Create(kDefaultCreateOptions); |
88 dispatcher->Init(std::move(message_pipe), 0); | 89 dispatcher->Init(std::move(message_pipe), 0); |
89 return dispatcher; | 90 return dispatcher; |
90 } | 91 } |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 233 |
233 bool rv = message_pipe_->EndSerialize(port_, channel, destination, | 234 bool rv = message_pipe_->EndSerialize(port_, channel, destination, |
234 actual_size, platform_handles); | 235 actual_size, platform_handles); |
235 message_pipe_ = nullptr; | 236 message_pipe_ = nullptr; |
236 port_ = kInvalidPort; | 237 port_ = kInvalidPort; |
237 return rv; | 238 return rv; |
238 } | 239 } |
239 | 240 |
240 } // namespace system | 241 } // namespace system |
241 } // namespace mojo | 242 } // namespace mojo |
OLD | NEW |