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

Side by Side Diff: services/shell/standalone/context.cc

Issue 2375663002: Replace MessageLoop::current()->task_runner() with ThreadTaskRunnerHandle::Get(). (Closed)
Patch Set: rebase Created 4 years, 2 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 | « ipc/ipc_channel_win.cc ('k') | services/shell/standalone/tracer.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 "services/shell/standalone/context.h" 5 #include "services/shell/standalone/context.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 service_manager_.reset(); 212 service_manager_.reset();
213 213
214 DCHECK_EQ(base::ThreadTaskRunnerHandle::Get(), service_manager_runner_); 214 DCHECK_EQ(base::ThreadTaskRunnerHandle::Get(), service_manager_runner_);
215 215
216 // If we didn't initialize the edk we should not shut it down. 216 // If we didn't initialize the edk we should not shut it down.
217 if (!init_edk_) 217 if (!init_edk_)
218 return; 218 return;
219 219
220 TRACE_EVENT0("mojo_shell", "Context::Shutdown"); 220 TRACE_EVENT0("mojo_shell", "Context::Shutdown");
221 // Post a task in case OnShutdownComplete is called synchronously. 221 // Post a task in case OnShutdownComplete is called synchronously.
222 base::MessageLoop::current()->task_runner()->PostTask( 222 base::ThreadTaskRunnerHandle::Get()->PostTask(
223 FROM_HERE, base::Bind(mojo::edk::ShutdownIPCSupport)); 223 FROM_HERE, base::Bind(mojo::edk::ShutdownIPCSupport));
224 // We'll quit when we get OnShutdownComplete(). 224 // We'll quit when we get OnShutdownComplete().
225 base::RunLoop().Run(); 225 base::RunLoop().Run();
226 } 226 }
227 227
228 void Context::OnShutdownComplete() { 228 void Context::OnShutdownComplete() {
229 DCHECK_EQ(base::ThreadTaskRunnerHandle::Get(), service_manager_runner_); 229 DCHECK_EQ(base::ThreadTaskRunnerHandle::Get(), service_manager_runner_);
230 base::MessageLoop::current()->QuitWhenIdle(); 230 base::MessageLoop::current()->QuitWhenIdle();
231 } 231 }
232 232
(...skipping 20 matching lines...) Expand all
253 mojom::InterfaceProviderPtr local_interfaces; 253 mojom::InterfaceProviderPtr local_interfaces;
254 254
255 std::unique_ptr<ConnectParams> params(new ConnectParams); 255 std::unique_ptr<ConnectParams> params(new ConnectParams);
256 params->set_source(CreateServiceManagerIdentity()); 256 params->set_source(CreateServiceManagerIdentity());
257 params->set_target(Identity(name, mojom::kRootUserID)); 257 params->set_target(Identity(name, mojom::kRootUserID));
258 params->set_remote_interfaces(mojo::GetProxy(&remote_interfaces)); 258 params->set_remote_interfaces(mojo::GetProxy(&remote_interfaces));
259 service_manager_->Connect(std::move(params)); 259 service_manager_->Connect(std::move(params));
260 } 260 }
261 261
262 } // namespace shell 262 } // namespace shell
OLDNEW
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | services/shell/standalone/tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698