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

Side by Side Diff: mojo/runner/child_process.cc

Issue 1179163002: Migrate callers of message_loop_proxy() to task_runner() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 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 | « jingle/notifier/listener/xmpp_push_client_unittest.cc ('k') | mojo/runner/context.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 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/runner/child_process.h" 5 #include "mojo/runner/child_process.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 : io_thread_("io_thread"), controller_thread_("controller_thread") {} 92 : io_thread_("io_thread"), controller_thread_("controller_thread") {}
93 ~AppContext() override {} 93 ~AppContext() override {}
94 94
95 void Init() { 95 void Init() {
96 // Initialize Mojo before starting any threads. 96 // Initialize Mojo before starting any threads.
97 embedder::Init(make_scoped_ptr(new embedder::SimplePlatformSupport())); 97 embedder::Init(make_scoped_ptr(new embedder::SimplePlatformSupport()));
98 98
99 // Create and start our I/O thread. 99 // Create and start our I/O thread.
100 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0); 100 base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0);
101 CHECK(io_thread_.StartWithOptions(io_thread_options)); 101 CHECK(io_thread_.StartWithOptions(io_thread_options));
102 io_runner_ = io_thread_.message_loop_proxy().get(); 102 io_runner_ = io_thread_.task_runner().get();
103 CHECK(io_runner_.get()); 103 CHECK(io_runner_.get());
104 104
105 // Create and start our controller thread. 105 // Create and start our controller thread.
106 base::Thread::Options controller_thread_options; 106 base::Thread::Options controller_thread_options;
107 controller_thread_options.message_loop_type = 107 controller_thread_options.message_loop_type =
108 base::MessageLoop::TYPE_CUSTOM; 108 base::MessageLoop::TYPE_CUSTOM;
109 controller_thread_options.message_pump_factory = 109 controller_thread_options.message_pump_factory =
110 base::Bind(&common::MessagePumpMojo::Create); 110 base::Bind(&common::MessagePumpMojo::Create);
111 CHECK(controller_thread_.StartWithOptions(controller_thread_options)); 111 CHECK(controller_thread_.StartWithOptions(controller_thread_options));
112 controller_runner_ = controller_thread_.message_loop_proxy().get(); 112 controller_runner_ = controller_thread_.task_runner().get();
113 CHECK(controller_runner_.get()); 113 CHECK(controller_runner_.get());
114 114
115 // TODO(vtl): This should be SLAVE, not NONE. 115 // TODO(vtl): This should be SLAVE, not NONE.
116 embedder::InitIPCSupport(embedder::ProcessType::NONE, controller_runner_, 116 embedder::InitIPCSupport(embedder::ProcessType::NONE, controller_runner_,
117 this, io_runner_, 117 this, io_runner_,
118 embedder::ScopedPlatformHandle()); 118 embedder::ScopedPlatformHandle());
119 } 119 }
120 120
121 void Shutdown() { 121 void Shutdown() {
122 Blocker blocker; 122 Blocker blocker;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // This will block, then run whatever the controller wants. 301 // This will block, then run whatever the controller wants.
302 blocker.Block(); 302 blocker.Block();
303 303
304 app_context.Shutdown(); 304 app_context.Shutdown();
305 305
306 return 0; 306 return 0;
307 } 307 }
308 308
309 } // namespace runner 309 } // namespace runner
310 } // namespace mojo 310 } // namespace mojo
OLDNEW
« no previous file with comments | « jingle/notifier/listener/xmpp_push_client_unittest.cc ('k') | mojo/runner/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698