Bug 230603

Summary: DOMPromiseDeferred should be able to handle Ref/RefPtr resolution values for interface types
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, eric.carlson, ews-watchlist, glenn, hta, jer.noble, philipj, sam, sergio, sihui_liu, tommyw, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description youenn fablet 2021-09-22 01:32:27 PDT
DOMPromiseDeferred should be able to handle Ref/RefPtr resolution values for interface types
Comment 1 youenn fablet 2021-09-22 01:50:31 PDT
Created attachment 438934 [details]
Patch
Comment 2 youenn fablet 2021-09-22 05:17:28 PDT
Comment on attachment 438934 [details]
Patch

win failure seems unrelated
Comment 3 Sihui Liu 2021-09-23 08:47:06 PDT
Comment on attachment 438934 [details]
Patch

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

Nice, r=me with nits.

> Source/WebCore/ChangeLog:10
> +        Small refactring to use reject instead of settle in ApplePaySetup.

refactoring

> Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:90
> +    Function<void(ExceptionOr<Ref<RTCCertificate>>&&)> m_resultCallback;

Do we want Function or CompletionHandler (is this function called multiple times)?
If we use Function, can we use std::exchange instead of WTFMove?
Comment 4 youenn fablet 2021-09-23 11:30:02 PDT
Comment on attachment 438934 [details]
Patch

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

>> Source/WebCore/ChangeLog:10
>> +        Small refactring to use reject instead of settle in ApplePaySetup.
> 
> refactoring

Will change

>> Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:90
>> +    Function<void(ExceptionOr<Ref<RTCCertificate>>&&)> m_resultCallback;
> 
> Do we want Function or CompletionHandler (is this function called multiple times)?
> If we use Function, can we use std::exchange instead of WTFMove?

Function is fine, it will only be called once but there is no guarantee that it will always be called.
We could use exchange but, given we do not reuse RTCCertificateGeneratorCallback, it is equivalent but more verbose than WTFMove.
Comment 5 youenn fablet 2021-09-23 11:31:02 PDT
Created attachment 439072 [details]
Patch for landing
Comment 6 EWS 2021-09-24 00:11:53 PDT
Committed r283028 (242088@main): <https://commits.webkit.org/242088@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439072 [details].
Comment 7 Radar WebKit Bug Importer 2021-09-24 00:12:17 PDT
<rdar://problem/83483186>