Index: content/browser/indexed_db/indexed_db_observer_changes.h |
diff --git a/content/browser/indexed_db/indexed_db_observer_changes.h b/content/browser/indexed_db/indexed_db_observer_changes.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..33b4d47bfff8a679fbd78f8de34c4d406cfc0ddb |
--- /dev/null |
+++ b/content/browser/indexed_db/indexed_db_observer_changes.h |
@@ -0,0 +1,53 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// 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.
|
+// single connection. |
+ |
+#ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_ |
+#define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_ |
+ |
+#include <stddef.h> |
+#include <stdint.h> |
+ |
+#include <map> |
+#include <set> |
+#include <vector> |
+ |
+#include "base/macros.h" |
+#include "base/memory/ptr_util.h" |
+#include "base/stl_util.h" |
+#include "content/browser/indexed_db/indexed_db_observation.h" |
+#include "content/common/content_export.h" |
+ |
+namespace content { |
+ |
+class IndexedDBObservation; |
+ |
+class CONTENT_EXPORT IndexedDBObserverChanges { |
+ public: |
+ IndexedDBObserverChanges(); |
+ ~IndexedDBObserverChanges(); |
+ |
+ void RecordObserverForLastObservation(int32_t observer_id); |
+ void AddObservation(std::unique_ptr<IndexedDBObservation> observation); |
+ |
+ 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
|
+ return std::move(observation_indices_map_); |
+ } |
+ std::vector<std::unique_ptr<IndexedDBObservation>> release_observations() { |
+ return std::move(observations_); |
+ } |
+ |
+ private: |
+ // Maps observer_id to corresponding set of indices in observations. |
+ std::map<int32_t, std::vector<int32_t>> observation_indices_map_; |
+ std::vector<std::unique_ptr<IndexedDBObservation>> observations_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(IndexedDBObserverChanges); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_ |