diff options
-rw-r--r-- | extensions/browser/api/alarms/alarms_api_unittest.cc | 2 | ||||
-rw-r--r-- | extensions/browser/api_test_utils.cc | 2 | ||||
-rw-r--r-- | extensions/browser/extension_icon_image_unittest.cc | 2 | ||||
-rw-r--r-- | extensions/browser/file_reader_unittest.cc | 2 | ||||
-rw-r--r-- | extensions/browser/image_loader_unittest.cc | 4 | ||||
-rw-r--r-- | extensions/browser/value_store/value_store_frontend_unittest.cc | 2 | ||||
-rw-r--r-- | extensions/shell/browser/shell_desktop_controller_aura.cc | 4 | ||||
-rw-r--r-- | extensions/test/extension_test_message_listener.cc | 2 | ||||
-rw-r--r-- | ipc/ipc_channel_posix_unittest.cc | 5 | ||||
-rw-r--r-- | ipc/ipc_fuzzing_tests.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_send_fds_test.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_test_channel_listener.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_test_sink.h | 2 | ||||
-rw-r--r-- | ipc/mojo/ipc_channel_mojo_unittest.cc | 20 | ||||
-rw-r--r-- | ipc/mojo/ipc_mojo_bootstrap_unittest.cc | 4 | ||||
-rw-r--r-- | ipc/sync_socket_unittest.cc | 6 |
16 files changed, 34 insertions, 35 deletions
diff --git a/extensions/browser/api/alarms/alarms_api_unittest.cc b/extensions/browser/api/alarms/alarms_api_unittest.cc index 61a469b..b08eed3 100644 --- a/extensions/browser/api/alarms/alarms_api_unittest.cc +++ b/extensions/browser/api/alarms/alarms_api_unittest.cc @@ -32,7 +32,7 @@ class AlarmDelegate : public AlarmManager::Delegate { void OnAlarm(const std::string& extension_id, const Alarm& alarm) override { alarms_seen.push_back(alarm.js_alarm->name); if (base::MessageLoop::current()->is_running()) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } std::vector<std::string> alarms_seen; diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc index 47bcb0e..83ed5fc 100644 --- a/extensions/browser/api_test_utils.cc +++ b/extensions/browser/api_test_utils.cc @@ -55,7 +55,7 @@ class SendResponseDelegate response_.reset(new bool); *response_ = success; if (should_post_quit_) { - base::MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->QuitWhenIdle(); } } diff --git a/extensions/browser/extension_icon_image_unittest.cc b/extensions/browser/extension_icon_image_unittest.cc index 29bb1ff..88c2fe4 100644 --- a/extensions/browser/extension_icon_image_unittest.cc +++ b/extensions/browser/extension_icon_image_unittest.cc @@ -129,7 +129,7 @@ class ExtensionIconImageTest : public ExtensionsTest, void OnExtensionIconImageChanged(IconImage* image) override { image_loaded_count_++; if (quit_in_image_loaded_) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } gfx::ImageSkia GetDefaultIcon() { diff --git a/extensions/browser/file_reader_unittest.cc b/extensions/browser/file_reader_unittest.cc index efd4367..5d40d31 100644 --- a/extensions/browser/file_reader_unittest.cc +++ b/extensions/browser/file_reader_unittest.cc @@ -45,7 +45,7 @@ class Receiver { void DidReadFile(bool success, const std::string& data) { succeeded_ = success; data_ = data; - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } bool succeeded_; diff --git a/extensions/browser/image_loader_unittest.cc b/extensions/browser/image_loader_unittest.cc index f1f2aad..530a006b 100644 --- a/extensions/browser/image_loader_unittest.cc +++ b/extensions/browser/image_loader_unittest.cc @@ -47,14 +47,14 @@ class ImageLoaderTest : public ExtensionsTest { void OnImageLoaded(const gfx::Image& image) { image_loaded_count_++; if (quit_in_image_loaded_) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); image_ = image; } void OnImageFamilyLoaded(const gfx::ImageFamily& image_family) { image_loaded_count_++; if (quit_in_image_loaded_) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); image_family_ = image_family; } diff --git a/extensions/browser/value_store/value_store_frontend_unittest.cc b/extensions/browser/value_store/value_store_frontend_unittest.cc index be65b7b..b3030f5 100644 --- a/extensions/browser/value_store/value_store_frontend_unittest.cc +++ b/extensions/browser/value_store/value_store_frontend_unittest.cc @@ -56,7 +56,7 @@ class ValueStoreFrontendTest : public testing::Test { void GetAndWait(scoped_ptr<base::Value>* output, scoped_ptr<base::Value> result) { *output = result.Pass(); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } scoped_ptr<ValueStoreFrontend> storage_; diff --git a/extensions/shell/browser/shell_desktop_controller_aura.cc b/extensions/shell/browser/shell_desktop_controller_aura.cc index f89714a..2cf78ef 100644 --- a/extensions/shell/browser/shell_desktop_controller_aura.cc +++ b/extensions/shell/browser/shell_desktop_controller_aura.cc @@ -246,8 +246,8 @@ void ShellDesktopControllerAura::OnHostCloseRequested( const aura::WindowTreeHost* host) { DCHECK_EQ(host_.get(), host); CloseAppWindows(); - base::MessageLoop::current()->PostTask(FROM_HERE, - base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); } void ShellDesktopControllerAura::InitWindowManager() { diff --git a/extensions/test/extension_test_message_listener.cc b/extensions/test/extension_test_message_listener.cc index a1970be..2712dc3c 100644 --- a/extensions/test/extension_test_message_listener.cc +++ b/extensions/test/extension_test_message_listener.cc @@ -110,7 +110,7 @@ void ExtensionTestMessageListener::Observe( if (waiting_) { waiting_ = false; - base::MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->QuitWhenIdle(); } } } diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc index 99bd68b..5dc4de4 100644 --- a/ipc/ipc_channel_posix_unittest.cc +++ b/ipc/ipc_channel_posix_unittest.cc @@ -89,7 +89,7 @@ class IPCChannelPosixTestListener : public IPC::Listener { loop->QuitNow(); } else { // Die as soon as Run is called. - loop->task_runner()->PostTask(FROM_HERE, loop->QuitClosure()); + loop->task_runner()->PostTask(FROM_HERE, loop->QuitWhenIdleClosure()); } } @@ -189,7 +189,8 @@ void IPCChannelPosixTest::SpinRunLoop(base::TimeDelta delay) { // in the case of a bad test. Usually, the run loop will quit sooner than // that because all tests use a IPCChannelPosixTestListener which quits the // current run loop on any channel activity. - loop->task_runner()->PostDelayedTask(FROM_HERE, loop->QuitClosure(), delay); + loop->task_runner()->PostDelayedTask(FROM_HERE, loop->QuitWhenIdleClosure(), + delay); loop->Run(); } diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc index 769922d..7f89308 100644 --- a/ipc/ipc_fuzzing_tests.cc +++ b/ipc/ipc_fuzzing_tests.cc @@ -185,7 +185,7 @@ class FuzzerServerListener : public SimpleListener { --message_count_; --pending_messages_; if (0 == message_count_) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } void ReplyMsgNotHandled(uint32_t type_id) { @@ -212,7 +212,7 @@ class FuzzerClientListener : public SimpleListener { bool OnMessageReceived(const IPC::Message& msg) override { last_msg_ = new IPC::Message(msg); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); return true; } diff --git a/ipc/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc index 22965da..a3b4d4e 100644 --- a/ipc/ipc_send_fds_test.cc +++ b/ipc/ipc_send_fds_test.cc @@ -73,7 +73,7 @@ class MyChannelDescriptorListener : public MyChannelDescriptorListenerBase { } void OnChannelError() override { - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } protected: @@ -96,7 +96,7 @@ class MyChannelDescriptorListener : public MyChannelDescriptorListenerBase { ++num_fds_received_; if (num_fds_received_ == kNumFDsToSend * kNumMessages) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } private: diff --git a/ipc/ipc_test_channel_listener.cc b/ipc/ipc_test_channel_listener.cc index 7d1832d..4d25ca3 100644 --- a/ipc/ipc_test_channel_listener.cc +++ b/ipc/ipc_test_channel_listener.cc @@ -49,12 +49,12 @@ bool TestChannelListener::OnMessageReceived(const IPC::Message& message) { void TestChannelListener::OnChannelError() { // There is a race when closing the channel so the last message may be lost. EXPECT_LE(messages_left_, 1); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } void TestChannelListener::SendNextMessage() { if (--messages_left_ <= 0) - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); else SendOneMessage(sender_, "Foo"); } diff --git a/ipc/ipc_test_sink.h b/ipc/ipc_test_sink.h index 5539c98..d964498 100644 --- a/ipc/ipc_test_sink.h +++ b/ipc/ipc_test_sink.h @@ -59,7 +59,7 @@ class Message; // public: // virtual bool OnMessageReceived(const IPC::Message& msg) { // <do something with the message> -// MessageLoop::current()->Quit(); +// MessageLoop::current()->QuitWhenIdle(); // return false; // to store the message in the sink, or true to drop it // } // }; diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc index 58d3e9f..f1982533 100644 --- a/ipc/mojo/ipc_channel_mojo_unittest.cc +++ b/ipc/mojo/ipc_channel_mojo_unittest.cc @@ -44,7 +44,7 @@ class ListenerThatExpectsOK : public IPC::Listener { EXPECT_TRUE(iter.ReadString(&should_be_ok)); EXPECT_EQ(should_be_ok, "OK"); received_ok_ = true; - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); return true; } @@ -202,14 +202,14 @@ class ListenerExpectingErrors : public IPC::Listener { } void OnChannelConnected(int32_t peer_pid) override { - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } bool OnMessageReceived(const IPC::Message& message) override { return true; } void OnChannelError() override { has_error_ = true; - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } bool has_error() const { return has_error_; } @@ -244,7 +244,7 @@ class ListenerThatQuits : public IPC::Listener { } void OnChannelConnected(int32_t peer_pid) override { - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } }; @@ -394,7 +394,7 @@ class ListenerThatExpectsMessagePipe : public IPC::Listener { bool OnMessageReceived(const IPC::Message& message) override { base::PickleIterator iter(message); HandleSendingHelper::ReadReceivedPipe(message, &iter); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); ListenerThatExpectsOK::SendOK(sender_); return true; } @@ -478,7 +478,7 @@ class ListenerThatExpectsMessagePipeUsingParamTrait : public IPC::Listener { MojoClose(handle.value()); } - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); ListenerThatExpectsOK::SendOK(sender_); return true; } @@ -597,7 +597,7 @@ class ListenerSendingOneOk : public IPC::Listener { void OnChannelConnected(int32_t peer_pid) override { ListenerThatExpectsOK::SendOK(sender_); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } void set_sender(IPC::Sender* sender) { sender_ = sender; } @@ -686,7 +686,7 @@ class ListenerThatExpectsFile : public IPC::Listener { bool OnMessageReceived(const IPC::Message& message) override { base::PickleIterator iter(message); HandleSendingHelper::ReadReceivedFile(message, &iter); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); ListenerThatExpectsOK::SendOK(sender_); return true; } @@ -751,7 +751,7 @@ class ListenerThatExpectsFileAndPipe : public IPC::Listener { base::PickleIterator iter(message); HandleSendingHelper::ReadReceivedFile(message, &iter); HandleSendingHelper::ReadReceivedPipe(message, &iter); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); ListenerThatExpectsOK::SendOK(sender_); return true; } @@ -816,7 +816,7 @@ class ListenerThatVerifiesPeerPid : public IPC::Listener { public: void OnChannelConnected(int32_t peer_pid) override { EXPECT_EQ(peer_pid, kMagicChildId); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } bool OnMessageReceived(const IPC::Message& message) override { diff --git a/ipc/mojo/ipc_mojo_bootstrap_unittest.cc b/ipc/mojo/ipc_mojo_bootstrap_unittest.cc index 528c235..391e953 100644 --- a/ipc/mojo/ipc_mojo_bootstrap_unittest.cc +++ b/ipc/mojo/ipc_mojo_bootstrap_unittest.cc @@ -37,11 +37,11 @@ void TestingDelegate::OnPipeAvailable( mojo::embedder::ScopedPlatformHandle handle, int32 peer_pid) { passed_ = true; - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } void TestingDelegate::OnBootstrapError() { - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } // Times out on Android; see http://crbug.com/502290 diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc index 9bf19dd..7184761 100644 --- a/ipc/sync_socket_unittest.cc +++ b/ipc/sync_socket_unittest.cc @@ -95,9 +95,7 @@ class SyncSocketServerListener : public IPC::Listener { // When the client responds, it sends back a shutdown message, // which causes the message loop to exit. - void OnMsgClassShutdown() { - base::MessageLoop::current()->Quit(); - } + void OnMsgClassShutdown() { base::MessageLoop::current()->QuitWhenIdle(); } IPC::Channel* chan_; @@ -153,7 +151,7 @@ class SyncSocketClientListener : public IPC::Listener { EXPECT_EQ(0U, socket_->Peek()); IPC::Message* msg = new MsgClassShutdown(); EXPECT_TRUE(chan_->Send(msg)); - base::MessageLoop::current()->Quit(); + base::MessageLoop::current()->QuitWhenIdle(); } base::SyncSocket* socket_; |