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

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

Issue 2806863003: [Page Load Metrics] Structure PageLoadTiming. (Closed)
Patch Set: rebase Created 3 years, 8 months 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 9ce7705baca0e990be0c45250ed031fdbc7374a6..f926f8d679a9856b830d528901c5801b5638b61a 100644
--- a/chrome/common/page_load_metrics/page_load_timing.cc
+++ b/chrome/common/page_load_metrics/page_load_timing.cc
@@ -6,6 +6,69 @@
namespace page_load_metrics {
+DocumentTiming::DocumentTiming() {}
+
+DocumentTiming::DocumentTiming(const DocumentTiming& other) = default;
+
+DocumentTiming::~DocumentTiming() {}
+
+bool DocumentTiming::operator==(const DocumentTiming& other) const {
+ return dom_content_loaded_event_start ==
+ other.dom_content_loaded_event_start &&
+ load_event_start == other.load_event_start &&
+ first_layout == other.first_layout;
+}
+
+bool DocumentTiming::IsEmpty() const {
+ return !dom_content_loaded_event_start && !load_event_start && !first_layout;
+}
+
+PaintTiming::PaintTiming() {}
+
+PaintTiming::PaintTiming(const PaintTiming& other) = default;
+
+PaintTiming::~PaintTiming() {}
+
+bool PaintTiming::operator==(const PaintTiming& other) const {
+ return first_paint == other.first_paint &&
+ first_text_paint == other.first_text_paint &&
+ first_image_paint == other.first_image_paint &&
+ first_contentful_paint == other.first_contentful_paint &&
+ first_meaningful_paint == other.first_meaningful_paint;
+}
+
+bool PaintTiming::IsEmpty() const {
+ return !first_paint && !first_text_paint && !first_image_paint &&
+ !first_contentful_paint && !first_meaningful_paint;
+}
+
+ParseTiming::ParseTiming() {}
+
+ParseTiming::ParseTiming(const ParseTiming& other) = default;
+
+ParseTiming::~ParseTiming() {}
+
+bool ParseTiming::operator==(const ParseTiming& other) const {
+ return parse_start == other.parse_start && parse_stop == other.parse_stop &&
+ parse_blocked_on_script_load_duration ==
+ other.parse_blocked_on_script_load_duration &&
+ parse_blocked_on_script_load_from_document_write_duration ==
+ other.parse_blocked_on_script_load_from_document_write_duration &&
+ parse_blocked_on_script_execution_duration ==
+ 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;
+}
+
+bool ParseTiming::IsEmpty() const {
+ return !parse_start && !parse_stop &&
+ !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;
+}
+
StyleSheetTiming::StyleSheetTiming() {}
StyleSheetTiming::StyleSheetTiming(const StyleSheetTiming& other) = default;
@@ -33,39 +96,16 @@ PageLoadTiming::~PageLoadTiming() {}
bool PageLoadTiming::operator==(const PageLoadTiming& other) const {
return navigation_start == other.navigation_start &&
response_start == other.response_start &&
- dom_content_loaded_event_start ==
- other.dom_content_loaded_event_start &&
- load_event_start == other.load_event_start &&
- first_layout == other.first_layout &&
- first_paint == other.first_paint &&
- first_text_paint == other.first_text_paint &&
- first_image_paint == other.first_image_paint &&
- first_contentful_paint == other.first_contentful_paint &&
- first_meaningful_paint == other.first_meaningful_paint &&
- parse_start == other.parse_start && parse_stop == other.parse_stop &&
- parse_blocked_on_script_load_duration ==
- other.parse_blocked_on_script_load_duration &&
- parse_blocked_on_script_load_from_document_write_duration ==
- other.parse_blocked_on_script_load_from_document_write_duration &&
- parse_blocked_on_script_execution_duration ==
- 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 &&
+ document_timing == other.document_timing &&
+ paint_timing == other.paint_timing &&
+ parse_timing == other.parse_timing &&
style_sheet_timing == other.style_sheet_timing;
}
bool PageLoadTiming::IsEmpty() const {
return navigation_start.is_null() && !response_start &&
- !dom_content_loaded_event_start && !load_event_start &&
- !first_layout && !first_paint && !first_text_paint &&
- !first_image_paint && !first_contentful_paint &&
- !first_meaningful_paint && !parse_start && !parse_stop &&
- !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 &&
- style_sheet_timing.IsEmpty();
+ document_timing.IsEmpty() && paint_timing.IsEmpty() &&
+ parse_timing.IsEmpty() && 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