Title: [214829] trunk/Source
Revision
214829
Author
ander...@apple.com
Date
2017-04-03 12:07:50 -0700 (Mon, 03 Apr 2017)

Log Message

Tweak ApplePaySession API
https://bugs.webkit.org/show_bug.cgi?id=170409
rdar://problem/31405459

Reviewed by Tim Horton.

Source/WebCore:

Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.

* Modules/applepay/ApplePayError.cpp:
(WebCore::ApplePayError::create):
(WebCore::ApplePayError::ApplePayError):
* Modules/applepay/ApplePayError.h:
* Modules/applepay/ApplePayError.idl:
* Modules/applepay/PaymentRequest.h:

Source/WebKit2:

Update for WebCore changes.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSError):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (214828 => 214829)


--- trunk/Source/WebCore/ChangeLog	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/ChangeLog	2017-04-03 19:07:50 UTC (rev 214829)
@@ -1,3 +1,20 @@
+2017-04-03  Anders Carlsson  <ander...@apple.com>
+
+        Tweak ApplePaySession API
+        https://bugs.webkit.org/show_bug.cgi?id=170409
+        rdar://problem/31405459
+
+        Reviewed by Tim Horton.
+
+        Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.
+
+        * Modules/applepay/ApplePayError.cpp:
+        (WebCore::ApplePayError::create):
+        (WebCore::ApplePayError::ApplePayError):
+        * Modules/applepay/ApplePayError.h:
+        * Modules/applepay/ApplePayError.idl:
+        * Modules/applepay/PaymentRequest.h:
+
 2017-04-03  Zan Dobersek  <zdober...@igalia.com>
 
         [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()

Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.cpp (214828 => 214829)


--- trunk/Source/WebCore/Modules/applepay/ApplePayError.cpp	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.cpp	2017-04-03 19:07:50 UTC (rev 214829)
@@ -30,15 +30,15 @@
 
 namespace WebCore {
 
-Ref<ApplePayError> ApplePayError::create(Code code, const String& message, std::optional<ContactField> contactField)
+Ref<ApplePayError> ApplePayError::create(Code code, std::optional<ContactField> contactField, const String& message)
 {
-    return adoptRef(*new ApplePayError { code, message, contactField });
+    return adoptRef(*new ApplePayError { code, contactField, message });
 }
 
-ApplePayError::ApplePayError(Code code, const String& message, std::optional<ContactField> contactField)
+ApplePayError::ApplePayError(Code code, std::optional<ContactField> contactField, const String& message)
     : m_code { code }
+    , m_contactField { contactField }
     , m_message { message }
-    , m_contactField { contactField }
 {
 }
 

Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.h (214828 => 214829)


--- trunk/Source/WebCore/Modules/applepay/ApplePayError.h	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.h	2017-04-03 19:07:50 UTC (rev 214829)
@@ -38,24 +38,24 @@
     using Code = PaymentError::Code;
     using ContactField = PaymentError::ContactField;
 
-    static Ref<ApplePayError> create(Code, const String& message, std::optional<ContactField>);
+    static Ref<ApplePayError> create(Code, std::optional<ContactField>, const String& message);
     virtual ~ApplePayError();
 
     Code code() const { return m_code; }
     void setCode(Code code) { m_code = code; }
 
+    std::optional<ContactField> contactField() const { return m_contactField; }
+    void setContactField(std::optional<ContactField> contactField) { m_contactField = contactField; }
+
     String message() const { return m_message; }
     void setMessage(String&& message) { m_message = WTFMove(message); }
 
-    std::optional<ContactField> contactField() const { return m_contactField; }
-    void setContactField(std::optional<ContactField> contactField) { m_contactField = contactField; }
-
 private:
-    ApplePayError(Code, const String& message, std::optional<ContactField>);
+    ApplePayError(Code, std::optional<ContactField>, const String& message);
 
     Code m_code;
+    std::optional<ContactField> m_contactField;
     String m_message;
-    std::optional<ContactField> m_contactField;
 };
 
 }

Modified: trunk/Source/WebCore/Modules/applepay/ApplePayError.idl (214828 => 214829)


--- trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayError.idl	2017-04-03 19:07:50 UTC (rev 214829)
@@ -38,7 +38,8 @@
     "phoneNumber",
     "emailAddress",
     "name",
-    "address",
+    "postalAddress",
+    "addressLines",
     "locality",
     "postalCode",
     "administrativeArea",
@@ -46,11 +47,10 @@
 };
 
 [
-    Constructor(ApplePayErrorCode errorCode, optional DOMString message = "", optional ApplePayErrorContactField contactField),
+    Constructor(ApplePayErrorCode errorCode, optional ApplePayErrorContactField contactField, optional DOMString message = ""),
     Conditional=APPLE_PAY_DELEGATE,
 ] interface ApplePayError {
     attribute ApplePayErrorCode code;
+    attribute ApplePayErrorContactField? contactField;
     attribute DOMString message;
-
-    attribute ApplePayErrorContactField? contactField;
 };

Modified: trunk/Source/WebCore/Modules/applepay/PaymentRequest.h (214828 => 214829)


--- trunk/Source/WebCore/Modules/applepay/PaymentRequest.h	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebCore/Modules/applepay/PaymentRequest.h	2017-04-03 19:07:50 UTC (rev 214829)
@@ -162,7 +162,8 @@
         PhoneNumber,
         EmailAddress,
         Name,
-        Address,
+        PostalAddress,
+        AddressLines,
         Locality,
         PostalCode,
         AdministrativeArea,
@@ -217,7 +218,8 @@
         WebCore::PaymentError::ContactField::PhoneNumber,
         WebCore::PaymentError::ContactField::EmailAddress,
         WebCore::PaymentError::ContactField::Name,
-        WebCore::PaymentError::ContactField::Address,
+        WebCore::PaymentError::ContactField::PostalAddress,
+        WebCore::PaymentError::ContactField::AddressLines,
         WebCore::PaymentError::ContactField::Locality,
         WebCore::PaymentError::ContactField::PostalCode,
         WebCore::PaymentError::ContactField::AdministrativeArea,

Modified: trunk/Source/WebKit2/ChangeLog (214828 => 214829)


--- trunk/Source/WebKit2/ChangeLog	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebKit2/ChangeLog	2017-04-03 19:07:50 UTC (rev 214829)
@@ -1,3 +1,16 @@
+2017-04-03  Anders Carlsson  <ander...@apple.com>
+
+        Tweak ApplePaySession API
+        https://bugs.webkit.org/show_bug.cgi?id=170409
+        rdar://problem/31405459
+
+        Reviewed by Tim Horton.
+
+        Update for WebCore changes.
+
+        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+        (WebKit::toNSError):
+
 2017-04-03  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [SOUP] URI Fragment is lost after redirect

Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (214828 => 214829)


--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-04-03 19:04:16 UTC (rev 214828)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2017-04-03 19:07:50 UTC (rev 214829)
@@ -616,8 +616,12 @@
             pkContactField = getPKContactFieldName();
             break;
 
-        case WebCore::PaymentError::ContactField::Address:
+        case WebCore::PaymentError::ContactField::PostalAddress:
             pkContactField = getPKContactFieldPostalAddress();
+            break;
+
+        case WebCore::PaymentError::ContactField::AddressLines:
+            pkContactField = getPKContactFieldPostalAddress();
             postalAddressKey = getCNPostalAddressStreetKey();
             break;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to