| Index: chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
|
| ===================================================================
|
| --- chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc (revision 36257)
|
| +++ chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc (working copy)
|
| @@ -112,10 +112,6 @@
|
|
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP_EX(DOMStorageDispatcherHost, message, *msg_is_ok)
|
| - IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageNamespaceId,
|
| - OnNamespaceId)
|
| - IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageCloneNamespaceId,
|
| - OnCloneNamespaceId)
|
| IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageStorageAreaId,
|
| OnStorageAreaId)
|
| IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageLength, OnLength)
|
| @@ -129,6 +125,10 @@
|
| return handled;
|
| }
|
|
|
| +int64 DOMStorageDispatcherHost::CloneSessionStorage(int64 original_id) {
|
| + return Context()->CloneSessionStorage(original_id);
|
| +}
|
| +
|
| void DOMStorageDispatcherHost::Send(IPC::Message* message) {
|
| if (!message_sender_) {
|
| delete message;
|
| @@ -147,50 +147,6 @@
|
| NewRunnableMethod(this, &DOMStorageDispatcherHost::Send, message));
|
| }
|
|
|
| -void DOMStorageDispatcherHost::OnNamespaceId(DOMStorageType storage_type,
|
| - IPC::Message* reply_msg) {
|
| - if (ChromeThread::CurrentlyOn(ChromeThread::IO)) {
|
| - ChromeThread::PostTask(ChromeThread::WEBKIT, FROM_HERE, NewRunnableMethod(
|
| - this, &DOMStorageDispatcherHost::OnNamespaceId, storage_type,
|
| - reply_msg));
|
| - return;
|
| - }
|
| -
|
| - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
|
| - DOMStorageNamespace* new_namespace;
|
| - if (storage_type == DOM_STORAGE_LOCAL)
|
| - new_namespace = Context()->LocalStorage();
|
| - else
|
| - new_namespace = Context()->NewSessionStorage();
|
| - ViewHostMsg_DOMStorageNamespaceId::WriteReplyParams(reply_msg,
|
| - new_namespace->id());
|
| - Send(reply_msg);
|
| -}
|
| -
|
| -void DOMStorageDispatcherHost::OnCloneNamespaceId(int64 namespace_id,
|
| - IPC::Message* reply_msg) {
|
| - if (ChromeThread::CurrentlyOn(ChromeThread::IO)) {
|
| - ChromeThread::PostTask(ChromeThread::WEBKIT, FROM_HERE, NewRunnableMethod(
|
| - this, &DOMStorageDispatcherHost::OnCloneNamespaceId, namespace_id,
|
| - reply_msg));
|
| - return;
|
| - }
|
| -
|
| - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
|
| - DOMStorageNamespace* existing_namespace =
|
| - Context()->GetStorageNamespace(namespace_id);
|
| - if (!existing_namespace) {
|
| - BrowserRenderProcessHost::BadMessageTerminateProcess(
|
| - ViewHostMsg_DOMStorageCloneNamespaceId::ID, process_handle_);
|
| - delete reply_msg;
|
| - return;
|
| - }
|
| - DOMStorageNamespace* new_namespace = existing_namespace->Copy();
|
| - ViewHostMsg_DOMStorageCloneNamespaceId::WriteReplyParams(reply_msg,
|
| - new_namespace->id());
|
| - Send(reply_msg);
|
| -}
|
| -
|
| void DOMStorageDispatcherHost::OnStorageAreaId(int64 namespace_id,
|
| const string16& origin,
|
| IPC::Message* reply_msg) {
|
| @@ -203,7 +159,7 @@
|
|
|
| DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
|
| DOMStorageNamespace* storage_namespace =
|
| - Context()->GetStorageNamespace(namespace_id);
|
| + Context()->GetStorageNamespace(namespace_id, true);
|
| if (!storage_namespace) {
|
| BrowserRenderProcessHost::BadMessageTerminateProcess(
|
| ViewHostMsg_DOMStorageStorageAreaId::ID, process_handle_);
|
| @@ -211,8 +167,8 @@
|
| return;
|
| }
|
| DOMStorageArea* storage_area = storage_namespace->GetStorageArea(origin);
|
| - ViewHostMsg_DOMStorageCloneNamespaceId::WriteReplyParams(reply_msg,
|
| - storage_area->id());
|
| + ViewHostMsg_DOMStorageStorageAreaId::WriteReplyParams(reply_msg,
|
| + storage_area->id());
|
| Send(reply_msg);
|
| }
|
|
|
|
|