OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 allowRedirectDetails); | 58 allowRedirectDetails); |
59 } | 59 } |
60 | 60 |
61 static PerformanceResourceTiming* create(const ResourceTimingInfo& info, | 61 static PerformanceResourceTiming* create(const ResourceTimingInfo& info, |
62 double timeOrigin, | 62 double timeOrigin, |
63 double startTime, | 63 double startTime, |
64 bool allowTimingDetails) { | 64 bool allowTimingDetails) { |
65 return new PerformanceResourceTiming(info, timeOrigin, startTime, 0.0, | 65 return new PerformanceResourceTiming(info, timeOrigin, startTime, 0.0, |
66 allowTimingDetails, false); | 66 allowTimingDetails, false); |
67 } | 67 } |
68 | 68 // Related doc: https://goo.gl/uNecAj. |
69 AtomicString initiatorType() const; | 69 virtual AtomicString initiatorType() const; |
70 | |
71 DOMHighResTimeStamp workerStart() const; | 70 DOMHighResTimeStamp workerStart() const; |
72 virtual DOMHighResTimeStamp redirectStart() const; | 71 virtual DOMHighResTimeStamp redirectStart() const; |
73 virtual DOMHighResTimeStamp redirectEnd() const; | 72 virtual DOMHighResTimeStamp redirectEnd() const; |
74 virtual DOMHighResTimeStamp fetchStart() const; | 73 virtual DOMHighResTimeStamp fetchStart() const; |
75 DOMHighResTimeStamp domainLookupStart() const; | 74 DOMHighResTimeStamp domainLookupStart() const; |
76 DOMHighResTimeStamp domainLookupEnd() const; | 75 DOMHighResTimeStamp domainLookupEnd() const; |
77 DOMHighResTimeStamp connectStart() const; | 76 DOMHighResTimeStamp connectStart() const; |
78 DOMHighResTimeStamp connectEnd() const; | 77 DOMHighResTimeStamp connectEnd() const; |
79 DOMHighResTimeStamp secureConnectionStart() const; | 78 DOMHighResTimeStamp secureConnectionStart() const; |
80 DOMHighResTimeStamp requestStart() const; | 79 DOMHighResTimeStamp requestStart() const; |
81 DOMHighResTimeStamp responseStart() const; | 80 DOMHighResTimeStamp responseStart() const; |
82 virtual DOMHighResTimeStamp responseEnd() const; | 81 virtual DOMHighResTimeStamp responseEnd() const; |
83 unsigned long long transferSize() const; | 82 unsigned long long transferSize() const; |
84 unsigned long long encodedBodySize() const; | 83 unsigned long long encodedBodySize() const; |
85 unsigned long long decodedBodySize() const; | 84 unsigned long long decodedBodySize() const; |
86 | 85 |
87 protected: | 86 protected: |
88 void buildJSONValue(V8ObjectBuilder&) const override; | 87 void buildJSONValue(V8ObjectBuilder&) const override; |
89 | 88 |
90 PerformanceResourceTiming(const AtomicString& initiatorType, | 89 // This constructor is for PerformanceNavigationTiming. |
91 double timeOrigin, | 90 // Related doc: https://goo.gl/uNecAj. |
92 ResourceLoadTiming*, | 91 PerformanceResourceTiming(const String& name, |
93 double lastRedirectEndTime, | |
94 double finishTime, | |
95 unsigned long long transferSize, | |
96 unsigned long long encodedBodyLength, | |
97 unsigned long long decodedBodyLength, | |
98 bool didReuseConnection, | |
99 bool allowTimingDetails, | |
100 bool allowRedirectDetails, | |
101 const String& name, | |
102 const String& entryType, | 92 const String& entryType, |
103 double startTime); | 93 double startTime, |
| 94 double duration); |
104 | 95 |
105 private: | 96 private: |
106 PerformanceResourceTiming(const ResourceTimingInfo&, | 97 PerformanceResourceTiming(const ResourceTimingInfo&, |
107 double timeOrigin, | 98 double timeOrigin, |
108 double startTime, | 99 double startTime, |
109 double lastRedirectEndTime, | 100 double lastRedirectEndTime, |
110 bool m_allowTimingDetails, | 101 bool m_allowTimingDetails, |
111 bool m_allowRedirectDetails); | 102 bool m_allowRedirectDetails); |
112 | 103 |
113 double workerReady() const; | 104 double workerReady() const; |
114 | 105 |
| 106 virtual ResourceLoadTiming* resourceLoadTiming() const; |
| 107 virtual bool allowTimingDetails() const; |
| 108 virtual bool didReuseConnection() const; |
| 109 virtual unsigned long long getTransferSize() const; |
| 110 virtual unsigned long long getEncodedBodySize() const; |
| 111 virtual unsigned long long getDecodedBodySize() const; |
| 112 |
115 AtomicString m_initiatorType; | 113 AtomicString m_initiatorType; |
116 double m_timeOrigin; | 114 double m_timeOrigin; |
117 RefPtr<ResourceLoadTiming> m_timing; | 115 RefPtr<ResourceLoadTiming> m_timing; |
118 double m_lastRedirectEndTime; | 116 double m_lastRedirectEndTime; |
119 double m_finishTime; | 117 double m_finishTime; |
120 unsigned long long m_transferSize; | 118 unsigned long long m_transferSize; |
121 unsigned long long m_encodedBodySize; | 119 unsigned long long m_encodedBodySize; |
122 unsigned long long m_decodedBodySize; | 120 unsigned long long m_decodedBodySize; |
123 bool m_didReuseConnection; | 121 bool m_didReuseConnection; |
124 bool m_allowTimingDetails; | 122 bool m_allowTimingDetails; |
125 bool m_allowRedirectDetails; | 123 bool m_allowRedirectDetails; |
126 }; | 124 }; |
127 | 125 |
128 } // namespace blink | 126 } // namespace blink |
129 | 127 |
130 #endif // PerformanceResourceTiming_h | 128 #endif // PerformanceResourceTiming_h |
OLD | NEW |