btm: Don't send a crash report for error page with mismatched accesses
When a HTTPS upgrade fails, the HTTP fallback can be blocked by a
NavigationThrottle e.g. HttpsUpgradesNavigationThrottle which will show
an error page. This means DidRedirectNavigation will not be called for
the HTTPS->HTTP redirect and it won't be added to our list of
server-side redirects. If the HTTPS request sets cookies,
CookieAccessFilter::Filter will return false since the HTTPS redirect is
not included in the list of URLs we pass to Filter.
Now that we know one of the causes of the cookie mismatch, stop
reporting crashes when that edge case happens. We want to continue
reporting other cases that we might not know about.
(cherry picked from commit cdfcfdc14c318ae32295b2b3b9058874fb11eb9b)
Bug: 407710083
Fixed: 414779232
Change-Id: I1da0eaa8191f5e079c2a418ba5031cd2535d8693
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6495270
Reviewed-by: Svend Larsen <svend@chromium.org>
Commit-Queue: Svend Larsen <svend@chromium.org>
Auto-Submit: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1453241}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6501379
Reviewed-by: Andrew Liu <liu@chromium.org>
Commit-Queue: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/branch-heads/7151@{#51}
Cr-Branched-From: 8e0d32ed6e49a2415b16e5ed402957cac2349ce2-refs/heads/main@{#1453031}
diff --git a/content/browser/btm/btm_page_visit_observer.cc b/content/browser/btm/btm_page_visit_observer.cc
index 5423548d..c651d2b 100644
--- a/content/browser/btm/btm_page_visit_observer.cc
+++ b/content/browser/btm/btm_page_visit_observer.cc
@@ -99,7 +99,7 @@
// TODO - crbug.com/406841434: `CHECK` the result of `filter_.Filter`.
bool were_all_accesses_matched = filter_.Filter(urls, accesses);
- if (!were_all_accesses_matched) {
+ if (!were_all_accesses_matched && !navigation_handle.IsErrorPage()) {
DEBUG_ALIAS_FOR_GURL(
committed_url_alias,
navigation_handle.GetRenderFrameHost()->GetLastCommittedURL());