| 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 #ifndef CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_TIMING_H_ | 5 #ifndef CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_TIMING_H_ |
| 6 #define CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_TIMING_H_ | 6 #define CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_TIMING_H_ |
| 7 | 7 |
| 8 #include "base/optional.h" | 8 #include "base/optional.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" | 10 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" |
| 11 | 11 |
| 12 namespace page_load_metrics { | 12 namespace page_load_metrics { |
| 13 | 13 |
| 14 struct StyleSheetTiming { |
| 15 StyleSheetTiming(); |
| 16 StyleSheetTiming(const StyleSheetTiming& other); |
| 17 ~StyleSheetTiming(); |
| 18 |
| 19 bool operator==(const StyleSheetTiming& other) const; |
| 20 bool operator!=(const StyleSheetTiming& other) const { |
| 21 return !(*this == other); |
| 22 } |
| 23 |
| 24 bool IsEmpty() const; |
| 25 |
| 26 // Total time spent parsing author style sheets, before the first contentful |
| 27 // paint. |
| 28 base::Optional<base::TimeDelta> author_style_sheet_parse_duration_before_fcp; |
| 29 }; |
| 30 |
| 14 // PageLoadTiming contains timing metrics associated with a page load. Many of | 31 // PageLoadTiming contains timing metrics associated with a page load. Many of |
| 15 // the metrics here are based on the Navigation Timing spec: | 32 // the metrics here are based on the Navigation Timing spec: |
| 16 // http://www.w3.org/TR/navigation-timing/. | 33 // http://www.w3.org/TR/navigation-timing/. |
| 17 struct PageLoadTiming { | 34 struct PageLoadTiming { |
| 18 public: | 35 public: |
| 19 PageLoadTiming(); | 36 PageLoadTiming(); |
| 20 PageLoadTiming(const PageLoadTiming& other); | 37 PageLoadTiming(const PageLoadTiming& other); |
| 21 ~PageLoadTiming(); | 38 ~PageLoadTiming(); |
| 22 | 39 |
| 23 bool operator==(const PageLoadTiming& other) const; | 40 bool operator==(const PageLoadTiming& other) const; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 108 |
| 92 // Sum of times when the parser is executing a script that was inserted from | 109 // Sum of times when the parser is executing a script that was inserted from |
| 93 // document.write. This duration must be less than or equal to | 110 // document.write. This duration must be less than or equal to |
| 94 // parse_blocked_on_script_load_duration. Note that this value may be updated | 111 // parse_blocked_on_script_load_duration. Note that this value may be updated |
| 95 // multiple times during the period between parse_start and parse_stop. Note | 112 // multiple times during the period between parse_start and parse_stop. Note |
| 96 // that some uncommon cases where scripts are loaded via document.write are | 113 // that some uncommon cases where scripts are loaded via document.write are |
| 97 // not currently covered by this field. See crbug/600711 for details. | 114 // not currently covered by this field. See crbug/600711 for details. |
| 98 base::Optional<base::TimeDelta> | 115 base::Optional<base::TimeDelta> |
| 99 parse_blocked_on_script_execution_from_document_write_duration; | 116 parse_blocked_on_script_execution_from_document_write_duration; |
| 100 | 117 |
| 118 StyleSheetTiming style_sheet_timing; |
| 119 |
| 101 // If you add additional members, also be sure to update operator==, | 120 // If you add additional members, also be sure to update operator==, |
| 102 // page_load_metrics_messages.h, and IsEmpty(). | 121 // page_load_metrics_messages.h, and IsEmpty(). |
| 103 }; | 122 }; |
| 104 | 123 |
| 105 struct PageLoadMetadata { | 124 struct PageLoadMetadata { |
| 106 PageLoadMetadata(); | 125 PageLoadMetadata(); |
| 107 bool operator==(const PageLoadMetadata& other) const; | 126 bool operator==(const PageLoadMetadata& other) const; |
| 108 // These are packed blink::WebLoadingBehaviorFlag enums. | 127 // These are packed blink::WebLoadingBehaviorFlag enums. |
| 109 int behavior_flags = blink::WebLoadingBehaviorNone; | 128 int behavior_flags = blink::WebLoadingBehaviorNone; |
| 110 }; | 129 }; |
| 111 | 130 |
| 112 } // namespace page_load_metrics | 131 } // namespace page_load_metrics |
| 113 | 132 |
| 114 #endif // CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_TIMING_H_ | 133 #endif // CHROME_COMMON_PAGE_LOAD_METRICS_PAGE_LOAD_TIMING_H_ |
| OLD | NEW |