Changeset 249313 in webkit


Ignore:
Timestamp:
Aug 29, 2019 9:35:58 PM (5 years ago)
Author:
Chris Dumez
Message:

Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
https://bugs.webkit.org/show_bug.cgi?id=201318

Reviewed by Alex Christensen.

Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.

Source/WebCore:

  • Modules/indexeddb/server/IDBServer.cpp:

(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
(WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
(WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):

  • Modules/indexeddb/server/IDBServer.h:

(WebCore::IDBServer::IDBServer::databaseDirectoryPathIsolatedCopy const):

  • 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::databaseRootDirectoryIsolatedCopy const):

  • Modules/webdatabase/Database.cpp:

(WebCore::Database::markAsDeletedAndClose):
(WebCore::Database::stringIdentifierIsolatedCopy const):
(WebCore::Database::displayNameIsolatedCopy const):
(WebCore::Database::expectedVersionIsolatedCopy const):
(WebCore::Database::fileNameIsolatedCopy const):
(WebCore::Database::details const):
(WebCore::Database::didCommitWriteTransaction):
(WebCore::Database::didExceedQuota):

  • Modules/webdatabase/Database.h:
  • Modules/webdatabase/DatabaseTracker.cpp:

(WebCore::DatabaseTracker::maximumSize):
(WebCore::DatabaseTracker::doneCreatingDatabase):
(WebCore::DatabaseTracker::addOpenDatabase):
(WebCore::DatabaseTracker::removeOpenDatabase):

  • Modules/webdatabase/SQLError.h:

(WebCore::SQLError::messageIsolatedCopy const):

  • Modules/webdatabase/SQLError.idl:
  • Modules/webdatabase/SQLTransaction.cpp:

(WebCore::SQLTransaction::openTransactionAndPreflight):

  • workers/service/server/RegistrationDatabase.cpp:

(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::clearAll):

  • workers/service/server/RegistrationDatabase.h:

(WebCore::RegistrationDatabase::databaseDirectoryIsolatedCopy const):

Source/WebKit:

  • NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:

(WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const):
(WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const):
(WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):

  • NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
  • NetworkProcess/cache/NetworkCacheBlobStorage.cpp:

(WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const):
(WebKit::NetworkCache::BlobStorage::synchronize):
(WebKit::NetworkCache::BlobStorage::blobPathForHash const):

  • NetworkProcess/cache/NetworkCacheBlobStorage.h:
  • NetworkProcess/cache/NetworkCacheStorage.cpp:

(WebKit::NetworkCache::Storage::basePathIsolatedCopy const):
(WebKit::NetworkCache::Storage::versionPath const):
(WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey const):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
(WebKit::NetworkCache::Storage::shrink):
(WebKit::NetworkCache::Storage::deleteOldVersions):

  • NetworkProcess/cache/NetworkCacheStorage.h:
Location:
trunk/Source
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249312 r249313  
     12019-08-29  Chris Dumez  <cdumez@apple.com>
     2
     3        Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
     4        https://bugs.webkit.org/show_bug.cgi?id=201318
     5
     6        Reviewed by Alex Christensen.
     7
     8        Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.
     9
     10        * Modules/indexeddb/server/IDBServer.cpp:
     11        (WebCore::IDBServer::IDBServer::createBackingStore):
     12        (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
     13        (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
     14        (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
     15        (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
     16        (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
     17        (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
     18        (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
     19        * Modules/indexeddb/server/IDBServer.h:
     20        (WebCore::IDBServer::IDBServer::databaseDirectoryPathIsolatedCopy const):
     21        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
     22        (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
     23        (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
     24        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
     25        * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
     26        (WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectoryIsolatedCopy const):
     27        * Modules/webdatabase/Database.cpp:
     28        (WebCore::Database::markAsDeletedAndClose):
     29        (WebCore::Database::stringIdentifierIsolatedCopy const):
     30        (WebCore::Database::displayNameIsolatedCopy const):
     31        (WebCore::Database::expectedVersionIsolatedCopy const):
     32        (WebCore::Database::fileNameIsolatedCopy const):
     33        (WebCore::Database::details const):
     34        (WebCore::Database::didCommitWriteTransaction):
     35        (WebCore::Database::didExceedQuota):
     36        * Modules/webdatabase/Database.h:
     37        * Modules/webdatabase/DatabaseTracker.cpp:
     38        (WebCore::DatabaseTracker::maximumSize):
     39        (WebCore::DatabaseTracker::doneCreatingDatabase):
     40        (WebCore::DatabaseTracker::addOpenDatabase):
     41        (WebCore::DatabaseTracker::removeOpenDatabase):
     42        * Modules/webdatabase/SQLError.h:
     43        (WebCore::SQLError::messageIsolatedCopy const):
     44        * Modules/webdatabase/SQLError.idl:
     45        * Modules/webdatabase/SQLTransaction.cpp:
     46        (WebCore::SQLTransaction::openTransactionAndPreflight):
     47        * workers/service/server/RegistrationDatabase.cpp:
     48        (WebCore::RegistrationDatabase::openSQLiteDatabase):
     49        (WebCore::RegistrationDatabase::clearAll):
     50        * workers/service/server/RegistrationDatabase.h:
     51        (WebCore::RegistrationDatabase::databaseDirectoryIsolatedCopy const):
     52
    1532019-08-29  Keith Rollin  <krollin@apple.com>
    254
  • trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp

    r248969 r249313  
    133133    ASSERT(!isMainThread());
    134134
    135     auto databaseDirectoryPath = this->databaseDirectoryPath();
     135    auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy();
    136136    if (databaseDirectoryPath.isEmpty())
    137137        return MemoryIDBBackingStore::create(m_sessionID, identifier);
     
    468468void IDBServer::performGetAllDatabaseNames(uint64_t serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID)
    469469{
    470     auto databaseDirectoryPath = this->databaseDirectoryPath();
     470    auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy();
    471471    String oldDirectory = IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot(mainFrameOrigin, openingOrigin, databaseDirectoryPath, "v0");
    472472    Vector<String> files = FileSystem::listDirectory(oldDirectory, "*"_s);
     
    642642void IDBServer::removeDatabasesModifiedSinceForVersion(WallTime modifiedSince, const String& version)
    643643{
    644     String versionPath = FileSystem::pathByAppendingComponent(databaseDirectoryPath(), version);
     644    String versionPath = FileSystem::pathByAppendingComponent(databaseDirectoryPathIsolatedCopy(), version);
    645645    for (auto& originPath : FileSystem::listDirectory(versionPath, "*")) {
    646646        String databaseIdentifier = FileSystem::lastComponentOfPathIgnoringTrailingSlash(originPath);
     
    652652void IDBServer::performCloseAndDeleteDatabasesModifiedSince(WallTime modifiedSince, uint64_t callbackID)
    653653{
    654     if (!databaseDirectoryPath().isEmpty()) {
     654    if (!databaseDirectoryPathIsolatedCopy().isEmpty()) {
    655655        removeDatabasesModifiedSinceForVersion(modifiedSince, "v0");
    656656        removeDatabasesModifiedSinceForVersion(modifiedSince, "v1");
     
    662662void IDBServer::removeDatabasesWithOriginsForVersion(const Vector<SecurityOriginData> &origins, const String& version)
    663663{
    664     String versionPath = FileSystem::pathByAppendingComponent(databaseDirectoryPath(), version);
     664    String versionPath = FileSystem::pathByAppendingComponent(databaseDirectoryPathIsolatedCopy(), version);
    665665    for (const auto& origin : origins) {
    666666        String originPath = FileSystem::pathByAppendingComponent(versionPath, origin.databaseIdentifier());
     
    676676void IDBServer::performCloseAndDeleteDatabasesForOrigins(const Vector<SecurityOriginData>& origins, uint64_t callbackID)
    677677{
    678     if (!databaseDirectoryPath().isEmpty()) {
     678    if (!databaseDirectoryPathIsolatedCopy().isEmpty()) {
    679679        removeDatabasesWithOriginsForVersion(origins, "v0");
    680680        removeDatabasesWithOriginsForVersion(origins, "v1");
     
    770770    ASSERT(!isMainThread());
    771771
    772     auto databaseDirectoryPath = this->databaseDirectoryPath();
     772    auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy();
    773773    auto oldVersionOriginDirectory = IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot(origin.topOrigin, origin.clientOrigin, databaseDirectoryPath, "v0");
    774774    auto newVersionOriginDirectory = IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot(origin.topOrigin, origin.clientOrigin, databaseDirectoryPath, "v1");
     
    817817void IDBServer::upgradeFilesIfNecessary()
    818818{
    819     auto databaseDirectoryPath = this->databaseDirectoryPath();
     819    auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy();
    820820    if (databaseDirectoryPath.isEmpty() || !FileSystem::fileExists(databaseDirectoryPath))
    821821        return;
  • trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h

    r248969 r249313  
    131131    UniqueIDBDatabase& getOrCreateUniqueIDBDatabase(const IDBDatabaseIdentifier&);
    132132   
    133     String databaseDirectoryPath() const { return m_databaseDirectoryPath.isolatedCopy(); }
     133    String databaseDirectoryPathIsolatedCopy() const { return m_databaseDirectoryPath.isolatedCopy(); }
    134134
    135135    void performGetAllDatabaseNames(uint64_t serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID);
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp

    r248971 r249313  
    766766String SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade()
    767767{
    768     auto databaseRootDirectory = this->databaseRootDirectory();
     768    auto databaseRootDirectory = this->databaseRootDirectoryIsolatedCopy();
    769769    String oldOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v0");
    770770    String oldDatabaseDirectory = FileSystem::pathByAppendingComponent(oldOriginDirectory, filenameForDatabaseName());
     
    858858uint64_t SQLiteIDBBackingStore::databasesSizeForOrigin() const
    859859{
    860     auto databaseRootDirectory = this->databaseRootDirectory();
     860    auto databaseRootDirectory = this->databaseRootDirectoryIsolatedCopy();
    861861    String oldVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v0");
    862862    String newVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v1");
     
    25632563    SQLiteFileSystem::deleteDatabaseFile(dbFilename);
    25642564    SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_databaseDirectory);
    2565     SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory()));
     2565    SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectoryIsolatedCopy()));
    25662566}
    25672567
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h

    r248971 r249313  
    110110    String fullDatabaseDirectoryWithUpgrade();
    111111   
    112     String databaseRootDirectory() const { return m_databaseRootDirectory.isolatedCopy(); }
     112    String databaseRootDirectoryIsolatedCopy() const { return m_databaseRootDirectory.isolatedCopy(); }
    113113
    114114    bool ensureValidRecordsTable();
  • trunk/Source/WebCore/Modules/webdatabase/Database.cpp

    r248846 r249313  
    581581        return;
    582582
    583     LOG(StorageAPI, "Marking %s (%p) as deleted", stringIdentifier().ascii().data(), this);
     583    LOG(StorageAPI, "Marking %s (%p) as deleted", stringIdentifierIsolatedCopy().ascii().data(), this);
    584584    m_deleted = true;
    585585
     
    602602}
    603603
    604 String Database::stringIdentifier() const
     604String Database::stringIdentifierIsolatedCopy() const
    605605{
    606606    // Return a deep copy for ref counting thread safety
     
    608608}
    609609
    610 String Database::displayName() const
     610String Database::displayNameIsolatedCopy() const
    611611{
    612612    // Return a deep copy for ref counting thread safety
     
    614614}
    615615
    616 String Database::expectedVersion() const
     616String Database::expectedVersionIsolatedCopy() const
    617617{
    618618    // Return a deep copy for ref counting thread safety
     
    631631}
    632632
    633 String Database::fileName() const
     633String Database::fileNameIsolatedCopy() const
    634634{
    635635    // Return a deep copy for ref counting thread safety
     
    640640{
    641641    // This code path is only used for database quota delegate calls, so file dates are irrelevant and left uninitialized.
    642     return DatabaseDetails(stringIdentifier(), displayName(), estimatedSize(), 0, WTF::nullopt, WTF::nullopt);
     642    return DatabaseDetails(stringIdentifierIsolatedCopy(), displayNameIsolatedCopy(), estimatedSize(), 0, WTF::nullopt, WTF::nullopt);
    643643}
    644644
     
    787787void Database::didCommitWriteTransaction()
    788788{
    789     DatabaseTracker::singleton().scheduleNotifyDatabaseChanged(securityOrigin(), stringIdentifier());
     789    DatabaseTracker::singleton().scheduleNotifyDatabaseChanged(securityOrigin(), stringIdentifierIsolatedCopy());
    790790}
    791791
     
    800800        setEstimatedSize(oldQuota + quotaIncreaseSize);
    801801    }
    802     databaseContext().databaseExceededQuota(stringIdentifier(), details());
     802    databaseContext().databaseExceededQuota(stringIdentifierIsolatedCopy(), details());
    803803    return tracker.quota(securityOrigin()) > oldQuota;
    804804}
  • trunk/Source/WebCore/Modules/webdatabase/Database.h

    r247219 r249313  
    8787
    8888    // Internal engine support
    89     String stringIdentifier() const;
    90     String displayName() const;
    91     String expectedVersion() const;
     89    String stringIdentifierIsolatedCopy() const;
     90    String displayNameIsolatedCopy() const;
     91    String expectedVersionIsolatedCopy() const;
    9292    unsigned long long estimatedSize() const;
    93     String fileName() const;
     93    String fileNameIsolatedCopy() const;
    9494    DatabaseDetails details() const;
    9595    SQLiteDatabase& sqliteDatabase() { return m_sqliteDatabase; }
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp

    r249013 r249313  
    277277    unsigned long long quota = quotaNoLock(origin);
    278278    unsigned long long diskUsage = usage(origin);
    279     unsigned long long databaseFileSize = SQLiteFileSystem::getDatabaseFileSize(database.fileName());
     279    unsigned long long databaseFileSize = SQLiteFileSystem::getDatabaseFileSize(database.fileNameIsolatedCopy());
    280280    ASSERT(databaseFileSize <= diskUsage);
    281281
     
    519519{
    520520    LockHolder lockDatabase(m_databaseGuard);
    521     doneCreatingDatabase(database.securityOrigin(), database.stringIdentifier());
     521    doneCreatingDatabase(database.securityOrigin(), database.stringIdentifierIsolatedCopy());
    522522}
    523523
     
    555555    }
    556556
    557     String name = database.stringIdentifier();
     557    String name = database.stringIdentifierIsolatedCopy();
    558558    auto* databaseSet = nameMap->get(name);
    559559    if (!databaseSet) {
     
    564564    databaseSet->add(&database);
    565565
    566     LOG(StorageAPI, "Added open Database %s (%p)\n", database.stringIdentifier().utf8().data(), &database);
     566    LOG(StorageAPI, "Added open Database %s (%p)\n", database.stringIdentifierIsolatedCopy().utf8().data(), &database);
    567567}
    568568
     
    582582    }
    583583
    584     String name = database.stringIdentifier();
     584    String name = database.stringIdentifierIsolatedCopy();
    585585    auto* databaseSet = nameMap->get(name);
    586586    if (!databaseSet) {
     
    591591    databaseSet->remove(&database);
    592592
    593     LOG(StorageAPI, "Removed open Database %s (%p)\n", database.stringIdentifier().utf8().data(), &database);
     593    LOG(StorageAPI, "Removed open Database %s (%p)\n", database.stringIdentifierIsolatedCopy().utf8().data(), &database);
    594594
    595595    if (!databaseSet->isEmpty())
     
    12111211                       
    12121212                        // If this database has been deleted or if its database file no longer matches the current version, this database is no longer valid and it should be marked as deleted.
    1213                         if (databaseFileName.isNull() || databaseFileName != FileSystem::pathGetFileName(db->fileName())) {
     1213                        if (databaseFileName.isNull() || databaseFileName != FileSystem::pathGetFileName(db->fileNameIsolatedCopy())) {
    12141214                            deletedDatabases.append(db);
    12151215                            foundDeletedDatabase = true;
  • trunk/Source/WebCore/Modules/webdatabase/SQLError.h

    r240557 r249313  
    4747
    4848    unsigned code() const { return m_code; }
    49     String message() const { return m_message.isolatedCopy(); }
     49    String messageIsolatedCopy() const { return m_message.isolatedCopy(); }
    5050
    5151    enum SQLErrorCode {
  • trunk/Source/WebCore/Modules/webdatabase/SQLError.idl

    r237210 r249313  
    3232] interface SQLError {
    3333    readonly attribute unsigned long code;
    34     readonly attribute DOMString message;
     34    [ImplementedAs=messageIsolatedCopy] readonly attribute DOMString message;
    3535
    3636    // SQLErrorCode: used only in the async DB API
  • trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp

    r248846 r249313  
    266266    }
    267267
    268     m_hasVersionMismatch = !m_database->expectedVersion().isEmpty() && (m_database->expectedVersion() != actualVersion);
     268    auto expectedVersion = m_database->expectedVersionIsolatedCopy();
     269    m_hasVersionMismatch = !expectedVersion.isEmpty() && expectedVersion != actualVersion;
    269270
    270271    // Spec 4.3.2.3: Perform preflight steps, jumping to the error callback if they fail
  • trunk/Source/WebCore/inspector/agents/InspectorDatabaseAgent.cpp

    r249132 r249313  
    6161{
    6262    auto errorObject = Inspector::Protocol::Database::Error::create()
    63         .setMessage(error.message())
     63        .setMessage(error.messageIsolatedCopy())
    6464        .setCode(error.code())
    6565        .release();
     
    206206void InspectorDatabaseAgent::didOpenDatabase(Database& database)
    207207{
    208     if (auto resource = findByFileName(database.fileName())) {
     208    if (auto resource = findByFileName(database.fileNameIsolatedCopy())) {
    209209        resource->setDatabase(database);
    210210        return;
    211211    }
    212212
    213     auto resource = InspectorDatabaseResource::create(database, database.securityOrigin().host, database.stringIdentifier(), database.expectedVersion());
     213    auto resource = InspectorDatabaseResource::create(database, database.securityOrigin().host, database.stringIdentifierIsolatedCopy(), database.expectedVersionIsolatedCopy());
    214214    m_resources.add(resource->id(), resource.ptr());
    215215    resource->bind(*m_frontendDispatcher);
     
    305305{
    306306    for (auto& resource : m_resources.values()) {
    307         if (resource->database().fileName() == fileName)
     307        if (resource->database().fileNameIsolatedCopy() == fileName)
    308308            return resource.get();
    309309    }
  • trunk/Source/WebCore/workers/service/server/RegistrationDatabase.cpp

    r249035 r249313  
    131131    ASSERT(!m_database);
    132132
    133     auto databaseDirectory = this->databaseDirectory();
     133    auto databaseDirectory = this->databaseDirectoryIsolatedCopy();
    134134    cleanOldDatabases(databaseDirectory);
    135135
     
    306306
    307307        SQLiteFileSystem::deleteDatabaseFile(m_databaseFilePath);
    308         SQLiteFileSystem::deleteEmptyDatabaseDirectory(databaseDirectory());
     308        SQLiteFileSystem::deleteEmptyDatabaseDirectory(databaseDirectoryIsolatedCopy());
    309309
    310310        callOnMainThread(WTFMove(completionHandler));
  • trunk/Source/WebCore/workers/service/server/RegistrationDatabase.h

    r248967 r249313  
    6161    RegistrationDatabase(RegistrationStore&, String&& databaseDirectory);
    6262   
    63     String databaseDirectory() const { return m_databaseDirectory.isolatedCopy(); }
     63    String databaseDirectoryIsolatedCopy() const { return m_databaseDirectory.isolatedCopy(); }
    6464
    6565    void postTaskToWorkQueue(Function<void()>&&);
  • trunk/Source/WebKit/ChangeLog

    r249312 r249313  
     12019-08-29  Chris Dumez  <cdumez@apple.com>
     2
     3        Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
     4        https://bugs.webkit.org/show_bug.cgi?id=201318
     5
     6        Reviewed by Alex Christensen.
     7
     8        Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.
     9
     10        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
     11        (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const):
     12        (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const):
     13        (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
     14        * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
     15        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
     16        (WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const):
     17        (WebKit::NetworkCache::BlobStorage::synchronize):
     18        (WebKit::NetworkCache::BlobStorage::blobPathForHash const):
     19        * NetworkProcess/cache/NetworkCacheBlobStorage.h:
     20        * NetworkProcess/cache/NetworkCacheStorage.cpp:
     21        (WebKit::NetworkCache::Storage::basePathIsolatedCopy const):
     22        (WebKit::NetworkCache::Storage::versionPath const):
     23        (WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const):
     24        (WebKit::NetworkCache::Storage::synchronize):
     25        (WebKit::NetworkCache::Storage::recordDirectoryPathForKey const):
     26        (WebKit::NetworkCache::Storage::traverse):
     27        (WebKit::NetworkCache::Storage::clear):
     28        (WebKit::NetworkCache::Storage::shrink):
     29        (WebKit::NetworkCache::Storage::deleteOldVersions):
     30        * NetworkProcess/cache/NetworkCacheStorage.h:
     31
    1322019-08-29  Keith Rollin  <krollin@apple.com>
    233
  • trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp

    r248846 r249313  
    7777}
    7878
    79 String ResourceLoadStatisticsPersistentStorage::storageDirectoryPath() const
     79String ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy() const
    8080{
    8181    return m_storageDirectoryPath.isolatedCopy();
     
    8484String ResourceLoadStatisticsPersistentStorage::resourceLogFilePath() const
    8585{
    86     String storagePath = storageDirectoryPath();
     86    String storagePath = storageDirectoryPathIsolatedCopy();
    8787    if (storagePath.isEmpty())
    8888        return emptyString();
     
    123123    ASSERT(!RunLoop::isMain());
    124124
    125     String storagePath = storageDirectoryPath();
     125    String storagePath = storageDirectoryPathIsolatedCopy();
    126126    ASSERT(!storagePath.isEmpty());
    127127
  • trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h

    r248762 r249313  
    5757
    5858private:
    59     String storageDirectoryPath() const;
     59    String storageDirectoryPathIsolatedCopy() const;
    6060    String resourceLogFilePath() const;
    6161
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp

    r249303 r249313  
    110110#if PLATFORM(GTK) || PLATFORM(WPE)
    111111        // Triggers with "touch $cachePath/dump".
    112         CString dumpFilePath = fileSystemRepresentation(pathByAppendingComponent(m_storage->basePath(), "dump"));
     112        CString dumpFilePath = fileSystemRepresentation(pathByAppendingComponent(m_storage->basePathIsolatedCopy(), "dump"));
    113113        GRefPtr<GFile> dumpFile = adoptGRef(g_file_new_for_path(dumpFilePath.data()));
    114114        GFileMonitor* monitor = g_file_monitor_file(dumpFile.get(), G_FILE_MONITOR_NONE, nullptr, nullptr);
     
    595595}
    596596
    597 String Cache::recordsPath() const
    598 {
    599     return m_storage->recordsPath();
     597String Cache::recordsPathIsolatedCopy() const
     598{
     599    return m_storage->recordsPathIsolatedCopy();
    600600}
    601601
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.h

    r249303 r249313  
    140140    void dumpContentsToFile();
    141141
    142     String recordsPath() const;
     142    String recordsPathIsolatedCopy() const;
    143143
    144144#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp

    r248973 r249313  
    4747}
    4848
    49 String BlobStorage::blobDirectoryPath() const
     49String BlobStorage::blobDirectoryPathIsolatedCopy() const
    5050{
    5151    return m_blobDirectoryPath.isolatedCopy();
     
    5656    ASSERT(!RunLoop::isMain());
    5757
    58     FileSystem::makeAllDirectories(blobDirectoryPath());
     58    auto blobDirectoryPath = blobDirectoryPathIsolatedCopy();
     59    FileSystem::makeAllDirectories(blobDirectoryPath);
    5960
    6061    m_approximateSize = 0;
    61     auto blobDirectory = blobDirectoryPath();
     62    auto blobDirectory = blobDirectoryPath;
    6263    traverseDirectory(blobDirectory, [this, &blobDirectory](const String& name, DirectoryEntryType type) {
    6364        if (type != DirectoryEntryType::File)
     
    8081{
    8182    auto hashAsString = SHA1::hexDigest(hash);
    82     return FileSystem::pathByAppendingComponent(blobDirectoryPath(), String::fromUTF8(hashAsString));
     83    return FileSystem::pathByAppendingComponent(blobDirectoryPathIsolatedCopy(), String::fromUTF8(hashAsString));
    8384}
    8485
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.h

    r223179 r249313  
    5858
    5959private:
    60     String blobDirectoryPath() const;
     60    String blobDirectoryPathIsolatedCopy() const;
    6161    String blobPathForHash(const SHA1::Digest&) const;
    6262
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp

    r248846 r249313  
    252252}
    253253
    254 String Storage::basePath() const
     254String Storage::basePathIsolatedCopy() const
    255255{
    256256    return m_basePath.isolatedCopy();
     
    259259String Storage::versionPath() const
    260260{
    261     return makeVersionedDirectoryPath(basePath());
    262 }
    263 
    264 String Storage::recordsPath() const
     261    return makeVersionedDirectoryPath(basePathIsolatedCopy());
     262}
     263
     264String Storage::recordsPathIsolatedCopy() const
    265265{
    266266    return m_recordsPath.isolatedCopy();
     
    300300
    301301        String anyType;
    302         traverseRecordsFiles(recordsPath(), anyType, [&](const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath) {
     302        traverseRecordsFiles(recordsPathIsolatedCopy(), anyType, [&](const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath) {
    303303            auto filePath = FileSystem::pathByAppendingComponent(recordDirectoryPath, fileName);
    304304
     
    324324        m_blobStorage.synchronize();
    325325
    326         deleteEmptyRecordsDirectories(recordsPath());
     326        deleteEmptyRecordsDirectories(recordsPathIsolatedCopy());
    327327
    328328        LOG(NetworkCacheStorage, "(NetworkProcess) cache synchronization completed size=%zu recordCount=%u", recordsSize, recordCount);
     
    375375{
    376376    ASSERT(!key.type().isEmpty());
    377     return FileSystem::pathByAppendingComponent(FileSystem::pathByAppendingComponent(recordsPath(), key.partitionHashAsString()), key.type());
     377    return FileSystem::pathByAppendingComponent(FileSystem::pathByAppendingComponent(recordsPathIsolatedCopy(), key.partitionHashAsString()), key.type());
    378378}
    379379
     
    904904
    905905    ioQueue().dispatch([this, &traverseOperation] {
    906         traverseRecordsFiles(recordsPath(), traverseOperation.type, [this, &traverseOperation](const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath) {
     906        traverseRecordsFiles(recordsPathIsolatedCopy(), traverseOperation.type, [this, &traverseOperation](const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath) {
    907907            ASSERT(type == traverseOperation.type || traverseOperation.type.isEmpty());
    908908            if (isBlob)
     
    999999
    10001000    ioQueue().dispatch([this, protectedThis = makeRef(*this), modifiedSinceTime, completionHandler = WTFMove(completionHandler), type = type.isolatedCopy()] () mutable {
    1001         auto recordsPath = this->recordsPath();
     1001        auto recordsPath = this->recordsPathIsolatedCopy();
    10021002        traverseRecordsFiles(recordsPath, type, [modifiedSinceTime](const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath) {
    10031003            auto filePath = FileSystem::pathByAppendingComponent(recordDirectoryPath, fileName);
     
    10751075
    10761076    backgroundIOQueue().dispatch([this, protectedThis = makeRef(*this)] () mutable {
    1077         auto recordsPath = this->recordsPath();
     1077        auto recordsPath = this->recordsPathIsolatedCopy();
    10781078        String anyType;
    10791079        traverseRecordsFiles(recordsPath, anyType, [this](const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath) {
     
    11101110void Storage::deleteOldVersions()
    11111111{
    1112     backgroundIOQueue().dispatch([cachePath = basePath()] () mutable {
     1112    backgroundIOQueue().dispatch([cachePath = basePathIsolatedCopy()] () mutable {
    11131113        traverseDirectory(cachePath, [&cachePath](const String& subdirName, DirectoryEntryType type) {
    11141114            if (type != DirectoryEntryType::Directory)
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h

    r244678 r249313  
    114114#endif
    115115
    116     String basePath() const;
     116    String basePathIsolatedCopy() const;
    117117    String versionPath() const;
    118     String recordsPath() const;
     118    String recordsPathIsolatedCopy() const;
    119119
    120120    const Salt& salt() const { return m_salt; }
Note: See TracChangeset for help on using the changeset viewer.