diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-26 01:31:22 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-26 01:31:22 +0000 |
commit | 037c70024e20282ce23b5e6297bea87b795c8dec (patch) | |
tree | 392a714c4ad0a6aef027c52d000fce30d6f5c678 /chrome/renderer | |
parent | 4afa45dfbf11e9334e63aef002cd854ec86f6d44 (diff) | |
download | chromium_src-037c70024e20282ce23b5e6297bea87b795c8dec.zip chromium_src-037c70024e20282ce23b5e6297bea87b795c8dec.tar.gz chromium_src-037c70024e20282ce23b5e6297bea87b795c8dec.tar.bz2 |
Handle storage events locally when possible.
TEST=none
BUG=33108
Review URL: http://codereview.chromium.org/543168
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/renderer_webstoragearea_impl.cc | 21 | ||||
-rw-r--r-- | chrome/renderer/renderer_webstoragearea_impl.h | 10 |
2 files changed, 20 insertions, 11 deletions
diff --git a/chrome/renderer/renderer_webstoragearea_impl.cc b/chrome/renderer/renderer_webstoragearea_impl.cc index 95e688e..43caed5 100644 --- a/chrome/renderer/renderer_webstoragearea_impl.cc +++ b/chrome/renderer/renderer_webstoragearea_impl.cc @@ -44,19 +44,26 @@ WebString RendererWebStorageAreaImpl::getItem(const WebString& key) { void RendererWebStorageAreaImpl::setItem( const WebString& key, const WebString& value, const WebURL& url, - bool& quota_exception) { + bool& quota_exception, WebString& old_value_webkit) { + NullableString16 old_value; RenderThread::current()->Send( new ViewHostMsg_DOMStorageSetItem(storage_area_id_, key, value, url, - "a_exception)); + "a_exception, &old_value)); + old_value_webkit = old_value; } -void RendererWebStorageAreaImpl::removeItem(const WebString& key, - const WebURL& url) { +void RendererWebStorageAreaImpl::removeItem( + const WebString& key, const WebURL& url, WebString& old_value_webkit) { + NullableString16 old_value; RenderThread::current()->Send( - new ViewHostMsg_DOMStorageRemoveItem(storage_area_id_, key, url)); + new ViewHostMsg_DOMStorageRemoveItem(storage_area_id_, key, + url, &old_value)); + old_value_webkit = old_value; } -void RendererWebStorageAreaImpl::clear(const WebURL& url) { +void RendererWebStorageAreaImpl::clear( + const WebURL& url, bool& cleared_something) { RenderThread::current()->Send( - new ViewHostMsg_DOMStorageClear(storage_area_id_, url)); + new ViewHostMsg_DOMStorageClear(storage_area_id_, url, + &cleared_something)); } diff --git a/chrome/renderer/renderer_webstoragearea_impl.h b/chrome/renderer/renderer_webstoragearea_impl.h index 040c9db..5ce935f 100644 --- a/chrome/renderer/renderer_webstoragearea_impl.h +++ b/chrome/renderer/renderer_webstoragearea_impl.h @@ -22,10 +22,12 @@ class RendererWebStorageAreaImpl : public WebKit::WebStorageArea { virtual WebKit::WebString getItem(const WebKit::WebString& key); virtual void setItem( const WebKit::WebString& key, const WebKit::WebString& value, - const WebKit::WebURL& url, bool& quota_exception); - virtual void removeItem(const WebKit::WebString& key, - const WebKit::WebURL& url); - virtual void clear(const WebKit::WebURL& url); + const WebKit::WebURL& url, bool& quota_exception, + WebKit::WebString& old_value); + virtual void removeItem( + const WebKit::WebString& key, const WebKit::WebURL& url, + WebKit::WebString& old_value); + virtual void clear(const WebKit::WebURL& url, bool& cleared_something); private: // The ID we use for all IPC. |