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