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" | 108 #include "chrome/browser/android/offline_pages/offline_page_request_job.h" |
109 #include "chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_an droid.h" | 109 #include "chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_an droid.h" |
110 #include "components/navigation_interception/intercept_navigation_delegate.h" | 110 #include "components/navigation_interception/intercept_navigation_delegate.h" |
111 #endif | 111 #endif |
112 | 112 |
113 #if defined(OS_CHROMEOS) | 113 #if defined(OS_CHROMEOS) |
114 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h " | 114 #include "chrome/browser/chromeos/login/signin/merge_session_resource_throttle.h " |
115 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" | 115 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" |
116 #endif | 116 #endif |
117 | 117 |
118 using content::BrowserThread; | 118 using content::BrowserThread; |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 } | 491 } |
492 #endif | 492 #endif |
493 | 493 |
494 if (io_data->resource_prefetch_predictor_observer()) { | 494 if (io_data->resource_prefetch_predictor_observer()) { |
495 io_data->resource_prefetch_predictor_observer()->OnRequestStarted( | 495 io_data->resource_prefetch_predictor_observer()->OnRequestStarted( |
496 request, resource_type, info->GetChildID(), info->GetRenderFrameID()); | 496 request, resource_type, info->GetChildID(), info->GetRenderFrameID()); |
497 } | 497 } |
498 | 498 |
499 #if defined(OS_ANDROID) | 499 #if defined(OS_ANDROID) |
500 if (!io_data->IsOffTheRecord()) { | 500 if (!io_data->IsOffTheRecord()) { |
501 offline_pages::OfflinePageRequestHandler::InitializeHandler( | 501 offline_pages::OfflinePageRequestJob::SetOfflinePageRequestInfoForRequest( |
502 request, resource_type); | 502 request, resource_type); |
mmenke
2016/08/19 15:04:09
I don't think any code is needed here at all. The
jianli
2016/08/19 19:34:56
Thanks for the tip. Done.
| |
503 } | 503 } |
504 #endif | 504 #endif |
505 } | 505 } |
506 | 506 |
507 void ChromeResourceDispatcherHostDelegate::DownloadStarting( | 507 void ChromeResourceDispatcherHostDelegate::DownloadStarting( |
508 net::URLRequest* request, | 508 net::URLRequest* request, |
509 content::ResourceContext* resource_context, | 509 content::ResourceContext* resource_context, |
510 int child_id, | 510 int child_id, |
511 int route_id, | 511 int route_id, |
512 bool is_content_initiated, | 512 bool is_content_initiated, |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
890 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 890 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
891 base::Unretained(this), url, request_loading_time)); | 891 base::Unretained(this), url, request_loading_time)); |
892 return; | 892 return; |
893 } | 893 } |
894 | 894 |
895 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 895 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
896 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 896 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
897 rappor::SampleDomainAndRegistryFromGURL( | 897 rappor::SampleDomainAndRegistryFromGURL( |
898 g_browser_process->rappor_service(), metric_name, url); | 898 g_browser_process->rappor_service(), metric_name, url); |
899 } | 899 } |
OLD | NEW |