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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 PENDING = 1, | 80 PENDING = 1, |
81 DONE = 2, | 81 DONE = 2, |
82 EarlyDeath = 3 | 82 EarlyDeath = 3 |
83 }; | 83 }; |
84 | 84 |
85 const String& readyState() const; | 85 const String& readyState() const; |
86 | 86 |
87 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); | 87 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); |
88 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 88 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
89 | 89 |
90 void setCursorDetails(IndexedDB::CursorType, blink::WebIDBCursorDirection); | 90 void setCursorDetails(IndexedDB::CursorType, WebIDBCursorDirection); |
91 void setPendingCursor(IDBCursor*); | 91 void setPendingCursor(IDBCursor*); |
92 void abort(); | 92 void abort(); |
93 | 93 |
94 virtual void onError(PassRefPtrWillBeRawPtr<DOMError>); | 94 virtual void onError(PassRefPtrWillBeRawPtr<DOMError>); |
95 virtual void onSuccess(const Vector<String>&); | 95 virtual void onSuccess(const Vector<String>&); |
96 virtual void onSuccess(PassOwnPtr<blink::WebIDBCursor>, IDBKey*, IDBKey* pri
maryKey, PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::WebBlobInfo> >); | 96 virtual void onSuccess(PassOwnPtr<WebIDBCursor>, IDBKey*, IDBKey* primaryKey
, PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<WebBlobInfo> >); |
97 virtual void onSuccess(IDBKey*); | 97 virtual void onSuccess(IDBKey*); |
98 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::We
bBlobInfo> >); | 98 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<WebBlobIn
fo> >); |
99 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::We
bBlobInfo> >, IDBKey*, const IDBKeyPath&); | 99 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<WebBlobIn
fo> >, IDBKey*, const IDBKeyPath&); |
100 virtual void onSuccess(int64_t); | 100 virtual void onSuccess(int64_t); |
101 virtual void onSuccess(); | 101 virtual void onSuccess(); |
102 virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer>
, PassOwnPtr<Vector<blink::WebBlobInfo> >); | 102 virtual void onSuccess(IDBKey*, IDBKey* primaryKey, PassRefPtr<SharedBuffer>
, PassOwnPtr<Vector<WebBlobInfo> >); |
103 | 103 |
104 // Only IDBOpenDBRequest instances should receive these: | 104 // Only IDBOpenDBRequest instances should receive these: |
105 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } | 105 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } |
106 virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<blink::WebIDBDat
abase>, const IDBDatabaseMetadata&, blink::WebIDBDataLoss, String dataLossMessag
e) { ASSERT_NOT_REACHED(); } | 106 virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBDatabase>,
const IDBDatabaseMetadata&, WebIDBDataLoss, String dataLossMessage) { ASSERT_NO
T_REACHED(); } |
107 virtual void onSuccess(PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseM
etadata&) { ASSERT_NOT_REACHED(); } | 107 virtual void onSuccess(PassOwnPtr<WebIDBDatabase>, const IDBDatabaseMetadata
&) { ASSERT_NOT_REACHED(); } |
108 | 108 |
109 // ActiveDOMObject | 109 // ActiveDOMObject |
110 virtual bool hasPendingActivity() const OVERRIDE FINAL; | 110 virtual bool hasPendingActivity() const OVERRIDE FINAL; |
111 virtual void stop() OVERRIDE FINAL; | 111 virtual void stop() OVERRIDE FINAL; |
112 | 112 |
113 // EventTarget | 113 // EventTarget |
114 virtual const AtomicString& interfaceName() const OVERRIDE; | 114 virtual const AtomicString& interfaceName() const OVERRIDE; |
115 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; | 115 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; |
116 virtual void uncaughtExceptionInEventHandler() OVERRIDE FINAL; | 116 virtual void uncaughtExceptionInEventHandler() OVERRIDE FINAL; |
117 | 117 |
(...skipping 14 matching lines...) Expand all Loading... |
132 virtual bool shouldEnqueueEvent() const; | 132 virtual bool shouldEnqueueEvent() const; |
133 void onSuccessInternal(IDBAny*); | 133 void onSuccessInternal(IDBAny*); |
134 void setResult(IDBAny*); | 134 void setResult(IDBAny*); |
135 | 135 |
136 bool m_contextStopped; | 136 bool m_contextStopped; |
137 Member<IDBTransaction> m_transaction; | 137 Member<IDBTransaction> m_transaction; |
138 ReadyState m_readyState; | 138 ReadyState m_readyState; |
139 bool m_requestAborted; // May be aborted by transaction then receive async o
nsuccess; ignore vs. assert. | 139 bool m_requestAborted; // May be aborted by transaction then receive async o
nsuccess; ignore vs. assert. |
140 | 140 |
141 private: | 141 private: |
142 void setResultCursor(IDBCursor*, IDBKey*, IDBKey* primaryKey, PassRefPtr<Sha
redBuffer> value, PassOwnPtr<Vector<blink::WebBlobInfo> >); | 142 void setResultCursor(IDBCursor*, IDBKey*, IDBKey* primaryKey, PassRefPtr<Sha
redBuffer> value, PassOwnPtr<Vector<WebBlobInfo> >); |
143 void handleBlobAcks(); | 143 void handleBlobAcks(); |
144 | 144 |
145 RefPtr<ScriptState> m_scriptState; | 145 RefPtr<ScriptState> m_scriptState; |
146 Member<IDBAny> m_source; | 146 Member<IDBAny> m_source; |
147 Member<IDBAny> m_result; | 147 Member<IDBAny> m_result; |
148 RefPtrWillBeMember<DOMError> m_error; | 148 RefPtrWillBeMember<DOMError> m_error; |
149 | 149 |
150 bool m_hasPendingActivity; | 150 bool m_hasPendingActivity; |
151 WillBeHeapVector<RefPtrWillBeMember<Event> > m_enqueuedEvents; | 151 WillBeHeapVector<RefPtrWillBeMember<Event> > m_enqueuedEvents; |
152 | 152 |
153 // Only used if the result type will be a cursor. | 153 // Only used if the result type will be a cursor. |
154 IndexedDB::CursorType m_cursorType; | 154 IndexedDB::CursorType m_cursorType; |
155 blink::WebIDBCursorDirection m_cursorDirection; | 155 WebIDBCursorDirection m_cursorDirection; |
156 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur
sor holds it. | 156 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur
sor holds it. |
157 Member<IDBCursor> m_pendingCursor; | 157 Member<IDBCursor> m_pendingCursor; |
158 // New state is not applied to the cursor object until the event is dispatch
ed. | 158 // New state is not applied to the cursor object until the event is dispatch
ed. |
159 Member<IDBKey> m_cursorKey; | 159 Member<IDBKey> m_cursorKey; |
160 Member<IDBKey> m_cursorPrimaryKey; | 160 Member<IDBKey> m_cursorPrimaryKey; |
161 RefPtr<SharedBuffer> m_cursorValue; | 161 RefPtr<SharedBuffer> m_cursorValue; |
162 OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo; | 162 OwnPtr<Vector<WebBlobInfo> > m_blobInfo; |
163 | 163 |
164 bool m_didFireUpgradeNeededEvent; | 164 bool m_didFireUpgradeNeededEvent; |
165 bool m_preventPropagation; | 165 bool m_preventPropagation; |
166 bool m_resultDirty; | 166 bool m_resultDirty; |
167 }; | 167 }; |
168 | 168 |
169 } // namespace blink | 169 } // namespace blink |
170 | 170 |
171 #endif // IDBRequest_h | 171 #endif // IDBRequest_h |
OLD | NEW |