diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-03 12:15:15 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-03 12:15:15 +0000 |
commit | 1e2de5528ddbe6d24d960841b4a8ccda5172599a (patch) | |
tree | 75f181694bee9fcaf56b048cae0b1c4f387ac736 /chrome/browser/in_process_webkit | |
parent | 0ea69ad73a7aa11efcb1e0e13dcf29753381ad50 (diff) | |
download | chromium_src-1e2de5528ddbe6d24d960841b4a8ccda5172599a.zip chromium_src-1e2de5528ddbe6d24d960841b4a8ccda5172599a.tar.gz chromium_src-1e2de5528ddbe6d24d960841b4a8ccda5172599a.tar.bz2 |
Fix various issues with DOMStorage that only showed up in multi-process mode.
We need to beef up our automated test coverage before we come out from behind a flag,
but in the mean time, let's fix these known issues.
TEST=All the layout tests work in multi-process mode.
BUG=none
Review URL: http://codereview.chromium.org/3294002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58482 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/in_process_webkit')
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc | 46 | ||||
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h | 8 |
2 files changed, 53 insertions, 1 deletions
diff --git a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc index dadebf0..52ee4a8 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -10,6 +10,7 @@ #include "chrome/browser/renderer_host/browser_render_process_host.h" #include "chrome/browser/renderer_host/resource_message_filter.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/indexed_db_key.h" #include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" #include "chrome/common/serialized_script_value.h" @@ -98,6 +99,9 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) { case ViewHostMsg_IDBCursorDirection::ID: case ViewHostMsg_IDBCursorKey::ID: case ViewHostMsg_IDBCursorValue::ID: + case ViewHostMsg_IDBCursorUpdate::ID: + case ViewHostMsg_IDBCursorContinue::ID: + case ViewHostMsg_IDBCursorRemove::ID: case ViewHostMsg_IDBFactoryOpen::ID: case ViewHostMsg_IDBFactoryAbortPendingTransactions::ID: case ViewHostMsg_IDBDatabaseName::ID: @@ -568,7 +572,7 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndexNames( std::vector<string16> index_names; index_names.reserve(web_index_names.length()); for (unsigned i = 0; i < web_index_names.length(); ++i) - index_names[i] = web_index_names.item(i); + index_names.push_back(web_index_names.item(i)); ViewHostMsg_IDBObjectStoreIndexNames::WriteReplyParams(reply_msg, index_names); parent_->Send(reply_msg); @@ -678,6 +682,9 @@ bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived( OnDirection) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBCursorKey, OnKey) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBCursorValue, OnValue) + IPC_MESSAGE_HANDLER(ViewHostMsg_IDBCursorUpdate, OnUpdate) + IPC_MESSAGE_HANDLER(ViewHostMsg_IDBCursorContinue, OnContinue) + IPC_MESSAGE_HANDLER(ViewHostMsg_IDBCursorRemove, OnRemove) IPC_MESSAGE_HANDLER(ViewHostMsg_IDBCursorDestroyed, OnDestroyed) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() @@ -747,6 +754,43 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnValue( parent_->Send(reply_msg); } +void IndexedDBDispatcherHost::CursorDispatcherHost::OnUpdate( + int32 cursor_id, + int32 response_id, + const SerializedScriptValue& value) { + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); + WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( + &map_, cursor_id, NULL, ViewHostMsg_IDBCursorUpdate::ID); + if (!idb_cursor) + return; + idb_cursor->update( + value, new IndexedDBCallbacks<void>(parent_, response_id)); +} + +void IndexedDBDispatcherHost::CursorDispatcherHost::OnContinue( + int32 cursor_id, + int32 response_id, + const IndexedDBKey& key) { + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); + WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( + &map_, cursor_id, NULL, ViewHostMsg_IDBCursorContinue::ID); + if (!idb_cursor) + return; + idb_cursor->continueFunction( + key, new IndexedDBCallbacks<WebIDBCursor>(parent_, response_id)); +} + +void IndexedDBDispatcherHost::CursorDispatcherHost::OnRemove( + int32 cursor_id, + int32 response_id) { + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); + WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess( + &map_, cursor_id, NULL, ViewHostMsg_IDBCursorUpdate::ID); + if (!idb_cursor) + return; + idb_cursor->remove(new IndexedDBCallbacks<void>(parent_, response_id)); +} + void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( int32 object_id) { parent_->DestroyObject( diff --git a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h index d461ee8..d563bfc 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -178,6 +178,14 @@ class IndexedDBDispatcherHost void OnDirection(int32 idb_object_store_id, IPC::Message* reply_msg); void OnKey(int32 idb_object_store_id, IPC::Message* reply_msg); void OnValue(int32 idb_object_store_id, IPC::Message* reply_msg); + void OnUpdate(int32 idb_object_store_id, + int32 response_id, + const SerializedScriptValue& value); + void OnContinue(int32 idb_object_store_id, + int32 response_id, + const IndexedDBKey& key); + void OnRemove(int32 idb_object_store_id, + int32 response_id); void OnDestroyed(int32 idb_cursor_id); IndexedDBDispatcherHost* parent_; |