Chromium Code Reviews| 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/common/content_export.h" | |
| 19 | |
| 20 namespace content { | |
| 21 | |
| 22 class IndexedDBObservation; | |
| 23 | |
| 24 class CONTENT_EXPORT IndexedDBObserverChanges { | |
|
dmurph
2016/07/08 18:40:44
Ok, so, each set of changes is on a per-connection
dmurph
2016/07/08 18:40:44
Also, instead of having a duplicate changes in the
palakj1
2016/07/08 22:17:54
Renamed.
Deferring messages change to next patch
| |
| 25 public: | |
| 26 IndexedDBObserverChanges(); | |
| 27 ~IndexedDBObserverChanges(); | |
| 28 | |
| 29 void AddObservationIndex(int32_t observer_id); | |
| 30 void AddObservation(std::unique_ptr<IndexedDBObservation> observation); | |
| 31 | |
| 32 const std::map<int32_t, std::vector<int32_t>>& observation_index() { | |
| 33 return observation_index_; | |
| 34 } | |
| 35 // TODO(palakj): Can I retrun const here. | |
| 36 std::vector<std::unique_ptr<IndexedDBObservation>>& observations() { | |
| 37 return observations_; | |
| 38 } | |
| 39 | |
| 40 private: | |
| 41 // map observer_id to corresponding set of indices in observations. | |
| 42 std::map<int32_t, std::vector<int32_t>> observation_index_; | |
| 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 |