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

Changeset 249053 in webkit


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

Cherry-pick r248967. rdar://problem/54643456

Crash under StringImpl::endsWith() in RegistrationDatabase::openSQLiteDatabase()
https://bugs.webkit.org/show_bug.cgi?id=200991
<rdar://problem/54566689>

Reviewed by Geoffrey Garen.

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

  • workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::openSQLiteDatabase): (WebCore::RegistrationDatabase::clearAll):
  • workers/service/server/RegistrationDatabase.h: (WebCore::RegistrationDatabase::databaseDirectory const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248967 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

    r249012 r249053  
     12019-08-23  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r248967. rdar://problem/54643456
     4
     5    Crash under StringImpl::endsWith() in RegistrationDatabase::openSQLiteDatabase()
     6    https://bugs.webkit.org/show_bug.cgi?id=200991
     7    <rdar://problem/54566689>
     8   
     9    Reviewed by Geoffrey Garen.
     10   
     11    Make sure we call isolatedCopy() on RegistrationDatabase::m_databaseDirectory before using
     12    it from background threads.
     13   
     14    * workers/service/server/RegistrationDatabase.cpp:
     15    (WebCore::RegistrationDatabase::openSQLiteDatabase):
     16    (WebCore::RegistrationDatabase::clearAll):
     17    * workers/service/server/RegistrationDatabase.h:
     18    (WebCore::RegistrationDatabase::databaseDirectory const):
     19   
     20   
     21    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     22
     23    2019-08-21  Chris Dumez  <cdumez@apple.com>
     24
     25            Crash under StringImpl::endsWith() in RegistrationDatabase::openSQLiteDatabase()
     26            https://bugs.webkit.org/show_bug.cgi?id=200991
     27            <rdar://problem/54566689>
     28
     29            Reviewed by Geoffrey Garen.
     30
     31            Make sure we call isolatedCopy() on RegistrationDatabase::m_databaseDirectory before using
     32            it from background threads.
     33
     34            * workers/service/server/RegistrationDatabase.cpp:
     35            (WebCore::RegistrationDatabase::openSQLiteDatabase):
     36            (WebCore::RegistrationDatabase::clearAll):
     37            * workers/service/server/RegistrationDatabase.h:
     38            (WebCore::RegistrationDatabase::databaseDirectory const):
     39
    1402019-08-22  Kocsen Chung  <kocsen_chung@apple.com>
    241
  • branches/safari-608-branch/Source/WebCore/workers/service/server/RegistrationDatabase.cpp

    r244097 r249053  
    131131    ASSERT(!m_database);
    132132
    133     cleanOldDatabases(m_databaseDirectory);
     133    auto databaseDirectory = this->databaseDirectory();
     134    cleanOldDatabases(databaseDirectory);
    134135
    135136    LOG(ServiceWorker, "ServiceWorker RegistrationDatabase opening file %s", fullFilename.utf8().data());
     
    151152    });
    152153
    153     SQLiteFileSystem::ensureDatabaseDirectoryExists(m_databaseDirectory);
     154    SQLiteFileSystem::ensureDatabaseDirectoryExists(databaseDirectory);
    154155
    155156    m_database = std::make_unique<SQLiteDatabase>();
     
    300301
    301302        SQLiteFileSystem::deleteDatabaseFile(m_databaseFilePath);
    302         SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_databaseDirectory);
     303        SQLiteFileSystem::deleteEmptyDatabaseDirectory(databaseDirectory());
    303304
    304305        callOnMainThread(WTFMove(completionHandler));
  • branches/safari-608-branch/Source/WebCore/workers/service/server/RegistrationDatabase.h

    r244097 r249053  
    6060private:
    6161    RegistrationDatabase(RegistrationStore&, String&& databaseDirectory);
     62   
     63    String databaseDirectory() const { return m_databaseDirectory.isolatedCopy(); }
    6264
    6365    void postTaskToWorkQueue(Function<void()>&&);
Note: See TracChangeset for help on using the changeset viewer.