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

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

Issue 320833002: [IndexedDB] Use consistent enums on both sides of IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments. Created 6 years, 6 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
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/indexed_db/indexed_db_dispatcher_host.h" 5 #include "content/browser/indexed_db/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/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 // TODO(alecflett): Avoid a copy here. 659 // TODO(alecflett): Avoid a copy here.
660 IndexedDBValue value; 660 IndexedDBValue value;
661 value.bits = params.value; 661 value.bits = params.value;
662 value.blob_info.swap(blob_info); 662 value.blob_info.swap(blob_info);
663 connection->database()->Put( 663 connection->database()->Put(
664 host_transaction_id, 664 host_transaction_id,
665 params.object_store_id, 665 params.object_store_id,
666 &value, 666 &value,
667 &scoped_handles, 667 &scoped_handles,
668 make_scoped_ptr(new IndexedDBKey(params.key)), 668 make_scoped_ptr(new IndexedDBKey(params.key)),
669 static_cast<IndexedDBDatabase::PutMode>(params.put_mode), 669 static_cast<blink::WebIDBPutMode>(params.put_mode),
jsbell 2014/06/11 16:42:02 This static_cast should no longer be necessary.
Pritam Nikam 2014/06/12 11:19:20 Done.
670 callbacks, 670 callbacks,
671 params.index_keys); 671 params.index_keys);
672 TransactionIDToSizeMap* map = 672 TransactionIDToSizeMap* map =
673 &parent_->database_dispatcher_host_->transaction_size_map_; 673 &parent_->database_dispatcher_host_->transaction_size_map_;
674 // Size can't be big enough to overflow because it represents the 674 // Size can't be big enough to overflow because it represents the
675 // actual bytes passed through IPC. 675 // actual bytes passed through IPC.
676 (*map)[host_transaction_id] += params.value.size(); 676 (*map)[host_transaction_id] += params.value.size();
677 } 677 }
678 678
679 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnSetIndexKeys( 679 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnSetIndexKeys(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 if (!connection || !connection->IsConnected()) 718 if (!connection || !connection->IsConnected())
719 return; 719 return;
720 720
721 scoped_refptr<IndexedDBCallbacks> callbacks(new IndexedDBCallbacks( 721 scoped_refptr<IndexedDBCallbacks> callbacks(new IndexedDBCallbacks(
722 parent_, params.ipc_thread_id, params.ipc_callbacks_id, -1)); 722 parent_, params.ipc_thread_id, params.ipc_callbacks_id, -1));
723 connection->database()->OpenCursor( 723 connection->database()->OpenCursor(
724 parent_->HostTransactionId(params.transaction_id), 724 parent_->HostTransactionId(params.transaction_id),
725 params.object_store_id, 725 params.object_store_id,
726 params.index_id, 726 params.index_id,
727 make_scoped_ptr(new IndexedDBKeyRange(params.key_range)), 727 make_scoped_ptr(new IndexedDBKeyRange(params.key_range)),
728 static_cast<indexed_db::CursorDirection>(params.direction), 728 static_cast<blink::WebIDBCursorDirection>(params.direction),
jsbell 2014/06/11 16:42:01 This static_cast should no longer be necessary.
Pritam Nikam 2014/06/12 11:19:20 Done.
729 params.key_only, 729 params.key_only,
730 static_cast<IndexedDBDatabase::TaskType>(params.task_type), 730 static_cast<blink::WebIDBTaskType>(params.task_type),
jsbell 2014/06/11 16:42:01 This static_cast should no longer be necessary.
Pritam Nikam 2014/06/12 11:19:20 Done.
731 callbacks); 731 callbacks);
732 } 732 }
733 733
734 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCount( 734 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCount(
735 const IndexedDBHostMsg_DatabaseCount_Params& params) { 735 const IndexedDBHostMsg_DatabaseCount_Params& params) {
736 DCHECK( 736 DCHECK(
737 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 737 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
738 IndexedDBConnection* connection = 738 IndexedDBConnection* connection =
739 parent_->GetOrTerminateProcess(&map_, params.ipc_database_id); 739 parent_->GetOrTerminateProcess(&map_, params.ipc_database_id);
740 if (!connection || !connection->IsConnected()) 740 if (!connection || !connection->IsConnected())
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 } 975 }
976 976
977 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( 977 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed(
978 int32 ipc_object_id) { 978 int32 ipc_object_id) {
979 DCHECK( 979 DCHECK(
980 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 980 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
981 parent_->DestroyObject(&map_, ipc_object_id); 981 parent_->DestroyObject(&map_, ipc_object_id);
982 } 982 }
983 983
984 } // namespace content 984 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698