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

Unified Diff: tools/gn/commands.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/command_refs.cc ('k') | tools/gn/config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/commands.cc
diff --git a/tools/gn/commands.cc b/tools/gn/commands.cc
index e600872c431c56751a9723cbd7beba07e64f28fc..d40beab011ae1ef3efeff1f35750c56c60eaba10 100644
--- a/tools/gn/commands.cc
+++ b/tools/gn/commands.cc
@@ -4,7 +4,6 @@
#include "tools/gn/commands.h"
#include "tools/gn/item.h"
-#include "tools/gn/item_node.h"
#include "tools/gn/label.h"
#include "tools/gn/setup.h"
#include "tools/gn/standard_out.h"
@@ -52,7 +51,7 @@ const Target* GetTargetForDesc(const std::vector<std::string>& args) {
if (!setup->DoSetup())
return NULL;
- // FIXME(brettw): set the output dir to be a sandbox one to avoid polluting
+ // TODO(brettw): set the output dir to be a sandbox one to avoid polluting
// the real output dir with files written by the build scripts.
// Do the actual load. This will also write out the target ninja files.
@@ -62,8 +61,7 @@ const Target* GetTargetForDesc(const std::vector<std::string>& args) {
// Need to resolve the label after we know the default toolchain.
// TODO(brettw) find the current directory and resolve the input label
// relative to that.
- Label default_toolchain = setup->build_settings().toolchain_manager()
- .GetDefaultToolchainUnlocked();
+ Label default_toolchain = setup->loader()->default_toolchain_label();
Value arg_value(NULL, args[0]);
Err err;
Label label =
@@ -73,19 +71,14 @@ const Target* GetTargetForDesc(const std::vector<std::string>& args) {
return NULL;
}
- ItemNode* node;
- {
- base::AutoLock lock(setup->build_settings().item_tree().lock());
- node = setup->build_settings().item_tree().GetExistingNodeLocked(label);
- }
- if (!node) {
- Err(Location(), "",
- "I don't know about this \"" + label.GetUserVisibleName(false) +
- "\"").PrintToStdout();
+ const Item* item = setup->builder()->GetItem(label);
+ if (!item) {
+ Err(Location(), "Label not found.",
+ label.GetUserVisibleName(false) + " not found.").PrintToStdout();
return NULL;
}
- const Target* target = node->item()->AsTarget();
+ const Target* target = item->AsTarget();
if (!target) {
Err(Location(), "Not a target.",
"The \"" + label.GetUserVisibleName(false) + "\" thing\n"
« no previous file with comments | « tools/gn/command_refs.cc ('k') | tools/gn/config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698