haikuwebkit/Source/WebCore/page/PrewarmInformation.h

60 lines
2.2 KiB
C
Raw Permalink Normal View History

Prewarm FontDatabase on process swap https://bugs.webkit.org/show_bug.cgi?id=190312 Reviewed by Chris Dumez. Source/WebCore: Implement basic prewarming of FontDatabase. When the domain of the first page load on a new process is known we pass the list of font families previous used by that domain to the process. This is used to prewarm CoreText font database. Initialization (which involves lots of blocking IPC) happens outside the main thread so the fonts are ready to use when needed. * WebCore.xcodeproj/project.pbxproj: * page/PrewarmInformation.h: Added. (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): Add data structure for prewarm information with encode/decode support. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): Prewarming interface to be used from WebKit. * page/ProcessWarming.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::FontDatabase::clear): Add mutex for thread safe access. (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::collectPrewarmInformation const): Collect font families seen by this process. (WebCore::FontCache::prewarm): Prewarm FontDatabase in a dispatch queue. Source/WebKit: Add mechanism for caching prewarm information per domain on UI process side. This information is then passed to newly initialized web processes that are being used for the same domain. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Pass prewarm information on process swap to the new process. (WebKit::WebProcessPool::didCollectPrewarmInformation): UI process side cache. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): (WebKit::WebPage::didReceivePolicyDecision): Collect and cache prewarm information for the previous process on process swap. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prewarmGlobally): Renamed for clarity. (WebKit::WebProcess::prewarmWithDomainInformation): (WebKit::WebProcess::sendPrewarmInformation): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Canonical link: https://commits.webkit.org/205342@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-09 09:14:37 +00:00
/*
* Copyright (C) 2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include "FontCache.h"
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
struct WEBCORE_EXPORT PrewarmInformation {
[WTF] Add makeUnique<T>, which ensures T is fast-allocated, WTF_MAKE_FAST_ALLOCATED annotation part https://bugs.webkit.org/show_bug.cgi?id=200620 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Three patches including this one were originally one patch. I split it into three pieces to make roll-out easy. This part, we annotate classes / structs with WTF_MAKE_FAST_ALLOCATED and WTF_MAKE_STRUCT_FAST_ALLOCATED if they are allocated from std::make_unique. The second patch will switch `std::make_unique` to `WTF::makeUnique` and the third patch will insert a static_assert that makeUnique-allocated class T is FastMalloc-ed. One insight from this patch is that we tend to forget adding WTF_MAKE_STRUCT_FAST_ALLOCATED if it is just a data struct. * debugger/Debugger.h: * inspector/scripts/codegen/objc_generator_templates.py: * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result: * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result: * inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result: * inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result: * inspector/scripts/tests/generic/expected/domain-availability.json-result: * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result: * inspector/scripts/tests/generic/expected/enum-values.json-result: * inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result: * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result: * inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result: * inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result: * inspector/scripts/tests/generic/expected/should-strip-comments.json-result: * inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result: * inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result: * inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result: * inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result: * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: * inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result: * inspector/scripts/tests/generic/expected/version.json-result: * inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result: * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result: Source/WebCore: * Modules/encryptedmedia/legacy/LegacyCDM.h: (WebCore::LegacyCDM::keySystem const): Deleted. (WebCore::LegacyCDM::client const): Deleted. (WebCore::LegacyCDM::setClient): Deleted. * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h: * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h: * Modules/webaudio/AsyncAudioDecoder.h: (WebCore::AsyncAudioDecoder::DecodingTask::audioData): Deleted. (WebCore::AsyncAudioDecoder::DecodingTask::sampleRate const): Deleted. (WebCore::AsyncAudioDecoder::DecodingTask::successCallback): Deleted. (WebCore::AsyncAudioDecoder::DecodingTask::errorCallback): Deleted. (WebCore::AsyncAudioDecoder::DecodingTask::audioBuffer): Deleted. * Modules/webauthn/AuthenticatorCoordinator.h: * Modules/webdatabase/SQLStatement.h: (WebCore::SQLStatement::hasStatementCallback const): Deleted. (WebCore::SQLStatement::hasStatementErrorCallback const): Deleted. * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: * Modules/webgpu/WHLSL/WHLSLResolvingType.h: * bindings/js/DOMPromiseProxy.h: * bindings/js/GCController.h: * bridge/jsc/BridgeJSC.h: * contentextensions/ContentExtensionsBackend.h: * dom/FullscreenManager.h: (WebCore::FullscreenManager::document): Deleted. (WebCore::FullscreenManager::document const): Deleted. (WebCore::FullscreenManager::topDocument const): Deleted. (WebCore::FullscreenManager::page const): Deleted. (WebCore::FullscreenManager::frame const): Deleted. (WebCore::FullscreenManager::documentElement const): Deleted. (WebCore::FullscreenManager::hasLivingRenderTree const): Deleted. (WebCore::FullscreenManager::pageCacheState const): Deleted. (WebCore::FullscreenManager::scheduleFullStyleRebuild): Deleted. (WebCore::FullscreenManager::fullscreenElement const): Deleted. (WebCore::FullscreenManager::isFullscreen const): Deleted. (WebCore::FullscreenManager::isFullscreenKeyboardInputAllowed const): Deleted. (WebCore::FullscreenManager::currentFullscreenElement const): Deleted. * dom/Microtasks.h: (WebCore::MicrotaskQueue::vm const): Deleted. * editing/CompositeEditCommand.h: * editing/mac/AlternativeTextUIController.h: * html/HTMLMediaElement.h: * inspector/InspectorFrontendClientLocal.h: * inspector/agents/WebHeapAgent.cpp: * layout/displaytree/DisplayRun.h: * layout/inlineformatting/InlineItem.h: * layout/inlineformatting/InlineLine.h: * layout/tableformatting/TableGrid.h: * loader/FrameLoader.h: (WebCore::FrameLoader::frame const): Deleted. (WebCore::FrameLoader::policyChecker const): Deleted. (WebCore::FrameLoader::history const): Deleted. (WebCore::FrameLoader::notifier const): Deleted. (WebCore::FrameLoader::subframeLoader const): Deleted. (WebCore::FrameLoader::mixedContentChecker const): Deleted. (WebCore::FrameLoader::urlSelected): Deleted. (WebCore::FrameLoader::reload): Deleted. (WebCore::FrameLoader::requestedHistoryItem const): Deleted. (WebCore::FrameLoader::documentLoader const): Deleted. (WebCore::FrameLoader::policyDocumentLoader const): Deleted. (WebCore::FrameLoader::provisionalDocumentLoader const): Deleted. (WebCore::FrameLoader::state const): Deleted. (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame const): Deleted. (WebCore::FrameLoader::client const): Deleted. (WebCore::FrameLoader::forceSandboxFlags): Deleted. (WebCore::FrameLoader::hasOpenedFrames const): Deleted. (WebCore::FrameLoader::setLoadsSynchronously): Deleted. (WebCore::FrameLoader::loadsSynchronously const): Deleted. (WebCore::FrameLoader::stateMachine): Deleted. (WebCore::FrameLoader::quickRedirectComing const): Deleted. (WebCore::FrameLoader::pageDismissalEventBeingDispatched const): Deleted. (WebCore::FrameLoader::previousURL const): Deleted. (WebCore::FrameLoader::setOverrideCachePolicyForTesting): Deleted. (WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting): Deleted. (WebCore::FrameLoader::setStrictRawResourceValidationPolicyDisabledForTesting): Deleted. (WebCore::FrameLoader::isStrictRawResourceValidationPolicyDisabledForTesting): Deleted. (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL const): Deleted. (WebCore::FrameLoader::setProvisionalLoadErrorBeingHandledURL): Deleted. (WebCore::FrameLoader::isReloadingFromOrigin const): Deleted. (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive): Deleted. (WebCore::FrameLoader::alwaysAllowLocalWebarchive const): Deleted. (WebCore::FrameLoader::loadWithDocumentLoader): Deleted. (WebCore::FrameLoader::loadWithNavigationAction): Deleted. (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const): Deleted. * loader/NavigationDisabler.h: * loader/NavigationScheduler.h: * loader/cache/CachedResource.h: * loader/cache/CachedSVGDocumentReference.h: (WebCore::CachedSVGDocumentReference::loadRequested const): Deleted. (WebCore::CachedSVGDocumentReference::document): Deleted. * loader/ios/PreviewLoader.h: * page/CaptionUserPreferences.h: * page/PrewarmInformation.h: * page/ResizeObserver.h: * page/SuspendableTimer.h: * page/csp/ContentSecurityPolicyDirective.h: * page/ios/ContentChangeObserver.h: * page/ios/DOMTimerHoldingTank.h: * page/linux/ResourceUsageOverlayLinux.cpp: * page/mac/TextIndicatorWindow.h: * page/scrolling/ScrollSnapOffsetsInfo.h: * page/scrolling/ScrollingMomentumCalculator.h: * platform/CPUMonitor.h: * platform/FileMonitor.h: * platform/ScrollAnimation.h: * platform/SuddenTermination.h: * platform/audio/AudioBus.h: (WebCore::AudioBus::numberOfChannels const): Deleted. (WebCore::AudioBus::channel): Deleted. (WebCore::AudioBus::channel const): Deleted. (WebCore::AudioBus::length const): Deleted. (WebCore::AudioBus::sampleRate const): Deleted. (WebCore::AudioBus::setSampleRate): Deleted. (WebCore::AudioBus::reset): Deleted. (WebCore::AudioBus::AudioBus): Deleted. * platform/audio/AudioChannel.h: (WebCore::AudioChannel::AudioChannel): Deleted. (WebCore::AudioChannel::set): Deleted. (WebCore::AudioChannel::length const): Deleted. (WebCore::AudioChannel::mutableData): Deleted. (WebCore::AudioChannel::data const): Deleted. (WebCore::AudioChannel::zero): Deleted. (WebCore::AudioChannel::clearSilentFlag): Deleted. (WebCore::AudioChannel::isSilent const): Deleted. * platform/audio/AudioFIFO.h: (WebCore::AudioFIFO::framesInFifo const): Deleted. (WebCore::AudioFIFO::updateIndex): Deleted. * platform/audio/AudioPullFIFO.h: * platform/audio/AudioResampler.h: (WebCore::AudioResampler::rate const): Deleted. * platform/audio/AudioResamplerKernel.h: * platform/audio/AudioSession.cpp: * platform/audio/AudioSession.h: (WebCore::AudioSession::isActive const): Deleted. * platform/audio/Biquad.h: * platform/audio/Cone.h: (WebCore::ConeEffect::setInnerAngle): Deleted. (WebCore::ConeEffect::innerAngle const): Deleted. (WebCore::ConeEffect::setOuterAngle): Deleted. (WebCore::ConeEffect::outerAngle const): Deleted. (WebCore::ConeEffect::setOuterGain): Deleted. (WebCore::ConeEffect::outerGain const): Deleted. * platform/audio/DenormalDisabler.h: (WebCore::DenormalDisabler::DenormalDisabler): Deleted. (WebCore::DenormalDisabler::~DenormalDisabler): Deleted. (WebCore::DenormalDisabler::flushDenormalFloatToZero): Deleted. (WebCore::DenormalDisabler::getCSR): Deleted. (WebCore::DenormalDisabler::setCSR): Deleted. * platform/audio/DirectConvolver.h: * platform/audio/Distance.h: (WebCore::DistanceEffect::model): Deleted. (WebCore::DistanceEffect::setModel): Deleted. (WebCore::DistanceEffect::setRefDistance): Deleted. (WebCore::DistanceEffect::setMaxDistance): Deleted. (WebCore::DistanceEffect::setRolloffFactor): Deleted. (WebCore::DistanceEffect::refDistance const): Deleted. (WebCore::DistanceEffect::maxDistance const): Deleted. (WebCore::DistanceEffect::rolloffFactor const): Deleted. * platform/audio/DownSampler.h: * platform/audio/DynamicsCompressor.h: (WebCore::DynamicsCompressor::sampleRate const): Deleted. (WebCore::DynamicsCompressor::nyquist const): Deleted. (WebCore::DynamicsCompressor::tailTime const): Deleted. (WebCore::DynamicsCompressor::latencyTime const): Deleted. * platform/audio/DynamicsCompressorKernel.h: (WebCore::DynamicsCompressorKernel::latencyFrames const): Deleted. (WebCore::DynamicsCompressorKernel::sampleRate const): Deleted. (WebCore::DynamicsCompressorKernel::meteringGain const): Deleted. * platform/audio/EqualPowerPanner.h: * platform/audio/FFTConvolver.h: (WebCore::FFTConvolver::fftSize const): Deleted. * platform/audio/HRTFDatabase.h: (WebCore::HRTFDatabase::numberOfAzimuths): Deleted. (WebCore::HRTFDatabase::sampleRate const): Deleted. * platform/audio/HRTFElevation.h: (WebCore::HRTFElevation::HRTFElevation): Deleted. (WebCore::HRTFElevation::kernelListL): Deleted. (WebCore::HRTFElevation::kernelListR): Deleted. (WebCore::HRTFElevation::elevationAngle const): Deleted. (WebCore::HRTFElevation::numberOfAzimuths const): Deleted. (WebCore::HRTFElevation::sampleRate const): Deleted. * platform/audio/HRTFPanner.h: (WebCore::HRTFPanner::fftSize const): Deleted. (WebCore::HRTFPanner::sampleRate const): Deleted. * platform/audio/MultiChannelResampler.h: * platform/audio/PlatformAudioData.h: * platform/audio/Reverb.h: (WebCore::Reverb::impulseResponseLength const): Deleted. * platform/audio/ReverbAccumulationBuffer.h: (WebCore::ReverbAccumulationBuffer::readIndex const): Deleted. (WebCore::ReverbAccumulationBuffer::readTimeFrame const): Deleted. * platform/audio/ReverbConvolver.h: (WebCore::ReverbConvolver::impulseResponseLength const): Deleted. (WebCore::ReverbConvolver::inputBuffer): Deleted. (WebCore::ReverbConvolver::useBackgroundThreads const): Deleted. * platform/audio/ReverbConvolverStage.h: (WebCore::ReverbConvolverStage::inputReadIndex const): Deleted. * platform/audio/ReverbInputBuffer.h: (WebCore::ReverbInputBuffer::writeIndex const): Deleted. * platform/audio/SincResampler.h: * platform/audio/UpSampler.h: * platform/audio/ZeroPole.h: (WebCore::ZeroPole::ZeroPole): Deleted. (WebCore::ZeroPole::reset): Deleted. (WebCore::ZeroPole::setZero): Deleted. (WebCore::ZeroPole::setPole): Deleted. (WebCore::ZeroPole::zero const): Deleted. (WebCore::ZeroPole::pole const): Deleted. * platform/audio/cocoa/WebAudioBufferList.h: (WebCore::WebAudioBufferList::list const): Deleted. (WebCore::WebAudioBufferList::operator AudioBufferList& const): Deleted. (WebCore::WebAudioBufferList::kind const): Deleted. * platform/audio/ios/AudioSessionIOS.mm: * platform/audio/mac/CARingBuffer.h: * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/gamepad/mac/HIDGamepad.h: * platform/graphics/FloatPoint.h: * platform/graphics/Font.h: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContext3DPrivate.h: * platform/graphics/GraphicsContextImpl.h: * platform/graphics/GraphicsLayer.cpp: * platform/graphics/LegacyCDMSession.h: * platform/graphics/Region.h: * platform/graphics/VelocityData.h: * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: * platform/graphics/avfoundation/CDMFairPlayStreaming.h: * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h: * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/cairo/FontCustomPlatformData.h: * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: * platform/graphics/cairo/PlatformContextCairo.h: * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: * platform/graphics/cv/ImageRotationSessionVT.h: (WebCore::ImageRotationSessionVT::RotationProperties::isIdentity const): Deleted. (WebCore::ImageRotationSessionVT::transform const): Deleted. (WebCore::ImageRotationSessionVT::rotationProperties const): Deleted. (WebCore::ImageRotationSessionVT::size): Deleted. (WebCore::ImageRotationSessionVT::rotatedSize): Deleted. * platform/graphics/cv/PixelBufferConformerCV.h: * platform/graphics/cv/TextureCacheCV.h: * platform/graphics/cv/VideoTextureCopierCV.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: * platform/graphics/iso/ISOBox.h: * platform/graphics/iso/ISOOriginalFormatBox.h: * platform/graphics/iso/ISOProtectionSchemeInfoBox.h: * platform/graphics/iso/ISOSchemeInformationBox.h: * platform/graphics/iso/ISOSchemeTypeBox.h: * platform/graphics/iso/ISOTrackEncryptionBox.h: * platform/graphics/iso/ISOVTTCue.cpp: (WebCore::ISOStringBox::contents): Deleted. * platform/graphics/iso/ISOVTTCue.h: (WebCore::ISOWebVTTCue::boxTypeName): Deleted. (WebCore::ISOWebVTTCue::presentationTime const): Deleted. (WebCore::ISOWebVTTCue::duration const): Deleted. (WebCore::ISOWebVTTCue::sourceID const): Deleted. (WebCore::ISOWebVTTCue::id const): Deleted. (WebCore::ISOWebVTTCue::originalStartTime const): Deleted. (WebCore::ISOWebVTTCue::settings const): Deleted. (WebCore::ISOWebVTTCue::cueText const): Deleted. * platform/graphics/nicosia/NicosiaPaintingOperation.h: * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h: * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h: * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.h: * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: * platform/graphics/opengl/Extensions3DOpenGLCommon.h: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: * platform/graphics/texmap/coordinated/Tile.h: * platform/graphics/win/FontCustomPlatformData.h: * platform/graphics/win/FullScreenController.cpp: * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h: * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: * platform/graphics/win/PlatformContextDirect2D.h: * platform/graphics/win/WKCAImageQueue.cpp: * platform/gtk/PasteboardHelper.cpp: * platform/ios/LegacyTileGrid.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediastream/gstreamer/GStreamerAudioData.h: (WebCore::GStreamerAudioData::GStreamerAudioData): Deleted. (WebCore::GStreamerAudioData::getSample): Deleted. (WebCore::GStreamerAudioData::getAudioInfo): Deleted. (WebCore::GStreamerAudioData::kind const): Deleted. * platform/mediastream/gstreamer/GStreamerCapturer.h: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: * platform/mediastream/libwebrtc/LibWebRTCDTMFSenderBackend.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h: * platform/mock/MediaPlaybackTargetPickerMock.h: * platform/mock/RTCDataChannelHandlerMock.h: * platform/network/ResourceErrorBase.h: * platform/network/curl/CookieJarDB.h: * platform/network/curl/CurlCacheEntry.h: * platform/network/curl/CurlContext.h: * platform/network/curl/CurlMultipartHandle.h: * platform/network/curl/CurlRequestScheduler.h: * platform/network/curl/CurlSSLVerifier.h: * platform/network/ios/PreviewConverter.h: * platform/network/soup/NetworkStorageSessionSoup.cpp: * platform/vr/openvr/VRPlatformDisplayOpenVR.h: * platform/vr/openvr/VRPlatformManagerOpenVR.h: * rendering/HitTestResult.h: * rendering/LayerOverlapMap.cpp: * rendering/RenderLayerCompositor.h: * rendering/svg/RenderSVGResourceMasker.h: * replay/UserInputBridge.h: * svg/graphics/filters/SVGFilterBuilder.h: * svg/properties/SVGAttributeAnimator.h: * svg/properties/SVGDecoratedProperty.h: * svg/properties/SVGPropertyAnimatorFactory.h: * testing/InternalSettings.cpp: * testing/LegacyMockCDM.cpp: * testing/LegacyMockCDM.h: * testing/MockCDMFactory.h: * workers/WorkerEventQueue.cpp: * workers/WorkerEventQueue.h: * workers/service/ServiceWorkerContainer.h: * worklets/PaintWorkletGlobalScope.h: * xml/XMLErrors.h: * xml/parser/XMLDocumentParserLibxml2.cpp: Source/WebDriver: * glib/SessionHostGlib.cpp: Source/WebKit: * NetworkProcess/AdClickAttributionManager.h: * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Cookies/WebCookieManager.h: * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/NetworkHTTPSUpgradeChecker.h: * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSocketChannel.h: * NetworkProcess/WebSocketTask.h: * NetworkProcess/cache/PrefetchCache.h: * NetworkProcess/cocoa/WebSocketTaskCocoa.h: * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: * NetworkProcess/soup/WebSocketTaskSoup.h: * NetworkProcess/webrtc/LibWebRTCSocketClient.h: * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: * Platform/Module.h: * PluginProcess/PluginControllerProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/Authentication/AuthenticationManager.h: * Shared/Cocoa/SandboxExtensionCocoa.mm: * Shared/Plugins/NPObjectMessageReceiver.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * UIProcess/API/APIAutomationClient.h: * UIProcess/API/APIAutomationSessionClient.h: * UIProcess/API/APIContextMenuClient.h: * UIProcess/API/APICustomProtocolManagerClient.h: * UIProcess/API/APIDiagnosticLoggingClient.h: * UIProcess/API/APIDownloadClient.h: * UIProcess/API/APIFindClient.h: * UIProcess/API/APIFindMatchesClient.h: * UIProcess/API/APIFormClient.h: * UIProcess/API/APIFullscreenClient.h: * UIProcess/API/APIGeolocationProvider.h: * UIProcess/API/APIHistoryClient.h: * UIProcess/API/APIIconDatabaseClient.h: * UIProcess/API/APIIconLoadingClient.h: * UIProcess/API/APIInjectedBundleClient.h: * UIProcess/API/APILegacyContextHistoryClient.h: * UIProcess/API/APILoaderClient.h: * UIProcess/API/APINavigationClient.h: * UIProcess/API/APIPolicyClient.h: * UIProcess/API/APIUIClient.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageStateClient): * UIProcess/API/Cocoa/WKUserContentController.mm: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: * UIProcess/API/glib/IconDatabase.h: * UIProcess/API/glib/WebKitAutomationSession.cpp: * UIProcess/API/glib/WebKitIconLoadingClient.cpp: * UIProcess/API/glib/WebKitNotificationProvider.h: * UIProcess/API/glib/WebKitUserContentManager.cpp: * UIProcess/API/glib/WebKitWebContext.cpp: * UIProcess/API/glib/WebKitWebView.cpp: * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: * UIProcess/API/gtk/WebKitWebInspector.cpp: * UIProcess/API/mac/WKView.mm: (-[WKView maybeInstallIconLoadingClient]): * UIProcess/API/wpe/APIViewClient.h: * UIProcess/API/wpe/ScrollGestureController.h: * UIProcess/ApplicationStateTracker.h: * UIProcess/Cocoa/AutomationSessionClient.h: * UIProcess/Cocoa/IconLoadingDelegate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/DrawingAreaProxy.h: * UIProcess/HighPerformanceGraphicsUsageSampler.h: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/PageClient.h: * UIProcess/PerActivityStateCPUUsageSampler.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h: * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: * UIProcess/SystemPreviewController.h: * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * UIProcess/WebNavigationState.h: * UIProcess/WebPageInjectedBundleClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/WebsiteDataStoreClient.h: * UIProcess/gtk/DragAndDropHandler.h: * UIProcess/ios/EditableImageController.h: * UIProcess/ios/InputViewUpdateDeferrer.h: * UIProcess/ios/SmartMagnificationController.h: * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: * UIProcess/mac/WKFullScreenWindowController.mm: * UIProcess/mac/WKTextFinderClient.mm: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm: * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: * WebProcess/MediaCache/WebMediaKeyStorageManager.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: * WebProcess/Network/webrtc/LibWebRTCResolver.h: * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Storage/WebSWOriginTable.h: * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebContextMenuClient.h: * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/WebGeolocationClient.h: * WebProcess/WebCoreSupport/WebInspectorClient.h: * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: * WebProcess/WebCoreSupport/WebNotificationClient.h: * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebCoreSupport/WebProgressTrackerClient.h: * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.h: * WebProcess/WebCoreSupport/WebUserMediaClient.h: * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: * WebProcess/WebPage/FindController.h: * WebProcess/WebPage/ViewGestureGeometryCollector.h: * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h: * WebProcess/WebProcess.h: * WebProcess/cocoa/UserMediaCaptureManager.h: Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: * WebCoreSupport/WebFixedPositionContent.mm: Source/WebKitLegacy/mac: * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/WebHostedNetscapePluginView.mm: * Plugins/WebNetscapePluginEventHandlerCocoa.h: * Storage/WebDatabaseManagerClient.mm: * WebCoreSupport/WebAlternativeTextClient.h: * WebCoreSupport/WebCachedFramePlatformData.h: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebGeolocationClient.h: * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebNotificationClient.h: * WebCoreSupport/WebSelectionServiceController.h: * WebView/WebMediaPlaybackTargetPicker.h: Source/WebKitLegacy/win: * FullscreenVideoController.cpp: * FullscreenVideoController.h: * Plugins/PluginMessageThrottlerWin.h: * WebCachedFramePlatformData.h: * WebCoreSupport/AcceleratedCompositingContext.h: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebDesktopNotificationsDelegate.h: * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebFrameLoaderClient.cpp: * WebCoreSupport/WebGeolocationClient.h: * WebCoreSupport/WebInspectorClient.h: * WebDatabaseManager.cpp: * WebKitQuartzCoreAdditions/CAD3DRenderer.h: * WebNodeHighlight.h: * WebNotificationCenter.cpp: * WebNotificationCenter.h: Tools: * DumpRenderTree/AccessibilityController.h: * DumpRenderTree/GCController.h: * DumpRenderTree/win/DRTDataObject.cpp: * DumpRenderTree/win/DRTDataObject.h: * DumpRenderTree/win/DRTDesktopNotificationPresenter.h: * DumpRenderTree/win/DRTDropSource.h: * DumpRenderTree/win/DraggingInfo.h: * DumpRenderTree/win/EditingDelegate.h: * DumpRenderTree/win/EventSender.cpp: * DumpRenderTree/win/FrameLoadDelegate.h: * DumpRenderTree/win/HistoryDelegate.h: * DumpRenderTree/win/MD5.h: * DumpRenderTree/win/PolicyDelegate.h: * DumpRenderTree/win/ResourceLoadDelegate.h: * DumpRenderTree/win/TextInputController.h: * DumpRenderTree/win/UIDelegate.cpp: * DumpRenderTree/win/UIDelegate.h: * TestRunnerShared/UIScriptContext/UIScriptContext.h: * TestRunnerShared/cocoa/ClassMethodSwizzler.h: * TestRunnerShared/cocoa/InstanceMethodSwizzler.h: * TestWebKitAPI/Counters.h: * TestWebKitAPI/PlatformWebView.h: * TestWebKitAPI/Tests/WTF/Expected.cpp: * TestWebKitAPI/Tests/WTF/HashMap.cpp: (TestWebKitAPI::DerefObserver::ref): (TestWebKitAPI::DerefObserver::deref): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/HashSet.cpp: (TestWebKitAPI::DerefObserver::ref): (TestWebKitAPI::DerefObserver::deref): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/UniqueRef.cpp: * TestWebKitAPI/Tests/WTF/WeakPtr.cpp: * TestWebKitAPI/Tests/WebCore/CalculationValue.cpp: * TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp: * TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h: * TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.h: * WebKitTestRunner/EventSenderProxy.h: * WebKitTestRunner/GeolocationProviderMock.h: * WebKitTestRunner/InjectedBundle/AccessibilityController.h: * WebKitTestRunner/InjectedBundle/EventSendingController.cpp: * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: * WebKitTestRunner/PlatformWebView.h: * WebKitTestRunner/TestInvocation.h: Canonical link: https://commits.webkit.org/214537@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-16 06:53:36 +00:00
WTF_MAKE_STRUCT_FAST_ALLOCATED;
[PSON] Prewarm system fallback fonts https://bugs.webkit.org/show_bug.cgi?id=190517 Reviewed by Ryosuke Niwa. This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages after process swaps. * page/PrewarmInformation.h: (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: (WebCore::FontCache::PrewarmInformation::isolatedCopy const): (WebCore::FontCache::PrewarmInformation::encode const): (WebCore::FontCache::PrewarmInformation::decode): Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontCache::systemFallbackForCharacters): Collect the names of fonts that end up needing character specific system fallbacks. (WebCore::FontCache::collectPrewarmInformation const): Include them into prewarm information. (WebCore::FontCache::prewarm): Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully prewarm it for fallbacks (independent of size, locale or other characteristics). Any future calls to systemFallbackForCharacters are fast. Canonical link: https://commits.webkit.org/205490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 16:02:35 +00:00
FontCache::PrewarmInformation fontCache;
Prewarm FontDatabase on process swap https://bugs.webkit.org/show_bug.cgi?id=190312 Reviewed by Chris Dumez. Source/WebCore: Implement basic prewarming of FontDatabase. When the domain of the first page load on a new process is known we pass the list of font families previous used by that domain to the process. This is used to prewarm CoreText font database. Initialization (which involves lots of blocking IPC) happens outside the main thread so the fonts are ready to use when needed. * WebCore.xcodeproj/project.pbxproj: * page/PrewarmInformation.h: Added. (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): Add data structure for prewarm information with encode/decode support. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): Prewarming interface to be used from WebKit. * page/ProcessWarming.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::FontDatabase::clear): Add mutex for thread safe access. (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::collectPrewarmInformation const): Collect font families seen by this process. (WebCore::FontCache::prewarm): Prewarm FontDatabase in a dispatch queue. Source/WebKit: Add mechanism for caching prewarm information per domain on UI process side. This information is then passed to newly initialized web processes that are being used for the same domain. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Pass prewarm information on process swap to the new process. (WebKit::WebProcessPool::didCollectPrewarmInformation): UI process side cache. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): (WebKit::WebPage::didReceivePolicyDecision): Collect and cache prewarm information for the previous process on process swap. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prewarmGlobally): Renamed for clarity. (WebKit::WebProcess::prewarmWithDomainInformation): (WebKit::WebProcess::sendPrewarmInformation): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Canonical link: https://commits.webkit.org/205342@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-09 09:14:37 +00:00
template<class Encoder> void encode(Encoder&) const;
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
template<class Decoder> static std::optional<PrewarmInformation> decode(Decoder&);
Prewarm FontDatabase on process swap https://bugs.webkit.org/show_bug.cgi?id=190312 Reviewed by Chris Dumez. Source/WebCore: Implement basic prewarming of FontDatabase. When the domain of the first page load on a new process is known we pass the list of font families previous used by that domain to the process. This is used to prewarm CoreText font database. Initialization (which involves lots of blocking IPC) happens outside the main thread so the fonts are ready to use when needed. * WebCore.xcodeproj/project.pbxproj: * page/PrewarmInformation.h: Added. (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): Add data structure for prewarm information with encode/decode support. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): Prewarming interface to be used from WebKit. * page/ProcessWarming.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::FontDatabase::clear): Add mutex for thread safe access. (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::collectPrewarmInformation const): Collect font families seen by this process. (WebCore::FontCache::prewarm): Prewarm FontDatabase in a dispatch queue. Source/WebKit: Add mechanism for caching prewarm information per domain on UI process side. This information is then passed to newly initialized web processes that are being used for the same domain. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Pass prewarm information on process swap to the new process. (WebKit::WebProcessPool::didCollectPrewarmInformation): UI process side cache. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): (WebKit::WebPage::didReceivePolicyDecision): Collect and cache prewarm information for the previous process on process swap. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prewarmGlobally): Renamed for clarity. (WebKit::WebProcess::prewarmWithDomainInformation): (WebKit::WebProcess::sendPrewarmInformation): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Canonical link: https://commits.webkit.org/205342@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-09 09:14:37 +00:00
};
template<class Encoder>
void PrewarmInformation::encode(Encoder& encoder) const
{
[PSON] Prewarm system fallback fonts https://bugs.webkit.org/show_bug.cgi?id=190517 Reviewed by Ryosuke Niwa. This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages after process swaps. * page/PrewarmInformation.h: (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: (WebCore::FontCache::PrewarmInformation::isolatedCopy const): (WebCore::FontCache::PrewarmInformation::encode const): (WebCore::FontCache::PrewarmInformation::decode): Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontCache::systemFallbackForCharacters): Collect the names of fonts that end up needing character specific system fallbacks. (WebCore::FontCache::collectPrewarmInformation const): Include them into prewarm information. (WebCore::FontCache::prewarm): Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully prewarm it for fallbacks (independent of size, locale or other characteristics). Any future calls to systemFallbackForCharacters are fast. Canonical link: https://commits.webkit.org/205490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 16:02:35 +00:00
encoder << fontCache;
Prewarm FontDatabase on process swap https://bugs.webkit.org/show_bug.cgi?id=190312 Reviewed by Chris Dumez. Source/WebCore: Implement basic prewarming of FontDatabase. When the domain of the first page load on a new process is known we pass the list of font families previous used by that domain to the process. This is used to prewarm CoreText font database. Initialization (which involves lots of blocking IPC) happens outside the main thread so the fonts are ready to use when needed. * WebCore.xcodeproj/project.pbxproj: * page/PrewarmInformation.h: Added. (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): Add data structure for prewarm information with encode/decode support. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): Prewarming interface to be used from WebKit. * page/ProcessWarming.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::FontDatabase::clear): Add mutex for thread safe access. (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::collectPrewarmInformation const): Collect font families seen by this process. (WebCore::FontCache::prewarm): Prewarm FontDatabase in a dispatch queue. Source/WebKit: Add mechanism for caching prewarm information per domain on UI process side. This information is then passed to newly initialized web processes that are being used for the same domain. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Pass prewarm information on process swap to the new process. (WebKit::WebProcessPool::didCollectPrewarmInformation): UI process side cache. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): (WebKit::WebPage::didReceivePolicyDecision): Collect and cache prewarm information for the previous process on process swap. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prewarmGlobally): Renamed for clarity. (WebKit::WebProcess::prewarmWithDomainInformation): (WebKit::WebProcess::sendPrewarmInformation): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Canonical link: https://commits.webkit.org/205342@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-09 09:14:37 +00:00
}
template<class Decoder>
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<PrewarmInformation> PrewarmInformation::decode(Decoder& decoder)
Prewarm FontDatabase on process swap https://bugs.webkit.org/show_bug.cgi?id=190312 Reviewed by Chris Dumez. Source/WebCore: Implement basic prewarming of FontDatabase. When the domain of the first page load on a new process is known we pass the list of font families previous used by that domain to the process. This is used to prewarm CoreText font database. Initialization (which involves lots of blocking IPC) happens outside the main thread so the fonts are ready to use when needed. * WebCore.xcodeproj/project.pbxproj: * page/PrewarmInformation.h: Added. (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): Add data structure for prewarm information with encode/decode support. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): Prewarming interface to be used from WebKit. * page/ProcessWarming.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::FontDatabase::clear): Add mutex for thread safe access. (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::collectPrewarmInformation const): Collect font families seen by this process. (WebCore::FontCache::prewarm): Prewarm FontDatabase in a dispatch queue. Source/WebKit: Add mechanism for caching prewarm information per domain on UI process side. This information is then passed to newly initialized web processes that are being used for the same domain. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Pass prewarm information on process swap to the new process. (WebKit::WebProcessPool::didCollectPrewarmInformation): UI process side cache. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): (WebKit::WebPage::didReceivePolicyDecision): Collect and cache prewarm information for the previous process on process swap. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prewarmGlobally): Renamed for clarity. (WebKit::WebProcess::prewarmWithDomainInformation): (WebKit::WebProcess::sendPrewarmInformation): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Canonical link: https://commits.webkit.org/205342@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-09 09:14:37 +00:00
{
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<FontCache::PrewarmInformation> fontCachePrewarmInformation;
[PSON] Prewarm system fallback fonts https://bugs.webkit.org/show_bug.cgi?id=190517 Reviewed by Ryosuke Niwa. This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages after process swaps. * page/PrewarmInformation.h: (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: (WebCore::FontCache::PrewarmInformation::isolatedCopy const): (WebCore::FontCache::PrewarmInformation::encode const): (WebCore::FontCache::PrewarmInformation::decode): Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontCache::systemFallbackForCharacters): Collect the names of fonts that end up needing character specific system fallbacks. (WebCore::FontCache::collectPrewarmInformation const): Include them into prewarm information. (WebCore::FontCache::prewarm): Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully prewarm it for fallbacks (independent of size, locale or other characteristics). Any future calls to systemFallbackForCharacters are fast. Canonical link: https://commits.webkit.org/205490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 16:02:35 +00:00
decoder >> fontCachePrewarmInformation;
if (!fontCachePrewarmInformation)
Prewarm FontDatabase on process swap https://bugs.webkit.org/show_bug.cgi?id=190312 Reviewed by Chris Dumez. Source/WebCore: Implement basic prewarming of FontDatabase. When the domain of the first page load on a new process is known we pass the list of font families previous used by that domain to the process. This is used to prewarm CoreText font database. Initialization (which involves lots of blocking IPC) happens outside the main thread so the fonts are ready to use when needed. * WebCore.xcodeproj/project.pbxproj: * page/PrewarmInformation.h: Added. (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): Add data structure for prewarm information with encode/decode support. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): Prewarming interface to be used from WebKit. * page/ProcessWarming.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::FontDatabase::clear): Add mutex for thread safe access. (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::collectPrewarmInformation const): Collect font families seen by this process. (WebCore::FontCache::prewarm): Prewarm FontDatabase in a dispatch queue. Source/WebKit: Add mechanism for caching prewarm information per domain on UI process side. This information is then passed to newly initialized web processes that are being used for the same domain. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Pass prewarm information on process swap to the new process. (WebKit::WebProcessPool::didCollectPrewarmInformation): UI process side cache. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): (WebKit::WebPage::didReceivePolicyDecision): Collect and cache prewarm information for the previous process on process swap. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prewarmGlobally): Renamed for clarity. (WebKit::WebProcess::prewarmWithDomainInformation): (WebKit::WebProcess::sendPrewarmInformation): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Canonical link: https://commits.webkit.org/205342@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-09 09:14:37 +00:00
return { };
[PSON] Prewarm system fallback fonts https://bugs.webkit.org/show_bug.cgi?id=190517 Reviewed by Ryosuke Niwa. This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages after process swaps. * page/PrewarmInformation.h: (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: (WebCore::FontCache::PrewarmInformation::isolatedCopy const): (WebCore::FontCache::PrewarmInformation::encode const): (WebCore::FontCache::PrewarmInformation::decode): Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontCache::systemFallbackForCharacters): Collect the names of fonts that end up needing character specific system fallbacks. (WebCore::FontCache::collectPrewarmInformation const): Include them into prewarm information. (WebCore::FontCache::prewarm): Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully prewarm it for fallbacks (independent of size, locale or other characteristics). Any future calls to systemFallbackForCharacters are fast. Canonical link: https://commits.webkit.org/205490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 16:02:35 +00:00
return PrewarmInformation { WTFMove(*fontCachePrewarmInformation) };
Prewarm FontDatabase on process swap https://bugs.webkit.org/show_bug.cgi?id=190312 Reviewed by Chris Dumez. Source/WebCore: Implement basic prewarming of FontDatabase. When the domain of the first page load on a new process is known we pass the list of font families previous used by that domain to the process. This is used to prewarm CoreText font database. Initialization (which involves lots of blocking IPC) happens outside the main thread so the fonts are ready to use when needed. * WebCore.xcodeproj/project.pbxproj: * page/PrewarmInformation.h: Added. (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): Add data structure for prewarm information with encode/decode support. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): Prewarming interface to be used from WebKit. * page/ProcessWarming.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::FontDatabase::clear): Add mutex for thread safe access. (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::collectPrewarmInformation const): Collect font families seen by this process. (WebCore::FontCache::prewarm): Prewarm FontDatabase in a dispatch queue. Source/WebKit: Add mechanism for caching prewarm information per domain on UI process side. This information is then passed to newly initialized web processes that are being used for the same domain. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Pass prewarm information on process swap to the new process. (WebKit::WebProcessPool::didCollectPrewarmInformation): UI process side cache. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): (WebKit::WebPage::didReceivePolicyDecision): Collect and cache prewarm information for the previous process on process swap. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::prewarmGlobally): Renamed for clarity. (WebKit::WebProcess::prewarmWithDomainInformation): (WebKit::WebProcess::sendPrewarmInformation): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Canonical link: https://commits.webkit.org/205342@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-09 09:14:37 +00:00
}
}