[webkit-changes] [WebKit/WebKit] f93a66: [Debug] ASSERTION FAILED: m_activeConnections.cont...

Sihui noreply at github.com
Tue Jan 2 15:50:01 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f93a6655d71b97847a7d3855c023229e5ac6e67b
      https://github.com/WebKit/WebKit/commit/f93a6655d71b97847a7d3855c023229e5ac6e67b
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-01-02 (Tue, 02 Jan 2024)

  Changed paths:
    M Source/WebKit/NetworkProcess/storage/CacheStorageManager.cpp
    M Source/WebKit/NetworkProcess/storage/CacheStorageManager.h
    M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp
    M Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp

  Log Message:
  -----------
  [Debug] ASSERTION FAILED: m_activeConnections.contains(connection)
https://bugs.webkit.org/show_bug.cgi?id=266732
rdar://119363590

Reviewed by Youenn Fablet.

CacheStorageManager is active when it has active connections, i.e. its m_activeConnections is not empty. In existing
impelementation, an active CacheStorageManager can be removed during website data deletion (see
OriginStorageManager::StorageBucket::deleteCacheStorageData). Later on, a new CacheStorageManager is created on
demand for handling CacheStorage related tasks. For the new CacheStorageManager, it does not have information about
active connections. If a NetworkStorageManager::UnlockCacheStorage is received at this time, the message will be passed
to the new CacheStorageManager, and the assertion in CacheStorageManager::unlockStorage will fail.

To fix this, this patch makes three changes:
1. Instead of removing existing CacheStorageManager on data deletion and creating a new one later, we just uninitialize
the states of existing CacheStorageManager and let it initialize from disk storage again later. Note m_activeConnections
is not cleared, so the existing CacheStorageManager is still marked active and can handle UnlockCacheStorage message.
2. When receiving UnlockCacheStorage message, if CacheStorageManager for origin does not exist, we will not create a
new CacheStorageManager to handle it (since the newly created CacheStorageManager will not know active connections).
3. m_pendingSize now keeps track of pending requests by cache identifier instead of count, so for size requests
initiated before reset() and finished after reset(), their result will not be used to updated m_size.

* Source/WebKit/NetworkProcess/storage/CacheStorageManager.cpp:
(WebKit::CacheStorageManager::~CacheStorageManager):
(WebKit::CacheStorageManager::reset):
(WebKit::CacheStorageManager::initializeCacheSize):
(WebKit::CacheStorageManager::requestSpaceAfterInitializingSize):
* Source/WebKit/NetworkProcess/storage/CacheStorageManager.h:
* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:
(WebKit::NetworkStorageManager::unlockCacheStorage):
* Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp:
(WebKit::OriginStorageManager::StorageBucket::deleteCacheStorageData):

Canonical link: https://commits.webkit.org/272585@main




More information about the webkit-changes mailing list