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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Fix rebase 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: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
index 9ca4b77574b15103d87b460053cd0dc5f82fa09c..7b520fe5cd92549af2550e598e1e80b9a2c11a0a 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
@@ -164,6 +164,23 @@ void HTMLFrameElementBase::ParseAttribute(
}
}
+const RefPtr<SecurityOrigin> HTMLFrameElementBase::GetOriginForFeaturePolicy()
+ const {
+ KURL url = GetDocument().CompleteURL(url_);
dcheng 2017/04/18 16:26:37 Nit: move this down to line 173
iclelland 2017/04/18 19:19:44 Done.
+ // Sandboxed frames have a unique origin.
+ if (GetSandboxFlags() & kSandboxOrigin)
+ return SecurityOrigin::CreateUnique();
+
+ // If the frame will inherit its origin from the owner, then use the owner's
+ // origin when constructing the container policy.
+ if (Document::ShouldInheritSecurityOriginFromOwner(url))
+ return GetDocument().GetSecurityOrigin();
+
+ // Other frames should use the origin defined by the absolute URL (this will
+ // be a unique origin for data: URLs)
+ return SecurityOrigin::Create(url);
+}
+
void HTMLFrameElementBase::SetNameAndOpenURL() {
frame_name_ = GetNameAttribute();
OpenURL();

Powered by Google App Engine
This is Rietveld 408576698