Bug 196180 - [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
Summary: [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andy Estes
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-23 15:39 PDT by Andy Estes
Modified: 2019-03-25 11:27 PDT (History)
9 users (show)

See Also:


Attachments
Patch (14.10 KB, patch)
2019-03-23 15:42 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (14.07 KB, patch)
2019-03-24 13:19 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (14.59 KB, patch)
2019-03-25 10:35 PDT, Andy Estes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2019-03-23 15:39:32 PDT
[Apple Pay] Remove the AvailablePaymentNetworks synchronous message
Comment 1 Andy Estes 2019-03-23 15:42:04 PDT Comment hidden (obsolete)
Comment 2 Andy Estes 2019-03-24 13:19:39 PDT
Created attachment 365837 [details]
Patch
Comment 3 youenn fablet 2019-03-25 08:41:43 PDT
Comment on attachment 365837 [details]
Patch

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

> Source/WebKit/WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm:46
> +        result.uncheckedAppend(network);

Can we add them to m_availablePaymentNetworks directly and return void?
Or better, return a AvailablePaymentNetworksSet directly and make this a free function or a static WebPaymentCoordinator one.
We could also change WebPaymentCoordinator::availablePaymentNetworks():
if (!m_availablePaymentNetworks)
    m_availablePaymentNetworks = platformAvailablePaymentNetworks();
return *m_availablePaymentNetworks;

> Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:133
> +    if (WebCore::AXObjectCache* cache = [self axObjectCache]) {

auto?
Comment 4 Andy Estes 2019-03-25 10:35:07 PDT
Created attachment 365874 [details]
Patch
Comment 5 Andy Estes 2019-03-25 10:48:21 PDT
(In reply to youenn fablet from comment #3)
> Comment on attachment 365837 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=365837&action=review
> 
> > Source/WebKit/WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm:46
> > +        result.uncheckedAppend(network);
> 
> Can we add them to m_availablePaymentNetworks directly and return void?
> Or better, return a AvailablePaymentNetworksSet directly and make this a
> free function or a static WebPaymentCoordinator one.
> We could also change WebPaymentCoordinator::availablePaymentNetworks():
> if (!m_availablePaymentNetworks)
>     m_availablePaymentNetworks = platformAvailablePaymentNetworks();
> return *m_availablePaymentNetworks;

I got rid of availablePaymentNetworks entirely and moved its logic into validatedPaymentNetwork. I made platformAvailablePaymentNetworks return a AvailablePaymentNetworksSet as you suggested.

> 
> > Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:133
> > +    if (WebCore::AXObjectCache* cache = [self axObjectCache]) {
> 
> auto?

Yep. Thanks for reviewing!
Comment 6 WebKit Commit Bot 2019-03-25 11:26:15 PDT
Comment on attachment 365874 [details]
Patch

Clearing flags on attachment: 365874

Committed r243443: <https://trac.webkit.org/changeset/243443>
Comment 7 WebKit Commit Bot 2019-03-25 11:26:17 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-03-25 11:27:24 PDT
<rdar://problem/49222105>