Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8b7d41505065a3dacb612e0dc4112df118590c05
      
https://github.com/WebKit/WebKit/commit/8b7d41505065a3dacb612e0dc4112df118590c05
  Author: Geoffrey Garen <[email protected]>
  Date:   2024-04-03 (Wed, 03 Apr 2024)

  Changed paths:
    M Source/WTF/wtf/CheckedRef.h
    M Source/WebCore/Modules/speech/SpeechRecognitionCaptureSourceImpl.h
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/animation/DocumentTimelinesController.h
    M Source/WebCore/bindings/js/ScriptController.h
    M Source/WebCore/dom/CustomElementDefaultARIA.h
    M Source/WebCore/dom/CustomElementReactionQueue.h
    M Source/WebCore/dom/DocumentMarkerController.h
    M Source/WebCore/dom/EventLoop.h
    M Source/WebCore/dom/ExtensionStyleSheets.h
    M Source/WebCore/dom/FullscreenManager.h
    M Source/WebCore/dom/IdTargetObserver.h
    M Source/WebCore/dom/IdTargetObserverRegistry.h
    M Source/WebCore/dom/PendingScriptClient.h
    M Source/WebCore/dom/RejectedPromiseTracker.h
    M Source/WebCore/dom/ScriptRunner.h
    M Source/WebCore/dom/VisitedLinkState.h
    M Source/WebCore/dom/messageports/MessagePortChannelRegistry.h
    M Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.h
    M Source/WebCore/editing/Editor.h
    M Source/WebCore/editing/FrameSelection.h
    M Source/WebCore/editing/TextManipulationController.h
    M Source/WebCore/history/BackForwardController.h
    M Source/WebCore/history/CachedPage.h
    M Source/WebCore/html/parser/HTMLDocumentParser.h
    M Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h
    M Source/WebCore/layout/layouttree/LayoutBox.h
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/FrameLoader.h
    M Source/WebCore/loader/HistoryController.h
    M Source/WebCore/loader/NavigationScheduler.h
    M Source/WebCore/loader/ProgressTracker.h
    M Source/WebCore/loader/ThreadableLoaderClient.h
    M Source/WebCore/page/AlternativeTextClient.h
    M Source/WebCore/page/DeviceController.h
    M Source/WebCore/page/DiagnosticLoggingClient.h
    M Source/WebCore/page/EditorClient.h
    M Source/WebCore/page/ElementTargetingController.h
    M Source/WebCore/page/EventHandler.h
    M Source/WebCore/page/FocusController.h
    M Source/WebCore/page/LocalFrameViewLayoutContext.h
    M Source/WebCore/page/PageConsoleClient.h
    M Source/WebCore/page/csp/ContentSecurityPolicy.h
    M Source/WebCore/page/scrolling/ScrollingStateTree.h
    M Source/WebCore/platform/KeyboardScrollingAnimator.h
    M Source/WebCore/platform/OrientationNotifier.h
    M Source/WebCore/platform/ScrollView.h
    M Source/WebCore/platform/ScrollableArea.cpp
    M Source/WebCore/platform/ScrollableArea.h
    M Source/WebCore/platform/cocoa/PlaybackSessionModel.h
    M Source/WebCore/platform/cocoa/VideoPresentationModel.h
    M Source/WebCore/platform/cocoa/WebAVPlayerLayer.mm
    M Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/platform/graphics/GlyphBuffer.h
    M Source/WebCore/platform/graphics/TextRun.cpp
    M Source/WebCore/platform/graphics/TextRun.h
    M Source/WebCore/platform/graphics/TiledBacking.h
    M Source/WebCore/platform/graphics/WidthIterator.cpp
    M Source/WebCore/platform/graphics/ca/LayerPool.h
    M Source/WebCore/platform/graphics/cocoa/NullPlaybackSessionInterface.h
    M Source/WebCore/platform/graphics/cocoa/NullVideoPresentationInterface.h
    M Source/WebCore/platform/ios/PlaybackSessionInterfaceIOS.h
    M Source/WebCore/platform/ios/PlaybackSessionInterfaceIOS.mm
    M Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h
    M Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
    M Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h
    M Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm
    M Source/WebCore/platform/mac/VideoPresentationInterfaceMac.h
    M Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h
    M Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h
    M Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.h
    M Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.h
    M Source/WebCore/platform/mediastream/RealtimeMediaSource.h
    M 
Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp
    M 
