| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_( |
| 105 base::WaitableEvent::ResetPolicy::MANUAL, | 105 base::WaitableEvent::ResetPolicy::MANUAL, |
| 106 base::WaitableEvent::InitialState::NOT_SIGNALED), | 106 base::WaitableEvent::InitialState::NOT_SIGNALED), // manual reset, |
| 107 // initially |
| 108 // non-signalled. |
| 107 run_loop_(run_loop), | 109 run_loop_(run_loop), |
| 108 main_thread_(base::ThreadTaskRunnerHandle::Get()) {} | 110 main_thread_(base::ThreadTaskRunnerHandle::Get()) {} |
| 109 | 111 |
| 110 BrowserMonitor::~BrowserMonitor() { | 112 BrowserMonitor::~BrowserMonitor() { |
| 111 } | 113 } |
| 112 | 114 |
| 113 bool BrowserMonitor::StartWatching( | 115 bool BrowserMonitor::StartWatching( |
| 114 base::Process process, | 116 base::Process process, |
| 115 base::win::ScopedHandle on_initialized_event) { | 117 base::win::ScopedHandle on_initialized_event) { |
| 116 if (!exit_code_watcher_.Initialize(std::move(process))) | 118 if (!exit_code_watcher_.Initialize(std::move(process))) |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 262 |
| 261 // Wind logging down. | 263 // Wind logging down. |
| 262 logging::LogEventProvider::Uninitialize(); | 264 logging::LogEventProvider::Uninitialize(); |
| 263 | 265 |
| 264 return 0; | 266 return 0; |
| 265 } | 267 } |
| 266 | 268 |
| 267 static_assert( | 269 static_assert( |
| 268 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, | 270 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, |
| 269 "WatcherMain() has wrong type"); | 271 "WatcherMain() has wrong type"); |
| OLD | NEW |