| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // process' lifetime to give it some more time to capture the browser exit. | 135 // process' lifetime to give it some more time to capture the browser exit. |
| 136 browser_exited_.TimedWait(base::TimeDelta::FromSeconds(kDelayTimeSeconds)); | 136 browser_exited_.TimedWait(base::TimeDelta::FromSeconds(kDelayTimeSeconds)); |
| 137 | 137 |
| 138 run_loop_->Quit(); | 138 run_loop_->Quit(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void BrowserMonitor::Watch(base::win::ScopedHandle on_initialized_event) { | 141 void BrowserMonitor::Watch(base::win::ScopedHandle on_initialized_event) { |
| 142 // This needs to run on an IO thread. | 142 // This needs to run on an IO thread. |
| 143 DCHECK_NE(main_thread_, base::ThreadTaskRunnerHandle::Get()); | 143 DCHECK_NE(main_thread_, base::ThreadTaskRunnerHandle::Get()); |
| 144 | 144 |
| 145 // Signal our client now that the Kasko reporter is initialized and we have | 145 // Signal our client that we have cleared all of the obstacles that might lead |
| 146 // cleared all of the obstacles that might lead to an early exit. | 146 // to an early exit. |
| 147 ::SetEvent(on_initialized_event.Get()); | 147 ::SetEvent(on_initialized_event.Get()); |
| 148 on_initialized_event.Close(); | 148 on_initialized_event.Close(); |
| 149 | 149 |
| 150 exit_code_watcher_.WaitForExit(); | 150 exit_code_watcher_.WaitForExit(); |
| 151 | 151 |
| 152 // Note that the browser has exited. | 152 // Note that the browser has exited. |
| 153 browser_exited_.Signal(); | 153 browser_exited_.Signal(); |
| 154 | 154 |
| 155 main_thread_->PostTask(FROM_HERE, | 155 main_thread_->PostTask(FROM_HERE, |
| 156 base::Bind(&BrowserMonitor::BrowserExited, base::Unretained(this))); | 156 base::Bind(&BrowserMonitor::BrowserExited, base::Unretained(this))); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 // Wind logging down. | 218 // Wind logging down. |
| 219 logging::LogEventProvider::Uninitialize(); | 219 logging::LogEventProvider::Uninitialize(); |
| 220 | 220 |
| 221 return 0; | 221 return 0; |
| 222 } | 222 } |
| 223 | 223 |
| 224 static_assert( | 224 static_assert( |
| 225 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, | 225 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, |
| 226 "WatcherMain() has wrong type"); | 226 "WatcherMain() has wrong type"); |
| OLD | NEW |