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

Changeset 249054 in webkit


Ignore:
Timestamp:
Aug 23, 2019, 10:53:16 AM (7 years ago)
Author:
Alan Coon
Message:

Cherry-pick r248971. rdar://problem/54643440

Crash under StringImpl::endsWith() in SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade()
https://bugs.webkit.org/show_bug.cgi?id=200990
<rdar://problem/54566439>

Reviewed by Alex Christensen.

Make sure we call isolatedCopy() on SQLiteIDBBackingStore::m_databaseRootDirectory before using
it from background threads.

  • Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade): (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
  • Modules/indexeddb/server/SQLiteIDBBackingStore.h: (WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectory const):

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

Location:
branches/safari-608-branch/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608-branch/Source/WebCore/ChangeLog

    r249053 r249054  
     12019-08-23  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r248971. rdar://problem/54643440
     4
     5    Crash under StringImpl::endsWith() in SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade()
     6    https://bugs.webkit.org/show_bug.cgi?id=200990
     7    <rdar://problem/54566439>
     8   
     9    Reviewed by Alex Christensen.
     10   
     11    Make sure we call isolatedCopy() on SQLiteIDBBackingStore::m_databaseRootDirectory before using
     12    it from background threads.
     13   
     14    * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
     15    (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
     16    (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
     17    (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
     18    * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
     19    (WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectory const):
     20   
     21   
     22    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     23
     24    2019-08-21  Chris Dumez  <cdumez@apple.com>
     25
     26            Crash under StringImpl::endsWith() in SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade()
     27            https://bugs.webkit.org/show_bug.cgi?id=200990
     28            <rdar://problem/54566439>
     29
     30            Reviewed by Alex Christensen.
     31
     32            Make sure we call isolatedCopy() on SQLiteIDBBackingStore::m_databaseRootDirectory before using
     33            it from background threads.
     34
     35            * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
     36            (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
     37            (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
     38            (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
     39            * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
     40            (WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectory const):
     41
    1422019-08-23  Kocsen Chung  <kocsen_chung@apple.com>
    243
  • branches/safari-608-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

    r246922 r249054  
    794794String SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade()
    795795{
    796     String oldOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory, "v0");
     796    auto databaseRootDirectory = this->databaseRootDirectory();
     797    String oldOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v0");
    797798    String oldDatabaseDirectory = FileSystem::pathByAppendingComponent(oldOriginDirectory, filenameForDatabaseName());
    798     String newOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory, "v1");
     799    String newOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v1");
    799800    String fileNameHash = SQLiteFileSystem::computeHashForFileName(m_identifier.databaseName());
    800801    Vector<String> directoriesWithSameHash = FileSystem::listDirectory(newOriginDirectory, fileNameHash + "*");
     
    893894uint64_t SQLiteIDBBackingStore::databasesSizeForOrigin() const
    894895{
    895     String oldVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory, "v0");
    896     String newVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory, "v1");
     896    auto databaseRootDirectory = this->databaseRootDirectory();
     897    String oldVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v0");
     898    String newVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v1");
    897899    return databasesSizeForFolder(oldVersionOriginDirectory) + databasesSizeForFolder(newVersionOriginDirectory);
    898900}
     
    26442646    SQLiteFileSystem::deleteDatabaseFile(dbFilename);
    26452647    SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_databaseDirectory);
    2646     SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory));
     2648    SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory()));
    26472649}
    26482650
  • branches/safari-608-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h

    r244687 r249054  
    106106    String fullDatabasePath() const;
    107107    String fullDatabaseDirectoryWithUpgrade();
     108   
     109    String databaseRootDirectory() const { return m_databaseRootDirectory.isolatedCopy(); }
    108110
    109111    uint64_t quotaForOrigin() const;
Note: See TracChangeset for help on using the changeset viewer.