Commit d95c1de3 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Fix hang-report field in hang crash reports.

hang-report field was done asynchronously and too late to be
consistently present in the crash reports.
It seems that the flag was only present in case of a second freeze.
Set the flag synchronously before generating the crash report.

Bug: 1056178
Change-Id: Ia7958c61a01dd9ffa592f3ba6b86481b50e8c89d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2074220Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745478}
parent 844e3061
......@@ -74,6 +74,9 @@ void SetMemoryWarningInProgress(bool value);
// Sets a key indicating that UI thread is frozen (if value is 'true'),
// otherwise remove the key.
// Setting the value is synchronous as it is expected to be set just before the
// report generation.
// Unsetting the value is asynchronous.
void SetHangReport(bool value);
// Sets a key indicating the current free memory amount in KB. 0 does not remove
......
......@@ -279,7 +279,7 @@ void SetMemoryWarningInProgress(bool value) {
void SetHangReport(bool value) {
if (value)
AddReportParameter(kHangReport, @"yes", true);
AddReportParameter(kHangReport, @"yes", false);
else
RemoveReportParameter(kHangReport);
}
......
......@@ -166,12 +166,12 @@ void LogRecoveryTime(base::TimeDelta time) {
}
if ([[NSDate date] timeIntervalSinceDate:self.lastSeenMainThread] >
self.delay) {
breakpad_helper::SetHangReport(true);
[[BreakpadController sharedInstance]
withBreakpadRef:^(BreakpadRef breakpadRef) {
if (!breakpadRef) {
return;
}
breakpad_helper::SetHangReport(true);
NSDictionary* breakpadReportInfo =
BreakpadGenerateReport(breakpadRef, nil);
if (!breakpadReportInfo) {
......@@ -207,6 +207,7 @@ void LogRecoveryTime(base::TimeDelta time) {
}
forKey:@(kNsUserDefaultKeyLastSessionInfo)];
self.reportGenerated = YES;
breakpad_helper::SetHangReport(false);
}];
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment