[base MessageLoopCurrent] Remove standalone SetNestableTasksAllowed

This completes a portion of a long-coming migration.

(TBR for mechanical changes outside of //base)
[email protected]

Bug: 781352
Change-Id: Ia3a43684f0a5a496bd0eed30ecb49d6db1d7f96a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2225921
Commit-Queue: Gabriel Charette <[email protected]>
Reviewed-by: François Doray <[email protected]>
Auto-Submit: Gabriel Charette <[email protected]>
Cr-Commit-Position: refs/heads/master@{#774720}
diff --git a/base/message_loop/message_pump_glib_unittest.cc b/base/message_loop/message_pump_glib_unittest.cc
index 54fa300..626a81f4 100644
--- a/base/message_loop/message_pump_glib_unittest.cc
+++ b/base/message_loop/message_pump_glib_unittest.cc
@@ -447,8 +447,6 @@
 };
 
 void TestGLibLoopInternal(EventInjector* injector, OnceClosure done) {
-  // Allow tasks to be processed from 'native' event loops.
-  MessageLoopCurrent::Get()->SetNestableTasksAllowed(true);
   scoped_refptr<GLibLoopRunner> runner = new GLibLoopRunner();
 
   int task_count = 0;
@@ -472,7 +470,10 @@
       TimeDelta::FromMilliseconds(40));
 
   // Run a nested, straight GLib message loop.
-  runner->RunGLib();
+  {
+    MessageLoopCurrent::ScopedNestableTaskAllower allow_nestable_tasks;
+    runner->RunGLib();
+  }
 
   ASSERT_EQ(3, task_count);
   EXPECT_EQ(4, injector->processed_events());
@@ -480,8 +481,6 @@
 }
 
 void TestGtkLoopInternal(EventInjector* injector, OnceClosure done) {
-  // Allow tasks to be processed from 'native' event loops.
-  MessageLoopCurrent::Get()->SetNestableTasksAllowed(true);
   scoped_refptr<GLibLoopRunner> runner = new GLibLoopRunner();
 
   int task_count = 0;
@@ -505,7 +504,10 @@
       TimeDelta::FromMilliseconds(40));
 
   // Run a nested, straight Gtk message loop.
-  runner->RunLoop();
+  {
+    MessageLoopCurrent::ScopedNestableTaskAllower allow_nestable_tasks;
+    runner->RunLoop();
+  }
 
   ASSERT_EQ(3, task_count);
   EXPECT_EQ(4, injector->processed_events());