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/browser/in_process_webkit | |
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/browser/in_process_webkit')
-rw-r--r-- | chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc | 18 |
1 files changed, 15 insertions, 3 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 ddd9439..299787a 100644 --- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc +++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc @@ -1,6 +1,6 @@ -// 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. +// 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. #include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" @@ -12,6 +12,7 @@ #include "chrome/browser/in_process_webkit/webkit_thread.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/renderer_host/browser_render_process_host.h" +#include "chrome/browser/renderer_host/render_view_host_notification_task.h" #include "chrome/browser/renderer_host/resource_message_filter.h" #include "chrome/common/render_messages.h" #include "googleurl/src/gurl.h" @@ -271,6 +272,17 @@ void DOMStorageDispatcherHost::OnSetItem( ScopedStorageEventContext scope(this, &url); WebStorageArea::Result result; NullableString16 old_value = storage_area->SetItem(key, value, &result, this); + + // If content was blocked, tell the UI to display the blocked content icon. + if (reply_msg->routing_id() == MSG_ROUTING_CONTROL) { + DLOG(WARNING) << "setItem was not given a proper routing id"; + } else if (result == WebKit::WebStorageArea::ResultBlockedByPolicy) { + CallRenderViewHostResourceDelegate( + process_handle_, reply_msg->routing_id(), + &RenderViewHostDelegate::Resource::OnContentBlocked, + CONTENT_SETTINGS_TYPE_COOKIES); + } + ViewHostMsg_DOMStorageSetItem::WriteReplyParams(reply_msg, result, old_value); Send(reply_msg); } |