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

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

Issue 2496233003: Destroy the old RenderWidgetHostView when swapping out a main frame. (Closed)
Patch Set: rebase Created 4 years 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 (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 4895 matching lines...) Expand 10 before | Expand all | Expand 10 after
4906 } 4906 }
4907 4907
4908 bool WebContentsImpl::CreateRenderViewForRenderManager( 4908 bool WebContentsImpl::CreateRenderViewForRenderManager(
4909 RenderViewHost* render_view_host, 4909 RenderViewHost* render_view_host,
4910 int opener_frame_routing_id, 4910 int opener_frame_routing_id,
4911 int proxy_routing_id, 4911 int proxy_routing_id,
4912 const FrameReplicationState& replicated_frame_state) { 4912 const FrameReplicationState& replicated_frame_state) {
4913 TRACE_EVENT0("browser,navigation", 4913 TRACE_EVENT0("browser,navigation",
4914 "WebContentsImpl::CreateRenderViewForRenderManager"); 4914 "WebContentsImpl::CreateRenderViewForRenderManager");
4915 4915
4916 if (proxy_routing_id == MSG_ROUTING_NONE) 4916 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(render_view_host);
4917
4918 // We only create a RWHV for active RenderViewHosts. When an inactive RVH is
4919 // reused, the RWHV is created in RenderFrameHostManager::CommitPending.
4920 if (rvhi->is_active()) {
4921 DCHECK_EQ(MSG_ROUTING_NONE, proxy_routing_id);
4917 CreateRenderWidgetHostViewForRenderManager(render_view_host); 4922 CreateRenderWidgetHostViewForRenderManager(render_view_host);
4923 }
4918 4924
4919 if (!static_cast<RenderViewHostImpl*>(render_view_host) 4925 if (!rvhi->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
4920 ->CreateRenderView(opener_frame_routing_id, 4926 replicated_frame_state, created_with_opener_)) {
4921 proxy_routing_id,
4922 replicated_frame_state,
4923 created_with_opener_)) {
4924 return false; 4927 return false;
4925 } 4928 }
4926 4929
4927 SetHistoryOffsetAndLengthForView(render_view_host, 4930 SetHistoryOffsetAndLengthForView(render_view_host,
4928 controller_.GetLastCommittedEntryIndex(), 4931 controller_.GetLastCommittedEntryIndex(),
4929 controller_.GetEntryCount()); 4932 controller_.GetEntryCount());
4930 4933
4931 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 4934 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
4932 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 4935 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
4933 // linux. See crbug.com/83941. 4936 // linux. See crbug.com/83941.
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
5281 dialog_manager_ = dialog_manager; 5284 dialog_manager_ = dialog_manager;
5282 } 5285 }
5283 5286
5284 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5287 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5285 auto it = binding_sets_.find(interface_name); 5288 auto it = binding_sets_.find(interface_name);
5286 if (it != binding_sets_.end()) 5289 if (it != binding_sets_.end())
5287 binding_sets_.erase(it); 5290 binding_sets_.erase(it);
5288 } 5291 }
5289 5292
5290 } // namespace content 5293 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698