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

Unified Diff: base/process/process_win.cc

Issue 725353003: Don't pass ProcessHandle through ChildProcessHostDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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: base/process/process_win.cc
diff --git a/base/process/process_win.cc b/base/process/process_win.cc
index 05041b20ddaa7e8f908acc242dce2e45df066046..3e0d79fa8d39dc769f79eb241efaafeee397bb0c 100644
--- a/base/process/process_win.cc
+++ b/base/process/process_win.cc
@@ -39,6 +39,18 @@ Process Process::Current() {
}
// static
+Process Process::DeprecatedGetProcessFromHandle(ProcessHandle handle) {
+ DCHECK_NE(handle, ::GetCurrentProcess());
+ ProcessHandle out_handle;
+ if (!::DuplicateHandle(GetCurrentProcess(), handle,
+ GetCurrentProcess(), &out_handle,
+ 0, FALSE, DUPLICATE_SAME_ACCESS)) {
+ return Process();
cpu_(ooo_6.6-7.5) 2014/11/18 01:40:42 no dcheck before returning at 48?
rvargas (doing something else) 2014/11/18 01:52:34 I don't think so. I'm mostly going by what we do a
+ }
+ return Process(out_handle);
+}
+
+// static
bool Process::CanBackgroundProcesses() {
return true;
}

Powered by Google App Engine
This is Rietveld 408576698