OLD | NEW |
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/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 return Value(); | 121 return Value(); |
122 g_scheduler->AddGenDependency( | 122 g_scheduler->AddGenDependency( |
123 build_settings->GetFullPath(cur_dir.ResolveRelativeFile( | 123 build_settings->GetFullPath(cur_dir.ResolveRelativeFile( |
124 dep.string_value(), | 124 dep.string_value(), |
125 scope->settings()->build_settings()->root_path_utf8()))); | 125 scope->settings()->build_settings()->root_path_utf8()))); |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 // Make the command line. | 129 // Make the command line. |
130 const base::FilePath& python_path = build_settings->python_path(); | 130 const base::FilePath& python_path = build_settings->python_path(); |
131 CommandLine cmdline(python_path); | 131 base::CommandLine cmdline(python_path); |
132 cmdline.AppendArgPath(script_path); | 132 cmdline.AppendArgPath(script_path); |
133 | 133 |
134 if (args.size() >= 2) { | 134 if (args.size() >= 2) { |
135 // Optional command-line arguments to the script. | 135 // Optional command-line arguments to the script. |
136 const Value& script_args = args[1]; | 136 const Value& script_args = args[1]; |
137 if (!script_args.VerifyTypeIs(Value::LIST, err)) | 137 if (!script_args.VerifyTypeIs(Value::LIST, err)) |
138 return Value(); | 138 return Value(); |
139 for (const auto& arg : script_args.list_value()) { | 139 for (const auto& arg : script_args.list_value()) { |
140 if (!arg.VerifyTypeIs(Value::STRING, err)) | 140 if (!arg.VerifyTypeIs(Value::STRING, err)) |
141 return Value(); | 141 return Value(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 msg); | 200 msg); |
201 return Value(); | 201 return Value(); |
202 } | 202 } |
203 | 203 |
204 // Default to None value for the input conversion if unspecified. | 204 // Default to None value for the input conversion if unspecified. |
205 return ConvertInputToValue(scope->settings(), output, function, | 205 return ConvertInputToValue(scope->settings(), output, function, |
206 args.size() >= 3 ? args[2] : Value(), err); | 206 args.size() >= 3 ? args[2] : Value(), err); |
207 } | 207 } |
208 | 208 |
209 } // namespace functions | 209 } // namespace functions |
OLD | NEW |