Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp

Issue 2276593002: Support renaming of IndexedDB indexes and object stores. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests for create rename in the same aborted transaction. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
index aa6524d1ebddae195ea237a791b8b3d7d2c62beb..c3ea8d4d7d32592d72c942cd6a95a97e5d7005ea 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
@@ -191,6 +191,19 @@ void IDBTransaction::objectStoreDeleted(const String& name)
}
}
+void IDBTransaction::objectStoreWillBeRenamed(const String& oldName, const String& newName)
jsbell 2016/09/07 17:16:14 Here we don't need the id... but it still seems li
pwnall 2016/09/07 22:43:52 objectStoreDeleted() also takes in the store's nam
+{
+ DCHECK(m_state != Finished);
+ DCHECK(isVersionChange());
+
+ DCHECK(!m_objectStoreMap.contains(newName));
+ DCHECK(m_objectStoreMap.contains(oldName)) << "The object store had to be accessed in order to be renamed.";
+
+ IDBObjectStoreMap::iterator it = m_objectStoreMap.find(oldName);
+ m_objectStoreMap.set(newName, it->value);
+ m_objectStoreMap.remove(oldName);
+}
+
void IDBTransaction::setActive(bool active)
{
DCHECK_NE(m_state, Finished) << "A finished transaction tried to setActive(" << (active ? "true" : "false") << ")";

Powered by Google App Engine
This is Rietveld 408576698