| 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 #include <wincrypt.h> | 8 #include <wincrypt.h> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // 64-bit)." | 122 // 64-bit)." |
| 123 python_command.AppendArg("--startup-pipe=" + | 123 python_command.AppendArg("--startup-pipe=" + |
| 124 base::IntToString(reinterpret_cast<uintptr_t>(child_write))); | 124 base::IntToString(reinterpret_cast<uintptr_t>(child_write))); |
| 125 | 125 |
| 126 job_handle_.Set(CreateJobObject(NULL, NULL)); | 126 job_handle_.Set(CreateJobObject(NULL, NULL)); |
| 127 if (!job_handle_.IsValid()) { | 127 if (!job_handle_.IsValid()) { |
| 128 LOG(ERROR) << "Could not create JobObject."; | 128 LOG(ERROR) << "Could not create JobObject."; |
| 129 return false; | 129 return false; |
| 130 } | 130 } |
| 131 | 131 |
| 132 if (!base::SetJobObjectAsKillOnJobClose(job_handle_.Get())) { | 132 if (!base::SetJobObjectLimitFlags(job_handle_.Get(), |
| 133 LOG(ERROR) << "Could not SetInformationJobObject."; | 133 JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE)) { |
| 134 LOG(ERROR) << "Could not SetJobObjectLimitFlags."; |
| 134 return false; | 135 return false; |
| 135 } | 136 } |
| 136 | 137 |
| 137 base::LaunchOptions launch_options; | 138 base::LaunchOptions launch_options; |
| 138 launch_options.inherit_handles = true; | 139 launch_options.inherit_handles = true; |
| 139 launch_options.job_handle = job_handle_.Get(); | 140 launch_options.job_handle = job_handle_.Get(); |
| 140 if (!base::LaunchProcess(python_command, launch_options, &process_handle_)) { | 141 if (!base::LaunchProcess(python_command, launch_options, &process_handle_)) { |
| 141 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString(); | 142 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString(); |
| 142 return false; | 143 return false; |
| 143 } | 144 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 166 if (!ParseServerData(server_data)) { | 167 if (!ParseServerData(server_data)) { |
| 167 LOG(ERROR) << "Could not parse server_data: " << server_data; | 168 LOG(ERROR) << "Could not parse server_data: " << server_data; |
| 168 return false; | 169 return false; |
| 169 } | 170 } |
| 170 | 171 |
| 171 return true; | 172 return true; |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace net | 175 } // namespace net |
| 175 | 176 |
| OLD | NEW |