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

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

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Require explicit wrapping when discarding map keys. Created 4 years, 2 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.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
index 98a496d4aa758f8f43343b3513516115990c90ab..ea832a61bd7829d8d877ca5ea69611d0da677ad5 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>
@@ -132,6 +133,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;
haraken 2016/10/18 19:01:29 Don't we need to call m_webCallbacks->detach()? J
Reilly Grant (use Gerrit) 2016/10/19 00:36:51 m_webCallbacks->detach() just clears the callback
+}
+
void IDBRequest::abort() {
DCHECK(!m_requestAborted);
if (m_contextStopped || !getExecutionContext())
@@ -397,6 +411,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 {

Powered by Google App Engine
This is Rietveld 408576698