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

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

Issue 7134017: Make safe browsing work in a multi-profile environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: addressed sky's nit Created 9 years, 5 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/client_side_detection_host.cc
===================================================================
--- chrome/browser/safe_browsing/client_side_detection_host.cc (revision 92179)
+++ chrome/browser/safe_browsing/client_side_detection_host.cc (working copy)
@@ -12,11 +12,13 @@
#include "base/metrics/histogram.h"
#include "base/task.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/browser_feature_extractor.h"
#include "chrome/browser/safe_browsing/client_side_detection_service.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "content/browser/browser_thread.h"
@@ -266,15 +268,13 @@
ClientSideDetectionHost::ClientSideDetectionHost(TabContents* tab)
: TabContentsObserver(tab),
- csd_service_(g_browser_process->safe_browsing_detection_service()),
- feature_extractor_(
- new BrowserFeatureExtractor(
- tab,
- g_browser_process->safe_browsing_detection_service())),
+ csd_service_(NULL),
cb_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(tab);
- // Note: csd_service_ and sb_service_ might be NULL.
+ csd_service_ = g_browser_process->safe_browsing_detection_service();
+ feature_extractor_.reset(new BrowserFeatureExtractor(tab, csd_service_));
sb_service_ = g_browser_process->safe_browsing_service();
+ // Note: csd_service_ and sb_service_ will be NULL here in testing.
registrar_.Add(this, content::NOTIFICATION_RESOURCE_RESPONSE_STARTED,
Source<RenderViewHostDelegate>(tab));
}

Powered by Google App Engine
This is Rietveld 408576698