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

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

Issue 7583007: Add "enabled" state to the ClientSideDetectionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit: removed unused code 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.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index cac584c5a29534107b6cd36011a7a0750ba3c38f..3261283cd6a63e13d4321eaf2e77742a38108589 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/safe_browsing/client_side_detection_service.h"
#include "chrome/browser/safe_browsing/malware_details.h"
#include "chrome/browser/safe_browsing/protocol_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
@@ -165,6 +166,17 @@ SafeBrowsingService::SafeBrowsingService()
closing_database_(false),
download_urlcheck_timeout_ms_(kDownloadUrlCheckTimeoutMs),
download_hashcheck_timeout_ms_(kDownloadHashCheckTimeoutMs) {
+ csd_service_ = g_browser_process->safe_browsing_detection_service();
+}
+
+SafeBrowsingService::~SafeBrowsingService() {
+ // Deletes the PrefChangeRegistrars, whose dtors also unregister |this| as an
+ // observer of the preferences.
+ STLDeleteValues(&prefs_map_);
+
+ // We should have already been shut down. If we're still enabled, then the
+ // database isn't going to be closed properly, which could lead to corruption.
+ DCHECK(!enabled_);
}
void SafeBrowsingService::Initialize() {
@@ -481,16 +493,6 @@ void SafeBrowsingService::LogPauseDelay(base::TimeDelta time) {
UMA_HISTOGRAM_LONG_TIMES("SB2.Delay", time);
}
-SafeBrowsingService::~SafeBrowsingService() {
- // Deletes the PrefChangeRegistrars, whose dtors also unregister |this| as an
- // observer of the preferences.
- STLDeleteValues(&prefs_map_);
-
- // We should have already been shut down. If we're still enabled, then the
- // database isn't going to be closed properly, which could lead to corruption.
- DCHECK(!enabled_);
-}
-
void SafeBrowsingService::OnIOInitialize(
const std::string& client_key,
const std::string& wrapped_key,
@@ -1322,4 +1324,7 @@ void SafeBrowsingService::RefreshState() {
Start();
else
ShutDown();
+
+ if (csd_service_)
+ csd_service_->SetEnabled(enable);
}

Powered by Google App Engine
This is Rietveld 408576698