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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 return scrollbarInclusion == ExcludeScrollbars ? excludeScrollbars(m_layoutS ize) : m_layoutSize; 1639 return scrollbarInclusion == ExcludeScrollbars ? excludeScrollbars(m_layoutS ize) : m_layoutSize;
1640 } 1640 }
1641 1641
1642 void FrameView::setLayoutSize(const IntSize& size) 1642 void FrameView::setLayoutSize(const IntSize& size)
1643 { 1643 {
1644 ASSERT(!layoutSizeFixedToFrameSize()); 1644 ASSERT(!layoutSizeFixedToFrameSize());
1645 1645
1646 setLayoutSizeInternal(size); 1646 setLayoutSizeInternal(size);
1647 } 1647 }
1648 1648
1649 void FrameView::didScrollTimerFired(Timer<FrameView>*) 1649 void FrameView::didScrollTimerFired(TimerBase*)
1650 { 1650 {
1651 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull()) 1651 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull())
1652 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); 1652 m_frame->document()->fetcher()->updateAllImageResourcePriorities();
1653 } 1653 }
1654 1654
1655 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded(const DoubleSize& scrollDelta) 1655 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded(const DoubleSize& scrollDelta)
1656 { 1656 {
1657 // Nothing to do after scrolling if there are no fixed position elements. 1657 // Nothing to do after scrolling if there are no fixed position elements.
1658 if (!hasViewportConstrainedObjects()) 1658 if (!hasViewportConstrainedObjects())
1659 return; 1659 return;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 object.updateWidgetGeometry(); 2062 object.updateWidgetGeometry();
2063 2063
2064 // Prevent plugins from causing infinite updates of themselves. 2064 // Prevent plugins from causing infinite updates of themselves.
2065 // FIXME: Do we really need to prevent this? 2065 // FIXME: Do we really need to prevent this?
2066 m_partUpdateSet.remove(&object); 2066 m_partUpdateSet.remove(&object);
2067 } 2067 }
2068 2068
2069 return m_partUpdateSet.isEmpty(); 2069 return m_partUpdateSet.isEmpty();
2070 } 2070 }
2071 2071
2072 void FrameView::updateWidgetsTimerFired(Timer<FrameView>*) 2072 void FrameView::updateWidgetsTimerFired(TimerBase*)
2073 { 2073 {
2074 ASSERT(!isInPerformLayout()); 2074 ASSERT(!isInPerformLayout());
2075 m_updateWidgetsTimer.stop(); 2075 m_updateWidgetsTimer.stop();
2076 for (unsigned i = 0; i < maxUpdateWidgetsIterations; ++i) { 2076 for (unsigned i = 0; i < maxUpdateWidgetsIterations; ++i) {
2077 if (updateWidgets()) 2077 if (updateWidgets())
2078 return; 2078 return;
2079 } 2079 }
2080 } 2080 }
2081 2081
2082 void FrameView::flushAnyPendingPostLayoutTasks() 2082 void FrameView::flushAnyPendingPostLayoutTasks()
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 2161
2162 m_lastViewportSize = layoutSize(IncludeScrollbars); 2162 m_lastViewportSize = layoutSize(IncludeScrollbars);
2163 m_lastZoomFactor = layoutViewItem.style()->zoom(); 2163 m_lastZoomFactor = layoutViewItem.style()->zoom();
2164 2164
2165 m_frame->document()->enqueueResizeEvent(); 2165 m_frame->document()->enqueueResizeEvent();
2166 2166
2167 if (m_frame->isMainFrame()) 2167 if (m_frame->isMainFrame())
2168 InspectorInstrumentation::didResizeMainFrame(m_frame.get()); 2168 InspectorInstrumentation::didResizeMainFrame(m_frame.get());
2169 } 2169 }
2170 2170
2171 void FrameView::postLayoutTimerFired(Timer<FrameView>*) 2171 void FrameView::postLayoutTimerFired(TimerBase*)
2172 { 2172 {
2173 performPostLayoutTasks(); 2173 performPostLayoutTasks();
2174 } 2174 }
2175 2175
2176 void FrameView::updateCounters() 2176 void FrameView::updateCounters()
2177 { 2177 {
2178 LayoutView* view = layoutView(); 2178 LayoutView* view = layoutView();
2179 if (!view->hasLayoutCounters()) 2179 if (!view->hasLayoutCounters())
2180 return; 2180 return;
2181 2181
(...skipping 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after
4284 } 4284 }
4285 4285
4286 bool FrameView::canThrottleRendering() const 4286 bool FrameView::canThrottleRendering() const
4287 { 4287 {
4288 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4288 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4289 return false; 4289 return false;
4290 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4290 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4291 } 4291 }
4292 4292
4293 } // namespace blink 4293 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698