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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.h

Issue 2675063002: Browser tests for using the new SafeBrowsing protocol (v4) (Closed)
Patch Set: shess@'s review Created 3 years, 10 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: chrome/browser/safe_browsing/safe_browsing_service.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index d1d355499100f56654c773e772e1a2d32068da10..88dc3d7005b691885210b43a17f43acf8d1ba41a 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -59,6 +59,8 @@ class SafeBrowsingUIManager;
class SafeBrowsingURLRequestContextGetter;
struct V4ProtocolConfig;
+enum class V4UsageStatus { V4_DISABLED, V4_INSTANTIATED, V4_ONLY };
Nathan Parker 2017/02/08 01:22:43 Add a comment... could point to the v4_feature_lis
vakh (use Gerrit instead) 2017/02/09 03:30:27 Done.
+
// Construction needs to happen on the main thread.
// The SafeBrowsingService owns both the UI and Database managers which do
// the heavylifting of safebrowsing service. Both of these managers stay
@@ -197,7 +199,8 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
protected:
// Creates the safe browsing service. Need to initialize before using.
- SafeBrowsingService();
+ SafeBrowsingService(
+ V4UsageStatus v4_usage_status = V4UsageStatus::V4_DISABLED);
~SafeBrowsingService() override;
@@ -298,7 +301,12 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
// Whether SafeBrowsing needs to be enabled in V4Only mode. In this mode, all
// SafeBrowsing decisions are made using the PVer4 implementation.
- bool enabled_v4_only_;
+ bool use_v4_only_;
+
+ // Whether the PVer4 implementation needs to be instantiated. Note that even
+ // if the PVer4 implementation has been instantiated, it is used only if
+ // |use_v4_only_| is true.
+ bool v4_enabled_;
// Tracks existing PrefServices, and the safe browsing preference on each.
// This is used to determine if any profile is currently using the safe

Powered by Google App Engine
This is Rietveld 408576698