Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IDBObserver_h | 5 #ifndef IDBObserver_h |
| 6 #define IDBObserver_h | 6 #define IDBObserver_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "modules/indexeddb/IDBDatabase.h" | 9 #include "modules/ModulesExport.h" |
| 10 #include "modules/indexeddb/IDBTransaction.h" | |
| 11 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 #include <set> | |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class ExceptionState; | |
| 15 class IDBObserverCallback; | 16 class IDBObserverCallback; |
| 16 class IDBObserverInit; | 17 class IDBObserverInit; |
| 18 class IDBDatabase; | |
| 19 class IDBTransaction; | |
| 17 | 20 |
| 18 class IDBObserver final : public GarbageCollected<IDBObserver>, public ScriptWra ppable { | 21 class MODULES_EXPORT IDBObserver final : public GarbageCollectedFinalized<IDBObs erver>, 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
| |
| 19 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
| 20 | 23 |
| 21 public: | 24 public: |
| 22 static IDBObserver* create(IDBObserverCallback&, const IDBObserverInit&); | 25 static IDBObserver* create(IDBObserverCallback&, const IDBObserverInit&); |
| 23 | 26 |
| 24 // API methods | 27 // API methods |
| 25 void observe(IDBDatabase*, IDBTransaction*, ExceptionState&); | 28 void observe(IDBDatabase*, IDBTransaction*, ExceptionState&); |
| 29 void unobserve(IDBDatabase*, ExceptionState&); | |
| 30 void removeObserver(int32_t id); | |
| 26 | 31 |
| 27 DECLARE_TRACE(); | 32 DECLARE_TRACE(); |
| 28 | 33 |
| 29 private: | 34 private: |
| 30 IDBObserver(IDBObserverCallback&, const IDBObserverInit&); | 35 IDBObserver(IDBObserverCallback&, const IDBObserverInit&); |
| 31 | 36 |
| 32 Member<IDBObserverCallback> m_callback; | 37 Member<IDBObserverCallback> m_callback; |
| 33 bool m_transaction; | 38 bool m_transaction; |
| 34 bool m_values; | 39 bool m_values; |
| 35 bool m_noRecords; | 40 bool m_noRecords; |
| 41 std::set<int32_t> m_observerIds; | |
| 36 }; | 42 }; |
| 37 | 43 |
| 38 } // namespace blink | 44 } // namespace blink |
| 39 | 45 |
| 40 #endif // IDBObserver_h | 46 #endif // IDBObserver_h |
| OLD | NEW |