Move OpenProcessHandle to Process::Open.
This removes another source of raw process handles.
BUG=417532
Review URL: https://codereview.chromium.org/868543002
Cr-Commit-Position: refs/heads/master@{#314633}
diff --git a/base/process/process_win.cc b/base/process/process_win.cc
index 0107015..4e600f94 100644
--- a/base/process/process_win.cc
+++ b/base/process/process_win.cc
@@ -47,10 +47,14 @@
}
// static
+Process Process::Open(ProcessId pid) {
+ return Process(::OpenProcess(kBasicProcessAccess, FALSE, pid));
+}
+
+// static
Process Process::OpenWithExtraPriviles(ProcessId pid) {
DWORD access = kBasicProcessAccess | PROCESS_DUP_HANDLE | PROCESS_VM_READ;
- ProcessHandle handle = ::OpenProcess(access, FALSE, pid);
- return Process(handle);
+ return Process(::OpenProcess(access, FALSE, pid));
}
// static