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

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

Issue 2125213002: [IndexedDB] Propogating changes to observers : Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifetime
Patch Set: IDBDatabase weakptr introduced on IDBObserver 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 c85005677b75b4d05a78f5a7a8a103eb79d55a47..c2872aea01f7f9cc05889134725a9db9eac179ca 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.h
@@ -8,6 +8,7 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "modules/ModulesExport.h"
#include "platform/heap/Handle.h"
+#include "public/platform/modules/indexeddb/WebIDBTypes.h"
#include <set>
namespace blink {
@@ -17,6 +18,7 @@ class IDBDatabase;
class IDBObserverCallback;
class IDBObserverInit;
class IDBTransaction;
+struct WebIDBObservation;
class MODULES_EXPORT IDBObserver final : public GarbageCollectedFinalized<IDBObserver>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
@@ -25,10 +27,17 @@ public:
static IDBObserver* create(IDBObserverCallback&, const IDBObserverInit&);
~IDBObserver();
+
// API methods
Marijn Kruisselbrink 2016/07/11 23:10:40 I'm not sure what the "API methods" and "API Attri
palakj1 2016/07/13 00:43:51 Removed. Not aware of the right comments to put he
void observe(IDBDatabase*, IDBTransaction*, ExceptionState&);
void unobserve(IDBDatabase*, ExceptionState&);
void removeObserver(int32_t id);
+ void onChange(int32_t id, const std::vector<WebIDBObservation>&, const std::vector<int32_t>& observation_index);
+
+ // API Attributes
+ bool transaction() const { return m_transaction; }
+ bool noRecords() const { return m_noRecords; }
+ bool values() const { return m_values; }
DECLARE_TRACE();
@@ -39,7 +48,7 @@ private:
bool m_transaction;
bool m_values;
bool m_noRecords;
- std::set<int32_t> m_observerIds;
+ std::map<int32_t, WeakMember<IDBDatabase>> m_observerIds;
Marijn Kruisselbrink 2016/07/11 23:10:40 You should not use stl containers to hold referenc
palakj1 2016/07/13 00:43:51 Changed stl container to heaphashmap. As discussed
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698