| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 #include "chrome/browser/supervised_user/supervised_user_resource_throttle.h" | 99 #include "chrome/browser/supervised_user/supervised_user_resource_throttle.h" |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 #if defined(USE_SYSTEM_PROTOBUF) | 102 #if defined(USE_SYSTEM_PROTOBUF) |
| 103 #include <google/protobuf/repeated_field.h> | 103 #include <google/protobuf/repeated_field.h> |
| 104 #else | 104 #else |
| 105 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 105 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 #if defined(OS_ANDROID) | 108 #if defined(OS_ANDROID) |
| 109 #include "chrome/browser/android/download/intercept_download_resource_throttle.h
" |
| 109 #include "chrome/browser/android/offline_pages/downloads/resource_throttle.h" | 110 #include "chrome/browser/android/offline_pages/downloads/resource_throttle.h" |
| 110 #include "chrome/browser/loader/data_reduction_proxy_resource_throttle_android.h
" | 111 #include "chrome/browser/loader/data_reduction_proxy_resource_throttle_android.h
" |
| 111 #include "components/navigation_interception/intercept_navigation_delegate.h" | 112 #include "components/navigation_interception/intercept_navigation_delegate.h" |
| 112 #endif | 113 #endif |
| 113 | 114 |
| 114 #if defined(OS_CHROMEOS) | 115 #if defined(OS_CHROMEOS) |
| 115 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h
" | 116 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h
" |
| 116 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" | 117 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" |
| 117 #endif | 118 #endif |
| 118 | 119 |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 546 } |
| 546 | 547 |
| 547 // If this isn't a new request, the standard resource throttles have already | 548 // If this isn't a new request, the standard resource throttles have already |
| 548 // been added, so no need to add them again. | 549 // been added, so no need to add them again. |
| 549 if (is_new_request) { | 550 if (is_new_request) { |
| 550 AppendStandardResourceThrottles(request, | 551 AppendStandardResourceThrottles(request, |
| 551 resource_context, | 552 resource_context, |
| 552 content::RESOURCE_TYPE_MAIN_FRAME, | 553 content::RESOURCE_TYPE_MAIN_FRAME, |
| 553 throttles); | 554 throttles); |
| 554 #if defined(OS_ANDROID) | 555 #if defined(OS_ANDROID) |
| 556 throttles->push_back( |
| 557 base::MakeUnique<InterceptDownloadResourceThrottle>( |
| 558 request, info->GetWebContentsGetterForRequest())); |
| 555 // On Android, forward text/html downloads to OfflinePages backend. | 559 // On Android, forward text/html downloads to OfflinePages backend. |
| 556 throttles->push_back( | 560 throttles->push_back( |
| 557 base::MakeUnique<offline_pages::downloads::ResourceThrottle>(request)); | 561 base::MakeUnique<offline_pages::downloads::ResourceThrottle>(request)); |
| 558 #endif | 562 #endif |
| 559 } | 563 } |
| 560 } | 564 } |
| 561 | 565 |
| 562 ResourceDispatcherHostLoginDelegate* | 566 ResourceDispatcherHostLoginDelegate* |
| 563 ChromeResourceDispatcherHostDelegate::CreateLoginDelegate( | 567 ChromeResourceDispatcherHostDelegate::CreateLoginDelegate( |
| 564 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { | 568 net::AuthChallengeInfo* auth_info, net::URLRequest* request) { |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 919 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
| 916 base::Unretained(this), url, request_loading_time)); | 920 base::Unretained(this), url, request_loading_time)); |
| 917 return; | 921 return; |
| 918 } | 922 } |
| 919 | 923 |
| 920 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 924 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
| 921 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 925 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
| 922 rappor::SampleDomainAndRegistryFromGURL( | 926 rappor::SampleDomainAndRegistryFromGURL( |
| 923 g_browser_process->rappor_service(), metric_name, url); | 927 g_browser_process->rappor_service(), metric_name, url); |
| 924 } | 928 } |
| OLD | NEW |