Changeset 249313 in webkit
- Timestamp:
- Aug 29, 2019 9:35:58 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r249312 r249313 1 2019-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 1 53 2019-08-29 Keith Rollin <krollin@apple.com> 2 54 -
trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
r248969 r249313 133 133 ASSERT(!isMainThread()); 134 134 135 auto databaseDirectoryPath = this->databaseDirectoryPath ();135 auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy(); 136 136 if (databaseDirectoryPath.isEmpty()) 137 137 return MemoryIDBBackingStore::create(m_sessionID, identifier); … … 468 468 void IDBServer::performGetAllDatabaseNames(uint64_t serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID) 469 469 { 470 auto databaseDirectoryPath = this->databaseDirectoryPath ();470 auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy(); 471 471 String oldDirectory = IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot(mainFrameOrigin, openingOrigin, databaseDirectoryPath, "v0"); 472 472 Vector<String> files = FileSystem::listDirectory(oldDirectory, "*"_s); … … 642 642 void IDBServer::removeDatabasesModifiedSinceForVersion(WallTime modifiedSince, const String& version) 643 643 { 644 String versionPath = FileSystem::pathByAppendingComponent(databaseDirectoryPath (), version);644 String versionPath = FileSystem::pathByAppendingComponent(databaseDirectoryPathIsolatedCopy(), version); 645 645 for (auto& originPath : FileSystem::listDirectory(versionPath, "*")) { 646 646 String databaseIdentifier = FileSystem::lastComponentOfPathIgnoringTrailingSlash(originPath); … … 652 652 void IDBServer::performCloseAndDeleteDatabasesModifiedSince(WallTime modifiedSince, uint64_t callbackID) 653 653 { 654 if (!databaseDirectoryPath ().isEmpty()) {654 if (!databaseDirectoryPathIsolatedCopy().isEmpty()) { 655 655 removeDatabasesModifiedSinceForVersion(modifiedSince, "v0"); 656 656 removeDatabasesModifiedSinceForVersion(modifiedSince, "v1"); … … 662 662 void IDBServer::removeDatabasesWithOriginsForVersion(const Vector<SecurityOriginData> &origins, const String& version) 663 663 { 664 String versionPath = FileSystem::pathByAppendingComponent(databaseDirectoryPath (), version);664 String versionPath = FileSystem::pathByAppendingComponent(databaseDirectoryPathIsolatedCopy(), version); 665 665 for (const auto& origin : origins) { 666 666 String originPath = FileSystem::pathByAppendingComponent(versionPath, origin.databaseIdentifier()); … … 676 676 void IDBServer::performCloseAndDeleteDatabasesForOrigins(const Vector<SecurityOriginData>& origins, uint64_t callbackID) 677 677 { 678 if (!databaseDirectoryPath ().isEmpty()) {678 if (!databaseDirectoryPathIsolatedCopy().isEmpty()) { 679 679 removeDatabasesWithOriginsForVersion(origins, "v0"); 680 680 removeDatabasesWithOriginsForVersion(origins, "v1"); … … 770 770 ASSERT(!isMainThread()); 771 771 772 auto databaseDirectoryPath = this->databaseDirectoryPath ();772 auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy(); 773 773 auto oldVersionOriginDirectory = IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot(origin.topOrigin, origin.clientOrigin, databaseDirectoryPath, "v0"); 774 774 auto newVersionOriginDirectory = IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot(origin.topOrigin, origin.clientOrigin, databaseDirectoryPath, "v1"); … … 817 817 void IDBServer::upgradeFilesIfNecessary() 818 818 { 819 auto databaseDirectoryPath = this->databaseDirectoryPath ();819 auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy(); 820 820 if (databaseDirectoryPath.isEmpty() || !FileSystem::fileExists(databaseDirectoryPath)) 821 821 return; -
trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h
r248969 r249313 131 131 UniqueIDBDatabase& getOrCreateUniqueIDBDatabase(const IDBDatabaseIdentifier&); 132 132 133 String databaseDirectoryPath () const { return m_databaseDirectoryPath.isolatedCopy(); }133 String databaseDirectoryPathIsolatedCopy() const { return m_databaseDirectoryPath.isolatedCopy(); } 134 134 135 135 void performGetAllDatabaseNames(uint64_t serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID); -
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
r248971 r249313 766 766 String SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade() 767 767 { 768 auto databaseRootDirectory = this->databaseRootDirectory ();768 auto databaseRootDirectory = this->databaseRootDirectoryIsolatedCopy(); 769 769 String oldOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v0"); 770 770 String oldDatabaseDirectory = FileSystem::pathByAppendingComponent(oldOriginDirectory, filenameForDatabaseName()); … … 858 858 uint64_t SQLiteIDBBackingStore::databasesSizeForOrigin() const 859 859 { 860 auto databaseRootDirectory = this->databaseRootDirectory ();860 auto databaseRootDirectory = this->databaseRootDirectoryIsolatedCopy(); 861 861 String oldVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v0"); 862 862 String newVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v1"); … … 2563 2563 SQLiteFileSystem::deleteDatabaseFile(dbFilename); 2564 2564 SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_databaseDirectory); 2565 SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory ()));2565 SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectoryIsolatedCopy())); 2566 2566 } 2567 2567 -
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h
r248971 r249313 110 110 String fullDatabaseDirectoryWithUpgrade(); 111 111 112 String databaseRootDirectory () const { return m_databaseRootDirectory.isolatedCopy(); }112 String databaseRootDirectoryIsolatedCopy() const { return m_databaseRootDirectory.isolatedCopy(); } 113 113 114 114 bool ensureValidRecordsTable(); -
trunk/Source/WebCore/Modules/webdatabase/Database.cpp
r248846 r249313 581 581 return; 582 582 583 LOG(StorageAPI, "Marking %s (%p) as deleted", stringIdentifier ().ascii().data(), this);583 LOG(StorageAPI, "Marking %s (%p) as deleted", stringIdentifierIsolatedCopy().ascii().data(), this); 584 584 m_deleted = true; 585 585 … … 602 602 } 603 603 604 String Database::stringIdentifier () const604 String Database::stringIdentifierIsolatedCopy() const 605 605 { 606 606 // Return a deep copy for ref counting thread safety … … 608 608 } 609 609 610 String Database::displayName () const610 String Database::displayNameIsolatedCopy() const 611 611 { 612 612 // Return a deep copy for ref counting thread safety … … 614 614 } 615 615 616 String Database::expectedVersion () const616 String Database::expectedVersionIsolatedCopy() const 617 617 { 618 618 // Return a deep copy for ref counting thread safety … … 631 631 } 632 632 633 String Database::fileName () const633 String Database::fileNameIsolatedCopy() const 634 634 { 635 635 // Return a deep copy for ref counting thread safety … … 640 640 { 641 641 // 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); 643 643 } 644 644 … … 787 787 void Database::didCommitWriteTransaction() 788 788 { 789 DatabaseTracker::singleton().scheduleNotifyDatabaseChanged(securityOrigin(), stringIdentifier ());789 DatabaseTracker::singleton().scheduleNotifyDatabaseChanged(securityOrigin(), stringIdentifierIsolatedCopy()); 790 790 } 791 791 … … 800 800 setEstimatedSize(oldQuota + quotaIncreaseSize); 801 801 } 802 databaseContext().databaseExceededQuota(stringIdentifier (), details());802 databaseContext().databaseExceededQuota(stringIdentifierIsolatedCopy(), details()); 803 803 return tracker.quota(securityOrigin()) > oldQuota; 804 804 } -
trunk/Source/WebCore/Modules/webdatabase/Database.h
r247219 r249313 87 87 88 88 // 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; 92 92 unsigned long long estimatedSize() const; 93 String fileName () const;93 String fileNameIsolatedCopy() const; 94 94 DatabaseDetails details() const; 95 95 SQLiteDatabase& sqliteDatabase() { return m_sqliteDatabase; } -
trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp
r249013 r249313 277 277 unsigned long long quota = quotaNoLock(origin); 278 278 unsigned long long diskUsage = usage(origin); 279 unsigned long long databaseFileSize = SQLiteFileSystem::getDatabaseFileSize(database.fileName ());279 unsigned long long databaseFileSize = SQLiteFileSystem::getDatabaseFileSize(database.fileNameIsolatedCopy()); 280 280 ASSERT(databaseFileSize <= diskUsage); 281 281 … … 519 519 { 520 520 LockHolder lockDatabase(m_databaseGuard); 521 doneCreatingDatabase(database.securityOrigin(), database.stringIdentifier ());521 doneCreatingDatabase(database.securityOrigin(), database.stringIdentifierIsolatedCopy()); 522 522 } 523 523 … … 555 555 } 556 556 557 String name = database.stringIdentifier ();557 String name = database.stringIdentifierIsolatedCopy(); 558 558 auto* databaseSet = nameMap->get(name); 559 559 if (!databaseSet) { … … 564 564 databaseSet->add(&database); 565 565 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); 567 567 } 568 568 … … 582 582 } 583 583 584 String name = database.stringIdentifier ();584 String name = database.stringIdentifierIsolatedCopy(); 585 585 auto* databaseSet = nameMap->get(name); 586 586 if (!databaseSet) { … … 591 591 databaseSet->remove(&database); 592 592 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); 594 594 595 595 if (!databaseSet->isEmpty()) … … 1211 1211 1212 1212 // 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())) { 1214 1214 deletedDatabases.append(db); 1215 1215 foundDeletedDatabase = true; -
trunk/Source/WebCore/Modules/webdatabase/SQLError.h
r240557 r249313 47 47 48 48 unsigned code() const { return m_code; } 49 String message () const { return m_message.isolatedCopy(); }49 String messageIsolatedCopy() const { return m_message.isolatedCopy(); } 50 50 51 51 enum SQLErrorCode { -
trunk/Source/WebCore/Modules/webdatabase/SQLError.idl
r237210 r249313 32 32 ] interface SQLError { 33 33 readonly attribute unsigned long code; 34 readonly attribute DOMString message;34 [ImplementedAs=messageIsolatedCopy] readonly attribute DOMString message; 35 35 36 36 // SQLErrorCode: used only in the async DB API -
trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp
r248846 r249313 266 266 } 267 267 268 m_hasVersionMismatch = !m_database->expectedVersion().isEmpty() && (m_database->expectedVersion() != actualVersion); 268 auto expectedVersion = m_database->expectedVersionIsolatedCopy(); 269 m_hasVersionMismatch = !expectedVersion.isEmpty() && expectedVersion != actualVersion; 269 270 270 271 // 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 61 61 { 62 62 auto errorObject = Inspector::Protocol::Database::Error::create() 63 .setMessage(error.message ())63 .setMessage(error.messageIsolatedCopy()) 64 64 .setCode(error.code()) 65 65 .release(); … … 206 206 void InspectorDatabaseAgent::didOpenDatabase(Database& database) 207 207 { 208 if (auto resource = findByFileName(database.fileName ())) {208 if (auto resource = findByFileName(database.fileNameIsolatedCopy())) { 209 209 resource->setDatabase(database); 210 210 return; 211 211 } 212 212 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()); 214 214 m_resources.add(resource->id(), resource.ptr()); 215 215 resource->bind(*m_frontendDispatcher); … … 305 305 { 306 306 for (auto& resource : m_resources.values()) { 307 if (resource->database().fileName () == fileName)307 if (resource->database().fileNameIsolatedCopy() == fileName) 308 308 return resource.get(); 309 309 } -
trunk/Source/WebCore/workers/service/server/RegistrationDatabase.cpp
r249035 r249313 131 131 ASSERT(!m_database); 132 132 133 auto databaseDirectory = this->databaseDirectory ();133 auto databaseDirectory = this->databaseDirectoryIsolatedCopy(); 134 134 cleanOldDatabases(databaseDirectory); 135 135 … … 306 306 307 307 SQLiteFileSystem::deleteDatabaseFile(m_databaseFilePath); 308 SQLiteFileSystem::deleteEmptyDatabaseDirectory(databaseDirectory ());308 SQLiteFileSystem::deleteEmptyDatabaseDirectory(databaseDirectoryIsolatedCopy()); 309 309 310 310 callOnMainThread(WTFMove(completionHandler)); -
trunk/Source/WebCore/workers/service/server/RegistrationDatabase.h
r248967 r249313 61 61 RegistrationDatabase(RegistrationStore&, String&& databaseDirectory); 62 62 63 String databaseDirectory () const { return m_databaseDirectory.isolatedCopy(); }63 String databaseDirectoryIsolatedCopy() const { return m_databaseDirectory.isolatedCopy(); } 64 64 65 65 void postTaskToWorkQueue(Function<void()>&&); -
trunk/Source/WebKit/ChangeLog
r249312 r249313 1 2019-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 1 32 2019-08-29 Keith Rollin <krollin@apple.com> 2 33 -
trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp
r248846 r249313 77 77 } 78 78 79 String ResourceLoadStatisticsPersistentStorage::storageDirectoryPath () const79 String ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy() const 80 80 { 81 81 return m_storageDirectoryPath.isolatedCopy(); … … 84 84 String ResourceLoadStatisticsPersistentStorage::resourceLogFilePath() const 85 85 { 86 String storagePath = storageDirectoryPath ();86 String storagePath = storageDirectoryPathIsolatedCopy(); 87 87 if (storagePath.isEmpty()) 88 88 return emptyString(); … … 123 123 ASSERT(!RunLoop::isMain()); 124 124 125 String storagePath = storageDirectoryPath ();125 String storagePath = storageDirectoryPathIsolatedCopy(); 126 126 ASSERT(!storagePath.isEmpty()); 127 127 -
trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h
r248762 r249313 57 57 58 58 private: 59 String storageDirectoryPath () const;59 String storageDirectoryPathIsolatedCopy() const; 60 60 String resourceLogFilePath() const; 61 61 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp
r249303 r249313 110 110 #if PLATFORM(GTK) || PLATFORM(WPE) 111 111 // Triggers with "touch $cachePath/dump". 112 CString dumpFilePath = fileSystemRepresentation(pathByAppendingComponent(m_storage->basePath (), "dump"));112 CString dumpFilePath = fileSystemRepresentation(pathByAppendingComponent(m_storage->basePathIsolatedCopy(), "dump")); 113 113 GRefPtr<GFile> dumpFile = adoptGRef(g_file_new_for_path(dumpFilePath.data())); 114 114 GFileMonitor* monitor = g_file_monitor_file(dumpFile.get(), G_FILE_MONITOR_NONE, nullptr, nullptr); … … 595 595 } 596 596 597 String Cache::recordsPath () const598 { 599 return m_storage->recordsPath ();597 String Cache::recordsPathIsolatedCopy() const 598 { 599 return m_storage->recordsPathIsolatedCopy(); 600 600 } 601 601 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.h
r249303 r249313 140 140 void dumpContentsToFile(); 141 141 142 String recordsPath () const;142 String recordsPathIsolatedCopy() const; 143 143 144 144 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp
r248973 r249313 47 47 } 48 48 49 String BlobStorage::blobDirectoryPath () const49 String BlobStorage::blobDirectoryPathIsolatedCopy() const 50 50 { 51 51 return m_blobDirectoryPath.isolatedCopy(); … … 56 56 ASSERT(!RunLoop::isMain()); 57 57 58 FileSystem::makeAllDirectories(blobDirectoryPath()); 58 auto blobDirectoryPath = blobDirectoryPathIsolatedCopy(); 59 FileSystem::makeAllDirectories(blobDirectoryPath); 59 60 60 61 m_approximateSize = 0; 61 auto blobDirectory = blobDirectoryPath ();62 auto blobDirectory = blobDirectoryPath; 62 63 traverseDirectory(blobDirectory, [this, &blobDirectory](const String& name, DirectoryEntryType type) { 63 64 if (type != DirectoryEntryType::File) … … 80 81 { 81 82 auto hashAsString = SHA1::hexDigest(hash); 82 return FileSystem::pathByAppendingComponent(blobDirectoryPath (), String::fromUTF8(hashAsString));83 return FileSystem::pathByAppendingComponent(blobDirectoryPathIsolatedCopy(), String::fromUTF8(hashAsString)); 83 84 } 84 85 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.h
r223179 r249313 58 58 59 59 private: 60 String blobDirectoryPath () const;60 String blobDirectoryPathIsolatedCopy() const; 61 61 String blobPathForHash(const SHA1::Digest&) const; 62 62 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp
r248846 r249313 252 252 } 253 253 254 String Storage::basePath () const254 String Storage::basePathIsolatedCopy() const 255 255 { 256 256 return m_basePath.isolatedCopy(); … … 259 259 String Storage::versionPath() const 260 260 { 261 return makeVersionedDirectoryPath(basePath ());262 } 263 264 String Storage::recordsPath () const261 return makeVersionedDirectoryPath(basePathIsolatedCopy()); 262 } 263 264 String Storage::recordsPathIsolatedCopy() const 265 265 { 266 266 return m_recordsPath.isolatedCopy(); … … 300 300 301 301 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) { 303 303 auto filePath = FileSystem::pathByAppendingComponent(recordDirectoryPath, fileName); 304 304 … … 324 324 m_blobStorage.synchronize(); 325 325 326 deleteEmptyRecordsDirectories(recordsPath ());326 deleteEmptyRecordsDirectories(recordsPathIsolatedCopy()); 327 327 328 328 LOG(NetworkCacheStorage, "(NetworkProcess) cache synchronization completed size=%zu recordCount=%u", recordsSize, recordCount); … … 375 375 { 376 376 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()); 378 378 } 379 379 … … 904 904 905 905 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) { 907 907 ASSERT(type == traverseOperation.type || traverseOperation.type.isEmpty()); 908 908 if (isBlob) … … 999 999 1000 1000 ioQueue().dispatch([this, protectedThis = makeRef(*this), modifiedSinceTime, completionHandler = WTFMove(completionHandler), type = type.isolatedCopy()] () mutable { 1001 auto recordsPath = this->recordsPath ();1001 auto recordsPath = this->recordsPathIsolatedCopy(); 1002 1002 traverseRecordsFiles(recordsPath, type, [modifiedSinceTime](const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath) { 1003 1003 auto filePath = FileSystem::pathByAppendingComponent(recordDirectoryPath, fileName); … … 1075 1075 1076 1076 backgroundIOQueue().dispatch([this, protectedThis = makeRef(*this)] () mutable { 1077 auto recordsPath = this->recordsPath ();1077 auto recordsPath = this->recordsPathIsolatedCopy(); 1078 1078 String anyType; 1079 1079 traverseRecordsFiles(recordsPath, anyType, [this](const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath) { … … 1110 1110 void Storage::deleteOldVersions() 1111 1111 { 1112 backgroundIOQueue().dispatch([cachePath = basePath ()] () mutable {1112 backgroundIOQueue().dispatch([cachePath = basePathIsolatedCopy()] () mutable { 1113 1113 traverseDirectory(cachePath, [&cachePath](const String& subdirName, DirectoryEntryType type) { 1114 1114 if (type != DirectoryEntryType::Directory) -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h
r244678 r249313 114 114 #endif 115 115 116 String basePath () const;116 String basePathIsolatedCopy() const; 117 117 String versionPath() const; 118 String recordsPath () const;118 String recordsPathIsolatedCopy() const; 119 119 120 120 const Salt& salt() const { return m_salt; }
Note: See TracChangeset
for help on using the changeset viewer.