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

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

Issue 2798673002: 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 4982 matching lines...) Expand 10 before | Expand all | Expand 10 after
4993 } 4993 }
4994 4994
4995 bool WebContentsImpl::CreateRenderViewForRenderManager( 4995 bool WebContentsImpl::CreateRenderViewForRenderManager(
4996 RenderViewHost* render_view_host, 4996 RenderViewHost* render_view_host,
4997 int opener_frame_routing_id, 4997 int opener_frame_routing_id,
4998 int proxy_routing_id, 4998 int proxy_routing_id,
4999 const FrameReplicationState& replicated_frame_state) { 4999 const FrameReplicationState& replicated_frame_state) {
5000 TRACE_EVENT0("browser,navigation", 5000 TRACE_EVENT0("browser,navigation",
5001 "WebContentsImpl::CreateRenderViewForRenderManager"); 5001 "WebContentsImpl::CreateRenderViewForRenderManager");
5002 5002
5003 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(render_view_host); 5003 if (proxy_routing_id == MSG_ROUTING_NONE)
5004 CreateRenderWidgetHostViewForRenderManager(render_view_host);
5004 5005
5005 // We only create a RWHV for active RenderViewHosts. When an inactive RVH is 5006 if (!static_cast<RenderViewHostImpl*>(render_view_host)
5006 // reused, the RWHV is created in RenderFrameHostManager::CommitPending. 5007 ->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
5007 if (rvhi->is_active()) {
5008 DCHECK_EQ(MSG_ROUTING_NONE, proxy_routing_id);
5009 CreateRenderWidgetHostViewForRenderManager(render_view_host);
5010 }
5011
5012 if (!rvhi->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
5013 replicated_frame_state, created_with_opener_)) { 5008 replicated_frame_state, created_with_opener_)) {
5014 return false; 5009 return false;
5015 } 5010 }
5016 5011
5017 SetHistoryOffsetAndLengthForView(render_view_host, 5012 SetHistoryOffsetAndLengthForView(render_view_host,
5018 controller_.GetLastCommittedEntryIndex(), 5013 controller_.GetLastCommittedEntryIndex(),
5019 controller_.GetEntryCount()); 5014 controller_.GetEntryCount());
5020 5015
5021 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 5016 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
5022 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 5017 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
5432 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5427 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5433 if (!render_view_host) 5428 if (!render_view_host)
5434 continue; 5429 continue;
5435 render_view_host_set.insert(render_view_host); 5430 render_view_host_set.insert(render_view_host);
5436 } 5431 }
5437 for (RenderViewHost* render_view_host : render_view_host_set) 5432 for (RenderViewHost* render_view_host : render_view_host_set)
5438 render_view_host->OnWebkitPreferencesChanged(); 5433 render_view_host->OnWebkitPreferencesChanged();
5439 } 5434 }
5440 5435
5441 } // namespace content 5436 } // 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