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

Unified Diff: tools/gn/function_toolchain.cc

Issue 56433003: GN threading refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « tools/gn/function_set_default_toolchain.cc ('k') | tools/gn/functions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_toolchain.cc
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc
index dde0306fb14cdc91922c1e534c010e5c47b7400b..cbd8826fa850180a94c23a31bea212779845131a 100644
--- a/tools/gn/function_toolchain.cc
+++ b/tools/gn/function_toolchain.cc
@@ -98,14 +98,15 @@ Value RunToolchain(Scope* scope,
const SourceDir& input_dir = scope->GetSourceDir();
Label label(input_dir, args[0].string_value());
if (g_scheduler->verbose_logging())
- g_scheduler->Log("Generating toolchain", label.GetUserVisibleName(false));
+ g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false));
// This object will actually be copied into the one owned by the toolchain
// manager, but that has to be done in the lock.
- Toolchain toolchain(scope->settings(), label);
+ scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label));
+ toolchain->set_defined_from(function);
Scope block_scope(scope);
- block_scope.SetProperty(&kToolchainPropertyKey, &toolchain);
+ block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get());
block->ExecuteBlockInScope(&block_scope, err);
block_scope.SetProperty(&kToolchainPropertyKey, NULL);
if (err->has_error())
@@ -113,17 +114,7 @@ Value RunToolchain(Scope* scope,
if (!block_scope.CheckForUnusedVars(err))
return Value();
- const BuildSettings* build_settings = scope->settings()->build_settings();
- {
- // Save the toolchain definition in the toolchain manager and mark the
- // corresponding item in the dependency tree resolved so that targets
- // that depend on this toolchain know it's ready.
- base::AutoLock lock(build_settings->item_tree().lock());
- build_settings->toolchain_manager().SetToolchainDefinitionLocked(
- toolchain, function->GetRange(), err);
- build_settings->item_tree().MarkItemDefinedLocked(build_settings, label,
- err);
- }
+ scope->settings()->build_settings()->ItemDefined(toolchain.PassAs<Item>());
return Value();
}
« no previous file with comments | « tools/gn/function_set_default_toolchain.cc ('k') | tools/gn/functions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698