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

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

Issue 2562323002: Devirtualize Frame::domWindow(). (Closed)
Patch Set: Created 4 years 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // input, layout, or painting probably belongs on LocalFrame. 67 // input, layout, or painting probably belongs on LocalFrame.
68 class CORE_EXPORT Frame : public GarbageCollectedFinalized<Frame> { 68 class CORE_EXPORT Frame : public GarbageCollectedFinalized<Frame> {
69 public: 69 public:
70 virtual ~Frame(); 70 virtual ~Frame();
71 71
72 DECLARE_VIRTUAL_TRACE(); 72 DECLARE_VIRTUAL_TRACE();
73 73
74 virtual bool isLocalFrame() const = 0; 74 virtual bool isLocalFrame() const = 0;
75 virtual bool isRemoteFrame() const = 0; 75 virtual bool isRemoteFrame() const = 0;
76 76
77 virtual DOMWindow* domWindow() const = 0;
78 virtual WindowProxy* windowProxy(DOMWrapperWorld&) = 0; 77 virtual WindowProxy* windowProxy(DOMWrapperWorld&) = 0;
79 78
80 virtual void navigate(Document& originDocument, 79 virtual void navigate(Document& originDocument,
81 const KURL&, 80 const KURL&,
82 bool replaceCurrentItem, 81 bool replaceCurrentItem,
83 UserGestureStatus) = 0; 82 UserGestureStatus) = 0;
84 // This version of Frame::navigate assumes the resulting navigation is not 83 // This version of Frame::navigate assumes the resulting navigation is not
85 // to be started on a timer. Use the method above in such cases. 84 // to be started on a timer. Use the method above in such cases.
86 virtual void navigate(const FrameLoadRequest&) = 0; 85 virtual void navigate(const FrameLoadRequest&) = 0;
87 virtual void reload(FrameLoadType, ClientRedirectPolicy) = 0; 86 virtual void reload(FrameLoadType, ClientRedirectPolicy) = 0;
(...skipping 12 matching lines...) Expand all
100 Page* page() const; 99 Page* page() const;
101 FrameHost* host() const; // Null when the frame is detached. 100 FrameHost* host() const; // Null when the frame is detached.
102 101
103 bool isMainFrame() const; 102 bool isMainFrame() const;
104 bool isLocalRoot() const; 103 bool isLocalRoot() const;
105 104
106 FrameOwner* owner() const; 105 FrameOwner* owner() const;
107 void setOwner(FrameOwner* owner) { m_owner = owner; } 106 void setOwner(FrameOwner* owner) { m_owner = owner; }
108 HTMLFrameOwnerElement* deprecatedLocalOwner() const; 107 HTMLFrameOwnerElement* deprecatedLocalOwner() const;
109 108
109 DOMWindow* domWindow() const { return m_domWindow; }
110
110 FrameTree& tree() const; 111 FrameTree& tree() const;
111 ChromeClient& chromeClient() const; 112 ChromeClient& chromeClient() const;
112 113
113 virtual SecurityContext* securityContext() const = 0; 114 virtual SecurityContext* securityContext() const = 0;
114 115
115 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame); 116 Frame* findFrameForNavigation(const AtomicString& name, Frame& activeFrame);
116 Frame* findUnsafeParentScrollPropagationBoundary(); 117 Frame* findUnsafeParentScrollPropagationBoundary();
117 118
118 // This prepares the Frame for the next commit. It will detach children, 119 // This prepares the Frame for the next commit. It will detach children,
119 // dispatch unload events, abort XHR requests and detach the document. 120 // dispatch unload events, abort XHR requests and detach the document.
(...skipping 26 matching lines...) Expand all
146 147
147 bool isDetaching() const { return m_isDetaching; } 148 bool isDetaching() const { return m_isDetaching; }
148 149
149 protected: 150 protected:
150 Frame(FrameClient*, FrameHost*, FrameOwner*); 151 Frame(FrameClient*, FrameHost*, FrameOwner*);
151 152
152 mutable FrameTree m_treeNode; 153 mutable FrameTree m_treeNode;
153 154
154 Member<FrameHost> m_host; 155 Member<FrameHost> m_host;
155 Member<FrameOwner> m_owner; 156 Member<FrameOwner> m_owner;
157 Member<DOMWindow> m_domWindow;
156 158
157 bool m_isDetaching = false; 159 bool m_isDetaching = false;
158 160
159 private: 161 private:
160 bool canNavigateWithoutFramebusting(const Frame&, String& errorReason); 162 bool canNavigateWithoutFramebusting(const Frame&, String& errorReason);
161 163
162 Member<FrameClient> m_client; 164 Member<FrameClient> m_client;
163 bool m_isLoading; 165 bool m_isLoading;
164 }; 166 };
165 167
166 inline FrameClient* Frame::client() const { 168 inline FrameClient* Frame::client() const {
167 return m_client; 169 return m_client;
168 } 170 }
169 171
170 inline FrameOwner* Frame::owner() const { 172 inline FrameOwner* Frame::owner() const {
171 return m_owner; 173 return m_owner;
172 } 174 }
173 175
174 inline FrameTree& Frame::tree() const { 176 inline FrameTree& Frame::tree() const {
175 return m_treeNode; 177 return m_treeNode;
176 } 178 }
177 179
178 // Allow equality comparisons of Frames by reference or pointer, 180 // Allow equality comparisons of Frames by reference or pointer,
179 // interchangeably. 181 // interchangeably.
180 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame) 182 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Frame)
181 183
182 } // namespace blink 184 } // namespace blink
183 185
184 #endif // Frame_h 186 #endif // Frame_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698