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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBObserver.h

Issue 2511403003: Send IndexedDB observations through IDBDatabaseCallbacks. (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/ScriptWrappable.h" 9 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "modules/ModulesExport.h" 10 #include "modules/ModulesExport.h"
(...skipping 10 matching lines...) Expand all
21 class IDBTransaction; 21 class IDBTransaction;
22 struct WebIDBObservation; 22 struct WebIDBObservation;
23 23
24 class MODULES_EXPORT IDBObserver final : public GarbageCollected<IDBObserver>, 24 class MODULES_EXPORT IDBObserver final : public GarbageCollected<IDBObserver>,
25 public ScriptWrappable { 25 public ScriptWrappable {
26 DEFINE_WRAPPERTYPEINFO(); 26 DEFINE_WRAPPERTYPEINFO();
27 27
28 public: 28 public:
29 static IDBObserver* create(IDBObserverCallback*); 29 static IDBObserver* create(IDBObserverCallback*);
30 30
31 void removeObserver(int32_t id); 31 IDBObserverCallback* callback() { return m_callback; }
32 void onChange(int32_t id,
33 const WebVector<WebIDBObservation>&,
34 const WebVector<int32_t>& observationIndex);
35 32
36 // Implement the IDBObserver IDL. 33 // Implement the IDBObserver IDL.
37 void observe(IDBDatabase*, 34 void observe(IDBDatabase*,
38 IDBTransaction*, 35 IDBTransaction*,
39 const IDBObserverInit&, 36 const IDBObserverInit&,
40 ExceptionState&); 37 ExceptionState&);
41 void unobserve(IDBDatabase*, ExceptionState&); 38 void unobserve(IDBDatabase*, ExceptionState&);
42 39
43 DECLARE_TRACE(); 40 DECLARE_TRACE();
44 41
45 private: 42 private:
46 explicit IDBObserver(IDBObserverCallback*); 43 explicit IDBObserver(IDBObserverCallback*);
47 44
48 Member<IDBObserverCallback> m_callback; 45 Member<IDBObserverCallback> m_callback;
49 HeapHashMap<int32_t, WeakMember<IDBDatabase>> m_observerIds; 46 HeapHashMap<int32_t, WeakMember<IDBDatabase>> m_observerIds;
50 }; 47 };
51 48
52 } // namespace blink 49 } // namespace blink
53 50
54 #endif // IDBObserver_h 51 #endif // IDBObserver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698