Source/WebCore/platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.h
    M Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h
    M Source/WebCore/platform/network/curl/CurlMultipartHandleClient.h
    M Source/WebCore/platform/network/curl/CurlRequest.h
    M Source/WebCore/platform/sql/SQLiteDatabase.h
    M Source/WebCore/rendering/LegacyRootInlineBox.cpp
    M Source/WebCore/rendering/LegacyRootInlineBox.h
    M Source/WebCore/rendering/MarkedText.h
    M Source/WebCore/rendering/RegionContext.h
    M Source/WebCore/rendering/RenderImageResource.h
    M Source/WebCore/rendering/RenderLayer.h
    M Source/WebCore/rendering/RenderObject.cpp
    M Source/WebCore/rendering/RenderObject.h
    M Source/WebCore/style/StyleScope.h
    M Source/WebCore/style/StyleUpdate.h
    M Source/WebCore/svg/SVGDocumentExtensions.h
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/workers/WorkerOrWorkletScriptController.h
    M Source/WebCore/workers/service/server/SWServer.h
    M Source/WebCore/workers/service/server/SWServerJobQueue.h
    M Source/WebCore/workers/service/server/SWServerToContextConnection.h
    M Source/WebCore/xml/parser/XMLDocumentParser.h
    M Source/WebKit/NetworkProcess/Downloads/DownloadManager.h
    M Source/WebKit/NetworkProcess/NetworkProcess.h
    M Source/WebKit/NetworkProcess/NetworkSession.h
    M 
Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h
    M Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h
    M Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h
    M Source/WebKit/Shared/WTFArgumentCoders.serialization.in
    M Source/WebKit/Shared/WebPreferencesStore.h
    M Source/WebKit/Shared/WebPreferencesStore.serialization.in
    M Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
    M Source/WebKit/UIProcess/Cocoa/ExtensionCapabilityGranter.h
    M Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp
    M Source/WebKit/UIProcess/DisplayLink.h
    M Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h
    M Source/WebKit/UIProcess/ProcessThrottler.cpp
    M Source/WebKit/UIProcess/SuspendedPageProxy.h
    M Source/WebKit/UIProcess/WebBackForwardCache.h
    M Source/WebKit/UIProcess/WebProcessCache.h
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/UIProcess/WebProcessPool.h
    M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.h
    M Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h
    M 
Source/WebKit/WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp
    M Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h
    M Source/WebKit/WebProcess/cocoa/VideoPresentationManager.h
    M Source/WebKitLegacy/Storage/StorageThread.h
    M Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.h
    M Tools/TestWebKitAPI/Tests/WTF/CheckedPtr.cpp
    M Tools/TestWebKitAPI/Tests/WTF/CheckedRef.cpp
    M Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/curl/CurlMultipartHandleTests.cpp

  Log Message:
  -----------
  CheckedPtr should require FastMalloc, Part 2
https://bugs.webkit.org/show_bug.cgi?id=271993
rdar://125737157

Reviewed by Ryosuke Niwa.

This will enable zombie-mode CheckedPtr.

It's also just good performance hygiene.

The two major changes in this patch are:

(1) Declare your type when you inherit from CanMakeCheckedPtr, like we do for
RefCounted and CanMakeWeakPtr. We use this to do our FastMalloc static_assert.
(In future, I also plan to use this type to share our implementation with other
lifetime schemes.) Fixed any classes that violated the FastMalloc static_assert.

