| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_ | |
| 6 #define CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <set> | |
| 11 | |
| 12 #include "base/memory/ref_counted.h" | |
| 13 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCursor.h" | |
| 14 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabase.h" | |
| 15 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" | |
| 16 | |
| 17 namespace blink { | |
| 18 class WebBlobInfo; | |
| 19 class WebIDBCallbacks; | |
| 20 class WebIDBDatabaseCallbacks; | |
| 21 class WebIDBObserver; | |
| 22 class WebString; | |
| 23 } | |
| 24 | |
| 25 namespace content { | |
| 26 class ThreadSafeSender; | |
| 27 | |
| 28 class WebIDBDatabaseImpl : public blink::WebIDBDatabase { | |
| 29 public: | |
| 30 WebIDBDatabaseImpl(int32_t ipc_database_id, | |
| 31 int32_t ipc_database_callbacks_id, | |
| 32 ThreadSafeSender* thread_safe_sender); | |
| 33 ~WebIDBDatabaseImpl() override; | |
| 34 | |
| 35 // blink::WebIDBDatabase | |
| 36 void createObjectStore(long long transaction_id, | |
| 37 long long objectstore_id, | |
| 38 const blink::WebString& name, | |
| 39 const blink::WebIDBKeyPath& key_path, | |
| 40 bool auto_increment) override; | |
| 41 void deleteObjectStore(long long transaction_id, | |
| 42 long long object_store_id) override; | |
| 43 void createTransaction(long long transaction_id, | |
| 44 blink::WebIDBDatabaseCallbacks* callbacks, | |
| 45 const blink::WebVector<long long>& scope, | |
| 46 blink::WebIDBTransactionMode mode) override; | |
| 47 | |
| 48 void close() override; | |
| 49 void versionChangeIgnored() override; | |
| 50 | |
| 51 int32_t addObserver(std::unique_ptr<blink::WebIDBObserver>, | |
| 52 long long transactionId) override; | |
| 53 void removeObservers( | |
| 54 const blink::WebVector<int32_t>& observer_ids_to_remove) override; | |
| 55 | |
| 56 void get(long long transactionId, | |
| 57 long long objectStoreId, | |
| 58 long long indexId, | |
| 59 const blink::WebIDBKeyRange&, | |
| 60 bool keyOnly, | |
| 61 blink::WebIDBCallbacks*) override; | |
| 62 void getAll(long long transactionId, | |
| 63 long long objectStoreId, | |
| 64 long long indexId, | |
| 65 const blink::WebIDBKeyRange&, | |
| 66 long long maxCount, | |
| 67 bool keyOnly, | |
| 68 blink::WebIDBCallbacks*) override; | |
| 69 void put(long long transactionId, | |
| 70 long long objectStoreId, | |
| 71 const blink::WebData& value, | |
| 72 const blink::WebVector<blink::WebBlobInfo>& webBlobInfo, | |
| 73 const blink::WebIDBKey&, | |
| 74 blink::WebIDBPutMode, | |
| 75 blink::WebIDBCallbacks*, | |
| 76 const blink::WebVector<long long>& indexIds, | |
| 77 const blink::WebVector<WebIndexKeys>&) override; | |
| 78 void setIndexKeys(long long transactionId, | |
| 79 long long objectStoreId, | |
| 80 const blink::WebIDBKey&, | |
| 81 const blink::WebVector<long long>& indexIds, | |
| 82 const blink::WebVector<WebIndexKeys>&) override; | |
| 83 void setIndexesReady(long long transactionId, | |
| 84 long long objectStoreId, | |
| 85 const blink::WebVector<long long>& indexIds) override; | |
| 86 void openCursor(long long transactionId, | |
| 87 long long objectStoreId, | |
| 88 long long indexId, | |
| 89 const blink::WebIDBKeyRange&, | |
| 90 blink::WebIDBCursorDirection direction, | |
| 91 bool keyOnly, | |
| 92 blink::WebIDBTaskType, | |
| 93 blink::WebIDBCallbacks*) override; | |
| 94 void count(long long transactionId, | |
| 95 long long objectStoreId, | |
| 96 long long indexId, | |
| 97 const blink::WebIDBKeyRange&, | |
| 98 blink::WebIDBCallbacks*) override; | |
| 99 void deleteRange(long long transactionId, | |
| 100 long long objectStoreId, | |
| 101 const blink::WebIDBKeyRange&, | |
| 102 blink::WebIDBCallbacks*) override; | |
| 103 void clear(long long transactionId, | |
| 104 long long objectStoreId, | |
| 105 blink::WebIDBCallbacks*) override; | |
| 106 void createIndex(long long transactionId, | |
| 107 long long objectStoreId, | |
| 108 long long indexId, | |
| 109 const blink::WebString& name, | |
| 110 const blink::WebIDBKeyPath&, | |
| 111 bool unique, | |
| 112 bool multiEntry) override; | |
| 113 void deleteIndex(long long transactionId, | |
| 114 long long objectStoreId, | |
| 115 long long indexId) override; | |
| 116 void abort(long long transaction_id) override; | |
| 117 void commit(long long transaction_id) override; | |
| 118 void ackReceivedBlobs( | |
| 119 const blink::WebVector<blink::WebString>& uuids) override; | |
| 120 | |
| 121 private: | |
| 122 int32_t ipc_database_id_; | |
| 123 int32_t ipc_database_callbacks_id_; | |
| 124 std::set<int32_t> observer_ids_; | |
| 125 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | |
| 126 }; | |
| 127 | |
| 128 } // namespace content | |
| 129 | |
| 130 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_ | |
| OLD | NEW |