@@ -17,6 +17,7 @@ const { enqueue, bufferResourceTiming } = require('internal/perf/observe');
1717const { validateThisInternalField } = require ( 'internal/validators' ) ;
1818const { kEnumerableProperty } = require ( 'internal/util' ) ;
1919
20+ const kBodyInfo = Symbol ( 'kBodyInfo' ) ;
2021const kCacheMode = Symbol ( 'kCacheMode' ) ;
2122const kRequestedUrl = Symbol ( 'kRequestedUrl' ) ;
2223const kTimingInfo = Symbol ( 'kTimingInfo' ) ;
@@ -110,11 +111,22 @@ class PerformanceResourceTiming extends PerformanceEntry {
110111 return this [ kTimingInfo ] . finalNetworkRequestStartTime ;
111112 }
112113
113- get responseStart ( ) {
114+ get finalResponseHeadersStart ( ) {
114115 validateThisInternalField ( this , kTimingInfo , 'PerformanceResourceTiming' ) ;
115116 return this [ kTimingInfo ] . finalNetworkResponseStartTime ;
116117 }
117118
119+ get firstInterimResponseStart ( ) {
120+ validateThisInternalField ( this , kTimingInfo , 'PerformanceResourceTiming' ) ;
121+ return this [ kTimingInfo ] . firstInterimNetworkResponseStartTime ?? 0 ;
122+ }
123+
124+ get responseStart ( ) {
125+ validateThisInternalField ( this , kTimingInfo , 'PerformanceResourceTiming' ) ;
126+ return this [ kTimingInfo ] . firstInterimNetworkResponseStartTime ||
127+ this [ kTimingInfo ] . finalNetworkResponseStartTime ;
128+ }
129+
118130 get responseEnd ( ) {
119131 validateThisInternalField ( this , kTimingInfo , 'PerformanceResourceTiming' ) ;
120132 return this [ kTimingInfo ] . endTime ;
@@ -148,6 +160,22 @@ class PerformanceResourceTiming extends PerformanceEntry {
148160 return this [ kResponseStatus ] ;
149161 }
150162
163+ get renderBlockingStatus ( ) {
164+ validateThisInternalField ( this , kTimingInfo , 'PerformanceResourceTiming' ) ;
165+ return this [ kTimingInfo ] . renderBlocking === true ?
166+ 'blocking' : 'non-blocking' ;
167+ }
168+
169+ get contentType ( ) {
170+ validateThisInternalField ( this , kTimingInfo , 'PerformanceResourceTiming' ) ;
171+ return this [ kBodyInfo ] ?. contentType ?? '' ;
172+ }
173+
174+ get contentEncoding ( ) {
175+ validateThisInternalField ( this , kTimingInfo , 'PerformanceResourceTiming' ) ;
176+ return this [ kBodyInfo ] ?. contentEncoding ?? '' ;
177+ }
178+
151179 toJSON ( ) {
152180 validateThisInternalField ( this , kInitiatorType , 'PerformanceResourceTiming' ) ;
153181 return {
@@ -167,13 +195,18 @@ class PerformanceResourceTiming extends PerformanceEntry {
167195 connectEnd : this . connectEnd ,
168196 secureConnectionStart : this . secureConnectionStart ,
169197 requestStart : this . requestStart ,
198+ finalResponseHeadersStart : this . finalResponseHeadersStart ,
199+ firstInterimResponseStart : this . firstInterimResponseStart ,
170200 responseStart : this . responseStart ,
171201 responseEnd : this . responseEnd ,
172202 transferSize : this . transferSize ,
173203 encodedBodySize : this . encodedBodySize ,
174204 decodedBodySize : this . decodedBodySize ,
175205 deliveryType : this . deliveryType ,
176206 responseStatus : this . responseStatus ,
207+ renderBlockingStatus : this . renderBlockingStatus ,
208+ contentType : this . contentType ,
209+ contentEncoding : this . contentEncoding ,
177210 } ;
178211 }
179212}
@@ -191,13 +224,18 @@ ObjectDefineProperties(PerformanceResourceTiming.prototype, {
191224 connectEnd : kEnumerableProperty ,
192225 secureConnectionStart : kEnumerableProperty ,
193226 requestStart : kEnumerableProperty ,
227+ finalResponseHeadersStart : kEnumerableProperty ,
228+ firstInterimResponseStart : kEnumerableProperty ,
194229 responseStart : kEnumerableProperty ,
195230 responseEnd : kEnumerableProperty ,
196231 transferSize : kEnumerableProperty ,
197232 encodedBodySize : kEnumerableProperty ,
198233 decodedBodySize : kEnumerableProperty ,
199234 deliveryType : kEnumerableProperty ,
200235 responseStatus : kEnumerableProperty ,
236+ renderBlockingStatus : kEnumerableProperty ,
237+ contentType : kEnumerableProperty ,
238+ contentEncoding : kEnumerableProperty ,
201239 toJSON : kEnumerableProperty ,
202240 [ SymbolToStringTag ] : {
203241 __proto__ : null ,
@@ -224,6 +262,7 @@ function createPerformanceResourceTiming(
224262 // The spec doesn't say to validate it in the class construction.
225263 resourceTiming [ kTimingInfo ] = timingInfo ;
226264 resourceTiming [ kCacheMode ] = cacheMode ;
265+ resourceTiming [ kBodyInfo ] = bodyInfo ;
227266 resourceTiming [ kDeliveryType ] = deliveryType ;
228267 resourceTiming [ kResponseStatus ] = responseStatus ;
229268
0 commit comments