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

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

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 | « Source/core/frame/Frame.h ('k') | Source/core/frame/LocalDOMWindow.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 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 using namespace HTMLNames; 56 using namespace HTMLNames;
57 57
58 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); 58 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame"));
59 59
60 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) 60 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
61 : m_treeNode(this) 61 : m_treeNode(this)
62 , m_host(host) 62 , m_host(host)
63 , m_owner(owner) 63 , m_owner(owner)
64 , m_client(client) 64 , m_client(client)
65 , m_remotePlatformLayer(0) 65 , m_remotePlatformLayer(0)
66 , m_hasBeenClosed(false)
67 { 66 {
68 ASSERT(page()); 67 ASSERT(page());
69 68
70 #ifndef NDEBUG 69 #ifndef NDEBUG
71 frameCounter.increment(); 70 frameCounter.increment();
72 #endif 71 #endif
73 72
74 if (m_owner) { 73 if (m_owner) {
75 page()->incrementSubframeCount(); 74 page()->incrementSubframeCount();
76 if (m_owner->isLocal()) 75 if (m_owner->isLocal())
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 return 0; 115 return 0;
117 } 116 }
118 117
119 Settings* Frame::settings() const 118 Settings* Frame::settings() const
120 { 119 {
121 if (m_host) 120 if (m_host)
122 return &m_host->settings(); 121 return &m_host->settings();
123 return 0; 122 return 0;
124 } 123 }
125 124
126 void Frame::setHasBeenClosed()
127 {
128 ASSERT(!m_hasBeenClosed);
129 m_hasBeenClosed = true;
130 }
131
132 void Frame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow) 125 void Frame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow)
133 { 126 {
134 if (m_domWindow) 127 if (m_domWindow)
135 m_domWindow->reset(); 128 m_domWindow->reset();
136 m_domWindow = domWindow; 129 m_domWindow = domWindow;
137 } 130 }
138 131
139 static ChromeClient& emptyChromeClient() 132 static ChromeClient& emptyChromeClient()
140 { 133 {
141 DEFINE_STATIC_LOCAL(EmptyChromeClient, client, ()); 134 DEFINE_STATIC_LOCAL(EmptyChromeClient, client, ());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 199 }
207 m_owner = 0; 200 m_owner = 0;
208 } 201 }
209 202
210 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const 203 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const
211 { 204 {
212 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; 205 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0;
213 } 206 }
214 207
215 } // namespace blink 208 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698