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

Side by Side Diff: content/browser/indexed_db/indexed_db_observer_changes.h

Issue 2511403003: Send IndexedDB observations through IDBDatabaseCallbacks. (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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 #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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698