Title: [283237] trunk
Revision
283237
Author
[email protected]
Date
2021-09-29 11:19:46 -0700 (Wed, 29 Sep 2021)

Log Message

Build-time optimization: forward declare more things in MediaPlayer.h and HTMLMediaElement.h
https://bugs.webkit.org/show_bug.cgi?id=230853

Reviewed by Eric Carlson.

Source/WebCore:

Forward-declare more things in MediaPlayer.h, and break apart *TrackPrivateClient into its
own file, so that clients don't need to include the entire class's file. This requires
other classes who got those includes "for free" previously to explicitly include headers in
their source files.

Drive-by fixes: Fixed a number of places where '0' was being used for 'null'.

* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
* Modules/mediasource/MediaSource.cpp:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/mediasource/SourceBuffer.h:
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::initialize):
* WebCore.xcodeproj/project.pbxproj:
* animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilterOperations):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapeInset):
(WebCore::consumeBorderImageSlice):
(WebCore::consumeBorderImageOutset):
* dom/Element.cpp:
(WebCore::Element::getAttributeNodeNS):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::addConsoleMessage):
* dom/TextEvent.cpp:
(WebCore::TextEvent::createForPlainTextPaste):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::listifyParagraph):
* html/HTMLMediaElement.cpp:
* html/HTMLMediaElement.h:
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::AudioTrack):
(WebCore::AudioTrack::~AudioTrack):
(WebCore::AudioTrack::setPrivate):
* html/track/AudioTrack.h:
(WebCore::AudioTrackClient::audioTrackEnabledChanged): Deleted.
(WebCore::AudioTrackClient::audioTrackIdChanged): Deleted.
(WebCore::AudioTrackClient::audioTrackKindChanged): Deleted.
(WebCore::AudioTrackClient::audioTrackLabelChanged): Deleted.
(WebCore::AudioTrackClient::audioTrackLanguageChanged): Deleted.
(WebCore::AudioTrackClient::willRemoveAudioTrack): Deleted.
* html/track/AudioTrackClient.h:
(WebCore::AudioTrackClient::audioTrackEnabledChanged):
(WebCore::AudioTrackClient::audioTrackIdChanged):
(WebCore::AudioTrackClient::audioTrackKindChanged):
(WebCore::AudioTrackClient::audioTrackLabelChanged):
(WebCore::AudioTrackClient::audioTrackLanguageChanged):
(WebCore::AudioTrackClient::willRemoveAudioTrack):
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::InbandTextTrack):
(WebCore::InbandTextTrack::~InbandTextTrack):
(WebCore::InbandTextTrack::setPrivate):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::VideoTrack):
(WebCore::VideoTrack::~VideoTrack):
(WebCore::VideoTrack::setPrivate):
* html/track/VideoTrack.h:
(WebCore::VideoTrackClient::videoTrackIdChanged): Deleted.
(WebCore::VideoTrackClient::videoTrackKindChanged): Deleted.
(WebCore::VideoTrackClient::videoTrackLabelChanged): Deleted.
(WebCore::VideoTrackClient::videoTrackLanguageChanged): Deleted.
(WebCore::VideoTrackClient::videoTrackSelectedChanged): Deleted.
(WebCore::VideoTrackClient::willRemoveVideoTrack): Deleted.
* html/track/VideoTrack.idl:
* html/track/VideoTrackClient.h:
(WebCore::VideoTrackClient::videoTrackIdChanged):
(WebCore::VideoTrackClient::videoTrackKindChanged):
(WebCore::VideoTrackClient::videoTrackLabelChanged):
(WebCore::VideoTrackClient::videoTrackLanguageChanged):
(WebCore::VideoTrackClient::videoTrackSelectedChanged):
(WebCore::VideoTrackClient::willRemoveVideoTrack):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::addMessage):
* platform/graphics/AudioTrackPrivate.h:
(WebCore::AudioTrackPrivate::setClient):
(WebCore::AudioTrackPrivate::clearClient):
* platform/graphics/AudioTrackPrivateClient.h:
* platform/graphics/InbandTextTrackPrivate.h:
(WebCore::InbandTextTrackPrivate::setClient):
(WebCore::InbandTextTrackPrivate::clearClient):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::MediaPlayer):
* platform/graphics/MediaPlayer.h:
* platform/graphics/SourceBufferPrivate.cpp:
* platform/graphics/TrackPrivateBase.h:
* platform/graphics/TrackPrivateBaseClient.h:
* platform/graphics/VideoTrackPrivate.h:
(WebCore::VideoTrackPrivate::setClient):
(WebCore::VideoTrackPrivate::clearClient):
* platform/graphics/VideoTrackPrivateClient.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
* platform/mock/mediasource/MockMediaSourcePrivate.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::RenderSearchField):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::setFontFromControlSize const):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLParserContext::createMemoryParser):

Source/WebKit:

Use new WeakPtr based client setters on TrackPrivates.

* GPUProcess/media/RemoteAudioTrackProxy.cpp:
(WebKit::RemoteAudioTrackProxy::RemoteAudioTrackProxy):
(WebKit::RemoteAudioTrackProxy::~RemoteAudioTrackProxy):
* GPUProcess/media/RemoteTextTrackProxy.cpp:
(WebKit::RemoteTextTrackProxy::RemoteTextTrackProxy):
(WebKit::RemoteTextTrackProxy::~RemoteTextTrackProxy):
* GPUProcess/media/RemoteVideoTrackProxy.cpp:
(WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy):
(WebKit::RemoteVideoTrackProxy::~RemoteVideoTrackProxy):

Source/WebKitLegacy:

Use nullptr rather than zero for null values.

* Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::StorageNamespaceImpl):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (283236 => 283237)


--- trunk/Source/WebCore/ChangeLog	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/ChangeLog	2021-09-29 18:19:46 UTC (rev 283237)
@@ -1,3 +1,113 @@
+2021-09-29  Jer Noble  <[email protected]>
+
+        Build-time optimization: forward declare more things in MediaPlayer.h and HTMLMediaElement.h
+        https://bugs.webkit.org/show_bug.cgi?id=230853
+
+        Reviewed by Eric Carlson.
+
+        Forward-declare more things in MediaPlayer.h, and break apart *TrackPrivateClient into its
+        own file, so that clients don't need to include the entire class's file. This requires
+        other classes who got those includes "for free" previously to explicitly include headers in
+        their source files.
+
+        Drive-by fixes: Fixed a number of places where '0' was being used for 'null'.
+
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
+        * Modules/mediasource/MediaSource.cpp:
+        * Modules/mediasource/SourceBuffer.cpp:
+        * Modules/mediasource/SourceBuffer.h:
+        * Modules/webaudio/ScriptProcessorNode.cpp:
+        (WebCore::ScriptProcessorNode::initialize):
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::blendFilterOperations):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeBasicShapeInset):
+        (WebCore::consumeBorderImageSlice):
+        (WebCore::consumeBorderImageOutset):
+        * dom/Element.cpp:
+        (WebCore::Element::getAttributeNodeNS):
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::addConsoleMessage):
+        * dom/TextEvent.cpp:
+        (WebCore::TextEvent::createForPlainTextPaste):
+        * editing/InsertListCommand.cpp:
+        (WebCore::InsertListCommand::listifyParagraph):
+        * html/HTMLMediaElement.cpp:
+        * html/HTMLMediaElement.h:
+        * html/track/AudioTrack.cpp:
+        (WebCore::AudioTrack::AudioTrack):
+        (WebCore::AudioTrack::~AudioTrack):
+        (WebCore::AudioTrack::setPrivate):
+        * html/track/AudioTrack.h:
+        (WebCore::AudioTrackClient::audioTrackEnabledChanged): Deleted.
+        (WebCore::AudioTrackClient::audioTrackIdChanged): Deleted.
+        (WebCore::AudioTrackClient::audioTrackKindChanged): Deleted.
+        (WebCore::AudioTrackClient::audioTrackLabelChanged): Deleted.
+        (WebCore::AudioTrackClient::audioTrackLanguageChanged): Deleted.
+        (WebCore::AudioTrackClient::willRemoveAudioTrack): Deleted.
+        * html/track/AudioTrackClient.h:
+        (WebCore::AudioTrackClient::audioTrackEnabledChanged):
+        (WebCore::AudioTrackClient::audioTrackIdChanged):
+        (WebCore::AudioTrackClient::audioTrackKindChanged):
+        (WebCore::AudioTrackClient::audioTrackLabelChanged):
+        (WebCore::AudioTrackClient::audioTrackLanguageChanged):
+        (WebCore::AudioTrackClient::willRemoveAudioTrack):
+        * html/track/InbandTextTrack.cpp:
+        (WebCore::InbandTextTrack::InbandTextTrack):
+        (WebCore::InbandTextTrack::~InbandTextTrack):
+        (WebCore::InbandTextTrack::setPrivate):
+        * html/track/VideoTrack.cpp:
+        (WebCore::VideoTrack::VideoTrack):
+        (WebCore::VideoTrack::~VideoTrack):
+        (WebCore::VideoTrack::setPrivate):
+        * html/track/VideoTrack.h:
+        (WebCore::VideoTrackClient::videoTrackIdChanged): Deleted.
+        (WebCore::VideoTrackClient::videoTrackKindChanged): Deleted.
+        (WebCore::VideoTrackClient::videoTrackLabelChanged): Deleted.
+        (WebCore::VideoTrackClient::videoTrackLanguageChanged): Deleted.
+        (WebCore::VideoTrackClient::videoTrackSelectedChanged): Deleted.
+        (WebCore::VideoTrackClient::willRemoveVideoTrack): Deleted.
+        * html/track/VideoTrack.idl:
+        * html/track/VideoTrackClient.h:
+        (WebCore::VideoTrackClient::videoTrackIdChanged):
+        (WebCore::VideoTrackClient::videoTrackKindChanged):
+        (WebCore::VideoTrackClient::videoTrackLabelChanged):
+        (WebCore::VideoTrackClient::videoTrackLanguageChanged):
+        (WebCore::VideoTrackClient::videoTrackSelectedChanged):
+        (WebCore::VideoTrackClient::willRemoveVideoTrack):
+        * page/PageConsoleClient.cpp:
+        (WebCore::PageConsoleClient::addMessage):
+        * platform/graphics/AudioTrackPrivate.h:
+        (WebCore::AudioTrackPrivate::setClient):
+        (WebCore::AudioTrackPrivate::clearClient):
+        * platform/graphics/AudioTrackPrivateClient.h:
+        * platform/graphics/InbandTextTrackPrivate.h:
+        (WebCore::InbandTextTrackPrivate::setClient):
+        (WebCore::InbandTextTrackPrivate::clearClient):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::MediaPlayer):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/SourceBufferPrivate.cpp:
+        * platform/graphics/TrackPrivateBase.h:
+        * platform/graphics/TrackPrivateBaseClient.h:
+        * platform/graphics/VideoTrackPrivate.h:
+        (WebCore::VideoTrackPrivate::setClient):
+        (WebCore::VideoTrackPrivate::clearClient):
+        * platform/graphics/VideoTrackPrivateClient.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
+        * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
+        * platform/mock/mediasource/MockMediaSourcePrivate.h:
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
+        * rendering/RenderSearchField.cpp:
+        (WebCore::RenderSearchField::RenderSearchField):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::setFontFromControlSize const):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLParserContext::createMemoryParser):
+
 2021-09-29  Alan Bujtas  <[email protected]>
 
         [LFC][IFC] Layout::Box should be able to return the first-line style when applicable

Modified: trunk/Source/WebCore/Headers.cmake (283236 => 283237)


--- trunk/Source/WebCore/Headers.cmake	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/Headers.cmake	2021-09-29 18:19:46 UTC (rev 283237)
@@ -761,11 +761,14 @@
     html/parser/HTMLParserScriptingFlagPolicy.h
 
     html/track/AudioTrack.h
+    html/track/AudioTrackClient.h
     html/track/TextTrack.h
+    html/track/TextTrackClient.h
     html/track/TextTrackCue.h
     html/track/TrackBase.h
     html/track/VTTCue.h
     html/track/VideoTrack.h
+    html/track/VideoTrackClient.h
 
     inspector/InspectorClient.h
     inspector/InspectorController.h
@@ -1220,6 +1223,7 @@
     platform/graphics/ANGLEWebKitBridge.h
     platform/graphics/AnimationFrameRate.h
     platform/graphics/AudioTrackPrivate.h
+    platform/graphics/AudioTrackPrivateClient.h
     platform/graphics/BifurcatedGraphicsContext.h
     platform/graphics/BitmapImage.h
     platform/graphics/Color.h
@@ -1363,11 +1367,13 @@
     platform/graphics/TextTrackRepresentation.h
     platform/graphics/TiledBacking.h
     platform/graphics/TrackPrivateBase.h
+    platform/graphics/TrackPrivateBaseClient.h
     platform/graphics/VP9Utilities.h
     platform/graphics/VelocityData.h
     platform/graphics/VideoLayerManager.h
     platform/graphics/VideoPlaybackQualityMetrics.h
     platform/graphics/VideoTrackPrivate.h
+    platform/graphics/VideoTrackPrivateClient.h
     platform/graphics/WidthCache.h
     platform/graphics/WindRule.h
 

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp (283236 => 283237)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -32,6 +32,7 @@
 #include "LegacyCDMSessionClearKey.h"
 #include "ContentType.h"
 #include "MediaPlayer.h"
+#include "PlatformMediaResourceLoader.h"
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (283236 => 283237)


--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -50,6 +50,7 @@
 #include "SourceBufferPrivate.h"
 #include "TextTrackList.h"
 #include "TimeRanges.h"
+#include "VideoTrack.h"
 #include "VideoTrackList.h"
 #include <wtf/IsoMallocInlines.h>
 

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (283236 => 283237)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -34,7 +34,9 @@
 
 #if ENABLE(MEDIA_SOURCE)
 
+#include "AudioTrack.h"
 #include "AudioTrackList.h"
+#include "AudioTrackPrivate.h"
 #include "BufferSource.h"
 #include "Event.h"
 #include "EventNames.h"
@@ -49,7 +51,9 @@
 #include "SourceBufferPrivate.h"
 #include "TextTrackList.h"
 #include "TimeRanges.h"
+#include "VideoTrack.h"
 #include "VideoTrackList.h"
+#include "VideoTrackPrivate.h"
 #include <_javascript_Core/JSCInlines.h>
 #include <_javascript_Core/JSLock.h>
 #include <_javascript_Core/VM.h>

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (283236 => 283237)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -34,14 +34,14 @@
 #if ENABLE(MEDIA_SOURCE)
 
 #include "ActiveDOMObject.h"
-#include "AudioTrack.h"
+#include "AudioTrackClient.h"
 #include "EventTarget.h"
 #include "ExceptionOr.h"
 #include "SourceBufferPrivate.h"
 #include "SourceBufferPrivateClient.h"
-#include "TextTrack.h"
+#include "TextTrackClient.h"
 #include "Timer.h"
-#include "VideoTrack.h"
+#include "VideoTrackClient.h"
 #include <wtf/LoggerHelper.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp (283236 => 283237)


--- trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -89,8 +89,8 @@
     // These AudioBuffers will be directly accessed in the main thread by _javascript_.
     for (unsigned i = 0; i < bufferCount; ++i) {
         // We prevent detaching the AudioBuffers here since we pass those to JS and reuse them.
-        m_inputBuffers[i] = m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, bufferSize(), sampleRate, AudioBuffer::LegacyPreventDetaching::Yes) : 0;
-        m_outputBuffers[i] = m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, bufferSize(), sampleRate, AudioBuffer::LegacyPreventDetaching::Yes) : 0;
+        m_inputBuffers[i] = m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, bufferSize(), sampleRate, AudioBuffer::LegacyPreventDetaching::Yes) : nullptr;
+        m_outputBuffers[i] = m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, bufferSize(), sampleRate, AudioBuffer::LegacyPreventDetaching::Yes) : nullptr;
     }
 
     AudioNode::initialize();

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (283236 => 283237)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-09-29 18:19:46 UTC (rev 283237)
@@ -4374,6 +4374,12 @@
 		CD19A2681A13E700008D650E /* DiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD19A2671A13E700008D650E /* DiagnosticLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD19FEA81F573972000C42FB /* ImageDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = CD19FEA61F573972000C42FB /* ImageDecoder.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD19FEAE1F574B6D000C42FB /* ImageDecoderAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD19FEAC1F574B6D000C42FB /* ImageDecoderAVFObjC.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CD1F9B14270235F700617EB6 /* VideoTrackPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD1F9B12270235F700617EB6 /* VideoTrackPrivateClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CD1F9B162702360F00617EB6 /* AudioTrackPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD1F9B152702360E00617EB6 /* AudioTrackPrivateClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CD1F9B1827023A2A00617EB6 /* VideoTrackClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD1F9B1727023A2900617EB6 /* VideoTrackClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CD1F9B1A27023A7600617EB6 /* AudioTrackClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD1F9B1927023A7600617EB6 /* AudioTrackClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CD1F9B1C27024BC200617EB6 /* TrackPrivateBaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD1F9B1B27024BC100617EB6 /* TrackPrivateBaseClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		CD1F9B212702565E00617EB6 /* TextTrackClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD1F9B202702565E00617EB6 /* TextTrackClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD225C091C46FBF400140761 /* WebCoreNSURLSession.mm */; };
 		CD225C0C1C46FBF400140761 /* WebCoreNSURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = CD225C0A1C46FBF400140761 /* WebCoreNSURLSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD27AE5022A9868700947FF9 /* ImageRotationSessionVT.h in Headers */ = {isa = PBXBuildFile; fileRef = CD27AE4E22A9868700947FF9 /* ImageRotationSessionVT.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -14972,6 +14978,12 @@
 		CD19FEAC1F574B6D000C42FB /* ImageDecoderAVFObjC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImageDecoderAVFObjC.h; sourceTree = "<group>"; };
 		CD19FEAD1F574B6D000C42FB /* ImageDecoderAVFObjC.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ImageDecoderAVFObjC.mm; sourceTree = "<group>"; };
 		CD1E7346167BC78E009A885D /* TextTrackRepresentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackRepresentation.cpp; sourceTree = "<group>"; };
+		CD1F9B12270235F700617EB6 /* VideoTrackPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackPrivateClient.h; sourceTree = "<group>"; };
+		CD1F9B152702360E00617EB6 /* AudioTrackPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioTrackPrivateClient.h; sourceTree = "<group>"; };
+		CD1F9B1727023A2900617EB6 /* VideoTrackClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackClient.h; sourceTree = "<group>"; };
+		CD1F9B1927023A7600617EB6 /* AudioTrackClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioTrackClient.h; sourceTree = "<group>"; };
+		CD1F9B1B27024BC100617EB6 /* TrackPrivateBaseClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPrivateBaseClient.h; sourceTree = "<group>"; };
+		CD1F9B202702565E00617EB6 /* TextTrackClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextTrackClient.h; sourceTree = "<group>"; };
 		CD225C091C46FBF400140761 /* WebCoreNSURLSession.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSURLSession.mm; sourceTree = "<group>"; };
 		CD225C0A1C46FBF400140761 /* WebCoreNSURLSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreNSURLSession.h; sourceTree = "<group>"; };
 		CD27AE4E22A9868700947FF9 /* ImageRotationSessionVT.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImageRotationSessionVT.h; sourceTree = "<group>"; };
@@ -26280,6 +26292,7 @@
 				BE88E0CC1715D2A200658D98 /* AudioTrack.cpp */,
 				BE88E0CD1715D2A200658D98 /* AudioTrack.h */,
 				BE88E0CE1715D2A200658D98 /* AudioTrack.idl */,
+				CD1F9B1927023A7600617EB6 /* AudioTrackClient.h */,
 				BE88E0CF1715D2A200658D98 /* AudioTrackList.cpp */,
 				BE88E0D01715D2A200658D98 /* AudioTrackList.h */,
 				BE88E0D11715D2A200658D98 /* AudioTrackList.idl */,
@@ -26301,6 +26314,7 @@
 				9759E93514EF1CF80026A2DD /* TextTrack.cpp */,
 				9759E93614EF1CF80026A2DD /* TextTrack.h */,
 				9759E93714EF1CF80026A2DD /* TextTrack.idl */,
+				CD1F9B202702565E00617EB6 /* TextTrackClient.h */,
 				9759E93814EF1CF80026A2DD /* TextTrackCue.cpp */,
 				9759E93914EF1CF80026A2DD /* TextTrackCue.h */,
 				9759E93A14EF1CF80026A2DD /* TextTrackCue.idl */,
@@ -26323,6 +26337,7 @@
 				BE88E0D21715D2A200658D98 /* VideoTrack.cpp */,
 				BE88E0D31715D2A200658D98 /* VideoTrack.h */,
 				BE88E0D41715D2A200658D98 /* VideoTrack.idl */,
+				CD1F9B1727023A2900617EB6 /* VideoTrackClient.h */,
 				BE88E0D51715D2A200658D98 /* VideoTrackList.cpp */,
 				BE88E0D61715D2A200658D98 /* VideoTrackList.h */,
 				BE88E0D71715D2A200658D98 /* VideoTrackList.idl */,
@@ -26921,6 +26936,7 @@
 				0F7E475125EEB79A0013F909 /* AnimationFrameRate.cpp */,
 				722A815C238FD50500C00583 /* AnimationFrameRate.h */,
 				BEF29EE91715DD0900C4B4C9 /* AudioTrackPrivate.h */,
+				CD1F9B152702360E00617EB6 /* AudioTrackPrivateClient.h */,
 				2DD87147265F4364005F997C /* BifurcatedGraphicsContext.cpp */,
 				2DD87149265F4365005F997C /* BifurcatedGraphicsContext.h */,
 				A89943270B42338700D7C802 /* BitmapImage.cpp */,
@@ -27170,6 +27186,7 @@
 				1AF89A411518FDEA00E547B5 /* TiledBacking.h */,
 				076E11BE1F683E0D00177395 /* TrackPrivateBase.cpp */,
 				BE913D7F181EF8E500DCB09E /* TrackPrivateBase.h */,
+				CD1F9B1B27024BC100617EB6 /* TrackPrivateBaseClient.h */,
 				E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */,
 				0F5A57CA229B18AE0025EDA9 /* VelocityData.cpp */,
 				0F1A0C36229A481800D37ADB /* VelocityData.h */,
@@ -27176,6 +27193,7 @@
 				1DAB3113251D725C00FC9485 /* VideoLayerManager.h */,
 				075033A6252BD36800F70CE3 /* VideoPlaybackQualityMetrics.h */,
 				BEF29EEA1715DD0900C4B4C9 /* VideoTrackPrivate.h */,
+				CD1F9B12270235F700617EB6 /* VideoTrackPrivateClient.h */,
 				CD6FE5BB24BCE7B6009FCDA4 /* VP9Utilities.cpp */,
 				CD6FE5BA24BCE7B6009FCDA4 /* VP9Utilities.h */,
 				1411DCB0164C39A800D49BC1 /* WidthCache.h */,
@@ -31511,11 +31529,13 @@
 				FDB052E01561A42C00B500D6 /* AudioSummingJunction.h in Headers */,
 				83005F9D24EB1D4000480F9B /* AudioTimestamp.h in Headers */,
 				BE88E0D91715D2A200658D98 /* AudioTrack.h in Headers */,
+				CD1F9B1A27023A7600617EB6 /* AudioTrackClient.h in Headers */,
 				BE88E0DC1715D2A200658D98 /* AudioTrackList.h in Headers */,
 				CD8B5A4C180E17C0008B8E65 /* AudioTrackMediaSource.h in Headers */,
 				BEF29EEB1715DD0900C4B4C9 /* AudioTrackPrivate.h in Headers */,
 				CDE3A85417F5FCE600C5BE20 /* AudioTrackPrivateAVF.h in Headers */,
 				CDE3A85817F6020400C5BE20 /* AudioTrackPrivateAVFObjC.h in Headers */,
+				CD1F9B162702360F00617EB6 /* AudioTrackPrivateClient.h in Headers */,
 				CD54A763180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h in Headers */,
 				07D6A4F81BF2307D00174146 /* AudioTrackPrivateMediaStream.h in Headers */,
 				FD31608B12B026F700C1A359 /* AudioUtilities.h in Headers */,
@@ -35555,6 +35575,7 @@
 				A824B4650E2EF2EA0081A7B7 /* TextRun.h in Headers */,
 				448B1B7A0F3A2F9B0047A9E2 /* TextSizeAdjustment.h in Headers */,
 				9759E94014EF1CF80026A2DD /* TextTrack.h in Headers */,
+				CD1F9B212702565E00617EB6 /* TextTrackClient.h in Headers */,
 				9759E94314EF1CF80026A2DD /* TextTrackCue.h in Headers */,
 				071A9EC3168FBC55002629F9 /* TextTrackCueGeneric.h in Headers */,
 				9759E94614EF1CF80026A2DD /* TextTrackCueList.h in Headers */,
@@ -35600,6 +35621,7 @@
 				070334D71459FFD5008D8D45 /* TrackBase.h in Headers */,
 				BE88E0C21715CE2600658D98 /* TrackListBase.h in Headers */,
 				BE913D80181EF92400DCB09E /* TrackPrivateBase.h in Headers */,
+				CD1F9B1C27024BC200617EB6 /* TrackPrivateBaseClient.h in Headers */,
 				FFAC30FE184FB145008C4F1E /* TrailingObjects.h in Headers */,
 				516071321BD8308B00DBC4F2 /* TransactionOperation.h in Headers */,
 				CD3EEF4125799FD9006563BB /* TransferFunction.h in Headers */,
@@ -35693,11 +35715,13 @@
 				0757B13E214AE79900794B0D /* VideoPreset.h in Headers */,
 				CDC939A81E9BDFB100BB768D /* VideoToolboxSoftLink.h in Headers */,
 				BE88E0DF1715D2A200658D98 /* VideoTrack.h in Headers */,
+				CD1F9B1827023A2A00617EB6 /* VideoTrackClient.h in Headers */,
 				BE88E0E21715D2A200658D98 /* VideoTrackList.h in Headers */,
 				CD8B5A46180DFF4E008B8E65 /* VideoTrackMediaSource.h in Headers */,
 				BEF29EEC1715DD0900C4B4C9 /* VideoTrackPrivate.h in Headers */,
 				CD336F6417FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h in Headers */,
 				CD336F6817FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h in Headers */,
+				CD1F9B14270235F700617EB6 /* VideoTrackPrivateClient.h in Headers */,
 				CD8B5A43180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h in Headers */,
 				070E81D11BF27656001FDA48 /* VideoTrackPrivateMediaStream.h in Headers */,
 				CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */,

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (283236 => 283237)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -315,9 +315,9 @@
     size_t toSize = to.operations().size();
     size_t size = std::max(fromSize, toSize);
     for (size_t i = 0; i < size; i++) {
-        RefPtr<FilterOperation> fromOp = (i < fromSize) ? from.operations()[i].get() : 0;
-        RefPtr<FilterOperation> toOp = (i < toSize) ? to.operations()[i].get() : 0;
-        RefPtr<FilterOperation> blendedOp = toOp ? blendFunc(fromOp.get(), toOp.get(), context) : (fromOp ? blendFunc(0, fromOp.get(), context, true) : 0);
+        RefPtr<FilterOperation> fromOp = (i < fromSize) ? from.operations()[i].get() : nullptr;
+        RefPtr<FilterOperation> toOp = (i < toSize) ? to.operations()[i].get() : nullptr;
+        RefPtr<FilterOperation> blendedOp = toOp ? blendFunc(fromOp.get(), toOp.get(), context) : (fromOp ? blendFunc(0, fromOp.get(), context, true) : nullptr);
         if (blendedOp)
             result.operations().append(blendedOp);
         else {

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (283236 => 283237)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -2671,8 +2671,8 @@
         shape->updateShapeSize1Value(top.releaseNonNull());
 
     if (consumeIdent<CSSValueRound>(args)) {
-        RefPtr<CSSPrimitiveValue> horizontalRadii[4] = { 0 };
-        RefPtr<CSSPrimitiveValue> verticalRadii[4] = { 0 };
+        RefPtr<CSSPrimitiveValue> horizontalRadii[4] = { nullptr };
+        RefPtr<CSSPrimitiveValue> verticalRadii[4] = { nullptr };
         if (!consumeRadii(horizontalRadii, verticalRadii, args, context.mode, false))
             return nullptr;
         shape->setTopLeftRadius(createPrimitiveValuePair(horizontalRadii[0].releaseNonNull(), verticalRadii[0].releaseNonNull(), Pair::IdenticalValueEncoding::Coalesce));
@@ -2881,7 +2881,7 @@
 static RefPtr<CSSValue> consumeBorderImageSlice(CSSPropertyID property, CSSParserTokenRange& range)
 {
     bool fill = consumeIdent<CSSValueFill>(range);
-    RefPtr<CSSPrimitiveValue> slices[4] = { 0 };
+    RefPtr<CSSPrimitiveValue> slices[4] = { nullptr };
 
     for (size_t index = 0; index < 4; ++index) {
         RefPtr<CSSPrimitiveValue> value = consumePercent(range, ValueRange::NonNegative);
@@ -2918,7 +2918,7 @@
 
 static RefPtr<CSSValue> consumeBorderImageOutset(CSSParserTokenRange& range)
 {
-    RefPtr<CSSPrimitiveValue> outsets[4] = { 0 };
+    RefPtr<CSSPrimitiveValue> outsets[4] = { nullptr };
 
     RefPtr<CSSPrimitiveValue> value;
     for (size_t index = 0; index < 4; ++index) {

Modified: trunk/Source/WebCore/dom/Element.cpp (283236 => 283237)


--- trunk/Source/WebCore/dom/Element.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/dom/Element.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -2995,12 +2995,12 @@
 RefPtr<Attr> Element::getAttributeNodeNS(const AtomString& namespaceURI, const AtomString& localName)
 {
     if (!elementData())
-        return 0;
+        return nullptr;
     QualifiedName qName(nullAtom(), localName, namespaceURI);
     synchronizeAttribute(qName);
     const Attribute* attribute = elementData()->findAttributeByName(qName);
     if (!attribute)
-        return 0;
+        return nullptr;
     return ensureAttr(attribute->name());
 }
 

Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (283236 => 283237)


--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -450,7 +450,7 @@
 
 void ScriptExecutionContext::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, JSC::JSGlobalObject* state, unsigned long requestIdentifier)
 {
-    addMessage(source, level, message, sourceURL, lineNumber, columnNumber, 0, state, requestIdentifier);
+    addMessage(source, level, message, sourceURL, lineNumber, columnNumber, nullptr, state, requestIdentifier);
 }
 
 bool ScriptExecutionContext::dispatchErrorEvent(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, JSC::Exception* exception, CachedScript* cachedScript)

Modified: trunk/Source/WebCore/dom/TextEvent.cpp (283236 => 283237)


--- trunk/Source/WebCore/dom/TextEvent.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/dom/TextEvent.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -48,7 +48,7 @@
 
 Ref<TextEvent> TextEvent::createForPlainTextPaste(RefPtr<WindowProxy>&& view, const String& data, bool shouldSmartReplace)
 {
-    return adoptRef(*new TextEvent(WTFMove(view), data, 0, shouldSmartReplace, false, MailBlockquoteHandling::RespectBlockquote));
+    return adoptRef(*new TextEvent(WTFMove(view), data, nullptr, shouldSmartReplace, false, MailBlockquoteHandling::RespectBlockquote));
 }
 
 Ref<TextEvent> TextEvent::createForFragmentPaste(RefPtr<WindowProxy>&& view, RefPtr<DocumentFragment>&& data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling)

Modified: trunk/Source/WebCore/editing/InsertListCommand.cpp (283236 => 283237)


--- trunk/Source/WebCore/editing/InsertListCommand.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/editing/InsertListCommand.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -364,7 +364,7 @@
     VisiblePosition end = endOfParagraph(start, CanSkipOverEditingBoundary);
     
     if (start.isNull() || end.isNull() || !start.deepEquivalent().containerNode()->hasEditableStyle() || !end.deepEquivalent().containerNode()->hasEditableStyle())
-        return 0;
+        return nullptr;
 
     // Check for adjoining lists.
     auto listItemElement = HTMLLIElement::create(document());
@@ -405,7 +405,7 @@
             insertionPos = positionInParentBeforeNode(listChild.get());
 
         if (!isEditablePosition(insertionPos))
-            return 0;
+            return nullptr;
 
         insertNodeAt(*listElement, insertionPos);
 

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (283236 => 283237)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -32,6 +32,7 @@
 #include "ApplicationCacheResource.h"
 #include "Attribute.h"
 #include "AudioTrackList.h"
+#include "AudioTrackPrivate.h"
 #include "Blob.h"
 #include "BlobURL.h"
 #include "CSSPropertyNames.h"
@@ -68,6 +69,7 @@
 #include "JSDOMPromiseDeferred.h"
 #include "JSHTMLMediaElement.h"
 #include "JSMediaControlsHost.h"
+#include "LoadableTextTrack.h"
 #include "Logging.h"
 #include "MIMETypeRegistry.h"
 #include "MediaController.h"
@@ -87,6 +89,7 @@
 #include "PageGroup.h"
 #include "PictureInPictureSupport.h"
 #include "PlatformMediaSessionManager.h"
+#include "PlatformTextTrack.h"
 #include "ProgressTracker.h"
 #include "Quirks.h"
 #include "RegistrableDomain.h"
@@ -111,7 +114,9 @@
 #include "UserContentController.h"
 #include "UserGestureIndicator.h"
 #include "VideoPlaybackQuality.h"
+#include "VideoTrack.h"
 #include "VideoTrackList.h"
+#include "VideoTrackPrivate.h"
 #include <_javascript_Core/ScriptObject.h>
 #include <_javascript_Core/Uint8Array.h>
 #include <limits>

Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (283236 => 283237)


--- trunk/Source/WebCore/html/HTMLMediaElement.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -28,7 +28,7 @@
 #if ENABLE(VIDEO)
 
 #include "ActiveDOMObject.h"
-#include "AudioTrack.h"
+#include "AudioTrackClient.h"
 #include "AutoplayEvent.h"
 #include "CaptionUserPreferences.h"
 #include "HTMLElement.h"
@@ -39,8 +39,8 @@
 #include "MediaPlayer.h"
 #include "MediaProducer.h"
 #include "MediaUniqueIdentifier.h"
-#include "TextTrack.h"
-#include "VideoTrack.h"
+#include "TextTrackClient.h"
+#include "VideoTrackClient.h"
 #include "VisibilityChangeClient.h"
 #include <wtf/Function.h>
 #include <wtf/LoggerHelper.h>

Modified: trunk/Source/WebCore/html/HTMLTrackElement.cpp (283236 => 283237)


--- trunk/Source/WebCore/html/HTMLTrackElement.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/HTMLTrackElement.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -34,6 +34,7 @@
 #include "EventNames.h"
 #include "HTMLMediaElement.h"
 #include "HTMLNames.h"
+#include "LoadableTextTrack.h"
 #include "Logging.h"
 #include <wtf/IsoMallocInlines.h>
 #include <wtf/text/CString.h>
@@ -60,7 +61,9 @@
 inline HTMLTrackElement::HTMLTrackElement(const QualifiedName& tagName, Document& document)
     : HTMLElement(tagName, document)
     , ActiveDOMObject(document)
+    , m_track(LoadableTextTrack::create(*this, attributeWithoutSynchronization(kindAttr).convertToASCIILowercase(), label(), srclang()))
 {
+    m_track->addClient(*this);
     LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this);
     ASSERT(hasTagName(trackTag));
 }
@@ -67,10 +70,8 @@
 
 HTMLTrackElement::~HTMLTrackElement()
 {
-    if (m_track) {
-        m_track->clearElement();
-        m_track->clearClient(*this);
-    }
+    m_track->clearElement();
+    m_track->clearClient(*this);
 }
 
 Ref<HTMLTrackElement> HTMLTrackElement::create(const QualifiedName& tagName, Document& document)
@@ -142,21 +143,9 @@
     return hasAttributeWithoutSynchronization(defaultAttr);
 }
 
-LoadableTextTrack& HTMLTrackElement::track()
+TextTrack& HTMLTrackElement::track()
 {
-    // FIXME: There is no practical value in lazily initializing this.
-    // Instead this should be created in the constructor.
-    if (!m_track) {
-        // The kind attribute is an enumerated attribute, limited only to known values. It defaults to 'subtitles' if missing or invalid.
-        String kind = attributeWithoutSynchronization(kindAttr).convertToASCIILowercase();
-        if (!TextTrack::isValidKindKeyword(kind))
-            kind = TextTrack::subtitlesKeyword();
-        m_track = LoadableTextTrack::create(*this, kind, label(), srclang());
-        m_track->addClient(*this);
-    }
-    ASSERT(m_track->trackElement() == this);
-
-    return *m_track;
+    return m_track;
 }
 
 bool HTMLTrackElement::isURLAttribute(const Attribute& attribute) const
@@ -206,7 +195,7 @@
             return;
         }
 
-        track().scheduleLoad(trackURL);
+        m_track->scheduleLoad(trackURL);
     });
 }
 
@@ -283,13 +272,11 @@
 {
     track().setReadinessState(static_cast<TextTrack::ReadinessState>(state));
     if (auto parent = mediaElement())
-        parent->textTrackReadyStateChanged(m_track.get());
+        parent->textTrackReadyStateChanged(m_track.ptr());
 }
 
 HTMLTrackElement::ReadyState HTMLTrackElement::readyState() const
 {
-    if (!m_track)
-        return HTMLTrackElement::NONE;
     return static_cast<ReadyState>(m_track->readinessState());
 }
 

Modified: trunk/Source/WebCore/html/HTMLTrackElement.h (283236 => 283237)


--- trunk/Source/WebCore/html/HTMLTrackElement.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/HTMLTrackElement.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -30,11 +30,12 @@
 
 #include "ActiveDOMObject.h"
 #include "HTMLElement.h"
-#include "LoadableTextTrack.h"
+#include "TextTrackClient.h"
 
 namespace WebCore {
 
 class HTMLMediaElement;
+class LoadableTextTrack;
 
 class HTMLTrackElement final : public HTMLElement, public ActiveDOMObject, public TextTrackClient {
     WTF_MAKE_ISO_ALLOCATED(HTMLTrackElement);
@@ -52,7 +53,7 @@
     ReadyState readyState() const;
     void setReadyState(ReadyState);
 
-    LoadableTextTrack& track();
+    TextTrack& track();
 
     void scheduleLoad();
 
@@ -87,7 +88,7 @@
 
     bool canLoadURL(const URL&);
 
-    RefPtr<LoadableTextTrack> m_track;
+    Ref<LoadableTextTrack> m_track;
     bool m_loadPending { false };
     bool m_hasRelevantLoadEventsListener { false };
 };

Modified: trunk/Source/WebCore/html/track/AudioTrack.cpp (283236 => 283237)


--- trunk/Source/WebCore/html/track/AudioTrack.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/track/AudioTrack.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -31,10 +31,12 @@
 
 #include "config.h"
 #include "AudioTrack.h"
-#include "AudioTrackList.h"
 
 #if ENABLE(VIDEO)
 
+#include "AudioTrackClient.h"
+#include "AudioTrackList.h"
+#include "AudioTrackPrivate.h"
 #include <wtf/NeverDestroyed.h>
 
 namespace WebCore {
@@ -80,13 +82,13 @@
     , m_private(trackPrivate)
     , m_enabled(trackPrivate.enabled())
 {
-    m_private->setClient(this);
+    m_private->setClient(*this);
     updateKindFromPrivate();
 }
 
 AudioTrack::~AudioTrack()
 {
-    m_private->setClient(nullptr);
+    m_private->clearClient();
 }
 
 void AudioTrack::setPrivate(AudioTrackPrivate& trackPrivate)
@@ -94,10 +96,10 @@
     if (m_private.ptr() == &trackPrivate)
         return;
 
-    m_private->setClient(nullptr);
+    m_private->clearClient();
     m_private = trackPrivate;
     m_private->setEnabled(m_enabled);
-    m_private->setClient(this);
+    m_private->setClient(*this);
 #if !RELEASE_LOG_DISABLED
     m_private->setLogger(logger(), logIdentifier());
 #endif

Modified: trunk/Source/WebCore/html/track/AudioTrack.h (283236 => 283237)


--- trunk/Source/WebCore/html/track/AudioTrack.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/track/AudioTrack.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -28,26 +28,15 @@
 
 #if ENABLE(VIDEO)
 
-#include "AudioTrackPrivate.h"
+#include "AudioTrackPrivateClient.h"
 #include "TrackBase.h"
 #include <wtf/WeakHashSet.h>
 
 namespace WebCore {
 
-class AudioTrack;
+class AudioTrackClient;
 class AudioTrackList;
 
-class AudioTrackClient : public CanMakeWeakPtr<AudioTrackClient> {
-public:
-    virtual ~AudioTrackClient() = default;
-    virtual void audioTrackEnabledChanged(AudioTrack&) { }
-    virtual void audioTrackIdChanged(AudioTrack&) { }
-    virtual void audioTrackKindChanged(AudioTrack&) { }
-    virtual void audioTrackLabelChanged(AudioTrack&) { }
-    virtual void audioTrackLanguageChanged(AudioTrack&) { }
-    virtual void willRemoveAudioTrack(AudioTrack&) { }
-};
-
 class AudioTrack final : public MediaTrackBase, private AudioTrackPrivateClient {
 public:
     static Ref<AudioTrack> create(ScriptExecutionContext* context, AudioTrackPrivate& trackPrivate)

Copied: trunk/Source/WebCore/html/track/AudioTrackClient.h (from rev 283236, trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp) (0 => 283237)


--- trunk/Source/WebCore/html/track/AudioTrackClient.h	                        (rev 0)
+++ trunk/Source/WebCore/html/track/AudioTrackClient.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(VIDEO)
+
+#include <wtf/WeakPtr.h>
+
+namespace WebCore {
+
+class AudioTrack;
+
+class AudioTrackClient : public CanMakeWeakPtr<AudioTrackClient> {
+public:
+    virtual ~AudioTrackClient() = default;
+    virtual void audioTrackEnabledChanged(AudioTrack&) { }
+    virtual void audioTrackIdChanged(AudioTrack&) { }
+    virtual void audioTrackKindChanged(AudioTrack&) { }
+    virtual void audioTrackLabelChanged(AudioTrack&) { }
+    virtual void audioTrackLanguageChanged(AudioTrack&) { }
+    virtual void willRemoveAudioTrack(AudioTrack&) { }
+};
+
+}
+
+#endif

Modified: trunk/Source/WebCore/html/track/InbandTextTrack.cpp (283236 => 283237)


--- trunk/Source/WebCore/html/track/InbandTextTrack.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/track/InbandTextTrack.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -58,13 +58,13 @@
     : TextTrack(&document, emptyAtom(), trackPrivate.id(), trackPrivate.label(), trackPrivate.language(), InBand)
     , m_private(trackPrivate)
 {
-    m_private->setClient(this);
+    m_private->setClient(*this);
     updateKindFromPrivate();
 }
 
 InbandTextTrack::~InbandTextTrack()
 {
-    m_private->setClient(nullptr);
+    m_private->clearClient();
 }
 
 void InbandTextTrack::setPrivate(InbandTextTrackPrivate& trackPrivate)
@@ -72,9 +72,9 @@
     if (m_private.ptr() == &trackPrivate)
         return;
 
-    m_private->setClient(nullptr);
+    m_private->clearClient();
     m_private = trackPrivate;
-    m_private->setClient(this);
+    m_private->setClient(*this);
 
     setModeInternal(mode());
     updateKindFromPrivate();

Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (283236 => 283237)


--- trunk/Source/WebCore/html/track/TextTrack.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -38,6 +38,7 @@
 #include "Document.h"
 #include "Event.h"
 #include "SourceBuffer.h"
+#include "TextTrackClient.h"
 #include "TextTrackCueList.h"
 #include "TextTrackList.h"
 #include "VTTRegion.h"

Modified: trunk/Source/WebCore/html/track/TextTrack.h (283236 => 283237)


--- trunk/Source/WebCore/html/track/TextTrack.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/track/TextTrack.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -39,25 +39,11 @@
 class ScriptExecutionContext;
 class TextTrack;
 class TextTrackList;
+class TextTrackClient;
 class TextTrackCueList;
 class VTTRegion;
 class VTTRegionList;
 
-class TextTrackClient : public CanMakeWeakPtr<TextTrackClient> {
-public:
-    virtual ~TextTrackClient() = default;
-    virtual void textTrackIdChanged(TextTrack&) { }
-    virtual void textTrackKindChanged(TextTrack&) { }
-    virtual void textTrackModeChanged(TextTrack&) { }
-    virtual void textTrackLabelChanged(TextTrack&) { }
-    virtual void textTrackLanguageChanged(TextTrack&) { }
-    virtual void textTrackAddCues(TextTrack&, const TextTrackCueList&) { }
-    virtual void textTrackRemoveCues(TextTrack&, const TextTrackCueList&) { }
-    virtual void textTrackAddCue(TextTrack&, TextTrackCue&) { }
-    virtual void textTrackRemoveCue(TextTrack&, TextTrackCue&) { }
-    virtual void willRemoveTextTrack(TextTrack&) { }
-};
-
 class TextTrack : public TrackBase, public EventTargetWithInlineData, public ActiveDOMObject {
     WTF_MAKE_ISO_ALLOCATED(TextTrack);
 public:

Copied: trunk/Source/WebCore/html/track/TextTrackClient.h (from rev 283236, trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp) (0 => 283237)


--- trunk/Source/WebCore/html/track/TextTrackClient.h	                        (rev 0)
+++ trunk/Source/WebCore/html/track/TextTrackClient.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(VIDEO)
+
+#include <wtf/WeakPtr.h>
+
+namespace WebCore {
+
+class TextTrack;
+class TextTrackCue;
+class TextTrackCueList;
+
+class TextTrackClient : public CanMakeWeakPtr<TextTrackClient> {
+public:
+    virtual ~TextTrackClient() = default;
+    virtual void textTrackIdChanged(TextTrack&) { }
+    virtual void textTrackKindChanged(TextTrack&) { }
+    virtual void textTrackModeChanged(TextTrack&) { }
+    virtual void textTrackLabelChanged(TextTrack&) { }
+    virtual void textTrackLanguageChanged(TextTrack&) { }
+    virtual void textTrackAddCues(TextTrack&, const TextTrackCueList&) { }
+    virtual void textTrackRemoveCues(TextTrack&, const TextTrackCueList&) { }
+    virtual void textTrackAddCue(TextTrack&, TextTrackCue&) { }
+    virtual void textTrackRemoveCue(TextTrack&, TextTrackCue&) { }
+    virtual void willRemoveTextTrack(TextTrack&) { }
+};
+
+}
+
+#endif

Modified: trunk/Source/WebCore/html/track/VideoTrack.cpp (283236 => 283237)


--- trunk/Source/WebCore/html/track/VideoTrack.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/track/VideoTrack.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -34,7 +34,9 @@
 
 #if ENABLE(VIDEO)
 
+#include "VideoTrackClient.h"
 #include "VideoTrackList.h"
+#include "VideoTrackPrivate.h"
 #include <wtf/NeverDestroyed.h>
 
 #if ENABLE(MEDIA_SOURCE)
@@ -84,13 +86,13 @@
     , m_private(trackPrivate)
     , m_selected(trackPrivate.selected())
 {
-    m_private->setClient(this);
+    m_private->setClient(*this);
     updateKindFromPrivate();
 }
 
 VideoTrack::~VideoTrack()
 {
-    m_private->setClient(nullptr);
+    m_private->clearClient();
 }
 
 void VideoTrack::setPrivate(VideoTrackPrivate& trackPrivate)
@@ -98,9 +100,9 @@
     if (m_private.ptr() == &trackPrivate)
         return;
 
-    m_private->setClient(nullptr);
+    m_private->clearClient();
     m_private = trackPrivate;
-    m_private->setClient(this);
+    m_private->setClient(*this);
 #if !RELEASE_LOG_DISABLED
     m_private->setLogger(logger(), logIdentifier());
 #endif

Modified: trunk/Source/WebCore/html/track/VideoTrack.h (283236 => 283237)


--- trunk/Source/WebCore/html/track/VideoTrack.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/track/VideoTrack.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -29,7 +29,7 @@
 #if ENABLE(VIDEO)
 
 #include "TrackBase.h"
-#include "VideoTrackPrivate.h"
+#include "VideoTrackPrivateClient.h"
 #include <wtf/WeakHashSet.h>
 
 namespace WebCore {
@@ -36,19 +36,10 @@
 
 class MediaDescription;
 class VideoTrack;
+class VideoTrackClient;
 class VideoTrackList;
+class VideoTrackPrivate;
 
-class VideoTrackClient : public CanMakeWeakPtr<VideoTrackClient> {
-public:
-    virtual ~VideoTrackClient() = default;
-    virtual void videoTrackIdChanged(VideoTrack&) { }
-    virtual void videoTrackKindChanged(VideoTrack&) { }
-    virtual void videoTrackLabelChanged(VideoTrack&) { }
-    virtual void videoTrackLanguageChanged(VideoTrack&) { }
-    virtual void videoTrackSelectedChanged(VideoTrack&) { }
-    virtual void willRemoveVideoTrack(VideoTrack&) { }
-};
-
 class VideoTrack final : public MediaTrackBase, private VideoTrackPrivateClient {
 public:
     static Ref<VideoTrack> create(ScriptExecutionContext* context, VideoTrackPrivate& trackPrivate)

Modified: trunk/Source/WebCore/html/track/VideoTrack.idl (283236 => 283237)


--- trunk/Source/WebCore/html/track/VideoTrack.idl	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/html/track/VideoTrack.idl	2021-09-29 18:19:46 UTC (rev 283237)
@@ -34,4 +34,5 @@
     [SettingsConditionallyReadWrite=MediaSource] attribute DOMString language;
 
     attribute boolean selected;
+
 };

Copied: trunk/Source/WebCore/html/track/VideoTrackClient.h (from rev 283236, trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp) (0 => 283237)


--- trunk/Source/WebCore/html/track/VideoTrackClient.h	                        (rev 0)
+++ trunk/Source/WebCore/html/track/VideoTrackClient.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(VIDEO)
+
+#include <wtf/WeakPtr.h>
+
+namespace WebCore {
+
+class VideoTrack;
+
+class VideoTrackClient : public CanMakeWeakPtr<VideoTrackClient> {
+public:
+    virtual ~VideoTrackClient() = default;
+    virtual void videoTrackIdChanged(VideoTrack&) { }
+    virtual void videoTrackKindChanged(VideoTrack&) { }
+    virtual void videoTrackLabelChanged(VideoTrack&) { }
+    virtual void videoTrackLanguageChanged(VideoTrack&) { }
+    virtual void videoTrackSelectedChanged(VideoTrack&) { }
+    virtual void willRemoveVideoTrack(VideoTrack&) { }
+};
+
+} // namespace WebCore
+
+#endif
+

Modified: trunk/Source/WebCore/page/PageConsoleClient.cpp (283236 => 283237)


--- trunk/Source/WebCore/page/PageConsoleClient.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/page/PageConsoleClient.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -148,7 +148,7 @@
     if (document)
         document->getParserLocation(url, line, column);
 
-    addMessage(source, level, message, url, line, column, 0, JSExecState::currentState(), requestIdentifier);
+    addMessage(source, level, message, url, line, column, nullptr, JSExecState::currentState(), requestIdentifier);
 }
 
 void PageConsoleClient::addMessage(MessageSource source, MessageLevel level, const String& message, Ref<ScriptCallStack>&& callStack)

Modified: trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h (283236 => 283237)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -32,7 +32,6 @@
 
 #include "CDMInstance.h"
 #include "CDMInstanceSession.h"
-#include "MediaPlayerPrivate.h"
 #include "SharedBuffer.h"
 #include <wtf/BoxPtr.h>
 #include <wtf/Condition.h>
@@ -44,6 +43,8 @@
 
 namespace WebCore {
 
+class MediaPlayer;
+
 using KeyIDType = Vector<uint8_t>;
 using KeyHandleValueVariant = Variant<
     Vector<uint8_t>

Modified: trunk/Source/WebCore/platform/graphics/AudioTrackPrivate.h (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/AudioTrackPrivate.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/AudioTrackPrivate.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include "AudioTrackPrivateClient.h"
 #include "TrackPrivateBase.h"
 #include <wtf/Function.h>
 
@@ -32,13 +33,6 @@
 
 namespace WebCore {
 
-class AudioTrackPrivate;
-
-class AudioTrackPrivateClient : public TrackPrivateBaseClient {
-public:
-    virtual void enabledChanged(bool) = 0;
-};
-
 class AudioTrackPrivate : public TrackPrivateBase {
 public:
     static Ref<AudioTrackPrivate> create()
@@ -46,8 +40,9 @@
         return adoptRef(*new AudioTrackPrivate);
     }
 
-    void setClient(AudioTrackPrivateClient* client) { m_client = client; }
-    AudioTrackPrivateClient* client() const override { return m_client; }
+    void setClient(AudioTrackPrivateClient& client) { m_client = makeWeakPtr(client); }
+    void clearClient() { m_client = nullptr; }
+    AudioTrackPrivateClient* client() const override { return m_client.get(); }
 
     virtual void setEnabled(bool enabled)
     {
@@ -78,7 +73,7 @@
     AudioTrackPrivate() = default;
 
 private:
-    AudioTrackPrivateClient* m_client { nullptr };
+    WeakPtr<AudioTrackPrivateClient> m_client;
     bool m_enabled { false };
     EnabledChangedCallback m_enabledChangedCallback;
 };

Copied: trunk/Source/WebCore/platform/graphics/AudioTrackPrivateClient.h (from rev 283236, trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp) (0 => 283237)


--- trunk/Source/WebCore/platform/graphics/AudioTrackPrivateClient.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/AudioTrackPrivateClient.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "TrackPrivateBaseClient.h"
+
+#if ENABLE(VIDEO)
+
+namespace WebCore {
+
+class AudioTrackPrivate;
+
+class AudioTrackPrivateClient : public TrackPrivateBaseClient {
+public:
+    virtual void enabledChanged(bool) = 0;
+};
+
+}
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -41,8 +41,9 @@
     static Ref<InbandTextTrackPrivate> create(CueFormat format) { return adoptRef(*new InbandTextTrackPrivate(format)); }
     virtual ~InbandTextTrackPrivate() = default;
 
-    InbandTextTrackPrivateClient* client() const override { return m_client; }
-    virtual void setClient(InbandTextTrackPrivateClient* client) { m_client = client; }
+    InbandTextTrackPrivateClient* client() const override { return m_client.get(); }
+    virtual void setClient(InbandTextTrackPrivateClient& client) { m_client = makeWeakPtr(client); }
+    void clearClient() { m_client = nullptr; }
 
     enum class Mode : uint8_t {
         Disabled,
@@ -88,7 +89,7 @@
 
 private:
     CueFormat m_format;
-    InbandTextTrackPrivateClient* m_client { nullptr };
+    WeakPtr<InbandTextTrackPrivateClient> m_client { nullptr };
     Mode m_mode { Mode::Disabled };
 };
 

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -33,9 +33,13 @@
 #include "Document.h"
 #include "GraphicsContext.h"
 #include "IntRect.h"
+#include "LegacyCDMSession.h"
 #include "Logging.h"
 #include "MIMETypeRegistry.h"
 #include "MediaPlayerPrivate.h"
+#include "PlatformMediaResourceLoader.h"
+#include "PlatformScreen.h"
+#include "PlatformTextTrack.h"
 #include "PlatformTimeRanges.h"
 #include <wtf/Lock.h>
 #include <wtf/NeverDestroyed.h>
@@ -185,9 +189,14 @@
 #endif
 
     const Vector<WebCore::ContentType>& mediaContentTypesRequiringHardwareSupport() const final { return nullContentTypeVector(); }
+
+    RefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader() final { return nullptr; }
+
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+    RefPtr<ArrayBuffer> mediaPlayerCachedKeyForKeyId(const String&) const final { return nullptr; }
+#endif
 };
 
-
 const Vector<ContentType>& MediaPlayerClient::mediaContentTypesRequiringHardwareSupport() const
 {
     static NeverDestroyed<Vector<ContentType>> contentTypes;
@@ -412,6 +421,7 @@
     : m_client(&client)
     , m_reloadTimer(*this, &MediaPlayer::reloadTimerFired)
     , m_private(makeUnique<NullMediaPlayerPrivate>(this))
+    , m_preferredDynamicRangeMode(DynamicRangeMode::Standard)
 {
 }
 
@@ -420,6 +430,7 @@
     , m_reloadTimer(*this, &MediaPlayer::reloadTimerFired)
     , m_private(makeUnique<NullMediaPlayerPrivate>(this))
     , m_activeEngineIdentifier(mediaEngineIdentifier)
+    , m_preferredDynamicRangeMode(DynamicRangeMode::Standard)
 {
 }
 

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -27,24 +27,17 @@
 
 #if ENABLE(VIDEO)
 
-#include "AudioTrackPrivate.h"
 #include "ContentType.h"
 #include "Cookie.h"
 #include "GraphicsTypesGL.h"
 #include "LayoutRect.h"
-#include "LegacyCDMSession.h"
 #include "MediaPlayerEnums.h"
 #include "MediaPlayerIdentifier.h"
-#include "NativeImage.h"
 #include "PlatformLayer.h"
-#include "PlatformMediaResourceLoader.h"
-#include "PlatformMediaSession.h"
-#include "PlatformScreen.h"
-#include "SecurityOriginHash.h"
+#include "SecurityOriginData.h"
 #include "Timer.h"
 #include "VideoPlaybackQualityMetrics.h"
 #include <wtf/URL.h>
-#include "VideoTrackPrivate.h"
 #include <_javascript_Core/Uint8Array.h>
 #include <wtf/CompletionHandler.h>
 #include <wtf/Function.h>
@@ -56,10 +49,6 @@
 #include <wtf/WeakPtr.h>
 #include <wtf/text/StringHash.h>
 
-#if ENABLE(AVF_CAPTIONS)
-#include "PlatformTextTrack.h"
-#endif
-
 OBJC_CLASS AVPlayer;
 OBJC_CLASS NSArray;
 
@@ -69,7 +58,11 @@
 
 namespace WebCore {
 
+enum class AudioSessionCategory : uint8_t;
+enum class DynamicRangeMode : uint8_t;
+
 class AudioSourceProvider;
+class AudioTrackPrivate;
 class CDMInstance;
 class CachedResourceLoader;
 class GraphicsContextGL;
@@ -76,6 +69,7 @@
 class GraphicsContext;
 class InbandTextTrackPrivate;
 class LegacyCDM;
+class LegacyCDMSession;
 class LegacyCDMSessionClient;
 class MediaPlaybackTarget;
 class MediaPlayer;
@@ -84,8 +78,12 @@
 class MediaPlayerRequestInstallMissingPluginsCallback;
 class MediaSourcePrivateClient;
 class MediaStreamPrivate;
+class NativeImage;
+class PlatformMediaResourceLoader;
+class PlatformTextTrack;
 class PlatformTimeRanges;
 class TextTrackRepresentation;
+class VideoTrackPrivate;
 
 struct GraphicsDeviceAdapter;
 struct SecurityOriginData;
@@ -203,7 +201,7 @@
 #endif
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-    virtual RefPtr<ArrayBuffer> mediaPlayerCachedKeyForKeyId(const String&) const { return nullptr; }
+    virtual RefPtr<ArrayBuffer> mediaPlayerCachedKeyForKeyId(const String&) const = 0;
     virtual void mediaPlayerKeyNeeded(Uint8Array*) { }
     virtual String mediaPlayerMediaKeysStorageDirectory() const { return emptyString(); }
 #endif
@@ -230,7 +228,7 @@
     virtual bool mediaPlayerPlatformVolumeConfigurationRequired() const { return false; }
     virtual bool mediaPlayerIsLooping() const { return false; }
     virtual CachedResourceLoader* mediaPlayerCachedResourceLoader() { return nullptr; }
-    virtual RefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader() { return nullptr; }
+    virtual RefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader() = 0;
     virtual bool doesHaveAttribute(const AtomString&, AtomString* = nullptr) const { return false; }
     virtual bool mediaPlayerShouldUsePersistentCache() const { return true; }
     virtual const String& mediaPlayerMediaCacheDirectory() const { return emptyString(); }
@@ -710,7 +708,7 @@
     bool m_shouldPrepareToRender { false };
     bool m_contentMIMETypeWasInferredFromExtension { false };
     bool m_initializingMediaEngine { false };
-    DynamicRangeMode m_preferredDynamicRangeMode { DynamicRangeMode::Standard };
+    DynamicRangeMode m_preferredDynamicRangeMode;
     PitchCorrectionAlgorithm m_pitchCorrectionAlgorithm { PitchCorrectionAlgorithm::BestAllAround };
 
 #if ENABLE(MEDIA_SOURCE)

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -29,9 +29,14 @@
 
 #include "MediaPlayer.h"
 #include "MediaPlayerIdentifier.h"
+#include "NativeImage.h"
 #include "PlatformTimeRanges.h"
 #include <wtf/CompletionHandler.h>
 
+#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
+#include "LegacyCDMSession.h"
+#endif
+
 namespace WebCore {
 
 class MediaPlayerPrivateInterface {

Modified: trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -28,6 +28,7 @@
 
 #if ENABLE(MEDIA_SOURCE)
 
+#include "AudioTrackPrivate.h"
 #include "Logging.h"
 #include "MediaDescription.h"
 #include "MediaSample.h"
@@ -36,6 +37,7 @@
 #include "SharedBuffer.h"
 #include "SourceBufferPrivateClient.h"
 #include "TimeRanges.h"
+#include "VideoTrackPrivate.h"
 #include <wtf/CheckedArithmetic.h>
 #include <wtf/MediaTime.h>
 #include <wtf/StringPrintStream.h>

Modified: trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -29,6 +29,7 @@
 
 #if ENABLE(VIDEO)
 
+#include "TrackPrivateBaseClient.h"
 #include <wtf/LoggerHelper.h>
 #include <wtf/MediaTime.h>
 #include <wtf/ThreadSafeRefCounted.h>
@@ -36,15 +37,6 @@
 
 namespace WebCore {
 
-class TrackPrivateBaseClient {
-public:
-    virtual ~TrackPrivateBaseClient() = default;
-    virtual void idChanged(const AtomString&) = 0;
-    virtual void labelChanged(const AtomString&) = 0;
-    virtual void languageChanged(const AtomString&) = 0;
-    virtual void willRemove() = 0;
-};
-
 class WEBCORE_EXPORT TrackPrivateBase
     : public ThreadSafeRefCounted<TrackPrivateBase, WTF::DestructionThread::Main>
 #if !RELEASE_LOG_DISABLED

Copied: trunk/Source/WebCore/platform/graphics/TrackPrivateBaseClient.h (from rev 283236, trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp) (0 => 283237)


--- trunk/Source/WebCore/platform/graphics/TrackPrivateBaseClient.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/TrackPrivateBaseClient.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(VIDEO)
+
+#include <wtf/Forward.h>
+#include <wtf/WeakPtr.h>
+
+namespace WebCore {
+
+class TrackPrivateBaseClient : public CanMakeWeakPtr<TrackPrivateBaseClient> {
+public:
+    virtual ~TrackPrivateBaseClient() = default;
+    virtual void idChanged(const AtomString&) = 0;
+    virtual void labelChanged(const AtomString&) = 0;
+    virtual void languageChanged(const AtomString&) = 0;
+    virtual void willRemove() = 0;
+};
+
+}
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/VideoTrackPrivate.h (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/VideoTrackPrivate.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/VideoTrackPrivate.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -28,19 +28,16 @@
 #if ENABLE(VIDEO)
 
 #include "TrackPrivateBase.h"
+#include "VideoTrackPrivateClient.h"
 #include <wtf/Function.h>
 
 namespace WebCore {
 
-class VideoTrackPrivateClient : public TrackPrivateBaseClient {
-public:
-    virtual void selectedChanged(bool) = 0;
-};
-
 class VideoTrackPrivate : public TrackPrivateBase {
 public:
-    void setClient(VideoTrackPrivateClient* client) { m_client = client; }
-    VideoTrackPrivateClient* client() const override { return m_client; }
+    void setClient(VideoTrackPrivateClient& client) { m_client = makeWeakPtr(client); }
+    void clearClient() { m_client = nullptr; }
+    VideoTrackPrivateClient* client() const override { return m_client.get(); }
 
     virtual void setSelected(bool selected)
     {
@@ -68,7 +65,7 @@
     VideoTrackPrivate() = default;
 
 private:
-    VideoTrackPrivateClient* m_client { nullptr };
+    WeakPtr<VideoTrackPrivateClient> m_client { nullptr };
     bool m_selected { false };
     SelectedChangedCallback m_selectedChangedCallback;
 };

Copied: trunk/Source/WebCore/platform/graphics/VideoTrackPrivateClient.h (from rev 283236, trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp) (0 => 283237)


--- trunk/Source/WebCore/platform/graphics/VideoTrackPrivateClient.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/VideoTrackPrivateClient.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(VIDEO)
+
+#include "TrackPrivateBaseClient.h"
+
+namespace WebCore {
+
+class VideoTrackPrivateClient : public TrackPrivateBaseClient {
+public:
+    virtual void selectedChanged(bool) = 0;
+};
+
+}
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -385,7 +385,7 @@
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && PLATFORM(MAC)
     RetainPtr<AVOutputContext> m_outputContext;
-    RefPtr<MediaPlaybackTarget> m_playbackTarget { nullptr };
+    RefPtr<MediaPlaybackTarget> m_playbackTarget;
 #endif
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2021-09-29 18:19:46 UTC (rev 283237)
@@ -53,6 +53,9 @@
 #import "MediaSessionManagerCocoa.h"
 #import "OutOfBandTextTrackPrivateAVF.h"
 #import "PixelBufferConformerCV.h"
+#import "PlatformMediaResourceLoader.h"
+#import "PlatformScreen.h"
+#import "PlatformTextTrack.h"
 #import "PlatformTimeRanges.h"
 #import "RuntimeApplicationChecks.h"
 #import "ScriptDisallowedScope.h"
@@ -106,6 +109,10 @@
 #import "TextTrack.h"
 #endif
 
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+#import "MediaPlaybackTarget.h"
+#endif
+
 #if PLATFORM(IOS_FAMILY)
 #import "LocalizedDeviceModel.h"
 #import "WAKAppKitStubs.h"

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm	2021-09-29 18:19:46 UTC (rev 283237)
@@ -33,6 +33,7 @@
 #import "CachedResourceRequest.h"
 #import "DataURLDecoder.h"
 #import "MediaPlayerPrivateAVFoundationObjC.h"
+#import "PlatformMediaResourceLoader.h"
 #import "ResourceLoaderOptions.h"
 #import "SharedBuffer.h"
 #import "UTIUtilities.h"

Modified: trunk/Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp (283236 => 283237)


--- trunk/Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -35,6 +35,7 @@
 #include "VP9UtilitiesCocoa.h"
 #include <pal/avfoundation/OutputContext.h>
 #include <pal/avfoundation/OutputDevice.h>
+#include <wtf/Algorithms.h>
 
 #include "VideoToolboxSoftLink.h"
 

Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h (283236 => 283237)


--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h	2021-09-29 18:19:46 UTC (rev 283237)
@@ -28,6 +28,7 @@
 #if ENABLE(MEDIA_SOURCE)
 
 #include "MediaSourcePrivate.h"
+#include <wtf/LoggerHelper.h>
 #include <wtf/MediaTime.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp (283236 => 283237)


--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -310,7 +310,7 @@
     fontDescription.setRenderingMode(settings().fontRenderingMode());
     fontDescription.setComputedSize(12);
     font = FontCascade(WTFMove(fontDescription), 0, 0);
-    font.update(0);
+    font.update(nullptr);
 
     run = TextRun(m_unavailablePluginReplacementText);
     textWidth = font.width(run);

Modified: trunk/Source/WebCore/rendering/RenderSearchField.cpp (283236 => 283237)


--- trunk/Source/WebCore/rendering/RenderSearchField.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/rendering/RenderSearchField.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -54,7 +54,7 @@
 RenderSearchField::RenderSearchField(HTMLInputElement& element, RenderStyle&& style)
     : RenderTextControlSingleLine(element, WTFMove(style))
     , m_searchPopupIsVisible(false)
-    , m_searchPopup(0)
+    , m_searchPopup(nullptr)
 {
     ASSERT(element.isSearchField());
 }

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (283236 => 283237)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2021-09-29 18:19:46 UTC (rev 283237)
@@ -965,7 +965,7 @@
     style.setLineHeight(RenderStyle::initialLineHeight());
 
     if (style.setFontDescription(WTFMove(fontDescription)))
-        style.fontCascade().update(0);
+        style.fontCascade().update(nullptr);
 }
 
 NSControlSize RenderThemeMac::controlSizeForSystemFont(const RenderStyle& style) const

Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (283236 => 283237)


--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -563,7 +563,7 @@
     xmlParserCtxtPtr parser = xmlCreateMemoryParserCtxt(chunk.data(), chunk.length());
 
     if (!parser)
-        return 0;
+        return nullptr;
 
     memcpy(parser->sax, handlers, sizeof(xmlSAXHandler));
 

Modified: trunk/Source/WebKit/ChangeLog (283236 => 283237)


--- trunk/Source/WebKit/ChangeLog	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebKit/ChangeLog	2021-09-29 18:19:46 UTC (rev 283237)
@@ -1,3 +1,22 @@
+2021-09-29  Jer Noble  <[email protected]>
+
+        Build-time optimization: forward declare more things in MediaPlayer.h and HTMLMediaElement.h
+        https://bugs.webkit.org/show_bug.cgi?id=230853
+
+        Reviewed by Eric Carlson.
+
+        Use new WeakPtr based client setters on TrackPrivates.
+
+        * GPUProcess/media/RemoteAudioTrackProxy.cpp:
+        (WebKit::RemoteAudioTrackProxy::RemoteAudioTrackProxy):
+        (WebKit::RemoteAudioTrackProxy::~RemoteAudioTrackProxy):
+        * GPUProcess/media/RemoteTextTrackProxy.cpp:
+        (WebKit::RemoteTextTrackProxy::RemoteTextTrackProxy):
+        (WebKit::RemoteTextTrackProxy::~RemoteTextTrackProxy):
+        * GPUProcess/media/RemoteVideoTrackProxy.cpp:
+        (WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy):
+        (WebKit::RemoteVideoTrackProxy::~RemoteVideoTrackProxy):
+
 2021-09-29  Alex Christensen  <[email protected]>
 
         Reduce allocations in DatabaseUtilities::sortedTables

Modified: trunk/Source/WebKit/GPUProcess/media/RemoteAudioTrackProxy.cpp (283236 => 283237)


--- trunk/Source/WebKit/GPUProcess/media/RemoteAudioTrackProxy.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteAudioTrackProxy.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -45,12 +45,13 @@
     , m_trackPrivate(trackPrivate)
     , m_mediaPlayerIdentifier(mediaPlayerIdentifier)
 {
-    m_trackPrivate->setClient(this);
+    m_trackPrivate->setClient(*this);
     m_connectionToWebProcess->connection().send(Messages::MediaPlayerPrivateRemote::AddRemoteAudioTrack(m_identifier, configuration()), m_mediaPlayerIdentifier);
 }
 
 RemoteAudioTrackProxy::~RemoteAudioTrackProxy()
 {
+    m_trackPrivate->clearClient();
 }
 
 TrackPrivateRemoteConfiguration& RemoteAudioTrackProxy::configuration()

Modified: trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp (283236 => 283237)


--- trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -49,12 +49,13 @@
     , m_trackPrivate(trackPrivate)
     , m_mediaPlayerIdentifier(mediaPlayerIdentifier)
 {
-    m_trackPrivate->setClient(this);
+    m_trackPrivate->setClient(*this);
     m_connectionToWebProcess->connection().send(Messages::MediaPlayerPrivateRemote::AddRemoteTextTrack(m_identifier, configuration()), m_mediaPlayerIdentifier);
 }
 
 RemoteTextTrackProxy::~RemoteTextTrackProxy()
 {
+    m_trackPrivate->clearClient();
 }
 
 TextTrackPrivateRemoteConfiguration& RemoteTextTrackProxy::configuration()

Modified: trunk/Source/WebKit/GPUProcess/media/RemoteVideoTrackProxy.cpp (283236 => 283237)


--- trunk/Source/WebKit/GPUProcess/media/RemoteVideoTrackProxy.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteVideoTrackProxy.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -45,12 +45,13 @@
     , m_trackPrivate(trackPrivate)
     , m_mediaPlayerIdentifier(mediaPlayerIdentifier)
 {
-    m_trackPrivate->setClient(this);
+    m_trackPrivate->setClient(*this);
     m_connectionToWebProcess->connection().send(Messages::MediaPlayerPrivateRemote::AddRemoteVideoTrack(m_identifier, configuration()), m_mediaPlayerIdentifier);
 }
 
 RemoteVideoTrackProxy::~RemoteVideoTrackProxy()
 {
+    m_trackPrivate->clearClient();
 }
 
 TrackPrivateRemoteConfiguration& RemoteVideoTrackProxy::configuration()

Modified: trunk/Source/WebKitLegacy/ChangeLog (283236 => 283237)


--- trunk/Source/WebKitLegacy/ChangeLog	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebKitLegacy/ChangeLog	2021-09-29 18:19:46 UTC (rev 283237)
@@ -1,3 +1,15 @@
+2021-09-29  Jer Noble  <[email protected]>
+
+        Build-time optimization: forward declare more things in MediaPlayer.h and HTMLMediaElement.h
+        https://bugs.webkit.org/show_bug.cgi?id=230853
+
+        Reviewed by Eric Carlson.
+
+        Use nullptr rather than zero for null values.
+
+        * Storage/StorageNamespaceImpl.cpp:
+        (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
+
 2021-09-28  Alex Christensen  <[email protected]>
 
         Mostly fix Mac CMake build

Modified: trunk/Source/WebKitLegacy/Storage/StorageNamespaceImpl.cpp (283236 => 283237)


--- trunk/Source/WebKitLegacy/Storage/StorageNamespaceImpl.cpp	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Source/WebKitLegacy/Storage/StorageNamespaceImpl.cpp	2021-09-29 18:19:46 UTC (rev 283237)
@@ -67,7 +67,7 @@
 StorageNamespaceImpl::StorageNamespaceImpl(StorageType storageType, const String& path, unsigned quota, PAL::SessionID sessionID)
     : m_storageType(storageType)
     , m_path(path.isolatedCopy())
-    , m_syncManager(0)
+    , m_syncManager(nullptr)
     , m_quota(quota)
     , m_isShutdown(false)
     , m_sessionID(sessionID)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (283236 => 283237)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2021-09-29 18:12:55 UTC (rev 283236)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2021-09-29 18:19:46 UTC (rev 283237)
@@ -302,12 +302,12 @@
 
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
 {
-    return 0;
+    return nullptr;
 }
 
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaControlsElementAtIndex(unsigned index)
 {
-    return 0;
+    return nullptr;
 }
 
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaDetailsElementAtIndex(unsigned index)
@@ -328,12 +328,12 @@
 
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
 {
-    return 0;
+    return nullptr;
 }
 
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::rowAtIndex(unsigned index)
 {
-    return 0;
+    return nullptr;
 }
 
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned index) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to