Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: net/test/local_test_server.cc

Issue 10692155: Switch to TimeDelta interfaces for process waiting functions in net and ipc. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc ('k') | net/test/local_test_server_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698