Add RunLoop::QuitWhenIdle().

This will facilitate the removal of calls to
MessageLoop::QuitWhenIdle().

BUG=616447

Review-Url: https://codereview.chromium.org/2045263004
Cr-Commit-Position: refs/heads/master@{#399053}
diff --git a/base/run_loop.cc b/base/run_loop.cc
index 4e425c9..7a957533 100644
--- a/base/run_loop.cc
+++ b/base/run_loop.cc
@@ -51,6 +51,10 @@
   }
 }
 
+void RunLoop::QuitWhenIdle() {
+  quit_when_idle_received_ = true;
+}
+
 base::Closure RunLoop::QuitClosure() {
   return base::Bind(&RunLoop::Quit, weak_factory_.GetWeakPtr());
 }