Title: [209168] trunk/Source/WebCore
- Revision
- 209168
- Author
- beid...@apple.com
- Date
- 2016-11-30 18:42:28 -0800 (Wed, 30 Nov 2016)
Log Message
IndexedDB: When doing puts, don't "updateAllIndexesForAddRecord" if there are no indexes.
https://bugs.webkit.org/show_bug.cgi?id=165215
Reviewed by Alex Christensen.
No new tests (No observable behavior change).
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Don't "updateAllIndexesForAddRecord" if there are no indexes.
Avoiding this saved us some IDBKey serialization and _javascript_ object manipulation.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (209167 => 209168)
--- trunk/Source/WebCore/ChangeLog 2016-12-01 02:33:04 UTC (rev 209167)
+++ trunk/Source/WebCore/ChangeLog 2016-12-01 02:42:28 UTC (rev 209168)
@@ -1,3 +1,16 @@
+2016-11-30 Brady Eidson <beid...@apple.com>
+
+ IndexedDB: When doing puts, don't "updateAllIndexesForAddRecord" if there are no indexes.
+ https://bugs.webkit.org/show_bug.cgi?id=165215
+
+ Reviewed by Alex Christensen.
+
+ No new tests (No observable behavior change).
+
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+ (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Don't "updateAllIndexesForAddRecord" if there are no indexes.
+ Avoiding this saved us some IDBKey serialization and _javascript_ object manipulation.
+
2016-11-30 Antoine Quint <grao...@apple.com>
[Modern Media Controls] LayoutNode: only mark properties as dirty if different than current value
Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (209167 => 209168)
--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp 2016-12-01 02:33:04 UTC (rev 209167)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp 2016-12-01 02:42:28 UTC (rev 209168)
@@ -1660,19 +1660,21 @@
recordID = m_sqliteDB->lastInsertRowID();
}
- auto error = updateAllIndexesForAddRecord(objectStoreInfo, keyData, value.data());
+ if (!objectStoreInfo.indexMap().isEmpty()) {
+ auto error = updateAllIndexesForAddRecord(objectStoreInfo, keyData, value.data());
- if (!error.isNull()) {
- auto* sql = cachedStatement(SQL::DeleteObjectStoreRecord, ASCIILiteral("DELETE FROM Records WHERE objectStoreID = ? AND key = CAST(? AS TEXT);"));
- if (!sql
- || sql->bindInt64(1, objectStoreInfo.identifier()) != SQLITE_OK
- || sql->bindBlob(2, keyBuffer->data(), keyBuffer->size()) != SQLITE_OK
- || sql->step() != SQLITE_DONE) {
- LOG_ERROR("Indexing new object store record failed, but unable to remove the object store record itself");
- return { IDBDatabaseException::UnknownError, ASCIILiteral("Indexing new object store record failed, but unable to remove the object store record itself") };
+ if (!error.isNull()) {
+ auto* sql = cachedStatement(SQL::DeleteObjectStoreRecord, ASCIILiteral("DELETE FROM Records WHERE objectStoreID = ? AND key = CAST(? AS TEXT);"));
+ if (!sql
+ || sql->bindInt64(1, objectStoreInfo.identifier()) != SQLITE_OK
+ || sql->bindBlob(2, keyBuffer->data(), keyBuffer->size()) != SQLITE_OK
+ || sql->step() != SQLITE_DONE) {
+ LOG_ERROR("Indexing new object store record failed, but unable to remove the object store record itself");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Indexing new object store record failed, but unable to remove the object store record itself") };
+ }
+
+ return error;
}
-
- return error;
}
const Vector<String>& blobURLs = value.blobURLs();
@@ -1728,7 +1730,7 @@
transaction->notifyCursorsOfChanges(objectStoreInfo.identifier());
- return error;
+ return { };
}
IDBError SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord(int64_t objectStoreRecord, Vector<String>& blobURLs, Vector<String>& blobFilePaths)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes