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

Changeset 247822 in webkit


Ignore:
Timestamp:
Jul 25, 2019, 8:42:11 AM (7 years ago)
Author:
Chris Dumez
Message:

Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
https://bugs.webkit.org/show_bug.cgi?id=200107
<rdar://problem/53034592>

Reviewed by Geoffrey Garen.

Source/WebCore:

Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.

Test: fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html

  • page/ChromeClient.h:
  • testing/Internals.cpp:

(WebCore::Internals::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):

  • testing/Internals.h:
  • testing/Internals.idl:

Source/WebKit:

  • Platform/IPC/Connection.cpp:

(IPC::Connection::SyncMessageState::incrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount):
(IPC::Connection::SyncMessageState::decrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount):
(IPC::Connection::SyncMessageState::processIncomingMessage):
(IPC::Connection::sendSyncMessage):

  • Platform/IPC/Connection.h:

Add support for new SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply flag
to allow processing incoming sync messages while sending a particular sync IPC. This is the
default behavior in all processes except in the WebContent process, where we try to avoid
re-entering to prevent bugs. This flag allows the WebContent process to change its default
behavior for some specific IPCs, where we know it is safe to re-enter and where it benefits
performance to re-renter.

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):

  • NetworkProcess/NetworkConnectionToWebProcess.h:
  • NetworkProcess/NetworkConnectionToWebProcess.messages.in:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::didReceiveSyncMessage):
(WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):

  • UIProcess/Network/NetworkProcessProxy.h:
  • UIProcess/Network/NetworkProcessProxy.messages.in:
  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):

  • WebProcess/WebCoreSupport/WebChromeClient.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):

  • WebProcess/WebPage/WebPage.h:

(WebKit::WebPage::sendSyncWithDelayedReply):

  • WebProcess/WebPage/WebPage.messages.in:

SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply
Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply
flag.

  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::runJavaScriptAlert):
(WebKit::WebChromeClient::runJavaScriptConfirm):
(WebKit::WebChromeClient::runJavaScriptPrompt):
Use new SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply flag when sending
the synchronous IPC for JS alerts / prompt / confirm. This allows the WebProcess to process
incoming synchronous IPC for other processes (in particular the UIProcess) while it is blocked
on those synchronous IPCs. It is safe to re-enter the WebContent process on these sync IPCs
since they are triggered by JS and we return to JS right after. This should avoid UIProcess
hangs when the UIProcess is sending a sync IPC to the WebContent process, which is itself
stuck on the sync IPC to show a JS alert.

LayoutTests:

Add layout test coverage for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.
Without the flag on the sendSync from the WebContent process of the
NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply IPC, the
test would hang. This is because the WebContent process sends a sync IPC to the network process,
which in turns sends one to the UIProcess, which itself sends one back to the WebContent process.
This would attempt to re-enter the WebContent process which is currently sending a sync IPC, which
is not allowed by default.

  • fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply-expected.txt: Added.
  • fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html: Added.
