Add RunLoop::QuitWhenIdleClosure().

BUG=616447

Review-Url: https://codereview.chromium.org/2053223004
Cr-Commit-Position: refs/heads/master@{#399234}
diff --git a/base/run_loop.cc b/base/run_loop.cc
index 7a957533..a2322f8 100644
--- a/base/run_loop.cc
+++ b/base/run_loop.cc
@@ -59,6 +59,10 @@
   return base::Bind(&RunLoop::Quit, weak_factory_.GetWeakPtr());
 }
 
+base::Closure RunLoop::QuitWhenIdleClosure() {
+  return base::Bind(&RunLoop::QuitWhenIdle, weak_factory_.GetWeakPtr());
+}
+
 bool RunLoop::BeforeRun() {
   DCHECK(!run_called_);
   run_called_ = true;