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

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Addressing 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/browser/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 99c60f66f417b1c746c296d2a54dc34f1d387aeb..dd52d622cc7dabca3630645b565decf989710c57 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -435,9 +435,9 @@ void RenderFrameHostManager::DidNavigateFrame(
bool was_caused_by_user_gesture) {
CommitPendingIfNecessary(render_frame_host, was_caused_by_user_gesture);
- // Make sure any dynamic changes to this frame's sandbox flags that were made
- // prior to navigation take effect.
- CommitPendingSandboxFlags();
+ // Make sure any dynamic changes to this frame's sandbox flags and feature
+ // policy that were made prior to navigation take effect.
+ CommitPendingFramePolicy();
}
void RenderFrameHostManager::CommitPendingIfNecessary(
@@ -537,23 +537,25 @@ void RenderFrameHostManager::DidChangeOpener(
}
}
-void RenderFrameHostManager::CommitPendingSandboxFlags() {
- // Return early if there were no pending sandbox flags updates.
- if (!frame_tree_node_->CommitPendingSandboxFlags())
+void RenderFrameHostManager::CommitPendingFramePolicy() {
+ // Return early if there were no pending updates to sandbox flags or container
+ // policy.
+ if (!frame_tree_node_->CommitPendingFramePolicy())
return;
- // Sandbox flags updates can only happen when the frame has a parent.
+ // Policy updates can only happen when the frame has a parent.
CHECK(frame_tree_node_->parent());
- // Notify all of the frame's proxies about updated sandbox flags, excluding
- // the parent process since it already knows the latest flags.
+ // Notify all of the frame's proxies about updated policies, excluding
+ // the parent process since it already knows the latest state.
SiteInstance* parent_site_instance =
frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
for (const auto& pair : proxy_hosts_) {
if (pair.second->GetSiteInstance() != parent_site_instance) {
- pair.second->Send(new FrameMsg_DidUpdateSandboxFlags(
+ pair.second->Send(new FrameMsg_DidUpdateFramePolicy(
pair.second->GetRoutingID(),
- frame_tree_node_->current_replication_state().sandbox_flags));
+ frame_tree_node_->current_replication_state().sandbox_flags,
+ frame_tree_node_->current_replication_state().container_policy));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698