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

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

Issue 2062203004: IDBObserver: Lifetime Management: Adding Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final architechture Created 4 years, 5 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.h
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h
index 538995bc8b907504792f182bd8b46a0514bd1308..c85005677b75b4d05a78f5a7a8a103eb79d55a47 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h
@@ -6,23 +6,29 @@
#define IDBObserver_h
#include "bindings/core/v8/ScriptWrappable.h"
-#include "modules/indexeddb/IDBDatabase.h"
-#include "modules/indexeddb/IDBTransaction.h"
+#include "modules/ModulesExport.h"
#include "platform/heap/Handle.h"
+#include <set>
namespace blink {
+class ExceptionState;
+class IDBDatabase;
class IDBObserverCallback;
class IDBObserverInit;
+class IDBTransaction;
-class IDBObserver final : public GarbageCollected<IDBObserver>, public ScriptWrappable {
+class MODULES_EXPORT IDBObserver final : public GarbageCollectedFinalized<IDBObserver>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static IDBObserver* create(IDBObserverCallback&, const IDBObserverInit&);
+ ~IDBObserver();
// API methods
void observe(IDBDatabase*, IDBTransaction*, ExceptionState&);
+ void unobserve(IDBDatabase*, ExceptionState&);
+ void removeObserver(int32_t id);
DECLARE_TRACE();
@@ -33,6 +39,7 @@ private:
bool m_transaction;
bool m_values;
bool m_noRecords;
+ std::set<int32_t> m_observerIds;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698