| 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/loader/chrome_resource_dispatcher_host_delegate.h" | 5 #include "chrome/browser/loader/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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig.h" | 48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig.h" |
| 49 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data
.h" | 49 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data
.h" |
| 50 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 50 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| 51 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.
h" | 51 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.
h" |
| 52 #include "components/google/core/browser/google_util.h" | 52 #include "components/google/core/browser/google_util.h" |
| 53 #include "components/policy/core/common/cloud/policy_header_io_helper.h" | 53 #include "components/policy/core/common/cloud/policy_header_io_helper.h" |
| 54 #include "components/previews/core/previews_experiments.h" | 54 #include "components/previews/core/previews_experiments.h" |
| 55 #include "components/previews/core/previews_io_data.h" | 55 #include "components/previews/core/previews_io_data.h" |
| 56 #include "components/rappor/public/rappor_utils.h" | 56 #include "components/rappor/public/rappor_utils.h" |
| 57 #include "components/rappor/rappor_service_impl.h" | 57 #include "components/rappor/rappor_service_impl.h" |
| 58 #include "components/safe_browsing/resource_throttle.h" |
| 58 #include "components/search_engines/template_url_service.h" | 59 #include "components/search_engines/template_url_service.h" |
| 59 #include "components/variations/net/variations_http_headers.h" | 60 #include "components/variations/net/variations_http_headers.h" |
| 60 #include "content/public/browser/browser_thread.h" | 61 #include "content/public/browser/browser_thread.h" |
| 61 #include "content/public/browser/navigation_data.h" | 62 #include "content/public/browser/navigation_data.h" |
| 62 #include "content/public/browser/notification_service.h" | 63 #include "content/public/browser/notification_service.h" |
| 63 #include "content/public/browser/plugin_service.h" | 64 #include "content/public/browser/plugin_service.h" |
| 64 #include "content/public/browser/plugin_service_filter.h" | 65 #include "content/public/browser/plugin_service_filter.h" |
| 65 #include "content/public/browser/render_frame_host.h" | 66 #include "content/public/browser/render_frame_host.h" |
| 66 #include "content/public/browser/render_process_host.h" | 67 #include "content/public/browser/render_process_host.h" |
| 67 #include "content/public/browser/render_view_host.h" | 68 #include "content/public/browser/render_view_host.h" |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 // Insert either safe browsing or data reduction proxy throttle at the front | 653 // Insert either safe browsing or data reduction proxy throttle at the front |
| 653 // of the list, so one of them gets to decide if the resource is safe. | 654 // of the list, so one of them gets to decide if the resource is safe. |
| 654 content::ResourceThrottle* first_throttle = NULL; | 655 content::ResourceThrottle* first_throttle = NULL; |
| 655 #if defined(OS_ANDROID) | 656 #if defined(OS_ANDROID) |
| 656 first_throttle = DataReductionProxyResourceThrottle::MaybeCreate( | 657 first_throttle = DataReductionProxyResourceThrottle::MaybeCreate( |
| 657 request, resource_context, resource_type, safe_browsing_.get()); | 658 request, resource_context, resource_type, safe_browsing_.get()); |
| 658 #endif // defined(OS_ANDROID) | 659 #endif // defined(OS_ANDROID) |
| 659 | 660 |
| 660 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) | 661 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
| 661 if (!first_throttle && io_data->safe_browsing_enabled()->GetValue()) { | 662 if (!first_throttle && io_data->safe_browsing_enabled()->GetValue()) { |
| 662 first_throttle = SafeBrowsingResourceThrottle::MaybeCreate( | 663 first_throttle = MaybeCreateSafeBrowsingResourceThrottle( |
| 663 request, resource_type, safe_browsing_.get()); | 664 request, resource_type, safe_browsing_.get()); |
| 664 } | 665 } |
| 665 #endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) | 666 #endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
| 666 | 667 |
| 667 if (first_throttle) | 668 if (first_throttle) |
| 668 throttles->push_back(base::WrapUnique(first_throttle)); | 669 throttles->push_back(base::WrapUnique(first_throttle)); |
| 669 | 670 |
| 670 #if BUILDFLAG(ENABLE_EXTENSIONS) | 671 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 671 content::ResourceThrottle* wait_for_extensions_init_throttle = | 672 content::ResourceThrottle* wait_for_extensions_init_throttle = |
| 672 user_script_listener_->CreateResourceThrottle(request->url(), | 673 user_script_listener_->CreateResourceThrottle(request->url(), |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 &ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 966 &ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
| 966 base::Unretained(this), url, request_loading_time)); | 967 base::Unretained(this), url, request_loading_time)); |
| 967 return; | 968 return; |
| 968 } | 969 } |
| 969 | 970 |
| 970 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 971 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
| 971 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 972 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
| 972 rappor::SampleDomainAndRegistryFromGURL( | 973 rappor::SampleDomainAndRegistryFromGURL( |
| 973 g_browser_process->rappor_service(), metric_name, url); | 974 g_browser_process->rappor_service(), metric_name, url); |
| 974 } | 975 } |
| OLD | NEW |