(2) Moved CanMakeCheckedPtr down from abstract base classes into concrete
subclasses. It's not possible for abstract base classes to require or
demonstrate that a class uses FastMalloc, or has any other concrete allocation
or destruction behavior. Abstract base classes that require a CheckedPtr
interface now make that part of their abstract API. (In future we need to do
this for CanMakeWeakPtr too. We've already done it for RefCounted.) It's a bit
more obvious now which classes have overlapping / wasteful lifetime
implementations. We can clean that up soon.

* Source/WTF/wtf/CheckedRef.h:

(WTF::CanMakeCheckedPtrBase::~CanMakeCheckedPtrBase): Moved the FastMalloc
assertion here because CheckedPtr needs to support abstract base classes that
don't know how they're allocated. This is logically clearer: CheckedPtr just
invokes your checking API and doesn't care how you check; only CanMakeCheckedPtr
will depend on FastMalloc.

* Source/WebCore/Modules/speech/SpeechRecognitionCaptureSourceImpl.h: (2)

* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/animation/DocumentTimelinesController.h:
* Source/WebCore/bindings/js/ScriptController.h:
* Source/WebCore/dom/CustomElementDefaultARIA.h:
* Source/WebCore/dom/CustomElementReactionQueue.h:
* Source/WebCore/dom/DocumentMarkerController.h:
* Source/WebCore/dom/EventLoop.h:
* Source/WebCore/dom/ExtensionStyleSheets.h:
* Source/WebCore/dom/FullscreenManager.h:
* Source/WebCore/dom/IdTargetObserver.h:
* Source/WebCore/dom/IdTargetObserverRegistry.h: (1)

* Source/WebCore/dom/PendingScriptClient.h: (2)
* Source/WebCore/dom/RejectedPromiseTracker.h: (1)
* Source/WebCore/dom/ScriptRunner.h: (2)

* Source/WebCore/dom/VisitedLinkState.h:
* Source/WebCore/dom/messageports/MessagePortChannelRegistry.h:
* Source/WebCore/dom/messageports/WorkerMessagePortChannelProvider.h:
* Source/WebCore/editing/Editor.h:
* Source/WebCore/editing/FrameSelection.h:
* Source/WebCore/editing/TextManipulationController.h:
* Source/WebCore/history/BackForwardController.h:
* Source/WebCore/history/CachedPage.h: (1)

* Source/WebCore/html/parser/HTMLDocumentParser.h: (2)

* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h:
* Source/WebCore/layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::incrementPtrCount const): Deleted.
(WebCore::Layout::Box::decrementPtrCount const): Deleted.
* Source/WebCore/loader/FrameLoader.cpp:
* Source/WebCore/loader/FrameLoader.h:
* Source/WebCore/loader/HistoryController.h:
* Source/WebCore/loader/NavigationScheduler.h:
* Source/WebCore/loader/ProgressTracker.h:
* Source/WebCore/loader/ThreadableLoaderClient.h:
* Source/WebCore/page/AlternativeTextClient.h:
* Source/WebCore/page/DeviceController.h:
* Source/WebCore/page/DiagnosticLoggingClient.h:
* Source/WebCore/page/EditorClient.h:
* Source/WebCore/page/ElementTargetingController.h:
* Source/WebCore/page/EventHandler.h:
* Source/WebCore/page/FocusController.h:
* Source/WebCore/page/LocalFrameViewLayoutContext.h:
* Source/WebCore/page/PageConsoleClient.h:
* Source/WebCore/page/csp/ContentSecurityPolicy.h:
* Source/WebCore/page/scrolling/ScrollingStateTree.h:
* Source/WebCore/platform/KeyboardScrollingAnimator.h:
* Source/WebCore/platform/OrientationNotifier.h:
* Source/WebCore/platform/ScrollView.h:
* Source/WebCore/platform/ScrollableArea.cpp:
* Source/WebCore/platform/ScrollableArea.h: (1)

* Source/WebCore/platform/cocoa/PlaybackSessionModel.h:
* Source/WebCore/platform/cocoa/VideoPresentationModel.h:
* Source/WebCore/platform/cocoa/WebAVPlayerLayer.mm: (2)

* Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h: (1)

* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::FontCascade):
(WebCore::GlyphToPathTranslator::containsMorePaths):
(WebCore::GlyphToPathTranslator::path):
(WebCore::GlyphToPathTranslator::extents):
(WebCore::GlyphToPathTranslator::advance):
* Source/WebCore/platform/graphics/FontCascade.h:
* Source/WebCore/platform/graphics/GlyphBuffer.h: Removed the recently added 
ability to
use CheckedPtr<GlyphBuffer>. GlyphBuffer is stack-allocated so it can't
participate in a zombie-mode lifetime scheme. We'll have to solve GlyphBuffer
another way later. (Chris said he's OK with this.)

* Source/WebCore/platform/graphics/TextRun.cpp:
* Source/WebCore/platform/graphics/TextRun.h:
* Source/WebCore/platform/graphics/TiledBacking.h: (1)

* Source/WebCore/platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::commitCurrentFontRange): See GlyphBuffer.h

