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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 thread_safe_sender_->Send( | 71 thread_safe_sender_->Send( |
72 new IndexedDBHostMsg_DatabaseCreateObjectStore(params)); | 72 new IndexedDBHostMsg_DatabaseCreateObjectStore(params)); |
73 } | 73 } |
74 | 74 |
75 void WebIDBDatabaseImpl::deleteObjectStore(long long transaction_id, | 75 void WebIDBDatabaseImpl::deleteObjectStore(long long transaction_id, |
76 long long object_store_id) { | 76 long long object_store_id) { |
77 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseDeleteObjectStore( | 77 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseDeleteObjectStore( |
78 ipc_database_id_, transaction_id, object_store_id)); | 78 ipc_database_id_, transaction_id, object_store_id)); |
79 } | 79 } |
80 | 80 |
| 81 void WebIDBDatabaseImpl::renameObjectStore(long long transaction_id, |
| 82 long long object_store_id, |
| 83 const blink::WebString& new_name) { |
| 84 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseRenameObjectStore( |
| 85 ipc_database_id_, transaction_id, object_store_id, new_name)); |
| 86 } |
| 87 |
81 void WebIDBDatabaseImpl::createTransaction( | 88 void WebIDBDatabaseImpl::createTransaction( |
82 long long transaction_id, | 89 long long transaction_id, |
83 WebIDBDatabaseCallbacks* callbacks, | 90 WebIDBDatabaseCallbacks* callbacks, |
84 const WebVector<long long>& object_store_ids, | 91 const WebVector<long long>& object_store_ids, |
85 blink::WebIDBTransactionMode mode) { | 92 blink::WebIDBTransactionMode mode) { |
86 IndexedDBDispatcher* dispatcher = | 93 IndexedDBDispatcher* dispatcher = |
87 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 94 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
88 dispatcher->RequestIDBDatabaseCreateTransaction( | 95 dispatcher->RequestIDBDatabaseCreateTransaction( |
89 ipc_database_id_, transaction_id, callbacks, object_store_ids, mode); | 96 ipc_database_id_, transaction_id, callbacks, object_store_ids, mode); |
90 } | 97 } |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseCreateIndex(params)); | 308 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseCreateIndex(params)); |
302 } | 309 } |
303 | 310 |
304 void WebIDBDatabaseImpl::deleteIndex(long long transaction_id, | 311 void WebIDBDatabaseImpl::deleteIndex(long long transaction_id, |
305 long long object_store_id, | 312 long long object_store_id, |
306 long long index_id) { | 313 long long index_id) { |
307 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseDeleteIndex( | 314 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseDeleteIndex( |
308 ipc_database_id_, transaction_id, object_store_id, index_id)); | 315 ipc_database_id_, transaction_id, object_store_id, index_id)); |
309 } | 316 } |
310 | 317 |
| 318 void WebIDBDatabaseImpl::renameIndex(long long transaction_id, |
| 319 long long object_store_id, |
| 320 long long index_id, |
| 321 const WebString& new_name) { |
| 322 thread_safe_sender_->Send(new IndexedDBHostMsg_DatabaseRenameIndex( |
| 323 ipc_database_id_, transaction_id, object_store_id, index_id, new_name)); |
| 324 } |
| 325 |
311 void WebIDBDatabaseImpl::abort(long long transaction_id) { | 326 void WebIDBDatabaseImpl::abort(long long transaction_id) { |
312 thread_safe_sender_->Send( | 327 thread_safe_sender_->Send( |
313 new IndexedDBHostMsg_DatabaseAbort(ipc_database_id_, transaction_id)); | 328 new IndexedDBHostMsg_DatabaseAbort(ipc_database_id_, transaction_id)); |
314 } | 329 } |
315 | 330 |
316 void WebIDBDatabaseImpl::commit(long long transaction_id) { | 331 void WebIDBDatabaseImpl::commit(long long transaction_id) { |
317 thread_safe_sender_->Send( | 332 thread_safe_sender_->Send( |
318 new IndexedDBHostMsg_DatabaseCommit(ipc_database_id_, transaction_id)); | 333 new IndexedDBHostMsg_DatabaseCommit(ipc_database_id_, transaction_id)); |
319 } | 334 } |
320 | 335 |
321 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) { | 336 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) { |
322 DCHECK(uuids.size()); | 337 DCHECK(uuids.size()); |
323 std::vector<std::string> param(uuids.size()); | 338 std::vector<std::string> param(uuids.size()); |
324 for (size_t i = 0; i < uuids.size(); ++i) | 339 for (size_t i = 0; i < uuids.size(); ++i) |
325 param[i] = uuids[i].latin1().data(); | 340 param[i] = uuids[i].latin1().data(); |
326 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param)); | 341 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param)); |
327 } | 342 } |
328 | 343 |
329 } // namespace content | 344 } // namespace content |
OLD | NEW |