⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 254169 in webkit


Ignore:
Timestamp:
Jan 7, 2020, 4:17:34 PM (7 years ago)
Author:
sihui_liu@apple.com
Message:

REGRESSION (r248734): different threads write m_storageMap of StorageAreaImpl at the same time
​https://bugs.webkit.org/show_bug.cgi?id=205764
<rdar://problem/58179425>

Reviewed by Maciej Stachowiak.

In StorageAreaImpl, we avoid modifying m_storageMap from different threads at the same time by blocking main
thread access to it until the writes(importing items) of storage thread is done.

In r248734 we introduced a new case where the main thread could modify m_storageMap for session change, but we
didn't add the wait there.

  • Storage/StorageAreaImpl.cpp:

(WebKit::StorageAreaImpl::importItems):
(WebKit::StorageAreaImpl::sessionChanged):

Location:
trunk/Source/WebKitLegacy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKitLegacy/ChangeLog

    r254087 r254169  
     12020-01-07  Sihui Liu  <sihui_liu@apple.com>
     2
     3        REGRESSION (r248734): different threads write m_storageMap of StorageAreaImpl at the same time
     4        https://bugs.webkit.org/show_bug.cgi?id=205764
     5        <rdar://problem/58179425>
     6
     7        Reviewed by Maciej Stachowiak.
     8
     9        In StorageAreaImpl, we avoid modifying m_storageMap from different threads at the same time by blocking main
     10        thread access to it until the writes(importing items) of storage thread is done.
     11
     12        In r248734 we introduced a new case where the main thread could modify m_storageMap for session change, but we
     13        didn't add the wait there.
     14
     15        * Storage/StorageAreaImpl.cpp:
     16        (WebKit::StorageAreaImpl::importItems):
     17        (WebKit::StorageAreaImpl::sessionChanged):
     18
    1192020-01-06  Mark Lam  <mark.lam@apple.com>
    220
  • trunk/Source/WebKitLegacy/Storage/StorageAreaImpl.cpp

    r254087 r254169  
    195195{
    196196    ASSERT(!m_isShutdown);
     197    ASSERT(!isMainThread());
    197198
    198199    m_storageMap->importItems(WTFMove(items));
    … …  
    294295    ASSERT(isMainThread());
    295296
     297    // If import is not completed, background storage thread may be modifying m_storageMap.
     298    blockUntilImportComplete();
     299
    296300    unsigned quota = m_storageMap->quota();
    297301    m_storageMap = StorageMap::create(quota);
Note: See TracChangeset for help on using the changeset viewer.