[webkit-changes] [WebKit/WebKit] cea23d: downcast() should return a smart pointer when pass...

Chris Dumez noreply at github.com
Tue Sep 12 15:37:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cea23dc5de2819f6c3774732c7c1771cfd0ff556
      https://github.com/WebKit/WebKit/commit/cea23dc5de2819f6c3774732c7c1771cfd0ff556
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M Source/WTF/wtf/Ref.h
    M Source/WTF/wtf/RefPtr.h
    M Source/WTF/wtf/TypeCasts.h
    M Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
    M Source/WebCore/bindings/js/JSElementCustom.cpp
    M Source/WebCore/bindings/js/JSNodeCustom.cpp
    M Source/WebCore/bindings/js/JSWebXRSpaceCustom.cpp
    M Source/WebCore/css/CSSCounterStyleDescriptors.cpp
    M Source/WebCore/css/CSSStyleRule.cpp
    M Source/WebCore/css/StyleSheetContents.cpp
    M Source/WebCore/css/parser/CSSParserImpl.cpp
    M Source/WebCore/css/typedom/CSSNumericValue.cpp
    M Source/WebCore/css/typedom/StylePropertyMap.cpp
    M Source/WebCore/html/HTMLCanvasElement.cpp
    M Source/WebCore/html/HTMLSlotElement.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
    M Source/WebCore/html/track/WebVTTParser.cpp
    M Source/WebCore/loader/SubstituteResource.h
    M Source/WebCore/page/DOMTimer.cpp
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/PerformanceUserTiming.cpp
    M Source/WebCore/page/scrolling/ScrollingStateTree.cpp
    M Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
    M Source/WebCore/style/RuleSetBuilder.cpp
    M Source/WebCore/style/StyleInvalidator.cpp
    M Source/WebCore/style/UserAgentStyle.cpp
    M Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

  Log Message:
  -----------
  downcast() should return a smart pointer when passed in a smart pointer
https://bugs.webkit.org/show_bug.cgi?id=261415

Reviewed by Darin Adler.

downcast() should return a smart pointer when passed in a smart pointer.
Otherwise, it forces us to use the less-safe static_pointer_cast() /
static_reference_cast() to cast without causing ref counting churn.

This will help with our increased adoption of smart pointers in WebKit.

* Source/WTF/wtf/Ref.h:
(WTF::is):
(WTF::downcast):
(WTF::dynamicDowncast):
* Source/WTF/wtf/RefPtr.h:
(WTF::is):
(WTF::downcast):
* Source/WTF/wtf/TypeCasts.h:
(WTF::is):
* Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp:
* Source/WebCore/bindings/js/JSElementCustom.cpp:
(WebCore::createNewElementWrapper):
* Source/WebCore/bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
* Source/WebCore/bindings/js/JSWebXRSpaceCustom.cpp:
(WebCore::toJSNewlyCreated):
* Source/WebCore/css/CSSCounterStyleDescriptors.cpp:
(WebCore::nameFromCSSValue):
(WebCore::additiveSymbolsFromCSSValue):
(WebCore::padFromCSSValue):
(WebCore::symbolsFromCSSValue):
* Source/WebCore/css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::setSelectorText):
(WebCore::CSSStyleRule::insertRule):
(WebCore::CSSStyleRule::deleteRule):
* Source/WebCore/css/StyleSheetContents.cpp:
(WebCore::traverseRulesInVector):
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeFontFeatureValuesRule):
* Source/WebCore/css/typedom/CSSNumericValue.cpp:
(WebCore::CSSNumericValue::toSum):
* Source/WebCore/css/typedom/StylePropertyMap.cpp:
(WebCore::StylePropertyMap::set):
* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getImageData):
* Source/WebCore/html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::assignedElements const):
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::getImageData const):
* Source/WebCore/html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* Source/WebCore/loader/SubstituteResource.h:
(WebCore::SubstituteResource::data const):
* Source/WebCore/page/DOMTimer.cpp:
(WebCore::DOMTimerFireState::DOMTimerFireState):
(WebCore::DOMTimerFireState::contextDocument const):
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::scrollToFragment):
* Source/WebCore/page/PerformanceUserTiming.cpp:
(WebCore::PerformanceUserTiming::mark):
* Source/WebCore/page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::commit):
* Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
* Source/WebCore/style/RuleSetBuilder.cpp:
(WebCore::Style::RuleSetBuilder::addChildRule):
* Source/WebCore/style/StyleInvalidator.cpp:
(WebCore::Style::shouldDirtyAllStyle):
* Source/WebCore/style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::addToDefaultStyle):
* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performImmediateActionHitTestAtLocation):

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




More information about the webkit-changes mailing list