• kbr@google.com's avatar
    2011-02-15 Kenneth Russell <kbr@google.com> · 7bf42ee7
    kbr@google.com authored
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            Implemented new method setMinimumTimerInterval in
            LayoutTestController for all ports.
    
            * DumpRenderTree/LayoutTestController.cpp:
            (setMinimumTimerIntervalCallback):
            (LayoutTestController::staticFunctions):
            * DumpRenderTree/LayoutTestController.h:
            * DumpRenderTree/chromium/LayoutTestController.cpp:
            (LayoutTestController::LayoutTestController):
            (LayoutTestController::setMinimumTimerInterval):
            * DumpRenderTree/chromium/LayoutTestController.h:
            * DumpRenderTree/chromium/WebViewHost.cpp:
            (WebViewHost::reset):
            * DumpRenderTree/gtk/DumpRenderTree.cpp:
            (resetDefaultsToConsistentValues):
            * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
            (LayoutTestController::setMinimumTimerInterval):
            * DumpRenderTree/mac/DumpRenderTree.mm:
            (resetWebViewToConsistentStateBeforeTesting):
            * DumpRenderTree/mac/LayoutTestControllerMac.mm:
            (LayoutTestController::setMinimumTimerInterval):
            * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
            (WebCore::WebPage::resetSettings):
            * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
            (LayoutTestController::setMinimumTimerInterval):
            * DumpRenderTree/qt/LayoutTestControllerQt.h:
            * DumpRenderTree/win/DumpRenderTree.cpp:
            (resetWebViewToConsistentStateBeforeTesting):
            * DumpRenderTree/win/LayoutTestControllerWin.cpp:
            (LayoutTestController::setMinimumTimerInterval):
    2011-02-15  Kenneth Russell  <kbr@google.com>
    
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            * fast/dom/timer-increase-min-interval-and-reset-part-1-expected.txt: Added.
            * fast/dom/timer-increase-min-interval-and-reset-part-1.html: Added.
            * fast/dom/timer-increase-min-interval-and-reset-part-2-expected.txt: Added.
            * fast/dom/timer-increase-min-interval-and-reset-part-2.html: Added.
              - Chained tests (the assumption is that the run-webkit-tests
                harness will run them sequentially, which is a reasonably good
                assumption) which verify that the minimum timer interval is
                reset between tests.
            * fast/dom/timer-increase-min-interval-expected.txt: Added.
            * fast/dom/timer-increase-min-interval.html: Added.
              - Verifies that increasing the minimum timer interval causes
                fast timers to run slowly.
            * fast/dom/timer-increase-then-decrease-min-interval-expected.txt: Added.
            * fast/dom/timer-increase-then-decrease-min-interval.html: Added.
              - Verifies that decreasing the minimum timer interval causes
                previously slowed-down timers to be reevaluated immediately.
    2011-02-15  Kenneth Russell  <kbr@google.com>
    
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            * public/WebSettings.h:
              - Added setMinimumTimerInterval.
            * src/WebKit.cpp:
            (WebKit::initialize):
              - Added FIXME to remove setting of page's default timer interval.
            * src/WebSettingsImpl.cpp:
            (WebKit::WebSettingsImpl::setMinimumTimerInterval):
              - Implemented new method on WebSettings.
            * src/WebSettingsImpl.h:
    2011-02-15  Kenneth Russell  <kbr@google.com>
    
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            Added needed methods to implement LayoutTestController's new
            setMinimumTimerInterval method.
    
            * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
            (DumpRenderTreeSupportQt::defaultMinimumTimerInterval):
            (DumpRenderTreeSupportQt::setMinimumTimerInterval):
            * WebCoreSupport/DumpRenderTreeSupportQt.h:
    2011-02-15  Kenneth Russell  <kbr@google.com>
    
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            Added needed methods to implement LayoutTestController's new
            setMinimumTimerInterval method.
    
            * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
            (DumpRenderTreeSupportGtk::defaultMinimumTimerInterval):
            (DumpRenderTreeSupportGtk::setMinimumTimerInterval):
            * WebCoreSupport/DumpRenderTreeSupportGtk.h:
    2011-02-15  Kenneth Russell  <kbr@google.com>
    
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            Added needed methods to implement LayoutTestController's new
            setMinimumTimerInterval method. Includes whitespace-only change to
            WebKit.idl to trigger proper rebuild on bots; will be removed in
            subsequent checkin.
    
            * Interfaces/IWebViewPrivate.idl:
            * Interfaces/WebKit.idl:
            * WebView.cpp:
            (WebView::initWithFrame):
            (WebView::defaultMinimumTimerInterval):
            (WebView::setMinimumTimerInterval):
            * WebView.h:
    2011-02-15  Kenneth Russell  <kbr@google.com>
    
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            Added needed methods to implement LayoutTestController's new
            setMinimumTimerInterval method.
    
            * WebView/WebView.mm:
            (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
            (+[WebView _defaultMinimumTimerInterval]):
            (-[WebView _setMinimumTimerInterval:]):
            * WebView/WebViewPrivate.h:
    2011-02-15  Kenneth Russell  <kbr@google.com>
    
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            Renamed DOMTimer::minTimerInterval and setMinTimerInterval to
            defaultMinTimerInterval and setDefaultMinTimerInterval, made them
            private and exposed them via Settings::defaultMinDOMTimerInterval
            and setDefaultMinDOMTimerInterval. Added new
            Settings::setMinDOMTimerInterval and minDOMTimerInterval.
    
            The storage for the minimum timer interval currently lives in the
            Page, though this could be moved to the Settings object if
            desired. The accessor methods on the Page are private and exposed
            to Settings by making Settings a friend, so the abstraction
            barrier is clear at the API level.
    
            Adjusting the interval both upward and downward may cause the fire
            times of the active timers on the page to be adjusted, if they
            would be affected by the clamping value. This is needed to reduce
            latency when bringing a tab to the foreground, in particular if
            the minimum timer interval was decreased from a very high value to
            a very low value.
    
            A new method, setMinimumTimerInterval, has been added to
            LayoutTestController, implemented in all ports of DumpRenderTree,
            and used in new layout tests.
    
            Ideally changing the page's minimum timer interval would affect
            dedicated workers, but this is too much to do in an initial patch,
            so a FIXME has been added.
    
            Tested with:
              - The new layout tests on the WebKit Mac and Chromium (Mac,
                Linux) DRT ports.
              - Hooked up the new API in Chromium and ran some simple manual
                tests.
    
            Tests: fast/dom/timer-increase-min-interval-and-reset-part-1.html
                   fast/dom/timer-increase-min-interval-and-reset-part-2.html
                   fast/dom/timer-increase-min-interval.html
                   fast/dom/timer-increase-then-decrease-min-interval.html
    
            * WebCore.exp.in:
            * dom/Document.cpp:
            (WebCore::Document::minimumTimerInterval):
            * dom/Document.h:
            * dom/ScriptExecutionContext.cpp:
            (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval):
            (WebCore::ScriptExecutionContext::minimumTimerInterval):
            * dom/ScriptExecutionContext.h:
            * page/DOMTimer.cpp:
            (WebCore::DOMTimer::DOMTimer):
            (WebCore::DOMTimer::fired):
            (WebCore::DOMTimer::adjustMinimumTimerInterval):
            (WebCore::DOMTimer::intervalClampedToMinimum):
            * page/DOMTimer.h:
            (WebCore::DOMTimer::defaultMinTimerInterval):
            (WebCore::DOMTimer::setDefaultMinTimerInterval):
            * page/Page.cpp:
            (WebCore::Page::Page):
            (WebCore::Page::setMinimumTimerInterval):
            (WebCore::Page::minimumTimerInterval):
            * page/Page.h:
            * page/Settings.cpp:
            (WebCore::Settings::setDefaultMinDOMTimerInterval):
            (WebCore::Settings::defaultMinDOMTimerInterval):
            (WebCore::Settings::setMinDOMTimerInterval):
            (WebCore::Settings::minDOMTimerInterval):
            * page/Settings.h:
            * platform/Timer.h:
            (WebCore::TimerBase::augmentFireInterval):
            (WebCore::TimerBase::augmentRepeatInterval):
    2011-02-15  Kenneth Russell  <kbr@google.com>
    
            Reviewed by Darin Fisher.
    
            Allow controlling minimum DOMTimer interval on a per-page basis
            https://bugs.webkit.org/show_bug.cgi?id=54312
    
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::WebPage):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    7bf42ee7
DOMTimer.h 3.1 KB