| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 // static | 48 // static |
| 49 RenderFrameProxy* RenderFrameProxy::CreateProxyToReplaceFrame( | 49 RenderFrameProxy* RenderFrameProxy::CreateProxyToReplaceFrame( |
| 50 RenderFrameImpl* frame_to_replace, | 50 RenderFrameImpl* frame_to_replace, |
| 51 int routing_id, | 51 int routing_id, |
| 52 blink::WebTreeScopeType scope) { | 52 blink::WebTreeScopeType scope) { |
| 53 CHECK_NE(routing_id, MSG_ROUTING_NONE); | 53 CHECK_NE(routing_id, MSG_ROUTING_NONE); |
| 54 | 54 |
| 55 scoped_ptr<RenderFrameProxy> proxy( | 55 std::unique_ptr<RenderFrameProxy> proxy( |
| 56 new RenderFrameProxy(routing_id, frame_to_replace->GetRoutingID())); | 56 new RenderFrameProxy(routing_id, frame_to_replace->GetRoutingID())); |
| 57 | 57 |
| 58 // When a RenderFrame is replaced by a RenderProxy, the WebRemoteFrame should | 58 // When a RenderFrame is replaced by a RenderProxy, the WebRemoteFrame should |
| 59 // always come from WebRemoteFrame::create and a call to WebFrame::swap must | 59 // always come from WebRemoteFrame::create and a call to WebFrame::swap must |
| 60 // follow later. | 60 // follow later. |
| 61 blink::WebRemoteFrame* web_frame = | 61 blink::WebRemoteFrame* web_frame = |
| 62 blink::WebRemoteFrame::create(scope, proxy.get()); | 62 blink::WebRemoteFrame::create(scope, proxy.get()); |
| 63 | 63 |
| 64 // If frame_to_replace has a RenderFrameProxy parent, then its | 64 // If frame_to_replace has a RenderFrameProxy parent, then its |
| 65 // RenderWidget will be destroyed along with it, so the new | 65 // RenderWidget will be destroyed along with it, so the new |
| (...skipping 21 matching lines...) Expand all Loading... |
| 87 // It is possible that the parent proxy has been detached in this renderer | 87 // It is possible that the parent proxy has been detached in this renderer |
| 88 // process, just as the parent's real frame was creating this child frame. | 88 // process, just as the parent's real frame was creating this child frame. |
| 89 // In this case, do not create the proxy. See https://crbug.com/568670. | 89 // In this case, do not create the proxy. See https://crbug.com/568670. |
| 90 if (!parent) | 90 if (!parent) |
| 91 return nullptr; | 91 return nullptr; |
| 92 } | 92 } |
| 93 | 93 |
| 94 blink::WebFrame* opener = | 94 blink::WebFrame* opener = |
| 95 RenderFrameImpl::ResolveOpener(opener_routing_id, nullptr); | 95 RenderFrameImpl::ResolveOpener(opener_routing_id, nullptr); |
| 96 | 96 |
| 97 scoped_ptr<RenderFrameProxy> proxy( | 97 std::unique_ptr<RenderFrameProxy> proxy( |
| 98 new RenderFrameProxy(routing_id, MSG_ROUTING_NONE)); | 98 new RenderFrameProxy(routing_id, MSG_ROUTING_NONE)); |
| 99 RenderViewImpl* render_view = nullptr; | 99 RenderViewImpl* render_view = nullptr; |
| 100 RenderWidget* render_widget = nullptr; | 100 RenderWidget* render_widget = nullptr; |
| 101 blink::WebRemoteFrame* web_frame = nullptr; | 101 blink::WebRemoteFrame* web_frame = nullptr; |
| 102 | 102 |
| 103 if (!parent) { | 103 if (!parent) { |
| 104 // Create a top level WebRemoteFrame. | 104 // Create a top level WebRemoteFrame. |
| 105 render_view = RenderViewImpl::FromRoutingID(render_view_routing_id); | 105 render_view = RenderViewImpl::FromRoutingID(render_view_routing_id); |
| 106 web_frame = blink::WebRemoteFrame::create(replicated_state.scope, | 106 web_frame = blink::WebRemoteFrame::create(replicated_state.scope, |
| 107 proxy.get(), opener); | 107 proxy.get(), opener); |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 blink::WebLocalFrame* source) { | 470 blink::WebLocalFrame* source) { |
| 471 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 471 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
| 472 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 472 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
| 473 } | 473 } |
| 474 | 474 |
| 475 void RenderFrameProxy::frameFocused() { | 475 void RenderFrameProxy::frameFocused() { |
| 476 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 476 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace | 479 } // namespace |
| OLD | NEW |