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

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

Issue 10854081: IndexedDB: Simplify cursor data callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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/in_process_webkit/indexed_db_dispatcher_host.h" 5 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 IPC_END_MESSAGE_MAP() 885 IPC_END_MESSAGE_MAP()
886 return handled; 886 return handled;
887 } 887 }
888 888
889 889
890 void IndexedDBDispatcherHost::CursorDispatcherHost::Send( 890 void IndexedDBDispatcherHost::CursorDispatcherHost::Send(
891 IPC::Message* message) { 891 IPC::Message* message) {
892 parent_->Send(message); 892 parent_->Send(message);
893 } 893 }
894 894
895 // TODO(jsbell): Remove this after WK92278 rolls.
896 void IndexedDBDispatcherHost::CursorDispatcherHost::OnKey(
897 int32 object_id, IndexedDBKey* key) {
898 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, object_id);
899 if (!idb_cursor)
900 return;
901
902 *key = IndexedDBKey(idb_cursor->key());
903 }
904
905 // TODO(jsbell): Remove this after WK92278 rolls.
906 void IndexedDBDispatcherHost::CursorDispatcherHost::OnPrimaryKey(
907 int32 object_id, IndexedDBKey* primary_key) {
908 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, object_id);
909 if (!idb_cursor)
910 return;
911
912 *primary_key = IndexedDBKey(idb_cursor->primaryKey());
913 }
914
915 // TODO(jsbell): Remove this after WK92278 rolls.
916 void IndexedDBDispatcherHost::CursorDispatcherHost::OnValue(
917 int32 object_id,
918 SerializedScriptValue* script_value) {
919 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, object_id);
920 if (!idb_cursor)
921 return;
922
923 *script_value = SerializedScriptValue(idb_cursor->value());
924 }
925 895
926 void IndexedDBDispatcherHost::CursorDispatcherHost::OnAdvance( 896 void IndexedDBDispatcherHost::CursorDispatcherHost::OnAdvance(
927 int32 cursor_id, 897 int32 cursor_id,
928 int32 thread_id, 898 int32 thread_id,
929 int32 response_id, 899 int32 response_id,
930 unsigned long count, 900 unsigned long count,
931 WebKit::WebExceptionCode* ec) { 901 WebKit::WebExceptionCode* ec) {
932 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); 902 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
933 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); 903 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id);
934 if (!idb_cursor) 904 if (!idb_cursor)
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 } 1071 }
1102 1072
1103 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( 1073 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed(
1104 int32 object_id) { 1074 int32 object_id) {
1105 // TODO(dgrogan): This doesn't seem to be happening with some version change 1075 // TODO(dgrogan): This doesn't seem to be happening with some version change
1106 // transactions. Possibly introduced with integer version support. 1076 // transactions. Possibly introduced with integer version support.
1107 transaction_size_map_.erase(object_id); 1077 transaction_size_map_.erase(object_id);
1108 transaction_url_map_.erase(object_id); 1078 transaction_url_map_.erase(object_id);
1109 parent_->DestroyObject(&map_, object_id); 1079 parent_->DestroyObject(&map_, object_id);
1110 } 1080 }
OLDNEW
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_dispatcher_host.h ('k') | content/common/indexed_db/indexed_db_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698