| 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);
|
| }
|
|
|