Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1846)

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 9837074: Make it so that allow_js_access: false can be used with background pages created by window.open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 0684b0ffe77e6c5e71c9089403cfcb020a1b142e..6a407720b487d230c1ec81099e0bb540d152962d 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -401,16 +401,23 @@ void RenderMessageFilter::OnMsgCreateWindow(
const ViewHostMsg_CreateWindow_Params& params,
int* route_id,
int* surface_id,
- int64* cloned_session_storage_namespace_id) {
- if (!content::GetContentClient()->browser()->CanCreateWindow(
+ int64* cloned_session_storage_namespace_id,
+ bool* no_js_access) {
+ content::ContentBrowserClient::CanCreateWindowResult result =
+ content::GetContentClient()->browser()->CanCreateWindow(
GURL(params.opener_url), GURL(params.opener_security_origin),
params.window_container_type, resource_context_,
- render_process_id_)) {
+ render_process_id_);
+
+ if (result == content::ContentBrowserClient::CANNOT_CREATE_WINDOW) {
*route_id = MSG_ROUTING_NONE;
*surface_id = 0;
return;
}
+ *no_js_access =
Andrew T Wilson (Slow) 2012/03/26 15:28:10 I'd move this to the check up above just to make s
+ result == content::ContentBrowserClient::CAN_CREATE_WINDOW_NO_JS_ACCESS;
+
#ifdef ENABLE_NEW_DOM_STORAGE_BACKEND
// TODO(michaeln): Fix this.
// This is a bug in the existing impl, session storage is effectively

Powered by Google App Engine
This is Rietveld 408576698