Revert of base: Remove use of MessageLoopProxy (patchset #6 id:100001 of https://codereview.chromium.org/1100773004/)

Reason for revert:
This CL caused this failure:
http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/2126

I would strongly recommend doing this in smaller pieces since it combines mechanical changes with more subtle ones (base/prefs, base/task).

Original issue's description:
> base: Remove use of MessageLoopProxy
>
> Replace usage of MessageLoopProxy under base/ with SingleThreadTaskRunner
> and ThreadTaskRunnerHandle (excluding the implementation of MessageLoopProxy
> itself which will removed later).
>
> This patch was mostly autogenerated with
> https://codereview.chromium.org/1010073002.
>
> Depends on https://codereview.chromium.org/1086733002/.
>
> BUG=465354
> TBR=nkostylev@chromium.org,pkasting@chromium.org,pauljensen@chromium.org
>
> Committed: https://crrev.com/62aa5ca413e15738ebebbb9acd271138ec808739
> Cr-Commit-Position: refs/heads/master@{#327512}

TBR=danakj@chromium.org,skyostil@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=465354

Review URL: https://codereview.chromium.org/1113953002

Cr-Commit-Position: refs/heads/master@{#327573}


CrOS-Libchrome-Original-Commit: 7669182866d8605d98a5141f7b82be3b516799ca
diff --git a/base/android/application_status_listener_unittest.cc b/base/android/application_status_listener_unittest.cc
index ce78bf9..1049628 100644
--- a/base/android/application_status_listener_unittest.cc
+++ b/base/android/application_status_listener_unittest.cc
@@ -7,7 +7,7 @@
 #include "base/callback_forward.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/run_loop.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/thread.h"
@@ -49,8 +49,9 @@
   void Run() {
     // Start the thread and tell it to register for events.
     thread_.Start();
-    thread_.task_runner()->PostTask(
-        FROM_HERE, base::Bind(&MultiThreadedTest::RegisterThreadForEvents,
+    thread_.message_loop()
+        ->PostTask(FROM_HERE,
+                   base::Bind(&MultiThreadedTest::RegisterThreadForEvents,
                               base::Unretained(this)));
 
     // Wait for its completion.
diff --git a/base/async_socket_io_handler_unittest.cc b/base/async_socket_io_handler_unittest.cc
index 721de9c..2b0e3c2 100644
--- a/base/async_socket_io_handler_unittest.cc
+++ b/base/async_socket_io_handler_unittest.cc
@@ -5,9 +5,6 @@
 #include "base/async_socket_io_handler.h"
 
 #include "base/bind.h"
-#include "base/location.h"
-#include "base/single_thread_task_runner.h"
-#include "base/thread_task_runner_handle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
@@ -107,8 +104,8 @@
   TestSocketReader reader(&pair[0], -1, false, false);
 
   pair[1].Send(kAsyncSocketIoTestString, kAsyncSocketIoTestStringLength);
-  base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, base::MessageLoop::QuitClosure(),
+  base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
+      base::MessageLoop::QuitClosure(),
       base::TimeDelta::FromMilliseconds(100));
   base::MessageLoop::current()->Run();
 
@@ -138,15 +135,15 @@
   // Issue sends on an interval to satisfy the Read() requirements.
   int64 milliseconds = 0;
   for (int i = 0; i < kReadOperationCount; ++i) {
-    base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-        FROM_HERE, base::Bind(&SendData, &pair[1], kAsyncSocketIoTestString,
-                              kAsyncSocketIoTestStringLength),
+    base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
+        base::Bind(&SendData, &pair[1], kAsyncSocketIoTestString,
+            kAsyncSocketIoTestStringLength),
         base::TimeDelta::FromMilliseconds(milliseconds));
     milliseconds += 10;
   }
 
-  base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, base::MessageLoop::QuitClosure(),
+  base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
+      base::MessageLoop::QuitClosure(),
       base::TimeDelta::FromMilliseconds(100 + milliseconds));
 
   base::MessageLoop::current()->Run();
diff --git a/base/bind_helpers.h b/base/bind_helpers.h
index 24063ad..c49b5b8 100644
--- a/base/bind_helpers.h
+++ b/base/bind_helpers.h
@@ -129,7 +129,7 @@
 // Passed() is particularly useful with PostTask() when you are transferring
 // ownership of an argument into a task, but don't necessarily know if the
 // task will always be executed. This can happen if the task is cancellable
-// or if it is posted to a TaskRunner.
+// or if it is posted to a MessageLoopProxy.
 //
 //
 // SIMPLE FUNCTIONS AND UTILITIES.
diff --git a/base/cancelable_callback_unittest.cc b/base/cancelable_callback_unittest.cc
index 6d0a114..fcbe23c 100644
--- a/base/cancelable_callback_unittest.cc
+++ b/base/cancelable_callback_unittest.cc
@@ -6,11 +6,9 @@
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
-#include "base/location.h"
 #include "base/memory/ref_counted.h"
+#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
-#include "base/thread_task_runner_handle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace base {
@@ -167,12 +165,12 @@
   CancelableClosure cancelable(base::Bind(&Increment,
                                            base::Unretained(&count)));
 
-  ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, cancelable.callback());
+  MessageLoop::current()->PostTask(FROM_HERE, cancelable.callback());
   RunLoop().RunUntilIdle();
 
   EXPECT_EQ(1, count);
 
-  ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, cancelable.callback());
+  MessageLoop::current()->PostTask(FROM_HERE, cancelable.callback());
 
   // Cancel before running the message loop.
   cancelable.Cancel();
diff --git a/base/chromeos/memory_pressure_monitor_chromeos.cc b/base/chromeos/memory_pressure_monitor_chromeos.cc
index 78f78ea..404c515 100644
--- a/base/chromeos/memory_pressure_monitor_chromeos.cc
+++ b/base/chromeos/memory_pressure_monitor_chromeos.cc
@@ -7,10 +7,10 @@
 #include <fcntl.h>
 #include <sys/select.h>
 
+#include "base/message_loop/message_loop.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/posix/eintr_wrapper.h"
 #include "base/process/process_metrics.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/time/time.h"
 
 namespace base {
@@ -120,9 +120,10 @@
 }
 
 void MemoryPressureMonitorChromeOS::ScheduleEarlyCheck() {
-  ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE, Bind(&MemoryPressureMonitorChromeOS::CheckMemoryPressure,
-                      weak_ptr_factory_.GetWeakPtr()));
+  MessageLoop::current()->PostTask(
+      FROM_HERE,
+      Bind(&MemoryPressureMonitorChromeOS::CheckMemoryPressure,
+           weak_ptr_factory_.GetWeakPtr()));
 }
 
 MemoryPressureListener::MemoryPressureLevel
diff --git a/base/critical_closure.h b/base/critical_closure.h
index 75e3704..ac07911 100644
--- a/base/critical_closure.h
+++ b/base/critical_closure.h
@@ -52,7 +52,7 @@
 // returned.
 //
 // Example:
-//   file_task_runner_->PostTask(
+//   file_message_loop_proxy_->PostTask(
 //       FROM_HERE,
 //       MakeCriticalClosure(base::Bind(&WriteToDiskTask, path_, data)));
 //
diff --git a/base/deferred_sequenced_task_runner_unittest.cc b/base/deferred_sequenced_task_runner_unittest.cc
index 6e17ad9..81f2a0a 100644
--- a/base/deferred_sequenced_task_runner_unittest.cc
+++ b/base/deferred_sequenced_task_runner_unittest.cc
@@ -7,9 +7,9 @@
 #include "base/basictypes.h"
 #include "base/bind.h"
 #include "base/bind_helpers.h"
-#include "base/location.h"
 #include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/threading/non_thread_safe.h"
 #include "base/threading/thread.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -58,9 +58,11 @@
   }
 
  protected:
-  DeferredSequencedTaskRunnerTest()
-      : loop_(),
-        runner_(new base::DeferredSequencedTaskRunner(loop_.task_runner())) {}
+  DeferredSequencedTaskRunnerTest() :
+      loop_(),
+      runner_(
+          new base::DeferredSequencedTaskRunner(loop_.message_loop_proxy())) {
+  }
 
   base::MessageLoop loop_;
   scoped_refptr<base::DeferredSequencedTaskRunner> runner_;
@@ -124,18 +126,21 @@
     thread1.Start();
     thread2.Start();
     for (int i = 0; i < 5; ++i) {
-      thread1.task_runner()->PostTask(
+      thread1.message_loop()->PostTask(
           FROM_HERE,
           base::Bind(&DeferredSequencedTaskRunnerTest::PostExecuteTask,
-                     base::Unretained(this), 2 * i));
-      thread2.task_runner()->PostTask(
+                     base::Unretained(this),
+                     2 * i));
+      thread2.message_loop()->PostTask(
           FROM_HERE,
           base::Bind(&DeferredSequencedTaskRunnerTest::PostExecuteTask,
-                     base::Unretained(this), 2 * i + 1));
+                     base::Unretained(this),
+                     2 * i + 1));
       if (i == 2) {
-        thread1.task_runner()->PostTask(
-            FROM_HERE, base::Bind(&DeferredSequencedTaskRunnerTest::StartRunner,
-                                  base::Unretained(this)));
+        thread1.message_loop()->PostTask(
+            FROM_HERE,
+            base::Bind(&DeferredSequencedTaskRunnerTest::StartRunner,
+                       base::Unretained(this)));
       }
     }
   }
