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

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: Minor bugs fixed 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
jsbell 2016/07/14 20:08:13 Move this comment down to just above class {}
palakj1 2016/07/15 20:16:04 Done.
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/browser/indexed_db/indexed_db_observation.h"
22 #include "content/common/content_export.h"
23
24 namespace content {
25
26 class IndexedDBObservation;
27
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() {
cmumford 2016/07/14 21:11:35 Are observation_indices_map_ and observations_ lin
palakj1 2016/07/15 20:16:04 We use observation_indices_map to retrieve an inde
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698