Don't enable speculative tiles immediately after main load stops progressing
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jan 2014 22:03:27 +0000 (22:03 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jan 2014 22:03:27 +0000 (22:03 +0000)
commitd8ee9494262531a4368c9fe5052cc4978e27b760
treeb19d10b4fe66edd5d6b159a4845ee7bd81a46785
parent0561bde12f1d890239bcb7fbc6a53c8f5a817add
Don't enable speculative tiles immediately after main load stops progressing
https://bugs.webkit.org/show_bug.cgi?id=127507

Reviewed by Andreas Kling.

It is common for timers and events to trigger more loading after the initial main frame loading
has completed. We should delay a bit before enabling speculative tiles and keep them disabled
if loading still continues.

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::adjustTiledBackingCoverage):
(WebCore::shouldEnableSpeculativeTilingDuringLoading):
(WebCore::FrameView::enableSpeculativeTilingIfNeeded):

    When load progression stops wait 0.5s before enabling speculative tiles.

(WebCore::FrameView::speculativeTilingEnableTimerFired):

    Don't enable speculative tiles if the progression has started again. Instead restart the timer.

* page/FrameView.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::computeTileCoverage):

    Move the FrameView level code to FrameView (so we don't need to add a timer to every RenderLayerBacking).

* rendering/RenderLayerBacking.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h