@@ -149,7 +154,8 @@
   {
     base::Thread thread("DeferredSequencedTaskRunnerTestThread");
     thread.Start();
-    runner_ = new base::DeferredSequencedTaskRunner(thread.task_runner());
+    runner_ =
+        new base::DeferredSequencedTaskRunner(thread.message_loop_proxy());
     for (int i = 0; i < 5; ++i) {
       {
         // Use a block to ensure that no reference to |short_lived_object|
diff --git a/base/files/file_path_watcher.h b/base/files/file_path_watcher.h
index 4f132af..d26fa06 100644
--- a/base/files/file_path_watcher.h
+++ b/base/files/file_path_watcher.h
@@ -12,7 +12,7 @@
 #include "base/callback.h"
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop_proxy.h"
 
 namespace base {
 
@@ -58,13 +58,12 @@
     // check |is_cancelled()| to avoid duplicate work.
     virtual void CancelOnMessageLoopThread() = 0;
 
-    scoped_refptr<base::SingleThreadTaskRunner> task_runner() const {
-      return task_runner_;
+    scoped_refptr<base::MessageLoopProxy> message_loop() const {
+      return message_loop_;
     }
 
-    void set_task_runner(
-        scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
-      task_runner_ = task_runner.Pass();
+    void set_message_loop(const scoped_refptr<base::MessageLoopProxy>& loop) {
+      message_loop_ = loop;
     }
 
     // Must be called before the PlatformDelegate is deleted.
@@ -77,7 +76,7 @@
     }
 
    private:
-    scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+    scoped_refptr<base::MessageLoopProxy> message_loop_;
     bool cancelled_;
   };
 
diff --git a/base/files/file_path_watcher_fsevents.cc b/base/files/file_path_watcher_fsevents.cc
index da01c43..ef4e6ee 100644
--- a/base/files/file_path_watcher_fsevents.cc
+++ b/base/files/file_path_watcher_fsevents.cc
@@ -13,7 +13,6 @@
 #include "base/mac/libdispatch_task_runner.h"
 #include "base/mac/scoped_cftyperef.h"
 #include "base/message_loop/message_loop.h"
-#include "base/thread_task_runner_handle.h"
 
 namespace base {
 
@@ -93,7 +92,7 @@
   if (!recursive)
     return false;
 
-  set_task_runner(ThreadTaskRunnerHandle::Get());
+  set_message_loop(MessageLoopProxy::current());
   callback_ = callback;
 
   FSEventStreamEventId start_event = FSEventsGetCurrentEventId();
@@ -153,7 +152,7 @@
 }
 
 FilePathWatcherFSEvents::~FilePathWatcherFSEvents() {
-  // This method may be called on either the libdispatch or task_runner()
+  // This method may be called on either the libdispatch or message_loop()
   // thread. Checking callback_ on the libdispatch thread here is safe because
   // it is executing in a task posted by Cancel() which first reset callback_.
   // PostTask forms a sufficient memory barrier to ensure that the value is
@@ -166,7 +165,7 @@
     const std::vector<FilePath>& paths) {
   DCHECK(g_task_runner.Get().RunsTasksOnCurrentThread());
   DCHECK(!resolved_target_.empty());
-  task_runner()->PostTask(
+  message_loop()->PostTask(
       FROM_HERE, Bind(&FilePathWatcherFSEvents::DispatchEvents, this, paths,
                       target_, resolved_target_));
 }
@@ -174,7 +173,7 @@
 void FilePathWatcherFSEvents::DispatchEvents(const std::vector<FilePath>& paths,
                                              const FilePath& target,
                                              const FilePath& resolved_target) {
-  DCHECK(task_runner()->RunsTasksOnCurrentThread());
+  DCHECK(message_loop()->RunsTasksOnCurrentThread());
 
   // Don't issue callbacks after Cancel() has been called.
   if (is_cancelled() || callback_.is_null()) {
@@ -191,7 +190,7 @@
 
 void FilePathWatcherFSEvents::CancelOnMessageLoopThread() {
   // For all other implementations, the "message loop thread" is the IO thread,
-  // as returned by task_runner(). This implementation, however, needs to
+  // as returned by message_loop(). This implementation, however, needs to
   // cancel pending work on the Dispatch Queue thread.
   DCHECK(g_task_runner.Get().RunsTasksOnCurrentThread());
 
@@ -240,7 +239,7 @@
                                 g_task_runner.Get().GetDispatchQueue());
 
   if (!FSEventStreamStart(fsevent_stream_)) {
-    task_runner()->PostTask(
+    message_loop()->PostTask(
         FROM_HERE, Bind(&FilePathWatcherFSEvents::ReportError, this, target_));
   }
 }
@@ -251,14 +250,14 @@
   bool changed = resolved != resolved_target_;
   resolved_target_ = resolved;
   if (resolved_target_.empty()) {
-    task_runner()->PostTask(
+    message_loop()->PostTask(
         FROM_HERE, Bind(&FilePathWatcherFSEvents::ReportError, this, target_));
   }
   return changed;
 }
 
 void FilePathWatcherFSEvents::ReportError(const FilePath& target) {
-  DCHECK(task_runner()->RunsTasksOnCurrentThread());
+  DCHECK(message_loop()->RunsTasksOnCurrentThread());
   if (!callback_.is_null()) {
     callback_.Run(target, true);
   }
diff --git a/base/files/file_path_watcher_kqueue.cc b/base/files/file_path_watcher_kqueue.cc
index e15cba7..8941d2e 100644
--- a/base/files/file_path_watcher_kqueue.cc
+++ b/base/files/file_path_watcher_kqueue.cc
@@ -11,7 +11,6 @@
 #include "base/files/file_util.h"
 #include "base/logging.h"
 #include "base/strings/stringprintf.h"
-#include "base/thread_task_runner_handle.h"
 
 // On some platforms these are not defined.
 #if !defined(EV_RECEIPT)
@@ -328,7 +327,7 @@
   target_ = path;
 
   MessageLoop::current()->AddDestructionObserver(this);
-  io_task_runner_ = ThreadTaskRunnerHandle::Get();
+  io_message_loop_ = base::MessageLoopProxy::current();
 
   kqueue_ = kqueue();
   if (kqueue_ == -1) {
@@ -357,14 +356,14 @@
 }
 
 void FilePathWatcherKQueue::Cancel() {
-  SingleThreadTaskRunner* task_runner = io_task_runner_.get();
-  if (!task_runner) {
+  base::MessageLoopProxy* proxy = io_message_loop_.get();
+  if (!proxy) {
     set_cancelled();
     return;
   }
-  if (!task_runner->BelongsToCurrentThread()) {
-    task_runner->PostTask(FROM_HERE,
-                          base::Bind(&FilePathWatcherKQueue::Cancel, this));
+  if (!proxy->BelongsToCurrentThread()) {
+    proxy->PostTask(FROM_HERE,
+                    base::Bind(&FilePathWatcherKQueue::Cancel, this));
     return;
   }
   CancelOnMessageLoopThread();
@@ -381,7 +380,7 @@
     kqueue_ = -1;
     std::for_each(events_.begin(), events_.end(), ReleaseEvent);
     events_.clear();
-    io_task_runner_ = NULL;
+    io_message_loop_ = NULL;
     MessageLoop::current()->RemoveDestructionObserver(this);
     callback_.Reset();
   }
diff --git a/base/files/file_path_watcher_kqueue.h b/base/files/file_path_watcher_kqueue.h
index 69555a3..87af891 100644
--- a/base/files/file_path_watcher_kqueue.h
+++ b/base/files/file_path_watcher_kqueue.h
@@ -11,7 +11,7 @@
 #include "base/files/file_path.h"
 #include "base/files/file_path_watcher.h"
 #include "base/message_loop/message_loop.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop_proxy.h"
 
 namespace base {
 
@@ -59,7 +59,7 @@
 
   typedef std::vector<struct kevent> EventVector;
 
-  // Can only be called on |io_task_runner_|'s thread.
+  // Can only be called on |io_message_loop_|'s thread.
   void CancelOnMessageLoopThread() override;
 
   // Returns true if the kevent values are error free.
@@ -118,7 +118,7 @@
   }
 
   EventVector events_;
-  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+  scoped_refptr<base::MessageLoopProxy> io_message_loop_;
   MessageLoopForIO::FileDescriptorWatcher kqueue_watcher_;
   FilePathWatcher::Callback callback_;
   FilePath target_;
diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc
index ba2f1d9..06c517a 100644
--- a/base/files/file_path_watcher_linux.cc
+++ b/base/files/file_path_watcher_linux.cc
@@ -26,10 +26,10 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/posix/eintr_wrapper.h"
-#include "base/single_thread_task_runner.h"
 #include "base/synchronization/lock.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/threading/thread.h"
 #include "base/trace_event/trace_event.h"
 
@@ -264,7 +264,7 @@
   shutdown_pipe_[0] = -1;
   shutdown_pipe_[1] = -1;
   if (inotify_fd_ >= 0 && pipe(shutdown_pipe_) == 0 && thread_.Start()) {
-    thread_.task_runner()->PostTask(
+    thread_.message_loop()->PostTask(
         FROM_HERE,
         Bind(&InotifyReaderCallback, this, inotify_fd_, shutdown_pipe_[0]));
     valid_ = true;
@@ -349,11 +349,12 @@
                                             bool created,
                                             bool deleted,
                                             bool is_dir) {
-  if (!task_runner()->BelongsToCurrentThread()) {
-    // Switch to task_runner() to access |watches_| safely.
-    task_runner()->PostTask(FROM_HERE,
-                            Bind(&FilePathWatcherImpl::OnFilePathChanged, this,
-                                 fired_watch, child, created, deleted, is_dir));
+  if (!message_loop()->BelongsToCurrentThread()) {
+    // Switch to message_loop() to access |watches_| safely.
+    message_loop()->PostTask(
+        FROM_HERE,
+        Bind(&FilePathWatcherImpl::OnFilePathChanged, this,
+             fired_watch, child, created, deleted, is_dir));
     return;
   }
 
@@ -451,7 +452,7 @@
   DCHECK(target_.empty());
   DCHECK(MessageLoopForIO::current());
 
-  set_task_runner(ThreadTaskRunnerHandle::Get());
+  set_message_loop(MessageLoopProxy::current());
   callback_ = callback;
   target_ = path;
   recursive_ = recursive;
@@ -475,16 +476,17 @@
   }
 
   // Switch to the message_loop() if necessary so we can access |watches_|.
-  if (!task_runner()->BelongsToCurrentThread()) {
-    task_runner()->PostTask(FROM_HERE, Bind(&FilePathWatcher::CancelWatch,
-                                            make_scoped_refptr(this)));
+  if (!message_loop()->BelongsToCurrentThread()) {
+    message_loop()->PostTask(FROM_HERE,
+                             Bind(&FilePathWatcher::CancelWatch,
+                                  make_scoped_refptr(this)));
   } else {
     CancelOnMessageLoopThread();
   }
 }
 
 void FilePathWatcherImpl::CancelOnMessageLoopThread() {
-  DCHECK(task_runner()->BelongsToCurrentThread());
+  DCHECK(message_loop()->BelongsToCurrentThread());
   set_cancelled();
 
   if (!callback_.is_null()) {
@@ -508,7 +510,7 @@
 void FilePathWatcherImpl::UpdateWatches() {
   // Ensure this runs on the message_loop() exclusively in order to avoid
   // concurrency issues.
-  DCHECK(task_runner()->BelongsToCurrentThread());
+  DCHECK(message_loop()->BelongsToCurrentThread());
   DCHECK(HasValidWatchVector());
 
   // Walk the list of watches and update them as we go.
diff --git a/base/files/file_path_watcher_unittest.cc b/base/files/file_path_watcher_unittest.cc
index 21e9dd1..0e1c467 100644
--- a/base/files/file_path_watcher_unittest.cc
+++ b/base/files/file_path_watcher_unittest.cc
@@ -20,15 +20,14 @@
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/location.h"
+#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
 #include "base/stl_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/test/test_file_util.h"
 #include "base/test/test_timeouts.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/threading/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -47,13 +46,14 @@
 class NotificationCollector
     : public base::RefCountedThreadSafe<NotificationCollector> {
  public:
-  NotificationCollector() : task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
+  NotificationCollector()
+      : loop_(base::MessageLoopProxy::current()) {}
 
   // Called from the file thread by the delegates.
   void OnChange(TestDelegate* delegate) {
-    task_runner_->PostTask(
-        FROM_HERE, base::Bind(&NotificationCollector::RecordChange, this,
-                              base::Unretained(delegate)));
+    loop_->PostTask(FROM_HERE,
+                    base::Bind(&NotificationCollector::RecordChange, this,
+                               base::Unretained(delegate)));
   }
 
   void Register(TestDelegate* delegate) {
@@ -74,13 +74,13 @@
 
   void RecordChange(TestDelegate* delegate) {
     // Warning: |delegate| is Unretained. Do not dereference.
-    ASSERT_TRUE(task_runner_->BelongsToCurrentThread());
+    ASSERT_TRUE(loop_->BelongsToCurrentThread());
     ASSERT_TRUE(delegates_.count(delegate));
     signaled_.insert(delegate);
 
     // Check whether all delegates have been signaled.
     if (signaled_ == delegates_)
-      task_runner_->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
+      loop_->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
   }
 
   // Set of registered delegates.
@@ -90,7 +90,7 @@
   std::set<TestDelegate*> signaled_;
 
   // The loop we should break after all delegates signaled.
-  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+  scoped_refptr<base::MessageLoopProxy> loop_;
 };
 
 class TestDelegateBase : public SupportsWeakPtr<TestDelegateBase> {
@@ -171,7 +171,7 @@
   void TearDown() override { RunLoop().RunUntilIdle(); }
 
   void DeleteDelegateOnFileThread(TestDelegate* delegate) {
-    file_thread_.task_runner()->DeleteSoon(FROM_HERE, delegate);
+    file_thread_.message_loop_proxy()->DeleteSoon(FROM_HERE, delegate);
   }
 
   FilePath test_file() {
@@ -216,9 +216,10 @@
                                      bool recursive_watch) {
   base::WaitableEvent completion(false, false);
   bool result;
-  file_thread_.task_runner()->PostTask(
-      FROM_HERE, base::Bind(SetupWatchCallback, target, watcher, delegate,
-                            recursive_watch, &result, &completion));
+  file_thread_.message_loop_proxy()->PostTask(
+      FROM_HERE,
+      base::Bind(SetupWatchCallback, target, watcher, delegate, recursive_watch,
+                 &result, &completion));
   completion.Wait();
   return result;
 }
@@ -288,8 +289,7 @@
 
   void OnFileChanged(const FilePath&, bool) override {
     watcher_.reset();
-    loop_->task_runner()->PostTask(FROM_HERE,
-                                   MessageLoop::QuitWhenIdleClosure());
+    loop_->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
   }
 
   FilePathWatcher* watcher() const { return watcher_.get(); }
@@ -324,7 +324,7 @@
   FilePathWatcher* watcher = new FilePathWatcher;
   ASSERT_TRUE(SetupWatch(test_file(), watcher, delegate.get(), false));
   ASSERT_TRUE(WriteFile(test_file(), "content"));
-  file_thread_.task_runner()->DeleteSoon(FROM_HERE, watcher);
+  file_thread_.message_loop_proxy()->DeleteSoon(FROM_HERE, watcher);
   DeleteDelegateOnFileThread(delegate.release());
 }
 
diff --git a/base/files/file_proxy.cc b/base/files/file_proxy.cc
index f995735..53b14fe 100644
--- a/base/files/file_proxy.cc
+++ b/base/files/file_proxy.cc
@@ -9,6 +9,7 @@
 #include "base/files/file.h"
 #include "base/files/file_util.h"
 #include "base/location.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/task_runner.h"
 #include "base/task_runner_util.h"
 
diff --git a/base/files/file_proxy_unittest.cc b/base/files/file_proxy_unittest.cc
index df0bbc8..dbf1476 100644
--- a/base/files/file_proxy_unittest.cc
+++ b/base/files/file_proxy_unittest.cc
@@ -9,6 +9,7 @@
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop.h"
 #include "base/threading/thread.h"
 #include "base/threading/thread_restrictions.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -78,7 +79,7 @@
   }
 
   TaskRunner* file_task_runner() const {
-    return file_thread_.task_runner().get();
+    return file_thread_.message_loop_proxy().get();
   }
   const FilePath& test_dir_path() const { return dir_.path(); }
   const FilePath test_path() const { return dir_.path().AppendASCII("test"); }
diff --git a/base/files/file_util_proxy_unittest.cc b/base/files/file_util_proxy_unittest.cc
index 7408369..5eb6819 100644
--- a/base/files/file_util_proxy_unittest.cc
+++ b/base/files/file_util_proxy_unittest.cc
@@ -8,6 +8,7 @@
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop.h"
 #include "base/threading/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -39,7 +40,7 @@
 
  protected:
   TaskRunner* file_task_runner() const {
-    return file_thread_.task_runner().get();
+    return file_thread_.message_loop_proxy().get();
   }
   const FilePath& test_dir_path() const { return dir_.path(); }
   const FilePath test_path() const { return dir_.path().AppendASCII("test"); }
diff --git a/base/files/important_file_writer.cc b/base/files/important_file_writer.cc
index 814fc7b..f49790c 100644
--- a/base/files/important_file_writer.cc
+++ b/base/files/important_file_writer.cc
@@ -130,7 +130,7 @@
       commit_interval_(TimeDelta::FromMilliseconds(kDefaultCommitIntervalMs)),
       weak_factory_(this) {
   DCHECK(CalledOnValidThread());
-  DCHECK(task_runner_);
+  DCHECK(task_runner_.get());
 }
 
 ImportantFileWriter::~ImportantFileWriter() {
diff --git a/base/files/important_file_writer_unittest.cc b/base/files/important_file_writer_unittest.cc
index d376cdc..170c2b2 100644
--- a/base/files/important_file_writer_unittest.cc
+++ b/base/files/important_file_writer_unittest.cc
@@ -9,11 +9,9 @@
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/location.h"
 #include "base/logging.h"
+#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/threading/thread.h"
 #include "base/time/time.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -99,7 +97,7 @@
 };
 
 TEST_F(ImportantFileWriterTest, Basic) {
-  ImportantFileWriter writer(file_, ThreadTaskRunnerHandle::Get());
+  ImportantFileWriter writer(file_, MessageLoopProxy::current().get());
   EXPECT_FALSE(PathExists(writer.path()));
   EXPECT_FALSE(successful_write_observer_.GetAndResetObservationState());
   writer.WriteNow(make_scoped_ptr(new std::string("foo")));
@@ -111,7 +109,7 @@
 }
 
 TEST_F(ImportantFileWriterTest, BasicWithSuccessfulWriteObserver) {
-  ImportantFileWriter writer(file_, ThreadTaskRunnerHandle::Get());
+  ImportantFileWriter writer(file_, MessageLoopProxy::current().get());
   EXPECT_FALSE(PathExists(writer.path()));
   EXPECT_FALSE(successful_write_observer_.GetAndResetObservationState());
   successful_write_observer_.ObserveNextSuccessfulWrite(&writer);
@@ -145,14 +143,15 @@
 }
 
 TEST_F(ImportantFileWriterTest, ScheduleWrite) {
-  ImportantFileWriter writer(file_, ThreadTaskRunnerHandle::Get());
+  ImportantFileWriter writer(file_, MessageLoopProxy::current().get());
   writer.set_commit_interval(TimeDelta::FromMilliseconds(25));
   EXPECT_FALSE(writer.HasPendingWrite());
   DataSerializer serializer("foo");
   writer.ScheduleWrite(&serializer);
   EXPECT_TRUE(writer.HasPendingWrite());
-  ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, MessageLoop::QuitWhenIdleClosure(),
+  MessageLoop::current()->PostDelayedTask(
+      FROM_HERE,
+      MessageLoop::QuitWhenIdleClosure(),
       TimeDelta::FromMilliseconds(100));
   MessageLoop::current()->Run();
   EXPECT_FALSE(writer.HasPendingWrite());
@@ -161,14 +160,15 @@
 }
 
 TEST_F(ImportantFileWriterTest, DoScheduledWrite) {
-  ImportantFileWriter writer(file_, ThreadTaskRunnerHandle::Get());
+  ImportantFileWriter writer(file_, MessageLoopProxy::current().get());
   EXPECT_FALSE(writer.HasPendingWrite());
   DataSerializer serializer("foo");
   writer.ScheduleWrite(&serializer);
   EXPECT_TRUE(writer.HasPendingWrite());
   writer.DoScheduledWrite();
-  ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, MessageLoop::QuitWhenIdleClosure(),
+  MessageLoop::current()->PostDelayedTask(
+      FROM_HERE,
+      MessageLoop::QuitWhenIdleClosure(),
       TimeDelta::FromMilliseconds(100));
   MessageLoop::current()->Run();
   EXPECT_FALSE(writer.HasPendingWrite());
@@ -177,14 +177,15 @@
 }
 
 TEST_F(ImportantFileWriterTest, BatchingWrites) {
-  ImportantFileWriter writer(file_, ThreadTaskRunnerHandle::Get());
+  ImportantFileWriter writer(file_, MessageLoopProxy::current().get());
   writer.set_commit_interval(TimeDelta::FromMilliseconds(25));
   DataSerializer foo("foo"), bar("bar"), baz("baz");
   writer.ScheduleWrite(&foo);
   writer.ScheduleWrite(&bar);
   writer.ScheduleWrite(&baz);
-  ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, MessageLoop::QuitWhenIdleClosure(),
+  MessageLoop::current()->PostDelayedTask(
+      FROM_HERE,
+      MessageLoop::QuitWhenIdleClosure(),
       TimeDelta::FromMilliseconds(100));
   MessageLoop::current()->Run();
   ASSERT_TRUE(PathExists(writer.path()));
diff --git a/base/memory/ref_counted_delete_on_message_loop.h b/base/memory/ref_counted_delete_on_message_loop.h
index 6a109e8..139a1ed 100644
--- a/base/memory/ref_counted_delete_on_message_loop.h
+++ b/base/memory/ref_counted_delete_on_message_loop.h
@@ -32,7 +32,6 @@
 //   ~Foo();
 // };
 
-// TODO(skyostil): Rename this to RefCountedDeleteOnTaskRunner.
 template <class T>
 class RefCountedDeleteOnMessageLoop : public subtle::RefCountedThreadSafeBase {
  public:
@@ -43,7 +42,7 @@
   RefCountedDeleteOnMessageLoop(
       const scoped_refptr<SingleThreadTaskRunner>& task_runner)
       : task_runner_(task_runner) {
-    DCHECK(task_runner_);
+    DCHECK(task_runner_.get());
   }
 
   void AddRef() const {
diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc
index 20e5c7b..d89a5c6 100644
--- a/base/memory/weak_ptr_unittest.cc
+++ b/base/memory/weak_ptr_unittest.cc
@@ -8,9 +8,8 @@
 
 #include "base/bind.h"
 #include "base/debug/leak_annotations.h"
-#include "base/location.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -26,8 +25,9 @@
     {
       Thread creator_thread("creator_thread");
       creator_thread.Start();
-      creator_thread.task_runner()->PostTask(
-          FROM_HERE, base::Bind(OffThreadObjectCreator::CreateObject, &result));
+      creator_thread.message_loop()->PostTask(
+          FROM_HERE,
+          base::Bind(OffThreadObjectCreator::CreateObject, &result));
     }
     DCHECK(result);  // We synchronized on thread destruction above.
     return result;
@@ -66,23 +66,25 @@
 
   void CreateArrowFromTarget(Arrow** arrow, Target* target) {
     WaitableEvent completion(true, false);
-    task_runner()->PostTask(
-        FROM_HERE, base::Bind(&BackgroundThread::DoCreateArrowFromTarget, arrow,
-                              target, &completion));
+    message_loop()->PostTask(
+        FROM_HERE,
+        base::Bind(&BackgroundThread::DoCreateArrowFromTarget,
+                   arrow, target, &completion));
     completion.Wait();
   }
 
   void CreateArrowFromArrow(Arrow** arrow, const Arrow* other) {
     WaitableEvent completion(true, false);
-    task_runner()->PostTask(
-        FROM_HERE, base::Bind(&BackgroundThread::DoCreateArrowFromArrow, arrow,
-                              other, &completion));
+    message_loop()->PostTask(
+        FROM_HERE,
+        base::Bind(&BackgroundThread::DoCreateArrowFromArrow,
+                   arrow, other, &completion));
     completion.Wait();
   }
 
   void DeleteTarget(Target* object) {
     WaitableEvent completion(true, false);
-    task_runner()->PostTask(
+    message_loop()->PostTask(
         FROM_HERE,
         base::Bind(&BackgroundThread::DoDeleteTarget, object, &completion));
     completion.Wait();
@@ -90,23 +92,25 @@
 
   void CopyAndAssignArrow(Arrow* object) {
     WaitableEvent completion(true, false);
-    task_runner()->PostTask(
-        FROM_HERE, base::Bind(&BackgroundThread::DoCopyAndAssignArrow, object,
-                              &completion));
+    message_loop()->PostTask(
+        FROM_HERE,
+        base::Bind(&BackgroundThread::DoCopyAndAssignArrow,
+                   object, &completion));
     completion.Wait();
   }
 
   void CopyAndAssignArrowBase(Arrow* object) {
     WaitableEvent completion(true, false);
-    task_runner()->PostTask(
-        FROM_HERE, base::Bind(&BackgroundThread::DoCopyAndAssignArrowBase,
-                              object, &completion));
+    message_loop()->PostTask(
+        FROM_HERE,
+        base::Bind(&BackgroundThread::DoCopyAndAssignArrowBase,
+                   object, &completion));
     completion.Wait();
   }
 
   void DeleteArrow(Arrow* object) {
     WaitableEvent completion(true, false);
-    task_runner()->PostTask(
+    message_loop()->PostTask(
         FROM_HERE,
         base::Bind(&BackgroundThread::DoDeleteArrow, object, &completion));
     completion.Wait();
@@ -115,8 +119,9 @@
   Target* DeRef(const Arrow* arrow) {
     WaitableEvent completion(true, false);
     Target* result = NULL;
-    task_runner()->PostTask(FROM_HERE, base::Bind(&BackgroundThread::DoDeRef,
-                                                  arrow, &result, &completion));
+    message_loop()->PostTask(
+        FROM_HERE,
+        base::Bind(&BackgroundThread::DoDeRef, arrow, &result, &completion));
     completion.Wait();
     return result;
   }
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h
index e0ce0da..5205a5a 100644
--- a/base/observer_list_threadsafe.h
+++ b/base/observer_list_threadsafe.h
@@ -14,10 +14,9 @@
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
 #include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/observer_list.h"
-#include "base/single_thread_task_runner.h"
 #include "base/stl_util.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/threading/platform_thread.h"
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -178,7 +177,7 @@
     base::AutoLock lock(list_lock_);
     for (const auto& entry : observer_lists_) {
       ObserverListContext* context = entry.second;
-      context->task_runner->PostTask(
+      context->loop->PostTask(
           from_here,
           base::Bind(
               &ObserverListThreadSafe<ObserverType>::template NotifyWrapper<
@@ -193,9 +192,11 @@
 
   struct ObserverListContext {
     explicit ObserverListContext(NotificationType type)
-        : task_runner(base::ThreadTaskRunnerHandle::Get()), list(type) {}
+        : loop(base::MessageLoopProxy::current()),
+          list(type) {
+    }
 
-    scoped_refptr<base::SingleThreadTaskRunner> task_runner;
+    scoped_refptr<base::MessageLoopProxy> loop;
     ObserverList<ObserverType> list;
 
    private:
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc
index 2e51e45..ea916b1 100644
--- a/base/observer_list_unittest.cc
+++ b/base/observer_list_unittest.cc
@@ -8,10 +8,9 @@
 #include <vector>
 
 #include "base/compiler_specific.h"
-#include "base/location.h"
 #include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
 #include "base/threading/platform_thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -108,7 +107,7 @@
 
   void ThreadMain() override {
     loop_ = new MessageLoop();  // Fire up a message loop.
-    loop_->task_runner()->PostTask(
+    loop_->PostTask(
         FROM_HERE,
         base::Bind(&AddRemoveThread::AddTask, weak_factory_.GetWeakPtr()));
     loop_->Run();
@@ -138,14 +137,13 @@
       list_->Notify(FROM_HERE, &Foo::Observe, 10);
     }
 
-    loop_->task_runner()->PostTask(
+    loop_->PostTask(
         FROM_HERE,
         base::Bind(&AddRemoveThread::AddTask, weak_factory_.GetWeakPtr()));
   }
 
   void Quit() {
-    loop_->task_runner()->PostTask(FROM_HERE,
-                                   MessageLoop::QuitWhenIdleClosure());
+    loop_->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
   }
 
   void Observe(int x) override {
diff --git a/base/posix/unix_domain_socket_linux_unittest.cc b/base/posix/unix_domain_socket_linux_unittest.cc
index c05141c..60b2bb8 100644
--- a/base/posix/unix_domain_socket_linux_unittest.cc
+++ b/base/posix/unix_domain_socket_linux_unittest.cc
@@ -10,11 +10,9 @@
 #include "base/bind_helpers.h"
 #include "base/files/file_util.h"
 #include "base/files/scoped_file.h"
-#include "base/location.h"
 #include "base/memory/scoped_vector.h"
 #include "base/pickle.h"
 #include "base/posix/unix_domain_socket_linux.h"
-#include "base/single_thread_task_runner.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -34,10 +32,11 @@
 
   // Have the thread send a synchronous message via the socket.
   Pickle request;
-  message_thread.task_runner()->PostTask(
+  message_thread.message_loop()->PostTask(
       FROM_HERE,
-      Bind(IgnoreResult(&UnixDomainSocket::SendRecvMsg), fds[1],
-           static_cast<uint8_t*>(NULL), 0U, static_cast<int*>(NULL), request));
+      Bind(IgnoreResult(&UnixDomainSocket::SendRecvMsg),
+           fds[1], static_cast<uint8_t*>(NULL), 0U, static_cast<int*>(NULL),
+           request));
 
   // Receive the message.
   ScopedVector<base::ScopedFD> message_fds;
@@ -52,8 +51,9 @@
 
   // Check that the thread didn't get blocked.
   WaitableEvent event(false, false);
-  message_thread.task_runner()->PostTask(
-      FROM_HERE, Bind(&WaitableEvent::Signal, Unretained(&event)));
+  message_thread.message_loop()->PostTask(
+      FROM_HERE,
+      Bind(&WaitableEvent::Signal, Unretained(&event)));
   ASSERT_TRUE(event.TimedWait(TimeDelta::FromMilliseconds(5000)));
 }
 
diff --git a/base/prefs/json_pref_store.h b/base/prefs/json_pref_store.h
index 1badcf2..d6ded59 100644
--- a/base/prefs/json_pref_store.h
+++ b/base/prefs/json_pref_store.h
@@ -17,6 +17,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/scoped_vector.h"
 #include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/observer_list.h"
 #include "base/prefs/base_prefs_export.h"
 #include "base/prefs/persistent_pref_store.h"
diff --git a/base/prefs/json_pref_store_unittest.cc b/base/prefs/json_pref_store_unittest.cc
index 728a57d..746c72b 100644
--- a/base/prefs/json_pref_store_unittest.cc
+++ b/base/prefs/json_pref_store_unittest.cc
@@ -7,7 +7,6 @@
 #include "base/bind.h"
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/location.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
@@ -16,7 +15,6 @@
 #include "base/path_service.h"
 #include "base/prefs/pref_filter.h"
 #include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
@@ -108,8 +106,7 @@
   void TearDown() override {
     // Make sure all pending tasks have been processed (e.g., deleting the
     // JsonPrefStore may post write tasks).
-    message_loop_.task_runner()->PostTask(FROM_HERE,
-                                          MessageLoop::QuitWhenIdleClosure());
+    message_loop_.PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
     message_loop_.Run();
   }
 
@@ -130,7 +127,9 @@
   base::FilePath bogus_input_file = data_dir_.AppendASCII("read.txt");
   ASSERT_FALSE(PathExists(bogus_input_file));
   scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      bogus_input_file, message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+      bogus_input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
   EXPECT_EQ(PersistentPrefStore::PREF_READ_ERROR_NO_FILE,
             pref_store->ReadPrefs());
   EXPECT_FALSE(pref_store->ReadOnly());
@@ -143,9 +142,11 @@
       data_dir_.AppendASCII("read_alternate.txt");
   ASSERT_FALSE(PathExists(bogus_input_file));
   ASSERT_FALSE(PathExists(bogus_alternate_input_file));
-  scoped_refptr<JsonPrefStore> pref_store =
-      new JsonPrefStore(bogus_input_file, bogus_alternate_input_file,
-                        message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+  scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
+      bogus_input_file,
+      bogus_alternate_input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
   EXPECT_EQ(PersistentPrefStore::PREF_READ_ERROR_NO_FILE,
             pref_store->ReadPrefs());
   EXPECT_FALSE(pref_store->ReadOnly());
@@ -156,8 +157,10 @@
   base::FilePath invalid_file_original = data_dir_.AppendASCII("invalid.json");
   base::FilePath invalid_file = temp_dir_.path().AppendASCII("invalid.json");
   ASSERT_TRUE(base::CopyFile(invalid_file_original, invalid_file));
-  scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      invalid_file, message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+  scoped_refptr<JsonPrefStore> pref_store =
+      new JsonPrefStore(invalid_file,
+                        message_loop_.message_loop_proxy().get(),
+                        scoped_ptr<PrefFilter>());
   EXPECT_EQ(PersistentPrefStore::PREF_READ_ERROR_JSON_PARSE,
             pref_store->ReadPrefs());
   EXPECT_FALSE(pref_store->ReadOnly());
@@ -243,7 +246,9 @@
   base::FilePath input_file = temp_dir_.path().AppendASCII("write.json");
   ASSERT_TRUE(PathExists(input_file));
   scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      input_file, message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+      input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
   ASSERT_EQ(PersistentPrefStore::PREF_READ_ERROR_NONE, pref_store->ReadPrefs());
   EXPECT_FALSE(pref_store->ReadOnly());
   EXPECT_TRUE(pref_store->IsInitializationComplete());
@@ -270,7 +275,9 @@
   base::FilePath input_file = temp_dir_.path().AppendASCII("write.json");
   ASSERT_TRUE(PathExists(input_file));
   scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      input_file, message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+      input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
 
   {
     MockPrefStoreObserver mock_observer;
@@ -307,7 +314,9 @@
   FilePath pref_file = temp_dir_.path().AppendASCII("empty_values.json");
 
   scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      pref_file, message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+      pref_file,
+      message_loop_.message_loop_proxy(),
+      scoped_ptr<PrefFilter>());
 
   // Set some keys with empty values.
   pref_store->SetValue("list", new base::ListValue);
@@ -318,8 +327,10 @@
   MessageLoop::current()->RunUntilIdle();
 
   // Reload.
-  pref_store = new JsonPrefStore(pref_file, message_loop_.task_runner(),
-                                 scoped_ptr<PrefFilter>());
+  pref_store = new JsonPrefStore(
+      pref_file,
+      message_loop_.message_loop_proxy(),
+      scoped_ptr<PrefFilter>());
   ASSERT_EQ(PersistentPrefStore::PREF_READ_ERROR_NONE, pref_store->ReadPrefs());
   ASSERT_FALSE(pref_store->ReadOnly());
 
@@ -337,7 +348,9 @@
   FilePath pref_file = temp_dir_.path().AppendASCII("empty_values.json");
 
   scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      pref_file, message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+      pref_file,
+      message_loop_.message_loop_proxy(),
+      scoped_ptr<PrefFilter>());
 
   base::DictionaryValue* dict = new base::DictionaryValue;
   dict->SetString("key", "value");
@@ -355,7 +368,9 @@
   base::FilePath bogus_input_file = data_dir_.AppendASCII("read.txt");
   ASSERT_FALSE(PathExists(bogus_input_file));
   scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      bogus_input_file, message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+      bogus_input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
   MockPrefStoreObserver mock_observer;
   pref_store->AddObserver(&mock_observer);
 
@@ -383,8 +398,10 @@
       new InterceptingPrefFilter());
   InterceptingPrefFilter* raw_intercepting_pref_filter_ =
       intercepting_pref_filter.get();
-  scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      input_file, message_loop_.task_runner(), intercepting_pref_filter.Pass());
+  scoped_refptr<JsonPrefStore> pref_store =
+      new JsonPrefStore(input_file,
+                        message_loop_.message_loop_proxy().get(),
+                        intercepting_pref_filter.Pass());
 
   ASSERT_EQ(PersistentPrefStore::PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE,
             pref_store->ReadPrefs());
@@ -428,8 +445,10 @@
       new InterceptingPrefFilter());
   InterceptingPrefFilter* raw_intercepting_pref_filter_ =
       intercepting_pref_filter.get();
-  scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
-      input_file, message_loop_.task_runner(), intercepting_pref_filter.Pass());
+  scoped_refptr<JsonPrefStore> pref_store =
+      new JsonPrefStore(input_file,
+                        message_loop_.message_loop_proxy().get(),
+                        intercepting_pref_filter.Pass());
 
   MockPrefStoreObserver mock_observer;
   pref_store->AddObserver(&mock_observer);
@@ -492,9 +511,11 @@
       temp_dir_.path().AppendASCII("alternate.json");
   ASSERT_FALSE(PathExists(input_file));
   ASSERT_TRUE(PathExists(alternate_input_file));
-  scoped_refptr<JsonPrefStore> pref_store =
-      new JsonPrefStore(input_file, alternate_input_file,
-                        message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+  scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
+      input_file,
+      alternate_input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
 
   ASSERT_FALSE(PathExists(input_file));
   ASSERT_TRUE(PathExists(alternate_input_file));
@@ -536,9 +557,11 @@
       temp_dir_.path().AppendASCII("alternate.json");
   ASSERT_TRUE(PathExists(input_file));
   ASSERT_TRUE(PathExists(alternate_input_file));
-  scoped_refptr<JsonPrefStore> pref_store =
-      new JsonPrefStore(input_file, alternate_input_file,
-                        message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+  scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
+      input_file,
+      alternate_input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
 
   ASSERT_TRUE(PathExists(input_file));
   ASSERT_TRUE(PathExists(alternate_input_file));
@@ -576,9 +599,11 @@
       temp_dir_.path().AppendASCII("alternate.json");
   ASSERT_TRUE(PathExists(input_file));
   ASSERT_FALSE(PathExists(alternate_input_file));
-  scoped_refptr<JsonPrefStore> pref_store =
-      new JsonPrefStore(input_file, alternate_input_file,
-                        message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+  scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
+      input_file,
+      alternate_input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
 
   ASSERT_TRUE(PathExists(input_file));
   ASSERT_FALSE(PathExists(alternate_input_file));
@@ -616,9 +641,11 @@
       temp_dir_.path().AppendASCII("alternate.json");
   ASSERT_FALSE(PathExists(input_file));
   ASSERT_TRUE(PathExists(alternate_input_file));
-  scoped_refptr<JsonPrefStore> pref_store =
-      new JsonPrefStore(input_file, alternate_input_file,
-                        message_loop_.task_runner(), scoped_ptr<PrefFilter>());
+  scoped_refptr<JsonPrefStore> pref_store = new JsonPrefStore(
+      input_file,
+      alternate_input_file,
+      message_loop_.message_loop_proxy().get(),
+      scoped_ptr<PrefFilter>());
 
   ASSERT_FALSE(PathExists(input_file));
   ASSERT_TRUE(PathExists(alternate_input_file));
diff --git a/base/prefs/pref_member.cc b/base/prefs/pref_member.cc
index 3097596..8d80dd0 100644
--- a/base/prefs/pref_member.cc
+++ b/base/prefs/pref_member.cc
@@ -7,10 +7,11 @@
 #include "base/callback.h"
 #include "base/callback_helpers.h"
 #include "base/location.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/prefs/pref_service.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/value_conversions.h"
 
+using base::MessageLoopProxy;
 using base::SingleThreadTaskRunner;
 
 namespace subtle {
@@ -51,7 +52,7 @@
 }
 
 void PrefMemberBase::MoveToThread(
-    scoped_refptr<SingleThreadTaskRunner> task_runner) {
+    const scoped_refptr<SingleThreadTaskRunner>& task_runner) {
   VerifyValuePrefName();
   // Load the value from preferences if it hasn't been loaded so far.
   if (!internal())
@@ -90,14 +91,15 @@
 }
 
 PrefMemberBase::Internal::Internal()
-    : thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
+    : thread_loop_(MessageLoopProxy::current()),
       is_managed_(false),
       is_user_modifiable_(false) {
 }
 PrefMemberBase::Internal::~Internal() { }
 
 bool PrefMemberBase::Internal::IsOnCorrectThread() const {
-  return thread_task_runner_->BelongsToCurrentThread();
+  // In unit tests, there may not be a message loop.
+  return thread_loop_.get() == NULL || thread_loop_->BelongsToCurrentThread();
 }
 
 void PrefMemberBase::Internal::UpdateValue(
@@ -113,18 +115,19 @@
     is_managed_ = is_managed;
     is_user_modifiable_ = is_user_modifiable;
   } else {
-    bool may_run = thread_task_runner_->PostTask(
-        FROM_HERE, base::Bind(&PrefMemberBase::Internal::UpdateValue, this,
-                              value.release(), is_managed, is_user_modifiable,
-                              closure_runner.Release()));
+    bool may_run = thread_loop_->PostTask(
+        FROM_HERE,
+        base::Bind(&PrefMemberBase::Internal::UpdateValue, this,
+                   value.release(), is_managed, is_user_modifiable,
+                   closure_runner.Release()));
     DCHECK(may_run);
   }
 }
 
 void PrefMemberBase::Internal::MoveToThread(
-    scoped_refptr<SingleThreadTaskRunner> task_runner) {
+    const scoped_refptr<SingleThreadTaskRunner>& task_runner) {
   CheckOnCorrectThread();
-  thread_task_runner_ = task_runner.Pass();
+  thread_loop_ = task_runner;
 }
 
 bool PrefMemberVectorStringUpdate(const base::Value& value,
diff --git a/base/prefs/pref_member.h b/base/prefs/pref_member.h
index 6dceb43..9b140d1 100644
--- a/base/prefs/pref_member.h
+++ b/base/prefs/pref_member.h
@@ -65,7 +65,8 @@
                      bool is_user_modifiable,
                      const base::Closure& callback) const;
 
-    void MoveToThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+    void MoveToThread(
+        const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
 
     // See PrefMember<> for description.
     bool IsManaged() const {
@@ -91,7 +92,7 @@
 
     bool IsOnCorrectThread() const;
 
-    scoped_refptr<base::SingleThreadTaskRunner> thread_task_runner_;
+    scoped_refptr<base::SingleThreadTaskRunner> thread_loop_;
     mutable bool is_managed_;
     mutable bool is_user_modifiable_;
 
@@ -112,7 +113,8 @@
   // See PrefMember<> for description.
   void Destroy();
 
-  void MoveToThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+  void MoveToThread(
+      const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
 
   // PrefObserver
   void OnPreferenceChanged(PrefService* service,
@@ -199,7 +201,8 @@
   // via PostTask.
   // This method should only be used from the thread the PrefMember is currently
   // on, which is the UI thread by default.
-  void MoveToThread(scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
+  void MoveToThread(
+      const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
     subtle::PrefMemberBase::MoveToThread(task_runner);
   }
 
diff --git a/base/prefs/pref_member_unittest.cc b/base/prefs/pref_member_unittest.cc
index a776e2c..435122b 100644
--- a/base/prefs/pref_member_unittest.cc
+++ b/base/prefs/pref_member_unittest.cc
@@ -5,10 +5,9 @@
 #include "base/prefs/pref_member.h"
 
 #include "base/bind.h"
-#include "base/location.h"
+#include "base/message_loop/message_loop.h"
 #include "base/prefs/pref_registry_simple.h"
 #include "base/prefs/testing_pref_service.h"
-#include "base/single_thread_task_runner.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -38,7 +37,7 @@
 
   void Init(const std::string& pref_name, PrefService* prefs) {
     pref_.Init(pref_name, prefs);
-    pref_.MoveToThread(pref_thread_.task_runner());
+    pref_.MoveToThread(pref_thread_.message_loop_proxy());
   }
 
   void Destroy() {
@@ -47,9 +46,10 @@
 
   void FetchValue() {
     base::WaitableEvent event(true, false);
-    ASSERT_TRUE(pref_thread_.task_runner()->PostTask(
-        FROM_HERE,
-        base::Bind(&GetPrefValueHelper::GetPrefValue, this, &event)));
+    ASSERT_TRUE(
+        pref_thread_.message_loop_proxy()->PostTask(
+            FROM_HERE,
+            base::Bind(&GetPrefValueHelper::GetPrefValue, this, &event)));
     event.Wait();
   }
 
@@ -100,11 +100,7 @@
 
 }  // anonymous namespace
 
-class PrefMemberTest : public testing::Test {
-  base::MessageLoop message_loop_;
-};
-
-TEST_F(PrefMemberTest, BasicGetAndSet) {
+TEST(PrefMemberTest, BasicGetAndSet) {
   TestingPrefServiceSimple prefs;
   RegisterTestPrefs(prefs.registry());
 
@@ -231,7 +227,7 @@
   EXPECT_EQ(expected_vector, *string_list);
 }
 
-TEST_F(PrefMemberTest, InvalidList) {
+TEST(PrefMemberTest, InvalidList) {
   // Set the vector to an initial good value.
   std::vector<std::string> expected_vector;
   expected_vector.push_back("foo");
@@ -249,7 +245,7 @@
   EXPECT_EQ(expected_vector, vector);
 }
 
-TEST_F(PrefMemberTest, TwoPrefs) {
+TEST(PrefMemberTest, TwoPrefs) {
   // Make sure two DoublePrefMembers stay in sync.
   TestingPrefServiceSimple prefs;
   RegisterTestPrefs(prefs.registry());
@@ -270,7 +266,7 @@
   EXPECT_EQ(4.2, *pref2);
 }
 
-TEST_F(PrefMemberTest, Observer) {
+TEST(PrefMemberTest, Observer) {
   TestingPrefServiceSimple prefs;
   RegisterTestPrefs(prefs.registry());
 
@@ -297,12 +293,12 @@
   EXPECT_EQ("hello", prefs.GetString(kStringPref));
 }
 
-TEST_F(PrefMemberTest, NoInit) {
+TEST(PrefMemberTest, NoInit) {
   // Make sure not calling Init on a PrefMember doesn't cause problems.
   IntegerPrefMember pref;
 }
 
-TEST_F(PrefMemberTest, MoveToThread) {
+TEST(PrefMemberTest, MoveToThread) {
   TestingPrefServiceSimple prefs;
   scoped_refptr<GetPrefValueHelper> helper(new GetPrefValueHelper());
   RegisterTestPrefs(prefs.registry());
diff --git a/base/prefs/pref_service.cc b/base/prefs/pref_service.cc
index 3ccdae7..5afb5ea 100644
--- a/base/prefs/pref_service.cc
+++ b/base/prefs/pref_service.cc
@@ -8,18 +8,16 @@
 
 #include "base/bind.h"
 #include "base/files/file_path.h"
-#include "base/location.h"
 #include "base/logging.h"
+#include "base/message_loop/message_loop.h"
 #include "base/metrics/histogram.h"
 #include "base/prefs/default_pref_store.h"
 #include "base/prefs/pref_notifier_impl.h"
 #include "base/prefs/pref_registry.h"
 #include "base/prefs/pref_value_store.h"
-#include "base/single_thread_task_runner.h"
 #include "base/stl_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/value_conversions.h"
 #include "build/build_config.h"
 
@@ -81,9 +79,10 @@
     read_error_callback_.Run(user_pref_store_->ReadPrefs());
   } else {
     // Guarantee that initialization happens after this function returned.
-    base::ThreadTaskRunnerHandle::Get()->PostTask(
+    base::MessageLoop::current()->PostTask(
         FROM_HERE,
-        base::Bind(&PersistentPrefStore::ReadPrefsAsync, user_pref_store_.get(),
+        base::Bind(&PersistentPrefStore::ReadPrefsAsync,
+                   user_pref_store_.get(),
                    new ReadErrorHandler(read_error_callback_)));
   }
 }
diff --git a/base/sequence_checker_unittest.cc b/base/sequence_checker_unittest.cc
index 0aa0f9c..9aae82c 100644
--- a/base/sequence_checker_unittest.cc
+++ b/base/sequence_checker_unittest.cc
@@ -9,8 +9,8 @@
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_loop.h"
 #include "base/sequence_checker.h"
-#include "base/single_thread_task_runner.h"
 #include "base/test/sequenced_worker_pool_owner.h"
 #include "base/threading/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -84,9 +84,10 @@
 
   void PostDoStuffToOtherThread(
       SequenceCheckedObject* sequence_checked_object) {
-    other_thread()->task_runner()->PostTask(
-        FROM_HERE, base::Bind(&SequenceCheckedObject::DoStuff,
-                              base::Unretained(sequence_checked_object)));
+    other_thread()->message_loop()->PostTask(
+        FROM_HERE,
+        base::Bind(&SequenceCheckedObject::DoStuff,
+                   base::Unretained(sequence_checked_object)));
   }
 
   void PostDeleteToOtherThread(
diff --git a/base/single_thread_task_runner.h b/base/single_thread_task_runner.h
index 6e93193..b5311db 100644
--- a/base/single_thread_task_runner.h
+++ b/base/single_thread_task_runner.h
@@ -16,8 +16,7 @@
 // there is a specific need to run tasks on only a single thread.
 //
 // SingleThreadTaskRunner implementations might:
-//   - Post tasks to an existing thread's MessageLoop (see
-//     MessageLoop::task_runner()).
+//   - Post tasks to an existing thread's MessageLoop (see MessageLoopProxy).
 //   - Create their own worker thread and MessageLoop to post tasks to.
 //   - Add tasks to a FIFO and signal to a non-MessageLoop thread for them to
 //     be processed. This allows TaskRunner-oriented code run on threads
diff --git a/base/synchronization/cancellation_flag_unittest.cc b/base/synchronization/cancellation_flag_unittest.cc
index 13c74bc..02b08b6 100644
--- a/base/synchronization/cancellation_flag_unittest.cc
+++ b/base/synchronization/cancellation_flag_unittest.cc
@@ -7,9 +7,8 @@
 #include "base/synchronization/cancellation_flag.h"
 
 #include "base/bind.h"
-#include "base/location.h"
 #include "base/logging.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop.h"
 #include "base/synchronization/spin_wait.h"
 #include "base/threading/thread.h"
 #include "base/time/time.h"
@@ -57,7 +56,7 @@
   ASSERT_TRUE(t.IsRunning());
 
   CancellationFlag flag;
-  t.task_runner()->PostTask(FROM_HERE, base::Bind(&CancelHelper, &flag));
+  t.message_loop()->PostTask(FROM_HERE, base::Bind(&CancelHelper, &flag));
 }
 
 }  // namespace
diff --git a/base/synchronization/condition_variable_unittest.cc b/base/synchronization/condition_variable_unittest.cc
index e63a723..5d7a0ab 100644
--- a/base/synchronization/condition_variable_unittest.cc
+++ b/base/synchronization/condition_variable_unittest.cc
@@ -9,10 +9,8 @@
 #include <vector>
 
 #include "base/bind.h"
-#include "base/location.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/single_thread_task_runner.h"
 #include "base/synchronization/condition_variable.h"
 #include "base/synchronization/lock.h"
 #include "base/synchronization/spin_wait.h"
@@ -222,7 +220,7 @@
 
   Thread thread("Helper");
   thread.Start();
-  thread.task_runner()->PostTask(FROM_HERE, base::Bind(&BackInTime, &lock));
+  thread.message_loop()->PostTask(FROM_HERE, base::Bind(&BackInTime, &lock));
 
   TimeTicks start = TimeTicks::Now();
   const TimeDelta kWaitTime = TimeDelta::FromMilliseconds(300);
diff --git a/base/synchronization/waitable_event_watcher_posix.cc b/base/synchronization/waitable_event_watcher_posix.cc
index ad66a4c..6fc337c 100644
--- a/base/synchronization/waitable_event_watcher_posix.cc
+++ b/base/synchronization/waitable_event_watcher_posix.cc
@@ -6,7 +6,7 @@
 
 #include "base/bind.h"
 #include "base/location.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop.h"
 #include "base/synchronization/lock.h"
 #include "base/synchronization/waitable_event.h"
 
@@ -68,7 +68,7 @@
   bool Fire(WaitableEvent* event) override {
     // Post the callback if we haven't been cancelled.
     if (!flag_->value()) {
-      message_loop_->task_runner()->PostTask(FROM_HERE, callback_);
+      message_loop_->PostTask(FROM_HERE, callback_);
     }
 
     // We are removed from the wait-list by the WaitableEvent itself. It only
@@ -158,7 +158,7 @@
 
     // No hairpinning - we can't call the delegate directly here. We have to
     // enqueue a task on the MessageLoop as normal.
-    current_ml->task_runner()->PostTask(FROM_HERE, internal_callback_);
+    current_ml->PostTask(FROM_HERE, internal_callback_);
     return true;
   }
 
diff --git a/base/task/cancelable_task_tracker.cc b/base/task/cancelable_task_tracker.cc
index a2e4799..b6e4b6a 100644
--- a/base/task/cancelable_task_tracker.cc
+++ b/base/task/cancelable_task_tracker.cc
@@ -11,10 +11,9 @@
 #include "base/compiler_specific.h"
 #include "base/location.h"
 #include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/synchronization/cancellation_flag.h"
 #include "base/task_runner.h"
-#include "base/thread_task_runner_handle.h"
 
 using base::Bind;
 using base::CancellationFlag;
@@ -86,7 +85,7 @@
   DCHECK(thread_checker_.CalledOnValidThread());
 
   // We need a MessageLoop to run reply.
-  DCHECK(base::ThreadTaskRunnerHandle::IsSet());
+  DCHECK(base::MessageLoopProxy::current().get());
 
   // Owned by reply callback below.
   CancellationFlag* flag = new CancellationFlag();
@@ -114,7 +113,7 @@
 CancelableTaskTracker::TaskId CancelableTaskTracker::NewTrackedTaskId(
     IsCanceledCallback* is_canceled_cb) {
   DCHECK(thread_checker_.CalledOnValidThread());
-  DCHECK(base::ThreadTaskRunnerHandle::IsSet());
+  DCHECK(base::MessageLoopProxy::current().get());
 
   TaskId id = next_id_;
   next_id_++;  // int64 is big enough that we ignore the potential overflow.
@@ -130,7 +129,7 @@
   // Will always run |untrack_and_delete_flag| on current MessageLoop.
   base::ScopedClosureRunner* untrack_and_delete_flag_runner =
       new base::ScopedClosureRunner(Bind(&RunOrPostToTaskRunner,
-                                         base::ThreadTaskRunnerHandle::Get(),
+                                         base::MessageLoopProxy::current(),
                                          untrack_and_delete_flag));
 
   *is_canceled_cb =
diff --git a/base/task/cancelable_task_tracker_unittest.cc b/base/task/cancelable_task_tracker_unittest.cc
index ff9e40b..8b2b86a 100644
--- a/base/task/cancelable_task_tracker_unittest.cc
+++ b/base/task/cancelable_task_tracker_unittest.cc
@@ -13,8 +13,8 @@
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
 #include "base/test/test_simple_task_runner.h"
 #include "base/threading/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -84,13 +84,15 @@
   Thread worker_thread("worker thread");
   ASSERT_TRUE(worker_thread.Start());
 
-  ignore_result(task_tracker_.PostTask(worker_thread.task_runner().get(),
+  ignore_result(task_tracker_.PostTask(worker_thread.message_loop_proxy().get(),
                                        FROM_HERE,
                                        MakeExpectedRunClosure(FROM_HERE)));
 
-  ignore_result(task_tracker_.PostTaskAndReply(
-      worker_thread.task_runner().get(), FROM_HERE,
-      MakeExpectedRunClosure(FROM_HERE), MakeExpectedRunClosure(FROM_HERE)));
+  ignore_result(
+      task_tracker_.PostTaskAndReply(worker_thread.message_loop_proxy().get(),
+                                     FROM_HERE,
+                                     MakeExpectedRunClosure(FROM_HERE),
+                                     MakeExpectedRunClosure(FROM_HERE)));
 
   CancelableTaskTracker::IsCanceledCallback is_canceled;
   ignore_result(task_tracker_.NewTrackedTaskId(&is_canceled));
@@ -164,9 +166,11 @@
   Thread worker_thread("worker thread");
   ASSERT_TRUE(worker_thread.Start());
 
-  CancelableTaskTracker::TaskId task_id = task_tracker_.PostTaskAndReply(
-      worker_thread.task_runner().get(), FROM_HERE, Bind(&DoNothing),
-      MakeExpectedNotRunClosure(FROM_HERE));
+  CancelableTaskTracker::TaskId task_id =
+      task_tracker_.PostTaskAndReply(worker_thread.message_loop_proxy().get(),
+                                     FROM_HERE,
+                                     Bind(&DoNothing),
+                                     MakeExpectedNotRunClosure(FROM_HERE));
   EXPECT_NE(CancelableTaskTracker::kBadTaskId, task_id);
 
   task_tracker_.TryCancel(task_id);
@@ -192,14 +196,14 @@
 
   Thread other_thread("other thread");
   ASSERT_TRUE(other_thread.Start());
-  other_thread.task_runner()->PostTask(
+  other_thread.message_loop_proxy()->PostTask(
       FROM_HERE, Bind(&ExpectIsCanceled, is_canceled, false));
   other_thread.Stop();
 
   task_tracker_.TryCancel(task_id);
 
   ASSERT_TRUE(other_thread.Start());
-  other_thread.task_runner()->PostTask(
+  other_thread.message_loop_proxy()->PostTask(
       FROM_HERE, Bind(&ExpectIsCanceled, is_canceled, true));
   other_thread.Stop();
 }
@@ -374,9 +378,11 @@
   Thread bad_thread("bad thread");
   ASSERT_TRUE(bad_thread.Start());
 
-  bad_thread.task_runner()->PostTask(
-      FROM_HERE, Bind(&MaybeRunDeadlyTaskTrackerMemberFunction,
-                      Unretained(&task_tracker_), Bind(&PostDoNothingTask)));
+  bad_thread.message_loop_proxy()->PostTask(
+      FROM_HERE,
+      Bind(&MaybeRunDeadlyTaskTrackerMemberFunction,
+           Unretained(&task_tracker_),
+           Bind(&PostDoNothingTask)));
 }
 
 void TryCancel(CancelableTaskTracker::TaskId task_id,
@@ -395,9 +401,11 @@
       test_task_runner.get(), FROM_HERE, Bind(&DoNothing));
   EXPECT_NE(CancelableTaskTracker::kBadTaskId, task_id);
 
-  bad_thread.task_runner()->PostTask(
-      FROM_HERE, Bind(&MaybeRunDeadlyTaskTrackerMemberFunction,
-                      Unretained(&task_tracker_), Bind(&TryCancel, task_id)));
+  bad_thread.message_loop_proxy()->PostTask(
+      FROM_HERE,
+      Bind(&MaybeRunDeadlyTaskTrackerMemberFunction,
+           Unretained(&task_tracker_),
+           Bind(&TryCancel, task_id)));
 
   test_task_runner->RunUntilIdle();
 }
@@ -413,9 +421,10 @@
       test_task_runner.get(), FROM_HERE, Bind(&DoNothing));
   EXPECT_NE(CancelableTaskTracker::kBadTaskId, task_id);
 
-  bad_thread.task_runner()->PostTask(
+  bad_thread.message_loop_proxy()->PostTask(
       FROM_HERE,
-      Bind(&MaybeRunDeadlyTaskTrackerMemberFunction, Unretained(&task_tracker_),
+      Bind(&MaybeRunDeadlyTaskTrackerMemberFunction,
+           Unretained(&task_tracker_),
            Bind(&CancelableTaskTracker::TryCancelAll)));
 
   test_task_runner->RunUntilIdle();
diff --git a/base/task_runner_util_unittest.cc b/base/task_runner_util_unittest.cc
index 8245cfc..481f09e 100644
--- a/base/task_runner_util_unittest.cc
+++ b/base/task_runner_util_unittest.cc
@@ -5,7 +5,7 @@
 #include "base/task_runner_util.h"
 
 #include "base/bind.h"
-#include "base/location.h"
+#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -69,7 +69,8 @@
   int result = 0;
 
   MessageLoop message_loop;
-  PostTaskAndReplyWithResult(message_loop.task_runner().get(), FROM_HERE,
+  PostTaskAndReplyWithResult(message_loop.message_loop_proxy().get(),
+                             FROM_HERE,
                              Bind(&ReturnFourtyTwo),
                              Bind(&StoreValue, &result));
 
@@ -82,7 +83,8 @@
   double result = 0;
 
   MessageLoop message_loop;
-  PostTaskAndReplyWithResult(message_loop.task_runner().get(), FROM_HERE,
+  PostTaskAndReplyWithResult(message_loop.message_loop_proxy().get(),
+                             FROM_HERE,
                              Bind(&ReturnFourtyTwo),
                              Bind(&StoreDoubleValue, &result));
 
@@ -96,8 +98,10 @@
   g_foo_free_count = 0;
 
   MessageLoop message_loop;
-  PostTaskAndReplyWithResult(message_loop.task_runner().get(), FROM_HERE,
-                             Bind(&CreateFoo), Bind(&ExpectFoo));
+  PostTaskAndReplyWithResult(message_loop.message_loop_proxy().get(),
+                             FROM_HERE,
+                             Bind(&CreateFoo),
+                             Bind(&ExpectFoo));
 
   RunLoop().RunUntilIdle();
 
@@ -110,8 +114,10 @@
   g_foo_free_count = 0;
 
   MessageLoop message_loop;
-  PostTaskAndReplyWithResult(message_loop.task_runner().get(), FROM_HERE,
-                             Bind(&CreateScopedFoo), Bind(&ExpectScopedFoo));
+  PostTaskAndReplyWithResult(message_loop.message_loop_proxy().get(),
+                             FROM_HERE,
+                             Bind(&CreateScopedFoo),
+                             Bind(&ExpectScopedFoo));
 
   RunLoop().RunUntilIdle();
 
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index 7f258f5..521f69c 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -18,13 +18,11 @@
 #include "base/format_macros.h"
 #include "base/hash.h"
 #include "base/lazy_instance.h"
-#include "base/location.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
 #include "base/process/kill.h"
 #include "base/process/launch.h"
-#include "base/single_thread_task_runner.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
@@ -36,7 +34,6 @@
 #include "base/test/sequenced_worker_pool_owner.h"
 #include "base/test/test_switches.h"
 #include "base/test/test_timeouts.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/threading/thread_checker.h"
 #include "base/time/time.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -352,7 +349,7 @@
     TimeDelta timeout,
     int flags,
     bool redirect_stdio,
-    SingleThreadTaskRunner* task_runner,
+    scoped_refptr<MessageLoopProxy> message_loop_proxy,
     const TestLauncher::LaunchChildGTestProcessCallback& callback) {
   TimeTicks start_time = TimeTicks::Now();
 
@@ -426,9 +423,14 @@
 
   // Run target callback on the thread it was originating from, not on
   // a worker pool thread.
-  task_runner->PostTask(FROM_HERE, Bind(&RunCallback, callback, exit_code,
-                                        TimeTicks::Now() - start_time,
-                                        was_timeout, output_file_contents));
+  message_loop_proxy->PostTask(
+      FROM_HERE,
+      Bind(&RunCallback,
+           callback,
+           exit_code,
+           TimeTicks::Now() - start_time,
+           was_timeout,
+           output_file_contents));
 }
 
 }  // namespace
@@ -502,8 +504,9 @@
   // Start the watchdog timer.
   watchdog_timer_.Reset();
 
-  ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE, Bind(&TestLauncher::RunTestIteration, Unretained(this)));
+  MessageLoop::current()->PostTask(
+      FROM_HERE,
+      Bind(&TestLauncher::RunTestIteration, Unretained(this)));
 
   MessageLoop::current()->Run();
 
@@ -533,10 +536,16 @@
   bool redirect_stdio = (parallel_jobs_ > 1) || BotModeEnabled();
 
   worker_pool_owner_->pool()->PostWorkerTask(
-      FROM_HERE, Bind(&DoLaunchChildTestProcess, new_command_line, timeout,
-                      flags, redirect_stdio, ThreadTaskRunnerHandle::Get(),
-                      Bind(&TestLauncher::OnLaunchTestProcessFinished,
-                           Unretained(this), callback)));
+      FROM_HERE,
+      Bind(&DoLaunchChildTestProcess,
+           new_command_line,
+           timeout,
+           flags,
+           redirect_stdio,
+           MessageLoopProxy::current(),
+           Bind(&TestLauncher::OnLaunchTestProcessFinished,
+                Unretained(this),
+                callback)));
 }
 
 void TestLauncher::OnTestFinished(const TestResult& result) {
@@ -948,8 +957,9 @@
     fflush(stdout);
 
     // No tests have actually been started, so kick off the next iteration.
-    ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE, Bind(&TestLauncher::RunTestIteration, Unretained(this)));
+    MessageLoop::current()->PostTask(
+        FROM_HERE,
+        Bind(&TestLauncher::RunTestIteration, Unretained(this)));
   }
 }
 
@@ -970,7 +980,7 @@
   tests_to_retry_.clear();
   results_tracker_.OnTestIterationStarting();
 
-  ThreadTaskRunnerHandle::Get()->PostTask(
+  MessageLoop::current()->PostTask(
       FROM_HERE, Bind(&TestLauncher::RunTests, Unretained(this)));
 }
 
@@ -1017,8 +1027,9 @@
   results_tracker_.PrintSummaryOfCurrentIteration();
 
   // Kick off the next iteration.
-  ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE, Bind(&TestLauncher::RunTestIteration, Unretained(this)));
+  MessageLoop::current()->PostTask(
+      FROM_HERE,
+      Bind(&TestLauncher::RunTestIteration, Unretained(this)));
 }
 
 void TestLauncher::OnOutputTimeout() {
diff --git a/base/test/launcher/unit_test_launcher.cc b/base/test/launcher/unit_test_launcher.cc
index ab6fa72..1b3a162 100644
--- a/base/test/launcher/unit_test_launcher.cc
+++ b/base/test/launcher/unit_test_launcher.cc
@@ -12,9 +12,7 @@
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/format_macros.h"
-#include "base/location.h"
 #include "base/message_loop/message_loop.h"
-#include "base/single_thread_task_runner.h"
 #include "base/stl_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
@@ -24,7 +22,6 @@
 #include "base/test/test_switches.h"
 #include "base/test/test_timeouts.h"
 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/threading/thread_checker.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -408,10 +405,13 @@
   // The temporary file's directory is also temporary.
   DeleteFile(callback_state.output_file.DirName(), true);
 
-  ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE, Bind(&RunUnitTestsSerially, callback_state.test_launcher,
-                      callback_state.platform_delegate, test_names,
-                      callback_state.launch_flags));
+  MessageLoop::current()->PostTask(
+      FROM_HERE,
+      Bind(&RunUnitTestsSerially,
+           callback_state.test_launcher,
+           callback_state.platform_delegate,
+           test_names,
+           callback_state.launch_flags));
 }
 
 }  // namespace
@@ -576,9 +576,12 @@
 size_t UnitTestLauncherDelegate::RetryTests(
     TestLauncher* test_launcher,
     const std::vector<std::string>& test_names) {
-  ThreadTaskRunnerHandle::Get()->PostTask(
+  MessageLoop::current()->PostTask(
       FROM_HERE,
-      Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names,
+      Bind(&RunUnitTestsSerially,
+           test_launcher,
+           platform_delegate_,
+           test_names,
            use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0));
   return test_names.size();
 }
diff --git a/base/test/sequenced_worker_pool_owner.cc b/base/test/sequenced_worker_pool_owner.cc
index b0d8b7a..4486323 100644
--- a/base/test/sequenced_worker_pool_owner.cc
+++ b/base/test/sequenced_worker_pool_owner.cc
@@ -6,7 +6,6 @@
 
 #include "base/location.h"
 #include "base/message_loop/message_loop.h"
-#include "base/single_thread_task_runner.h"
 
 namespace base {
 
@@ -51,8 +50,9 @@
 }
 
 void SequencedWorkerPoolOwner::OnDestruct() {
-  constructor_message_loop_->task_runner()->PostTask(
-      FROM_HERE, constructor_message_loop_->QuitWhenIdleClosure());
+  constructor_message_loop_->PostTask(
+      FROM_HERE,
+      constructor_message_loop_->QuitWhenIdleClosure());
 }
 
 }  // namespace base
diff --git a/base/test/task_runner_test_template.h b/base/test/task_runner_test_template.h
index ee2b876..9bcf70b 100644
--- a/base/test/task_runner_test_template.h
+++ b/base/test/task_runner_test_template.h
@@ -53,9 +53,7 @@
 #include "base/basictypes.h"
 #include "base/bind.h"
 #include "base/callback.h"
-#include "base/location.h"
 #include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
 #include "base/synchronization/condition_variable.h"
 #include "base/synchronization/lock.h"
 #include "base/task_runner.h"
@@ -197,7 +195,7 @@
             i);
     for (int j = 0; j < i + 1; ++j) {
       task_runner->PostTask(FROM_HERE, ith_task_runner_task);
-      thread.task_runner()->PostTask(FROM_HERE, ith_non_task_runner_task);
+      thread.message_loop()->PostTask(FROM_HERE, ith_non_task_runner_task);
       expected_task_run_counts[i] += 2;
     }
   }
diff --git a/base/test/thread_test_helper.cc b/base/test/thread_test_helper.cc
index 6a12190..2bd3ba5 100644
--- a/base/test/thread_test_helper.cc
+++ b/base/test/thread_test_helper.cc
@@ -11,9 +11,9 @@
 namespace base {
 
 ThreadTestHelper::ThreadTestHelper(
-    scoped_refptr<SingleThreadTaskRunner> target_thread)
+    const scoped_refptr<MessageLoopProxy>& target_thread)
     : test_result_(false),
-      target_thread_(target_thread.Pass()),
+      target_thread_(target_thread),
       done_event_(false, false) {
 }
 
diff --git a/base/test/thread_test_helper.h b/base/test/thread_test_helper.h
index 926da73..f6817b5 100644
--- a/base/test/thread_test_helper.h
+++ b/base/test/thread_test_helper.h
@@ -7,7 +7,7 @@
 
 #include "base/compiler_specific.h"
 #include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/synchronization/waitable_event.h"
 
 namespace base {
@@ -19,7 +19,7 @@
 class ThreadTestHelper : public RefCountedThreadSafe<ThreadTestHelper> {
  public:
   explicit ThreadTestHelper(
-      scoped_refptr<SingleThreadTaskRunner> target_thread);
+      const scoped_refptr<MessageLoopProxy>& target_thread);
 
   // True if RunTest() was successfully executed on the target thread.
   bool Run() WARN_UNUSED_RESULT;
@@ -38,7 +38,7 @@
   void RunInThread();
 
   bool test_result_;
-  scoped_refptr<SingleThreadTaskRunner> target_thread_;
+  scoped_refptr<MessageLoopProxy> target_thread_;
   WaitableEvent done_event_;
 
   DISALLOW_COPY_AND_ASSIGN(ThreadTestHelper);
diff --git a/base/threading/post_task_and_reply_impl.cc b/base/threading/post_task_and_reply_impl.cc
index f3e88ab..a82a4fd 100644
--- a/base/threading/post_task_and_reply_impl.cc
+++ b/base/threading/post_task_and_reply_impl.cc
@@ -25,30 +25,30 @@
 class PostTaskAndReplyRelay {
  public:
   PostTaskAndReplyRelay(const tracked_objects::Location& from_here,
-                        const Closure& task,
-                        const Closure& reply)
+                        const Closure& task, const Closure& reply)
       : from_here_(from_here),
-        origin_task_runner_(ThreadTaskRunnerHandle::Get()) {
+        origin_loop_(ThreadTaskRunnerHandle::Get()) {
     task_ = task;
     reply_ = reply;
   }
 
   ~PostTaskAndReplyRelay() {
-    DCHECK(origin_task_runner_->BelongsToCurrentThread());
+    DCHECK(origin_loop_->BelongsToCurrentThread());
     task_.Reset();
     reply_.Reset();
   }
 
   void Run() {
     task_.Run();
-    origin_task_runner_->PostTask(
-        from_here_, Bind(&PostTaskAndReplyRelay::RunReplyAndSelfDestruct,
-                         base::Unretained(this)));
+    origin_loop_->PostTask(
+        from_here_,
+        Bind(&PostTaskAndReplyRelay::RunReplyAndSelfDestruct,
+             base::Unretained(this)));
   }
 
  private:
   void RunReplyAndSelfDestruct() {
-    DCHECK(origin_task_runner_->BelongsToCurrentThread());
+    DCHECK(origin_loop_->BelongsToCurrentThread());
 
     // Force |task_| to be released before |reply_| is to ensure that no one
     // accidentally depends on |task_| keeping one of its arguments alive while
@@ -62,7 +62,7 @@
   }
 
   tracked_objects::Location from_here_;
-  scoped_refptr<SingleThreadTaskRunner> origin_task_runner_;
+  scoped_refptr<SingleThreadTaskRunner> origin_loop_;
   Closure reply_;
   Closure task_;
 };
diff --git a/base/threading/post_task_and_reply_impl.h b/base/threading/post_task_and_reply_impl.h
index a5b9580..076a46d 100644
--- a/base/threading/post_task_and_reply_impl.h
+++ b/base/threading/post_task_and_reply_impl.h
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 // This file contains the implementation shared by
-// TaskRunner::PostTaskAndReply and WorkerPool::PostTaskAndReply.
+// MessageLoopProxy::PostTaskAndReply and WorkerPool::PostTaskAndReply.
 
 #ifndef BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
 #define BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
@@ -21,11 +21,11 @@
 // MessageLoop.
 //
 // If you're looking for a concrete implementation of
-// PostTaskAndReply, you probably want base::SingleThreadTaskRunner, or you
+// PostTaskAndReply, you probably want base::MessageLoopProxy, or you
 // may want base::WorkerPool.
 class PostTaskAndReplyImpl {
  public:
-  // Implementation for TaskRunner::PostTaskAndReply and
+  // Implementation for MessageLoopProxy::PostTaskAndReply and
   // WorkerPool::PostTaskAndReply.
   bool PostTaskAndReply(const tracked_objects::Location& from_here,
                         const Closure& task,
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 459c31b..6f4a248 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -17,11 +17,11 @@
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/memory/linked_ptr.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/stl_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/synchronization/condition_variable.h"
 #include "base/synchronization/lock.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/threading/platform_thread.h"
 #include "base/threading/simple_thread.h"
 #include "base/threading/thread_local.h"
@@ -1158,27 +1158,29 @@
   return *token;
 }
 
-SequencedWorkerPool::SequencedWorkerPool(size_t max_threads,
-                                         const std::string& thread_name_prefix)
-    : constructor_task_runner_(ThreadTaskRunnerHandle::Get()),
+SequencedWorkerPool::SequencedWorkerPool(
+    size_t max_threads,
+    const std::string& thread_name_prefix)
+    : constructor_message_loop_(MessageLoopProxy::current()),
       inner_(new Inner(this, max_threads, thread_name_prefix, NULL)) {
 }
 
-SequencedWorkerPool::SequencedWorkerPool(size_t max_threads,
-                                         const std::string& thread_name_prefix,
-                                         TestingObserver* observer)
-    : constructor_task_runner_(ThreadTaskRunnerHandle::Get()),
+SequencedWorkerPool::SequencedWorkerPool(
+    size_t max_threads,
+    const std::string& thread_name_prefix,
+    TestingObserver* observer)
+    : constructor_message_loop_(MessageLoopProxy::current()),
       inner_(new Inner(this, max_threads, thread_name_prefix, observer)) {
 }
 
 SequencedWorkerPool::~SequencedWorkerPool() {}
 
 void SequencedWorkerPool::OnDestruct() const {
-  DCHECK(constructor_task_runner_);
+  DCHECK(constructor_message_loop_.get());
   // Avoid deleting ourselves on a worker thread (which would
   // deadlock).
   if (RunsTasksOnCurrentThread()) {
-    constructor_task_runner_->DeleteSoon(FROM_HERE, this);
+    constructor_message_loop_->DeleteSoon(FROM_HERE, this);
   } else {
     delete this;
   }
@@ -1298,7 +1300,7 @@
 }
 
 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) {
-  DCHECK(constructor_task_runner_->BelongsToCurrentThread());
+  DCHECK(constructor_message_loop_->BelongsToCurrentThread());
   inner_->Shutdown(max_new_blocking_tasks_after_shutdown);
 }
 
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h
index 2126b0d..0b6c5f9 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -11,10 +11,8 @@
 #include "base/base_export.h"
 #include "base/basictypes.h"
 #include "base/callback_forward.h"
-#include "base/location.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/single_thread_task_runner.h"
 #include "base/task_runner.h"
 
 namespace tracked_objects {
@@ -23,7 +21,7 @@
 
 namespace base {
 
-class SingleThreadTaskRunner;
+class MessageLoopProxy;
 
 template <class T> class DeleteHelper;
 
@@ -347,7 +345,7 @@
   class Inner;
   class Worker;
 
-  const scoped_refptr<SingleThreadTaskRunner> constructor_task_runner_;
+  const scoped_refptr<MessageLoopProxy> constructor_message_loop_;
 
   // Avoid pulling in too many headers by putting (almost) everything
   // into |inner_|.
diff --git a/base/threading/sequenced_worker_pool_unittest.cc b/base/threading/sequenced_worker_pool_unittest.cc
index 05989a5..c12156e 100644
--- a/base/threading/sequenced_worker_pool_unittest.cc
+++ b/base/threading/sequenced_worker_pool_unittest.cc
@@ -11,6 +11,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/synchronization/condition_variable.h"
 #include "base/synchronization/lock.h"
 #include "base/test/sequenced_task_runner_test_template.h"
diff --git a/base/threading/thread.cc b/base/threading/thread.cc
index bab3991..d42ba4d 100644
--- a/base/threading/thread.cc
+++ b/base/threading/thread.cc
@@ -6,7 +6,6 @@
 
 #include "base/bind.h"
 #include "base/lazy_instance.h"
-#include "base/location.h"
 #include "base/profiler/scoped_tracker.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
@@ -163,7 +162,7 @@
     return;
 
   stopping_ = true;
-  task_runner()->PostTask(FROM_HERE, base::Bind(&ThreadQuitHelper));
+  message_loop_->PostTask(FROM_HERE, base::Bind(&ThreadQuitHelper));
 }
 
 bool Thread::IsRunning() const {
diff --git a/base/threading/thread.h b/base/threading/thread.h
index 4915606..5010f0e 100644
--- a/base/threading/thread.h
+++ b/base/threading/thread.h
@@ -11,8 +11,8 @@
 #include "base/callback.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
 #include "base/message_loop/timer_slack.h"
-#include "base/single_thread_task_runner.h"
 #include "base/threading/platform_thread.h"
 
 namespace base {
@@ -156,7 +156,7 @@
   // hold on to this even after the thread is gone; in this situation, attempts
   // to PostTask() will fail.
   scoped_refptr<SingleThreadTaskRunner> task_runner() const {
-    return message_loop_->task_runner();
+    return message_loop_proxy();
   }
 
   // Returns the name of this thread (for display in debugger too).
diff --git a/base/threading/thread_perftest.cc b/base/threading/thread_perftest.cc
index 3bc9fb4..a08cc5b 100644
--- a/base/threading/thread_perftest.cc
+++ b/base/threading/thread_perftest.cc
@@ -5,9 +5,7 @@
 #include "base/base_switches.h"
 #include "base/bind.h"
 #include "base/command_line.h"
-#include "base/location.h"
 #include "base/memory/scoped_vector.h"
-#include "base/single_thread_task_runner.h"
 #include "base/strings/stringprintf.h"
 #include "base/synchronization/condition_variable.h"
 #include "base/synchronization/lock.h"
@@ -56,9 +54,12 @@
   base::TimeTicks ThreadNow(base::Thread* thread) {
     base::WaitableEvent done(false, false);
     base::TimeTicks ticks;
-    thread->task_runner()->PostTask(
-        FROM_HERE, base::Bind(&ThreadPerfTest::TimeOnThread,
-                              base::Unretained(this), &ticks, &done));
+    thread->message_loop_proxy()->PostTask(
+        FROM_HERE,
+        base::Bind(&ThreadPerfTest::TimeOnThread,
+                   base::Unretained(this),
+                   &ticks,
+                   &done));
     done.Wait();
     return ticks;
   }
@@ -127,9 +128,10 @@
       FinishMeasurement();
       return;
     }
-    NextThread(hops)->task_runner()->PostTask(
-        FROM_HERE, base::Bind(&ThreadPerfTest::PingPong, base::Unretained(this),
-                              hops - 1));
+    NextThread(hops)->message_loop_proxy()->PostTask(
+        FROM_HERE,
+        base::Bind(
+            &ThreadPerfTest::PingPong, base::Unretained(this), hops - 1));
   }
 };
 
@@ -196,9 +198,11 @@
   void PingPong(int hops) override {
     remaining_hops_ = hops;
     for (size_t i = 0; i < threads_.size(); i++) {
-      threads_[i]->task_runner()->PostTask(
-          FROM_HERE, base::Bind(&EventPerfTest::WaitAndSignalOnThread,
-                                base::Unretained(this), i));
+      threads_[i]->message_loop_proxy()->PostTask(
+          FROM_HERE,
+          base::Bind(&EventPerfTest::WaitAndSignalOnThread,
+                     base::Unretained(this),
+                     i));
     }
 
     // Kick off the Signal ping-ponging.
diff --git a/base/threading/thread_unittest.cc b/base/threading/thread_unittest.cc
index a89768e..f4d024f 100644
--- a/base/threading/thread_unittest.cc
+++ b/base/threading/thread_unittest.cc
@@ -7,8 +7,7 @@
 #include <vector>
 
 #include "base/bind.h"
-#include "base/location.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop.h"
 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/platform_test.h"
@@ -145,7 +144,7 @@
   EXPECT_TRUE(a.IsRunning());
 
   bool was_invoked = false;
-  a.task_runner()->PostTask(FROM_HERE, base::Bind(&ToggleValue, &was_invoked));
+  a.message_loop()->PostTask(FROM_HERE, base::Bind(&ToggleValue, &was_invoked));
 
   // wait for the task to run (we could use a kernel event here
   // instead to avoid busy waiting, but this is sufficient for
@@ -166,12 +165,14 @@
     // Test that all events are dispatched before the Thread object is
     // destroyed.  We do this by dispatching a sleep event before the
     // event that will toggle our sentinel value.
-    a.task_runner()->PostTask(
-        FROM_HERE, base::Bind(static_cast<void (*)(base::TimeDelta)>(
-                                  &base::PlatformThread::Sleep),
-                              base::TimeDelta::FromMilliseconds(20)));
-    a.task_runner()->PostTask(FROM_HERE,
-                              base::Bind(&ToggleValue, &was_invoked));
+    a.message_loop()->PostTask(
+        FROM_HERE,
+        base::Bind(
+            static_cast<void (*)(base::TimeDelta)>(
+                &base::PlatformThread::Sleep),
+            base::TimeDelta::FromMilliseconds(20)));
+    a.message_loop()->PostTask(FROM_HERE, base::Bind(&ToggleValue,
+                                                     &was_invoked));
   }
   EXPECT_TRUE(was_invoked);
 }
@@ -220,7 +221,7 @@
 
     // Register an observer that writes into |captured_events| once the
     // thread's message loop is destroyed.
-    t.task_runner()->PostTask(
+    t.message_loop()->PostTask(
         FROM_HERE, base::Bind(&RegisterDestructionObserver,
                               base::Unretained(&loop_destruction_observer)));
 
diff --git a/base/threading/worker_pool.h b/base/threading/worker_pool.h
index a52a414..333b495 100644
--- a/base/threading/worker_pool.h
+++ b/base/threading/worker_pool.h
@@ -36,7 +36,7 @@
   static bool PostTask(const tracked_objects::Location& from_here,
                        const base::Closure& task, bool task_is_slow);
 
-  // Just like TaskRunner::PostTaskAndReply, except the destination
+  // Just like MessageLoopProxy::PostTaskAndReply, except the destination
   // for |task| is a worker thread and you can specify |task_is_slow| just
   // like you can for PostTask above.
   static bool PostTaskAndReply(const tracked_objects::Location& from_here,
diff --git a/base/trace_event/trace_event_android.cc b/base/trace_event/trace_event_android.cc
index 26bd0c7..bcba436 100644
--- a/base/trace_event/trace_event_android.cc
+++ b/base/trace_event/trace_event_android.cc
@@ -114,7 +114,7 @@
   Thread end_chrome_tracing_thread("end_chrome_tracing");
   WaitableEvent complete_event(false, false);
   end_chrome_tracing_thread.Start();
-  end_chrome_tracing_thread.task_runner()->PostTask(
+  end_chrome_tracing_thread.message_loop()->PostTask(
       FROM_HERE, base::Bind(&EndChromeTracing, Unretained(this),
                             Unretained(&complete_event)));
   complete_event.Wait();
diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc
index f1c87dd..cbeeeab 100644
--- a/base/trace_event/trace_event_impl.cc
+++ b/base/trace_event/trace_event_impl.cc
@@ -14,8 +14,8 @@
 #include "base/format_macros.h"
 #include "base/json/string_escape.h"
 #include "base/lazy_instance.h"
-#include "base/location.h"
 #include "base/memory/singleton.h"
+#include "base/message_loop/message_loop.h"
 #include "base/process/process_metrics.h"
 #include "base/stl_util.h"
 #include "base/strings/string_number_conversions.h"
@@ -28,7 +28,6 @@
 #include "base/synchronization/waitable_event.h"
 #include "base/sys_info.h"
 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
-#include "base/thread_task_runner_handle.h"
 #include "base/threading/platform_thread.h"
 #include "base/threading/thread_id_name_manager.h"
 #include "base/threading/worker_pool.h"
@@ -1407,7 +1406,7 @@
     AutoLock lock(lock_);
 
     // Can't enable tracing when Flush() is in progress.
-    DCHECK(!flush_task_runner_);
+    DCHECK(!flush_message_loop_proxy_.get());
 
     InternalTraceOptions new_options =
         GetInternalOptionsFromTraceOptions(options);
@@ -1681,9 +1680,9 @@
 }
 
 // Flush() works as the following:
-// 1. Flush() is called in thread A whose task runner is saved in
-//    flush_task_runner_;
-// 2. If thread_message_loops_ is not empty, thread A posts task to each message
+// 1. Flush() is called in threadA whose message loop is saved in
+//    flush_message_loop_proxy_;
+// 2. If thread_message_loops_ is not empty, threadA posts task to each message
 //    loop to flush the thread local buffers; otherwise finish the flush;
 // 3. FlushCurrentThread() deletes the thread local event buffer:
 //    - The last batch of events of the thread are flushed into the main buffer;
@@ -1711,11 +1710,9 @@
       thread_message_loop_task_runners;
   {
     AutoLock lock(lock_);
-    DCHECK(!flush_task_runner_);
-    flush_task_runner_ = ThreadTaskRunnerHandle::IsSet()
-                             ? ThreadTaskRunnerHandle::Get()
-                             : nullptr;
-    DCHECK_IMPLIES(thread_message_loops_.size(), flush_task_runner_);
+    DCHECK(!flush_message_loop_proxy_.get());
+    flush_message_loop_proxy_ = MessageLoopProxy::current();
+    DCHECK(!thread_message_loops_.size() || flush_message_loop_proxy_.get());
     flush_output_callback_ = cb;
 
     if (thread_shared_chunk_) {
@@ -1738,7 +1735,7 @@
           FROM_HERE,
           Bind(&TraceLog::FlushCurrentThread, Unretained(this), generation));
     }
-    flush_task_runner_->PostDelayedTask(
+    flush_message_loop_proxy_->PostDelayedTask(
         FROM_HERE,
         Bind(&TraceLog::OnFlushTimeout, Unretained(this), generation),
         TimeDelta::FromMilliseconds(kThreadFlushTimeoutMs));
@@ -1792,7 +1789,7 @@
     UseNextTraceBuffer();
     thread_message_loops_.clear();
 
-    flush_task_runner_ = NULL;
+    flush_message_loop_proxy_ = NULL;
     flush_output_callback = flush_output_callback_;
     flush_output_callback_.Reset();
   }
@@ -1815,7 +1812,7 @@
 void TraceLog::FlushCurrentThread(int generation) {
   {
     AutoLock lock(lock_);
-    if (!CheckGeneration(generation) || !flush_task_runner_) {
+    if (!CheckGeneration(generation) || !flush_message_loop_proxy_.get()) {
       // This is late. The corresponding flush has finished.
       return;
     }
@@ -1825,18 +1822,19 @@
   delete thread_local_event_buffer_.Get();
 
   AutoLock lock(lock_);
-  if (!CheckGeneration(generation) || !flush_task_runner_ ||
+  if (!CheckGeneration(generation) || !flush_message_loop_proxy_.get() ||
       thread_message_loops_.size())
     return;
 
-  flush_task_runner_->PostTask(
-      FROM_HERE, Bind(&TraceLog::FinishFlush, Unretained(this), generation));
+  flush_message_loop_proxy_->PostTask(
+      FROM_HERE,
+      Bind(&TraceLog::FinishFlush, Unretained(this), generation));
 }
 
 void TraceLog::OnFlushTimeout(int generation) {
   {
     AutoLock lock(lock_);
-    if (!CheckGeneration(generation) || !flush_task_runner_) {
+    if (!CheckGeneration(generation) || !flush_message_loop_proxy_.get()) {
       // Flush has finished before timeout.
       return;
     }
diff --git a/base/trace_event/trace_event_impl.h b/base/trace_event/trace_event_impl.h
index 50d33ca..33a85c9 100644
--- a/base/trace_event/trace_event_impl.h
+++ b/base/trace_event/trace_event_impl.h
@@ -18,7 +18,6 @@
 #include "base/memory/ref_counted_memory.h"
 #include "base/memory/scoped_vector.h"
 #include "base/observer_list.h"
-#include "base/single_thread_task_runner.h"
 #include "base/strings/string_util.h"
 #include "base/synchronization/condition_variable.h"
 #include "base/synchronization/lock.h"
@@ -799,8 +798,8 @@
   ThreadLocalBoolean thread_is_in_trace_event_;
 
   // Contains the message loops of threads that have had at least one event
-  // added into the local event buffer. Not using SingleThreadTaskRunner
-  // because we need to know the life time of the message loops.
+  // added into the local event buffer. Not using MessageLoopProxy because we
+  // need to know the life time of the message loops.
   hash_set<MessageLoop*> thread_message_loops_;
 
   // For events which can't be added into the thread local buffer, e.g. events
@@ -810,7 +809,7 @@
 
   // Set when asynchronous Flush is in progress.
   OutputCallback flush_output_callback_;
-  scoped_refptr<SingleThreadTaskRunner> flush_task_runner_;
+  scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_;
   subtle::AtomicWord generation_;
   bool use_worker_thread_;
 
diff --git a/base/trace_event/trace_event_memory.cc b/base/trace_event/trace_event_memory.cc
index ab8ba0d..2bf6d38 100644
--- a/base/trace_event/trace_event_memory.cc
+++ b/base/trace_event/trace_event_memory.cc
@@ -6,10 +6,9 @@
 
 #include "base/debug/leak_annotations.h"
 #include "base/lazy_instance.h"
-#include "base/location.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/threading/thread_local_storage.h"
@@ -145,11 +144,11 @@
 //////////////////////////////////////////////////////////////////////////////
 
 TraceMemoryController::TraceMemoryController(
-    scoped_refptr<SingleThreadTaskRunner> task_runner,
+    scoped_refptr<MessageLoopProxy> message_loop_proxy,
     HeapProfilerStartFunction heap_profiler_start_function,
     HeapProfilerStopFunction heap_profiler_stop_function,
     GetHeapProfileFunction get_heap_profile_function)
-    : task_runner_(task_runner.Pass()),
+    : message_loop_proxy_(message_loop_proxy),
       heap_profiler_start_function_(heap_profiler_start_function),
       heap_profiler_stop_function_(heap_profiler_stop_function),
       get_heap_profile_function_(get_heap_profile_function),
@@ -175,9 +174,10 @@
   if (!enabled)
     return;
   DVLOG(1) << "OnTraceLogEnabled";
-  task_runner_->PostTask(FROM_HERE,
-                         base::Bind(&TraceMemoryController::StartProfiling,
-                                    weak_factory_.GetWeakPtr()));
+  message_loop_proxy_->PostTask(
+      FROM_HERE,
+      base::Bind(&TraceMemoryController::StartProfiling,
+                 weak_factory_.GetWeakPtr()));
 }
 
 void TraceMemoryController::OnTraceLogDisabled() {
@@ -185,9 +185,10 @@
   // called, so we cannot tell if it was enabled before. Always try to turn
   // off profiling.
   DVLOG(1) << "OnTraceLogDisabled";
-  task_runner_->PostTask(FROM_HERE,
-                         base::Bind(&TraceMemoryController::StopProfiling,
-                                    weak_factory_.GetWeakPtr()));
+  message_loop_proxy_->PostTask(
+      FROM_HERE,
+      base::Bind(&TraceMemoryController::StopProfiling,
+                 weak_factory_.GetWeakPtr()));
 }
 
 void TraceMemoryController::StartProfiling() {
diff --git a/base/trace_event/trace_event_memory.h b/base/trace_event/trace_event_memory.h
index e2b3ae9..8e70020 100644
--- a/base/trace_event/trace_event_memory.h
+++ b/base/trace_event/trace_event_memory.h
@@ -20,7 +20,7 @@
 
 namespace base {
 
-class SingleThreadTaskRunner;
+class MessageLoopProxy;
 
 namespace trace_event {
 
@@ -35,14 +35,15 @@
   typedef void (*HeapProfilerStopFunction)();
   typedef char* (*GetHeapProfileFunction)();
 
-  // |task_runner| must be a task runner for the primary thread for the client
+  // |message_loop_proxy| must be a proxy to the primary thread for the client
   // process, e.g. the UI thread in a browser. The function pointers must be
   // pointers to tcmalloc heap profiling functions; by avoiding direct calls to
   // these functions we avoid a dependency on third_party/tcmalloc from base.
-  TraceMemoryController(scoped_refptr<SingleThreadTaskRunner> task_runner,
-                        HeapProfilerStartFunction heap_profiler_start_function,
-                        HeapProfilerStopFunction heap_profiler_stop_function,
-                        GetHeapProfileFunction get_heap_profile_function);
+  TraceMemoryController(
+      scoped_refptr<MessageLoopProxy> message_loop_proxy,
+      HeapProfilerStartFunction heap_profiler_start_function,
+      HeapProfilerStopFunction heap_profiler_stop_function,
+      GetHeapProfileFunction get_heap_profile_function);
   virtual ~TraceMemoryController();
 
   // base::trace_event::TraceLog::EnabledStateChangedObserver overrides:
@@ -64,7 +65,7 @@
   bool IsTimerRunningForTest() const;
 
   // Ensures the observer starts and stops tracing on the primary thread.
-  scoped_refptr<SingleThreadTaskRunner> task_runner_;
+  scoped_refptr<MessageLoopProxy> message_loop_proxy_;
 
   // Pointers to tcmalloc heap profiling functions. Allows this class to use
   // tcmalloc functions without introducing a dependency from base to tcmalloc.
diff --git a/base/trace_event/trace_event_memory_unittest.cc b/base/trace_event/trace_event_memory_unittest.cc
index 781a054..4732733 100644
--- a/base/trace_event/trace_event_memory_unittest.cc
+++ b/base/trace_event/trace_event_memory_unittest.cc
@@ -7,6 +7,7 @@
 #include <sstream>
 #include <string>
 
+#include "base/message_loop/message_loop.h"
 #include "base/trace_event/trace_event_impl.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -39,9 +40,12 @@
   EXPECT_EQ(0u, TraceLog::GetInstance()->GetObserverCountForTest());
 
   // Creating a controller adds it to the TraceLog observer list.
-  scoped_ptr<TraceMemoryController> controller(new TraceMemoryController(
-      message_loop.task_runner(), ::HeapProfilerWithPseudoStackStart,
-      ::HeapProfilerStop, ::GetHeapProfile));
+  scoped_ptr<TraceMemoryController> controller(
+      new TraceMemoryController(
+          message_loop.message_loop_proxy(),
+          ::HeapProfilerWithPseudoStackStart,
+          ::HeapProfilerStop,
+          ::GetHeapProfile));
   EXPECT_EQ(1u, TraceLog::GetInstance()->GetObserverCountForTest());
   EXPECT_TRUE(
       TraceLog::GetInstance()->HasEnabledStateObserver(controller.get()));
diff --git a/base/trace_event/trace_event_system_stats_monitor_unittest.cc b/base/trace_event/trace_event_system_stats_monitor_unittest.cc
index 03dff59..995f53b 100644
--- a/base/trace_event/trace_event_system_stats_monitor_unittest.cc
+++ b/base/trace_event/trace_event_system_stats_monitor_unittest.cc
@@ -7,6 +7,7 @@
 #include <sstream>
 #include <string>
 
+#include "base/message_loop/message_loop.h"
 #include "base/trace_event/trace_event_impl.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -35,7 +36,8 @@
 
   // Creating a system stats monitor adds it to the TraceLog observer list.
   scoped_ptr<TraceEventSystemStatsMonitor> system_stats_monitor(
-      new TraceEventSystemStatsMonitor(message_loop.task_runner()));
+      new TraceEventSystemStatsMonitor(
+          message_loop.message_loop_proxy()));
   EXPECT_EQ(1u, TraceLog::GetInstance()->GetObserverCountForTest());
   EXPECT_TRUE(
       TraceLog::GetInstance()->HasEnabledStateObserver(
diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc
index 17953e7..0d3b091 100644
--- a/base/trace_event/trace_event_unittest.cc
+++ b/base/trace_event/trace_event_unittest.cc
@@ -9,12 +9,10 @@
 #include "base/command_line.h"
 #include "base/json/json_reader.h"
 #include "base/json/json_writer.h"
-#include "base/location.h"
 #include "base/memory/ref_counted_memory.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/singleton.h"
 #include "base/process/process_handle.h"
-#include "base/single_thread_task_runner.h"
 #include "base/strings/stringprintf.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/platform_thread.h"
@@ -97,9 +95,10 @@
     WaitableEvent flush_complete_event(false, false);
     Thread flush_thread("flush");
     flush_thread.Start();
-    flush_thread.task_runner()->PostTask(
-        FROM_HERE, base::Bind(&TraceEventTestFixture::EndTraceAndFlushAsync,
-                              base::Unretained(this), &flush_complete_event));
+    flush_thread.message_loop()->PostTask(FROM_HERE,
+      base::Bind(&TraceEventTestFixture::EndTraceAndFlushAsync,
+                 base::Unretained(this),
+                 &flush_complete_event));
     flush_complete_event.Wait();
   }
 
@@ -1425,7 +1424,7 @@
   WaitableEvent task_complete_event(false, false);
   thread.Start();
 
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, base::Bind(&TraceWithAllMacroVariants, &task_complete_event));
   task_complete_event.Wait();
   thread.Stop();
@@ -1446,9 +1445,9 @@
     threads[i] = new Thread(StringPrintf("Thread %d", i));
     task_complete_events[i] = new WaitableEvent(false, false);
     threads[i]->Start();
-    threads[i]->task_runner()->PostTask(
-        FROM_HERE, base::Bind(&TraceManyInstantEvents, i, num_events,
-                              task_complete_events[i]));
+    threads[i]->message_loop()->PostTask(
+        FROM_HERE, base::Bind(&TraceManyInstantEvents,
+                              i, num_events, task_complete_events[i]));
   }
 
   for (int i = 0; i < num_threads; i++) {
@@ -1494,9 +1493,9 @@
     task_complete_events[i] = new WaitableEvent(false, false);
     threads[i]->Start();
     thread_ids[i] = threads[i]->thread_id();
-    threads[i]->task_runner()->PostTask(
-        FROM_HERE, base::Bind(&TraceManyInstantEvents, i, kNumEvents,
-                              task_complete_events[i]));
+    threads[i]->message_loop()->PostTask(
+        FROM_HERE, base::Bind(&TraceManyInstantEvents,
+                              i, kNumEvents, task_complete_events[i]));
   }
   for (int i = 0; i < kNumThreads; i++) {
     task_complete_events[i]->Wait();
@@ -2726,17 +2725,17 @@
   Thread thread("1");
   WaitableEvent task_complete_event(false, false);
   thread.Start();
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, Bind(&TraceLog::SetCurrentThreadBlocksMessageLoop,
                       Unretained(TraceLog::GetInstance())));
 
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, Bind(&TraceWithAllMacroVariants, &task_complete_event));
   task_complete_event.Wait();
 
   WaitableEvent task_start_event(false, false);
   WaitableEvent task_stop_event(false, false);
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, Bind(&BlockUntilStopped, &task_start_event, &task_stop_event));
   task_start_event.Wait();
 
@@ -2797,15 +2796,15 @@
   WaitableEvent task_complete_event(false, false);
   thread.Start();
 
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, Bind(&TraceWithAllMacroVariants, &task_complete_event));
   task_complete_event.Wait();
 
   WaitableEvent task_start_event(false, false);
   WaitableEvent task_stop_event(false, false);
-  thread.task_runner()->PostTask(
-      FROM_HERE, Bind(&SetBlockingFlagAndBlockUntilStopped, &task_start_event,
-                      &task_stop_event));
+  thread.message_loop()->PostTask(
+      FROM_HERE, Bind(&SetBlockingFlagAndBlockUntilStopped,
+                      &task_start_event, &task_stop_event));
   task_start_event.Wait();
 
   EndTraceAndFlush();
@@ -2822,14 +2821,14 @@
   WaitableEvent task_complete_event(false, false);
   thread.Start();
 
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, Bind(&TraceWithAllMacroVariants, &task_complete_event));
   task_complete_event.Wait();
   task_complete_event.Reset();
 
   WaitableEvent task_start_event(false, false);
   WaitableEvent task_stop_event(false, false);
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, Bind(&BlockUntilStopped, &task_start_event, &task_stop_event));
   task_start_event.Wait();
 
@@ -2844,7 +2843,7 @@
   // executed in the thread before continuing.
   task_start_event.Reset();
   task_stop_event.Reset();
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, Bind(&BlockUntilStopped, &task_start_event, &task_stop_event));
   task_start_event.Wait();
   task_stop_event.Signal();
@@ -2853,7 +2852,7 @@
   // TraceLog should discover the generation mismatch and recover the thread
   // local buffer for the thread without any error.
   BeginTrace();
-  thread.task_runner()->PostTask(
+  thread.message_loop()->PostTask(
       FROM_HERE, Bind(&TraceWithAllMacroVariants, &task_complete_event));
   task_complete_event.Wait();
   task_complete_event.Reset();