OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/observers/subresource_filter_metrics_
observer.h" | 5 #include "chrome/browser/page_load_metrics/observers/subresource_filter_metrics_
observer.h" |
6 | 6 |
7 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" | 7 #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" |
8 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 8 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
9 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" | 9 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return CONTINUE_OBSERVING; | 161 return CONTINUE_OBSERVING; |
162 } | 162 } |
163 | 163 |
164 void SubresourceFilterMetricsObserver::OnComplete( | 164 void SubresourceFilterMetricsObserver::OnComplete( |
165 const page_load_metrics::PageLoadTiming& timing, | 165 const page_load_metrics::PageLoadTiming& timing, |
166 const page_load_metrics::PageLoadExtraInfo& info) { | 166 const page_load_metrics::PageLoadExtraInfo& info) { |
167 OnGoingAway(timing, info, base::TimeTicks()); | 167 OnGoingAway(timing, info, base::TimeTicks()); |
168 } | 168 } |
169 | 169 |
170 void SubresourceFilterMetricsObserver::OnLoadedResource( | 170 void SubresourceFilterMetricsObserver::OnLoadedResource( |
171 const page_load_metrics::ExtraRequestInfo& extra_request_info) { | 171 const page_load_metrics::ExtraRequestCompleteInfo& extra_request_info) { |
172 if (extra_request_info.was_cached) { | 172 if (extra_request_info.was_cached) { |
173 ++num_cache_resources_; | 173 ++num_cache_resources_; |
174 cache_bytes_ += extra_request_info.raw_body_bytes; | 174 cache_bytes_ += extra_request_info.raw_body_bytes; |
175 } else { | 175 } else { |
176 ++num_network_resources_; | 176 ++num_network_resources_; |
177 network_bytes_ += extra_request_info.raw_body_bytes; | 177 network_bytes_ += extra_request_info.raw_body_bytes; |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 void SubresourceFilterMetricsObserver::OnParseStop( | 181 void SubresourceFilterMetricsObserver::OnParseStop( |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 PAGE_LOAD_LONG_HISTOGRAM( | 356 PAGE_LOAD_LONG_HISTOGRAM( |
357 internal::kHistogramSubresourceFilterForegroundDuration, | 357 internal::kHistogramSubresourceFilterForegroundDuration, |
358 foreground_duration.value()); | 358 foreground_duration.value()); |
359 if (timing.first_paint && timing.first_paint < foreground_duration) { | 359 if (timing.first_paint && timing.first_paint < foreground_duration) { |
360 PAGE_LOAD_LONG_HISTOGRAM( | 360 PAGE_LOAD_LONG_HISTOGRAM( |
361 internal::kHistogramSubresourceFilterForegroundDurationAfterPaint, | 361 internal::kHistogramSubresourceFilterForegroundDurationAfterPaint, |
362 foreground_duration.value() - timing.first_paint.value()); | 362 foreground_duration.value() - timing.first_paint.value()); |
363 } | 363 } |
364 } | 364 } |
365 } | 365 } |
OLD | NEW |