diff options
author | siggi <siggi@chromium.org> | 2014-12-18 13:17:15 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-18 21:18:09 +0000 |
commit | 581938f0351e10aed206ce295d4504eb5cd611a6 (patch) | |
tree | 8bd9f956296905b7c8b94cc6d1a296689bba7ed1 /chrome/chrome_watcher | |
parent | 9c2faf1f1fd39d12f459d75ca3fccd5474802eeb (diff) | |
download | chromium_src-581938f0351e10aed206ce295d4504eb5cd611a6.zip chromium_src-581938f0351e10aed206ce295d4504eb5cd611a6.tar.gz chromium_src-581938f0351e10aed206ce295d4504eb5cd611a6.tar.bz2 |
Switch ExitCodeWatcher to base::Process.
R=erikwright@chromium.org
BUG=412384
Review URL: https://codereview.chromium.org/807513003
Cr-Commit-Position: refs/heads/master@{#309073}
Diffstat (limited to 'chrome/chrome_watcher')
-rw-r--r-- | chrome/chrome_watcher/chrome_watcher_main.cc | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/chrome/chrome_watcher/chrome_watcher_main.cc b/chrome/chrome_watcher/chrome_watcher_main.cc index ea6756b..6d35d0c 100644 --- a/chrome/chrome_watcher/chrome_watcher_main.cc +++ b/chrome/chrome_watcher/chrome_watcher_main.cc @@ -7,7 +7,7 @@ #include "base/at_exit.h" #include "base/command_line.h" #include "base/logging_win.h" -#include "base/process/process_handle.h" +#include "base/process/process.h" #include "base/template_util.h" #include "components/browser_watcher/exit_code_watcher_win.h" #include "components/browser_watcher/exit_funnel_win.h" @@ -44,29 +44,12 @@ extern "C" int WatcherMain(const base::char16* registry_path) { // Attempt to wait on our parent process, and record its exit status. if (exit_code_watcher.ParseArguments( *base::CommandLine::ForCurrentProcess())) { - base::ProcessHandle dupe = base::kNullProcessHandle; - // Duplicate the process handle for the exit funnel due to the wonky - // process handle lifetime management in base. - if (!::DuplicateHandle(base::GetCurrentProcessHandle(), - exit_code_watcher.process(), - base::GetCurrentProcessHandle(), - &dupe, - 0, - FALSE, - DUPLICATE_SAME_ACCESS)) { - dupe = base::kNullProcessHandle; - } - // Wait on the process. exit_code_watcher.WaitForExit(); - if (dupe != base::kNullProcessHandle) { - browser_watcher::ExitFunnel funnel; - funnel.Init(registry_path, dupe); - funnel.RecordEvent(L"BrowserExit"); - - base::CloseProcessHandle(dupe); - } + browser_watcher::ExitFunnel funnel; + funnel.Init(registry_path, exit_code_watcher.process().Handle()); + funnel.RecordEvent(L"BrowserExit"); ret = 0; } |