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

Side by Side Diff: third_party/WebKit/Source/core/frame/Frame.h

Issue 2254533002: [FeaturePolicy] Initial implementation of Feature Policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fp-flag
Patch Set: Addressing review comments from PS#13 and #15 Created 4 years, 1 month 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999-2001 Lars Knoll <knoll@kde.org> 3 * 1999-2001 Lars Knoll <knoll@kde.org>
4 * 1999-2001 Antti Koivisto <koivisto@kde.org> 4 * 1999-2001 Antti Koivisto <koivisto@kde.org>
5 * 2000-2001 Simon Hausmann <hausmann@kde.org> 5 * 2000-2001 Simon Hausmann <hausmann@kde.org>
6 * 2000-2001 Dirk Mueller <mueller@kde.org> 6 * 2000-2001 Dirk Mueller <mueller@kde.org>
7 * 2000 Stefan Schimanski <1Stein@gmx.de> 7 * 2000 Stefan Schimanski <1Stein@gmx.de>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
9 * reserved. 9 * reserved.
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 15 matching lines...) Expand all
26 * Boston, MA 02110-1301, USA. 26 * Boston, MA 02110-1301, USA.
27 */ 27 */
28 28
29 #ifndef Frame_h 29 #ifndef Frame_h
30 #define Frame_h 30 #define Frame_h
31 31
32 #include "core/CoreExport.h" 32 #include "core/CoreExport.h"
33 #include "core/frame/FrameTypes.h" 33 #include "core/frame/FrameTypes.h"
34 #include "core/loader/FrameLoaderTypes.h" 34 #include "core/loader/FrameLoaderTypes.h"
35 #include "core/page/FrameTree.h" 35 #include "core/page/FrameTree.h"
36 #include "platform/feature_policy/FeaturePolicy.h"
36 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
37 #include "wtf/Forward.h" 38 #include "wtf/Forward.h"
38 39
40 #include <memory>
41
39 namespace blink { 42 namespace blink {
40 43
41 class ChromeClient; 44 class ChromeClient;
42 class DOMWindow; 45 class DOMWindow;
43 class DOMWrapperWorld; 46 class DOMWrapperWorld;
44 class Document; 47 class Document;
45 class FrameClient; 48 class FrameClient;
46 class FrameHost; 49 class FrameHost;
47 class FrameOwner; 50 class FrameOwner;
48 class HTMLFrameOwnerElement; 51 class HTMLFrameOwnerElement;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 105
103 FrameOwner* owner() const; 106 FrameOwner* owner() const;
104 void setOwner(FrameOwner* owner) { m_owner = owner; } 107 void setOwner(FrameOwner* owner) { m_owner = owner; }
105 HTMLFrameOwnerElement* deprecatedLocalOwner() const; 108 HTMLFrameOwnerElement* deprecatedLocalOwner() const;
106 109
107 FrameTree& tree() const; 110 FrameTree& tree() const;
108 ChromeClient& chromeClient() const; 111 ChromeClient& chromeClient() const;
109 112
110 virtual SecurityContext* securityContext() const = 0; 113 virtual SecurityContext* securityContext() const = 0;
111 114
115 FeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); }
116 void setFeaturePolicy(FeaturePolicy* newPolicy) {
117 m_featurePolicy.reset(newPolicy);
118 }
119
112 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame); 120 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame);
113 Frame* findUnsafeParentScrollPropagationBoundary(); 121 Frame* findUnsafeParentScrollPropagationBoundary();
114 122
115 // This prepares the Frame for the next commit. It will detach children, 123 // This prepares the Frame for the next commit. It will detach children,
116 // dispatch unload events, abort XHR requests and detach the document. 124 // dispatch unload events, abort XHR requests and detach the document.
117 // Returns true if the frame is ready to receive the next commit, or false 125 // Returns true if the frame is ready to receive the next commit, or false
118 // otherwise. 126 // otherwise.
119 virtual bool prepareForCommit() = 0; 127 virtual bool prepareForCommit() = 0;
120 128
121 bool canNavigate(const Frame&); 129 bool canNavigate(const Frame&);
(...skipping 25 matching lines...) Expand all
147 mutable FrameTree m_treeNode; 155 mutable FrameTree m_treeNode;
148 156
149 Member<FrameHost> m_host; 157 Member<FrameHost> m_host;
150 Member<FrameOwner> m_owner; 158 Member<FrameOwner> m_owner;
151 159
152 private: 160 private:
153 bool canNavigateWithoutFramebusting(const Frame&, String& errorReason); 161 bool canNavigateWithoutFramebusting(const Frame&, String& errorReason);
154 162
155 Member<FrameClient> m_client; 163 Member<FrameClient> m_client;
156 bool m_isLoading; 164 bool m_isLoading;
165
166 std::unique_ptr<FeaturePolicy> m_featurePolicy;
157 }; 167 };
158 168
159 inline FrameClient* Frame::client() const { 169 inline FrameClient* Frame::client() const {
160 return m_client; 170 return m_client;
161 } 171 }
162 172
163 inline FrameOwner* Frame::owner() const { 173 inline FrameOwner* Frame::owner() const {
164 return m_owner; 174 return m_owner;
165 } 175 }
166 176
167 inline FrameTree& Frame::tree() const { 177 inline FrameTree& Frame::tree() const {
168 return m_treeNode; 178 return m_treeNode;
169 } 179 }
170 180
171 // Allow equality comparisons of Frames by reference or pointer, 181 // Allow equality comparisons of Frames by reference or pointer,
172 // interchangeably. 182 // interchangeably.
173 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame) 183 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame)
174 184
175 } // namespace blink 185 } // namespace blink
176 186
177 #endif // Frame_h 187 #endif // Frame_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698