Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCursor.h" | 11 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCursor.h" |
| 12 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabase.h" | 12 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabase.h" |
| 13 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" | 13 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 class WebBlobInfo; | 16 class WebBlobInfo; |
| 17 class WebIDBCallbacks; | 17 class WebIDBCallbacks; |
| 18 class WebIDBDatabaseCallbacks; | 18 class WebIDBDatabaseCallbacks; |
| 19 class WebIDBObserver; | |
| 19 class WebString; | 20 class WebString; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace content { | 23 namespace content { |
| 23 class ThreadSafeSender; | 24 class ThreadSafeSender; |
| 24 | 25 |
| 25 class WebIDBDatabaseImpl : public blink::WebIDBDatabase { | 26 class WebIDBDatabaseImpl : public blink::WebIDBDatabase { |
| 26 public: | 27 public: |
| 27 WebIDBDatabaseImpl(int32_t ipc_database_id, | 28 WebIDBDatabaseImpl(int32_t ipc_database_id, |
| 28 int32_t ipc_database_callbacks_id, | 29 int32_t ipc_database_callbacks_id, |
| 29 ThreadSafeSender* thread_safe_sender); | 30 ThreadSafeSender* thread_safe_sender); |
| 30 ~WebIDBDatabaseImpl() override; | 31 ~WebIDBDatabaseImpl() override; |
| 31 | 32 |
| 32 // blink::WebIDBDatabase | 33 // blink::WebIDBDatabase |
| 33 void createObjectStore(long long transaction_id, | 34 void createObjectStore(long long transaction_id, |
| 34 long long objectstore_id, | 35 long long objectstore_id, |
| 35 const blink::WebString& name, | 36 const blink::WebString& name, |
| 36 const blink::WebIDBKeyPath& key_path, | 37 const blink::WebIDBKeyPath& key_path, |
| 37 bool auto_increment) override; | 38 bool auto_increment) override; |
| 38 void deleteObjectStore(long long transaction_id, | 39 void deleteObjectStore(long long transaction_id, |
| 39 long long object_store_id) override; | 40 long long object_store_id) override; |
| 40 void createTransaction(long long transaction_id, | 41 void createTransaction(long long transaction_id, |
| 41 blink::WebIDBDatabaseCallbacks* callbacks, | 42 blink::WebIDBDatabaseCallbacks* callbacks, |
| 42 const blink::WebVector<long long>& scope, | 43 const blink::WebVector<long long>& scope, |
| 43 blink::WebIDBTransactionMode mode) override; | 44 blink::WebIDBTransactionMode mode) override; |
| 44 | 45 |
| 45 void close() override; | 46 void close() override; |
| 46 void versionChangeIgnored() override; | 47 void versionChangeIgnored() override; |
| 47 | 48 |
| 49 int32_t addObserver(blink::WebIDBObserver*, long long transactionId) override; | |
| 50 bool containsObserverId(int32_t id) override; | |
|
cmumford
2016/06/28 20:26:23
make method const.
palakj1
2016/06/29 23:02:41
Done.
| |
| 51 void removeObservers( | |
| 52 const std::vector<int32_t>& observer_ids_to_remove) override; | |
| 53 | |
| 48 void get(long long transactionId, | 54 void get(long long transactionId, |
| 49 long long objectStoreId, | 55 long long objectStoreId, |
| 50 long long indexId, | 56 long long indexId, |
| 51 const blink::WebIDBKeyRange&, | 57 const blink::WebIDBKeyRange&, |
| 52 bool keyOnly, | 58 bool keyOnly, |
| 53 blink::WebIDBCallbacks*) override; | 59 blink::WebIDBCallbacks*) override; |
| 54 void getAll(long long transactionId, | 60 void getAll(long long transactionId, |
| 55 long long objectStoreId, | 61 long long objectStoreId, |
| 56 long long indexId, | 62 long long indexId, |
| 57 const blink::WebIDBKeyRange&, | 63 const blink::WebIDBKeyRange&, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 long long objectStoreId, | 112 long long objectStoreId, |
| 107 long long indexId) override; | 113 long long indexId) override; |
| 108 void abort(long long transaction_id) override; | 114 void abort(long long transaction_id) override; |
| 109 void commit(long long transaction_id) override; | 115 void commit(long long transaction_id) override; |
| 110 void ackReceivedBlobs( | 116 void ackReceivedBlobs( |
| 111 const blink::WebVector<blink::WebString>& uuids) override; | 117 const blink::WebVector<blink::WebString>& uuids) override; |
| 112 | 118 |
| 113 private: | 119 private: |
| 114 int32_t ipc_database_id_; | 120 int32_t ipc_database_id_; |
| 115 int32_t ipc_database_callbacks_id_; | 121 int32_t ipc_database_callbacks_id_; |
| 122 std::set<int32_t> observer_ids_; | |
| 116 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 123 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 117 }; | 124 }; |
| 118 | 125 |
| 119 } // namespace content | 126 } // namespace content |
| 120 | 127 |
| 121 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_ | 128 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_ |
| OLD | NEW |