summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-08 19:28:32 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-08 19:28:32 +0000
commitc3df17c94b05b3a22b6755b93dc68bcca9c010f7 (patch)
tree74b6ab99f838f13cef0de7bc258a03c36c129c80 /chrome/renderer
parent70a4ec5fb0885b27c1cfdef0132eeb2c0fc7dc99 (diff)
downloadchromium_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')
-rw-r--r--chrome/renderer/renderer_webstoragearea_impl.cc17
-rw-r--r--chrome/renderer/renderer_webstoragearea_impl.h8
2 files changed, 13 insertions, 12 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(
diff --git a/chrome/renderer/renderer_webstoragearea_impl.h b/chrome/renderer/renderer_webstoragearea_impl.h
index 7bd6ff1..8a324c2 100644
--- a/chrome/renderer/renderer_webstoragearea_impl.h
+++ b/chrome/renderer/renderer_webstoragearea_impl.h
@@ -1,6 +1,6 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
-// source code is governed by a BSD-style license that can be found in the
-// LICENSE file.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
#ifndef CHROME_RENDERER_RENDERER_WEBSTORAGEAREA_IMPL_H_
#define CHROME_RENDERER_RENDERER_WEBSTORAGEAREA_IMPL_H_
@@ -23,7 +23,7 @@ class RendererWebStorageAreaImpl : public WebKit::WebStorageArea {
virtual void setItem(
const WebKit::WebString& key, const WebKit::WebString& value,
const WebKit::WebURL& url, WebStorageArea::Result& result,
- WebKit::WebString& old_value);
+ WebKit::WebString& old_value, WebKit::WebFrame* web_view);
virtual void removeItem(
const WebKit::WebString& key, const WebKit::WebURL& url,
WebKit::WebString& old_value);