OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 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 IDBOpenDBRequest_h | 26 #ifndef IDBOpenDBRequest_h |
27 #define IDBOpenDBRequest_h | 27 #define IDBOpenDBRequest_h |
28 | 28 |
29 #include "modules/ModulesExport.h" | 29 #include "modules/ModulesExport.h" |
30 #include "modules/indexeddb/IDBRequest.h" | 30 #include "modules/indexeddb/IDBRequest.h" |
31 #include "public/platform/modules/indexeddb/WebIDBDatabase.h" | 31 #include "public/platform/modules/indexeddb/WebIDBDatabase.h" |
32 #include <memory> | |
33 | 32 |
34 namespace blink { | 33 namespace blink { |
35 | 34 |
36 class IDBDatabaseCallbacks; | 35 class IDBDatabaseCallbacks; |
37 | 36 |
38 class MODULES_EXPORT IDBOpenDBRequest final : public IDBRequest { | 37 class MODULES_EXPORT IDBOpenDBRequest final : public IDBRequest { |
39 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
40 public: | 39 public: |
41 static IDBOpenDBRequest* create(ScriptState*, IDBDatabaseCallbacks*, int64_t
transactionId, int64_t version); | 40 static IDBOpenDBRequest* create(ScriptState*, IDBDatabaseCallbacks*, int64_t
transactionId, int64_t version); |
42 ~IDBOpenDBRequest() override; | 41 ~IDBOpenDBRequest() override; |
43 DECLARE_VIRTUAL_TRACE(); | 42 DECLARE_VIRTUAL_TRACE(); |
44 | 43 |
45 using IDBRequest::onSuccess; | 44 using IDBRequest::onSuccess; |
46 | 45 |
47 void onBlocked(int64_t existingVersion) override; | 46 void onBlocked(int64_t existingVersion) override; |
48 void onUpgradeNeeded(int64_t oldVersion, std::unique_ptr<WebIDBDatabase>, co
nst IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) override; | 47 void onUpgradeNeeded(int64_t oldVersion, std::unique_ptr<IDBDatabaseProxy>,
const IDBDatabaseMetadata&, indexed_db::mojom::blink::DataLoss, String dataLossM
essage) override; |
49 void onSuccess(std::unique_ptr<WebIDBDatabase>, const IDBDatabaseMetadata&)
override; | 48 void onSuccess(std::unique_ptr<IDBDatabaseProxy>, const IDBDatabaseMetadata&
) override; |
50 void onSuccess(int64_t oldVersion) override; | 49 void onSuccess(int64_t oldVersion) override; |
51 | 50 |
52 // EventTarget | 51 // EventTarget |
53 const AtomicString& interfaceName() const override; | 52 const AtomicString& interfaceName() const override; |
54 | 53 |
55 DEFINE_ATTRIBUTE_EVENT_LISTENER(blocked); | 54 DEFINE_ATTRIBUTE_EVENT_LISTENER(blocked); |
56 DEFINE_ATTRIBUTE_EVENT_LISTENER(upgradeneeded); | 55 DEFINE_ATTRIBUTE_EVENT_LISTENER(upgradeneeded); |
57 | 56 |
58 protected: | 57 protected: |
59 bool shouldEnqueueEvent() const override; | 58 bool shouldEnqueueEvent() const override; |
60 | 59 |
61 // EventTarget | 60 // EventTarget |
62 DispatchEventResult dispatchEventInternal(Event*) override; | 61 DispatchEventResult dispatchEventInternal(Event*) override; |
63 | 62 |
64 private: | 63 private: |
65 IDBOpenDBRequest(ScriptState*, IDBDatabaseCallbacks*, int64_t transactionId,
int64_t version); | 64 IDBOpenDBRequest(ScriptState*, IDBDatabaseCallbacks*, int64_t transactionId,
int64_t version); |
66 | 65 |
67 Member<IDBDatabaseCallbacks> m_databaseCallbacks; | 66 Member<IDBDatabaseCallbacks> m_databaseCallbacks; |
68 const int64_t m_transactionId; | 67 const int64_t m_transactionId; |
69 int64_t m_version; | 68 int64_t m_version; |
70 }; | 69 }; |
71 | 70 |
72 } // namespace blink | 71 } // namespace blink |
73 | 72 |
74 #endif // IDBOpenDBRequest_h | 73 #endif // IDBOpenDBRequest_h |
OLD | NEW |