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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include <google/protobuf/repeated_field.h> | 98 #include <google/protobuf/repeated_field.h> |
99 #else | 99 #else |
100 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 100 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
101 #endif | 101 #endif |
102 | 102 |
103 #if BUILDFLAG(ANDROID_JAVA_UI) | 103 #if BUILDFLAG(ANDROID_JAVA_UI) |
104 #include "chrome/browser/android/intercept_download_resource_throttle.h" | 104 #include "chrome/browser/android/intercept_download_resource_throttle.h" |
105 #endif | 105 #endif |
106 | 106 |
107 #if defined(OS_ANDROID) | 107 #if defined(OS_ANDROID) |
108 #include "chrome/browser/android/offline_pages/offline_page_request_handler.h" | |
109 #include "chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_an
droid.h" | 108 #include "chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_an
droid.h" |
110 #include "components/navigation_interception/intercept_navigation_delegate.h" | 109 #include "components/navigation_interception/intercept_navigation_delegate.h" |
111 #endif | 110 #endif |
112 | 111 |
113 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
114 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h
" | 113 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h
" |
115 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" | 114 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" |
116 #endif | 115 #endif |
117 | 116 |
118 using content::BrowserThread; | 117 using content::BrowserThread; |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 resource_context, | 487 resource_context, |
489 resource_type, | 488 resource_type, |
490 throttles); | 489 throttles); |
491 } | 490 } |
492 #endif | 491 #endif |
493 | 492 |
494 if (io_data->resource_prefetch_predictor_observer()) { | 493 if (io_data->resource_prefetch_predictor_observer()) { |
495 io_data->resource_prefetch_predictor_observer()->OnRequestStarted( | 494 io_data->resource_prefetch_predictor_observer()->OnRequestStarted( |
496 request, resource_type, info->GetChildID(), info->GetRenderFrameID()); | 495 request, resource_type, info->GetChildID(), info->GetRenderFrameID()); |
497 } | 496 } |
498 | |
499 #if defined(OS_ANDROID) | |
500 if (!io_data->IsOffTheRecord()) { | |
501 offline_pages::OfflinePageRequestHandler::InitializeHandler( | |
502 request, resource_type); | |
503 } | |
504 #endif | |
505 } | 497 } |
506 | 498 |
507 void ChromeResourceDispatcherHostDelegate::DownloadStarting( | 499 void ChromeResourceDispatcherHostDelegate::DownloadStarting( |
508 net::URLRequest* request, | 500 net::URLRequest* request, |
509 content::ResourceContext* resource_context, | 501 content::ResourceContext* resource_context, |
510 int child_id, | 502 int child_id, |
511 int route_id, | 503 int route_id, |
512 bool is_content_initiated, | 504 bool is_content_initiated, |
513 bool must_download, | 505 bool must_download, |
514 ScopedVector<content::ResourceThrottle>* throttles) { | 506 ScopedVector<content::ResourceThrottle>* throttles) { |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 882 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
891 base::Unretained(this), url, request_loading_time)); | 883 base::Unretained(this), url, request_loading_time)); |
892 return; | 884 return; |
893 } | 885 } |
894 | 886 |
895 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 887 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
896 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 888 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
897 rappor::SampleDomainAndRegistryFromGURL( | 889 rappor::SampleDomainAndRegistryFromGURL( |
898 g_browser_process->rappor_service(), metric_name, url); | 890 g_browser_process->rappor_service(), metric_name, url); |
899 } | 891 } |
OLD | NEW |