-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up use of WeakPtr with EventTarget objects (such as Node)
https://bugs.webkit.org/show_bug.cgi?id=265878 Reviewed by Darin Adler. Speed up use of WeakPtr with EventTarget objects (such as Node) by using a single thread ref count instead of ThreadSafeRefCounted for the WeakPtr implementation object, like we did for RenderObjects. Most of the EventTarget didn't need a thread-safe WeakPtr impl. For the subclasses that did, I either: - Updated the logic to avoid ref'ing / deref'ing the WeakPtr on a different thread. - Had the subclass inherit ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr and used ThreadSafeWeakPtr instead of WeakPtr. This tested as a small Speedometer progression (~0.3% on M1 with 98% confidence). More importantly, this will help us convert more CheckedPtr<Node> into WeakPtr<Node> without hurting performance. * Source/WebCore/Modules/cookie-store/CookieStore.cpp: (WebCore::CookieStore::MainThreadBridge::detach): (WebCore::CookieStore::~CookieStore): * Source/WebCore/Modules/mediastream/RTCRtpSFrameTransform.cpp: (WebCore::processFrame): (WebCore::RTCRtpSFrameTransform::initializeTransformer): (WebCore::transformFrame): (WebCore::RTCRtpSFrameTransform::createStreams): * Source/WebCore/Modules/mediastream/RTCRtpSFrameTransform.h: * Source/WebCore/Modules/permissions/MainThreadPermissionObserver.cpp: (WebCore::MainThreadPermissionObserver::MainThreadPermissionObserver): (WebCore::MainThreadPermissionObserver::stateChanged): * Source/WebCore/Modules/permissions/MainThreadPermissionObserver.h: * Source/WebCore/Modules/permissions/PermissionStatus.cpp: (WebCore::PermissionStatus::PermissionStatus): (WebCore::PermissionStatus::virtualHasPendingActivity const): * Source/WebCore/Modules/permissions/PermissionStatus.h: * Source/WebCore/Modules/webcodecs/WebCodecsAudioDecoder.cpp: (WebCore::WebCodecsAudioDecoder::configure): * Source/WebCore/Modules/webcodecs/WebCodecsAudioDecoder.h: * Source/WebCore/Modules/webcodecs/WebCodecsAudioEncoder.cpp: (WebCore::WebCodecsAudioEncoder::configure): * Source/WebCore/Modules/webcodecs/WebCodecsAudioEncoder.h: * Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp: (WebCore::WebCodecsVideoDecoder::configure): * Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.h: * Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp: (WebCore::WebCodecsVideoEncoder::configure): (WebCore::WebCodecsVideoEncoder::encode): (WebCore::WebCodecsVideoEncoder::flush): * Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.h: * Source/WebCore/dom/BroadcastChannel.cpp: (WebCore::BroadcastChannel::MainThreadBridge::detach): (WebCore::BroadcastChannel::~BroadcastChannel): * Source/WebCore/dom/EventTarget.h: * Source/WebCore/dom/MessagePort.cpp: (WebCore::WTF_REQUIRES_LOCK): (WebCore::MessagePort::MessagePort): (WebCore::MessagePort::~MessagePort): (WebCore::MessagePort::ref const): Deleted. (WebCore::MessagePort::deref const): Deleted. * Source/WebCore/dom/MessagePort.h: * Source/WebCore/html/OffscreenCanvas.h: Canonical link: https://commits.webkit.org/271982@main
- Loading branch information
Showing
20 changed files
with
99 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.