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

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

Issue 2062203004: IDBObserver: Lifetime Management: Adding Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unobserve functionality Created 4 years, 6 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/IDBObserver.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp
index 0023bac4dc2cce0fbad9a3a64dab90bffb72f4ff..6f59d53bc8b6dc9b6d7f67eb2479341bc675e68a 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp
@@ -45,6 +45,15 @@ void IDBObserver::observe(IDBDatabase* database, IDBTransaction* transaction, Ex
database->backend()->observe(this, transaction->id());
}
+void IDBObserver::unobserve(IDBDatabase* database, ExceptionState& exceptionState)
+{
+ if (!database->backend()) {
+ exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databaseClosedErrorMessage);
+ return;
+ }
+ database->backend()->unobserve(this);
+}
+
DEFINE_TRACE(IDBObserver)
{
visitor->trace(m_callback);

Powered by Google App Engine
This is Rietveld 408576698