[webkit-changes] [WebKit/WebKit] 8f33f1: Use WTF::ThreadSafeRefCountedAndCanMakeThreadSafeW...

Commit Queue noreply at github.com
Fri Feb 10 05:26:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8f33f11f2a7f6cf72197a8651b6a9cf17136154c
      https://github.com/WebKit/WebKit/commit/8f33f11f2a7f6cf72197a8651b6a9cf17136154c
  Author: David Kilzer <ddkilzer at apple.com>
  Date:   2023-02-10 (Fri, 10 Feb 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/DecomposedGlyphs.h
    M Source/WebCore/platform/graphics/ImageSource.cpp
    M Source/WebCore/platform/graphics/ImageSource.h
    M Source/WebCore/platform/graphics/NativeImage.h
    M Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h
    M Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
    M Source/WebCore/platform/network/cocoa/RangeResponseGenerator.h
    M Source/WebCore/platform/network/cocoa/RangeResponseGenerator.mm
    M Source/WebCore/storage/StorageQuotaManager.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h

  Log Message:
  -----------
  Use WTF::ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<> more in WebCore
https://bugs.webkit.org/show_bug.cgi?id=250929
<rdar://problem/104436726>

Reviewed by Chris Dumez.

Classes that inherit from both WTF::ThreadSafeRefCounted<> and
WTF::CanMakeWeakPtr<> should use
WTF::ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<> instead.

Most of the changes below are:
- to replace WeakPtr<> with ThreadSafeWeakPtr<> in instance
  variables and data structures,
- to change raw pointers returned from WeakPtr<>.get() to
  RefPtr<> types, and
- to use a local RefPtr<> to an object instead of checking the
  pointer value in the ThreadSafeWeakPtr<> object directly.

Since a lock is taken each time the value stored in the
ThreadSafeWeakPtr<> is returned, there is an effort to minimize
the number of times that happens within a given method by
creating a local RefPtr<> variable on the stack.

* Source/WebCore/platform/graphics/DecomposedGlyphs.h:
* Source/WebCore/platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ensureDecoderAvailable):
* Source/WebCore/platform/graphics/ImageSource.h:
* Source/WebCore/platform/graphics/NativeImage.h:
* Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h:
* Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate fullscreenInterface]):
(-[WebAVPlayerViewControllerDelegate setFullscreenInterface:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStartPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStopPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStopPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate playerViewController:shouldExitFullScreenWithReason:]):
(-[WebAVPlayerViewControllerDelegate playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerWillStartPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerDidStartPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureController:failedToStartPictureInPictureWithError:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerWillStopPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureControllerDidStopPictureInPicture:]):
(-[WebAVPlayerViewControllerDelegate pictureInPictureController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]):
(-[WebAVPlayerViewController initWithFullscreenInterface:]):
(-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
- On watchOS, if _fullscreenInterface is nullptr, attempt to
  call completionHandler if set.  Previously this would crash.
(-[WebAVPlayerViewController MY_NO_RETURN]):
* Source/WebCore/platform/network/cocoa/RangeResponseGenerator.h:
* Source/WebCore/platform/network/cocoa/RangeResponseGenerator.mm:
(WebCore::RangeResponseGenerator::giveResponseToTaskIfBytesInRangeReceived):
* Source/WebCore/storage/StorageQuotaManager.h:

* Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:
(WebKit::RemoteResourceCacheProxy::clearNativeImageMap):
(WebKit::RemoteResourceCacheProxy::clearDecomposedGlyphsMap):
* Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.h:

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




More information about the webkit-changes mailing list