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

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

Issue 2841933003: [subresource_filter] Remove some state from the driver factory (Closed)
Patch Set: no more dep branch Created 3 years, 8 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 b7969d7705d01efbf024f6f77a7e6f18659a16fc..2402e8888ca3e4e645082f8bea2d3b1264d00f1c 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
@@ -9,7 +9,7 @@
#include <memory>
#include <set>
#include <string>
-#include <utility>
+#include <unordered_map>
#include <vector>
#include "base/macros.h"
@@ -17,6 +17,7 @@
#include "base/time/time.h"
#include "components/safe_browsing_db/util.h"
#include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h"
+#include "components/subresource_filter/core/common/activation_decision.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"
@@ -46,32 +47,6 @@ class ContentSubresourceFilterDriverFactory
public content::WebContentsObserver,
public ContentSubresourceFilterThrottleManager::Delegate {
public:
- // NOTE: ActivationDecision backs a UMA histogram, so it is append-only.
- enum class ActivationDecision {
- // The activation decision is unknown, or not known yet.
- UNKNOWN,
-
- // Subresource filtering was activated.
- ACTIVATED,
-
- // Did not activate because subresource filtering was disabled.
- ACTIVATION_DISABLED,
-
- // Did not activate because the main frame document URL had an unsupported
- // scheme.
- UNSUPPORTED_SCHEME,
-
- // Did not activate because the main frame document URL was whitelisted.
- URL_WHITELISTED,
-
- // Did not activate because the main frame document URL did not match the
- // activation list.
- ACTIVATION_LIST_NOT_MATCHED,
-
- // Max value for enum.
- ACTIVATION_DECISION_MAX
- };
-
static void CreateForWebContents(
content::WebContents* web_contents,
std::unique_ptr<SubresourceFilterClient> client);
@@ -102,12 +77,6 @@ class ContentSubresourceFilterDriverFactory
// Reloads the page and inserts the host of its URL to the whitelist.
void OnReloadRequested();
- // Returns the |ActivationDecision| for the current main frame
- // document.
- ActivationDecision GetActivationDecisionForLastCommittedPageLoad() const {
- return activation_decision_;
- }
-
// ContentSubresourceFilterThrottleManager::Delegate:
void OnFirstSubresourceLoadDisallowed() override;
bool ShouldSuppressActivation(
@@ -115,7 +84,7 @@ class ContentSubresourceFilterDriverFactory
void WillProcessResponse(
content::NavigationHandle* navigation_handle) override;
- ContentSubresourceFilterThrottleManager* throttle_manager() {
+ ContentSubresourceFilterThrottleManager* throttle_manager() const {
return throttle_manager_.get();
}
@@ -153,10 +122,6 @@ class ContentSubresourceFilterDriverFactory
std::unique_ptr<ContentSubresourceFilterThrottleManager> throttle_manager_;
- ActivationLevel activation_level_;
- ActivationDecision activation_decision_;
- bool measure_performance_;
-
// The URLs in the navigation chain.
std::vector<GURL> navigation_chain_;

Powered by Google App Engine
This is Rietveld 408576698