OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 IndexedDBObserver(int32_t observer_id, | 37 IndexedDBObserver(int32_t observer_id, |
38 std::set<int64_t> object_store_ids, | 38 std::set<int64_t> object_store_ids, |
39 const Options& options); | 39 const Options& options); |
40 ~IndexedDBObserver(); | 40 ~IndexedDBObserver(); |
41 | 41 |
42 int32_t id() const { return id_; } | 42 int32_t id() const { return id_; } |
43 const std::set<int64_t>& object_store_ids() const { | 43 const std::set<int64_t>& object_store_ids() const { |
44 return object_store_ids_; | 44 return object_store_ids_; |
45 } | 45 } |
46 | 46 |
| 47 void set_object_store_ids(std::set<int64_t> ids) { |
| 48 object_store_ids_ = std::move(ids); |
| 49 } |
| 50 |
47 bool IsRecordingType(blink::WebIDBOperationType type) const { | 51 bool IsRecordingType(blink::WebIDBOperationType type) const { |
48 DCHECK_NE(type, blink::WebIDBOperationTypeCount); | 52 DCHECK_NE(type, blink::WebIDBOperationTypeCount); |
49 return options_.operation_types[type]; | 53 return options_.operation_types[type]; |
50 } | 54 } |
51 bool IsRecordingObjectStore(int64_t object_store_id) const { | 55 bool IsRecordingObjectStore(int64_t object_store_id) const { |
52 return base::ContainsValue(object_store_ids_, object_store_id); | 56 return base::ContainsValue(object_store_ids_, object_store_id); |
53 } | 57 } |
54 bool include_transaction() const { return options_.include_transaction; } | 58 bool include_transaction() const { return options_.include_transaction; } |
55 bool no_records() const { return options_.no_records; } | 59 bool no_records() const { return options_.no_records; } |
56 bool values() const { return options_.values; } | 60 bool values() const { return options_.values; } |
57 | 61 |
58 private: | 62 private: |
59 int32_t id_; | 63 int32_t id_; |
60 std::set<int64_t> object_store_ids_; | 64 std::set<int64_t> object_store_ids_; |
61 Options options_; | 65 Options options_; |
62 | 66 |
63 DISALLOW_COPY_AND_ASSIGN(IndexedDBObserver); | 67 DISALLOW_COPY_AND_ASSIGN(IndexedDBObserver); |
64 }; | 68 }; |
65 | 69 |
66 } // namespace content | 70 } // namespace content |
67 | 71 |
68 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_H_ | 72 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_OBSERVER_H_ |
OLD | NEW |