diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 19:28:32 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 19:28:32 +0000 |
commit | c3df17c94b05b3a22b6755b93dc68bcca9c010f7 (patch) | |
tree | 74b6ab99f838f13cef0de7bc258a03c36c129c80 /chrome/renderer/renderer_webstoragearea_impl.cc | |
parent | 70a4ec5fb0885b27c1cfdef0132eeb2c0fc7dc99 (diff) | |
download | chromium_src-c3df17c94b05b3a22b6755b93dc68bcca9c010f7.zip chromium_src-c3df17c94b05b3a22b6755b93dc68bcca9c010f7.tar.gz chromium_src-c3df17c94b05b3a22b6755b93dc68bcca9c010f7.tar.bz2 |
Use the WebViewClient* passed in from the StorageAreaProxy instead of using
RenderThread::RoutingIDForCurrentContext() whenever possible. In addition,
call OnContentBlocked directly from within the browser instead of sending
another IPC message. Lastly, make sure that we don't crash in the event
that we can't determine the routing id.
WebKit side: https://bugs.webkit.org/show_bug.cgi?id=35758
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/669084
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40920 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/renderer_webstoragearea_impl.cc')
-rw-r--r-- | chrome/renderer/renderer_webstoragearea_impl.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/renderer/renderer_webstoragearea_impl.cc b/chrome/renderer/renderer_webstoragearea_impl.cc index 61c3448..7ee9774 100644 --- a/chrome/renderer/renderer_webstoragearea_impl.cc +++ b/chrome/renderer/renderer_webstoragearea_impl.cc @@ -50,9 +50,15 @@ WebString RendererWebStorageAreaImpl::getItem(const WebString& key) { void RendererWebStorageAreaImpl::setItem( const WebString& key, const WebString& value, const WebURL& url, - WebStorageArea::Result& result, WebString& old_value_webkit) { - int32 routing_id = RenderThread::RoutingIDForCurrentContext(); - CHECK(routing_id != MSG_ROUTING_CONTROL); + WebStorageArea::Result& result, WebString& old_value_webkit, + WebFrame* web_frame) { + int32 routing_id = MSG_ROUTING_CONTROL; + if (web_frame) { + RenderView* render_view = RenderView::FromWebView(web_frame->view()); + if (render_view) + routing_id = render_view->routing_id(); + } + DCHECK(routing_id != MSG_ROUTING_CONTROL); NullableString16 old_value; IPC::SyncMessage* message = @@ -62,11 +68,6 @@ void RendererWebStorageAreaImpl::setItem( RenderThread::current()->cookie_message_filter()->pump_messages_event()); RenderThread::current()->Send(message); old_value_webkit = old_value; - - if (result == WebStorageArea::ResultBlockedByPolicy) { - RenderThread::current()->Send(new ViewHostMsg_ContentBlocked( - routing_id, CONTENT_SETTINGS_TYPE_COOKIES)); - } } void RendererWebStorageAreaImpl::removeItem( |