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

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

Issue 538323003: Have window.closed return true when frame is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update m_hasBeenClosed comment Created 6 years, 3 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) 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 reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; } 91 blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; }
92 92
93 Settings* settings() const; // can be null 93 Settings* settings() const; // can be null
94 94
95 // FIXME: This method identifies a LocalFrame that is acting as a RemoteFram e. 95 // FIXME: This method identifies a LocalFrame that is acting as a RemoteFram e.
96 // It is necessary only until we can instantiate a RemoteFrame, at which poi nt 96 // It is necessary only until we can instantiate a RemoteFrame, at which poi nt
97 // it can be removed and its callers can be converted to use the isRemoteFra me() 97 // it can be removed and its callers can be converted to use the isRemoteFra me()
98 // method. 98 // method.
99 bool isRemoteFrameTemporary() const { return m_remotePlatformLayer; } 99 bool isRemoteFrameTemporary() const { return m_remotePlatformLayer; }
100 100
101 bool hasBeenClosed() const { return m_hasBeenClosed; }
102 void setHasBeenClosed() { ASSERT(!m_hasBeenClosed); m_hasBeenClosed = true; }
tkent 2014/09/17 08:28:46 nit: We don't put multiple statements in a single
sof 2014/09/17 09:55:05 Thanks, addressed (&un-inlined.)
103
101 protected: 104 protected:
102 Frame(FrameClient*, FrameHost*, FrameOwner*); 105 Frame(FrameClient*, FrameHost*, FrameOwner*);
103 106
104 mutable FrameTree m_treeNode; 107 mutable FrameTree m_treeNode;
105 108
106 FrameHost* m_host; 109 FrameHost* m_host;
107 FrameOwner* m_owner; 110 FrameOwner* m_owner;
108 111
109 RefPtrWillBePersistent<LocalDOMWindow> m_domWindow; 112 RefPtrWillBePersistent<LocalDOMWindow> m_domWindow;
110 113
111 private: 114 private:
112 FrameClient* m_client; 115 FrameClient* m_client;
113 blink::WebLayer* m_remotePlatformLayer; 116 blink::WebLayer* m_remotePlatformLayer;
117
118 // The closing of a frame by the embedder may not trigger the
119 // immediate release of this Frame object -- there might be
120 // other RefPtrs to the Frame, up the stack or elsewhere.
121 //
122 // Hence, keep a separate flag that's set when the frame is
123 // closed. It is consulted by window.closed.
124 bool m_hasBeenClosed;
114 }; 125 };
115 126
116 inline FrameClient* Frame::client() const 127 inline FrameClient* Frame::client() const
117 { 128 {
118 return m_client; 129 return m_client;
119 } 130 }
120 131
121 inline void Frame::clearClient() 132 inline void Frame::clearClient()
122 { 133 {
123 m_client = 0; 134 m_client = 0;
(...skipping 13 matching lines...) Expand all
137 { 148 {
138 return m_treeNode; 149 return m_treeNode;
139 } 150 }
140 151
141 // Allow equality comparisons of Frames by reference or pointer, interchangeably . 152 // Allow equality comparisons of Frames by reference or pointer, interchangeably .
142 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame) 153 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame)
143 154
144 } // namespace blink 155 } // namespace blink
145 156
146 #endif // Frame_h 157 #endif // Frame_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/Window/resources/window-property-collector.js ('k') | Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698