source: webkit/trunk/Source/WebCore/css/CSSFontFaceSource.cpp

Last change on this file was 287021, checked in by Jean-Yves Avenard, 3 years ago

PerformanceTests:
Distinguish contiguous SharedBuffer from non-contiguous one and guarantee immutability: part 3
https://bugs.webkit.org/show_bug.cgi?id=233677

Reviewed by Youenn Fablet.

  • DecoderTest/DecoderTest/main.mm:

(main):

Source/JavaScriptCore:
Rename SharedBuffer classes.
https://bugs.webkit.org/show_bug.cgi?id=233677
rdar://problem/85963900

Reviewed by Youenn Fablet.

SharedBuffer are renamed FragmentedSharedBuffer and
ContiguousSharedBuffer to SharedBuffer to better reflect their actual
types.

  • runtime/ArrayBuffer.h:

Source/WebCore:
Rename SharedBuffer classes.
https://bugs.webkit.org/show_bug.cgi?id=233677
rdar://problem/85963900

Reviewed by Youenn Fablet.

SharedBuffer are renamed FragmentedSharedBuffer and
ContiguousSharedBuffer to SharedBuffer to better reflect their actual
types.

Rename only, no change in behaviour.

  • Modules/async-clipboard/ClipboardImageReader.cpp:
  • Modules/async-clipboard/ClipboardImageReader.h:
  • Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
  • Modules/async-clipboard/ClipboardItemBindingsDataSource.h:
  • Modules/async-clipboard/ios/ClipboardImageReaderIOS.mm:
  • Modules/async-clipboard/mac/ClipboardImageReaderMac.mm:
  • Modules/cache/CacheStorageConnection.cpp:
  • Modules/cache/DOMCache.cpp:
  • Modules/cache/DOMCache.h:
  • Modules/cache/DOMCacheEngine.cpp:
  • Modules/cache/DOMCacheEngine.h:
  • Modules/encryptedmedia/CDM.cpp:
  • Modules/encryptedmedia/CDM.h:
  • Modules/encryptedmedia/CDMClient.h:
  • Modules/encryptedmedia/InitDataRegistry.cpp:
  • Modules/encryptedmedia/InitDataRegistry.h:
  • Modules/encryptedmedia/MediaKeySession.cpp:
  • Modules/encryptedmedia/MediaKeySession.h:
  • Modules/encryptedmedia/MediaKeyStatusMap.cpp:
  • Modules/encryptedmedia/MediaKeyStatusMap.h:
  • Modules/encryptedmedia/MediaKeys.cpp:
  • Modules/encryptedmedia/MediaKeys.h:
  • Modules/fetch/FetchBody.cpp:
  • Modules/fetch/FetchBody.h:
  • Modules/fetch/FetchBodyConsumer.cpp:
  • Modules/fetch/FetchBodyConsumer.h:
  • Modules/fetch/FetchLoader.cpp:
  • Modules/fetch/FetchLoader.h:
  • Modules/fetch/FetchResponse.cpp:
  • Modules/fetch/FetchResponse.h:
  • Modules/highlight/AppHighlight.h:
  • Modules/highlight/AppHighlightRangeData.cpp:
  • Modules/highlight/AppHighlightRangeData.h:
  • Modules/highlight/AppHighlightStorage.cpp:
  • Modules/highlight/AppHighlightStorage.h:
  • Modules/indexeddb/server/IDBSerialization.cpp:
  • Modules/indexeddb/server/IDBSerialization.h:
  • Modules/mediarecorder/MediaRecorder.cpp:
  • Modules/mediarecorder/MediaRecorder.h:
  • Modules/mediasession/MediaMetadata.cpp:
  • Modules/mediasource/SourceBuffer.cpp:
  • Modules/mediasource/SourceBuffer.h:
  • Modules/mediastream/RTCDataChannelRemoteHandler.h:
  • Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
  • Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
  • Modules/streams/ReadableStreamSink.h:
  • bindings/js/JSDOMGlobalObject.cpp:
  • bindings/js/ScriptBufferSourceProvider.h:
  • bindings/js/SerializedScriptValue.h:
  • css/CSSFontFaceSource.cpp:
  • css/CSSFontFaceSource.h:
  • dom/DataTransfer.cpp:
  • editing/Editor.cpp:
  • editing/Editor.h:
  • editing/SerializedAttachmentData.h:
  • editing/WebContentReader.h:
  • editing/WebCorePasteboardFileReader.cpp:
  • editing/WebCorePasteboardFileReader.h:
  • editing/cocoa/EditorCocoa.mm:
  • editing/cocoa/HTMLConverter.mm:
  • editing/cocoa/WebContentReaderCocoa.mm:
  • editing/gtk/WebContentReaderGtk.cpp:
  • editing/mac/EditorMac.mm:
  • fileapi/Blob.h:
  • fileapi/NetworkSendQueue.cpp:
  • fileapi/NetworkSendQueue.h:
  • html/FTPDirectoryDocument.cpp:
  • html/HTMLAttachmentElement.cpp:
  • html/HTMLAttachmentElement.h:
  • html/HTMLMediaElement.cpp:
  • html/HTMLMediaElement.h:
  • html/ImageDocument.cpp:
  • inspector/InspectorInstrumentation.cpp:
  • inspector/InspectorInstrumentation.h:
  • inspector/InspectorInstrumentationWebKit.cpp:
  • inspector/InspectorInstrumentationWebKit.h:
  • inspector/NetworkResourcesData.cpp:
  • inspector/NetworkResourcesData.h:
  • inspector/agents/InspectorNetworkAgent.cpp:
  • inspector/agents/InspectorNetworkAgent.h:
  • inspector/agents/InspectorPageAgent.cpp:
  • inspector/agents/InspectorPageAgent.h:
  • loader/ContentFilter.cpp:
  • loader/CrossOriginPreflightChecker.cpp:
  • loader/DocumentLoader.cpp:
  • loader/DocumentLoader.h:
  • loader/DocumentThreadableLoader.cpp:
  • loader/EmptyClients.cpp:
  • loader/FrameLoader.cpp:
  • loader/FrameLoader.h:
  • loader/FrameLoaderClient.h:
  • loader/LoaderStrategy.h:
  • loader/NetscapePlugInStreamLoader.cpp:
  • loader/NetscapePlugInStreamLoader.h:
  • loader/ResourceCryptographicDigest.cpp:
  • loader/ResourceCryptographicDigest.h:
  • loader/ResourceLoader.cpp:
  • loader/ResourceLoader.h:
  • loader/SubresourceLoader.cpp:
  • loader/SubresourceLoader.h:
  • loader/SubstituteData.h:
  • loader/SubstituteResource.h:
  • loader/appcache/ApplicationCacheHost.cpp:
  • loader/appcache/ApplicationCacheHost.h:
  • loader/appcache/ApplicationCacheResource.cpp:
  • loader/appcache/ApplicationCacheResource.h:
  • loader/appcache/ApplicationCacheStorage.cpp:
  • loader/appcache/ApplicationCacheStorage.h:
  • loader/archive/ArchiveFactory.cpp:
  • loader/archive/ArchiveFactory.h:
  • loader/archive/ArchiveResource.cpp:
  • loader/archive/ArchiveResource.h:
  • loader/archive/cf/LegacyWebArchive.cpp:
  • loader/archive/cf/LegacyWebArchive.h:
  • loader/archive/mhtml/MHTMLArchive.cpp:
  • loader/archive/mhtml/MHTMLArchive.h:
  • loader/archive/mhtml/MHTMLParser.cpp:
  • loader/archive/mhtml/MHTMLParser.h:
  • loader/cache/CachedApplicationManifest.cpp:
  • loader/cache/CachedApplicationManifest.h:
  • loader/cache/CachedCSSStyleSheet.cpp:
  • loader/cache/CachedCSSStyleSheet.h:
  • loader/cache/CachedFont.cpp:
  • loader/cache/CachedFont.h:
  • loader/cache/CachedImage.cpp:
  • loader/cache/CachedImage.h:
  • loader/cache/CachedRawResource.cpp:
  • loader/cache/CachedRawResource.h:
  • loader/cache/CachedResource.cpp:
  • loader/cache/CachedResource.h:
  • loader/cache/CachedSVGDocument.cpp:
  • loader/cache/CachedSVGDocument.h:
  • loader/cache/CachedSVGFont.cpp:
  • loader/cache/CachedSVGFont.h:
  • loader/cache/CachedScript.cpp:
  • loader/cache/CachedScript.h:
  • loader/cache/CachedTextTrack.cpp:
  • loader/cache/CachedTextTrack.h:
  • loader/cache/CachedXSLStyleSheet.cpp:
  • loader/cache/CachedXSLStyleSheet.h:
  • loader/cocoa/DiskCacheMonitorCocoa.h:
  • loader/cocoa/DiskCacheMonitorCocoa.mm:
  • loader/ios/LegacyPreviewLoader.h:
  • loader/ios/LegacyPreviewLoader.mm:
  • page/EditorClient.h:
  • page/Page.cpp:
  • page/PageSerializer.cpp:
  • page/PageSerializer.h:
  • page/ShareData.h:
  • page/ShareDataReader.cpp:
  • platform/KeyedCoding.h:
  • platform/NowPlayingManager.h:
  • platform/Pasteboard.cpp:
  • platform/Pasteboard.h:
  • platform/PasteboardCustomData.cpp:
  • platform/PasteboardCustomData.h:
  • platform/PasteboardStrategy.h:
  • platform/PasteboardWriterData.h:
  • platform/PlatformContentFilter.h:
  • platform/PlatformPasteboard.h:
  • platform/PreviewConverter.cpp:
  • platform/PreviewConverter.h:
  • platform/PreviewConverterClient.h:
  • platform/PreviewConverterProvider.h:
  • platform/PromisedAttachmentInfo.h:
  • platform/SharedBuffer.cpp:
  • platform/SharedBuffer.h:
  • platform/SharedBufferChunkReader.cpp:
  • platform/SharedBufferChunkReader.h:
  • platform/StaticPasteboard.cpp:
  • platform/StaticPasteboard.h:
  • platform/audio/NowPlayingInfo.h:
  • platform/audio/cocoa/AudioFileReaderCocoa.cpp:
  • platform/cf/KeyedEncoderCF.cpp:
  • platform/cf/KeyedEncoderCF.h:
  • platform/cf/SharedBufferCF.cpp:
  • platform/cocoa/NetworkExtensionContentFilter.h:
  • platform/cocoa/NetworkExtensionContentFilter.mm:
  • platform/cocoa/ParentalControlsContentFilter.h:
  • platform/cocoa/ParentalControlsContentFilter.mm:
  • platform/cocoa/PasteboardCocoa.mm:
  • platform/cocoa/SharedBufferCocoa.mm:
  • platform/encryptedmedia/CDMInstance.h:
  • platform/encryptedmedia/CDMInstanceSession.h:
  • platform/encryptedmedia/CDMPrivate.h:
  • platform/encryptedmedia/CDMProxy.cpp:
  • platform/encryptedmedia/CDMProxy.h:
  • platform/encryptedmedia/CDMUtilities.cpp:
  • platform/encryptedmedia/CDMUtilities.h:
  • platform/encryptedmedia/clearkey/CDMClearKey.cpp:
  • platform/encryptedmedia/clearkey/CDMClearKey.h:
  • platform/generic/KeyedEncoderGeneric.cpp:
  • platform/generic/KeyedEncoderGeneric.h:
  • platform/glib/KeyedEncoderGlib.cpp:
  • platform/glib/KeyedEncoderGlib.h:
  • platform/glib/SharedBufferGlib.cpp:
  • platform/graphics/Font.cpp:
  • platform/graphics/Font.h:
  • platform/graphics/FontPlatformData.h:
  • platform/graphics/Image.cpp:
  • platform/graphics/Image.h:
  • platform/graphics/ImageBackingStore.h:
  • platform/graphics/ImageDecoder.cpp:
  • platform/graphics/ImageDecoder.h:
  • platform/graphics/ImageSource.cpp:
  • platform/graphics/ImageSource.h:
  • platform/graphics/Model.cpp:
  • platform/graphics/Model.h:
  • platform/graphics/PlatformMediaResourceLoader.h:
  • platform/graphics/SourceBufferPrivate.cpp:
  • platform/graphics/SourceBufferPrivate.h:
  • platform/graphics/WOFFFileFormat.cpp:
  • platform/graphics/WOFFFileFormat.h:
  • platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
  • platform/graphics/avfoundation/CDMFairPlayStreaming.h:
  • platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
  • platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
  • platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
  • platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
  • platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
  • platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
  • platform/graphics/cairo/FontCustomPlatformData.h:
  • platform/graphics/cg/ImageDecoderCG.cpp:
  • platform/graphics/cg/ImageDecoderCG.h:
  • platform/graphics/cocoa/FontPlatformDataCocoa.mm:
  • platform/graphics/cocoa/SourceBufferParser.cpp:
  • platform/graphics/cocoa/SourceBufferParser.h:
  • platform/graphics/cocoa/SourceBufferParserWebM.cpp:
  • platform/graphics/coretext/FontPlatformDataCoreText.cpp:
  • platform/graphics/displaylists/DisplayListItemBuffer.cpp:
  • platform/graphics/displaylists/DisplayListItemBuffer.h:
  • platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
  • platform/graphics/freetype/FontPlatformDataFreeType.cpp:
  • platform/graphics/gstreamer/GStreamerCommon.cpp:
  • platform/graphics/gstreamer/GStreamerCommon.h:
  • platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
  • platform/graphics/gstreamer/ImageDecoderGStreamer.h:
  • platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
  • platform/graphics/gstreamer/eme/CDMProxyClearKey.h:
  • platform/graphics/gstreamer/eme/CDMThunder.cpp:
  • platform/graphics/gstreamer/eme/CDMThunder.h:
  • platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
  • platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
  • platform/graphics/mac/FontCustomPlatformData.cpp:
  • platform/graphics/mac/FontCustomPlatformData.h:
  • platform/graphics/opentype/OpenTypeMathData.cpp:
  • platform/graphics/opentype/OpenTypeMathData.h:
  • platform/graphics/opentype/OpenTypeTypes.h:
  • platform/graphics/opentype/OpenTypeUtilities.cpp:
  • platform/graphics/opentype/OpenTypeUtilities.h:
  • platform/graphics/opentype/OpenTypeVerticalData.cpp:
  • platform/graphics/win/DirectWriteUtilities.h:
  • platform/graphics/win/FontCustomPlatformData.cpp:
  • platform/graphics/win/FontCustomPlatformData.h:
  • platform/graphics/win/FontCustomPlatformDataCairo.cpp:
  • platform/graphics/win/FontPlatformDataCairoWin.cpp:
  • platform/graphics/win/FontPlatformDataWin.cpp:
  • platform/graphics/win/ImageDecoderDirect2D.cpp:
  • platform/graphics/win/ImageDecoderDirect2D.h:
  • platform/graphics/win/ImageWin.cpp:
  • platform/gtk/SelectionData.h:
  • platform/image-decoders/ScalableImageDecoder.cpp:
  • platform/image-decoders/ScalableImageDecoder.h:
  • platform/image-decoders/avif/AVIFImageReader.cpp:
  • platform/image-decoders/avif/AVIFImageReader.h:
  • platform/image-decoders/bmp/BMPImageDecoder.cpp:
  • platform/image-decoders/bmp/BMPImageDecoder.h:
  • platform/image-decoders/bmp/BMPImageReader.h:
  • platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
  • platform/image-decoders/gif/GIFImageDecoder.cpp:
  • platform/image-decoders/gif/GIFImageDecoder.h:
  • platform/image-decoders/gif/GIFImageReader.h:
  • platform/image-decoders/ico/ICOImageDecoder.cpp:
  • platform/image-decoders/ico/ICOImageDecoder.h:
  • platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
  • platform/image-decoders/jpeg/JPEGImageDecoder.h:
  • platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp:
  • platform/image-decoders/png/PNGImageDecoder.cpp:
  • platform/image-decoders/webp/WEBPImageDecoder.cpp:
  • platform/image-decoders/webp/WEBPImageDecoder.h:
  • platform/ios/PasteboardIOS.mm:
  • platform/ios/PlatformPasteboardIOS.mm:
  • platform/mac/PasteboardMac.mm:
  • platform/mac/PlatformPasteboardMac.mm:
  • platform/mediarecorder/MediaRecorderPrivate.h:
  • platform/mediarecorder/MediaRecorderPrivateMock.cpp:
  • platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
  • platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
  • platform/network/DataURLDecoder.h:
  • platform/network/FormData.cpp:
  • platform/network/FormData.h:
  • platform/network/ResourceHandle.h:
  • platform/network/ResourceHandleClient.cpp:
  • platform/network/ResourceHandleClient.h:
  • platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
  • platform/network/cocoa/RangeResponseGenerator.mm:
  • platform/network/cocoa/WebCoreNSURLSession.h:
  • platform/network/cocoa/WebCoreNSURLSession.mm:
  • platform/network/curl/CurlDownload.cpp:
  • platform/network/curl/CurlDownload.h:
  • platform/network/curl/CurlMultipartHandle.cpp:
  • platform/network/curl/CurlMultipartHandle.h:
  • platform/network/curl/CurlMultipartHandleClient.h:
  • platform/network/curl/CurlRequest.cpp:
  • platform/network/curl/CurlRequest.h:
  • platform/network/curl/CurlRequestClient.h:
  • platform/network/curl/CurlResourceHandleDelegate.cpp:
  • platform/network/curl/CurlResourceHandleDelegate.h:
  • platform/network/ios/LegacyPreviewLoaderClient.h:
  • platform/posix/SharedBufferPOSIX.cpp:
  • platform/win/PasteboardWin.cpp:
  • platform/win/SharedBufferWin.cpp:
  • testing/MockCDMFactory.cpp:
  • testing/MockCDMFactory.h:
  • testing/MockContentFilter.cpp:
  • testing/MockContentFilter.h:
  • workers/ScriptBuffer.h:
  • workers/WorkerFontLoadRequest.cpp:
  • workers/service/context/ServiceWorkerFetch.cpp:
  • workers/service/context/ServiceWorkerFetch.h:
  • workers/service/server/SWScriptStorage.cpp:
  • xml/XSLTProcessorLibxslt.cpp:
  • xml/parser/XMLDocumentParserLibxml2.cpp:

