| 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 14 matching lines...) Expand all Loading... |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #ifndef PerformanceResourceTiming_h | 32 #ifndef PerformanceResourceTiming_h |
| 33 #define PerformanceResourceTiming_h | 33 #define PerformanceResourceTiming_h |
| 34 | 34 |
| 35 #include "core/CoreExport.h" |
| 35 #include "core/timing/PerformanceEntry.h" | 36 #include "core/timing/PerformanceEntry.h" |
| 36 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 37 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 class ResourceLoadTiming; | 42 class ResourceLoadTiming; |
| 42 class ResourceTimingInfo; | 43 class ResourceTimingInfo; |
| 43 | 44 |
| 44 class PerformanceResourceTiming final : public PerformanceEntry { | 45 class CORE_EXPORT PerformanceResourceTiming final : public PerformanceEntry { |
| 45 DEFINE_WRAPPERTYPEINFO(); | 46 DEFINE_WRAPPERTYPEINFO(); |
| 46 | 47 |
| 48 friend class PerformanceResourceTimingTest; |
| 49 |
| 47 public: | 50 public: |
| 48 static PerformanceResourceTiming* create(const ResourceTimingInfo& info, | 51 static PerformanceResourceTiming* create(const ResourceTimingInfo& info, |
| 49 double timeOrigin, | 52 double timeOrigin, |
| 50 double startTime, | 53 double startTime, |
| 51 double lastRedirectEndTime, | 54 double lastRedirectEndTime, |
| 52 bool allowTimingDetails, | 55 bool allowTimingDetails, |
| 53 bool allowRedirectDetails) { | 56 bool allowRedirectDetails) { |
| 54 return new PerformanceResourceTiming( | 57 return new PerformanceResourceTiming( |
| 55 info, timeOrigin, startTime, lastRedirectEndTime, allowTimingDetails, | 58 info, timeOrigin, startTime, lastRedirectEndTime, allowTimingDetails, |
| 56 allowRedirectDetails); | 59 allowRedirectDetails); |
| 57 } | 60 } |
| 58 | 61 |
| 59 static PerformanceResourceTiming* create(const ResourceTimingInfo& info, | 62 static PerformanceResourceTiming* create(const ResourceTimingInfo& info, |
| 60 double timeOrigin, | 63 double timeOrigin, |
| 61 double startTime, | 64 double startTime, |
| 62 bool allowTimingDetails) { | 65 bool allowTimingDetails) { |
| 63 return new PerformanceResourceTiming(info, timeOrigin, startTime, 0.0, | 66 return new PerformanceResourceTiming(info, timeOrigin, startTime, 0.0, |
| 64 allowTimingDetails, false); | 67 allowTimingDetails, false); |
| 65 } | 68 } |
| 66 | 69 |
| 67 AtomicString initiatorType() const; | 70 AtomicString initiatorType() const; |
| 68 | 71 AtomicString nextHopProtocol() const; |
| 69 double workerStart() const; | 72 double workerStart() const; |
| 70 double redirectStart() const; | 73 double redirectStart() const; |
| 71 double redirectEnd() const; | 74 double redirectEnd() const; |
| 72 double fetchStart() const; | 75 double fetchStart() const; |
| 73 double domainLookupStart() const; | 76 double domainLookupStart() const; |
| 74 double domainLookupEnd() const; | 77 double domainLookupEnd() const; |
| 75 double connectStart() const; | 78 double connectStart() const; |
| 76 double connectEnd() const; | 79 double connectEnd() const; |
| 77 double secureConnectionStart() const; | 80 double secureConnectionStart() const; |
| 78 double requestStart() const; | 81 double requestStart() const; |
| 79 double responseStart() const; | 82 double responseStart() const; |
| 80 double responseEnd() const; | 83 double responseEnd() const; |
| 81 unsigned long long transferSize() const; | 84 unsigned long long transferSize() const; |
| 82 unsigned long long encodedBodySize() const; | 85 unsigned long long encodedBodySize() const; |
| 83 unsigned long long decodedBodySize() const; | 86 unsigned long long decodedBodySize() const; |
| 84 | 87 |
| 85 protected: | 88 protected: |
| 86 void buildJSONValue(V8ObjectBuilder&) const override; | 89 void buildJSONValue(V8ObjectBuilder&) const override; |
| 87 | 90 |
| 88 private: | 91 private: |
| 89 PerformanceResourceTiming(const ResourceTimingInfo&, | 92 PerformanceResourceTiming(const ResourceTimingInfo&, |
| 90 double timeOrigin, | 93 double timeOrigin, |
| 91 double startTime, | 94 double startTime, |
| 92 double lastRedirectEndTime, | 95 double lastRedirectEndTime, |
| 93 bool m_allowTimingDetails, | 96 bool m_allowTimingDetails, |
| 94 bool m_allowRedirectDetails); | 97 bool m_allowRedirectDetails); |
| 95 ~PerformanceResourceTiming() override; | 98 ~PerformanceResourceTiming() override; |
| 96 | 99 |
| 100 static AtomicString produceNextHopProtocol( |
| 101 const AtomicString& alpnNegotiatedProtocol, |
| 102 const AtomicString& connectionInfo); |
| 103 |
| 97 double workerReady() const; | 104 double workerReady() const; |
| 98 | 105 |
| 99 AtomicString m_initiatorType; | 106 AtomicString m_initiatorType; |
| 107 AtomicString m_nextHopProtocol; |
| 108 AtomicString m_connectionInfo; |
| 100 double m_timeOrigin; | 109 double m_timeOrigin; |
| 101 RefPtr<ResourceLoadTiming> m_timing; | 110 RefPtr<ResourceLoadTiming> m_timing; |
| 102 double m_lastRedirectEndTime; | 111 double m_lastRedirectEndTime; |
| 103 double m_finishTime; | 112 double m_finishTime; |
| 104 unsigned long long m_transferSize; | 113 unsigned long long m_transferSize; |
| 105 unsigned long long m_encodedBodySize; | 114 unsigned long long m_encodedBodySize; |
| 106 unsigned long long m_decodedBodySize; | 115 unsigned long long m_decodedBodySize; |
| 107 bool m_didReuseConnection; | 116 bool m_didReuseConnection; |
| 108 bool m_allowTimingDetails; | 117 bool m_allowTimingDetails; |
| 109 bool m_allowRedirectDetails; | 118 bool m_allowRedirectDetails; |
| 110 }; | 119 }; |
| 111 | 120 |
| 112 } // namespace blink | 121 } // namespace blink |
| 113 | 122 |
| 114 #endif // PerformanceResourceTiming_h | 123 #endif // PerformanceResourceTiming_h |
| OLD | NEW |