Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: mojo/system/message_pipe_dispatcher.cc

Issue 505863002: Mojo: Add static factory functions to MessagePipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/system/message_pipe.cc ('k') | mojo/system/message_pipe_dispatcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(MessagePipe::CreateLocalProxy());
88 scoped_ptr<MessagePipeEndpoint>(new LocalMessagePipeEndpoint()),
89 scoped_ptr<MessagePipeEndpoint>(new ProxyMessagePipeEndpoint())));
90 scoped_refptr<MessagePipeDispatcher> dispatcher( 88 scoped_refptr<MessagePipeDispatcher> dispatcher(
91 new MessagePipeDispatcher(MessagePipeDispatcher::kDefaultCreateOptions)); 89 new MessagePipeDispatcher(MessagePipeDispatcher::kDefaultCreateOptions));
92 dispatcher->Init(message_pipe, 0); 90 dispatcher->Init(message_pipe, 0);
93 91
94 return std::make_pair(dispatcher, message_pipe); 92 return std::make_pair(dispatcher, message_pipe);
95 } 93 }
96 94
97 // static 95 // static
98 scoped_refptr<MessagePipeDispatcher> MessagePipeDispatcher::Deserialize( 96 scoped_refptr<MessagePipeDispatcher> MessagePipeDispatcher::Deserialize(
99 Channel* channel, 97 Channel* channel,
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // MessagePipeDispatcherTransport ---------------------------------------------- 274 // MessagePipeDispatcherTransport ----------------------------------------------
277 275
278 MessagePipeDispatcherTransport::MessagePipeDispatcherTransport( 276 MessagePipeDispatcherTransport::MessagePipeDispatcherTransport(
279 DispatcherTransport transport) 277 DispatcherTransport transport)
280 : DispatcherTransport(transport) { 278 : DispatcherTransport(transport) {
281 DCHECK_EQ(message_pipe_dispatcher()->GetType(), Dispatcher::kTypeMessagePipe); 279 DCHECK_EQ(message_pipe_dispatcher()->GetType(), Dispatcher::kTypeMessagePipe);
282 } 280 }
283 281
284 } // namespace system 282 } // namespace system
285 } // namespace mojo 283 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/message_pipe.cc ('k') | mojo/system/message_pipe_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698