Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ee6d739d218f27a98346d64c683e4b1bcd3c6b84
https://github.com/WebKit/WebKit/commit/ee6d739d218f27a98346d64c683e4b1bcd3c6b84
Author: Chris Dumez <[email protected]>
Date: 2025-11-06 (Thu, 06 Nov 2025)
Changed paths:
M Source/JavaScriptCore/bytecode/MetadataTable.h
M Source/JavaScriptCore/inspector/InspectorProtocolTypes.h
M Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py
M
Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
M Source/WTF/SaferCPPExpectations/MemoryUnsafeCastCheckerExpectations
M Source/WTF/wtf/Ref.h
M Source/WTF/wtf/RefPtr.h
M Source/WTF/wtf/WeakPtr.h
M Source/WTF/wtf/WeakRef.h
M Source/WTF/wtf/text/AtomString.h
M Source/WTF/wtf/text/AtomStringImpl.cpp
M Source/WTF/wtf/text/AtomStringImpl.h
M Source/WebCore/SaferCPPExpectations/MemoryUnsafeCastCheckerExpectations
M Source/WebCore/bindings/js/JSDOMWrapperCache.h
M Source/WebCore/css/typedom/CSSNumericValue.cpp
M Source/WebCore/css/typedom/CSSStyleValueFactory.cpp
M Source/WebCore/dom/TreeScope.cpp
M Source/WebCore/editing/ApplyStyleCommand.cpp
M Source/WebCore/editing/DeleteSelectionCommand.cpp
M Source/WebCore/editing/Editor.cpp
M Source/WebCore/editing/ReplaceSelectionCommand.cpp
M Source/WebCore/editing/TypingCommand.cpp
M Source/WebCore/inspector/InspectorCanvas.cpp
M Source/WebCore/page/EventHandler.cpp
M Source/WebCore/page/ImageOverlayController.cpp
M Source/WebCore/page/scrolling/ThreadedScrollingCoordinator.cpp
M Source/WebCore/platform/audio/cocoa/AudioFileReaderCocoa.cpp
M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm
M Source/WebCore/rendering/RenderPtr.h
M Source/WebCore/rendering/style/StyleCrossfadeImage.cpp
M Source/WebCore/rendering/style/StyleFilterImage.cpp
M Source/WebCore/svg/SVGFEImageElement.cpp
M Source/WebCore/svg/properties/SVGPrimitivePropertyAnimator.h
M Source/WebCore/svg/properties/SVGValuePropertyAnimator.h
M Source/WebCore/svg/properties/SVGValuePropertyListAnimator.h
M Source/WebKit/Shared/API/APIArray.h
M Source/WebKit/UIProcess/API/glib/WebKitFeature.cpp
M Source/WebKit/UIProcess/API/glib/WebKitWebExtensionMatchPattern.cpp
M Source/WebKit/UIProcess/WebPreferences.cpp
M Tools/TestWebKitAPI/Tests/WTF/Ref.cpp
Log Message:
-----------
Rename static_pointer_cast() / static_reference_cast() to
unsafeRefPtrDowncast() / unsafeRefDowncast()
https://bugs.webkit.org/show_bug.cgi?id=301991
Reviewed by Darin Adler.
Rename static_pointer_cast() / static_reference_cast() to unsafeRefPtrDowncast()
/ unsafeRefDowncast() to make it clear they are unsafe and reduce their use in
the codebase by leveraging:
1. downcast<>() which is truly safe and supports smart pointers nowadays
2. uncheckedDowncast<>() which is not ideal but better since it will at least
validate
the cast in debug builds.
3. New upcast() functions which are safe since it is safe to use static_cast
for upcasts.
* Source/JavaScriptCore/bytecode/MetadataTable.h:
(JSC::MetadataTable::unlinkedMetadata const):
* Source/JavaScriptCore/inspector/InspectorProtocolTypes.h:
(Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::runtimeCast):
* Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py:
*
Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
* Source/WTF/SaferCPPExpectations/MemoryUnsafeCastCheckerExpectations:
* Source/WTF/wtf/Ref.h:
(WTF::upcast):
(WTF::unsafeRefDowncast):
(WTF::uncheckedDowncast):
(WTF::downcast):
(WTF::dynamicDowncast):
(WTF::static_reference_cast): Deleted.
* Source/WTF/wtf/RefPtr.h:
(WTF::upcast):
(WTF::unsafeRefPtrDowncast):
(WTF::uncheckedDowncast):
(WTF::downcast):
(WTF::dynamicDowncast):
(WTF::static_pointer_cast): Deleted.
* Source/WTF/wtf/WeakPtr.h:
(WTF::weak_ptr_impl_cast):
(WTF::downcast):
(WTF::dynamicDowncast):
* Source/WTF/wtf/WeakRef.h:
(WTF::downcast):
(WTF::dynamicDowncast):
* Source/WTF/wtf/text/AtomString.h:
* Source/WTF/wtf/text/AtomStringImpl.cpp:
(WTF::AtomStringImpl::addSlowCase):
* Source/WTF/wtf/text/AtomStringImpl.h:
(WTF::AtomStringImpl::add):
* Source/WebCore/SaferCPPExpectations/MemoryUnsafeCastCheckerExpectations:
* Source/WebCore/bindings/js/JSDOMWrapperCache.h:
(WebCore::createWrapper):
* Source/WebCore/css/typedom/CSSNumericValue.cpp:
(WebCore::convertToExceptionOrNumericValue):
* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::reifyValue):
* Source/WebCore/dom/TreeScope.cpp:
(WebCore::TreeScope::elementFromPoint):
(WebCore::TreeScope::elementsFromPoint):
* Source/WebCore/editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
* Source/WebCore/editing/DeleteSelectionCommand.cpp:
(WebCore::firstInSpecialElement):
(WebCore::lastInSpecialElement):
* Source/WebCore/editing/Editor.cpp:
(WebCore::Editor::setComposition):
* Source/WebCore/editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::handleStyleSpans):
* Source/WebCore/editing/TypingCommand.cpp:
(WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
* Source/WebCore/inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::finalizeFrame):
(WebCore::InspectorCanvas::markCurrentFrameIncomplete):
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::updateDragAndDrop):
* Source/WebCore/page/ImageOverlayController.cpp:
(WebCore::ImageOverlayController::selectionQuadsDidChange):
* Source/WebCore/page/scrolling/ThreadedScrollingCoordinator.cpp:
(WebCore::ThreadedScrollingCoordinator::pageDestroyed):
* Source/WebCore/platform/audio/cocoa/AudioFileReaderCocoa.cpp:
(WebCore::AudioFileReader::demuxWebMData const):
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::didParseInitializationData):
* Source/WebCore/rendering/RenderPtr.h:
(WTF::downcast):
(WebCore::static_pointer_cast): Deleted.
* Source/WebCore/rendering/style/StyleCrossfadeImage.cpp:
(WebCore::StyleCrossfadeImage::computedStyleValue const):
* Source/WebCore/rendering/style/StyleFilterImage.cpp:
(WebCore::StyleFilterImage::computedStyleValue const):
* Source/WebCore/svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::imageBufferForEffect const):
* Source/WebCore/svg/properties/SVGPrimitivePropertyAnimator.h:
(WebCore::SVGPrimitivePropertyAnimator::SVGPrimitivePropertyAnimator):
* Source/WebCore/svg/properties/SVGValuePropertyAnimator.h:
(WebCore::SVGValuePropertyAnimator::SVGValuePropertyAnimator):
* Source/WebCore/svg/properties/SVGValuePropertyListAnimator.h:
(WebCore::SVGValuePropertyListAnimator::SVGValuePropertyListAnimator):
* Source/WebKit/Shared/API/APIArray.h:
* Source/WebKit/UIProcess/API/glib/WebKitFeature.cpp:
(webkitFeatureCreate):
* Source/WebKit/UIProcess/API/glib/WebKitWebExtensionMatchPattern.cpp:
(webkitWebExtensionMatchPatternCreate):
* Source/WebKit/UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::experimentalFeatures):
(WebKit::WebPreferences::internalDebugFeatures):
* Tools/TestWebKitAPI/Tests/WTF/Ref.cpp:
(TestWebKitAPI::TEST(WTF_Ref, StaticReferenceCastFromConstReference)):
(TestWebKitAPI::TEST(WTF_Ref, StaticReferenceCastFromRValueReference)):
Canonical link: https://commits.webkit.org/302695@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications