OLD | NEW |
---|---|
(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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_ | |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_ | |
7 | |
8 #include <stddef.h> | |
9 #include <stdint.h> | |
10 | |
11 #include <map> | |
12 #include <set> | |
13 #include <vector> | |
14 | |
15 #include "base/macros.h" | |
16 #include "base/memory/ptr_util.h" | |
17 #include "base/stl_util.h" | |
18 #include "content/browser/indexed_db/indexed_db_observation.h" | |
19 #include "content/common/content_export.h" | |
20 | |
21 namespace content { | |
22 | |
23 class IndexedDBObservation; | |
24 | |
25 // This class holds a collection of observations of a transaction corresponding | |
26 // to a | |
cmumford
2016/07/19 16:00:16
Fix line wrap.
palakj1
2016/07/19 18:04:14
done
| |
27 // single connection. | |
28 class CONTENT_EXPORT IndexedDBObserverChanges { | |
29 public: | |
30 IndexedDBObserverChanges(); | |
31 ~IndexedDBObserverChanges(); | |
32 | |
33 void RecordObserverForLastObservation(int32_t observer_id); | |
34 void AddObservation(std::unique_ptr<IndexedDBObservation> observation); | |
35 | |
36 std::map<int32_t, std::vector<int32_t>> release_observation_indices_map() { | |
37 return std::move(observation_indices_map_); | |
38 } | |
39 std::vector<std::unique_ptr<IndexedDBObservation>> release_observations() { | |
40 return std::move(observations_); | |
41 } | |
42 | |
43 private: | |
44 // Maps observer_id to corresponding set of indices in observations. | |
45 std::map<int32_t, std::vector<int32_t>> observation_indices_map_; | |
46 std::vector<std::unique_ptr<IndexedDBObservation>> observations_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(IndexedDBObserverChanges); | |
49 }; | |
50 | |
51 } // namespace content | |
52 | |
53 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_ | |
OLD | NEW |