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

Unified Diff: mojo/embedder/embedder.cc

Issue 484893004: Mojo: Make Core own a PlatformSupport, and plumb it through to Channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/system/channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/embedder/embedder.cc
diff --git a/mojo/embedder/embedder.cc b/mojo/embedder/embedder.cc
index a9f70c5ef09cc70dd270baccccf1f407a9ccf5ee..cfeddba74b5a58c6f1303520787689a77c9b5adf 100644
--- a/mojo/embedder/embedder.cc
+++ b/mojo/embedder/embedder.cc
@@ -38,12 +38,14 @@ namespace {
// Helper for |CreateChannel...()|. (Note: May return null for some failures.)
scoped_refptr<system::Channel> MakeChannel(
+ system::Core* core,
ScopedPlatformHandle platform_handle,
scoped_refptr<system::MessagePipe> message_pipe) {
DCHECK(platform_handle.is_valid());
// Create and initialize a |system::Channel|.
- scoped_refptr<system::Channel> channel = new system::Channel();
+ scoped_refptr<system::Channel> channel =
+ new system::Channel(core->platform_support());
if (!channel->Init(system::RawChannel::Create(platform_handle.Pass()))) {
// This is very unusual (e.g., maybe |platform_handle| was invalid or we
// reached some system resource limit).
@@ -76,12 +78,14 @@ scoped_refptr<system::Channel> MakeChannel(
}
void CreateChannelHelper(
+ system::Core* core,
ScopedPlatformHandle platform_handle,
scoped_ptr<ChannelInfo> channel_info,
scoped_refptr<system::MessagePipe> message_pipe,
DidCreateChannelCallback callback,
scoped_refptr<base::TaskRunner> callback_thread_task_runner) {
- channel_info->channel = MakeChannel(platform_handle.Pass(), message_pipe);
+ channel_info->channel =
+ MakeChannel(core, platform_handle.Pass(), message_pipe);
// Hand the channel back to the embedder.
if (callback_thread_task_runner) {
@@ -116,7 +120,7 @@ ScopedMessagePipeHandle CreateChannelOnIOThread(
*channel_info = new ChannelInfo();
(*channel_info)->channel =
- MakeChannel(platform_handle.Pass(), remote_message_pipe.second);
+ MakeChannel(core, platform_handle.Pass(), remote_message_pipe.second);
return rv.Pass();
}
@@ -143,6 +147,7 @@ ScopedMessagePipeHandle CreateChannel(
if (rv.is_valid()) {
io_thread_task_runner->PostTask(FROM_HERE,
base::Bind(&CreateChannelHelper,
+ base::Unretained(core),
base::Passed(&platform_handle),
base::Passed(&channel_info),
remote_message_pipe.second,
« no previous file with comments | « no previous file | mojo/system/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698