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/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "public/platform/modules/indexeddb/WebIDBTypes.h" | |
11 #include <set> | 12 #include <set> |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 class ExceptionState; | 16 class ExceptionState; |
16 class IDBDatabase; | 17 class IDBDatabase; |
17 class IDBObserverCallback; | 18 class IDBObserverCallback; |
18 class IDBObserverInit; | 19 class IDBObserverInit; |
19 class IDBTransaction; | 20 class IDBTransaction; |
21 struct WebIDBObservation; | |
20 | 22 |
21 class MODULES_EXPORT IDBObserver final : public GarbageCollectedFinalized<IDBObs erver>, public ScriptWrappable { | 23 class MODULES_EXPORT IDBObserver final : public GarbageCollectedFinalized<IDBObs erver>, public ScriptWrappable { |
22 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
23 | 25 |
24 public: | 26 public: |
25 static IDBObserver* create(IDBObserverCallback&, const IDBObserverInit&); | 27 static IDBObserver* create(IDBObserverCallback&, const IDBObserverInit&); |
26 | 28 |
27 ~IDBObserver(); | 29 ~IDBObserver(); |
28 // API methods | 30 // API methods |
29 void observe(IDBDatabase*, IDBTransaction*, ExceptionState&); | 31 void observe(IDBDatabase*, IDBTransaction*, ExceptionState&); |
30 void unobserve(IDBDatabase*, ExceptionState&); | 32 void unobserve(IDBDatabase*, ExceptionState&); |
31 void removeObserver(int32_t id); | 33 void removeObserver(int32_t id); |
34 void onChange(const std::vector<WebIDBObservation>&, const std::vector<int32 _t>& observation_index); | |
32 | 35 |
33 DECLARE_TRACE(); | 36 DECLARE_TRACE(); |
34 | 37 |
35 private: | 38 private: |
36 IDBObserver(IDBObserverCallback&, const IDBObserverInit&); | 39 IDBObserver(IDBObserverCallback&, const IDBObserverInit&); |
37 | 40 |
38 Member<IDBObserverCallback> m_callback; | 41 Member<IDBObserverCallback> m_callback; |
39 bool m_transaction; | 42 bool m_transaction; |
40 bool m_values; | 43 bool m_values; |
41 bool m_noRecords; | 44 bool m_noRecords; |
45 // bool m_operationType[WebIDBOperationTypeCount] = {true}; | |
jsbell
2016/07/11 18:25:33
Remove or change into a TODO before landing
palakj1
2016/07/11 22:25:40
Done.
| |
42 std::set<int32_t> m_observerIds; | 46 std::set<int32_t> m_observerIds; |
43 }; | 47 }; |
44 | 48 |
45 } // namespace blink | 49 } // namespace blink |
46 | 50 |
47 #endif // IDBObserver_h | 51 #endif // IDBObserver_h |
OLD | NEW |