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

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 cmumford 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..106c3e3eecc17db4c9427a991b252c50e18e9fe1 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 IDBObserverCallback;
class IDBObserverInit;
+class IDBDatabase;
cmumford 2016/07/06 22:57:56 Put forward declarations in alphabetical order.
palakj1 2016/07/07 00:19:53 Done.
+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;
cmumford 2016/07/06 22:57:57 So both IDBObserver and WebIDBDatabaseImpl have a
dmurph 2016/07/06 23:34:24 They're not identical. Here's the overview: 1. Eve
palakj1 2016/07/07 00:19:54 They are in the same thread, but not the same. Con
cmumford 2016/07/07 19:48:51 yep - thx.
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698