Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1458014dcd4499f3fbf200aa18c711c7f8d5fc70
https://github.com/WebKit/WebKit/commit/1458014dcd4499f3fbf200aa18c711c7f8d5fc70
Author: Ahmad Saleem <[email protected]>
Date: 2026-08-28 (Fri, 28 Aug 2026)
Changed paths:
M Source/WebCore/html/HTMLVideoElement.cpp
Log Message:
-----------
HTMLVideoElement::player() is called and protected redundantly in several
accessors
https://bugs.webkit.org/show_bug.cgi?id=322677
Reviewed by Chris Dumez.
Several HTMLVideoElement accessors called player() two-to-four times, each
protect(player()) constructing a fresh RefPtr (ref/deref churn) on hot paths.
Cache one RefPtr player = this->player() per function and reuse it. This also
normalizes webkitDecodedFrameCount()/webkitDroppedFrameCount(), which
previously dereferenced the raw pointer without protecting it.
No change in behavior.
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsAcceleratedRendering const):
(WebCore::HTMLVideoElement::supportsFullscreen const):
(WebCore::HTMLVideoElement::videoWidth const):
(WebCore::HTMLVideoElement::videoHeight const):
(WebCore::HTMLVideoElement::webkitDecodedFrameCount const):
(WebCore::HTMLVideoElement::webkitDroppedFrameCount const):
Canonical link: https://commits.webkit.org/320081@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications