| OLD | NEW |
| 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 "chrome/test/chromedriver/chrome_impl.h" | 5 #include "chrome/test/chromedriver/chrome_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 9 #include "chrome/test/chromedriver/status.h" | 9 #include "chrome/test/chromedriver/status.h" |
| 10 | 10 |
| 11 ChromeImpl::ChromeImpl(base::ProcessHandle process, | 11 ChromeImpl::ChromeImpl(base::ProcessHandle process, |
| 12 ScopedTempDir* user_data_dir) | 12 base::ScopedTempDir* user_data_dir) |
| 13 : process_(process) { | 13 : process_(process) { |
| 14 if (user_data_dir->IsValid()) { | 14 if (user_data_dir->IsValid()) { |
| 15 CHECK(user_data_dir_.Set(user_data_dir->Take())); | 15 CHECK(user_data_dir_.Set(user_data_dir->Take())); |
| 16 } | 16 } |
| 17 } | 17 } |
| 18 | 18 |
| 19 ChromeImpl::~ChromeImpl() { | 19 ChromeImpl::~ChromeImpl() { |
| 20 base::CloseProcessHandle(process_); | 20 base::CloseProcessHandle(process_); |
| 21 } | 21 } |
| 22 | 22 |
| 23 Status ChromeImpl::Quit() { | 23 Status ChromeImpl::Quit() { |
| 24 if (!base::KillProcess(process_, 0, true)) | 24 if (!base::KillProcess(process_, 0, true)) |
| 25 return Status(kUnknownError, "cannot kill Chrome"); | 25 return Status(kUnknownError, "cannot kill Chrome"); |
| 26 return Status(kOk); | 26 return Status(kOk); |
| 27 } | 27 } |
| OLD | NEW |