| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 // If it's from the web, we don't trust it, so we push the throttle on. | 409 // If it's from the web, we don't trust it, so we push the throttle on. |
| 410 if (is_content_initiated) { | 410 if (is_content_initiated) { |
| 411 const content::ResourceRequestInfo* info = | 411 const content::ResourceRequestInfo* info = |
| 412 content::ResourceRequestInfo::ForRequest(request); | 412 content::ResourceRequestInfo::ForRequest(request); |
| 413 throttles->push_back(new DownloadResourceThrottle( | 413 throttles->push_back(new DownloadResourceThrottle( |
| 414 download_request_limiter_, info->GetWebContentsGetterForRequest(), | 414 download_request_limiter_, info->GetWebContentsGetterForRequest(), |
| 415 request->url(), request->method())); | 415 request->url(), request->method())); |
| 416 #if BUILDFLAG(ANDROID_JAVA_UI) | 416 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 417 throttles->push_back( | 417 throttles->push_back( |
| 418 new chrome::InterceptDownloadResourceThrottle( | 418 new chrome::InterceptDownloadResourceThrottle( |
| 419 request, child_id, route_id, request_id)); | 419 request, child_id, route_id, request_id, must_download)); |
| 420 #endif | 420 #endif |
| 421 } | 421 } |
| 422 | 422 |
| 423 // If this isn't a new request, we've seen this before and added the standard | 423 // If this isn't a new request, we've seen this before and added the standard |
| 424 // resource throttles already so no need to add it again. | 424 // resource throttles already so no need to add it again. |
| 425 if (!request->is_pending()) { | 425 if (!request->is_pending()) { |
| 426 AppendStandardResourceThrottles(request, | 426 AppendStandardResourceThrottles(request, |
| 427 resource_context, | 427 resource_context, |
| 428 content::RESOURCE_TYPE_MAIN_FRAME, | 428 content::RESOURCE_TYPE_MAIN_FRAME, |
| 429 throttles); | 429 throttles); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); | 714 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); |
| 715 return false; | 715 return false; |
| 716 } | 716 } |
| 717 | 717 |
| 718 // static | 718 // static |
| 719 void ChromeResourceDispatcherHostDelegate:: | 719 void ChromeResourceDispatcherHostDelegate:: |
| 720 SetExternalProtocolHandlerDelegateForTesting( | 720 SetExternalProtocolHandlerDelegateForTesting( |
| 721 ExternalProtocolHandler::Delegate* delegate) { | 721 ExternalProtocolHandler::Delegate* delegate) { |
| 722 g_external_protocol_handler_delegate = delegate; | 722 g_external_protocol_handler_delegate = delegate; |
| 723 } | 723 } |
| OLD | NEW |