Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc

Issue 10786043: call putWithIndexKeys from chrome (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/common/indexed_db/indexed_db_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | content/common/indexed_db/indexed_db_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698