diff options
author | rvargas <rvargas@chromium.org> | 2015-01-23 12:36:44 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-23 20:37:27 +0000 |
commit | 17a407d8909846afcb50a6e29bc3686876fbfa03 (patch) | |
tree | 810dc99f73b9f17a0854224df9dca35b96983533 /win8 | |
parent | c742ea924974388a15ef160e82e3f0b7895d5dc8 (diff) | |
download | chromium_src-17a407d8909846afcb50a6e29bc3686876fbfa03.zip chromium_src-17a407d8909846afcb50a6e29bc3686876fbfa03.tar.gz chromium_src-17a407d8909846afcb50a6e29bc3686876fbfa03.tar.bz2 |
Move OpenProcessHandleWithAccess to Process::OpenWithAccess.
This removes another source of raw process handles.
BUG=417532
Review URL: https://codereview.chromium.org/860453002
Cr-Commit-Position: refs/heads/master@{#312919}
Diffstat (limited to 'win8')
-rw-r--r-- | win8/viewer/metro_viewer_process_host.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/win8/viewer/metro_viewer_process_host.cc b/win8/viewer/metro_viewer_process_host.cc index 2e04ef8..61a776c 100644 --- a/win8/viewer/metro_viewer_process_host.cc +++ b/win8/viewer/metro_viewer_process_host.cc @@ -12,7 +12,6 @@ #include "base/memory/ref_counted.h" #include "base/path_service.h" #include "base/process/process.h" -#include "base/process/process_handle.h" #include "base/strings/string16.h" #include "base/synchronization/waitable_event.h" #include "base/time/time.h" @@ -68,14 +67,13 @@ MetroViewerProcessHost::~MetroViewerProcessHost() { if (message_filter_.get()) { // Wait for the viewer process to go away. if (viewer_process_id != base::kNullProcessId) { - base::ProcessHandle viewer_process = NULL; - base::OpenProcessHandleWithAccess( - viewer_process_id, - PROCESS_QUERY_INFORMATION | SYNCHRONIZE, - &viewer_process); - if (viewer_process) { - ::WaitForSingleObject(viewer_process, INFINITE); - ::CloseHandle(viewer_process); + base::Process viewer_process = + base::Process::OpenWithAccess( + viewer_process_id, + PROCESS_QUERY_INFORMATION | SYNCHRONIZE); + if (viewer_process.IsValid()) { + int exit_code; + viewer_process.WaitForExit(&exit_code); } } channel_->RemoveFilter(message_filter_.get()); |