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

Unified Diff: tools/gn/functions.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_toolchain.cc ('k') | tools/gn/functions_target.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/functions.cc
diff --git a/tools/gn/functions.cc b/tools/gn/functions.cc
index 0e2729771c3f8e95267b1782203060a1237b3bd4..96bc915464c873f5e518fceb42301ca57788d63e 100644
--- a/tools/gn/functions.cc
+++ b/tools/gn/functions.cc
@@ -11,12 +11,10 @@
#include "tools/gn/config_values_generator.h"
#include "tools/gn/err.h"
#include "tools/gn/input_file.h"
-#include "tools/gn/item_tree.h"
#include "tools/gn/parse_tree.h"
#include "tools/gn/scheduler.h"
#include "tools/gn/scope.h"
#include "tools/gn/settings.h"
-#include "tools/gn/target_manager.h"
#include "tools/gn/token.h"
#include "tools/gn/value.h"
@@ -261,29 +259,21 @@ Value RunConfig(const FunctionCallNode* function,
Label label(MakeLabelForScope(scope, function, args[0].string_value()));
if (g_scheduler->verbose_logging())
- g_scheduler->Log("Generating config", label.GetUserVisibleName(true));
+ g_scheduler->Log("Defining config", label.GetUserVisibleName(true));
- // Create the empty config object.
- ItemTree* tree = &scope->settings()->build_settings()->item_tree();
- Config* config = Config::GetConfig(scope->settings(), function->GetRange(),
- label, NULL, err);
- if (err->has_error())
- return Value();
+ // Create the new config.
+ scoped_ptr<Config> config(new Config(scope->settings(), label));
+ config->set_defined_from(function);
// Fill it.
const SourceDir& input_dir = scope->GetSourceDir();
- ConfigValuesGenerator gen(&config->config_values(), scope,
- function->function(), input_dir, err);
+ ConfigValuesGenerator gen(&config->config_values(), scope, input_dir, err);
gen.Run();
if (err->has_error())
return Value();
// Mark as complete.
- {
- base::AutoLock lock(tree->lock());
- tree->MarkItemDefinedLocked(scope->settings()->build_settings(), label,
- err);
- }
+ scope->settings()->build_settings()->ItemDefined(config.PassAs<Item>());
return Value();
}
« no previous file with comments | « tools/gn/function_toolchain.cc ('k') | tools/gn/functions_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698