Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Speculative fix to a crash caused by hitting the dangerous download i…
Browse files Browse the repository at this point in the history
…nfobar.

There is no good explanation of the crash:
1. When clicking on a dangerous download, we set mPendingRequest and start
the infobar.
2. When user dismiss the infobar, we reset mPendingRequest.
3. If mPendingRequest is non null, a 2nd request will not trigger any
infobar.
So at anytime, there are at most 1 dangerous infobar.
And if mPendingRequest is non null, there should be an infobar showing,
vice versa.

So this a speculative fix to the crash from the crash stack we have
seen.

BUG=579707

Review URL: https://codereview.chromium.org/1614453003

Cr-Commit-Position: refs/heads/master@{#372153}
  • Loading branch information
qinmin authored and Commit bot committed Jan 28, 2016
1 parent 56284dd commit 7efc4d5
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private class DangerousDownloadListener implements SimpleConfirmInfoBarBuilder.L
@Override
public void onInfoBarButtonClicked(boolean confirm) {
assert mTab != null;
if (mPendingRequest == null) return;
if (mPendingRequest.hasDownloadId()) {
nativeDangerousDownloadValidated(mTab, mPendingRequest.getDownloadId(), confirm);
if (confirm) {
Expand Down

0 comments on commit 7efc4d5

Please sign in to comment.