Chromium Code Reviews| 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 "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 return navigation_start == other.navigation_start && |
| 17 response_start == other.response_start && | 17 response_start == other.response_start && |
| 18 dom_loading == other.dom_loading && | 18 dom_loading == other.dom_loading && |
| 19 dom_content_loaded_event_start == | 19 dom_content_loaded_event_start == |
| 20 other.dom_content_loaded_event_start && | 20 other.dom_content_loaded_event_start && |
| 21 load_event_start == other.load_event_start && | 21 load_event_start == other.load_event_start && |
| 22 first_layout == other.first_layout && | 22 first_layout == other.first_layout && |
| 23 first_paint == other.first_paint && | 23 first_paint == other.first_paint && |
| 24 first_text_paint == other.first_text_paint && | 24 first_text_paint == other.first_text_paint && |
| 25 first_image_paint == other.first_image_paint && | 25 first_image_paint == other.first_image_paint && |
| 26 first_contentful_paint == other.first_contentful_paint && | |
|
Bryan McQuade
2016/07/29 15:02:26
oh wow we weren't testing this in the equality imp
Bryan McQuade
2016/07/29 17:59:27
I landed a fix for this here: https://codereview.c
Kunihiko Sakamoto
2016/08/01 08:52:07
Done.
| |
| 27 first_meaningful_paint == other.first_meaningful_paint && | |
| 26 parse_start == other.parse_start && parse_stop == other.parse_stop && | 28 parse_start == other.parse_start && parse_stop == other.parse_stop && |
| 27 parse_blocked_on_script_load_duration == | 29 parse_blocked_on_script_load_duration == |
| 28 other.parse_blocked_on_script_load_duration && | 30 other.parse_blocked_on_script_load_duration && |
| 29 parse_blocked_on_script_load_from_document_write_duration == | 31 parse_blocked_on_script_load_from_document_write_duration == |
| 30 other.parse_blocked_on_script_load_from_document_write_duration; | 32 other.parse_blocked_on_script_load_from_document_write_duration; |
| 31 } | 33 } |
| 32 | 34 |
| 33 bool PageLoadTiming::IsEmpty() const { | 35 bool PageLoadTiming::IsEmpty() const { |
| 34 return navigation_start.is_null() && !response_start && !dom_loading && | 36 return navigation_start.is_null() && !response_start && !dom_loading && |
| 35 !dom_content_loaded_event_start && !load_event_start && | 37 !dom_content_loaded_event_start && !load_event_start && |
| 36 !first_layout && !first_paint && !first_text_paint && | 38 !first_layout && !first_paint && !first_text_paint && |
| 37 !first_image_paint && !parse_start && !parse_stop && | 39 !first_image_paint && !parse_start && !parse_stop && |
| 38 !parse_blocked_on_script_load_duration && | 40 !parse_blocked_on_script_load_duration && |
| 39 !parse_blocked_on_script_load_from_document_write_duration; | 41 !parse_blocked_on_script_load_from_document_write_duration; |
| 40 } | 42 } |
| 41 | 43 |
| 42 PageLoadMetadata::PageLoadMetadata() {} | 44 PageLoadMetadata::PageLoadMetadata() {} |
| 43 | 45 |
| 44 bool PageLoadMetadata::operator==(const PageLoadMetadata& other) const { | 46 bool PageLoadMetadata::operator==(const PageLoadMetadata& other) const { |
| 45 return behavior_flags == other.behavior_flags; | 47 return behavior_flags == other.behavior_flags; |
| 46 } | 48 } |
| 47 | 49 |
| 48 } // namespace page_load_metrics | 50 } // namespace page_load_metrics |
| OLD | NEW |