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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (!render_view->is_swapped_out()) | 118 if (!render_view->is_swapped_out()) |
119 render_view->SetSwappedOut(true); | 119 render_view->SetSwappedOut(true); |
120 } else { | 120 } else { |
121 // Create a frame under an existing parent. The parent is always expected | 121 // Create a frame under an existing parent. The parent is always expected |
122 // to be a RenderFrameProxy, because navigations initiated by local frames | 122 // to be a RenderFrameProxy, because navigations initiated by local frames |
123 // should not wind up here. | 123 // should not wind up here. |
124 | 124 |
125 web_frame = parent->web_frame()->createRemoteChild( | 125 web_frame = parent->web_frame()->createRemoteChild( |
126 replicated_state.scope, | 126 replicated_state.scope, |
127 blink::WebString::fromUTF8(replicated_state.name), | 127 blink::WebString::fromUTF8(replicated_state.name), |
128 blink::WebString::fromUTF8(replicated_state.unique_name), | |
129 replicated_state.sandbox_flags, proxy.get(), opener); | 128 replicated_state.sandbox_flags, proxy.get(), opener); |
| 129 proxy->unique_name_ = replicated_state.unique_name; |
130 render_view = parent->render_view(); | 130 render_view = parent->render_view(); |
131 render_widget = parent->render_widget(); | 131 render_widget = parent->render_widget(); |
132 } | 132 } |
133 | 133 |
134 proxy->Init(web_frame, render_view, render_widget); | 134 proxy->Init(web_frame, render_view, render_widget); |
135 | 135 |
136 // Initialize proxy's WebRemoteFrame with the security origin and other | 136 // Initialize proxy's WebRemoteFrame with the security origin and other |
137 // replicated information. | 137 // replicated information. |
138 // TODO(dcheng): Calling this when parent_routing_id != MSG_ROUTING_NONE is | 138 // TODO(dcheng): Calling this when parent_routing_id != MSG_ROUTING_NONE is |
139 // mostly redundant, since we already pass the name and sandbox flags in | 139 // mostly redundant, since we already pass the name and sandbox flags in |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 void RenderFrameProxy::DidCommitCompositorFrame() { | 215 void RenderFrameProxy::DidCommitCompositorFrame() { |
216 } | 216 } |
217 | 217 |
218 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { | 218 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { |
219 DCHECK(web_frame_); | 219 DCHECK(web_frame_); |
220 web_frame_->setReplicatedOrigin(state.origin); | 220 web_frame_->setReplicatedOrigin(state.origin); |
221 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); | 221 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); |
222 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name), | 222 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name)); |
223 blink::WebString::fromUTF8(state.unique_name)); | |
224 web_frame_->setReplicatedInsecureRequestPolicy(state.insecure_request_policy); | 223 web_frame_->setReplicatedInsecureRequestPolicy(state.insecure_request_policy); |
225 web_frame_->setReplicatedPotentiallyTrustworthyUniqueOrigin( | 224 web_frame_->setReplicatedPotentiallyTrustworthyUniqueOrigin( |
226 state.has_potentially_trustworthy_unique_origin); | 225 state.has_potentially_trustworthy_unique_origin); |
227 web_frame_->setReplicatedFeaturePolicyHeader( | 226 web_frame_->setReplicatedFeaturePolicyHeader( |
228 FeaturePolicyHeaderToWeb(state.feature_policy_header)); | 227 FeaturePolicyHeaderToWeb(state.feature_policy_header)); |
229 if (state.has_received_user_gesture) | 228 if (state.has_received_user_gesture) |
230 web_frame_->setHasReceivedUserGesture(); | 229 web_frame_->setHasReceivedUserGesture(); |
231 | 230 |
232 web_frame_->resetReplicatedContentSecurityPolicy(); | 231 web_frame_->resetReplicatedContentSecurityPolicy(); |
233 for (const auto& header : state.accumulated_csp_headers) | 232 for (const auto& header : state.accumulated_csp_headers) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 void RenderFrameProxy::OnDidStopLoading() { | 338 void RenderFrameProxy::OnDidStopLoading() { |
340 web_frame_->didStopLoading(); | 339 web_frame_->didStopLoading(); |
341 } | 340 } |
342 | 341 |
343 void RenderFrameProxy::OnDispatchLoad() { | 342 void RenderFrameProxy::OnDispatchLoad() { |
344 web_frame_->dispatchLoadEventOnFrameOwner(); | 343 web_frame_->dispatchLoadEventOnFrameOwner(); |
345 } | 344 } |
346 | 345 |
347 void RenderFrameProxy::OnDidUpdateName(const std::string& name, | 346 void RenderFrameProxy::OnDidUpdateName(const std::string& name, |
348 const std::string& unique_name) { | 347 const std::string& unique_name) { |
349 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name), | 348 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name)); |
350 blink::WebString::fromUTF8(unique_name)); | 349 unique_name_ = unique_name; |
351 } | 350 } |
352 | 351 |
353 void RenderFrameProxy::OnAddContentSecurityPolicy( | 352 void RenderFrameProxy::OnAddContentSecurityPolicy( |
354 const ContentSecurityPolicyHeader& header) { | 353 const ContentSecurityPolicyHeader& header) { |
355 web_frame_->addReplicatedContentSecurityPolicyHeader( | 354 web_frame_->addReplicatedContentSecurityPolicyHeader( |
356 blink::WebString::fromUTF8(header.header_value), header.type, | 355 blink::WebString::fromUTF8(header.header_value), header.type, |
357 header.source); | 356 header.source); |
358 } | 357 } |
359 | 358 |
360 void RenderFrameProxy::OnResetContentSecurityPolicy() { | 359 void RenderFrameProxy::OnResetContentSecurityPolicy() { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 blink::WebLocalFrame* source) { | 525 blink::WebLocalFrame* source) { |
527 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 526 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
528 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 527 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
529 } | 528 } |
530 | 529 |
531 void RenderFrameProxy::frameFocused() { | 530 void RenderFrameProxy::frameFocused() { |
532 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 531 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
533 } | 532 } |
534 | 533 |
535 } // namespace | 534 } // namespace |
OLD | NEW |