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

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

Issue 1303773002: Give the main frame a RenderWidget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: plumb through surface ID *and* widget surface ID for window.open Created 5 years, 3 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_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 19033a8ecdfa24d7156bc34187e4d0aa82ada488..f406aabc34fa567f13a2d6e7aa8230ae79053da8 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -314,8 +314,16 @@ bool RenderViewHostImpl::CreateRenderView(
#endif
params.web_preferences = GetWebkitPreferences();
params.view_id = GetRoutingID();
+ params.view_surface_id = surface_id();
params.main_frame_routing_id = main_frame_routing_id_;
- params.surface_id = surface_id();
+ if (main_frame_routing_id_ != MSG_ROUTING_NONE) {
+ RenderFrameHostImpl* main_rfh = RenderFrameHostImpl::FromID(
+ GetProcess()->GetID(), main_frame_routing_id_);
+ DCHECK(main_rfh);
+ RenderWidgetHostImpl* main_rwh = main_rfh->GetRenderWidgetHostForFrame();
+ params.main_frame_widget_routing_id = main_rwh->GetRoutingID();
+ params.widget_surface_id = main_rwh->surface_id();
+ }
params.session_storage_namespace_id =
delegate_->GetSessionStorageNamespace(instance_.get())->id();
// Ensure the RenderView sets its opener correctly.
@@ -750,7 +758,9 @@ void RenderViewHostImpl::AllowBindings(int bindings_flags) {
// This process has no bindings yet. Make sure it does not have more
// than this single active view.
// --single-process only has one renderer.
- if (GetProcess()->GetActiveViewCount() > 1 &&
+ // TODO(dcheng): IMPORTANT IMPORTANT IMPORTANT. Once RenderViewHost is no
+ // longer a RenderWidgetHost, this *must* be decremented back to 1.
+ if (GetProcess()->GetActiveViewCount() > 2 &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess))
return;
@@ -984,8 +994,10 @@ bool RenderViewHostImpl::IsRenderView() const {
}
void RenderViewHostImpl::CreateNewWindow(
- int route_id,
- int main_frame_route_id,
+ int32 route_id,
+ int32 main_frame_route_id,
+ int32 main_frame_widget_route_id,
+ int32 surface_id,
const ViewHostMsg_CreateWindow_Params& params,
SessionStorageNamespace* session_storage_namespace) {
ViewHostMsg_CreateWindow_Params validated_params(params);
@@ -994,6 +1006,7 @@ void RenderViewHostImpl::CreateNewWindow(
GetProcess()->FilterURL(true, &validated_params.opener_security_origin);
delegate_->CreateNewWindow(GetSiteInstance(), route_id, main_frame_route_id,
+ main_frame_widget_route_id, surface_id,
validated_params, session_storage_namespace);
}

Powered by Google App Engine
This is Rietveld 408576698