From 94818d2da2c4d31a950521e6d09d9845b06e0b1d Mon Sep 17 00:00:00 2001 From: Mario Sanchez Prada Date: Fri, 3 Sep 2021 11:11:55 +0200 Subject: [PATCH] Adapt to new signature of SITH::AssociateBlockingPage() It does no longer expect a WebContents and a navigation ID. Chromium change: https://source.chromium.org/chromium/chromium/src/+/f88ed985d8b8b8e21806a3897a207a643d049f47 commit f88ed985d8b8b8e21806a3897a207a643d049f47 Author: Claudio DeSouza Date: Wed Aug 25 17:59:59 2021 +0000 [MPArch] Update SecurityInterstitialTabHelper for primary page only Interstitial pages are not supposed to be shown during pre-rendering, and changes have been done in different parts of the codebase to reflect that. This CL introduces changes to the tab helper, to make sure we do not a hold a security insterstitial page for a prerendering navigation, as well as avoiding processing observer events for similar cases. Bug: 1225210 --- .../brave_shields/browser/domain_block_navigation_throttle.cc | 2 +- .../decentralized_dns_navigation_throttle.cc | 2 +- components/ipfs/ipfs_navigation_throttle.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/brave_shields/browser/domain_block_navigation_throttle.cc b/components/brave_shields/browser/domain_block_navigation_throttle.cc index 07efa0c5e141..397e35985dd5 100644 --- a/components/brave_shields/browser/domain_block_navigation_throttle.cc +++ b/components/brave_shields/browser/domain_block_navigation_throttle.cc @@ -186,7 +186,7 @@ void DomainBlockNavigationThrottle::ShowInterstitial() { // Replace the tab contents with our interstitial page. security_interstitials::SecurityInterstitialTabHelper::AssociateBlockingPage( - web_contents, handle->GetNavigationId(), std::move(blocked_page)); + handle, std::move(blocked_page)); // Navigation was deferred rather than canceled outright because the // call to the ad blocking service happens on a task runner, but now we diff --git a/components/decentralized_dns/decentralized_dns_navigation_throttle.cc b/components/decentralized_dns/decentralized_dns_navigation_throttle.cc index 6a76a7529968..3de427e0486c 100644 --- a/components/decentralized_dns/decentralized_dns_navigation_throttle.cc +++ b/components/decentralized_dns/decentralized_dns_navigation_throttle.cc @@ -83,7 +83,7 @@ void DecentralizedDnsNavigationThrottle::ShowInterstitial() { std::string page_content = page->GetHTMLContents(); security_interstitials::SecurityInterstitialTabHelper::AssociateBlockingPage( - web_contents, handle->GetNavigationId(), std::move(page)); + handle, std::move(page)); CancelDeferredNavigation(content::NavigationThrottle::ThrottleCheckResult( content::NavigationThrottle::CANCEL, net::ERR_BLOCKED_BY_CLIENT, diff --git a/components/ipfs/ipfs_navigation_throttle.cc b/components/ipfs/ipfs_navigation_throttle.cc index cec2868d1219..9112365c8f60 100644 --- a/components/ipfs/ipfs_navigation_throttle.cc +++ b/components/ipfs/ipfs_navigation_throttle.cc @@ -193,7 +193,7 @@ IpfsNavigationThrottle::ShowIPFSOnboardingInterstitial() { std::string page_content = page->GetHTMLContents(); security_interstitials::SecurityInterstitialTabHelper::AssociateBlockingPage( - web_contents, handle->GetNavigationId(), std::move(page)); + handle, std::move(page)); return content::NavigationThrottle::ThrottleCheckResult( content::NavigationThrottle::CANCEL, net::ERR_BLOCKED_BY_CLIENT, page_content); @@ -213,7 +213,7 @@ void IpfsNavigationThrottle::ShowInterstitial() { std::string page_content = page->GetHTMLContents(); security_interstitials::SecurityInterstitialTabHelper::AssociateBlockingPage( - web_contents, handle->GetNavigationId(), std::move(page)); + handle, std::move(page)); CancelDeferredNavigation(content::NavigationThrottle::ThrottleCheckResult( content::NavigationThrottle::CANCEL, net::ERR_BLOCKED_BY_CLIENT,