-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop SharedBuffer::data() in favor of span() #28798
Drop SharedBuffer::data() in favor of span() #28798
Conversation
EWS run on previous version of this PR (hash 9ce861b) |
9ce861b
to
34a8c16
Compare
EWS run on previous version of this PR (hash 34a8c16) |
34a8c16
to
5a3cbf7
Compare
EWS run on previous version of this PR (hash 5a3cbf7) |
5a3cbf7
to
aefcd8d
Compare
EWS run on previous version of this PR (hash aefcd8d) |
aefcd8d
to
ce4ad6f
Compare
EWS run on previous version of this PR (hash ce4ad6f) |
ce4ad6f
to
0a5a21a
Compare
EWS run on previous version of this PR (hash 0a5a21a) |
0a5a21a
to
4192bfd
Compare
EWS run on previous version of this PR (hash 4192bfd) |
4192bfd
to
9a81e8d
Compare
EWS run on previous version of this PR (hash 9a81e8d) |
9a81e8d
to
cd56adf
Compare
EWS run on previous version of this PR (hash cd56adf) |
47a14e8
to
2bea767
Compare
EWS run on previous version of this PR (hash 2bea767) |
2bea767
to
3f48b51
Compare
EWS run on previous version of this PR (hash 3f48b51) |
3f48b51
to
f21d320
Compare
EWS run on previous version of this PR (hash f21d320) |
f21d320
to
51f341f
Compare
EWS run on previous version of this PR (hash 51f341f) |
51f341f
to
9079799
Compare
EWS run on current version of this PR (hash 9079799) |
@@ -194,7 +194,7 @@ std::optional<Vector<Ref<SharedBuffer>>> InitDataRegistry::extractKeyIDsCenc(con | |||
#if USE(GSTREAMER) | |||
bool isPlayReadySanitizedInitializationData(const SharedBuffer& buffer) | |||
{ | |||
const char* protectionData = buffer.dataAsCharPtr(); | |||
auto* protectionData = reinterpret_cast<const char*>(buffer.span().data()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, I really have to get my byteCast
in.
|
||
auto sendRight = makeMemoryEntry(size, toVMAddress(data), protection, MACH_PORT_NULL); | ||
auto sendRight = makeMemoryEntry(data.size(), toVMAddress(static_cast<void*>(const_cast<uint8_t*>(data.data()))), protection, MACH_PORT_NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that static_cast
really needed?
@@ -4428,7 +4428,7 @@ void MediaPlayerPrivateGStreamer::initializationDataEncountered(InitData&& initD | |||
|
|||
GST_DEBUG("scheduling initializationDataEncountered %s event of size %zu", initData.payloadContainerType().utf8().data(), | |||
initData.payload()->size()); | |||
GST_MEMDUMP("init datas", reinterpret_cast<const uint8_t*>(initData.payload()->makeContiguous()->data()), initData.payload()->size()); | |||
GST_MEMDUMP("init datas", reinterpret_cast<const uint8_t*>(initData.payload()->makeContiguous()->span().data()), initData.payload()->size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why reinterpret_cast
here? What type are we casting from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look needed indeed.
@@ -98,7 +98,7 @@ Ref<MediaPromise> SourceBufferPrivateGStreamer::appendInternal(Ref<SharedBuffer> | |||
|
|||
ASSERT(!m_appendPromise); | |||
m_appendPromise.emplace(); | |||
gpointer bufferData = const_cast<void*>(static_cast<const void*>(data->data())); | |||
gpointer bufferData = const_cast<void*>(static_cast<const void*>(data->span().data())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should only need const_cast
, not two casts, here.
https://bugs.webkit.org/show_bug.cgi?id=274401 Reviewed by Darin Adler. * Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::sanitizeKeyids): * Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp: (WebCore::keyIdsMatch): (WebCore::MediaKeyStatusMap::Iterator::next): * Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp: (WebCore::FetchBodyConsumer::consumeFormDataAsStream): * Source/WebCore/bindings/js/WebAssemblyCachedScriptSourceProvider.h: * Source/WebCore/bindings/js/WebAssemblyScriptBufferSourceProvider.h: * Source/WebCore/fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::didReceiveData): * Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::didReceiveData): * Source/WebCore/loader/DocumentLoader.cpp: (WebCore::DocumentLoader::dataReceived): * Source/WebCore/platform/SharedBuffer.cpp: (WebCore::SharedBufferDataView::createSharedBuffer const): * Source/WebCore/platform/SharedBuffer.h: (WebCore::SharedBufferDataView::span const): (WebCore::SharedBuffer::dataAsCharPtr const): Deleted. (WebCore::SharedBufferDataView::data const): Deleted. (WebCore::SharedBufferDataView::dataAsCharPtr const): Deleted. * Source/WebCore/platform/SharedMemory.h: (WebCore::SharedMemory::wrapMap): * Source/WebCore/platform/cocoa/MediaUtilities.cpp: (WebCore::createAudioFormatDescription): * Source/WebCore/platform/cocoa/MediaUtilities.h: (WebCore::createAudioFormatDescription): * Source/WebCore/platform/cocoa/SharedBufferCocoa.mm: (-[WebCoreSharedBufferData bytes]): * Source/WebCore/platform/cocoa/SharedMemoryCocoa.cpp: (WebCore::SharedMemory::wrapMap): * Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::extractKeyidsLocationFromCencInitData): (WebCore::extractKeyidsFromCencInitData): (WebCore::extractKeyIdFromWebMInitData): * Source/WebCore/platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::setSize): (WebCore::ImageBackingStore::ImageBackingStore): * Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests): * Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::decodeUTI): * Source/WebCore/platform/graphics/cocoa/CMUtilities.mm: (WebCore::createAudioFormatDescription): (WebCore::PacketDurationParser::PacketDurationParser): * Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::WebMParser::VideoTrackData::consumeFrameData): * Source/WebCore/platform/graphics/opentype/OpenTypeTypes.h: (WebCore::OpenType::validateTable): (WebCore::OpenType::TableBase::isValidEnd): * Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp: * Source/WebCore/platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::readDataSync): * Source/WebCore/workers/ScriptBuffer.cpp: (WebCore::tryConvertToShareableResourceHandle): * Source/WebCore/xml/XSLTProcessorLibxslt.cpp: (WebCore::docLoaderFunc): * Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded): * Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorder.cpp: (WebKit::RemoteMediaRecorder::fetchData): * Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::readData): * Source/WebKit/NetworkProcess/storage/BackgroundFetchStoreImpl.cpp: (WebKit::BackgroundFetchStoreImpl::initializeFetches): * Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.cpp: (WebKit::CacheStorageDiskStore::readRecordFromFileData): * Source/WebKit/Platform/IPC/SharedBufferReference.cpp: (IPC::SharedBufferReference::data const): * Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp: (API::getData): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadAlternateHTML): * Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm: (WebKit::PDFPluginBase::streamDidReceiveData): * Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp: (WebKit::WebLocalFrameLoaderClient::finishedLoading): Canonical link: https://commits.webkit.org/279097@main
9079799
to
24db6e6
Compare
Committed 279097@main (24db6e6): https://commits.webkit.org/279097@main Reviewed commits have been landed. Closing PR #28798 and removing active labels. |
Looks like I failed to upload my local follow-up changes (to address review comments) before merging the PR. I'm following up in #28895. |
24db6e6
9079799
π§ͺ wincairo-tests