OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (C) 2016 Google Inc. All rights reserved. | |
3 * | |
4 * Redistribution and use in source and binary forms, with or without | |
5 * modification, are permitted provided that the following conditions are | |
6 * met: | |
7 * | |
8 * * Redistributions of source code must retain the above copyright | |
9 * notice, this list of conditions and the following disclaimer. | |
10 * * Redistributions in binary form must reproduce the above | |
11 * copyright notice, this list of conditions and the following disclaimer | |
12 * in the documentation and/or other materials provided with the | |
13 * distribution. | |
14 * * Neither the name of Google Inc. nor the names of its | |
15 * contributors may be used to endorse or promote products derived from | |
16 * this software without specific prior written permission. | |
17 * | |
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 */ | |
30 | |
31 #ifndef PerformanceNavigationTiming_h | |
32 #define PerformanceNavigationTiming_h | |
33 | |
34 #include "core/CoreExport.h" | |
35 #include "core/frame/DOMWindowProperty.h" | |
36 #include "core/timing/PerformanceResourceTiming.h" | |
37 #include "wtf/Forward.h" | |
38 | |
39 namespace blink { | |
40 | |
41 class DocumentLoadTiming; | |
42 class DocumentLoader; | |
43 class DocumentTiming; | |
panicker
2016/11/04 18:55:32
Could you add a basic layout test?
You can follow
sunjian
2016/11/04 22:25:19
Will add tests in the follow-up cl. Added a TODO
| |
44 | |
45 class CORE_EXPORT PerformanceNavigationTiming final | |
46 : public PerformanceResourceTiming { | |
47 DEFINE_WRAPPERTYPEINFO(); | |
48 | |
49 public: | |
50 static PerformanceNavigationTiming* create( | |
51 double timeOrigin, | |
52 double unloadEventStart, | |
53 double unloadEventEnd, | |
54 double loadEventStart, | |
55 double loadEventEnd, | |
56 unsigned short redirectCount, | |
57 double domInteractive, | |
58 double domContentLoadedEventStart, | |
59 double domContentLoadedEventEnd, | |
60 double domComplete, | |
61 AtomicString type, | |
62 double redirectStart, | |
63 double redirectEnd, | |
64 double fetchStart, | |
65 double responseEnd, | |
66 bool hasCrossOriginRedirect, | |
67 bool hasSameOriginAsPreviousDocument, | |
68 ResourceLoadTiming* timing, | |
69 double lastRedirectEndTime, | |
70 double finishTime, | |
71 unsigned long long transferSize, | |
72 unsigned long long encodedBodyLength, | |
73 unsigned long long decodedBodyLength, | |
74 bool didReuseConnection) { | |
75 return new PerformanceNavigationTiming( | |
76 timeOrigin, unloadEventStart, unloadEventEnd, loadEventStart, | |
77 loadEventEnd, redirectCount, domInteractive, domContentLoadedEventStart, | |
78 domContentLoadedEventEnd, domComplete, type, redirectStart, redirectEnd, | |
79 fetchStart, responseEnd, hasCrossOriginRedirect, | |
80 hasSameOriginAsPreviousDocument, "", timing, lastRedirectEndTime, | |
81 finishTime, transferSize, encodedBodyLength, decodedBodyLength, | |
82 didReuseConnection, true /*allowTimingDetails*/, | |
83 true /*allowRediectDetails*/, "document", "navigation", timeOrigin); | |
84 } | |
85 | |
86 double unloadEventStart() const; | |
87 double unloadEventEnd() const; | |
88 double domInteractive() const; | |
89 double domContentLoadedEventStart() const; | |
90 double domContentLoadedEventEnd() const; | |
91 double domComplete() const; | |
92 double loadEventStart() const; | |
93 double loadEventEnd() const; | |
94 AtomicString type() const; | |
95 unsigned short redirectCount() const; | |
96 | |
97 double fetchStart() const override; | |
98 double redirectStart() const override; | |
99 double redirectEnd() const override; | |
100 double responseEnd() const override; | |
101 | |
102 protected: | |
103 void buildJSONValue(V8ObjectBuilder&) const override; | |
104 | |
105 private: | |
106 explicit PerformanceNavigationTiming(double timeOrigin, | |
107 double unloadEventStart, | |
108 double unloadEventEnd, | |
109 double loadEventStart, | |
110 double loadEventEnd, | |
111 unsigned short redirectCount, | |
112 double domInteractive, | |
113 double domContentLoadedEventStart, | |
114 double domContentLoadedEventEnd, | |
115 double domComplete, | |
116 AtomicString type, | |
117 double redirectStart, | |
118 double redirectEnd, | |
119 double fetchStart, | |
120 double responseEnd, | |
121 bool hasCrossOriginRedirect, | |
122 bool hasSameOriginAsPreviousDocument, | |
123 const AtomicString& initiatorType, | |
124 ResourceLoadTiming*, | |
125 double lastRedirectEndTime, | |
126 double finishTime, | |
127 unsigned long long transferSize, | |
128 unsigned long long encodedBodyLength, | |
129 unsigned long long decodedBodyLength, | |
130 bool didReuseConnection, | |
131 bool allowTimingDetails, | |
132 bool allowRedirectDetails, | |
133 const String& name, | |
134 const String& entryType, | |
135 double startTime); | |
136 | |
137 ~PerformanceNavigationTiming() override; | |
138 | |
139 double m_timeOrigin; | |
140 double m_unloadEventStart; | |
141 double m_unloadEventEnd; | |
142 double m_loadEventStart; | |
143 double m_loadEventEnd; | |
144 unsigned short m_redirectCount; | |
145 double m_domInteractive; | |
146 double m_domContentLoadedEventStart; | |
147 double m_domContentLoadedEventEnd; | |
148 double m_domComplete; | |
149 AtomicString m_type; | |
150 double m_redirectStart; | |
151 double m_redirectEnd; | |
152 double m_fetchStart; | |
153 double m_responseEnd; | |
154 bool m_hasCrossOriginRedirect; | |
155 bool m_hasSameOriginAsPreviousDocument; | |
156 }; | |
157 } // namespace blink | |
158 | |
159 #endif // PerformanceNavigationTiming_h | |
OLD | NEW |