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 24 matching lines...) Expand all Loading... |
35 #include "core/dom/ActiveDOMObject.h" | 35 #include "core/dom/ActiveDOMObject.h" |
36 #include "core/dom/DOMError.h" | 36 #include "core/dom/DOMError.h" |
37 #include "core/dom/DOMStringList.h" | 37 #include "core/dom/DOMStringList.h" |
38 #include "core/events/Event.h" | 38 #include "core/events/Event.h" |
39 #include "core/events/EventListener.h" | 39 #include "core/events/EventListener.h" |
40 #include "core/events/EventTarget.h" | 40 #include "core/events/EventTarget.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/heap/Handle.h" | 44 #include "platform/heap/Handle.h" |
| 45 #include "public/platform/WebBlobInfo.h" |
45 #include "public/platform/WebIDBCursor.h" | 46 #include "public/platform/WebIDBCursor.h" |
46 | 47 |
47 namespace WebCore { | 48 namespace WebCore { |
48 | 49 |
49 class ExceptionState; | 50 class ExceptionState; |
50 class IDBCursor; | 51 class IDBCursor; |
51 struct IDBDatabaseMetadata; | 52 struct IDBDatabaseMetadata; |
52 class SharedBuffer; | 53 class SharedBuffer; |
53 | 54 |
54 #if ENABLE(OILPAN) | 55 #if ENABLE(OILPAN) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 96 |
96 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); | 97 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); |
97 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 98 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
98 | 99 |
99 void setCursorDetails(IndexedDB::CursorType, blink::WebIDBCursor::Direction)
; | 100 void setCursorDetails(IndexedDB::CursorType, blink::WebIDBCursor::Direction)
; |
100 void setPendingCursor(PassRefPtrWillBeRawPtr<IDBCursor>); | 101 void setPendingCursor(PassRefPtrWillBeRawPtr<IDBCursor>); |
101 void abort(); | 102 void abort(); |
102 | 103 |
103 virtual void onError(PassRefPtrWillBeRawPtr<DOMError>); | 104 virtual void onError(PassRefPtrWillBeRawPtr<DOMError>); |
104 virtual void onSuccess(const Vector<String>&); | 105 virtual void onSuccess(const Vector<String>&); |
105 virtual void onSuccess(PassOwnPtr<blink::WebIDBCursor>, PassRefPtr<IDBKey>,
PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer>); | 106 virtual void onSuccess(PassOwnPtr<blink::WebIDBCursor>, PassRefPtr<IDBKey>,
PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink
::WebBlobInfo> >); |
106 virtual void onSuccess(PassRefPtr<IDBKey>); | 107 virtual void onSuccess(PassRefPtr<IDBKey>); |
107 virtual void onSuccess(PassRefPtr<SharedBuffer>); | 108 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::We
bBlobInfo> >); |
108 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassRefPtr<IDBKey>, const I
DBKeyPath&); | 109 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::We
bBlobInfo> >, PassRefPtr<IDBKey>, const IDBKeyPath&); |
109 virtual void onSuccess(int64_t); | 110 virtual void onSuccess(int64_t); |
110 virtual void onSuccess(); | 111 virtual void onSuccess(); |
111 virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Pa
ssRefPtr<SharedBuffer>); | 112 virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Pa
ssRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::WebBlobInfo> >); |
112 | 113 |
113 // Only IDBOpenDBRequest instances should receive these: | 114 // Only IDBOpenDBRequest instances should receive these: |
114 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } | 115 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } |
115 virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<blink::WebIDBDat
abase>, const IDBDatabaseMetadata&, blink::WebIDBDataLoss, String dataLossMessag
e) { ASSERT_NOT_REACHED(); } | 116 virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<blink::WebIDBDat
abase>, const IDBDatabaseMetadata&, blink::WebIDBDataLoss, String dataLossMessag
e) { ASSERT_NOT_REACHED(); } |
116 virtual void onSuccess(PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseM
etadata&) { ASSERT_NOT_REACHED(); } | 117 virtual void onSuccess(PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseM
etadata&) { ASSERT_NOT_REACHED(); } |
117 | 118 |
118 // ActiveDOMObject | 119 // ActiveDOMObject |
119 virtual bool hasPendingActivity() const OVERRIDE FINAL; | 120 virtual bool hasPendingActivity() const OVERRIDE FINAL; |
120 virtual void stop() OVERRIDE FINAL; | 121 virtual void stop() OVERRIDE FINAL; |
121 | 122 |
(...skipping 29 matching lines...) Expand all Loading... |
151 virtual bool shouldEnqueueEvent() const; | 152 virtual bool shouldEnqueueEvent() const; |
152 void onSuccessInternal(PassRefPtrWillBeRawPtr<IDBAny>); | 153 void onSuccessInternal(PassRefPtrWillBeRawPtr<IDBAny>); |
153 void setResult(PassRefPtrWillBeRawPtr<IDBAny>); | 154 void setResult(PassRefPtrWillBeRawPtr<IDBAny>); |
154 | 155 |
155 bool m_contextStopped; | 156 bool m_contextStopped; |
156 RefPtr<IDBTransaction> m_transaction; | 157 RefPtr<IDBTransaction> m_transaction; |
157 ReadyState m_readyState; | 158 ReadyState m_readyState; |
158 bool m_requestAborted; // May be aborted by transaction then receive async o
nsuccess; ignore vs. assert. | 159 bool m_requestAborted; // May be aborted by transaction then receive async o
nsuccess; ignore vs. assert. |
159 | 160 |
160 private: | 161 private: |
161 void setResultCursor(PassRefPtrWillBeRawPtr<IDBCursor>, PassRefPtr<IDBKey>,
PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value); | 162 void setResultCursor(PassRefPtrWillBeRawPtr<IDBCursor>, PassRefPtr<IDBKey>,
PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector
<blink::WebBlobInfo> >); |
| 163 void handleBlobAcks(); |
162 #if !ENABLE(OILPAN) | 164 #if !ENABLE(OILPAN) |
163 void checkForReferenceCycle(); | 165 void checkForReferenceCycle(); |
164 #endif | 166 #endif |
165 | 167 |
166 RefPtr<NewScriptState> m_scriptState; | 168 RefPtr<NewScriptState> m_scriptState; |
167 RefPtrWillBeMember<IDBAny> m_source; | 169 RefPtrWillBeMember<IDBAny> m_source; |
168 RefPtrWillBeMember<IDBAny> m_result; | 170 RefPtrWillBeMember<IDBAny> m_result; |
169 RefPtrWillBeMember<DOMError> m_error; | 171 RefPtrWillBeMember<DOMError> m_error; |
170 | 172 |
171 bool m_hasPendingActivity; | 173 bool m_hasPendingActivity; |
172 WillBeHeapVector<RefPtrWillBeMember<Event> > m_enqueuedEvents; | 174 WillBeHeapVector<RefPtrWillBeMember<Event> > m_enqueuedEvents; |
173 | 175 |
174 // Only used if the result type will be a cursor. | 176 // Only used if the result type will be a cursor. |
175 IndexedDB::CursorType m_cursorType; | 177 IndexedDB::CursorType m_cursorType; |
176 blink::WebIDBCursor::Direction m_cursorDirection; | 178 blink::WebIDBCursor::Direction m_cursorDirection; |
177 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur
sor holds it. | 179 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur
sor holds it. |
178 RefPtrWillBeMember<IDBCursor> m_pendingCursor; | 180 RefPtrWillBeMember<IDBCursor> m_pendingCursor; |
179 // New state is not applied to the cursor object until the event is dispatch
ed. | 181 // New state is not applied to the cursor object until the event is dispatch
ed. |
180 RefPtr<IDBKey> m_cursorKey; | 182 RefPtr<IDBKey> m_cursorKey; |
181 RefPtr<IDBKey> m_cursorPrimaryKey; | 183 RefPtr<IDBKey> m_cursorPrimaryKey; |
182 RefPtr<SharedBuffer> m_cursorValue; | 184 RefPtr<SharedBuffer> m_cursorValue; |
| 185 OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo; |
183 | 186 |
184 bool m_didFireUpgradeNeededEvent; | 187 bool m_didFireUpgradeNeededEvent; |
185 bool m_preventPropagation; | 188 bool m_preventPropagation; |
186 bool m_resultDirty; | 189 bool m_resultDirty; |
187 }; | 190 }; |
188 | 191 |
189 } // namespace WebCore | 192 } // namespace WebCore |
190 | 193 |
191 #endif // IDBRequest_h | 194 #endif // IDBRequest_h |
OLD | NEW |