Changeset 247565 in webkit


Ignore:
Timestamp:
Jul 18, 2019 10:44:54 AM (5 years ago)
Author:
Chris Dumez
Message:

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:
Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r247563 r247565  
     12019-07-18  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r247486) Multiple Layout Tests in http/tests/cache/* are crashing on iOS Debug WK2
     4        https://bugs.webkit.org/show_bug.cgi?id=199892
     5        <rdar://problem/53230217>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        The StorageManager was unregistering itself as a WorkQueueMessageReceiver on a given IPC
     10        connection too early. As a result, we would sometimes receive a 'StorageManager:DestroyStorageMap'
     11        IPC in NetworkConnectionToWebProcess::didReceiveMessage() with nobody to process it, which would
     12        trigger an assertion. To address the issue, we stop unregistering the StorageManager as a
     13        WorkQueueMessageReceiver inside removeAllowedSessionStorageNamespaceConnection(). Instead, we
     14        let the logic inside processDidCloseConnection() take care of it once the connection closes.
     15
     16        * NetworkProcess/WebStorage/StorageManager.cpp:
     17        (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
     18        (WebKit::StorageManager::processDidCloseConnection):
     19        * NetworkProcess/WebStorage/StorageManager.h:
     20
    1212019-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
    222
  • trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp

    r247555 r247565  
    538538{
    539539    auto allowedConnectionID = allowedConnection.uniqueID();
    540     if (m_connections.remove(allowedConnectionID))
    541         allowedConnection.removeWorkQueueMessageReceiver(Messages::StorageManager::messageReceiverName());
    542 
    543540    m_queue->dispatch([this, protectedThis = makeRef(*this), allowedConnectionID, storageNamespaceID]() mutable {
    544541        ASSERT(m_sessionStorageNamespaces.contains(storageNamespaceID));
     
    575572void StorageManager::processDidCloseConnection(IPC::Connection& connection)
    576573{
    577     if (m_connections.removeAll(connection.uniqueID()))
     574    if (m_connections.remove(connection.uniqueID()))
    578575        connection.removeWorkQueueMessageReceiver(Messages::StorageManager::messageReceiverName());
    579576
  • trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManager.h

    r247555 r247565  
    3232#include <wtf/Forward.h>
    3333#include <wtf/Function.h>
    34 #include <wtf/HashCountedSet.h>
    3534#include <wtf/HashSet.h>
    3635#include <wtf/text/StringHash.h>
     
    114113
    115114    HashMap<std::pair<IPC::Connection::UniqueID, uint64_t>, RefPtr<StorageArea>> m_storageAreasByConnection;
    116     HashCountedSet<IPC::Connection::UniqueID> m_connections;
     115    HashSet<IPC::Connection::UniqueID> m_connections;
    117116
    118117    enum class State {
Note: See TracChangeset for help on using the changeset viewer.