Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1068)

Unified Diff: tools/gn/loader.h

Issue 2130443002: Remove calls to MessageLoop::current() in tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR brettw (add comment) Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gn/loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/loader.h
diff --git a/tools/gn/loader.h b/tools/gn/loader.h
index a610835aa3958389f4d04f3d7e86a18ae6c74a17..17f7110ed763e86e17bcb9e1fcff040d37da3fa2 100644
--- a/tools/gn/loader.h
+++ b/tools/gn/loader.h
@@ -11,13 +11,10 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "base/single_thread_task_runner.h"
#include "tools/gn/label.h"
#include "tools/gn/scope.h"
-namespace base {
-class MessageLoop;
-}
-
class BuildSettings;
class LocationRange;
class Settings;
@@ -90,10 +87,13 @@ class LoaderImpl : public Loader {
Label GetDefaultToolchain() const override;
const Settings* GetToolchainSettings(const Label& label) const override;
- // Sets the message loop corresponding to the main thread. By default this
+ // Sets the task runner corresponding to the main thread. By default this
// class will use the thread active during construction, but there is not
- // a message loop active during construction all the time.
- void set_main_loop(base::MessageLoop* loop) { main_loop_ = loop; }
+ // a task runner active during construction all the time.
+ void set_task_runner(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
+ task_runner_ = task_runner;
+ }
// The complete callback is called whenever there are no more pending loads.
// Called on the main thread only. This may be called more than once if the
@@ -159,7 +159,7 @@ class LoaderImpl : public Loader {
const base::Callback<void(const ParseNode*)>& callback,
Err* err);
- base::MessageLoop* main_loop_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
int pending_loads_;
base::Closure complete_callback_;
« no previous file with comments | « no previous file | tools/gn/loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698