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

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: Post dmurph review 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.h
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h
index 538995bc8b907504792f182bd8b46a0514bd1308..a2c0a59c4d7d73f51136babecea39ed077c8f74a 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h
@@ -6,16 +6,19 @@
#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 IDBObserverCallback;
class IDBObserverInit;
+class IDBDatabase;
+class IDBTransaction;
-class IDBObserver final : public GarbageCollected<IDBObserver>, public ScriptWrappable {
+class MODULES_EXPORT IDBObserver final : public GarbageCollectedFinalized<IDBObserver>, public ScriptWrappable {
dmurph 2016/06/28 18:53:50 I think we can just be GarbageCollected, right?
palakj1 2016/06/29 23:02:41 std::set<int32_t> m_observerIds requires finalizat
DEFINE_WRAPPERTYPEINFO();
public:
@@ -23,6 +26,8 @@ public:
// API methods
void observe(IDBDatabase*, IDBTransaction*, ExceptionState&);
+ void unobserve(IDBDatabase*, ExceptionState&);
+ void removeObserver(int32_t id);
DECLARE_TRACE();
@@ -33,6 +38,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