OLD | NEW |
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 IDBIndex* createIndex(ScriptState* scriptState, const String& name, const Ve
ctor<String>& keyPath, const Dictionary& options, ExceptionState& exceptionState
) | 81 IDBIndex* createIndex(ScriptState* scriptState, const String& name, const Ve
ctor<String>& keyPath, const Dictionary& options, ExceptionState& exceptionState
) |
82 { | 82 { |
83 return createIndex(scriptState, name, IDBKeyPath(keyPath), options, exce
ptionState); | 83 return createIndex(scriptState, name, IDBKeyPath(keyPath), options, exce
ptionState); |
84 } | 84 } |
85 IDBIndex* index(const String& name, ExceptionState&); | 85 IDBIndex* index(const String& name, ExceptionState&); |
86 void deleteIndex(const String& name, ExceptionState&); | 86 void deleteIndex(const String& name, ExceptionState&); |
87 | 87 |
88 IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&); | 88 IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&); |
89 | 89 |
90 // Used by IDBCursor::update(): | 90 // Used by IDBCursor::update(): |
91 IDBRequest* put(ScriptState*, blink::WebIDBPutMode, IDBAny* source, ScriptVa
lue&, IDBKey*, ExceptionState&); | 91 IDBRequest* put(ScriptState*, WebIDBPutMode, IDBAny* source, ScriptValue&, I
DBKey*, ExceptionState&); |
92 | 92 |
93 // Used internally and by InspectorIndexedDBAgent: | 93 // Used internally and by InspectorIndexedDBAgent: |
94 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, blink::WebIDBCursorDirect
ion, blink::WebIDBTaskType = blink::WebIDBTaskTypeNormal); | 94 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, WebIDBCursorDirection, We
bIDBTaskType = WebIDBTaskTypeNormal); |
95 | 95 |
96 void markDeleted() { m_deleted = true; } | 96 void markDeleted() { m_deleted = true; } |
97 bool isDeleted() const { return m_deleted; } | 97 bool isDeleted() const { return m_deleted; } |
98 void transactionFinished(); | 98 void transactionFinished(); |
99 | 99 |
100 const IDBObjectStoreMetadata& metadata() const { return m_metadata; } | 100 const IDBObjectStoreMetadata& metadata() const { return m_metadata; } |
101 void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = meta
data; } | 101 void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = meta
data; } |
102 | 102 |
103 typedef HeapVector<Member<IDBKey> > IndexKeys; | 103 typedef HeapVector<Member<IDBKey> > IndexKeys; |
104 | 104 |
105 blink::WebIDBDatabase* backendDB() const; | 105 WebIDBDatabase* backendDB() const; |
106 | 106 |
107 private: | 107 private: |
108 IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*); | 108 IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*); |
109 | 109 |
110 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, c
onst Dictionary&, ExceptionState&); | 110 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, c
onst Dictionary&, ExceptionState&); |
111 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, b
ool unique, bool multiEntry, ExceptionState&); | 111 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, b
ool unique, bool multiEntry, ExceptionState&); |
112 IDBRequest* put(ScriptState*, blink::WebIDBPutMode, IDBAny* source, ScriptVa
lue&, const ScriptValue& key, ExceptionState&); | 112 IDBRequest* put(ScriptState*, WebIDBPutMode, IDBAny* source, ScriptValue&, c
onst ScriptValue& key, ExceptionState&); |
113 | 113 |
114 int64_t findIndexId(const String& name) const; | 114 int64_t findIndexId(const String& name) const; |
115 bool containsIndex(const String& name) const | 115 bool containsIndex(const String& name) const |
116 { | 116 { |
117 return findIndexId(name) != IDBIndexMetadata::InvalidId; | 117 return findIndexId(name) != IDBIndexMetadata::InvalidId; |
118 } | 118 } |
119 | 119 |
120 IDBObjectStoreMetadata m_metadata; | 120 IDBObjectStoreMetadata m_metadata; |
121 Member<IDBTransaction> m_transaction; | 121 Member<IDBTransaction> m_transaction; |
122 bool m_deleted; | 122 bool m_deleted; |
123 | 123 |
124 typedef HeapHashMap<String, Member<IDBIndex> > IDBIndexMap; | 124 typedef HeapHashMap<String, Member<IDBIndex> > IDBIndexMap; |
125 IDBIndexMap m_indexMap; | 125 IDBIndexMap m_indexMap; |
126 }; | 126 }; |
127 | 127 |
128 } // namespace blink | 128 } // namespace blink |
129 | 129 |
130 #endif // IDBObjectStore_h | 130 #endif // IDBObjectStore_h |
OLD | NEW |