Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ | |
| 6 #define COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ | |
| 7 | |
| 8 #include "base/time/time.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 class WebPerformance; | |
| 12 } | |
| 13 | |
| 14 namespace page_load_metrics { | |
| 15 | |
| 16 // PageLoadTiming contains timing metrics associated with a page load. Many of | |
| 17 // the metrics here are based on the Navigation Timing spec: | |
| 18 // http://www.w3.org/TR/navigation-timing/. | |
| 19 struct PageLoadTiming { | |
| 20 public: | |
| 21 PageLoadTiming(); | |
| 22 PageLoadTiming(blink::WebPerformance&); | |
|
Bryan McQuade
2015/09/02 18:26:46
can you make the function parameter const?
Charlie Harrison
2015/09/03 14:00:52
Done.
| |
| 23 ~PageLoadTiming(); | |
| 24 | |
| 25 bool operator==(const PageLoadTiming& other) const; | |
|
Bryan McQuade
2015/09/02 18:26:46
I think randy had suggested trying to use the defa
Charlie Harrison
2015/09/03 14:00:52
According to this: http://en.cppreference.com/w/cp
| |
| 26 | |
| 27 // Returns true if |parent| is equal to |this| besides for uninitialized | |
| 28 // fields in |parent| | |
| 29 bool IsChild(const PageLoadTiming& parent) const; | |
|
Bryan McQuade
2015/09/02 18:26:46
Though these methods logically make sense as membe
Charlie Harrison
2015/09/03 14:00:52
Randy said it's reasonable to move them, but he is
| |
| 30 | |
| 31 bool IsComplete() const; | |
| 32 bool IsEmpty() const; | |
| 33 // Checks guaranteed ordering for performance events. | |
| 34 // Assumes IsComplete() | |
| 35 bool IsOrdered() const; | |
| 36 | |
| 37 // Time that the navigation for the associated page was initiated. | |
| 38 base::Time navigation_start; | |
| 39 | |
| 40 // Time that the first byte of the response is received. | |
| 41 base::TimeDelta response_start; | |
| 42 | |
| 43 // Time immediately before the DOMContentLoaded event is fired. | |
| 44 base::TimeDelta dom_content_loaded_event_start; | |
| 45 | |
| 46 // Time immediately before the load event is fired. | |
| 47 base::TimeDelta load_event_start; | |
| 48 | |
| 49 // Time when the first layout is completed. | |
| 50 base::TimeDelta first_layout; | |
| 51 | |
| 52 // If you add additional members, also be sure to update operator== and | |
| 53 // page_load_metrics_messages.h | |
| 54 private: | |
| 55 base::TimeDelta ClampDelta(double event_ms, double start_ms) const; | |
| 56 }; | |
| 57 | |
| 58 } // namespace page_load_metrics | |
| 59 | |
| 60 #endif // COMPONENTS_PAGE_LOAD_METRICS_COMMON_PAGE_LOAD_TIMING_H_ | |
| OLD | NEW |