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

Side by Side Diff: mojo/embedder/embedder.cc

Issue 382333002: Introduce ChannelMojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing Mac build failure Created 6 years, 5 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 | Annotate | Revision Log
« mojo/embedder/embedder.h ('K') | « mojo/embedder/embedder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "mojo/embedder/embedder.h" 5 #include "mojo/embedder/embedder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 callback.Run(channel_info.release()); 90 callback.Run(channel_info.release());
91 } 91 }
92 } 92 }
93 93
94 } // namespace 94 } // namespace
95 95
96 void Init() { 96 void Init() {
97 system::entrypoints::SetCore(new system::Core()); 97 system::entrypoints::SetCore(new system::Core());
98 } 98 }
99 99
100 void InitIfNeeded() {
101 if (!system::entrypoints::GetCore())
102 system::entrypoints::SetCore(new system::Core());
103 }
104
100 ScopedMessagePipeHandle CreateChannel( 105 ScopedMessagePipeHandle CreateChannel(
101 ScopedPlatformHandle platform_handle, 106 ScopedPlatformHandle platform_handle,
102 scoped_refptr<base::TaskRunner> io_thread_task_runner, 107 scoped_refptr<base::TaskRunner> io_thread_task_runner,
103 DidCreateChannelCallback callback, 108 DidCreateChannelCallback callback,
104 scoped_refptr<base::TaskRunner> callback_thread_task_runner) { 109 scoped_refptr<base::TaskRunner> callback_thread_task_runner) {
105 DCHECK(platform_handle.is_valid()); 110 DCHECK(platform_handle.is_valid());
106 111
107 std::pair<scoped_refptr<system::MessagePipeDispatcher>, 112 std::pair<scoped_refptr<system::MessagePipeDispatcher>,
108 scoped_refptr<system::MessagePipe> > remote_message_pipe = 113 scoped_refptr<system::MessagePipe> > remote_message_pipe =
109 system::MessagePipeDispatcher::CreateRemoteMessagePipe(); 114 system::MessagePipeDispatcher::CreateRemoteMessagePipe();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (dispatcher->GetType() != system::Dispatcher::kTypePlatformHandle) 175 if (dispatcher->GetType() != system::Dispatcher::kTypePlatformHandle)
171 return MOJO_RESULT_INVALID_ARGUMENT; 176 return MOJO_RESULT_INVALID_ARGUMENT;
172 177
173 *platform_handle = static_cast<system::PlatformHandleDispatcher*>( 178 *platform_handle = static_cast<system::PlatformHandleDispatcher*>(
174 dispatcher.get())->PassPlatformHandle().Pass(); 179 dispatcher.get())->PassPlatformHandle().Pass();
175 return MOJO_RESULT_OK; 180 return MOJO_RESULT_OK;
176 } 181 }
177 182
178 } // namespace embedder 183 } // namespace embedder
179 } // namespace mojo 184 } // namespace mojo
OLDNEW
« mojo/embedder/embedder.h ('K') | « mojo/embedder/embedder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698