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

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

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Allow cpp_only to be set by the invoker. Created 4 years, 3 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.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseCallbacks.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseCallbacks.cpp
index ec660ed553744a272d86fad093ad3266463d028b..f984de81928359521f514913bb76f1bc51eba8d2 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseCallbacks.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseCallbacks.cpp
@@ -26,6 +26,7 @@
#include "modules/indexeddb/IDBDatabaseCallbacks.h"
#include "modules/indexeddb/IDBDatabase.h"
+#include "modules/indexeddb/WebIDBDatabaseCallbacksImpl.h"
namespace blink {
@@ -60,13 +61,6 @@ void IDBDatabaseCallbacks::onVersionChange(int64_t oldVersion, int64_t newVersio
m_database->onVersionChange(oldVersion, newVersion);
}
-void IDBDatabaseCallbacks::connect(IDBDatabase* database)
-{
- ASSERT(!m_database);
- ASSERT(database);
- m_database = database;
-}
-
void IDBDatabaseCallbacks::onAbort(int64_t transactionId, DOMException* error)
{
if (m_database)
@@ -79,4 +73,33 @@ void IDBDatabaseCallbacks::onComplete(int64_t transactionId)
m_database->onComplete(transactionId);
}
+void IDBDatabaseCallbacks::connect(IDBDatabase* database)
+{
+ DCHECK(!m_database);
+ DCHECK(database);
+ m_database = database;
+}
+
+std::unique_ptr<WebIDBDatabaseCallbacks> IDBDatabaseCallbacks::createWebCallbacks()
+{
+ DCHECK(!m_webCallbacks);
+ std::unique_ptr<WebIDBDatabaseCallbacks> callbacks = WebIDBDatabaseCallbacksImpl::create(this);
+ m_webCallbacks = callbacks.get();
+ return callbacks;
+}
+
+void IDBDatabaseCallbacks::detachWebCallbacks()
+{
+ if (m_webCallbacks) {
+ m_webCallbacks->detach();
+ m_webCallbacks = nullptr;
+ }
+}
+
+void IDBDatabaseCallbacks::webCallbacksDestroyed()
+{
+ DCHECK(m_webCallbacks);
+ m_webCallbacks = nullptr;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698