| 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 "components/page_load_metrics/common/page_load_timing.h" | 5 #include "components/page_load_metrics/common/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; |
| 12 |
| 11 PageLoadTiming::~PageLoadTiming() {} | 13 PageLoadTiming::~PageLoadTiming() {} |
| 12 | 14 |
| 13 bool PageLoadTiming::operator==(const PageLoadTiming& other) const { | 15 bool PageLoadTiming::operator==(const PageLoadTiming& other) const { |
| 14 return navigation_start == other.navigation_start && | 16 return navigation_start == other.navigation_start && |
| 15 response_start == other.response_start && | 17 response_start == other.response_start && |
| 16 dom_loading == other.dom_loading && | 18 dom_loading == other.dom_loading && |
| 17 dom_content_loaded_event_start == | 19 dom_content_loaded_event_start == |
| 18 other.dom_content_loaded_event_start && | 20 other.dom_content_loaded_event_start && |
| 19 load_event_start == other.load_event_start && | 21 load_event_start == other.load_event_start && |
| 20 first_layout == other.first_layout && | 22 first_layout == other.first_layout && |
| 21 first_paint == other.first_paint && | 23 first_paint == other.first_paint && |
| 22 first_text_paint == other.first_text_paint && | 24 first_text_paint == other.first_text_paint && |
| 23 first_image_paint == other.first_image_paint; | 25 first_image_paint == other.first_image_paint; |
| 24 } | 26 } |
| 25 | 27 |
| 26 bool PageLoadTiming::IsEmpty() const { | 28 bool PageLoadTiming::IsEmpty() const { |
| 27 return navigation_start.is_null() && response_start.is_zero() && | 29 return navigation_start.is_null() && response_start.is_zero() && |
| 28 dom_loading.is_zero() && dom_content_loaded_event_start.is_zero() && | 30 dom_loading.is_zero() && dom_content_loaded_event_start.is_zero() && |
| 29 load_event_start.is_zero() && first_layout.is_zero() && | 31 load_event_start.is_zero() && first_layout.is_zero() && |
| 30 first_paint.is_zero() && first_text_paint.is_zero() && | 32 first_paint.is_zero() && first_text_paint.is_zero() && |
| 31 first_image_paint.is_zero(); | 33 first_image_paint.is_zero(); |
| 32 } | 34 } |
| 33 | 35 |
| 34 } // namespace page_load_metrics | 36 } // namespace page_load_metrics |
| OLD | NEW |