| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <windows.h> | 5 #include <windows.h> |
| 6 #include <sddl.h> | 6 #include <sddl.h> |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 DISALLOW_COPY_AND_ASSIGN(BrowserMonitor); | 94 DISALLOW_COPY_AND_ASSIGN(BrowserMonitor); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 BrowserMonitor::BrowserMonitor(base::StringPiece16 registry_path, | 97 BrowserMonitor::BrowserMonitor(base::StringPiece16 registry_path, |
| 98 base::RunLoop* run_loop) | 98 base::RunLoop* run_loop) |
| 99 : exit_code_watcher_(registry_path), | 99 : exit_code_watcher_(registry_path), |
| 100 end_session_watcher_window_( | 100 end_session_watcher_window_( |
| 101 base::Bind(&BrowserMonitor::OnEndSessionMessage, | 101 base::Bind(&BrowserMonitor::OnEndSessionMessage, |
| 102 base::Unretained(this))), | 102 base::Unretained(this))), |
| 103 background_thread_("BrowserWatcherThread"), | 103 background_thread_("BrowserWatcherThread"), |
| 104 browser_exited_( | 104 browser_exited_(base::WaitableEvent::ResetPolicy::MANUAL, |
| 105 base::WaitableEvent::ResetPolicy::MANUAL, | 105 base::WaitableEvent::InitialState::NOT_SIGNALED), |
| 106 base::WaitableEvent::InitialState::NOT_SIGNALED), | |
| 107 run_loop_(run_loop), | 106 run_loop_(run_loop), |
| 108 main_thread_(base::ThreadTaskRunnerHandle::Get()) {} | 107 main_thread_(base::ThreadTaskRunnerHandle::Get()) {} |
| 109 | 108 |
| 110 BrowserMonitor::~BrowserMonitor() { | 109 BrowserMonitor::~BrowserMonitor() { |
| 111 } | 110 } |
| 112 | 111 |
| 113 bool BrowserMonitor::StartWatching( | 112 bool BrowserMonitor::StartWatching( |
| 114 base::Process process, | 113 base::Process process, |
| 115 base::win::ScopedHandle on_initialized_event) { | 114 base::win::ScopedHandle on_initialized_event) { |
| 116 if (!exit_code_watcher_.Initialize(std::move(process))) | 115 if (!exit_code_watcher_.Initialize(std::move(process))) |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 259 |
| 261 // Wind logging down. | 260 // Wind logging down. |
| 262 logging::LogEventProvider::Uninitialize(); | 261 logging::LogEventProvider::Uninitialize(); |
| 263 | 262 |
| 264 return 0; | 263 return 0; |
| 265 } | 264 } |
| 266 | 265 |
| 267 static_assert( | 266 static_assert( |
| 268 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, | 267 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, |
| 269 "WatcherMain() has wrong type"); | 268 "WatcherMain() has wrong type"); |
| OLD | NEW |