| 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 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 it.GetCurrentValue()->abort(); | 1061 it.GetCurrentValue()->abort(); |
| 1062 it.Advance(); | 1062 it.Advance(); |
| 1063 } | 1063 } |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( | 1066 bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( |
| 1067 const IPC::Message& message, bool* msg_is_ok) { | 1067 const IPC::Message& message, bool* msg_is_ok) { |
| 1068 bool handled = true; | 1068 bool handled = true; |
| 1069 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::TransactionDispatcherHost, | 1069 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::TransactionDispatcherHost, |
| 1070 message, *msg_is_ok) | 1070 message, *msg_is_ok) |
| 1071 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionCommit, OnCommit) |
| 1071 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort) | 1072 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort) |
| 1072 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionMode, OnMode) | 1073 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionMode, OnMode) |
| 1073 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStore, OnObjectStore) | 1074 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStore, OnObjectStore) |
| 1074 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, | 1075 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, |
| 1075 OnDidCompleteTaskEvents) | 1076 OnDidCompleteTaskEvents) |
| 1076 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDestroyed, OnDestroyed) | 1077 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDestroyed, OnDestroyed) |
| 1077 IPC_MESSAGE_UNHANDLED(handled = false) | 1078 IPC_MESSAGE_UNHANDLED(handled = false) |
| 1078 IPC_END_MESSAGE_MAP() | 1079 IPC_END_MESSAGE_MAP() |
| 1079 return handled; | 1080 return handled; |
| 1080 } | 1081 } |
| 1081 | 1082 |
| 1082 void IndexedDBDispatcherHost::TransactionDispatcherHost::Send( | 1083 void IndexedDBDispatcherHost::TransactionDispatcherHost::Send( |
| 1083 IPC::Message* message) { | 1084 IPC::Message* message) { |
| 1084 parent_->Send(message); | 1085 parent_->Send(message); |
| 1085 } | 1086 } |
| 1086 | 1087 |
| 1088 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnCommit( |
| 1089 int32 transaction_id) { |
| 1090 WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
| 1091 &map_, transaction_id); |
| 1092 if (!idb_transaction) |
| 1093 return; |
| 1094 |
| 1095 idb_transaction->commit(); |
| 1096 } |
| 1097 |
| 1087 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( | 1098 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( |
| 1088 int32 transaction_id) { | 1099 int32 transaction_id) { |
| 1089 WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( | 1100 WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( |
| 1090 &map_, transaction_id); | 1101 &map_, transaction_id); |
| 1091 if (!idb_transaction) | 1102 if (!idb_transaction) |
| 1092 return; | 1103 return; |
| 1093 | 1104 |
| 1094 idb_transaction->abort(); | 1105 idb_transaction->abort(); |
| 1095 } | 1106 } |
| 1096 | 1107 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 } | 1147 } |
| 1137 idb_transaction->didCompleteTaskEvents(); | 1148 idb_transaction->didCompleteTaskEvents(); |
| 1138 } | 1149 } |
| 1139 | 1150 |
| 1140 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( | 1151 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( |
| 1141 int32 object_id) { | 1152 int32 object_id) { |
| 1142 transaction_size_map_.erase(object_id); | 1153 transaction_size_map_.erase(object_id); |
| 1143 transaction_url_map_.erase(object_id); | 1154 transaction_url_map_.erase(object_id); |
| 1144 parent_->DestroyObject(&map_, object_id); | 1155 parent_->DestroyObject(&map_, object_id); |
| 1145 } | 1156 } |
| OLD | NEW |