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

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

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Address last nits and fix leaks in unit tests. 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/IDBDatabaseCallbacks.h
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseCallbacks.h b/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseCallbacks.h
index 33743498662e2f4d9c36f5f9e569361cb360b134..4916b3b26b9f6dc8dac4e621c89068affc9d3ebc 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseCallbacks.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseCallbacks.h
@@ -34,6 +34,7 @@ namespace blink {
class DOMException;
class IDBDatabase;
+class WebIDBDatabaseCallbacks;
class MODULES_EXPORT IDBDatabaseCallbacks
: public GarbageCollectedFinalized<IDBDatabaseCallbacks> {
@@ -51,6 +52,12 @@ class MODULES_EXPORT IDBDatabaseCallbacks
void connect(IDBDatabase*);
+ // Returns a new WebIDBDatabaseCallbacks for this object. Must only be
+ // called once.
+ std::unique_ptr<WebIDBDatabaseCallbacks> createWebCallbacks();
+ void detachWebCallbacks();
+ void webCallbacksDestroyed();
+
protected:
// Exposed to subclasses for unit tests.
IDBDatabaseCallbacks();
@@ -64,6 +71,10 @@ class MODULES_EXPORT IDBDatabaseCallbacks
// can survive too. m_database should be a weak reference to avoid that an
// IDBDatabase survives the GC with the IDBDatabaseCallbacks.
WeakMember<IDBDatabase> m_database;
+
+ // Pointer back to the WebIDBDatabaseCallbacks that holds a persistent
+ // reference to this object.
+ WebIDBDatabaseCallbacks* m_webCallbacks = nullptr;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698