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

Side by Side Diff: chrome/common/page_load_metrics/page_load_timing.cc

Issue 2199443002: Move PageLoadTiming TimeDelta fields to a common header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove dom_loading Created 4 years, 4 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 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 PageLoadTiming::PageLoadTiming() {} 9 PageLoadTiming::PageLoadTiming() {}
10 10
11 PageLoadTiming::PageLoadTiming(const PageLoadTiming& other) = default; 11 PageLoadTiming::PageLoadTiming(const PageLoadTiming& other) = default;
12 12
13 PageLoadTiming::~PageLoadTiming() {} 13 PageLoadTiming::~PageLoadTiming() {}
14 14
15 bool PageLoadTiming::operator==(const PageLoadTiming& other) const { 15 bool PageLoadTiming::operator==(const PageLoadTiming& other) const {
16 return navigation_start == other.navigation_start && 16 #define PAGE_LOAD_TIMING_TIME_DELTA_FIELD(field_name) \
17 response_start == other.response_start && 17 &&field_name == other.field_name
18 dom_content_loaded_event_start == 18
19 other.dom_content_loaded_event_start && 19 return navigation_start == other.navigation_start
20 load_event_start == other.load_event_start && 20 #include "chrome/common/page_load_metrics/page_load_timing_fields.h"
21 first_layout == other.first_layout && 21 ;
22 first_paint == other.first_paint && 22
23 first_text_paint == other.first_text_paint && 23 #undef PAGE_LOAD_TIMING_TIME_DELTA_FIELD
24 first_image_paint == other.first_image_paint &&
25 first_contentful_paint == other.first_contentful_paint &&
26 parse_start == other.parse_start && parse_stop == other.parse_stop &&
27 parse_blocked_on_script_load_duration ==
28 other.parse_blocked_on_script_load_duration &&
29 parse_blocked_on_script_load_from_document_write_duration ==
30 other.parse_blocked_on_script_load_from_document_write_duration;
31 } 24 }
32 25
33 bool PageLoadTiming::IsEmpty() const { 26 bool PageLoadTiming::IsEmpty() const {
34 return navigation_start.is_null() && !response_start && 27 #define PAGE_LOAD_TIMING_TIME_DELTA_FIELD(field_name) &&!field_name
35 !dom_content_loaded_event_start && !load_event_start && 28
36 !first_layout && !first_paint && !first_text_paint && 29 return navigation_start.is_null()
37 !first_image_paint && !first_contentful_paint && !parse_start && 30 #include "chrome/common/page_load_metrics/page_load_timing_fields.h"
38 !parse_stop && !parse_blocked_on_script_load_duration && 31 ;
39 !parse_blocked_on_script_load_from_document_write_duration; 32
40 } 33 #undef PAGE_LOAD_TIMING_TIME_DELTA_FIELD
41 34
42 PageLoadMetadata::PageLoadMetadata() {} 35 PageLoadMetadata::PageLoadMetadata() {}
43 36
44 bool PageLoadMetadata::operator==(const PageLoadMetadata& other) const { 37 bool PageLoadMetadata::operator==(const PageLoadMetadata& other) const {
45 return behavior_flags == other.behavior_flags; 38 return behavior_flags == other.behavior_flags;
46 } 39 }
47 40
48 } // namespace page_load_metrics 41 } // namespace page_load_metrics
OLDNEW
« no previous file with comments | « chrome/common/page_load_metrics/page_load_timing.h ('k') | chrome/common/page_load_metrics/page_load_timing_fields.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698