OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (C) 2016 Google Inc. All rights reserved. | |
Kunihiko Sakamoto
2016/11/07 07:53:18
Please use the short license block (here, .cpp and
sunjian
2016/11/08 02:10:19
Done.
| |
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; | |
44 | |
45 // TODO(sunjian): Add layout test | |
46 class CORE_EXPORT PerformanceNavigationTiming final | |
47 : public PerformanceResourceTiming { | |
48 DEFINE_WRAPPERTYPEINFO(); | |
49 | |
50 public: | |
51 static PerformanceNavigationTiming* create( | |
kinuko
2016/11/06 15:16:43
This create method may not be really useful as it
sunjian
2016/11/08 02:10:19
Done.
| |
52 double timeOrigin, | |
53 double unloadEventStart, | |
54 double unloadEventEnd, | |
55 double loadEventStart, | |
56 double loadEventEnd, | |
57 unsigned short redirectCount, | |
58 double domInteractive, | |
59 double domContentLoadedEventStart, | |
60 double domContentLoadedEventEnd, | |
61 double domComplete, | |
62 AtomicString type, | |
63 double redirectStart, | |
64 double redirectEnd, | |
65 double fetchStart, | |
66 double responseEnd, | |
67 bool hasCrossOriginRedirect, | |
68 bool hasSameOriginAsPreviousDocument, | |
69 ResourceLoadTiming* timing, | |
70 double lastRedirectEndTime, | |
71 double finishTime, | |
72 unsigned long long transferSize, | |
73 unsigned long long encodedBodyLength, | |
74 unsigned long long decodedBodyLength, | |
75 bool didReuseConnection) { | |
76 return new PerformanceNavigationTiming( | |
77 timeOrigin, unloadEventStart, unloadEventEnd, loadEventStart, | |
78 loadEventEnd, redirectCount, domInteractive, domContentLoadedEventStart, | |
79 domContentLoadedEventEnd, domComplete, type, redirectStart, redirectEnd, | |
80 fetchStart, responseEnd, hasCrossOriginRedirect, | |
81 hasSameOriginAsPreviousDocument, "", timing, lastRedirectEndTime, | |
82 finishTime, transferSize, encodedBodyLength, decodedBodyLength, | |
83 didReuseConnection, true /*allowTimingDetails*/, | |
84 true /*allowRediectDetails*/, "document", "navigation", timeOrigin); | |
85 } | |
86 | |
87 double unloadEventStart() const; | |
88 double unloadEventEnd() const; | |
89 double domInteractive() const; | |
90 double domContentLoadedEventStart() const; | |
91 double domContentLoadedEventEnd() const; | |
92 double domComplete() const; | |
93 double loadEventStart() const; | |
94 double loadEventEnd() const; | |
95 AtomicString type() const; | |
96 unsigned short redirectCount() const; | |
97 | |
98 double fetchStart() const override; | |
99 double redirectStart() const override; | |
100 double redirectEnd() const override; | |
101 double responseEnd() const override; | |
102 | |
103 protected: | |
104 void buildJSONValue(V8ObjectBuilder&) const override; | |
105 | |
106 private: | |
107 explicit PerformanceNavigationTiming(double timeOrigin, | |
kinuko
2016/11/06 15:16:43
no need of explicit
sunjian
2016/11/08 02:10:19
Done.
| |
108 double unloadEventStart, | |
109 double unloadEventEnd, | |
110 double loadEventStart, | |
111 double loadEventEnd, | |
112 unsigned short redirectCount, | |
113 double domInteractive, | |
114 double domContentLoadedEventStart, | |
115 double domContentLoadedEventEnd, | |
116 double domComplete, | |
117 AtomicString type, | |
118 double redirectStart, | |
119 double redirectEnd, | |
120 double fetchStart, | |
121 double responseEnd, | |
122 bool hasCrossOriginRedirect, | |
123 bool hasSameOriginAsPreviousDocument, | |
124 const AtomicString& initiatorType, | |
125 ResourceLoadTiming*, | |
126 double lastRedirectEndTime, | |
127 double finishTime, | |
128 unsigned long long transferSize, | |
129 unsigned long long encodedBodyLength, | |
130 unsigned long long decodedBodyLength, | |
131 bool didReuseConnection, | |
132 bool allowTimingDetails, | |
133 bool allowRedirectDetails, | |
134 const String& name, | |
135 const String& entryType, | |
136 double startTime); | |
137 | |
138 ~PerformanceNavigationTiming() override; | |
139 | |
140 double m_timeOrigin; | |
141 double m_unloadEventStart; | |
142 double m_unloadEventEnd; | |
143 double m_loadEventStart; | |
144 double m_loadEventEnd; | |
145 unsigned short m_redirectCount; | |
146 double m_domInteractive; | |
147 double m_domContentLoadedEventStart; | |
148 double m_domContentLoadedEventEnd; | |
149 double m_domComplete; | |
150 AtomicString m_type; | |
151 double m_redirectStart; | |
152 double m_redirectEnd; | |
153 double m_fetchStart; | |
154 double m_responseEnd; | |
155 bool m_hasCrossOriginRedirect; | |
156 bool m_hasSameOriginAsPreviousDocument; | |
157 }; | |
158 } // namespace blink | |
159 | |
160 #endif // PerformanceNavigationTiming_h | |
OLD | NEW |