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

Unified Diff: chrome/browser/media/test_license_server.cc

Issue 789023002: Update browser/media to use the new version of LaunchProcess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/test_license_server.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/test_license_server.cc
diff --git a/chrome/browser/media/test_license_server.cc b/chrome/browser/media/test_license_server.cc
index 92f751f54568261705602a4cb04b38b7aca0d4ea..8efc779ec8a91f811d89a84410f6ee9eec758fff 100644
--- a/chrome/browser/media/test_license_server.cc
+++ b/chrome/browser/media/test_license_server.cc
@@ -13,8 +13,7 @@
TestLicenseServer::TestLicenseServer(
scoped_ptr<TestLicenseServerConfig> server_config)
- : server_config_(server_config.Pass()),
- license_server_process_(base::kNullProcessHandle) {
+ : server_config_(server_config.Pass()) {
}
TestLicenseServer::~TestLicenseServer() {
@@ -22,7 +21,7 @@ TestLicenseServer::~TestLicenseServer() {
}
bool TestLicenseServer::Start() {
- if (license_server_process_ != base::kNullProcessHandle)
+ if (license_server_process_.IsValid())
return true;
if (!server_config_->IsPlatformSupported()) {
@@ -38,24 +37,24 @@ bool TestLicenseServer::Start() {
DVLOG(0) << "Starting test license server " <<
command_line.GetCommandLineString();
- if (!base::LaunchProcess(command_line, base::LaunchOptions(),
- &license_server_process_)) {
+ license_server_process_ =
+ base::LaunchProcess(command_line, base::LaunchOptions());
+ if (!license_server_process_.IsValid()) {
DVLOG(0) << "Failed to start test license server!";
return false;
}
- DCHECK_NE(license_server_process_, base::kNullProcessHandle);
return true;
}
bool TestLicenseServer::Stop() {
- if (license_server_process_ == base::kNullProcessHandle)
+ if (!license_server_process_.IsValid())
return true;
DVLOG(0) << "Killing license server.";
- bool kill_succeeded = base::KillProcess(license_server_process_, 1, true);
+ bool kill_succeeded =
+ base::KillProcess(license_server_process_.Handle(), 1, true);
if (kill_succeeded) {
- base::CloseProcessHandle(license_server_process_);
- license_server_process_ = base::kNullProcessHandle;
+ license_server_process_.Close();
} else {
DVLOG(1) << "Kill failed?!";
}
« no previous file with comments | « chrome/browser/media/test_license_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698