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

Side by Side Diff: tools/gn/loader.cc

Issue 279023002: Add GN function get_label_info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comment Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/gn.gyp ('k') | tools/gn/scope_per_file_provider_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/loader.h" 5 #include "tools/gn/loader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "tools/gn/build_settings.h" 10 #include "tools/gn/build_settings.h"
11 #include "tools/gn/err.h" 11 #include "tools/gn/err.h"
12 #include "tools/gn/filesystem_utils.h" 12 #include "tools/gn/filesystem_utils.h"
13 #include "tools/gn/input_file_manager.h" 13 #include "tools/gn/input_file_manager.h"
14 #include "tools/gn/parse_tree.h" 14 #include "tools/gn/parse_tree.h"
15 #include "tools/gn/scheduler.h" 15 #include "tools/gn/scheduler.h"
16 #include "tools/gn/scope_per_file_provider.h" 16 #include "tools/gn/scope_per_file_provider.h"
17 #include "tools/gn/settings.h" 17 #include "tools/gn/settings.h"
18 #include "tools/gn/source_dir.h" 18 #include "tools/gn/source_dir.h"
19 #include "tools/gn/source_file.h" 19 #include "tools/gn/source_file.h"
20 #include "tools/gn/trace.h" 20 #include "tools/gn/trace.h"
21 21
22 namespace {
23
24 std::string GetOutputSubdirName(const Label& toolchain_label, bool is_default) {
25 // The default toolchain has no subdir.
26 if (is_default)
27 return std::string();
28
29 // For now just assume the toolchain name is always a valid dir name. We may
30 // want to clean up the in the future.
31 return toolchain_label.name();
32 }
33
34 } // namespace
35
36 // Identifies one time a file is loaded in a given toolchain so we don't load 22 // Identifies one time a file is loaded in a given toolchain so we don't load
37 // it more than once. 23 // it more than once.
38 struct LoaderImpl::LoadID { 24 struct LoaderImpl::LoadID {
39 LoadID() {} 25 LoadID() {}
40 LoadID(const SourceFile& f, const Label& tc_name) 26 LoadID(const SourceFile& f, const Label& tc_name)
41 : file(f), 27 : file(f),
42 toolchain_name(tc_name) { 28 toolchain_name(tc_name) {
43 } 29 }
44 30
45 bool operator<(const LoadID& other) const { 31 bool operator<(const LoadID& other) const {
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 const SourceFile& file_name, 386 const SourceFile& file_name,
401 const base::Callback<void(const ParseNode*)>& callback, 387 const base::Callback<void(const ParseNode*)>& callback,
402 Err* err) { 388 Err* err) {
403 if (async_load_file_.is_null()) { 389 if (async_load_file_.is_null()) {
404 return g_scheduler->input_file_manager()->AsyncLoadFile( 390 return g_scheduler->input_file_manager()->AsyncLoadFile(
405 origin, build_settings, file_name, callback, err); 391 origin, build_settings, file_name, callback, err);
406 } 392 }
407 return async_load_file_.Run( 393 return async_load_file_.Run(
408 origin, build_settings, file_name, callback, err); 394 origin, build_settings, file_name, callback, err);
409 } 395 }
OLDNEW
« no previous file with comments | « tools/gn/gn.gyp ('k') | tools/gn/scope_per_file_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698