| 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 14 matching lines...) Expand all Loading... |
| 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 "bindings/core/v8/ActiveScriptWrappable.h" | 32 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 33 #include "bindings/core/v8/ScriptState.h" | 33 #include "bindings/core/v8/ScriptState.h" |
| 34 #include "bindings/core/v8/ScriptValue.h" | 34 #include "bindings/core/v8/ScriptValue.h" |
| 35 #include "core/dom/ActiveDOMObject.h" | |
| 36 #include "core/dom/DOMStringList.h" | 35 #include "core/dom/DOMStringList.h" |
| 36 #include "core/dom/SuspendableObject.h" |
| 37 #include "core/events/EventListener.h" | 37 #include "core/events/EventListener.h" |
| 38 #include "core/events/EventTarget.h" | 38 #include "core/events/EventTarget.h" |
| 39 #include "modules/EventModules.h" | 39 #include "modules/EventModules.h" |
| 40 #include "modules/ModulesExport.h" | 40 #include "modules/ModulesExport.h" |
| 41 #include "modules/indexeddb/IDBAny.h" | 41 #include "modules/indexeddb/IDBAny.h" |
| 42 #include "modules/indexeddb/IDBTransaction.h" | 42 #include "modules/indexeddb/IDBTransaction.h" |
| 43 #include "modules/indexeddb/IndexedDB.h" | 43 #include "modules/indexeddb/IndexedDB.h" |
| 44 #include "platform/blob/BlobData.h" | 44 #include "platform/blob/BlobData.h" |
| 45 #include "platform/heap/Handle.h" | 45 #include "platform/heap/Handle.h" |
| 46 #include "public/platform/WebBlobInfo.h" | 46 #include "public/platform/WebBlobInfo.h" |
| 47 #include "public/platform/modules/indexeddb/WebIDBCursor.h" | 47 #include "public/platform/modules/indexeddb/WebIDBCursor.h" |
| 48 #include "public/platform/modules/indexeddb/WebIDBTypes.h" | 48 #include "public/platform/modules/indexeddb/WebIDBTypes.h" |
| 49 #include <memory> | 49 #include <memory> |
| 50 | 50 |
| 51 namespace blink { | 51 namespace blink { |
| 52 | 52 |
| 53 class DOMException; | 53 class DOMException; |
| 54 class ExceptionState; | 54 class ExceptionState; |
| 55 class IDBCursor; | 55 class IDBCursor; |
| 56 struct IDBDatabaseMetadata; | 56 struct IDBDatabaseMetadata; |
| 57 class IDBValue; | 57 class IDBValue; |
| 58 | 58 |
| 59 class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, | 59 class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, |
| 60 public ActiveScriptWrappable, | 60 public ActiveScriptWrappable, |
| 61 public ActiveDOMObject { | 61 public SuspendableObject { |
| 62 DEFINE_WRAPPERTYPEINFO(); | 62 DEFINE_WRAPPERTYPEINFO(); |
| 63 USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); | 63 USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); |
| 64 | 64 |
| 65 public: | 65 public: |
| 66 static IDBRequest* create(ScriptState*, IDBAny* source, IDBTransaction*); | 66 static IDBRequest* create(ScriptState*, IDBAny* source, IDBTransaction*); |
| 67 ~IDBRequest() override; | 67 ~IDBRequest() override; |
| 68 DECLARE_VIRTUAL_TRACE(); | 68 DECLARE_VIRTUAL_TRACE(); |
| 69 | 69 |
| 70 ScriptValue result(ScriptState*, ExceptionState&); | 70 ScriptValue result(ScriptState*, ExceptionState&); |
| 71 DOMException* error(ExceptionState&) const; | 71 DOMException* error(ExceptionState&) const; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 ASSERT_NOT_REACHED(); | 118 ASSERT_NOT_REACHED(); |
| 119 } | 119 } |
| 120 virtual void onSuccess(std::unique_ptr<WebIDBDatabase>, | 120 virtual void onSuccess(std::unique_ptr<WebIDBDatabase>, |
| 121 const IDBDatabaseMetadata&) { | 121 const IDBDatabaseMetadata&) { |
| 122 ASSERT_NOT_REACHED(); | 122 ASSERT_NOT_REACHED(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // ScriptWrappable | 125 // ScriptWrappable |
| 126 bool hasPendingActivity() const final; | 126 bool hasPendingActivity() const final; |
| 127 | 127 |
| 128 // ActiveDOMObject | 128 // SuspendableObject |
| 129 void contextDestroyed() override; | 129 void contextDestroyed() override; |
| 130 | 130 |
| 131 // EventTarget | 131 // EventTarget |
| 132 const AtomicString& interfaceName() const override; | 132 const AtomicString& interfaceName() const override; |
| 133 ExecutionContext* getExecutionContext() const final; | 133 ExecutionContext* getExecutionContext() const final; |
| 134 void uncaughtExceptionInEventHandler() final; | 134 void uncaughtExceptionInEventHandler() final; |
| 135 | 135 |
| 136 // Called by a version change transaction that has finished to set this | 136 // Called by a version change transaction that has finished to set this |
| 137 // request back from DONE (following "upgradeneeded") back to PENDING (for | 137 // request back from DONE (following "upgradeneeded") back to PENDING (for |
| 138 // the upcoming "success" or "error"). | 138 // the upcoming "success" or "error"). |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 bool m_resultDirty = true; | 188 bool m_resultDirty = true; |
| 189 | 189 |
| 190 // Pointer back to the WebIDBCallbacks that holds a persistent reference to | 190 // Pointer back to the WebIDBCallbacks that holds a persistent reference to |
| 191 // this object. | 191 // this object. |
| 192 WebIDBCallbacks* m_webCallbacks = nullptr; | 192 WebIDBCallbacks* m_webCallbacks = nullptr; |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 } // namespace blink | 195 } // namespace blink |
| 196 | 196 |
| 197 #endif // IDBRequest_h | 197 #endif // IDBRequest_h |
| OLD | NEW |