⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 248352 in webkit


Ignore:
Timestamp:
Aug 6, 2019, 11:52:44 PM (7 years ago)
Author:
Kocsen Chung
Message:

Cherry-pick r247868. rdar://problem/54017876

[iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes UIProcess hangs
https://bugs.webkit.org/show_bug.cgi?id=200138
<rdar://problem/52698157>

Reviewed by Geoffrey Garen.

Source/WebKit:

Revert most of r247822 and use an alternative approach to address hangs. In this patch, the proposal
is to add a SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply flag on the
WebPage::TouchEventSync() & WebPage::GetPositionInformation() sendSync() calls in the UIProcess.
Those will cause this IPCs to get dispatched right away in the WebContent process, even if the
WebContent process is itself currently stuck on unbounded (i.e. potentially slow) synchronous IPC
(JS alerts / prompts & sync XHR). Because re-entering WebCore on sync IPC is generally unsafe, this
patch also updates the WebPage::getPositionInformation() & WebPage::touchEventSync() to return early
(i.e. cancelled) if they get called while the WebContent process is stuck on a slow sendSync.

This approach should address the UIProcess hangs caused by the WebPage::TouchEventSync() and
WebPage::GetPositionInformation() sync IPC messages when the WebContent process is busy on a slow XHR
or a JS prompt / alert. It should be safe because we do not re-enter WebCore. The only drawback is that
those IPCs will be cancelled (early return with default value) when the WebContent process is busy.
However, I am being told that this is likely acceptable in practice.

  • Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState::processIncomingMessage): (IPC::Connection::sendMessage): (IPC::Connection::sendSyncMessage): (IPC::Connection::dispatchMessage):
  • Platform/IPC/Connection.h: (IPC::UnboundedSynchronousIPCScope::UnboundedSynchronousIPCScope): (IPC::UnboundedSynchronousIPCScope::~UnboundedSynchronousIPCScope): (IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC):
  • Platform/IPC/Decoder.cpp: (IPC::Decoder::shouldDispatchMessageWhenWaitingForSyncReply const):
  • Platform/IPC/Decoder.h:
  • Platform/IPC/Encoder.cpp: (IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply const): (IPC::Encoder::setShouldDispatchMessageWhenWaitingForSyncReply): (IPC::Encoder::wrapForTesting):
  • Platform/IPC/Encoder.h:
  • Platform/IPC/MessageFlags.h:
  • UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleTouchEventSynchronously):
  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView ensurePositionInformationIsUpToDate:]):
  • WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResourceSynchronously):
  • WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply): (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt):
  • WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::layerVolatilityTimerFired): (WebKit::WebPage::markLayersVolatile): (WebKit::WebPage::cancelMarkLayersVolatile): (WebKit::WebPage::touchEventSync): (WebKit::WebPage::didCompletePageTransition): (WebKit::WebPage::updatePreferences): (WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
  • WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sendSyncWithDelayedReply):
  • WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation):

LayoutTests:

Update existing layout test accordingly.

  • fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply-expected.txt: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply-expected.txt.
  • fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply.html: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html.

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

Location:
branches/safari-608.1-branch
Files:
17 edited
2 moved

Legend:

