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

Unified Diff: chrome/browser/process_singleton_win.cc

Issue 1844023002: Capture a report on failed browser rendez-vous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_win.cc
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index 335215680f0d1063b90260fcd4b1e7b9e39a3248..acd028744e121789a042b567edd407cda3d20160 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -26,14 +26,18 @@
#include "chrome/browser/chrome_process_finder_win.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/ui/simple_message_box.h"
+#include "chrome/chrome_watcher/kasko_util.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/chromium_strings.h"
+#include "chrome/installer/util/browser_distribution.h"
+#include "chrome/installer/util/util_constants.h"
#include "chrome/installer/util/wmi.h"
#include "content/public/common/result_codes.h"
#include "net/base/escape.h"
+#include "third_party/kasko/kasko_features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/win/hwnd_util.h"
@@ -249,6 +253,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
break;
}
+ // The window is hung.
DWORD process_id = 0;
DWORD thread_id = ::GetWindowThreadProcessId(remote_window_, &process_id);
if (!thread_id || !process_id) {
@@ -257,7 +262,40 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
}
base::Process process = base::Process::Open(process_id);
- // The window is hung. Scan for every window to find a visible one.
+#if BUILDFLAG(ENABLE_KASKO)
Sigurður Ásgeirsson 2016/03/31 19:28:49 As we discussed, there is a race on the PID here,
manzagop (departed) 2016/04/01 16:09:00 Done.
+ // Capture a failed rendez-vous hang report of the other process. Kasko needs
+ // the exception context to live either in the dumper of the dumpee. This
+ // means we cannot rely on kasko reporters from either browser watcher, and
+ // instead spin up a new reporter. Note that we will exit shortly after
+ // capturing the report, meaning the report may not get uploaded by this
+ // reporter.
+ // DO NOT SUBMIT: add a build flag for capturign RDV hangs
+ // #if BUILDFLAG(ENABLE_KASKO_RDV_HANG_REPORTS)
+ // TODO(manzagop): add a metric for the number of captured hang reports, for
+ // comparison with uploaded count?
+
+ // Check the channel
+ // DO NOT SUBMIT: only on canary.
+ // base::string16 channel_name = GoogleUpdateSettings::GetChromeChannel(!InstallUtil::IsPerUserInstall(cmd_line.GetProgram()));
+ // if (base::StringPiece16(channel_name) == L"" ||
+ // base::StringPiece16(channel_name) == installer::kChromeChannelCanary)
+
+ base::FilePath data_base_dir;
+ chrome::GetDefaultUserDataDirectory(&data_base_dir);
+ base::string16 endpoint =
+ L"chrome_kasko_hangs_" +
+ base::UintToString16(base::Process::Current().Pid());
+
+ bool launched_kasko =
+ InitializeKaskoReporter(endpoint, data_base_dir.value().c_str());
+ if (launched_kasko) {
+ // DO NOT SUBMIT: add a specific crash keys (RDV hang).
+ DumpHungProcess(thread_id, installer::kChromeChannelCanary, process);
+ ShutdownKaskoReporter();
+ }
+#endif // BUILDFLAG(ENABLE_KASKO)
+
+ // Scan for every window to find a visible one.
bool visible_window = false;
::EnumThreadWindows(thread_id,
&BrowserWindowEnumeration,
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698