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 |
11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
13 * | 13 * |
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef IDBIndex_h | 26 #ifndef IDBIndex_h |
27 #define IDBIndex_h | 27 #define IDBIndex_h |
28 | 28 |
| 29 #include "Source/modules/indexeddb/indexed_db.mojom-blink.h" |
29 #include "bindings/core/v8/ScriptWrappable.h" | 30 #include "bindings/core/v8/ScriptWrappable.h" |
30 #include "modules/indexeddb/IDBCursor.h" | 31 #include "modules/indexeddb/IDBCursor.h" |
31 #include "modules/indexeddb/IDBKeyPath.h" | 32 #include "modules/indexeddb/IDBKeyPath.h" |
32 #include "modules/indexeddb/IDBKeyRange.h" | 33 #include "modules/indexeddb/IDBKeyRange.h" |
33 #include "modules/indexeddb/IDBMetadata.h" | 34 #include "modules/indexeddb/IDBMetadata.h" |
34 #include "modules/indexeddb/IDBRequest.h" | 35 #include "modules/indexeddb/IDBRequest.h" |
35 #include "public/platform/modules/indexeddb/WebIDBCursor.h" | |
36 #include "public/platform/modules/indexeddb/WebIDBDatabase.h" | |
37 #include "public/platform/modules/indexeddb/WebIDBTypes.h" | |
38 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
39 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
40 | 38 |
41 namespace blink { | 39 namespace blink { |
42 | 40 |
43 class ExceptionState; | 41 class ExceptionState; |
| 42 class IDBDatabaseProxy; |
44 class IDBObjectStore; | 43 class IDBObjectStore; |
45 | 44 |
46 class IDBIndex final : public GarbageCollectedFinalized<IDBIndex>, public Script
Wrappable { | 45 class IDBIndex final : public GarbageCollectedFinalized<IDBIndex>, public Script
Wrappable { |
47 DEFINE_WRAPPERTYPEINFO(); | 46 DEFINE_WRAPPERTYPEINFO(); |
48 public: | 47 public: |
49 static IDBIndex* create(const IDBIndexMetadata& metadata, IDBObjectStore* ob
jectStore, IDBTransaction* transaction) | 48 static IDBIndex* create(const IDBIndexMetadata& metadata, IDBObjectStore* ob
jectStore, IDBTransaction* transaction) |
50 { | 49 { |
51 return new IDBIndex(metadata, objectStore, transaction); | 50 return new IDBIndex(metadata, objectStore, transaction); |
52 } | 51 } |
53 ~IDBIndex(); | 52 ~IDBIndex(); |
(...skipping 13 matching lines...) Expand all Loading... |
67 IDBRequest* getAll(ScriptState*, const ScriptValue& range, ExceptionState&); | 66 IDBRequest* getAll(ScriptState*, const ScriptValue& range, ExceptionState&); |
68 IDBRequest* getAll(ScriptState*, const ScriptValue& range, unsigned long max
Count, ExceptionState&); | 67 IDBRequest* getAll(ScriptState*, const ScriptValue& range, unsigned long max
Count, ExceptionState&); |
69 IDBRequest* getKey(ScriptState*, const ScriptValue& key, ExceptionState&); | 68 IDBRequest* getKey(ScriptState*, const ScriptValue& key, ExceptionState&); |
70 IDBRequest* getAllKeys(ScriptState*, const ScriptValue& range, ExceptionStat
e&); | 69 IDBRequest* getAllKeys(ScriptState*, const ScriptValue& range, ExceptionStat
e&); |
71 IDBRequest* getAllKeys(ScriptState*, const ScriptValue& range, uint32_t maxC
ount, ExceptionState&); | 70 IDBRequest* getAllKeys(ScriptState*, const ScriptValue& range, uint32_t maxC
ount, ExceptionState&); |
72 | 71 |
73 void markDeleted() { m_deleted = true; } | 72 void markDeleted() { m_deleted = true; } |
74 bool isDeleted() const; | 73 bool isDeleted() const; |
75 | 74 |
76 // Used internally and by InspectorIndexedDBAgent: | 75 // Used internally and by InspectorIndexedDBAgent: |
77 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, WebIDBCursorDirection); | 76 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, indexed_db::mojom::blink:
:CursorDirection); |
78 | 77 |
79 WebIDBDatabase* backendDB() const; | 78 IDBDatabaseProxy* backendDB() const; |
80 | 79 |
81 private: | 80 private: |
82 IDBIndex(const IDBIndexMetadata&, IDBObjectStore*, IDBTransaction*); | 81 IDBIndex(const IDBIndexMetadata&, IDBObjectStore*, IDBTransaction*); |
83 | 82 |
84 IDBRequest* getInternal(ScriptState*, const ScriptValue& key, ExceptionState
&, bool keyOnly); | 83 IDBRequest* getInternal(ScriptState*, const ScriptValue& key, ExceptionState
&, bool keyOnly); |
85 IDBRequest* getAllInternal(ScriptState*, const ScriptValue& range, unsigned
long maxCount, ExceptionState&, bool keyOnly); | 84 IDBRequest* getAllInternal(ScriptState*, const ScriptValue& range, unsigned
long maxCount, ExceptionState&, bool keyOnly); |
86 | 85 |
87 IDBIndexMetadata m_metadata; | 86 IDBIndexMetadata m_metadata; |
88 Member<IDBObjectStore> m_objectStore; | 87 Member<IDBObjectStore> m_objectStore; |
89 Member<IDBTransaction> m_transaction; | 88 Member<IDBTransaction> m_transaction; |
90 bool m_deleted = false; | 89 bool m_deleted = false; |
91 }; | 90 }; |
92 | 91 |
93 } // namespace blink | 92 } // namespace blink |
94 | 93 |
95 #endif // IDBIndex_h | 94 #endif // IDBIndex_h |
OLD | NEW |