Skip to content

Commit

Permalink
Adapt to new signature of SITH::AssociateBlockingPage()
Browse files Browse the repository at this point in the history
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 <cdesouza@igalia.com>
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
  • Loading branch information
mariospr committed Sep 3, 2021
1 parent 60933c6 commit 94818d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions components/ipfs/ipfs_navigation_throttle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down

0 comments on commit 94818d2

Please sign in to comment.