Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Cleanup, reponding to review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
86 return getAttribute(HTMLNames::nameAttr); 87 return getAttribute(HTMLNames::nameAttr);
87 } 88 }
88 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; } 89 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; }
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 !m_widget; } 94 bool isDisplayNone() const override { return !m_widget; }
94 AtomicString csp() const override { return nullAtom; } 95 AtomicString csp() const override { return nullAtom; }
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& tagName, Document&); 102 HTMLFrameOwnerElement(const QualifiedName& tagName, Document&);
101 void setSandboxFlags(SandboxFlags); 103 void setSandboxFlags(SandboxFlags);
102 104
103 bool loadOrRedirectSubframe(const KURL&, 105 bool loadOrRedirectSubframe(const KURL&,
104 const AtomicString& frameName, 106 const AtomicString& frameName,
105 bool replaceCurrentItem); 107 bool replaceCurrentItem);
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();
112 void updateContainerPolicy();
110 113
111 private: 114 private:
112 // Intentionally private to prevent redundant checks when the type is 115 // Intentionally private to prevent redundant checks when the type is
113 // already HTMLFrameOwnerElement. 116 // already HTMLFrameOwnerElement.
114 bool isLocal() const final { return true; } 117 bool isLocal() const final { return true; }
115 bool isRemote() const final { return false; } 118 bool isRemote() const final { return false; }
116 119
117 bool isFrameOwnerElement() const final { return true; } 120 bool isFrameOwnerElement() const final { return true; }
118 121
119 virtual ReferrerPolicy referrerPolicyAttribute() { 122 virtual ReferrerPolicy referrerPolicyAttribute() {
120 return ReferrerPolicyDefault; 123 return ReferrerPolicyDefault;
121 } 124 }
122 125
123 Member<Frame> m_contentFrame; 126 Member<Frame> m_contentFrame;
124 Member<FrameViewBase> m_widget; 127 Member<FrameViewBase> m_widget;
125 SandboxFlags m_sandboxFlags; 128 SandboxFlags m_sandboxFlags;
129
130 WebParsedFeaturePolicy m_containerPolicy;
131
132 // Tracks the absolute URL represented by the contents of the src attribute.
133 KURL m_absoluteURL;
alexmos 2017/04/06 00:44:22 Why do we need to track this? Could you get it in
iclelland 2017/04/09 03:25:54 My concern here was that the absolute URL isn't ju
126 }; 134 };
127 135
128 DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, isFrameOwnerElement()); 136 DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, isFrameOwnerElement());
129 137
130 class SubframeLoadingDisabler { 138 class SubframeLoadingDisabler {
131 STACK_ALLOCATED(); 139 STACK_ALLOCATED();
132 140
133 public: 141 public:
134 explicit SubframeLoadingDisabler(Node& root) 142 explicit SubframeLoadingDisabler(Node& root)
135 : SubframeLoadingDisabler(&root) {} 143 : SubframeLoadingDisabler(&root) {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 175
168 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement, 176 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement,
169 FrameOwner, 177 FrameOwner,
170 owner, 178 owner,
171 owner->isLocal(), 179 owner->isLocal(),
172 owner.isLocal()); 180 owner.isLocal());
173 181
174 } // namespace blink 182 } // namespace blink
175 183
176 #endif // HTMLFrameOwnerElement_h 184 #endif // HTMLFrameOwnerElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698