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

Side by Side Diff: chromeos/process_proxy/process_proxy.cc

Issue 555313002: Cleanup: Use base/files/file_util.h instead of base/file_util.h in ash/, athena/, and chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chromeos/process_proxy/process_proxy.h" 5 #include "chromeos/process_proxy/process_proxy.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <sys/ioctl.h> 9 #include <sys/ioctl.h>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/file_util.h" 13 #include "base/files/file_util.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/posix/eintr_wrapper.h" 15 #include "base/posix/eintr_wrapper.h"
16 #include "base/process/kill.h" 16 #include "base/process/kill.h"
17 #include "base/process/launch.h" 17 #include "base/process/launch.h"
18 #include "base/threading/thread.h" 18 #include "base/threading/thread.h"
19 #include "chromeos/process_proxy/process_output_watcher.h" 19 #include "chromeos/process_proxy/process_output_watcher.h"
20 #include "third_party/cros_system_api/switches/chrome_switches.h" 20 #include "third_party/cros_system_api/switches/chrome_switches.h"
21 21
22 namespace { 22 namespace {
23 23
(...skipping 12 matching lines...) Expand all
36 } // namespace 36 } // namespace
37 37
38 namespace chromeos { 38 namespace chromeos {
39 39
40 ProcessProxy::ProcessProxy(): process_launched_(false), 40 ProcessProxy::ProcessProxy(): process_launched_(false),
41 callback_set_(false), 41 callback_set_(false),
42 watcher_started_(false) { 42 watcher_started_(false) {
43 // Set pipes to initial, invalid value so we can easily know if a pipe was 43 // Set pipes to initial, invalid value so we can easily know if a pipe was
44 // opened by us. 44 // opened by us.
45 ClearAllFdPairs(); 45 ClearAllFdPairs();
46 }; 46 }
47 47
48 bool ProcessProxy::Open(const std::string& command, pid_t* pid) { 48 bool ProcessProxy::Open(const std::string& command, pid_t* pid) {
49 if (process_launched_) 49 if (process_launched_)
50 return false; 50 return false;
51 51
52 if (!CreatePseudoTerminalPair(pt_pair_)) { 52 if (!CreatePseudoTerminalPair(pt_pair_)) {
53 return false; 53 return false;
54 } 54 }
55 55
56 process_launched_ = LaunchProcess(command, pt_pair_[PT_SLAVE_FD], &pid_); 56 process_launched_ = LaunchProcess(command, pt_pair_[PT_SLAVE_FD], &pid_);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 ClearFdPair(pt_pair_); 259 ClearFdPair(pt_pair_);
260 ClearFdPair(shutdown_pipe_); 260 ClearFdPair(shutdown_pipe_);
261 } 261 }
262 262
263 void ProcessProxy::ClearFdPair(int* pipe) { 263 void ProcessProxy::ClearFdPair(int* pipe) {
264 pipe[PIPE_END_READ] = kInvalidFd; 264 pipe[PIPE_END_READ] = kInvalidFd;
265 pipe[PIPE_END_WRITE] = kInvalidFd; 265 pipe[PIPE_END_WRITE] = kInvalidFd;
266 } 266 }
267 267
268 } // namespace chromeos 268 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/process_proxy/process_output_watcher_unittest.cc ('k') | chromeos/settings/timezone_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698