Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace EventLoopTimerPtr with EventLoopTimerHandle #16498

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

rniwa
Copy link
Member

@rniwa rniwa commented Aug 8, 2023

6b2ef31

Replace EventLoopTimerPtr with EventLoopTimerHandle
https://bugs.webkit.org/show_bug.cgi?id=259955

Reviewed by Wenson Hsieh.

This PR replaces EventLoopTimerPtr, which is a type cast of EventLoopTimer*,
with a proper EventLoopTimerHandle which knows how to clean up itself at the end.

EventLoopTimerHandle is simply a wrapper around RefPtr<EventLoopTimer> now that
EventLoopTimer is reference counted.

This PR also removes cancelScheduledTask and cancelRepeatingTask from EventLoop
and EventLoopTaskGroup as the timer is automatically deleted when the handle dies.

* Source/WebCore/dom/EventLoop.cpp:
(WebCore::EventLoopTimerHandle::EventLoopTimerHandle):
(WebCore::EventLoopTimerHandle::~EventLoopTimerHandle):
(WebCore::EventLoopTimerHandle::operator=):
(WebCore::EventLoop::scheduleTask):
(WebCore::EventLoop::cancelScheduledTask): Deleted.
(WebCore::EventLoop::removeScheduledTimer):
(WebCore::EventLoop::didExecuteScheduledTask): Deleted.
(WebCore::EventLoop::scheduleRepeatingTask):
(WebCore::EventLoop::cancelRepeatingTask): Deleted.
(WebCore::EventLoop::removeRepeatingTimer):
(WebCore::EventLoopTaskGroup::scheduleTask):.
(WebCore::EventLoopTaskGroup::cancelScheduledTask): Deleted.
(WebCore::EventLoopTaskGroup::didExecuteScheduledTask): Deleted.
(WebCore::EventLoopTaskGroup::removeScheduledTimer):
(WebCore::EventLoopTaskGroup::scheduleRepeatingTask):
(WebCore::EventLoopTaskGroup::cancelRepeatingTask): Deleted.
(WebCore::EventLoopTaskGroup::removeRepeatingTimer):
* Source/WebCore/dom/EventLoop.h:
(WebCore::EventLoopTimerHandle::operator UnspecifiedBoolType const):
(WebCore::EventLoopTimerHandle::unspecifiedBoolTypeInstance const):
* Source/WebCore/editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::stopAlternativeTextUITimer):
* Source/WebCore/editing/AlternativeTextController.h:
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::maybeRestoreContextSoon):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
* Source/WebCore/page/EventSource.cpp:
(WebCore::EventSource::scheduleInitialConnect):
(WebCore::EventSource::scheduleReconnect):
(WebCore::EventSource::close):
* Source/WebCore/page/EventSource.h:
* Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::flushProgressEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEventTimerFired):
* Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h:

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

ec8656b

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2   πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim
βœ… πŸ›  watch
βœ… πŸ›  πŸ§ͺ unsafe-merge βœ… πŸ›  watch-sim

@rniwa rniwa requested a review from cdumez as a code owner August 8, 2023 23:29
@rniwa rniwa self-assigned this Aug 8, 2023
@rniwa rniwa added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Aug 8, 2023
Source/WebCore/dom/EventLoop.cpp Outdated Show resolved Hide resolved
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 9, 2023
@rniwa rniwa removed the merging-blocked Applied to prevent a change from being merged label Aug 9, 2023
@rniwa rniwa added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Aug 9, 2023
https://bugs.webkit.org/show_bug.cgi?id=259955

Reviewed by Wenson Hsieh.

This PR replaces EventLoopTimerPtr, which is a type cast of EventLoopTimer*,
with a proper EventLoopTimerHandle which knows how to clean up itself at the end.

EventLoopTimerHandle is simply a wrapper around RefPtr<EventLoopTimer> now that
EventLoopTimer is reference counted.

This PR also removes cancelScheduledTask and cancelRepeatingTask from EventLoop
and EventLoopTaskGroup as the timer is automatically deleted when the handle dies.

* Source/WebCore/dom/EventLoop.cpp:
(WebCore::EventLoopTimerHandle::EventLoopTimerHandle):
(WebCore::EventLoopTimerHandle::~EventLoopTimerHandle):
(WebCore::EventLoopTimerHandle::operator=):
(WebCore::EventLoop::scheduleTask):
(WebCore::EventLoop::cancelScheduledTask): Deleted.
(WebCore::EventLoop::removeScheduledTimer):
(WebCore::EventLoop::didExecuteScheduledTask): Deleted.
(WebCore::EventLoop::scheduleRepeatingTask):
(WebCore::EventLoop::cancelRepeatingTask): Deleted.
(WebCore::EventLoop::removeRepeatingTimer):
(WebCore::EventLoopTaskGroup::scheduleTask):.
(WebCore::EventLoopTaskGroup::cancelScheduledTask): Deleted.
(WebCore::EventLoopTaskGroup::didExecuteScheduledTask): Deleted.
(WebCore::EventLoopTaskGroup::removeScheduledTimer):
(WebCore::EventLoopTaskGroup::scheduleRepeatingTask):
(WebCore::EventLoopTaskGroup::cancelRepeatingTask): Deleted.
(WebCore::EventLoopTaskGroup::removeRepeatingTimer):
* Source/WebCore/dom/EventLoop.h:
(WebCore::EventLoopTimerHandle::operator UnspecifiedBoolType const):
(WebCore::EventLoopTimerHandle::unspecifiedBoolTypeInstance const):
* Source/WebCore/editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::stopAlternativeTextUITimer):
* Source/WebCore/editing/AlternativeTextController.h:
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::maybeRestoreContextSoon):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
* Source/WebCore/page/EventSource.cpp:
(WebCore::EventSource::scheduleInitialConnect):
(WebCore::EventSource::scheduleReconnect):
(WebCore::EventSource::close):
* Source/WebCore/page/EventSource.h:
* Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::flushProgressEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEventTimerFired):
* Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h:

Canonical link: https://commits.webkit.org/266715@main
@webkit-commit-queue
Copy link
Collaborator

Committed 266715@main (6b2ef31): https://commits.webkit.org/266715@main

Reviewed commits have been landed. Closing PR #16498 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Aug 9, 2023
@webkit-commit-queue webkit-commit-queue merged commit 6b2ef31 into WebKit:main Aug 9, 2023
@rniwa rniwa deleted the fix259955 branch August 9, 2023 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOM For bugs specific to XML/HTML DOM elements (including parsing).
Projects
None yet
5 participants