| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 411       base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); | 411       base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); | 
| 412 | 412 | 
| 413   // If it's from the web, we don't trust it, so we push the throttle on. | 413   // If it's from the web, we don't trust it, so we push the throttle on. | 
| 414   if (is_content_initiated) { | 414   if (is_content_initiated) { | 
| 415     const content::ResourceRequestInfo* info = | 415     const content::ResourceRequestInfo* info = | 
| 416         content::ResourceRequestInfo::ForRequest(request); | 416         content::ResourceRequestInfo::ForRequest(request); | 
| 417     throttles->push_back(new DownloadResourceThrottle( | 417     throttles->push_back(new DownloadResourceThrottle( | 
| 418         download_request_limiter_, info->GetWebContentsGetterForRequest(), | 418         download_request_limiter_, info->GetWebContentsGetterForRequest(), | 
| 419         request->url(), request->method())); | 419         request->url(), request->method())); | 
| 420 #if BUILDFLAG(ANDROID_JAVA_UI) | 420 #if BUILDFLAG(ANDROID_JAVA_UI) | 
| 421     throttles->push_back( | 421     throttles->push_back(new chrome::InterceptDownloadResourceThrottle( | 
| 422         new chrome::InterceptDownloadResourceThrottle( | 422         request, child_id, route_id, request_id)); | 
| 423             request, child_id, route_id, request_id)); |  | 
| 424 #endif | 423 #endif | 
| 425   } | 424   } | 
| 426 | 425 | 
| 427   // If this isn't a new request, we've seen this before and added the standard | 426   // If this isn't a new request, we've seen this before and added the standard | 
| 428   //  resource throttles already so no need to add it again. | 427   //  resource throttles already so no need to add it again. | 
| 429   if (!request->is_pending()) { | 428   if (!request->is_pending()) { | 
| 430     AppendStandardResourceThrottles(request, | 429     AppendStandardResourceThrottles(request, | 
| 431                                     resource_context, | 430                                     resource_context, | 
| 432                                     content::RESOURCE_TYPE_MAIN_FRAME, | 431                                     content::RESOURCE_TYPE_MAIN_FRAME, | 
| 433                                     throttles); | 432                                     throttles); | 
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 729     return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); | 728     return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); | 
| 730   return false; | 729   return false; | 
| 731 } | 730 } | 
| 732 | 731 | 
| 733 // static | 732 // static | 
| 734 void ChromeResourceDispatcherHostDelegate:: | 733 void ChromeResourceDispatcherHostDelegate:: | 
| 735     SetExternalProtocolHandlerDelegateForTesting( | 734     SetExternalProtocolHandlerDelegateForTesting( | 
| 736     ExternalProtocolHandler::Delegate* delegate) { | 735     ExternalProtocolHandler::Delegate* delegate) { | 
| 737   g_external_protocol_handler_delegate = delegate; | 736   g_external_protocol_handler_delegate = delegate; | 
| 738 } | 737 } | 
| OLD | NEW | 
|---|