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

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

Issue 2655463006: PlzNavigate: Enforce 'frame-src' CSP on the browser. (Closed)
Patch Set: Add TODO in the FrameLoader. Created 3 years, 10 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/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index 8bc73019f0b8317a3ba51dd915308c45b957c0f6..42c23f05a592b38a82dfcf1b3556c5e3aed9e07e 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -13,6 +13,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/profiler/scoped_tracker.h"
#include "base/stl_util.h"
+#include "content/browser/frame_host/csp_context_impl.h"
#include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/navigation_request.h"
#include "content/browser/frame_host/navigator.h"
@@ -117,7 +118,8 @@ FrameTreeNode::FrameTreeNode(FrameTree* frame_tree,
pending_sandbox_flags_(blink::WebSandboxFlags::None),
frame_owner_properties_(frame_owner_properties),
loading_progress_(kLoadingProgressNotStarted),
- blame_context_(frame_tree_node_id_, parent) {
+ blame_context_(frame_tree_node_id_, parent),
+ csp_context_(new CSPContextImpl(this)) {
std::pair<FrameTreeNodeIdMap::iterator, bool> result =
g_frame_tree_node_id_map.Get().insert(
std::make_pair(frame_tree_node_id_, this));
@@ -257,6 +259,7 @@ void FrameTreeNode::SetCurrentOrigin(
replication_state_.origin = origin;
replication_state_.has_potentially_trustworthy_unique_origin =
is_potentially_trustworthy_unique_origin;
+ csp_context_->SetSelf(replication_state_.origin);
}
void FrameTreeNode::SetFrameName(const std::string& name,

Powered by Google App Engine
This is Rietveld 408576698