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

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

Issue 1113063004: Add HANDLE_FLAG_PROTECT_FROM_CLOSE flag to Tracked/ScopedHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed dynamic disabling of ActiveVerifier. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« base/win/scoped_handle.cc ('K') | « chrome/app/close_handle_hook_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/spawned_test_server/local_test_server_win.cc
diff --git a/net/test/spawned_test_server/local_test_server_win.cc b/net/test/spawned_test_server/local_test_server_win.cc
index 71e1f7e70af1b5ea48d5fdb43bbcbfb91fe53810..0476b907caffb879ab100bd3d8199289227fc02f 100644
--- a/net/test/spawned_test_server/local_test_server_win.cc
+++ b/net/test/spawned_test_server/local_test_server_win.cc
@@ -101,8 +101,9 @@ bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) {
child_write_fd_.Set(child_write);
// Have the child inherit the write half.
- if (!SetHandleInformation(child_write, HANDLE_FLAG_INHERIT,
- HANDLE_FLAG_INHERIT)) {
+ if (!::DuplicateHandle(::GetCurrentProcess(), child_write,
+ ::GetCurrentProcess(), &child_write, 0, TRUE,
+ DUPLICATE_SAME_ACCESS)) {
PLOG(ERROR) << "Failed to enable pipe inheritance";
return false;
}
@@ -125,9 +126,11 @@ bool LocalTestServer::LaunchPython(const base::FilePath& testserver_path) {
process_ = base::LaunchProcess(python_command, launch_options);
if (!process_.IsValid()) {
LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString();
+ ::CloseHandle(child_write);
return false;
}
+ ::CloseHandle(child_write);
return true;
}
« base/win/scoped_handle.cc ('K') | « chrome/app/close_handle_hook_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698