Source/WebKit:
Rename SharedBuffer classes.
https://bugs.webkit.org/show_bug.cgi?id=233677
rdar://problem/85963900

Reviewed by Youenn Fablet.

SharedBuffer are renamed FragmentedSharedBuffer and
ContiguousSharedBuffer to SharedBuffer to better reflect their actual
types.

  • GPUProcess/media/RemoteCDMInstanceProxy.cpp:
  • GPUProcess/media/RemoteCDMInstanceProxy.h:
  • GPUProcess/media/RemoteCDMInstanceSessionProxy.cpp:
  • GPUProcess/media/RemoteCDMInstanceSessionProxy.h:
  • GPUProcess/media/RemoteCDMProxy.cpp:
  • GPUProcess/media/RemoteCDMProxy.h:
  • GPUProcess/media/RemoteLegacyCDMProxy.h:
  • GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp:
  • GPUProcess/media/RemoteLegacyCDMSessionProxy.h:
  • GPUProcess/media/RemoteMediaResource.cpp:
  • GPUProcess/media/RemoteMediaResource.h:
  • GPUProcess/webrtc/RemoteMediaRecorder.cpp:
  • NetworkProcess/Downloads/PendingDownload.h:
  • NetworkProcess/NetworkCORSPreflightChecker.cpp:
  • NetworkProcess/NetworkCORSPreflightChecker.h:
  • NetworkProcess/NetworkDataTask.h:
  • NetworkProcess/NetworkLoad.cpp:
  • NetworkProcess/NetworkLoad.h:
  • NetworkProcess/NetworkLoadClient.h:
  • NetworkProcess/NetworkResourceLoader.cpp:
  • NetworkProcess/NetworkResourceLoader.h:
  • NetworkProcess/PingLoad.cpp:
  • NetworkProcess/PingLoad.h:
  • NetworkProcess/PreconnectTask.cpp:
  • NetworkProcess/PreconnectTask.h:
  • NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp:
  • NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h:
  • NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
  • NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h:
  • NetworkProcess/cache/CacheStorageEngineCache.cpp:
  • NetworkProcess/cache/NetworkCache.cpp:
  • NetworkProcess/cache/NetworkCache.h:
  • NetworkProcess/cache/NetworkCacheEntry.cpp:
  • NetworkProcess/cache/NetworkCacheEntry.h:
  • NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
  • NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
  • NetworkProcess/cache/PrefetchCache.cpp:
  • NetworkProcess/cache/PrefetchCache.h:
  • NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
  • NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
  • NetworkProcess/curl/NetworkDataTaskCurl.cpp:
  • NetworkProcess/curl/NetworkDataTaskCurl.h:
  • NetworkProcess/soup/NetworkDataTaskSoup.cpp:
  • NetworkProcess/webrtc/NetworkRTCProvider.h:
  • Platform/IPC/SharedBufferCopy.cpp:
  • Platform/IPC/SharedBufferCopy.h:
  • Platform/IPC/SharedBufferDataReference.h:
  • Platform/SharedMemory.cpp:
  • Platform/SharedMemory.h:
  • Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
  • Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp:
  • Shared/ShareableResource.cpp:
  • Shared/ShareableResource.h:
  • Shared/WebCoreArgumentCoders.cpp:
  • Shared/WebCoreArgumentCoders.h:
  • Shared/WebHitTestResultData.cpp:
  • Shared/gtk/ArgumentCodersGtk.cpp:
  • Shared/win/WebCoreArgumentCodersWin.cpp:
  • UIProcess/API/APIAttachment.cpp:
  • UIProcess/API/APIAttachment.h:
  • UIProcess/API/APIContentRuleListStore.cpp:
  • UIProcess/API/APIContentRuleListStore.h:
  • UIProcess/API/APINavigationClient.h:
  • UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
  • UIProcess/API/gtk/DropTargetGtk3.cpp:
  • UIProcess/Cocoa/NavigationState.h:
  • UIProcess/Cocoa/NavigationState.mm:
  • UIProcess/Cocoa/WebProcessProxyCocoa.mm:
  • UIProcess/Cocoa/WebViewImpl.h:
  • UIProcess/Cocoa/WebViewImpl.mm:
  • UIProcess/PageClient.h:
  • UIProcess/WebPageProxy.h:
  • UIProcess/WebURLSchemeTask.cpp:
  • UIProcess/WebURLSchemeTask.h:
  • UIProcess/gtk/Clipboard.h:
  • UIProcess/gtk/ClipboardGtk3.cpp:
  • UIProcess/gtk/ClipboardGtk4.cpp:
  • UIProcess/ios/PageClientImplIOS.h:
  • UIProcess/ios/PageClientImplIOS.mm:
  • UIProcess/ios/WKContentViewInteraction.mm:
  • UIProcess/ios/WebPageProxyIOS.mm:
  • UIProcess/mac/PageClientImplMac.h:
  • UIProcess/mac/PageClientImplMac.mm:
  • UIProcess/mac/WebPageProxyMac.mm:
  • WebProcess/GPU/media/RemoteCDM.cpp:
  • WebProcess/GPU/media/RemoteCDM.h:
  • WebProcess/GPU/media/RemoteCDMInstance.cpp:
  • WebProcess/GPU/media/RemoteCDMInstance.h:
  • WebProcess/GPU/media/RemoteCDMInstanceSession.cpp:
  • WebProcess/GPU/media/RemoteCDMInstanceSession.h:
  • WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
  • WebProcess/GPU/media/RemoteImageDecoderAVF.h:
  • WebProcess/GPU/media/RemoteImageDecoderAVFManager.cpp:
  • WebProcess/GPU/media/RemoteImageDecoderAVFManager.h:
  • WebProcess/GPU/media/RemoteLegacyCDMSession.cpp:
  • WebProcess/GPU/media/SourceBufferPrivateRemote.cpp:
  • WebProcess/GPU/media/SourceBufferPrivateRemote.h:
  • WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
  • WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
  • WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
  • WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
  • WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
  • WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
  • WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
  • WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
  • WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
  • WebProcess/Network/NetworkProcessConnection.cpp:
  • WebProcess/Network/WebResourceLoader.cpp:
  • WebProcess/Plugins/PDF/PDFPlugin.h:
  • WebProcess/Plugins/PDF/PDFPlugin.mm:
  • WebProcess/Plugins/Plugin.h:
  • WebProcess/Plugins/PluginView.cpp:
  • WebProcess/Plugins/PluginView.h:
  • WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
  • WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
  • WebProcess/WebCoreSupport/WebEditorClient.cpp:
  • WebProcess/WebCoreSupport/WebEditorClient.h:
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
  • WebProcess/WebCoreSupport/WebPlatformStrategies.h:
  • WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
  • WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h:
  • WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
  • WebProcess/WebPage/WebFrame.cpp:
  • WebProcess/WebPage/WebPage.cpp:
  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/ios/WebPageIOS.mm:
  • WebProcess/WebPage/mac/WebPageMac.mm:
  • WebProcess/win/WebProcessWin.cpp:

