Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: Source/modules/indexeddb/IDBRequest.h

Issue 235933013: Add the backchannel for Blobs to be received into Blink from the database backend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rolled in feedback Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 "heap/Handle.h" 41 #include "heap/Handle.h"
42 #include "modules/indexeddb/IDBAny.h" 42 #include "modules/indexeddb/IDBAny.h"
43 #include "modules/indexeddb/IDBTransaction.h" 43 #include "modules/indexeddb/IDBTransaction.h"
44 #include "modules/indexeddb/IndexedDB.h" 44 #include "modules/indexeddb/IndexedDB.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 // Base class to simplify usage of event target refcounting. 55 // Base class to simplify usage of event target refcounting.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 91
91 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(success);
92 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); 93 DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
93 94
94 void setCursorDetails(IndexedDB::CursorType, blink::WebIDBCursor::Direction) ; 95 void setCursorDetails(IndexedDB::CursorType, blink::WebIDBCursor::Direction) ;
95 void setPendingCursor(PassRefPtr<IDBCursor>); 96 void setPendingCursor(PassRefPtr<IDBCursor>);
96 void abort(); 97 void abort();
97 98
98 virtual void onError(PassRefPtrWillBeRawPtr<DOMError>); 99 virtual void onError(PassRefPtrWillBeRawPtr<DOMError>);
99 virtual void onSuccess(const Vector<String>&); 100 virtual void onSuccess(const Vector<String>&);
100 virtual void onSuccess(PassOwnPtr<blink::WebIDBCursor>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer>); 101 virtual void onSuccess(PassOwnPtr<blink::WebIDBCursor>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink ::WebBlobInfo> >);
101 virtual void onSuccess(PassRefPtr<IDBKey>); 102 virtual void onSuccess(PassRefPtr<IDBKey>);
102 virtual void onSuccess(PassRefPtr<SharedBuffer>); 103 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::We bBlobInfo> >);
103 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassRefPtr<IDBKey>, const I DBKeyPath&); 104 virtual void onSuccess(PassRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::We bBlobInfo> >, PassRefPtr<IDBKey>, const IDBKeyPath&);
104 virtual void onSuccess(int64_t); 105 virtual void onSuccess(int64_t);
105 virtual void onSuccess(); 106 virtual void onSuccess();
106 virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Pa ssRefPtr<SharedBuffer>); 107 virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Pa ssRefPtr<SharedBuffer>, PassOwnPtr<Vector<blink::WebBlobInfo> >);
107 108
108 // Only IDBOpenDBRequest instances should receive these: 109 // Only IDBOpenDBRequest instances should receive these:
109 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); } 110 virtual void onBlocked(int64_t oldVersion) { ASSERT_NOT_REACHED(); }
110 virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<blink::WebIDBDat abase>, const IDBDatabaseMetadata&, blink::WebIDBDataLoss, String dataLossMessag e) { ASSERT_NOT_REACHED(); } 111 virtual void onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<blink::WebIDBDat abase>, const IDBDatabaseMetadata&, blink::WebIDBDataLoss, String dataLossMessag e) { ASSERT_NOT_REACHED(); }
111 virtual void onSuccess(PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseM etadata&) { ASSERT_NOT_REACHED(); } 112 virtual void onSuccess(PassOwnPtr<blink::WebIDBDatabase>, const IDBDatabaseM etadata&) { ASSERT_NOT_REACHED(); }
112 113
113 // ActiveDOMObject 114 // ActiveDOMObject
114 virtual bool hasPendingActivity() const OVERRIDE FINAL; 115 virtual bool hasPendingActivity() const OVERRIDE FINAL;
115 virtual void stop() OVERRIDE FINAL; 116 virtual void stop() OVERRIDE FINAL;
116 117
(...skipping 27 matching lines...) Expand all
144 virtual bool shouldEnqueueEvent() const; 145 virtual bool shouldEnqueueEvent() const;
145 void onSuccessInternal(PassRefPtr<IDBAny>); 146 void onSuccessInternal(PassRefPtr<IDBAny>);
146 void setResult(PassRefPtr<IDBAny>); 147 void setResult(PassRefPtr<IDBAny>);
147 148
148 bool m_contextStopped; 149 bool m_contextStopped;
149 RefPtr<IDBTransaction> m_transaction; 150 RefPtr<IDBTransaction> m_transaction;
150 ReadyState m_readyState; 151 ReadyState m_readyState;
151 bool m_requestAborted; // May be aborted by transaction then receive async o nsuccess; ignore vs. assert. 152 bool m_requestAborted; // May be aborted by transaction then receive async o nsuccess; ignore vs. assert.
152 153
153 private: 154 private:
154 void setResultCursor(PassRefPtr<IDBCursor>, PassRefPtr<IDBKey>, PassRefPtr<I DBKey> primaryKey, PassRefPtr<SharedBuffer> value); 155 void setResultCursor(PassRefPtr<IDBCursor>, PassRefPtr<IDBKey>, PassRefPtr<I DBKey> primaryKey, PassRefPtr<SharedBuffer> value, PassOwnPtr<Vector<blink::WebB lobInfo> >);
155 void checkForReferenceCycle(); 156 void checkForReferenceCycle();
157 void handleBlobAcks();
156 158
157 RefPtr<NewScriptState> m_scriptState; 159 RefPtr<NewScriptState> m_scriptState;
158 RefPtr<IDBAny> m_source; 160 RefPtr<IDBAny> m_source;
159 RefPtr<IDBAny> m_result; 161 RefPtr<IDBAny> m_result;
160 RefPtrWillBePersistent<DOMError> m_error; 162 RefPtrWillBePersistent<DOMError> m_error;
161 163
162 bool m_hasPendingActivity; 164 bool m_hasPendingActivity;
163 WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_enqueuedEvents; 165 WillBePersistentHeapVector<RefPtrWillBeMember<Event> > m_enqueuedEvents;
164 166
165 // Only used if the result type will be a cursor. 167 // Only used if the result type will be a cursor.
166 IndexedDB::CursorType m_cursorType; 168 IndexedDB::CursorType m_cursorType;
167 blink::WebIDBCursor::Direction m_cursorDirection; 169 blink::WebIDBCursor::Direction m_cursorDirection;
168 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur sor holds it. 170 // When a cursor is continued/advanced, m_result is cleared and m_pendingCur sor holds it.
169 RefPtr<IDBCursor> m_pendingCursor; 171 RefPtr<IDBCursor> m_pendingCursor;
170 // New state is not applied to the cursor object until the event is dispatch ed. 172 // New state is not applied to the cursor object until the event is dispatch ed.
171 RefPtr<IDBKey> m_cursorKey; 173 RefPtr<IDBKey> m_cursorKey;
172 RefPtr<IDBKey> m_cursorPrimaryKey; 174 RefPtr<IDBKey> m_cursorPrimaryKey;
173 RefPtr<SharedBuffer> m_cursorValue; 175 RefPtr<SharedBuffer> m_cursorValue;
176 OwnPtr<Vector<blink::WebBlobInfo> > m_blobInfo;
174 177
175 bool m_didFireUpgradeNeededEvent; 178 bool m_didFireUpgradeNeededEvent;
176 bool m_preventPropagation; 179 bool m_preventPropagation;
177 bool m_resultDirty; 180 bool m_resultDirty;
178 }; 181 };
179 182
180 } // namespace WebCore 183 } // namespace WebCore
181 184
182 #endif // IDBRequest_h 185 #endif // IDBRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698