Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: chrome/chrome_watcher/chrome_watcher_main.cc

Issue 1834463002: Identify the hung thread using the Wait Chain Traversal API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BASE_EXPORT Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/process_singleton_win.cc ('k') | chrome/chrome_watcher/kasko_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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");
OLDNEW
« no previous file with comments | « chrome/browser/process_singleton_win.cc ('k') | chrome/chrome_watcher/kasko_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698