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

Side by Side Diff: content/browser/indexed_db/indexed_db_observer_changes.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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // This class holds all observed operations of a transaction corresponding to a
6 // single connection.
7
8 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_
9 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_
10
11 #include <stddef.h>
12 #include <stdint.h>
13
14 #include <map>
15 #include <set>
16 #include <vector>
17
18 #include "base/macros.h"
19 #include "base/memory/ptr_util.h"
20 #include "base/stl_util.h"
21 #include "content/common/content_export.h"
22
23 namespace content {
24
25 class IndexedDBObservation;
26
27 class CONTENT_EXPORT IndexedDBObserverChanges {
28 public:
29 IndexedDBObserverChanges();
30 ~IndexedDBObserverChanges();
31
32 void RecordObserverForLastObservation(int32_t observer_id);
33 void AddObservation(std::unique_ptr<IndexedDBObservation> observation);
34
35 std::map<int32_t, std::vector<int32_t>>& observation_index() {
Marijn Kruisselbrink 2016/07/11 23:10:39 Would it make sense to instead of having methods t
palakj1 2016/07/13 00:43:51 Done.
36 return observation_index_;
37 }
38 std::vector<std::unique_ptr<IndexedDBObservation>>& observations() {
39 return observations_;
40 }
41
42 private:
43 // Maps observer_id to corresponding set of indices in observations.
44 std::map<int32_t, std::vector<int32_t>> observation_index_;
Marijn Kruisselbrink 2016/07/11 23:10:39 Is observation_index really the best name for this
palakj1 2016/07/13 00:43:51 Agreed. Changed to observation_indices_map. Any be
45 std::vector<std::unique_ptr<IndexedDBObservation>> observations_;
46
47 DISALLOW_COPY_AND_ASSIGN(IndexedDBObserverChanges);
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698