| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( | 478 void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( |
| 479 net::URLRequest* request, | 479 net::URLRequest* request, |
| 480 content::ResourceContext* resource_context, | 480 content::ResourceContext* resource_context, |
| 481 ResourceType resource_type, | 481 ResourceType resource_type, |
| 482 ScopedVector<content::ResourceThrottle>* throttles) { | 482 ScopedVector<content::ResourceThrottle>* throttles) { |
| 483 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 483 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 484 | 484 |
| 485 // Insert either safe browsing or data reduction proxy throttle at the front | 485 // Insert either safe browsing or data reduction proxy throttle at the front |
| 486 // of the list, so one of them gets to decide if the resource is safe. | 486 // of the list, so one of them gets to decide if the resource is safe. |
| 487 content::ResourceThrottle* first_throttle = NULL; | 487 content::ResourceThrottle* first_throttle = NULL; |
| 488 #if defined(OS_ANDROID) && defined(SAFE_BROWSING_SERVICE) | 488 #if defined(OS_ANDROID) |
| 489 first_throttle = DataReductionProxyResourceThrottle::MaybeCreate( | 489 first_throttle = DataReductionProxyResourceThrottle::MaybeCreate( |
| 490 request, resource_context, resource_type, safe_browsing_.get()); | 490 request, resource_context, resource_type, safe_browsing_.get()); |
| 491 #endif // defined(OS_ANDROID) && defined(SAFE_BROWSING_SERVICE) | 491 #endif // defined(OS_ANDROID) |
| 492 | 492 |
| 493 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) | 493 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
| 494 if (!first_throttle && io_data->safe_browsing_enabled()->GetValue()) { | 494 if (!first_throttle && io_data->safe_browsing_enabled()->GetValue()) { |
| 495 first_throttle = SafeBrowsingResourceThrottle::MaybeCreate( | 495 first_throttle = SafeBrowsingResourceThrottle::MaybeCreate( |
| 496 request, resource_type, safe_browsing_.get()); | 496 request, resource_type, safe_browsing_.get()); |
| 497 } | 497 } |
| 498 #endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) | 498 #endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
| 499 | 499 |
| 500 if (first_throttle) | 500 if (first_throttle) |
| 501 throttles->push_back(first_throttle); | 501 throttles->push_back(first_throttle); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 url_request->GetTotalReceivedBytes())); | 720 url_request->GetTotalReceivedBytes())); |
| 721 } | 721 } |
| 722 } | 722 } |
| 723 | 723 |
| 724 // static | 724 // static |
| 725 void ChromeResourceDispatcherHostDelegate:: | 725 void ChromeResourceDispatcherHostDelegate:: |
| 726 SetExternalProtocolHandlerDelegateForTesting( | 726 SetExternalProtocolHandlerDelegateForTesting( |
| 727 ExternalProtocolHandler::Delegate* delegate) { | 727 ExternalProtocolHandler::Delegate* delegate) { |
| 728 g_external_protocol_handler_delegate = delegate; | 728 g_external_protocol_handler_delegate = delegate; |
| 729 } | 729 } |
| OLD | NEW |