| 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 ca3bb0fb6accf5aba82e5ddc6a64babf9d522291..f43d2016dd4c08a3ac1d6e4eaf8f20a767d745d5 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp
|
| @@ -163,6 +163,23 @@ void HTMLFrameElementBase::ParseAttribute(
|
| }
|
| }
|
|
|
| +const RefPtr<SecurityOrigin> HTMLFrameElementBase::GetOriginForFeaturePolicy()
|
| + const {
|
| + KURL url = GetDocument().CompleteURL(url_);
|
| + // Sandboxed frames have a unique origin.
|
| + if (url.ProtocolIsData() || (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();
|
|
|