Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4723)

Unified Diff: chrome/common/page_load_metrics/page_load_timing.cc

Issue 2468913002: Add CSSTiming to collect aggregate PLT-level stats about CSS. (Closed)
Patch Set: fix browser test Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/page_load_metrics/page_load_timing.cc
diff --git a/chrome/common/page_load_metrics/page_load_timing.cc b/chrome/common/page_load_metrics/page_load_timing.cc
index 3f0925893c40a0eba879b36cdb7bafa3130c783c..40120a3a406d14b5696d9dfc4bed2026db9de77b 100644
--- a/chrome/common/page_load_metrics/page_load_timing.cc
+++ b/chrome/common/page_load_metrics/page_load_timing.cc
@@ -6,6 +6,21 @@
namespace page_load_metrics {
+StyleSheetTiming::StyleSheetTiming() {}
+
+StyleSheetTiming::StyleSheetTiming(const StyleSheetTiming& other) = default;
+
+StyleSheetTiming::~StyleSheetTiming() {}
+
+bool StyleSheetTiming::operator==(const StyleSheetTiming& other) const {
+ return author_style_sheet_parse_duration_before_fcp ==
+ other.author_style_sheet_parse_duration_before_fcp;
+}
+
+bool StyleSheetTiming::IsEmpty() const {
+ return !author_style_sheet_parse_duration_before_fcp;
+}
+
PageLoadTiming::PageLoadTiming() {}
PageLoadTiming::PageLoadTiming(const PageLoadTiming& other) = default;
@@ -33,7 +48,8 @@ bool PageLoadTiming::operator==(const PageLoadTiming& other) const {
other.parse_blocked_on_script_execution_duration &&
parse_blocked_on_script_execution_from_document_write_duration ==
other
- .parse_blocked_on_script_execution_from_document_write_duration;
+ .parse_blocked_on_script_execution_from_document_write_duration &&
+ style_sheet_timing == other.style_sheet_timing;
}
bool PageLoadTiming::IsEmpty() const {
@@ -45,7 +61,8 @@ bool PageLoadTiming::IsEmpty() const {
!parse_blocked_on_script_load_duration &&
!parse_blocked_on_script_load_from_document_write_duration &&
!parse_blocked_on_script_execution_duration &&
- !parse_blocked_on_script_execution_from_document_write_duration;
+ !parse_blocked_on_script_execution_from_document_write_duration &&
+ style_sheet_timing.IsEmpty();
}
PageLoadMetadata::PageLoadMetadata() {}
« no previous file with comments | « chrome/common/page_load_metrics/page_load_timing.h ('k') | chrome/renderer/page_load_metrics/metrics_render_frame_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698