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

Unified Diff: content/common/indexed_db/indexed_db_observation.h

Issue 2125213002: [IndexedDB] Propogating changes to observers : Renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifetime
Patch Set: Filtering Changes to Observer : Browser End 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/common/indexed_db/indexed_db_observation.h
diff --git a/content/common/indexed_db/indexed_db_observation.h b/content/common/indexed_db/indexed_db_observation.h
new file mode 100644
index 0000000000000000000000000000000000000000..36dedf0f4859e274d90dbee19226adc6261bcbdb
--- /dev/null
+++ b/content/common/indexed_db/indexed_db_observation.h
@@ -0,0 +1,47 @@
+// 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_COMMON_INDEXED_DB_INDEXED_DB_OBSERVATION_H_
+#define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_OBSERVATION_H_
+
+#include "base/macros.h"
+#include "content/browser/indexed_db/indexed_db_value.h"
+#include "content/common/content_export.h"
+#include "content/common/indexed_db/indexed_db_key_range.h"
+
+namespace content {
+
+class CONTENT_EXPORT IndexedDBObservation {
+ public:
+ enum OperationType {
+ ADD = 0,
+ PUT,
+ DELETE,
+ CLEAR,
+ };
+
+ IndexedDBObservation(OperationType);
+ IndexedDBObservation(OperationType, IndexedDBKeyRange);
+ IndexedDBObservation(OperationType, IndexedDBKeyRange, IndexedDBValue);
+
+ ~IndexedDBObservation();
+
+ OperationType type() const { return type_; }
+ IndexedDBKeyRange key_range() const { return key_range_; }
+ IndexedDBValue value() const { return value_; }
+
+ private:
+ // Required.
+ OperationType type_;
+ // Populated for ADD, PUT, and DELETE operations.
+ IndexedDBKeyRange key_range_;
+ // Populated for ADD and PUT operations if values are requested.
+ IndexedDBValue value_;
+
+ DISALLOW_COPY_AND_ASSIGN(IndexedDBObservation);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_OBSERVATION_H_

Powered by Google App Engine
This is Rietveld 408576698