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/observers/core_page_load_metrics_obse
rver.h" | 5 #include "chrome/browser/page_load_metrics/observers/core_page_load_metrics_obse
rver.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 event.GetType() == blink::WebInputEvent::kGestureScrollBegin) { | 662 event.GetType() == blink::WebInputEvent::kGestureScrollBegin) { |
663 received_scroll_input_after_first_paint_ = true; | 663 received_scroll_input_after_first_paint_ = true; |
664 if (now.is_null()) | 664 if (now.is_null()) |
665 now = base::TimeTicks::Now(); | 665 now = base::TimeTicks::Now(); |
666 PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstScrollInputAfterFirstPaint, | 666 PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstScrollInputAfterFirstPaint, |
667 now - first_paint_); | 667 now - first_paint_); |
668 } | 668 } |
669 } | 669 } |
670 | 670 |
671 void CorePageLoadMetricsObserver::OnLoadedResource( | 671 void CorePageLoadMetricsObserver::OnLoadedResource( |
672 const page_load_metrics::ExtraRequestInfo& extra_request_info) { | 672 const page_load_metrics::ExtraRequestCompleteInfo& |
673 if (extra_request_info.was_cached) { | 673 extra_request_complete_info) { |
| 674 if (extra_request_complete_info.was_cached) { |
674 ++num_cache_resources_; | 675 ++num_cache_resources_; |
675 cache_bytes_ += extra_request_info.raw_body_bytes; | 676 cache_bytes_ += extra_request_complete_info.raw_body_bytes; |
676 } else { | 677 } else { |
677 ++num_network_resources_; | 678 ++num_network_resources_; |
678 network_bytes_ += extra_request_info.raw_body_bytes; | 679 network_bytes_ += extra_request_complete_info.raw_body_bytes; |
679 } | 680 } |
680 } | 681 } |
681 | 682 |
682 void CorePageLoadMetricsObserver::RecordTimingHistograms( | 683 void CorePageLoadMetricsObserver::RecordTimingHistograms( |
683 const page_load_metrics::PageLoadTiming& timing, | 684 const page_load_metrics::PageLoadTiming& timing, |
684 const page_load_metrics::PageLoadExtraInfo& info) { | 685 const page_load_metrics::PageLoadExtraInfo& info) { |
685 // Log time to first foreground / time to first background. Log counts that we | 686 // Log time to first foreground / time to first background. Log counts that we |
686 // started a relevant page load in the foreground / background. | 687 // started a relevant page load in the foreground / background. |
687 if (!info.started_in_foreground && info.first_foreground_time) { | 688 if (!info.started_in_foreground && info.first_foreground_time) { |
688 PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstForeground, | 689 PAGE_LOAD_HISTOGRAM(internal::kHistogramFirstForeground, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 } | 838 } |
838 | 839 |
839 // Log the eTLD+1 of sites that did not report first meaningful paint. | 840 // Log the eTLD+1 of sites that did not report first meaningful paint. |
840 if (timing.paint_timing.first_paint && | 841 if (timing.paint_timing.first_paint && |
841 !timing.paint_timing.first_meaningful_paint) { | 842 !timing.paint_timing.first_meaningful_paint) { |
842 rappor::SampleDomainAndRegistryFromGURL( | 843 rappor::SampleDomainAndRegistryFromGURL( |
843 rappor_service, | 844 rappor_service, |
844 internal::kRapporMetricsNameFirstMeaningfulPaintNotRecorded, info.url); | 845 internal::kRapporMetricsNameFirstMeaningfulPaintNotRecorded, info.url); |
845 } | 846 } |
846 } | 847 } |
OLD | NEW |