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

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

Issue 7538009: Send back the URL that matched the SafeBrowsing list with the CSD ping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Matt's comments. 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/browser_feature_extractor.cc
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc
index 4d8a48fc6a492ac661c68ccd08ea00cda1881a7b..fc7933edf8ac378098c6a67bca04f7cdf2151191 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc
@@ -43,6 +43,10 @@ const char kHasSSLReferrer[] = "HasSSLReferrer";
const char kPageTransitionType[] = "PageTransitionType";
const char kIsFirstNavigation[] = "IsFirstNavigation";
const char kBadIpFetch[] = "BadIpFetch=";
+const char kSafeBrowsingMaliciousUrl[] = "SafeBrowsingMaliciousUrl=";
+const char kSafeBrowsingOriginalUrl[] = "SafeBrowsingOriginalUrl=";
+const char kSafeBrowsingIsSubresource[] = "SafeBrowsingIsSubresource";
+const char kSafeBrowsingThreatType[] = "SafeBrowsingThreatType";
} // namespace features
BrowseInfo::BrowseInfo() {}
@@ -226,6 +230,24 @@ void BrowserFeatureExtractor::ExtractBrowseInfoFeatures(
}
}
}
+ if (info.unsafe_resource.get()) {
+ // A SafeBrowsing interstitial was shown for the current URL.
+ AddFeature(features::kSafeBrowsingMaliciousUrl +
+ info.unsafe_resource->url.spec(),
+ 1.0,
+ request);
+ AddFeature(features::kSafeBrowsingOriginalUrl +
+ info.unsafe_resource->original_url.spec(),
+ 1.0,
+ request);
+ AddFeature(features::kSafeBrowsingIsSubresource,
+ info.unsafe_resource->is_subresource ? 1.0 : 0.0,
+ request);
+ AddFeature(features::kSafeBrowsingThreatType,
+ static_cast<double>(info.unsafe_resource->threat_type),
+ request);
+ }
+
}
void BrowserFeatureExtractor::StartExtractFeatures(

Powered by Google App Engine
This is Rietveld 408576698