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

Unified Diff: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h

Issue 2446503002: Fix SubResourceFilter to work with PlzNavigate. (Closed)
Patch Set: fix unit 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/content_subresource_filter_driver_factory.h
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
index 049e85f3f87a77458278925c785c57c2aef9e7d5..2e1056e39988ce7fcba95a7b8a5bebd1eecae79a 100644
--- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
+++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
@@ -76,25 +76,9 @@ class ContentSubresourceFilterDriverFactory
// Reloads the page and inserts the url to the whitelist.
void OnReloadRequested();
- // Checks if all preconditions are fulfilled and if so, activates filtering
- // for the given |render_frame_host|. |url| is used to check web site specific
- // preconditions and should be the web URL of the page where caller is
- // intended to activate the Safe Browsing Subresource Filter.
- // TODO(melandory) While due to crbug.com/621856 we cannot yet get rid of
- // SubresourceFilterNavigationThrottle, it would still make sense to change
- // its semantics so that its only responsibility is to emulate
- // DidRedirectNavigation and ReadyToCommitNavigation for us before we get
- // these from WebContentsObserver for free. Then, the throttle would no longer
- // contain any subresource filter specific logic, and those pieces of logic
- // would all be moved into here.
- void ReadyToCommitMainFrameNavigation(
- content::RenderFrameHost* render_frame_host,
- const GURL& url);
-
const HostSet& safe_browsing_blacklisted_patterns_set() const {
return safe_browsing_blacklisted_patterns_;
}
- const HostSet& whitelisted_set() const { return whitelisted_hosts_; }
ActivationState activation_state() { return activation_state_; }
private:
@@ -117,11 +101,10 @@ class ContentSubresourceFilterDriverFactory
// content::WebContentsObserver:
void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
- void DidStartProvisionalLoadForFrame(
- content::RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- bool is_error_page,
- bool is_iframe_srcdoc) override;
+ void DidStartNavigation(
+ content::NavigationHandle* navigation_handle) override;
+ void ReadyToCommitNavigation(
+ content::NavigationHandle* navigation_handle) override;
bool OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* render_frame_host) override;
@@ -131,7 +114,11 @@ class ContentSubresourceFilterDriverFactory
void ActivateForFrameHostIfNeeded(content::RenderFrameHost* render_frame_host,
const GURL& url);
- void set_activation_state(const ActivationState& new_activation_state);
+ // Internal implementation of ReadyToCommitNavigation which doesn't use
+ // NavigationHandle to ease unit tests.
+ void ReadyToCommitNavigationInternal(
+ content::RenderFrameHost* render_frame_host,
+ const GURL& url);
bool IsHit(const GURL& url) const;

Powered by Google App Engine
This is Rietveld 408576698