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

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

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/WebIDBDatabaseCallbacksImpl.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp b/third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp
index 4b6b8e87603ccf4e2b756924583d64539efe6c18..a79fff198ca1d49a2efc3f94151ac5c1e33d1a61 100644
--- a/third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp
@@ -41,25 +41,37 @@ WebIDBDatabaseCallbacksImpl::WebIDBDatabaseCallbacksImpl(
IDBDatabaseCallbacks* callbacks)
: m_callbacks(callbacks) {}
-WebIDBDatabaseCallbacksImpl::~WebIDBDatabaseCallbacksImpl() {}
+WebIDBDatabaseCallbacksImpl::~WebIDBDatabaseCallbacksImpl() {
+ if (m_callbacks)
+ m_callbacks->webCallbacksDestroyed();
+}
void WebIDBDatabaseCallbacksImpl::onForcedClose() {
- m_callbacks->onForcedClose();
+ if (m_callbacks)
+ m_callbacks->onForcedClose();
}
void WebIDBDatabaseCallbacksImpl::onVersionChange(long long oldVersion,
long long newVersion) {
- m_callbacks->onVersionChange(oldVersion, newVersion);
+ if (m_callbacks)
+ m_callbacks->onVersionChange(oldVersion, newVersion);
}
void WebIDBDatabaseCallbacksImpl::onAbort(long long transactionId,
const WebIDBDatabaseError& error) {
- m_callbacks->onAbort(transactionId,
- DOMException::create(error.code(), error.message()));
+ if (m_callbacks) {
+ m_callbacks->onAbort(transactionId,
+ DOMException::create(error.code(), error.message()));
+ }
}
void WebIDBDatabaseCallbacksImpl::onComplete(long long transactionId) {
- m_callbacks->onComplete(transactionId);
+ if (m_callbacks)
+ m_callbacks->onComplete(transactionId);
+}
+
+void WebIDBDatabaseCallbacksImpl::detach() {
+ m_callbacks.clear();
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698