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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1131593003: Revert of Revert of OOPIF: Specify previous sibling frames when creating new RenderFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 558
559 BrowserAccessibilityManager* manager = 559 BrowserAccessibilityManager* manager =
560 parent_frame->browser_accessibility_manager(); 560 parent_frame->browser_accessibility_manager();
561 if (!manager) 561 if (!manager)
562 return NULL; 562 return NULL;
563 563
564 return manager->GetFromID(parent_node_id); 564 return manager->GetFromID(parent_node_id);
565 } 565 }
566 566
567 bool RenderFrameHostImpl::CreateRenderFrame(int parent_routing_id, 567 bool RenderFrameHostImpl::CreateRenderFrame(int parent_routing_id,
568 int previous_sibling_routing_id,
568 int proxy_routing_id) { 569 int proxy_routing_id) {
569 TRACE_EVENT0("navigation", "RenderFrameHostImpl::CreateRenderFrame"); 570 TRACE_EVENT0("navigation", "RenderFrameHostImpl::CreateRenderFrame");
570 DCHECK(!IsRenderFrameLive()) << "Creating frame twice"; 571 DCHECK(!IsRenderFrameLive()) << "Creating frame twice";
571 572
572 // The process may (if we're sharing a process with another host that already 573 // The process may (if we're sharing a process with another host that already
573 // initialized it) or may not (we have our own process or the old process 574 // initialized it) or may not (we have our own process or the old process
574 // crashed) have been initialized. Calling Init multiple times will be 575 // crashed) have been initialized. Calling Init multiple times will be
575 // ignored, so this is safe. 576 // ignored, so this is safe.
576 if (!GetProcess()->Init()) 577 if (!GetProcess()->Init())
577 return false; 578 return false;
578 579
579 DCHECK(GetProcess()->HasConnection()); 580 DCHECK(GetProcess()->HasConnection());
580 581
581 FrameMsg_NewFrame_WidgetParams widget_params; 582 FrameMsg_NewFrame_Params params;
583 params.routing_id = routing_id_;
584 params.parent_routing_id = parent_routing_id;
585 params.proxy_routing_id = proxy_routing_id;
586 params.previous_sibling_routing_id = previous_sibling_routing_id;
587 params.replication_state = frame_tree_node()->current_replication_state();
588
582 if (render_widget_host_) { 589 if (render_widget_host_) {
583 widget_params.routing_id = render_widget_host_->GetRoutingID(); 590 params.widget_params.routing_id = render_widget_host_->GetRoutingID();
584 widget_params.surface_id = render_widget_host_->surface_id(); 591 params.widget_params.surface_id = render_widget_host_->surface_id();
585 widget_params.hidden = render_widget_host_->is_hidden(); 592 params.widget_params.hidden = render_widget_host_->is_hidden();
586 } else { 593 } else {
587 // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in 594 // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in
588 // the renderer process. 595 // the renderer process.
589 widget_params.routing_id = MSG_ROUTING_NONE; 596 params.widget_params.routing_id = MSG_ROUTING_NONE;
590 widget_params.surface_id = 0; 597 params.widget_params.surface_id = 0;
591 widget_params.hidden = true; 598 params.widget_params.hidden = true;
592 } 599 }
593 600
594 Send(new FrameMsg_NewFrame(routing_id_, parent_routing_id, proxy_routing_id, 601 Send(new FrameMsg_NewFrame(params));
595 frame_tree_node()->current_replication_state(),
596 widget_params));
597 602
598 // The RenderWidgetHost takes ownership of its view. It is tied to the 603 // The RenderWidgetHost takes ownership of its view. It is tied to the
599 // lifetime of the current RenderProcessHost for this RenderFrameHost. 604 // lifetime of the current RenderProcessHost for this RenderFrameHost.
600 if (render_widget_host_) { 605 if (render_widget_host_) {
601 RenderWidgetHostView* rwhv = 606 RenderWidgetHostView* rwhv =
602 new RenderWidgetHostViewChildFrame(render_widget_host_); 607 new RenderWidgetHostViewChildFrame(render_widget_host_);
603 rwhv->Hide(); 608 rwhv->Hide();
604 } 609 }
605 610
606 if (proxy_routing_id != MSG_ROUTING_NONE) { 611 if (proxy_routing_id != MSG_ROUTING_NONE) {
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 // We may be returning to an existing NavigationEntry that had been granted 2074 // We may be returning to an existing NavigationEntry that had been granted
2070 // file access. If this is a different process, we will need to grant the 2075 // file access. If this is a different process, we will need to grant the
2071 // access again. The files listed in the page state are validated when they 2076 // access again. The files listed in the page state are validated when they
2072 // are received from the renderer to prevent abuse. 2077 // are received from the renderer to prevent abuse.
2073 if (request_params.page_state.IsValid()) { 2078 if (request_params.page_state.IsValid()) {
2074 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); 2079 render_view_host_->GrantFileAccessFromPageState(request_params.page_state);
2075 } 2080 }
2076 } 2081 }
2077 2082
2078 } // namespace content 2083 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698