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

Unified Diff: trunk/src/tools/gn/config.cc

Issue 21084010: Revert 214254 "Add initial prototype for the GN meta-buildsystem." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 5 months 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 | « trunk/src/tools/gn/config.h ('k') | trunk/src/tools/gn/config_values.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/tools/gn/config.cc
===================================================================
--- trunk/src/tools/gn/config.cc (revision 214322)
+++ trunk/src/tools/gn/config.cc (working copy)
@@ -1,78 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "tools/gn/config.h"
-
-#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 Label& label) : Item(label) {
-}
-
-Config::~Config() {
-}
-
-Config* Config::AsConfig() {
- return this;
-}
-
-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(label);
- node = new ItemNode(config);
- 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 && node->state() != ItemNode::RESOLVED)
- tree->GetExistingNodeLocked(dep_from->label())->AddDependency(node);
-
- return config;
-}
« no previous file with comments | « trunk/src/tools/gn/config.h ('k') | trunk/src/tools/gn/config_values.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698