Location:
trunk
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247821 r247822  
     12019-07-25  Chris Dumez  <cdumez@apple.com>
     2
     3        Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
     4        https://bugs.webkit.org/show_bug.cgi?id=200107
     5        <rdar://problem/53034592>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Add layout test coverage for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.
     10        Without the flag on the sendSync from the WebContent process of the
     11        NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply IPC, the
     12        test would hang. This is because the WebContent process sends a sync IPC to the network process,
     13        which in turns sends one to the UIProcess, which itself sends one back to the WebContent process.
     14        This would attempt to re-enter the WebContent process which is currently sending a sync IPC, which
     15        is not allowed by default.
     16
     17        * fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply-expected.txt: Added.
     18        * fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html: Added.
     19
    1202019-07-25  Rob Buis  <rbuis@igalia.com>
    221
  • trunk/Source/WebCore/ChangeLog

    r247821 r247822  
     12019-07-25  Chris Dumez  <cdumez@apple.com>
     2
     3        Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
     4        https://bugs.webkit.org/show_bug.cgi?id=200107
     5        <rdar://problem/53034592>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply.
     10
     11        Test: fast/misc/testProcessIncomingSyncMessagesWhenWaitingForSyncReply.html
     12
     13        * page/ChromeClient.h:
     14        * testing/Internals.cpp:
     15        (WebCore::Internals::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     16        * testing/Internals.h:
     17        * testing/Internals.idl:
     18
    1192019-07-25  Rob Buis  <rbuis@igalia.com>
    220
  • trunk/Source/WebCore/page/ChromeClient.h

    r246285 r247822  
    382382#endif
    383383
     384    virtual bool testProcessIncomingSyncMessagesWhenWaitingForSyncReply() { return true; }
     385
    384386#if PLATFORM(IOS_FAMILY)
    385387    // FIXME: Come up with a more descriptive name for this function and make it platform independent (if possible).
  • trunk/Source/WebCore/testing/Internals.cpp

    r247821 r247822  
    22762276}
    22772277
     2278bool Internals::testProcessIncomingSyncMessagesWhenWaitingForSyncReply()
     2279{
     2280    ASSERT(contextDocument());
     2281    ASSERT(contextDocument()->page());
     2282    return contextDocument()->page()->chrome().client().testProcessIncomingSyncMessagesWhenWaitingForSyncReply();
     2283}
     2284
    22782285void Internals::setAutomaticDashSubstitutionEnabled(bool enabled)
    22792286{
  • trunk/Source/WebCore/testing/Internals.h

    r247821 r247822  
    332332    void toggleOverwriteModeEnabled();
    333333
     334    bool testProcessIncomingSyncMessagesWhenWaitingForSyncReply();
     335
    334336    ExceptionOr<RefPtr<Range>> rangeOfString(const String&, RefPtr<Range>&&, const Vector<String>& findOptions);
    335337    ExceptionOr<unsigned> countMatchesForText(const String&, const Vector<String>& findOptions, const String& markMatches);
  • trunk/Source/WebCore/testing/Internals.idl

    r247821 r247822  
    383383    [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
    384384
     385    boolean testProcessIncomingSyncMessagesWhenWaitingForSyncReply();
     386
    385387    // Flags for layerTreeAsText.
    386388    const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
  • trunk/Source/WebKit/ChangeLog

    r247821 r247822  
     12019-07-25  Chris Dumez  <cdumez@apple.com>
     2
     3        Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts
     4        https://bugs.webkit.org/show_bug.cgi?id=200107
     5        <rdar://problem/53034592>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * Platform/IPC/Connection.cpp:
     10        (IPC::Connection::SyncMessageState::incrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount):
     11        (IPC::Connection::SyncMessageState::decrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount):
     12        (IPC::Connection::SyncMessageState::processIncomingMessage):
     13        (IPC::Connection::sendSyncMessage):
     14        * Platform/IPC/Connection.h:
     15        Add support for new SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply flag
     16        to allow processing incoming sync messages while sending a particular sync IPC. This is the
     17        default behavior in all processes except in the WebContent process, where we try to avoid
     18        re-entering to prevent bugs. This flag allows the WebContent process to change its default
     19        behavior for some specific IPCs, where we know it is safe to re-enter and where it benefits
     20        performance to re-renter.
     21
     22        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     23        (WebKit::NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     24        * NetworkProcess/NetworkConnectionToWebProcess.h:
     25        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
     26        * UIProcess/Network/NetworkProcessProxy.cpp:
     27        (WebKit::NetworkProcessProxy::didReceiveSyncMessage):
     28        (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     29        * UIProcess/Network/NetworkProcessProxy.h:
     30        * UIProcess/Network/NetworkProcessProxy.messages.in:
     31        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     32        (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     33        * WebProcess/WebCoreSupport/WebChromeClient.h:
     34        * WebProcess/WebPage/WebPage.cpp:
     35        (WebKit::WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
     36        * WebProcess/WebPage/WebPage.h:
     37        (WebKit::WebPage::sendSyncWithDelayedReply):
     38        * WebProcess/WebPage/WebPage.messages.in:
     39        SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply
     40        Add testing infrastructure for SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply
     41        flag.
     42
     43        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     44        (WebKit::WebChromeClient::runJavaScriptAlert):
     45        (WebKit::WebChromeClient::runJavaScriptConfirm):
     46        (WebKit::WebChromeClient::runJavaScriptPrompt):
     47        Use new SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply flag when sending
     48        the synchronous IPC for JS alerts / prompt / confirm. This allows the WebProcess to process
     49        incoming synchronous IPC for other processes (in particular the UIProcess) while it is blocked
     50        on those synchronous IPCs. It is safe to re-enter the WebContent process on these sync IPCs
     51        since they are triggered by JS and we return to JS right after. This should avoid UIProcess
     52        hangs when the UIProcess is sending a sync IPC to the WebContent process, which is itself
     53        stuck on the sync IPC to show a JS alert.
     54
    1552019-07-25  Rob Buis  <rbuis@igalia.com>
    256
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r247558 r247822  
    3535#include "NetworkProcessConnectionMessages.h"
    3636#include "NetworkProcessMessages.h"
     37#include "NetworkProcessProxyMessages.h"
    3738#include "NetworkRTCMonitorMessages.h"
    3839#include "NetworkRTCProviderMessages.h"
     
    412413}
    413414
     415void NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply(WebCore::PageIdentifier webPageID, Messages::NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::DelayedReply&& reply)
     416{
     417    bool handled = false;
     418    if (!m_networkProcess->parentProcessConnection()->sendSync(Messages::NetworkProcessProxy::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply(webPageID), Messages::NetworkProcessProxy::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::Reply(handled), 0))
     419        return reply(false);
     420    reply(handled);
     421}
     422
    414423void NetworkConnectionToWebProcess::loadPing(NetworkResourceLoadParameters&& loadParameters)
    415424{
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

    r246452 r247822  
    166166    void scheduleResourceLoad(NetworkResourceLoadParameters&&);
    167167    void performSynchronousLoad(NetworkResourceLoadParameters&&, Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&&);
     168    void testProcessIncomingSyncMessagesWhenWaitingForSyncReply(WebCore::PageIdentifier, Messages::NetworkConnectionToWebProcess::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::DelayedReply&&);
    168169    void loadPing(NetworkResourceLoadParameters&&);
    169170    void prefetchDNS(const String&);
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in

    r246452 r247822  
    2525    ScheduleResourceLoad(WebKit::NetworkResourceLoadParameters resourceLoadParameters)
    2626    PerformSynchronousLoad(WebKit::NetworkResourceLoadParameters resourceLoadParameters) -> (WebCore::ResourceError error, WebCore::ResourceResponse response, Vector<char> data) Synchronous
     27    TestProcessIncomingSyncMessagesWhenWaitingForSyncReply(WebCore::PageIdentifier webPageID) -> (bool handled) Synchronous
    2728    LoadPing(WebKit::NetworkResourceLoadParameters resourceLoadParameters)
    2829    RemoveLoadIdentifier(uint64_t resourceLoadIdentifier)
  • trunk/Source/WebKit/Platform/IPC/Connection.cpp

    r247486 r247822  
    9999    void dispatchMessages(Connection* allowedConnection);
    100100
     101    void incrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount() { ++m_processIncomingSyncMessagesWhenWaitingForSyncReplyCount; }
     102    void decrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount() { --m_processIncomingSyncMessagesWhenWaitingForSyncReplyCount; }
     103
    101104private:
    102105    void dispatchMessageAndResetDidScheduleDispatchMessagesForConnection(Connection&);
     
    115118    };
    116119    Vector<ConnectionAndIncomingMessage> m_messagesToDispatchWhileWaitingForSyncReply;
     120
     121    std::atomic<unsigned> m_processIncomingSyncMessagesWhenWaitingForSyncReplyCount { 0 };
    117122};
    118123
     
    135140bool Connection::SyncMessageState::processIncomingMessage(Connection& connection, std::unique_ptr<Decoder>& message)
    136141{
    137     if (!message->shouldDispatchMessageWhenWaitingForSyncReply())
     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)
    138152        return false;
    139153
     
    566580    sendMessage(WTFMove(encoder), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
    567581
     582    if (sendSyncOptions.contains(SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
     583        SyncMessageState::singleton().incrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount();
     584
    568585    // Then wait for a reply. Waiting for a reply could involve dispatching incoming sync messages, so
    569586    // keep an extra reference to the connection here in case it's invalidated.
    570587    Ref<Connection> protect(*this);
    571588    std::unique_ptr<Decoder> reply = waitForSyncReply(syncRequestID, timeout, sendSyncOptions);
     589
     590    if (sendSyncOptions.contains(SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
     591        SyncMessageState::singleton().decrementProcessIncomingSyncMessagesWhenWaitingForSyncReplyCount();
    572592
    573593    --m_inSendSyncCount;
  • trunk/Source/WebKit/Platform/IPC/Connection.h

    r247486 r247822  
    6969    InformPlatformProcessWillSuspend = 1 << 0,
    7070    UseFullySynchronousModeForTesting = 1 << 1,
     71    ProcessIncomingSyncMessagesWhenWaitingForSyncReply = 1 << 2,
    7172};
    7273
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r245796 r247822  
    4141#include "StorageAccessStatus.h"
    4242#include "WebCompiledContentRuleList.h"
     43#include "WebPageMessages.h"
    4344#include "WebPageProxy.h"
    4445#include "WebProcessMessages.h"
     
    269270        return;
    270271
    271     ASSERT_NOT_REACHED();
     272    didReceiveSyncNetworkProcessProxyMessage(connection, decoder, replyEncoder);
    272273}
    273274
     
    12041205}
    12051206
     1207void NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply(WebCore::PageIdentifier webPageID, Messages::NetworkProcessProxy::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::DelayedReply&& reply)
     1208{
     1209    auto* page = WebProcessProxy::webPage(webPageID);
     1210    if (!page)
     1211        return reply(false);
     1212
     1213    bool handled = false;
     1214    if (!page->sendSync(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply(), Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::Reply(handled)))
     1215        return reply(false);
     1216    reply(handled);
     1217}
     1218
    12061219#if ENABLE(INDEXED_DATABASE)
    12071220void NetworkProcessProxy::createSymLinkForFileUpgrade(const String& indexedDatabaseDirectory)
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h

    r245796 r247822  
    164164    void didSyncAllCookies();
    165165
     166    void testProcessIncomingSyncMessagesWhenWaitingForSyncReply(WebCore::PageIdentifier, Messages::NetworkProcessProxy::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::DelayedReply&&);
     167
    166168    ProcessThrottler& throttler() { return m_throttler; }
    167169    WebProcessPool& processPool() { return m_processPool; }
     
    204206    void didClose(IPC::Connection&) override;
    205207    void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
     208    void didReceiveSyncNetworkProcessProxyMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
    206209
    207210    // Message handlers
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in

    r245796 r247822  
    3131
    3232    DidSyncAllCookies()
     33
     34    TestProcessIncomingSyncMessagesWhenWaitingForSyncReply(WebCore::PageIdentifier webPageID) -> (bool handled) Synchronous
    3335
    3436    ProcessReadyToSuspend()
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r246285 r247822  
    3737#include "InjectedBundleNodeHandle.h"
    3838#include "NavigationActionData.h"
     39#include "NetworkConnectionToWebProcessMessages.h"
     40#include "NetworkProcessConnection.h"
    3941#include "PageBanner.h"
    4042#include "UserData.h"
     
    304306}
    305307
     308bool WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply()
     309{
     310    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        return false;
     313    return handled;
     314}
     315
    306316void WebChromeClient::show()
    307317{
     
    459469    HangDetectionDisabler hangDetectionDisabler;
    460470
    461     m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply());
     471    m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), IPC::SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply);
    462472}
    463473
     
    476486
    477487    bool result = false;
    478     if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result)))
     488    if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), IPC::SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
    479489        return false;
    480490
     
    495505    HangDetectionDisabler hangDetectionDisabler;
    496506
    497     if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result)))
     507    if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), IPC::SendSyncOption::ProcessIncomingSyncMessagesWhenWaitingForSyncReply))
    498508        return false;
    499509
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h

    r246285 r247822  
    223223    void contentRuleListNotification(const URL&, const WebCore::ContentRuleListResults&) final;
    224224
     225    bool testProcessIncomingSyncMessagesWhenWaitingForSyncReply() final;
     226
    225227#if PLATFORM(WIN)
    226228    void setLastSetCursorToCurrentCursor() final { }
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r247820 r247822  
    58865886}
    58875887
     5888void WebPage::testProcessIncomingSyncMessagesWhenWaitingForSyncReply(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::DelayedReply&& reply)
     5889{
     5890    reply(true);
     5891}
     5892
    58885893#if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
    58895894static const int primarySnapshottedPlugInSearchLimit = 3000;
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r247820 r247822  
    5050#include "UserData.h"
    5151#include "WebBackForwardListProxy.h"
     52#include "WebPageMessages.h"
    5253#include "WebURLSchemeHandler.h"
    5354#include "WebUndoStepID.h"
     
    11671168
    11681169    template<typename T>
    1169     bool sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply)
     1170    bool sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply, OptionSet<IPC::SendSyncOption> sendSyncOptions = { })
    11701171    {
    11711172        cancelGesturesBlockedOnSynchronousReplies();
    1172         return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
     1173        return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), sendSyncOptions | IPC::SendSyncOption::InformPlatformProcessWillSuspend);
    11731174    }
    11741175
     
    12911292    bool executeKeypressCommandsInternal(const Vector<WebCore::KeypressCommand>&, WebCore::KeyboardEvent*);
    12921293#endif
     1294
     1295    void testProcessIncomingSyncMessagesWhenWaitingForSyncReply(Messages::WebPage::TestProcessIncomingSyncMessagesWhenWaitingForSyncReply::DelayedReply&&);
    12931296
    12941297    void updateDrawingAreaLayerTreeFreezeState();
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in

    r247820 r247822  
    3131    SendCSPViolationReport(uint64_t frameID, URL reportURL, IPC::FormDataReference reportData)
    3232    EnqueueSecurityPolicyViolationEvent(uint64_t frameID, WebCore::SecurityPolicyViolationEvent::Init eventInit)
     33
     34    TestProcessIncomingSyncMessagesWhenWaitingForSyncReply() -> (bool handled) Synchronous
    3335
    3436#if PLATFORM(COCOA)
Note: See TracChangeset for help on using the changeset viewer.