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 <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 Loading... |
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 Loading... |
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 } |
OLD | NEW |