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

Side by Side Diff: content/child/indexed_db/webidbdatabase_impl.h

Issue 2511403003: Send IndexedDB observations through IDBDatabaseCallbacks. (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_ 5 #ifndef CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_
6 #define CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_ 6 #define CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
11 11
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "content/common/indexed_db/indexed_db.mojom.h" 14 #include "content/common/indexed_db/indexed_db.mojom.h"
15 #include "content/common/indexed_db/indexed_db_constants.h" 15 #include "content/common/indexed_db/indexed_db_constants.h"
16 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCursor.h" 16 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCursor.h"
17 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabase.h" 17 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabase.h"
18 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" 18 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
19 19
20 namespace blink { 20 namespace blink {
21 class WebBlobInfo; 21 class WebBlobInfo;
22 class WebIDBCallbacks; 22 class WebIDBCallbacks;
23 class WebIDBObserver;
24 class WebString; 23 class WebString;
25 } 24 }
26 25
27 namespace content { 26 namespace content {
28 27
29 class CONTENT_EXPORT WebIDBDatabaseImpl 28 class CONTENT_EXPORT WebIDBDatabaseImpl
30 : public NON_EXPORTED_BASE(blink::WebIDBDatabase) { 29 : public NON_EXPORTED_BASE(blink::WebIDBDatabase) {
31 public: 30 public:
32 WebIDBDatabaseImpl(indexed_db::mojom::DatabaseAssociatedPtrInfo database, 31 WebIDBDatabaseImpl(indexed_db::mojom::DatabaseAssociatedPtrInfo database,
33 scoped_refptr<base::SingleThreadTaskRunner> io_runner); 32 scoped_refptr<base::SingleThreadTaskRunner> io_runner);
(...skipping 10 matching lines...) Expand all
44 void renameObjectStore(long long transaction_id, 43 void renameObjectStore(long long transaction_id,
45 long long object_store_id, 44 long long object_store_id,
46 const blink::WebString& new_name) override; 45 const blink::WebString& new_name) override;
47 void createTransaction(long long transaction_id, 46 void createTransaction(long long transaction_id,
48 const blink::WebVector<long long>& scope, 47 const blink::WebVector<long long>& scope,
49 blink::WebIDBTransactionMode mode) override; 48 blink::WebIDBTransactionMode mode) override;
50 49
51 void close() override; 50 void close() override;
52 void versionChangeIgnored() override; 51 void versionChangeIgnored() override;
53 52
54 int32_t addObserver(std::unique_ptr<blink::WebIDBObserver>, 53 void addObserver(long long transaction_id,
55 long long transactionId) override; 54 int32_t observer_id,
55 bool include_transaction,
56 bool no_records,
57 bool values,
58 const std::bitset<blink::WebIDBOperationTypeCount>&
59 operation_types) override;
56 void removeObservers( 60 void removeObservers(
57 const blink::WebVector<int32_t>& observer_ids_to_remove) override; 61 const blink::WebVector<int32_t>& observer_ids_to_remove) override;
58 62
59 void get(long long transactionId, 63 void get(long long transactionId,
60 long long objectStoreId, 64 long long objectStoreId,
61 long long indexId, 65 long long indexId,
62 const blink::WebIDBKeyRange&, 66 const blink::WebIDBKeyRange&,
63 bool keyOnly, 67 bool keyOnly,
64 blink::WebIDBCallbacks*) override; 68 blink::WebIDBCallbacks*) override;
65 void getAll(long long transactionId, 69 void getAll(long long transactionId,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 size_t max_put_value_size_ = kMaxIDBMessageSizeInBytes; 142 size_t max_put_value_size_ = kMaxIDBMessageSizeInBytes;
139 143
140 IOThreadHelper* helper_; 144 IOThreadHelper* helper_;
141 std::set<int32_t> observer_ids_; 145 std::set<int32_t> observer_ids_;
142 scoped_refptr<base::SingleThreadTaskRunner> io_runner_; 146 scoped_refptr<base::SingleThreadTaskRunner> io_runner_;
143 }; 147 };
144 148
145 } // namespace content 149 } // namespace content
146 150
147 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_ 151 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698