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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 } | 678 } |
679 | 679 |
680 bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived( | 680 bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived( |
681 const IPC::Message& message, bool* msg_is_ok) { | 681 const IPC::Message& message, bool* msg_is_ok) { |
682 bool handled = true; | 682 bool handled = true; |
683 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::ObjectStoreDispatcherHost, | 683 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::ObjectStoreDispatcherHost, |
684 message, *msg_is_ok) | 684 message, *msg_is_ok) |
685 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreName, OnName) | 685 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreName, OnName) |
686 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreKeyPath, OnKeyPath) | 686 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreKeyPath, OnKeyPath) |
687 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndexNames, OnIndexNames) | 687 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndexNames, OnIndexNames) |
| 688 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreAutoIncrement, |
| 689 OnAutoIncrement) |
688 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGet, OnGet) | 690 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGet, OnGet) |
689 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePut, OnPut) | 691 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePut, OnPut) |
690 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDelete, OnDelete) | 692 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDelete, OnDelete) |
691 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDeleteRange, OnDeleteRange) | 693 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDeleteRange, OnDeleteRange) |
692 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreClear, OnClear) | 694 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreClear, OnClear) |
693 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreCreateIndex, OnCreateIndex) | 695 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreCreateIndex, OnCreateIndex) |
694 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndex, OnIndex) | 696 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndex, OnIndex) |
695 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDeleteIndex, OnDeleteIndex) | 697 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDeleteIndex, OnDeleteIndex) |
696 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreOpenCursor, OnOpenCursor) | 698 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreOpenCursor, OnOpenCursor) |
697 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreCount, OnCount) | 699 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreCount, OnCount) |
(...skipping 30 matching lines...) Expand all Loading... |
728 &map_, idb_object_store_id); | 730 &map_, idb_object_store_id); |
729 if (!idb_object_store) | 731 if (!idb_object_store) |
730 return; | 732 return; |
731 | 733 |
732 WebDOMStringList web_index_names = idb_object_store->indexNames(); | 734 WebDOMStringList web_index_names = idb_object_store->indexNames(); |
733 index_names->reserve(web_index_names.length()); | 735 index_names->reserve(web_index_names.length()); |
734 for (unsigned i = 0; i < web_index_names.length(); ++i) | 736 for (unsigned i = 0; i < web_index_names.length(); ++i) |
735 index_names->push_back(web_index_names.item(i)); | 737 index_names->push_back(web_index_names.item(i)); |
736 } | 738 } |
737 | 739 |
| 740 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnAutoIncrement( |
| 741 int32 idb_object_store_id, bool* auto_increment) { |
| 742 parent_->SyncGetter<bool>(&map_, idb_object_store_id, auto_increment, |
| 743 &WebIDBObjectStore::autoIncrement); |
| 744 } |
| 745 |
738 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet( | 746 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet( |
739 int idb_object_store_id, | 747 int idb_object_store_id, |
740 int32 thread_id, | 748 int32 thread_id, |
741 int32 response_id, | 749 int32 response_id, |
742 const IndexedDBKeyRange& key_range, | 750 const IndexedDBKeyRange& key_range, |
743 int32 transaction_id, | 751 int32 transaction_id, |
744 WebKit::WebExceptionCode* ec) { | 752 WebKit::WebExceptionCode* ec) { |
745 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); | 753 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
746 WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( | 754 WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( |
747 &map_, idb_object_store_id); | 755 &map_, idb_object_store_id); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 } | 1228 } |
1221 idb_transaction->didCompleteTaskEvents(); | 1229 idb_transaction->didCompleteTaskEvents(); |
1222 } | 1230 } |
1223 | 1231 |
1224 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( | 1232 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( |
1225 int32 object_id) { | 1233 int32 object_id) { |
1226 transaction_size_map_.erase(object_id); | 1234 transaction_size_map_.erase(object_id); |
1227 transaction_url_map_.erase(object_id); | 1235 transaction_url_map_.erase(object_id); |
1228 parent_->DestroyObject(&map_, object_id); | 1236 parent_->DestroyObject(&map_, object_id); |
1229 } | 1237 } |
OLD | NEW |