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

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

Issue 8310014: Only send the client-side phishing model to a renderer if its profile has SafeBrowsing enabled. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/client_side_detection_service.cc
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc
index 3903131c9aaa35363ad4374fdfb67919f08e572f..a14c70968fad356aba04527d25463da6c8adc2c6 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
@@ -15,9 +15,12 @@
#include "base/task.h"
#include "base/time.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_features.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/net/http_return.h"
+#include "chrome/common/pref_names.h"
#include "chrome/common/safe_browsing/client_model.pb.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
@@ -213,8 +216,11 @@ void ClientSideDetectionService::Observe(int type,
void ClientSideDetectionService::SendModelToProcess(
RenderProcessHost* process) {
- VLOG(2) << "Sending phishing model to renderer";
- process->Send(new SafeBrowsingMsg_SetPhishingModel(model_str_));
+ Profile* profile = Profile::FromBrowserContext(process->browser_context());
+ if (profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) {
+ VLOG(2) << "Sending phishing model to renderer";
+ process->Send(new SafeBrowsingMsg_SetPhishingModel(model_str_));
noelutz 2011/10/17 17:48:13 What if the renderer already has an older model?
+ }
}
void ClientSideDetectionService::SendModelToRenderers() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698