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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/script_request_detector.h

Issue 1024943002: Add domain request detection to incident reporting service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DomainRequest incident type to histograms.xml Created 5 years, 9 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/incident_reporting/script_request_detector.h
diff --git a/chrome/browser/safe_browsing/incident_reporting/script_request_detector.h b/chrome/browser/safe_browsing/incident_reporting/script_request_detector.h
index f5e31f0654bb4c54683cb3947c4656985195e05f..0d1dbf264209e5ce13b21a5cc485a14dedcef2bc 100644
--- a/chrome/browser/safe_browsing/incident_reporting/script_request_detector.h
+++ b/chrome/browser/safe_browsing/incident_reporting/script_request_detector.h
@@ -18,6 +18,7 @@ class URLRequest;
namespace safe_browsing {
class ClientIncidentReport_IncidentData_ScriptRequestIncident;
+class ClientIncidentReport_IncidentData_DomainRequestIncident;
// Observes network requests and reports suspicious activity.
class ScriptRequestDetector {
@@ -35,9 +36,18 @@ class ScriptRequestDetector {
void set_allow_null_profile_for_testing(bool allow_null_profile_for_testing);
private:
- void InitializeScriptSet();
+ void InitializeHashSets();
- void ReportIncidentOnUIThread(
+ void DetectDomainRequests(const net::URLRequest* request);
+ void DetectScriptRequests(const net::URLRequest* request);
+
+ void ReportDomainIncidentOnUIThread(
+ int render_process_id,
+ int render_frame_id,
+ scoped_ptr<ClientIncidentReport_IncidentData_DomainRequestIncident>
+ incident_data);
+
+ void ReportScriptIncidentOnUIThread(
int render_process_id,
int render_frame_id,
scoped_ptr<ClientIncidentReport_IncidentData_ScriptRequestIncident>
@@ -45,6 +55,7 @@ class ScriptRequestDetector {
scoped_ptr<IncidentReceiver> incident_receiver_;
base::hash_set<std::string> script_set_;
+ base::hash_set<std::string> domain_set_;
bool allow_null_profile_for_testing_;
base::WeakPtrFactory<ScriptRequestDetector> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698