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

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_host/chrome_resource_dispatcher_host_delegate. h" 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 return true; 301 return true;
302 } 302 }
303 303
304 void ChromeResourceDispatcherHostDelegate::RequestBeginning( 304 void ChromeResourceDispatcherHostDelegate::RequestBeginning(
305 net::URLRequest* request, 305 net::URLRequest* request,
306 content::ResourceContext* resource_context, 306 content::ResourceContext* resource_context,
307 content::AppCacheService* appcache_service, 307 content::AppCacheService* appcache_service,
308 ResourceType resource_type, 308 ResourceType resource_type,
309 ScopedVector<content::ResourceThrottle>* throttles) { 309 ScopedVector<content::ResourceThrottle>* throttles) {
310 if (safe_browsing_)
311 safe_browsing_->OnResourceRequest(request);
Nico 2014/11/14 19:52:58 nit: if someone helpfully deletes this in the futu
gab 2014/11/18 17:23:19 Right, but this class itself is highly undertested
312
310 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); 313 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
311 bool is_prerendering = 314 bool is_prerendering =
312 info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender; 315 info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender;
313 if (is_prerendering) { 316 if (is_prerendering) {
314 // Requests with the IGNORE_LIMITS flag set (i.e., sync XHRs) 317 // Requests with the IGNORE_LIMITS flag set (i.e., sync XHRs)
315 // should remain at MAXIMUM_PRIORITY. 318 // should remain at MAXIMUM_PRIORITY.
316 if (request->load_flags() & net::LOAD_IGNORE_LIMITS) { 319 if (request->load_flags() & net::LOAD_IGNORE_LIMITS) {
317 DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY); 320 DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY);
318 } else { 321 } else {
319 request->SetPriority(net::IDLE); 322 request->SetPriority(net::IDLE);
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 url_request->GetTotalReceivedBytes())); 757 url_request->GetTotalReceivedBytes()));
755 } 758 }
756 } 759 }
757 760
758 // static 761 // static
759 void ChromeResourceDispatcherHostDelegate:: 762 void ChromeResourceDispatcherHostDelegate::
760 SetExternalProtocolHandlerDelegateForTesting( 763 SetExternalProtocolHandlerDelegateForTesting(
761 ExternalProtocolHandler::Delegate* delegate) { 764 ExternalProtocolHandler::Delegate* delegate) {
762 g_external_protocol_handler_delegate = delegate; 765 g_external_protocol_handler_delegate = delegate;
763 } 766 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698