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

Unified Diff: chrome/renderer/safe_browsing/phishing_classifier_delegate.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: Add a comment as Noe suggested 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/renderer/safe_browsing/phishing_classifier_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/safe_browsing/phishing_classifier_delegate.cc
diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc b/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc
index c03fa07dd6e32683e88532bed9bce83e00fd78be..8d182841d9f911a436515d108379e1d1a12f4ae9 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc
+++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate.cc
@@ -65,10 +65,15 @@ bool PhishingClassifierFilter::OnControlMessageReceived(
}
void PhishingClassifierFilter::OnSetPhishingModel(const std::string& model) {
- safe_browsing::Scorer* scorer = safe_browsing::Scorer::Create(model);
- if (!scorer) {
- DLOG(ERROR) << "Unable to create a PhishingScorer - corrupt model?";
- return;
+ safe_browsing::Scorer* scorer = NULL;
+ // An empty model string means we should disable client-side phishing
+ // detection.
+ if (!model.empty()) {
+ scorer = safe_browsing::Scorer::Create(model);
+ if (!scorer) {
+ DLOG(ERROR) << "Unable to create a PhishingScorer - corrupt model?";
+ return;
+ }
}
PhishingClassifierDelegates::iterator i;
for (i = g_delegates.Get().begin(); i != g_delegates.Get().end(); ++i) {
« no previous file with comments | « chrome/renderer/safe_browsing/phishing_classifier_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698