Title: [167866] trunk/Source/WebKit2
Revision
167866
Author
[email protected]
Date
2014-04-27 18:55:35 -0700 (Sun, 27 Apr 2014)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (167865 => 167866)


--- trunk/Source/WebKit2/ChangeLog	2014-04-27 23:13:05 UTC (rev 167865)
+++ trunk/Source/WebKit2/ChangeLog	2014-04-28 01:55:35 UTC (rev 167866)
@@ -1,3 +1,24 @@
+2014-04-27  Alexey Proskuryakov  <[email protected]>
+
+        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.
+
 2014-04-27  Dan Bernstein  <[email protected]>
 
         [Cocoa] -[WKWebProcessPlugInController parameters] returns nil if no parameters have been set yet

Modified: trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp (167865 => 167866)


--- trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp	2014-04-27 23:13:05 UTC (rev 167865)
+++ trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp	2014-04-28 01:55:35 UTC (rev 167866)
@@ -50,17 +50,13 @@
 
 void AsynchronousNetworkLoaderClient::willSendRequest(NetworkResourceLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
 {
-    // This message is DispatchMessageEvenWhenWaitingForSyncReply to avoid a situation where the NetworkProcess is deadlocked
-    // waiting for 6 connections to complete while the WebProcess is waiting for a 7th (Synchronous XHR) to complete.
-    loader->sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+    loader->sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse));
 }
 
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
 void AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace(NetworkResourceLoader* loader, const ProtectionSpace& protectionSpace)
 {
-    // This message is DispatchMessageEvenWhenWaitingForSyncReply to avoid a situation where the NetworkProcess is deadlocked
-    // waiting for 6 connections to complete while the WebProcess is waiting for a 7th (Synchronous XHR) to complete.
-    loader->sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+    loader->sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace));
 }
 #endif
 

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (167865 => 167866)


--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2014-04-27 23:13:05 UTC (rev 167865)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp	2014-04-28 01:55:35 UTC (rev 167866)
@@ -58,7 +58,6 @@
     : m_serialLoadingEnabled(false)
 {
     m_connection = IPC::Connection::createServerConnection(connectionIdentifier, this, RunLoop::main());
-    m_connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true);
     m_connection->open();
 }
 

Modified: trunk/Source/WebKit2/Platform/IPC/Connection.cpp (167865 => 167866)


--- trunk/Source/WebKit2/Platform/IPC/Connection.cpp	2014-04-27 23:13:05 UTC (rev 167865)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.cpp	2014-04-28 01:55:35 UTC (rev 167866)
@@ -794,6 +794,8 @@
     m_didReceiveInvalidMessage |= message->isInvalid();
     m_inDispatchMessageCount--;
 
+    // FIXME: For Delayed synchronous messages, we should not decrement the counter until we send a response.
+    // Otherwise, we would deadlock if processing the message results in a sync message back after we exit this function.
     if (message->shouldDispatchMessageWhenWaitingForSyncReply())
         m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount--;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to