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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2739203002: Initial Implementation of Iframe Attribute for Feature Policy (Part 3) (Closed)
Patch Set: Bug fix: frame owner does not always exist. Created 3 years, 9 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: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 13857db271a9005fbcfd277261654baa7bd4495b..31fc6ea8cb15a5647a48fb5028b512b8c708d52b 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -617,8 +617,14 @@ void FrameLoader::didBeginDocument() {
const WebParsedFeaturePolicy& parsedHeader = parseFeaturePolicy(
featurePolicyHeader, m_frame->securityContext()->getSecurityOrigin(),
&messages);
- m_frame->securityContext()->initializeFeaturePolicy(parsedHeader,
- parentFeaturePolicy);
+ WebParsedFeaturePolicy containerPolicy;
+ if (m_frame->owner()) {
dglazkov 2017/03/20 20:57:12 I wonder if even need to do anything with feature
lunalu1 2017/03/20 21:07:01 There are two ways to define feature policy. One i
dglazkov 2017/03/20 22:18:26 I could be wrong, but if I remember correctly, the
+ containerPolicy = getContainerPolicyFromAllowedFeatures(
+ m_frame->owner()->allowedFeatures(),
+ m_frame->securityContext()->getSecurityOrigin());
+ }
+ m_frame->securityContext()->initializeFeaturePolicy(
+ parsedHeader, containerPolicy, parentFeaturePolicy);
for (auto& message : messages) {
m_frame->document()->addConsoleMessage(ConsoleMessage::create(
OtherMessageSource, ErrorMessageLevel,

Powered by Google App Engine
This is Rietveld 408576698