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

Side by Side 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, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_helper.h" 5 #include "content/browser/renderer_host/render_widget_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/eintr_wrapper.h" 9 #include "base/eintr_wrapper.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 render_process_id_, render_widget_id); 207 render_process_id_, render_widget_id);
208 } 208 }
209 209
210 void RenderWidgetHelper::OnCrossSiteSwapOutACK( 210 void RenderWidgetHelper::OnCrossSiteSwapOutACK(
211 const ViewMsg_SwapOut_Params& params) { 211 const ViewMsg_SwapOut_Params& params) {
212 resource_dispatcher_host_->OnSwapOutACK(params); 212 resource_dispatcher_host_->OnSwapOutACK(params);
213 } 213 }
214 214
215 void RenderWidgetHelper::CreateNewWindow( 215 void RenderWidgetHelper::CreateNewWindow(
216 const ViewHostMsg_CreateWindow_Params& params, 216 const ViewHostMsg_CreateWindow_Params& params,
217 bool no_javascript_access,
217 base::ProcessHandle render_process, 218 base::ProcessHandle render_process,
218 int* route_id, 219 int* route_id,
219 int* surface_id) { 220 int* surface_id) {
220 if (params.opener_suppressed) { 221 if (params.opener_suppressed || no_javascript_access) {
221 // If the opener is supppressed, we should open the window in a new 222 // If the opener is supppressed or script access is disallowed, we should
222 // BrowsingInstance, and thus a new process. That means the current 223 // open the window in a new BrowsingInstance, and thus a new process. That
223 // renderer process will not be able to route messages to it. Because of 224 // means the current renderer process will not be able to route messages to
224 // this, we will immediately show and navigate the window in 225 // it. Because of this, we will immediately show and navigate the window
225 // OnCreateWindowOnUI, using the params provided here. 226 // in OnCreateWindowOnUI, using the params provided here.
226 *route_id = MSG_ROUTING_NONE; 227 *route_id = MSG_ROUTING_NONE;
227 *surface_id = 0; 228 *surface_id = 0;
228 } else { 229 } else {
229 *route_id = GetNextRoutingID(); 230 *route_id = GetNextRoutingID();
230 *surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer( 231 *surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
231 render_process_id_, *route_id); 232 render_process_id_, *route_id);
232 // Block resource requests until the view is created, since the HWND might 233 // Block resource requests until the view is created, since the HWND might
233 // be needed if a response ends up creating a plugin. 234 // be needed if a response ends up creating a plugin.
234 resource_dispatcher_host_->BlockRequestsForRoute( 235 resource_dispatcher_host_->BlockRequestsForRoute(
235 render_process_id_, *route_id); 236 render_process_id_, *route_id);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 void RenderWidgetHelper::ClearAllocatedDIBs() { 356 void RenderWidgetHelper::ClearAllocatedDIBs() {
356 for (std::map<TransportDIB::Id, int>::iterator 357 for (std::map<TransportDIB::Id, int>::iterator
357 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { 358 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) {
358 if (HANDLE_EINTR(close(i->second)) < 0) 359 if (HANDLE_EINTR(close(i->second)) < 0)
359 PLOG(ERROR) << "close: " << i->first; 360 PLOG(ERROR) << "close: " << i->first;
360 } 361 }
361 362
362 allocated_dibs_.clear(); 363 allocated_dibs_.clear();
363 } 364 }
364 #endif 365 #endif
OLDNEW
« 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