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

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 4890 matching lines...) Expand 10 before | Expand all | Expand 10 after
4901 } 4901 }
4902 4902
4903 bool WebContentsImpl::CreateRenderViewForRenderManager( 4903 bool WebContentsImpl::CreateRenderViewForRenderManager(
4904 RenderViewHost* render_view_host, 4904 RenderViewHost* render_view_host,
4905 int opener_frame_routing_id, 4905 int opener_frame_routing_id,
4906 int proxy_routing_id, 4906 int proxy_routing_id,
4907 const FrameReplicationState& replicated_frame_state) { 4907 const FrameReplicationState& replicated_frame_state) {
4908 TRACE_EVENT0("browser,navigation", 4908 TRACE_EVENT0("browser,navigation",
4909 "WebContentsImpl::CreateRenderViewForRenderManager"); 4909 "WebContentsImpl::CreateRenderViewForRenderManager");
4910 4910
4911 if (proxy_routing_id == MSG_ROUTING_NONE) 4911 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(render_view_host);
4912
4913 // We only create a RWHV for active RenderViewHosts. When an inactive RVH is
4914 // reused, the RWHV is created in RenderFrameHostManager::CommitPending.
4915 if (rvhi->is_active()) {
4916 DCHECK_EQ(MSG_ROUTING_NONE, proxy_routing_id);
4912 CreateRenderWidgetHostViewForRenderManager(render_view_host); 4917 CreateRenderWidgetHostViewForRenderManager(render_view_host);
4918 }
4913 4919
4914 if (!static_cast<RenderViewHostImpl*>(render_view_host) 4920 if (!rvhi->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
4915 ->CreateRenderView(opener_frame_routing_id, 4921 replicated_frame_state, created_with_opener_)) {
4916 proxy_routing_id,
4917 replicated_frame_state,
4918 created_with_opener_)) {
4919 return false; 4922 return false;
4920 } 4923 }
4921 4924
4922 SetHistoryOffsetAndLengthForView(render_view_host, 4925 SetHistoryOffsetAndLengthForView(render_view_host,
4923 controller_.GetLastCommittedEntryIndex(), 4926 controller_.GetLastCommittedEntryIndex(),
4924 controller_.GetEntryCount()); 4927 controller_.GetEntryCount());
4925 4928
4926 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 4929 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
4927 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 4930 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
4928 // linux. See crbug.com/83941. 4931 // linux. See crbug.com/83941.
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
5276 dialog_manager_ = dialog_manager; 5279 dialog_manager_ = dialog_manager;
5277 } 5280 }
5278 5281
5279 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5282 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5280 auto it = binding_sets_.find(interface_name); 5283 auto it = binding_sets_.find(interface_name);
5281 if (it != binding_sets_.end()) 5284 if (it != binding_sets_.end())
5282 binding_sets_.erase(it); 5285 binding_sets_.erase(it);
5283 } 5286 }
5284 5287
5285 } // namespace content 5288 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698