| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "content/public/browser/plugin_service_filter.h" | 64 #include "content/public/browser/plugin_service_filter.h" |
| 65 #include "content/public/browser/render_frame_host.h" | 65 #include "content/public/browser/render_frame_host.h" |
| 66 #include "content/public/browser/render_process_host.h" | 66 #include "content/public/browser/render_process_host.h" |
| 67 #include "content/public/browser/render_view_host.h" | 67 #include "content/public/browser/render_view_host.h" |
| 68 #include "content/public/browser/resource_context.h" | 68 #include "content/public/browser/resource_context.h" |
| 69 #include "content/public/browser/resource_dispatcher_host.h" | 69 #include "content/public/browser/resource_dispatcher_host.h" |
| 70 #include "content/public/browser/resource_request_info.h" | 70 #include "content/public/browser/resource_request_info.h" |
| 71 #include "content/public/browser/service_worker_context.h" | 71 #include "content/public/browser/service_worker_context.h" |
| 72 #include "content/public/browser/stream_info.h" | 72 #include "content/public/browser/stream_info.h" |
| 73 #include "content/public/browser/web_contents.h" | 73 #include "content/public/browser/web_contents.h" |
| 74 #include "content/public/common/previews_state.h" |
| 74 #include "content/public/common/resource_response.h" | 75 #include "content/public/common/resource_response.h" |
| 75 #include "extensions/features/features.h" | 76 #include "extensions/features/features.h" |
| 76 #include "net/base/load_flags.h" | 77 #include "net/base/load_flags.h" |
| 77 #include "net/base/load_timing_info.h" | 78 #include "net/base/load_timing_info.h" |
| 78 #include "net/base/request_priority.h" | 79 #include "net/base/request_priority.h" |
| 79 #include "net/http/http_response_headers.h" | 80 #include "net/http/http_response_headers.h" |
| 80 #include "net/ssl/client_cert_store.h" | 81 #include "net/ssl/client_cert_store.h" |
| 81 #include "net/url_request/url_request.h" | 82 #include "net/url_request/url_request.h" |
| 82 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 83 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
| 83 | 84 |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 } | 929 } |
| 929 | 930 |
| 930 content::NavigationData* | 931 content::NavigationData* |
| 931 ChromeResourceDispatcherHostDelegate::GetNavigationData( | 932 ChromeResourceDispatcherHostDelegate::GetNavigationData( |
| 932 net::URLRequest* request) const { | 933 net::URLRequest* request) const { |
| 933 ChromeNavigationData* data = | 934 ChromeNavigationData* data = |
| 934 ChromeNavigationData::GetDataAndCreateIfNecessary(request); | 935 ChromeNavigationData::GetDataAndCreateIfNecessary(request); |
| 935 if (!request) | 936 if (!request) |
| 936 return data; | 937 return data; |
| 937 | 938 |
| 939 // Update the previews state from the navigation data. |
| 940 const content::ResourceRequestInfo* info = |
| 941 content::ResourceRequestInfo::ForRequest(request); |
| 942 if (info) { |
| 943 data->set_previews_state(info->GetPreviewsState()); |
| 944 } |
| 945 |
| 938 data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data = | 946 data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data = |
| 939 data_reduction_proxy::DataReductionProxyData::GetData(*request); | 947 data_reduction_proxy::DataReductionProxyData::GetData(*request); |
| 940 // DeepCopy the DataReductionProxyData from the URLRequest to prevent the | 948 // DeepCopy the DataReductionProxyData from the URLRequest to prevent the |
| 941 // URLRequest and DataReductionProxyData from both having ownership of the | 949 // URLRequest and DataReductionProxyData from both having ownership of the |
| 942 // same object. This copy will be shortlived as it will be deep copied again | 950 // same object. This copy will be shortlived as it will be deep copied again |
| 943 // when content makes a clone of NavigationData for the UI thread. | 951 // when content makes a clone of NavigationData for the UI thread. |
| 944 if (data_reduction_proxy_data) | 952 if (data_reduction_proxy_data) |
| 945 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy()); | 953 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy()); |
| 946 return data; | 954 return data; |
| 947 } | 955 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 965 &ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 973 &ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
| 966 base::Unretained(this), url, request_loading_time)); | 974 base::Unretained(this), url, request_loading_time)); |
| 967 return; | 975 return; |
| 968 } | 976 } |
| 969 | 977 |
| 970 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 978 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
| 971 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 979 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
| 972 rappor::SampleDomainAndRegistryFromGURL( | 980 rappor::SampleDomainAndRegistryFromGURL( |
| 973 g_browser_process->rappor_service(), metric_name, url); | 981 g_browser_process->rappor_service(), metric_name, url); |
| 974 } | 982 } |
| OLD | NEW |