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 11 matching lines...) Expand all Loading... |
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef IDBRequest_h | 29 #ifndef IDBRequest_h |
30 #define IDBRequest_h | 30 #define IDBRequest_h |
31 | 31 |
| 32 #include <memory> |
32 #include "bindings/core/v8/ActiveScriptWrappable.h" | 33 #include "bindings/core/v8/ActiveScriptWrappable.h" |
33 #include "bindings/core/v8/ScriptState.h" | 34 #include "bindings/core/v8/ScriptState.h" |
34 #include "bindings/core/v8/ScriptValue.h" | 35 #include "bindings/core/v8/ScriptValue.h" |
35 #include "core/dom/DOMStringList.h" | 36 #include "core/dom/DOMStringList.h" |
36 #include "core/dom/SuspendableObject.h" | 37 #include "core/dom/SuspendableObject.h" |
37 #include "core/events/EventListener.h" | 38 #include "core/events/EventListener.h" |
38 #include "core/events/EventTarget.h" | 39 #include "core/events/EventTarget.h" |
39 #include "modules/EventModules.h" | 40 #include "modules/EventModules.h" |
40 #include "modules/ModulesExport.h" | 41 #include "modules/ModulesExport.h" |
41 #include "modules/indexeddb/IDBAny.h" | 42 #include "modules/indexeddb/IDBAny.h" |
| 43 #include "modules/indexeddb/IDBRequestLoader.h" |
42 #include "modules/indexeddb/IDBTransaction.h" | 44 #include "modules/indexeddb/IDBTransaction.h" |
43 #include "modules/indexeddb/IndexedDB.h" | 45 #include "modules/indexeddb/IndexedDB.h" |
44 #include "platform/blob/BlobData.h" | 46 #include "platform/blob/BlobData.h" |
45 #include "platform/heap/Handle.h" | 47 #include "platform/heap/Handle.h" |
46 #include "public/platform/WebBlobInfo.h" | 48 #include "public/platform/WebBlobInfo.h" |
47 #include "public/platform/modules/indexeddb/WebIDBCursor.h" | 49 #include "public/platform/modules/indexeddb/WebIDBCursor.h" |
48 #include "public/platform/modules/indexeddb/WebIDBTypes.h" | 50 #include "public/platform/modules/indexeddb/WebIDBTypes.h" |
49 #include <memory> | |
50 | 51 |
51 namespace blink { | 52 namespace blink { |
52 | 53 |
53 class DOMException; | 54 class DOMException; |
54 class ExceptionState; | 55 class ExceptionState; |
55 class IDBCursor; | 56 class IDBCursor; |
56 struct IDBDatabaseMetadata; | 57 struct IDBDatabaseMetadata; |
| 58 class IDBRequestLoader; |
57 class IDBValue; | 59 class IDBValue; |
58 | 60 |
59 class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, | 61 class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, |
60 public ActiveScriptWrappable<IDBRequest>, | 62 public ActiveScriptWrappable<IDBRequest>, |
61 public SuspendableObject { | 63 public SuspendableObject { |
62 DEFINE_WRAPPERTYPEINFO(); | 64 DEFINE_WRAPPERTYPEINFO(); |
63 USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); | 65 USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); |
64 | 66 |
65 public: | 67 public: |
66 static IDBRequest* Create(ScriptState*, IDBAny* source, IDBTransaction*); | 68 static IDBRequest* Create(ScriptState*, IDBAny* source, IDBTransaction*); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 WebIDBCursorDirection cursor_direction_ = kWebIDBCursorDirectionNext; | 182 WebIDBCursorDirection cursor_direction_ = kWebIDBCursorDirectionNext; |
181 // When a cursor is continued/advanced, m_result is cleared and | 183 // When a cursor is continued/advanced, m_result is cleared and |
182 // m_pendingCursor holds it. | 184 // m_pendingCursor holds it. |
183 Member<IDBCursor> pending_cursor_; | 185 Member<IDBCursor> pending_cursor_; |
184 // New state is not applied to the cursor object until the event is | 186 // New state is not applied to the cursor object until the event is |
185 // dispatched. | 187 // dispatched. |
186 Member<IDBKey> cursor_key_; | 188 Member<IDBKey> cursor_key_; |
187 Member<IDBKey> cursor_primary_key_; | 189 Member<IDBKey> cursor_primary_key_; |
188 RefPtr<IDBValue> cursor_value_; | 190 RefPtr<IDBValue> cursor_value_; |
189 | 191 |
| 192 // Used to unwrap Blob-wrapped IDBValues. |
| 193 Member<IDBRequestLoader> loader_; |
| 194 |
190 bool did_fire_upgrade_needed_event_ = false; | 195 bool did_fire_upgrade_needed_event_ = false; |
191 bool prevent_propagation_ = false; | 196 bool prevent_propagation_ = false; |
192 bool result_dirty_ = true; | 197 bool result_dirty_ = true; |
193 | 198 |
194 // Transactions should be aborted after event dispatch if an exception was | 199 // Transactions should be aborted after event dispatch if an exception was |
195 // not caught. This is cleared before dispatch, set by a call to | 200 // not caught. This is cleared before dispatch, set by a call to |
196 // uncaughtExceptionInEventHandler() during dispatch, and checked afterwards | 201 // uncaughtExceptionInEventHandler() during dispatch, and checked afterwards |
197 // to abort if necessary. | 202 // to abort if necessary. |
198 bool did_throw_in_event_handler_ = false; | 203 bool did_throw_in_event_handler_ = false; |
199 | 204 |
200 // Pointer back to the WebIDBCallbacks that holds a persistent reference to | 205 // Pointer back to the WebIDBCallbacks that holds a persistent reference to |
201 // this object. | 206 // this object. |
202 WebIDBCallbacks* web_callbacks_ = nullptr; | 207 WebIDBCallbacks* web_callbacks_ = nullptr; |
203 }; | 208 }; |
204 | 209 |
205 } // namespace blink | 210 } // namespace blink |
206 | 211 |
207 #endif // IDBRequest_h | 212 #endif // IDBRequest_h |
OLD | NEW |