OLD | NEW |
(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_COMMON_INDEXED_DB_INDEXED_DB_OBSERVATION_H_ |
| 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_OBSERVATION_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "content/browser/indexed_db/indexed_db_value.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "content/common/indexed_db/indexed_db_key_range.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class CONTENT_EXPORT IndexedDBObservation { |
| 16 public: |
| 17 enum OperationType { |
| 18 ADD = 0, |
| 19 PUT, |
| 20 DELETE, |
| 21 CLEAR, |
| 22 }; |
| 23 |
| 24 IndexedDBObservation(OperationType); |
| 25 IndexedDBObservation(OperationType, IndexedDBKeyRange); |
| 26 IndexedDBObservation(OperationType, IndexedDBKeyRange, IndexedDBValue); |
| 27 |
| 28 ~IndexedDBObservation(); |
| 29 |
| 30 OperationType type() const { return type_; } |
| 31 IndexedDBKeyRange key_range() const { return key_range_; } |
| 32 IndexedDBValue value() const { return value_; } |
| 33 |
| 34 private: |
| 35 // Required. |
| 36 OperationType type_; |
| 37 // Populated for ADD, PUT, and DELETE operations. |
| 38 IndexedDBKeyRange key_range_; |
| 39 // Populated for ADD and PUT operations if values are requested. |
| 40 IndexedDBValue value_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(IndexedDBObservation); |
| 43 }; |
| 44 |
| 45 } // namespace content |
| 46 |
| 47 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_OBSERVATION_H_ |
OLD | NEW |