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

Side by Side Diff: content/renderer/render_frame_proxy.cc

Issue 2410153005: Fix RenderView reuse issues when canceling a pending RenderFrameHost. (Closed)
Patch Set: Rebase Created 4 years, 2 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') | content/renderer/render_widget.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/renderer/render_frame_proxy.h" 5 #include "content/renderer/render_frame_proxy.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 RenderWidget* render_widget = nullptr; 104 RenderWidget* render_widget = nullptr;
105 blink::WebRemoteFrame* web_frame = nullptr; 105 blink::WebRemoteFrame* web_frame = nullptr;
106 106
107 if (!parent) { 107 if (!parent) {
108 // Create a top level WebRemoteFrame. 108 // Create a top level WebRemoteFrame.
109 render_view = RenderViewImpl::FromRoutingID(render_view_routing_id); 109 render_view = RenderViewImpl::FromRoutingID(render_view_routing_id);
110 web_frame = blink::WebRemoteFrame::create(replicated_state.scope, 110 web_frame = blink::WebRemoteFrame::create(replicated_state.scope,
111 proxy.get(), opener); 111 proxy.get(), opener);
112 render_view->webview()->setMainFrame(web_frame); 112 render_view->webview()->setMainFrame(web_frame);
113 render_widget = render_view->GetWidget(); 113 render_widget = render_view->GetWidget();
114
115 // If the RenderView is reused by this proxy after having been used for a
116 // pending RenderFrame that was discarded, its swapped out state needs to
117 // be updated, as the OnSwapOut flow which normally does this won't happen
118 // in that case. See https://crbug.com/653746 and
119 // https://crbug.com/651980.
120 if (!render_view->is_swapped_out())
121 render_view->SetSwappedOut(true);
114 } else { 122 } else {
115 // Create a frame under an existing parent. The parent is always expected 123 // Create a frame under an existing parent. The parent is always expected
116 // to be a RenderFrameProxy, because navigations initiated by local frames 124 // to be a RenderFrameProxy, because navigations initiated by local frames
117 // should not wind up here. 125 // should not wind up here.
118 126
119 web_frame = parent->web_frame()->createRemoteChild( 127 web_frame = parent->web_frame()->createRemoteChild(
120 replicated_state.scope, 128 replicated_state.scope,
121 blink::WebString::fromUTF8(replicated_state.name), 129 blink::WebString::fromUTF8(replicated_state.name),
122 blink::WebString::fromUTF8(replicated_state.unique_name), 130 blink::WebString::fromUTF8(replicated_state.unique_name),
123 replicated_state.sandbox_flags, proxy.get(), opener); 131 replicated_state.sandbox_flags, proxy.get(), opener);
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 blink::WebLocalFrame* source) { 503 blink::WebLocalFrame* source) {
496 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); 504 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID();
497 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); 505 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id));
498 } 506 }
499 507
500 void RenderFrameProxy::frameFocused() { 508 void RenderFrameProxy::frameFocused() {
501 Send(new FrameHostMsg_FrameFocused(routing_id_)); 509 Send(new FrameHostMsg_FrameFocused(routing_id_));
502 } 510 }
503 511
504 } // namespace 512 } // namespace
OLDNEW
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698