Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) | 4 * (C) 2000 Simon Hausmann (hausmann@kde.org) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 } else if (name == onbeforeunloadAttr) { | 156 } else if (name == onbeforeunloadAttr) { |
| 157 // FIXME: should <frame> elements have beforeunload handlers? | 157 // FIXME: should <frame> elements have beforeunload handlers? |
| 158 SetAttributeEventListener( | 158 SetAttributeEventListener( |
| 159 EventTypeNames::beforeunload, | 159 EventTypeNames::beforeunload, |
| 160 CreateAttributeEventListener(this, name, value, EventParameterName())); | 160 CreateAttributeEventListener(this, name, value, EventParameterName())); |
| 161 } else { | 161 } else { |
| 162 HTMLFrameOwnerElement::ParseAttribute(params); | 162 HTMLFrameOwnerElement::ParseAttribute(params); |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 const RefPtr<SecurityOrigin> HTMLFrameElementBase::GetOriginForFeaturePolicy() | |
| 167 const { | |
| 168 KURL url = GetDocument().CompleteURL(url_); | |
| 169 // Sandboxed frames and data: urls have a unique origin. | |
| 170 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.
| |
| 171 return SecurityOrigin::CreateUnique(); | |
| 172 // Frames with about:blank and javascript: urls inherit their origin from | |
| 173 // their parent frame. | |
| 174 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
| |
| 175 return GetDocument().GetSecurityOrigin(); | |
| 176 // Otherwise, return the origin of the absolute URL. | |
| 177 return SecurityOrigin::Create(url); | |
| 178 } | |
| 179 | |
| 166 void HTMLFrameElementBase::SetNameAndOpenURL() { | 180 void HTMLFrameElementBase::SetNameAndOpenURL() { |
| 167 frame_name_ = GetNameAttribute(); | 181 frame_name_ = GetNameAttribute(); |
| 168 OpenURL(); | 182 OpenURL(); |
| 169 } | 183 } |
| 170 | 184 |
| 171 Node::InsertionNotificationRequest HTMLFrameElementBase::InsertedInto( | 185 Node::InsertionNotificationRequest HTMLFrameElementBase::InsertedInto( |
| 172 ContainerNode* insertion_point) { | 186 ContainerNode* insertion_point) { |
| 173 HTMLFrameOwnerElement::InsertedInto(insertion_point); | 187 HTMLFrameOwnerElement::InsertedInto(insertion_point); |
| 174 return kInsertionShouldCallDidNotifySubtreeInsertions; | 188 return kInsertionShouldCallDidNotifySubtreeInsertions; |
| 175 } | 189 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 | 285 |
| 272 if (contentDocument()) { | 286 if (contentDocument()) { |
| 273 contentDocument()->WillChangeFrameOwnerProperties( | 287 contentDocument()->WillChangeFrameOwnerProperties( |
| 274 margin_width_, margin_height, scrolling_mode_, IsDisplayNone()); | 288 margin_width_, margin_height, scrolling_mode_, IsDisplayNone()); |
| 275 } | 289 } |
| 276 margin_height_ = margin_height; | 290 margin_height_ = margin_height; |
| 277 FrameOwnerPropertiesChanged(); | 291 FrameOwnerPropertiesChanged(); |
| 278 } | 292 } |
| 279 | 293 |
| 280 } // namespace blink | 294 } // namespace blink |
| OLD | NEW |