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_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVATION_H_ |
| 6 #define CONTENT_BROWSER_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 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
| 13 |
| 14 namespace content { |
| 15 |
| 16 // Represents a single observed operation (put/add/delete/clear) of a |
| 17 // transaction. |
| 18 class IndexedDBObservation { |
| 19 public: |
| 20 using OperationType = blink::WebIDBOperationType; |
| 21 |
| 22 IndexedDBObservation(int32_t object_store_id, OperationType type); |
| 23 IndexedDBObservation(int32_t object_store_id, |
| 24 OperationType type, |
| 25 IndexedDBKeyRange key_range); |
| 26 IndexedDBObservation(int32_t object_store_id, |
| 27 OperationType type, |
| 28 IndexedDBKeyRange key_range, |
| 29 IndexedDBValue value); |
| 30 |
| 31 ~IndexedDBObservation(); |
| 32 |
| 33 int64_t object_store_id() const { return object_store_id_; } |
| 34 OperationType type() const { return type_; } |
| 35 const IndexedDBKeyRange key_range() const { return key_range_; } |
| 36 const IndexedDBValue value() const { return value_; } |
| 37 |
| 38 private: |
| 39 int64_t object_store_id_; |
| 40 OperationType type_; |
| 41 // Populated for ADD, PUT, and DELETE operations. |
| 42 IndexedDBKeyRange key_range_; |
| 43 // Populated for ADD and PUT operations if values are requested. |
| 44 IndexedDBValue value_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(IndexedDBObservation); |
| 47 }; |
| 48 |
| 49 } // namespace content |
| 50 |
| 51 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVATION_H_ |
OLD | NEW |