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