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

Unified Diff: third_party/WebKit/Source/web/WebRemoteFrameImpl.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/web/WebRemoteFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
index c4f8498d80cb7ecca3e832e800f12b167c7befd4..a990ac619e898b1a7964920bee1a37c50d6d51a7 100644
--- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
@@ -15,6 +15,7 @@
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/layout/LayoutObject.h"
#include "core/page/Page.h"
+#include "platform/feature_policy/FeaturePolicy.h"
#include "platform/heap/Handle.h"
#include "public/platform/WebFeaturePolicy.h"
#include "public/platform/WebFloatRect.h"
@@ -431,8 +432,14 @@ void WebRemoteFrameImpl::setReplicatedFeaturePolicyHeader(
Frame* parentFrame = frame()->client()->parent();
parentFeaturePolicy = parentFrame->securityContext()->getFeaturePolicy();
}
- frame()->securityContext()->initializeFeaturePolicy(parsedHeader,
- parentFeaturePolicy);
+ WebParsedFeaturePolicy containerPolicy;
+ if (frame() && frame()->owner()) {
+ containerPolicy = getContainerPolicyFromAllowedFeatures(
+ frame()->owner()->allowedFeatures(),
+ frame()->securityContext()->getSecurityOrigin());
+ }
+ frame()->securityContext()->initializeFeaturePolicy(
+ parsedHeader, containerPolicy, parentFeaturePolicy);
}
}

Powered by Google App Engine
This is Rietveld 408576698