| OLD | NEW |
| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 return true; | 308 return true; |
| 309 } | 309 } |
| 310 | 310 |
| 311 void ChromeResourceDispatcherHostDelegate::RequestBeginning( | 311 void ChromeResourceDispatcherHostDelegate::RequestBeginning( |
| 312 net::URLRequest* request, | 312 net::URLRequest* request, |
| 313 content::ResourceContext* resource_context, | 313 content::ResourceContext* resource_context, |
| 314 content::AppCacheService* appcache_service, | 314 content::AppCacheService* appcache_service, |
| 315 ResourceType resource_type, | 315 ResourceType resource_type, |
| 316 ScopedVector<content::ResourceThrottle>* throttles) { | 316 ScopedVector<content::ResourceThrottle>* throttles) { |
| 317 if (safe_browsing_) |
| 318 safe_browsing_->OnResourceRequest(request); |
| 319 |
| 317 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 320 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 318 bool is_prerendering = | 321 bool is_prerendering = |
| 319 info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender; | 322 info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender; |
| 320 if (is_prerendering) { | 323 if (is_prerendering) { |
| 321 // Requests with the IGNORE_LIMITS flag set (i.e., sync XHRs) | 324 // Requests with the IGNORE_LIMITS flag set (i.e., sync XHRs) |
| 322 // should remain at MAXIMUM_PRIORITY. | 325 // should remain at MAXIMUM_PRIORITY. |
| 323 if (request->load_flags() & net::LOAD_IGNORE_LIMITS) { | 326 if (request->load_flags() & net::LOAD_IGNORE_LIMITS) { |
| 324 DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY); | 327 DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY); |
| 325 } else { | 328 } else { |
| 326 request->SetPriority(net::IDLE); | 329 request->SetPriority(net::IDLE); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 url_request->GetTotalReceivedBytes())); | 764 url_request->GetTotalReceivedBytes())); |
| 762 } | 765 } |
| 763 } | 766 } |
| 764 | 767 |
| 765 // static | 768 // static |
| 766 void ChromeResourceDispatcherHostDelegate:: | 769 void ChromeResourceDispatcherHostDelegate:: |
| 767 SetExternalProtocolHandlerDelegateForTesting( | 770 SetExternalProtocolHandlerDelegateForTesting( |
| 768 ExternalProtocolHandler::Delegate* delegate) { | 771 ExternalProtocolHandler::Delegate* delegate) { |
| 769 g_external_protocol_handler_delegate = delegate; | 772 g_external_protocol_handler_delegate = delegate; |
| 770 } | 773 } |
| OLD | NEW |