Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 291e800aa6fc9d7fda5dc59c670d6430f48e085e
      
https://github.com/WebKit/WebKit/commit/291e800aa6fc9d7fda5dc59c670d6430f48e085e
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2025-11-17 (Mon, 17 Nov 2025)

  Changed paths:
    M Source/WebCore/Modules/mediasource/SourceBuffer.cpp
    M Source/WebCore/platform/graphics/SourceBufferPrivate.cpp
    M Source/WebCore/platform/graphics/SourceBufferPrivate.h
    M Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp
    M Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h

  Log Message:
  -----------
  Make SourceBufferPrivate's eviction calculation and query of buffer size 
thread-safe
https://bugs.webkit.org/show_bug.cgi?id=302396
rdar://164553410

Reviewed by Jer Noble.

The SourceBufferPrivateRemote mirrorred some of the base-class members but had
those atomics. We move it to the base class.
We also make the querying of the SourceBufferPrivate's eviction data thread-safe
and its calculation (via lock).

We also remove from SourceBufferPrivateRemote the thread-safe implementation
of timeStampOffset/setTimestampOffset in favour of the base class. This
allows to reduce differences between SourceBufferPrivateRemote and the
generic SourceBufferPrivate

No change in existing behaviours.
* Source/WebCore/Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::sourceBufferPrivateBufferedChanged):
* Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::removeCodedFramesInternal):
(WebCore::SourceBufferPrivate::setMaximumBufferSize):
(WebCore::SourceBufferPrivate::computeEvictionData):
(WebCore::SourceBufferPrivate::hasTooManySamples const):
(WebCore::SourceBufferPrivate::asyncEvictCodedFrames):
(WebCore::SourceBufferPrivate::evictCodedFrames):
(WebCore::SourceBufferPrivate::evictCodedFramesInternal):
(WebCore::SourceBufferPrivate::isBufferFullFor const):
(WebCore::SourceBufferPrivate::canAppend const):
(WebCore::SourceBufferPrivate::evictionData const):
(WebCore::SourceBufferPrivate::contentSize const):
* Source/WebCore/platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::evictionData const): Deleted.
* Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
(WebKit::SourceBufferPrivateRemote::setMaximumBufferSize):
(WebKit::SourceBufferPrivateRemote::totalTrackBufferSizeInBytes const): Deleted.
(WebKit::SourceBufferPrivateRemote::isBufferFullFor const): Deleted.
(WebKit::SourceBufferPrivateRemote::canAppend const): Deleted.
* Source/WebKit/WebProcess/GPU/media/SourceBufferPrivateRemote.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to