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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.h

Issue 2314933005: Align IndexedDB metadata rollback on transaction abort to spec. (Closed)
Patch Set: Add failing tests. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&); 90 IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&);
91 91
92 // Used by IDBCursor::update(): 92 // Used by IDBCursor::update():
93 IDBRequest* put(ScriptState*, WebIDBPutMode, IDBAny* source, const ScriptVal ue&, IDBKey*, ExceptionState&); 93 IDBRequest* put(ScriptState*, WebIDBPutMode, IDBAny* source, const ScriptVal ue&, IDBKey*, ExceptionState&);
94 94
95 // Used internally and by InspectorIndexedDBAgent: 95 // Used internally and by InspectorIndexedDBAgent:
96 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, WebIDBCursorDirection, We bIDBTaskType = WebIDBTaskTypeNormal); 96 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, WebIDBCursorDirection, We bIDBTaskType = WebIDBTaskTypeNormal);
97 97
98 void markDeleted() { m_deleted = true; } 98 void markDeleted() { m_deleted = true; }
99 bool isDeleted() const { return m_deleted; } 99 bool isDeleted() const { return m_deleted; }
100 void abort(); 100 void versionChangeTransactionAborted();
101 void transactionFinished(); 101 void transactionFinished();
102 102
103 const IDBObjectStoreMetadata& metadata() const { return m_metadata; } 103 const IDBObjectStoreMetadata& metadata() const { return m_metadata; }
104 void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = meta data; } 104 // Rolls back the object store's metadata to a previous version.
105 //
106 // Used when a versionchange transaction is aborted.
107 void rollbackMetadata(const IDBObjectStoreMetadata& previousMetadata);
105 108
106 typedef HeapVector<Member<IDBKey>> IndexKeys; 109 typedef HeapVector<Member<IDBKey>> IndexKeys;
107 110
108 WebIDBDatabase* backendDB() const; 111 WebIDBDatabase* backendDB() const;
109 112
110 private: 113 private:
111 IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*); 114 IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*);
112 115
113 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, c onst IDBIndexParameters&, ExceptionState&); 116 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, c onst IDBIndexParameters&, ExceptionState&);
114 IDBRequest* put(ScriptState*, WebIDBPutMode, IDBAny* source, const ScriptVal ue&, const ScriptValue& key, ExceptionState&); 117 IDBRequest* put(ScriptState*, WebIDBPutMode, IDBAny* source, const ScriptVal ue&, const ScriptValue& key, ExceptionState&);
(...skipping 12 matching lines...) Expand all
127 IDBIndexMap m_indexMap; 130 IDBIndexMap m_indexMap;
128 131
129 // Used to mark indexes created in an aborted upgrade transaction as 132 // Used to mark indexes created in an aborted upgrade transaction as
130 // deleted. 133 // deleted.
131 HeapHashSet<Member<IDBIndex>> m_createdIndexes; 134 HeapHashSet<Member<IDBIndex>> m_createdIndexes;
132 }; 135 };
133 136
134 } // namespace blink 137 } // namespace blink
135 138
136 #endif // IDBObjectStore_h 139 #endif // IDBObjectStore_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698