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

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

Issue 1402533003: Don't use base::MessageLoop::{Quit,QuitClosure} in mojo/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/runner/context.h" 5 #include "mojo/runner/context.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 DCHECK_EQ(base::MessageLoop::current()->task_runner(), 252 DCHECK_EQ(base::MessageLoop::current()->task_runner(),
253 task_runners_->shell_runner()); 253 task_runners_->shell_runner());
254 embedder::ShutdownIPCSupport(); 254 embedder::ShutdownIPCSupport();
255 // We'll quit when we get OnShutdownComplete(). 255 // We'll quit when we get OnShutdownComplete().
256 base::MessageLoop::current()->Run(); 256 base::MessageLoop::current()->Run();
257 } 257 }
258 258
259 void Context::OnShutdownComplete() { 259 void Context::OnShutdownComplete() {
260 DCHECK_EQ(base::MessageLoop::current()->task_runner(), 260 DCHECK_EQ(base::MessageLoop::current()->task_runner(),
261 task_runners_->shell_runner()); 261 task_runners_->shell_runner());
262 base::MessageLoop::current()->Quit(); 262 base::MessageLoop::current()->QuitWhenIdle();
263 } 263 }
264 264
265 void Context::Run(const GURL& url) { 265 void Context::Run(const GURL& url) {
266 DCHECK(app_complete_callback_.is_null()); 266 DCHECK(app_complete_callback_.is_null());
267 ServiceProviderPtr services; 267 ServiceProviderPtr services;
268 ServiceProviderPtr exposed_services; 268 ServiceProviderPtr exposed_services;
269 269
270 app_urls_.insert(url); 270 app_urls_.insert(url);
271 271
272 scoped_ptr<shell::ConnectToApplicationParams> params( 272 scoped_ptr<shell::ConnectToApplicationParams> params(
(...skipping 22 matching lines...) Expand all
295 } 295 }
296 } 296 }
297 297
298 void Context::OnApplicationEnd(const GURL& url) { 298 void Context::OnApplicationEnd(const GURL& url) {
299 if (app_urls_.find(url) != app_urls_.end()) { 299 if (app_urls_.find(url) != app_urls_.end()) {
300 app_urls_.erase(url); 300 app_urls_.erase(url);
301 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { 301 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) {
302 DCHECK_EQ(base::MessageLoop::current()->task_runner(), 302 DCHECK_EQ(base::MessageLoop::current()->task_runner(),
303 task_runners_->shell_runner()); 303 task_runners_->shell_runner());
304 if (app_complete_callback_.is_null()) { 304 if (app_complete_callback_.is_null()) {
305 base::MessageLoop::current()->Quit(); 305 base::MessageLoop::current()->QuitWhenIdle();
306 } else { 306 } else {
307 app_complete_callback_.Run(); 307 app_complete_callback_.Run();
308 } 308 }
309 } 309 }
310 } 310 }
311 } 311 }
312 312
313 } // namespace runner 313 } // namespace runner
314 } // namespace mojo 314 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/runner/android/background_application_loader_unittest.cc ('k') | mojo/runner/native_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698