| 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/system/message_pipe_dispatcher.h" | 5 #include "mojo/system/message_pipe_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/system/channel.h" | 8 #include "mojo/system/channel.h" |
| 9 #include "mojo/system/constants.h" | 9 #include "mojo/system/constants.h" |
| 10 #include "mojo/system/local_message_pipe_endpoint.h" | 10 #include "mojo/system/local_message_pipe_endpoint.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 port_ = port; | 77 port_ = port; |
| 78 } | 78 } |
| 79 | 79 |
| 80 Dispatcher::Type MessagePipeDispatcher::GetType() const { | 80 Dispatcher::Type MessagePipeDispatcher::GetType() const { |
| 81 return kTypeMessagePipe; | 81 return kTypeMessagePipe; |
| 82 } | 82 } |
| 83 | 83 |
| 84 // static | 84 // static |
| 85 std::pair<scoped_refptr<MessagePipeDispatcher>, scoped_refptr<MessagePipe> > | 85 std::pair<scoped_refptr<MessagePipeDispatcher>, scoped_refptr<MessagePipe> > |
| 86 MessagePipeDispatcher::CreateRemoteMessagePipe() { | 86 MessagePipeDispatcher::CreateRemoteMessagePipe() { |
| 87 scoped_refptr<MessagePipe> message_pipe(new MessagePipe( | 87 scoped_refptr<MessagePipe> message_pipe( |
| 88 scoped_ptr<MessagePipeEndpoint>(new LocalMessagePipeEndpoint()), | 88 new MessagePipe(MessagePipe::LocalProxy())); |
| 89 scoped_ptr<MessagePipeEndpoint>(new ProxyMessagePipeEndpoint()))); | |
| 90 scoped_refptr<MessagePipeDispatcher> dispatcher( | 89 scoped_refptr<MessagePipeDispatcher> dispatcher( |
| 91 new MessagePipeDispatcher(MessagePipeDispatcher::kDefaultCreateOptions)); | 90 new MessagePipeDispatcher(MessagePipeDispatcher::kDefaultCreateOptions)); |
| 92 dispatcher->Init(message_pipe, 0); | 91 dispatcher->Init(message_pipe, 0); |
| 93 | 92 |
| 94 return std::make_pair(dispatcher, message_pipe); | 93 return std::make_pair(dispatcher, message_pipe); |
| 95 } | 94 } |
| 96 | 95 |
| 97 // static | 96 // static |
| 98 scoped_refptr<MessagePipeDispatcher> MessagePipeDispatcher::Deserialize( | 97 scoped_refptr<MessagePipeDispatcher> MessagePipeDispatcher::Deserialize( |
| 99 Channel* channel, | 98 Channel* channel, |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // MessagePipeDispatcherTransport ---------------------------------------------- | 275 // MessagePipeDispatcherTransport ---------------------------------------------- |
| 277 | 276 |
| 278 MessagePipeDispatcherTransport::MessagePipeDispatcherTransport( | 277 MessagePipeDispatcherTransport::MessagePipeDispatcherTransport( |
| 279 DispatcherTransport transport) | 278 DispatcherTransport transport) |
| 280 : DispatcherTransport(transport) { | 279 : DispatcherTransport(transport) { |
| 281 DCHECK_EQ(message_pipe_dispatcher()->GetType(), Dispatcher::kTypeMessagePipe); | 280 DCHECK_EQ(message_pipe_dispatcher()->GetType(), Dispatcher::kTypeMessagePipe); |
| 282 } | 281 } |
| 283 | 282 |
| 284 } // namespace system | 283 } // namespace system |
| 285 } // namespace mojo | 284 } // namespace mojo |
| OLD | NEW |