Changeset 260717 in webkit
- Timestamp:
- Apr 25, 2020 8:03:30 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 17 added
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r260716 r260717 1 2020-04-25 Alex Christensen <achristensen@webkit.org> 2 3 Move ApplePay code from WebKitAdditions to WebCore and WebKit 4 https://bugs.webkit.org/show_bug.cgi?id=210521 5 6 Reviewed by Andy Estes. 7 8 Only 4 minor modifications were necessary, as follows: 9 10 1. PaymentSetupFeatures's RetainPtr<NSArray<PKPaymentSetupFeature *>> was changed to RetainPtr<NSArray> to work with C++. 11 2. WebPaymentCoordinatorProxyAdditions messages were moved to WebPaymentCoordinatorProxy, removing the need for 12 the extra message receiver, the Optional<WebPaymentCoordinatorProxyAdditions>, and the finishConstruction. 13 3. WebMediaSessionManager.cpp's macros that collided with other macros were renamed. This was necessary because of different source unification. 14 4. PaymentSetupFeatures.h was renamed to ApplePayPaymentSetupFeatures.h to be able to build with PaymentSetupFeatures.h in the SDK. 15 16 The rest is just copy and paste. 17 18 There isn't a good way to land this without breaking the build without removing the files from WebKitAdditions at the same time, 19 so I'll do the two at the same time late at night to not cause disruption. 20 21 * DerivedSources.make: 22 * Modules/applepay/ApplePayInstallmentConfiguration.h: Added. 23 * Modules/applepay/ApplePayInstallmentConfiguration.idl: Added. 24 * Modules/applepay/ApplePayPayment.h: 25 * Modules/applepay/ApplePayPayment.idl: 26 * Modules/applepay/ApplePayPaymentMethod.h: 27 * Modules/applepay/ApplePayPaymentMethod.idl: 28 * Modules/applepay/ApplePayPaymentMethodUpdate.h: 29 * Modules/applepay/ApplePayPaymentMethodUpdate.idl: 30 * Modules/applepay/ApplePayRequestBase.cpp: 31 (WebCore::finishConverting): 32 (WebCore::requiresSupportedNetworks): 33 * Modules/applepay/ApplePayRequestBase.h: 34 * Modules/applepay/ApplePaySession.cpp: 35 (WebCore::finishConverting): 36 * Modules/applepay/ApplePaySessionPaymentRequest.h: 37 (WebCore::ApplePaySessionPaymentRequest::installmentConfiguration const): 38 (WebCore::ApplePaySessionPaymentRequest::setInstallmentConfiguration): 39 * Modules/applepay/ApplePaySetup.cpp: Added. 40 (WebCore::shouldDiscloseFeatures): 41 (WebCore::ApplePaySetup::getSetupFeatures): 42 (WebCore::ApplePaySetup::begin): 43 (WebCore::ApplePaySetup::ApplePaySetup): 44 (WebCore::ApplePaySetup::stop): 45 (WebCore::ApplePaySetup::suspend): 46 * Modules/applepay/ApplePaySetup.h: Added. 47 (WebCore::ApplePaySetup::create): 48 * Modules/applepay/ApplePaySetup.idl: Added. 49 * Modules/applepay/ApplePaySetupFeature.h: Added. 50 (WebCore::ApplePaySetupFeature::create): 51 (WebCore::ApplePaySetupFeature::platformFeature const): 52 * Modules/applepay/ApplePaySetupFeature.idl: Added. 53 * Modules/applepay/ApplePaySetupFeature.mm: Added. 54 (WebCore::ApplePaySetupFeature::type const): 55 (WebCore::ApplePaySetupFeature::state const): 56 (WebCore::ApplePaySetupFeature::supportsInstallments const): 57 (WebCore::ApplePaySetupFeature::ApplePaySetupFeature): 58 * Modules/applepay/ApplePaySetupFeatureType.h: Added. 59 * Modules/applepay/ApplePaySetupFeatureType.idl: Added. 60 * Modules/applepay/PaymentCoordinatorClient.h: 61 (WebCore::PaymentCoordinatorClient::getSetupFeatures): 62 (WebCore::PaymentCoordinatorClient::beginApplePaySetup): 63 (WebCore::PaymentCoordinatorClient::endApplePaySetup): 64 * Modules/applepay/PaymentInstallmentConfiguration.h: Added. 65 * Modules/applepay/PaymentInstallmentConfiguration.mm: Added. 66 (WebCore::toDecimalNumber): 67 (WebCore::platformFeatureType): 68 (WebCore::createPlatformConfiguration): 69 (WebCore::PaymentInstallmentConfiguration::PaymentInstallmentConfiguration): 70 (WebCore::PaymentInstallmentConfiguration::platformConfiguration const): 71 * Modules/applepay/PaymentMethodUpdate.h: 72 * Modules/applepay/cocoa/PaymentCocoa.mm: 73 (WebCore::finishConverting): 74 * Modules/applepay/cocoa/PaymentMethodCocoa.mm: 75 (WebCore::finishConverting): 76 * Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm: 77 (WebCore::PaymentMethodUpdate::setInstallmentGroupIdentifier): 78 * Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm: 79 (WebCore::additionalError): 80 * Modules/applepay/paymentrequest/ApplePayRequest.idl: 81 * Modules/mediasession/WebMediaSessionManager.cpp: 82 (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled): 83 (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): 84 (WebCore::WebMediaSessionManager::mockMediaPlaybackTargetPickerDismissPopup): 85 (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient): 86 (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient): 87 (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): 88 (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): 89 (WebCore::WebMediaSessionManager::clientStateDidChange): 90 (WebCore::WebMediaSessionManager::setPlaybackTarget): 91 (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): 92 (WebCore::WebMediaSessionManager::playbackTargetPickerWasDismissed): 93 (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): 94 (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring): 95 (WebCore::WebMediaSessionManager::configureWatchdogTimer): 96 (WebCore::WebMediaSessionManager::watchdogTimerFired): 97 * SourcesCocoa.txt: 98 * WebCore.xcodeproj/project.pbxproj: 99 * platform/cocoa/WebCoreAdditions.mm: 100 1 101 2020-04-25 Simon Fraser <simon.fraser@apple.com> 2 102 -
trunk/Source/WebCore/DerivedSources.make
r260505 r260717 104 104 $(WebCore)/Modules/applepay/ApplePayErrorCode.idl \ 105 105 $(WebCore)/Modules/applepay/ApplePayErrorContactField.idl \ 106 $(WebCore)/Modules/applepay/ApplePayInstallmentConfiguration.idl \ 106 107 $(WebCore)/Modules/applepay/ApplePayLineItem.idl \ 107 108 $(WebCore)/Modules/applepay/ApplePayMerchantCapability.idl \ … … 119 120 $(WebCore)/Modules/applepay/ApplePaySession.idl \ 120 121 $(WebCore)/Modules/applepay/ApplePaySessionError.idl \ 122 $(WebCore)/Modules/applepay/ApplePaySetup.idl \ 123 $(WebCore)/Modules/applepay/ApplePaySetupFeature.idl \ 124 $(WebCore)/Modules/applepay/ApplePaySetupFeatureType.idl \ 121 125 $(WebCore)/Modules/applepay/ApplePayShippingContactSelectedEvent.idl \ 122 126 $(WebCore)/Modules/applepay/ApplePayShippingContactUpdate.idl \ … … 1265 1269 ADDITIONAL_EVENT_TARGET_FACTORY = 1266 1270 1267 -include WebCoreDerivedSourcesAdditions.make1268 1269 1271 JS_BINDING_IDLS += $(ADDITIONAL_BINDING_IDLS) 1270 1272 -
trunk/Source/WebCore/Modules/applepay/ApplePayPayment.h
r248692 r260717 31 31 #include "ApplePayPaymentMethod.h" 32 32 33 #if USE(APPLE_INTERNAL_SDK)34 #include <WebKitAdditions/ApplePayPaymentAdditions.h>35 #endif36 37 33 namespace WebCore { 38 34 … … 47 43 Optional<ApplePayPaymentContact> billingContact; 48 44 Optional<ApplePayPaymentContact> shippingContact; 49 50 #if defined(APPLEPAYPAYMENT_ADDITIONS) 51 APPLEPAYPAYMENT_ADDITIONS 52 #undef APPLEPAYPAYMENT_ADDITIONS 53 #endif 45 String installmentAuthorizationToken; 54 46 }; 55 47 -
trunk/Source/WebCore/Modules/applepay/ApplePayPayment.idl
r209927 r260717 31 31 ApplePayPaymentContact billingContact; 32 32 ApplePayPaymentContact shippingContact; 33 [Conditional=APPLE_PAY_INSTALLMENTS] DOMString installmentAuthorizationToken; 33 34 }; 34 35 -
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h
r256041 r260717 31 31 #include <wtf/Optional.h> 32 32 33 #if USE(APPLE_INTERNAL_SDK)34 #include <WebKitAdditions/ApplePayPaymentMethodAdditions.h>35 #endif36 37 33 namespace WebCore { 38 34 … … 47 43 Optional<ApplePayPaymentPass> paymentPass; 48 44 Optional<ApplePayPaymentContact> billingContact; 49 50 #if defined(APPLEPAYPAYMENTMETHOD_ADDITIONS) 51 APPLEPAYPAYMENTMETHOD_ADDITIONS 52 #undef APPLEPAYPAYMENTMETHOD_ADDITIONS 53 #endif 45 String bindToken; 54 46 }; 55 47 -
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.idl
r256041 r260717 34 34 ApplePayPaymentPass paymentPass; 35 35 ApplePayPaymentContact billingContact; 36 [Conditional=APPLE_PAY_INSTALLMENTS] DOMString bindToken; 36 37 }; -
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.h
r250179 r260717 30 30 #include "ApplePayLineItem.h" 31 31 32 #if USE(APPLE_INTERNAL_SDK)33 #include <WebKitAdditions/ApplePayPaymentMethodUpdateAdditions.h>34 #endif35 36 32 namespace WebCore { 37 33 … … 39 35 ApplePayLineItem newTotal; 40 36 Vector<ApplePayLineItem> newLineItems; 41 42 #if defined(APPLEPAYPAYMENTMETHODUPDATE_ADDITIONS) 43 APPLEPAYPAYMENTMETHODUPDATE_ADDITIONS 44 #undef APPLEPAYPAYMENTMETHODUPDATE_ADDITIONS 45 #endif 37 String installmentGroupIdentifier; 46 38 }; 47 39 -
trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodUpdate.idl
r217626 r260717 29 29 required ApplePayLineItem newTotal; 30 30 sequence<ApplePayLineItem> newLineItems; 31 [Conditional=APPLE_PAY_INSTALLMENTS] DOMString installmentGroupIdentifier; 31 32 }; -
trunk/Source/WebCore/Modules/applepay/ApplePayRequestBase.cpp
r250026 r260717 32 32 #include <wtf/text/StringConcatenateNumbers.h> 33 33 34 #if USE(APPLE_INTERNAL_SDK) 35 #include <WebKitAdditions/ApplePayRequestBaseAdditions.cpp> 34 namespace WebCore { 35 36 static void finishConverting(ApplePaySessionPaymentRequest& result, ApplePayRequestBase& request) 37 { 38 #if ENABLE(APPLE_PAY_INSTALLMENTS) 39 if (request.installmentConfiguration) 40 result.setInstallmentConfiguration(WTFMove(*request.installmentConfiguration)); 36 41 #else 37 namespace WebCore { 38 static void finishConverting(ApplePaySessionPaymentRequest&, ApplePayRequestBase&) { } 39 static bool requiresSupportedNetworks(unsigned, const ApplePayRequestBase&) { return true; } 42 UNUSED_PARAM(result); 43 UNUSED_PARAM(request); 44 #endif 40 45 } 46 47 static bool requiresSupportedNetworks(unsigned version, const ApplePayRequestBase& request) 48 { 49 #if ENABLE(APPLE_PAY_INSTALLMENTS) 50 return version < 8 || !request.installmentConfiguration; 51 #else 52 UNUSED_PARAM(version); 53 UNUSED_PARAM(request); 54 return true; 41 55 #endif 42 43 namespace WebCore { 56 } 44 57 45 58 static ExceptionOr<Vector<String>> convertAndValidate(Document& document, unsigned version, const Vector<String>& supportedNetworks, const PaymentCoordinator& paymentCoordinator) -
trunk/Source/WebCore/Modules/applepay/ApplePayRequestBase.h
r248692 r260717 29 29 30 30 #include "ApplePayContactField.h" 31 #include "ApplePayInstallmentConfiguration.h" 31 32 #include "ApplePayMerchantCapability.h" 32 33 #include "ApplePayPaymentContact.h" 33 34 #if USE(APPLE_INTERNAL_SDK)35 #include <WebKitAdditions/ApplePayRequestBaseAdditions.h>36 #endif37 34 38 35 namespace WebCore { … … 55 52 Vector<String> supportedCountries; 56 53 57 #if defined(APPLEPAYREQUESTBASE_ADDITIONS) 58 APPLEPAYREQUESTBASE_ADDITIONS 59 #undef APPLEPAYREQUESTBASE_ADDITIONS 54 #if ENABLE(APPLE_PAY_INSTALLMENTS) 55 Optional<ApplePayInstallmentConfiguration> installmentConfiguration; 60 56 #endif 61 57 }; -
trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp
r258679 r260717 66 66 #include <wtf/RunLoop.h> 67 67 68 #if USE(APPLE_INTERNAL_SDK) 69 #include <WebKitAdditions/ApplePaySessionAdditions.cpp> 68 namespace WebCore { 69 70 static void finishConverting(PaymentMethodUpdate& convertedUpdate, ApplePayPaymentMethodUpdate&& update) 71 { 72 #if ENABLE(APPLE_PAY_INSTALLMENTS) 73 convertedUpdate.setInstallmentGroupIdentifier(update.installmentGroupIdentifier); 70 74 #else 71 namespace WebCore { 72 static void finishConverting(PaymentMethodUpdate&, ApplePayPaymentMethodUpdate&&) { } 73 } 75 UNUSED_PARAM(convertedUpdate); 76 UNUSED_PARAM(update); 74 77 #endif 75 76 namespace WebCore { 78 } 77 79 78 80 WTF_MAKE_ISO_ALLOCATED_IMPL(ApplePaySession); -
trunk/Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h
r250179 r260717 29 29 30 30 #include "PaymentContact.h" 31 #include "PaymentInstallmentConfiguration.h" 31 32 #include <wtf/Optional.h> 32 33 #include <wtf/Vector.h> 33 34 #include <wtf/text/WTFString.h> 34 35 #if USE(APPLE_INTERNAL_SDK)36 #include <WebKitAdditions/ApplePaySessionPaymentRequestAdditions.h>37 #endif38 35 39 36 namespace WebCore { … … 142 139 void setRequester(Requester requester) { m_requester = requester; } 143 140 144 #if defined(APPLEPAYSESSIONPAYMENTREQUEST_PUBLIC_ADDITIONS)145 APPLEPAYSESSIONPAYMENTREQUEST_PUBLIC_ADDITIONS 146 #undef APPLEPAYSESSIONPAYMENTREQUEST_PUBLIC_ADDITIONS 141 #if HAVE(PASSKIT_INSTALLMENTS) 142 const PaymentInstallmentConfiguration& installmentConfiguration() const { return m_installmentConfiguration; } 143 void setInstallmentConfiguration(PaymentInstallmentConfiguration&& installmentConfiguration) { m_installmentConfiguration = WTFMove(installmentConfiguration); } 147 144 #endif 148 145 … … 173 170 Requester m_requester { Requester::ApplePayJS }; 174 171 175 #if defined(APPLEPAYSESSIONPAYMENTREQUEST_PRIVATE_ADDITIONS) 176 APPLEPAYSESSIONPAYMENTREQUEST_PRIVATE_ADDITIONS 177 #undef APPLEPAYSESSIONPAYMENTREQUEST_PRIVATE_ADDITIONS 172 #if HAVE(PASSKIT_INSTALLMENTS) 173 PaymentInstallmentConfiguration m_installmentConfiguration; 178 174 #endif 179 175 }; -
trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
r254015 r260717 29 29 30 30 #include "ApplePaySessionPaymentRequest.h" 31 #include "ApplePaySetup.h" 32 #include "ApplePaySetupFeature.h" 33 #include <wtf/CompletionHandler.h> 31 34 #include <wtf/Forward.h> 32 35 #include <wtf/Function.h> 33 34 #if USE(APPLE_INTERNAL_SDK)35 #import <WebKitAdditions/PaymentCoordinatorClientAdditions.h>36 #endif37 36 38 37 namespace WebCore { … … 72 71 virtual bool isAlwaysOnLoggingAllowed() const { return false; } 73 72 73 #if ENABLE(APPLE_PAY_SETUP) 74 virtual void getSetupFeatures(const ApplePaySetup::Configuration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler) { completionHandler({ }); } 75 virtual void beginApplePaySetup(const ApplePaySetup::Configuration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&& completionHandler) { completionHandler(false); } 76 virtual void endApplePaySetup() { } 77 #endif 78 74 79 protected: 75 80 virtual ~PaymentCoordinatorClient() = default; 76 77 #if defined(PAYMENTCOORDINATORCLIENT_ADDITIONS)78 PAYMENTCOORDINATORCLIENT_ADDITIONS79 #undef PAYMENTCOORDINATORCLIENT_ADDITIONS80 #endif81 81 }; 82 82 -
trunk/Source/WebCore/Modules/applepay/PaymentMethodUpdate.h
r250179 r260717 31 31 #include <wtf/RetainPtr.h> 32 32 33 #if USE(APPLE_INTERNAL_SDK)34 #include <WebKitAdditions/PaymentMethodUpdateAdditions.h>35 #endif36 37 33 OBJC_CLASS PKPaymentRequestPaymentMethodUpdate; 38 34 … … 51 47 PKPaymentRequestPaymentMethodUpdate *platformUpdate() const; 52 48 53 #if defined(PAYMENTMETHODUPDATE_PUBLIC_ADDITIONS) 54 PAYMENTMETHODUPDATE_PUBLIC_ADDITIONS 55 #undef PAYMENTMETHODUPDATE_PUBLIC_ADDITIONS 49 #if HAVE(PASSKIT_INSTALLMENTS) 50 void setInstallmentGroupIdentifier(const String&); 56 51 #endif 57 52 58 53 private: 59 54 Optional<TotalAndLineItems> m_totalAndLineItems; -
trunk/Source/WebCore/Modules/applepay/cocoa/PaymentCocoa.mm
r248692 r260717 34 34 #import <pal/spi/cocoa/PassKitSPI.h> 35 35 36 #if USE(APPLE_INTERNAL_SDK) 37 #import <WebKitAdditions/PaymentCocoaAdditions.mm> 36 namespace WebCore { 37 38 static void finishConverting(PKPayment *payment, ApplePayPayment& result) 39 { 40 #if HAVE(PASSKIT_INSTALLMENTS) 41 if (NSString *installmentAuthorizationToken = payment.installmentAuthorizationToken) 42 result.installmentAuthorizationToken = installmentAuthorizationToken; 38 43 #else 39 namespace WebCore { 40 static void finishConverting(PKPayment *, ApplePayPayment&) { } 44 UNUSED_PARAM(payment); 45 UNUSED_PARAM(result); 46 #endif 41 47 } 42 #endif43 44 namespace WebCore {45 48 46 49 static ApplePayPayment::Token convert(PKPaymentToken *paymentToken) -
trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm
r259050 r260717 33 33 #import <pal/spi/cocoa/PassKitSPI.h> 34 34 35 #if USE(APPLE_INTERNAL_SDK) 36 #import <WebKitAdditions/PaymentMethodCocoaAdditions.mm> 35 namespace WebCore { 36 37 static void finishConverting(PKPaymentMethod *paymentMethod, ApplePayPaymentMethod& result) 38 { 39 #if HAVE(PASSKIT_INSTALLMENTS) 40 if (NSString *bindToken = paymentMethod.bindToken) 41 result.bindToken = bindToken; 37 42 #else 38 namespace WebCore { 39 static void finishConverting(PKPaymentMethod *, ApplePayPaymentMethod&) { } 43 UNUSED_PARAM(paymentMethod); 44 UNUSED_PARAM(result); 45 #endif 40 46 } 41 #endif42 43 namespace WebCore {44 47 45 48 static ApplePayPaymentPass::ActivationState convert(PKPaymentPassActivationState paymentPassActivationState) -
trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm
r250179 r260717 60 60 } 61 61 62 #if HAVE(PASSKIT_INSTALLMENTS) 63 void PaymentMethodUpdate::setInstallmentGroupIdentifier(const String& installmentGroupIdentifier) 64 { 65 [m_platformUpdate setInstallmentGroupIdentifier:installmentGroupIdentifier]; 66 } 67 #endif 68 62 69 } // namespace WebCore 63 70 -
trunk/Source/WebCore/Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm
r250048 r260717 32 32 #import <pal/cocoa/PassKitSoftLink.h> 33 33 34 #if USE(APPLE_INTERNAL_SDK) 35 #import <WebKitAdditions/PaymentSessionErrorCocoaAdditions.mm> 34 namespace WebCore { 35 36 static Optional<ApplePaySessionError> additionalError(NSError *error) 37 { 38 #if HAVE(PASSKIT_INSTALLMENTS) 39 // FIXME: Replace with PKPaymentErrorBindTokenUserInfoKey and 40 // PKPaymentAuthorizationFeatureApplicationError when they're available in an SDK. 41 static NSString * const bindTokenKey = @"PKPaymentErrorBindToken"; 42 static constexpr NSInteger pkPaymentAuthorizationFeatureApplicationError = -2016; 43 44 if (error.code != pkPaymentAuthorizationFeatureApplicationError) 45 return WTF::nullopt; 46 47 id bindTokenValue = error.userInfo[bindTokenKey]; 48 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!bindTokenValue || [bindTokenValue isKindOfClass:NSString.class]); 49 return ApplePaySessionError { "featureApplicationError"_s, { { "bindToken"_s, (NSString *)bindTokenValue } } }; 36 50 #else 37 namespace WebCore { 38 static Optional<ApplePaySessionError> additionalError(NSError *) { return WTF::nullopt; } 51 UNUSED_PARAM(error); 52 return WTF::nullopt; 53 #endif 39 54 } 40 #endif41 42 namespace WebCore {43 55 44 56 PaymentSessionError::PaymentSessionError(RetainPtr<NSError>&& error) -
trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayRequest.idl
r227140 r260717 29 29 required unsigned long version; 30 30 required DOMString merchantIdentifier; 31 [Conditional=APPLE_PAY_INSTALLMENTS] ApplePayInstallmentConfiguration installmentConfiguration; 31 32 }; -
trunk/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp
r255581 r260717 41 41 static const Seconds taskDelayInterval { 100_ms }; 42 42 43 #undef LOGIDENTIFIER 44 #define LOGIDENTIFIER __func__ 45 46 #undef ALWAYS_LOG 47 #define ALWAYS_LOG logger().logAlways 43 #define ALWAYS_LOG_MEDIASESSIONMANAGER logger().logAlways 48 44 49 45 struct ClientState { … … 162 158 return; 163 159 164 ALWAYS_LOG (LOGIDENTIFIER);160 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__); 165 161 m_mockPickerEnabled = enabled; 166 162 } … … 168 164 void WebMediaSessionManager::setMockMediaPlaybackTargetPickerState(const String& name, MediaPlaybackTargetContext::State state) 169 165 { 170 ALWAYS_LOG (LOGIDENTIFIER);166 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__); 171 167 mockPicker().setState(name, state); 172 168 } … … 174 170 void WebMediaSessionManager::mockMediaPlaybackTargetPickerDismissPopup() 175 171 { 176 ALWAYS_LOG (LOGIDENTIFIER);172 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__); 177 173 mockPicker().dismissPopup(); 178 174 } … … 209 205 return 0; 210 206 211 ALWAYS_LOG (LOGIDENTIFIER, contextId);207 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, contextId); 212 208 m_clientState.append(makeUnique<ClientState>(client, contextId)); 213 209 … … 225 221 return; 226 222 227 ALWAYS_LOG (LOGIDENTIFIER, m_clientState[index].get());223 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, m_clientState[index].get()); 228 224 229 225 m_clientState.remove(index); … … 238 234 for (size_t i = m_clientState.size(); i > 0; --i) { 239 235 if (&m_clientState[i - 1]->client == &client) { 240 ALWAYS_LOG (LOGIDENTIFIER, m_clientState[i - 1].get());236 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, m_clientState[i - 1].get()); 241 237 m_clientState.remove(i - 1); 242 238 } … … 258 254 } 259 255 260 ALWAYS_LOG (LOGIDENTIFIER, m_clientState[index].get());256 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, m_clientState[index].get()); 261 257 262 258 bool hasActiveRoute = flagsAreSet(m_clientState[index]->flags, MediaProducer::IsPlayingToExternalDevice); … … 276 272 return; 277 273 278 ALWAYS_LOG (LOGIDENTIFIER, m_clientState[index].get(), "new flags = ", newFlags);274 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, m_clientState[index].get(), "new flags = ", newFlags); 279 275 280 276 changedClientState->flags = newFlags; … … 300 296 301 297 if (flagsAreSet(state->flags, MediaProducer::IsPlayingToExternalDevice) && flagsAreSet(state->flags, MediaProducer::IsPlayingVideo)) { 302 ALWAYS_LOG (LOGIDENTIFIER, state.get(), " returning early");298 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, state.get(), " returning early"); 303 299 return; 304 300 } … … 307 303 // Do not begin playing to the device unless playback has just started. 308 304 if (!flagsAreSet(newFlags, MediaProducer::IsPlayingVideo) || flagsAreSet(oldFlags, MediaProducer::IsPlayingVideo)) { 309 ALWAYS_LOG (LOGIDENTIFIER, "returning early, playback didn't just start");305 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, "returning early, playback didn't just start"); 310 306 return; 311 307 } … … 314 310 if (state == changedClientState) 315 311 continue; 316 ALWAYS_LOG (LOGIDENTIFIER, state.get(), " calling setShouldPlayToPlaybackTarget(false)");312 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, state.get(), " calling setShouldPlayToPlaybackTarget(false)"); 317 313 state->client.setShouldPlayToPlaybackTarget(state->contextId, false); 318 314 } 319 315 320 ALWAYS_LOG (LOGIDENTIFIER, changedClientState.get(), " calling setShouldPlayToPlaybackTarget(true)");316 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, changedClientState.get(), " calling setShouldPlayToPlaybackTarget(true)"); 321 317 changedClientState->client.setShouldPlayToPlaybackTarget(changedClientState->contextId, true); 322 318 … … 327 323 void WebMediaSessionManager::setPlaybackTarget(Ref<MediaPlaybackTarget>&& target) 328 324 { 329 ALWAYS_LOG (LOGIDENTIFIER, "has active route = ", target->hasActiveRoute());325 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, "has active route = ", target->hasActiveRoute()); 330 326 m_playbackTarget = WTFMove(target); 331 327 m_targetChanged = true; … … 335 331 void WebMediaSessionManager::externalOutputDeviceAvailableDidChange(bool available) 336 332 { 337 ALWAYS_LOG (LOGIDENTIFIER, available);333 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, available); 338 334 m_externalOutputDeviceAvailable = available; 339 335 for (auto& state : m_clientState) … … 343 339 void WebMediaSessionManager::playbackTargetPickerWasDismissed() 344 340 { 345 ALWAYS_LOG (LOGIDENTIFIER);341 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__); 346 342 m_playbackTargetPickerDismissed = true; 347 343 scheduleDelayedTask(TargetClientsConfigurationTask); … … 376 372 auto& state = m_clientState[i]; 377 373 378 ALWAYS_LOG (LOGIDENTIFIER, state.get(), ", requestedPicker = ", state->requestedPicker);374 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, state.get(), ", requestedPicker = ", state->requestedPicker); 379 375 380 376 if ((m_targetChanged || m_playbackTargetPickerDismissed) && state->requestedPicker) … … 402 398 403 399 if (i != indexOfClientWillPlayToTarget || !haveActiveRoute) { 404 ALWAYS_LOG (LOGIDENTIFIER, state.get(), " calling setShouldPlayToPlaybackTarget(false)");400 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, state.get(), " calling setShouldPlayToPlaybackTarget(false)"); 405 401 state->client.setShouldPlayToPlaybackTarget(state->contextId, false); 406 402 } 407 403 408 404 if (state->requestedPicker && m_playbackTargetPickerDismissed) { 409 ALWAYS_LOG (LOGIDENTIFIER, state.get(), " calling playbackTargetPickerWasDismissed");405 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, state.get(), " calling playbackTargetPickerWasDismissed"); 410 406 state->client.playbackTargetPickerWasDismissed(state->contextId); 411 407 } … … 419 415 auto& state = m_clientState[indexOfClientWillPlayToTarget]; 420 416 if (!flagsAreSet(state->flags, MediaProducer::IsPlayingToExternalDevice)) { 421 ALWAYS_LOG (LOGIDENTIFIER, state.get(), " calling setShouldPlayToPlaybackTarget(true)");417 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, state.get(), " calling setShouldPlayToPlaybackTarget(true)"); 422 418 state->client.setShouldPlayToPlaybackTarget(state->contextId, true); 423 419 } … … 434 430 bool haveClientWithMedia = false; 435 431 for (auto& state : m_clientState) { 436 ALWAYS_LOG (LOGIDENTIFIER, state.get());432 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, state.get()); 437 433 if (state->flags & MediaProducer::RequiresPlaybackTargetMonitoring) { 438 434 monitoringRequired = true; … … 446 442 447 443 if (monitoringRequired || (hasAvailabilityListener && haveClientWithMedia)) { 448 ALWAYS_LOG (LOGIDENTIFIER, "starting monitoring");444 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, "starting monitoring"); 449 445 targetPicker().startingMonitoringPlaybackTargets(); 450 446 } else { 451 ALWAYS_LOG (LOGIDENTIFIER, "stopping monitoring");447 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, "stopping monitoring"); 452 448 targetPicker().stopMonitoringPlaybackTargets(); 453 449 } … … 491 487 if (!m_playbackTarget || !m_playbackTarget->hasActiveRoute()) { 492 488 if (m_watchdogTimer.isActive()) { 493 ALWAYS_LOG (LOGIDENTIFIER, "stopping timer");489 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, "stopping timer"); 494 490 m_currentWatchdogInterval = { }; 495 491 m_watchdogTimer.stop(); … … 503 499 for (auto& state : m_clientState) { 504 500 505 ALWAYS_LOG (LOGIDENTIFIER, state.get(), " playedToEnd = ", state->playedToEnd);501 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, state.get(), " playedToEnd = ", state->playedToEnd); 506 502 507 503 if (flagsAreSet(state->flags, MediaProducer::IsPlayingToExternalDevice) && flagsAreSet(state->flags, MediaProducer::IsPlayingVideo)) … … 513 509 514 510 if (stopTimer) { 515 ALWAYS_LOG (LOGIDENTIFIER, "stopping timer");511 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, "stopping timer"); 516 512 m_currentWatchdogInterval = { }; 517 513 m_watchdogTimer.stop(); … … 521 517 m_watchdogTimer.startOneShot(interval); 522 518 } 523 ALWAYS_LOG (LOGIDENTIFIER, "timer scheduled for ", interval.value(), " seconds");519 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__, "timer scheduled for ", interval.value(), " seconds"); 524 520 m_currentWatchdogInterval = interval; 525 521 } … … 531 527 return; 532 528 533 ALWAYS_LOG (LOGIDENTIFIER);529 ALWAYS_LOG_MEDIASESSIONMANAGER(__func__); 534 530 targetPicker().invalidatePlaybackTargets(); 535 531 } -
trunk/Source/WebCore/PAL/ChangeLog
r260712 r260717 1 2020-04-25 Alex Christensen <achristensen@webkit.org> 2 3 Move ApplePay code from WebKitAdditions to WebCore and WebKit 4 https://bugs.webkit.org/show_bug.cgi?id=210521 5 6 Reviewed by Andy Estes. 7 8 * pal/cocoa/PassKitSoftLink.h: 9 * pal/cocoa/PassKitSoftLink.mm: 10 * pal/spi/cocoa/PassKitSPI.h: 11 1 12 2020-04-25 Darin Adler <darin@apple.com> 2 13 -
trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h
r256648 r260717 40 40 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentMerchantSession) 41 41 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequest) 42 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentSetupConfiguration) 43 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentSetupController) 44 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentSetupFeature) 45 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentSetupRequest) 46 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentSetupViewController) 42 47 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentSummaryItem) 43 48 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKShippingMethod) 49 50 #if HAVE(PASSKIT_INSTALLMENTS) 51 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentInstallmentConfiguration) 52 #endif 44 53 45 54 #if PLATFORM(IOS_FAMILY) -
trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm
r256648 r260717 33 33 #if PLATFORM(MAC) 34 34 SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PAL_EXPORT) 35 #else 35 36 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, PassKit, PKPaymentSetupConfiguration, PAL_EXPORT) 37 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, PassKit, PKPaymentSetupController, PAL_EXPORT) 38 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, PassKit, PKPaymentSetupFeature, PAL_EXPORT) 39 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, PassKit, PKPaymentSetupRequest, PAL_EXPORT) 40 41 #if HAVE(PASSKIT_INSTALLMENTS) 42 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, PassKit, PKPaymentInstallmentConfiguration, PAL_EXPORT) 43 #endif 44 45 #else // PLATFORM(MAC) 46 36 47 SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PAL_EXPORT) 48 49 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentSetupConfiguration, PAL_EXPORT) 50 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentSetupController, PAL_EXPORT) 51 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentSetupFeature, PAL_EXPORT) 52 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentSetupRequest, PAL_EXPORT) 53 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentSetupViewController, PAL_EXPORT) 54 55 #if HAVE(PASSKIT_INSTALLMENTS) 56 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentInstallmentConfiguration, PAL_EXPORT) 37 57 #endif 58 59 #endif // PLATFORM(MAC) 38 60 39 61 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContact, PAL_EXPORT) -
trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h
r260366 r260717 46 46 #import <PassKit/PKPaymentMethod.h> 47 47 #import <PassKit/PKPaymentRequest_Private.h> 48 #import <PassKit/PKPaymentSetupConfiguration_WebKit.h> 49 #import <PassKit/PKPaymentSetupController.h> 50 #import <PassKit/PKPaymentSetupRequest.h> 48 51 #import <PassKitCore/PKPaymentRequestStatus_Private.h> 49 52 #import <PassKitCore/PKPaymentRequest_WebKit.h> 50 53 54 #if HAVE(PASSKIT_INSTALLMENTS) 55 #import <PassKitCore/PKPayment_Private.h> 56 #import <PassKitCore/PKPaymentInstallmentConfiguration.h> 57 #import <PassKitCore/PKPaymentMethod_Private.h> 58 #endif 59 51 60 #if PLATFORM(IOS_FAMILY) 52 61 #import <PassKit/PKPaymentAuthorizationController_Private.h> 62 #import <PassKit/PKPaymentSetupViewController.h> 63 #endif 64 65 #if HAVE(PASSKIT_INSTALLMENT_IDENTIFIERS) && PLATFORM(MAC) 66 @interface PKPaymentInstallmentConfiguration (WebKitSPI) 67 @property (nonatomic, copy, nullable) NSString *installmentMerchantIdentifier; 68 @property (nonatomic, copy, nullable) NSString *referrerIdentifier; 69 @end 53 70 #endif 54 71 -
trunk/Source/WebCore/SourcesCocoa.txt
r260561 r260717 596 596 Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp 597 597 Modules/applepay/ApplePayRequestBase.cpp 598 Modules/applepay/ApplePaySetup.cpp 599 Modules/applepay/ApplePaySetupFeature.mm 598 600 Modules/applepay/ApplePaySession.cpp 599 601 Modules/applepay/ApplePaySessionPaymentRequest.cpp … … 603 605 Modules/applepay/PaymentCoordinator.cpp 604 606 Modules/applepay/PaymentCoordinatorClient.cpp 607 Modules/applepay/PaymentInstallmentConfiguration.mm 605 608 Modules/applepay/PaymentRequestValidator.mm 606 609 Modules/applepay/PaymentSession.cpp … … 621 624 JSApplePayErrorCode.cpp 622 625 JSApplePayErrorContactField.cpp 626 JSApplePayInstallmentConfiguration.cpp 623 627 JSApplePayLineItem.cpp 624 628 JSApplePayMerchantCapability.cpp … … 638 642 JSApplePaySession.cpp 639 643 JSApplePaySessionError.cpp 644 JSApplePaySetup.cpp 645 JSApplePaySetupFeature.cpp 646 JSApplePaySetupFeatureType.cpp 640 647 JSApplePayShippingContactSelectedEvent.cpp 641 648 JSApplePayShippingContactUpdate.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r260712 r260717 1901 1901 5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */; }; 1902 1902 5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */; }; 1903 5C53DCE124465DFC00A93124 /* ApplePaySetupFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C53DCCF2446449900A93124 /* ApplePaySetupFeature.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1904 5C53DCE724468AD200A93124 /* PaymentInstallmentConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C53DCCE2446449900A93124 /* PaymentInstallmentConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1905 5C53DCEA24468FB400A93124 /* ApplePaySetup.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C53DCCB2446449800A93124 /* ApplePaySetup.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1903 1906 5C5D2385227A0652000B9BDA /* CustomHeaderFields.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C5D2383227A063A000B9BDA /* CustomHeaderFields.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1904 1907 5C7C88D81D0F1F4A009D2F6D /* SocketProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7C88D71D0F1F2B009D2F6D /* SocketProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 9092 9095 5C5381B31D87E08100E2EBE6 /* JSURLSearchParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSURLSearchParams.cpp; sourceTree = "<group>"; }; 9093 9096 5C5381B41D87E08100E2EBE6 /* JSURLSearchParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSURLSearchParams.h; sourceTree = "<group>"; }; 9097 5C53DCC62446449700A93124 /* ApplePaySetup.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ApplePaySetup.idl; sourceTree = "<group>"; }; 9098 5C53DCC92446449800A93124 /* ApplePaySetupFeature.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ApplePaySetupFeature.mm; sourceTree = "<group>"; }; 9099 5C53DCCA2446449800A93124 /* ApplePaySetupFeature.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ApplePaySetupFeature.idl; sourceTree = "<group>"; }; 9100 5C53DCCB2446449800A93124 /* ApplePaySetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplePaySetup.h; sourceTree = "<group>"; }; 9101 5C53DCCC2446449900A93124 /* PaymentInstallmentConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentInstallmentConfiguration.mm; sourceTree = "<group>"; }; 9102 5C53DCCE2446449900A93124 /* PaymentInstallmentConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaymentInstallmentConfiguration.h; sourceTree = "<group>"; }; 9103 5C53DCCF2446449900A93124 /* ApplePaySetupFeature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplePaySetupFeature.h; sourceTree = "<group>"; }; 9104 5C53DCD02446449A00A93124 /* ApplePayInstallmentConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplePayInstallmentConfiguration.h; sourceTree = "<group>"; }; 9105 5C53DCD22446449A00A93124 /* ApplePaySetup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplePaySetup.cpp; sourceTree = "<group>"; }; 9106 5C53DCD42446449B00A93124 /* ApplePaySetupFeatureType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplePaySetupFeatureType.h; sourceTree = "<group>"; }; 9107 5C53DCD52446449B00A93124 /* ApplePayInstallmentConfiguration.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ApplePayInstallmentConfiguration.idl; sourceTree = "<group>"; }; 9108 5C53DCD62446449C00A93124 /* ApplePaySetupFeatureType.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ApplePaySetupFeatureType.idl; sourceTree = "<group>"; }; 9094 9109 5C5D2383227A063A000B9BDA /* CustomHeaderFields.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomHeaderFields.h; sourceTree = "<group>"; }; 9095 9110 5C5D2386227A077C000B9BDA /* CustomHeaderFields.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomHeaderFields.cpp; sourceTree = "<group>"; }; … … 17312 17327 A1BB85A02159AF570067E07D /* ApplePayErrorContactField.h */, 17313 17328 A1BB85A22159AF570067E07D /* ApplePayErrorContactField.idl */, 17329 5C53DCD02446449A00A93124 /* ApplePayInstallmentConfiguration.h */, 17330 5C53DCD52446449B00A93124 /* ApplePayInstallmentConfiguration.idl */, 17314 17331 7C6579E21E00827000E3A27A /* ApplePayLineItem.h */, 17315 17332 7C6579E41E0082C800E3A27A /* ApplePayLineItem.idl */, … … 17349 17366 1A58E8631D19D4DF00C0EA73 /* ApplePaySessionPaymentRequest.cpp */, 17350 17367 1A58E8641D19D4DF00C0EA73 /* ApplePaySessionPaymentRequest.h */, 17368 5C53DCD22446449A00A93124 /* ApplePaySetup.cpp */, 17369 5C53DCCB2446449800A93124 /* ApplePaySetup.h */, 17370 5C53DCC62446449700A93124 /* ApplePaySetup.idl */, 17371 5C53DCCF2446449900A93124 /* ApplePaySetupFeature.h */, 17372 5C53DCCA2446449800A93124 /* ApplePaySetupFeature.idl */, 17373 5C53DCC92446449800A93124 /* ApplePaySetupFeature.mm */, 17374 5C53DCD42446449B00A93124 /* ApplePaySetupFeatureType.h */, 17375 5C53DCD62446449C00A93124 /* ApplePaySetupFeatureType.idl */, 17351 17376 1A8A64471D19FCFB00D0E00F /* ApplePayShippingContactSelectedEvent.cpp */, 17352 17377 1A8A64481D19FCFB00D0E00F /* ApplePayShippingContactSelectedEvent.h */, … … 17372 17397 1A58E8621D19D3BF00C0EA73 /* PaymentCoordinatorClient.h */, 17373 17398 7CF930E61E01F9AD00BAFFBE /* PaymentHeaders.h */, 17399 5C53DCCE2446449900A93124 /* PaymentInstallmentConfiguration.h */, 17400 5C53DCCC2446449900A93124 /* PaymentInstallmentConfiguration.mm */, 17374 17401 1AE96A871D1A0CEB00B86768 /* PaymentMerchantSession.h */, 17375 17402 1A8A64391D19FC5300D0E00F /* PaymentMethod.h */, … … 29488 29515 A1956F202331A8C70057E9D2 /* ApplePaySessionError.h in Headers */, 29489 29516 1A58E8651D19D4EB00C0EA73 /* ApplePaySessionPaymentRequest.h in Headers */, 29517 5C53DCEA24468FB400A93124 /* ApplePaySetup.h in Headers */, 29518 5C53DCE124465DFC00A93124 /* ApplePaySetupFeature.h in Headers */, 29490 29519 1A8A645C1D19FCFC00D0E00F /* ApplePayShippingContactSelectedEvent.h in Headers */, 29491 29520 A12C59F22035FCD60012236B /* ApplePayShippingContactUpdate.h in Headers */, … … 32213 32242 A1DF5AA61F7F64BB0058A477 /* PaymentHandler.h in Headers */, 32214 32243 7CF930E71E01F9B400BAFFBE /* PaymentHeaders.h in Headers */, 32244 5C53DCE724468AD200A93124 /* PaymentInstallmentConfiguration.h in Headers */, 32215 32245 A1F76B311F44C55A0014C318 /* PaymentItem.h in Headers */, 32216 32246 1AE96A891D1A0CEB00B86768 /* PaymentMerchantSession.h in Headers */, -
trunk/Source/WebCore/platform/cocoa/WebCoreAdditions.mm
r238739 r260717 25 25 26 26 #import "config.h" 27 28 #if USE(APPLE_INTERNAL_SDK)29 #import <WebKitAdditions/WebCoreAdditions.mm>30 #endif -
trunk/Source/WebKit/ChangeLog
r260712 r260717 1 2020-04-25 Alex Christensen <achristensen@webkit.org> 2 3 Move ApplePay code from WebKitAdditions to WebCore and WebKit 4 https://bugs.webkit.org/show_bug.cgi?id=210521 5 6 Reviewed by Andy Estes. 7 8 * DerivedSources.make: 9 * Scripts/webkit/messages.py: 10 * Shared/ApplePay/ApplePayPaymentSetupFeatures.h: Added. 11 (WebKit::PaymentSetupFeatures::platformFeatures const): 12 * Shared/ApplePay/ApplePayPaymentSetupFeatures.mm: Added. 13 (WebKit::PaymentSetupFeatures::PaymentSetupFeatures): 14 (WebKit::PaymentSetupFeatures::encode const): 15 (WebKit::PaymentSetupFeatures::decode): 16 (WebKit::PaymentSetupFeatures::operator Vector<Ref<WebCore::ApplePaySetupFeature>> const): 17 * Shared/ApplePay/PaymentSetupConfiguration.h: Added. 18 (WebKit::PaymentSetupConfiguration::platformConfiguration const): 19 * Shared/ApplePay/PaymentSetupConfiguration.mm: Added. 20 (WebKit::toPlatformConfiguration): 21 (WebKit::PaymentSetupConfiguration::PaymentSetupConfiguration): 22 (WebKit::PaymentSetupConfiguration::encode const): 23 (WebKit::PaymentSetupConfiguration::decode): 24 * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: 25 * Shared/ApplePay/WebPaymentCoordinatorProxy.h: 26 (WebKit::WebPaymentCoordinatorProxy::finishConstruction): Deleted. 27 * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: 28 * Shared/ApplePay/cocoa/PaymentSetupConfiguration.mm: Added. 29 (WebKitAdditions::toPlatformConfiguration): 30 (WebKitAdditions::PaymentSetupConfiguration::PaymentSetupConfiguration): 31 (WebKitAdditions::PaymentSetupConfiguration::encode const): 32 (WebKitAdditions::PaymentSetupConfiguration::decode): 33 * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: 34 (WebKit::finishCreating): 35 (WebKit::WebPaymentCoordinatorProxy::getSetupFeatures): 36 (WebKit::WebPaymentCoordinatorProxy::beginApplePaySetup): 37 (WebKit::WebPaymentCoordinatorProxy::endApplePaySetup): 38 (WebKit::WebPaymentCoordinatorProxy::platformBeginApplePaySetup): 39 (WebKit::WebPaymentCoordinatorProxy::platformEndApplePaySetup): 40 * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: 41 (IPC::finishDecoding): 42 (IPC::finishEncoding): 43 (IPC::ArgumentCoder<WebCore::PaymentInstallmentConfiguration>::encode): 44 (IPC::ArgumentCoder<WebCore::PaymentInstallmentConfiguration>::decode): 45 * SourcesCocoa.txt: 46 * WebKit.xcodeproj/project.pbxproj: 47 * WebProcess/ApplePay/WebPaymentCoordinator.cpp: 48 (WebKit::WebPaymentCoordinator::getSetupFeatures): 49 (WebKit::WebPaymentCoordinator::beginApplePaySetup): 50 (WebKit::WebPaymentCoordinator::endApplePaySetup): 51 * WebProcess/ApplePay/WebPaymentCoordinator.h: 52 1 53 2020-04-25 Darin Adler <darin@apple.com> 2 54 -
trunk/Source/WebKit/DerivedSources.make
r260102 r260717 254 254 HEADER_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(HEADER_SEARCH_PATHS) $(SYSTEM_HEADER_SEARCH_PATHS) | perl -e 'print "-I" . join(" -I", split(" ", <>));') 255 255 256 -include WebKitDerivedSourcesAdditions.make257 258 256 .PHONY : all 259 257 -
trunk/Source/WebKit/Scripts/webkit/messages.py
r260381 r260717 645 645 'WebKit::LayerHostingMode': ['"LayerTreeContext.h"'], 646 646 'WebKit::PageState': ['"SessionState.h"'], 647 'WebKit::PaymentSetupFeatures': ['"ApplePayPaymentSetupFeatures.h"'], 647 648 'WebKit::RespectSelectionAnchor': ['"GestureTypes.h"'], 648 649 'WebKit::WebGestureEvent': ['"WebEvent.h"'], -
trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp
r256083 r260717 46 46 } 47 47 48 WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy(WebPaymentCoordinatorProxy::Client& client)49 : m_client { client }50 , m_canMakePaymentsQueue { WorkQueue::create("com.apple.WebKit.CanMakePayments") }51 {52 m_client.paymentCoordinatorAddMessageReceiver(*this, Messages::WebPaymentCoordinatorProxy::messageReceiverName(), *this);53 finishConstruction(*this);54 }55 56 WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy()57 {58 if (m_state != State::Idle)59 hidePaymentUI();60 61 m_client.paymentCoordinatorRemoveMessageReceiver(*this, Messages::WebPaymentCoordinatorProxy::messageReceiverName());62 }63 64 48 IPC::Connection* WebPaymentCoordinatorProxy::messageSenderConnection() const 65 49 { -
trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h
r250287 r260717 35 35 #include <wtf/Forward.h> 36 36 #include <wtf/RetainPtr.h> 37 #include <wtf/WeakObjCPtr.h> 37 38 #include <wtf/WeakPtr.h> 38 39 #include <wtf/WorkQueue.h> 39 40 40 #if USE(APPLE_INTERNAL_SDK) 41 #include <WebKitAdditions/WebPaymentCoordinatorProxyAdditions.h> 41 #if HAVE(PASSKIT_PAYMENT_SETUP) 42 OBJC_CLASS PKPaymentSetupViewController; 43 OBJC_CLASS UIViewController; 42 44 #endif 43 45 … … 61 63 OBJC_CLASS UIViewController; 62 64 65 #if PLATFORM(IOS) 66 OBJC_CLASS PKPaymentSetupViewController; 67 #endif 68 63 69 namespace WebKit { 64 70 71 class PaymentSetupConfiguration; 72 class PaymentSetupFeatures; 65 73 class WebPageProxy; 66 74 … … 125 133 void cancelPaymentSession(); 126 134 135 #if HAVE(PASSKIT_PAYMENT_SETUP) 136 void getSetupFeatures(const PaymentSetupConfiguration&, CompletionHandler<void(const PaymentSetupFeatures&)>&&); 137 void beginApplePaySetup(const PaymentSetupConfiguration&, const PaymentSetupFeatures&, CompletionHandler<void(bool)>&&); 138 void endApplePaySetup(); 139 void platformBeginApplePaySetup(const PaymentSetupConfiguration&, const PaymentSetupFeatures&, CompletionHandler<void(bool)>&&); 140 void platformEndApplePaySetup(); 141 #endif 142 127 143 bool canBegin() const; 128 144 bool canCancel() const; … … 192 208 RetainPtr<NSObject> m_sheetWindowWillCloseObserver; 193 209 #endif 194 195 #if defined(WEBPAYMENTCOORDINATORPROXY_ADDITIONS) 196 WEBPAYMENTCOORDINATORPROXY_ADDITIONS 197 #undef WEBPAYMENTCOORDINATORPROXY_ADDITIONS 198 #else 199 void finishConstruction(WebPaymentCoordinatorProxy&) { } 210 #if PLATFORM(IOS) 211 WeakObjCPtr<PKPaymentSetupViewController> m_paymentSetupViewController; 200 212 #endif 201 213 }; -
trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in
r252655 r260717 39 39 AbortPaymentSession() 40 40 CancelPaymentSession() 41 #if HAVE(PASSKIT_PAYMENT_SETUP) 42 GetSetupFeatures(WebKit::PaymentSetupConfiguration configuration) -> (WebKit::PaymentSetupFeatures features) Async 43 BeginApplePaySetup(WebKit::PaymentSetupConfiguration configuration, WebKit::PaymentSetupFeatures features) -> (bool result) Async 44 EndApplePaySetup() 45 #endif 41 46 } 42 47 -
trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
r260485 r260717 31 31 #import "WKPaymentAuthorizationDelegate.h" 32 32 #import "WebPaymentCoordinatorProxy.h" 33 #import "WebPaymentCoordinatorProxyMessages.h" 33 34 #import <WebCore/PaymentAuthorizationStatus.h> 34 35 #import <WebCore/PaymentHeaders.h> … … 38 39 #import <wtf/cocoa/VectorCocoa.h> 39 40 41 #if HAVE(PASSKIT_PAYMENT_SETUP) 42 #import "APIUIClient.h" 43 #import "ApplePayPaymentSetupFeatures.h" 44 #import "PaymentSetupConfiguration.h" 45 #import "WebPageProxy.h" 46 #import "WebProcessProxy.h" 47 #endif 48 40 49 #import <pal/cocoa/PassKitSoftLink.h> 41 42 #if USE(APPLE_INTERNAL_SDK)43 #import <WebKitAdditions/WebPaymentCoordinatorProxyCocoaAdditions.mm>44 #else45 namespace WebKit {46 static void finishCreating(PKPaymentRequest *, const WebCore::ApplePaySessionPaymentRequest&) { }47 }48 #endif49 50 50 51 // FIXME: We don't support any platforms without -setThumbnailURLs:, so this can be removed. … … 61 62 62 63 namespace WebKit { 64 65 static void finishCreating(PKPaymentRequest *platformRequest, const WebCore::ApplePaySessionPaymentRequest& request) 66 { 67 #if HAVE(PASSKIT_INSTALLMENTS) 68 if (PKPaymentInstallmentConfiguration *configuration = request.installmentConfiguration().platformConfiguration()) { 69 platformRequest.installmentConfiguration = configuration; 70 platformRequest.requestType = PKPaymentRequestTypeInstallment; 71 } 72 #else 73 UNUSED_PARAM(platformRequest); 74 UNUSED_PARAM(request); 75 #endif 76 } 77 78 WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy(WebPaymentCoordinatorProxy::Client& client) 79 : m_client(client) 80 , m_canMakePaymentsQueue(WorkQueue::create("com.apple.WebKit.CanMakePayments")) 81 { 82 m_client.paymentCoordinatorAddMessageReceiver(*this, Messages::WebPaymentCoordinatorProxy::messageReceiverName(), *this); 83 } 84 85 WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy() 86 { 87 if (m_state != State::Idle) 88 hidePaymentUI(); 89 90 m_client.paymentCoordinatorRemoveMessageReceiver(*this, Messages::WebPaymentCoordinatorProxy::messageReceiverName()); 91 } 63 92 64 93 void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler) … … 271 300 } 272 301 302 #if HAVE(PASSKIT_PAYMENT_SETUP) 303 304 void WebPaymentCoordinatorProxy::getSetupFeatures(const PaymentSetupConfiguration& configuration, Messages::WebPaymentCoordinatorProxy::GetSetupFeatures::AsyncReply&& reply) 305 { 306 #if PLATFORM(MAC) 307 if (!PAL::getPKPaymentSetupControllerClass()) { 308 reply({ }); 309 return; 310 } 311 #endif 312 313 auto completion = makeBlockPtr([reply = WTFMove(reply)](NSArray<PKPaymentSetupFeature *> *features) mutable { 314 RunLoop::main().dispatch([reply = WTFMove(reply), features = retainPtr(features)]() mutable { 315 reply(PaymentSetupFeatures { WTFMove(features) }); 316 }); 317 }); 318 319 ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN 320 [PAL::getPKPaymentSetupControllerClass() paymentSetupFeaturesForConfiguration:configuration.platformConfiguration() completion:completion.get()]; 321 ALLOW_NEW_API_WITHOUT_GUARDS_END 322 } 323 324 void WebPaymentCoordinatorProxy::beginApplePaySetup(const PaymentSetupConfiguration& configuration, const PaymentSetupFeatures& features, Messages::WebPaymentCoordinatorProxy::BeginApplePaySetup::AsyncReply&& reply) 325 { 326 platformBeginApplePaySetup(configuration, features, WTFMove(reply)); 327 } 328 329 void WebPaymentCoordinatorProxy::endApplePaySetup() 330 { 331 platformEndApplePaySetup(); 332 } 333 334 #if PLATFORM(MAC) 335 336 void WebPaymentCoordinatorProxy::platformBeginApplePaySetup(const PaymentSetupConfiguration& configuration, const PaymentSetupFeatures& features, Messages::WebPaymentCoordinatorProxy::BeginApplePaySetup::AsyncReply&& reply) 337 { 338 if (!PAL::getPKPaymentSetupRequestClass()) { 339 reply(false); 340 return; 341 } 342 343 auto request = adoptNS([PAL::allocPKPaymentSetupRequestInstance() init]); 344 [request setConfiguration:configuration.platformConfiguration()]; 345 [request setPaymentSetupFeatures:features.platformFeatures()]; 346 347 auto completion = makeBlockPtr([reply = WTFMove(reply)](BOOL success) mutable { 348 RunLoop::main().dispatch([reply = WTFMove(reply), success]() mutable { 349 reply(success); 350 }); 351 }); 352 353 auto paymentSetupController = adoptNS([PAL::allocPKPaymentSetupControllerInstance() init]); 354 355 ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN 356 [paymentSetupController presentPaymentSetupRequest:request.get() completion:completion.get()]; 357 ALLOW_NEW_API_WITHOUT_GUARDS_END 358 } 359 360 void WebPaymentCoordinatorProxy::platformEndApplePaySetup() 361 { 362 } 363 364 #else // PLATFORM(MAC) 365 366 void WebPaymentCoordinatorProxy::platformBeginApplePaySetup(const PaymentSetupConfiguration& configuration, const PaymentSetupFeatures& features, Messages::WebPaymentCoordinatorProxy::BeginApplePaySetup::AsyncReply&& reply) 367 { 368 UIViewController *presentingViewController = m_paymentCoordinatorProxy.m_client.paymentCoordinatorPresentingViewController(m_paymentCoordinatorProxy); 369 if (!presentingViewController) { 370 reply(false); 371 return; 372 } 373 374 auto request = adoptNS([PAL::allocPKPaymentSetupRequestInstance() init]); 375 [request setConfiguration:configuration.platformConfiguration()]; 376 [request setPaymentSetupFeatures:features.platformFeatures()]; 377 378 auto paymentSetupViewController = adoptNS([PAL::allocPKPaymentSetupViewControllerInstance() initWithPaymentSetupRequest:request.get()]); 379 if (!paymentSetupViewController) { 380 reply(false); 381 return; 382 } 383 384 auto completion = makeBlockPtr([reply = WTFMove(reply)]() mutable { 385 RunLoop::main().dispatch([reply = WTFMove(reply)]() mutable { 386 reply(true); 387 }); 388 }); 389 390 endApplePaySetup(); 391 [presentingViewController presentViewController:paymentSetupViewController.get() animated:YES completion:completion.get()]; 392 m_paymentSetupViewController = paymentSetupViewController.get(); 393 } 394 395 void WebPaymentCoordinatorProxy::platformEndApplePaySetup() 396 { 397 [m_paymentSetupViewController dismissViewControllerAnimated:YES completion:nil]; 398 m_paymentSetupViewController = nil; 399 } 400 401 #endif // PLATFORM(MAC) 402 403 #endif // HAVE(PASSKIT_PAYMENT_SETUP) 404 273 405 } // namespace WebKit 274 406 -
trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
r255784 r260717 42 42 #endif 43 43 44 #if USE(APPLE_INTERNAL_SDK)45 #import <WebKitAdditions/WebCoreArgumentCodersCocoaAdditions.mm>46 #elif ENABLE(APPLE_PAY)47 namespace IPC {48 static bool finishDecoding(Decoder&, WebCore::ApplePaySessionPaymentRequest&) { return true; }49 static void finishEncoding(Encoder&, const WebCore::ApplePaySessionPaymentRequest&) { }50 }51 #endif52 53 44 namespace IPC { 54 45 using namespace WebCore; 55 46 56 47 #if ENABLE(APPLE_PAY) 48 49 static bool finishDecoding(Decoder& decoder, WebCore::ApplePaySessionPaymentRequest& request) 50 { 51 #if ENABLE(APPLE_PAY_INSTALLMENTS) 52 Optional<WebCore::PaymentInstallmentConfiguration> installmentConfiguration; 53 decoder >> installmentConfiguration; 54 if (!installmentConfiguration) 55 return false; 56 57 request.setInstallmentConfiguration(WTFMove(*installmentConfiguration)); 58 return true; 59 #else 60 UNUSED_PARAM(decoder); 61 UNUSED_PARAM(request); 62 return true; 63 #endif 64 } 65 66 static void finishEncoding(Encoder& encoder, const WebCore::ApplePaySessionPaymentRequest& request) 67 { 68 #if ENABLE(APPLE_PAY_INSTALLMENTS) 69 encoder << request.installmentConfiguration(); 70 #else 71 UNUSED_PARAM(encoder); 72 UNUSED_PARAM(request); 73 #endif 74 } 75 76 #if HAVE(PASSKIT_INSTALLMENTS) 77 78 void ArgumentCoder<WebCore::PaymentInstallmentConfiguration>::encode(Encoder& encoder, const WebCore::PaymentInstallmentConfiguration& configuration) 79 { 80 encoder << configuration.platformConfiguration(); 81 } 82 83 Optional<WebCore::PaymentInstallmentConfiguration> ArgumentCoder<WebCore::PaymentInstallmentConfiguration>::decode(Decoder& decoder) 84 { 85 auto configuration = IPC::decode<PKPaymentInstallmentConfiguration>(decoder, PAL::getPKPaymentInstallmentConfigurationClass()); 86 if (!configuration) 87 return WTF::nullopt; 88 89 return { WTFMove(*configuration) }; 90 } 91 92 #endif // HAVE(PASSKIT_INSTALLMENTS) 57 93 58 94 void ArgumentCoder<WebCore::Payment>::encode(Encoder& encoder, const WebCore::Payment& payment) -
trunk/Source/WebKit/SourcesCocoa.txt
r260182 r260717 123 123 Shared/API/Cocoa/WKRemoteObjectCoder.mm 124 124 125 Shared/ApplePay/ApplePayPaymentSetupFeatures.mm 126 Shared/ApplePay/PaymentSetupConfiguration.mm 125 127 Shared/ApplePay/WebPaymentCoordinatorProxy.cpp 126 128 Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r260712 r260717 4028 4028 5C46C0AE21B71AE200BC5991 /* _WKWebsiteDataStoreConfigurationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsiteDataStoreConfigurationInternal.h; sourceTree = "<group>"; }; 4029 4029 5C4B9D8A210A8C46008F14D1 /* UndoOrRedo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UndoOrRedo.h; sourceTree = "<group>"; }; 4030 5C53DCDD24465BF900A93124 /* ApplePayPaymentSetupFeatures.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ApplePayPaymentSetupFeatures.mm; sourceTree = "<group>"; }; 4031 5C53DCDE24465BF900A93124 /* PaymentSetupConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaymentSetupConfiguration.h; sourceTree = "<group>"; }; 4032 5C53DCDF24465BF900A93124 /* ApplePayPaymentSetupFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplePayPaymentSetupFeatures.h; sourceTree = "<group>"; }; 4033 5C53DCE024465BF900A93124 /* PaymentSetupConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentSetupConfiguration.mm; sourceTree = "<group>"; }; 4030 4034 5C5CEC382209583200D6BBB0 /* DaemonEntryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DaemonEntryPoint.h; sourceTree = "<group>"; }; 4031 4035 5C5CEC392209583200D6BBB0 /* DaemonEntryPoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DaemonEntryPoint.mm; sourceTree = "<group>"; }; … … 6265 6269 1AB1F77A1D1B30A9007C9BD1 /* ios */, 6266 6270 1AB1F77C1D1B30A9007C9BD1 /* mac */, 6271 5C53DCDF24465BF900A93124 /* ApplePayPaymentSetupFeatures.h */, 6272 5C53DCDD24465BF900A93124 /* ApplePayPaymentSetupFeatures.mm */, 6273 5C53DCDE24465BF900A93124 /* PaymentSetupConfiguration.h */, 6274 5C53DCE024465BF900A93124 /* PaymentSetupConfiguration.mm */, 6267 6275 1AB1F7881D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.cpp */, 6268 6276 1AB1F7891D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h */, -
trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp
r254015 r260717 29 29 #if ENABLE(APPLE_PAY) 30 30 31 #include "ApplePayPaymentSetupFeatures.h" 31 32 #include "DataReference.h" 33 #include "PaymentSetupConfiguration.h" 32 34 #include "WebCoreArgumentCoders.h" 33 35 #include "WebPage.h" … … 221 223 #endif 222 224 223 } 224 225 #endif 225 #if ENABLE(APPLE_PAY_SETUP) 226 227 void WebPaymentCoordinator::getSetupFeatures(const WebCore::ApplePaySetup::Configuration& configuration, const URL& url, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&& completionHandler) 228 { 229 m_webPage.sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::GetSetupFeatures(PaymentSetupConfiguration { configuration, url }), WTFMove(completionHandler)); 230 } 231 232 void WebPaymentCoordinator::beginApplePaySetup(const WebCore::ApplePaySetup::Configuration& configuration, const URL& url, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&& features, CompletionHandler<void(bool)>&& completionHandler) 233 { 234 m_webPage.sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::BeginApplePaySetup(PaymentSetupConfiguration { configuration, url }, PaymentSetupFeatures { WTFMove(features) }), WTFMove(completionHandler)); 235 } 236 237 void WebPaymentCoordinator::endApplePaySetup() 238 { 239 m_webPage.send(Messages::WebPaymentCoordinatorProxy::EndApplePaySetup()); 240 } 241 242 #endif // ENABLE(APPLE_PAY_SETUP) 243 244 } 245 246 #endif -
trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h
r254015 r260717 86 86 String userAgentScriptsBlockedErrorMessage() const final; 87 87 88 #if ENABLE(APPLE_PAY_SETUP) 89 void getSetupFeatures(const WebCore::ApplePaySetup::Configuration&, const URL&, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&&) final; 90 void beginApplePaySetup(const WebCore::ApplePaySetup::Configuration&, const URL&, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&) final; 91 void endApplePaySetup() final; 92 #endif 93 88 94 // IPC::MessageReceiver. 89 95 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; … … 113 119 114 120 Optional<AvailablePaymentNetworksSet> m_availablePaymentNetworks; 115 116 #if USE(APPLE_INTERNAL_SDK)117 #import <WebKitAdditions/WebPaymentCoordinatorAdditions.h>118 #endif119 121 }; 120 122
Note: See TracChangeset
for help on using the changeset viewer.