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

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

Issue 1142123002: Remove swapped-out usage in --site-per-process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another round of fixes. Created 5 years, 6 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/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_browsertest.cc » ('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 <map> 7 #include <map>
8 8
9 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
10 #include "content/child/webmessageportchannel_impl.h" 11 #include "content/child/webmessageportchannel_impl.h"
11 #include "content/common/frame_messages.h" 12 #include "content/common/frame_messages.h"
12 #include "content/common/frame_replication_state.h" 13 #include "content/common/frame_replication_state.h"
13 #include "content/common/swapped_out_messages.h" 14 #include "content/common/swapped_out_messages.h"
14 #include "content/common/view_messages.h" 15 #include "content/common/view_messages.h"
16 #include "content/public/common/content_switches.h"
15 #include "content/renderer/child_frame_compositing_helper.h" 17 #include "content/renderer/child_frame_compositing_helper.h"
16 #include "content/renderer/render_frame_impl.h" 18 #include "content/renderer/render_frame_impl.h"
17 #include "content/renderer/render_thread_impl.h" 19 #include "content/renderer/render_thread_impl.h"
18 #include "content/renderer/render_view_impl.h" 20 #include "content/renderer/render_view_impl.h"
19 #include "third_party/WebKit/public/platform/WebString.h" 21 #include "third_party/WebKit/public/platform/WebString.h"
20 #include "third_party/WebKit/public/web/WebLocalFrame.h" 22 #include "third_party/WebKit/public/web/WebLocalFrame.h"
21 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" 23 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
22 #include "third_party/WebKit/public/web/WebView.h" 24 #include "third_party/WebKit/public/web/WebView.h"
23 25
24 namespace content { 26 namespace content {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 RenderFrameProxy* RenderFrameProxy::CreateFrameProxy( 60 RenderFrameProxy* RenderFrameProxy::CreateFrameProxy(
59 int routing_id, 61 int routing_id,
60 int parent_routing_id, 62 int parent_routing_id,
61 int render_view_routing_id, 63 int render_view_routing_id,
62 const FrameReplicationState& replicated_state) { 64 const FrameReplicationState& replicated_state) {
63 scoped_ptr<RenderFrameProxy> proxy( 65 scoped_ptr<RenderFrameProxy> proxy(
64 new RenderFrameProxy(routing_id, MSG_ROUTING_NONE)); 66 new RenderFrameProxy(routing_id, MSG_ROUTING_NONE));
65 RenderViewImpl* render_view = NULL; 67 RenderViewImpl* render_view = NULL;
66 blink::WebRemoteFrame* web_frame = NULL; 68 blink::WebRemoteFrame* web_frame = NULL;
67 if (parent_routing_id == MSG_ROUTING_NONE) { 69 if (parent_routing_id == MSG_ROUTING_NONE) {
68 // Create a top level frame. 70 // Create a top level WebRemoteFrame.
69 render_view = RenderViewImpl::FromRoutingID(render_view_routing_id); 71 render_view = RenderViewImpl::FromRoutingID(render_view_routing_id);
70 web_frame = 72 web_frame =
71 blink::WebRemoteFrame::create(replicated_state.scope, proxy.get()); 73 blink::WebRemoteFrame::create(replicated_state.scope, proxy.get());
72 render_view->webview()->setMainFrame(web_frame); 74 render_view->webview()->setMainFrame(web_frame);
73 } else { 75 } else {
74 // Create a frame under an existing parent. The parent is always expected 76 // Create a frame under an existing parent. The parent is always expected
75 // to be a RenderFrameProxy, because navigations initiated by local frames 77 // to be a RenderFrameProxy, because navigations initiated by local frames
76 // should not wind up here. 78 // should not wind up here.
77 RenderFrameProxy* parent = 79 RenderFrameProxy* parent =
78 RenderFrameProxy::FromRoutingID(parent_routing_id); 80 RenderFrameProxy::FromRoutingID(parent_routing_id);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 287
286 void RenderFrameProxy::OnDisownOpener() { 288 void RenderFrameProxy::OnDisownOpener() {
287 // TODO(creis): We should only see this for main frames for now. To support 289 // TODO(creis): We should only see this for main frames for now. To support
288 // disowning the opener on subframes, we will need to move WebContentsImpl's 290 // disowning the opener on subframes, we will need to move WebContentsImpl's
289 // opener_ to FrameTreeNode. 291 // opener_ to FrameTreeNode.
290 CHECK(!web_frame_->parent()); 292 CHECK(!web_frame_->parent());
291 293
292 // When there is a RenderFrame for this proxy, tell it to disown its opener. 294 // When there is a RenderFrame for this proxy, tell it to disown its opener.
293 // TODO(creis): Remove this when we only have WebRemoteFrames and make sure 295 // TODO(creis): Remove this when we only have WebRemoteFrames and make sure
294 // they know they have an opener. 296 // they know they have an opener.
295 RenderFrameImpl* render_frame = 297 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
296 RenderFrameImpl::FromRoutingID(frame_routing_id_); 298 switches::kSitePerProcess)) {
297 if (render_frame) { 299 RenderFrameImpl* render_frame =
298 if (render_frame->GetWebFrame()->opener()) 300 RenderFrameImpl::FromRoutingID(frame_routing_id_);
299 render_frame->GetWebFrame()->setOpener(NULL); 301 if (render_frame) {
300 return; 302 if (render_frame->GetWebFrame()->opener())
303 render_frame->GetWebFrame()->setOpener(NULL);
304 return;
305 }
301 } 306 }
302 307
303 if (web_frame_->opener()) 308 if (web_frame_->opener())
304 web_frame_->setOpener(NULL); 309 web_frame_->setOpener(NULL);
305 } 310 }
306 311
307 void RenderFrameProxy::OnDidStartLoading() { 312 void RenderFrameProxy::OnDidStartLoading() {
308 if (IsMainFrameDetachedFromTree()) 313 if (IsMainFrameDetachedFromTree())
309 return; 314 return;
310 315
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 blink::WebUserGestureIndicator::isProcessingUserGesture(); 415 blink::WebUserGestureIndicator::isProcessingUserGesture();
411 blink::WebUserGestureIndicator::consumeUserGesture(); 416 blink::WebUserGestureIndicator::consumeUserGesture();
412 Send(new FrameHostMsg_OpenURL(routing_id_, params)); 417 Send(new FrameHostMsg_OpenURL(routing_id_, params));
413 } 418 }
414 419
415 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { 420 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) {
416 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); 421 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event));
417 } 422 }
418 423
419 } // namespace 424 } // namespace
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698