| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 page()->incrementSubframeCount(); | 74 page()->incrementSubframeCount(); |
| 75 if (m_owner->isLocal()) | 75 if (m_owner->isLocal()) |
| 76 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); | 76 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); |
| 77 } else { | 77 } else { |
| 78 page()->setMainFrame(this); | 78 page()->setMainFrame(this); |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 Frame::~Frame() | 82 Frame::~Frame() |
| 83 { | 83 { |
| 84 // FIXME: We should not be doing all this work inside the destructor |
| 85 #if !ENABLE(OILPAN) |
| 84 disconnectOwnerElement(); | 86 disconnectOwnerElement(); |
| 85 setDOMWindow(nullptr); | 87 setDOMWindow(nullptr); |
| 86 | 88 #endif |
| 87 // FIXME: We should not be doing all this work inside the destructor | |
| 88 | 89 |
| 89 #ifndef NDEBUG | 90 #ifndef NDEBUG |
| 90 frameCounter.decrement(); | 91 frameCounter.decrement(); |
| 91 #endif | 92 #endif |
| 92 } | 93 } |
| 93 | 94 |
| 95 void Frame::trace(Visitor* visitor) |
| 96 { |
| 97 visitor->trace(m_treeNode); |
| 98 visitor->trace(m_host); |
| 99 visitor->trace(m_owner); |
| 100 visitor->trace(m_domWindow); |
| 101 } |
| 102 |
| 94 void Frame::detachChildren() | 103 void Frame::detachChildren() |
| 95 { | 104 { |
| 96 typedef Vector<RefPtr<Frame> > FrameVector; | 105 typedef WillBeHeapVector<RefPtrWillBeMember<Frame> > FrameVector; |
| 97 FrameVector childrenToDetach; | 106 FrameVector childrenToDetach; |
| 98 childrenToDetach.reserveCapacity(tree().childCount()); | 107 childrenToDetach.reserveCapacity(tree().childCount()); |
| 99 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi
bling()) | 108 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi
bling()) |
| 100 childrenToDetach.append(child); | 109 childrenToDetach.append(child); |
| 101 FrameVector::iterator end = childrenToDetach.end(); | 110 FrameVector::iterator end = childrenToDetach.end(); |
| 102 for (FrameVector::iterator it = childrenToDetach.begin(); it != end; ++it) | 111 for (FrameVector::iterator it = childrenToDetach.begin(); it != end; ++it) { |
| 103 (*it)->detach(); | 112 (*it)->detach(); |
| 113 (*it)->disconnectOwnerElement(); |
| 114 } |
| 104 } | 115 } |
| 105 | 116 |
| 106 FrameHost* Frame::host() const | 117 FrameHost* Frame::host() const |
| 107 { | 118 { |
| 108 return m_host; | 119 return m_host; |
| 109 } | 120 } |
| 110 | 121 |
| 111 Page* Frame::page() const | 122 Page* Frame::page() const |
| 112 { | 123 { |
| 113 if (m_host) | 124 if (m_host) |
| 114 return &m_host->page(); | 125 return &m_host->page(); |
| 115 return 0; | 126 return 0; |
| 116 } | 127 } |
| 117 | 128 |
| 118 Settings* Frame::settings() const | 129 Settings* Frame::settings() const |
| 119 { | 130 { |
| 120 if (m_host) | 131 if (m_host) |
| 121 return &m_host->settings(); | 132 return &m_host->settings(); |
| 122 return 0; | 133 return 0; |
| 123 } | 134 } |
| 124 | 135 |
| 125 void Frame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow) | 136 void Frame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow) |
| 126 { | 137 { |
| 127 if (m_domWindow) | 138 if (m_domWindow) |
| 128 m_domWindow->reset(); | 139 m_domWindow->reset(); |
| 140 |
| 129 m_domWindow = domWindow; | 141 m_domWindow = domWindow; |
| 130 } | 142 } |
| 131 | 143 |
| 132 static ChromeClient& emptyChromeClient() | 144 static ChromeClient& emptyChromeClient() |
| 133 { | 145 { |
| 134 DEFINE_STATIC_LOCAL(EmptyChromeClient, client, ()); | 146 DEFINE_STATIC_LOCAL(EmptyChromeClient, client, ()); |
| 135 return client; | 147 return client; |
| 136 } | 148 } |
| 137 | 149 |
| 138 ChromeClient& Frame::chromeClient() const | 150 ChromeClient& Frame::chromeClient() const |
| (...skipping 12 matching lines...) Expand all Loading... |
| 151 return 0; | 163 return 0; |
| 152 // FIXME: If <object> is ever fixed to disassociate itself from frames | 164 // FIXME: If <object> is ever fixed to disassociate itself from frames |
| 153 // that it has started but canceled, then this can turn into an ASSERT | 165 // that it has started but canceled, then this can turn into an ASSERT |
| 154 // since ownerElement() would be 0 when the load is canceled. | 166 // since ownerElement() would be 0 when the load is canceled. |
| 155 // https://bugs.webkit.org/show_bug.cgi?id=18585 | 167 // https://bugs.webkit.org/show_bug.cgi?id=18585 |
| 156 if (!object->isRenderPart()) | 168 if (!object->isRenderPart()) |
| 157 return 0; | 169 return 0; |
| 158 return toRenderPart(object); | 170 return toRenderPart(object); |
| 159 } | 171 } |
| 160 | 172 |
| 161 void Frame::setRemotePlatformLayer(blink::WebLayer* layer) | 173 void Frame::setRemotePlatformLayer(WebLayer* layer) |
| 162 { | 174 { |
| 163 if (m_remotePlatformLayer) | 175 if (m_remotePlatformLayer) |
| 164 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); | 176 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); |
| 165 m_remotePlatformLayer = layer; | 177 m_remotePlatformLayer = layer; |
| 166 if (m_remotePlatformLayer) | 178 if (m_remotePlatformLayer) |
| 167 GraphicsLayer::registerContentsLayer(layer); | 179 GraphicsLayer::registerContentsLayer(layer); |
| 168 | 180 |
| 169 ASSERT(owner()); | 181 ASSERT(owner()); |
| 170 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); | 182 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); |
| 171 if (RenderPart* renderer = ownerRenderer()) | 183 if (RenderPart* renderer = ownerRenderer()) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 190 } | 202 } |
| 191 | 203 |
| 192 void Frame::disconnectOwnerElement() | 204 void Frame::disconnectOwnerElement() |
| 193 { | 205 { |
| 194 if (m_owner) { | 206 if (m_owner) { |
| 195 if (m_owner->isLocal()) | 207 if (m_owner->isLocal()) |
| 196 toHTMLFrameOwnerElement(m_owner)->clearContentFrame(); | 208 toHTMLFrameOwnerElement(m_owner)->clearContentFrame(); |
| 197 if (page()) | 209 if (page()) |
| 198 page()->decrementSubframeCount(); | 210 page()->decrementSubframeCount(); |
| 199 } | 211 } |
| 200 m_owner = 0; | 212 m_owner = nullptr; |
| 201 } | 213 } |
| 202 | 214 |
| 203 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const | 215 HTMLFrameOwnerElement* Frame::deprecatedLocalOwner() const |
| 204 { | 216 { |
| 205 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; | 217 return m_owner && m_owner->isLocal() ? toHTMLFrameOwnerElement(m_owner) : 0; |
| 206 } | 218 } |
| 207 | 219 |
| 208 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |