2022-05-23 Alan Coon Cherry-pick r294280. rdar://problem/87980543 REGRESSION(r249162): CanvasRenderingContext2DBase::drawImage() crashes if the image is animated and the first frame cannot be decoded https://bugs.webkit.org/show_bug.cgi?id=239113 rdar://87980543 Reviewed by Simon Fraser. Source/WebCore: CanvasRenderingContext2DBase::drawImage() needs to ensure the first frame of the animated image can be decoded correctly before creating the temporary static image. If the first frame can't be decoded, this function should return immediately. This matches the behavior of this function before r249162. The animated image decodes its frames asynchronously in a work queue. But the first frame has to be decoded synchronously in the main run loop. So to avoid running the image decoder in two different threads we are going to keep the first and the current frame cached when we receive a memory pressure warning. This should not increase the memory allocation of the animated image because the numbers of cached frames increases quickly and we keep all of them till a memory warning is received. But the memory pressure warning will be received a little bit more often. This depends on the memory size of the first frame. To make the code more robust, make ImageSource take a Ref instead of taking a RefPtr. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::drawImage): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::BitmapImage): (WebCore::BitmapImage::destroyDecodedData): * platform/graphics/BitmapImage.h: * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::ImageSource): (WebCore::ImageSource::destroyDecodedData): (WebCore::ImageSource::setNativeImage): * platform/graphics/ImageSource.h: (WebCore::ImageSource::create): (WebCore::ImageSource::isDecoderAvailable const): (WebCore::ImageSource::destroyAllDecodedData): Deleted. (WebCore::ImageSource::destroyAllDecodedDataExcludeFrame): Deleted. (WebCore::ImageSource::destroyDecodedDataBeforeFrame): Deleted. Source/WebKit: * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::drawSystemImage): Canonical link: https://commits.webkit.org/250624@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294280 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-05-16 Said Abou-Hallawa REGRESSION(r249162): CanvasRenderingContext2DBase::drawImage() crashes if the image is animated and the first frame cannot be decoded https://bugs.webkit.org/show_bug.cgi?id=239113 rdar://87980543 Reviewed by Simon Fraser. * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::drawSystemImage): 2022-05-02 Alan Coon Apply patch. rdar://problem/92617943 2022-05-02 Alex Christensen Revert all use of _setPrivacyProxyFailClosedForUnreachableNonMainHosts https://bugs.webkit.org/show_bug.cgi?id=239977 Due to what is likely confusion about internal integration processes, the powers that be have decided that the best course of action for now is to restore the status quo and accept any consequences that may entail. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::createWebSocketTask): 2022-04-29 Alan Coon Cherry-pick r287877. rdar://problem/92357915 Non-unified build fixes, early January 2022 edition https://bugs.webkit.org/show_bug.cgi?id=235013 Unreviewed non-unified build fixes. Source/JavaScriptCore: * wasm/js/JSWebAssemblyModule.cpp: Add missing JSWebAssemblyLinkError.h header. * wasm/js/JSWebAssemblyModule.h: Add missing forward declaration for the JSC::OptimizingCallLinkInfo type. Source/WebCore: No new tests needed. * Modules/fetch/FetchBodyConsumer.cpp: Add missing FormData.h header. * Modules/fetch/FormDataConsumer.h: Add missing ExceptionOr.h header, and forward declaration for the WebCore::ScriptExecutionContext type. * animation/CSSAnimation.cpp: Add missing KeyframeEffect.h header. * animation/KeyframeEffect.cpp: Add missing StyledElement.h header. * html/HTMLFormElement.cpp: Add missing PseudoClassChangeInvalidation.h header. * platform/network/SynchronousLoaderClient.cpp: Add missing SharedBuffer.h header. * rendering/svg/RenderSVGBlock.cpp: Add missing SVGRenderSupport.h header. * rendering/svg/RenderSVGForeignObject.cpp: Ditto. * rendering/svg/RenderSVGInline.cpp: Ditto. * rendering/svg/RenderSVGModelObject.cpp: Add missing SVGElementInlines.h header. * rendering/svg/SVGInlineTextBox.cpp: Add missing FloatConversion.h header. * svg/SVGViewElement.cpp: Add missing RenderElement.h header. * workers/service/context/ServiceWorkerFetch.h: Add missing forward declaration for the WebCore::SharedBuffer type, remove unused one for WebCore::FragmentedSharedBuffer. Source/WebKit: * Platform/IPC/SharedBufferCopy.cpp: Add missing WebCoreArgumentCoders.h header, remove now unneeded ArgumentCoders.h header. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287877 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-11 Adrian Perez de Castro Non-unified build fixes, early January 2022 edition https://bugs.webkit.org/show_bug.cgi?id=235013 Unreviewed non-unified build fixes. * Platform/IPC/SharedBufferCopy.cpp: Add missing WebCoreArgumentCoders.h header, remove now unneeded ArgumentCoders.h header. 2022-04-22 Alan Coon Cherry-pick r291724. rdar://problem/91975589 Expose the AX tree of PDFs loaded via iframes on the Mac https://bugs.webkit.org/show_bug.cgi?id=238168 Reviewed by Chris Fleizach. Source/WebKit: Given this markup: