RESOLVED FIXED 189458
[Payment Request] Use JSValueInWrappedObject for PaymentResponse's details attribute
https://bugs.webkit.org/show_bug.cgi?id=189458
Summary [Payment Request] Use JSValueInWrappedObject for PaymentResponse's details at...
Andy Estes
Reported 2018-09-08 20:21:11 PDT
[Payment Request] Use JSValueInWrappedObject for PaymentResponse's details attribute
Attachments
Patch (20.46 KB, patch)
2018-09-08 20:30 PDT, Andy Estes
no flags
Patch (21.13 KB, patch)
2018-09-08 20:43 PDT, Andy Estes
no flags
Archive of layout-test-results from ews126 for ios-simulator-wk2 (2.55 MB, application/zip)
2018-09-08 22:51 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.96 MB, application/zip)
2018-09-09 00:51 PDT, EWS Watchlist
no flags
Patch (21.12 KB, patch)
2018-09-09 11:46 PDT, Andy Estes
no flags
Patch (21.14 KB, patch)
2018-09-09 12:09 PDT, Andy Estes
no flags
Andy Estes
Comment 1 2018-09-08 20:30:43 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 2 2018-09-08 20:32:17 PDT Comment hidden (obsolete)
Andy Estes
Comment 3 2018-09-08 20:43:19 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 4 2018-09-08 20:45:25 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 5 2018-09-08 22:51:09 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 6 2018-09-08 22:51:10 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2018-09-09 00:51:12 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 8 2018-09-09 00:51:14 PDT Comment hidden (obsolete)
Andy Estes
Comment 9 2018-09-09 11:46:45 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 10 2018-09-09 11:49:36 PDT Comment hidden (obsolete)
Andy Estes
Comment 11 2018-09-09 12:09:19 PDT
EWS Watchlist
Comment 12 2018-09-09 12:10:49 PDT
Attachment 349290 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp:39: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Sam Weinig
Comment 13 2018-09-09 16:18:16 PDT
Comment on attachment 349290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349290&action=review > Source/WebCore/Modules/paymentrequest/PaymentResponse.idl:37 > + [CustomGetter] readonly attribute object details; This seems like something that could be useful elsewhere. Can we establish a pattern and add this to the bindings generator as a new custom attribute rather than using CustomGetter?
Andy Estes
Comment 14 2018-09-09 19:38:15 PDT
(In reply to Sam Weinig from comment #13) > Comment on attachment 349290 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=349290&action=review > > > Source/WebCore/Modules/paymentrequest/PaymentResponse.idl:37 > > + [CustomGetter] readonly attribute object details; > > This seems like something that could be useful elsewhere. Can we establish a > pattern and add this to the bindings generator as a new custom attribute > rather than using CustomGetter? We have custom bindings that follow this pattern in a few places now (CustomEvent, History, MessageEvent, PaymentMethodChangeEvent, now PaymentResponse), so I agree we should have generator support for this. I filed bug #189466.
youenn fablet
Comment 15 2018-09-10 08:30:28 PDT
Comment on attachment 349290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349290&action=review > Source/WebCore/Modules/paymentrequest/PaymentResponse.h:44 > + using DetailsFunction = Function<JSC::Strong<JSC::JSObject>(JSC::ExecState&)>; Can we make the function return a JSC::JSValue?
Andy Estes
Comment 16 2018-09-10 11:14:47 PDT
(In reply to youenn fablet from comment #15) > Comment on attachment 349290 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=349290&action=review > > > Source/WebCore/Modules/paymentrequest/PaymentResponse.h:44 > > + using DetailsFunction = Function<JSC::Strong<JSC::JSObject>(JSC::ExecState&)>; > > Can we make the function return a JSC::JSValue? Sure, we can; JSValue is what `details` is ultimately converted to in the custom bindings. I chose this because Strong<JSObject> is the type returned by toJS<IDNullable<IDLObject>>, but it doesn't really matter where the conversion from that to JSValue happens (either in DetailsFunction or the custom bindings).
youenn fablet
Comment 17 2018-09-10 11:58:22 PDT
Comment on attachment 349290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349290&action=review > LayoutTests/http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html:26 > + return "leaked an unexpected number of nodes: " + leaks + " leaks in " + repetitions + " runs"; If that pattern works and is not flaky, maybe this should be put in its own script so that we can reuse it elsewhere.
Andy Estes
Comment 18 2018-09-10 12:41:23 PDT
(In reply to youenn fablet from comment #17) > Comment on attachment 349290 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=349290&action=review > > > LayoutTests/http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html:26 > > + return "leaked an unexpected number of nodes: " + leaks + " leaks in " + repetitions + " runs"; > > If that pattern works and is not flaky, maybe this should be put in its own > script so that we can reuse it elsewhere. Good idea, I'll do that in a follow-up. Thanks for the review!
WebKit Commit Bot
Comment 19 2018-09-10 13:08:08 PDT
Comment on attachment 349290 [details] Patch Clearing flags on attachment: 349290 Committed r235856: <https://trac.webkit.org/changeset/235856>
WebKit Commit Bot
Comment 20 2018-09-10 13:08:10 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 21 2018-09-10 13:09:26 PDT
Darin Adler
Comment 23 2018-09-13 18:47:29 PDT
Comment on attachment 349290 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349290&action=review > LayoutTests/http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html:13 > + const repetitions = 40; Increasing this number will possibly cure the flakiness seen on the bots. I determined the number 40 in the other test empirically and it seems enough to be non-flaky there. A larger number should fix it here. > LayoutTests/http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html:24 > + if (leaks < repetitions / 10) Or we could use a smaller divisor here, like maybe 5.
Andy Estes
Comment 24 2018-09-24 09:50:05 PDT
Increased the number of reputations in r236404: <https://trac.webkit.org/changeset/236404>
Andy Estes
Comment 25 2018-09-24 09:50:25 PDT
(In reply to Andy Estes from comment #24) > Increased the number of reputations in r236404: > <https://trac.webkit.org/changeset/236404> Repetitions, even.
Note You need to log in before you can comment on or make changes to this bug.