Title: [249054] branches/safari-608-branch/Source/WebCore
- Revision
- 249054
- Author
- [email protected]
- Date
- 2019-08-23 10:53:16 -0700 (Fri, 23 Aug 2019)
Log 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
Modified Paths
Diff
Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (249053 => 249054)
--- branches/safari-608-branch/Source/WebCore/ChangeLog 2019-08-23 17:53:14 UTC (rev 249053)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog 2019-08-23 17:53:16 UTC (rev 249054)
@@ -1,5 +1,46 @@
2019-08-23 Kocsen Chung <[email protected]>
+ 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
+
+ 2019-08-21 Chris Dumez <[email protected]>
+
+ 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):
+
+2019-08-23 Kocsen Chung <[email protected]>
+
Cherry-pick r248967. rdar://problem/54643456
Crash under StringImpl::endsWith() in RegistrationDatabase::openSQLiteDatabase()
Modified: branches/safari-608-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (249053 => 249054)
--- branches/safari-608-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp 2019-08-23 17:53:14 UTC (rev 249053)
+++ branches/safari-608-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp 2019-08-23 17:53:16 UTC (rev 249054)
@@ -793,9 +793,10 @@
String SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade()
{
- String oldOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory, "v0");
+ auto databaseRootDirectory = this->databaseRootDirectory();
+ String oldOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v0");
String oldDatabaseDirectory = FileSystem::pathByAppendingComponent(oldOriginDirectory, filenameForDatabaseName());
- String newOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory, "v1");
+ String newOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v1");
String fileNameHash = SQLiteFileSystem::computeHashForFileName(m_identifier.databaseName());
Vector<String> directoriesWithSameHash = FileSystem::listDirectory(newOriginDirectory, fileNameHash + "*");
String newDatabaseDirectory = FileSystem::pathByAppendingComponent(newOriginDirectory, fileNameHash);
@@ -892,8 +893,9 @@
uint64_t SQLiteIDBBackingStore::databasesSizeForOrigin() const
{
- String oldVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory, "v0");
- String newVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory, "v1");
+ auto databaseRootDirectory = this->databaseRootDirectory();
+ String oldVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v0");
+ String newVersionOriginDirectory = m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory, "v1");
return databasesSizeForFolder(oldVersionOriginDirectory) + databasesSizeForFolder(newVersionOriginDirectory);
}
@@ -2643,7 +2645,7 @@
SQLiteFileSystem::deleteDatabaseFile(dbFilename);
SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_databaseDirectory);
- SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_identifier.databaseDirectoryRelativeToRoot(m_databaseRootDirectory));
+ SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_identifier.databaseDirectoryRelativeToRoot(databaseRootDirectory()));
}
void SQLiteIDBBackingStore::unregisterCursor(SQLiteIDBCursor& cursor)
Modified: branches/safari-608-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h (249053 => 249054)
--- branches/safari-608-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h 2019-08-23 17:53:14 UTC (rev 249053)
+++ branches/safari-608-branch/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h 2019-08-23 17:53:16 UTC (rev 249054)
@@ -105,6 +105,8 @@
String filenameForDatabaseName() const;
String fullDatabasePath() const;
String fullDatabaseDirectoryWithUpgrade();
+
+ String databaseRootDirectory() const { return m_databaseRootDirectory.isolatedCopy(); }
uint64_t quotaForOrigin() const;
uint64_t maximumSize() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes