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

Unified Diff: Source/modules/indexeddb/IDBCursor.cpp

Issue 18590006: Blob support for IDB [Blink] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge fixes [builds, untested] Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/indexeddb/IDBCursor.cpp
diff --git a/Source/modules/indexeddb/IDBCursor.cpp b/Source/modules/indexeddb/IDBCursor.cpp
index 68a346ca75a2dabf7ff02da0b1547b62853ca9c7..f15dd8fbbb4340ab6f0891de9b47bb939d480c11 100644
--- a/Source/modules/indexeddb/IDBCursor.cpp
+++ b/Source/modules/indexeddb/IDBCursor.cpp
@@ -310,7 +310,7 @@ ScriptValue IDBCursor::value(ScriptExecutionContext* context)
m_valueDirty = false;
DOMRequestState requestState(context);
- ScriptValue value = deserializeIDBValueBuffer(&requestState, m_value);
+ ScriptValue value = deserializeIDBValueBuffer(&requestState, m_value, &m_blobInfo);
RefPtr<IDBObjectStore> objectStore = effectiveObjectStore();
const IDBObjectStoreMetadata metadata = objectStore->metadata();
if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
@@ -325,7 +325,7 @@ ScriptValue IDBCursor::value(ScriptExecutionContext* context)
return value;
}
-void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value)
+void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value, Vector<BlobInfo>& blobInfo)
{
m_key = key;
m_keyDirty = true;
@@ -335,6 +335,8 @@ void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primary
if (!isKeyCursor()) {
m_value = value;
+ m_blobInfo.clear();
+ m_blobInfo.swap(blobInfo);
jsbell 2013/09/12 22:52:17 I'm waffling on OwnPtr<Vector> vs. swapping here.
ericu 2013/11/20 23:06:08 Switched to OwnPtr.
m_valueDirty = true;
}

Powered by Google App Engine
This is Rietveld 408576698