Changeset 206176 in webkit


Ignore:
Timestamp:
Sep 20, 2016 2:43:26 PM (8 years ago)
Author:
andersca@apple.com
Message:

Can't present a payment sheet if a sheet is already active in another window
https://bugs.webkit.org/show_bug.cgi?id=162314
rdar://problem/27643511

Reviewed by Tim Horton.

Instead of keeping track of whether a sheet is active or not, keep track of its underlying payment coordinator proxy,
so we can hide it and send a cancel event to WebCore if another sheet is being presented.

  • UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:

(WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
(WebKit::WebPaymentCoordinatorProxy::didReachFinalState):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r206166 r206176  
     12016-09-20  Anders Carlsson  <andersca@apple.com>
     2
     3        Can't present a payment sheet if a sheet is already active in another window
     4        https://bugs.webkit.org/show_bug.cgi?id=162314
     5        rdar://problem/27643511
     6
     7        Reviewed by Tim Horton.
     8
     9        Instead of keeping track of whether a sheet is active or not, keep track of its underlying payment coordinator proxy,
     10        so we can hide it and send a cancel event to WebCore if another sheet is being presented.
     11
     12        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
     13        (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
     14        (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
     15        (WebKit::WebPaymentCoordinatorProxy::didReachFinalState):
     16
    1172016-09-20  Keith Rollin  <krollin@apple.com>
    218
  • trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp

    r203414 r206176  
    3737namespace WebKit {
    3838
    39 static bool isShowingPaymentUI;
     39static WebPaymentCoordinatorProxy* activePaymentCoordinatorProxy;
    4040
    4141WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy(WebPageProxy& webPageProxy)
     
    5050WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy()
    5151{
     52    if (activePaymentCoordinatorProxy == this)
     53        activePaymentCoordinatorProxy = nullptr;
     54
    5255    if (m_state != State::Idle)
    5356        hidePaymentUI();
     
    7881    ASSERT(canBegin());
    7982
    80     if (isShowingPaymentUI) {
    81         result = false;
    82         return;
    83     }
    84     isShowingPaymentUI = true;
     83    if (activePaymentCoordinatorProxy) {
     84        activePaymentCoordinatorProxy->hidePaymentUI();
     85        activePaymentCoordinatorProxy->didCancelPayment();
     86    }
     87
     88    activePaymentCoordinatorProxy = this;
    8589
    8690    m_state = State::Activating;
     
    332336    m_merchantValidationState = MerchantValidationState::Idle;
    333337
    334     ASSERT(isShowingPaymentUI);
    335     isShowingPaymentUI = false;
     338    ASSERT(activePaymentCoordinatorProxy == this);
     339    activePaymentCoordinatorProxy = nullptr;
    336340}
    337341
Note: See TracChangeset for help on using the changeset viewer.