| 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 "net/test/spawned_test_server/local_test_server.h" | 5 #include "net/test/spawned_test_server/local_test_server.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // interoperability. When sharing a handle between 32-bit and 64-bit | 169 // interoperability. When sharing a handle between 32-bit and 64-bit |
| 170 // applications, only the lower 32 bits are significant, so it is | 170 // applications, only the lower 32 bits are significant, so it is |
| 171 // safe to truncate the handle (when passing it from 64-bit to | 171 // safe to truncate the handle (when passing it from 64-bit to |
| 172 // 32-bit) or sign-extend the handle (when passing it from 32-bit to | 172 // 32-bit) or sign-extend the handle (when passing it from 32-bit to |
| 173 // 64-bit)." | 173 // 64-bit)." |
| 174 python_command.AppendArg("--startup-pipe=" + | 174 python_command.AppendArg("--startup-pipe=" + |
| 175 base::IntToString(reinterpret_cast<uintptr_t>(child_write))); | 175 base::IntToString(reinterpret_cast<uintptr_t>(child_write))); |
| 176 | 176 |
| 177 base::LaunchOptions launch_options; | 177 base::LaunchOptions launch_options; |
| 178 launch_options.inherit_handles = true; | 178 launch_options.inherit_handles = true; |
| 179 if (!base::LaunchProcess(python_command, launch_options, &process_handle_)) { | 179 process_ = base::LaunchProcess(python_command, launch_options); |
| 180 if (!process_.IsValid()) { |
| 180 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString(); | 181 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString(); |
| 181 return false; | 182 return false; |
| 182 } | 183 } |
| 183 | 184 |
| 184 return true; | 185 return true; |
| 185 } | 186 } |
| 186 | 187 |
| 187 bool LocalTestServer::WaitToStart() { | 188 bool LocalTestServer::WaitToStart() { |
| 188 base::win::ScopedHandle read_fd(child_read_fd_.Take()); | 189 base::win::ScopedHandle read_fd(child_read_fd_.Take()); |
| 189 base::win::ScopedHandle write_fd(child_write_fd_.Take()); | 190 base::win::ScopedHandle write_fd(child_write_fd_.Take()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 205 if (!ParseServerData(server_data)) { | 206 if (!ParseServerData(server_data)) { |
| 206 LOG(ERROR) << "Could not parse server_data: " << server_data; | 207 LOG(ERROR) << "Could not parse server_data: " << server_data; |
| 207 return false; | 208 return false; |
| 208 } | 209 } |
| 209 | 210 |
| 210 return true; | 211 return true; |
| 211 } | 212 } |
| 212 | 213 |
| 213 } // namespace net | 214 } // namespace net |
| 214 | 215 |
| OLD | NEW |