dbus: Use base::MessageLoop.

BUG=236029
[email protected]

Review URL: https://chromiumcodereview.appspot.com/14386016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197629 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/dbus/bus.cc b/dbus/bus.cc
index cfc833d..ea0497d 100644
--- a/dbus/bus.cc
+++ b/dbus/bus.cc
@@ -50,23 +50,19 @@
     const int file_descriptor = dbus_watch_get_unix_fd(raw_watch_);
     const int flags = dbus_watch_get_flags(raw_watch_);
 
-    MessageLoopForIO::Mode mode = MessageLoopForIO::WATCH_READ;
+    base::MessageLoopForIO::Mode mode = base::MessageLoopForIO::WATCH_READ;
     if ((flags & DBUS_WATCH_READABLE) && (flags & DBUS_WATCH_WRITABLE))
-      mode = MessageLoopForIO::WATCH_READ_WRITE;
+      mode = base::MessageLoopForIO::WATCH_READ_WRITE;
     else if (flags & DBUS_WATCH_READABLE)
-      mode = MessageLoopForIO::WATCH_READ;
+      mode = base::MessageLoopForIO::WATCH_READ;
     else if (flags & DBUS_WATCH_WRITABLE)
-      mode = MessageLoopForIO::WATCH_WRITE;
+      mode = base::MessageLoopForIO::WATCH_WRITE;
     else
       NOTREACHED();
 
     const bool persistent = true;  // Watch persistently.
-    const bool success = MessageLoopForIO::current()->WatchFileDescriptor(
-        file_descriptor,
-        persistent,
-        mode,
-        &file_descriptor_watcher_,
-        this);
+    const bool success = base::MessageLoopForIO::current()->WatchFileDescriptor(
+        file_descriptor, persistent, mode, &file_descriptor_watcher_, this);
     CHECK(success) << "Unable to allocate memory";
   }
 
@@ -196,8 +192,8 @@
   dbus_threads_init_default();
   // The origin message loop is unnecessary if the client uses synchronous
   // functions only.
-  if (MessageLoop::current())
-    origin_task_runner_ =  MessageLoop::current()->message_loop_proxy();
+  if (base::MessageLoop::current())
+    origin_task_runner_ = base::MessageLoop::current()->message_loop_proxy();
 }
 
 Bus::~Bus() {
diff --git a/dbus/bus_unittest.cc b/dbus/bus_unittest.cc
index a288d53..82949d3 100644
--- a/dbus/bus_unittest.cc
+++ b/dbus/bus_unittest.cc
@@ -87,11 +87,11 @@
 
 TEST(BusTest, RemoveObjectProxy) {
   // Setup the current thread's MessageLoop.
-  MessageLoop message_loop;
+  base::MessageLoop message_loop;
 
   // Start the D-Bus thread.
   base::Thread::Options thread_options;
-  thread_options.message_loop_type = MessageLoop::TYPE_IO;
+  thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
   base::Thread dbus_thread("D-Bus thread");
   dbus_thread.StartWithOptions(thread_options);
 
@@ -171,7 +171,7 @@
 TEST(BusTest, UnregisterExportedObject) {
   // Start the D-Bus thread.
   base::Thread::Options thread_options;
-  thread_options.message_loop_type = MessageLoop::TYPE_IO;
+  thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
   base::Thread dbus_thread("D-Bus thread");
   dbus_thread.StartWithOptions(thread_options);
 
@@ -221,7 +221,7 @@
 TEST(BusTest, ShutdownAndBlockWithDBusThread) {
   // Start the D-Bus thread.
   base::Thread::Options thread_options;
-  thread_options.message_loop_type = MessageLoop::TYPE_IO;
+  thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
   base::Thread dbus_thread("D-Bus thread");
   dbus_thread.StartWithOptions(thread_options);
 
diff --git a/dbus/end_to_end_async_unittest.cc b/dbus/end_to_end_async_unittest.cc
index 7ef17254..210431f 100644
--- a/dbus/end_to_end_async_unittest.cc
+++ b/dbus/end_to_end_async_unittest.cc
@@ -41,7 +41,7 @@
     // Start the D-Bus thread.
     dbus_thread_.reset(new base::Thread("D-Bus Thread"));
     base::Thread::Options thread_options;
-    thread_options.message_loop_type = MessageLoop::TYPE_IO;
+    thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
     ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
 
     // Start the test service, using the D-Bus thread.
@@ -253,7 +253,7 @@
     message_loop_.Run();
   }
 
-  MessageLoop message_loop_;
+  base::MessageLoop message_loop_;
   std::vector<std::string> response_strings_;
   std::vector<std::string> error_names_;
   scoped_ptr<base::Thread> dbus_thread_;
@@ -537,7 +537,7 @@
                             dbus::ObjectProxy::EmptyResponseCallback());
   // Post a delayed task to quit the message loop.
   message_loop_.PostDelayedTask(FROM_HERE,
-                                MessageLoop::QuitClosure(),
+                                base::MessageLoop::QuitClosure(),
                                 TestTimeouts::tiny_timeout());
   message_loop_.Run();
   // We cannot tell if the empty callback is called, but at least we can
diff --git a/dbus/mock_unittest.cc b/dbus/mock_unittest.cc
index f860082..c12a3832 100644
--- a/dbus/mock_unittest.cc
+++ b/dbus/mock_unittest.cc
@@ -77,7 +77,7 @@
 
  protected:
   std::string response_string_;
-  MessageLoop message_loop_;
+  base::MessageLoop message_loop_;
   scoped_refptr<dbus::MockBus> mock_bus_;
   scoped_refptr<dbus::MockObjectProxy> mock_proxy_;
 
diff --git a/dbus/object_manager_unittest.cc b/dbus/object_manager_unittest.cc
index 9f86bc9..3033b20 100644
--- a/dbus/object_manager_unittest.cc
+++ b/dbus/object_manager_unittest.cc
@@ -64,7 +64,7 @@
     // Start the D-Bus thread.
     dbus_thread_.reset(new base::Thread("D-Bus Thread"));
     base::Thread::Options thread_options;
-    thread_options.message_loop_type = MessageLoop::TYPE_IO;
+    thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
     ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
 
     // Start the test service, using the D-Bus thread.
@@ -176,7 +176,7 @@
     WaitForMethodCallback();
   }
 
-  MessageLoop message_loop_;
+  base::MessageLoop message_loop_;
   scoped_ptr<base::Thread> dbus_thread_;
   scoped_refptr<dbus::Bus> bus_;
   dbus::ObjectManager* object_manager_;
diff --git a/dbus/property_unittest.cc b/dbus/property_unittest.cc
index 98b5cfc..ed5bfc3 100644
--- a/dbus/property_unittest.cc
+++ b/dbus/property_unittest.cc
@@ -51,7 +51,7 @@
     // Start the D-Bus thread.
     dbus_thread_.reset(new base::Thread("D-Bus Thread"));
     base::Thread::Options thread_options;
-    thread_options.message_loop_type = MessageLoop::TYPE_IO;
+    thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
     ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
 
     // Start the test service, using the D-Bus thread.
@@ -136,7 +136,7 @@
     }
   }
 
