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 |
11 #include <list> | 11 #include <list> |
12 #include <map> | 12 #include <map> |
13 #include <queue> | 13 #include <queue> |
14 #include <string> | 14 #include <string> |
15 #include <utility> | 15 #include <utility> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
20 #include "content/browser/indexed_db/indexed_db.h" | 20 #include "content/browser/indexed_db/indexed_db.h" |
21 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 21 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
22 #include "content/browser/indexed_db/indexed_db_callbacks.h" | 22 #include "content/browser/indexed_db/indexed_db_callbacks.h" |
23 #include "content/browser/indexed_db/indexed_db_metadata.h" | 23 #include "content/browser/indexed_db/indexed_db_metadata.h" |
| 24 #include "content/browser/indexed_db/indexed_db_observer_changes.h" |
24 #include "content/browser/indexed_db/indexed_db_pending_connection.h" | 25 #include "content/browser/indexed_db/indexed_db_pending_connection.h" |
25 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h" | 26 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h" |
26 #include "content/browser/indexed_db/list_set.h" | 27 #include "content/browser/indexed_db/list_set.h" |
| 28 #include "content/common/indexed_db/indexed_db_observation.h" |
27 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" | 29 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
28 | 30 |
29 namespace url { | 31 namespace url { |
30 class Origin; | 32 class Origin; |
31 } | 33 } |
32 | 34 |
33 namespace content { | 35 namespace content { |
34 | 36 |
35 class IndexedDBBlobInfo; | 37 class IndexedDBBlobInfo; |
36 class IndexedDBConnection; | 38 class IndexedDBConnection; |
37 class IndexedDBDatabaseCallbacks; | 39 class IndexedDBDatabaseCallbacks; |
38 class IndexedDBFactory; | 40 class IndexedDBFactory; |
39 class IndexedDBKey; | 41 class IndexedDBKey; |
40 class IndexedDBKeyPath; | 42 class IndexedDBKeyPath; |
41 class IndexedDBKeyRange; | 43 class IndexedDBKeyRange; |
| 44 class IndexedDBObservation; |
42 class IndexedDBTransaction; | 45 class IndexedDBTransaction; |
43 struct IndexedDBValue; | 46 struct IndexedDBValue; |
44 | 47 |
45 class CONTENT_EXPORT IndexedDBDatabase | 48 class CONTENT_EXPORT IndexedDBDatabase |
46 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { | 49 : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBDatabase>) { |
47 public: | 50 public: |
48 // An index and corresponding set of keys | 51 // An index and corresponding set of keys |
49 using IndexKeys = std::pair<int64_t, std::vector<IndexedDBKey>>; | 52 using IndexKeys = std::pair<int64_t, std::vector<IndexedDBKey>>; |
50 | 53 |
51 // Identifier is pair of (origin, database name). | 54 // 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); | 125 void TransactionCreated(IndexedDBTransaction* transaction); |
123 void TransactionFinished(IndexedDBTransaction* transaction, bool committed); | 126 void TransactionFinished(IndexedDBTransaction* transaction, bool committed); |
124 | 127 |
125 // Called by transactions to report failure committing to the backing store. | 128 // Called by transactions to report failure committing to the backing store. |
126 void TransactionCommitFailed(const leveldb::Status& status); | 129 void TransactionCommitFailed(const leveldb::Status& status); |
127 | 130 |
128 void AddPendingObserver(int64_t transaction_id, int32_t observer_id); | 131 void AddPendingObserver(int64_t transaction_id, int32_t observer_id); |
129 void RemovePendingObservers(IndexedDBConnection* connection, | 132 void RemovePendingObservers(IndexedDBConnection* connection, |
130 const std::vector<int32_t>& pending_observer_ids); | 133 const std::vector<int32_t>& pending_observer_ids); |
131 | 134 |
| 135 void FilterObservation(IndexedDBTransaction*, |
| 136 int64_t object_store_id, |
| 137 IndexedDBObservation::OperationType, |
| 138 const IndexedDBKeyRange&); |
| 139 void SendObservations( |
| 140 std::map<int32_t, std::unique_ptr<IndexedDBObserverChanges>> change_map); |
| 141 |
132 void Get(int64_t transaction_id, | 142 void Get(int64_t transaction_id, |
133 int64_t object_store_id, | 143 int64_t object_store_id, |
134 int64_t index_id, | 144 int64_t index_id, |
135 std::unique_ptr<IndexedDBKeyRange> key_range, | 145 std::unique_ptr<IndexedDBKeyRange> key_range, |
136 bool key_only, | 146 bool key_only, |
137 scoped_refptr<IndexedDBCallbacks> callbacks); | 147 scoped_refptr<IndexedDBCallbacks> callbacks); |
138 void GetAll(int64_t transaction_id, | 148 void GetAll(int64_t transaction_id, |
139 int64_t object_store_id, | 149 int64_t object_store_id, |
140 int64_t index_id, | 150 int64_t index_id, |
141 std::unique_ptr<IndexedDBKeyRange> key_range, | 151 std::unique_ptr<IndexedDBKeyRange> key_range, |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 325 |
316 ConnectionSet connections_; | 326 ConnectionSet connections_; |
317 bool experimental_web_platform_features_enabled_; | 327 bool experimental_web_platform_features_enabled_; |
318 | 328 |
319 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); | 329 DISALLOW_COPY_AND_ASSIGN(IndexedDBDatabase); |
320 }; | 330 }; |
321 | 331 |
322 } // namespace content | 332 } // namespace content |
323 | 333 |
324 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ | 334 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_DATABASE_H_ |
OLD | NEW |