diff --git a/mojo/android/javatests/mojo_test_case.cc b/mojo/android/javatests/mojo_test_case.cc index f958d7c0d72b58..22a08ff674fcd2 100644 --- a/mojo/android/javatests/mojo_test_case.cc +++ b/mojo/android/javatests/mojo_test_case.cc @@ -54,8 +54,7 @@ static void RunLoop(JNIEnv* env, base::RunLoop run_loop; if (timeout_ms) { base::MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::MessageLoop::QuitClosure(), + FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), base::TimeDelta::FromMilliseconds(timeout_ms)); run_loop.Run(); } else { diff --git a/mojo/android/system/base_run_loop.cc b/mojo/android/system/base_run_loop.cc index df78561b27de3d..e48d2f0e019947 100644 --- a/mojo/android/system/base_run_loop.cc +++ b/mojo/android/system/base_run_loop.cc @@ -39,7 +39,7 @@ static void RunUntilIdle(JNIEnv* env, static void Quit(JNIEnv* env, const JavaParamRef& jcaller, jlong runLoopID) { - reinterpret_cast(runLoopID)->Quit(); + reinterpret_cast(runLoopID)->QuitWhenIdle(); } static void RunJavaRunnable( diff --git a/mojo/application/public/cpp/lib/application_impl.cc b/mojo/application/public/cpp/lib/application_impl.cc index 7ea8834bd17ee5..aecd61cdd5b56b 100644 --- a/mojo/application/public/cpp/lib/application_impl.cc +++ b/mojo/application/public/cpp/lib/application_impl.cc @@ -20,7 +20,7 @@ namespace { void DefaultTerminationClosure() { if (base::MessageLoop::current() && base::MessageLoop::current()->is_running()) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } } // namespace diff --git a/mojo/runner/android/background_application_loader_unittest.cc b/mojo/runner/android/background_application_loader_unittest.cc index ac24ae5054309b..f99e44c3c31e95 100644 --- a/mojo/runner/android/background_application_loader_unittest.cc +++ b/mojo/runner/android/background_application_loader_unittest.cc @@ -20,7 +20,7 @@ class DummyLoader : public shell::ApplicationLoader { void Load(const GURL& url, InterfaceRequest application_request) override { if (simulate_app_quit_) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } void DontSimulateAppQuit() { simulate_app_quit_ = false; } diff --git a/mojo/runner/context.cc b/mojo/runner/context.cc index f1bb1a468ae26b..462ed84d350d84 100644 --- a/mojo/runner/context.cc +++ b/mojo/runner/context.cc @@ -259,7 +259,7 @@ void Context::Shutdown() { void Context::OnShutdownComplete() { DCHECK_EQ(base::MessageLoop::current()->task_runner(), task_runners_->shell_runner()); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } void Context::Run(const GURL& url) { @@ -302,7 +302,7 @@ void Context::OnApplicationEnd(const GURL& url) { DCHECK_EQ(base::MessageLoop::current()->task_runner(), task_runners_->shell_runner()); if (app_complete_callback_.is_null()) { - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } else { app_complete_callback_.Run(); } diff --git a/mojo/runner/native_runner_unittest.cc b/mojo/runner/native_runner_unittest.cc index d75373841c8fdb..b2516b0547942d 100644 --- a/mojo/runner/native_runner_unittest.cc +++ b/mojo/runner/native_runner_unittest.cc @@ -33,7 +33,7 @@ class TestNativeRunner : public shell::NativeRunner { ~TestNativeRunner() override { state_->runner_was_destroyed = true; if (base::MessageLoop::current()->is_running()) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } void Start(const base::FilePath& app_path, bool start_sandboxed, diff --git a/mojo/runner/shell_apptest.cc b/mojo/runner/shell_apptest.cc index 13ddf36e7b8339..f0eb95cf1afdcf 100644 --- a/mojo/runner/shell_apptest.cc +++ b/mojo/runner/shell_apptest.cc @@ -124,7 +124,7 @@ TEST_F(ShellHTTPAppTest, Http) { EXPECT_EQ(GetURL("app"), app_url); EXPECT_EQ(GetURL("app"), connection_url); EXPECT_EQ("hello", message); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); }); base::RunLoop().Run(); } @@ -140,7 +140,7 @@ TEST_F(ShellHTTPAppTest, Redirect) { EXPECT_EQ(GetURL("app"), app_url); EXPECT_EQ(GetURL("app"), connection_url); EXPECT_EQ("hello", message); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); }); base::RunLoop().Run(); } @@ -169,7 +169,7 @@ TEST_F(ShellHTTPAppTest, MAYBE_QueryHandling) { EXPECT_EQ(GetURL("app?foo"), connection_url); } else if (num_responses == 2) { EXPECT_EQ(GetURL("app?bar"), connection_url); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } else { CHECK(false); } @@ -189,7 +189,7 @@ TEST_F(ShellAppTest, MojoURLQueryHandling) { base::CompareCase::SENSITIVE)); EXPECT_EQ(app_url.To() + "?foo", connection_url); EXPECT_EQ("hello", message); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); }; pingable->Ping("hello", callback); base::RunLoop().Run(); diff --git a/mojo/services/test_service/test_service_application.cc b/mojo/services/test_service/test_service_application.cc index 2c1569c89cb3c6..7fd16fadbe5b59 100644 --- a/mojo/services/test_service/test_service_application.cc +++ b/mojo/services/test_service/test_service_application.cc @@ -53,7 +53,7 @@ void TestServiceApplication::ReleaseRef() { assert(ref_count_ > 0); ref_count_--; if (ref_count_ <= 0) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } } // namespace test diff --git a/mojo/shell/application_manager_unittest.cc b/mojo/shell/application_manager_unittest.cc index 058240cee61817..e13f616f5573d6 100644 --- a/mojo/shell/application_manager_unittest.cc +++ b/mojo/shell/application_manager_unittest.cc @@ -54,7 +54,7 @@ class TestServiceImpl : public TestService { --context_->num_impls; if (!base::MessageLoop::current()->is_running()) return; - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } // TestService implementation: @@ -76,7 +76,7 @@ class TestClient { void AckTest() { if (quit_after_ack_) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } void Test(const std::string& test_string) { @@ -268,7 +268,7 @@ class TestAImpl : public TestA { } void Quit() { - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); test_context_->set_a_called_quit(); test_context_->QuitSoon(); } @@ -291,7 +291,7 @@ class TestBImpl : public TestB { ~TestBImpl() override { test_context_->IncrementNumBDeletes(); if (base::MessageLoop::current()->is_running()) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); test_context_->QuitSoon(); } @@ -351,7 +351,7 @@ class Tester : public ApplicationDelegate, requestor_url_ != connection->GetRemoteApplicationURL()) { context_->set_tester_called_quit(); context_->QuitSoon(); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); return false; } // If we're coming from A, then add B, otherwise A. diff --git a/mojo/shell/capability_filter_test.cc b/mojo/shell/capability_filter_test.cc index f8d0349e64608b..b50f7174dd817f 100644 --- a/mojo/shell/capability_filter_test.cc +++ b/mojo/shell/capability_filter_test.cc @@ -83,12 +83,12 @@ class ConnectionValidator : public ApplicationLoader, if (i != expectations_.end()) { expectations_.erase(i); if (expectations_.empty()) - loop_->Quit(); + loop_->QuitWhenIdle(); } else { // This is a test failure, and will result in PrintUnexpectedExpecations() // being called. unexpected_.insert(result); - loop_->Quit(); + loop_->QuitWhenIdle(); } }