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

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: Improved downcast checking. 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
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 if (ownerElement()) {
191 if (Document* doc = document())
192 doc->topDocument().clearAXObjectCache();
dcheng 2014/03/17 18:17:44 Do we need a FIXME here? What will topDocument() d
kenrb 2014/03/18 20:01:19 Done.
193 ownerElement()->clearContentFrame();
194 if (page())
195 page()->decrementSubframeCount();
196 }
197 m_ownerElement = 0;
198 }
199
182 } // namespace WebCore 200 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698