| 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 <memory> | |
| 13 #include <utility> | |
| 14 #include <vector> | |
| 15 | |
| 16 #include "base/macros.h" | |
| 17 #include "content/browser/indexed_db/indexed_db_observation.h" | |
| 18 #include "content/common/content_export.h" | |
| 19 | |
| 20 namespace content { | |
| 21 | |
| 22 class IndexedDBObservation; | |
| 23 | |
| 24 // Holds observations corresponding to a transaction for a single connection. | |
| 25 class CONTENT_EXPORT IndexedDBObserverChanges { | |
| 26 public: | |
| 27 IndexedDBObserverChanges(); | |
| 28 ~IndexedDBObserverChanges(); | |
| 29 | |
| 30 void RecordObserverForLastObservation(int32_t observer_id); | |
| 31 void AddObservation(std::unique_ptr<IndexedDBObservation> observation); | |
| 32 | |
| 33 std::map<int32_t, std::vector<int32_t>> release_observation_indices_map() { | |
| 34 return std::move(observation_indices_map_); | |
| 35 } | |
| 36 std::vector<std::unique_ptr<IndexedDBObservation>> release_observations() { | |
| 37 return std::move(observations_); | |
| 38 } | |
| 39 | |
| 40 private: | |
| 41 // Maps observer_id to corresponding set of indices in observations. | |
| 42 std::map<int32_t, std::vector<int32_t>> observation_indices_map_; | |
| 43 std::vector<std::unique_ptr<IndexedDBObservation>> observations_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(IndexedDBObserverChanges); | |
| 46 }; | |
| 47 | |
| 48 } // namespace content | |
| 49 | |
| 50 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_ | |
| OLD | NEW |