Source/WebKitLegacy:
Rename SharedBuffer classes.
https://bugs.webkit.org/show_bug.cgi?id=233677
rdar://problem/85963900

Reviewed by Youenn Fablet.

SharedBuffer are renamed FragmentedSharedBuffer and
ContiguousSharedBuffer to SharedBuffer to better reflect their actual
types.

  • WebCoreSupport/PingHandle.h:

Source/WebKitLegacy/mac:
Rename SharedBuffer classes.
https://bugs.webkit.org/show_bug.cgi?id=233677
rdar://problem/85963900

Reviewed by Youenn Fablet.

SharedBuffer are renamed FragmentedSharedBuffer and
ContiguousSharedBuffer to SharedBuffer to better reflect their actual
types.

  • WebCoreSupport/WebEditorClient.h:
  • WebCoreSupport/WebEditorClient.mm:
  • WebCoreSupport/WebFrameLoaderClient.h:
  • WebCoreSupport/WebFrameLoaderClient.mm:
  • WebCoreSupport/WebPlatformStrategies.h:
  • WebCoreSupport/WebPlatformStrategies.mm:
  • WebView/WebDataSource.mm:
  • WebView/WebHTMLView.mm:
  • WebView/WebResource.mm:

Source/WebKitLegacy/win:
Rename SharedBuffer classes.
https://bugs.webkit.org/show_bug.cgi?id=233677
rdar://problem/85963900

