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

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

Issue 516663002: Introducing the OffDomainInclusionDetector to analyze resource requests for suspicious activity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review:mattm Created 6 years, 1 month 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/safe_browsing_service.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index f991e27767a93bdf5fd231888bf2fc644e5cc6b5..9133181306501237515ddf3efe061e399ba9645d 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.h"
#include "chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyzer.h"
#include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h"
+#include "chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector.h"
#include "chrome/browser/safe_browsing/malware_details.h"
#include "chrome/browser/safe_browsing/ping_manager.h"
#include "chrome/browser/safe_browsing/protocol_manager.h"
@@ -240,6 +241,9 @@ void SafeBrowsingService::Initialize() {
incident_service_.reset(new safe_browsing::IncidentReportingService(
this, url_request_context_getter_));
}
+
+ off_domain_inclusion_detector_.reset(
+ new safe_browsing::OffDomainInclusionDetector);
#endif
// Track the safe browsing preference of existing profiles.
@@ -347,6 +351,13 @@ void SafeBrowsingService::RegisterDelayedAnalysisCallback(
#endif
}
+void SafeBrowsingService::OnResourceRequest(const net::URLRequest* request) {
+#if defined(FULL_SAFE_BROWSING)
+ if (off_domain_inclusion_detector_)
+ off_domain_inclusion_detector_->OnResourceRequest(request);
+#endif
+}
+
SafeBrowsingUIManager* SafeBrowsingService::CreateUIManager() {
return new SafeBrowsingUIManager(this);
}

Powered by Google App Engine
This is Rietveld 408576698