Index: content/browser/indexed_db/indexed_db_observer.h |
diff --git a/content/browser/indexed_db/indexed_db_observer.h b/content/browser/indexed_db/indexed_db_observer.h |
index f7bd95985a3b280865f63303b9e44faaf4578ff7..5301839ec8db11f0809d6f14534ab7dee04516f8 100644 |
--- a/content/browser/indexed_db/indexed_db_observer.h |
+++ b/content/browser/indexed_db/indexed_db_observer.h |
@@ -8,20 +8,48 @@ |
#include <stddef.h> |
#include <stdint.h> |
+#include <set> |
+#include <vector> |
+ |
#include "base/macros.h" |
+#include "base/stl_util.h" |
#include "content/common/content_export.h" |
+#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
namespace content { |
class CONTENT_EXPORT IndexedDBObserver { |
public: |
- IndexedDBObserver(int32_t observer_id); |
+ // TODO(palakj): Modify constructor to add operation_type. |
+ IndexedDBObserver(int32_t observer_id, |
+ std::set<int64_t> object_store_ids, |
+ bool includeTransaction, |
cmumford
2016/07/14 21:11:35
unix_style.
palakj1
2016/07/15 20:16:04
changed.
|
+ bool noRecords, |
+ bool values); |
~IndexedDBObserver(); |
- int32_t id() const { return observer_id_; } |
+ int32_t id() const { return id_; } |
+ const std::set<int64_t>& GetObjectStoreIds() const { |
+ return object_store_ids_; |
+ } |
+ bool IsRecordingType(blink::WebIDBOperationType type) const { |
+ DCHECK_NE(type, blink::WebIDBOperationTypeCount); |
+ return operation_type_[type]; |
+ } |
+ bool IsRecordingObjectStore(int64_t object_store_id) const { |
+ return ContainsValue(object_store_ids_, object_store_id); |
+ } |
+ bool include_transaction() const { return include_transaction_; } |
+ bool no_records() const { return no_records_; } |
+ bool values() const { return values_; } |
private: |
- int32_t observer_id_; |
+ int32_t id_; |
+ std::set<int64_t> object_store_ids_; |
+ bool include_transaction_, no_records_, values_; |
+ // operation_type_ indicates whether each operation type { ADD, PUT, DELETE, |
+ // CLEAR } is to be recorded or not. |
+ bool operation_type_[blink::WebIDBOperationTypeCount]; |
jsbell
2016/07/14 20:08:13
How about std::bitset rather than an array of bool
palakj1
2016/07/15 20:16:04
Never knew about it. Changing.
|
DISALLOW_COPY_AND_ASSIGN(IndexedDBObserver); |
}; |