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

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

Issue 8400020: Revert 107528 - Collect some histograms about signed binary downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_service.cc (revision 107537)
+++ chrome/browser/safe_browsing/safe_browsing_service.cc (working copy)
@@ -30,6 +30,7 @@
#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"
@@ -174,9 +175,12 @@
safe_browsing::ClientSideDetectionService::Create(
g_browser_process->system_request_context()));
}
- download_service_.reset(new safe_browsing::DownloadProtectionService(
- this,
- 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());
+ }
#endif
}
@@ -212,12 +216,20 @@
}
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 {
@@ -1356,9 +1368,6 @@
if (csd_service_.get())
csd_service_->SetEnabledAndRefreshState(enable);
- if (download_service_.get()) {
- download_service_->SetEnabled(
- enable && CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableImprovedDownloadProtection));
- }
+ if (download_service_.get())
+ download_service_->SetEnabled(enable);
}
« 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