OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 5 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" | 10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 &map_, params.idb_object_store_id); | 704 &map_, params.idb_object_store_id); |
705 WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( | 705 WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
706 &parent_->transaction_dispatcher_host_->map_, params.transaction_id); | 706 &parent_->transaction_dispatcher_host_->map_, params.transaction_id); |
707 if (!idb_transaction || !idb_object_store) | 707 if (!idb_transaction || !idb_object_store) |
708 return; | 708 return; |
709 | 709 |
710 *ec = 0; | 710 *ec = 0; |
711 scoped_ptr<WebIDBCallbacks> callbacks( | 711 scoped_ptr<WebIDBCallbacks> callbacks( |
712 new IndexedDBCallbacks<WebIDBKey>(parent_, params.thread_id, | 712 new IndexedDBCallbacks<WebIDBKey>(parent_, params.thread_id, |
713 params.response_id)); | 713 params.response_id)); |
714 // TODO(alecflett): switch to putWithIndexKeys when available. | 714 idb_object_store->putWithIndexKeys(params.serialized_value, params.key, |
715 idb_object_store->put(params.serialized_value, params.key, params.put_mode, | 715 params.put_mode, callbacks.release(), |
716 callbacks.release(), *idb_transaction, *ec); | 716 *idb_transaction, params.index_names, |
| 717 params.index_keys, *ec); |
717 if (*ec) | 718 if (*ec) |
718 return; | 719 return; |
719 int64 size = UTF16ToUTF8(params.serialized_value.data()).size(); | 720 int64 size = UTF16ToUTF8(params.serialized_value.data()).size(); |
720 WebIDBTransactionIDToSizeMap* map = | 721 WebIDBTransactionIDToSizeMap* map = |
721 &parent_->transaction_dispatcher_host_->transaction_size_map_; | 722 &parent_->transaction_dispatcher_host_->transaction_size_map_; |
722 (*map)[params.transaction_id] += size; | 723 (*map)[params.transaction_id] += size; |
723 } | 724 } |
724 | 725 |
725 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDelete( | 726 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDelete( |
726 int idb_object_store_id, | 727 int idb_object_store_id, |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 } | 1139 } |
1139 idb_transaction->didCompleteTaskEvents(); | 1140 idb_transaction->didCompleteTaskEvents(); |
1140 } | 1141 } |
1141 | 1142 |
1142 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( | 1143 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( |
1143 int32 object_id) { | 1144 int32 object_id) { |
1144 transaction_size_map_.erase(object_id); | 1145 transaction_size_map_.erase(object_id); |
1145 transaction_url_map_.erase(object_id); | 1146 transaction_url_map_.erase(object_id); |
1146 parent_->DestroyObject(&map_, object_id); | 1147 parent_->DestroyObject(&map_, object_id); |
1147 } | 1148 } |
OLD | NEW |