[webkit-changes] [WebKit/WebKit] 43d0b6: Integrate setTimeout and setInterval with HTML5 ev...

Ryosuke Niwa noreply at github.com
Fri Aug 11 13:28:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 43d0b6dbeebf8116a9ff8af86280528bd8884676
      https://github.com/WebKit/WebKit/commit/43d0b6dbeebf8116a9ff8af86280528bd8884676
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-08-11 (Fri, 11 Aug 2023)

  Changed paths:
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/dom/EventLoop.cpp
    M Source/WebCore/dom/EventLoop.h
    M Source/WebCore/dom/ScriptExecutionContext.cpp
    M Source/WebCore/dom/ScriptExecutionContext.h
    M Source/WebCore/dom/TaskSource.h
    M Source/WebCore/page/DOMTimer.cpp
    M Source/WebCore/page/DOMTimer.h
    R Source/WebCore/page/SuspendableTimer.cpp
    R Source/WebCore/page/SuspendableTimer.h
    M Source/WebCore/testing/Internals.cpp

  Log Message:
  -----------
  Integrate setTimeout and setInterval with HTML5 event loop
https://bugs.webkit.org/show_bug.cgi?id=203137

Reviewed by Chris Dumez.

This PR integrates DOM timers with HTML5 event loop. Specifically, DOMTimer now uses
EventLoopTaskGroup::scheduleTask and EventLoopTaskGroup::scheduleRepeatingTask instead of
inheriting from SuspendableTimer. This PR also deletes SuspendableTimer class now that
we've migrated all uses of it to EventLoop's equivalents.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/EventLoop.cpp:
(WebCore::EventLoop::scheduleTask): Fixed a bug that the newly created timer won't be
suspended when the task group had been suspended.
(WebCore::EventLoop::scheduleRepeatingTask): Ditto.
(WebCore::EventLoopTaskGroup::setTimerAlignment):
(WebCore::EventLoopTaskGroup::setTimerHasReachedMaxNestingLevel):
(WebCore::EventLoopTaskGroup::adjustTimerNextTimeout):
(WebCore::EventLoopTaskGroup::adjustTimerRepeatInterval):
(WebCore::EventLoopTaskGroup::didChangeTimerAlignmentInterval):
* Source/WebCore/dom/EventLoop.h:
* Source/WebCore/dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::didChangeTimerAlignmentInterval):
* Source/WebCore/dom/ScriptExecutionContext.h:
* Source/WebCore/dom/TaskSource.h:
* Source/WebCore/page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::removeById):
(WebCore::DOMTimer::fired):
(WebCore::DOMTimer::stop):
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
(WebCore::DOMTimer::didStop): Deleted.
* Source/WebCore/page/DOMTimer.h:
* Source/WebCore/page/SuspendableTimer.cpp: Removed.
* Source/WebCore/page/SuspendableTimer.h: Removed.
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::isTimerThrottled):

Canonical link: https://commits.webkit.org/266828@main




More information about the webkit-changes mailing list