Title: [247631] branches/safari-608-branch/Source/WebKit
Revision
247631
Author
alanc...@apple.com
Date
2019-07-18 18:39:54 -0700 (Thu, 18 Jul 2019)

Log Message

Cherry-pick r247565. rdar://problem/53279116

    Regression(r247486) Multiple Layout Tests in http/tests/cache/* are crashing on iOS Debug WK2
    https://bugs.webkit.org/show_bug.cgi?id=199892
    <rdar://problem/53230217>

    Reviewed by Geoffrey Garen.

    The StorageManager was unregistering itself as a WorkQueueMessageReceiver on a given IPC
    connection too early. As a result, we would sometimes receive a 'StorageManager:DestroyStorageMap'
    IPC in NetworkConnectionToWebProcess::didReceiveMessage() with nobody to process it, which would
    trigger an assertion. To address the issue, we stop unregistering the StorageManager as a
    WorkQueueMessageReceiver inside removeAllowedSessionStorageNamespaceConnection(). Instead, we
    let the logic inside processDidCloseConnection() take care of it once the connection closes.

    * NetworkProcess/WebStorage/StorageManager.cpp:
    (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
    (WebKit::StorageManager::processDidCloseConnection):
    * NetworkProcess/WebStorage/StorageManager.h:

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

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (247630 => 247631)


--- branches/safari-608-branch/Source/WebKit/ChangeLog	2019-07-19 01:39:52 UTC (rev 247630)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog	2019-07-19 01:39:54 UTC (rev 247631)
@@ -1,5 +1,50 @@
 2019-07-18  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r247565. rdar://problem/53279116
+
+    Regression(r247486) Multiple Layout Tests in http/tests/cache/* are crashing on iOS Debug WK2
+    https://bugs.webkit.org/show_bug.cgi?id=199892
+    <rdar://problem/53230217>
+    
+    Reviewed by Geoffrey Garen.
+    
+    The StorageManager was unregistering itself as a WorkQueueMessageReceiver on a given IPC
+    connection too early. As a result, we would sometimes receive a 'StorageManager:DestroyStorageMap'
+    IPC in NetworkConnectionToWebProcess::didReceiveMessage() with nobody to process it, which would
+    trigger an assertion. To address the issue, we stop unregistering the StorageManager as a
+    WorkQueueMessageReceiver inside removeAllowedSessionStorageNamespaceConnection(). Instead, we
+    let the logic inside processDidCloseConnection() take care of it once the connection closes.
+    
+    * NetworkProcess/WebStorage/StorageManager.cpp:
+    (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
+    (WebKit::StorageManager::processDidCloseConnection):
+    * NetworkProcess/WebStorage/StorageManager.h:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-18  Chris Dumez  <cdu...@apple.com>
+
+            Regression(r247486) Multiple Layout Tests in http/tests/cache/* are crashing on iOS Debug WK2
+            https://bugs.webkit.org/show_bug.cgi?id=199892
+            <rdar://problem/53230217>
+
+            Reviewed by Geoffrey Garen.
+
+            The StorageManager was unregistering itself as a WorkQueueMessageReceiver on a given IPC
+            connection too early. As a result, we would sometimes receive a 'StorageManager:DestroyStorageMap'
+            IPC in NetworkConnectionToWebProcess::didReceiveMessage() with nobody to process it, which would
+            trigger an assertion. To address the issue, we stop unregistering the StorageManager as a
+            WorkQueueMessageReceiver inside removeAllowedSessionStorageNamespaceConnection(). Instead, we
+            let the logic inside processDidCloseConnection() take care of it once the connection closes.
+
+            * NetworkProcess/WebStorage/StorageManager.cpp:
+            (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
+            (WebKit::StorageManager::processDidCloseConnection):
+            * NetworkProcess/WebStorage/StorageManager.h:
+
+2019-07-18  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r247552. rdar://problem/53279120
 
     Set WordIsNearTap flag, was not being set at all before

Modified: branches/safari-608-branch/Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp (247630 => 247631)


--- branches/safari-608-branch/Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp	2019-07-19 01:39:52 UTC (rev 247630)
+++ branches/safari-608-branch/Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp	2019-07-19 01:39:54 UTC (rev 247631)
@@ -537,9 +537,6 @@
 void StorageManager::removeAllowedSessionStorageNamespaceConnection(uint64_t storageNamespaceID, IPC::Connection& allowedConnection)
 {
     auto allowedConnectionID = allowedConnection.uniqueID();
-    if (m_connections.remove(allowedConnectionID))
-        allowedConnection.removeWorkQueueMessageReceiver(Messages::StorageManager::messageReceiverName());
-
     m_queue->dispatch([this, protectedThis = makeRef(*this), allowedConnectionID, storageNamespaceID]() mutable {
         ASSERT(m_sessionStorageNamespaces.contains(storageNamespaceID));
         if (auto* sessionStorageNamespace = m_sessionStorageNamespaces.get(storageNamespaceID))
@@ -574,7 +571,7 @@
 
 void StorageManager::processDidCloseConnection(IPC::Connection& connection)
 {
-    if (m_connections.removeAll(connection.uniqueID()))
+    if (m_connections.remove(connection.uniqueID()))
         connection.removeWorkQueueMessageReceiver(Messages::StorageManager::messageReceiverName());
 
     m_queue->dispatch([this, protectedThis = makeRef(*this), connectionID = connection.uniqueID()]() mutable {

Modified: branches/safari-608-branch/Source/WebKit/NetworkProcess/WebStorage/StorageManager.h (247630 => 247631)


--- branches/safari-608-branch/Source/WebKit/NetworkProcess/WebStorage/StorageManager.h	2019-07-19 01:39:52 UTC (rev 247630)
+++ branches/safari-608-branch/Source/WebKit/NetworkProcess/WebStorage/StorageManager.h	2019-07-19 01:39:54 UTC (rev 247631)
@@ -31,7 +31,6 @@
 #include <WebCore/StorageMap.h>
 #include <wtf/Forward.h>
 #include <wtf/Function.h>
-#include <wtf/HashCountedSet.h>
 #include <wtf/HashSet.h>
 #include <wtf/text/StringHash.h>
 
@@ -113,7 +112,7 @@
     HashMap<uint64_t, RefPtr<SessionStorageNamespace>> m_sessionStorageNamespaces;
 
     HashMap<std::pair<IPC::Connection::UniqueID, uint64_t>, RefPtr<StorageArea>> m_storageAreasByConnection;
-    HashCountedSet<IPC::Connection::UniqueID> m_connections;
+    HashSet<IPC::Connection::UniqueID> m_connections;
 
     enum class State {
         Running,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to