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

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

Issue 7583007: Add "enabled" state to the ClientSideDetectionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 years, 4 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 6dbcdc0b638e804e6636fd2c4e601c155bb73ca8..c13180b1198c089491a73532386f37506fea630e 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -42,6 +42,10 @@ namespace net {
class URLRequestContextGetter;
}
+namespace safe_browsing {
+class ClientSideDetectionService;
+}
+
// Construction needs to happen on the main thread.
class SafeBrowsingService
: public base::RefCountedThreadSafe<SafeBrowsingService>,
@@ -251,6 +255,11 @@ class SafeBrowsingService
return enabled_ && enable_download_protection_;
}
+ safe_browsing::ClientSideDetectionService*
+ safe_browsing_detection_service() const {
+ return csd_service_.get();
+ }
+
// Preference handling.
static void RegisterPrefs(PrefService* prefs);
@@ -373,6 +382,10 @@ class SafeBrowsingService
// UI.
void Start();
+ // Stops the SafeBrowsingService. This can be called when the safe browsing
+ // preference is disabled.
+ void Stop();
+
// Called on the db thread to close the database. See CloseDatabase().
void OnCloseDatabase();
@@ -522,6 +535,10 @@ class SafeBrowsingService
// Used to track creation and destruction of profiles on the UI thread.
NotificationRegistrar prefs_registrar_;
+ // The ClientSideDetectionService is managed by the SafeBrowsingService,
+ // since its running state and lifecycle depends on SafeBrowsingService's.
+ scoped_ptr<safe_browsing::ClientSideDetectionService> csd_service_;
+
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingService);
};

Powered by Google App Engine
This is Rietveld 408576698