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

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: 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; }
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. For Oilpan,
Mads Ager (chromium) 2014/09/17 07:47:39 Remove the Oilpan reference in this patch since Fr
sof 2014/09/17 08:08:28 Thanks, that would premature to mention. Removed.
121 // any release will only happen at the next GC (at the earliest.)
122 //
123 // Hence, keep a separate flag that's set when the frame is
124 // closed. It is consulted by window.closed.
125 bool m_hasBeenClosed;
114 }; 126 };
115 127
116 inline FrameClient* Frame::client() const 128 inline FrameClient* Frame::client() const
117 { 129 {
118 return m_client; 130 return m_client;
119 } 131 }
120 132
121 inline void Frame::clearClient() 133 inline void Frame::clearClient()
122 { 134 {
123 m_client = 0; 135 m_client = 0;
(...skipping 13 matching lines...) Expand all
137 { 149 {
138 return m_treeNode; 150 return m_treeNode;
139 } 151 }
140 152
141 // Allow equality comparisons of Frames by reference or pointer, interchangeably . 153 // Allow equality comparisons of Frames by reference or pointer, interchangeably .
142 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame) 154 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame)
143 155
144 } // namespace blink 156 } // namespace blink
145 157
146 #endif // Frame_h 158 #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