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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 // Defined in the IDL | 83 // Defined in the IDL |
84 enum ReadyState { | 84 enum ReadyState { |
85 PENDING = 1, | 85 PENDING = 1, |
86 DONE = 2, | 86 DONE = 2, |
87 EarlyDeath = 3 | 87 EarlyDeath = 3 |
88 }; | 88 }; |
89 | 89 |
90 const String& readyState() const; | 90 const String& readyState() const; |
91 | 91 |
| 92 // Returns a new WebIDBCallbacks for this request. Must only be called once. |
| 93 std::unique_ptr<WebIDBCallbacks> createWebCallbacks(); |
| 94 void webCallbacksDestroyed(); |
| 95 |
92 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); | 96 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); |
93 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
94 | 98 |
95 void setCursorDetails(IndexedDB::CursorType, WebIDBCursorDirection); | 99 void setCursorDetails(IndexedDB::CursorType, WebIDBCursorDirection); |
96 void setPendingCursor(IDBCursor*); | 100 void setPendingCursor(IDBCursor*); |
97 void abort(); | 101 void abort(); |
98 | 102 |
99 virtual void onError(DOMException*); | 103 virtual void onError(DOMException*); |
100 virtual void onSuccess(const Vector<String>&); | 104 virtual void onSuccess(const Vector<String>&); |
101 virtual void onSuccess(std::unique_ptr<WebIDBCursor>, IDBKey*, IDBKey* prima
ryKey, PassRefPtr<IDBValue>); | 105 virtual void onSuccess(std::unique_ptr<WebIDBCursor>, IDBKey*, IDBKey* prima
ryKey, PassRefPtr<IDBValue>); |
102 virtual void onSuccess(IDBKey*); | 106 virtual void onSuccess(IDBKey*); |
103 virtual void onSuccess(PassRefPtr<IDBValue>); | 107 virtual void onSuccess(PassRefPtr<IDBValue>); |
104 virtual void onSuccess(const Vector<RefPtr<IDBValue>>&); | 108 virtual void onSuccess(const Vector<RefPtr<IDBValue>>&); |
105 virtual void onSuccess(int64_t); | 109 virtual void onSuccess(int64_t); |
106 virtual void onSuccess(); | 110 virtual void onSuccess(); |
107 virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<IDBValue>); | 111 virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<IDBValue>); |
108 | 112 |
109 // Only IDBOpenDBRequest instances should receive these: | 113 // Only IDBOpenDBRequest instances should receive these: |
110 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } | 114 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } |
111 virtual void onUpgradeNeeded(int64_t oldVersion, std::unique_ptr<WebIDBDatab
ase>, const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) { ASSE
RT_NOT_REACHED(); } | 115 virtual void onUpgradeNeeded(int64_t oldVersion, std::unique_ptr<WebIDBDatab
ase>, const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) { ASSE
RT_NOT_REACHED(); } |
112 virtual void onSuccess(std::unique_ptr<WebIDBDatabase>, const IDBDatabaseMet
adata&) { ASSERT_NOT_REACHED(); } | 116 virtual void onSuccess(std::unique_ptr<WebIDBDatabase>, const IDBDatabaseMet
adata&) { ASSERT_NOT_REACHED(); } |
113 | 117 |
114 // ScriptWrappable | 118 // ScriptWrappable |
115 bool hasPendingActivity() const final; | 119 bool hasPendingActivity() const final; |
116 | 120 |
117 // ActiveDOMObject | 121 // ActiveDOMObject |
118 void stop() final; | 122 void stop() override; |
119 | 123 |
120 // EventTarget | 124 // EventTarget |
121 const AtomicString& interfaceName() const override; | 125 const AtomicString& interfaceName() const override; |
122 ExecutionContext* getExecutionContext() const final; | 126 ExecutionContext* getExecutionContext() const final; |
123 void uncaughtExceptionInEventHandler() final; | 127 void uncaughtExceptionInEventHandler() final; |
124 | 128 |
125 // Called by a version change transaction that has finished to set this | 129 // Called by a version change transaction that has finished to set this |
126 // request back from DONE (following "upgradeneeded") back to PENDING (for | 130 // request back from DONE (following "upgradeneeded") back to PENDING (for |
127 // the upcoming "success" or "error"). | 131 // the upcoming "success" or "error"). |
128 void transactionDidFinishAndDispatch(); | 132 void transactionDidFinishAndDispatch(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur
sor holds it. | 168 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur
sor holds it. |
165 Member<IDBCursor> m_pendingCursor; | 169 Member<IDBCursor> m_pendingCursor; |
166 // New state is not applied to the cursor object until the event is dispatch
ed. | 170 // New state is not applied to the cursor object until the event is dispatch
ed. |
167 Member<IDBKey> m_cursorKey; | 171 Member<IDBKey> m_cursorKey; |
168 Member<IDBKey> m_cursorPrimaryKey; | 172 Member<IDBKey> m_cursorPrimaryKey; |
169 RefPtr<IDBValue> m_cursorValue; | 173 RefPtr<IDBValue> m_cursorValue; |
170 | 174 |
171 bool m_didFireUpgradeNeededEvent = false; | 175 bool m_didFireUpgradeNeededEvent = false; |
172 bool m_preventPropagation = false; | 176 bool m_preventPropagation = false; |
173 bool m_resultDirty = true; | 177 bool m_resultDirty = true; |
| 178 |
| 179 // Pointer back to the WebIDBCallbacks that holds a persistent reference to |
| 180 // this object. |
| 181 WebIDBCallbacks* m_webCallbacks = nullptr; |
174 }; | 182 }; |
175 | 183 |
176 } // namespace blink | 184 } // namespace blink |
177 | 185 |
178 #endif // IDBRequest_h | 186 #endif // IDBRequest_h |
OLD | NEW |