Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Unified Diff: components/subresource_filter/content/browser/subresource_filter_navigation_throttle.cc

Issue 2396133003: Change the logic how Subesource Filter propagates activation. (Closed)
Patch Set: fix tests Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/content/browser/subresource_filter_navigation_throttle.cc
diff --git a/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.cc b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.cc
index b735d1c17dcdb9d7a0f61bd6e77ab0878f596fad..7e9dee25ffecbd5aad5660dada2ab588ec543e04 100644
--- a/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.cc
+++ b/components/subresource_filter/content/browser/subresource_filter_navigation_throttle.cc
@@ -21,31 +21,11 @@ SubresourceFilterNavigationThrottle::Create(content::NavigationHandle* handle) {
SubresourceFilterNavigationThrottle::SubresourceFilterNavigationThrottle(
content::NavigationHandle* handle)
- : content::NavigationThrottle(handle),
- initial_url_(navigation_handle()->GetURL()) {}
+ : content::NavigationThrottle(handle) {}
SubresourceFilterNavigationThrottle::~SubresourceFilterNavigationThrottle() {}
content::NavigationThrottle::ThrottleCheckResult
-SubresourceFilterNavigationThrottle::WillRedirectRequest() {
- if (!navigation_handle()->GetURL().SchemeIsHTTPOrHTTPS())
- return NavigationThrottle::PROCEED;
- ContentSubresourceFilterDriverFactory* driver_factory =
- ContentSubresourceFilterDriverFactory::FromWebContents(
- navigation_handle()->GetWebContents());
- // Ensure that the activation state of the subresource filter is persisted
- // beyond redirects. In case of the desktop platforms, where Safe Browsing
- // check is performed synchronously it's guaranteed that |driver_factory| has
- // the information about the activation set. But if the Safe Browsing check in
- // asynchronous, then we night miss some redirects.
- if (driver_factory->ShouldActivateForURL(initial_url_)) {
- driver_factory->AddHostOfURLToActivationSet(navigation_handle()->GetURL());
- }
-
- return NavigationThrottle::PROCEED;
-}
-
-content::NavigationThrottle::ThrottleCheckResult
SubresourceFilterNavigationThrottle::WillProcessResponse() {
if (!navigation_handle()->GetURL().SchemeIsHTTPOrHTTPS())
return NavigationThrottle::PROCEED;
@@ -53,7 +33,8 @@ SubresourceFilterNavigationThrottle::WillProcessResponse() {
ContentSubresourceFilterDriverFactory::FromWebContents(
navigation_handle()->GetWebContents())
->ReadyToCommitMainFrameNavigation(
- navigation_handle()->GetRenderFrameHost(), initial_url_);
+ navigation_handle()->GetRenderFrameHost(),
+ navigation_handle()->GetURL());
return NavigationThrottle::PROCEED;
}

Powered by Google App Engine
This is Rietveld 408576698