Bug 228641

Summary: Attribute nw connections to the source application
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, eric.carlson, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch for landing
none
Patch for landing none

Description youenn fablet 2021-07-30 07:30:55 PDT
<rdar://81039713>
Comment 1 youenn fablet 2021-07-30 07:40:01 PDT
Created attachment 434623 [details]
Patch
Comment 2 youenn fablet 2021-07-30 07:49:24 PDT
Created attachment 434625 [details]
Patch
Comment 3 Alex Christensen 2021-07-30 08:08:21 PDT
Comment on attachment 434625 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434625&action=review

We also set configuration.get()._attributedBundleIdentifier for SafariViewController based on the page ID.

> Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm:100
> +        nw_parameters_set_source_application(tcpTLS.get(), *reinterpret_cast<const audit_token_t*>(CFDataGetBytePtr(sourceApplicationAuditData)));

RELEASE_ASSERT(CFDataGetSize(sourceApplicationAuditData) == sizeof(audit_token_t));

> Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm:239
> +        nw_parameters_set_source_application(parameters, *reinterpret_cast<const audit_token_t*>(CFDataGetBytePtr(m_sourceApplicationAuditData.get())));

ditto
Comment 4 youenn fablet 2021-07-30 08:20:32 PDT
Created attachment 434626 [details]
Patch
Comment 5 youenn fablet 2021-07-30 08:23:13 PDT
Thanks for the review.

(In reply to Alex Christensen from comment #3)
> Comment on attachment 434625 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=434625&action=review
> 
> We also set configuration.get()._attributedBundleIdentifier for
> SafariViewController based on the page ID.

Will do in a follow-up as we do not have the page ID.

> > Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm:100
> > +        nw_parameters_set_source_application(tcpTLS.get(), *reinterpret_cast<const audit_token_t*>(CFDataGetBytePtr(sourceApplicationAuditData)));
> 
> RELEASE_ASSERT(CFDataGetSize(sourceApplicationAuditData) ==
> sizeof(audit_token_t));
> 
> > Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm:239
> > +        nw_parameters_set_source_application(parameters, *reinterpret_cast<const audit_token_t*>(CFDataGetBytePtr(m_sourceApplicationAuditData.get())));
> 
> ditto

I changed it to directly get an audit_token_t from network process.
Comment 6 youenn fablet 2021-07-30 08:25:23 PDT
Created attachment 434629 [details]
Patch for landing
Comment 7 EWS 2021-07-30 09:16:53 PDT
ChangeLog entry in Source/WebKit/ChangeLog contains OOPS!.
Comment 8 youenn fablet 2021-07-30 09:40:52 PDT
Created attachment 434638 [details]
Patch for landing
Comment 9 youenn fablet 2021-07-30 10:23:55 PDT
> Will do in a follow-up as we do not have the page ID.

https://bugs.webkit.org/show_bug.cgi?id=228649
Comment 10 EWS 2021-07-30 10:31:05 PDT
Committed r280481 (240116@main): <https://commits.webkit.org/240116@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434638 [details].