Changeset 278477 in webkit
- Timestamp:
- Jun 4, 2021 11:35:42 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r278472 r278477 1 2021-06-04 Alex Christensen <achristensen@webkit.org> 2 3 Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize 4 https://bugs.webkit.org/show_bug.cgi?id=226629 5 6 Reviewed by Brady Eidson. 7 8 * performance-api/resource-timing-apis-expected.txt: 9 * platform/mac/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt: Removed. 10 1 11 2021-06-04 Robert Jenner <jenner@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/ChangeLog
r278410 r278477 1 2021-06-04 Alex Christensen <achristensen@webkit.org> 2 3 Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize 4 https://bugs.webkit.org/show_bug.cgi?id=226629 5 6 Reviewed by Brady Eidson. 7 8 * web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt: 9 * web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: 10 * web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt: 11 * web-platform-tests/navigation-timing/test_document_onload-expected.txt: 12 * web-platform-tests/resource-timing/TAO-case-insensitive-null-opaque-origin.sub-expected.txt: 13 * web-platform-tests/resource-timing/TAO-crossorigin-port.sub-expected.txt: 14 * web-platform-tests/resource-timing/TAO-null-opaque-origin.sub-expected.txt: 15 This apparent regression is actually just uncovering an existing failure. 16 The test expects the sum of many values to not be equal to zero. 17 It used to be adding undefined to many 0 values, which returned undefined, which is not equal to zero. 18 Now it's adding 0's and getting 0 which correctly indicates that we are not exposing timing values where we should. 19 * web-platform-tests/resource-timing/cors-preflight.any-expected.txt: 20 * web-platform-tests/resource-timing/cors-preflight.any.worker-expected.txt: 21 * web-platform-tests/resource-timing/idlharness.any-expected.txt: 22 * web-platform-tests/resource-timing/idlharness.any.worker-expected.txt: 23 * web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt: 24 * web-platform-tests/resource-timing/resource_connection_reuse-expected.txt: 25 * web-platform-tests/resource-timing/resource_connection_reuse.https-expected.txt: 26 * web-platform-tests/resource-timing/single-entry-per-resource-expected.txt: 27 * web-platform-tests/resource-timing/test_resource_timing.https-expected.txt: 28 * web-platform-tests/service-workers/service-worker/resource-timing-cross-origin.https-expected.txt: 29 1 30 2021-06-03 Youenn Fablet <youenn@apple.com> 2 31 -
trunk/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt
r277767 r278477 4 4 5 5 6 FAIL Performance navigation timing entries are observable. assert_true: Expected attribute: decodedBodySize. expected true got false 6 PASS Performance navigation timing entries are observable. 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt
r277767 r278477 4 4 5 5 6 FAIL Performance navigation timing instance's value is reasonable. assert_ true: Expected transferSize to be greater than encodedBodySize in uncached navigation. expected true got false6 FAIL Performance navigation timing instance's value is reasonable. assert_greater_than: Expected domInteractive to be greater than 0 expected a number greater than 0 but got 0 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt
r277767 r278477 4 4 5 5 6 FAIL Test that secureConnectionStart is not zero assert_greater_than: secureConnectionStart is non-zero expected a number greater than 0 but got 0 6 PASS Test that secureConnectionStart is not zero 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/navigation-timing/test_document_onload-expected.txt
r277767 r278477 4 4 5 5 6 FAIL Test that the attributes have a proper value during DOMContentLoaded assert_greater_than: descr expected a number but got a "undefined" 7 FAIL Test that the attributes have a proper value during onload assert_greater_than: descr expected a number but got a "undefined" 6 PASS Test that the attributes have a proper value during DOMContentLoaded 7 PASS Test that the attributes have a proper value during onload 8 PASS Test that the attributes have a proper value during a task after onload 8 9 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-case-insensitive-null-opaque-origin.sub-expected.txt
r264458 r278477 4 4 5 5 6 FAIL Test case-insensitive null TAO value with opaque origins assert_equals: expected "PASS" but got "FAIL" 6 PASS Test case-insensitive null TAO value with opaque origins 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-crossorigin-port.sub-expected.txt
r264458 r278477 4 4 5 5 6 FAIL Makes sure that the iframe passed the test and had an entry which passed the timing allow check assert_equals: expected "PASS" but got "FAIL" 6 PASS Makes sure that the iframe passed the test and had an entry which passed the timing allow check 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/TAO-null-opaque-origin.sub-expected.txt
r267647 r278477 4 4 5 5 6 PASS Test null TAO value with opaque origins 6 FAIL Test null TAO value with opaque origins assert_equals: expected "PASS" but got "FAIL" 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cors-preflight.any-expected.txt
r264458 r278477 1 1 2 FAIL PerformanceResourceTiming sizes fetch with preflight test assert_greater_than: No-preflight transferSize expected a number but got a "undefined"2 FAIL PerformanceResourceTiming sizes fetch with preflight test assert_greater_than: No-preflight transferSize expected a number greater than 0 but got 0 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/cors-preflight.any.worker-expected.txt
r264458 r278477 1 1 2 FAIL PerformanceResourceTiming sizes fetch with preflight test assert_greater_than: No-preflight transferSize expected a number but got a "undefined" 2 PASS PerformanceResourceTiming sizes fetch with preflight test 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness.any-expected.txt
r267647 r278477 25 25 PASS PerformanceResourceTiming interface: attribute responseStart 26 26 PASS PerformanceResourceTiming interface: attribute responseEnd 27 FAIL PerformanceResourceTiming interface: attribute transferSize assert_true: The prototype object must have a property "transferSize" expected true got false28 FAIL PerformanceResourceTiming interface: attribute encodedBodySize assert_true: The prototype object must have a property "encodedBodySize" expected true got false29 FAIL PerformanceResourceTiming interface: attribute decodedBodySize assert_true: The prototype object must have a property "decodedBodySize" expected true got false27 PASS PerformanceResourceTiming interface: attribute transferSize 28 PASS PerformanceResourceTiming interface: attribute encodedBodySize 29 PASS PerformanceResourceTiming interface: attribute decodedBodySize 30 30 PASS PerformanceResourceTiming interface: operation toJSON() 31 31 PASS PerformanceResourceTiming must be primary interface of resource … … 45 45 PASS PerformanceResourceTiming interface: resource must inherit property "responseStart" with the proper type 46 46 PASS PerformanceResourceTiming interface: resource must inherit property "responseEnd" with the proper type 47 FAIL PerformanceResourceTiming interface: resource must inherit property "transferSize" with the proper type assert_inherits: property "transferSize" not found in prototype chain 48 FAIL PerformanceResourceTiming interface: resource must inherit property "encodedBodySize" with the proper type assert_inherits: property "encodedBodySize" not found in prototype chain 49 FAIL PerformanceResourceTiming interface: resource must inherit property "decodedBodySize" with the proper type assert_inherits: property "decodedBodySize" not found in prototype chain 47 PASS PerformanceResourceTiming interface: resource must inherit property "transferSize" with the proper type 48 PASS PerformanceResourceTiming interface: resource must inherit property "encodedBodySize" with the proper type 49 PASS PerformanceResourceTiming interface: resource must inherit property "decodedBodySize" with the proper type 50 50 PASS PerformanceResourceTiming interface: resource must inherit property "toJSON()" with the proper type 51 FAIL PerformanceResourceTiming interface: default toJSON operation on resource assert_true: property "transferSize" should be present in the output of PerformanceResourceTiming.prototype.toJSON() expected true got false51 PASS PerformanceResourceTiming interface: default toJSON operation on resource 52 52 PASS Performance interface: operation clearResourceTimings() 53 53 PASS Performance interface: operation setResourceTimingBufferSize(unsigned long) -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/idlharness.any.worker-expected.txt
r267647 r278477 25 25 PASS PerformanceResourceTiming interface: attribute responseStart 26 26 PASS PerformanceResourceTiming interface: attribute responseEnd 27 FAIL PerformanceResourceTiming interface: attribute transferSize assert_true: The prototype object must have a property "transferSize" expected true got false28 FAIL PerformanceResourceTiming interface: attribute encodedBodySize assert_true: The prototype object must have a property "encodedBodySize" expected true got false29 FAIL PerformanceResourceTiming interface: attribute decodedBodySize assert_true: The prototype object must have a property "decodedBodySize" expected true got false27 PASS PerformanceResourceTiming interface: attribute transferSize 28 PASS PerformanceResourceTiming interface: attribute encodedBodySize 29 PASS PerformanceResourceTiming interface: attribute decodedBodySize 30 30 PASS PerformanceResourceTiming interface: operation toJSON() 31 31 PASS PerformanceResourceTiming must be primary interface of resource … … 45 45 PASS PerformanceResourceTiming interface: resource must inherit property "responseStart" with the proper type 46 46 PASS PerformanceResourceTiming interface: resource must inherit property "responseEnd" with the proper type 47 FAIL PerformanceResourceTiming interface: resource must inherit property "transferSize" with the proper type assert_inherits: property "transferSize" not found in prototype chain 48 FAIL PerformanceResourceTiming interface: resource must inherit property "encodedBodySize" with the proper type assert_inherits: property "encodedBodySize" not found in prototype chain 49 FAIL PerformanceResourceTiming interface: resource must inherit property "decodedBodySize" with the proper type assert_inherits: property "decodedBodySize" not found in prototype chain 47 PASS PerformanceResourceTiming interface: resource must inherit property "transferSize" with the proper type 48 PASS PerformanceResourceTiming interface: resource must inherit property "encodedBodySize" with the proper type 49 PASS PerformanceResourceTiming interface: resource must inherit property "decodedBodySize" with the proper type 50 50 PASS PerformanceResourceTiming interface: resource must inherit property "toJSON()" with the proper type 51 FAIL PerformanceResourceTiming interface: default toJSON operation on resource assert_true: property "transferSize" should be present in the output of PerformanceResourceTiming.prototype.toJSON() expected true got false51 PASS PerformanceResourceTiming interface: default toJSON operation on resource 52 52 PASS Performance interface: operation clearResourceTimings() 53 53 PASS Performance interface: operation setResourceTimingBufferSize(unsigned long) -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt
r267647 r278477 1 2 Harness Error (TIMEOUT), message = null3 1 4 2 PASS No timeline entry for about:blank … … 7 5 PASS 'xmlhttprequest (Populate cache): The initial request populates the cache (if appropriate). 8 6 PASS 'xmlhttprequest (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). 9 TIMEOUT 'script (Populate cache): The initial request populates the cache (if appropriate). Test timed out 10 TIMEOUT 'script (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). Test timed out 7 PASS 'script (Populate cache): The initial request populates the cache (if appropriate). 8 PASS 'script (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). 9 PASS 'link (Populate cache): The initial request populates the cache (if appropriate). 10 PASS 'link (Potentially Cached): Immediately fetch the same URL, exercising the cache hit path (if any). 11 PASS 'iframe: 250ms delay before 'responseStart', another 250ms delay before 'responseEnd'. 12 PASS 'xmlhttprequest: 250ms delay before 'responseStart', another 250ms delay before 'responseEnd'. 13 PASS 'script: 250ms delay before 'responseStart', another 250ms delay before 'responseEnd'. 14 PASS 'link: 250ms delay before 'responseStart', another 250ms delay before 'responseEnd'. 15 PASS 'iframe (Redirected): 250ms delay before 'redirectEnd', another 250ms delay before 'responseStart'. 16 PASS 'xmlhttprequest (Redirected): 250ms delay before 'redirectEnd', another 250ms delay before 'responseStart'. 17 PASS 'script (Redirected): 250ms delay before 'redirectEnd', another 250ms delay before 'responseStart'. 18 PASS 'link (Redirected): 250ms delay before 'redirectEnd', another 250ms delay before 'responseStart'. 19 PASS 'iframe 250ms delay in headers does not affect responseStart' 20 PASS 'xmlhttprequest 250ms delay in headers does not affect responseStart' 21 PASS 'script 250ms delay in headers does not affect responseStart' 22 PASS 'link 250ms delay in headers does not affect responseStart' 23 PASS 'iframe responseStart uses 1XX (first) response timings' 24 PASS 'xmlhttprequest responseStart uses 1XX (first) response timings' 25 PASS 'script responseStart uses 1XX (first) response timings' 26 PASS 'link responseStart uses 1XX (first) response timings' 11 27 Show details -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse-expected.txt
r267647 r278477 9 9 PASS connectStart and fetchStart should be the same 10 10 PASS connectEnd and fetchStart should be the same 11 PASS secureConnectionStart should be zero 12 PASS domainLookupStart and fetchStart should be the same 13 PASS domainLookupEnd and fetchStart should be the same 11 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_connection_reuse.https-expected.txt
r267647 r278477 9 9 PASS connectStart and fetchStart should be the same 10 10 PASS connectEnd and fetchStart should be the same 11 FAIL secureConnectStart and fetchStart should be the same assert_equals: secureConnectStart and fetchStart should be the same expected 0 but got 51.00000000000001 11 PASS secureConnectionStart and fetchStart should be the same 12 12 PASS domainLookupStart and fetchStart should be the same 13 13 PASS domainLookupEnd and fetchStart should be the same -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/single-entry-per-resource-expected.txt
r267647 r278477 5 5 6 6 7 PASS Only one resource entry per resource7 PASS A single resource used in two elements produces a single entry. 8 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/test_resource_timing.https-expected.txt
r267647 r278477 7 7 PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (iframe) 8 8 PASS PerformanceEntry has correct order of timing attributes (iframe) 9 FAIL PerformanceEntry has correct network transfer attributes (iframe) assert_equals: encodedBodySize size expected (number) 215 but got (undefined) undefined 9 PASS PerformanceEntry has correct network transfer attributes (iframe) 10 10 PASS PerformanceEntry has correct protocol attribute (iframe) 11 11 PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (img) 12 12 PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (img) 13 13 PASS PerformanceEntry has correct order of timing attributes (img) 14 FAIL PerformanceEntry has correct network transfer attributes (img) assert_equals: encodedBodySize size expected (number) 249 but got (undefined) undefined 14 PASS PerformanceEntry has correct network transfer attributes (img) 15 15 PASS PerformanceEntry has correct protocol attribute (img) 16 16 PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (link) 17 17 PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (link) 18 18 PASS PerformanceEntry has correct order of timing attributes (link) 19 FAIL PerformanceEntry has correct network transfer attributes (link) assert_equals: encodedBodySize size expected (number) 44 but got (undefined) undefined 19 PASS PerformanceEntry has correct network transfer attributes (link) 20 20 PASS PerformanceEntry has correct protocol attribute (link) 21 21 PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (script) 22 22 PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (script) 23 23 PASS PerformanceEntry has correct order of timing attributes (script) 24 FAIL PerformanceEntry has correct network transfer attributes (script) assert_equals: encodedBodySize size expected (number) 133 but got (undefined) undefined 24 PASS PerformanceEntry has correct network transfer attributes (script) 25 25 PASS PerformanceEntry has correct protocol attribute (script) 26 26 PASS window.performance.getEntriesByName() and window.performance.getEntriesByNameType() return same data (xmlhttprequest) 27 27 PASS PerformanceEntry has correct name, initiatorType, startTime, and duration (xmlhttprequest) 28 28 PASS PerformanceEntry has correct order of timing attributes (xmlhttprequest) 29 FAIL PerformanceEntry has correct network transfer attributes (xmlhttprequest) assert_equals: encodedBodySize size expected (number) 112 but got (undefined) undefined29 FAIL PerformanceEntry has correct network transfer attributes (xmlhttprequest) assert_equals: encodedBodySize size expected 112 but got 120 30 30 PASS PerformanceEntry has correct protocol attribute (xmlhttprequest) 31 31 PASS window.performance Resource Timing Entries exist -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing-cross-origin.https-expected.txt
r238592 r278477 1 1 2 PASS Test that timing allow check fails when service worker changes origin from same to cross origin. 2 3 3 FAIL Test that timing allow check fails when service worker changes origin from same to cross origin. assert_unreached: unexpected rejection: assert_equals: decodedBodySize should be 0 in cross-origin request. expected (number) 0 but got (undefined) undefined Reached unreachable code4 -
trunk/LayoutTests/performance-api/resource-timing-apis-expected.txt
r267644 r278477 20 20 PASS "responseStart" in PerformanceResourceTiming.prototype is true 21 21 PASS "responseEnd" in PerformanceResourceTiming.prototype is true 22 FAIL "transferSize" in PerformanceResourceTiming.prototype should be true. Was false. 23 FAIL "encodedBodySize" in PerformanceResourceTiming.prototype should be true. Was false. 24 FAIL "decodedBodySize" in PerformanceResourceTiming.prototype should be true. Was false. 22 PASS "transferSize" in PerformanceResourceTiming.prototype is true 23 PASS "encodedBodySize" in PerformanceResourceTiming.prototype is true 24 PASS "decodedBodySize" in PerformanceResourceTiming.prototype is true 25 25 PASS PerformanceResourceTiming.prototype.toJSON is defined. 26 26 PASS new PerformanceResourceTiming() threw exception TypeError: Illegal constructor. … … 51 51 PASS [Worker] "responseStart" in PerformanceResourceTiming.prototype is true 52 52 PASS [Worker] "responseEnd" in PerformanceResourceTiming.prototype is true 53 FAIL [Worker] "transferSize" in PerformanceResourceTiming.prototype should be true. Was false. 54 FAIL [Worker] "encodedBodySize" in PerformanceResourceTiming.prototype should be true. Was false. 55 FAIL [Worker] "decodedBodySize" in PerformanceResourceTiming.prototype should be true. Was false. 53 PASS [Worker] "transferSize" in PerformanceResourceTiming.prototype is true 54 PASS [Worker] "encodedBodySize" in PerformanceResourceTiming.prototype is true 55 PASS [Worker] "decodedBodySize" in PerformanceResourceTiming.prototype is true 56 56 PASS [Worker] PerformanceResourceTiming.prototype.toJSON is defined. 57 57 PASS [Worker] new PerformanceResourceTiming() threw exception TypeError: Illegal constructor. -
trunk/Source/WTF/ChangeLog
r278474 r278477 1 2021-06-04 Alex Christensen <achristensen@webkit.org> 2 3 Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize 4 https://bugs.webkit.org/show_bug.cgi?id=226629 5 6 Reviewed by Brady Eidson. 7 8 * Scripts/Preferences/WebPreferencesExperimental.yaml: 9 1 10 2021-06-04 Devin Rousso <drousso@apple.com> 2 11 -
trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
r277767 r278477 795 795 default: false 796 796 797 # Note: This is off by default because of privacy concerns 798 # such as https://github.com/w3c/resource-timing/issues/238 799 PerformanceResourceTimingSensitivePropertiesEnabled: 800 type: bool 801 humanReadableName: "PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize" 802 humanReadableDescription: "Enable all properties of PerformanceResourceTiming API" 803 defaultValue: 804 WebKitLegacy: 805 default: false 806 WebKit: 807 default: false 808 WebCore: 809 default: false 810 797 811 PrivateClickMeasurementDebugModeEnabled: 798 812 type: bool -
trunk/Source/WebCore/ChangeLog
r278466 r278477 1 2021-06-04 Alex Christensen <achristensen@webkit.org> 2 3 Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize 4 https://bugs.webkit.org/show_bug.cgi?id=226629 5 6 Reviewed by Brady Eidson. 7 8 The tests for TAO are entangled with the tests for these properties. Having an implementation helps see what is still broken. 9 Covered by web platform tests. 10 11 * page/PerformanceResourceTiming.cpp: 12 (WebCore::PerformanceResourceTiming::transferSize const): 13 (WebCore::PerformanceResourceTiming::encodedBodySize const): 14 (WebCore::PerformanceResourceTiming::decodedBodySize const): 15 * page/PerformanceResourceTiming.h: 16 * page/PerformanceResourceTiming.idl: 17 1 18 2021-06-04 Myles C. Maxfield <mmaxfield@apple.com> 2 19 -
trunk/Source/WebCore/page/PerformanceResourceTiming.cpp
r278391 r278477 257 257 } 258 258 259 uint64_t PerformanceResourceTiming::transferSize() const 260 { 261 if (!m_resourceTiming.allowTimingDetails() 262 || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect) 263 return 0; 264 265 auto encodedBodySize = m_resourceTiming.networkLoadMetrics().responseBodyBytesReceived; 266 if (encodedBodySize == std::numeric_limits<uint64_t>::max()) 267 return 0; 268 269 // https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-transfersize 270 return encodedBodySize + 300; 271 } 272 273 uint64_t PerformanceResourceTiming::encodedBodySize() const 274 { 275 if (!m_resourceTiming.allowTimingDetails() 276 || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect) 277 return 0; 278 279 auto encodedBodySize = m_resourceTiming.networkLoadMetrics().responseBodyBytesReceived; 280 if (encodedBodySize == std::numeric_limits<uint64_t>::max()) 281 return 0; 282 283 return encodedBodySize; 284 } 285 286 uint64_t PerformanceResourceTiming::decodedBodySize() const 287 { 288 if (!m_resourceTiming.allowTimingDetails() 289 || m_resourceTiming.networkLoadMetrics().hasCrossOriginRedirect) 290 return 0; 291 292 auto decodedBodySize = m_resourceTiming.networkLoadMetrics().responseBodyDecodedSize; 293 if (decodedBodySize == std::numeric_limits<uint64_t>::max()) 294 return 0; 295 296 return decodedBodySize; 297 } 298 259 299 } // namespace WebCore -
trunk/Source/WebCore/page/PerformanceResourceTiming.h
r278391 r278477 62 62 double responseStart() const; 63 63 double responseEnd() const; 64 uint64_t transferSize() const; 65 uint64_t encodedBodySize() const; 66 uint64_t decodedBodySize() const; 64 67 65 68 const Vector<Ref<PerformanceServerTiming>>& serverTiming() const { return m_serverTiming; } -
trunk/Source/WebCore/page/PerformanceResourceTiming.idl
r277767 r278477 51 51 readonly attribute DOMHighResTimeStamp responseStart; 52 52 readonly attribute DOMHighResTimeStamp responseEnd; 53 54 // Note: transferSize, encodedBodySize, and decodedBodySize are intentionally omitted55 // because of privacy concerns such as https://github.com/w3c/resource-timing/issues/23853 [EnabledBySetting=PerformanceResourceTimingSensitiveProperties] readonly attribute unsigned long long transferSize; 54 [EnabledBySetting=PerformanceResourceTimingSensitiveProperties] readonly attribute unsigned long long encodedBodySize; 55 [EnabledBySetting=PerformanceResourceTimingSensitiveProperties] readonly attribute unsigned long long decodedBodySize; 56 56 57 57 // https://www.w3.org/TR/server-timing/#extension-to-the-performanceresourcetiming-interface -
trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm
r278391 r278477 325 325 LOG(Network, "Handle %p delegate connectionDidFinishLoading:%p", m_handle, connection); 326 326 327 double responseEndTime = [[[connection _timingData] objectForKey:@"_kCFNTimingDataResponseEnd"] doubleValue]; 328 329 auto work = [self = self, protectedSelf = retainPtr(self), connection = retainPtr(connection), responseEndTime] () mutable { 327 auto work = [self = self, protectedSelf = retainPtr(self), connection = retainPtr(connection), timingData = retainPtr([connection _timingData])] () mutable { 330 328 if (!m_handle || !m_handle->client()) 331 329 return; 332 330 333 331 if (auto metrics = m_handle->networkLoadMetrics()) { 334 if ( responseEndTime)332 if (double responseEndTime = [[timingData objectForKey:@"_kCFNTimingDataResponseEnd"] doubleValue]) 335 333 metrics->responseEnd = WallTime::fromRawSeconds(adoptNS([[NSDate alloc] initWithTimeIntervalSinceReferenceDate:responseEndTime]).get().timeIntervalSince1970).approximateMonotonicTime(); 336 334 else 337 335 metrics->responseEnd = metrics->responseStart; 336 metrics->responseBodyBytesReceived = [[timingData objectForKey:@"_kCFNTimingDataResponseBodyBytesReceived"] unsignedLongLongValue]; 337 metrics->responseBodyDecodedSize = [[timingData objectForKey:@"_kCFNTimingDataResponseBodyBytesDecoded"] unsignedLongLongValue]; 338 338 metrics->markComplete(); 339 339 m_handle->client()->didFinishLoading(m_handle, *metrics); -
trunk/Source/WebKit/ChangeLog
r278475 r278477 1 2021-06-04 Alex Christensen <achristensen@webkit.org> 2 3 Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize 4 https://bugs.webkit.org/show_bug.cgi?id=226629 5 6 Reviewed by Brady Eidson. 7 8 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 9 (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): 10 1 11 2021-06-04 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r278475 r278477 847 847 uint64_t requestHeaderBytesSent = 0; 848 848 uint64_t responseHeaderBytesReceived = 0; 849 uint64_t responseBodyBytesReceived = 0;850 uint64_t responseBodyDecodedSize = 0;851 849 852 850 for (NSURLSessionTaskTransactionMetrics *transactionMetrics in metrics.transactionMetrics) { … … 854 852 requestHeaderBytesSent += transactionMetrics.countOfRequestHeaderBytesSent; 855 853 responseHeaderBytesReceived += transactionMetrics.countOfResponseHeaderBytesReceived; 856 responseBodyBytesReceived += transactionMetrics.countOfResponseBodyBytesReceived;857 responseBodyDecodedSize += transactionMetrics.countOfResponseBodyBytesAfterDecoding ? transactionMetrics.countOfResponseBodyBytesAfterDecoding : transactionMetrics.countOfResponseBodyBytesReceived;858 854 #else 859 855 ALLOW_DEPRECATED_DECLARATIONS_BEGIN 860 856 requestHeaderBytesSent += transactionMetrics._requestHeaderBytesSent; 861 857 responseHeaderBytesReceived += transactionMetrics._responseHeaderBytesReceived; 862 responseBodyBytesReceived += transactionMetrics._responseBodyBytesReceived;863 responseBodyDecodedSize += transactionMetrics._responseBodyBytesDecoded ? transactionMetrics._responseBodyBytesDecoded : transactionMetrics._responseBodyBytesReceived;864 858 ALLOW_DEPRECATED_DECLARATIONS_END 865 859 #endif … … 869 863 networkLoadMetrics.requestBodyBytesSent = task.countOfBytesSent; 870 864 networkLoadMetrics.responseHeaderBytesReceived = responseHeaderBytesReceived; 871 networkLoadMetrics.responseBodyBytesReceived = responseBodyBytesReceived;872 networkLoadMetrics.responseBodyDecodedSize = responseBodyDecodedSize;873 865 } 866 #if HAVE(CFNETWORK_METRICS_APIS_V4) 867 networkLoadMetrics.responseBodyBytesReceived = m.countOfResponseBodyBytesReceived; 868 networkLoadMetrics.responseBodyDecodedSize = m.countOfResponseBodyBytesAfterDecoding; 869 #else 870 ALLOW_DEPRECATED_DECLARATIONS_BEGIN 871 networkLoadMetrics.responseBodyBytesReceived = m._responseBodyBytesReceived; 872 networkLoadMetrics.responseBodyDecodedSize = m._responseBodyBytesDecoded; 873 ALLOW_DEPRECATED_DECLARATIONS_END 874 #endif 875 // Sometimes the encoded body bytes received contains a few (3 or so) bytes from the header when there is no body. 876 // When this happens, trim our metrics to make more sense. 877 if (!networkLoadMetrics.responseBodyDecodedSize) 878 networkLoadMetrics.responseBodyBytesReceived = 0; 874 879 } 875 880 }
Note: See TracChangeset
for help on using the changeset viewer.