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

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

Issue 51693002: GN: toolchain threading cleanup (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/config.cc ('k') | tools/gn/function_toolchain.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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/process/kill.h" 8 #include "base/process/kill.h"
9 #include "base/process/launch.h" 9 #include "base/process/launch.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 SourceFile script_source = 294 SourceFile script_source =
295 cur_dir.ResolveRelativeFile(args[0].string_value()); 295 cur_dir.ResolveRelativeFile(args[0].string_value());
296 base::FilePath script_path = build_settings->GetFullPath(script_source); 296 base::FilePath script_path = build_settings->GetFullPath(script_source);
297 if (!build_settings->secondary_source_path().empty() && 297 if (!build_settings->secondary_source_path().empty() &&
298 !base::PathExists(script_path)) { 298 !base::PathExists(script_path)) {
299 // Fall back to secondary source root when the file doesn't exist. 299 // Fall back to secondary source root when the file doesn't exist.
300 script_path = build_settings->GetFullPathSecondary(script_source); 300 script_path = build_settings->GetFullPathSecondary(script_source);
301 } 301 }
302 302
303 ScopedTrace trace(TraceItem::TRACE_SCRIPT_EXECUTE, script_source.value()); 303 ScopedTrace trace(TraceItem::TRACE_SCRIPT_EXECUTE, script_source.value());
304 trace.SetToolchain(settings->toolchain()->label()); 304 trace.SetToolchain(settings->toolchain_label());
305 305
306 // Add all dependencies of this script, including the script itself, to the 306 // Add all dependencies of this script, including the script itself, to the
307 // build deps. 307 // build deps.
308 g_scheduler->AddGenDependency(script_path); 308 g_scheduler->AddGenDependency(script_path);
309 if (args.size() == 4) { 309 if (args.size() == 4) {
310 const Value& deps_value = args[3]; 310 const Value& deps_value = args[3];
311 if (!deps_value.VerifyTypeIs(Value::LIST, err)) 311 if (!deps_value.VerifyTypeIs(Value::LIST, err))
312 return Value(); 312 return Value();
313 313
314 for (size_t i = 0; i < deps_value.list_value().size(); i++) { 314 for (size_t i = 0; i < deps_value.list_value().size(); i++) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 msg += "."; 388 msg += ".";
389 *err = Err(function->function(), "Script returned non-zero exit code.", 389 *err = Err(function->function(), "Script returned non-zero exit code.",
390 msg); 390 msg);
391 return Value(); 391 return Value();
392 } 392 }
393 393
394 return ConvertInputToValue(output, function, args[2], err); 394 return ConvertInputToValue(output, function, args[2], err);
395 } 395 }
396 396
397 } // namespace functions 397 } // namespace functions
OLDNEW
« no previous file with comments | « tools/gn/config.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698