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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "tools/gn/build_settings.h" | 10 #include "tools/gn/build_settings.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 base::Bind(&LoaderImpl::DecrementPendingLoads, this)); | 237 base::Bind(&LoaderImpl::DecrementPendingLoads, this)); |
238 return; | 238 return; |
239 } | 239 } |
240 | 240 |
241 if (g_scheduler->verbose_logging()) { | 241 if (g_scheduler->verbose_logging()) { |
242 g_scheduler->Log("Running", file_name.value() + " with toolchain " + | 242 g_scheduler->Log("Running", file_name.value() + " with toolchain " + |
243 settings->toolchain_label().GetUserVisibleName(false)); | 243 settings->toolchain_label().GetUserVisibleName(false)); |
244 } | 244 } |
245 | 245 |
246 Scope our_scope(settings->base_config()); | 246 Scope our_scope(settings->base_config()); |
247 ScopePerFileProvider per_file_provider(&our_scope); | 247 ScopePerFileProvider per_file_provider(&our_scope, true); |
248 our_scope.set_source_dir(file_name.GetDir()); | 248 our_scope.set_source_dir(file_name.GetDir()); |
249 | 249 |
250 ScopedTrace trace(TraceItem::TRACE_FILE_EXECUTE, file_name.value()); | 250 ScopedTrace trace(TraceItem::TRACE_FILE_EXECUTE, file_name.value()); |
251 trace.SetToolchain(settings->toolchain_label()); | 251 trace.SetToolchain(settings->toolchain_label()); |
252 | 252 |
253 Err err; | 253 Err err; |
254 root->Execute(&our_scope, &err); | 254 root->Execute(&our_scope, &err); |
255 if (err.has_error()) | 255 if (err.has_error()) |
256 g_scheduler->FailWithError(err); | 256 g_scheduler->FailWithError(err); |
257 | 257 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 const SourceFile& file_name, | 392 const SourceFile& file_name, |
393 const base::Callback<void(const ParseNode*)>& callback, | 393 const base::Callback<void(const ParseNode*)>& callback, |
394 Err* err) { | 394 Err* err) { |
395 if (async_load_file_.is_null()) { | 395 if (async_load_file_.is_null()) { |
396 return g_scheduler->input_file_manager()->AsyncLoadFile( | 396 return g_scheduler->input_file_manager()->AsyncLoadFile( |
397 origin, build_settings, file_name, callback, err); | 397 origin, build_settings, file_name, callback, err); |
398 } | 398 } |
399 return async_load_file_.Run( | 399 return async_load_file_.Run( |
400 origin, build_settings, file_name, callback, err); | 400 origin, build_settings, file_name, callback, err); |
401 } | 401 } |
OLD | NEW |