[MessageLoopCurrent] Move QuitWhenIdleClosure to RunLoop

I was about to migrate MessageLoop::QuitWhenIdleClosure() to
MessageLoopCurrent::QuitWhenIdleClosure() but figured this should really
just be alongside similar deprecated methods moved to RunLoop last year.

This CL is a contract that I'll TBR mass migrate calls to
MessageLoop::QuitWhenIdleClosure() to it after this lands
(and fix includes where relevant).

[email protected], [email protected]

Bug: 825327
Change-Id: I3a544a3735427dfac5e57c4e266be9901fbb67ec
Reviewed-on: https://chromium-review.googlesource.com/1055808
Reviewed-by: kylechar <[email protected]>
Reviewed-by: danakj <[email protected]>
Commit-Queue: Gabriel Charette <[email protected]>
Cr-Commit-Position: refs/heads/master@{#558956}
diff --git a/base/run_loop.cc b/base/run_loop.cc
index 496e858f..1385a8631 100644
--- a/base/run_loop.cc
+++ b/base/run_loop.cc
@@ -239,6 +239,11 @@
   tls_delegate.Get().Get()->active_run_loops_.top()->QuitWhenIdle();
 }
 
+// static
+Closure RunLoop::QuitCurrentWhenIdleClosureDeprecated() {
+  return Bind(&RunLoop::QuitCurrentWhenIdleDeprecated);
+}
+
 #if DCHECK_IS_ON()
 RunLoop::ScopedDisallowRunningForTesting::ScopedDisallowRunningForTesting()
     : current_delegate_(tls_delegate.Get().Get()),
diff --git a/base/run_loop.h b/base/run_loop.h
index d3858fce..53c42d0 100644
--- a/base/run_loop.h
+++ b/base/run_loop.h
@@ -234,12 +234,13 @@
 
   // Quits the active RunLoop (when idle) -- there must be one. These were
   // introduced as prefered temporary replacements to the long deprecated
-  // MessageLoop::Quit(WhenIdle) methods. Callers should properly plumb a
-  // reference to the appropriate RunLoop instance (or its QuitClosure) instead
-  // of using these in order to link Run()/Quit() to a single RunLoop instance
-  // and increase readability.
+  // MessageLoop::Quit(WhenIdle)(Closure) methods. Callers should properly plumb
+  // a reference to the appropriate RunLoop instance (or its QuitClosure)
+  // instead of using these in order to link Run()/Quit() to a single RunLoop
+  // instance and increase readability.
   static void QuitCurrentDeprecated();
   static void QuitCurrentWhenIdleDeprecated();
+  static Closure QuitCurrentWhenIdleClosureDeprecated();
 
   // Run() will DCHECK if called while there's a ScopedDisallowRunningForTesting
   // in scope on its thread. This is useful to add safety to some test