Reviewed by Youenn Fablet.

SharedBuffer are renamed FragmentedSharedBuffer and
ContiguousSharedBuffer to SharedBuffer to better reflect their actual
types.

  • MemoryStream.cpp:
  • MemoryStream.h:
  • WebArchive.cpp:
  • WebCoreSupport/WebEditorClient.cpp:
  • WebCoreSupport/WebEditorClient.h:
  • WebFrame.cpp:
  • WebFrame.h:
  • WebKitDLL.cpp:
  • WebResource.cpp:
  • WebResource.h:

Tools:
Rename SharedBuffer classes.
https://bugs.webkit.org/show_bug.cgi?id=233677
rdar://problem/85963900

Reviewed by Youenn Fablet.

SharedBuffer are renamed FragmentedSharedBuffer and
ContiguousSharedBuffer to SharedBuffer to better reflect their actual
types.

  • TestWebKitAPI/Tests/WTF/FileSystem.cpp:
  • TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp:
  • TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp:
  • TestWebKitAPI/Tests/WebCore/SharedBufferTest.cpp:
  • TestWebKitAPI/Tests/WebCore/SharedBufferTest.h:
  • TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp:
  • TestWebKitAPI/Tests/WebCore/cocoa/SharedBuffer.mm:
  • TestWebKitAPI/win/TestWebCoreStubs.cpp:
  • Property svn:eol-style set to native
