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

Unified Diff: content/browser/renderer_host/render_widget_helper.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: Fix indentation. 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_widget_helper.cc
diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc
index e69ba494c0aa3c7b475bd847de28dbfe9dec1d32..a29babbf4123d0fb2649954b4913e2138749c6dd 100644
--- a/content/browser/renderer_host/render_widget_helper.cc
+++ b/content/browser/renderer_host/render_widget_helper.cc
@@ -214,15 +214,16 @@ void RenderWidgetHelper::OnCrossSiteSwapOutACK(
void RenderWidgetHelper::CreateNewWindow(
const ViewHostMsg_CreateWindow_Params& params,
+ bool no_javascript_access,
base::ProcessHandle render_process,
int* route_id,
int* surface_id) {
- if (params.opener_suppressed) {
- // If the opener is supppressed, we should open the window in a new
- // BrowsingInstance, and thus a new process. That means the current
- // renderer process will not be able to route messages to it. Because of
- // this, we will immediately show and navigate the window in
- // OnCreateWindowOnUI, using the params provided here.
+ if (params.opener_suppressed || no_javascript_access) {
+ // If the opener is supppressed or script access is disallowed, we should
+ // open the window in a new BrowsingInstance, and thus a new process. That
+ // means the current renderer process will not be able to route messages to
+ // it. Because of this, we will immediately show and navigate the window
+ // in OnCreateWindowOnUI, using the params provided here.
*route_id = MSG_ROUTING_NONE;
*surface_id = 0;
} else {
« no previous file with comments | « content/browser/renderer_host/render_widget_helper.h ('k') | content/browser/tab_contents/tab_contents_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698