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

Unified Diff: third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp

Issue 2739203002: Initial Implementation of Iframe Attribute for Feature Policy (Part 3) (Closed)
Patch Set: 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 7210cc43ed279be3ae6ce30b014037bfef329bbb..db287cd9ee5bb52a562c9c37e3cc2d118e9a2060 100644
--- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
@@ -4,6 +4,7 @@
#include "web/WebRemoteFrameImpl.h"
+#include <v8/include/v8.h>
#include "core/dom/Fullscreen.h"
#include "core/dom/RemoteSecurityContext.h"
#include "core/dom/SecurityContext.h"
@@ -13,6 +14,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"
@@ -25,7 +27,6 @@
#include "web/RemoteFrameOwner.h"
#include "web/WebLocalFrameImpl.h"
#include "web/WebViewImpl.h"
-#include <v8/include/v8.h>
namespace blink {
@@ -427,15 +428,19 @@ void WebRemoteFrameImpl::setReplicatedName(const WebString& name,
}
void WebRemoteFrameImpl::setReplicatedFeaturePolicyHeader(
- const WebParsedFeaturePolicyHeader& parsedHeader) const {
+ const WebParsedFeaturePolicy& parsedHeader) const {
if (RuntimeEnabledFeatures::featurePolicyEnabled()) {
WebFeaturePolicy* parentFeaturePolicy = nullptr;
if (parent()) {
Frame* parentFrame = frame()->client()->parent();
parentFeaturePolicy = parentFrame->securityContext()->getFeaturePolicy();
}
- frame()->securityContext()->initializeFeaturePolicy(parsedHeader,
- parentFeaturePolicy);
+ const WebParsedFeaturePolicy containerPolicy =
+ getContainerPolicyFromAllowedFeatures(
+ frame()->owner()->allowedFeatures(),
+ frame()->securityContext()->getSecurityOrigin());
+ frame()->securityContext()->initializeFeaturePolicy(
+ parsedHeader, containerPolicy, parentFeaturePolicy);
}
}

Powered by Google App Engine
This is Rietveld 408576698