| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "tools/gn/loader.h" | 5 #include "tools/gn/loader.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "tools/gn/build_settings.h" | 10 #include "tools/gn/build_settings.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 FROM_HERE, base::Bind(&LoaderImpl::DecrementPendingLoads, this)); | 244 FROM_HERE, base::Bind(&LoaderImpl::DecrementPendingLoads, this)); |
| 245 return; | 245 return; |
| 246 } | 246 } |
| 247 | 247 |
| 248 if (g_scheduler->verbose_logging()) { | 248 if (g_scheduler->verbose_logging()) { |
| 249 g_scheduler->Log("Running", file_name.value() + " with toolchain " + | 249 g_scheduler->Log("Running", file_name.value() + " with toolchain " + |
| 250 settings->toolchain_label().GetUserVisibleName(false)); | 250 settings->toolchain_label().GetUserVisibleName(false)); |
| 251 } | 251 } |
| 252 | 252 |
| 253 Scope our_scope(settings->base_config()); | 253 Scope our_scope(settings->base_config()); |
| 254 our_scope.AddSourceFile(file_name); |
| 254 ScopePerFileProvider per_file_provider(&our_scope, true); | 255 ScopePerFileProvider per_file_provider(&our_scope, true); |
| 255 our_scope.set_source_dir(file_name.GetDir()); | 256 our_scope.set_source_dir(file_name.GetDir()); |
| 256 | 257 |
| 257 // Targets, etc. generated as part of running this file will end up here. | 258 // Targets, etc. generated as part of running this file will end up here. |
| 258 Scope::ItemVector collected_items; | 259 Scope::ItemVector collected_items; |
| 259 our_scope.set_item_collector(&collected_items); | 260 our_scope.set_item_collector(&collected_items); |
| 260 | 261 |
| 261 ScopedTrace trace(TraceItem::TRACE_FILE_EXECUTE, file_name.value()); | 262 ScopedTrace trace(TraceItem::TRACE_FILE_EXECUTE, file_name.value()); |
| 262 trace.SetToolchain(settings->toolchain_label()); | 263 trace.SetToolchain(settings->toolchain_label()); |
| 263 | 264 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 const SourceFile& file_name, | 422 const SourceFile& file_name, |
| 422 const base::Callback<void(const ParseNode*)>& callback, | 423 const base::Callback<void(const ParseNode*)>& callback, |
| 423 Err* err) { | 424 Err* err) { |
| 424 if (async_load_file_.is_null()) { | 425 if (async_load_file_.is_null()) { |
| 425 return g_scheduler->input_file_manager()->AsyncLoadFile( | 426 return g_scheduler->input_file_manager()->AsyncLoadFile( |
| 426 origin, build_settings, file_name, callback, err); | 427 origin, build_settings, file_name, callback, err); |
| 427 } | 428 } |
| 428 return async_load_file_.Run( | 429 return async_load_file_.Run( |
| 429 origin, build_settings, file_name, callback, err); | 430 origin, build_settings, file_name, callback, err); |
| 430 } | 431 } |
| OLD | NEW |