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 16 matching lines...) Expand all Loading... | |
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/dom/DOMHighResTimeStamp.h" | 35 #include "core/dom/DOMHighResTimeStamp.h" |
36 #include "core/timing/PerformanceEntry.h" | 36 #include "core/timing/PerformanceEntry.h" |
37 #include "core/timing/PerformanceServerTiming.h" | |
37 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
38 #include "platform/wtf/Forward.h" | 39 #include "platform/wtf/Forward.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 class ResourceLoadTiming; | 43 class ResourceLoadTiming; |
43 class ResourceTimingInfo; | 44 class ResourceTimingInfo; |
44 | 45 |
46 using PerformanceServerTimingVector = | |
47 HeapVector<Member<PerformanceServerTiming>>; | |
Yoav Weiss
2017/06/29 06:57:33
Remove the definition from here
| |
48 | |
45 class CORE_EXPORT PerformanceResourceTiming : public PerformanceEntry { | 49 class CORE_EXPORT PerformanceResourceTiming : public PerformanceEntry { |
46 DEFINE_WRAPPERTYPEINFO(); | 50 DEFINE_WRAPPERTYPEINFO(); |
47 | 51 |
48 public: | 52 public: |
49 ~PerformanceResourceTiming() override; | 53 ~PerformanceResourceTiming() override; |
50 static PerformanceResourceTiming* Create(const ResourceTimingInfo& info, | 54 static PerformanceResourceTiming* Create( |
51 double time_origin, | 55 const ResourceTimingInfo& info, |
52 double start_time, | 56 double time_origin, |
53 double last_redirect_end_time, | 57 double start_time, |
54 bool allow_timing_details, | 58 double last_redirect_end_time, |
55 bool allow_redirect_details) { | 59 bool allow_timing_details, |
60 bool allow_redirect_details, | |
61 PerformanceServerTimingVector& serverTiming) { | |
56 return new PerformanceResourceTiming( | 62 return new PerformanceResourceTiming( |
57 info, time_origin, start_time, last_redirect_end_time, | 63 info, time_origin, start_time, last_redirect_end_time, |
58 allow_timing_details, allow_redirect_details); | 64 allow_timing_details, allow_redirect_details, serverTiming); |
59 } | 65 } |
60 | 66 |
61 static PerformanceResourceTiming* Create(const ResourceTimingInfo& info, | 67 static PerformanceResourceTiming* Create( |
62 double time_origin, | 68 const ResourceTimingInfo& info, |
63 double start_time, | 69 double time_origin, |
64 bool allow_timing_details) { | 70 double start_time, |
71 bool allow_timing_details, | |
72 PerformanceServerTimingVector& serverTiming) { | |
65 return new PerformanceResourceTiming(info, time_origin, start_time, 0.0, | 73 return new PerformanceResourceTiming(info, time_origin, start_time, 0.0, |
66 allow_timing_details, false); | 74 allow_timing_details, false, |
75 serverTiming); | |
67 } | 76 } |
68 // Related doc: https://goo.gl/uNecAj. | 77 // Related doc: https://goo.gl/uNecAj. |
69 virtual AtomicString initiatorType() const; | 78 virtual AtomicString initiatorType() const; |
70 DOMHighResTimeStamp workerStart() const; | 79 DOMHighResTimeStamp workerStart() const; |
71 virtual DOMHighResTimeStamp redirectStart() const; | 80 virtual DOMHighResTimeStamp redirectStart() const; |
72 virtual DOMHighResTimeStamp redirectEnd() const; | 81 virtual DOMHighResTimeStamp redirectEnd() const; |
73 virtual DOMHighResTimeStamp fetchStart() const; | 82 virtual DOMHighResTimeStamp fetchStart() const; |
74 DOMHighResTimeStamp domainLookupStart() const; | 83 DOMHighResTimeStamp domainLookupStart() const; |
75 DOMHighResTimeStamp domainLookupEnd() const; | 84 DOMHighResTimeStamp domainLookupEnd() const; |
76 DOMHighResTimeStamp connectStart() const; | 85 DOMHighResTimeStamp connectStart() const; |
77 DOMHighResTimeStamp connectEnd() const; | 86 DOMHighResTimeStamp connectEnd() const; |
78 DOMHighResTimeStamp secureConnectionStart() const; | 87 DOMHighResTimeStamp secureConnectionStart() const; |
79 DOMHighResTimeStamp requestStart() const; | 88 DOMHighResTimeStamp requestStart() const; |
80 DOMHighResTimeStamp responseStart() const; | 89 DOMHighResTimeStamp responseStart() const; |
81 virtual DOMHighResTimeStamp responseEnd() const; | 90 virtual DOMHighResTimeStamp responseEnd() const; |
82 unsigned long long transferSize() const; | 91 unsigned long long transferSize() const; |
83 unsigned long long encodedBodySize() const; | 92 unsigned long long encodedBodySize() const; |
84 unsigned long long decodedBodySize() const; | 93 unsigned long long decodedBodySize() const; |
94 PerformanceServerTimingVector serverTiming() const; | |
95 | |
96 DECLARE_VIRTUAL_TRACE(); | |
85 | 97 |
86 protected: | 98 protected: |
87 void BuildJSONValue(V8ObjectBuilder&) const override; | 99 void BuildJSONValue(V8ObjectBuilder&) const override; |
88 | 100 |
89 // This constructor is for PerformanceNavigationTiming. | 101 // This constructor is for PerformanceNavigationTiming. |
90 // Related doc: https://goo.gl/uNecAj. | 102 // Related doc: https://goo.gl/uNecAj. |
91 PerformanceResourceTiming(const String& name, | 103 PerformanceResourceTiming(const String& name, |
92 const String& entry_type, | 104 const String& entry_type, |
93 double start_time, | 105 double start_time, |
94 double duration); | 106 double duration, |
107 PerformanceServerTimingVector&); | |
95 | 108 |
96 private: | 109 private: |
97 PerformanceResourceTiming(const ResourceTimingInfo&, | 110 PerformanceResourceTiming(const ResourceTimingInfo&, |
98 double time_origin, | 111 double time_origin, |
99 double start_time, | 112 double start_time, |
100 double last_redirect_end_time, | 113 double last_redirect_end_time, |
101 bool allow_timing_details, | 114 bool allow_timing_details, |
102 bool allow_redirect_details); | 115 bool allow_redirect_details, |
116 PerformanceServerTimingVector&); | |
103 | 117 |
104 double WorkerReady() const; | 118 double WorkerReady() const; |
105 | 119 |
106 virtual ResourceLoadTiming* GetResourceLoadTiming() const; | 120 virtual ResourceLoadTiming* GetResourceLoadTiming() const; |
107 virtual bool AllowTimingDetails() const; | 121 virtual bool AllowTimingDetails() const; |
108 virtual bool DidReuseConnection() const; | 122 virtual bool DidReuseConnection() const; |
109 virtual unsigned long long GetTransferSize() const; | 123 virtual unsigned long long GetTransferSize() const; |
110 virtual unsigned long long GetEncodedBodySize() const; | 124 virtual unsigned long long GetEncodedBodySize() const; |
111 virtual unsigned long long GetDecodedBodySize() const; | 125 virtual unsigned long long GetDecodedBodySize() const; |
112 | 126 |
113 AtomicString initiator_type_; | 127 AtomicString initiator_type_; |
114 double time_origin_; | 128 double time_origin_; |
115 RefPtr<ResourceLoadTiming> timing_; | 129 RefPtr<ResourceLoadTiming> timing_; |
116 double last_redirect_end_time_; | 130 double last_redirect_end_time_; |
117 double finish_time_; | 131 double finish_time_; |
118 unsigned long long transfer_size_; | 132 unsigned long long transfer_size_; |
119 unsigned long long encoded_body_size_; | 133 unsigned long long encoded_body_size_; |
120 unsigned long long decoded_body_size_; | 134 unsigned long long decoded_body_size_; |
121 bool did_reuse_connection_; | 135 bool did_reuse_connection_; |
122 bool allow_timing_details_; | 136 bool allow_timing_details_; |
123 bool allow_redirect_details_; | 137 bool allow_redirect_details_; |
124 bool allow_negative_value_; | 138 bool allow_negative_value_; |
139 PerformanceServerTimingVector serverTiming_; | |
125 }; | 140 }; |
126 | 141 |
127 } // namespace blink | 142 } // namespace blink |
128 | 143 |
129 #endif // PerformanceResourceTiming_h | 144 #endif // PerformanceResourceTiming_h |
OLD | NEW |