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

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

Issue 536473002: PlzNavigate: Initialize the renderer on commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 current_instance, new_instance, frame_tree_node_->IsMainFrame()); 611 current_instance, new_instance, frame_tree_node_->IsMainFrame());
612 DCHECK(pending_render_frame_host_.get()); 612 DCHECK(pending_render_frame_host_.get());
613 // TODO(clamy): Wait until the navigation has committed before swapping 613 // TODO(clamy): Wait until the navigation has committed before swapping
614 // renderers. 614 // renderers.
615 scoped_ptr<RenderFrameHostImpl> old_render_frame_host = 615 scoped_ptr<RenderFrameHostImpl> old_render_frame_host =
616 SetRenderFrameHost(pending_render_frame_host_.Pass()); 616 SetRenderFrameHost(pending_render_frame_host_.Pass());
617 if (frame_tree_node_->IsMainFrame()) 617 if (frame_tree_node_->IsMainFrame())
618 render_frame_host_->render_view_host()->AttachToFrameTree(); 618 render_frame_host_->render_view_host()->AttachToFrameTree();
619 } 619 }
620 620
621 // If the renderer that needs to navigate is not live (it was just created or
622 // it crashed), initialize it.
623 if (!render_frame_host_->render_view_host()->IsRenderViewLive()) {
624 // Recreate the opener chain.
625 int opener_route_id = delegate_->CreateOpenerRenderViewsForRenderManager(
626 render_frame_host_->GetSiteInstance());
627 if (!InitRenderView(render_frame_host_->render_view_host(),
628 opener_route_id,
629 MSG_ROUTING_NONE,
630 frame_tree_node_->IsMainFrame())) {
631 return;
632 }
633 }
634
621 frame_tree_node_->navigator()->CommitNavigation( 635 frame_tree_node_->navigator()->CommitNavigation(
622 render_frame_host_.get(), info); 636 render_frame_host_.get(), info);
623 } 637 }
624 638
625 void RenderFrameHostManager::Observe( 639 void RenderFrameHostManager::Observe(
626 int type, 640 int type,
627 const NotificationSource& source, 641 const NotificationSource& source,
628 const NotificationDetails& details) { 642 const NotificationDetails& details) {
629 switch (type) { 643 switch (type) {
630 case NOTIFICATION_RENDERER_PROCESS_CLOSED: 644 case NOTIFICATION_RENDERER_PROCESS_CLOSED:
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 void RenderFrameHostManager::DeleteRenderFrameProxyHost( 1687 void RenderFrameHostManager::DeleteRenderFrameProxyHost(
1674 SiteInstance* instance) { 1688 SiteInstance* instance) {
1675 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); 1689 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId());
1676 if (iter != proxy_hosts_.end()) { 1690 if (iter != proxy_hosts_.end()) {
1677 delete iter->second; 1691 delete iter->second;
1678 proxy_hosts_.erase(iter); 1692 proxy_hosts_.erase(iter);
1679 } 1693 }
1680 } 1694 }
1681 1695
1682 } // namespace content 1696 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698