| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/test/test_server.h" | 5 #include "net/test/test_server.h" |
| 6 | 6 |
| 7 #include <poll.h> | 7 #include <poll.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 file_util::ScopedFD write_closer(&pipefd[1]); | 111 file_util::ScopedFD write_closer(&pipefd[1]); |
| 112 base::file_handle_mapping_vector map_write_fd; | 112 base::file_handle_mapping_vector map_write_fd; |
| 113 map_write_fd.push_back(std::make_pair(pipefd[1], pipefd[1])); | 113 map_write_fd.push_back(std::make_pair(pipefd[1], pipefd[1])); |
| 114 | 114 |
| 115 python_command.AppendSwitchASCII("startup-pipe", | 115 python_command.AppendSwitchASCII("startup-pipe", |
| 116 base::IntToString(pipefd[1])); | 116 base::IntToString(pipefd[1])); |
| 117 | 117 |
| 118 // Try to kill any orphaned testserver processes that may be running. | 118 // Try to kill any orphaned testserver processes that may be running. |
| 119 OrphanedTestServerFilter filter(testserver_path.value(), | 119 OrphanedTestServerFilter filter(testserver_path.value(), |
| 120 base::IntToString(host_port_pair_.port())); | 120 base::IntToString(host_port_pair_.port())); |
| 121 if (!base::KillProcesses(L"python", -1, &filter)) { | 121 if (!base::KillProcesses("python", -1, &filter)) { |
| 122 LOG(WARNING) << "Failed to clean up older orphaned testserver instances."; | 122 LOG(WARNING) << "Failed to clean up older orphaned testserver instances."; |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Launch a new testserver process. | 125 // Launch a new testserver process. |
| 126 if (!base::LaunchApp(python_command.argv(), map_write_fd, false, | 126 if (!base::LaunchApp(python_command.argv(), map_write_fd, false, |
| 127 &process_handle_)) { | 127 &process_handle_)) { |
| 128 LOG(ERROR) << "Failed to launch " << python_command.command_line_string() | 128 LOG(ERROR) << "Failed to launch " << python_command.command_line_string() |
| 129 << " ..."; | 129 << " ..."; |
| 130 return false; | 130 return false; |
| 131 } | 131 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 157 | 157 |
| 158 if (!ParseServerData(server_data)) { | 158 if (!ParseServerData(server_data)) { |
| 159 LOG(ERROR) << "Could not parse server_data: " << server_data; | 159 LOG(ERROR) << "Could not parse server_data: " << server_data; |
| 160 return false; | 160 return false; |
| 161 } | 161 } |
| 162 | 162 |
| 163 return true; | 163 return true; |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace net | 166 } // namespace net |
| OLD | NEW |