Skip to content

Commit 4c9de0f

Browse files
committed
1 parent 41baa4f commit 4c9de0f

File tree

5 files changed

+20
-23
lines changed

5 files changed

+20
-23
lines changed

Source/WebCore/Modules/mediasource/MediaSourceHandle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class MediaSourceHandle
7676

7777
const bool m_detachable;
7878
bool m_detached { false };
79-
Ref<SharedPrivate> m_private;
79+
const Ref<SharedPrivate> m_private;
8080
};
8181

8282
using DetachedMediaSourceHandle = MediaSourceHandle;

Source/WebCore/Modules/mediasource/SourceBuffer.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class SourceBufferClientImpl final : public SourceBufferPrivateClient {
169169

170170
Ref<SourceBuffer> SourceBuffer::create(Ref<SourceBufferPrivate>&& sourceBufferPrivate, MediaSource& source)
171171
{
172-
auto sourceBuffer = adoptRef(*new SourceBuffer(WTF::move(sourceBufferPrivate), source));
172+
Ref sourceBuffer = adoptRef(*new SourceBuffer(WTF::move(sourceBufferPrivate), source));
173173
sourceBuffer->suspendIfNeeded();
174174
return sourceBuffer;
175175
}
@@ -929,7 +929,7 @@ Ref<MediaPromise> SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegme
929929
// FIXME: Implement steps 5.2.1-5.2.8.1 as per Editor's Draft 09 January 2015, and reorder this
930930
// 5.2.1 Let new audio track be a new AudioTrack object.
931931
// 5.2.2 Generate a unique ID and assign it to the id property on new video track.
932-
auto newAudioTrack = AudioTrack::create(protectedScriptExecutionContext().get(), Ref { *audioTrackInfo.track });
932+
Ref newAudioTrack = AudioTrack::create(protectedScriptExecutionContext().get(), Ref { *audioTrackInfo.track });
933933
newAudioTrack->addClient(*this);
934934
newAudioTrack->setSourceBuffer(this);
935935

@@ -976,7 +976,7 @@ Ref<MediaPromise> SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegme
976976
// FIXME: Implement steps 5.3.1-5.3.8.1 as per Editor's Draft 09 January 2015, and reorder this
977977
// 5.3.1 Let new video track be a new VideoTrack object.
978978
// 5.3.2 Generate a unique ID and assign it to the id property on new video track.
979-
auto newVideoTrack = VideoTrack::create(protectedScriptExecutionContext().get(), Ref { *videoTrackInfo.track });
979+
Ref newVideoTrack = VideoTrack::create(protectedScriptExecutionContext().get(), Ref { *videoTrackInfo.track });
980980
newVideoTrack->addClient(*this);
981981
newVideoTrack->setSourceBuffer(this);
982982

@@ -1020,24 +1020,24 @@ Ref<MediaPromise> SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegme
10201020

10211021
// 5.4 For each text track in the initialization segment, run following steps:
10221022
for (auto& textTrackInfo : segment.textTracks) {
1023-
auto& textTrackPrivate = *textTrackInfo.track;
1023+
Ref textTrackPrivate = *textTrackInfo.track;
10241024

10251025
// FIXME: Implement steps 5.4.1-5.4.8.1 as per Editor's Draft 09 January 2015, and reorder this
10261026
// 5.4.1 Let new text track be a new TextTrack object with its properties populated with the
10271027
// appropriate information from the initialization segment.
1028-
auto newTextTrack = InbandTextTrack::create(*protectedScriptExecutionContext(), textTrackPrivate);
1028+
Ref newTextTrack = InbandTextTrack::create(*protectedScriptExecutionContext(), textTrackPrivate);
10291029
newTextTrack->addClient(*this);
10301030

10311031
// 5.4.2 If the mode property on new text track equals "showing" or "hidden", then set active
10321032
// track flag to true.
1033-
if (textTrackPrivate.mode() != InbandTextTrackPrivate::Mode::Disabled)
1033+
if (textTrackPrivate->mode() != InbandTextTrackPrivate::Mode::Disabled)
10341034
activeTrackFlag = true;
10351035

10361036
// 5.4.3 Add new text track to the textTracks attribute on this SourceBuffer object.
10371037
// 5.4.4 Queue a task to fire a trusted event named addtrack, that does not bubble and is
10381038
// not cancelable, and that uses the TrackEvent interface, at textTracks attribute on this
10391039
// SourceBuffer object.
1040-
textTracks->append(newTextTrack.get());
1040+
textTracks->append(newTextTrack);
10411041

10421042
// 5.4.5 Add new text track to the textTracks attribute on the HTMLMediaElement.
10431043
// 5.4.6 Queue a task to fire a trusted event named addtrack, that does not bubble and is
@@ -1051,13 +1051,13 @@ Ref<MediaPromise> SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegme
10511051
// Let mirrored text track be a new TextTrack object.
10521052
// Assign the same property values to mirrored text track as were determined for new text track.
10531053
// Add mirrored text track to the textTracks attribute on the HTMLMediaElement.
1054-
source->addTextTrackMirrorToElement(textTrackPrivate);
1054+
source->addTextTrackMirrorToElement(textTrackPrivate.get());
10551055
}
10561056

10571057
m_textCodecs.append(RefPtr { textTrackInfo.description }->codec().toAtomString());
10581058

10591059
// 5.4.7 Create a new track buffer to store coded frames for this track.
1060-
m_private->addTrackBuffer(textTrackPrivate.id(), WTF::move(textTrackInfo.description));
1060+
m_private->addTrackBuffer(textTrackPrivate->id(), WTF::move(textTrackInfo.description));
10611061
}
10621062

