Index: third_party/WebKit/Source/modules/indexeddb/IDBIndex.h |
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.h b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.h |
index 77c907c495641f8871b9c0721d06f2e45d7b9065..b01a82014b8fb86eaa5e7e6522eae92d75c697cd 100644 |
--- a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.h |
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.h |
@@ -46,20 +46,22 @@ class IDBObjectStore; |
class IDBIndex final : public GarbageCollectedFinalized<IDBIndex>, public ScriptWrappable { |
DEFINE_WRAPPERTYPEINFO(); |
public: |
- static IDBIndex* create(const IDBIndexMetadata& metadata, IDBObjectStore* objectStore, IDBTransaction* transaction) |
+ static IDBIndex* create(RefPtr<IDBIndexMetadata> metadata, IDBObjectStore* objectStore, IDBTransaction* transaction) |
{ |
- return new IDBIndex(metadata, objectStore, transaction); |
+ return new IDBIndex(std::move(metadata), objectStore, transaction); |
} |
~IDBIndex(); |
DECLARE_TRACE(); |
+ const IDBIndexMetadata& metadata() const { return *m_metadata; } |
+ |
// Implement the IDL |
- const String& name() const { return m_metadata.name; } |
+ const String& name() const { return metadata().name; } |
void setName(const String& name, ExceptionState&); |
IDBObjectStore* objectStore() const { return m_objectStore.get(); } |
ScriptValue keyPath(ScriptState*) const; |
- bool unique() const { return m_metadata.unique; } |
- bool multiEntry() const { return m_metadata.multiEntry; } |
+ bool unique() const { return metadata().unique; } |
+ bool multiEntry() const { return metadata().multiEntry; } |
IDBRequest* openCursor(ScriptState*, const ScriptValue& key, const String& direction, ExceptionState&); |
IDBRequest* openKeyCursor(ScriptState*, const ScriptValue& range, const String& direction, ExceptionState&); |
@@ -72,8 +74,9 @@ public: |
IDBRequest* getAllKeys(ScriptState*, const ScriptValue& range, uint32_t maxCount, ExceptionState&); |
void markDeleted() { m_deleted = true; } |
- bool isDeleted() const; |
- int64_t id() const { return m_metadata.id; } |
+ bool isDeleted() const { return m_deleted; } |
+ int64_t id() const { return metadata().id; } |
+ void revertMetadata(RefPtr<IDBIndexMetadata> oldMetadata); |
// Used internally and by InspectorIndexedDBAgent: |
IDBRequest* openCursor(ScriptState*, IDBKeyRange*, WebIDBCursorDirection); |
@@ -81,12 +84,12 @@ public: |
WebIDBDatabase* backendDB() const; |
private: |
- IDBIndex(const IDBIndexMetadata&, IDBObjectStore*, IDBTransaction*); |
+ IDBIndex(RefPtr<IDBIndexMetadata>, IDBObjectStore*, IDBTransaction*); |
IDBRequest* getInternal(ScriptState*, const ScriptValue& key, ExceptionState&, bool keyOnly); |
IDBRequest* getAllInternal(ScriptState*, const ScriptValue& range, unsigned long maxCount, ExceptionState&, bool keyOnly); |
- IDBIndexMetadata m_metadata; |
+ RefPtr<IDBIndexMetadata> m_metadata; |
Member<IDBObjectStore> m_objectStore; |
Member<IDBTransaction> m_transaction; |
bool m_deleted = false; |