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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBRequest.h

Issue 2828953002: [IndexedDB] Hold referenced to IDB::put blobs in the IDBRequest (Closed)
Patch Set: Name change, and added dcheck Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBRequest.h
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h
index 4f221aeb5c3a0262c6dbffbff77da747b77406fc..69d4f1395507ba94606cf1ec3456dd0ac75e1aa7 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h
@@ -29,6 +29,8 @@
#ifndef IDBRequest_h
#define IDBRequest_h
+#include <memory>
+
#include "bindings/core/v8/ActiveScriptWrappable.h"
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/ScriptValue.h"
@@ -43,10 +45,10 @@
#include "modules/indexeddb/IndexedDB.h"
#include "platform/blob/BlobData.h"
#include "platform/heap/Handle.h"
+#include "platform/wtf/HashMap.h"
#include "public/platform/WebBlobInfo.h"
#include "public/platform/modules/indexeddb/WebIDBCursor.h"
#include "public/platform/modules/indexeddb/WebIDBTypes.h"
-#include <memory>
namespace blink {
@@ -141,6 +143,11 @@ class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData,
IDBCursor* GetResultCursor() const;
+ void StorePutOperationBlobs(
+ HashMap<String, RefPtr<BlobDataHandle>> blob_handles) {
+ transit_blob_handles_ = std::move(blob_handles);
+ }
+
protected:
IDBRequest(ScriptState*, IDBAny* source, IDBTransaction*);
void EnqueueEvent(Event*);
@@ -168,6 +175,8 @@ class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData,
void AckReceivedBlobs(const IDBValue*);
void AckReceivedBlobs(const Vector<RefPtr<IDBValue>>&);
+ void ClearPutOperationBlobs() { transit_blob_handles_.clear(); }
+
Member<IDBAny> source_;
Member<IDBAny> result_;
Member<DOMException> error_;
@@ -187,6 +196,8 @@ class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData,
Member<IDBKey> cursor_primary_key_;
RefPtr<IDBValue> cursor_value_;
+ HashMap<String, RefPtr<BlobDataHandle>> transit_blob_handles_;
+
bool did_fire_upgrade_needed_event_ = false;
bool prevent_propagation_ = false;
bool result_dirty_ = true;

Powered by Google App Engine
This is Rietveld 408576698