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

Unified Diff: components/browser_watcher/watcher_metrics_provider_win.cc

Issue 868543002: Move OpenProcessHandle to Process::Open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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
« no previous file with comments | « chrome/test/perf/perf_test.cc ('k') | sandbox/linux/services/unix_domain_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_watcher/watcher_metrics_provider_win.cc
diff --git a/components/browser_watcher/watcher_metrics_provider_win.cc b/components/browser_watcher/watcher_metrics_provider_win.cc
index 0848046ef79cc7559a5f950824966eb59447bd07..2798ae56c42d0fce3d9a17387b60cd78df1b33bc 100644
--- a/components/browser_watcher/watcher_metrics_provider_win.cc
+++ b/components/browser_watcher/watcher_metrics_provider_win.cc
@@ -8,7 +8,7 @@
#include <vector>
#include "base/metrics/sparse_histogram.h"
-#include "base/process/process_handle.h"
+#include "base/process/process.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
@@ -51,10 +51,9 @@ bool IsDeadProcess(base::StringPiece16 key_or_value_name) {
// This is more expensive than the above check, but should also be very rare,
// as this only happens more than once for a given PID if a user is running
// multiple Chrome instances concurrently.
- base::ProcessHandle process = base::kNullProcessHandle;
- if (base::OpenProcessHandle(static_cast<base::ProcessId>(pid), &process)) {
- base::CloseProcessHandle(process);
-
+ base::Process process =
+ base::Process::Open(static_cast<base::ProcessId>(pid));
+ if (process.IsValid()) {
// The fact that it was possible to open the process says it's live.
return false;
}
« no previous file with comments | « chrome/test/perf/perf_test.cc ('k') | sandbox/linux/services/unix_domain_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698