| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/loader/chrome_resource_dispatcher_host_delegate.h" | 5 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 GetDataAndCreateIfNecessary(request); | 131 GetDataAndCreateIfNecessary(request); |
| 132 data->set_used_data_reduction_proxy(true); | 132 data->set_used_data_reduction_proxy(true); |
| 133 } | 133 } |
| 134 return ChromeResourceDispatcherHostDelegate::GetNavigationData(request); | 134 return ChromeResourceDispatcherHostDelegate::GetNavigationData(request); |
| 135 } | 135 } |
| 136 | 136 |
| 137 // ChromeResourceDispatcherHost implementation: | 137 // ChromeResourceDispatcherHost implementation: |
| 138 void AppendStandardResourceThrottles( | 138 void AppendStandardResourceThrottles( |
| 139 net::URLRequest* request, | 139 net::URLRequest* request, |
| 140 content::ResourceContext* resource_context, | 140 content::ResourceContext* resource_context, |
| 141 content::ResourceType resource_type, | 141 ResourceType resource_type, |
| 142 ScopedVector<content::ResourceThrottle>* throttles) override { | 142 ScopedVector<content::ResourceThrottle>* throttles) override { |
| 143 ++times_stardard_throttles_added_for_url_[request->url()]; | 143 ++times_stardard_throttles_added_for_url_[request->url()]; |
| 144 ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( | 144 ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( |
| 145 request, resource_context, resource_type, throttles); | 145 request, resource_context, resource_type, throttles); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void set_should_add_data_reduction_proxy_data( | 148 void set_should_add_data_reduction_proxy_data( |
| 149 bool should_add_data_reduction_proxy_data) { | 149 bool should_add_data_reduction_proxy_data) { |
| 150 should_add_data_reduction_proxy_data_ = | 150 should_add_data_reduction_proxy_data_ = |
| 151 should_add_data_reduction_proxy_data; | 151 should_add_data_reduction_proxy_data; |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 DownloadTestObserverNotInProgress download_observer( | 629 DownloadTestObserverNotInProgress download_observer( |
| 630 content::BrowserContext::GetDownloadManager(browser()->profile()), 1); | 630 content::BrowserContext::GetDownloadManager(browser()->profile()), 1); |
| 631 download_observer.StartObserving(); | 631 download_observer.StartObserving(); |
| 632 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( | 632 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( |
| 633 "/download-anchor-attrib.html")); | 633 "/download-anchor-attrib.html")); |
| 634 download_observer.WaitForFinished(); | 634 download_observer.WaitForFinished(); |
| 635 EXPECT_EQ(1, | 635 EXPECT_EQ(1, |
| 636 GetTimesStandardThrottlesAddedForURL( | 636 GetTimesStandardThrottlesAddedForURL( |
| 637 embedded_test_server()->GetURL("/anchor_download_test.png"))); | 637 embedded_test_server()->GetURL("/anchor_download_test.png"))); |
| 638 } | 638 } |
| OLD | NEW |