Chromium Code Reviews| Index: tools/gn/loader.cc |
| diff --git a/tools/gn/loader.cc b/tools/gn/loader.cc |
| index 69fb7668e17dd200c23ec5b37a7f591c5f774d5a..54e36495f50f7966954affd5cdef1745e2a7d3a1 100644 |
| --- a/tools/gn/loader.cc |
| +++ b/tools/gn/loader.cc |
| @@ -6,8 +6,7 @@ |
| #include "base/bind.h" |
| #include "base/memory/ptr_util.h" |
| -#include "base/message_loop/message_loop.h" |
| -#include "base/single_thread_task_runner.h" |
| +#include "base/threading/thread_task_runner_handle.h" |
| #include "tools/gn/build_settings.h" |
| #include "tools/gn/err.h" |
| #include "tools/gn/filesystem_utils.h" |
| @@ -100,9 +99,9 @@ SourceFile Loader::BuildFileForLabel(const Label& label) { |
| // ----------------------------------------------------------------------------- |
| LoaderImpl::LoaderImpl(const BuildSettings* build_settings) |
| - : main_loop_(base::MessageLoop::current()), |
| - pending_loads_(0), |
| - build_settings_(build_settings) { |
| + : pending_loads_(0), build_settings_(build_settings) { |
| + if (base::ThreadTaskRunnerHandle::IsSet()) |
|
brettw
2016/07/11 20:47:25
Can you add a comment here that there may be no ac
fdoray
2016/07/18 15:28:40
Done.
|
| + task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
| } |
| LoaderImpl::~LoaderImpl() { |
| @@ -239,7 +238,7 @@ void LoaderImpl::BackgroundLoadFile(const Settings* settings, |
| const LocationRange& origin, |
| const ParseNode* root) { |
| if (!root) { |
| - main_loop_->task_runner()->PostTask( |
| + task_runner_->PostTask( |
| FROM_HERE, base::Bind(&LoaderImpl::DecrementPendingLoads, this)); |
| return; |
| } |
| @@ -280,8 +279,7 @@ void LoaderImpl::BackgroundLoadFile(const Settings* settings, |
| trace.Done(); |
| - main_loop_->task_runner()->PostTask( |
| - FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this)); |
| + task_runner_->PostTask(FROM_HERE, base::Bind(&LoaderImpl::DidLoadFile, this)); |
| } |
| void LoaderImpl::BackgroundLoadBuildConfig( |
| @@ -289,7 +287,7 @@ void LoaderImpl::BackgroundLoadBuildConfig( |
| const Scope::KeyValueMap& toolchain_overrides, |
| const ParseNode* root) { |
| if (!root) { |
| - main_loop_->task_runner()->PostTask( |
| + task_runner_->PostTask( |
| FROM_HERE, base::Bind(&LoaderImpl::DecrementPendingLoads, this)); |
| return; |
| } |
| @@ -339,9 +337,9 @@ void LoaderImpl::BackgroundLoadBuildConfig( |
| } |
| } |
| - main_loop_->task_runner()->PostTask( |
| - FROM_HERE, base::Bind(&LoaderImpl::DidLoadBuildConfig, this, |
| - settings->toolchain_label())); |
| + task_runner_->PostTask(FROM_HERE, |
| + base::Bind(&LoaderImpl::DidLoadBuildConfig, this, |
| + settings->toolchain_label())); |
| } |
| void LoaderImpl::DidLoadFile() { |