-  MessageLoop message_loop_;
+  base::MessageLoop message_loop_;
   scoped_ptr<base::Thread> dbus_thread_;
   scoped_refptr<dbus::Bus> bus_;
   dbus::ObjectProxy* object_proxy_;
diff --git a/dbus/signal_sender_verification_unittest.cc b/dbus/signal_sender_verification_unittest.cc
index 2f2eb44c..ca9cb82d 100644
--- a/dbus/signal_sender_verification_unittest.cc
+++ b/dbus/signal_sender_verification_unittest.cc
@@ -34,7 +34,7 @@
     // Start the D-Bus thread.
     dbus_thread_.reset(new base::Thread("D-Bus Thread"));
     base::Thread::Options thread_options;
-    thread_options.message_loop_type = MessageLoop::TYPE_IO;
+    thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
     ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
 
     // Create the client, using the D-Bus thread.
@@ -152,7 +152,7 @@
     message_loop_.Run();
   }
 
-  MessageLoop message_loop_;
+  base::MessageLoop message_loop_;
   scoped_ptr<base::Thread> dbus_thread_;
   scoped_refptr<dbus::Bus> bus_;
   dbus::ObjectProxy* object_proxy_;
diff --git a/dbus/test_server.cc b/dbus/test_server.cc
index 0c5cc756..88f751f 100644
--- a/dbus/test_server.cc
+++ b/dbus/test_server.cc
@@ -15,7 +15,7 @@
 
   base::Thread* dbus_thread = new base::Thread("D-Bus Thread");
   base::Thread::Options thread_options;
-  thread_options.message_loop_type = MessageLoop::TYPE_IO;
+  thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
   CHECK(dbus_thread->StartWithOptions(thread_options));
 
   dbus::TestService::Options options;
diff --git a/dbus/test_service.cc b/dbus/test_service.cc
index 4b739bf..c41d445 100644
--- a/dbus/test_service.cc
+++ b/dbus/test_service.cc
@@ -46,7 +46,7 @@
 
 bool TestService::StartService() {
   base::Thread::Options thread_options;
-  thread_options.message_loop_type = MessageLoop::TYPE_IO;
+  thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
   return StartWithOptions(thread_options);
 }
 
@@ -153,7 +153,7 @@
     on_all_methods_exported_.Signal();
 }
 
-void TestService::Run(MessageLoop* message_loop) {
+void TestService::Run(base::MessageLoop* message_loop) {
   Bus::Options bus_options;
   bus_options.bus_type = Bus::SESSION;
   bus_options.connection_type = Bus::PRIVATE;
diff --git a/dbus/test_service.h b/dbus/test_service.h
index b9e14b5..765a630 100644
--- a/dbus/test_service.h
+++ b/dbus/test_service.h
@@ -99,7 +99,7 @@
                   bool success);
 
   // base::Thread override.
-  virtual void Run(MessageLoop* message_loop) OVERRIDE;
+  virtual void Run(base::MessageLoop* message_loop) OVERRIDE;
 
   //
   // Exported methods.