OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/page_load_metrics/page_load_metrics_observer.h" | 5 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 namespace page_load_metrics { | 9 namespace page_load_metrics { |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 base::Optional<base::TimeDelta>() /* first_background_time */, | 49 base::Optional<base::TimeDelta>() /* first_background_time */, |
50 base::Optional<base::TimeDelta>() /* first_foreground_time */, | 50 base::Optional<base::TimeDelta>() /* first_foreground_time */, |
51 started_in_foreground /* started_in_foreground */, | 51 started_in_foreground /* started_in_foreground */, |
52 UserInitiatedInfo::BrowserInitiated(), url, url, true /* did_commit */, | 52 UserInitiatedInfo::BrowserInitiated(), url, url, true /* did_commit */, |
53 page_load_metrics::END_NONE, | 53 page_load_metrics::END_NONE, |
54 page_load_metrics::UserInitiatedInfo::NotUserInitiated(), | 54 page_load_metrics::UserInitiatedInfo::NotUserInitiated(), |
55 base::TimeDelta(), page_load_metrics::PageLoadMetadata(), | 55 base::TimeDelta(), page_load_metrics::PageLoadMetadata(), |
56 page_load_metrics::PageLoadMetadata()); | 56 page_load_metrics::PageLoadMetadata()); |
57 } | 57 } |
58 | 58 |
59 ExtraRequestInfo::ExtraRequestInfo( | 59 ExtraRequestCompleteInfo::ExtraRequestCompleteInfo( |
60 bool was_cached, | 60 bool was_cached, |
61 int64_t raw_body_bytes, | 61 int64_t raw_body_bytes, |
62 int64_t original_network_content_length, | 62 int64_t original_network_content_length, |
63 std::unique_ptr<data_reduction_proxy::DataReductionProxyData> | 63 std::unique_ptr<data_reduction_proxy::DataReductionProxyData> |
64 data_reduction_proxy_data) | 64 data_reduction_proxy_data, |
| 65 content::ResourceType detected_resource_type) |
65 : was_cached(was_cached), | 66 : was_cached(was_cached), |
66 raw_body_bytes(raw_body_bytes), | 67 raw_body_bytes(raw_body_bytes), |
67 original_network_content_length(original_network_content_length), | 68 original_network_content_length(original_network_content_length), |
68 data_reduction_proxy_data(std::move(data_reduction_proxy_data)) {} | 69 data_reduction_proxy_data(std::move(data_reduction_proxy_data)), |
| 70 resource_type(detected_resource_type) {} |
69 | 71 |
70 ExtraRequestInfo::~ExtraRequestInfo() {} | 72 ExtraRequestCompleteInfo::~ExtraRequestCompleteInfo() {} |
| 73 |
| 74 ExtraRequestStartInfo::ExtraRequestStartInfo(content::ResourceType found_type) |
| 75 : resource_type(found_type) {} |
| 76 |
| 77 ExtraRequestStartInfo::ExtraRequestStartInfo( |
| 78 const ExtraRequestStartInfo& other) = default; |
| 79 |
| 80 ExtraRequestStartInfo::~ExtraRequestStartInfo() {} |
71 | 81 |
72 FailedProvisionalLoadInfo::FailedProvisionalLoadInfo(base::TimeDelta interval, | 82 FailedProvisionalLoadInfo::FailedProvisionalLoadInfo(base::TimeDelta interval, |
73 net::Error error) | 83 net::Error error) |
74 : time_to_failed_provisional_load(interval), error(error) {} | 84 : time_to_failed_provisional_load(interval), error(error) {} |
75 | 85 |
76 FailedProvisionalLoadInfo::~FailedProvisionalLoadInfo() {} | 86 FailedProvisionalLoadInfo::~FailedProvisionalLoadInfo() {} |
77 | 87 |
78 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnStart( | 88 PageLoadMetricsObserver::ObservePolicy PageLoadMetricsObserver::OnStart( |
79 content::NavigationHandle* navigation_handle, | 89 content::NavigationHandle* navigation_handle, |
80 const GURL& currently_committed_url, | 90 const GURL& currently_committed_url, |
(...skipping 30 matching lines...) Expand all Loading... |
111 | 121 |
112 PageLoadMetricsObserver::ObservePolicy | 122 PageLoadMetricsObserver::ObservePolicy |
113 PageLoadMetricsObserver::ShouldObserveMimeType( | 123 PageLoadMetricsObserver::ShouldObserveMimeType( |
114 const std::string& mime_type) const { | 124 const std::string& mime_type) const { |
115 return mime_type == "text/html" || mime_type == "application/xhtml+xml" | 125 return mime_type == "text/html" || mime_type == "application/xhtml+xml" |
116 ? CONTINUE_OBSERVING | 126 ? CONTINUE_OBSERVING |
117 : STOP_OBSERVING; | 127 : STOP_OBSERVING; |
118 } | 128 } |
119 | 129 |
120 } // namespace page_load_metrics | 130 } // namespace page_load_metrics |
OLD | NEW |