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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 visitor->trace(m_view); | 213 visitor->trace(m_view); |
214 visitor->trace(m_domWindow); | 214 visitor->trace(m_domWindow); |
215 visitor->trace(m_pagePopupOwner); | 215 visitor->trace(m_pagePopupOwner); |
216 visitor->trace(m_script); | 216 visitor->trace(m_script); |
217 visitor->trace(m_editor); | 217 visitor->trace(m_editor); |
218 visitor->trace(m_spellChecker); | 218 visitor->trace(m_spellChecker); |
219 visitor->trace(m_selection); | 219 visitor->trace(m_selection); |
220 visitor->trace(m_eventHandler); | 220 visitor->trace(m_eventHandler); |
221 visitor->trace(m_console); | 221 visitor->trace(m_console); |
222 visitor->trace(m_inputMethodController); | 222 visitor->trace(m_inputMethodController); |
223 visitor->template registerWeakMembers<LocalFrame, &LocalFrame::clearWeakMemb
ers>(this); | |
224 HeapSupplementable<LocalFrame>::trace(visitor); | 223 HeapSupplementable<LocalFrame>::trace(visitor); |
225 #endif | 224 #endif |
226 LocalFrameLifecycleNotifier::trace(visitor); | 225 LocalFrameLifecycleNotifier::trace(visitor); |
227 Frame::trace(visitor); | 226 Frame::trace(visitor); |
228 } | 227 } |
229 | 228 |
230 DOMWindow* LocalFrame::domWindow() const | 229 DOMWindow* LocalFrame::domWindow() const |
231 { | 230 { |
232 return m_domWindow.get(); | 231 return m_domWindow.get(); |
233 } | 232 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 WindowProxyManager* LocalFrame::windowProxyManager() const | 363 WindowProxyManager* LocalFrame::windowProxyManager() const |
365 { | 364 { |
366 return m_script->windowProxyManager(); | 365 return m_script->windowProxyManager(); |
367 } | 366 } |
368 | 367 |
369 void LocalFrame::disconnectOwnerElement() | 368 void LocalFrame::disconnectOwnerElement() |
370 { | 369 { |
371 if (owner()) { | 370 if (owner()) { |
372 if (Document* document = this->document()) | 371 if (Document* document = this->document()) |
373 document->topDocument().clearAXObjectCache(); | 372 document->topDocument().clearAXObjectCache(); |
374 #if ENABLE(OILPAN) | |
375 // First give the plugin elements holding persisted, | |
376 // renderer-less plugins the opportunity to dispose of them. | |
377 for (const auto& pluginElement : m_pluginElements) | |
378 pluginElement->disconnectContentFrame(); | |
379 m_pluginElements.clear(); | |
380 #endif | |
381 } | 373 } |
382 Frame::disconnectOwnerElement(); | 374 Frame::disconnectOwnerElement(); |
383 } | 375 } |
384 | 376 |
385 bool LocalFrame::shouldClose() | 377 bool LocalFrame::shouldClose() |
386 { | 378 { |
387 // TODO(dcheng): This should be fixed to dispatch beforeunload events to | 379 // TODO(dcheng): This should be fixed to dispatch beforeunload events to |
388 // both local and remote frames. | 380 // both local and remote frames. |
389 return m_loader.shouldClose(); | 381 return m_loader.shouldClose(); |
390 } | 382 } |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 // direction to hide the top controls, only give the delta to the | 819 // direction to hide the top controls, only give the delta to the |
828 // top controls when the frame can scroll. | 820 // top controls when the frame can scroll. |
829 DoublePoint maximumScrollPosition = | 821 DoublePoint maximumScrollPosition = |
830 host()->visualViewport().maximumScrollPositionDouble() + | 822 host()->visualViewport().maximumScrollPositionDouble() + |
831 toDoubleSize(view()->maximumScrollPositionDouble()); | 823 toDoubleSize(view()->maximumScrollPositionDouble()); |
832 DoublePoint scrollPosition = host()->visualViewport() | 824 DoublePoint scrollPosition = host()->visualViewport() |
833 .visibleRectInDocument().location(); | 825 .visibleRectInDocument().location(); |
834 return delta.height() > 0 || scrollPosition.y() < maximumScrollPosition.y(); | 826 return delta.height() > 0 || scrollPosition.y() < maximumScrollPosition.y(); |
835 } | 827 } |
836 | 828 |
837 #if ENABLE(OILPAN) | |
838 void LocalFrame::registerPluginElement(HTMLPlugInElement* plugin) | |
839 { | |
840 m_pluginElements.add(plugin); | |
841 } | |
842 | |
843 void LocalFrame::unregisterPluginElement(HTMLPlugInElement* plugin) | |
844 { | |
845 ASSERT(m_pluginElements.contains(plugin)); | |
846 m_pluginElements.remove(plugin); | |
847 } | |
848 | |
849 void LocalFrame::clearWeakMembers(Visitor* visitor) | |
850 { | |
851 Vector<UntracedMember<HTMLPlugInElement>> deadPlugins; | |
852 for (const auto& pluginElement : m_pluginElements) { | |
853 if (!Heap::isHeapObjectAlive(pluginElement)) { | |
854 pluginElement->shouldDisposePlugin(); | |
855 deadPlugins.append(pluginElement); | |
856 } | |
857 } | |
858 for (unsigned i = 0; i < deadPlugins.size(); ++i) | |
859 m_pluginElements.remove(deadPlugins[i]); | |
860 } | |
861 #endif | |
862 | |
863 String LocalFrame::localLayerTreeAsText(unsigned flags) const | 829 String LocalFrame::localLayerTreeAsText(unsigned flags) const |
864 { | 830 { |
865 if (!contentLayoutObject()) | 831 if (!contentLayoutObject()) |
866 return String(); | 832 return String(); |
867 | 833 |
868 return contentLayoutObject()->compositor()->layerTreeAsText(static_cast<Laye
rTreeFlags>(flags)); | 834 return contentLayoutObject()->compositor()->layerTreeAsText(static_cast<Laye
rTreeFlags>(flags)); |
869 } | 835 } |
870 | 836 |
871 bool LocalFrame::shouldThrottleRendering() const | 837 bool LocalFrame::shouldThrottleRendering() const |
872 { | 838 { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 { | 890 { |
925 m_frame->disableNavigation(); | 891 m_frame->disableNavigation(); |
926 } | 892 } |
927 | 893 |
928 FrameNavigationDisabler::~FrameNavigationDisabler() | 894 FrameNavigationDisabler::~FrameNavigationDisabler() |
929 { | 895 { |
930 m_frame->enableNavigation(); | 896 m_frame->enableNavigation(); |
931 } | 897 } |
932 | 898 |
933 } // namespace blink | 899 } // namespace blink |
OLD | NEW |