10631063
// 5.5 If active track flag equals true, then run the following steps:
@@ -1405,11 +1405,11 @@ void SourceBuffer::updateBuffered()
14051405
if (isManaged()) {
14061406
auto addedRanges = m_buffered->ranges();
14071407
addedRanges -= oldRanges;
1408-
auto addedTimeRanges = TimeRanges::create(WTF::move(addedRanges));
1408+
Ref addedTimeRanges = TimeRanges::create(WTF::move(addedRanges));
14091409

14101410
auto removedRanges = oldRanges;
14111411
removedRanges -= m_buffered->ranges();
1412-
auto removedTimeRanges = TimeRanges::create(WTF::move(removedRanges));
1412+
Ref removedTimeRanges = TimeRanges::create(WTF::move(removedRanges));
14131413

14141414
queueTaskToDispatchEvent(*this, TaskSource::MediaElement, BufferedChangeEvent::create(WTF::move(addedTimeRanges), WTF::move(removedTimeRanges)));
14151415
}

Source/WebCore/SaferCPPExpectations/UncountedCallArgsCheckerExpectations

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Modules/mediasession/MediaMetadata.cpp
1010
Modules/mediasession/MediaSession.cpp
1111
[ Mac ] Modules/mediasession/MediaSessionCoordinator.cpp
1212
[ Mac ] Modules/mediasession/MediaSessionCoordinator.h
13-
Modules/mediasource/MediaSourceHandle.cpp
1413
Modules/mediastream/MediaStreamTrack.cpp
1514
Modules/mediastream/MediaStreamTrackProcessor.cpp
1615
Modules/mediastream/RTCDTMFSender.cpp
@@ -636,7 +635,6 @@ platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp
636635
platform/mediastream/mac/WebAudioSourceProviderCocoa.mm
637636
platform/mock/MockRealtimeVideoSource.cpp
638637
platform/mock/RTCNotifiersMock.cpp
639-
platform/mock/mediasource/MockMediaSourcePrivate.cpp
640638
platform/network/mac/ResourceHandleMac.mm
641639
platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm
642640
platform/text/BidiContext.cpp

Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Modules/mediacapabilities/MediaCapabilities.cpp
22
Modules/mediacontrols/MediaControlsHost.cpp
33
[ Mac ] Modules/mediasession/MediaSession.cpp
4-
Modules/mediasource/SourceBuffer.cpp
54
Modules/model-element/HTMLModelElement.cpp
65
Modules/webaudio/AudioBasicProcessorNode.cpp
76
Modules/webaudio/AudioBuffer.cpp

Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace WebCore {
3838

3939
Ref<MockMediaSourcePrivate> MockMediaSourcePrivate::create(MockMediaPlayerMediaSource& parent, MediaSourcePrivateClient& client)
4040
{
41-
auto source = adoptRef(*new MockMediaSourcePrivate(parent, client));
41+
Ref source = adoptRef(*new MockMediaSourcePrivate(parent, client));
4242
client.setPrivateAndOpen(source.copyRef());
4343
return source;
4444
}
@@ -47,12 +47,12 @@ MockMediaSourcePrivate::MockMediaSourcePrivate(MockMediaPlayerMediaSource& paren
4747
: MediaSourcePrivate(client)
4848
, m_player(parent)
4949
#if !RELEASE_LOG_DISABLED
50-
, m_logger(m_player->mediaPlayerLogger())
51-
, m_logIdentifier(m_player->mediaPlayerLogIdentifier())
50+
, m_logger(parent.mediaPlayerLogger())
51+
, m_logIdentifier(parent.mediaPlayerLogIdentifier())
5252
#endif
5353
{
5454
#if !RELEASE_LOG_DISABLED
55-
client.setLogIdentifier(m_player->mediaPlayerLogIdentifier());
55+
client.setLogIdentifier(parent.mediaPlayerLogIdentifier());
5656
#endif
5757
}
5858

@@ -89,14 +89,14 @@ void MockMediaSourcePrivate::setPlayer(MediaPlayerPrivateInterface* player)
8989
void MockMediaSourcePrivate::durationChanged(const MediaTime& duration)
9090
{
9191
MediaSourcePrivate::durationChanged(duration);
92-
if (m_player)
93-
m_player->updateDuration(duration);
92+
if (RefPtr player = m_player.get())
93+
player->updateDuration(duration);
9494
}
9595

9696
void MockMediaSourcePrivate::notifyActiveSourceBuffersChanged()
9797
{
98-
if (m_player)
99-
m_player->notifyActiveSourceBuffersChanged();
98+
if (RefPtr player = m_player.get())
99+
player->notifyActiveSourceBuffersChanged();
100100
}
101101

102102
std::optional<VideoPlaybackQualityMetrics> MockMediaSourcePrivate::videoPlaybackQualityMetrics()

0 commit comments

Comments
 (0)