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

Unified 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: Post cmumford review 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 side-by-side diff with in-line comments
Download patch
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..1ecf6ecfb4fdde57f7f121bbddcd6c8e80658b5b
--- /dev/null
+++ b/content/browser/indexed_db/indexed_db_observer_changes.h
@@ -0,0 +1,50 @@
+// 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.
+
+#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/common/content_export.h"
+
+namespace content {
+
+class IndexedDBObservation;
+
+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
+ public:
+ IndexedDBObserverChanges();
+ ~IndexedDBObserverChanges();
+
+ void AddObservationIndex(int32_t observer_id);
+ void AddObservation(std::unique_ptr<IndexedDBObservation> observation);
+
+ const std::map<int32_t, std::vector<int32_t>>& observation_index() {
+ return observation_index_;
+ }
+ // TODO(palakj): Can I retrun const here.
+ std::vector<std::unique_ptr<IndexedDBObservation>>& observations() {
+ return observations_;
+ }
+
+ private:
+ // map observer_id to corresponding set of indices in observations.
+ std::map<int32_t, std::vector<int32_t>> observation_index_;
+ std::vector<std::unique_ptr<IndexedDBObservation>> observations_;
+
+ DISALLOW_COPY_AND_ASSIGN(IndexedDBObserverChanges);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_CHANGES_H_

Powered by Google App Engine
This is Rietveld 408576698