Changeset 167866 in webkit


Ignore:
Timestamp:
Apr 27, 2014 6:55:35 PM (10 years ago)
Author:
ap@apple.com
Message:

Don't use DispatchMessageEvenWhenWaitingForSyncReply for messages from NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=132144

Reviewed by Darin Adler.

  • NetworkProcess/AsynchronousNetworkLoaderClient.cpp:

(WebKit::AsynchronousNetworkLoaderClient::willSendRequest):
(WebKit::AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace):
Dont use the IPC::DispatchMessageEvenWhenWaitingForSyncReply flag. It's not needed,
almost never works in NetworkProcess, but may cause trouble if it did.

  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): Removed
setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage()
function call, because there are no more any messages in NetworkProcess it could affect.

  • Platform/IPC/Connection.cpp: (IPC::Connection::dispatchMessage): Added a FIXME

for an unrelated bug Anders and myself noticed while looking into this.

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r167865 r167866  
     12014-04-27  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Don't use DispatchMessageEvenWhenWaitingForSyncReply for messages from NetworkProcess
     4        https://bugs.webkit.org/show_bug.cgi?id=132144
     5
     6        Reviewed by Darin Adler.
     7
     8        * NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
     9        (WebKit::AsynchronousNetworkLoaderClient::willSendRequest):
     10        (WebKit::AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace):
     11        Dont use the IPC::DispatchMessageEvenWhenWaitingForSyncReply flag. It's not needed,
     12        almost never works in NetworkProcess, but may cause trouble if it did.
     13
     14        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     15        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): Removed
     16        setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage()
     17        function call, because there are no more any messages in NetworkProcess it could affect.
     18
     19        * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchMessage): Added a FIXME
     20        for an unrelated bug Anders and myself noticed while looking into this.
     21
    1222014-04-27  Dan Bernstein  <mitz@apple.com>
    223
  • trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp

    r167853 r167866  
    5151void AsynchronousNetworkLoaderClient::willSendRequest(NetworkResourceLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
    5252{
    53     // This message is DispatchMessageEvenWhenWaitingForSyncReply to avoid a situation where the NetworkProcess is deadlocked
    54     // waiting for 6 connections to complete while the WebProcess is waiting for a 7th (Synchronous XHR) to complete.
    55     loader->sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
     53    loader->sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse));
    5654}
    5755
     
    5957void AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace(NetworkResourceLoader* loader, const ProtectionSpace& protectionSpace)
    6058{
    61     // This message is DispatchMessageEvenWhenWaitingForSyncReply to avoid a situation where the NetworkProcess is deadlocked
    62     // waiting for 6 connections to complete while the WebProcess is waiting for a 7th (Synchronous XHR) to complete.
    63     loader->sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
     59    loader->sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace));
    6460}
    6561#endif
  • trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r167635 r167866  
    5959{
    6060    m_connection = IPC::Connection::createServerConnection(connectionIdentifier, this, RunLoop::main());
    61     m_connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true);
    6261    m_connection->open();
    6362}
  • trunk/Source/WebKit2/Platform/IPC/Connection.cpp

    r167854 r167866  
    795795    m_inDispatchMessageCount--;
    796796
     797    // FIXME: For Delayed synchronous messages, we should not decrement the counter until we send a response.
     798    // Otherwise, we would deadlock if processing the message results in a sync message back after we exit this function.
    797799    if (message->shouldDispatchMessageWhenWaitingForSyncReply())
    798800        m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount--;
Note: See TracChangeset for help on using the changeset viewer.