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

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

Issue 544013005: Simplify window.closed testing. (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
« no previous file with comments | « no previous file | Source/core/frame/Frame.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
103
104 protected: 101 protected:
105 Frame(FrameClient*, FrameHost*, FrameOwner*); 102 Frame(FrameClient*, FrameHost*, FrameOwner*);
106 103
107 mutable FrameTree m_treeNode; 104 mutable FrameTree m_treeNode;
108 105
109 FrameHost* m_host; 106 FrameHost* m_host;
110 FrameOwner* m_owner; 107 FrameOwner* m_owner;
111 108
112 RefPtrWillBePersistent<LocalDOMWindow> m_domWindow; 109 RefPtrWillBePersistent<LocalDOMWindow> m_domWindow;
113 110
114 private: 111 private:
115 FrameClient* m_client; 112 FrameClient* m_client;
116 blink::WebLayer* m_remotePlatformLayer; 113 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;
125 }; 114 };
126 115
127 inline FrameClient* Frame::client() const 116 inline FrameClient* Frame::client() const
128 { 117 {
129 return m_client; 118 return m_client;
130 } 119 }
131 120
132 inline void Frame::clearClient() 121 inline void Frame::clearClient()
133 { 122 {
134 m_client = 0; 123 m_client = 0;
(...skipping 13 matching lines...) Expand all
148 { 137 {
149 return m_treeNode; 138 return m_treeNode;
150 } 139 }
151 140
152 // Allow equality comparisons of Frames by reference or pointer, interchangeably . 141 // Allow equality comparisons of Frames by reference or pointer, interchangeably .
153 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame) 142 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame)
154 143
155 } // namespace blink 144 } // namespace blink
156 145
157 #endif // Frame_h 146 #endif // Frame_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698