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

Unified Diff: tools/gn/config.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/config.h ('k') | tools/gn/config_values_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/config.cc
diff --git a/tools/gn/config.cc b/tools/gn/config.cc
index 5b89e2beb020d82ca179e6b866b5a49ae529960b..dce951f65b33384fec9403cb65176ef6354662d8 100644
--- a/tools/gn/config.cc
+++ b/tools/gn/config.cc
@@ -6,8 +6,6 @@
#include "tools/gn/err.h"
#include "tools/gn/input_file_manager.h"
-#include "tools/gn/item_node.h"
-#include "tools/gn/item_tree.h"
#include "tools/gn/scheduler.h"
Config::Config(const Settings* settings, const Label& label)
@@ -24,59 +22,3 @@ Config* Config::AsConfig() {
const Config* Config::AsConfig() const {
return this;
}
-
-// static
-Config* Config::GetConfig(const Settings* settings,
- const LocationRange& specified_from_here,
- const Label& label,
- Item* dep_from,
- Err* err) {
- DCHECK(!label.is_null());
-
- ItemTree* tree = &settings->build_settings()->item_tree();
- base::AutoLock lock(tree->lock());
-
- ItemNode* node = tree->GetExistingNodeLocked(label);
- Config* config = NULL;
- if (!node) {
- config = new Config(settings, label);
- node = new ItemNode(config);
- node->set_originally_referenced_from_here(specified_from_here);
- tree->AddNodeLocked(node);
-
- // Only schedule loading the given target if somebody is depending on it
- // (and we optimize by not re-asking it to run the current file).
- // Otherwise, we're probably generating it right now.
- if (dep_from && dep_from->label().dir() != label.dir()) {
- settings->build_settings()->toolchain_manager().ScheduleInvocationLocked(
- specified_from_here, label.GetToolchainLabel(), label.dir(),
- err);
- }
- } else if ((config = node->item()->AsConfig())) {
- // Previously saw this item as a config.
-
- // If we have no dep_from, we're generating it. In this case, it had better
- // not already be generated.
- if (!dep_from && node->state() != ItemNode::REFERENCED) {
- *err = Err(specified_from_here, "Duplicate config definition.",
- "You already told me about a config with this name.");
- return NULL;
- }
- } else {
- // Previously saw this thing as a non-config.
- *err = Err(specified_from_here,
- "Config name already used.",
- "Previously you specified a " +
- node->item()->GetItemTypeName() + " with this name instead.");
- return NULL;
- }
-
- // Keep a record of the guy asking us for this dependency. We know if
- // somebody is adding a dependency, that guy it himself not resolved.
- if (dep_from) {
- if (!dep_from->item_node()->AddDependency(
- settings->build_settings(), specified_from_here, node, err))
- return NULL;
- }
- return config;
-}
« no previous file with comments | « tools/gn/config.h ('k') | tools/gn/config_values_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698