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