Index: third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp |
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp |
index a30c43145e6b2ab81ec1e2816e574fc51be8cb5b..2b5ffeb41a226d3d7908d8a357bcafe919738962 100644 |
--- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp |
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp |
@@ -42,6 +42,7 @@ |
#include "modules/indexeddb/IDBEventDispatcher.h" |
#include "modules/indexeddb/IDBTracing.h" |
#include "modules/indexeddb/IDBValue.h" |
+#include "modules/indexeddb/WebIDBCallbacksImpl.h" |
#include "platform/SharedBuffer.h" |
#include "public/platform/WebBlobInfo.h" |
#include <memory> |
@@ -130,6 +131,19 @@ const String& IDBRequest::readyState() const { |
return IndexedDBNames::done; |
} |
+std::unique_ptr<WebIDBCallbacks> IDBRequest::createWebCallbacks() { |
+ DCHECK(!m_webCallbacks); |
+ std::unique_ptr<WebIDBCallbacks> callbacks = |
+ WebIDBCallbacksImpl::create(this); |
+ m_webCallbacks = callbacks.get(); |
+ return callbacks; |
+} |
+ |
+void IDBRequest::webCallbacksDestroyed() { |
+ DCHECK(m_webCallbacks); |
+ m_webCallbacks = nullptr; |
+} |
+ |
void IDBRequest::abort() { |
DCHECK(!m_requestAborted); |
if (m_contextStopped || !getExecutionContext()) |
@@ -395,6 +409,10 @@ void IDBRequest::contextDestroyed() { |
m_result->contextWillBeDestroyed(); |
if (m_pendingCursor) |
m_pendingCursor->contextWillBeDestroyed(); |
+ if (m_webCallbacks) { |
+ m_webCallbacks->detach(); |
+ m_webCallbacks = nullptr; |
+ } |
} |
const AtomicString& IDBRequest::interfaceName() const { |