OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 | 5 |
6 #include "base/process_util.h" | 6 #include "base/process_util.h" |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <spawn.h> | 9 #include <spawn.h> |
10 #include <string> | 10 #include <string> |
11 #include <sys/types.h> | 11 #include <sys/types.h> |
12 #include <sys/wait.h> | 12 #include <sys/wait.h> |
13 | 13 |
14 namespace process_util { | 14 namespace base { |
15 | 15 |
16 bool LaunchApp(const std::vector<std::string>& argv, | 16 bool LaunchApp(const std::vector<std::string>& argv, |
17 bool wait, ProcessHandle* process_handle) { | 17 bool wait, ProcessHandle* process_handle) { |
18 bool retval = true; | 18 bool retval = true; |
19 | 19 |
20 char* argv_copy[argv.size() + 1]; | 20 char* argv_copy[argv.size() + 1]; |
21 for (size_t i = 0; i < argv.size(); i++) { | 21 for (size_t i = 0; i < argv.size(); i++) { |
22 argv_copy[i] = const_cast<char*>(argv[i].c_str()); | 22 argv_copy[i] = const_cast<char*>(argv[i].c_str()); |
23 } | 23 } |
24 argv_copy[argv.size()] = NULL; | 24 argv_copy[argv.size()] = NULL; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 int status; | 56 int status; |
57 waitpid(handle, &status, 0); | 57 waitpid(handle, &status, 0); |
58 return WIFEXITED(status); | 58 return WIFEXITED(status); |
59 } | 59 } |
60 | 60 |
61 bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) { | 61 bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) { |
62 // TODO(pinkerton): can we implement this? On linux it relies on /proc. | 62 // TODO(pinkerton): can we implement this? On linux it relies on /proc. |
63 return false; | 63 return false; |
64 } | 64 } |
65 | 65 |
66 } // namespace process_util | 66 } // namespace base |
OLD | NEW |