Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "content/common/frame_messages.h" | 10 #include "content/common/frame_messages.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 // static | 33 // static |
| 34 RenderFrameProxy* RenderFrameProxy::CreateProxyToReplaceFrame( | 34 RenderFrameProxy* RenderFrameProxy::CreateProxyToReplaceFrame( |
| 35 RenderFrameImpl* frame_to_replace, | 35 RenderFrameImpl* frame_to_replace, |
| 36 int routing_id) { | 36 int routing_id) { |
| 37 CHECK_NE(routing_id, MSG_ROUTING_NONE); | 37 CHECK_NE(routing_id, MSG_ROUTING_NONE); |
| 38 | 38 |
| 39 scoped_ptr<RenderFrameProxy> proxy( | 39 scoped_ptr<RenderFrameProxy> proxy( |
| 40 new RenderFrameProxy(routing_id, frame_to_replace->GetRoutingID())); | 40 new RenderFrameProxy(routing_id, frame_to_replace->GetRoutingID())); |
| 41 | 41 |
| 42 blink::WebRemoteFrame* web_frame = NULL; | 42 // When a RenderFrame will be replaced by a RenderProxy, the WebRemoteFrame |
|
Charlie Reis
2014/08/19 21:32:32
nit: will be -> is
nasko
2014/08/20 14:15:17
Done.
| |
| 43 if (frame_to_replace->GetWebFrame()->parent() && | 43 // should always come from WebRemoteFrame::create and a call to WebFrame::swap |
| 44 frame_to_replace->GetWebFrame()->parent()->isWebRemoteFrame()) { | 44 // must follow later. |
| 45 blink::WebRemoteFrame* parent_web_frame = | 45 blink::WebRemoteFrame* web_frame = blink::WebRemoteFrame::create(proxy.get()); |
|
Charlie Reis
2014/08/19 21:32:32
I don't fully understand why the old code was unne
nasko
2014/08/20 14:15:17
It was just wrong before. It was hitting an ASSERT
Charlie Reis
2014/08/20 17:09:37
Acknowledged.
| |
| 46 frame_to_replace->GetWebFrame()->parent()->toWebRemoteFrame(); | |
| 47 web_frame = parent_web_frame->createRemoteChild("", proxy.get()); | |
| 48 } else { | |
| 49 web_frame = blink::WebRemoteFrame::create(proxy.get()); | |
| 50 } | |
| 51 | |
| 52 proxy->Init(web_frame, frame_to_replace->render_view()); | 46 proxy->Init(web_frame, frame_to_replace->render_view()); |
| 53 return proxy.release(); | 47 return proxy.release(); |
| 54 } | 48 } |
| 55 | 49 |
| 56 RenderFrameProxy* RenderFrameProxy::CreateFrameProxy( | 50 RenderFrameProxy* RenderFrameProxy::CreateFrameProxy( |
| 57 int routing_id, | 51 int routing_id, |
| 58 int parent_routing_id, | 52 int parent_routing_id, |
| 59 int render_view_routing_id) { | 53 int render_view_routing_id) { |
| 60 scoped_ptr<RenderFrameProxy> proxy( | 54 scoped_ptr<RenderFrameProxy> proxy( |
| 61 new RenderFrameProxy(routing_id, MSG_ROUTING_NONE)); | 55 new RenderFrameProxy(routing_id, MSG_ROUTING_NONE)); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 compositing_helper_->EnableCompositing(true); | 214 compositing_helper_->EnableCompositing(true); |
| 221 } | 215 } |
| 222 compositing_helper_->OnCompositorFrameSwapped(frame.Pass(), | 216 compositing_helper_->OnCompositorFrameSwapped(frame.Pass(), |
| 223 param.a.producing_route_id, | 217 param.a.producing_route_id, |
| 224 param.a.output_surface_id, | 218 param.a.output_surface_id, |
| 225 param.a.producing_host_id, | 219 param.a.producing_host_id, |
| 226 param.a.shared_memory_handle); | 220 param.a.shared_memory_handle); |
| 227 } | 221 } |
| 228 | 222 |
| 229 } // namespace | 223 } // namespace |
| OLD | NEW |