Revert r261858
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 May 2020 16:14:48 +0000 (16:14 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 May 2020 16:14:48 +0000 (16:14 +0000)
Breaks Apple internal SDK Debug builds.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261864 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https-expected.txt [deleted file]
LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https.html [deleted file]
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/DerivedSources-input.xcfilelist
Source/WebCore/DerivedSources-output.xcfilelist
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/applepay/ApplePaySetup.cpp
Source/WebCore/Modules/applepay/ApplePaySetup.idl
Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.h [deleted file]
Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.idl [deleted file]
Source/WebCore/Modules/applepay/ApplePaySetupFeature.idl
Source/WebCore/Modules/applepay/ApplePaySetupFeature.mm
Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.h [deleted file]
Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.idl [deleted file]
Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl
Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h
Source/WebCore/Modules/applepay/ApplePaySetupWebCore.h
Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
Source/WebCore/Modules/applepay/PaymentCoordinator.h
Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/testing/MockApplePaySetupFeature.cpp [deleted file]
Source/WebCore/testing/MockApplePaySetupFeature.h [deleted file]
Source/WebCore/testing/MockPaymentCoordinator.cpp
Source/WebCore/testing/MockPaymentCoordinator.h
Source/WebCore/testing/MockPaymentCoordinator.idl
Source/WebKit/Shared/ApplePay/PaymentSetupConfiguration.mm
Source/WebKit/Shared/ApplePay/PaymentSetupConfigurationWebKit.h
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h

diff --git a/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https-expected.txt b/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https-expected.txt
deleted file mode 100644 (file)
index 3235845..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Test ApplePaySetup.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS internals.mockPaymentCoordinator.setupConfiguration.merchantIdentifier is expectedMerchantIdentifier
-PASS internals.mockPaymentCoordinator.setupConfiguration.referrerIdentifier is expectedReferrerIdentifier
-PASS internals.mockPaymentCoordinator.setupConfiguration.signature is expectedSignature
-PASS typeof internals.mockPaymentCoordinator.setupConfiguration.signedFields is "object"
-PASS internals.mockPaymentCoordinator.setupConfiguration.signedFields.length is expectedSignedFields.length
-PASS internals.mockPaymentCoordinator.setupConfiguration.signedFields[0] is expectedSignedFields[0]
-PASS typeof features is "object"
-PASS features.length is 1
-PASS features[0].state is expectedSetupFeatureState
-PASS features[0].type is expectedSetupFeatureType
-PASS features[0].supportsInstallments is expectedSetupFeatureSupportsInstallments
-PASS internals.mockPaymentCoordinator.setupConfiguration.merchantIdentifier is expectedMerchantIdentifier
-PASS internals.mockPaymentCoordinator.setupConfiguration.referrerIdentifier is expectedReferrerIdentifier
-PASS internals.mockPaymentCoordinator.setupConfiguration.signature is expectedSignature
-PASS typeof internals.mockPaymentCoordinator.setupConfiguration.signedFields is "object"
-PASS internals.mockPaymentCoordinator.setupConfiguration.signedFields.length is expectedSignedFields.length
-PASS internals.mockPaymentCoordinator.setupConfiguration.signedFields[0] is expectedSignedFields[0]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https.html b/LayoutTests/http/tests/ssl/applepay/ApplePaySetup.https.html
deleted file mode 100644 (file)
index 97aaf3a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="/js-test-resources/ui-helper.js"></script>
-<script src="/resources/js-test-pre.js"></script>
-<script src="/resources/payment-request.js"></script>
-</head>
-<body>
-<script>
-
-description("Test ApplePaySetup.");
-
-window.jsTestIsAsync = true;
-
-expectedMerchantIdentifier = 'merchant';
-expectedReferrerIdentifier = 'referrer';
-expectedSignature = 'signature';
-expectedSignedFields = ['field1'];
-expectedSetupFeatureState = 'supported';
-expectedSetupFeatureType = 'appleCard';
-expectedSetupFeatureSupportsInstallments = true;
-
-testSetupConfiguration = () => {
-    shouldBe('internals.mockPaymentCoordinator.setupConfiguration.merchantIdentifier', 'expectedMerchantIdentifier');
-    shouldBe('internals.mockPaymentCoordinator.setupConfiguration.referrerIdentifier', 'expectedReferrerIdentifier');
-    shouldBe('internals.mockPaymentCoordinator.setupConfiguration.signature', 'expectedSignature');
-    shouldBe('typeof internals.mockPaymentCoordinator.setupConfiguration.signedFields', '"object"');
-    shouldBe('internals.mockPaymentCoordinator.setupConfiguration.signedFields.length', 'expectedSignedFields.length');
-    shouldBe('internals.mockPaymentCoordinator.setupConfiguration.signedFields[0]', 'expectedSignedFields[0]');
-}
-
-(async () => {
-
-    let setup = new ApplePaySetup({
-        merchantIdentifier: expectedMerchantIdentifier,
-        referrerIdentifier: expectedReferrerIdentifier,
-        signature: expectedSignature,
-        signedFields: expectedSignedFields,
-    });
-
-    internals.mockPaymentCoordinator.addSetupFeature(expectedSetupFeatureState, expectedSetupFeatureType, expectedSetupFeatureSupportsInstallments);
-
-    features = await setup.getSetupFeatures();
-    testSetupConfiguration();
-    shouldBe('typeof features', '"object"');
-    shouldBe('features.length', '1');
-    shouldBe('features[0].state', 'expectedSetupFeatureState');
-    shouldBe('features[0].type', 'expectedSetupFeatureType');
-    shouldBe('features[0].supportsInstallments', 'expectedSetupFeatureSupportsInstallments');
-
-    activateThen(async () => {
-        let success = await setup.begin(features);
-        testSetupConfiguration();
-        finishJSTest();
-    });
-
-})();
-</script>
-<script src="/resources/js-test-post.js"></script>
-</body>
-</html>
index fab9a8d..a6704af 100644 (file)
@@ -36,9 +36,8 @@ fast/media/mq-prefers-reduced-motion-live-update.html [ Pass ]
 
 http/tests/ssl/applepay/ [ Pass ]
 
-# ApplePayInstallmentConfiguration and ApplePaySetup were first available in Catalina.
+# ApplePayInstallmentConfiguration was first available in Catalina.
 [ Mojave ] http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html [ Skip ]
-[ Mojave ] http/tests/ssl/applepay/ApplePaySetup.https.html [ Skip ]
 
 fast/visual-viewport/rubberbanding-viewport-rects.html [ Pass ]
 fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html  [ Pass ]
index 7fa9478..5a8da6a 100644 (file)
@@ -41,9 +41,7 @@ $(PROJECT_DIR)/Modules/applepay/ApplePayRequestBase.idl
 $(PROJECT_DIR)/Modules/applepay/ApplePaySession.idl
 $(PROJECT_DIR)/Modules/applepay/ApplePaySessionError.idl
 $(PROJECT_DIR)/Modules/applepay/ApplePaySetup.idl
-$(PROJECT_DIR)/Modules/applepay/ApplePaySetupConfiguration.idl
 $(PROJECT_DIR)/Modules/applepay/ApplePaySetupFeature.idl
-$(PROJECT_DIR)/Modules/applepay/ApplePaySetupFeatureState.idl
 $(PROJECT_DIR)/Modules/applepay/ApplePaySetupFeatureType.idl
 $(PROJECT_DIR)/Modules/applepay/ApplePayShippingContactSelectedEvent.idl
 $(PROJECT_DIR)/Modules/applepay/ApplePayShippingContactUpdate.idl
@@ -1135,7 +1133,6 @@ $(PROJECT_DIR)/testing/InternalsMapLike.idl
 $(PROJECT_DIR)/testing/InternalsSetLike.idl
 $(PROJECT_DIR)/testing/MallocStatistics.idl
 $(PROJECT_DIR)/testing/MemoryInfo.idl
-$(PROJECT_DIR)/testing/MockApplePaySetupFeature.idl
 $(PROJECT_DIR)/testing/MockCDMFactory.idl
 $(PROJECT_DIR)/testing/MockContentFilterSettings.idl
 $(PROJECT_DIR)/testing/MockPageOverlay.idl
index 2545157..f3e9762 100644 (file)
@@ -115,12 +115,8 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySessionError.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySessionError.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetup.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetup.h
-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupConfiguration.cpp
-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupConfiguration.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeature.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeature.h
-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeatureState.cpp
-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeatureState.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeatureType.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePaySetupFeatureType.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSApplePayShippingContactSelectedEvent.cpp
@@ -1090,8 +1086,6 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMessageEvent.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMessageEvent.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMessagePort.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMessagePort.h
-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockApplePaySetupFeature.cpp
-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockApplePaySetupFeature.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockCDMFactory.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockCDMFactory.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSMockContentFilterSettings.cpp
index e3dc345..2a3ef90 100644 (file)
@@ -120,9 +120,7 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/applepay/ApplePaySession.idl \
     $(WebCore)/Modules/applepay/ApplePaySessionError.idl \
     $(WebCore)/Modules/applepay/ApplePaySetup.idl \
-       $(WebCore)/Modules/applepay/ApplePaySetupConfiguration.idl \
     $(WebCore)/Modules/applepay/ApplePaySetupFeature.idl \
-       $(WebCore)/Modules/applepay/ApplePaySetupFeatureState.idl \
     $(WebCore)/Modules/applepay/ApplePaySetupFeatureType.idl \
     $(WebCore)/Modules/applepay/ApplePayShippingContactSelectedEvent.idl \
     $(WebCore)/Modules/applepay/ApplePayShippingContactUpdate.idl \
index cfc0ddd..e8c2b1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -76,7 +76,7 @@ void ApplePaySetup::getSetupFeatures(Document& document, SetupFeaturesPromise&&
 
     m_setupFeaturesPromise = WTFMove(promise);
 
-    page->paymentCoordinator().getSetupFeatures(m_configuration, document.url(), [this, pendingActivity = makePendingActivity(*this)](Vector<Ref<ApplePaySetupFeature>>&& setupFeatures) {
+    page->paymentCoordinator().client().getSetupFeatures(m_configuration, document.url(), [this, pendingActivity = makePendingActivity(*this)](Vector<Ref<ApplePaySetupFeature>>&& setupFeatures) {
         if (m_setupFeaturesPromise)
             std::exchange(m_setupFeaturesPromise, WTF::nullopt)->settle(WTFMove(setupFeatures));
     });
@@ -109,13 +109,13 @@ void ApplePaySetup::begin(Document& document, Vector<RefPtr<ApplePaySetupFeature
     m_beginPromise = WTFMove(promise);
     m_pendingActivity = makePendingActivity(*this);
 
-    page->paymentCoordinator().beginApplePaySetup(m_configuration, document.url(), WTFMove(features), [this](bool result) {
+    page->paymentCoordinator().client().beginApplePaySetup(m_configuration, document.url(), WTFMove(features), [this](bool result) {
         if (m_beginPromise)
             std::exchange(m_beginPromise, WTF::nullopt)->settle(result);
     });
 }
 
-ApplePaySetup::ApplePaySetup(ScriptExecutionContext& context, ApplePaySetupConfiguration&& configuration)
+ApplePaySetup::ApplePaySetup(ScriptExecutionContext& context, Configuration&& configuration)
     : ActiveDOMObject(&context)
     , m_configuration(WTFMove(configuration))
 {
@@ -131,7 +131,7 @@ void ApplePaySetup::stop()
         std::exchange(m_beginPromise, WTF::nullopt)->settle(Exception { AbortError });
 
     if (auto page = downcast<Document>(*scriptExecutionContext()).page())
-        page->paymentCoordinator().endApplePaySetup();
+        page->paymentCoordinator().client().endApplePaySetup();
 
     m_pendingActivity = nullptr;
 }
index 4cc43ad..57a465b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  */
 
 [
+    Conditional=APPLE_PAY_SETUP,
+] dictionary ApplePaySetupConfiguration {
+    DOMString merchantIdentifier;
+    DOMString referrerIdentifier;
+    DOMString signature;
+    sequence<DOMString> signedFields;
+};
+
+[
     ActiveDOMObject,
     Conditional=APPLE_PAY_SETUP,
     Constructor(ApplePaySetupConfiguration configuration),
diff --git a/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.h b/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.h
deleted file mode 100644 (file)
index 4493580..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(APPLE_PAY_SETUP)
-
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-struct ApplePaySetupConfiguration {
-    String merchantIdentifier;
-    String referrerIdentifier;
-    String signature;
-    Vector<String> signedFields;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(APPLE_PAY_SETUP)
diff --git a/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.idl b/Source/WebCore/Modules/applepay/ApplePaySetupConfiguration.idl
deleted file mode 100644 (file)
index 81e3b5b..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=APPLE_PAY_SETUP,
-    ExportMacro=WEBCORE_EXPORT,
-    JSGenerateToJSObject,
-] dictionary ApplePaySetupConfiguration {
-    DOMString merchantIdentifier;
-    DOMString referrerIdentifier;
-    DOMString signature;
-    sequence<DOMString> signedFields;
-};
index 4d62d12..516dbbc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 [
     Conditional=APPLE_PAY_SETUP,
+] enum ApplePaySetupFeatureState {
+    "unsupported",
+    "supported",
+    "supplementarySupported",
+    "completed"
+};
+
+[
+    Conditional=APPLE_PAY_SETUP,
     EnabledBySetting=ApplePay,
-    ExportMacro=WEBCORE_EXPORT,
+    ImplementationLacksVTable,
     SecureContext,
-    SkipVTableValidation,
 ] interface ApplePaySetupFeature {
     [CachedAttribute] readonly attribute ApplePaySetupFeatureType type;
     [CachedAttribute] readonly attribute ApplePaySetupFeatureState state;
index d677b07..586a0aa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #if ENABLE(APPLE_PAY_SETUP)
 
-#import "ApplePaySetupFeatureState.h"
 #import "ApplePaySetupFeatureTypeWebCore.h"
 #import <pal/spi/cocoa/PassKitSPI.h>
 
 namespace WebCore {
 
-ApplePaySetupFeature::ApplePaySetupFeature() = default;
-ApplePaySetupFeature::~ApplePaySetupFeature() = default;
-
 ApplePaySetupFeatureType ApplePaySetupFeature::type() const
 {
     switch ([m_feature type]) {
@@ -49,17 +45,17 @@ ApplePaySetupFeatureType ApplePaySetupFeature::type() const
     }
 }
 
-ApplePaySetupFeatureState ApplePaySetupFeature::state() const
+ApplePaySetupFeature::State ApplePaySetupFeature::state() const
 {
     switch ([m_feature state]) {
     case PKPaymentSetupFeatureStateUnsupported:
-        return ApplePaySetupFeatureState::Unsupported;
+        return State::Unsupported;
     case PKPaymentSetupFeatureStateSupported:
-        return ApplePaySetupFeatureState::Supported;
+        return State::Supported;
     case PKPaymentSetupFeatureStateSupplementarySupported:
-        return ApplePaySetupFeatureState::SupplementarySupported;
+        return State::SupplementarySupported;
     case PKPaymentSetupFeatureStateCompleted:
-        return ApplePaySetupFeatureState::Completed;
+        return State::Completed;
     }
 }
 
diff --git a/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.h b/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.h
deleted file mode 100644 (file)
index c5fa164..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(APPLE_PAY_SETUP)
-
-namespace WebCore {
-
-enum class ApplePaySetupFeatureState : uint8_t {
-    Unsupported,
-    Supported,
-    SupplementarySupported,
-    Completed,
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(APPLE_PAY_SETUP)
diff --git a/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.idl b/Source/WebCore/Modules/applepay/ApplePaySetupFeatureState.idl
deleted file mode 100644 (file)
index 772b311..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=APPLE_PAY_SETUP,
-    ExportMacro=WEBCORE_EXPORT,
-] enum ApplePaySetupFeatureState {
-    "unsupported",
-    "supported",
-    "supplementarySupported",
-    "completed"
-};
index 53a6182..a4961ad 100644 (file)
@@ -25,7 +25,6 @@
 
 [
     Conditional=APPLE_PAY_SETUP,
-    ExportMacro=WEBCORE_EXPORT,
 ] enum ApplePaySetupFeatureType {
     "applePay",
     "appleCard"
index d85ef06..15c1152 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,7 +34,6 @@ OBJC_CLASS PKPaymentSetupFeature;
 
 namespace WebCore {
 
-enum class ApplePaySetupFeatureState : uint8_t;
 enum class ApplePaySetupFeatureType : uint8_t;
 
 class ApplePaySetupFeature : public RefCounted<ApplePaySetupFeature> {
@@ -43,21 +42,23 @@ public:
     {
         return adoptRef(*new ApplePaySetupFeature(feature));
     }
-    
-    WEBCORE_EXPORT virtual ~ApplePaySetupFeature();
 
-    virtual ApplePaySetupFeatureState state() const;
-    virtual ApplePaySetupFeatureType type() const;
+    ApplePaySetupFeatureType type() const;
+
+    enum class State : uint8_t {
+        Unsupported,
+        Supported,
+        SupplementarySupported,
+        Completed,
+    };
+    State state() const;
 
     PKPaymentSetupFeature *platformFeature() const { return m_feature.get(); }
 
 #if ENABLE(APPLE_PAY_INSTALLMENTS)
-    virtual bool supportsInstallments() const;
+    bool supportsInstallments() const;
 #endif
 
-protected:
-    WEBCORE_EXPORT ApplePaySetupFeature();
-
 private:
     WEBCORE_EXPORT explicit ApplePaySetupFeature(PKPaymentSetupFeature *);
 
index 887d213..6cc74c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,7 +27,6 @@
 
 #if ENABLE(APPLE_PAY_SETUP)
 
-#include "ApplePaySetupConfiguration.h"
 #include <WebCore/ActiveDOMObject.h>
 #include <WebCore/JSDOMPromiseDeferred.h>
 #include <wtf/Forward.h>
@@ -43,7 +42,14 @@ class Document;
 
 class ApplePaySetup : public ActiveDOMObject, public RefCounted<ApplePaySetup> {
 public:
-    static Ref<ApplePaySetup> create(ScriptExecutionContext& context, ApplePaySetupConfiguration&& configuration)
+    struct Configuration {
+        String merchantIdentifier;
+        String referrerIdentifier;
+        String signature;
+        Vector<String> signedFields;
+    };
+
+    static Ref<ApplePaySetup> create(ScriptExecutionContext& context, Configuration&& configuration)
     {
         return adoptRef(*new ApplePaySetup(context, WTFMove(configuration)));
     }
@@ -55,14 +61,14 @@ public:
     void begin(Document&, Vector<RefPtr<ApplePaySetupFeature>>&&, BeginPromise&&);
 
 private:
-    ApplePaySetup(ScriptExecutionContext&, ApplePaySetupConfiguration&&);
+    ApplePaySetup(ScriptExecutionContext&, Configuration&&);
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const final { return "ApplePaySetup"; }
     void stop() final;
     void suspend(ReasonForSuspension) final;
 
-    ApplePaySetupConfiguration m_configuration;
+    Configuration m_configuration;
     Optional<SetupFeaturesPromise> m_setupFeaturesPromise;
     Optional<BeginPromise> m_beginPromise;
     RefPtr<PendingActivity<ApplePaySetup>> m_pendingActivity;
index d94466a..92d873f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -284,6 +284,7 @@ bool PaymentCoordinator::setApplePayIsActiveIfAllowed(Document& document) const
         return false;
     }
 
+    RELEASE_LOG_IF_ALLOWED("setApplePayIsActiveIfAllowed() -> true (supportsUnrestrictedApplePay: %d)", supportsUnrestrictedApplePay);
     document.setApplePayIsActive();
     return true;
 }
@@ -299,38 +300,6 @@ Expected<void, ExceptionDetails> PaymentCoordinator::shouldAllowUserAgentScripts
     return makeUnexpected(ExceptionDetails { m_client.userAgentScriptsBlockedErrorMessage() });
 }
 
-#if ENABLE(APPLE_PAY_SETUP)
-
-void PaymentCoordinator::getSetupFeatures(const ApplePaySetupConfiguration& configuration, const URL& url, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler)
-{
-    RELEASE_LOG_IF_ALLOWED("getSetupFeatures()");
-    m_client.getSetupFeatures(configuration, url, [this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)](Vector<Ref<ApplePaySetupFeature>>&& features) mutable {
-        if (!weakThis)
-            return;
-        RELEASE_LOG_IF_ALLOWED("getSetupFeatures() completed (features: %zu)", features.size());
-        completionHandler(WTFMove(features));
-    });
-}
-
-void PaymentCoordinator::beginApplePaySetup(const ApplePaySetupConfiguration& configuration, const URL& url, Vector<RefPtr<ApplePaySetupFeature>>&& features, CompletionHandler<void(bool)>&& completionHandler)
-{
-    RELEASE_LOG_IF_ALLOWED("beginApplePaySetup()");
-    m_client.beginApplePaySetup(configuration, url, WTFMove(features), [this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)](bool success) mutable {
-        if (!weakThis)
-            return;
-        RELEASE_LOG_IF_ALLOWED("beginApplePaySetup() completed (success: %d)", success);
-        completionHandler(success);
-    });
-}
-
-void PaymentCoordinator::endApplePaySetup()
-{
-    RELEASE_LOG_IF_ALLOWED("endApplePaySetup()");
-    m_client.endApplePaySetup();
-}
-
-#endif
-
 } // namespace WebCore
 
 #undef RELEASE_LOG_ERROR_IF_ALLOWED
index 97d86e7..bfeca8f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,7 +34,6 @@
 
 namespace WebCore {
 
-class ApplePaySetupFeature;
 class Document;
 class Payment;
 class PaymentCoordinatorClient;
@@ -45,7 +44,6 @@ class PaymentMethodUpdate;
 class PaymentSession;
 class PaymentSessionError;
 enum class PaymentAuthorizationStatus;
-struct ApplePaySetupConfiguration;
 struct ExceptionDetails;
 struct PaymentAuthorizationResult;
 struct ShippingContactUpdate;
@@ -87,12 +85,6 @@ public:
     bool shouldEnableApplePayAPIs(Document&) const;
     WEBCORE_EXPORT Expected<void, ExceptionDetails> shouldAllowUserAgentScripts(Document&) const;
 
-#if ENABLE(APPLE_PAY_SETUP)
-    void getSetupFeatures(const ApplePaySetupConfiguration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&&);
-    void beginApplePaySetup(const ApplePaySetupConfiguration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&);
-    void endApplePaySetup();
-#endif
-
 private:
     bool setApplePayIsActiveIfAllowed(Document&) const;
 
index 553d9cd..1b84e7e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,6 +29,7 @@
 
 #include "ApplePaySessionPaymentRequest.h"
 #include "ApplePaySetupFeatureWebCore.h"
+#include "ApplePaySetupWebCore.h"
 #include <wtf/CompletionHandler.h>
 #include <wtf/Forward.h>
 #include <wtf/Function.h>
@@ -38,7 +39,6 @@ namespace WebCore {
 class Document;
 class PaymentMerchantSession;
 class PaymentMethodUpdate;
-struct ApplePaySetupConfiguration;
 struct PaymentAuthorizationResult;
 struct ShippingContactUpdate;
 struct ShippingMethodUpdate;
@@ -71,8 +71,8 @@ public:
     virtual bool isAlwaysOnLoggingAllowed() const { return false; }
 
 #if ENABLE(APPLE_PAY_SETUP)
-    virtual void getSetupFeatures(const ApplePaySetupConfiguration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler) { completionHandler({ }); }
-    virtual void beginApplePaySetup(const ApplePaySetupConfiguration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&& completionHandler) { completionHandler(false); }
+    virtual void getSetupFeatures(const ApplePaySetup::Configuration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler) { completionHandler({ }); }
+    virtual void beginApplePaySetup(const ApplePaySetup::Configuration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&& completionHandler) { completionHandler(false); }
     virtual void endApplePaySetup() { }
 #endif
 
index 31f3d26..dbf7f63 100644 (file)
@@ -641,9 +641,7 @@ WHLSLStandardLibraryFunctionMap.cpp
     JSApplePaySession.cpp
     JSApplePaySessionError.cpp
     JSApplePaySetup.cpp
-    JSApplePaySetupConfiguration.cpp
     JSApplePaySetupFeature.cpp
-    JSApplePaySetupFeatureState.cpp
     JSApplePaySetupFeatureType.cpp
     JSApplePayShippingContactSelectedEvent.cpp
     JSApplePayShippingContactUpdate.cpp
index c417f81..3fb15be 100644 (file)
                A180AD5B219F81B000DC039A /* WebCoreAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = A17E4F26219BC01600E1C7EE /* WebCoreAdditions.mm */; };
                A185B42A1E8211A100DC9118 /* LegacyPreviewLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A185B4281E8211A100DC9118 /* LegacyPreviewLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A18890AF1AA13F250026C301 /* ParentalControlsContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               A1891045246DF6C6006BA9FC /* ApplePaySetupFeatureState.h in Headers */ = {isa = PBXBuildFile; fileRef = A1891042246DF6C6006BA9FC /* ApplePaySetupFeatureState.h */; };
-               A1891053246E1A34006BA9FC /* MockApplePaySetupFeature.h in Headers */ = {isa = PBXBuildFile; fileRef = A1891051246E1A34006BA9FC /* MockApplePaySetupFeature.h */; };
-               A1891054246E1A34006BA9FC /* MockApplePaySetupFeature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1891052246E1A34006BA9FC /* MockApplePaySetupFeature.cpp */; };
-               A1891059246F2C1B006BA9FC /* ApplePaySetupConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = A1891056246F2BC8006BA9FC /* ApplePaySetupConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1956F1C2331A6770057E9D2 /* JSApplePayCancelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A1956F1B2331A6460057E9D2 /* JSApplePayCancelEvent.h */; };
                A1956F202331A8C70057E9D2 /* ApplePaySessionError.h in Headers */ = {isa = PBXBuildFile; fileRef = A1956F1D2331A8C70057E9D2 /* ApplePaySessionError.h */; };
                A1956F232331ACF20057E9D2 /* WHLSLReplaceWith.h in Headers */ = {isa = PBXBuildFile; fileRef = 3351F70B22CAD8DA0015B40D /* WHLSLReplaceWith.h */; };
                A185B4281E8211A100DC9118 /* LegacyPreviewLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyPreviewLoader.h; sourceTree = "<group>"; };
                A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ParentalControlsContentFilter.mm; sourceTree = "<group>"; };
                A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParentalControlsContentFilter.h; sourceTree = "<group>"; };
-               A1891042246DF6C6006BA9FC /* ApplePaySetupFeatureState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePaySetupFeatureState.h; sourceTree = "<group>"; };
-               A1891044246DF6C6006BA9FC /* ApplePaySetupFeatureState.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePaySetupFeatureState.idl; sourceTree = "<group>"; };
-               A1891051246E1A34006BA9FC /* MockApplePaySetupFeature.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockApplePaySetupFeature.h; sourceTree = "<group>"; };
-               A1891052246E1A34006BA9FC /* MockApplePaySetupFeature.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MockApplePaySetupFeature.cpp; sourceTree = "<group>"; };
-               A1891056246F2BC8006BA9FC /* ApplePaySetupConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePaySetupConfiguration.h; sourceTree = "<group>"; };
-               A1891058246F2BC8006BA9FC /* ApplePaySetupConfiguration.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePaySetupConfiguration.idl; sourceTree = "<group>"; };
                A18F7A351ECA73640059E1E1 /* RuntimeApplicationChecks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeApplicationChecks.cpp; sourceTree = "<group>"; };
                A1956F182331A4680057E9D2 /* ApplePayCancelEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePayCancelEvent.idl; sourceTree = "<group>"; };
                A1956F1A2331A6460057E9D2 /* JSApplePayCancelEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayCancelEvent.cpp; sourceTree = "<group>"; };
                                1A58E8641D19D4DF00C0EA73 /* ApplePaySessionPaymentRequest.h */,
                                5C53DCD22446449A00A93124 /* ApplePaySetup.cpp */,
                                5C53DCC62446449700A93124 /* ApplePaySetup.idl */,
-                               A1891056246F2BC8006BA9FC /* ApplePaySetupConfiguration.h */,
-                               A1891058246F2BC8006BA9FC /* ApplePaySetupConfiguration.idl */,
                                5C53DCCA2446449800A93124 /* ApplePaySetupFeature.idl */,
                                5C53DCC92446449800A93124 /* ApplePaySetupFeature.mm */,
-                               A1891042246DF6C6006BA9FC /* ApplePaySetupFeatureState.h */,
-                               A1891044246DF6C6006BA9FC /* ApplePaySetupFeatureState.idl */,
                                5C53DCD62446449C00A93124 /* ApplePaySetupFeatureType.idl */,
                                5C53DCD42446449B00A93124 /* ApplePaySetupFeatureTypeWebCore.h */,
                                5C53DCCF2446449900A93124 /* ApplePaySetupFeatureWebCore.h */,
                                A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */,
                                CD5393CB175DCCE600C07123 /* MemoryInfo.h */,
                                CD5393CC175DCCE600C07123 /* MemoryInfo.idl */,
-                               A1891052246E1A34006BA9FC /* MockApplePaySetupFeature.cpp */,
-                               A1891051246E1A34006BA9FC /* MockApplePaySetupFeature.h */,
                                CDF4B7211E03BF8100E235A2 /* MockCDMFactory.cpp */,
                                CDF4B7221E03BF8100E235A2 /* MockCDMFactory.h */,
                                CDF4B71F1E03BF6F00E235A2 /* MockCDMFactory.idl */,
                                427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */,
                                EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */,
                                CDC26B41160A8CCE0026757B /* LegacyMockCDM.h in Headers */,
-                               A1891053246E1A34006BA9FC /* MockApplePaySetupFeature.h in Headers */,
                                A1BF6B831AA96C7D00AF4A8A /* MockContentFilter.h in Headers */,
                                A1B5B29F1AAA846F008B6042 /* MockContentFilterSettings.h in Headers */,
                                51058ADC1D6792C1009A538C /* MockGamepad.h in Headers */,
                                1A8A64591D19FCFC00D0E00F /* ApplePaySession.h in Headers */,
                                A1956F202331A8C70057E9D2 /* ApplePaySessionError.h in Headers */,
                                1A58E8651D19D4EB00C0EA73 /* ApplePaySessionPaymentRequest.h in Headers */,
-                               A1891059246F2C1B006BA9FC /* ApplePaySetupConfiguration.h in Headers */,
-                               A1891045246DF6C6006BA9FC /* ApplePaySetupFeatureState.h in Headers */,
                                5C53DCE124465DFC00A93124 /* ApplePaySetupFeatureWebCore.h in Headers */,
                                5C53DCEA24468FB400A93124 /* ApplePaySetupWebCore.h in Headers */,
                                1A8A645C1D19FCFC00D0E00F /* ApplePayShippingContactSelectedEvent.h in Headers */,
                                427DA71D13735DFA007C57FB /* JSServiceWorkerInternals.cpp in Sources */,
                                EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
                                CDC26B40160A8CC60026757B /* LegacyMockCDM.cpp in Sources */,
-                               A1891054246E1A34006BA9FC /* MockApplePaySetupFeature.cpp in Sources */,
                                CDF4B7311E03D00700E235A2 /* MockCDMFactory.cpp in Sources */,
                                A1BF6B821AA96C7D00AF4A8A /* MockContentFilter.cpp in Sources */,
                                A1B5B29E1AAA846E008B6042 /* MockContentFilterSettings.cpp in Sources */,
diff --git a/Source/WebCore/testing/MockApplePaySetupFeature.cpp b/Source/WebCore/testing/MockApplePaySetupFeature.cpp
deleted file mode 100644 (file)
index 86b1ecc..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MockApplePaySetupFeature.h"
-
-#if ENABLE(APPLE_PAY_SETUP)
-
-namespace WebCore {
-
-Ref<MockApplePaySetupFeature> MockApplePaySetupFeature::create(ApplePaySetupFeatureState state, ApplePaySetupFeatureType type, bool supportsInstallments)
-{
-    return adoptRef(*new MockApplePaySetupFeature(state, type, supportsInstallments));
-}
-
-MockApplePaySetupFeature::MockApplePaySetupFeature(ApplePaySetupFeatureState state, ApplePaySetupFeatureType type, bool supportsInstallments)
-    : ApplePaySetupFeature()
-    , m_state(state)
-    , m_type(type)
-#if ENABLE(APPLE_PAY_INSTALLMENTS)
-    , m_supportsInstallments(supportsInstallments)
-#endif
-{
-    UNUSED_PARAM(supportsInstallments);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(APPLE_PAY_SETUP)
diff --git a/Source/WebCore/testing/MockApplePaySetupFeature.h b/Source/WebCore/testing/MockApplePaySetupFeature.h
deleted file mode 100644 (file)
index 7705f29..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(APPLE_PAY_SETUP)
-
-#include "ApplePaySetupFeatureWebCore.h"
-
-namespace WebCore {
-
-class MockApplePaySetupFeature final : public ApplePaySetupFeature {
-public:
-    static Ref<MockApplePaySetupFeature> create(ApplePaySetupFeatureState, ApplePaySetupFeatureType, bool supportsInstallments);
-    
-    ApplePaySetupFeatureState state() const final { return m_state; }
-    ApplePaySetupFeatureType type() const final { return m_type; }
-
-#if ENABLE(APPLE_PAY_INSTALLMENTS)
-    bool supportsInstallments() const final { return m_supportsInstallments; }
-#endif
-
-private:
-    MockApplePaySetupFeature(ApplePaySetupFeatureState, ApplePaySetupFeatureType, bool supportsInstallments);
-
-    ApplePaySetupFeatureState m_state;
-    ApplePaySetupFeatureType m_type;
-#if ENABLE(APPLE_PAY_INSTALLMENTS)
-    bool m_supportsInstallments;
-#endif
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(APPLE_PAY_SETUP)
index d89d87b..782dd7e 100644 (file)
@@ -29,7 +29,6 @@
 #if ENABLE(APPLE_PAY)
 
 #include "ApplePaySessionPaymentRequest.h"
-#include "MockApplePaySetupFeature.h"
 #include "MockPayment.h"
 #include "MockPaymentContact.h"
 #include "MockPaymentMethod.h"
@@ -232,28 +231,6 @@ void MockPaymentCoordinator::paymentCoordinatorDestroyed()
     delete this;
 }
 
-#if ENABLE(APPLE_PAY_SETUP)
-
-void MockPaymentCoordinator::addSetupFeature(ApplePaySetupFeatureState state, ApplePaySetupFeatureType type, bool supportsInstallments)
-{
-    m_setupFeatures.append(MockApplePaySetupFeature::create(state, type, supportsInstallments));
-}
-
-void MockPaymentCoordinator::getSetupFeatures(const ApplePaySetupConfiguration& configuration, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&& completionHandler)
-{
-    m_setupConfiguration = configuration;
-    auto setupFeaturesCopy = m_setupFeatures;
-    completionHandler(WTFMove(setupFeaturesCopy));
-}
-
-void MockPaymentCoordinator::beginApplePaySetup(const ApplePaySetupConfiguration& configuration, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&& completionHandler)
-{
-    m_setupConfiguration = configuration;
-    completionHandler(true);
-}
-
-#endif
-
 } // namespace WebCore
 
 #endif // ENABLE(APPLE_PAY)
index 881fa0a..a444162 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "ApplePayInstallmentConfigurationWebCore.h"
 #include "ApplePayLineItem.h"
-#include "ApplePaySetupConfiguration.h"
 #include "ApplePayShippingMethod.h"
 #include "MockPaymentAddress.h"
 #include "MockPaymentContactFields.h"
@@ -54,11 +53,6 @@ public:
     void changePaymentMethod(ApplePayPaymentMethod&&);
     void acceptPayment();
     void cancelPayment();
-    
-#if ENABLE(APPLE_PAY_SETUP)
-    void addSetupFeature(ApplePaySetupFeatureState, ApplePaySetupFeatureType, bool supportsInstallments);
-    const ApplePaySetupConfiguration& setupConfiguration() const { return m_setupConfiguration; }
-#endif
 
     const ApplePayLineItem& total() const { return m_total; }
     const Vector<ApplePayLineItem>& lineItems() const { return m_lineItems; }
@@ -96,11 +90,6 @@ private:
 
     bool isAlwaysOnLoggingAllowed() const final { return true; }
 
-#if ENABLE(APPLE_PAY_SETUP)
-    void getSetupFeatures(const ApplePaySetupConfiguration&, const URL&, CompletionHandler<void(Vector<Ref<ApplePaySetupFeature>>&&)>&&) final;
-    void beginApplePaySetup(const ApplePaySetupConfiguration&, const URL&, Vector<RefPtr<ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&) final;
-#endif
-
     void updateTotalAndLineItems(const ApplePaySessionPaymentRequest::TotalAndLineItems&);
 
     Page& m_page;
@@ -118,10 +107,6 @@ private:
 #if ENABLE(APPLE_PAY_INSTALLMENTS)
     ApplePayInstallmentConfiguration m_installmentConfiguration;
 #endif
-#if ENABLE(APPLE_PAY_SETUP)
-    ApplePaySetupConfiguration m_setupConfiguration;
-    Vector<Ref<ApplePaySetupFeature>> m_setupFeatures;
-#endif
 };
 
 } // namespace WebCore
index 3c64106..7934b50 100644 (file)
@@ -35,8 +35,6 @@
     void acceptPayment();
     void cancelPayment();
 
-    [Conditional=APPLE_PAY_SETUP] void addSetupFeature(ApplePaySetupFeatureState state, ApplePaySetupFeatureType type, boolean supportsInstallments);
-
     readonly attribute ApplePayLineItem total;
     readonly attribute sequence<ApplePayLineItem> lineItems;
     readonly attribute sequence<MockPaymentError> errors;
@@ -44,8 +42,6 @@
     readonly attribute MockPaymentContactFields requiredBillingContactFields;
     readonly attribute MockPaymentContactFields requiredShippingContactFields;
 
-    [Conditional=APPLE_PAY_SETUP] readonly attribute ApplePaySetupConfiguration setupConfiguration;
-
     attribute boolean supportsUnrestrictedApplePay;
 
     [Conditional=APPLE_PAY_INSTALLMENTS] readonly attribute ApplePayInstallmentConfiguration installmentConfiguration;
index b15d113..622b329 100644 (file)
@@ -31,7 +31,6 @@
 #import "ArgumentCodersCocoa.h"
 #import "Decoder.h"
 #import "Encoder.h"
-#import <WebCore/ApplePaySetupConfiguration.h>
 #import <wtf/URL.h>
 
 #import <pal/cocoa/PassKitSoftLink.h>
@@ -42,7 +41,7 @@
 
 namespace WebKit {
 
-static RetainPtr<PKPaymentSetupConfiguration> toPlatformConfiguration(const WebCore::ApplePaySetupConfiguration& coreConfiguration, const URL& url)
+static RetainPtr<PKPaymentSetupConfiguration> toPlatformConfiguration(const WebCore::ApplePaySetup::Configuration& coreConfiguration, const URL& url)
 {
 #if PLATFORM(MAC)
     if (!PAL::getPKPaymentSetupConfigurationClass())
@@ -67,7 +66,7 @@ ALLOW_NEW_API_WITHOUT_GUARDS_END
     return configuration;
 }
 
-PaymentSetupConfiguration::PaymentSetupConfiguration(const WebCore::ApplePaySetupConfiguration& configuration, const URL& url)
+PaymentSetupConfiguration::PaymentSetupConfiguration(const WebCore::ApplePaySetup::Configuration& configuration, const URL& url)
     : m_configuration { toPlatformConfiguration(configuration, url) }
 {
 }
index ec9beb9..8bee36a 100644 (file)
@@ -27,6 +27,7 @@
 
 #if HAVE(PASSKIT_PAYMENT_SETUP)
 
+#include <WebCore/ApplePaySetupWebCore.h>
 #include <wtf/Forward.h>
 #include <wtf/RetainPtr.h>
 
@@ -37,16 +38,12 @@ class Decoder;
 class Encoder;
 }
 
-namespace WebCore {
-struct ApplePaySetupConfiguration;
-}
-
 namespace WebKit {
 
 class PaymentSetupConfiguration {
 public:
     PaymentSetupConfiguration() = default;
-    PaymentSetupConfiguration(const WebCore::ApplePaySetupConfiguration&, const URL&);
+    PaymentSetupConfiguration(const WebCore::ApplePaySetup::Configuration&, const URL&);
 
     void encode(IPC::Encoder&) const;
     static Optional<PaymentSetupConfiguration> decode(IPC::Decoder&);
index f811042..60cebb1 100644 (file)
@@ -224,12 +224,12 @@ bool WebPaymentCoordinator::remoteUIEnabled() const
 
 #if ENABLE(APPLE_PAY_SETUP)
 
-void WebPaymentCoordinator::getSetupFeatures(const WebCore::ApplePaySetupConfiguration& configuration, const URL& url, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&& completionHandler)
+void WebPaymentCoordinator::getSetupFeatures(const WebCore::ApplePaySetup::Configuration& configuration, const URL& url, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&& completionHandler)
 {
     m_webPage.sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::GetSetupFeatures(PaymentSetupConfiguration { configuration, url }), WTFMove(completionHandler));
 }
 
-void WebPaymentCoordinator::beginApplePaySetup(const WebCore::ApplePaySetupConfiguration& configuration, const URL& url, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&& features, CompletionHandler<void(bool)>&& completionHandler)
+void WebPaymentCoordinator::beginApplePaySetup(const WebCore::ApplePaySetup::Configuration& configuration, const URL& url, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&& features, CompletionHandler<void(bool)>&& completionHandler)
 {
     m_webPage.sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::BeginApplePaySetup(PaymentSetupConfiguration { configuration, url }, PaymentSetupFeatures { WTFMove(features) }), WTFMove(completionHandler));
 }
index 8bb6058..3e66d02 100644 (file)
@@ -86,8 +86,8 @@ private:
     String userAgentScriptsBlockedErrorMessage() const final;
 
 #if ENABLE(APPLE_PAY_SETUP)
-    void getSetupFeatures(const WebCore::ApplePaySetupConfiguration&, const URL&, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&&) final;
-    void beginApplePaySetup(const WebCore::ApplePaySetupConfiguration&, const URL&, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&) final;
+    void getSetupFeatures(const WebCore::ApplePaySetup::Configuration&, const URL&, CompletionHandler<void(Vector<Ref<WebCore::ApplePaySetupFeature>>&&)>&&) final;
+    void beginApplePaySetup(const WebCore::ApplePaySetup::Configuration&, const URL&, Vector<RefPtr<WebCore::ApplePaySetupFeature>>&&, CompletionHandler<void(bool)>&&) final;
     void endApplePaySetup() final;
 #endif