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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.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/IDBOpenDBRequest.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp
index 924d2834b795018340e44bb4801a8ef52b6f40c5..723f1f6c073f9b32816a40c6ce301e31d79ca724 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp
@@ -67,6 +67,12 @@ DEFINE_TRACE(IDBOpenDBRequest) {
IDBRequest::trace(visitor);
}
+void IDBOpenDBRequest::contextDestroyed() {
+ IDBRequest::contextDestroyed();
+ if (m_databaseCallbacks)
+ m_databaseCallbacks->detachWebCallbacks();
+}
+
const AtomicString& IDBOpenDBRequest::interfaceName() const {
return EventTargetNames::IDBOpenDBRequest;
}
@@ -89,12 +95,6 @@ void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion,
WebIDBDataLoss dataLoss,
String dataLossMessage) {
IDB_TRACE("IDBOpenDBRequest::onUpgradeNeeded()");
- if (m_contextStopped || !getExecutionContext()) {
- std::unique_ptr<WebIDBDatabase> db = std::move(backend);
- db->abort(m_transactionId);
- db->close();
- return;
- }
if (!shouldEnqueueEvent())
return;
@@ -126,12 +126,6 @@ void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion,
void IDBOpenDBRequest::onSuccess(std::unique_ptr<WebIDBDatabase> backend,
const IDBDatabaseMetadata& metadata) {
IDB_TRACE("IDBOpenDBRequest::onSuccess()");
- if (m_contextStopped || !getExecutionContext()) {
- std::unique_ptr<WebIDBDatabase> db = std::move(backend);
- if (db)
- db->close();
- return;
- }
if (!shouldEnqueueEvent())
return;

Powered by Google App Engine
This is Rietveld 408576698