Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1560)

Unified Diff: chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc

Issue 545054: Introduce all the plumbing for Session Storage. This mostly consists of crea... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698