OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 * | 18 * |
19 */ | 19 */ |
20 | 20 |
21 #ifndef HTMLFrameOwnerElement_h | 21 #ifndef HTMLFrameOwnerElement_h |
22 #define HTMLFrameOwnerElement_h | 22 #define HTMLFrameOwnerElement_h |
23 | 23 |
24 #include "core/CoreExport.h" | 24 #include "core/CoreExport.h" |
25 #include "core/dom/Document.h" | 25 #include "core/dom/Document.h" |
26 #include "core/frame/FrameOwner.h" | 26 #include "core/frame/FrameOwner.h" |
27 #include "core/html/HTMLElement.h" | 27 #include "core/html/HTMLElement.h" |
| 28 #include "platform/feature_policy/FeaturePolicy.h" |
28 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
29 #include "platform/scroll/ScrollTypes.h" | 30 #include "platform/scroll/ScrollTypes.h" |
30 #include "platform/weborigin/SecurityPolicy.h" | 31 #include "platform/weborigin/SecurityPolicy.h" |
31 #include "wtf/HashCountedSet.h" | 32 #include "wtf/HashCountedSet.h" |
32 | 33 |
33 namespace blink { | 34 namespace blink { |
34 | 35 |
35 class ExceptionState; | 36 class ExceptionState; |
36 class Frame; | 37 class Frame; |
37 class FrameViewBase; | 38 class FrameViewBase; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return getAttribute(HTMLNames::nameAttr); | 87 return getAttribute(HTMLNames::nameAttr); |
87 } | 88 } |
88 ScrollbarMode ScrollingMode() const override { return kScrollbarAuto; } | 89 ScrollbarMode ScrollingMode() const override { return kScrollbarAuto; } |
89 int MarginWidth() const override { return -1; } | 90 int MarginWidth() const override { return -1; } |
90 int MarginHeight() const override { return -1; } | 91 int MarginHeight() const override { return -1; } |
91 bool AllowFullscreen() const override { return false; } | 92 bool AllowFullscreen() const override { return false; } |
92 bool AllowPaymentRequest() const override { return false; } | 93 bool AllowPaymentRequest() const override { return false; } |
93 bool IsDisplayNone() const override { return !widget_; } | 94 bool IsDisplayNone() const override { return !widget_; } |
94 AtomicString Csp() const override { return g_null_atom; } | 95 AtomicString Csp() const override { return g_null_atom; } |
95 const WebVector<WebFeaturePolicyFeature>& AllowedFeatures() const override; | 96 const WebVector<WebFeaturePolicyFeature>& AllowedFeatures() const override; |
| 97 const WebParsedFeaturePolicy& ContainerPolicy() const override; |
96 | 98 |
97 DECLARE_VIRTUAL_TRACE(); | 99 DECLARE_VIRTUAL_TRACE(); |
98 | 100 |
99 protected: | 101 protected: |
100 HTMLFrameOwnerElement(const QualifiedName& tag_name, Document&); | 102 HTMLFrameOwnerElement(const QualifiedName& tag_name, Document&); |
101 void SetSandboxFlags(SandboxFlags); | 103 void SetSandboxFlags(SandboxFlags); |
102 | 104 |
103 bool LoadOrRedirectSubframe(const KURL&, | 105 bool LoadOrRedirectSubframe(const KURL&, |
104 const AtomicString& frame_name, | 106 const AtomicString& frame_name, |
105 bool replace_current_item); | 107 bool replace_current_item); |
106 bool IsKeyboardFocusable() const override; | 108 bool IsKeyboardFocusable() const override; |
107 | 109 |
108 void DisposeWidgetSoon(FrameViewBase*); | 110 void DisposeWidgetSoon(FrameViewBase*); |
109 void FrameOwnerPropertiesChanged(); | 111 void FrameOwnerPropertiesChanged(); |
110 | 112 |
| 113 // Return the origin which is to be used for feature policy container |
| 114 // policies, when a specific origin is needed. This supports the "allow" |
| 115 // attribute, which uses the url specified by the parent document to determine |
| 116 // the origin when the frame is constructed. |
| 117 virtual const RefPtr<SecurityOrigin> GetOriginForFeaturePolicy() const { |
| 118 return SecurityOrigin::CreateUnique(); |
| 119 } |
| 120 |
| 121 // Construct a new feature policy container policy for this frame, based on |
| 122 // the frame attributes and the effective origin specified in the frame |
| 123 // attributes. |
| 124 void UpdateContainerPolicy(); |
| 125 |
111 private: | 126 private: |
112 // Intentionally private to prevent redundant checks when the type is | 127 // Intentionally private to prevent redundant checks when the type is |
113 // already HTMLFrameOwnerElement. | 128 // already HTMLFrameOwnerElement. |
114 bool IsLocal() const final { return true; } | 129 bool IsLocal() const final { return true; } |
115 bool IsRemote() const final { return false; } | 130 bool IsRemote() const final { return false; } |
116 | 131 |
117 bool IsFrameOwnerElement() const final { return true; } | 132 bool IsFrameOwnerElement() const final { return true; } |
118 | 133 |
119 virtual ReferrerPolicy ReferrerPolicyAttribute() { | 134 virtual ReferrerPolicy ReferrerPolicyAttribute() { |
120 return kReferrerPolicyDefault; | 135 return kReferrerPolicyDefault; |
121 } | 136 } |
122 | 137 |
123 Member<Frame> content_frame_; | 138 Member<Frame> content_frame_; |
124 Member<FrameViewBase> widget_; | 139 Member<FrameViewBase> widget_; |
125 SandboxFlags sandbox_flags_; | 140 SandboxFlags sandbox_flags_; |
| 141 |
| 142 WebParsedFeaturePolicy container_policy_; |
126 }; | 143 }; |
127 | 144 |
128 DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, IsFrameOwnerElement()); | 145 DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, IsFrameOwnerElement()); |
129 | 146 |
130 class SubframeLoadingDisabler { | 147 class SubframeLoadingDisabler { |
131 STACK_ALLOCATED(); | 148 STACK_ALLOCATED(); |
132 | 149 |
133 public: | 150 public: |
134 explicit SubframeLoadingDisabler(Node& root) | 151 explicit SubframeLoadingDisabler(Node& root) |
135 : SubframeLoadingDisabler(&root) {} | 152 : SubframeLoadingDisabler(&root) {} |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 184 |
168 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement, | 185 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement, |
169 FrameOwner, | 186 FrameOwner, |
170 owner, | 187 owner, |
171 owner->IsLocal(), | 188 owner->IsLocal(), |
172 owner.IsLocal()); | 189 owner.IsLocal()); |
173 | 190 |
174 } // namespace blink | 191 } // namespace blink |
175 | 192 |
176 #endif // HTMLFrameOwnerElement_h | 193 #endif // HTMLFrameOwnerElement_h |
OLD | NEW |