diff options
author | rvargas <rvargas@chromium.org> | 2015-02-04 13:11:29 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-04 21:12:35 +0000 |
commit | 6b039c379ae314520617fae279194b77f2441ea9 (patch) | |
tree | 1b807f607ce37544762acca0f3bbd23b50b6b68d /components | |
parent | afebf76e26c5cecb3fa043c410f64ed96243a09e (diff) | |
download | chromium_src-6b039c379ae314520617fae279194b77f2441ea9.zip chromium_src-6b039c379ae314520617fae279194b77f2441ea9.tar.gz chromium_src-6b039c379ae314520617fae279194b77f2441ea9.tar.bz2 |
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}
Diffstat (limited to 'components')
-rw-r--r-- | components/browser_watcher/watcher_metrics_provider_win.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/components/browser_watcher/watcher_metrics_provider_win.cc b/components/browser_watcher/watcher_metrics_provider_win.cc index 0848046..2798ae5 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; } |