Unmodified
Added
Removed
  • branches/safari-608.1-branch/LayoutTests/ChangeLog

    r248350 r248352  
     12019-08-06  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r247868. rdar://problem/54017876
     4
     5    [iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes UIProcess hangs
     6    https://bugs.webkit.org/show_bug.cgi?id=200138
     7    <rdar://problem/52698157>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/WebKit:
     12   
     13    Revert most of r247822 and use an alternative approach to address hangs. In this patch, the proposal
     14    is to add a SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply flag on the
     15    WebPage::TouchEventSync() & WebPage::GetPositionInformation() sendSync() calls in the UIProcess.
     16    Those will cause this IPCs to get dispatched right away in the WebContent process, even if the
     17    WebContent process is itself currently stuck on unbounded (i.e. potentially slow) synchronous IPC
     18    (JS alerts / prompts & sync XHR). Because re-entering WebCore on sync IPC is generally unsafe, this
     19    patch also updates the WebPage::getPositionInformation() & WebPage::touchEventSync() to return early
     20    (i.e. cancelled) if they get called while the WebContent process is stuck on a slow sendSync.
     21   
     22    This approach should address the UIProcess hangs caused by the WebPage::TouchEventSync() and
     23    WebPage::GetPositionInformation() sync IPC messages when the WebContent process is busy on a slow XHR
     24    or a JS prompt / alert. It should be safe because we do not re-enter WebCore. The only drawback is that
     25    those IPCs will be cancelled (early return with default value) when the WebContent process is busy.
     26    However, I am being told that this is likely acceptable in practice.
     27   
     28    * Platform/IPC/Connection.cpp:
     29    (IPC::Connection::SyncMessageState::processIncomingMessage):
     30    (IPC::Connection::sendMessage):
     31    (IPC::Connection::sendSyncMessage):
     32    (IPC::Connection::dispatchMessage):
     33    * Platform/IPC/Connection.h:
     34    (IPC::UnboundedSynchronousIPCScope::UnboundedSynchronousIPCScope):
     35    (IPC::UnboundedSynchronousIPCScope::~UnboundedSynchronousIPCScope):
     36    (IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC):
     37    * Platform/IPC/Decoder.cpp:
     38    (IPC::Decoder::shouldDispatchMessageWhenWaitingForSyncReply const):
     39    * Platform/IPC/Decoder.h:
     40    * Platform/IPC/Encoder.cpp:
     41    (IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply const):
     42    (IPC::Encoder::setShouldDispatchMessageWhenWaitingForSyncReply):
     43    (IPC::Encoder::wrapForTesting):
     44    * Platform/IPC/Encoder.h:
     45    * Platform/IPC/MessageFlags.h:
     46    * UIProcess/Network/NetworkProcessProxy.cpp:
     47    (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     48    * UIProcess/WebPageProxy.cpp:
     49    (WebKit::WebPageProxy::handleTouchEventSynchronously):
     50    * UIProcess/ios/WKContentViewInteraction.mm:
     51    (-[WKContentView ensurePositionInformationIsUpToDate:]):
     52    * WebProcess/Network/WebLoaderStrategy.cpp:
     53    (WebKit::WebLoaderStrategy::loadResourceSynchronously):
     54    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     55    (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     56    (WebKit::WebChromeClient::runJavaScriptAlert):
     57    (WebKit::WebChromeClient::runJavaScriptConfirm):
     58    (WebKit::WebChromeClient::runJavaScriptPrompt):
     59    * WebProcess/WebPage/WebPage.cpp:
     60    (WebKit::WebPage::layerVolatilityTimerFired):
     61    (WebKit::WebPage::markLayersVolatile):
     62    (WebKit::WebPage::cancelMarkLayersVolatile):
     63    (WebKit::WebPage::touchEventSync):
     64    (WebKit::WebPage::didCompletePageTransition):
     65    (WebKit::WebPage::updatePreferences):
     66    (WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     67    * WebProcess/WebPage/WebPage.h:
     68    (WebKit::WebPage::sendSyncWithDelayedReply):
     69    * WebProcess/WebPage/ios/WebPageIOS.mm:
     70    (WebKit::WebPage::getPositionInformation):
     71   
     72    LayoutTests:
     73   
     74    Update existing layout test accordingly.
     75   
     76    * fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply-expected.txt: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply-expected.txt.
     77    * fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply.html: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html.
     78   
     79   
     80    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     81
     82    2019-07-26  Chris Dumez  <cdumez@apple.com>
     83
     84            [iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes UIProcess hangs
     85            https://bugs.webkit.org/show_bug.cgi?id=200138
     86            <rdar://problem/52698157>
     87
     88            Reviewed by Geoffrey Garen.
     89
     90            Update existing layout test accordingly.
     91
     92            * fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply-expected.txt: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply-expected.txt.
     93            * fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply.html: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html.
     94
    1952019-08-06  Kocsen Chung  <kocsen_chung@apple.com>
    296
  • branches/safari-608.1-branch/LayoutTests/fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply-expected.txt

    r248351 r248352  
    1 Test for the SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply sendSync flag
     1Test for the SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply sendSync flag
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
  • branches/safari-608.1-branch/LayoutTests/fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply.html

    r248351 r248352  
    44<script src="../../resources/js-test.js"></script>
    55<script>
    6 description("Test for the SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply sendSync flag");
     6description("Test for the SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply sendSync flag");
    77
    88shouldBeTrue("internals.testProcessIncomingSyncMessagesWhenWaitingForSyncReply()");
  • branches/safari-608.1-branch/Source/WebKit/ChangeLog

    r248349 r248352  
     12019-08-06  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r247868. rdar://problem/54017876
     4
     5    [iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes UIProcess hangs
     6    https://bugs.webkit.org/show_bug.cgi?id=200138
     7    <rdar://problem/52698157>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Source/WebKit:
     12   
     13    Revert most of r247822 and use an alternative approach to address hangs. In this patch, the proposal
     14    is to add a SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply flag on the
     15    WebPage::TouchEventSync() & WebPage::GetPositionInformation() sendSync() calls in the UIProcess.
     16    Those will cause this IPCs to get dispatched right away in the WebContent process, even if the
     17    WebContent process is itself currently stuck on unbounded (i.e. potentially slow) synchronous IPC
     18    (JS alerts / prompts & sync XHR). Because re-entering WebCore on sync IPC is generally unsafe, this
     19    patch also updates the WebPage::getPositionInformation() & WebPage::touchEventSync() to return early
     20    (i.e. cancelled) if they get called while the WebContent process is stuck on a slow sendSync.
     21   
     22    This approach should address the UIProcess hangs caused by the WebPage::TouchEventSync() and
     23    WebPage::GetPositionInformation() sync IPC messages when the WebContent process is busy on a slow XHR
     24    or a JS prompt / alert. It should be safe because we do not re-enter WebCore. The only drawback is that
     25    those IPCs will be cancelled (early return with default value) when the WebContent process is busy.
     26    However, I am being told that this is likely acceptable in practice.
     27   
     28    * Platform/IPC/Connection.cpp:
     29    (IPC::Connection::SyncMessageState::processIncomingMessage):
     30    (IPC::Connection::sendMessage):
     31    (IPC::Connection::sendSyncMessage):
     32    (IPC::Connection::dispatchMessage):
     33    * Platform/IPC/Connection.h:
     34    (IPC::UnboundedSynchronousIPCScope::UnboundedSynchronousIPCScope):
     35    (IPC::UnboundedSynchronousIPCScope::~UnboundedSynchronousIPCScope):
     36    (IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC):
     37    * Platform/IPC/Decoder.cpp:
     38    (IPC::Decoder::shouldDispatchMessageWhenWaitingForSyncReply const):
     39    * Platform/IPC/Decoder.h:
     40    * Platform/IPC/Encoder.cpp:
     41    (IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply const):
     42    (IPC::Encoder::setShouldDispatchMessageWhenWaitingForSyncReply):
     43    (IPC::Encoder::wrapForTesting):
     44    * Platform/IPC/Encoder.h:
     45    * Platform/IPC/MessageFlags.h:
     46    * UIProcess/Network/NetworkProcessProxy.cpp:
     47    (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     48    * UIProcess/WebPageProxy.cpp:
     49    (WebKit::WebPageProxy::handleTouchEventSynchronously):
     50    * UIProcess/ios/WKContentViewInteraction.mm:
     51    (-[WKContentView ensurePositionInformationIsUpToDate:]):
     52    * WebProcess/Network/WebLoaderStrategy.cpp:
     53    (WebKit::WebLoaderStrategy::loadResourceSynchronously):
     54    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     55    (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     56    (WebKit::WebChromeClient::runJavaScriptAlert):
     57    (WebKit::WebChromeClient::runJavaScriptConfirm):
     58    (WebKit::WebChromeClient::runJavaScriptPrompt):
     59    * WebProcess/WebPage/WebPage.cpp:
     60    (WebKit::WebPage::layerVolatilityTimerFired):
     61    (WebKit::WebPage::markLayersVolatile):
     62    (WebKit::WebPage::cancelMarkLayersVolatile):
     63    (WebKit::WebPage::touchEventSync):
     64    (WebKit::WebPage::didCompletePageTransition):
     65    (WebKit::WebPage::updatePreferences):
     66    (WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     67    * WebProcess/WebPage/WebPage.h:
     68    (WebKit::WebPage::sendSyncWithDelayedReply):
     69    * WebProcess/WebPage/ios/WebPageIOS.mm:
     70    (WebKit::WebPage::getPositionInformation):
     71   
     72    LayoutTests:
     73   
     74    Update existing layout test accordingly.
     75   
     76    * fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply-expected.txt: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply-expected.txt.
     77    * fast/misc/{testProcessIncomingSyncMessagesWhenWaitingForUnboundedReply.html: Renamed from LayoutTests/fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html.
     78   
     79   
     80    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     81
     82    2019-07-26  Chris Dumez  <cdumez@apple.com>
     83
     84            [iOS] WebPage::TouchEventSync() & WebPage::GetPositionInformation() sync IPC causes UIProcess hangs
     85            https://bugs.webkit.org/show_bug.cgi?id=200138
     86            <rdar://problem/52698157>
     87
     88            Reviewed by Geoffrey Garen.
     89
     90            Revert most of r247822 and use an alternative approach to address hangs. In this patch, the proposal
     91            is to add a SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply flag on the
     92            WebPage::TouchEventSync() & WebPage::GetPositionInformation() sendSync() calls in the UIProcess.
     93            Those will cause this IPCs to get dispatched right away in the WebContent process, even if the
     94            WebContent process is itself currently stuck on unbounded (i.e. potentially slow) synchronous IPC
     95            (JS alerts / prompts & sync XHR). Because re-entering WebCore on sync IPC is generally unsafe, this
     96            patch also updates the WebPage::getPositionInformation() & WebPage::touchEventSync() to return early
     97            (i.e. cancelled) if they get called while the WebContent process is stuck on a slow sendSync.
     98
     99            This approach should address the UIProcess hangs caused by the WebPage::TouchEventSync() and
     100            WebPage::GetPositionInformation() sync IPC messages when the WebContent process is busy on a slow XHR
     101            or a JS prompt / alert. It should be safe because we do not re-enter WebCore. The only drawback is that
     102            those IPCs will be cancelled (early return with default value) when the WebContent process is busy.
     103            However, I am being told that this is likely acceptable in practice.
     104
     105            * Platform/IPC/Connection.cpp:
     106            (IPC::Connection::SyncMessageState::processIncomingMessage):
     107            (IPC::Connection::sendMessage):
     108            (IPC::Connection::sendSyncMessage):
     109            (IPC::Connection::dispatchMessage):
     110            * Platform/IPC/Connection.h:
     111            (IPC::UnboundedSynchronousIPCScope::UnboundedSynchronousIPCScope):
     112            (IPC::UnboundedSynchronousIPCScope::~UnboundedSynchronousIPCScope):
     113            (IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC):
     114            * Platform/IPC/Decoder.cpp:
     115            (IPC::Decoder::shouldDispatchMessageWhenWaitingForSyncReply const):
     116            * Platform/IPC/Decoder.h:
     117            * Platform/IPC/Encoder.cpp:
     118            (IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply const):
     119            (IPC::Encoder::setShouldDispatchMessageWhenWaitingForSyncReply):
     120            (IPC::Encoder::wrapForTesting):
     121            * Platform/IPC/Encoder.h:
     122            * Platform/IPC/MessageFlags.h:
     123            * UIProcess/Network/NetworkProcessProxy.cpp:
     124            (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     125            * UIProcess/WebPageProxy.cpp:
     126            (WebKit::WebPageProxy::handleTouchEventSynchronously):
     127            * UIProcess/ios/WKContentViewInteraction.mm:
     128            (-[WKContentView ensurePositionInformationIsUpToDate:]):
     129            * WebProcess/Network/WebLoaderStrategy.cpp:
     130            (WebKit::WebLoaderStrategy::loadResourceSynchronously):
     131            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     132            (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     133            (WebKit::WebChromeClient::runJavaScriptAlert):
     134            (WebKit::WebChromeClient::runJavaScriptConfirm):
     135            (WebKit::WebChromeClient::runJavaScriptPrompt):
     136            * WebProcess/WebPage/WebPage.cpp:
     137            (WebKit::WebPage::layerVolatilityTimerFired):
     138            (WebKit::WebPage::markLayersVolatile):
     139            (WebKit::WebPage::cancelMarkLayersVolatile):
     140            (WebKit::WebPage::touchEventSync):
     141            (WebKit::WebPage::didCompletePageTransition):
     142            (WebKit::WebPage::updatePreferences):
     143            (WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     144            * WebProcess/WebPage/WebPage.h:
     145            (WebKit::WebPage::sendSyncWithDelayedReply):
     146            * WebProcess/WebPage/ios/WebPageIOS.mm:
     147            (WebKit::WebPage::getPositionInformation):
     148
    11492019-08-06  Kocsen Chung  <kocsen_chung@apple.com>
    2150
  • branches/safari-608.1-branch/Source/WebKit/Platform/IPC/Connection.cpp

    r248349 r248352  
    2828
    2929#include "Logging.h"
     30#include "MessageFlags.h"
    3031#include <memory>
    3132#include <wtf/HashSet.h>
     
    5051#endif
    5152
     53std::atomic<unsigned> UnboundedSynchronousIPCScope::unboundedSynchronousIPCCount = 0;
     54
    5255struct Connection::ReplyHandler {
    5356    RefPtr<FunctionDispatcher> dispatcher;
     
    99102    void dispatchMessages(Connection* allowedConnection);
    100103
    101     void incrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount() { ++m_processIncomingSyncMessagesWhenWaitingForSyncReplyCount; }
    102     void decrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount() { --m_processIncomingSyncMessagesWhenWaitingForSyncReplyCount; }
    103 
    104104private:
    105105    void dispatchMessageAndResetDidScheduleDispatchMessagesForConnection(Connection&);
     
    118118    };
    119119    Vector<ConnectionAndIncomingMessage> m_messagesToDispatchWhileWaitingForSyncReply;
    120 
    121     std::atomic<unsigned> m_processIncomingSyncMessagesWhenWaitingForSyncReplyCount { 0 };
    122120};
    123121
     
    140138bool Connection::SyncMessageState::processIncomingMessage(Connection& connection, std::unique_ptr<Decoder>& message)
    141139{
    142     bool shouldDispatchMessageWhenWaitingForSyncReply = message->shouldDispatchMessageWhenWaitingForSyncReply();
    143 
    144     // We dispatch synchronous messages even if shouldDispatchMessageWhenWaitingForSyncReply returns false if the
    145     // sendSync() used SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply. This is used for some messages
    146     // in the WebContent process (which normally does not dispatch messages when waiting for a sync reply), to avoid
    147     // hangs.
    148     if (!shouldDispatchMessageWhenWaitingForSyncReply && message->isSyncMessage() && m_processIncomingSyncMessagesWhenWaitingForSyncReplyCount.load())
    149         shouldDispatchMessageWhenWaitingForSyncReply = true;
    150 
    151     if (!shouldDispatchMessageWhenWaitingForSyncReply)
     140    switch (message->shouldDispatchMessageWhenWaitingForSyncReply()) {
     141    case ShouldDispatchWhenWaitingForSyncReply::No:
    152142        return false;
     143    case ShouldDispatchWhenWaitingForSyncReply::YesDuringUnboundedIPC:
     144        if (!UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC())
     145            return false;
     146        break;
     147    case ShouldDispatchWhenWaitingForSyncReply::Yes:
     148        break;
     149    }
    153150
    154151    ConnectionAndIncomingMessage connectionAndIncomingMessage { connection, WTFMove(message) };
     
    434431        && (!m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage
    435432            || m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount))
    436         encoder->setShouldDispatchMessageWhenWaitingForSyncReply(true);
     433        encoder->setShouldDispatchMessageWhenWaitingForSyncReply(ShouldDispatchWhenWaitingForSyncReply::Yes);
     434    else if (sendOptions.contains(SendOption::DispatchMessageEvenWhenWaitingForUnboundedSyncReply))
     435        encoder->setShouldDispatchMessageWhenWaitingForSyncReply(ShouldDispatchWhenWaitingForSyncReply::YesDuringUnboundedIPC);
    437436
    438437    {
     
    578577
    579578    // First send the message.
    580     sendMessage(WTFMove(encoder), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
    581 
    582     if (sendSyncOptions.contains(SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
    583         SyncMessageState::singleton().incrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount();
     579    OptionSet<SendOption> sendOptions = IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply;
     580    if (sendSyncOptions.contains(SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply))
     581        sendOptions = sendOptions | IPC::SendOption::DispatchMessageEvenWhenWaitingForUnboundedSyncReply;
     582
     583    sendMessage(WTFMove(encoder), sendOptions);
    584584
    585585    // Then wait for a reply. Waiting for a reply could involve dispatching incoming sync messages, so
     
    587587    Ref<Connection> protect(*this);
    588588    std::unique_ptr<Decoder> reply = waitForSyncReply(syncRequestID, timeout, sendSyncOptions);
    589 
    590     if (sendSyncOptions.contains(SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
    591         SyncMessageState::singleton().decrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount();
    592589
    593590    --m_inSendSyncCount;
     
    10411038
    10421039    m_inDispatchMessageCount++;
    1043 
    1044     if (message->shouldDispatchMessageWhenWaitingForSyncReply())
     1040   
     1041    bool isDispatchingMessageWhileWaitingForSyncReply = (message->shouldDispatchMessageWhenWaitingForSyncReply() == ShouldDispatchWhenWaitingForSyncReply::Yes)
     1042        || (message->shouldDispatchMessageWhenWaitingForSyncReply() == ShouldDispatchWhenWaitingForSyncReply::YesDuringUnboundedIPC && UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC());
     1043
     1044    if (isDispatchingMessageWhileWaitingForSyncReply)
    10451045        m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount++;
    10461046
     
    10581058    // FIXME: For synchronous messages, we should not decrement the counter until we send a response.
    10591059    // Otherwise, we would deadlock if processing the message results in a sync message back after we exit this function.
    1060     if (message->shouldDispatchMessageWhenWaitingForSyncReply())
     1060    if (isDispatchingMessageWhileWaitingForSyncReply)
    10611061        m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount--;
    10621062
  • branches/safari-608.1-branch/Source/WebKit/Platform/IPC/Connection.h

    r248349 r248352  
    6262    // This is the default for synchronous messages.
    6363    DispatchMessageEvenWhenWaitingForSyncReply = 1 << 0,
    64     IgnoreFullySynchronousMode = 1 << 1,
     64    DispatchMessageEvenWhenWaitingForUnboundedSyncReply = 1 << 1,
     65    IgnoreFullySynchronousMode = 1 << 2,
    6566};
    6667
     
    6970    InformPlatformProcessWillSuspend = 1 << 0,
    7071    UseFullySynchronousModeForTesting = 1 << 1,
    71     ProcessIncomingSyncMessagesWhenWaitingForSyncReply = 1 << 2,
     72    ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply = 1 << 2,
    7273};
    7374
     
    555556}
    556557
     558class UnboundedSynchronousIPCScope {
     559public:
     560    UnboundedSynchronousIPCScope()
     561    {
     562        ASSERT(RunLoop::isMain());
     563        ++unboundedSynchronousIPCCount;
     564    }
     565
     566    ~UnboundedSynchronousIPCScope()
     567    {
     568        ASSERT(RunLoop::isMain());
     569        ASSERT(unboundedSynchronousIPCCount);
     570        --unboundedSynchronousIPCCount;
     571    }
     572
     573    static bool hasOngoingUnboundedSyncIPC()
     574    {
     575        return unboundedSynchronousIPCCount.load() > 0;
     576    }
     577
     578private:
     579    static std::atomic<unsigned> unboundedSynchronousIPCCount;
     580};
     581
    557582} // namespace IPC
  • branches/safari-608.1-branch/Source/WebKit/Platform/IPC/Decoder.cpp

    r239427 r248352  
    8989}
    9090
    91 bool Decoder::shouldDispatchMessageWhenWaitingForSyncReply() const
    92 {
    93     return m_messageFlags & DispatchMessageWhenWaitingForSyncReply;
     91ShouldDispatchWhenWaitingForSyncReply Decoder::shouldDispatchMessageWhenWaitingForSyncReply() const
     92{
     93    if (m_messageFlags & DispatchMessageWhenWaitingForSyncReply)
     94        return ShouldDispatchWhenWaitingForSyncReply::Yes;
     95    if (m_messageFlags & DispatchMessageWhenWaitingForUnboundedSyncReply)
     96        return ShouldDispatchWhenWaitingForSyncReply::YesDuringUnboundedIPC;
     97    return ShouldDispatchWhenWaitingForSyncReply::No;
    9498}
    9599
  • branches/safari-608.1-branch/Source/WebKit/Platform/IPC/Decoder.h

    r243460 r248352  
    4040class DataReference;
    4141class ImportanceAssertion;
     42enum class ShouldDispatchWhenWaitingForSyncReply;
    4243
    4344class Decoder {
     
    5556
    5657    bool isSyncMessage() const;
    57     bool shouldDispatchMessageWhenWaitingForSyncReply() const;
     58    ShouldDispatchWhenWaitingForSyncReply shouldDispatchMessageWhenWaitingForSyncReply() const;
    5859    bool shouldUseFullySynchronousModeForTesting() const;
    5960
  • branches/safari-608.1-branch/Source/WebKit/Platform/IPC/Encoder.cpp

    r238798 r248352  
    8686}
    8787
    88 bool Encoder::shouldDispatchMessageWhenWaitingForSyncReply() const
    89 {
    90     return *buffer() & DispatchMessageWhenWaitingForSyncReply;
     88ShouldDispatchWhenWaitingForSyncReply Encoder::shouldDispatchMessageWhenWaitingForSyncReply() const
     89{
     90    if (*buffer() & DispatchMessageWhenWaitingForSyncReply)
     91        return ShouldDispatchWhenWaitingForSyncReply::Yes;
     92    if (*buffer() & DispatchMessageWhenWaitingForUnboundedSyncReply)
     93        return ShouldDispatchWhenWaitingForSyncReply::YesDuringUnboundedIPC;
     94    return ShouldDispatchWhenWaitingForSyncReply::No;
    9195}
    9296
     
    99103}
    100104
    101 void Encoder::setShouldDispatchMessageWhenWaitingForSyncReply(bool shouldDispatchMessageWhenWaitingForSyncReply)
    102 {
    103     if (shouldDispatchMessageWhenWaitingForSyncReply)
     105void Encoder::setShouldDispatchMessageWhenWaitingForSyncReply(ShouldDispatchWhenWaitingForSyncReply shouldDispatchWhenWaitingForSyncReply)
     106{
     107    switch (shouldDispatchWhenWaitingForSyncReply) {
     108    case ShouldDispatchWhenWaitingForSyncReply::No:
     109        *buffer() &= ~(DispatchMessageWhenWaitingForSyncReply | DispatchMessageWhenWaitingForUnboundedSyncReply);
     110        break;
     111    case ShouldDispatchWhenWaitingForSyncReply::Yes:
    104112        *buffer() |= DispatchMessageWhenWaitingForSyncReply;
    105     else
     113        *buffer() &= ~DispatchMessageWhenWaitingForUnboundedSyncReply;
     114        break;
     115    case ShouldDispatchWhenWaitingForSyncReply::YesDuringUnboundedIPC:
     116        *buffer() |= DispatchMessageWhenWaitingForUnboundedSyncReply;
    106117        *buffer() &= ~DispatchMessageWhenWaitingForSyncReply;
     118        break;
     119    }
    107120}
    108121
     
    117130    ASSERT(!original->isSyncMessage());
    118131
    119     original->setShouldDispatchMessageWhenWaitingForSyncReply(true);
     132    original->setShouldDispatchMessageWhenWaitingForSyncReply(ShouldDispatchWhenWaitingForSyncReply::Yes);
    120133
    121134    encodeVariableLengthByteArray(DataReference(original->buffer(), original->bufferSize()));
  • branches/safari-608.1-branch/Source/WebKit/Platform/IPC/Encoder.h

    r237294 r248352  
    3535
    3636class DataReference;
     37enum class ShouldDispatchWhenWaitingForSyncReply;
    3738
    3839class Encoder final {
     
    4950    bool isSyncMessage() const;
    5051
    51     void setShouldDispatchMessageWhenWaitingForSyncReply(bool);
    52     bool shouldDispatchMessageWhenWaitingForSyncReply() const;
     52    void setShouldDispatchMessageWhenWaitingForSyncReply(ShouldDispatchWhenWaitingForSyncReply);
     53    ShouldDispatchWhenWaitingForSyncReply shouldDispatchMessageWhenWaitingForSyncReply() const;
    5354
    5455    void setFullySynchronousModeForTesting();
  • branches/safari-608.1-branch/Source/WebKit/Platform/IPC/MessageFlags.h

    r188793 r248352  
    3232    SyncMessage = 1 << 0,
    3333    DispatchMessageWhenWaitingForSyncReply = 1 << 1,
    34     UseFullySynchronousModeForTesting = 1 << 2,
     34    DispatchMessageWhenWaitingForUnboundedSyncReply = 1 << 2,
     35    UseFullySynchronousModeForTesting = 1 << 3,
    3536};
     37
     38enum class ShouldDispatchWhenWaitingForSyncReply { No, Yes, YesDuringUnboundedIPC };
    3639
    3740} // namespace IPC
  • branches/safari-608.1-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r248349 r248352  
    12121212
    12131213    bool handled = false;
    1214     if (!page->sendSync(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply(), Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::Reply(handled)))
     1214    if (!page->sendSync(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply(), Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::Reply(handled), Seconds::infinity(), IPC::SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply))
    12151215        return reply(false);
    12161216    reply(handled);
  • branches/safari-608.1-branch/Source/WebKit/UIProcess/WebPageProxy.cpp

    r248348 r248352  
    26632663    m_process->responsivenessTimer().start();
    26642664    bool handled = false;
    2665     bool replyReceived = m_process->sendSync(Messages::WebPage::TouchEventSync(event), Messages::WebPage::TouchEventSync::Reply(handled), m_pageID, 1_s);
     2665    bool replyReceived = m_process->sendSync(Messages::WebPage::TouchEventSync(event), Messages::WebPage::TouchEventSync::Reply(handled), m_pageID, 1_s, IPC::SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply);
    26662666    // If the sync request has timed out, we should consider the event handled. The Web Process is too busy to answer any questions, so the default action is also likely to have issues.
    26672667    if (!replyReceived)
  • branches/safari-608.1-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r248343 r248352  
    19991999        return connection->waitForAndDispatchImmediately<Messages::WebPageProxy::DidReceivePositionInformation>(_page->pageID(), 1_s, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
    20002000
    2001     bool receivedResponse = _page->process().sendSync(Messages::WebPage::GetPositionInformation(request), Messages::WebPage::GetPositionInformation::Reply(_positionInformation), _page->pageID(), 1_s);
     2001    bool receivedResponse = _page->process().sendSync(Messages::WebPage::GetPositionInformation(request), Messages::WebPage::GetPositionInformation::Reply(_positionInformation), _page->pageID(), 1_s, IPC::SendSyncOption::ForceDispatchWhenDestinationIsWaitingForUnboundedSyncReply);
    20022002    _hasValidPositionInformation = receivedResponse && _positionInformation.canBeValid;
    20032003   
  • branches/safari-608.1-branch/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp

    r246452 r248352  
    565565
    566566    HangDetectionDisabler hangDetectionDisabler;
     567    IPC::UnboundedSynchronousIPCScope unboundedSynchronousIPCScope;
    567568
    568569    bool shouldNotifyOfUpload = request.hasUpload() && m_loadersWithUploads.isEmpty();
  • branches/safari-608.1-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r248349 r248352  
    308308bool WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply()
    309309{
     310    IPC::UnboundedSynchronousIPCScope unboundedSynchronousIPCScope;
    310311    bool handled = false;
    311     if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply(m_page.pageID()), Messages::NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::Reply(handled), 0, Seconds::infinity(), IPC::SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
     312    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply(m_page.pageID()), Messages::NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::Reply(handled), 0))
    312313        return false;
    313314    return handled;
     
    468469
    469470    HangDetectionDisabler hangDetectionDisabler;
    470 
    471     m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), IPC::SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply);
     471    IPC::UnboundedSynchronousIPCScope unboundedSynchronousIPCScope;
     472
     473    m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply());
    472474}
    473475
     
    484486
    485487    HangDetectionDisabler hangDetectionDisabler;
     488    IPC::UnboundedSynchronousIPCScope unboundedSynchronousIPCScope;
    486489
    487490    bool result = false;
    488     if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), IPC::SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
     491    if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result)))
    489492        return false;
    490493
     
    504507
    505508    HangDetectionDisabler hangDetectionDisabler;
    506 
    507     if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), IPC::SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
     509    IPC::UnboundedSynchronousIPCScope unboundedSynchronousIPCScope;
     510
     511    if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result)))
    508512        return false;
    509513
  • branches/safari-608.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r248349 r248352  
    317317static const Seconds maximumLayerVolatilityTimerInterval { 2_s };
    318318
    319 #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Layers, __VA_ARGS__)
    320 #define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), Layers, __VA_ARGS__)
     319#define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), channel, "%p - WebPage::" fmt, this, ##__VA_ARGS__)
     320#define RELEASE_LOG_ERROR_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), channel, "%p - WebPage::" fmt, this, ##__VA_ARGS__)
    321321
    322322class SendStopResponsivenessTimer {
     
    25522552        m_layerVolatilityTimer.stop();
    25532553        if (didSucceed)
    2554             RELEASE_LOG_IF_ALLOWED("%p - WebPage - Succeeded in marking layers as volatile", this);
     2554            RELEASE_LOG_IF_ALLOWED(Layers, "layerVolatilityTimerFired: Succeeded in marking layers as volatile");
    25552555        else
    2556             RELEASE_LOG_IF_ALLOWED("%p - WebPage - Failed to mark layers as volatile within %gms", this, maximumLayerVolatilityTimerInterval.milliseconds());
     2556            RELEASE_LOG_IF_ALLOWED(Layers, "layerVolatilityTimerFired: Failed to mark layers as volatile within %gms", maximumLayerVolatilityTimerInterval.milliseconds());
    25572557        callVolatilityCompletionHandlers(didSucceed);
    25582558        return;
    25592559    }
    25602560
    2561     RELEASE_LOG_ERROR_IF_ALLOWED("%p - WebPage - Failed to mark all layers as volatile, will retry in %g ms", this, newInterval.milliseconds());
     2561    RELEASE_LOG_ERROR_IF_ALLOWED(Layers, "layerVolatilityTimerFired: Failed to mark all layers as volatile, will retry in %g ms", newInterval.milliseconds());
    25622562    m_layerVolatilityTimer.startRepeating(newInterval);
    25632563}
     
    25702570void WebPage::markLayersVolatile(WTF::Function<void (bool)>&& completionHandler)
    25712571{
    2572     RELEASE_LOG_IF_ALLOWED("%p - WebPage::markLayersVolatile()", this);
     2572    RELEASE_LOG_IF_ALLOWED(Layers, "markLayersVolatile");
    25732573
    25742574    if (m_layerVolatilityTimer.isActive())
     
    25812581    if (didSucceed || m_isSuspendedUnderLock) {
    25822582        if (didSucceed)
    2583             RELEASE_LOG_IF_ALLOWED("%p - WebPage - Successfully marked layers as volatile", this);
     2583            RELEASE_LOG_IF_ALLOWED(Layers, "markLayersVolatile: Successfully marked layers as volatile");
    25842584        else {
    25852585            // If we get suspended when locking the screen, it is expected that some IOSurfaces cannot be marked as purgeable so we do not keep retrying.
    2586             RELEASE_LOG_IF_ALLOWED("%p - WebPage - Did what we could to mark IOSurfaces as purgeable after locking the screen", this);
     2586            RELEASE_LOG_IF_ALLOWED(Layers, "markLayersVolatile: Did what we could to mark IOSurfaces as purgeable after locking the screen");
    25872587        }
    25882588        callVolatilityCompletionHandlers(didSucceed);
     
    25902590    }
    25912591
    2592     RELEASE_LOG_IF_ALLOWED("%p - Failed to mark all layers as volatile, will retry in %g ms", this, initialLayerVolatilityTimerInterval.milliseconds());
     2592    RELEASE_LOG_IF_ALLOWED(Layers, "markLayersVolatile: Failed to mark all layers as volatile, will retry in %g ms", initialLayerVolatilityTimerInterval.milliseconds());
    25932593    m_layerVolatilityTimer.startRepeating(initialLayerVolatilityTimerInterval);
    25942594}
     
    25962596void WebPage::cancelMarkLayersVolatile()
    25972597{
    2598     RELEASE_LOG_IF_ALLOWED("%p - WebPage::cancelMarkLayersVolatile()", this);
     2598    RELEASE_LOG_IF_ALLOWED(Layers, "cancelMarkLayersVolatile");
    25992599    m_layerVolatilityTimer.stop();
    26002600    m_markLayersAsVolatileCompletionHandlers.clear();
     
    29062906void WebPage::touchEventSync(const WebTouchEvent& touchEvent, CompletionHandler<void(bool)>&& reply)
    29072907{
     2908    // Avoid UIProcess hangs when the WebContent process is stuck on a sync IPC.
     2909    if (IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC()) {
     2910        RELEASE_LOG_ERROR_IF_ALLOWED(Process, "touchEventSync - Not processing because the process is stuck on unbounded sync IPC");
     2911        return reply(true);
     2912    }
     2913
    29082914    m_pendingSynchronousTouchEventReply = WTFMove(reply);
    29092915
     
    32753281    unfreezeLayerTree(LayerTreeFreezeReason::PageTransition);
    32763282
    3277     RELEASE_LOG_IF_ALLOWED("%p - WebPage - Did complete page transition", this);
     3283    RELEASE_LOG_IF_ALLOWED(Layers, "didCompletePageTransition: Did complete page transition");
    32783284
    32793285    bool isInitialEmptyDocument = !m_mainFrame;
     
    35403546#if !PLATFORM(GTK) && !PLATFORM(WIN)
    35413547    if (!settings.acceleratedCompositingEnabled()) {
    3542         RELEASE_LOG_IF_ALLOWED("%p - WebPage - acceleratedCompositingEnabled setting was false. WebKit cannot function in this mode; changing setting to true", this);
     3548        RELEASE_LOG_IF_ALLOWED(Layers, "updatePreferences: acceleratedCompositingEnabled setting was false. WebKit cannot function in this mode; changing setting to true");
    35433549        settings.setAcceleratedCompositingEnabled(true);
    35443550    }
     
    58775883void WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::DelayedReply&& reply)
    58785884{
     5885    RELEASE_ASSERT(IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC());
    58795886    reply(true);
    58805887}
  • branches/safari-608.1-branch/Source/WebKit/WebProcess/WebPage/WebPage.h

    r248349 r248352  
    11681168
    11691169    template<typename T>
    1170     bool sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply, OptionSet<IPC::SendSyncOption> sendSyncOptions = { })
     1170    bool sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply)
    11711171    {
    11721172        cancelGesturesBlockedOnSynchronousReplies();
    1173         return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), sendSyncOptions | IPC::SendSyncOption::InformPlatformProcessWillSuspend);
     1173        return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
    11741174    }
    11751175
  • branches/safari-608.1-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r248343 r248352  
    133133#import <wtf/text/TextStream.h>
    134134
     135#define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), channel, "%p - WebPage::" fmt, this, ##__VA_ARGS__)
     136#define RELEASE_LOG_ERROR_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), channel, "%p - WebPage::" fmt, this, ##__VA_ARGS__)
     137
    135138namespace WebKit {
    136139using namespace WebCore;
     
    25432546void WebPage::getPositionInformation(const InteractionInformationRequest& request, CompletionHandler<void(InteractionInformationAtPosition&&)>&& reply)
    25442547{
     2548    // Avoid UIProcess hangs when the WebContent process is stuck on a sync IPC.
     2549    if (IPC::UnboundedSynchronousIPCScope::hasOngoingUnboundedSyncIPC()) {
     2550        RELEASE_LOG_ERROR_IF_ALLOWED(Process, "getPositionInformation - Not processing because the process is stuck on unbounded sync IPC");
     2551        return reply({ });
     2552    }
     2553
    25452554    m_pendingSynchronousPositionInformationReply = WTFMove(reply);
    25462555
     
    40164025} // namespace WebKit
    40174026
     4027#undef RELEASE_LOG_IF_ALLOWED
     4028#undef RELEASE_LOG_ERROR_IF_ALLOWED
     4029
    40184030#endif // PLATFORM(IOS_FAMILY)
Note: See TracChangeset for help on using the changeset viewer.