[webkit-changes] [WebKit/WebKit] a72b93: CARingBuffer has two implementations for almost th...

Kimmo Kinnunen noreply at github.com
Thu Nov 10 23:15:47 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a72b93ec11fdf094188844a9e2218bd227c4c156
      https://github.com/WebKit/WebKit/commit/a72b93ec11fdf094188844a9e2218bd227c4c156
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2022-11-10 (Thu, 10 Nov 2022)

  Changed paths:
    M Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm
    M Source/WebCore/platform/audio/cocoa/CARingBuffer.cpp
    M Source/WebCore/platform/audio/cocoa/CARingBuffer.h
    M Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm
    M Source/WebKit/Shared/Cocoa/SharedCARingBuffer.cpp
    M Source/WebKit/Shared/Cocoa/SharedCARingBuffer.h
    M Tools/TestWebKitAPI/Tests/WebCore/CARingBuffer.cpp

  Log Message:
  -----------
  CARingBuffer has two implementations for almost the same thing
https://bugs.webkit.org/show_bug.cgi?id=247721

Reviewed by Eric Carlson.

The CARingBuffer implementations duplicate the underlying
parallel operation logic.

Move the WebKit side implementation to CARingBuffer and delete
the WebCore side implementation. WebKit side is a bit more
correct.

This way the WebKit code is tested by the CARingBufferTests.

Change the implementation slightly to account that there are
"fetch bounds" and "store bounds":
 getStoreTimeBounds()
 getFetchTimeBounds()

The fetch time bounds are shared across potentially untrusted
processes, and as such should not be used unless needed.
Answering the question "What time range did I store previously?"
is a question involving local information, since there is just
one producer. This means that it can be fulfilled with the
local store time bounds and should not be loaded from the
shared memory.

Removes CARingBuffer::flush() since that is just used to
initialize the shared time bounds storage. This logic is
in the constructors of the types now.

Removes CARingBuffer::size(), it is an unused function.

* Source/WebCore/platform/audio/cocoa/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::pullSamples):
(WebCore::AudioSampleDataSource::pullAvailableSamplesAsChunks):
* Source/WebCore/platform/audio/cocoa/CARingBuffer.cpp:
(WebCore::CARingBuffer::initialize):
(WebCore::CARingBuffer::setTimeBounds):
(WebCore::CARingBuffer::getStoreTimeBounds):
(WebCore::CARingBuffer::store):
(WebCore::CARingBuffer::getFetchTimeBounds):
(WebCore::clamp):
(WebCore::CARingBuffer::fetchIfHasEnoughData):
(WebCore::CARingBuffer::fetch):
(WebCore::CARingBuffer::fetchInternal):
(WebCore::InProcessCARingBuffer::InProcessCARingBuffer):
(WebCore::CARingBuffer::getCurrentFrameBounds): Deleted.
(WebCore::CARingBuffer::clipTimeBounds): Deleted.
(WebCore::InProcessCARingBuffer::flush): Deleted.
(WebCore::InProcessCARingBuffer::setCurrentFrameBounds): Deleted.
(WebCore::InProcessCARingBuffer::getCurrentFrameBoundsWithoutUpdate): Deleted.
(WebCore::InProcessCARingBuffer::currentStartFrame const): Deleted.
(WebCore::InProcessCARingBuffer::currentEndFrame const): Deleted.
* Source/WebCore/platform/audio/cocoa/CARingBuffer.h:
(WebCore::CARingBuffer::updateFrameBounds): Deleted.
* Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::provideInput):
(WebCore::AudioSourceProviderAVFObjC::process):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
* Source/WebKit/Shared/Cocoa/SharedCARingBuffer.cpp:
(WebKit::ConsumerSharedCARingBuffer::map):
(WebKit::ProducerSharedCARingBuffer::allocate):
(WebKit::SharedCARingBufferBase::data): Deleted.
(WebKit::SharedCARingBufferBase::sharedFrameBounds const): Deleted.
(WebKit::SharedCARingBufferBase::getCurrentFrameBoundsWithoutUpdate): Deleted.
(WebKit::SharedCARingBufferBase::flush): Deleted.
(WebKit::SharedCARingBufferBase::updateFrameBounds): Deleted.
(WebKit::SharedCARingBufferBase::size const): Deleted.
(WebKit::ProducerSharedCARingBuffer::setCurrentFrameBounds): Deleted.
* Source/WebKit/Shared/Cocoa/SharedCARingBuffer.h:
* Tools/TestWebKitAPI/Tests/WebCore/CARingBuffer.cpp:
(TestWebKitAPI::makeBounds):
(TestWebKitAPI::TEST_F):

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




More information about the webkit-changes mailing list