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 ca3bb0fb6accf5aba82e5ddc6a64babf9d522291..5a12886c93dba6ab8de3c54fc701253bf96afcf1 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp |
| @@ -163,6 +163,20 @@ void HTMLFrameElementBase::ParseAttribute( |
| } |
| } |
| +const RefPtr<SecurityOrigin> HTMLFrameElementBase::GetOriginForFeaturePolicy() |
| + const { |
| + KURL url = GetDocument().CompleteURL(url_); |
| + // Sandboxed frames and data: urls have a unique origin. |
| + if (url.ProtocolIsData() || (GetSandboxFlags() & kSandboxOrigin)) |
|
alexmos
2017/04/11 01:17:49
Checking data: explicitly might not actually be ne
alexmos
2017/04/11 01:17:49
nit: use IsSandboxed(kSandboxOrigin)
iclelland
2017/04/11 17:41:43
I thought that was only defined on SecurityContext
iclelland
2017/04/11 17:41:43
You're right there, thanks. SecurityOrigin::Create
alexmos
2017/04/13 02:09:15
The ProtocolIsData() check still seems to be there
alexmos
2017/04/13 02:09:15
Ah, right, this is for a frame owner, not a docume
iclelland
2017/04/13 19:05:31
Thanks for catching that. Done.
|
| + return SecurityOrigin::CreateUnique(); |
| + // Frames with about:blank and javascript: urls inherit their origin from |
| + // their parent frame. |
| + if (url.ProtocolIsJavaScript() || url.IsAboutBlankURL()) |
|
alexmos
2017/04/11 01:17:49
Do you also need to handle the case where |url| is
iclelland
2017/04/11 17:41:43
That's a good idea -- it's not currently exported
alexmos
2017/04/13 02:09:15
Yes, I assumed that we'd need to export it more wi
|
| + return GetDocument().GetSecurityOrigin(); |
| + // Otherwise, return the origin of the absolute URL. |
| + return SecurityOrigin::Create(url); |
| +} |
| + |
| void HTMLFrameElementBase::SetNameAndOpenURL() { |
| frame_name_ = GetNameAttribute(); |
| OpenURL(); |