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

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

Issue 845663004: Initial script request detector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on top of latest incident reporting hotness. Created 5 years, 10 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/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 358cfa2cd88d3196302dd707046bafb61c15b277..a79607e2ef7fa548e07749aa84993c6156d3eaf6 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -56,6 +56,7 @@
#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/incident_reporting/script_request_detector.h"
#include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signature_analyzer.h"
#endif
@@ -231,6 +232,9 @@ void SafeBrowsingService::Initialize() {
if (IsIncidentReportingServiceEnabled()) {
incident_service_.reset(new safe_browsing::IncidentReportingService(
this, url_request_context_getter_));
+ script_request_detector_.reset(
+ new safe_browsing::ScriptRequestDetector(
+ incident_service_->GetIncidentReceiver().Pass()));
grt (UTC plus 2) 2015/02/06 15:24:55 do you need the .Pass() here? does it compile if y
robertshield 2015/02/06 22:36:48 Done.
}
off_domain_inclusion_detector_.reset(
@@ -278,6 +282,9 @@ void SafeBrowsingService::ShutDown() {
#if defined(FULL_SAFE_BROWSING)
off_domain_inclusion_detector_.reset();
+ script_request_detector_.reset();
+ // Note that it is important that incident_service_ be destroyed AFTER the
grt (UTC plus 2) 2015/02/06 15:24:55 why do you say that? i don't think it's true.
robertshield 2015/02/06 22:36:48 If you recall the earlier revision of the CL, it u
grt (UTC plus 2) 2015/02/06 23:37:46 Oh, right. Apologies if that comment sounded snott
+ // detectors.
incident_service_.reset();
#endif
@@ -359,6 +366,8 @@ void SafeBrowsingService::OnResourceRequest(const net::URLRequest* request) {
#if defined(FULL_SAFE_BROWSING)
if (off_domain_inclusion_detector_)
off_domain_inclusion_detector_->OnResourceRequest(request);
+ if (script_request_detector_)
+ script_request_detector_->OnResourceRequest(request);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698