* Source/WebCore/platform/graphics/ca/LayerPool.h: (1)
* Source/WebCore/platform/graphics/cocoa/NullPlaybackSessionInterface.h:
* Source/WebCore/platform/graphics/cocoa/NullVideoPresentationInterface.h:
* Source/WebCore/platform/ios/PlaybackSessionInterfaceIOS.h:
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h:
* Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h:
* Source/WebCore/platform/mac/VideoPresentationInterfaceMac.h:
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h:
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.h:
* Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.h:
* Source/WebCore/platform/mediastream/RealtimeMediaSource.h:
* 
Source/WebCore/platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.h:
* Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h: 
(2)

* Source/WebCore/platform/network/curl/CurlMultipartHandleClient.h:
* Source/WebCore/platform/sql/SQLiteDatabase.h:
* Source/WebCore/rendering/LegacyRootInlineBox.cpp:
* Source/WebCore/rendering/LegacyRootInlineBox.h:
* Source/WebCore/rendering/MarkedText.h:
* Source/WebCore/rendering/RegionContext.h:
* Source/WebCore/rendering/RenderImageResource.h:
* Source/WebCore/rendering/RenderLayer.h:
* Source/WebCore/rendering/RenderObject.cpp:
* Source/WebCore/rendering/RenderObject.h:
* Source/WebCore/style/StyleScope.h:
* Source/WebCore/style/StyleUpdate.h:
* Source/WebCore/svg/SVGDocumentExtensions.h: (1)

* Source/WebCore/testing/Internals.h: (2)
* Source/WebCore/workers/WorkerOrWorkletScriptController.h:
* Source/WebCore/workers/service/server/SWServer.h:
* Source/WebCore/workers/service/server/SWServerJobQueue.h:
* Source/WebCore/workers/service/server/SWServerToContextConnection.h: (1)

* Source/WebCore/xml/parser/XMLDocumentParser.h:
* Source/WebKit/NetworkProcess/Downloads/DownloadManager.h:
* Source/WebKit/NetworkProcess/NetworkProcess.h: (2)

* Source/WebKit/NetworkProcess/NetworkSession.h:
* Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h:
* Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h:
* Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:
* Source/WebKit/Shared/WTFArgumentCoders.serialization.in:
* Source/WebKit/Shared/WebPreferencesStore.h:
(WebKit::WebPreferencesStore::isolatedCopy const):
(WebKit::WebPreferencesStore::isolatedCopy):
* Source/WebKit/Shared/WebPreferencesStore.serialization.in:
* Source/WebKit/UIProcess/AuxiliaryProcessProxy.h:
* Source/WebKit/UIProcess/Cocoa/ExtensionCapabilityGranter.h: (1)

* Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (2)

* Source/WebKit/UIProcess/DisplayLink.h:
* Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h:
* Source/WebKit/UIProcess/ProcessThrottler.cpp:
* Source/WebKit/UIProcess/SuspendedPageProxy.h:
* Source/WebKit/UIProcess/WebBackForwardCache.h:
* Source/WebKit/UIProcess/WebProcessCache.h: (1)

* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishRemoteWorkerContextConnectionToNetworkProcess):
WebPreferencesStore& can't use zombie-mode CheckedPtr because it's an interior
object pointer. For now, we can accuratrely represent lifetime by explicitly
ref'ing its owner. Later, we should just change it to be refcounted.

* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* 
Source/WebKit/WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp:
* Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h:
* Source/WebKit/WebProcess/cocoa/VideoPresentationManager.h: (2)

* Source/WebKitLegacy/Storage/StorageThread.h:
* Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.h:
* Tools/TestWebKitAPI/Tests/WTF/CheckedPtr.cpp:
* Tools/TestWebKitAPI/Tests/WTF/CheckedRef.cpp:
* Tools/TestWebKitAPI/Tests/WTF/Hasher.cpp:
(TestWebKitAPI::TEST(WTF, Hasher_CheckedPtr)): (1)

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to