[webkit-changes] [WebKit/WebKit] b08052: Remove RefPtr::releaseConstNonNull

Ryan Reno noreply at github.com
Wed Sep 27 19:35:06 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b08052889f6e17a4ec33cbe934dbecdc1db4baf5
      https://github.com/WebKit/WebKit/commit/b08052889f6e17a4ec33cbe934dbecdc1db4baf5
  Author: Ryan Reno <rreno at apple.com>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M Source/WTF/wtf/RefPtr.h
    M Tools/TestWebKitAPI/Tests/WTF/RefLogger.cpp
    M Tools/TestWebKitAPI/Tests/WTF/RefLogger.h
    M Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp

  Log Message:
  -----------
  Remove RefPtr::releaseConstNonNull
https://bugs.webkit.org/show_bug.cgi?id=262226
rdar://116146895

Reviewed by Dan Glastonbury.

There are no users of releaseConstNonNull anymore. We can use Ref's
templated move constructor to move from releaseNonNull's Ref<T> to a
Ref<const T> which is the current pattern used by clients.

Adds a test to verify Ref<const T> can be constructed from
RefPtr<T>::releaseNonNull.

* Source/WTF/wtf/RefPtr.h:
(WTF::RefPtr::releaseNonNull):
(WTF::RefPtr::releaseConstNonNull): Deleted.
* Tools/TestWebKitAPI/Tests/WTF/RefLogger.cpp:
(TestWebKitAPI::RefLogger::ref const):
(TestWebKitAPI::RefLogger::deref const):
(TestWebKitAPI::RefLogger::ref): Deleted.
(TestWebKitAPI::RefLogger::deref): Deleted.
* Tools/TestWebKitAPI/Tests/WTF/RefLogger.h:
* Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp:
(TestWebKitAPI::TEST):

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




More information about the webkit-changes mailing list