File size: 9.3 KB
Line 
1/*
2 * Copyright (C) 2007-2021 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "config.h"
27#include "CSSFontFaceSource.h"
28
29#include "CSSFontFace.h"
30#include "CSSFontSelector.h"
31#include "CachedFontLoadRequest.h"
32#include "CachedSVGFont.h"
33#include "Document.h"
34#include "Font.h"
35#include "FontCache.h"
36#include "FontCascadeDescription.h"
37#include "FontCreationContext.h"
38#include "FontCustomPlatformData.h"
39#include "FontDescription.h"
40#include "ResourceLoadObserver.h"
41#include "RuntimeEnabledFeatures.h"
42#include "SVGElementTypeHelpers.h"
43#include "SVGFontElement.h"
44#include "SVGFontFaceElement.h"
45#include "SVGToOTFFontConversion.h"
46#include "SVGURIReference.h"
47#include "SharedBuffer.h"
48
49namespace WebCore {
50
51inline void CSSFontFaceSource::setStatus(Status newStatus)
52{
53 switch (newStatus) {
54 case Status::Pending:
55 ASSERT_NOT_REACHED();
56 break;
57 case Status::Loading:
58 ASSERT(status() == Status::Pending);
59 break;
60 case Status::Success:
61 ASSERT(status() == Status::Loading);
62 break;
63 case Status::Failure:
64 ASSERT(status() == Status::Loading);
65 break;
66 }
67
68 m_status = newStatus;
69}
70
71CSSFontFaceSource::CSSFontFaceSource(CSSFontFace& owner, const String& familyNameOrURI)
72 : m_familyNameOrURI(familyNameOrURI)
73 , m_face(owner)
74{
75}
76
77CSSFontFaceSource::CSSFontFaceSource(CSSFontFace& owner, const String& familyNameOrURI, CSSFontSelector& fontSelector, UniqueRef<FontLoadRequest>&& request)
78 : m_familyNameOrURI(familyNameOrURI)
79 , m_face(owner)
80 , m_fontSelector(fontSelector)
81 , m_fontRequest(request.moveToUniquePtr())
82{
83 // This may synchronously call fontLoaded().
84 m_fontRequest->setClient(this);
85
86 if (status() == Status::Pending && !m_fontRequest->isPending()) {
87 setStatus(Status::Loading);
88 if (!shouldIgnoreFontLoadCompletions()) {
89 if (m_fontRequest->errorOccurred())
90 setStatus(Status::Failure);
91 else
92 setStatus(Status::Success);
93 }
94 }
95}
96
97CSSFontFaceSource::CSSFontFaceSource(CSSFontFace& owner, const String& familyNameOrURI, SVGFontFaceElement& fontFace)
98 : m_familyNameOrURI(familyNameOrURI)
99 , m_face(owner)
100 , m_svgFontFaceElement(fontFace)
101 , m_hasSVGFontFaceElement(true)
102{
103}
104
105CSSFontFaceSource::CSSFontFaceSource(CSSFontFace& owner, const String& familyNameOrURI, Ref<JSC::ArrayBufferView>&& arrayBufferView)
106 : m_familyNameOrURI(familyNameOrURI)
107 , m_face(owner)
108 , m_immediateSource(WTFMove(arrayBufferView))
109{
110}
111
112CSSFontFaceSource::~CSSFontFaceSource()
113{
114 if (m_fontRequest)
115 m_fontRequest->setClient(nullptr);
116}
117
118bool CSSFontFaceSource::shouldIgnoreFontLoadCompletions() const
119{
120 return m_face.shouldIgnoreFontLoadCompletions();
121}
122
123void CSSFontFaceSource::opportunisticallyStartFontDataURLLoading()
124{
125 if (status() == Status::Pending && m_fontRequest && m_fontRequest->url().protocolIsData() && m_familyNameOrURI.length() < MB)
126 load();
127}
128
129void CSSFontFaceSource::fontLoaded(FontLoadRequest& fontRequest)
130{
131 ASSERT_UNUSED(fontRequest, &fontRequest == m_fontRequest.get());
132
133 if (shouldIgnoreFontLoadCompletions())
134 return;
135
136 Ref<CSSFontFace> protectedFace(m_face);
137
138 // If the font is in the cache, this will be synchronously called from FontLoadRequest::addClient().
139 if (m_status == Status::Pending)
140 setStatus(Status::Loading);
141 else if (m_status == Status::Failure) {
142 // This function may be called twice if loading was cancelled.
143 ASSERT(m_fontRequest->errorOccurred());
144 return;
145 }
146
147 if (m_fontRequest->errorOccurred() || !m_fontRequest->ensureCustomFontData(m_familyNameOrURI))
148 setStatus(Status::Failure);
149 else
150 setStatus(Status::Success);
151
152 m_face.fontLoaded(*this);
153}
154
155void CSSFontFaceSource::load(Document* document)
156{
157 setStatus(Status::Loading);
158
159 if (m_fontRequest) {
160 ASSERT(m_fontSelector);
161 if (auto* context = m_fontSelector->scriptExecutionContext())
162 context->beginLoadingFontSoon(*m_fontRequest);
163 } else {
164 bool success = false;
165 if (m_hasSVGFontFaceElement) {
166 if (m_svgFontFaceElement && is<SVGFontElement>(m_svgFontFaceElement->parentNode())) {
167 ASSERT(!m_inDocumentCustomPlatformData);
168 SVGFontElement& fontElement = downcast<SVGFontElement>(*m_svgFontFaceElement->parentNode());
169 if (auto otfFont = convertSVGToOTFFont(fontElement))
170 m_generatedOTFBuffer = SharedBuffer::create(WTFMove(otfFont.value()));
171 if (m_generatedOTFBuffer) {
172 m_inDocumentCustomPlatformData = createFontCustomPlatformData(*m_generatedOTFBuffer, String());
173 success = static_cast<bool>(m_inDocumentCustomPlatformData);
174 }
175 }
176 } else if (m_immediateSource) {
177 ASSERT(!m_immediateFontCustomPlatformData);
178 bool wrapping;
179 auto buffer = SharedBuffer::create(static_cast<const char*>(m_immediateSource->baseAddress()), m_immediateSource->byteLength());
180 m_immediateFontCustomPlatformData = CachedFont::createCustomFontData(buffer.get(), String(), wrapping);
181 success = static_cast<bool>(m_immediateFontCustomPlatformData);
182 } else {
183 // We are only interested in whether or not fontForFamily() returns null or not. Luckily, none of
184 // the values in the FontDescription other than the family name can cause the function to return
185 // null if it wasn't going to otherwise (and vice-versa).
186 FontCascadeDescription fontDescription;
187 fontDescription.setOneFamily(m_familyNameOrURI);
188 fontDescription.setComputedSize(1);
189 fontDescription.setShouldAllowUserInstalledFonts(m_face.allowUserInstalledFonts());
190 success = FontCache::forCurrentThread().fontForFamily(fontDescription, m_familyNameOrURI, { }, true);
191 if (document && RuntimeEnabledFeatures::sharedFeatures().webAPIStatisticsEnabled())
192 ResourceLoadObserver::shared().logFontLoad(*document, m_familyNameOrURI.string(), success);
193 }
194 setStatus(success ? Status::Success : Status::Failure);
195 }
196}
197
198RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, const FontCreationContext& fontCreationContext)
199{
200 ASSERT(status() == Status::Success);
201
202 bool usesInDocumentSVGFont = m_hasSVGFontFaceElement;
203
204 if (!m_fontRequest && !usesInDocumentSVGFont) {
205 if (m_immediateSource) {
206 if (!m_immediateFontCustomPlatformData)
207 return nullptr;
208 return Font::create(CachedFont::platformDataFromCustomData(*m_immediateFontCustomPlatformData, fontDescription, syntheticBold, syntheticItalic, fontCreationContext), Font::Origin::Remote);
209 }
210
211 // We're local. Just return a Font from the normal cache.
212 // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
213 return FontCache::forCurrentThread().fontForFamily(fontDescription, m_familyNameOrURI, fontCreationContext, true);
214 }
215
216 if (m_fontRequest) {
217 auto success = m_fontRequest->ensureCustomFontData(m_familyNameOrURI);
218 ASSERT_UNUSED(success, success);
219
220 ASSERT(status() == Status::Success);
221 auto result = m_fontRequest->createFont(fontDescription, m_familyNameOrURI, syntheticBold, syntheticItalic, fontCreationContext);
222 ASSERT(result);
223 return result;
224 }
225
226 if (!usesInDocumentSVGFont)
227 return nullptr;
228
229 if (!m_svgFontFaceElement || !is<SVGFontElement>(m_svgFontFaceElement->parentNode()))
230 return nullptr;
231 if (!m_inDocumentCustomPlatformData)
232 return nullptr;
233 return Font::create(m_inDocumentCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontCreationContext), Font::Origin::Remote);
234}
235
236bool CSSFontFaceSource::isSVGFontFaceSource() const
237{
238 return m_hasSVGFontFaceElement || (is<CachedFontLoadRequest>(m_fontRequest) && is<CachedSVGFont>(downcast<CachedFontLoadRequest>(m_fontRequest.get())->cachedFont()));
239}
240
241}
Note: See TracBrowser for help on using the repository browser.