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 7a52cdae05087f05406296abce6fbc3a34a07261..bc5c2dfdf8692886311e36ecee21217a41e7e17c 100644 |
--- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h |
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h |
@@ -40,6 +40,7 @@ |
#include "modules/ModulesExport.h" |
#include "modules/indexeddb/IDBAny.h" |
#include "modules/indexeddb/IDBTransaction.h" |
+#include "modules/indexeddb/IDBValueWrapper.h" |
#include "modules/indexeddb/IndexedDB.h" |
#include "platform/bindings/ActiveScriptWrappable.h" |
#include "platform/bindings/ScriptState.h" |
@@ -98,13 +99,23 @@ class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, |
void SetPendingCursor(IDBCursor*); |
void Abort(); |
+ void QueueResult(DOMException*); |
+ void QueueResult(IDBKey*); |
+ void QueueResult(std::unique_ptr<WebIDBCursor>, |
+ IDBKey*, |
+ IDBKey* primary_key, |
+ PassRefPtr<IDBValue>); |
+ void QueueResult(PassRefPtr<IDBValue>); |
+ void QueueResult(const Vector<RefPtr<IDBValue>>&); |
+ void QueueResult(IDBKey*, IDBKey* primary_key, PassRefPtr<IDBValue>); |
+ |
virtual void OnError(DOMException*); |
+ virtual void OnSuccess(IDBKey*); |
virtual void OnSuccess(const Vector<String>&); |
jsbell
2017/05/08 22:08:01
As you probably noticed, this overload is for webk
pwnall
2017/05/11 23:54:25
Yes, but thank you for checking! This is a non-tri
|
virtual void OnSuccess(std::unique_ptr<WebIDBCursor>, |
IDBKey*, |
IDBKey* primary_key, |
PassRefPtr<IDBValue>); |
- virtual void OnSuccess(IDBKey*); |
virtual void OnSuccess(PassRefPtr<IDBValue>); |
virtual void OnSuccess(const Vector<RefPtr<IDBValue>>&); |
virtual void OnSuccess(int64_t); |
@@ -125,6 +136,10 @@ class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, |
NOTREACHED(); |
} |
+ inline void ExtractOutgoingBlobHandlesFrom(IDBValueWrapper* value_wrapper) { |
+ value_wrapper->ExtractBlobDataHandles(&outgoing_blob_handles_); |
+ } |
+ |
// ScriptWrappable |
bool HasPendingActivity() const final; |
@@ -143,11 +158,6 @@ 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*); |
@@ -159,7 +169,10 @@ class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, |
// EventTarget |
DispatchEventResult DispatchEventInternal(Event*) override; |
+ // Can be nullptr for requests that are not associated with a transaction, |
+ // i.e. delete requests and unsuccessful open requests. |
Member<IDBTransaction> transaction_; |
+ |
ReadyState ready_state_ = PENDING; |
bool request_aborted_ = false; // May be aborted by transaction then receive |
// async onsuccess; ignore vs. assert. |
@@ -175,8 +188,6 @@ 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_; |
@@ -196,7 +207,8 @@ class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, |
Member<IDBKey> cursor_primary_key_; |
RefPtr<IDBValue> cursor_value_; |
- HashMap<String, RefPtr<BlobDataHandle>> transit_blob_handles_; |
+ // Keeps blobs alive while they are sent to the browser process. |
+ Vector<RefPtr<BlobDataHandle>> outgoing_blob_handles_; |
bool did_fire_upgrade_needed_event_ = false; |
bool prevent_propagation_ = false; |