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

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

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missed a null check Created 6 years, 9 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/LocalFrame.h » ('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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 : m_host(host) 72 : m_host(host)
73 , m_ownerElement(ownerElement) 73 , m_ownerElement(ownerElement)
74 , m_frameID(generateFrameID()) 74 , m_frameID(generateFrameID())
75 , m_remotePlatformLayer(0) 75 , m_remotePlatformLayer(0)
76 { 76 {
77 ASSERT(page()); 77 ASSERT(page());
78 78
79 #ifndef NDEBUG 79 #ifndef NDEBUG
80 frameCounter.increment(); 80 frameCounter.increment();
81 #endif 81 #endif
82
83 if (this->ownerElement()) {
84 page()->incrementSubframeCount();
85 this->ownerElement()->setContentFrame(*this);
86 }
82 } 87 }
83 88
84 Frame::~Frame() 89 Frame::~Frame()
85 { 90 {
91 disconnectOwnerElement();
86 setDOMWindow(nullptr); 92 setDOMWindow(nullptr);
87 93
88 // FIXME: We should not be doing all this work inside the destructor 94 // FIXME: We should not be doing all this work inside the destructor
89 95
90 #ifndef NDEBUG 96 #ifndef NDEBUG
91 frameCounter.decrement(); 97 frameCounter.decrement();
92 #endif 98 #endif
93 99
94 HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.e nd(); 100 HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.e nd();
95 for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObserver s.begin(); it != stop; ++it) 101 for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObserver s.begin(); it != stop; ++it)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 { 178 {
173 m_host = 0; 179 m_host = 0;
174 } 180 }
175 181
176 bool Frame::isMainFrame() const 182 bool Frame::isMainFrame() const
177 { 183 {
178 Page* page = this->page(); 184 Page* page = this->page();
179 return page && this == page->mainFrame(); 185 return page && this == page->mainFrame();
180 } 186 }
181 187
188 void Frame::disconnectOwnerElement()
189 {
190 // FIXME: The semantics here are specific to LocalFrame and will need to cha nge
191 // when RemoteFrames no longer have Documents.
192 if (ownerElement()) {
193 if (Document* doc = document())
194 doc->topDocument().clearAXObjectCache();
195 ownerElement()->clearContentFrame();
196 if (page())
197 page()->decrementSubframeCount();
198 }
199 m_ownerElement = 0;
200 }
201
182 } // namespace WebCore 202 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698