RESOLVED FIXED 202825
Only use CFNetwork SPI for metrics where needed
https://bugs.webkit.org/show_bug.cgi?id=202825
Summary Only use CFNetwork SPI for metrics where needed
Alex Christensen
Reported 2019-10-10 14:35:24 PDT
Only use CFNetwork SPI for metrics where needed
Attachments
Patch (6.24 KB, patch)
2019-10-10 14:35 PDT, Alex Christensen
no flags
Patch (9.41 KB, patch)
2019-10-11 11:17 PDT, Alex Christensen
no flags
Patch (9.34 KB, patch)
2019-10-11 11:38 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2019-10-10 14:35:51 PDT
Joseph Pecoraro
Comment 2 2019-10-10 17:51:00 PDT
Comment on attachment 380685 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=380685&action=review r=me The first time we tried this (bug 198762) got rolled out in r247095. Just make sure this test continues to pass! http/tests/inspector/network/har/har-page.html > Source/WTF/wtf/Platform.h:1521 > +#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) > +#define HAVE_CFNETWORK_METRICS 1 > +#endif Nit: I believe Keith Rollins was just investigating if we should enable these for tvOS / watchOS. The APIs do exist there, so I suggest we do that. Maybe you can sync up with him on how best to do that, but that doesn't block this. I'd probably have named this positive for "APIs" since older builds have the "SPIs". So maybe something like HAVE_CFNETWORK_METRICS_APIS_V4? I'd leave that up to you. > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:710 > + networkLoadMetrics.tlsCipher = stringForSSLCipher((SSLCipherSuite)[m.negotiatedTLSCipherSuite unsignedShortValue]); Shouldn't this be a `tls_ciphersuite_t` not a `SSLCipherSuite`? Or are they interchangeable? > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:734 > for (NSURLSessionTaskTransactionMetrics *transactionMetrics in metrics.transactionMetrics) { > +#if HAVE(CFNETWORK_METRICS) > + requestHeaderBytesSent += transactionMetrics.countOfRequestHeaderBytesSent; > + responseHeaderBytesReceived += transactionMetrics.countOfResponseHeaderBytesReceived; > + responseBodyBytesReceived += transactionMetrics.countOfResponseBodyBytesReceived; > + responseBodyDecodedSize += transactionMetrics.countOfResponseBodyBytesAfterDecoding ? transactionMetrics.countOfResponseBodyBytesAfterDecoding : transactionMetrics.countOfResponseBodyBytesReceived; > +#else Not significant but we should probably update NetworkLoadMetrics's values here from uint32_ts to uint64_ts. This was done in the first attempt to use the CFNetwork APIs: https://bugs.webkit.org/attachment.cgi?id=371875&action=review ``` uint32_t requestHeaderBytesSent; uint32_t responseHeaderBytesReceived; ``` The CFNetwork APIs here are `int64_t` and the SPIs here were `NSInteger`. So it seems a >32bit number could happen.
Alex Christensen
Comment 3 2019-10-11 11:17:25 PDT
Alex Christensen
Comment 4 2019-10-11 11:38:17 PDT
Joseph Pecoraro
Comment 5 2019-10-11 13:36:57 PDT
*** Bug 198762 has been marked as a duplicate of this bug. ***
WebKit Commit Bot
Comment 6 2019-10-11 13:38:17 PDT
Comment on attachment 380772 [details] Patch Clearing flags on attachment: 380772 Committed r251021: <https://trac.webkit.org/changeset/251021>
WebKit Commit Bot
Comment 7 2019-10-11 13:38:19 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-10-15 16:47:01 PDT
Tim Horton
Comment 9 2020-03-08 12:53:29 PDT
Comment on attachment 380772 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=380772&action=review > Source/WTF/wtf/Platform.h:1519 > +#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) FWIW "PLATFORM(IOS_FAMILY) && only testing an IPHONE_OS version" is always wrong. This is disabled on all non-iOS iOS-family platforms.
Note You need to log in before you can comment on or make changes to this bug.