Commit 05334c25 authored by alexmos's avatar alexmos Committed by Commit bot

Send initializeChildFrame from RenderFrameProxy rather than WebLocalFrame (part 2).

Move initializeChildFrame from RenderFrameImpl to RenderFrameProxy.  Replace RenderFrameImpl::OnSwapOut's call to setIsRemote with WebRemoteFrame::initializeFromFrame that was introduced in part 1 of this change (https://codereview.chromium.org/591413004/)

This will be followed by another CL that will remove setIsRemote on the blink side.

BUG=416102

Review URL: https://codereview.chromium.org/592263002

Cr-Commit-Position: refs/heads/master@{#296822}
parent 5cbb7d7a
...@@ -1063,19 +1063,10 @@ void RenderFrameImpl::OnSwapOut(int proxy_routing_id) { ...@@ -1063,19 +1063,10 @@ void RenderFrameImpl::OnSwapOut(int proxy_routing_id) {
// frame? // frame?
OnStop(); OnStop();
// Let subframes know that the frame is now rendered remotely, for the // Transfer settings such as initial drawing parameters to the remote frame
// purposes of compositing and input events. // that will replace this frame.
if (!is_main_frame) { if (!is_main_frame)
// TODO(creis): Remove setIsRemote and send initializeChildFrame from the proxy->web_frame()->initializeFromFrame(frame_);
// RenderFrameProxy, since the RenderFrameHost may be deleted first. In
// the meantime, temporarily set this frame's proxy so that the message
// is sent via RenderFrameProxy.
// See http://crbug.com/416102.
DCHECK(!render_frame_proxy_);
set_render_frame_proxy(proxy);
frame_->setIsRemote(true);
set_render_frame_proxy(NULL);
}
// Replace the page with a blank dummy URL. The unload handler will not be // Replace the page with a blank dummy URL. The unload handler will not be
// run a second time, thanks to a check in FrameLoader::stopLoading. // run a second time, thanks to a check in FrameLoader::stopLoading.
...@@ -3180,12 +3171,6 @@ void RenderFrameImpl::forwardInputEvent(const blink::WebInputEvent* event) { ...@@ -3180,12 +3171,6 @@ void RenderFrameImpl::forwardInputEvent(const blink::WebInputEvent* event) {
Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event));
} }
void RenderFrameImpl::initializeChildFrame(const blink::WebRect& frame_rect,
float scale_factor) {
render_frame_proxy_->Send(new FrameHostMsg_InitializeChildFrame(
routing_id_, frame_rect, scale_factor));
}
blink::WebScreenOrientationClient* blink::WebScreenOrientationClient*
RenderFrameImpl::webScreenOrientationClient() { RenderFrameImpl::webScreenOrientationClient() {
if (!screen_orientation_dispatcher_) if (!screen_orientation_dispatcher_)
......
...@@ -441,8 +441,6 @@ class CONTENT_EXPORT RenderFrameImpl ...@@ -441,8 +441,6 @@ class CONTENT_EXPORT RenderFrameImpl
virtual void didLoseWebGLContext(blink::WebLocalFrame* frame, virtual void didLoseWebGLContext(blink::WebLocalFrame* frame,
int arb_robustness_status_code); int arb_robustness_status_code);
virtual void forwardInputEvent(const blink::WebInputEvent* event); virtual void forwardInputEvent(const blink::WebInputEvent* event);
virtual void initializeChildFrame(const blink::WebRect& frame_rect,
float scale_factor);
virtual blink::WebScreenOrientationClient* webScreenOrientationClient(); virtual blink::WebScreenOrientationClient* webScreenOrientationClient();
virtual bool isControlledByServiceWorker(); virtual bool isControlledByServiceWorker();
virtual void postAccessibilityEvent(const blink::WebAXObject& obj, virtual void postAccessibilityEvent(const blink::WebAXObject& obj,
......
...@@ -271,4 +271,11 @@ void RenderFrameProxy::postMessageEvent( ...@@ -271,4 +271,11 @@ void RenderFrameProxy::postMessageEvent(
Send(new ViewHostMsg_RouteMessageEvent(render_view_->GetRoutingID(), params)); Send(new ViewHostMsg_RouteMessageEvent(render_view_->GetRoutingID(), params));
} }
void RenderFrameProxy::initializeChildFrame(
const blink::WebRect& frame_rect,
float scale_factor) {
Send(new FrameHostMsg_InitializeChildFrame(
routing_id_, frame_rect, scale_factor));
}
} // namespace } // namespace
...@@ -99,6 +99,9 @@ class CONTENT_EXPORT RenderFrameProxy ...@@ -99,6 +99,9 @@ class CONTENT_EXPORT RenderFrameProxy
blink::WebRemoteFrame* targetFrame, blink::WebRemoteFrame* targetFrame,
blink::WebSecurityOrigin target, blink::WebSecurityOrigin target,
blink::WebDOMMessageEvent event); blink::WebDOMMessageEvent event);
virtual void initializeChildFrame(
const blink::WebRect& frame_rect,
float scale_factor);
private: private:
RenderFrameProxy(int routing_id, int frame_routing_id); RenderFrameProxy(int routing_id, int frame_routing_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment