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

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 nits 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 107
105 FrameOwner* owner() const; 108 FrameOwner* owner() const;
106 void setOwner(FrameOwner* owner) { m_owner = owner; } 109 void setOwner(FrameOwner* owner) { m_owner = owner; }
107 HTMLFrameOwnerElement* deprecatedLocalOwner() const; 110 HTMLFrameOwnerElement* deprecatedLocalOwner() const;
108 111
109 FrameTree& tree() const; 112 FrameTree& tree() const;
110 ChromeClient& chromeClient() const; 113 ChromeClient& chromeClient() const;
111 114
112 virtual SecurityContext* securityContext() const = 0; 115 virtual SecurityContext* securityContext() const = 0;
113 116
117 FeaturePolicy* getFeaturePolicy() const { return m_featurePolicy.get(); }
118 void setFeaturePolicy(std::unique_ptr<FeaturePolicy> newPolicy) {
119 m_featurePolicy = std::move(newPolicy);
120 }
121
114 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame); 122 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame);
115 Frame* findUnsafeParentScrollPropagationBoundary(); 123 Frame* findUnsafeParentScrollPropagationBoundary();
116 124
117 // This prepares the Frame for the next commit. It will detach children, 125 // This prepares the Frame for the next commit. It will detach children,
118 // dispatch unload events, abort XHR requests and detach the document. 126 // dispatch unload events, abort XHR requests and detach the document.
119 // Returns true if the frame is ready to receive the next commit, or false 127 // Returns true if the frame is ready to receive the next commit, or false
120 // otherwise. 128 // otherwise.
121 virtual bool prepareForCommit() = 0; 129 virtual bool prepareForCommit() = 0;
122 130
123 bool canNavigate(const Frame&); 131 bool canNavigate(const Frame&);
(...skipping 29 matching lines...) Expand all
153 Member<FrameHost> m_host; 161 Member<FrameHost> m_host;
154 Member<FrameOwner> m_owner; 162 Member<FrameOwner> m_owner;
155 163
156 bool m_isDetaching = false; 164 bool m_isDetaching = false;
157 165
158 private: 166 private:
159 bool canNavigateWithoutFramebusting(const Frame&, String& errorReason); 167 bool canNavigateWithoutFramebusting(const Frame&, String& errorReason);
160 168
161 Member<FrameClient> m_client; 169 Member<FrameClient> m_client;
162 bool m_isLoading; 170 bool m_isLoading;
171
172 std::unique_ptr<FeaturePolicy> m_featurePolicy;
163 }; 173 };
164 174
165 inline FrameClient* Frame::client() const { 175 inline FrameClient* Frame::client() const {
166 return m_client; 176 return m_client;
167 } 177 }
168 178
169 inline FrameOwner* Frame::owner() const { 179 inline FrameOwner* Frame::owner() const {
170 return m_owner; 180 return m_owner;
171 } 181 }
172 182
173 inline FrameTree& Frame::tree() const { 183 inline FrameTree& Frame::tree() const {
174 return m_treeNode; 184 return m_treeNode;
175 } 185 }
176 186
177 // Allow equality comparisons of Frames by reference or pointer, 187 // Allow equality comparisons of Frames by reference or pointer,
178 // interchangeably. 188 // interchangeably.
179 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame) 189 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame)
180 190
181 } // namespace blink 191 } // namespace blink
182 192
183 #endif // Frame_h 193 #endif // Frame_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.idl ('k') | third_party/WebKit/Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698