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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2786443003: Revert "Destroy the old RenderWidgetHostView when swapping out a main frame." (Closed)
Patch Set: Created 3 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
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 4965 matching lines...) Expand 10 before | Expand all | Expand 10 after
4976 } 4976 }
4977 4977
4978 bool WebContentsImpl::CreateRenderViewForRenderManager( 4978 bool WebContentsImpl::CreateRenderViewForRenderManager(
4979 RenderViewHost* render_view_host, 4979 RenderViewHost* render_view_host,
4980 int opener_frame_routing_id, 4980 int opener_frame_routing_id,
4981 int proxy_routing_id, 4981 int proxy_routing_id,
4982 const FrameReplicationState& replicated_frame_state) { 4982 const FrameReplicationState& replicated_frame_state) {
4983 TRACE_EVENT0("browser,navigation", 4983 TRACE_EVENT0("browser,navigation",
4984 "WebContentsImpl::CreateRenderViewForRenderManager"); 4984 "WebContentsImpl::CreateRenderViewForRenderManager");
4985 4985
4986 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(render_view_host); 4986 if (proxy_routing_id == MSG_ROUTING_NONE)
4987 CreateRenderWidgetHostViewForRenderManager(render_view_host);
4987 4988
4988 // We only create a RWHV for active RenderViewHosts. When an inactive RVH is 4989 if (!static_cast<RenderViewHostImpl*>(render_view_host)
4989 // reused, the RWHV is created in RenderFrameHostManager::CommitPending. 4990 ->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
4990 if (rvhi->is_active()) {
4991 DCHECK_EQ(MSG_ROUTING_NONE, proxy_routing_id);
4992 CreateRenderWidgetHostViewForRenderManager(render_view_host);
4993 }
4994
4995 if (!rvhi->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
4996 replicated_frame_state, created_with_opener_)) { 4991 replicated_frame_state, created_with_opener_)) {
4997 return false; 4992 return false;
4998 } 4993 }
4999 4994
5000 SetHistoryOffsetAndLengthForView(render_view_host, 4995 SetHistoryOffsetAndLengthForView(render_view_host,
5001 controller_.GetLastCommittedEntryIndex(), 4996 controller_.GetLastCommittedEntryIndex(),
5002 controller_.GetEntryCount()); 4997 controller_.GetEntryCount());
5003 4998
5004 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 4999 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
5005 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 5000 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
5411 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5406 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5412 if (!render_view_host) 5407 if (!render_view_host)
5413 continue; 5408 continue;
5414 render_view_host_set.insert(render_view_host); 5409 render_view_host_set.insert(render_view_host);
5415 } 5410 }
5416 for (RenderViewHost* render_view_host : render_view_host_set) 5411 for (RenderViewHost* render_view_host : render_view_host_set)
5417 render_view_host->OnWebkitPreferencesChanged(); 5412 render_view_host->OnWebkitPreferencesChanged();
5418 } 5413 }
5419 5414
5420 } // namespace content 5415 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698