| 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/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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 base::InjectionArc(dev_null, STDIN_FILENO, true)); | 186 base::InjectionArc(dev_null, STDIN_FILENO, true)); |
| 187 // Adding another element here? Remeber to increase the argument to | 187 // Adding another element here? Remeber to increase the argument to |
| 188 // reserve(), above. | 188 // reserve(), above. |
| 189 | 189 |
| 190 std::copy(fd_shuffle1.begin(), fd_shuffle1.end(), | 190 std::copy(fd_shuffle1.begin(), fd_shuffle1.end(), |
| 191 std::back_inserter(fd_shuffle2)); | 191 std::back_inserter(fd_shuffle2)); |
| 192 | 192 |
| 193 if (!ShuffleFileDescriptors(&fd_shuffle1)) | 193 if (!ShuffleFileDescriptors(&fd_shuffle1)) |
| 194 _exit(127); | 194 _exit(127); |
| 195 | 195 |
| 196 file_util::SetCurrentDirectory(startup_dir); | 196 base::SetCurrentDirectory(startup_dir); |
| 197 | 197 |
| 198 // TODO(brettw) the base version GetAppOutput does a | 198 // TODO(brettw) the base version GetAppOutput does a |
| 199 // CloseSuperfluousFds call here. Do we need this? | 199 // CloseSuperfluousFds call here. Do we need this? |
| 200 | 200 |
| 201 for (size_t i = 0; i < argv.size(); i++) | 201 for (size_t i = 0; i < argv.size(); i++) |
| 202 argv_cstr[i] = const_cast<char*>(argv[i].c_str()); | 202 argv_cstr[i] = const_cast<char*>(argv[i].c_str()); |
| 203 argv_cstr[argv.size()] = NULL; | 203 argv_cstr[argv.size()] = NULL; |
| 204 execvp(argv_cstr[0], argv_cstr.get()); | 204 execvp(argv_cstr[0], argv_cstr.get()); |
| 205 _exit(127); | 205 _exit(127); |
| 206 } | 206 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 msg); | 406 msg); |
| 407 return Value(); | 407 return Value(); |
| 408 } | 408 } |
| 409 | 409 |
| 410 // Default to None value for the input conversion if unspecified. | 410 // Default to None value for the input conversion if unspecified. |
| 411 return ConvertInputToValue(output, function, | 411 return ConvertInputToValue(output, function, |
| 412 args.size() >= 3 ? args[2] : Value(), err); | 412 args.size() >= 3 ? args[2] : Value(), err); |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace functions | 415 } // namespace functions |
| OLD | NEW |