| 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 #include "content/child/indexed_db/webidbdatabase_impl.h" | 5 #include "content/child/indexed_db/webidbdatabase_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 10 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void WebIDBDatabaseImpl::deleteObjectStore(long long transaction_id, | 71 void WebIDBDatabaseImpl::deleteObjectStore(long long transaction_id, |
| 72 long long object_store_id) { | 72 long long object_store_id) { |
| 73 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseDeleteObjectStore( | 73 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseDeleteObjectStore( |
| 74 ipc_database_id_, transaction_id, object_store_id)); | 74 ipc_database_id_, transaction_id, object_store_id)); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void WebIDBDatabaseImpl::createTransaction( | 77 void WebIDBDatabaseImpl::createTransaction( |
| 78 long long transaction_id, | 78 long long transaction_id, |
| 79 WebIDBDatabaseCallbacks* callbacks, | 79 WebIDBDatabaseCallbacks* callbacks, |
| 80 const WebVector<long long>& object_store_ids, | 80 const WebVector<long long>& object_store_ids, |
| 81 WebIDBDatabase::TransactionMode mode) { | 81 blink::WebIDBTransactionMode mode) { |
| 82 IndexedDBDispatcher* dispatcher = | 82 IndexedDBDispatcher* dispatcher = |
| 83 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 83 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 84 dispatcher->RequestIDBDatabaseCreateTransaction( | 84 dispatcher->RequestIDBDatabaseCreateTransaction( |
| 85 ipc_database_id_, transaction_id, callbacks, object_store_ids, mode); | 85 ipc_database_id_, transaction_id, callbacks, object_store_ids, mode); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void WebIDBDatabaseImpl::close() { | 88 void WebIDBDatabaseImpl::close() { |
| 89 IndexedDBDispatcher* dispatcher = | 89 IndexedDBDispatcher* dispatcher = |
| 90 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 90 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 91 dispatcher->RequestIDBDatabaseClose(ipc_database_id_, | 91 dispatcher->RequestIDBDatabaseClose(ipc_database_id_, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 107 IndexedDBKeyRangeBuilder::Build(key_range), | 107 IndexedDBKeyRangeBuilder::Build(key_range), |
| 108 key_only, | 108 key_only, |
| 109 callbacks); | 109 callbacks); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void WebIDBDatabaseImpl::put(long long transaction_id, | 112 void WebIDBDatabaseImpl::put(long long transaction_id, |
| 113 long long object_store_id, | 113 long long object_store_id, |
| 114 const blink::WebData& value, | 114 const blink::WebData& value, |
| 115 const blink::WebVector<WebBlobInfo>& web_blob_info, | 115 const blink::WebVector<WebBlobInfo>& web_blob_info, |
| 116 const WebIDBKey& key, | 116 const WebIDBKey& key, |
| 117 PutMode put_mode, | 117 blink::WebIDBPutMode put_mode, |
| 118 WebIDBCallbacks* callbacks, | 118 WebIDBCallbacks* callbacks, |
| 119 const WebVector<long long>& web_index_ids, | 119 const WebVector<long long>& web_index_ids, |
| 120 const WebVector<WebIndexKeys>& web_index_keys) { | 120 const WebVector<WebIndexKeys>& web_index_keys) { |
| 121 IndexedDBDispatcher* dispatcher = | 121 IndexedDBDispatcher* dispatcher = |
| 122 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 122 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 123 dispatcher->RequestIDBDatabasePut(ipc_database_id_, | 123 dispatcher->RequestIDBDatabasePut(ipc_database_id_, |
| 124 transaction_id, | 124 transaction_id, |
| 125 object_store_id, | 125 object_store_id, |
| 126 value, | 126 value, |
| 127 web_blob_info, | 127 web_blob_info, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 std::vector<int64> index_ids(web_index_ids.data(), | 165 std::vector<int64> index_ids(web_index_ids.data(), |
| 166 web_index_ids.data() + web_index_ids.size()); | 166 web_index_ids.data() + web_index_ids.size()); |
| 167 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseSetIndexesReady( | 167 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseSetIndexesReady( |
| 168 ipc_database_id_, transaction_id, object_store_id, index_ids)); | 168 ipc_database_id_, transaction_id, object_store_id, index_ids)); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void WebIDBDatabaseImpl::openCursor(long long transaction_id, | 171 void WebIDBDatabaseImpl::openCursor(long long transaction_id, |
| 172 long long object_store_id, | 172 long long object_store_id, |
| 173 long long index_id, | 173 long long index_id, |
| 174 const WebIDBKeyRange& key_range, | 174 const WebIDBKeyRange& key_range, |
| 175 WebIDBCursor::Direction direction, | 175 blink::WebIDBCursorDirection direction, |
| 176 bool key_only, | 176 bool key_only, |
| 177 TaskType task_type, | 177 blink::WebIDBTaskType task_type, |
| 178 WebIDBCallbacks* callbacks) { | 178 WebIDBCallbacks* callbacks) { |
| 179 IndexedDBDispatcher* dispatcher = | 179 IndexedDBDispatcher* dispatcher = |
| 180 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 180 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 181 dispatcher->RequestIDBDatabaseOpenCursor( | 181 dispatcher->RequestIDBDatabaseOpenCursor( |
| 182 ipc_database_id_, | 182 ipc_database_id_, |
| 183 transaction_id, | 183 transaction_id, |
| 184 object_store_id, | 184 object_store_id, |
| 185 index_id, | 185 index_id, |
| 186 IndexedDBKeyRangeBuilder::Build(key_range), | 186 IndexedDBKeyRangeBuilder::Build(key_range), |
| 187 direction, | 187 direction, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) { | 269 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) { |
| 270 DCHECK(uuids.size()); | 270 DCHECK(uuids.size()); |
| 271 std::vector<std::string> param(uuids.size()); | 271 std::vector<std::string> param(uuids.size()); |
| 272 for (size_t i = 0; i < uuids.size(); ++i) | 272 for (size_t i = 0; i < uuids.size(); ++i) |
| 273 param[i] = uuids[i].latin1().data(); | 273 param[i] = uuids[i].latin1().data(); |
| 274 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param)); | 274 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param)); |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace content | 277 } // namespace content |
| OLD | NEW |