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

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

Issue 18590006: Blob support for IDB [Blink] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: small cleanup Created 7 years 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/WebIDBCallbacksImpl.cpp
diff --git a/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp b/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
index 9fa9f2fd6abc13996a4a2f8a68c0ae161cd1f8b3..00b4e71d4b72d91bf1bd7b2f9510c2a104b40c1d 100644
--- a/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
+++ b/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
@@ -33,12 +33,14 @@
#include "modules/indexeddb/IDBMetadata.h"
#include "modules/indexeddb/IDBRequest.h"
#include "platform/SharedBuffer.h"
+#include "platform/blob/BlobInfo.h"
#include "public/platform/WebData.h"
#include "public/platform/WebIDBCursor.h"
#include "public/platform/WebIDBDatabase.h"
#include "public/platform/WebIDBDatabaseError.h"
#include "public/platform/WebIDBKey.h"
+using blink::WebBlobInfo;
using blink::WebData;
using blink::WebIDBCursor;
using blink::WebIDBDatabase;
@@ -47,6 +49,7 @@ using blink::WebIDBIndex;
using blink::WebIDBKey;
using blink::WebIDBKeyPath;
using blink::WebIDBMetadata;
+using blink::WebVector;
namespace WebCore {
@@ -64,13 +67,20 @@ WebIDBCallbacksImpl::WebIDBCallbacksImpl(PassRefPtr<IDBRequest> request)
WebIDBCallbacksImpl::~WebIDBCallbacksImpl()
{
}
+static PassOwnPtr<Vector<BlobInfo> > ConvertBlobInfo(const WebVector<WebBlobInfo>& webBlobInfo)
+{
+ OwnPtr<Vector<BlobInfo> > blobInfo = adoptPtr(new Vector<BlobInfo>(webBlobInfo.size()));
+ for (size_t i = 0; i < webBlobInfo.size(); ++i)
+ (*blobInfo)[i] = webBlobInfo[i];
+ return blobInfo.release();
+}
void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error)
{
m_request->onError(error);
}
-void WebIDBCallbacksImpl::onSuccess(const blink::WebVector<blink::WebString>& webStringList)
+void WebIDBCallbacksImpl::onSuccess(const WebVector<blink::WebString>& webStringList)
{
Vector<String> stringList;
for (size_t i = 0; i < webStringList.size(); ++i)
@@ -78,9 +88,9 @@ void WebIDBCallbacksImpl::onSuccess(const blink::WebVector<blink::WebString>& we
m_request->onSuccess(stringList);
}
-void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value)
+void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value, const WebVector<WebBlobInfo>& webBlobInfo)
{
- m_request->onSuccess(adoptPtr(cursor), key, primaryKey, value);
+ m_request->onSuccess(adoptPtr(cursor), key, primaryKey, value, ConvertBlobInfo(webBlobInfo));
}
void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend, const WebIDBMetadata& metadata)
@@ -93,14 +103,14 @@ void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key)
m_request->onSuccess(key);
}
-void WebIDBCallbacksImpl::onSuccess(const WebData& value)
+void WebIDBCallbacksImpl::onSuccess(const WebData& value, const WebVector<WebBlobInfo>& webBlobInfo)
{
- m_request->onSuccess(value);
+ m_request->onSuccess(value, ConvertBlobInfo(webBlobInfo));
}
-void WebIDBCallbacksImpl::onSuccess(const WebData& value, const WebIDBKey& key, const WebIDBKeyPath& keyPath)
+void WebIDBCallbacksImpl::onSuccess(const WebData& value, const WebVector<WebBlobInfo>& webBlobInfo, const WebIDBKey& key, const WebIDBKeyPath& keyPath)
{
- m_request->onSuccess(value, key, keyPath);
+ m_request->onSuccess(value, ConvertBlobInfo(webBlobInfo), key, keyPath);
}
void WebIDBCallbacksImpl::onSuccess(long long value)
@@ -113,9 +123,9 @@ void WebIDBCallbacksImpl::onSuccess()
m_request->onSuccess();
}
-void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value)
+void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value, const WebVector<WebBlobInfo>& webBlobInfo)
{
- m_request->onSuccess(key, primaryKey, value);
+ m_request->onSuccess(key, primaryKey, value, ConvertBlobInfo(webBlobInfo));
}
void WebIDBCallbacksImpl::onBlocked(long long oldVersion)

Powered by Google App Engine
This is Rietveld 408576698