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 20 matching lines...) Expand all Loading... |
31 #include "bindings/v8/SerializedScriptValue.h" | 31 #include "bindings/v8/SerializedScriptValue.h" |
32 #include "modules/indexeddb/IDBCursor.h" | 32 #include "modules/indexeddb/IDBCursor.h" |
33 #include "modules/indexeddb/IDBIndex.h" | 33 #include "modules/indexeddb/IDBIndex.h" |
34 #include "modules/indexeddb/IDBKey.h" | 34 #include "modules/indexeddb/IDBKey.h" |
35 #include "modules/indexeddb/IDBKeyRange.h" | 35 #include "modules/indexeddb/IDBKeyRange.h" |
36 #include "modules/indexeddb/IDBMetadata.h" | 36 #include "modules/indexeddb/IDBMetadata.h" |
37 #include "modules/indexeddb/IDBRequest.h" | 37 #include "modules/indexeddb/IDBRequest.h" |
38 #include "modules/indexeddb/IDBTransaction.h" | 38 #include "modules/indexeddb/IDBTransaction.h" |
39 #include "public/platform/WebIDBCursor.h" | 39 #include "public/platform/WebIDBCursor.h" |
40 #include "public/platform/WebIDBDatabase.h" | 40 #include "public/platform/WebIDBDatabase.h" |
| 41 #include "public/platform/WebIDBTypes.h" |
41 #include "wtf/PassRefPtr.h" | 42 #include "wtf/PassRefPtr.h" |
42 #include "wtf/RefPtr.h" | 43 #include "wtf/RefPtr.h" |
43 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
44 | 45 |
45 namespace WebCore { | 46 namespace WebCore { |
46 | 47 |
47 class DOMStringList; | 48 class DOMStringList; |
48 class IDBAny; | 49 class IDBAny; |
49 class ExceptionState; | 50 class ExceptionState; |
50 | 51 |
(...skipping 29 matching lines...) Expand all Loading... |
80 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
) |
81 { | 82 { |
82 return createIndex(scriptState, name, IDBKeyPath(keyPath), options, exce
ptionState); | 83 return createIndex(scriptState, name, IDBKeyPath(keyPath), options, exce
ptionState); |
83 } | 84 } |
84 IDBIndex* index(const String& name, ExceptionState&); | 85 IDBIndex* index(const String& name, ExceptionState&); |
85 void deleteIndex(const String& name, ExceptionState&); | 86 void deleteIndex(const String& name, ExceptionState&); |
86 | 87 |
87 IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&); | 88 IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&); |
88 | 89 |
89 // Used by IDBCursor::update(): | 90 // Used by IDBCursor::update(): |
90 IDBRequest* put(ScriptState*, blink::WebIDBDatabase::PutMode, IDBAny* source
, ScriptValue&, IDBKey*, ExceptionState&); | 91 IDBRequest* put(ScriptState*, blink::WebIDBPutMode, IDBAny* source, ScriptVa
lue&, IDBKey*, ExceptionState&); |
91 | 92 |
92 // Used internally and by InspectorIndexedDBAgent: | 93 // Used internally and by InspectorIndexedDBAgent: |
93 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, blink::WebIDBCursor::Dire
ction, blink::WebIDBDatabase::TaskType = blink::WebIDBDatabase::NormalTask); | 94 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, blink::WebIDBCursorDirect
ion, blink::WebIDBTaskType = blink::WebIDBTaskTypeNormal); |
94 | 95 |
95 void markDeleted() { m_deleted = true; } | 96 void markDeleted() { m_deleted = true; } |
96 bool isDeleted() const { return m_deleted; } | 97 bool isDeleted() const { return m_deleted; } |
97 void transactionFinished(); | 98 void transactionFinished(); |
98 | 99 |
99 const IDBObjectStoreMetadata& metadata() const { return m_metadata; } | 100 const IDBObjectStoreMetadata& metadata() const { return m_metadata; } |
100 void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = meta
data; } | 101 void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = meta
data; } |
101 | 102 |
102 typedef HeapVector<Member<IDBKey> > IndexKeys; | 103 typedef HeapVector<Member<IDBKey> > IndexKeys; |
103 | 104 |
104 blink::WebIDBDatabase* backendDB() const; | 105 blink::WebIDBDatabase* backendDB() const; |
105 | 106 |
106 private: | 107 private: |
107 IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*); | 108 IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*); |
108 | 109 |
109 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&); |
110 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&); |
111 IDBRequest* put(ScriptState*, blink::WebIDBDatabase::PutMode, IDBAny* source
, ScriptValue&, const ScriptValue& key, ExceptionState&); | 112 IDBRequest* put(ScriptState*, blink::WebIDBPutMode, IDBAny* source, ScriptVa
lue&, const ScriptValue& key, ExceptionState&); |
112 | 113 |
113 int64_t findIndexId(const String& name) const; | 114 int64_t findIndexId(const String& name) const; |
114 bool containsIndex(const String& name) const | 115 bool containsIndex(const String& name) const |
115 { | 116 { |
116 return findIndexId(name) != IDBIndexMetadata::InvalidId; | 117 return findIndexId(name) != IDBIndexMetadata::InvalidId; |
117 } | 118 } |
118 | 119 |
119 IDBObjectStoreMetadata m_metadata; | 120 IDBObjectStoreMetadata m_metadata; |
120 Member<IDBTransaction> m_transaction; | 121 Member<IDBTransaction> m_transaction; |
121 bool m_deleted; | 122 bool m_deleted; |
122 | 123 |
123 typedef HeapHashMap<String, Member<IDBIndex> > IDBIndexMap; | 124 typedef HeapHashMap<String, Member<IDBIndex> > IDBIndexMap; |
124 IDBIndexMap m_indexMap; | 125 IDBIndexMap m_indexMap; |
125 }; | 126 }; |
126 | 127 |
127 } // namespace WebCore | 128 } // namespace WebCore |
128 | 129 |
129 #endif // IDBObjectStore_h | 130 #endif // IDBObjectStore_h |
OLD | NEW |