chore: cherry-pick e4abe032f3ad from chromium #28806
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ensure that BrowserContext is not used after it has been freed
Previously, it was possible for the BrowserContext to be destroyed
before ReportAnchorElementMetricsOnClick attempted to access it.
The fix uses the fact that NavigationPredictor extends
WebContentsObserver and checks that web_contents is still alive
before dereferencing BrowserContext. WebContents will always
outlive BrowserContext.
R=lukasza@chromium.org, ryansturm@chromium.org
(cherry picked from commit 7313a810ae0b1361cbe8453bc5496654dee24c76)
(cherry picked from commit f782a440339fa19a44422ca5e7165cddd1cffcc9)
Bug: 1197904
Change-Id: Iee4f126e92670a84d57c7a4ec7d6f702fb975c7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2821639
Reviewed-by: Ryan Sturm ryansturm@chromium.org
Reviewed-by: Łukasz Anforowicz lukasza@chromium.org
Commit-Queue: Łukasz Anforowicz lukasza@chromium.org
Cr-Original-Original-Commit-Position: refs/heads/master@{#872021}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2827043
Auto-Submit: Robert Ogden robertogden@chromium.org
Commit-Queue: Ryan Sturm ryansturm@chromium.org
Cr-Original-Commit-Position: refs/branch-heads/4472@{#77}
Cr-Original-Branched-From: 3d60439cfb36485e76a1c5bb7f513d3721b20da1-refs/heads/master@{#870763}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2830308
Reviewed-by: Tarun Bansal tbansal@chromium.org
Commit-Queue: Tarun Bansal tbansal@chromium.org
Commit-Queue: Robert Ogden robertogden@chromium.org
Cr-Commit-Position: refs/branch-heads/4430@{#1297}
Cr-Branched-From: e5ce7dc4f7518237b3d9bb93cccca35d25216cbe-refs/heads/master@{#857950}
Notes: Security: backported fix for CVE-2021-21226.