[Apple Pay] Add release logging to PaymentCoordinator
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 19:53:35 +0000 (19:53 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 19:53:35 +0000 (19:53 +0000)
commitdb6888977410f8f3bec4cefa89bd8aa948f843ab
treee05eb703e193835a95cedb8653c3a87a8d283b02
parent7aa2e717b7aeb32652defe2c0ed8ff4a9785601f
[Apple Pay] Add release logging to PaymentCoordinator
https://bugs.webkit.org/show_bug.cgi?id=196738

Reviewed by Alex Christensen.

Source/WebCore:

When allowed, log interactions with PaymentCoordinator to os_log to help diagnose Apple Pay bugs.

The following information might be logged: names of functions called, merchant API versions,
boolean results of canMakePayments(), boolean results of beginPaymentSession(), whether
completePaymentSession() was called with a final state result, boolean results of
shouldAllowApplePay(), whether a document has evaluated user agent scripts or is running
user scripts, and whether a client supports unrestricted Apple Pay.

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::supportsVersion const):
(WebCore::PaymentCoordinator::canMakePayments):
(WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
(WebCore::PaymentCoordinator::openPaymentSetup):
(WebCore::PaymentCoordinator::beginPaymentSession):
(WebCore::PaymentCoordinator::completeMerchantValidation):
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
(WebCore::PaymentCoordinator::completePaymentSession):
(WebCore::PaymentCoordinator::abortPaymentSession):
(WebCore::PaymentCoordinator::cancelPaymentSession):
(WebCore::PaymentCoordinator::validateMerchant):
(WebCore::PaymentCoordinator::didAuthorizePayment):
(WebCore::PaymentCoordinator::didSelectPaymentMethod):
(WebCore::PaymentCoordinator::didSelectShippingMethod):
(WebCore::PaymentCoordinator::didSelectShippingContact):
(WebCore::PaymentCoordinator::didCancelPaymentSession):
(WebCore::PaymentCoordinator::shouldAllowApplePay const):
(WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
* platform/Logging.h:
* testing/MockPaymentCoordinator.h:

Source/WebKit:

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::isAlwaysOnLoggingAllowed const):
* WebProcess/ApplePay/WebPaymentCoordinator.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
Source/WebCore/platform/Logging.h
Source/WebCore/testing/MockPaymentCoordinator.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp
Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h