| OLD | NEW |
| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 : m_host(host) | 73 : m_host(host) |
| 74 , m_ownerElement(ownerElement) | 74 , m_ownerElement(ownerElement) |
| 75 , m_frameID(generateFrameID()) | 75 , m_frameID(generateFrameID()) |
| 76 , m_remotePlatformLayer(0) | 76 , m_remotePlatformLayer(0) |
| 77 { | 77 { |
| 78 ASSERT(page()); | 78 ASSERT(page()); |
| 79 | 79 |
| 80 #ifndef NDEBUG | 80 #ifndef NDEBUG |
| 81 frameCounter.increment(); | 81 frameCounter.increment(); |
| 82 #endif | 82 #endif |
| 83 | |
| 84 if (this->ownerElement()) { | |
| 85 page()->incrementSubframeCount(); | |
| 86 this->ownerElement()->setContentFrame(*this); | |
| 87 } | |
| 88 } | 83 } |
| 89 | 84 |
| 90 Frame::~Frame() | 85 Frame::~Frame() |
| 91 { | 86 { |
| 92 disconnectOwnerElement(); | |
| 93 setDOMWindow(nullptr); | 87 setDOMWindow(nullptr); |
| 94 | 88 |
| 95 // FIXME: We should not be doing all this work inside the destructor | 89 // FIXME: We should not be doing all this work inside the destructor |
| 96 | 90 |
| 97 #ifndef NDEBUG | 91 #ifndef NDEBUG |
| 98 frameCounter.decrement(); | 92 frameCounter.decrement(); |
| 99 #endif | 93 #endif |
| 100 | 94 |
| 101 HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.e
nd(); | 95 HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.e
nd(); |
| 102 for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObserver
s.begin(); it != stop; ++it) | 96 for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObserver
s.begin(); it != stop; ++it) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 { | 190 { |
| 197 m_host = 0; | 191 m_host = 0; |
| 198 } | 192 } |
| 199 | 193 |
| 200 bool Frame::isMainFrame() const | 194 bool Frame::isMainFrame() const |
| 201 { | 195 { |
| 202 Page* page = this->page(); | 196 Page* page = this->page(); |
| 203 return page && this == page->mainFrame(); | 197 return page && this == page->mainFrame(); |
| 204 } | 198 } |
| 205 | 199 |
| 206 void Frame::disconnectOwnerElement() | |
| 207 { | |
| 208 // FIXME: The semantics here are specific to LocalFrame and will need to cha
nge | |
| 209 // when RemoteFrames no longer have Documents. | |
| 210 if (ownerElement()) { | |
| 211 if (Document* doc = document()) | |
| 212 doc->topDocument().clearAXObjectCache(); | |
| 213 ownerElement()->clearContentFrame(); | |
| 214 if (page()) | |
| 215 page()->decrementSubframeCount(); | |
| 216 } | |
| 217 m_ownerElement = 0; | |
| 218 } | |
| 219 | |
| 220 } // namespace WebCore | 200 } // namespace WebCore |
| OLD | NEW |