| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // chrome.exe in order to report its exit status. | 217 // chrome.exe in order to report its exit status. |
| 218 ::SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY); | 218 ::SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY); |
| 219 | 219 |
| 220 base::Callback<void(const base::Process&)> on_hung_callback; | 220 base::Callback<void(const base::Process&)> on_hung_callback; |
| 221 | 221 |
| 222 #if BUILDFLAG(ENABLE_KASKO) | 222 #if BUILDFLAG(ENABLE_KASKO) |
| 223 bool launched_kasko = InitializeKaskoReporter(GetKaskoEndpoint(process.Pid()), | 223 bool launched_kasko = InitializeKaskoReporter(GetKaskoEndpoint(process.Pid()), |
| 224 browser_data_directory); | 224 browser_data_directory); |
| 225 | 225 |
| 226 #if BUILDFLAG(ENABLE_KASKO_HANG_REPORTS) | 226 #if BUILDFLAG(ENABLE_KASKO_HANG_REPORTS) |
| 227 // Only activate hang reports for the canary channel. For testing purposes, | 227 // Only activate hang reports for the canary channel. |
| 228 // Chrome instances with no channels will also report hangs. | |
| 229 if (launched_kasko && | 228 if (launched_kasko && |
| 230 (base::StringPiece16(channel_name) == L"" || | 229 base::StringPiece16(channel_name) == installer::kChromeChannelCanary) { |
| 231 base::StringPiece16(channel_name) == installer::kChromeChannelCanary)) { | |
| 232 on_hung_callback = base::Bind(&DumpHungProcess, main_thread_id, | 230 on_hung_callback = base::Bind(&DumpHungProcess, main_thread_id, |
| 233 channel_name, L"hung-process"); | 231 channel_name, L"hung-process"); |
| 234 } | 232 } |
| 235 #endif // BUILDFLAG(ENABLE_KASKO_HANG_REPORTS) | 233 #endif // BUILDFLAG(ENABLE_KASKO_HANG_REPORTS) |
| 236 #endif // BUILDFLAG(ENABLE_KASKO) | 234 #endif // BUILDFLAG(ENABLE_KASKO) |
| 237 | 235 |
| 238 // Run a UI message loop on the main thread. | 236 // Run a UI message loop on the main thread. |
| 239 base::MessageLoop msg_loop(base::MessageLoop::TYPE_UI); | 237 base::MessageLoop msg_loop(base::MessageLoop::TYPE_UI); |
| 240 msg_loop.set_thread_name("WatcherMainThread"); | 238 msg_loop.set_thread_name("WatcherMainThread"); |
| 241 | 239 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 264 | 262 |
| 265 // Wind logging down. | 263 // Wind logging down. |
| 266 logging::LogEventProvider::Uninitialize(); | 264 logging::LogEventProvider::Uninitialize(); |
| 267 | 265 |
| 268 return 0; | 266 return 0; |
| 269 } | 267 } |
| 270 | 268 |
| 271 static_assert( | 269 static_assert( |
| 272 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, | 270 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, |
| 273 "WatcherMain() has wrong type"); | 271 "WatcherMain() has wrong type"); |
| OLD | NEW |