OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace content { | 33 namespace content { |
34 | 34 |
35 class IndexedDBBlobInfo; | 35 class IndexedDBBlobInfo; |
36 class IndexedDBConnection; | 36 class IndexedDBConnection; |
37 class IndexedDBDatabaseCallbacks; | 37 class IndexedDBDatabaseCallbacks; |
38 class IndexedDBFactory; | 38 class IndexedDBFactory; |
39 class IndexedDBKey; | 39 class IndexedDBKey; |
40 class IndexedDBKeyPath; | 40 class IndexedDBKeyPath; |
41 class IndexedDBKeyRange; | 41 class IndexedDBKeyRange; |
| 42 class IndexedDBObservation; |
| 43 class IndexedDBObserverChanges; |
42 class IndexedDBTransaction; | 44 class IndexedDBTransaction; |
43 struct IndexedDBValue; | 45 struct IndexedDBValue; |
44 | 46 |
45 class CONTENT_EXPORT IndexedDBDatabase | 47 class CONTENT_EXPORT IndexedDBDatabase |
46 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { | 48 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { |
47 public: | 49 public: |
48 // An index and corresponding set of keys | 50 // An index and corresponding set of keys |
49 using IndexKeys = std::pair<int64_t, std::vector<IndexedDBKey>>; | 51 using IndexKeys = std::pair<int64_t, std::vector<IndexedDBKey>>; |
50 | 52 |
51 // Identifier is pair of (origin, database name). | 53 // Identifier is pair of (origin, database name). |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void TransactionCreated(IndexedDBTransaction* transaction); | 124 void TransactionCreated(IndexedDBTransaction* transaction); |
123 void TransactionFinished(IndexedDBTransaction* transaction, bool committed); | 125 void TransactionFinished(IndexedDBTransaction* transaction, bool committed); |
124 | 126 |
125 // Called by transactions to report failure committing to the backing store. | 127 // Called by transactions to report failure committing to the backing store. |
126 void TransactionCommitFailed(const leveldb::Status& status); | 128 void TransactionCommitFailed(const leveldb::Status& status); |
127 | 129 |
128 void AddPendingObserver(int64_t transaction_id, int32_t observer_id); | 130 void AddPendingObserver(int64_t transaction_id, int32_t observer_id); |
129 void RemovePendingObservers(IndexedDBConnection* connection, | 131 void RemovePendingObservers(IndexedDBConnection* connection, |
130 const std::vector<int32_t>& pending_observer_ids); | 132 const std::vector<int32_t>& pending_observer_ids); |
131 | 133 |
| 134 void FilterObservation(IndexedDBTransaction*, |
| 135 int64_t object_store_id, |
| 136 blink::WebIDBOperationType type, |
| 137 const IndexedDBKeyRange& key_range); |
| 138 void SendObservations( |
| 139 std::map<int32_t, std::unique_ptr<IndexedDBObserverChanges>> change_map); |
| 140 |
132 void Get(int64_t transaction_id, | 141 void Get(int64_t transaction_id, |
133 int64_t object_store_id, | 142 int64_t object_store_id, |
134 int64_t index_id, | 143 int64_t index_id, |
135 std::unique_ptr<IndexedDBKeyRange> key_range, | 144 std::unique_ptr<IndexedDBKeyRange> key_range, |
136 bool key_only, | 145 bool key_only, |
137 scoped_refptr<IndexedDBCallbacks> callbacks); | 146 scoped_refptr<IndexedDBCallbacks> callbacks); |
138 void GetAll(int64_t transaction_id, | 147 void GetAll(int64_t transaction_id, |
139 int64_t object_store_id, | 148 int64_t object_store_id, |
140 int64_t index_id, | 149 int64_t index_id, |
141 std::unique_ptr<IndexedDBKeyRange> key_range, | 150 std::unique_ptr<IndexedDBKeyRange> key_range, |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 324 |
316 ConnectionSet connections_; | 325 ConnectionSet connections_; |
317 bool experimental_web_platform_features_enabled_; | 326 bool experimental_web_platform_features_enabled_; |
318 | 327 |
319 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); | 328 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); |
320 }; | 329 }; |
321 | 330 |
322 } // namespace content | 331 } // namespace content |
323 | 332 |
324 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 333 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
OLD | NEW |