Chromium Code Reviews| Index: content/renderer/render_frame_impl.cc |
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
| index 9dfdf6b0a1a9a383e1a3c5da5997b169842dba26..77a8c1b88c5a261c3508297f2604888a2439598f 100644 |
| --- a/content/renderer/render_frame_impl.cc |
| +++ b/content/renderer/render_frame_impl.cc |
| @@ -34,6 +34,7 @@ |
| #include "content/child/weburlresponse_extradata_impl.h" |
| #include "content/common/clipboard_messages.h" |
| #include "content/common/frame_messages.h" |
| +#include "content/common/frame_replication_state.h" |
| #include "content/common/input_messages.h" |
| #include "content/common/service_worker/service_worker_types.h" |
| #include "content/common/swapped_out_messages.h" |
| @@ -1106,7 +1107,9 @@ void RenderFrameImpl::OnBeforeUnload() { |
| before_unload_end_time)); |
| } |
| -void RenderFrameImpl::OnSwapOut(int proxy_routing_id) { |
| +void RenderFrameImpl::OnSwapOut( |
| + int proxy_routing_id, |
| + const FrameReplicationState& remote_frame_state) { |
| TRACE_EVENT1("navigation", "RenderFrameImpl::OnSwapOut", "id", routing_id_); |
| RenderFrameProxy* proxy = NULL; |
| bool is_site_per_process = |
| @@ -1192,6 +1195,20 @@ void RenderFrameImpl::OnSwapOut(int proxy_routing_id) { |
| } |
| } |
| + // initialize remote frame with the security origin that was passed to us |
|
Charlie Reis
2014/11/13 18:00:58
nit: Initialize the RemoteFrame with the replicati
alexmos
2014/11/18 18:25:33
Done. Actually, rephrased a bit and used "WebRemo
|
| + // from the process that is now rendering the frame. |
| + // TODO(alexmos): we cannot yet do this for swapped-out main frames, |
|
Charlie Reis
2014/11/13 18:00:58
nit: We
This TODO is what Nasko is currently work
alexmos
2014/11/18 18:25:33
Done.
|
| + // because in that case we leave the LocalFrame as the main frame visible to |
| + // Blink and don't call swap() above. Because swap() is what creates a |
| + // RemoteFrame in proxy->web_frame(), the RemoteFrame will not exist for main |
| + // frames. When we do an unconditional swap for all frames, we can remove |
| + // !is_main_frame below. |
| + if (is_site_per_process && proxy && !is_main_frame) { |
| + proxy->web_frame()->setReplicatedOrigin( |
| + blink::WebURL(GURL(remote_frame_state.origin.string())), |
| + remote_frame_state.is_unique_origin); |
| + } |
| + |
| // Safe to exit if no one else is using the process. |
| if (is_main_frame) |
| render_view_->WasSwappedOut(); |