diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 03:58:45 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 03:58:45 +0000 |
commit | 3d392a6fd21a84a4eae5cc340242219f5062b46d (patch) | |
tree | 99d0e4dd9d0b1128d6a0ab0b4b381db3f23c3e6c /chrome/browser | |
parent | 8f0bcb9f2381746bfc8f234fe1fcf831321adbf5 (diff) | |
download | chromium_src-3d392a6fd21a84a4eae5cc340242219f5062b46d.zip chromium_src-3d392a6fd21a84a4eae5cc340242219f5062b46d.tar.gz chromium_src-3d392a6fd21a84a4eae5cc340242219f5062b46d.tar.bz2 |
Get rid of the half-working traces of locking, caching, and quotas. It
probably shoudln't have been added in to begin with.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/203015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25966 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc | 68 | ||||
-rw-r--r-- | chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h | 5 |
2 files changed, 4 insertions, 69 deletions
diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc index bd1ba65..49fdfda 100644 --- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc +++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc @@ -65,18 +65,14 @@ bool DOMStorageDispatcherHost::OnMessageReceived(const IPC::Message& message, OnNamespaceId) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageCloneNamespaceId, OnCloneNamespaceId) - IPC_MESSAGE_HANDLER(ViewHostMsg_DOMStorageDerefNamespaceId, - OnDerefNamespaceId) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageStorageAreaId, OnStorageAreaId) - IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageLock, OnLock) - IPC_MESSAGE_HANDLER(ViewHostMsg_DOMStorageUnlock, OnUnlock) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageLength, OnLength) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageKey, OnKey) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageGetItem, OnGetItem) IPC_MESSAGE_HANDLER(ViewHostMsg_DOMStorageSetItem, OnSetItem) IPC_MESSAGE_HANDLER(ViewHostMsg_DOMStorageRemoveItem, OnRemoveItem) - IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_DOMStorageClear, OnClear) + IPC_MESSAGE_HANDLER(ViewHostMsg_DOMStorageClear, OnClear) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() if (handled) @@ -145,23 +141,6 @@ void DOMStorageDispatcherHost::OnCloneNamespaceId(int64 namespace_id, Send(reply_msg); } -void DOMStorageDispatcherHost::OnDerefNamespaceId(int64 namespace_id) { - DCHECK(!shutdown_); - if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { - MessageLoop* webkit_loop = webkit_thread_->GetMessageLoop(); - webkit_loop->PostTask(FROM_HERE, NewRunnableMethod(this, - &DOMStorageDispatcherHost::OnDerefNamespaceId, namespace_id)); - return; - } - - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); - StorageNamespace* storage_namespace = - Context()->GetStorageNamespace(namespace_id); - CHECK(storage_namespace); // TODO(jorlow): Do better than this. - // TODO(jorlow): Track resources here so we can free them (even beyond just - // when the renderer process dies). -} - void DOMStorageDispatcherHost::OnStorageAreaId(int64 namespace_id, const string16& origin, IPC::Message* reply_msg) { @@ -184,41 +163,6 @@ void DOMStorageDispatcherHost::OnStorageAreaId(int64 namespace_id, Send(reply_msg); } -void DOMStorageDispatcherHost::OnLock(int64 storage_area_id, - IPC::Message* reply_msg) { - DCHECK(!shutdown_); - if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { - MessageLoop* webkit_loop = webkit_thread_->GetMessageLoop(); - webkit_loop->PostTask(FROM_HERE, NewRunnableMethod(this, - &DOMStorageDispatcherHost::OnLock, storage_area_id, reply_msg)); - return; - } - - StorageArea* storage_area = Context()->GetStorageArea(storage_area_id); - CHECK(storage_area); // TODO(jorlow): Do better than this. - // TODO(jorlow): Implement locking, quotas, etc... - bool invalidate_cache = true; - size_t bytes_left_in_quota = 9999999; - ViewHostMsg_DOMStorageLock::WriteReplyParams(reply_msg, invalidate_cache, - bytes_left_in_quota); - Send(reply_msg); -} - -void DOMStorageDispatcherHost::OnUnlock(int64 storage_area_id) { - DCHECK(!shutdown_); - if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { - MessageLoop* webkit_loop = webkit_thread_->GetMessageLoop(); - webkit_loop->PostTask(FROM_HERE, NewRunnableMethod(this, - &DOMStorageDispatcherHost::OnUnlock, storage_area_id)); - return; - } - - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); - StorageArea* storage_area = Context()->GetStorageArea(storage_area_id); - CHECK(storage_area); // TODO(jorlow): Do better than this. - // TODO(jorlow): Do something. -} - void DOMStorageDispatcherHost::OnLength(int64 storage_area_id, IPC::Message* reply_msg) { DCHECK(!shutdown_); @@ -310,23 +254,17 @@ void DOMStorageDispatcherHost::OnRemoveItem(int64 storage_area_id, storage_area->RemoveItem(key); } -void DOMStorageDispatcherHost::OnClear(int64 storage_area_id, - IPC::Message* reply_msg) { +void DOMStorageDispatcherHost::OnClear(int64 storage_area_id) { DCHECK(!shutdown_); if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { MessageLoop* webkit_loop = webkit_thread_->GetMessageLoop(); webkit_loop->PostTask(FROM_HERE, NewRunnableMethod(this, - &DOMStorageDispatcherHost::OnClear, storage_area_id, reply_msg)); + &DOMStorageDispatcherHost::OnClear, storage_area_id)); return; } DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); - // TODO(jorlow): Return the total quota for this domain. - size_t bytes_left_in_quota = 9999999; StorageArea* storage_area = Context()->GetStorageArea(storage_area_id); CHECK(storage_area); // TODO(jorlow): Do better than this. storage_area->Clear(); - ViewHostMsg_DOMStorageClear::WriteReplyParams(reply_msg, - bytes_left_in_quota); - Send(reply_msg); } diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h index 72b061f..8f5c94d 100644 --- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h +++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h @@ -39,11 +39,8 @@ class DOMStorageDispatcherHost : // Message Handlers. void OnNamespaceId(bool is_local_storage, IPC::Message* reply_msg); void OnCloneNamespaceId(int64 namespace_id, IPC::Message* reply_msg); - void OnDerefNamespaceId(int64 namespace_id); void OnStorageAreaId(int64 namespace_id, const string16& origin, IPC::Message* reply_msg); - void OnLock(int64 storage_area_id, IPC::Message* reply_msg); - void OnUnlock(int64 storage_area_id); void OnLength(int64 storage_area_id, IPC::Message* reply_msg); void OnKey(int64 storage_area_id, unsigned index, IPC::Message* reply_msg); void OnGetItem(int64 storage_area_id, const string16& key, @@ -51,7 +48,7 @@ class DOMStorageDispatcherHost : void OnSetItem(int64 storage_area_id, const string16& key, const string16& value); void OnRemoveItem(int64 storage_area_id, const string16& key); - void OnClear(int64 storage_area_id, IPC::Message* reply_msg); + void OnClear(int64 storage_area_id); // A shortcut for accessing our context. DOMStorageContext* Context() { |