Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 7313a81) 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-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-Commit-Position: refs/branch-heads/4472@{#77} Cr-Branched-From: 3d60439-refs/heads/master@{#870763}
- Loading branch information