Bug 230603 - DOMPromiseDeferred should be able to handle Ref/RefPtr resolution values for interface types
Summary: DOMPromiseDeferred should be able to handle Ref/RefPtr resolution values for ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-22 01:32 PDT by youenn fablet
Modified: 2021-09-24 00:12 PDT (History)
12 users (show)

See Also:


Attachments
Patch (12.27 KB, patch)
2021-09-22 01:50 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (12.25 KB, patch)
2021-09-23 11:31 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>