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/local_test_server.h" | 5 #include "net/test/local_test_server.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return SetupWhenServerStarted(); | 115 return SetupWhenServerStarted(); |
116 } | 116 } |
117 | 117 |
118 bool LocalTestServer::Stop() { | 118 bool LocalTestServer::Stop() { |
119 CleanUpWhenStoppingServer(); | 119 CleanUpWhenStoppingServer(); |
120 | 120 |
121 if (!process_handle_) | 121 if (!process_handle_) |
122 return true; | 122 return true; |
123 | 123 |
124 // First check if the process has already terminated. | 124 // First check if the process has already terminated. |
125 bool ret = base::WaitForSingleProcess(process_handle_, 0); | 125 bool ret = base::WaitForSingleProcess(process_handle_, base::TimeDelta()); |
126 if (!ret) | 126 if (!ret) |
127 ret = base::KillProcess(process_handle_, 1, true); | 127 ret = base::KillProcess(process_handle_, 1, true); |
128 | 128 |
129 if (ret) { | 129 if (ret) { |
130 base::CloseProcessHandle(process_handle_); | 130 base::CloseProcessHandle(process_handle_); |
131 process_handle_ = base::kNullProcessHandle; | 131 process_handle_ = base::kNullProcessHandle; |
132 } else { | 132 } else { |
133 VLOG(1) << "Kill failed?"; | 133 VLOG(1) << "Kill failed?"; |
134 } | 134 } |
135 | 135 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 break; | 244 break; |
245 default: | 245 default: |
246 NOTREACHED(); | 246 NOTREACHED(); |
247 return false; | 247 return false; |
248 } | 248 } |
249 | 249 |
250 return true; | 250 return true; |
251 } | 251 } |
252 | 252 |
253 } // namespace net | 253 } // namespace net |
OLD | NEW |