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 COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ | 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ |
6 #define COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ | 6 #define COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 | 9 |
10 namespace page_load_metrics { | 10 namespace page_load_metrics { |
11 | 11 |
12 // PageLoadTiming contains timing metrics associated with a page load. Many of | 12 // PageLoadTiming contains timing metrics associated with a page load. Many of |
13 // the metrics here are based on the Navigation Timing spec: | 13 // the metrics here are based on the Navigation Timing spec: |
14 // http://www.w3.org/TR/navigation-timing/. | 14 // http://www.w3.org/TR/navigation-timing/. |
15 struct PageLoadTiming { | 15 struct PageLoadTiming { |
16 public: | 16 public: |
17 PageLoadTiming(); | 17 PageLoadTiming(); |
18 ~PageLoadTiming(); | 18 ~PageLoadTiming(); |
19 | 19 |
20 bool operator==(const PageLoadTiming& other) const; | 20 bool operator==(const PageLoadTiming& other) const; |
21 | 21 |
22 bool IsEmpty() const; | 22 bool IsEmpty() const; |
23 | 23 |
24 // Time that the navigation for the associated page was initiated. | 24 // Time that the navigation for the associated page was initiated. |
25 base::Time navigation_start; | 25 base::Time navigation_start; |
26 | 26 |
27 // All TimeDeltas are relative to navigation_start | 27 // All TimeDeltas are relative to navigation_start |
28 | 28 |
29 // @shivanisha TODO Issue 596367 shows that it is possible for a existent | |
Bryan McQuade
2016/03/29 18:33:43
style nit:
TODO(shivanisha): Issue ...
shivanisha
2016/03/29 18:54:25
updating the comment
| |
30 // TimeDelta value to be 0 (2 TimeTicks can have the same value even if they | |
31 // were assigned in separate instructions if the clock speed is less | |
32 // granular). The solution there was to use base::Optional for those values. | |
33 // Consider changing the below values to Optional as well when serialization | |
34 // supports it. | |
35 | |
29 // Time that the first byte of the response is received. | 36 // Time that the first byte of the response is received. |
30 base::TimeDelta response_start; | 37 base::TimeDelta response_start; |
31 | 38 |
32 // Time that the document transitions to the 'loading' state. This is roughly | 39 // Time that the document transitions to the 'loading' state. This is roughly |
33 // the time that the HTML parser begins parsing the main HTML resource. | 40 // the time that the HTML parser begins parsing the main HTML resource. |
34 base::TimeDelta dom_loading; | 41 base::TimeDelta dom_loading; |
35 | 42 |
36 // Time immediately before the DOMContentLoaded event is fired. | 43 // Time immediately before the DOMContentLoaded event is fired. |
37 base::TimeDelta dom_content_loaded_event_start; | 44 base::TimeDelta dom_content_loaded_event_start; |
38 | 45 |
(...skipping 12 matching lines...) Expand all Loading... | |
51 // Time when the first contentful thing (image, text, etc.) is painted. | 58 // Time when the first contentful thing (image, text, etc.) is painted. |
52 base::TimeDelta first_contentful_paint; | 59 base::TimeDelta first_contentful_paint; |
53 | 60 |
54 // If you add additional members, also be sure to update operator==, | 61 // If you add additional members, also be sure to update operator==, |
55 // page_load_metrics_messages.h, and IsEmpty(). | 62 // page_load_metrics_messages.h, and IsEmpty(). |
56 }; | 63 }; |
57 | 64 |
58 } // namespace page_load_metrics | 65 } // namespace page_load_metrics |
59 | 66 |
60 #endif // COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ | 67 #endif // COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ |
OLD | NEW |