| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/media/test_license_server.h" | 5 #include "chrome/browser/media/test_license_server.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/process/kill.h" | 9 #include "base/process/kill.h" |
| 10 #include "base/process/launch.h" | 10 #include "base/process/launch.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 bool TestLicenseServer::Start() { | 23 bool TestLicenseServer::Start() { |
| 24 if (license_server_process_.IsValid()) | 24 if (license_server_process_.IsValid()) |
| 25 return true; | 25 return true; |
| 26 | 26 |
| 27 if (!server_config_->IsPlatformSupported()) { | 27 if (!server_config_->IsPlatformSupported()) { |
| 28 DVLOG(0) << "License server is not supported on current platform."; | 28 DVLOG(0) << "License server is not supported on current platform."; |
| 29 return false; | 29 return false; |
| 30 } | 30 } |
| 31 | 31 |
| 32 CommandLine command_line(CommandLine::NO_PROGRAM); | 32 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
| 33 if (!server_config_->GetServerCommandLine(&command_line)) { | 33 if (!server_config_->GetServerCommandLine(&command_line)) { |
| 34 DVLOG(0) << "Could not get server command line to launch."; | 34 DVLOG(0) << "Could not get server command line to launch."; |
| 35 return false; | 35 return false; |
| 36 } | 36 } |
| 37 | 37 |
| 38 DVLOG(0) << "Starting test license server " << | 38 DVLOG(0) << "Starting test license server " << |
| 39 command_line.GetCommandLineString(); | 39 command_line.GetCommandLineString(); |
| 40 license_server_process_ = | 40 license_server_process_ = |
| 41 base::LaunchProcess(command_line, base::LaunchOptions()); | 41 base::LaunchProcess(command_line, base::LaunchOptions()); |
| 42 if (!license_server_process_.IsValid()) { | 42 if (!license_server_process_.IsValid()) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 57 license_server_process_.Close(); | 57 license_server_process_.Close(); |
| 58 } else { | 58 } else { |
| 59 DVLOG(1) << "Kill failed?!"; | 59 DVLOG(1) << "Kill failed?!"; |
| 60 } | 60 } |
| 61 return kill_succeeded; | 61 return kill_succeeded; |
| 62 } | 62 } |
| 63 | 63 |
| 64 std::string TestLicenseServer::GetServerURL() { | 64 std::string TestLicenseServer::GetServerURL() { |
| 65 return server_config_->GetServerURL(); | 65 return server_config_->GetServerURL(); |
| 66 } | 66 } |
| OLD | NEW |