Chromium Code Reviews| 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(); |