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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector.cc

Issue 1515703005: WebRequest API: add more resource types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments (creis, mattm, battre) Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_d etector.h" 5 #include "chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_d etector.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // Only analyze top-level frames within the main frame. 138 // Only analyze top-level frames within the main frame.
139 return request_info->ParentIsMainFrame(); 139 return request_info->ParentIsMainFrame();
140 case content::RESOURCE_TYPE_STYLESHEET: 140 case content::RESOURCE_TYPE_STYLESHEET:
141 case content::RESOURCE_TYPE_SCRIPT: 141 case content::RESOURCE_TYPE_SCRIPT:
142 case content::RESOURCE_TYPE_IMAGE: 142 case content::RESOURCE_TYPE_IMAGE:
143 case content::RESOURCE_TYPE_FONT_RESOURCE: 143 case content::RESOURCE_TYPE_FONT_RESOURCE:
144 case content::RESOURCE_TYPE_SUB_RESOURCE: 144 case content::RESOURCE_TYPE_SUB_RESOURCE:
145 case content::RESOURCE_TYPE_OBJECT: 145 case content::RESOURCE_TYPE_OBJECT:
146 case content::RESOURCE_TYPE_MEDIA: 146 case content::RESOURCE_TYPE_MEDIA:
147 case content::RESOURCE_TYPE_XHR: 147 case content::RESOURCE_TYPE_XHR:
148 case content::RESOURCE_TYPE_PLUGIN_RESOURCE:
148 // Types above are to be analyzed for off-domain inclusion if they are 149 // Types above are to be analyzed for off-domain inclusion if they are
149 // loaded as part of the main frame. 150 // loaded as part of the main frame.
150 return request_info->IsMainFrame(); 151 return request_info->IsMainFrame();
151 case content::RESOURCE_TYPE_WORKER: 152 case content::RESOURCE_TYPE_WORKER:
152 case content::RESOURCE_TYPE_SHARED_WORKER: 153 case content::RESOURCE_TYPE_SHARED_WORKER:
153 case content::RESOURCE_TYPE_PREFETCH: 154 case content::RESOURCE_TYPE_PREFETCH:
154 case content::RESOURCE_TYPE_FAVICON: 155 case content::RESOURCE_TYPE_FAVICON:
155 case content::RESOURCE_TYPE_PING: 156 case content::RESOURCE_TYPE_PING:
156 case content::RESOURCE_TYPE_SERVICE_WORKER: 157 case content::RESOURCE_TYPE_SERVICE_WORKER:
158 case content::RESOURCE_TYPE_CSP_REPORT:
157 // Types above are not to be analyzed for off-domain inclusion. 159 // Types above are not to be analyzed for off-domain inclusion.
158 return false; 160 return false;
159 case content::RESOURCE_TYPE_LAST_TYPE: 161 case content::RESOURCE_TYPE_LAST_TYPE:
160 NOTREACHED(); 162 NOTREACHED();
161 break; 163 break;
162 } 164 }
163 NOTREACHED(); 165 NOTREACHED();
164 return false; 166 return false;
165 } 167 }
166 168
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 ->Add(off_domain_inclusion_info->resource_type); 359 ->Add(off_domain_inclusion_info->resource_type);
358 } 360 }
359 361
360 if (!report_analysis_event_callback_.is_null() && 362 if (!report_analysis_event_callback_.is_null() &&
361 analysis_event != AnalysisEvent::NO_EVENT) { 363 analysis_event != AnalysisEvent::NO_EVENT) {
362 report_analysis_event_callback_.Run(analysis_event); 364 report_analysis_event_callback_.Run(analysis_event);
363 } 365 }
364 } 366 }
365 367
366 } // namespace safe_browsing 368 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698