Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: content/renderer/render_frame_proxy.cc

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Cleanup, reponding to review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_proxy.cc
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc
index 0707dfdb34d4843d1459300f08a5d9dbbc29a2a5..b42dec7004f6a1fcdd4d92576fe4637a70fe6c0c 100644
--- a/content/renderer/render_frame_proxy.cc
+++ b/content/renderer/render_frame_proxy.cc
@@ -127,7 +127,9 @@ RenderFrameProxy* RenderFrameProxy::CreateFrameProxy(
web_frame = parent->web_frame()->createRemoteChild(
replicated_state.scope,
blink::WebString::fromUTF8(replicated_state.name),
- replicated_state.sandbox_flags, proxy.get(), opener);
+ replicated_state.sandbox_flags,
+ FeaturePolicyHeaderToWeb(replicated_state.container_policy),
lunalu1 2017/04/05 22:30:03 same here
iclelland 2017/04/09 03:25:54 Sorry, not sure what this refers to
+ proxy.get(), opener);
proxy->unique_name_ = replicated_state.unique_name;
render_view = parent->render_view();
render_widget = parent->render_widget();
@@ -235,7 +237,7 @@ void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) {
}
// Update the proxy's SecurityContext and FrameOwner with new sandbox flags
-// that were set by its parent in another process.
+// and container policy that were set by its parent in another process.
//
// Normally, when a frame's sandbox attribute is changed dynamically, the
// frame's FrameOwner is updated with the new sandbox flags right away, while
@@ -250,9 +252,13 @@ void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) {
// properly if this proxy ever parents a local frame. The proxy's FrameOwner
// flags are also updated here with the caveat that the FrameOwner won't learn
// about updates to its flags until they take effect.
-void RenderFrameProxy::OnDidUpdateSandboxFlags(blink::WebSandboxFlags flags) {
+void RenderFrameProxy::OnDidUpdateFramePolicy(
+ blink::WebSandboxFlags flags,
+ const ParsedFeaturePolicyHeader& container_policy) {
lunalu1 2017/04/05 22:30:03 Can we rename ParsedFeaturePolicyHeader to ParsedF
iclelland 2017/04/09 03:25:54 I'll file another CL to rename that, to avoid maki
web_frame_->setReplicatedSandboxFlags(flags);
web_frame_->setFrameOwnerSandboxFlags(flags);
+ web_frame_->setFrameOwnerContainerPolicy(
+ FeaturePolicyHeaderToWeb(container_policy));
}
bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) {
@@ -272,7 +278,7 @@ bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener)
IPC_MESSAGE_HANDLER(FrameMsg_DidStartLoading, OnDidStartLoading)
IPC_MESSAGE_HANDLER(FrameMsg_DidStopLoading, OnDidStopLoading)
- IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags)
+ IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateFramePolicy, OnDidUpdateFramePolicy)
IPC_MESSAGE_HANDLER(FrameMsg_DispatchLoad, OnDispatchLoad)
IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateName, OnDidUpdateName)
IPC_MESSAGE_HANDLER(FrameMsg_AddContentSecurityPolicies,

Powered by Google App Engine
This is Rietveld 408576698