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

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

Issue 8345033: Collect some histograms about signed binary downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix chromeos and valgrind Created 9 years, 2 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
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.h ('k') | chrome/browser/safe_browsing/signature_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 914a9fec96c2c64f5482667189d14c10c4e9f929..8987512e8f193389fec2cdea68ee1f84daf63f05 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -30,7 +30,6 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/browser/browser_thread.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
@@ -175,12 +174,9 @@ SafeBrowsingService::SafeBrowsingService()
safe_browsing::ClientSideDetectionService::Create(
g_browser_process->system_request_context()));
}
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableImprovedDownloadProtection)) {
- download_service_ = new safe_browsing::DownloadProtectionService(
- this,
- g_browser_process->system_request_context());
- }
+ download_service_.reset(new safe_browsing::DownloadProtectionService(
+ this,
+ g_browser_process->system_request_context()));
#endif
}
@@ -216,20 +212,12 @@ void SafeBrowsingService::Initialize() {
}
void SafeBrowsingService::ShutDown() {
- if (download_service_.get()) {
- // Disabling the download service first will ensure that it is
- // disabled before the SafeBrowsingService object becomes invalid. The
- // download service might stay around for a bit since it's
- // ref-counted but it won't do any harm because it will be
- // disabled.
- download_service_->SetEnabled(false);
- download_service_ = NULL;
- }
Stop();
// The IO thread is going away, so make sure the ClientSideDetectionService
// dtor executes now since it may call the dtor of URLFetcher which relies
// on it.
csd_service_.reset();
+ download_service_.reset();
}
bool SafeBrowsingService::CanCheckUrl(const GURL& url) const {
@@ -1368,6 +1356,9 @@ void SafeBrowsingService::RefreshState() {
if (csd_service_.get())
csd_service_->SetEnabledAndRefreshState(enable);
- if (download_service_.get())
- download_service_->SetEnabled(enable);
+ if (download_service_.get()) {
+ download_service_->SetEnabled(
+ enable && CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableImprovedDownloadProtection));
+ }
}
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.h ('k') | chrome/browser/safe_browsing/signature_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698