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

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

Issue 14999008: Add a killswitch for CSD malware IP match and report feature. Use a new killswitch whitelist URL wh… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc
index d9107dd4aaaee54a1dcc06927389814ab711b14c..52a807174458f8277f8815be030bf759ec53b111 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host.cc
@@ -176,18 +176,24 @@ class ClientSideDetectionHost::ShouldClassifyUrlRequest
return;
}
+ bool malware_killswitch = database_manager_->MalwareKillSwitchOn();
+
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
- base::Bind(&ShouldClassifyUrlRequest::CheckCache, this));
+ base::Bind(&ShouldClassifyUrlRequest::CheckCache, this,
+ malware_killswitch));
}
- void CheckCache() {
+ void CheckCache(bool malware_killswitch) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (canceled_) {
return;
}
+ // Whether enable the malware IP matching feature
+ csd_service_->SetMalwareEnabled(malware_killswitch);
+
// If result is cached, we don't want to run classification again
bool is_phishing;
if (csd_service_->GetValidCachedResult(params_.url, &is_phishing)) {
@@ -380,14 +386,18 @@ void ClientSideDetectionHost::OnPhishingDetectionDone(
browse_info_.get() &&
verdict->ParseFromString(verdict_str) &&
verdict->IsInitialized()) {
- scoped_ptr<ClientMalwareRequest> malware_verdict(new ClientMalwareRequest);
- // Start browser-side malware feature extraction. Once we're done it will
- // send the malware client verdict request.
- malware_verdict->set_url(verdict->url());
- feature_extractor_->ExtractMalwareFeatures(
- browse_info_.get(),
- malware_verdict.get());
- MalwareFeatureExtractionDone(malware_verdict.Pass());
+ // We do the malware IP matching and request sending if the feature
+ // is enabled
+ if (csd_service_->MalwareEnabled()) {
+ scoped_ptr<ClientMalwareRequest> malware_verdict(
+ new ClientMalwareRequest);
+ // Start browser-side malware feature extraction. Once we're done it will
+ // send the malware client verdict request.
+ malware_verdict->set_url(verdict->url());
+ feature_extractor_->ExtractMalwareFeatures(
+ browse_info_.get(), malware_verdict.get());
+ MalwareFeatureExtractionDone(malware_verdict.Pass());
+ }
// We only send phishing verdict to the server if the verdict is phishing or
// if a SafeBrowsing interstitial was already shown for this site. E.g., a

Powered by Google App Engine
This is Rietveld 408576698