Changeset 248692 in webkit


Ignore:
Timestamp:
Aug 14, 2019 3:55:30 PM (5 years ago)
Author:
aestes@apple.com
Message:

[Cocoa] Add some WKA extension points
https://bugs.webkit.org/show_bug.cgi?id=200506
<rdar://problem/51682474>

Reviewed by Tim Horton.

Source/WebCore:

  • Modules/applepay/ApplePayPayment.h:
  • Modules/applepay/ApplePayPaymentMethod.h:
  • Modules/applepay/ApplePayRequestBase.cpp:

(WebCore::finishConverting):
(WebCore::convertAndValidate):

  • Modules/applepay/ApplePayRequestBase.h:
  • Modules/applepay/ApplePaySessionPaymentRequest.h:
  • Modules/applepay/PaymentCoordinatorClient.cpp:

(WebCore::PaymentCoordinatorClient::supportsVersion):

  • Modules/applepay/cocoa/PaymentCocoa.mm:

(WebCore::convert):

  • Modules/applepay/cocoa/PaymentMethodCocoa.mm:

(WebCore::finishConverting):
(WebCore::convert):

Source/WebKit:

  • Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:

(WebKit::finishCreating):
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):

  • Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:

(IPC::finishDecoding):
(IPC::finishEncoding):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
(IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):

  • Shared/WebCoreArgumentCoders.h:
Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r248688 r248692  
     12019-08-14  Andy Estes  <aestes@apple.com>
     2
     3        [Cocoa] Add some WKA extension points
     4        https://bugs.webkit.org/show_bug.cgi?id=200506
     5        <rdar://problem/51682474>
     6
     7        Reviewed by Tim Horton.
     8
     9        * Modules/applepay/ApplePayPayment.h:
     10        * Modules/applepay/ApplePayPaymentMethod.h:
     11        * Modules/applepay/ApplePayRequestBase.cpp:
     12        (WebCore::finishConverting):
     13        (WebCore::convertAndValidate):
     14        * Modules/applepay/ApplePayRequestBase.h:
     15        * Modules/applepay/ApplePaySessionPaymentRequest.h:
     16        * Modules/applepay/PaymentCoordinatorClient.cpp:
     17        (WebCore::PaymentCoordinatorClient::supportsVersion):
     18        * Modules/applepay/cocoa/PaymentCocoa.mm:
     19        (WebCore::convert):
     20        * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
     21        (WebCore::finishConverting):
     22        (WebCore::convert):
     23
    1242019-08-14  Devin Rousso  <drousso@apple.com>
    225
  • trunk/Source/WebCore/Modules/applepay/ApplePayPayment.h

    r239427 r248692  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131#include "ApplePayPaymentMethod.h"
    3232
     33#if USE(APPLE_INTERNAL_SDK)
     34#include <WebKitAdditions/ApplePayPaymentAdditions.h>
     35#endif
     36
    3337namespace WebCore {
    3438
     
    4347    Optional<ApplePayPaymentContact> billingContact;
    4448    Optional<ApplePayPaymentContact> shippingContact;
     49
     50#if defined(APPLEPAYPAYMENT_ADDITIONS)
     51APPLEPAYPAYMENT_ADDITIONS
     52#undef APPLEPAYPAYMENT_ADDITIONS
     53#endif
    4554};
    4655
  • trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h

    r239427 r248692  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131#include <wtf/Optional.h>
    3232
     33#if USE(APPLE_INTERNAL_SDK)
     34#include <WebKitAdditions/ApplePayPaymentMethodAdditions.h>
     35#endif
     36
    3337namespace WebCore {
    3438
     
    3741struct ApplePayPaymentMethod {   
    3842    using Type = ApplePayPaymentMethodType;
    39    
     43
    4044    String displayName;
    4145    String network;
    4246    Optional<Type> type;
    4347    Optional<ApplePayPaymentPass> paymentPass;
     48
     49#if defined(APPLEPAYPAYMENTMETHOD_ADDITIONS)
     50APPLEPAYPAYMENTMETHOD_ADDITIONS
     51#undef APPLEPAYPAYMENTMETHOD_ADDITIONS
     52#endif
    4453};
    4554
  • trunk/Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp

    r243324 r248692  
    3131#include "PaymentCoordinator.h"
    3232#include <wtf/text/StringConcatenateNumbers.h>
     33
     34#if USE(APPLE_INTERNAL_SDK)
     35#include <WebKitAdditions/ApplePayRequestBaseAdditions.cpp>
     36#else
     37namespace WebCore {
     38static void finishConverting(ApplePaySessionPaymentRequest&, ApplePayRequestBase&) { }
     39}
     40#endif
    3341
    3442namespace WebCore {
     
    7987    if (request.billingContact)
    8088        result.setBillingContact(PaymentContact::fromApplePayPaymentContact(version, *request.billingContact));
    81    
     89
    8290    if (request.requiredShippingContactFields) {
    8391        auto requiredShippingContactFields = convertAndValidate(version, *request.requiredShippingContactFields);
     
    95103        result.setSupportedCountries(WTFMove(request.supportedCountries));
    96104
     105    finishConverting(result, request);
     106
    97107    return WTFMove(result);
    98108}
  • trunk/Source/WebCore/Modules/applepay/ApplePayRequestBase.h

    r243324 r248692  
    3232#include "ApplePayPaymentContact.h"
    3333
     34#if USE(APPLE_INTERNAL_SDK)
     35#include <WebKitAdditions/ApplePayRequestBaseAdditions.h>
     36#endif
     37
    3438namespace WebCore {
    3539
     
    5054    String applicationData;
    5155    Vector<String> supportedCountries;
     56
     57#if defined(APPLEPAYREQUESTBASE_ADDITIONS)
     58APPLEPAYREQUESTBASE_ADDITIONS
     59#undef APPLEPAYREQUESTBASE_ADDITIONS
     60#endif
    5261};
    5362
  • trunk/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h

    r239427 r248692  
    11/*
    2  * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333#include <wtf/text/WTFString.h>
    3434
     35#if USE(APPLE_INTERNAL_SDK)
     36#include <WebKitAdditions/ApplePaySessionPaymentRequestAdditions.h>
     37#endif
     38
    3539namespace WebCore {
    3640
     
    138142    void setRequester(Requester requester) { m_requester = requester; }
    139143
     144#if defined(APPLEPAYSESSIONPAYMENTREQUEST_PUBLIC_ADDITIONS)
     145APPLEPAYSESSIONPAYMENTREQUEST_PUBLIC_ADDITIONS
     146#undef APPLEPAYSESSIONPAYMENTREQUEST_PUBLIC_ADDITIONS
     147#endif
     148
    140149private:
    141150    unsigned m_version { 0 };
     
    163172
    164173    Requester m_requester { Requester::ApplePayJS };
     174
     175#if defined(APPLEPAYSESSIONPAYMENTREQUEST_PRIVATE_ADDITIONS)
     176APPLEPAYSESSIONPAYMENTREQUEST_PRIVATE_ADDITIONS
     177#undef APPLEPAYSESSIONPAYMENTREQUEST_PRIVATE_ADDITIONS
     178#endif
    165179};
    166180
  • trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.cpp

    r244727 r248692  
    4141#elif !ENABLE(APPLE_PAY_SESSION_V7)
    4242    static const unsigned currentVersion = 6;
     43#elif !ENABLE(APPLE_PAY_SESSION_V8)
     44    static const unsigned currentVersion = 7;
    4345#else
    44     static const unsigned currentVersion = 7;
     46    static const unsigned currentVersion = 8;
    4547#endif
    4648
  • trunk/Source/WebCore/Modules/applepay/cocoa/PaymentCocoa.mm

    r238515 r248692  
    3434#import <pal/spi/cocoa/PassKitSPI.h>
    3535
     36#if USE(APPLE_INTERNAL_SDK)
     37#import <WebKitAdditions/PaymentCocoaAdditions.mm>
     38#else
     39namespace WebCore {
     40static void finishConverting(PKPayment *, ApplePayPayment&) { }
     41}
     42#endif
     43
    3644namespace WebCore {
    3745
     
    6573        result.shippingContact = PaymentContact(payment.shippingContact).toApplePayPaymentContact(version);
    6674
     75    finishConverting(payment, result);
     76
    6777    return result;
    6878}
  • trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm

    r239427 r248692  
    11/*
    2  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3232#import "ApplePayPaymentMethodType.h"
    3333#import <pal/spi/cocoa/PassKitSPI.h>
     34
     35#if USE(APPLE_INTERNAL_SDK)
     36#import <WebKitAdditions/PaymentMethodCocoaAdditions.mm>
     37#else
     38namespace WebCore {
     39static void finishConverting(PKPaymentMethod *, ApplePayPaymentMethod&) { }
     40}
     41#endif
    3442
    3543namespace WebCore {
     
    99107    result.paymentPass = convert(paymentMethod.paymentPass);
    100108
     109    finishConverting(paymentMethod, result);
     110
    101111    return result;
    102112}
  • trunk/Source/WebKit/ChangeLog

    r248690 r248692  
     12019-08-14  Andy Estes  <aestes@apple.com>
     2
     3        [Cocoa] Add some WKA extension points
     4        https://bugs.webkit.org/show_bug.cgi?id=200506
     5        <rdar://problem/51682474>
     6
     7        Reviewed by Tim Horton.
     8
     9        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
     10        (WebKit::finishCreating):
     11        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
     12        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
     13        (IPC::finishDecoding):
     14        (IPC::finishEncoding):
     15        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
     16        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
     17        * Shared/WebCoreArgumentCoders.h:
     18
    1192019-08-14  Luming Yin  <luming_yin@apple.com>
    220
  • trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm

    r246235 r248692  
    3838#import <wtf/URL.h>
    3939
     40#if USE(APPLE_INTERNAL_SDK)
     41#import <WebKitAdditions/WebPaymentCoordinatorProxyCocoaAdditions.mm>
     42#else
     43namespace WebKit {
     44static void finishCreating(PKPaymentRequest *, const WebCore::ApplePaySessionPaymentRequest&) { }
     45}
     46#endif
     47
    4048// FIXME: We don't support any platforms without -setThumbnailURLs:, so this can be removed.
    4149@interface PKPaymentRequest ()
     
    329337#endif
    330338
     339    finishCreating(result.get(), paymentRequest);
     340
    331341    return result;
    332342}
  • trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm

    r242950 r248692  
    11/*
    2  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4242#endif
    4343
     44#if USE(APPLE_INTERNAL_SDK)
     45#import <WebKitAdditions/WebCoreArgumentCodersCocoaAdditions.mm>
     46#else
     47namespace IPC {
     48static bool finishDecoding(Decoder&, WebCore::ApplePaySessionPaymentRequest&) { return true; }
     49static void finishEncoding(Encoder&, const WebCore::ApplePaySessionPaymentRequest&) { }
     50}
     51#endif
     52
    4453namespace IPC {
    4554using namespace WebCore;
     
    182191    encoder << request.supportedCountries();
    183192    encoder.encodeEnum(request.requester());
     193    finishEncoding(encoder, request);
    184194}
    185195
     
    263273        return false;
    264274    request.setRequester(requester);
     275
     276    if (!finishDecoding(decoder, request))
     277        return false;
    265278
    266279    return true;
  • trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h

    r246725 r248692  
    4949#if USE(CURL)
    5050#include <WebCore/CurlProxySettings.h>
     51#endif
     52
     53#if USE(APPLE_INTERNAL_SDK)
     54#include <WebKitAdditions/WebCoreArgumentCodersAdditions.h>
    5155#endif
    5256
Note: See TracChangeset for help on using the changeset viewer.