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

Unified Diff: net/test/spawned_test_server/local_test_server.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: net/test/spawned_test_server/local_test_server.cc
diff --git a/net/test/spawned_test_server/local_test_server.cc b/net/test/spawned_test_server/local_test_server.cc
index c85e05a8dec8dea98c30ae937facdf08fe10dd06..309c69c5a135548120ea0f7499dede05db5dc7a4 100644
--- a/net/test/spawned_test_server/local_test_server.cc
+++ b/net/test/spawned_test_server/local_test_server.cc
@@ -121,18 +121,17 @@ bool LocalTestServer::BlockUntilStarted() {
bool LocalTestServer::Stop() {
CleanUpWhenStoppingServer();
- if (!process_handle_)
+ if (!process_.IsValid())
return true;
// First check if the process has already terminated.
- bool ret = base::WaitForSingleProcess(process_handle_, base::TimeDelta());
+ bool ret = base::WaitForSingleProcess(process_.Handle(), base::TimeDelta());
if (!ret) {
- ret = base::KillProcess(process_handle_, 1, true);
+ ret = base::KillProcess(process_.Handle(), 1, true);
}
if (ret) {
- base::CloseProcessHandle(process_handle_);
- process_handle_ = base::kNullProcessHandle;
+ process_.Close();
} else {
VLOG(1) << "Kill failed?";
}
@@ -149,7 +148,6 @@ bool LocalTestServer::Init(const base::FilePath& document_root) {
// number out over a pipe that this TestServer object will read from. Once
// that is complete, the host port pair will contain the actual port.
DCHECK(!GetPort());
- process_handle_ = base::kNullProcessHandle;
base::FilePath src_dir;
if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_dir))
« no previous file with comments | « net/test/spawned_test_server/local_test_server.h ('k') | net/test/spawned_test_server/local_test_server_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698