| Index: third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
|
| diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
|
| index 75157c238f3a53f7ebf8e3bf187a19310922919b..4662e7b40f3c584bcffb26148b7b4aee93d9c011 100644
|
| --- a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
|
| +++ b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
|
| @@ -45,13 +45,14 @@ using blink::WebIDBDatabase;
|
|
|
| namespace blink {
|
|
|
| -IDBIndex::IDBIndex(const IDBIndexMetadata& metadata, IDBObjectStore* objectStore, IDBTransaction* transaction)
|
| - : m_metadata(metadata)
|
| +IDBIndex::IDBIndex(RefPtr<IDBIndexMetadata> metadata, IDBObjectStore* objectStore, IDBTransaction* transaction)
|
| + : m_metadata(std::move(metadata))
|
| , m_objectStore(objectStore)
|
| , m_transaction(transaction)
|
| {
|
| DCHECK(m_objectStore);
|
| DCHECK(m_transaction);
|
| + DCHECK(m_metadata.get());
|
| DCHECK_NE(id(), IDBIndexMetadata::InvalidId);
|
| }
|
|
|
| @@ -100,9 +101,7 @@ void IDBIndex::setName(const String& name, ExceptionState& exceptionState)
|
| }
|
|
|
| backendDB()->renameIndex(m_transaction->id(), m_objectStore->id(), id(), name);
|
| - m_metadata.name = name;
|
| - m_objectStore->indexRenamed(m_metadata.id, name);
|
| - m_transaction->db()->indexRenamed(m_objectStore->id(), id(), name);
|
| + m_objectStore->renameIndex(id(), name);
|
| }
|
|
|
| ScriptValue IDBIndex::keyPath(ScriptState* scriptState) const
|
| @@ -110,6 +109,15 @@ ScriptValue IDBIndex::keyPath(ScriptState* scriptState) const
|
| return ScriptValue::from(scriptState, metadata().keyPath);
|
| }
|
|
|
| +void IDBIndex::revertMetadata(RefPtr<IDBIndexMetadata> oldMetadata)
|
| +{
|
| + m_metadata = std::move(oldMetadata);
|
| +
|
| + // An index's metadata will only get reverted if the index was in the
|
| + // database when the versionchange transaction started.
|
| + m_deleted = false;
|
| +}
|
| +
|
| IDBRequest* IDBIndex::openCursor(ScriptState* scriptState, const ScriptValue& range, const String& directionString, ExceptionState& exceptionState)
|
| {
|
| IDB_TRACE("IDBIndex::openCursor");
|
| @@ -308,9 +316,4 @@ WebIDBDatabase* IDBIndex::backendDB() const
|
| return m_transaction->backendDB();
|
| }
|
|
|
| -bool IDBIndex::isDeleted() const
|
| -{
|
| - return m_deleted || m_objectStore->isDeleted();
|
| -}
|
| -
|
| } // namespace blink
|
|
|