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

Side by Side 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 unified diff | Download patch
OLDNEW
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/common/page_load_metrics/page_load_timing.h" 5 #include "chrome/common/page_load_metrics/page_load_timing.h"
6 6
7 namespace page_load_metrics { 7 namespace page_load_metrics {
8 8
9 StyleSheetTiming::StyleSheetTiming() {}
10
11 StyleSheetTiming::StyleSheetTiming(const StyleSheetTiming& other) = default;
12
13 StyleSheetTiming::~StyleSheetTiming() {}
14
15 bool StyleSheetTiming::operator==(const StyleSheetTiming& other) const {
16 return author_style_sheet_parse_duration_before_fcp ==
17 other.author_style_sheet_parse_duration_before_fcp;
18 }
19
20 bool StyleSheetTiming::IsEmpty() const {
21 return !author_style_sheet_parse_duration_before_fcp;
22 }
23
9 PageLoadTiming::PageLoadTiming() {} 24 PageLoadTiming::PageLoadTiming() {}
10 25
11 PageLoadTiming::PageLoadTiming(const PageLoadTiming& other) = default; 26 PageLoadTiming::PageLoadTiming(const PageLoadTiming& other) = default;
12 27
13 PageLoadTiming::~PageLoadTiming() {} 28 PageLoadTiming::~PageLoadTiming() {}
14 29
15 bool PageLoadTiming::operator==(const PageLoadTiming& other) const { 30 bool PageLoadTiming::operator==(const PageLoadTiming& other) const {
16 return navigation_start == other.navigation_start && 31 return navigation_start == other.navigation_start &&
17 response_start == other.response_start && 32 response_start == other.response_start &&
18 dom_content_loaded_event_start == 33 dom_content_loaded_event_start ==
19 other.dom_content_loaded_event_start && 34 other.dom_content_loaded_event_start &&
20 load_event_start == other.load_event_start && 35 load_event_start == other.load_event_start &&
21 first_layout == other.first_layout && 36 first_layout == other.first_layout &&
22 first_paint == other.first_paint && 37 first_paint == other.first_paint &&
23 first_text_paint == other.first_text_paint && 38 first_text_paint == other.first_text_paint &&
24 first_image_paint == other.first_image_paint && 39 first_image_paint == other.first_image_paint &&
25 first_contentful_paint == other.first_contentful_paint && 40 first_contentful_paint == other.first_contentful_paint &&
26 first_meaningful_paint == other.first_meaningful_paint && 41 first_meaningful_paint == other.first_meaningful_paint &&
27 parse_start == other.parse_start && parse_stop == other.parse_stop && 42 parse_start == other.parse_start && parse_stop == other.parse_stop &&
28 parse_blocked_on_script_load_duration == 43 parse_blocked_on_script_load_duration ==
29 other.parse_blocked_on_script_load_duration && 44 other.parse_blocked_on_script_load_duration &&
30 parse_blocked_on_script_load_from_document_write_duration == 45 parse_blocked_on_script_load_from_document_write_duration ==
31 other.parse_blocked_on_script_load_from_document_write_duration && 46 other.parse_blocked_on_script_load_from_document_write_duration &&
32 parse_blocked_on_script_execution_duration == 47 parse_blocked_on_script_execution_duration ==
33 other.parse_blocked_on_script_execution_duration && 48 other.parse_blocked_on_script_execution_duration &&
34 parse_blocked_on_script_execution_from_document_write_duration == 49 parse_blocked_on_script_execution_from_document_write_duration ==
35 other 50 other
36 .parse_blocked_on_script_execution_from_document_write_duration ; 51 .parse_blocked_on_script_execution_from_document_write_duration &&
52 style_sheet_timing == other.style_sheet_timing;
37 } 53 }
38 54
39 bool PageLoadTiming::IsEmpty() const { 55 bool PageLoadTiming::IsEmpty() const {
40 return navigation_start.is_null() && !response_start && 56 return navigation_start.is_null() && !response_start &&
41 !dom_content_loaded_event_start && !load_event_start && 57 !dom_content_loaded_event_start && !load_event_start &&
42 !first_layout && !first_paint && !first_text_paint && 58 !first_layout && !first_paint && !first_text_paint &&
43 !first_image_paint && !first_contentful_paint && 59 !first_image_paint && !first_contentful_paint &&
44 !first_meaningful_paint && !parse_start && !parse_stop && 60 !first_meaningful_paint && !parse_start && !parse_stop &&
45 !parse_blocked_on_script_load_duration && 61 !parse_blocked_on_script_load_duration &&
46 !parse_blocked_on_script_load_from_document_write_duration && 62 !parse_blocked_on_script_load_from_document_write_duration &&
47 !parse_blocked_on_script_execution_duration && 63 !parse_blocked_on_script_execution_duration &&
48 !parse_blocked_on_script_execution_from_document_write_duration; 64 !parse_blocked_on_script_execution_from_document_write_duration &&
65 style_sheet_timing.IsEmpty();
49 } 66 }
50 67
51 PageLoadMetadata::PageLoadMetadata() {} 68 PageLoadMetadata::PageLoadMetadata() {}
52 69
53 bool PageLoadMetadata::operator==(const PageLoadMetadata& other) const { 70 bool PageLoadMetadata::operator==(const PageLoadMetadata& other) const {
54 return behavior_flags == other.behavior_flags; 71 return behavior_flags == other.behavior_flags;
55 } 72 }
56 73
57 } // namespace page_load_metrics 74 } // namespace page_load_metrics
OLDNEW
« 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