2022-04-20 Alan Coon Cherry-pick r289100. rdar://problem/79950080 Teach VideoFullscreenInterface to keep track of its corresponding MediaPlayer's MediaPlayerIdentifier https://bugs.webkit.org/show_bug.cgi?id=236090 Reviewed by Eric Carlson. Source/WebCore: Add plumbing for an optional MediaPlayerIdentifier through the video fullscreen model. This identifier is invalidated upon `loadstart`, and updated once we observe `loadedmetadata`, which ensures that if the media engine (and media player) changes out from underneath the video fullscreen model, we still keep the new player ID up to date. See WebKit/ChangeLog for more details. * platform/cocoa/VideoFullscreenModel.h: (WebCore::VideoFullscreenModelClient::setPlayerIdentifier): * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::updateForEventName): (WebCore::VideoFullscreenModelVideoElement::observedEventNames): Additionally listen for `loadstartEvent` and `loadedmetadataEvent` (see above). (WebCore::VideoFullscreenModelVideoElement::setPlayerIdentifier): * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/mac/VideoFullscreenInterfaceMac.h: (WebCore::VideoFullscreenInterfaceMac::playerIdentifier const): Source/WebKit: Add an IPC message between VideoFullscreenManager and VideoFullscreenManagerProxy to update the media player ID corresponding to a given PlaybackSessionContextIdentifier. This is sent if the underlying media player changes (and subsequently fires `loadstart` and `loadedmetadata` events), and also sent upon entering fullscreen video. In a future patch, this mechanism will be used to teach VideoFullscreenManagerProxy to grab an image bitmap from the GPU process for a given PlaybackSessionContextIdentifier. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::setPlayerIdentifier): * WebProcess/cocoa/VideoFullscreenManager.h: * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenInterfaceContext::setPlayerIdentifier): (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::setPlayerIdentifier): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289100 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-03 Wenson Hsieh Teach VideoFullscreenInterface to keep track of its corresponding MediaPlayer's MediaPlayerIdentifier https://bugs.webkit.org/show_bug.cgi?id=236090 Reviewed by Eric Carlson. Add an IPC message between VideoFullscreenManager and VideoFullscreenManagerProxy to update the media player ID corresponding to a given PlaybackSessionContextIdentifier. This is sent if the underlying media player changes (and subsequently fires `loadstart` and `loadedmetadata` events), and also sent upon entering fullscreen video. In a future patch, this mechanism will be used to teach VideoFullscreenManagerProxy to grab an image bitmap from the GPU process for a given PlaybackSessionContextIdentifier. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::setPlayerIdentifier): * WebProcess/cocoa/VideoFullscreenManager.h: * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenInterfaceContext::setPlayerIdentifier): (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::setPlayerIdentifier): 2022-04-19 Alan Coon Cherry-pick r292049. rdar://problem/89104216 [macOS] Muted video is sometimes paused when entering fullscreen https://bugs.webkit.org/show_bug.cgi?id=238462 rdar://89104216 Reviewed by Jer Noble. Source/WebCore: Test: media/fullscreen-when-muted.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didMoveToNewDocument): Add logging. (WebCore::HTMLMediaElement::elementIsHidden const): Consider both element fullscreen and video fullscreen. (WebCore::HTMLMediaElement::visibilityStateChanged): Use elementIsHidden. (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const): Add logging for the one case that didn't have it. (WebCore::HTMLMediaElement::updateMediaPlayer): New, wrap MediaPlayer functions that are called frequently by RenderVideo so we can only call them when necessary. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::elementIsHidden const): Deleted. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::visibilityChanged): Just use elementIsHidden, it already accounts for fullscreen. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setVisibleInViewport): Do nothing when visibility is not changing. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPageIsVisible): Add logging. * rendering/RenderVideo.cpp: (WebCore::RenderVideo::updatePlayer): Call HTMLMediaElement::updateMediaPlayer instead of calling MediaPlayer directly. Source/WebKit: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::setPageIsVisible): Track visibility and do nothing when it doesn't change. (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio): Ditto for aspect ratio. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: LayoutTests: * media/fullscreen-when-muted-expected.txt: Added. * media/fullscreen-when-muted.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292049 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-29 Eric Carlson [macOS] Muted video is sometimes paused when entering fullscreen https://bugs.webkit.org/show_bug.cgi?id=238462 rdar://89104216 Reviewed by Jer Noble. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::setPageIsVisible): Track visibility and do nothing when it doesn't change. (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio): Ditto for aspect ratio. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 2022-04-19 Alan Coon Cherry-pick r292044. rdar://problem/86662565 Don't send sync RemoteMediaPlayerProxy messages that we know will fail https://bugs.webkit.org/show_bug.cgi?id=238467 rdar://86662565 Reviewed by Jer Noble. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::videoFrameForCurrentTime): Return early if readyState is less than HaveCurrentData, or if the first frame is not available. * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: (WebKit::MediaPlayerPrivateRemote::nativeImageForCurrentTime): Ditto. (WebKit::MediaPlayerPrivateRemote::colorSpace): Ditto. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292044 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-29 Eric Carlson Don't send sync RemoteMediaPlayerProxy messages that we know will fail https://bugs.webkit.org/show_bug.cgi?id=238467 rdar://86662565 Reviewed by Jer Noble. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::videoFrameForCurrentTime): Return early if readyState is less than HaveCurrentData, or if the first frame is not available. * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: (WebKit::MediaPlayerPrivateRemote::nativeImageForCurrentTime): Ditto. (WebKit::MediaPlayerPrivateRemote::colorSpace): Ditto. 2022-04-19 Alan Coon Cherry-pick r291606. rdar://problem/91446317 Website policies are not respected when doing COOP based process swap https://bugs.webkit.org/show_bug.cgi?id=238036 Reviewed by Chris Dumez. Source/WebKit: In case of normal process swap, we make use of website policies so everything is fine. For COOP based process swap, this happens later on, at a point where we lost website policies. To overcome this, we store the website policies used by a navigation inside the API::Navigation object. It is used by continueNavigationInNewProcess to correctly initialize the new WebPage website policies. We then set the website policies in the navigation object just before continuing the load in the same process, as process swap may happen later when inspecting the response. Minor refactoring in continueNavigationInNewProcess to get the policies directly from the given Navigation object. Minor refactoring in receivedNavigationPolicyDecision to make the code doing process swap clearer. Covered by API test. * UIProcess/API/APINavigation.h: (API::Navigation::setWebsitePoliciesForProcessSwap): (API::Navigation::takeWebsitePoliciesForProcessSwap): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::triggerBrowsingContextGroupSwitchForNavigation): * UIProcess/WebPageProxy.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291606 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-22 Youenn Fablet Website policies are not respected when doing COOP based process swap https://bugs.webkit.org/show_bug.cgi?id=238036 Reviewed by Chris Dumez. In case of normal process swap, we make use of website policies so everything is fine. For COOP based process swap, this happens later on, at a point where we lost website policies. To overcome this, we store the website policies used by a navigation inside the API::Navigation object. It is used by continueNavigationInNewProcess to correctly initialize the new WebPage website policies. We then set the website policies in the navigation object just before continuing the load in the same process, as process swap may happen later when inspecting the response. Minor refactoring in continueNavigationInNewProcess to get the policies directly from the given Navigation object. Minor refactoring in receivedNavigationPolicyDecision to make the code doing process swap clearer. Covered by API test. * UIProcess/API/APINavigation.h: (API::Navigation::setWebsitePoliciesForProcessSwap): (API::Navigation::takeWebsitePoliciesForProcessSwap): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::triggerBrowsingContextGroupSwitchForNavigation): * UIProcess/WebPageProxy.h: 2022-04-19 Alan Coon Cherry-pick r291689. rdar://problem/88461772 REGRESSION (iOS 15.1 / r280824) QuickLook - model not loading when passing extra parameters https://bugs.webkit.org/show_bug.cgi?id=236069 Reviewed by Darin Adler. Source/WebCore: To extend the lifetime of Blob objects while loading/downloading is pending, we rely to BlobURLHandle objects, which tell the NetworkProcess that we still need this blob data, even if the corresponding Blob object gets GC'd by JS. The issue here is that the load was not using the vanilla blob URL but was intead appending a fragment to the URL. As a result, BlobRegistryImpl::registerBlobURLHandle() would fail to look up the corresponding blob data and would fail to extend its lifetime. To address the issue, BlobRegistryImpl::registerBlobURLHandle() / unregisterBlobURLHandle() now strip fragments from the blob URL, similarly to what was already done inside BlobRegistryImpl::getBlobDataFromURL(). Test: fast/files/blob-with-fragment-as-frame-url.html * platform/network/BlobRegistryImpl.cpp: (WebCore::blobURLWithoutFragment): (WebCore::BlobRegistryImpl::registerBlobURLHandle): (WebCore::BlobRegistryImpl::unregisterBlobURLHandle): Source/WebKit: Fix theoretical blob data leak. A WebContent process could create several BlobURLHandles for the same blob URL. This would result in several calls to NetworkConnectionToWebProcess::registerBlobURLHandle() for the same URL and several calls to to BlobRegistryImpl::registerBlobURLHandle() for the same URL as well. BlobRegistryImpl is using a HashCountedSet for m_blobReferences in order to deal with this fact. However, NetworkConnectionToWebProcess was using a simple HashSet for m_blobURLHandles. As a result, if the WebContent process would exit and didClose() would get called, the NetworkConnectionToWebProcess may call BlobRegistryImpl::unregisterBlobURLHandle() only once even though the WebContent process had several handles for this URL, which would not fully remove the URL from BlobRegistryImpl's HashCountedSet. To address the issue, NetworkConnectionToWebProcess::m_blobURLHandles is now a HashCountedSet too and we call BlobRegistryImpl::unregisterBlobURLHandle() as many times as needed in didClose(). * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): * NetworkProcess/NetworkConnectionToWebProcess.h: LayoutTests: Add layout test coverage. * fast/files/blob-with-fragment-as-frame-url-expected.txt: Added. * fast/files/blob-with-fragment-as-frame-url.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291689 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-22 Chris Dumez REGRESSION (iOS 15.1 / r280824) QuickLook - model not loading when passing extra parameters https://bugs.webkit.org/show_bug.cgi?id=236069 Reviewed by Darin Adler. Fix theoretical blob data leak. A WebContent process could create several BlobURLHandles for the same blob URL. This would result in several calls to NetworkConnectionToWebProcess::registerBlobURLHandle() for the same URL and several calls to to BlobRegistryImpl::registerBlobURLHandle() for the same URL as well. BlobRegistryImpl is using a HashCountedSet for m_blobReferences in order to deal with this fact. However, NetworkConnectionToWebProcess was using a simple HashSet for m_blobURLHandles. As a result, if the WebContent process would exit and didClose() would get called, the NetworkConnectionToWebProcess may call BlobRegistryImpl::unregisterBlobURLHandle() only once even though the WebContent process had several handles for this URL, which would not fully remove the URL from BlobRegistryImpl's HashCountedSet. To address the issue, NetworkConnectionToWebProcess::m_blobURLHandles is now a HashCountedSet too and we call BlobRegistryImpl::unregisterBlobURLHandle() as many times as needed in didClose(). * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): * NetworkProcess/NetworkConnectionToWebProcess.h: 2022-04-19 Alan Coon Cherry-pick r291371. rdar://problem/72058321 CoreIPC Hardening: Add user gesture check when saving images https://bugs.webkit.org/show_bug.cgi?id=237839 Reviewed by Chris Dumez. Add check to confirm that attempts to store images in the user's Photo Library and attempts to store data in the pasteboard were triggered by a user gesture. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::writePromisedAttachmentToPasteboard): Message check the authorization token before performing the write. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::isValidPerformActionOnElementAuthorizationToken const): Added. (WebKit::WebPageProxy::performActionOnElement): Added. (WebKit::WebPageProxy::saveImageToLibrary): Message check the authorization token before performing the save. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performActionOnElement): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291371 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-16 Brent Fulgham CoreIPC Hardening: Add user gesture check when saving images https://bugs.webkit.org/show_bug.cgi?id=237839 Reviewed by Chris Dumez. Add check to confirm that attempts to store images in the user's Photo Library and attempts to store data in the pasteboard were triggered by a user gesture. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::writePromisedAttachmentToPasteboard): Message check the authorization token before performing the write. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::isValidPerformActionOnElementAuthorizationToken const): Added. (WebKit::WebPageProxy::performActionOnElement): Added. (WebKit::WebPageProxy::saveImageToLibrary): Message check the authorization token before performing the save. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performActionOnElement): 2022-04-19 Alan Coon Cherry-pick r290874. rdar://problem/84869202 Push HTMLMediaElement renderer's contentBox rect to GPU process https://bugs.webkit.org/show_bug.cgi?id=237444 rdar://84869202 Reviewed by Jer Noble. Source/WebCore: No new tests. This is a speculative fix, with new logging, for an issue I haven't been able to reproduce. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updateRenderer): Push mediaPlayerContentBoxRect to the media player. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::playerContentBoxRectChanged): Pass rect to platform player. * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::playerContentBoxRectChanged): Source/WebKit: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): Configuration now has playerContentBoxRect. (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): (WebKit::RemoteMediaPlayerProxy::playerContentBoxRectChanged): Update playerContentBoxRect. * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: (WebKit::RemoteMediaPlayerProxyConfiguration::encode const): (WebKit::RemoteMediaPlayerProxyConfiguration::decode): * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm: (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeIfPossible): Convert from static function so we can log. (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable): Add logging. (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged): Ditto. (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced): Ditto. (WebKit::setVideoInlineSizeIfPossible): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::playerContentBoxRectChanged): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290874 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-06 Eric Carlson Push HTMLMediaElement renderer's contentBox rect to GPU process https://bugs.webkit.org/show_bug.cgi?id=237444 rdar://84869202 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): Configuration now has playerContentBoxRect. (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): (WebKit::RemoteMediaPlayerProxy::playerContentBoxRectChanged): Update playerContentBoxRect. * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: (WebKit::RemoteMediaPlayerProxyConfiguration::encode const): (WebKit::RemoteMediaPlayerProxyConfiguration::decode): * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm: (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeIfPossible): Convert from static function so we can log. (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable): Add logging. (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged): Ditto. (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced): Ditto. (WebKit::setVideoInlineSizeIfPossible): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::playerContentBoxRectChanged): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 2022-04-18 Kocsen Chung Cherry-pick r292846. rdar://problem/88965550 Adjust when _setPrivacyProxyFailClosedForUnreachableNonMainHosts is called https://bugs.webkit.org/show_bug.cgi?id=237735 Reviewed by Geoff Garen. This is recommitting http://trac.webkit.org/r291598 but leaving the definition of PrivateRelayed::Yes and ::No based on whether metrics._privacyStance == nw_connection_privacy_stance_direct instead of nw_connection_privacy_stance_failed. It has flip flopped several times in the various related commits, but it needs to be nw_connection_privacy_stance_direct. I manually verified that this fixes without reintroducing . * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (WebKit::NetworkSessionCocoa::createWebSocketTask): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292846 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-04-13 Alex Christensen Adjust when _setPrivacyProxyFailClosedForUnreachableNonMainHosts is called https://bugs.webkit.org/show_bug.cgi?id=237735 Reviewed by Geoff Garen. This is recommitting http://trac.webkit.org/r291598 but leaving the definition of PrivateRelayed::Yes and ::No based on whether metrics._privacyStance == nw_connection_privacy_stance_direct instead of nw_connection_privacy_stance_failed. It has flip flopped several times in the various related commits, but it needs to be nw_connection_privacy_stance_direct. I manually verified that this fixes without reintroducing . * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (WebKit::NetworkSessionCocoa::createWebSocketTask): 2022-04-18 Kocsen Chung Cherry-pick r292401. rdar://problem/83168970 5 Media API tests are flakily timing out on iOS14 https://bugs.webkit.org/show_bug.cgi?id=230321 Reviewed by Jer Noble. Source/WebKit: Un-skipped API test WKWebViewPausePlayingAudioTests.OutOfWindow * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationWillEnterForegroundForMedia): Log the correct name. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationDidEnterBackgroundForMedia): Call PlatformMediaSessionManager. (WebKit::WebPage::applicationWillEnterForegroundForMedia): Ditto. Tools: * TestWebKitAPI/Tests/ios/WKWebViewPausePlayingAudioTests.mm: (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292401 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-04-05 Eric Carlson 5 Media API tests are flakily timing out on iOS14 https://bugs.webkit.org/show_bug.cgi?id=230321 Reviewed by Jer Noble. Un-skipped API test WKWebViewPausePlayingAudioTests.OutOfWindow * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationWillEnterForegroundForMedia): Log the correct name. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationDidEnterBackgroundForMedia): Call PlatformMediaSessionManager. (WebKit::WebPage::applicationWillEnterForegroundForMedia): Ditto. 2022-04-18 Kocsen Chung Cherry-pick r292319. rdar://problem/89916360 Remove display list map entry before remote resource https://bugs.webkit.org/show_bug.cgi?id=238764 Reviewed by Simon Fraser. * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::clearImageBufferReference): * GPUProcess/graphics/RemoteDisplayListRecorder.h: * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::releaseRemoteResourceWithQualifiedIdentifier): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292319 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-04-04 Cameron McCormack Remove display list map entry before remote resource https://bugs.webkit.org/show_bug.cgi?id=238764 Reviewed by Simon Fraser. * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::clearImageBufferReference): * GPUProcess/graphics/RemoteDisplayListRecorder.h: * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::releaseRemoteResourceWithQualifiedIdentifier): 2022-04-15 Alan Coon Cherry-pick r292431. rdar://problem/90677955 Revert r291598 https://bugs.webkit.org/show_bug.cgi?id=238842 Reviewed by Geoff Garen. It caused some problems and needs further analysis. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::createWebSocketTask): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292431 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-04-05 Alex Christensen Revert r291598 https://bugs.webkit.org/show_bug.cgi?id=238842 Reviewed by Geoff Garen. It caused some problems and needs further analysis. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::createWebSocketTask): 2022-04-15 Russell Epstein Apply patch. rdar://problem/84869202 2022-03-03 Eric Carlson Push HTMLMediaElement renderer's contentBox rect to GPU process https://bugs.webkit.org/show_bug.cgi?id=237444 rdar://84869202 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): Configuration now has playerContentBoxRect. (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): (WebKit::RemoteMediaPlayerProxy::playerContentBoxRectChanged): Update playerContentBoxRect. * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: (WebKit::RemoteMediaPlayerProxyConfiguration::encode const): (WebKit::RemoteMediaPlayerProxyConfiguration::decode): * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm: (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeIfPossible): Convert from static function so we can log. (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable): Add logging. (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged): Ditto. (WebKit::RemoteMediaPlayerProxy::setVideoInlineSizeFenced): Ditto. (WebKit::setVideoInlineSizeIfPossible): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::playerContentBoxRectChanged): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 2022-04-07 Alan Coon Cherry-pick r291881. rdar://problem/90848454 [GPU Process] RemoteRenderingBackend::stopListeningForIPC() should not change the RemoteResourceCache on the main thread https://bugs.webkit.org/show_bug.cgi?id=238298 rdar://90731372 Reviewed by Simon Fraser. To release the RemoteResourceCache and the rendering resource request on the WorkQueue thread, RemoteRenderingBackend::stopListeningForIPC() dispatches an empty lambda to its WorkQueue but m_renderingResourcesRequest and m_remoteResourceCache are captured by-move to initializers to this lambda. But this means m_remoteResourceCache is changed on the main thread while the WorkQueue thread may be accessing it to get a cached remote resource. The EWS crashes showed that, RemoteRenderingBackend::stopListeningForIPC() on the main thread is waiting its WorkQueue to stop and complete all its work including the dispatched empty lambda. And the WorkQueue thread is getting wrong resource counters from the RemoteResourceCache. This would happen if the HashMaps of RemoteResourceCache were emptied on the main thread while the counters had outdated values. To fix this thread safety issue, the RemoteResourceCache should not ever be changed on the main thread. Since capturing by-move is kind of change, we will capture m_renderingResourcesRequest and m_remoteResourceCache by reference and we let the dispatched lambda explicitly releases them on the WorkQueue thread. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::stopListeningForIPC): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291881 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-25 Said Abou-Hallawa [GPU Process] RemoteRenderingBackend::stopListeningForIPC() should not change the RemoteResourceCache on the main thread https://bugs.webkit.org/show_bug.cgi?id=238298 rdar://90731372 Reviewed by Simon Fraser. To release the RemoteResourceCache and the rendering resource request on the WorkQueue thread, RemoteRenderingBackend::stopListeningForIPC() dispatches an empty lambda to its WorkQueue but m_renderingResourcesRequest and m_remoteResourceCache are captured by-move to initializers to this lambda. But this means m_remoteResourceCache is changed on the main thread while the WorkQueue thread may be accessing it to get a cached remote resource. The EWS crashes showed that, RemoteRenderingBackend::stopListeningForIPC() on the main thread is waiting its WorkQueue to stop and complete all its work including the dispatched empty lambda. And the WorkQueue thread is getting wrong resource counters from the RemoteResourceCache. This would happen if the HashMaps of RemoteResourceCache were emptied on the main thread while the counters had outdated values. To fix this thread safety issue, the RemoteResourceCache should not ever be changed on the main thread. Since capturing by-move is kind of change, we will capture m_renderingResourcesRequest and m_remoteResourceCache by reference and we let the dispatched lambda explicitly releases them on the WorkQueue thread. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::stopListeningForIPC): 2022-04-07 Alan Coon Cherry-pick r291821. rdar://problem/89145552 REGRESSION(r286590): Links with URL schemes are not clickable in Mail https://bugs.webkit.org/show_bug.cgi?id=238262 Reviewed by Geoffrey Garen. This feature requires access to the Launch Services daemon in Mail and other apps on iOS. This patch is a partial revert of r286590. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::nonBrowserServices): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291821 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-24 Per Arne Vollan REGRESSION(r286590): Links with URL schemes are not clickable in Mail https://bugs.webkit.org/show_bug.cgi?id=238262 Reviewed by Geoffrey Garen. This feature requires access to the Launch Services daemon in Mail and other apps on iOS. This patch is a partial revert of r286590. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::nonBrowserServices): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2022-03-31 Alan Coon Apply patch. rdar://problem/90957287 2022-03-11 J Pascoe [WebAuthn] Cancel running operations in ASA on navigation https://bugs.webkit.org/show_bug.cgi?id=237452 rdar://problem/89781990 Reviewed by Brent Fulgham. Pre-ASA WebAuthn calls cancel requests on navigation via calling authenticatorManager.cancelRequest in WebPageProxy. In WebAuthn calls that go through ASA, the authenticatorManager lives in the ASA process, so calls won't be cancelled on navigation. This patch attempts to cancel ongoing operations whenever a WebAuthenticatorCoordinatorProxy that uses ASA is destroyed, effectively cancelling requests on reload or navigation. * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::~WebAuthenticatorCoordinatorProxy): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: 2022-03-31 Alan Coon Apply patch. rdar://problem/90957317 2022-03-08 J Pascoe [WebAuthn] Using WebAuthn within cross-origin iframe elements https://bugs.webkit.org/show_bug.cgi?id=222240 rdar://problem/74830748 Reviewed by Brent Fulgham. This patch relaxes the requirement to perform a Web Authentication assertion inside an i-frame with the "publickey-credentials-get" feature policy from 'same-site' to 'cross-origin with consent'. There is an additional requirement that there is only a single cross-origin parent to present to the user in the prompt. If we can't display the updated prompt, then cross-origin assertions are not allowed. * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::configureAssertionOptions): (WebKit::configurationAssertionRequestContext): (WebKit::WebAuthenticatorCoordinatorProxy::contextForRequest): * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::getAssertion): * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h: 2022-03-29 Alan Coon Cherry-pick r290371. rdar://problem/88652375 Call WKNavigationDelegate.didFailProvisionalNavigation even after a cross-origin navigation with COOP https://bugs.webkit.org/show_bug.cgi?id=237071 Patch by Alex Christensen on 2022-02-23 Reviewed by Chris Dumez. Source/WebKit: There was an assumption that this callback wasn't needed in this case, but it is. Covered by an API test that verifies the callback is received. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): Tools: * TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm: (TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290371 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-23 Alex Christensen Call WKNavigationDelegate.didFailProvisionalNavigation even after a cross-origin navigation with COOP https://bugs.webkit.org/show_bug.cgi?id=237071 Reviewed by Chris Dumez. There was an assumption that this callback wasn't needed in this case, but it is. Covered by an API test that verifies the callback is received. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): 2022-03-29 Alan Coon Apply patch. rdar://problem/89997669 2022-02-14 Kimmo Kinnunen ExtensionsGL is not useful class, it should be removed https://bugs.webkit.org/show_bug.cgi?id=236490 Move the RemoteGraphicsContextGLProxyBase functions to RemoteGraphicsContextGL. The ..Base can now be removed as ExtensionGL is removed. Reviewed by Dean Jackson. * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::workQueueInitialize): (WebKit::RemoteGraphicsContextGL::ensureExtensionEnabled): (WebKit::RemoteGraphicsContextGL::markContextChanged): * GPUProcess/graphics/RemoteGraphicsContextGL.h: * GPUProcess/graphics/RemoteGraphicsContextGL.messages.in: * GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h: (getGraphicsResetStatusARB): (getTranslatedShaderSourceANGLE): (drawBuffersEXT): * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy): (WebKit::RemoteGraphicsContextGLProxy::setContextVisibility): (WebKit::RemoteGraphicsContextGLProxy::isGLES2Compliant const): (WebKit::RemoteGraphicsContextGLProxy::markContextChanged): (WebKit::RemoteGraphicsContextGLProxy::supportsExtension): (WebKit::RemoteGraphicsContextGLProxy::ensureExtensionEnabled): (WebKit::RemoteGraphicsContextGLProxy::isExtensionEnabled): (WebKit::RemoteGraphicsContextGLProxy::initialize): (WebKit::RemoteGraphicsContextGLProxy::reshape): * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h: 2022-03-29 Russell Epstein Cherry-pick r290840. rdar://problem/90957274 [WebAuthn] Don't use decidePolicyForLocalAuthenticator for Web Authentication Modern https://bugs.webkit.org/show_bug.cgi?id=225646 rdar://78147681 Reviewed by Brent Fulgham. decidePolicyForLocalAuthenticator is not implemented for the _WKWebAuthenticationPanelDelegate used for modern because the prompt to allow Touch/FaceID comes earlier in the process. * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::makeCredential): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290840 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-04 J Pascoe [WebAuthn] Don't use decidePolicyForLocalAuthenticator for Web Authentication Modern https://bugs.webkit.org/show_bug.cgi?id=225646 rdar://78147681 Reviewed by Brent Fulgham. decidePolicyForLocalAuthenticator is not implemented for the _WKWebAuthenticationPanelDelegate used for modern because the prompt to allow Touch/FaceID comes earlier in the process. * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::makeCredential): 2022-03-29 Alex Christensen Revert r292055 ​https://bugs.webkit.org/show_bug.cgi?id=186919 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): 2022-03-29 Alex Christensen Navigation Timing data is corrupt in WebView (UIWebView/WKWebView) https://bugs.webkit.org/show_bug.cgi?id=186919 Reviewed by Simon Fraser. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): 2022-03-29 Alan Coon Cherry-pick r292042. rdar://problem/89434696 Unreviewed, fix UAF after r291980 Source/WebCore: * page/FrameView.h: (WebCore::FrameView::overrideSizeForCSSDefaultViewportUnits): Added. (WebCore::FrameView::overrideSizeForCSSSmallViewportUnits): Added. (WebCore::FrameView::overrideSizeForCSSLargeViewportUnits): Added. * page/FrameView.cpp: (WebCore::FrameView::setSizeForCSSDefaultViewportUnits): (WebCore::FrameView::overrideWidthForCSSDefaultViewportUnits): (WebCore::FrameView::resetOverriddenWidthForCSSDefaultViewportUnits): (WebCore::FrameView::setOverrideSizeForCSSDefaultViewportUnits): Renamed from `overrideSizeForCSSDefaultViewportUnits`. (WebCore::FrameView::setSizeForCSSSmallViewportUnits): (WebCore::FrameView::overrideWidthForCSSSmallViewportUnits): (WebCore::FrameView::resetOverriddenWidthForCSSSmallViewportUnits): (WebCore::FrameView::setOverrideSizeForCSSSmallViewportUnits): Renamed from `overrideSizeForCSSSmallViewportUnits`. (WebCore::FrameView::setSizeForCSSLargeViewportUnits): (WebCore::FrameView::overrideWidthForCSSLargeViewportUnits): (WebCore::FrameView::resetOverriddenWidthForCSSLargeViewportUnits): (WebCore::FrameView::setOverrideSizeForCSSLargeViewportUnits): Renamed from `overrideSizeForCSSLargeViewportUnits`. (WebCore::FrameView::copyCSSViewportSizeOverrides): Deleted. Expose `OverrideViewportSize` so that we can copy those members specifically instead of having to keep alive the old `FrameView` when transitioning to a new page. Source/WebKit: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Expose `OverrideViewportSize` so that we can copy those members specifically instead of having to keep alive the old `FrameView` when transitioning to a new page. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292042 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-29 Devin Rousso Unreviewed, fix UAF after r291980 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Expose `OverrideViewportSize` so that we can copy those members specifically instead of having to keep alive the old `FrameView` when transitioning to a new page. 2022-03-29 Alan Coon Cherry-pick r291980. rdar://problem/89434696 [iOS] Add `WKWebView` API to control CSS "small viewport" `sv*` and "large viewport" `lv*` units https://bugs.webkit.org/show_bug.cgi?id=237979 Reviewed by Tim Horton. Source/WebCore: Tests: CSSViewportUnits.NegativeMinimumViewportInset CSSViewportUnits.NegativeMaximumViewportInset CSSViewportUnits.MinimumViewportInsetLargerThanMaximumViewportInset CSSViewportUnits.MinimumViewportInsetLargerThanFrame CSSViewportUnits.MaximumViewportInsetLargerThanFrame CSSViewportUnits.MinimumViewportInset CSSViewportUnits.MaximumViewportInset CSSViewportUnits.MinimumViewportInsetWithZoom CSSViewportUnits.MaximumViewportInsetWithZoom CSSViewportUnits.MinimumViewportInsetWithWritingMode CSSViewportUnits.MaximumViewportInsetWithWritingMode CSSViewportUnits.MinimumViewportInsetWithFrame CSSViewportUnits.MaximumViewportInsetWithFrame CSSViewportUnits.MinimumViewportInsetWithBounds CSSViewportUnits.MaximumViewportInsetWithBounds CSSViewportUnits.MinimumViewportInsetWithContentInset CSSViewportUnits.MaximumViewportInsetWithContentInset CSSViewportUnits.MinimumViewportInsetWithSafeAreaInsets CSSViewportUnits.MaximumViewportInsetWithSafeAreaInsets CSSViewportUnits.UnobscuredSizeOverridesIgnoreMaximumViewportInsetAPI * page/FrameView.h: * page/FrameView.cpp: (WebCore::FrameView::performSizeToContentAutoSize): (WebCore::FrameView::enableAutoSizeMode): (WebCore::FrameView::clearSizeOverrideForCSSDefaultViewportUnits): Added. (WebCore::FrameView::setSizeForCSSDefaultViewportUnits): Added. (WebCore::FrameView::overrideWidthForCSSDefaultViewportUnits): Added. (WebCore::FrameView::resetOverriddenWidthForCSSDefaultViewportUnits): Added. (WebCore::FrameView::overrideSizeForCSSDefaultViewportUnits): Added. (WebCore::FrameView::sizeForCSSDefaultViewportUnits const): Renamed from `sizeForCSSDefaultViewportUnits`. (WebCore::FrameView::copyCSSViewportUnits const): Added. Add all the various methods for getting/setting/overriding/clearing an override value for CSS "default viewport" `v*` units. This allows for `WKWebView` clients to preserve existing behavior (where CSS "default viewport" `v*` units match the size of the `WKWebView`) while adding supporting CSS "small viewport" `sv*` units and CSS "large viewport" `lv*` units. Source/WebKit: Recently the W3C CSS working group added [some new unit types to CSS](https://drafts.csswg.org/css-values-4/#viewport-variants) with the goal of helping web developers better deal with browsers that have dynamic UI elements that change apperance/size/etc. based on user actions (e.g. the URL bar collapsing/"squishing" and expanding/"unsquishing" depending on whether the user has most recently scrolled/swiped down the page). These new units come in three categories: - the "large viewport" units (`lvw`, `lvh`, etc.) each represent 1% of one dimension of the size of the visual area of the page when all browser UI elements are in their smallest state (e.g. when the URL bar is collapsed/"squished") - the "small viewport" units (`svw`, `svh`, etc.) each represent 1% of one dimension of the size of the visual area of the page when all browser UI elements are in their largest state (e.g. when the URL bar is expanded/"unsquished") - the "dynamic viewport" units (`dvw`, `dvh`, etc.) each represent 1% of one dimension of the size of the current visual area of the page, which depends on the current state of all browser UI elements This way, developer could use `100svh` to ensure that no matter what state the browser UI elements are in the entire element will always be visible on the screen, or use `100dvh` to respond to browser UI element changes by automatically resizing various elements to always fully take advantage of the available space. Nothing needs to be added to support "dynamic viewport" `dv*` units as there already exists other methods to adjust the visual area of the `WKWebView` without adjusting its `frame` (e.g. `-[WKWebView setBounds:]`, `-[UIScrollView setContentInset:]`, etc.). But for "small viewport" `sv*` units and "large viewport" `lv*` units, however, there is unfortunately no way to tell a `WKWebView` anything like "this is the smallest/largest that this `WKWebView` will ever be", so there's no way to know ahead of time what the size of the visual area would be when all browser UI elements are in their smallest/largest state. As such, this patch adds a new API to allow for `WKWebView` clients to tell WebKit this information ahead of time. Note that there already exists the concept of "default viewport" units (`vw`, `vh`, etc.) that each represent 1% of one dimension of the size of the visual area of the page when all browser UI elements are in their default state. The behavior of these units remain the same, and the value can be changed via the existing `-[WKWebView setFrame:]`. Tests: CSSViewportUnits.NegativeMinimumViewportInset CSSViewportUnits.NegativeMaximumViewportInset CSSViewportUnits.MinimumViewportInsetLargerThanMaximumViewportInset CSSViewportUnits.MinimumViewportInsetLargerThanFrame CSSViewportUnits.MaximumViewportInsetLargerThanFrame CSSViewportUnits.MinimumViewportInset CSSViewportUnits.MaximumViewportInset CSSViewportUnits.MinimumViewportInsetWithZoom CSSViewportUnits.MaximumViewportInsetWithZoom CSSViewportUnits.MinimumViewportInsetWithWritingMode CSSViewportUnits.MaximumViewportInsetWithWritingMode CSSViewportUnits.MinimumViewportInsetWithFrame CSSViewportUnits.MaximumViewportInsetWithFrame CSSViewportUnits.MinimumViewportInsetWithBounds CSSViewportUnits.MaximumViewportInsetWithBounds CSSViewportUnits.MinimumViewportInsetWithContentInset CSSViewportUnits.MaximumViewportInsetWithContentInset CSSViewportUnits.MinimumViewportInsetWithSafeAreaInsets CSSViewportUnits.MaximumViewportInsetWithSafeAreaInsets CSSViewportUnits.UnobscuredSizeOverridesIgnoreMaximumViewportInsetAPI * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _recalculateViewportSizesWithMinimumViewportInset:maximumViewportInset:throwOnInvalidInput:]): Added. (-[WKWebView setMinimumViewportInset:maximumViewportInset:]): Added. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _processWillSwapOrDidExit]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _didCompleteAnimatedResize]): (-[WKWebView _setMinimumUnobscuredSizeOverride:]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _dispatchSetMinimumUnobscuredSize:]): Deleted. (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): Deleted. Recalculate the size for CSS "small viewport" `sv*` units whenever the `frame` changes. Also move the deduplication logic that prevents the same value from being sent to the WebProcess more than once to the setter methods on `WebPageProxy` so that it can be used by more than just iOS-only codepaths. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setDefaultUnobscuredSize): Added. (WebKit::WebPageProxy::setMinimumUnobscuredSize): Added. (WebKit::WebPageProxy::setMaximumUnobscuredSize): Added. (WebKit::WebPageProxy::creationParameters): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setMinimumUnobscuredSize): Deleted. (WebKit::WebPageProxy::setMaximumUnobscuredSize): Deleted. * Shared/WebPageCreationParameters.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::setViewportSizeForCSSViewportUnits): (WebKit::WebPage::setDefaultUnobscuredSize): Added. (WebKit::WebPage::setMinimumUnobscuredSize): Added. (WebKit::WebPage::setMaximumUnobscuredSize): Added. (WebKit::WebPage::updateSizeForCSSDefaultViewportUnits): Added. (WebKit::WebPage::updateSizeForCSSSmallViewportUnits): Added. (WebKit::WebPage::updateSizeForCSSLargeViewportUnits): Added. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::setMinimumUnobscuredSize): Deleted. (WebKit::WebPage::setMaximumUnobscuredSize): Deleted. (WebKit::WebPage::updateViewportSizeForCSSViewportUnits): Deleted. Add all the various methods for getting/setting/overriding/clearing an override value for CSS "default viewport" `v*` units. This allows for `WKWebView` clients to preserve existing behavior (where CSS "default viewport" `v*` units match the size of the `WKWebView`) while adding supporting CSS "small viewport" `sv*` units and CSS "large viewport" `lv*` units. Move iOS-only code to be for all platforms. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Propagate all viewport size overrides when a new `FrameView` is created. Tools: * TestWebKitAPI/Tests/WebKitCocoa/CSSViewportUnits.mm: (TEST.CSSViewportUnits.NegativeMinimumViewportInset): Added. (TEST.CSSViewportUnits.NegativeMaximumViewportInset): Added. (TEST.CSSViewportUnits.MinimumViewportInsetLargerThanMaximumViewportInset): Added. (TEST.CSSViewportUnits.MinimumViewportInsetLargerThanFrame): Added. (TEST.CSSViewportUnits.MaximumViewportInsetLargerThanFrame): Added. (TEST.CSSViewportUnits.MinimumViewportInset): Added. (TEST.CSSViewportUnits.MaximumViewportInset): Added. (TEST.CSSViewportUnits.MinimumViewportInsetWithZoom): Added. (TEST.CSSViewportUnits.MaximumViewportInsetWithZoom): Added. (TEST.CSSViewportUnits.MinimumViewportInsetWithWritingMode): Added. (TEST.CSSViewportUnits.MaximumViewportInsetWithWritingMode): Added. (TEST.CSSViewportUnits.MinimumViewportInsetWithFrame): Added. (TEST.CSSViewportUnits.MaximumViewportInsetWithFrame): Added. (TEST.CSSViewportUnits.MinimumViewportInsetWithBounds): Added. (TEST.CSSViewportUnits.MaximumViewportInsetWithBounds): Added. (TEST.CSSViewportUnits.MinimumViewportInsetWithContentInset): Added. (TEST.CSSViewportUnits.MaximumViewportInsetWithContentInset): Added. (TEST.CSSViewportUnits.MinimumViewportInsetWithSafeAreaInsets): Added. (TEST.CSSViewportUnits.MaximumViewportInsetWithSafeAreaInsets): Added. (TEST.CSSViewportUnits.UnobscuredSizeOverridesIgnoreMaximumViewportInsetAPI): Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291980 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-28 Devin Rousso [iOS] Add `WKWebView` API to control CSS "small viewport" `sv*` and "large viewport" `lv*` units https://bugs.webkit.org/show_bug.cgi?id=237979 Reviewed by Tim Horton. Recently the W3C CSS working group added [some new unit types to CSS](https://drafts.csswg.org/css-values-4/#viewport-variants) with the goal of helping web developers better deal with browsers that have dynamic UI elements that change apperance/size/etc. based on user actions (e.g. the URL bar collapsing/"squishing" and expanding/"unsquishing" depending on whether the user has most recently scrolled/swiped down the page). These new units come in three categories: - the "large viewport" units (`lvw`, `lvh`, etc.) each represent 1% of one dimension of the size of the visual area of the page when all browser UI elements are in their smallest state (e.g. when the URL bar is collapsed/"squished") - the "small viewport" units (`svw`, `svh`, etc.) each represent 1% of one dimension of the size of the visual area of the page when all browser UI elements are in their largest state (e.g. when the URL bar is expanded/"unsquished") - the "dynamic viewport" units (`dvw`, `dvh`, etc.) each represent 1% of one dimension of the size of the current visual area of the page, which depends on the current state of all browser UI elements This way, developer could use `100svh` to ensure that no matter what state the browser UI elements are in the entire element will always be visible on the screen, or use `100dvh` to respond to browser UI element changes by automatically resizing various elements to always fully take advantage of the available space. Nothing needs to be added to support "dynamic viewport" `dv*` units as there already exists other methods to adjust the visual area of the `WKWebView` without adjusting its `frame` (e.g. `-[WKWebView setBounds:]`, `-[UIScrollView setContentInset:]`, etc.). But for "small viewport" `sv*` units and "large viewport" `lv*` units, however, there is unfortunately no way to tell a `WKWebView` anything like "this is the smallest/largest that this `WKWebView` will ever be", so there's no way to know ahead of time what the size of the visual area would be when all browser UI elements are in their smallest/largest state. As such, this patch adds a new API to allow for `WKWebView` clients to tell WebKit this information ahead of time. Note that there already exists the concept of "default viewport" units (`vw`, `vh`, etc.) that each represent 1% of one dimension of the size of the visual area of the page when all browser UI elements are in their default state. The behavior of these units remain the same, and the value can be changed via the existing `-[WKWebView setFrame:]`. Tests: CSSViewportUnits.NegativeMinimumViewportInset CSSViewportUnits.NegativeMaximumViewportInset CSSViewportUnits.MinimumViewportInsetLargerThanMaximumViewportInset CSSViewportUnits.MinimumViewportInsetLargerThanFrame CSSViewportUnits.MaximumViewportInsetLargerThanFrame CSSViewportUnits.MinimumViewportInset CSSViewportUnits.MaximumViewportInset CSSViewportUnits.MinimumViewportInsetWithZoom CSSViewportUnits.MaximumViewportInsetWithZoom CSSViewportUnits.MinimumViewportInsetWithWritingMode CSSViewportUnits.MaximumViewportInsetWithWritingMode CSSViewportUnits.MinimumViewportInsetWithFrame CSSViewportUnits.MaximumViewportInsetWithFrame CSSViewportUnits.MinimumViewportInsetWithBounds CSSViewportUnits.MaximumViewportInsetWithBounds CSSViewportUnits.MinimumViewportInsetWithContentInset CSSViewportUnits.MaximumViewportInsetWithContentInset CSSViewportUnits.MinimumViewportInsetWithSafeAreaInsets CSSViewportUnits.MaximumViewportInsetWithSafeAreaInsets CSSViewportUnits.UnobscuredSizeOverridesIgnoreMaximumViewportInsetAPI * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _recalculateViewportSizesWithMinimumViewportInset:maximumViewportInset:throwOnInvalidInput:]): Added. (-[WKWebView setMinimumViewportInset:maximumViewportInset:]): Added. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _processWillSwapOrDidExit]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _didCompleteAnimatedResize]): (-[WKWebView _setMinimumUnobscuredSizeOverride:]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _dispatchSetMinimumUnobscuredSize:]): Deleted. (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): Deleted. Recalculate the size for CSS "small viewport" `sv*` units whenever the `frame` changes. Also move the deduplication logic that prevents the same value from being sent to the WebProcess more than once to the setter methods on `WebPageProxy` so that it can be used by more than just iOS-only codepaths. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setDefaultUnobscuredSize): Added. (WebKit::WebPageProxy::setMinimumUnobscuredSize): Added. (WebKit::WebPageProxy::setMaximumUnobscuredSize): Added. (WebKit::WebPageProxy::creationParameters): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setMinimumUnobscuredSize): Deleted. (WebKit::WebPageProxy::setMaximumUnobscuredSize): Deleted. * Shared/WebPageCreationParameters.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::setViewportSizeForCSSViewportUnits): (WebKit::WebPage::setDefaultUnobscuredSize): Added. (WebKit::WebPage::setMinimumUnobscuredSize): Added. (WebKit::WebPage::setMaximumUnobscuredSize): Added. (WebKit::WebPage::updateSizeForCSSDefaultViewportUnits): Added. (WebKit::WebPage::updateSizeForCSSSmallViewportUnits): Added. (WebKit::WebPage::updateSizeForCSSLargeViewportUnits): Added. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::setMinimumUnobscuredSize): Deleted. (WebKit::WebPage::setMaximumUnobscuredSize): Deleted. (WebKit::WebPage::updateViewportSizeForCSSViewportUnits): Deleted. Add all the various methods for getting/setting/overriding/clearing an override value for CSS "default viewport" `v*` units. This allows for `WKWebView` clients to preserve existing behavior (where CSS "default viewport" `v*` units match the size of the `WKWebView`) while adding supporting CSS "small viewport" `sv*` units and CSS "large viewport" `lv*` units. Move iOS-only code to be for all platforms. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Propagate all viewport size overrides when a new `FrameView` is created. 2022-03-28 Alan Coon Cherry-pick r291622. rdar://problem/90935942 Fetching a Blob URL with an unbounded Range header do not generate a Content-Range response header https://bugs.webkit.org/show_bug.cgi?id=238170 Reviewed by Eric Carlson. Source/WebCore: Test: fetch/fetch-blob-unbounded-range.html Handle the case where the request contains an unbounded range, and property calculate the rangeEnd to pass into ParsedContentRange. * platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::notifyResponseOnSuccess): Source/WebKit: Handle the case where the request contains an unbounded range, and property calculate the rangeEnd to pass into ParsedContentRange. * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): LayoutTests: * fetch/fetch-blob-unbounded-range-expected.txt: Added. * fetch/fetch-blob-unbounded-range.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291622 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-22 Jer Noble Fetching a Blob URL with an unbounded Range header do not generate a Content-Range response header https://bugs.webkit.org/show_bug.cgi?id=238170 Reviewed by Eric Carlson. Handle the case where the request contains an unbounded range, and property calculate the rangeEnd to pass into ParsedContentRange. * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): 2022-03-23 Alan Coon Cherry-pick r291057. rdar://problem/89291566 File System Access: disallows names that are not permitted by underlying file system https://bugs.webkit.org/show_bug.cgi?id=237635 rdar://89291566 We use FileSystem::fileSystemRepresentation to convert input name to a name that is permitted in current file system. This patch makes File System Access API to throw error if the input name does not match the converted name. Reviewed by Youenn Fablet. * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::isValidFileName): (WebKit::FileSystemStorageHandle::requestCreateHandle): (WebKit::FileSystemStorageHandle::removeEntry): (WebKit::FileSystemStorageHandle::move): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291057 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-09 Sihui Liu File System Access: disallows names that are not permitted by underlying file system https://bugs.webkit.org/show_bug.cgi?id=237635 rdar://89291566 We use FileSystem::fileSystemRepresentation to convert input name to a name that is permitted in current file system. This patch makes File System Access API to throw error if the input name does not match the converted name. Reviewed by Youenn Fablet. * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::isValidFileName): (WebKit::FileSystemStorageHandle::requestCreateHandle): (WebKit::FileSystemStorageHandle::removeEntry): (WebKit::FileSystemStorageHandle::move): 2022-03-23 Alan Coon Cherry-pick r290985. rdar://problem/78421282 Add a preference to mute video capture in case audio capture gets interrupted https://bugs.webkit.org/show_bug.cgi?id=237524 Reviewed by Eric Carlson. Source/WebCore: In case we detect that a microphone track source gets muted due to interruption, we mute capture video tracks based if allowed by the new MuteCameraOnMicrophoneInterruptionEnabled setting. Add support for mock microphone interruption and remove previous in process internals API. Test: fast/mediastream/media-stream-video-track-interrupted-from-audio.html * Modules/mediastream/MediaStreamTrack.cpp: * Modules/mediastream/MediaStreamTrack.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::setIsInterrupted): * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setMockCaptureDevicesInterrupted): (WebCore::MockRealtimeMediaSourceCenter::setMockCameraIsInterrupted): Deleted. * platform/mock/MockRealtimeMediaSourceCenter.h: Source/WebKit: Add support for interrupt mock microphone devices. Send to WebProcess sources whether sources are interrupted each time the source muted value changes. Store that value in remote sources. * GPUProcess/GPUProcess.cpp: * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * UIProcess/API/C/WKPage.cpp: * UIProcess/API/C/WKPagePrivate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * UIProcess/GPU/GPUProcessProxy.cpp: * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/RemoteRealtimeAudioSource.h: * WebProcess/cocoa/RemoteRealtimeDisplaySource.h: * WebProcess/cocoa/RemoteRealtimeMediaSourceProxy.cpp: * WebProcess/cocoa/RemoteRealtimeMediaSourceProxy.h: * WebProcess/cocoa/RemoteRealtimeVideoSource.h: * WebProcess/cocoa/UserMediaCaptureManager.cpp: * WebProcess/cocoa/UserMediaCaptureManager.h: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: Source/WTF: * Scripts/Preferences/WebPreferencesInternal.yaml: Tools: Add support for interrupt mock microphone devices. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: LayoutTests: * fast/mediastream/media-stream-video-track-interrupted-from-audio-expected.txt: Added. * fast/mediastream/media-stream-video-track-interrupted-from-audio.html: Added. * fast/mediastream/media-stream-video-track-interrupted.html: Migrated to testRunner API. * fast/mediastream/track-ended-while-muted.html: * platform/glib/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290985 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-08 Youenn Fablet Add a preference to mute video capture in case audio capture gets interrupted https://bugs.webkit.org/show_bug.cgi?id=237524 Reviewed by Eric Carlson. Add support for interrupt mock microphone devices. Send to WebProcess sources whether sources are interrupted each time the source muted value changes. Store that value in remote sources. * GPUProcess/GPUProcess.cpp: * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * UIProcess/API/C/WKPage.cpp: * UIProcess/API/C/WKPagePrivate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * UIProcess/GPU/GPUProcessProxy.cpp: * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/RemoteRealtimeAudioSource.h: * WebProcess/cocoa/RemoteRealtimeDisplaySource.h: * WebProcess/cocoa/RemoteRealtimeMediaSourceProxy.cpp: * WebProcess/cocoa/RemoteRealtimeMediaSourceProxy.h: * WebProcess/cocoa/RemoteRealtimeVideoSource.h: * WebProcess/cocoa/UserMediaCaptureManager.cpp: * WebProcess/cocoa/UserMediaCaptureManager.h: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: 2022-03-23 Alan Coon Cherry-pick r290443. rdar://problem/89322580 Update CSP console logging https://bugs.webkit.org/show_bug.cgi?id=232216 Reviewed by Brent Fulgham. Source/WebCore: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::willSendRequestInternal): (WebCore::SubresourceLoader::originalHeaders const): * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::allowResourceFromSource const): (WebCore::ContentSecurityPolicy::allowWorkerFromSource const): (WebCore::ContentSecurityPolicy::allowScriptFromSource const): (WebCore::ContentSecurityPolicy::allowStyleFromSource const): Source/WebKit: * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::check): (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::checkRequest): (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): * NetworkProcess/NetworkLoadChecker.h: LayoutTests: * http/tests/security/contentSecurityPolicy/audio-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/font-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/font-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/image-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/image-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/report-blocked-uri-after-multiple-redirects-expected.txt: * http/tests/security/contentSecurityPolicy/script-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/script-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/stylesheet-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/stylesheet-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/svg-font-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/svg-font-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/svg-image-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/svg-image-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/track-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/track-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/video-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/video-redirect-blocked.html: * http/tests/security/contentSecurityPolicy/xsl-redirect-blocked-expected.txt: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290443 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-24 Kate Cheney Update CSP console logging https://bugs.webkit.org/show_bug.cgi?id=232216 Reviewed by Brent Fulgham. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::check): (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::checkRequest): (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): * NetworkProcess/NetworkLoadChecker.h: 2022-03-22 Alan Coon Cherry-pick r290367. rdar://problem/88567612 Fix GPUP WebGL generator script wrt uninitialised sized span https://bugs.webkit.org/show_bug.cgi?id=235889 Patch by Kimmo Kinnunen on 2022-02-23 Reviewed by Antti Koivisto. Source/WebKit: Regenerated. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp: (WebKit::RemoteGraphicsContextGLProxy::getShaderPrecisionFormat): Tools: Fix the generator. The r290328 only edited the generated files. Add a other hunk missing from r290175. * Scripts/generate-gpup-webgl: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290367 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-23 Kimmo Kinnunen Fix GPUP WebGL generator script wrt uninitialised sized span https://bugs.webkit.org/show_bug.cgi?id=235889 Reviewed by Antti Koivisto. Regenerated. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp: (WebKit::RemoteGraphicsContextGLProxy::getShaderPrecisionFormat): 2022-03-22 Alan Coon Revert r289292. rdar://problem/90113314 2022-03-22 Alan Coon Revert r290708. rdar://problem/90113314 2022-03-25 Alex Christensen Cherry pick r289026 rdar://90860743 http://trac.webkit.org/r289026 wasn't merged to the safari-613-branch, which caused excessive unnecessary logging. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): 2022-03-22 Alex Christensen Fix build on safari-613-branch Most of this is just merging most of https://github.com/WebKit/WebKit/commit/ecdbbe0b667c3231bbbf93ab3a5d4df29a6df985 for rdar://problem/89972004 * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createSocketChannel): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::transferToNewWebProcess): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::createWebSocketTask): * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSocketChannel.cpp: (WebKit::NetworkSocketChannel::create): (WebKit::NetworkSocketChannel::NetworkSocketChannel): * NetworkProcess/NetworkSocketChannel.h: * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::createWebSocketTask): * NetworkProcess/soup/NetworkSessionSoup.cpp: (WebKit::NetworkSessionSoup::createWebSocketTask): * NetworkProcess/soup/NetworkSessionSoup.h: * Shared/Cocoa/AuxiliaryProcessCocoa.mm: (WebKit::handleAXPreferenceChange): * WebProcess/Network/WebSocketChannel.cpp: (WebKit::WebSocketChannel::connect): 2022-03-22 Alan Coon Cherry-pick r291598. rdar://problem/89972004 Adjust when _setPrivacyProxyFailClosedForUnreachableNonMainHosts is called https://bugs.webkit.org/show_bug.cgi?id=237735 Reviewed by Geoff Garen. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (WebKit::NetworkSessionCocoa::createWebSocketTask): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291598 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-21 Alex Christensen Adjust when _setPrivacyProxyFailClosedForUnreachableNonMainHosts is called https://bugs.webkit.org/show_bug.cgi?id=237735 Reviewed by Geoff Garen. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (WebKit::NetworkSessionCocoa::createWebSocketTask): 2022-03-22 Alan Coon Cherry-pick r289134. rdar://problem/89972004 Remember whether cached main resources used private relay when considering whether to call _setPrivacyProxyFailClosed https://bugs.webkit.org/show_bug.cgi?id=236125 Patch by Alex Christensen on 2022-02-04 Reviewed by Geoffrey Garen. Source/WebCore: Use an unused bit on disk to remember whether the response was originally received over private relay. Also, instead of remembering on the main frame's DocumentLoader, remember on the WebProcess. This makes it so if you enter the same URL twice, which loads from the MemoryCache from different WebCore::Pages, it still remembers. If you load a different domain, it will load in a different WebProcess anyways, at which point you will not be using the same MemoryCache. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setMainResourceWasPrivateRelayed): Deleted. (WebCore::DocumentLoader::mainResourceWasPrivateRelayed const): Deleted. Source/WebKit: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::makeEntry): (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::Cache::update): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::Entry): (WebKit::NetworkCache::Entry::encodeAsStorageRecord const): (WebKit::NetworkCache::Entry::decodeStorageRecord): * NetworkProcess/cache/NetworkCacheEntry.h: (WebKit::NetworkCache::Entry::privateRelayed const): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse): (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cache/PrefetchCache.cpp: (WebKit::PrefetchCache::Entry::Entry): (WebKit::PrefetchCache::store): * NetworkProcess/cache/PrefetchCache.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::addParametersShared): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/WebProcess.h: (WebKit::WebProcess::setHadMainFrameMainResourcePrivateRelayed): (WebKit::WebProcess::hadMainFrameMainResourcePrivateRelayed const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289134 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-04 Alex Christensen Remember whether cached main resources used private relay when considering whether to call _setPrivacyProxyFailClosed https://bugs.webkit.org/show_bug.cgi?id=236125 Reviewed by Geoffrey Garen. * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::makeEntry): (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::Cache::update): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::Entry): (WebKit::NetworkCache::Entry::encodeAsStorageRecord const): (WebKit::NetworkCache::Entry::decodeStorageRecord): * NetworkProcess/cache/NetworkCacheEntry.h: (WebKit::NetworkCache::Entry::privateRelayed const): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse): (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cache/PrefetchCache.cpp: (WebKit::PrefetchCache::Entry::Entry): (WebKit::PrefetchCache::store): * NetworkProcess/cache/PrefetchCache.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::addParametersShared): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/WebProcess.h: (WebKit::WebProcess::setHadMainFrameMainResourcePrivateRelayed): (WebKit::WebProcess::hadMainFrameMainResourcePrivateRelayed const): 2022-03-21 Alan Coon Cherry-pick r291573. rdar://problem/89964344 [watchOS] Add required syscall https://bugs.webkit.org/show_bug.cgi?id=238117 Reviewed by Brent Fulgham. Add rarely used syscall on watchOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291573 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-21 Per Arne Vollan [watchOS] Add required syscall https://bugs.webkit.org/show_bug.cgi?id=238117 Reviewed by Brent Fulgham. Add rarely used syscall on watchOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2022-03-21 Alan Coon Cherry-pick r291522. rdar://problem/90124325 Fix the build (hopefully) * Shared/Cocoa/ArgumentCodersCocoa.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291522 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-19 Tim Horton Fix the build (hopefully) * Shared/Cocoa/ArgumentCodersCocoa.mm: 2022-03-21 Alan Coon Cherry-pick r291518. rdar://problem/90124325 [Cocoa] Teach WebKit how to serialize CGColors https://bugs.webkit.org/show_bug.cgi?id=238069 Reviewed by Dean Jackson and Tim Horton. Source/WebKit: We have 2 ways of serializing Cocoa objects: NS type handling in ArgumentCodersCocoa.mm, and CF type handling in ArgumentCodersCF.mm. CGColors are CF types, so this patch adds direct support in ArgumentCodersCF to serialize them, by round-tripping them through WebCore::Colors. However, NS containers (like font descriptor attribute dictionaries) can contain CGColors, so this patch also teaches ArgumentCodersCocoa that there may be CF types inside NS containers. If one is present, ArgumentCodersCocoa has to call into ArgumentCodersCF to serialize it. This patch doesn't add support for the reverse path, where an NS object is contained within a CF container. I intentionally omitted implementing this because I wasn't sure if it would be a layering violation; ArgumentCodersCococa.mm already #includes ArgumentCodersCF.h, but ArgumentCodersCF.mm doesn't #include ArgumentCodersCocoa.h. This path isn't actually necessary to solve my problem at hand, so someone else can add support if necessary in the future. I also added a comment at the site where the code would fail, describing what the problem is and a potential workaround. This patch also adds support for our NSSecureCoding implementation for CGColors. This is necessary because sometimes we want to serialize things like NSAttributedStrings, which we don't have direct support for, so we use NSSecureCoding to serialize them instead. NSAttributedStrings can contain fonts whose descriptor dictionaries contain CGColors, so this path needs to work with CGColors too. Support is implemented using NSKeyedArchiverDelegate and NSKeyedUnarchiverDelegate. Test: IPCTestingAPI.CGColorInNSSecureCoding The non-NSSecureCoding parts of this patch are tested by our regular LayoutTests when DOM GPU Process rendering is enabled. * Shared/Cocoa/ArgumentCodersCocoa.mm: (-[WKSecureCodingArchivingDelegate archiver:willEncodeObject:]): (-[WKSecureCodingArchivingDelegate unarchiver:didDecodeObject:]): (-[WKSecureCodingCGColorWrapper wrappedColor]): (+[WKSecureCodingCGColorWrapper supportsSecureCoding]): (-[WKSecureCodingCGColorWrapper encodeWithCoder:]): (-[WKSecureCodingCGColorWrapper initWithCoder:]): (-[WKSecureCodingCGColorWrapper initWithCGColor:]): (IPC::typeFromObject): (IPC::decodeSecureCodingInternal): (IPC::encodeCFInternal): (IPC::decodeCFInternal): (IPC::encodeObject): (IPC::decodeObject): * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder>::decode): * Shared/cf/ArgumentCodersCF.h: Tools: * Scripts/webkitpy/style/checkers/cpp.py: * TestWebKitAPI/Tests/WebKitCocoa/IPCTestingAPI.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291518 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-18 Myles C. Maxfield [Cocoa] Teach WebKit how to serialize CGColors https://bugs.webkit.org/show_bug.cgi?id=238069 Reviewed by Dean Jackson and Tim Horton. We have 2 ways of serializing Cocoa objects: NS type handling in ArgumentCodersCocoa.mm, and CF type handling in ArgumentCodersCF.mm. CGColors are CF types, so this patch adds direct support in ArgumentCodersCF to serialize them, by round-tripping them through WebCore::Colors. However, NS containers (like font descriptor attribute dictionaries) can contain CGColors, so this patch also teaches ArgumentCodersCocoa that there may be CF types inside NS containers. If one is present, ArgumentCodersCocoa has to call into ArgumentCodersCF to serialize it. This patch doesn't add support for the reverse path, where an NS object is contained within a CF container. I intentionally omitted implementing this because I wasn't sure if it would be a layering violation; ArgumentCodersCococa.mm already #includes ArgumentCodersCF.h, but ArgumentCodersCF.mm doesn't #include ArgumentCodersCocoa.h. This path isn't actually necessary to solve my problem at hand, so someone else can add support if necessary in the future. I also added a comment at the site where the code would fail, describing what the problem is and a potential workaround. This patch also adds support for our NSSecureCoding implementation for CGColors. This is necessary because sometimes we want to serialize things like NSAttributedStrings, which we don't have direct support for, so we use NSSecureCoding to serialize them instead. NSAttributedStrings can contain fonts whose descriptor dictionaries contain CGColors, so this path needs to work with CGColors too. Support is implemented using NSKeyedArchiverDelegate and NSKeyedUnarchiverDelegate. Test: IPCTestingAPI.CGColorInNSSecureCoding The non-NSSecureCoding parts of this patch are tested by our regular LayoutTests when DOM GPU Process rendering is enabled. * Shared/Cocoa/ArgumentCodersCocoa.mm: (-[WKSecureCodingArchivingDelegate archiver:willEncodeObject:]): (-[WKSecureCodingArchivingDelegate unarchiver:didDecodeObject:]): (-[WKSecureCodingCGColorWrapper wrappedColor]): (+[WKSecureCodingCGColorWrapper supportsSecureCoding]): (-[WKSecureCodingCGColorWrapper encodeWithCoder:]): (-[WKSecureCodingCGColorWrapper initWithCoder:]): (-[WKSecureCodingCGColorWrapper initWithCGColor:]): (IPC::typeFromObject): (IPC::decodeSecureCodingInternal): (IPC::encodeCFInternal): (IPC::decodeCFInternal): (IPC::encodeObject): (IPC::decodeObject): * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder>::decode): * Shared/cf/ArgumentCodersCF.h: 2022-03-21 Alan Coon Cherry-pick r291326. rdar://problem/85551863 Video poster disappears prematurely on play, leaving transparent video element. https://bugs.webkit.org/show_bug.cgi?id=226960 Reviewed by Jer Noble. Source/WebCore: If a media file has an enabled video track, don't advance readyState to HAVE_ENOUGH_DATA until we have the first frame so we won't hide the poster image until AVFoundation has something to render. Tested manually. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::mediaPlayerFirstVideoFrameAvailable): Always log. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::updateStates): Move the test for the first video frame above the player item status check. If a file has a video track, don't advance to HAVE_ENOUGH_DATA unless we have the first video frame. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear m_cachedHasEnabledVideo. (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Remove unneeded local variable. (WebCore::MediaPlayerPrivateAVFoundationObjC::platformSetVisible): Minro cleanup. (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Set `hasVideo` if AVPlayerItem.hasEnabledVideo is true, because it remains stable while AVAssetTracks sometimes disappear and reappear. (WebCore::MediaPlayerPrivateAVFoundationObjC::firstFrameAvailableDidChange): Add logging. (WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledAudioDidChange): Ditto (WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledVideoDidChange): New, cache AVPlayerItem.hasEnabledVideo. (WebCore::itemKVOProperties): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Respond to @"hasEnabledVideo". * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: Source/WebKit: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): Always log. (WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote): Ditto. (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): Pass the player's content rect box to createVideoLayerRemote so it can be sized correctly even before it becomes visible. (WebKit::MediaPlayerPrivateRemote::firstVideoFrameAvailable): Always log. (WebKit::MediaPlayerPrivateRemote::renderingModeChanged): Ditto. * WebProcess/GPU/media/VideoLayerRemote.h: * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm: (WebKit::createVideoLayerRemote): Set the new layer's frame so its children will be positioned correctly when the are made visible. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291326 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-15 Eric Carlson Video poster disappears prematurely on play, leaving transparent video element. https://bugs.webkit.org/show_bug.cgi?id=226960 Reviewed by Jer Noble. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): Always log. (WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote): Ditto. (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): Pass the player's content rect box to createVideoLayerRemote so it can be sized correctly even before it becomes visible. (WebKit::MediaPlayerPrivateRemote::firstVideoFrameAvailable): Always log. (WebKit::MediaPlayerPrivateRemote::renderingModeChanged): Ditto. * WebProcess/GPU/media/VideoLayerRemote.h: * WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.mm: (WebKit::createVideoLayerRemote): Set the new layer's frame so its children will be positioned correctly when the are made visible. 2022-03-21 Alan Coon Cherry-pick r291182. rdar://problem/88226412 Delay responsiveness checks for the Network Process until it has finished initialization https://bugs.webkit.org/show_bug.cgi?id=237782 Reviewed by Geoffrey Garen. Delay responsiveness checks for the Network Process until it has finished initialization. Network process initialization can be slow but we have evidence that it is not truly hung since we see network process terminations right as the network process is initiating the WebProcess connection later on. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::didFinishLaunching): (WebKit::AuxiliaryProcessProxy::beginResponsivenessChecks): (WebKit::AuxiliaryProcessProxy::startResponsivenessTimer): * UIProcess/AuxiliaryProcessProxy.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::didFinishLaunching): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::sendCreationParametersToNewProcess): * UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp: (WebKit::WebAuthnProcessProxy::didFinishLaunching): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291182 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-11 Chris Dumez Delay responsiveness checks for the Network Process until it has finished initialization https://bugs.webkit.org/show_bug.cgi?id=237782 Reviewed by Geoffrey Garen. Delay responsiveness checks for the Network Process until it has finished initialization. Network process initialization can be slow but we have evidence that it is not truly hung since we see network process terminations right as the network process is initiating the WebProcess connection later on. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::didFinishLaunching): (WebKit::AuxiliaryProcessProxy::beginResponsivenessChecks): (WebKit::AuxiliaryProcessProxy::startResponsivenessTimer): * UIProcess/AuxiliaryProcessProxy.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::didFinishLaunching): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::sendCreationParametersToNewProcess): * UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp: (WebKit::WebAuthnProcessProxy::didFinishLaunching): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): 2022-03-21 Alan Coon Cherry-pick r291006. rdar://problem/85361911 The accessibility library should be soft linked optionally https://bugs.webkit.org/show_bug.cgi?id=236513 Reviewed by Geoffrey Garen. The accessibility library should be soft linked optionally, since it is not always present. * Shared/Cocoa/AuxiliaryProcessCocoa.mm: (WebKit::handleAXPreferenceChange): (WebKit::AuxiliaryProcess::handlePreferenceChange): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291006 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-08 Per Arne Vollan The accessibility library should be soft linked optionally https://bugs.webkit.org/show_bug.cgi?id=236513 Reviewed by Geoffrey Garen. The accessibility library should be soft linked optionally, since it is not always present. * Shared/Cocoa/AuxiliaryProcessCocoa.mm: (WebKit::handleAXPreferenceChange): (WebKit::AuxiliaryProcess::handlePreferenceChange): 2022-03-21 Alan Coon Cherry-pick r290969. rdar://problem/89638872 Preconnecting after process swap is a page load time improvement on some devices https://bugs.webkit.org/show_bug.cgi?id=237055 Reviewed by Geoffrey Garen. Source/WebCore: Export method. * platform/network/NetworkLoadMetrics.h: Source/WebKit: On some devices we see that doing a second preconnect on HTTP/1.1 is a significant page load time improvement. This is due to the fact that most page loads on HTTP/1.1 will open several connections, and having two preconnected connections instead of one, will speed up page load time. This patch implements this by starting a second preconnect after the first has finished. It is important to wait until the first preconnect has finished, otherwise the second preconnect will go to waste, since the underlying network layer does not yet know if this is HTTP/1.1 or not. Since we do not see page load time improvement on iOS with this behavior, it is currently only enabled for macOS. The next step is to investigate why it does not seem to be a page load time improvement on iOS. We probably need to make sure the main resource load has started before we start the second preconect. This will avoid that the second preconnect returns immediately. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::sendH2Ping): (WebKit::NetworkConnectionToWebProcess::preconnectTo): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::preconnectTo): * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::PreconnectTask): (WebKit::PreconnectTask::didFinishLoading): (WebKit::PreconnectTask::didFailLoading): (WebKit::PreconnectTask::didFinish): * NetworkProcess/PreconnectTask.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource): Source/WTF: Add ENABLE guard for this behavior. * wtf/PlatformEnableCocoa.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290969 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-07 Per Arne Vollan Preconnecting after process swap is a page load time improvement on some devices https://bugs.webkit.org/show_bug.cgi?id=237055 Reviewed by Geoffrey Garen. On some devices we see that doing a second preconnect on HTTP/1.1 is a significant page load time improvement. This is due to the fact that most page loads on HTTP/1.1 will open several connections, and having two preconnected connections instead of one, will speed up page load time. This patch implements this by starting a second preconnect after the first has finished. It is important to wait until the first preconnect has finished, otherwise the second preconnect will go to waste, since the underlying network layer does not yet know if this is HTTP/1.1 or not. Since we do not see page load time improvement on iOS with this behavior, it is currently only enabled for macOS. The next step is to investigate why it does not seem to be a page load time improvement on iOS. We probably need to make sure the main resource load has started before we start the second preconect. This will avoid that the second preconnect returns immediately. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::sendH2Ping): (WebKit::NetworkConnectionToWebProcess::preconnectTo): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::preconnectTo): * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::PreconnectTask): (WebKit::PreconnectTask::didFinishLoading): (WebKit::PreconnectTask::didFailLoading): (WebKit::PreconnectTask::didFinish): * NetworkProcess/PreconnectTask.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource): 2022-03-21 Alan Coon Cherry-pick r290856. rdar://problem/89569036 REGRESSION (r284472): [ Monterey ] http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html is failing https://bugs.webkit.org/show_bug.cgi?id=237280 Reviewed by Devin Rousso. Source/WebCore: Covered by existing http/tests/websocket/tests/hybi/inspector/* test cases. On macOS Monterey we use NSURLSession-based WebSockets by default, unlike earlier versions of macOS. The channel for these sockets is implemented in `WebKit::WebSocketChannel`. The non-NSURLSession WebSockets channel (at least on Cocoa platforms) is implemented in `WebCore::WebSocketChannel`. As of r284472 the logic to delay the dispatch of received WebSocket message on platforms using NSURLSession-based WebSockets is handled by `WebCore::WebSocket`, not the `WebKit::WebSocketChannel`. `WebKit::WebSocketChannel` now immediately does the work it needs to, and only the delegated work to `WebSocket` is queued and taken care of when the socket has resumed. This resulted in some of the instrumentation in `WebKit::WebSocketChannel` being able to be called while the socket was suspended leading to events being logged in the frontend "in the future" (e.g. before the paused script would have been able to be aware of them). To correct this the `WebKit::WebSocketChannel` now provides a hook into its helper `WebSocketChannelInspector` object to allow the `WebCore::WebSocket` to notify Web Inspector of events at the same time it is being logically handled by the page. Other `ThreadableWebSocketChannel` implementations will instead provide `nullptr` in place of a pointer to a `WebInspectorChannelInspector`. `WebCore::WebSocketChannel` was not affected by the changes in r284472 as it has a different way to guarantee that the methods containing InspectorInstrumentation were not called while the channel was suspended (and enforced with numerous `ASSERT(!m_suspended)` checks). * Modules/websockets/ThreadableWebSocketChannel.h: (WebCore::ThreadableWebSocketChannel::channelInspector const): * Modules/websockets/WebSocketChannelClient.h: - Add `reason` for error messages so they can be sent to Web Inspector. * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::didReceiveMessage): (WebCore::WebSocket::didReceiveBinaryData): (WebCore::WebSocket::didReceiveMessageError): (WebCore::WebSocket::didClose): * Modules/websockets/WebSocket.h: - Move inspector instrumentation calls from `WebKit::WebSocketChannel` to here so that they are not called until the socket is resumed. - We also now wrap these instrumentation calls in an unlikely check for frontends to avoid allocating the simulated call frames when Web Inspector isn't even open. * Modules/websockets/WebSocketChannelInspector.cpp: (WebCore::WebSocketChannelInspector::WebSocketChannelInspector): (WebCore::WebSocketChannelInspector::didCreateWebSocket const): (WebCore::WebSocketChannelInspector::willSendWebSocketHandshakeRequest const): (WebCore::WebSocketChannelInspector::didReceiveWebSocketHandshakeResponse const): (WebCore::WebSocketChannelInspector::didCloseWebSocket const): (WebCore::WebSocketChannelInspector::didReceiveWebSocketFrame const): (WebCore::WebSocketChannelInspector::didSendWebSocketFrame const): (WebCore::WebSocketChannelInspector::didReceiveWebSocketFrameError const): (WebCore::WebSocketChannelInspector::createFrame): (WebCore::WebSocketChannelInspector::didCreateWebSocket): Deleted. (WebCore::WebSocketChannelInspector::willSendWebSocketHandshakeRequest): Deleted. (WebCore::WebSocketChannelInspector::didReceiveWebSocketHandshakeResponse): Deleted. (WebCore::WebSocketChannelInspector::didCloseWebSocket): Deleted. (WebCore::WebSocketChannelInspector::didReceiveWebSocketFrame): Deleted. (WebCore::WebSocketChannelInspector::didSendWebSocketFrame): Deleted. (WebCore::WebSocketChannelInspector::didReceiveWebSocketFrameError): Deleted. * Modules/websockets/WebSocketChannelInspector.h: - Update to keep a WeakRef to the `Document` to reduce the amount of plumbing necessary to call these methods from `WebSocket`. - Move static utility method `createFrame` here from `WebKit::WebSocketChannel` since it is only used for inspector instrumentation. * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError): (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect): * Modules/websockets/WorkerThreadableWebSocketChannel.h: * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp: (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError): * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::fail): (WebCore::WebSocketChannel::didFailSocketStream): * Modules/websockets/WebSocketChannel.h: - Update these classes to pass along a reason, if available, for errors. Source/WebKit: Move inspector instrumentation for things that should be delayed until the websocket has resumed (in general, these are instrumentation points for receiving messages) into WebCore::WebSocket so that they are sent at the expected time in the frontend, not "in the future" when script execution is suspended (e.g. while debugging). * WebProcess/Network/WebSocketChannel.cpp: (WebKit::WebSocketChannel::notifySendFrame): (WebKit::WebSocketChannel::connect): (WebKit::WebSocketChannel::close): (WebKit::WebSocketChannel::fail): (WebKit::WebSocketChannel::disconnect): (WebKit::WebSocketChannel::didReceiveText): (WebKit::WebSocketChannel::didReceiveBinaryData): (WebKit::WebSocketChannel::didClose): (WebKit::WebSocketChannel::didReceiveMessageError): (WebKit::WebSocketChannel::didSendHandshakeRequest): (WebKit::WebSocketChannel::didReceiveHandshakeResponse): (WebKit::createWebSocketFrameForWebInspector): Deleted. * WebProcess/Network/WebSocketChannel.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290856 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-04 Patrick Angle REGRESSION (r284472): [ Monterey ] http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html is failing https://bugs.webkit.org/show_bug.cgi?id=237280 Reviewed by Devin Rousso. Move inspector instrumentation for things that should be delayed until the websocket has resumed (in general, these are instrumentation points for receiving messages) into WebCore::WebSocket so that they are sent at the expected time in the frontend, not "in the future" when script execution is suspended (e.g. while debugging). * WebProcess/Network/WebSocketChannel.cpp: (WebKit::WebSocketChannel::notifySendFrame): (WebKit::WebSocketChannel::connect): (WebKit::WebSocketChannel::close): (WebKit::WebSocketChannel::fail): (WebKit::WebSocketChannel::disconnect): (WebKit::WebSocketChannel::didReceiveText): (WebKit::WebSocketChannel::didReceiveBinaryData): (WebKit::WebSocketChannel::didClose): (WebKit::WebSocketChannel::didReceiveMessageError): (WebKit::WebSocketChannel::didSendHandshakeRequest): (WebKit::WebSocketChannel::didReceiveHandshakeResponse): (WebKit::createWebSocketFrameForWebInspector): Deleted. * WebProcess/Network/WebSocketChannel.h: 2022-03-21 Alan Coon Cherry-pick r290855. rdar://problem/82814846 Web Inspector: [Cocoa] Continually opening and closing Web Inspector sometimes crashes https://bugs.webkit.org/show_bug.cgi?id=237484 Reviewed by Darin Adler. We need to handle operations on the main queue because `webView:stopURLSchemeTask:` will be called from the main queue, and we must not be in middle the operation when we get the request to stop said operation, otherwise we may attempt to call `[urlSchemeTask did*]`, which is not permitted after we have been asked to stop that task. If we add the operation for the `WKURLSchemeTask` to a different queue it is possible we will have already started the operation on a background queue while at the same time are receiving a request to stop that same `WKURLSchemeTask`. * UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm: (-[WKInspectorResourceURLSchemeHandler webView:startURLSchemeTask:]): (-[WKInspectorResourceURLSchemeHandler webView:stopURLSchemeTask:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290855 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-04 Patrick Angle Web Inspector: [Cocoa] Continually opening and closing Web Inspector sometimes crashes https://bugs.webkit.org/show_bug.cgi?id=237484 Reviewed by Darin Adler. We need to handle operations on the main queue because `webView:stopURLSchemeTask:` will be called from the main queue, and we must not be in middle the operation when we get the request to stop said operation, otherwise we may attempt to call `[urlSchemeTask did*]`, which is not permitted after we have been asked to stop that task. If we add the operation for the `WKURLSchemeTask` to a different queue it is possible we will have already started the operation on a background queue while at the same time are receiving a request to stop that same `WKURLSchemeTask`. * UIProcess/Inspector/mac/WKInspectorResourceURLSchemeHandler.mm: (-[WKInspectorResourceURLSchemeHandler webView:startURLSchemeTask:]): (-[WKInspectorResourceURLSchemeHandler webView:stopURLSchemeTask:]): 2022-03-21 Alan Coon Cherry-pick r290847. rdar://problem/89402338 Crash under ScrollingCoordinatorMac::hasNodeWithAnimatedScrollChanged() https://bugs.webkit.org/show_bug.cgi?id=237478 Reviewed by Alan Bujtas. Crash data show that r290109 failed to fix this crash; the actual cause of the crash is a null m_page on TiledCoreAnimationScrollingCoordinator, diagnosed by noting that the crash offset corresponds to the offset of m_renderingUpdateRemainingSteps in Page. * WebProcess/WebPage/mac/TiledCoreAnimationScrollingCoordinator.mm: (WebKit::TiledCoreAnimationScrollingCoordinator::hasNodeWithAnimatedScrollChanged): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290847 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-04 Simon Fraser Crash under ScrollingCoordinatorMac::hasNodeWithAnimatedScrollChanged() https://bugs.webkit.org/show_bug.cgi?id=237478 Reviewed by Alan Bujtas. Crash data show that r290109 failed to fix this crash; the actual cause of the crash is a null m_page on TiledCoreAnimationScrollingCoordinator, diagnosed by noting that the crash offset corresponds to the offset of m_renderingUpdateRemainingSteps in Page. * WebProcess/WebPage/mac/TiledCoreAnimationScrollingCoordinator.mm: (WebKit::TiledCoreAnimationScrollingCoordinator::hasNodeWithAnimatedScrollChanged): 2022-03-21 Alan Coon Cherry-pick r290744. rdar://problem/81609371 [WebAuthn] Ensure presenter gets dismissed on iOS https://bugs.webkit.org/show_bug.cgi?id=237336 rdar://81609371 Reviewed by Brent Fulgham. Always call [m_presenter dismissWithError] to ensure presenter gets dismissed. * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm: (WebKit::AuthenticatorPresenterCoordinator::dimissPresenter): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290744 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-02 J Pascoe [WebAuthn] Ensure presenter gets dismissed on iOS https://bugs.webkit.org/show_bug.cgi?id=237336 rdar://81609371 Reviewed by Brent Fulgham. Always call [m_presenter dismissWithError] to ensure presenter gets dismissed. * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm: (WebKit::AuthenticatorPresenterCoordinator::dimissPresenter): 2022-03-21 Alan Coon Cherry-pick r290676. rdar://problem/83831093 [Cocoa] HLS stream currentTime sometimes jumps backwards https://bugs.webkit.org/show_bug.cgi?id=235087 rdar://83831093 Reviewed by Dean Jackson. Source/WebCore: Test: http/tests/media/hls/hls-non-zero-start-time.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by: pass log identifier to lambda so the method name will be logged correctly. (WebCore::HTMLMediaElement::currentMediaTime const): Remove LOG_CACHED_TIME_WARNINGS build flag, always log time drift warnings when log level is DEBUG. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Log when periodic time observer is passed unexpected values. (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Use NSKeyValueObservingOptionInitial KVO option for "@duration" property because we sometimes don't get a duration changed event for HLS streams, so m_cachedDuration remains invalid. (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTimeDidChange const): Drive-by: fix use-after-move. Source/WebKit: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::currentTimeChanged): Always notify player when time jumps backwards. LayoutTests: * http/tests/media/hls/hls-non-zero-start-time-expected.txt: Added. * http/tests/media/hls/hls-non-zero-start-time.html: Added. * http/tests/media/resources/hls/bip-bop-live.m3u8: Added. * http/tests/media/resources/hls/bipbop/start-offset.m3u8: Added. * http/tests/media/resources/hls/bipbop/start-offset.ts: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290676 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-01 Eric Carlson [Cocoa] HLS stream currentTime sometimes jumps backwards https://bugs.webkit.org/show_bug.cgi?id=235087 rdar://83831093 Reviewed by Dean Jackson. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::currentTimeChanged): Always notify player when time jumps backwards. 2022-03-21 Alan Coon Cherry-pick r290539. rdar://problem/88767812 [WebAuthn] Fallback to attestation=none whenever attestation fails https://bugs.webkit.org/show_bug.cgi?id=237223 rdar://88767812 Reviewed by Brent Fulgham. Source/WebKit: Whenever attestation is requested by a RP and it fails to complete, we previously errored out of the registration. The more correct platform behavior in this case is to provide attestation=none. Created API test for this behavior. * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested): Tools: Add test for local authenticator attestation fallback behavior. * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290539 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-25 J Pascoe [WebAuthn] Fallback to attestation=none whenever attestation fails https://bugs.webkit.org/show_bug.cgi?id=237223 rdar://88767812 Reviewed by Brent Fulgham. Whenever attestation is requested by a RP and it fails to complete, we previously errored out of the registration. The more correct platform behavior in this case is to provide attestation=none. Created API test for this behavior. * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested): 2022-03-21 Alan Coon Cherry-pick r290328. rdar://problem/88567612 Fix GPUP WebGL generator script wrt uninitialised sized span https://bugs.webkit.org/show_bug.cgi?id=235889 Reviewed by Chris Dumez. Even though we check if the synchronous message was received successfully before using it, if we didn't check then we might have a problem with pointing to uninitialized memory, which we then wouldn't use for anything. To fix this hypothetical problem, I start out by pointing to initialized memory. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp: (WebKit::RemoteGraphicsContextGLProxy::getShaderPrecisionFormat): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290328 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-22 Alex Christensen Fix GPUP WebGL generator script wrt uninitialised sized span https://bugs.webkit.org/show_bug.cgi?id=235889 Reviewed by Chris Dumez. Even though we check if the synchronous message was received successfully before using it, if we didn't check then we might have a problem with pointing to uninitialized memory, which we then wouldn't use for anything. To fix this hypothetical problem, I start out by pointing to initialized memory. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp: (WebKit::RemoteGraphicsContextGLProxy::getShaderPrecisionFormat): 2022-03-21 Alan Coon Cherry-pick r288662. rdar://problem/89582442 [WP] Avoid calling IOSurfaceAlignProperty https://bugs.webkit.org/show_bug.cgi?id=235659 Reviewed by Simon Fraser. Source/WebCore: Add information about alignment of bytes per row to IOSurface class. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::surfaceBytesPerRowAlignment): (WebCore::IOSurface::bytesPerRowAlignment): (WebCore::IOSurface::setBytesPerRowAlignment): Source/WebKit: Avoid calling IOSurfaceAlignProperty in the WebContent process, since it requires IOKit access. Information about the alignment of bytes per row of IOSurface will be retrieved in the UI process, and sent to the WebContent process, where it will be stored. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288662 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-26 Per Arne Vollan [WP] Avoid calling IOSurfaceAlignProperty https://bugs.webkit.org/show_bug.cgi?id=235659 Reviewed by Simon Fraser. Avoid calling IOSurfaceAlignProperty in the WebContent process, since it requires IOKit access. Information about the alignment of bytes per row of IOSurface will be retrieved in the UI process, and sent to the WebContent process, where it will be stored. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2022-03-17 Alan Coon Revert r290967. rdar://problem/90331977 2022-03-09 Russell Epstein Cherry-pick r290646. rdar://problem/88911184 focus({preventScroll: true}) does not prevent scrolling on iOS https://bugs.webkit.org/show_bug.cgi?id=236584 rdar://88911184 Reviewed by Simon Fraser. Source/WebCore: Plumb `FocusOptions` through `Element::dispatchFocusEvent()` as well as the chrome client hooks for `elementDidRefocus` and `elementDidFocus`, instead of just a `FocusDirection` flag. * dom/Document.cpp: (WebCore::Document::setFocusedElement): * dom/Element.cpp: (WebCore::Element::focus): (WebCore::Element::dispatchFocusEvent): * dom/Element.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::dispatchFocusEvent): * html/HTMLSelectElement.h: * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::dispatchFocusEvent): * html/HTMLTextFormControlElement.h: * loader/EmptyClients.h: * page/ChromeClient.h: (WebCore::ChromeClient::elementDidFocus): (WebCore::ChromeClient::elementDidRefocus): * page/FocusController.cpp: (WebCore::dispatchEventsOnWindowAndFocusedElement): (WebCore::FocusController::setFocusedElement): Source/WebKit: Add support for `preventScroll` on iOS by avoiding UI-side zooming/scrolling to reveal the focused element if it was focused with `preventScroll: true`. See below for more details. Tests: fast/forms/select-focus-prevent-scroll.html fast/forms/text-field-focus-prevent-scroll.html * Shared/FocusedElementInformation.cpp: (WebKit::FocusedElementInformation::encode const): (WebKit::FocusedElementInformation::decode): * Shared/FocusedElementInformation.h: Add a boolean flag to `FocusedElementInformation` to indicate whether or not scrolling to reveal the focused element should be prevented. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _zoomToRevealFocusedElement]): Only zoom to reveal the focused element if the focused element information's `preventScroll` flag is `NO`. (-[WKContentView _elementDidBlur]): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::elementDidFocus): (WebKit::WebChromeClient::elementDidRefocus): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::elementDidRefocus): (WebKit::WebPage::elementDidFocus): Use `FocusOptions` to set the `preventScroll` flag when propagating `FocusedElementInformation`. * WebProcess/WebPage/WebPage.h: Source/WebKitLegacy/ios: Adjust the method signature of elementDidFocus. See WebCore ChangeLog for more information. * WebCoreSupport/WebChromeClientIOS.h: * WebCoreSupport/WebChromeClientIOS.mm: (WebChromeClientIOS::elementDidFocus): Source/WebKitLegacy/mac: Adjust the method signature of elementDidFocus. See WebCore ChangeLog for more information. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::elementDidFocus): LayoutTests: Add a couple of new layout tests to verify that passing in `{ preventScroll: true }` for focus options causes us to avoid scrolling to reveal focused select elements and text fields. * fast/forms/select-focus-prevent-scroll-expected.txt: Added. * fast/forms/select-focus-prevent-scroll.html: Added. * fast/forms/text-field-focus-prevent-scroll-expected.txt: Added. * fast/forms/text-field-focus-prevent-scroll.html: Added. * resources/ui-helper.js: Also make it safe to call `waitForInputSessionToDismiss()` in a platform-agnostic test, by bailing early if we're not on iOS, using WebKit2. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290646 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-01 Wenson Hsieh focus({preventScroll: true}) does not prevent scrolling on iOS https://bugs.webkit.org/show_bug.cgi?id=236584 rdar://88911184 Reviewed by Simon Fraser. Add support for `preventScroll` on iOS by avoiding UI-side zooming/scrolling to reveal the focused element if it was focused with `preventScroll: true`. See below for more details. Tests: fast/forms/select-focus-prevent-scroll.html fast/forms/text-field-focus-prevent-scroll.html * Shared/FocusedElementInformation.cpp: (WebKit::FocusedElementInformation::encode const): (WebKit::FocusedElementInformation::decode): * Shared/FocusedElementInformation.h: Add a boolean flag to `FocusedElementInformation` to indicate whether or not scrolling to reveal the focused element should be prevented. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _zoomToRevealFocusedElement]): Only zoom to reveal the focused element if the focused element information's `preventScroll` flag is `NO`. (-[WKContentView _elementDidBlur]): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::elementDidFocus): (WebKit::WebChromeClient::elementDidRefocus): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::elementDidRefocus): (WebKit::WebPage::elementDidFocus): Use `FocusOptions` to set the `preventScroll` flag when propagating `FocusedElementInformation`. * WebProcess/WebPage/WebPage.h: 2022-03-08 Russell Epstein Cherry-pick r288701. rdar://problem/83734079 "Unrecognized Content-Security-Policy directive 'worker-src'." https://bugs.webkit.org/show_bug.cgi?id=235260 Reviewed by Brent Fulgham. LayoutTests/imported/w3c: * web-platform-tests/content-security-policy/child-src/child-src-cross-origin-load.sub-expected.txt: * web-platform-tests/content-security-policy/child-src/child-src-worker-blocked.sub-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/worker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/worker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-classic.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-classic.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-module.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-module.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/worker-classic.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/worker-classic.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/worker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/worker-import.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/worker-import.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/worker-module.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/worker-module.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-import.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-import.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/worker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/worker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/script-src-self/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/script-src-self/worker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/worker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/worker-src/dedicated-fallback.sub-expected.txt: * web-platform-tests/content-security-policy/worker-src/dedicated-none.sub-expected.txt: * web-platform-tests/content-security-policy/worker-src/dedicated-worker-src-child-fallback-blocked.sub-expected.txt: * web-platform-tests/content-security-policy/worker-src/dedicated-worker-src-script-fallback.sub-expected.txt: * web-platform-tests/content-security-policy/worker-src/dedicated-worker-src-self-fallback.sub-expected.txt: * web-platform-tests/content-security-policy/worker-src/service-none.https.sub-expected.txt: * web-platform-tests/content-security-policy/worker-src/service-worker-src-child-fallback-blocked.https.sub-expected.txt: * web-platform-tests/content-security-policy/worker-src/shared-child.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-fallback.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-list.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-none.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-self.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-worker-src-child-fallback-blocked.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-worker-src-child-fallback.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-worker-src-default-fallback.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-worker-src-script-fallback.sub-expected.txt: Added. * web-platform-tests/content-security-policy/worker-src/shared-worker-src-self-fallback.sub-expected.txt: Added. * web-platform-tests/content-security-policy/blob/self-doesnt-match-blob.sub-expected.txt: * web-platform-tests/content-security-policy/blob/star-doesnt-match-blob.sub-expected.txt: * web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-classic.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-classic.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/worker-classic.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/worker-classic.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/worker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/worker-import.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/worker-import.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/worker-module.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/worker-module.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-import-data.https-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/worker-import-data.http-expected.txt: * web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/worker-import-data.https-expected.txt: Source/WebCore: Implementation of worker-src directive. According to https://www.w3.org/TR/CSP3/#changes-from-level-2 the worker-src directive now restricts URLs that can be loaded by workers, and defers to child-src if not specified. * bindings/js/WorkerModuleScriptLoader.cpp: (WebCore::WorkerModuleScriptLoader::load): Check worker-src instead of child-src for worker loads. * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): * loader/ThreadableLoader.h: Check worker-src instead of child-src for worker loads. * page/csp/ContentSecurityPolicy.cpp: We can remove allowChildContextFromSource which is now fully replaced by allowWorkerFromSource. (WebCore::ContentSecurityPolicy::allowWorkerFromSource const): (WebCore::ContentSecurityPolicy::allowChildContextFromSource const): Deleted. * page/csp/ContentSecurityPolicy.h: * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::operativeDirectiveForWorkerSrc const): worker-src defers to child-src, then script-src, then default-src. (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForWorker): (WebCore::ContentSecurityPolicyDirectiveList::addDirective): * page/csp/ContentSecurityPolicyDirectiveList.h: * page/csp/ContentSecurityPolicyDirectiveNames.cpp: * page/csp/ContentSecurityPolicyDirectiveNames.h: * workers/AbstractWorker.cpp: (WebCore::AbstractWorker::resolveURL): * workers/AbstractWorker.h: We check LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy in allowWorkerFromSource, so we don't need to check in in AbstractWorker::resolveURL anymore. We can also replace the child-src checks with worker-src ones. * workers/Worker.cpp: (WebCore::Worker::create): * workers/WorkerFontLoadRequest.cpp: (WebCore::WorkerFontLoadRequest::load): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): Block service worker registrations not specified by worker-src. * workers/shared/SharedWorker.cpp: (WebCore::SharedWorker::create): Block shared worker urls not specified by worker-src. * workers/shared/SharedWorkerScriptLoader.cpp: (WebCore::SharedWorkerScriptLoader::SharedWorkerScriptLoader): Source/WebKit: * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): LayoutTests: Update tests now that worker-src defaults eventually to script-src. Since this was not the case with child-src, legacy CSP tests do not expect script-src policies to affect workers. We can fix this by specifying a separate worker-src policy for these tests to maintain behavior. * TestExpectations: Some wpt tests log random URL strings that change for every test iteration. For now we can't unskip those. * http/tests/security/contentSecurityPolicy/1.1/child-src/worker-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked-expected.txt: * http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-blocks-eval.html: * http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-block-aborts-all-subsequent-imports.html: * http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-redirect-cross-origin-blocked.html: * http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp.html: * http/tests/security/contentSecurityPolicy/worker-script-src.html: * http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-eval.html: * http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-importScript-redirect-cross-origin.html: * http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-xhr.html: * http/tests/security/isolatedWorld/bypass-main-world-csp-worker.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288701 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-27 Kate Cheney "Unrecognized Content-Security-Policy directive 'worker-src'." https://bugs.webkit.org/show_bug.cgi?id=235260 Reviewed by Brent Fulgham. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): 2022-03-07 Russell Epstein Cherry-pick r290961. rdar://problem/89912760 [macCatalyst] Compilation error: WebContentProcess.xib: error: macOS xibs do not support target device type "ipad". https://bugs.webkit.org/show_bug.cgi?id=237549 rdar://89912760 Patch by Richard Houle on 2022-03-07 Reviewed by Alexey Proskuryakov. Xcode for macOS 12.5 complains that we bundle Mac XIBs inside our macCatalyst builds. * Configurations/BaseXPCService.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290961 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-07 Richard Houle [macCatalyst] Compilation error: WebContentProcess.xib: error: macOS xibs do not support target device type "ipad". https://bugs.webkit.org/show_bug.cgi?id=237549 rdar://89912760 Reviewed by Alexey Proskuryakov. Xcode for macOS 12.5 complains that we bundle Mac XIBs inside our macCatalyst builds. * Configurations/BaseXPCService.xcconfig: 2022-03-07 Russell Epstein Cherry-pick r285688. rdar://problem/85307256 [macOS] Add required methods to IOKit message filter https://bugs.webkit.org/show_bug.cgi?id=233012 Reviewed by Brent Fulgham. Add required methods to IOKit message filter on macOS. * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285688 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-11-11 Per Arne [macOS] Add required methods to IOKit message filter https://bugs.webkit.org/show_bug.cgi?id=233012 Reviewed by Brent Fulgham. Add required methods to IOKit message filter on macOS. * WebProcess/com.apple.WebProcess.sb.in: 2022-03-07 Russell Epstein Cherry-pick r290765. rdar://problem/89232969 Throw proper exception on failed removeEntry() calls https://bugs.webkit.org/show_bug.cgi?id=237382 Reviewed by Chris Dumez. LayoutTests/imported/w3c: * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any-expected.txt: * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getDirectoryHandle.https.any.worker-expected.txt: * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any-expected.txt: * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-getFileHandle.https.any.worker-expected.txt: * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any-expected.txt: * web-platform-tests/file-system-access/sandboxed_FileSystemDirectoryHandle-removeEntry.https.any.worker-expected.txt: Source/WebKit: Updated existing tests. * NetworkProcess/storage/FileSystemStorageError.h: (WebKit::convertToException): * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::FileSystemStorageHandle::removeEntry): LayoutTests: * storage/filesystemaccess/handle-move-expected.txt: * storage/filesystemaccess/handle-move-worker-expected.txt: * storage/filesystemaccess/resources/handle-move.js: (async test): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290765 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-02 Sihui Liu Throw proper exception on failed removeEntry() calls https://bugs.webkit.org/show_bug.cgi?id=237382 Reviewed by Chris Dumez. Updated existing tests. * NetworkProcess/storage/FileSystemStorageError.h: (WebKit::convertToException): * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::FileSystemStorageHandle::removeEntry): 2022-03-07 Russell Epstein Cherry-pick r290758. rdar://problem/89710486 [AppSSO] Correct logging messages to avoid confusing screeners that an error has occurred https://bugs.webkit.org/show_bug.cgi?id=237390 Reviewed by Simon Fraser. The phrasing of the message in 'SOAuthorizationCoordinator::tryAuthorize' when a URL is not relevant for AppSSO flows is: AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize: Cannot authorize the requested URL."); This leads people spelunking logs to believe that the URL can't be authorized (perhaps due to an error). Instead, we should more accurately report that the URL is not one that is mediated through an AppSSO flow, and so no AppSSO processing is needed. * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm: (WebKit::SOAuthorizationCoordinator::tryAuthorize): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290758 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-02 Brent Fulgham [AppSSO] Correct logging messages to avoid confusing screeners that an error has occurred https://bugs.webkit.org/show_bug.cgi?id=237390 Reviewed by Simon Fraser. The phrasing of the message in 'SOAuthorizationCoordinator::tryAuthorize' when a URL is not relevant for AppSSO flows is: AUTHORIZATIONCOORDINATOR_RELEASE_LOG("tryAuthorize: Cannot authorize the requested URL."); This leads people spelunking logs to believe that the URL can't be authorized (perhaps due to an error). Instead, we should more accurately report that the URL is not one that is mediated through an AppSSO flow, and so no AppSSO processing is needed. * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm: (WebKit::SOAuthorizationCoordinator::tryAuthorize): 2022-03-07 Russell Epstein Cherry-pick r290755. rdar://problem/89700242 [WebAuthn] Completion handler is not called when WebAuthn invoked without proper entitlements https://bugs.webkit.org/show_bug.cgi?id=237380 Reviewed by Chris Dumez. WebAuthn is not permitted outside of Web Browser applications. When an application that lacks the full web browser entitlement attempts to invoke WebAuthn flows, we do an early return. However, the completion handler for this flow is bypassed, preventing applications from being informed of this problem. * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::makeCredential): (WebKit::WebAuthenticatorCoordinator::getAssertion): (WebKit::WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290755 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-03-02 Brent Fulgham [WebAuthn] Completion handler is not called when WebAuthn invoked without proper entitlements https://bugs.webkit.org/show_bug.cgi?id=237380 Reviewed by Chris Dumez. WebAuthn is not permitted outside of Web Browser applications. When an application that lacks the full web browser entitlement attempts to invoke WebAuthn flows, we do an early return. However, the completion handler for this flow is bypassed, preventing applications from being informed of this problem. * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::makeCredential): (WebKit::WebAuthenticatorCoordinator::getAssertion): (WebKit::WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable): 2022-03-07 Russell Epstein Cherry-pick r290629. rdar://problem/88903506 [IPC] Do more hardening in WebSWServerConnection's client registration / unregistration https://bugs.webkit.org/show_bug.cgi?id=237290 Reviewed by Alex Christensen. Validate client identifiers sent by the WebContent process via IPC to make sure that the process identifier of the client actually matches the process identifier of the process we're connected to. Also validate the SecurityOriginData to make sure it is not empty. We support sending empty SecurityOriginData objects over IPC. However, they cannot be used as keys in HashMaps. If validation fails, we assume the WebContent process is compromised and we terminate it. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290629 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-28 Chris Dumez [IPC] Do more hardening in WebSWServerConnection's client registration / unregistration https://bugs.webkit.org/show_bug.cgi?id=237290 Reviewed by Alex Christensen. Validate client identifiers sent by the WebContent process via IPC to make sure that the process identifier of the client actually matches the process identifier of the process we're connected to. Also validate the SecurityOriginData to make sure it is not empty. We support sending empty SecurityOriginData objects over IPC. However, they cannot be used as keys in HashMaps. If validation fails, we assume the WebContent process is compromised and we terminate it. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): 2022-03-07 Russell Epstein Cherry-pick r290343. rdar://problem/85811396 Further restrict received IPC boolean values to 0 or 1 https://bugs.webkit.org/show_bug.cgi?id=236801 rdar://85811396 Patch by Simon Lewis on 2022-02-22 Reviewed by Chris Dumez. Return std::nullopt if a value larger than 1 is received. * Platform/IPC/ArgumentCoder.h: (IPC::ArgumentCoder::decode): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290343 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-22 Simon Lewis Further restrict received IPC boolean values to 0 or 1 https://bugs.webkit.org/show_bug.cgi?id=236801 rdar://85811396 Reviewed by Chris Dumez. Return std::nullopt if a value larger than 1 is received. * Platform/IPC/ArgumentCoder.h: (IPC::ArgumentCoder::decode): 2022-03-07 Russell Epstein Cherry-pick r290305. rdar://problem/89287719 Rename RenderStyle::userSelectIncludingInert to RenderStyle::effectiveUserSelect https://bugs.webkit.org/show_bug.cgi?id=237033 Reviewed by Antti Koivisto. This naming is consistent with other properties (effectiveDisplay/Appearance/PointerEvents/etc.). Source/WebCore: * dom/Node.cpp: (WebCore::computeEditabilityFromComputedStyle): (WebCore::Node::canStartSelection const): * dom/Position.cpp: (WebCore::Position::nodeIsUserSelectNone): (WebCore::Position::nodeIsUserSelectAll): * page/EventHandler.cpp: (WebCore::EventHandler::canMouseDownStartSelect): (WebCore::EventHandler::selectCursor): * page/Frame.cpp: (WebCore::Frame::rangeForPoint): * rendering/RenderElement.cpp: (WebCore::RenderElement::selectionBackgroundColor const): (WebCore::RenderElement::selectionColor const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderObject.cpp: (WebCore::RenderObject::collectSelectionGeometriesInternal): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::effectiveUserSelect const): (WebCore::RenderStyle::userSelectIncludingInert const): Deleted. Source/WebKit: * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::isSelectableTextNode const): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionPositionInformation): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290305 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-22 Tim Nguyen Rename RenderStyle::userSelectIncludingInert to RenderStyle::effectiveUserSelect https://bugs.webkit.org/show_bug.cgi?id=237033 Reviewed by Antti Koivisto. This naming is consistent with other properties (effectiveDisplay/Appearance/PointerEvents/etc.). * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::isSelectableTextNode const): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionPositionInformation): 2022-03-07 Russell Epstein Cherry-pick r290246. rdar://problem/85811396 Change IPC encoding of boolean type to use one bit https://bugs.webkit.org/show_bug.cgi?id=236801 rdar://85811396 Patch by Simon Lewis on 2022-02-21 Reviewed by Chris Dumez. This patch ensures that only the lower bit is set in a boolean for IPC messages. * Platform/IPC/ArgumentCoder.h: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290246 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-21 Simon Lewis Change IPC encoding of boolean type to use one bit https://bugs.webkit.org/show_bug.cgi?id=236801 rdar://85811396 Reviewed by Chris Dumez. This patch ensures that only the lower bit is set in a boolean for IPC messages. * Platform/IPC/ArgumentCoder.h: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2022-03-07 Russell Epstein Cherry-pick r289121. rdar://problem/88492251 Fix App Privacy Report redirect attribution https://bugs.webkit.org/show_bug.cgi?id=236111 Reviewed by Brent Fulgham. Source/WebCore: Test: http/tests/app-privacy-report/user-attribution-redirect.html Test: http/tests/app-privacy-report/app-attribution-redirect.html * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Source/WebKit: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): LayoutTests: * http/tests/app-privacy-report/resources/redirect.js: Added. * http/tests/app-privacy-report/app-attribution-redirect-expected.txt: Added. * http/tests/app-privacy-report/app-attribution-redirect.html: Added. * http/tests/app-privacy-report/user-attribution-redirect-expected.txt: Added. * http/tests/app-privacy-report/user-attribution-redirect.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289121 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-04 Kate Cheney Fix App Privacy Report redirect attribution https://bugs.webkit.org/show_bug.cgi?id=236111 Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): 2022-03-07 Russell Epstein Cherry-pick r288237. rdar://problem/87275093 WebKit::AuthenticatorPresenterCoordinator() constructor falls through ASSERT_NOT_REACHED() https://bugs.webkit.org/show_bug.cgi?id=234991 Reviewed by Darin Adler. Drop unnecessary default: case in the switch statement since it handles all enum values already. * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm: (WebKit::AuthenticatorPresenterCoordinator::AuthenticatorPresenterCoordinator): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288237 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-19 Chris Dumez WebKit::AuthenticatorPresenterCoordinator() constructor falls through ASSERT_NOT_REACHED() https://bugs.webkit.org/show_bug.cgi?id=234991 Reviewed by Darin Adler. Drop unnecessary default: case in the switch statement since it handles all enum values already. * UIProcess/WebAuthentication/Cocoa/AuthenticatorPresenterCoordinator.mm: (WebKit::AuthenticatorPresenterCoordinator::AuthenticatorPresenterCoordinator): 2022-03-07 Russell Epstein Cherry-pick r287986. rdar://problem/87489048 Fix a few Objective-C object leaks due to early returns in `init` https://bugs.webkit.org/show_bug.cgi?id=235162 Reviewed by Wenson Hsieh. Source/JavaScriptCore: * API/JSValue.mm: (-[JSValue initWithValue:inContext:]): Source/WebCore: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController init]): Source/WebKit: * UIProcess/ios/WKHoverPlatter.mm: (-[WKHoverPlatter initWithView:delegate:]): Source/WebKitLegacy/mac: * Storage/WebDatabaseQuotaManager.mm: (WebCore::if): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287986 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-13 Tim Horton Fix a few Objective-C object leaks due to early returns in `init` https://bugs.webkit.org/show_bug.cgi?id=235162 Reviewed by Wenson Hsieh. * UIProcess/ios/WKHoverPlatter.mm: (-[WKHoverPlatter initWithView:delegate:]): 2022-03-01 Russell Epstein Revert r289282. rdar://problem/88876661 2022-03-01 Russell Epstein Cherry-pick r290066. rdar://problem/89072361 [macOS][WP] Add required syscall to sandbox https://bugs.webkit.org/show_bug.cgi?id=236781 Reviewed by Chris Dumez. Add required syscall to the WebContent process' sandbox on macOS. This patch also adds back a set of syscalls that were removed in https://commits.webkit.org/r286778 for current and previous versions of macOS. These syscalls will be denied going forward. * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290066 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-17 Per Arne Vollan [macOS][WP] Add required syscall to sandbox https://bugs.webkit.org/show_bug.cgi?id=236781 Reviewed by Chris Dumez. Add required syscall to the WebContent process' sandbox on macOS. This patch also adds back a set of syscalls that were removed in https://commits.webkit.org/r286778 for current and previous versions of macOS. These syscalls will be denied going forward. * WebProcess/com.apple.WebProcess.sb.in: 2022-03-01 Russell Epstein Cherry-pick r290005. rdar://problem/87596724 CrashTracer: com.apple.WebKit.WebContent at JavaScriptCore: bmalloc_allocate_impl_impl_slow https://bugs.webkit.org/show_bug.cgi?id=236695 rdar://87596724 Reviewed by Jer Noble. Source/WebCore: When a new FragmentedSharedBuffer is received from the network process, it is proactively coalesced into a SharedBuffer during each call to CachedResource::updateBuffer(). This causes a large number of re-allocations and copies; essentially re-allocating each time the resource's buffer receives one more chunk of data. Instead we only flatten the data buffer once all data have been received. Running speedtest.net with a gigabit link, we see a reduction of peak memory use in the content process by about 40% (from 740MB to under 440MB of physical memory, 1.7GB of memory allocation vs 535MB) Covered by existing tests. * editing/ios/EditorIOS.mm: (WebCore::Editor::writeImageToPasteboard): * editing/mac/EditorMac.mm: (WebCore::Editor::writeImageToPasteboard): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::didFinishLoading): * loader/cache/CachedApplicationManifest.cpp: (WebCore::CachedApplicationManifest::finishLoading): * loader/cache/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::finishLoading): * loader/cache/CachedFont.cpp: (WebCore::CachedFont::ensureCustomFontData): * loader/cache/CachedImage.cpp: (WebCore::CachedImage::updateImageData): * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::calculateIncrementalDataChunk const): (WebCore::CachedRawResource::updateBuffer): (WebCore::CachedRawResource::finishLoading): * loader/cache/CachedRawResource.h: * loader/cache/CachedResource.h: (WebCore::CachedResource::resourceBuffer const): * loader/cache/CachedScript.cpp: (WebCore::CachedScript::script): * loader/cache/CachedXSLStyleSheet.cpp: (WebCore::CachedXSLStyleSheet::finishLoading): Source/WebKit: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::finishedLoading): Fly-by fix, the IPC::DataReference would reference a SharedBuffer going out of scope before it was sent over IPC. Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290005 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-17 Jean-Yves Avenard CrashTracer: com.apple.WebKit.WebContent at JavaScriptCore: bmalloc_allocate_impl_impl_slow https://bugs.webkit.org/show_bug.cgi?id=236695 rdar://87596724 Reviewed by Jer Noble. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::finishedLoading): Fly-by fix, the IPC::DataReference would reference a SharedBuffer going out of scope before it was sent over IPC. 2022-02-28 Russell Epstein Cherry-pick r289380. rdar://problem/86904276 Reduce allocations and increase thread safety of constructedPath https://bugs.webkit.org/show_bug.cgi?id=236286 Patch by Alex Christensen on 2022-02-08 Reviewed by Chris Dumez. * UIProcess/API/APIContentRuleListStore.cpp: (API::constructedPathPrefix): (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289380 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-08 Alex Christensen Reduce allocations and increase thread safety of constructedPath https://bugs.webkit.org/show_bug.cgi?id=236286 Reviewed by Chris Dumez. * UIProcess/API/APIContentRuleListStore.cpp: (API::constructedPathPrefix): (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers): 2022-02-16 Russell Epstein Cherry-pick r289875. rdar://problem/88358696 Web Inspector: [Cocoa] Reentrancy in WebKit::WebInspectorUIProxy::open https://bugs.webkit.org/show_bug.cgi?id=236672 Reviewed by Devin Rousso. Speculative fix for non-reproducible reentrancy. Because `WebInspectorUIProxy::open` calls `WebInspectorUIProxy::platformBringToFront`, which under some conditions can call `WebInspectorUIProxy::open`, there was an opportunity for recurssion. This appears to happen when the window of the inspector view does not match the window of the inspected web view, which in general should not be possible for a newly opened inspector. My suspicion is that the web view is not actually attached to a window at the time the inspector is being opened. This patch adds a fail-safe that will detach the inspector view into its own window when these conditions are met while we are in middle of opening the inspector, and also adds logging to indicate if the inspected web view was actually in a window. This should both prevent the crash from the re-entry as well as provide more context when the issue does occur. * UIProcess/Inspector/WebInspectorUIProxy.cpp: (WebKit::WebInspectorUIProxy::open): * UIProcess/Inspector/WebInspectorUIProxy.h: * UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm: (WebKit::WebInspectorUIProxy::platformBringToFront): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289875 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-15 Patrick Angle Web Inspector: [Cocoa] Reentrancy in WebKit::WebInspectorUIProxy::open https://bugs.webkit.org/show_bug.cgi?id=236672 Reviewed by Devin Rousso. Speculative fix for non-reproducible reentrancy. Because `WebInspectorUIProxy::open` calls `WebInspectorUIProxy::platformBringToFront`, which under some conditions can call `WebInspectorUIProxy::open`, there was an opportunity for recurssion. This appears to happen when the window of the inspector view does not match the window of the inspected web view, which in general should not be possible for a newly opened inspector. My suspicion is that the web view is not actually attached to a window at the time the inspector is being opened. This patch adds a fail-safe that will detach the inspector view into its own window when these conditions are met while we are in middle of opening the inspector, and also adds logging to indicate if the inspected web view was actually in a window. This should both prevent the crash from the re-entry as well as provide more context when the issue does occur. * UIProcess/Inspector/WebInspectorUIProxy.cpp: (WebKit::WebInspectorUIProxy::open): * UIProcess/Inspector/WebInspectorUIProxy.h: * UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm: (WebKit::WebInspectorUIProxy::platformBringToFront): 2022-02-15 Russell Epstein Revert r289343. rdar://problem/88629773 2022-02-14 Russell Epstein Cherry-pick r289658. rdar://problem/88678598 Regression(r287684) Microsoft teams meeting URLs fail to open the app https://bugs.webkit.org/show_bug.cgi?id=236516 Reviewed by Geoffrey Garen. Add a quirk for Microsoft teams. Source/WebCore: * page/Quirks.cpp: (WebCore::Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture): * page/Quirks.h: Source/WebKit: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289658 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-11 Chris Dumez Regression(r287684) Microsoft teams meeting URLs fail to open the app https://bugs.webkit.org/show_bug.cgi?id=236516 Reviewed by Geoffrey Garen. Add a quirk for Microsoft teams. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): 2022-02-08 Russell Epstein Cherry-pick r288090. rdar://problem/87601499 Frequent GPU process jetsams due to RemoteRenderingBackendProxy not claiming ownership of SharedMemory buffers https://bugs.webkit.org/show_bug.cgi?id=235226 Patch by Kimmo Kinnunen on 2022-01-17 Reviewed by Simon Fraser. Claim memory from SharedBitmaps and SharedMemory that RemoteRenderingBackendProxy asks and receives from RemoteRenderingBackend. This is not very good, as GPUP allocates most of the memory and thus might jetsam before WP claims them. However, that is a bigger change to be done after this one. No new tests, hard to test currently. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::Handle::takeOwnershipOfMemory const): * Shared/ShareableBitmap.h: * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::getShareableBitmap): (WebKit::RemoteRenderingBackendProxy::getFilteredImage): * WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp: (WebKit::RemoteResourceCacheProxy::recordNativeImageUse): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288090 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-17 Kimmo Kinnunen Frequent GPU process jetsams due to RemoteRenderingBackendProxy not claiming ownership of SharedMemory buffers https://bugs.webkit.org/show_bug.cgi?id=235226 Reviewed by Simon Fraser. Claim memory from SharedBitmaps and SharedMemory that RemoteRenderingBackendProxy asks and receives from RemoteRenderingBackend. This is not very good, as GPUP allocates most of the memory and thus might jetsam before WP claims them. However, that is a bigger change to be done after this one. No new tests, hard to test currently. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::Handle::takeOwnershipOfMemory const): * Shared/ShareableBitmap.h: * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::getShareableBitmap): (WebKit::RemoteRenderingBackendProxy::getFilteredImage): * WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp: (WebKit::RemoteResourceCacheProxy::recordNativeImageUse): 2022-02-07 Russell Epstein Cherry-pick r289150. rdar://problem/88521016 Don't use adattributiond on iOS https://bugs.webkit.org/show_bug.cgi?id=236157 Patch by Alex Christensen on 2022-02-04 Reviewed by John Wilander. It is still having configuration issues such as rdar://88334217 * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289150 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-04 Alex Christensen Don't use adattributiond on iOS https://bugs.webkit.org/show_bug.cgi?id=236157 Reviewed by John Wilander. It is still having configuration issues such as rdar://88334217 * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration): 2022-02-07 Russell Epstein Cherry-pick r289123. rdar://problem/88501750 [iOS][macOS] Adjust sysctl sandbox access https://bugs.webkit.org/show_bug.cgi?id=236082 Reviewed by Brent Fulgham. Adjust sysctl sandbox access based on telemetry. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289123 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-04 Per Arne Vollan [iOS][macOS] Adjust sysctl sandbox access https://bugs.webkit.org/show_bug.cgi?id=236082 Reviewed by Brent Fulgham. Adjust sysctl sandbox access based on telemetry. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2022-02-07 Russell Epstein Cherry-pick r289081. rdar://problem/87163253 Delay writing origin file in NetworkStorageManager https://bugs.webkit.org/show_bug.cgi?id=235897 rdar://87163253 Reviewed by Geoffrey Garen. Revert r288924 that delays writing origin file to when OriginStorageManager is destroyed, and take a different approach that schedules a async task to write origin file. PLT results show that the new approach can also make up for PLT regresion caused by r286936, where network process started to write origin file before replying sync storage message from web process. * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::localOriginStorageManager): * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::OriginStorageManager): (WebKit::OriginStorageManager::~OriginStorageManager): Deleted. * NetworkProcess/storage/OriginStorageManager.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289081 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-03 Sihui Liu Delay writing origin file in NetworkStorageManager https://bugs.webkit.org/show_bug.cgi?id=235897 rdar://87163253 Reviewed by Geoffrey Garen. Revert r288924 that delays writing origin file to when OriginStorageManager is destroyed, and take a different approach that schedules a async task to write origin file. PLT results show that the new approach can also make up for PLT regresion caused by r286936, where network process started to write origin file before replying sync storage message from web process. * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::localOriginStorageManager): * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::OriginStorageManager): (WebKit::OriginStorageManager::~OriginStorageManager): Deleted. * NetworkProcess/storage/OriginStorageManager.h: 2022-02-07 Russell Epstein Cherry-pick r289072. rdar://problem/88439656 [iOS][WP] Add access to required syscalls https://bugs.webkit.org/show_bug.cgi?id=236087 Reviewed by Brent Fulgham. Add access to required syscalls which are rarely used. This is based on recent telemetry. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289072 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-03 Per Arne Vollan [iOS][WP] Add access to required syscalls https://bugs.webkit.org/show_bug.cgi?id=236087 Reviewed by Brent Fulgham. Add access to required syscalls which are rarely used. This is based on recent telemetry. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2022-02-07 Russell Epstein Cherry-pick r289062. rdar://problem/87617695 Crash at com.apple.WebKit: WebKit::RemoteLayerBackingStore::display https://bugs.webkit.org/show_bug.cgi?id=236003 Source/WebCore: Patch by Kimmo Kinnunen on 2022-02-03 Reviewed by Simon Fraser. * platform/graphics/GraphicsLayerContentsDisplayDelegate.h: Add a comment not to call PlatformCALayer::setBackingStoreAttached() * platform/graphics/cocoa/WebProcessGraphicsContextGLCocoa.mm: Clear the PlatformCALayer contents in more explicit way. Source/WebKit: Patch by Kimmo Kinnunen on 2022-02-03 Reviewed by Simon Fraser. Using UI-side compositing, following chain would be the cause a crash: PlatformCALayerRemote::recursiveBuildTransaction RemoteLayerBackingStore::display PlatformCALayer::platformCALayerLayerDisplay WebProcessGraphicsContextGLCocoa.mm DisplayBufferDisplayDelegate::display PlatformCALayer::setContents(nullptr) The nullptr contents happens when the WebGL context does not have display buffer yet or when the display buffer creation would fail. Setting empty layer contents would destroy the RemoteLayerBackingStore, even though the callstack is in process of displaying the layer to the backing store. When setting PlatformCALayer contents "empty", clear the backing store instead of removing the backing store. Tested by LayoutTests/webgl (under ASAN, ios simulator) * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: * WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::setContents): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289062 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-03 Kimmo Kinnunen Crash at com.apple.WebKit: WebKit::RemoteLayerBackingStore::display https://bugs.webkit.org/show_bug.cgi?id=236003 Reviewed by Simon Fraser. Using UI-side compositing, following chain would be the cause a crash: PlatformCALayerRemote::recursiveBuildTransaction RemoteLayerBackingStore::display PlatformCALayer::platformCALayerLayerDisplay WebProcessGraphicsContextGLCocoa.mm DisplayBufferDisplayDelegate::display PlatformCALayer::setContents(nullptr) The nullptr contents happens when the WebGL context does not have display buffer yet or when the display buffer creation would fail. Setting empty layer contents would destroy the RemoteLayerBackingStore, even though the callstack is in process of displaying the layer to the backing store. When setting PlatformCALayer contents "empty", clear the backing store instead of removing the backing store. Tested by LayoutTests/webgl (under ASAN, ios simulator) * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: * WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::setContents): 2022-02-07 Russell Epstein Cherry-pick r289052. rdar://problem/88382949 [GPUP] Add read access to sysctl properties https://bugs.webkit.org/show_bug.cgi?id=236018 Reviewed by Darin Adler. Add read access to sysctl properties based on telemetry. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289052 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-03 Per Arne Vollan [GPUP] Add read access to sysctl properties https://bugs.webkit.org/show_bug.cgi?id=236018 Reviewed by Darin Adler. Add read access to sysctl properties based on telemetry. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2022-02-07 Russell Epstein Cherry-pick r289026. rdar://problem/87358372 Remove debug log accidentally added with r289018 https://bugs.webkit.org/show_bug.cgi?id=236000 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289026 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-02 Alex Christensen Remove debug log accidentally added with r289018 https://bugs.webkit.org/show_bug.cgi?id=236000 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): 2022-02-07 Russell Epstein Cherry-pick r289018. rdar://problem/87358372 Use private relay for all subresources if the main document main resource was loaded using private relay https://bugs.webkit.org/show_bug.cgi?id=236000 Source/WebCore: Patch by Alex Christensen on 2022-02-02 Reviewed by Brady Eidson. This can be manually tested using instructions in the radar. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setMainResourceWasPrivateRelayed): (WebCore::DocumentLoader::mainResourceWasPrivateRelayed const): Source/WebCore/PAL: Patch by Alex Christensen on 2022-02-02 Reviewed by Brady Eidson. * pal/spi/cf/CFNetworkSPI.h: Source/WebKit: Patch by Alex Christensen on 2022-02-02 Reviewed by Brady Eidson. * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::didReceiveResponse): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveResponse): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponse): (WebKit::NetworkLoad::notifyDidReceiveResponse): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::transferToNewWebProcess): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::sendDidReceiveResponsePotentiallyInNewBrowsingContextGroup): (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveResponse): * NetworkProcess/PingLoad.h: * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::didReceiveResponse): * NetworkProcess/PreconnectTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::processResponse): * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: (WebKit::ServiceWorkerNavigationPreloader::loadWithCacheEntry): (WebKit::ServiceWorkerNavigationPreloader::willSendRedirectedRequest): (WebKit::ServiceWorkerNavigationPreloader::didReceiveResponse): * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h: * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * Shared/PrivateRelayed.h: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::addParametersShared): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::mainFrameMainResource const): (WebKit::WebResourceLoader::willSendRequest): (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289018 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-02 Alex Christensen Use private relay for all subresources if the main document main resource was loaded using private relay https://bugs.webkit.org/show_bug.cgi?id=236000 Reviewed by Brady Eidson. * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::didReceiveResponse): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveResponse): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponse): (WebKit::NetworkLoad::notifyDidReceiveResponse): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::transferToNewWebProcess): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::sendDidReceiveResponsePotentiallyInNewBrowsingContextGroup): (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveResponse): * NetworkProcess/PingLoad.h: * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::didReceiveResponse): * NetworkProcess/PreconnectTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::processResponse): * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: (WebKit::ServiceWorkerNavigationPreloader::loadWithCacheEntry): (WebKit::ServiceWorkerNavigationPreloader::willSendRedirectedRequest): (WebKit::ServiceWorkerNavigationPreloader::didReceiveResponse): * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h: * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * Shared/PrivateRelayed.h: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::addParametersShared): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::mainFrameMainResource const): (WebKit::WebResourceLoader::willSendRequest): (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: 2022-02-07 Russell Epstein Cherry-pick r288957. rdar://problem/88300200 [iOS][WP] Add access in sandbox to Mach message https://bugs.webkit.org/show_bug.cgi?id=236021 Reviewed by Brent Fulgham. Add access in sandbox to required Mach message in the WebContent process on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288957 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-02 Per Arne Vollan [iOS][WP] Add access in sandbox to Mach message https://bugs.webkit.org/show_bug.cgi?id=236021 Reviewed by Brent Fulgham. Add access in sandbox to required Mach message in the WebContent process on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2022-02-07 Russell Epstein Cherry-pick r288949. rdar://problem/88226432 ServiceWorkerNavigationPreloader should only be used once https://bugs.webkit.org/show_bug.cgi?id=235882 Reviewed by Chris Dumez. Source/WebKit: In case service worker preload is being used and related service worker context crashes (or service worker context sends bad messages), We can end up in a bad state where we will ask the preload twice for the same response (once for good, and the next one as we go to didNotHandle case). To prevent this, we add checks in loadResponseFromPreloader and loadBodyFromPreloader. As part of this investigation, I found out that ServiceWorkerNavigationPreloader is not correctly handling the case of preload responses coming from cache. In particular, no body will be given since we return early in waitForBody in case the preload network load is null. Prevent this by making sure waitForBody calls the response completion handler if available, even if the preload network load is null. And update the response body callback before executing the response completion handler to make sure data received synchronously from the preload is given to the service worker fetch task. Test: http/wpt/service-workers/fetch-service-worker-preload-cache.https.html * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: LayoutTests: * http/wpt/service-workers/fetch-service-worker-preload-cache.https-expected.txt: Added. * http/wpt/service-workers/fetch-service-worker-preload-cache.https.html: Added. * http/wpt/service-workers/resources/fetch-service-worker-preload-script.py: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288949 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-02 Youenn Fablet ServiceWorkerNavigationPreloader should only be used once https://bugs.webkit.org/show_bug.cgi?id=235882 Reviewed by Chris Dumez. In case service worker preload is being used and related service worker context crashes (or service worker context sends bad messages), We can end up in a bad state where we will ask the preload twice for the same response (once for good, and the next one as we go to didNotHandle case). To prevent this, we add checks in loadResponseFromPreloader and loadBodyFromPreloader. As part of this investigation, I found out that ServiceWorkerNavigationPreloader is not correctly handling the case of preload responses coming from cache. In particular, no body will be given since we return early in waitForBody in case the preload network load is null. Prevent this by making sure waitForBody calls the response completion handler if available, even if the preload network load is null. And update the response body callback before executing the response completion handler to make sure data received synchronously from the preload is given to the service worker fetch task. Test: http/wpt/service-workers/fetch-service-worker-preload-cache.https.html * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: 2022-02-07 Russell Epstein Cherry-pick r288924. rdar://problem/87163253 Write origin file when OriginStorageManager is destroyed https://bugs.webkit.org/show_bug.cgi?id=235897 rdar://87163253 Reviewed by Darin Adler. The first WebStorage message sent from web process to network process is sync, and writing origin file when creating OriginStorageManager will delay the reply. Since we can get the origin information from in-memory map when OriginStorageManager is present, we may delay the write to until when OriginStorageManager is destroyed. This fixes the PLT regression from r286936. * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::localOriginStorageManager): * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::OriginStorageManager): (WebKit::OriginStorageManager::~OriginStorageManager): * NetworkProcess/storage/OriginStorageManager.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288924 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-01 Sihui Liu Write origin file when OriginStorageManager is destroyed https://bugs.webkit.org/show_bug.cgi?id=235897 rdar://87163253 Reviewed by Darin Adler. The first WebStorage message sent from web process to network process is sync, and writing origin file when creating OriginStorageManager will delay the reply. Since we can get the origin information from in-memory map when OriginStorageManager is present, we may delay the write to until when OriginStorageManager is destroyed. This fixes the PLT regression from r286936. * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::localOriginStorageManager): * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::OriginStorageManager): (WebKit::OriginStorageManager::~OriginStorageManager): * NetworkProcess/storage/OriginStorageManager.h: 2022-02-07 Russell Epstein Cherry-pick r288922. rdar://problem/88172449 [WP] Remove PostScript conversion code https://bugs.webkit.org/show_bug.cgi?id=235892 Reviewed by Tim Horton. The WebContent process no longer has access to the PostScript conversion service, so there is no need to keep this code. Source/WebCore: * loader/cache/CachedImage.cpp: (WebCore::CachedImage::convertedDataIfNeeded const): * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::convertPostScriptDataToPDF): Deleted. * platform/graphics/cg/PDFDocumentImage.h: Source/WebKit: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::pluginInfo): (WebKit::PDFPlugin::streamDidReceiveResponse): (WebKit::PDFPlugin::manualStreamDidReceiveResponse): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288922 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-01 Per Arne Vollan [WP] Remove PostScript conversion code https://bugs.webkit.org/show_bug.cgi?id=235892 Reviewed by Tim Horton. The WebContent process no longer has access to the PostScript conversion service, so there is no need to keep this code. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::pluginInfo): (WebKit::PDFPlugin::streamDidReceiveResponse): (WebKit::PDFPlugin::manualStreamDidReceiveResponse): 2022-02-07 Russell Epstein Cherry-pick r288898. rdar://problem/87785042 Protect NetworkConnectionToWebProcess::createFetchTask from a null service worker connection https://bugs.webkit.org/show_bug.cgi?id=235878 Reviewed by Chris Dumez. After https://bugs.webkit.org/show_bug.cgi?id=234179, there is no guarantee that we have a SWServer/SWServerConnection per session ID. This is only guaranteed if there is a corresponding network session. We add null pointer checks to NetworkConnectionToWebProcess::swConnection() which now returns a pointer. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createFetchTask): (WebKit::NetworkConnectionToWebProcess::swConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288898 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-02-01 Youenn Fablet Protect NetworkConnectionToWebProcess::createFetchTask from a null service worker connection https://bugs.webkit.org/show_bug.cgi?id=235878 Reviewed by Chris Dumez. After https://bugs.webkit.org/show_bug.cgi?id=234179, there is no guarantee that we have a SWServer/SWServerConnection per session ID. This is only guaranteed if there is a corresponding network session. We add null pointer checks to NetworkConnectionToWebProcess::swConnection() which now returns a pointer. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createFetchTask): (WebKit::NetworkConnectionToWebProcess::swConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded): 2022-02-07 Russell Epstein Cherry-pick r288864. rdar://problem/87192657 [iOS] Don't register undo actions in undoManager overridden by WKWebView client https://bugs.webkit.org/show_bug.cgi?id=235928 Patch by Matt Gilligan on 2022-01-31 Reviewed by Tim Horton. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::registerEditCommand): Use -[WKContentView undoManagerForWebView] rather than -undoManager to prevent registering actions in an undo manager overridden by a WKWebView subclass. This ensures that all actions are registered in the same manager. If the client has disabled groupsByEvent on the overridden undoManager, this prevents an exception from being thrown due to registering actions outside of an undo group. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288864 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-31 Matt Gilligan [iOS] Don't register undo actions in undoManager overridden by WKWebView client https://bugs.webkit.org/show_bug.cgi?id=235928 Reviewed by Tim Horton. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::registerEditCommand): Use -[WKContentView undoManagerForWebView] rather than -undoManager to prevent registering actions in an undo manager overridden by a WKWebView subclass. This ensures that all actions are registered in the same manager. If the client has disabled groupsByEvent on the overridden undoManager, this prevents an exception from being thrown due to registering actions outside of an undo group. 2022-02-07 Russell Epstein Cherry-pick r288860. rdar://problem/88584471 [iOS] Clean up some issues in the 'com.apple.WebKit.adattributiond.sb' sandbox https://bugs.webkit.org/show_bug.cgi?id=235929 Patch by Brent Fulgham on 2022-01-31 Reviewed by Alex Christensen. Revise a few syntax issues in the sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.adattributiond.sb: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288860 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-31 Brent Fulgham [iOS] Clean up some issues in the 'com.apple.WebKit.adattributiond.sb' sandbox https://bugs.webkit.org/show_bug.cgi?id=235929 Reviewed by Alex Christensen. Revise a few syntax issues in the sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.adattributiond.sb: 2022-02-07 Russell Epstein Cherry-pick r288848. rdar://problem/86950638 Web Inspector: [Cocoa] Crash in WebKit::WebInspectorUIProxy::attachmentViewDidChange https://bugs.webkit.org/show_bug.cgi?id=235842 Reviewed by Timothy Hatcher. Speculatively fix an occasional crash in WebKit::WebInspectorUIProxy::attachmentViewDidChange by ensuring that the WebInspectorUIProxy still exists before calling `attachmentViewDidChange`. Currently we are sometimes crashing while attempting to `m_objCAdapter.get()`, which is the first use of a member variable in `WebInspectorUIProxy::attachmentViewDidChange`. This retain pointer should never be able to not exists, since it storing `nil` is a valid state. This points to the WebInspectorUIProxy itself no longer existing. The fix is to check that we actually have a `WebInspectorUIProxy` before calling `attachmentViewDidChange`. This is also just good practice since `WebPageProxy::inspector()` is also able to return `nullptr` under certain circumstances, and all other calls to it are guarded to check if the WebInspectorUIProxy is still around first. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setInspectorAttachmentView): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288848 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-31 Patrick Angle Web Inspector: [Cocoa] Crash in WebKit::WebInspectorUIProxy::attachmentViewDidChange https://bugs.webkit.org/show_bug.cgi?id=235842 Reviewed by Timothy Hatcher. Speculatively fix an occasional crash in WebKit::WebInspectorUIProxy::attachmentViewDidChange by ensuring that the WebInspectorUIProxy still exists before calling `attachmentViewDidChange`. Currently we are sometimes crashing while attempting to `m_objCAdapter.get()`, which is the first use of a member variable in `WebInspectorUIProxy::attachmentViewDidChange`. This retain pointer should never be able to not exists, since it storing `nil` is a valid state. This points to the WebInspectorUIProxy itself no longer existing. The fix is to check that we actually have a `WebInspectorUIProxy` before calling `attachmentViewDidChange`. This is also just good practice since `WebPageProxy::inspector()` is also able to return `nullptr` under certain circumstances, and all other calls to it are guarded to check if the WebInspectorUIProxy is still around first. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setInspectorAttachmentView): 2022-02-07 Russell Epstein Cherry-pick r288831. rdar://problem/88268450 [iOS] SharePlay is shown prominently for system-provided Share Sheets https://bugs.webkit.org/show_bug.cgi?id=235895 rdar://88268450 Reviewed by Wenson Hsieh. Source/WebKit: Content shared using the Web Share API should not display a SharePlay action. * UIProcess/Cocoa/WKShareSheet.mm: (-[WKShareSheet presentWithShareDataArray:inRect:]): Use `-[UIActivityViewController setExcludedActivityTypes:]` to ensure a SharePlay action is not displayed. Source/WTF: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288831 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-31 Aditya Keerthi [iOS] SharePlay is shown prominently for system-provided Share Sheets https://bugs.webkit.org/show_bug.cgi?id=235895 rdar://88268450 Reviewed by Wenson Hsieh. Content shared using the Web Share API should not display a SharePlay action. * UIProcess/Cocoa/WKShareSheet.mm: (-[WKShareSheet presentWithShareDataArray:inRect:]): Use `-[UIActivityViewController setExcludedActivityTypes:]` to ensure a SharePlay action is not displayed. 2022-02-07 Russell Epstein Cherry-pick r288825. rdar://problem/88172449 [WP] Remove PostScript conversion code https://bugs.webkit.org/show_bug.cgi?id=235892 Reviewed by Brent Fulgham. The WebContent process no longer has access to the PostScript conversion service, so there is no need to keep this code. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::streamDidFinishLoading): (WebKit::PDFPlugin::manualStreamDidFinishLoading): (WebKit::PDFPlugin::convertPostScriptDataIfNeeded): Deleted. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288825 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-31 Per Arne Vollan [WP] Remove PostScript conversion code https://bugs.webkit.org/show_bug.cgi?id=235892 Reviewed by Brent Fulgham. The WebContent process no longer has access to the PostScript conversion service, so there is no need to keep this code. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::streamDidFinishLoading): (WebKit::PDFPlugin::manualStreamDidFinishLoading): (WebKit::PDFPlugin::convertPostScriptDataIfNeeded): Deleted. 2022-02-07 Russell Epstein Cherry-pick r288776. rdar://problem/88214729 [macOS][WP] Temporarily add syscall to sandbox https://bugs.webkit.org/show_bug.cgi?id=235841 Reviewed by Brent Fulgham. Temporarily add syscall to sandbox in the WebContent process on macOS. This can be removed when is fixed. * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288776 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-28 Per Arne Vollan [macOS][WP] Temporarily add syscall to sandbox https://bugs.webkit.org/show_bug.cgi?id=235841 Reviewed by Brent Fulgham. Temporarily add syscall to sandbox in the WebContent process on macOS. This can be removed when is fixed. * WebProcess/com.apple.WebProcess.sb.in: 2022-02-07 Russell Epstein Cherry-pick r288754. rdar://problem/88035818 Ensure session is added in network process when it creates connection to web process https://bugs.webkit.org/show_bug.cgi?id=235754 Reviewed by Chris Dumez. In NetworkProcess::CreateNetworkConnectionToWebProcess, if the session that web process is using is not added yet, WorkQueueMessageReceiver cannot be added to the connection and storage messages will be dropped. Usually session is added in NetworkProcess::AddWebsiteDataStore, which is sent from UI process before NetworkProcess::CreateNetworkConnectionToWebProcess; but CreateNetworkConnectionToWebProcess message has DispatchMessageEvenWhenWaitingForSyncReply flag set, so it might get processed earlier. To fix the issue, now we send set DispatchMessageEvenWhenWaitingForSyncReply flag on AddWebsiteDataStore message too, so it's processed before CreateNetworkConnectionToWebProcess. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::addSession): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288754 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-28 Sihui Liu Ensure session is added in network process when it creates connection to web process https://bugs.webkit.org/show_bug.cgi?id=235754 Reviewed by Chris Dumez. In NetworkProcess::CreateNetworkConnectionToWebProcess, if the session that web process is using is not added yet, WorkQueueMessageReceiver cannot be added to the connection and storage messages will be dropped. Usually session is added in NetworkProcess::AddWebsiteDataStore, which is sent from UI process before NetworkProcess::CreateNetworkConnectionToWebProcess; but CreateNetworkConnectionToWebProcess message has DispatchMessageEvenWhenWaitingForSyncReply flag set, so it might get processed earlier. To fix the issue, now we send set DispatchMessageEvenWhenWaitingForSyncReply flag on AddWebsiteDataStore message too, so it's processed before CreateNetworkConnectionToWebProcess. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::addSession): 2022-02-07 Russell Epstein Cherry-pick r288711. rdar://problem/88160246 [iOS][macOS] Removed unneeded telemetry https://bugs.webkit.org/show_bug.cgi?id=235742 Reviewed by Darin Adler. Remove some telemetry we have sufficient data for. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288711 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-27 Per Arne Vollan [iOS][macOS] Removed unneeded telemetry https://bugs.webkit.org/show_bug.cgi?id=235742 Reviewed by Darin Adler. Remove some telemetry we have sufficient data for. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2022-02-07 Russell Epstein Cherry-pick r288605. rdar://problem/87948317 REGRESSION (iOS 15.2): Loading gets stuck after back-navigation involving COOP header https://bugs.webkit.org/show_bug.cgi?id=235475 Reviewed by Geoffrey Garen. Source/WebCore: Make sure ShouldTreatAsContinuingLoad is properly propagated for back/forward navigations, not just regular loadRequests. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::loadWithNavigationAction): (WebCore::FrameLoader::loadPostRequest): (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): (WebCore::FrameLoader::loadDifferentDocumentItem): * loader/FrameLoader.h: Source/WebKit: WebPageProxy::continueNavigationInNewProcess() was failing to pass the identifier of the NetworkResourceLoader that needs to be resumed to ProvisionalPageProxy::goToBackForwardItem(). It was only passing it to ProvisionalPageProxy::loadRequest(), which is used for non-back/forward navigations. As a result, in case of COOP process-swap on back/forward navigation, the network process would start a fresh load instead of resuming the existing one. The fresh load would get a COOP header and thus trigger yet another process swap (and so on in a loop). Also fix an issue where ProvisionalPageProxy::goToBackForwardItem() would always use ShouldTreatAsContinuingLoad::YesAfterNavigationPolicyDecision even in the case of a COOP process-swap. In the case of a COOP process-swap, we should pass in ShouldTreatAsContinuingLoad::YesAfterProvisionalLoadStarted. This was causing us to do an extra call to didStartProvisionalLoad() and was causing the new API test to hit an assertion on debug builds. Covered by new API test. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::goToBackForwardItem): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::triggerBrowsingContextGroupSwitchForNavigation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadData): (WebKit::WebPage::goToBackForwardItem): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Tools: Add API test coverage. * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288605 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-25 Chris Dumez REGRESSION (iOS 15.2): Loading gets stuck after back-navigation involving COOP header https://bugs.webkit.org/show_bug.cgi?id=235475 Reviewed by Geoffrey Garen. WebPageProxy::continueNavigationInNewProcess() was failing to pass the identifier of the NetworkResourceLoader that needs to be resumed to ProvisionalPageProxy::goToBackForwardItem(). It was only passing it to ProvisionalPageProxy::loadRequest(), which is used for non-back/forward navigations. As a result, in case of COOP process-swap on back/forward navigation, the network process would start a fresh load instead of resuming the existing one. The fresh load would get a COOP header and thus trigger yet another process swap (and so on in a loop). Also fix an issue where ProvisionalPageProxy::goToBackForwardItem() would always use ShouldTreatAsContinuingLoad::YesAfterNavigationPolicyDecision even in the case of a COOP process-swap. In the case of a COOP process-swap, we should pass in ShouldTreatAsContinuingLoad::YesAfterProvisionalLoadStarted. This was causing us to do an extra call to didStartProvisionalLoad() and was causing the new API test to hit an assertion on debug builds. Covered by new API test. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::goToBackForwardItem): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::triggerBrowsingContextGroupSwitchForNavigation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadData): (WebKit::WebPage::goToBackForwardItem): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2022-02-07 Russell Epstein Cherry-pick r288586. rdar://problem/87994712 [macOS] Observe CFNetwork preference domain https://bugs.webkit.org/show_bug.cgi?id=235603 Reviewed by Darin Adler. Since the Networking process is now using CF prefs direct mode, the CFNetwork preference domain should be observed for changes. * UIProcess/Cocoa/PreferenceObserver.mm: (-[WKPreferenceObserver init]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288586 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-25 Per Arne Vollan [macOS] Observe CFNetwork preference domain https://bugs.webkit.org/show_bug.cgi?id=235603 Reviewed by Darin Adler. Since the Networking process is now using CF prefs direct mode, the CFNetwork preference domain should be observed for changes. * UIProcess/Cocoa/PreferenceObserver.mm: (-[WKPreferenceObserver init]): 2022-02-07 Russell Epstein Cherry-pick r288543. rdar://problem/84958961 REGRESSION(r282320): [Cocoa] User-installed fonts don't work in the GPU Process (in WKWebView) https://bugs.webkit.org/show_bug.cgi?id=235449 Reviewed by Darin Adler. Source/WebCore/PAL: * pal/spi/cf/CoreTextSPI.h: Source/WebKit: The reason for this bug was I was misusing kCTFontOptionsSystemUIFont. I thought this flag just meant "allow the creation of system fonts" but it turns out it means something more subtle than that. Instead of unconditionally specifying this flag, we should just pull out the options field from the source font (which will include that flag if the font was a system font) and use that instead. Test: fast/text/user-installed-canvas.html * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder>::encodePlatformData): (IPC::createCTFont): (IPC::ArgumentCoder>::decodePlatformData): LayoutTests: * fast/text/user-installed-canvas-expected.html: Added. * fast/text/user-installed-canvas.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288543 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-24 Myles C. Maxfield REGRESSION(r282320): [Cocoa] User-installed fonts don't work in the GPU Process (in WKWebView) https://bugs.webkit.org/show_bug.cgi?id=235449 Reviewed by Darin Adler. The reason for this bug was I was misusing kCTFontOptionsSystemUIFont. I thought this flag just meant "allow the creation of system fonts" but it turns out it means something more subtle than that. Instead of unconditionally specifying this flag, we should just pull out the options field from the source font (which will include that flag if the font was a system font) and use that instead. Test: fast/text/user-installed-canvas.html * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder>::encodePlatformData): (IPC::createCTFont): (IPC::ArgumentCoder>::decodePlatformData): 2022-02-07 Russell Epstein Cherry-pick r288478. rdar://problem/72567903 Regression (r286936): SessionStorage data is not cleared when deleting website data by modification time https://bugs.webkit.org/show_bug.cgi?id=235542 Reviewed by Chris Dumez. Source/WebKit: The old behavior before r286936 is to delete SessionStorage data regardless of the modifiedSince parameter. r286936 made it check modifiedSince and perform deleteion when modifiedSince time is -Walltime::infinity. This patch corrects it by deleting SessionStorage data when modifiedSince time is in the past. API test: SessionStorage.ClearByModificationTime * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::StorageBucket::deleteData): Tools: * TestWebKitAPI/Tests/WebKitCocoa/SessionStorage.mm: (TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288478 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-24 Sihui Liu Regression (r286936): SessionStorage data is not cleared when deleting website data by modification time https://bugs.webkit.org/show_bug.cgi?id=235542 Reviewed by Chris Dumez. The old behavior before r286936 is to delete SessionStorage data regardless of the modifiedSince parameter. r286936 made it check modifiedSince and perform deleteion when modifiedSince time is -Walltime::infinity. This patch corrects it by deleting SessionStorage data when modifiedSince time is in the past. API test: SessionStorage.ClearByModificationTime * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::StorageBucket::deleteData): 2022-02-07 Russell Epstein Cherry-pick r288466. rdar://problem/82554226 REGRESSION (iOS 15): HTMLAudioElement fails to load new audio when device is locked or safari is in background https://bugs.webkit.org/show_bug.cgi?id=229688 Reviewed by Jer Noble. Source/WebCore: An iOS application loses its NowPlaying status as soon as the AudioSession category is set to Ambient, and it can only get it back again by changing the category to Playback *and* starting playback. When an application is in the background, however, it can't start playback unless it *already* has NowPlaying status. So, ipso facto, background playback will always fail once the category is set to Ambient. If an AudioSession's category is set to Playback when it is activated, it will interrupt another application playing audio, activate Bluetooth routes, etc. This means WebKit has to relinquish Playback when a page is unable to produce audio because AVFoundation automatically activates the audio session when playback starts - even if the AVPlayer is muted or has no audio. To allow pages that were playing audio when WebKit went into the background to continue to play after switching urls or activating another media element, add a grace period when switch from Playback to Ambient. Test: media/audio-session-category.html * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::updateSessionState): Source/WebKit: * WebProcess/GPU/media/RemoteAudioSession.cpp: (WebKit::RemoteAudioSession::category const): Return the most recently set category on all platforms so it is possible to test. LayoutTests: * fast/mediasession/metadata/audio-track-enabled.html: Wait longer for the audio session category to be reset. * media/audio-session-category-expected.txt: Added. * media/audio-session-category.html: Added. * platform/gtk/TestExpectations: Skip new test. * platform/mac-wk1/TestExpectations: Skip new test, MediaStream isn't supported on WK1. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288466 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-24 Eric Carlson REGRESSION (iOS 15): HTMLAudioElement fails to load new audio when device is locked or safari is in background https://bugs.webkit.org/show_bug.cgi?id=229688 Reviewed by Jer Noble. * WebProcess/GPU/media/RemoteAudioSession.cpp: (WebKit::RemoteAudioSession::category const): Return the most recently set category on all platforms so it is possible to test. 2022-02-07 Russell Epstein Cherry-pick r288387. rdar://problem/87468788 Inject Launch Services database before NSApplication is initialized https://bugs.webkit.org/show_bug.cgi?id=235186 Reviewed by Chris Dumez. To avoid the main thread getting stuck, the Launch Services database should be injected before NSApplication is initialized, since the initialization now depends on the database. To make sure also prewarmed WebContent processes are receiving the Launch Services database, the WebsiteDataStore method sendNetworkProcessXPCEndpointToProcess is moved to the class NetworkProcessProxy, since prewarmed processes will not have a data store initially. This allows us to simplify the code, since we are no longer depending on having a Website data store before sending the XPC endpoint. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::sendNetworkProcessXPCEndpointToProcess): (WebKit::WebsiteDataStore::sendNetworkProcessXPCEndpointToProcess const): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::platformDidReceiveLoadParameters): * WebProcess/cocoa/LaunchServicesDatabaseManager.h: * WebProcess/cocoa/LaunchServicesDatabaseManager.mm: (WebKit::LaunchServicesDatabaseManager::waitForDatabaseUpdate): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288387 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-21 Per Arne Vollan Inject Launch Services database before NSApplication is initialized https://bugs.webkit.org/show_bug.cgi?id=235186 Reviewed by Chris Dumez. To avoid the main thread getting stuck, the Launch Services database should be injected before NSApplication is initialized, since the initialization now depends on the database. To make sure also prewarmed WebContent processes are receiving the Launch Services database, the WebsiteDataStore method sendNetworkProcessXPCEndpointToProcess is moved to the class NetworkProcessProxy, since prewarmed processes will not have a data store initially. This allows us to simplify the code, since we are no longer depending on having a Website data store before sending the XPC endpoint. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::sendNetworkProcessXPCEndpointToProcess): (WebKit::WebsiteDataStore::sendNetworkProcessXPCEndpointToProcess const): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::platformDidReceiveLoadParameters): * WebProcess/cocoa/LaunchServicesDatabaseManager.h: * WebProcess/cocoa/LaunchServicesDatabaseManager.mm: (WebKit::LaunchServicesDatabaseManager::waitForDatabaseUpdate): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2022-02-07 Russell Epstein Cherry-pick r288296. rdar://problem/88593227 Disable fallback path to WebRTC platform sockets https://bugs.webkit.org/show_bug.cgi?id=235402 Reviewed by Eric Carlson. We should not fallback to the legacy WebRTC socket code path in Cocoa ports. Instead, if we cannot create the corresponding sockets (in case of ssltcp candidates for instance), we mark the socket as closed. Minor refactoring to show that NetworkRTCUDPSocketCocoa code path should always be successful. Manually tested on meet.google.com which can make use of ssltcp candidates. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: * NetworkProcess/webrtc/NetworkRTCProvider.h: * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288296 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-20 Youenn Fablet Disable fallback path to WebRTC platform sockets https://bugs.webkit.org/show_bug.cgi?id=235402 Reviewed by Eric Carlson. We should not fallback to the legacy WebRTC socket code path in Cocoa ports. Instead, if we cannot create the corresponding sockets (in case of ssltcp candidates for instance), we mark the socket as closed. Minor refactoring to show that NetworkRTCUDPSocketCocoa code path should always be successful. Manually tested on meet.google.com which can make use of ssltcp candidates. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: * NetworkProcess/webrtc/NetworkRTCProvider.h: * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: 2022-02-07 Russell Epstein Cherry-pick r288185. rdar://problem/87709485 [Cocoa] Do not change preferred AudioSession buffer size when VPIO is running https://bugs.webkit.org/show_bug.cgi?id=235317 Reviewed by Eric Carlson. Source/WebCore: Add infra to be notified when audio capture unit is stopped. Add a check to return early with microphone sample callback if microphone samples are not to be processed. Manually tested. * platform/mediastream/mac/BaseAudioSharedUnit.cpp: * platform/mediastream/mac/BaseAudioSharedUnit.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/mediastream/mac/CoreAudioCaptureSource.h: Source/WebKit: When we stop capturing, we might still use the VPIO unit to render audio. In that case, it might be problematic to increase the preferred buffer size as: - Audio unit might stop running, hence stopping audio rendering - Increasing the preferred buffer size might increase latency which is not a good thing in VPIO usecases. * GPUProcess/media/RemoteAudioSessionProxy.cpp: * GPUProcess/media/RemoteAudioSessionProxyManager.cpp: * GPUProcess/media/RemoteAudioSessionProxyManager.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288185 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-19 Youenn Fablet [Cocoa] Do not change preferred AudioSession buffer size when VPIO is running https://bugs.webkit.org/show_bug.cgi?id=235317 Reviewed by Eric Carlson. When we stop capturing, we might still use the VPIO unit to render audio. In that case, it might be problematic to increase the preferred buffer size as: - Audio unit might stop running, hence stopping audio rendering - Increasing the preferred buffer size might increase latency which is not a good thing in VPIO usecases. * GPUProcess/media/RemoteAudioSessionProxy.cpp: * GPUProcess/media/RemoteAudioSessionProxyManager.cpp: * GPUProcess/media/RemoteAudioSessionProxyManager.h: 2022-02-07 Russell Epstein Cherry-pick r288178. rdar://problem/79296770 REGRESSION (r264352): Mail compose body field does not avoid the keyboard when scrolling after focus https://bugs.webkit.org/show_bug.cgi?id=235331 rdar://79296770 Reviewed by Tim Horton. Source/WebKit: After r264352 added the call to `_page->scheduleFullEditorStateUpdate();` during element focus, scrolling to reveal the selection in the focused body field in Mail stopped working. This is because Mail: 1. Sets `firstResponderKeyboardAvoidanceEnabled` to NO on the WKScrollView, which prevents automatic inset adjustment logic in UIKit from taking effect and adding the keyboard height to the bottom system content inset. 2. Manually sets `-contentScrollInset` on the WKScrollView during a UIKeyboardDidShowNotification, which occurs after we've already attempted to zoom to the selection. ...combined with the fact that without the call to `scheduleFullEditorStateUpdate()`, the next EditorState would've arrived only after the keyboard animation finished. The end result is that we don't end up avoiding the keyboard at all when focusing the body field in Mail compose. While rdar://87733414 tracks refactoring logic in WebKit2 Mail compose to ensure that the content scroll insets on WKScrollView are applied during UIKeyboardWillShowNotification instead of after the keyboard has finished animating in, this patch provides a short-term workaround by restoring pre-r264352 behavior, with respect to when the element is scrolled into view. Test: editing/selection/ios/scroll-to-reveal-selection-with-keyboard-avoidance-disabled.html * Platform/spi/ios/UIKitSPI.h: Add a declaration for the `-firstResponderKeyboardAvoidanceEnabled` SPI property on non-internal iOS SDKs. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _keyboardDidShow:]): Plumb this through to the WKContentView, so we can zoom/scroll to the focused element if needed. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanUpInteraction]): (-[WKContentView _keyboardDidShow]): If we previously deferred the call to `-_zoomToRevealFocusedElement` due to the keyboard still animating in, schedule a call to it now on a 0-delay timer; this delay is necessary to ensure that this zoom occurs *after* Mail has already set the content inset, which also happens underneath a "KeyboardDidShow" notification. (-[WKContentView _zoomToRevealFocusedElement]): In the case where the (presumably internal) client has set `firstResponderKeyboardAvoidanceEnabled` to NO and the keyboard is animating in, defer the actual call into the web view to `-_zoomToRevealFocusedElement` until after the keyboard animation is finished. This ensures compatibility with existant logic in Mail for manually setting the content scroll inset on the WKScrollView after the keyboard animation is complete. (-[WKContentView resetShouldZoomToFocusRectAfterShowingKeyboard]): (-[WKContentView _elementDidBlur]): Tools: Add support for a UIScriptController hook to override `firstResponderKeyboardAvoidanceEnabled` on WKScrollView. See LayoutTests for more details. * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: * TestRunnerShared/UIScriptContext/UIScriptController.h: (WTR::UIScriptController::setScrollViewKeyboardAvoidanceEnabled): * WebKitTestRunner/ios/TestControllerIOS.mm: (WTR::TestController::platformResetStateToConsistentValues): * WebKitTestRunner/ios/UIScriptControllerIOS.h: * WebKitTestRunner/ios/UIScriptControllerIOS.mm: (WTR::UIScriptControllerIOS::setScrollViewKeyboardAvoidanceEnabled): LayoutTests: Add a layout test that (at least) exercises the newly added codepath, where focusing an editor when the scroll view has `firstResponderKeyboardAvoidanceEnabled` set to NO will still allow us to scroll to the selection. * editing/selection/ios/scroll-to-reveal-selection-with-keyboard-avoidance-disabled-expected.txt: Added. * editing/selection/ios/scroll-to-reveal-selection-with-keyboard-avoidance-disabled.html: Added. * resources/ui-helper.js: (window.UIHelper.setScrollViewKeyboardAvoidanceEnabled): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288178 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-18 Wenson Hsieh REGRESSION (r264352): Mail compose body field does not avoid the keyboard when scrolling after focus https://bugs.webkit.org/show_bug.cgi?id=235331 rdar://79296770 Reviewed by Tim Horton. After r264352 added the call to `_page->scheduleFullEditorStateUpdate();` during element focus, scrolling to reveal the selection in the focused body field in Mail stopped working. This is because Mail: 1. Sets `firstResponderKeyboardAvoidanceEnabled` to NO on the WKScrollView, which prevents automatic inset adjustment logic in UIKit from taking effect and adding the keyboard height to the bottom system content inset. 2. Manually sets `-contentScrollInset` on the WKScrollView during a UIKeyboardDidShowNotification, which occurs after we've already attempted to zoom to the selection. ...combined with the fact that without the call to `scheduleFullEditorStateUpdate()`, the next EditorState would've arrived only after the keyboard animation finished. The end result is that we don't end up avoiding the keyboard at all when focusing the body field in Mail compose. While rdar://87733414 tracks refactoring logic in WebKit2 Mail compose to ensure that the content scroll insets on WKScrollView are applied during UIKeyboardWillShowNotification instead of after the keyboard has finished animating in, this patch provides a short-term workaround by restoring pre-r264352 behavior, with respect to when the element is scrolled into view. Test: editing/selection/ios/scroll-to-reveal-selection-with-keyboard-avoidance-disabled.html * Platform/spi/ios/UIKitSPI.h: Add a declaration for the `-firstResponderKeyboardAvoidanceEnabled` SPI property on non-internal iOS SDKs. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _keyboardDidShow:]): Plumb this through to the WKContentView, so we can zoom/scroll to the focused element if needed. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanUpInteraction]): (-[WKContentView _keyboardDidShow]): If we previously deferred the call to `-_zoomToRevealFocusedElement` due to the keyboard still animating in, schedule a call to it now on a 0-delay timer; this delay is necessary to ensure that this zoom occurs *after* Mail has already set the content inset, which also happens underneath a "KeyboardDidShow" notification. (-[WKContentView _zoomToRevealFocusedElement]): In the case where the (presumably internal) client has set `firstResponderKeyboardAvoidanceEnabled` to NO and the keyboard is animating in, defer the actual call into the web view to `-_zoomToRevealFocusedElement` until after the keyboard animation is finished. This ensures compatibility with existant logic in Mail for manually setting the content scroll inset on the WKScrollView after the keyboard animation is complete. (-[WKContentView resetShouldZoomToFocusRectAfterShowingKeyboard]): (-[WKContentView _elementDidBlur]): 2022-02-07 Russell Epstein Cherry-pick r288128. rdar://problem/87711220 Copy com.apple.WebKit.adattributiond.sb into place with other iOS sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=235320 Patch by Alex Christensen on 2022-01-18 Reviewed by Per Arne Vollan. Ever since r287100 we are using the sandbox profile, but it doesn't exist so we just crash. * WebKit.xcodeproj/project.pbxproj: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288128 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-18 Alex Christensen Copy com.apple.WebKit.adattributiond.sb into place with other iOS sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=235320 Reviewed by Per Arne Vollan. Ever since r287100 we are using the sandbox profile, but it doesn't exist so we just crash. * WebKit.xcodeproj/project.pbxproj: 2022-02-07 Russell Epstein Cherry-pick r288076. rdar://problem/83863292 Ensure in flight layer transactions don't accumulate further canvas drawing https://bugs.webkit.org/show_bug.cgi?id=231163 Reviewed by Simon Fraser. Source/WebCore: When UI side compositing is enabled (as it is on iOS), we build a layer tree transaction in RemoteLayerTreeDrawingArea::updateRendering to send off to the UI process. At a high level, updateRendering does this: 1. Run any requestAnimationFrame callbacks 2. Iterate over the composited layers to draw their contents into the layer backing stores 3. Dispatch a task to a different thread to flush the contexts of the layer backing stores and then send the transaction to the UI process Step 3 is done off a separate task as an optimization, to get the drawing work queued up by step 2 happening in parallel to any work the page may day once updateRendering is finished. This can be a problem when: - GPU process canvas rendering is enabled (but DOM rendering is disabled) - we have accelerated ImageBuffers for both layer backing stores and canvas backing stores - the page does canvas drawing between steps 2 and 3, which affects the contents of a canvas backing store IOSurface that was drawn into a layer backing store IOSurface while building the transaction The way we draw the canvas contents into the layer is by creating a CGImage from the canvas backing store ImageBuffer's IOSurface. Normally, if we draw into an IOSurface that has been wrapped by a CGImage, this will cause the CGImage to obtain a unique copy of the IOSurface's pixels, rather than continue holding on to the IOSurface itself. When the drawing of this CGImage on to the layer backing store IOSurface happens, the "draw image" command is queued up to be processed later. It's only when the flush happens in step 3 above that the drawing occurs. This means that the CGImage wrapping the IOSurface exists until that flush. But while the CGImage does exist, it's in the Web process, and the canvas drawing on to the same IOSurface happens in the GPU process. Since QuartzCore doesn't know of its existence, it doesn't cause the copy-on-write to occur. The effect of this is that subsequent page drawing on to the canvas can make its way into the layer transaction unexpectedly. This patch induces the copy-on-write in the Web process when needed, by tracking whether a canvas has been drawn into a layer backing store and the layer transaction flush hasn't happened yet. Just before we do any more drawing on the canvas, if we are in this state, we perform a no-op drawing command on the IOSurface, then flush, to make the CGImage copy the IOSurface data out. * html/HTMLCanvasElement.cpp: (WebCore::imageDrawingRequiresGuardAgainstUseByPendingLayerTransaction): We only need to induce the CGImage copy-on-write behavior if both the layer and canvas backing stores are accelerated, the canvas ImageBuffer is remote, and the layer ImageBuffer is not remote. (WebCore::HTMLCanvasElement::paint): (WebCore::HTMLCanvasElement::drawingContext const): Use drawingContext as a convenient single place to check whether we are performing the first drawing command before the layer tree transaction flush has happened. * html/HTMLCanvasElement.h: * page/Page.h: (WebCore::Page::setIsAwaitingLayerTreeTransactionFlush): (WebCore::Page::isAwaitingLayerTreeTransactionFlush const): * platform/graphics/ImageBufferBackend.h: (WebCore::ImageBufferBackend::ensureNativeImagesHaveCopiedBackingStore): * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::ensureNativeImagesHaveCopiedBackingStore): The flush is needed since the CGImage wrapping the IOSurface will only copy the pixel data out once the no-op drawing command is processed. * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: Source/WebKit: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): (WebKit::WebPage::didFlushLayerTreeAtTime): Inform the WebCore::Page about the state of the layer tree transaction building. * WebProcess/WebPage/WebPage.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288076 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-16 Cameron McCormack Ensure in flight layer transactions don't accumulate further canvas drawing https://bugs.webkit.org/show_bug.cgi?id=231163 Reviewed by Simon Fraser. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): (WebKit::WebPage::didFlushLayerTreeAtTime): Inform the WebCore::Page about the state of the layer tree transaction building. * WebProcess/WebPage/WebPage.h: 2022-02-07 Russell Epstein Cherry-pick r287995. rdar://problem/87458502 Avoid unnecessary call to windowScreenDidChange https://bugs.webkit.org/show_bug.cgi?id=235198 Reviewed by Geoffrey Garen. It is a page load performance progression to avoid this call in initWithDrawingAreaProxy. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287995 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-13 Per Arne Vollan Avoid unnecessary call to windowScreenDidChange https://bugs.webkit.org/show_bug.cgi?id=235198 Reviewed by Geoffrey Garen. It is a page load performance progression to avoid this call in initWithDrawingAreaProxy. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]): 2022-02-07 Russell Epstein Cherry-pick r287970. rdar://problem/87423294 PCM: Same-site triggering events should support ephemeral measurement https://bugs.webkit.org/show_bug.cgi?id=235160 Reviewed by Alex Christensen. Source/WebCore: We added ephemeral measurement for direct response advertising in https://bugs.webkit.org/show_bug.cgi?id=228984. We added support for same-site triggering events in https://bugs.webkit.org/show_bug.cgi?id=233173. These two features should work together. The bug was that WebKit::NetworkSession::handlePrivateClickMeasurementConversion() only checked for cross-site triggering events when handling ephemeral measurements. Test: http/tests/privateClickMeasurement/triggering-event-with-attribution-source-through-fetch-keepalive-ephemeral.html * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::isNeitherSameSiteNorCrossSiteTriggeringEvent): New convenience function to enhance readability in WebKit::NetworkSession::handlePrivateClickMeasurementConversion(). * loader/PrivateClickMeasurement.h: Source/WebKit: We added ephemeral measurement for direct response advertising in https://bugs.webkit.org/show_bug.cgi?id=228984. We added support for same-site triggering events in https://bugs.webkit.org/show_bug.cgi?id=233173. These two features should work together. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::handlePrivateClickMeasurementConversion): This function previously only checked for cross-site triggering events when handling ephemeral measurements. Now it also checks for same-site triggering events. LayoutTests: * http/tests/privateClickMeasurement/triggering-event-with-attribution-source-through-fetch-keepalive-ephemeral-expected.txt: Added. * http/tests/privateClickMeasurement/triggering-event-with-attribution-source-through-fetch-keepalive-ephemeral.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287970 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-12 John Wilander PCM: Same-site triggering events should support ephemeral measurement https://bugs.webkit.org/show_bug.cgi?id=235160 Reviewed by Alex Christensen. We added ephemeral measurement for direct response advertising in https://bugs.webkit.org/show_bug.cgi?id=228984. We added support for same-site triggering events in https://bugs.webkit.org/show_bug.cgi?id=233173. These two features should work together. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::handlePrivateClickMeasurementConversion): This function previously only checked for cross-site triggering events when handling ephemeral measurements. Now it also checks for same-site triggering events. 2022-02-07 Russell Epstein Cherry-pick r287959. rdar://problem/80213097 Add to Contact menu item does nothing on mac. https://bugs.webkit.org/show_bug.cgi?id=235154 Source/WebCore: Reviewed by Tim Horton. Add to Context menu item for telephone numbers did not actually show the contact card. This was because the delgate did not tell the menu where to display the card from, so it just failed. Plumbing that information through fixes the issue. * page/ChromeClient.h: (WebCore::ChromeClient::handleTelephoneNumberClick): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::handleClick): Source/WebKit: rdar://80213097 Reviewed by Tim Horton. Add to Context menu item for telephone numbers did not actually show the contact card. This was because the delgate did not tell the menu where to display the card from, so it just failed. Plumbing that information through fixes the issue. * Platform/mac/MenuUtilities.h: * Platform/mac/MenuUtilities.mm: (-[WKEmptyPresenterHighlightDelegate initWithRect:]): (-[WKEmptyPresenterHighlightDelegate revealContext:rectsForItem:]): (-[WKEmptyPresenterHighlightDelegate revealContext:shouldUseDefaultHighlightForItem:]): (WebKit::menuForTelephoneNumber): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::showTelephoneNumberMenu): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleTelephoneNumberClick): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::handleTelephoneNumberClick): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287959 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-12 Megan Gardner Add to Contact menu item does nothing on mac. https://bugs.webkit.org/show_bug.cgi?id=235154 rdar://80213097 Reviewed by Tim Horton. Add to Context menu item for telephone numbers did not actually show the contact card. This was because the delgate did not tell the menu where to display the card from, so it just failed. Plumbing that information through fixes the issue. * Platform/mac/MenuUtilities.h: * Platform/mac/MenuUtilities.mm: (-[WKEmptyPresenterHighlightDelegate initWithRect:]): (-[WKEmptyPresenterHighlightDelegate revealContext:rectsForItem:]): (-[WKEmptyPresenterHighlightDelegate revealContext:shouldUseDefaultHighlightForItem:]): (WebKit::menuForTelephoneNumber): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::showTelephoneNumberMenu): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleTelephoneNumberClick): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::handleTelephoneNumberClick): 2022-02-07 Russell Epstein Cherry-pick r287930. rdar://problem/85790203 [iOS] Page loading hangs for ~10s on WebProcess launch https://bugs.webkit.org/show_bug.cgi?id=235089 Reviewed by Eric Carlson. WebPage::setMuted() will result in calling into the current audioCaptureFactory, which will be by default CoreAudioAudioCaptureFactory unless replaced. CoreAudioAudioCaptureFactory will in turn call into AVAudioSession, which will block for multiple seconds due to the WebContent process sandbox. Change the order in which these calls occur by configuring the audioCaptureFactory in platformInitialize(), which occurs near the top of the constructor. This requires access to the WebPageCreationParameters passed into the constructor, modify that method to take a WebPageCreationParameters, and modify all the platform-specific definitions of that method. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::platformInitialize): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_appHighlightsVisible): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformInitialize): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformInitialize): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformInitializeAccessibility): (WebKit::WebPage::platformInitialize): Deleted. * WebProcess/WebPage/playstation/WebPagePlayStation.cpp: (WebKit::WebPage::platformInitialize): * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::platformInitialize): * WebProcess/WebPage/wpe/WebPageWPE.cpp: (WebKit::WebPage::platformInitialize): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287930 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-12 Jer Noble [iOS] Page loading hangs for ~10s on WebProcess launch https://bugs.webkit.org/show_bug.cgi?id=235089 Reviewed by Eric Carlson. WebPage::setMuted() will result in calling into the current audioCaptureFactory, which will be by default CoreAudioAudioCaptureFactory unless replaced. CoreAudioAudioCaptureFactory will in turn call into AVAudioSession, which will block for multiple seconds due to the WebContent process sandbox. Change the order in which these calls occur by configuring the audioCaptureFactory in platformInitialize(), which occurs near the top of the constructor. This requires access to the WebPageCreationParameters passed into the constructor, modify that method to take a WebPageCreationParameters, and modify all the platform-specific definitions of that method. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::platformInitialize): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_appHighlightsVisible): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformInitialize): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformInitialize): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformInitializeAccessibility): (WebKit::WebPage::platformInitialize): Deleted. * WebProcess/WebPage/playstation/WebPagePlayStation.cpp: (WebKit::WebPage::platformInitialize): * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::platformInitialize): * WebProcess/WebPage/wpe/WebPageWPE.cpp: (WebKit::WebPage::platformInitialize): 2022-02-07 Russell Epstein Cherry-pick r287914. rdar://problem/85451366 Protect DocumentLoader when a reference to its members is used. https://bugs.webkit.org/show_bug.cgi?id=233464 Patch by Frédéric Wang on 2022-01-12 Reviewed by Brady Eidson. Source/WebCore: No new tests, due to our infra (bug 127676). * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Ensure that DocumentLoader loader remains alive while DocumentLoader::m_mainDocumentError is used. Source/WebKit: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishLoadForFrame): If the navigationID is obsolete, skip update of the page load state to avoid failure of debug ASSERT. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad): Ensure that DocumentLoader loader remains alive while DocumentLoader::m_request is used. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287914 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-12 Frédéric Wang Protect DocumentLoader when a reference to its members is used. https://bugs.webkit.org/show_bug.cgi?id=233464 Reviewed by Brady Eidson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishLoadForFrame): If the navigationID is obsolete, skip update of the page load state to avoid failure of debug ASSERT. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad): Ensure that DocumentLoader loader remains alive while DocumentLoader::m_request is used. 2022-02-02 Russell Epstein Apply patch. rdar://problem/86150540 2022-02-01 Said Abou-Hallawa [GPU Process] Remove the resource use counters from the remote resource cache https://bugs.webkit.org/show_bug.cgi?id=235636 Reviewed by Simon Fraser. The display list items and the resource management messages are both communicated from the WebProcess and the GPUProcess through the stream connection. The resources will be sent to the GPUProcess, consumed by the display items and then released in the right order. So there is no need anymore for the resource use counters. * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::setStateWithQualifiedIdentifiers): (WebKit::RemoteDisplayListRecorder::clipToImageBufferWithQualifiedIdentifier): (WebKit::RemoteDisplayListRecorder::drawGlyphsWithQualifiedIdentifier): (WebKit::RemoteDisplayListRecorder::drawImageBufferWithQualifiedIdentifier): (WebKit::RemoteDisplayListRecorder::drawNativeImageWithQualifiedIdentifier): (WebKit::RemoteDisplayListRecorder::drawPatternWithQualifiedIdentifier): * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::releaseRemoteResource): (WebKit::RemoteRenderingBackend::releaseRemoteResourceWithQualifiedIdentifier): * GPUProcess/graphics/RemoteRenderingBackend.h: * GPUProcess/graphics/RemoteRenderingBackend.messages.in: * GPUProcess/graphics/RemoteResourceCache.cpp: (WebKit::RemoteResourceCache::cacheImageBuffer): (WebKit::RemoteResourceCache::cacheNativeImage): (WebKit::RemoteResourceCache::cacheFont): (WebKit::RemoteResourceCache::releaseRemoteResource): (WebKit::RemoteResourceCache::ensureResourceUseCounter): Deleted. (WebKit::RemoteResourceCache::maybeRemoveResource): Deleted. (WebKit::RemoteResourceCache::recordResourceUse): Deleted. (WebKit::RemoteResourceCache::updateHasActiveDrawables): Deleted. * GPUProcess/graphics/RemoteResourceCache.h: (WebKit::RemoteResourceCache::hasActiveDrawables const): (): Deleted. * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp: (WebKit::RemoteDisplayListRecorderProxy::recordResourceUse): * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::releaseRemoteResource): (WebKit::RemoteRenderingBackendProxy::recordNativeImageUse): Deleted. (WebKit::RemoteRenderingBackendProxy::recordFontUse): Deleted. (WebKit::RemoteRenderingBackendProxy::recordImageBufferUse): Deleted. * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h: * WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp: (WebKit::RemoteResourceCacheProxy::cacheImageBuffer): (WebKit::RemoteResourceCacheProxy::cachedImageBuffer const): (WebKit::RemoteResourceCacheProxy::releaseImageBuffer): (WebKit::RemoteResourceCacheProxy::recordImageBufferUse): (WebKit::RemoteResourceCacheProxy::recordNativeImageUse): (WebKit::RemoteResourceCacheProxy::recordFontUse): (WebKit::RemoteResourceCacheProxy::releaseNativeImage): (WebKit::RemoteResourceCacheProxy::clearNativeImageMap): (WebKit::RemoteResourceCacheProxy::releaseAllRemoteFonts): (WebKit::RemoteResourceCacheProxy::finalizeRenderingUpdateForFonts): (WebKit::RemoteResourceCacheProxy::remoteResourceCacheWasDestroyed): * WebProcess/GPU/graphics/RemoteResourceCacheProxy.h: 2022-02-01 Russell Epstein Cherry-pick r288844. rdar://problem/88241768 [macOS][WP] Add required syscall https://bugs.webkit.org/show_bug.cgi?id=235901 Reviewed by Brent Fulgham. * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288844 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-31 Per Arne Vollan [macOS][WP] Add required syscall https://bugs.webkit.org/show_bug.cgi?id=235901 Reviewed by Brent Fulgham. * WebProcess/com.apple.WebProcess.sb.in: 2022-01-31 Russell Epstein Cherry-pick r288652. rdar://problem/87169406 [WebAuthn] We should pass extensions to ASC if possible https://bugs.webkit.org/show_bug.cgi?id=235533 rdar://87169406 Reviewed by Brent Fulgham. This patch starts passing WebAuthn extensions to ASC if possible, in order to support the googleLegacyAppidSupport extension, which is required to register security keys on google.com. It also starts passing the attestationPreference option, which was not being passed before. Tested manually. Previous version of patch contained TestWebKitAPI.WebAuthenticationPanel.PublicKeyCredentialRequestOptionsASC and TestWebKitAPI.WebAuthenticationPanel.PublicKeyCredentialCreationOptionsASC, but were removed due to difficulty softlinking from tests. * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: * UIProcess/API/Cocoa/_WKAuthenticationExtensionsClientInputs.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (authenticationExtensionsClientInputs): * UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h: * UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm: * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::toNSString): (WebKit::toASCExtensions): (WebKit::configureRegistrationRequestContext): (WebKit::configurationAssertionRequestContext): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * WebKit.xcodeproj/project.pbxproj: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288652 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-26 J Pascoe [WebAuthn] We should pass extensions to ASC if possible https://bugs.webkit.org/show_bug.cgi?id=235533 rdar://87169406 Reviewed by Brent Fulgham. This patch starts passing WebAuthn extensions to ASC if possible, in order to support the googleLegacyAppidSupport extension, which is required to register security keys on google.com. It also starts passing the attestationPreference option, which was not being passed before. Tested manually. Previous version of patch contained TestWebKitAPI.WebAuthenticationPanel.PublicKeyCredentialRequestOptionsASC and TestWebKitAPI.WebAuthenticationPanel.PublicKeyCredentialCreationOptionsASC, but were removed due to difficulty softlinking from tests. * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: * UIProcess/API/Cocoa/_WKAuthenticationExtensionsClientInputs.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (authenticationExtensionsClientInputs): * UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.h: * UIProcess/WebAuthentication/Cocoa/AuthenticationServicesCoreSoftLink.mm: * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::toNSString): (WebKit::toASCExtensions): (WebKit::configureRegistrationRequestContext): (WebKit::configurationAssertionRequestContext): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * WebKit.xcodeproj/project.pbxproj: 2022-01-28 Russell Epstein Cherry-pick r288750. rdar://problem/88177392 [macOS][WP] Add required syscall https://bugs.webkit.org/show_bug.cgi?id=235828 Reviewed by Darin Adler. * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288750 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-28 Per Arne Vollan [macOS][WP] Add required syscall https://bugs.webkit.org/show_bug.cgi?id=235828 Reviewed by Darin Adler. * WebProcess/com.apple.WebProcess.sb.in: 2022-01-28 Russell Epstein Cherry-pick r287844. rdar://problem/87262730 [MacCatalyst] Add syscalls from iOS sandbox https://bugs.webkit.org/show_bug.cgi?id=234970 Reviewed by Darin Adler. Add syscalls from iOS sandbox that are not in the MacCatalyst sandbox, since these are potentially still needed on MacCatalyst. * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287844 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-10 Per Arne Vollan [MacCatalyst] Add syscalls from iOS sandbox https://bugs.webkit.org/show_bug.cgi?id=234970 Reviewed by Darin Adler. Add syscalls from iOS sandbox that are not in the MacCatalyst sandbox, since these are potentially still needed on MacCatalyst. * WebProcess/com.apple.WebProcess.sb.in: 2022-01-28 Russell Epstein Cherry-pick r288591. rdar://problem/87850345 [macOS][WP] Allow mach extension to service https://bugs.webkit.org/show_bug.cgi?id=235599 Reviewed by Darin Adler. Allow mach extension to a service in the WebContent process on macOS. * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288591 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-25 Per Arne Vollan [macOS][WP] Allow mach extension to service https://bugs.webkit.org/show_bug.cgi?id=235599 Reviewed by Darin Adler. Allow mach extension to a service in the WebContent process on macOS. * WebProcess/com.apple.WebProcess.sb.in: 2022-01-25 Alan Coon Cherry-pick r287990. rdar://problem/86781432 [iOS][Networking] Add access to required network service https://bugs.webkit.org/show_bug.cgi?id=235188 Reviewed by Brent Fulgham. Add access to required network service in the Networking process on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287990 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-13 Per Arne Vollan [iOS][Networking] Add access to required network service https://bugs.webkit.org/show_bug.cgi?id=235188 Reviewed by Brent Fulgham. Add access to required network service in the Networking process on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2022-01-25 Russell Epstein Cherry-pick r288315. rdar://problem/87601762 Implement WebGL GPU buffer texture upload path for Cocoa getUserMedia camera streams https://bugs.webkit.org/show_bug.cgi?id=235233 Patch by Kimmo Kinnunen on 2022-01-20 Reviewed by Youenn Fablet. Source/WebCore: Make full texture uploads from MediaStream camera captures use CVPixelBuffers instead of reading the pixels back. Implement MediaPlayerInterface::pixelBufferForCurrentTime() for MediaPlayerPrivateMediaSourceAVFObjC. Rename functions from pixelBuffer... to videoSample... Use new type MediaSampleVideoFrame instead of CVPixelBuffer. MediaSampleVideoFrame contains also the frame orientation. The orientation is needed as the camera might capture the image with a rotation or a flip. To avoid ifdefs, the new API videoSampleForCurrentTime exists for all platforms, but is currently called only by Cocoa. Also the type MediaSampleVideoFrame exists for all platforms but has the frame contents implementation only for Cocoa. Tested by fast/mediastream/getUserMedia-to-canvas-1.html fast/mediastream/getUserMedia-to-canvas-2.html Currently the "mirrored" part is tested manually, WebKit does not request mirrored camera image so it is dead code. * Headers.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::videoSampleForCurrentTime): (WebCore::MediaPlayer::pixelBufferForCurrentTime): Deleted. * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::copyVideoTextureToPlatformTexture): (WebCore::MediaPlayerPrivateInterface::videoSampleForCurrentTime): (WebCore::MediaPlayerPrivateInterface::pixelBufferForCurrentTime): Deleted. * platform/graphics/MediaSampleVideoFrame.h: Added. (WebCore::MediaSampleVideoFrame::orientation const): (WebCore::MediaSampleVideoFrame::pixelBuffer const): (WebCore::MediaSampleVideoFrame::operator== const): (WebCore::MediaSampleVideoFrame::encode const): (WebCore::MediaSampleVideoFrame::decode): * platform/graphics/avfoundation/MediaSampleVideoFrameAVF.mm: Added. (WebCore::MediaSampleVideoFrame::MediaSampleVideoFrame): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::videoSampleForCurrentTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::pixelBufferForCurrentTime): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoSampleForCurrentTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pixelBufferForCurrentTime): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::videoOrientation): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleForCurrentTime): * platform/graphics/cocoa/GraphicsContextGLCocoa.mm: (WebCore::GraphicsContextGLCocoa::copyTextureFromMedia): * platform/graphics/cv/GraphicsContextGLCV.h: * platform/graphics/cv/GraphicsContextGLCVCocoa.cpp: (WebCore::GraphicsContextGLCVCocoa::GraphicsContextGLCVCocoa): (WebCore::GraphicsContextGLCVCocoa::copyVideoFrameToTexture): (WebCore::GraphicsContextGLCVCocoa::copyPixelBufferToTexture): Deleted. * platform/graphics/cv/GraphicsContextGLCVCocoa.h: Source/WebKit: Rename functions from pixelBuffer... to videoFrame. Send new type MediaPlayerVideoFrame instead of CVPixelBuffer. MediaPlayerVideoFrame contains also the frame orientation. * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::copyTextureFromMedia): * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::invalidate): (WebKit::RemoteMediaPlayerProxy::videoFrameForCurrentTimeIfChanged): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm: (WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTimeIfChanged): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::videoFrameForCurrentTime): (WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: (WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime): Deleted. LayoutTests: * fast/mediastream/getUserMedia-to-canvas.html: * webrtc/routines.js: Test camera image rotations in the test. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288315 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-20 Kimmo Kinnunen Implement WebGL GPU buffer texture upload path for Cocoa getUserMedia camera streams https://bugs.webkit.org/show_bug.cgi?id=235233 Reviewed by Youenn Fablet. Rename functions from pixelBuffer... to videoFrame. Send new type MediaPlayerVideoFrame instead of CVPixelBuffer. MediaPlayerVideoFrame contains also the frame orientation. * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::copyTextureFromMedia): * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::invalidate): (WebKit::RemoteMediaPlayerProxy::videoFrameForCurrentTimeIfChanged): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm: (WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTimeIfChanged): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::videoFrameForCurrentTime): (WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: (WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime): Deleted. 2022-01-24 Alan Coon Cherry-pick r288389. rdar://problem/85405320 Disable CFURLCache in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=234988 Reviewed by Geoffrey Garen. Source/WebCore: _CFURLStorageSessionCopyCache can be slow (see rdar://85418732) and UI process may kill network process for being unresponsive. Since WebKit does not use CFURLCache, we should disable it to avoid the hang. * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier): * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::createPrivateStorageSession): Source/WebCore/PAL: * pal/spi/cf/CFNetworkSPI.h: Source/WebKit: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::newTestingSession): (WebKit::NetworkProcess::ensureSession): Source/WebKitLegacy: * WebCoreSupport/NetworkStorageSessionMap.cpp: (NetworkStorageSessionMap::ensureSession): Source/WTF: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288389 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-21 Sihui Liu Disable CFURLCache in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=234988 Reviewed by Geoffrey Garen. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::newTestingSession): (WebKit::NetworkProcess::ensureSession): 2022-01-24 Alan Coon Cherry-pick r288386. rdar://problem/87822314 [iOS][WP] Allow access to CFNetwork prefs https://bugs.webkit.org/show_bug.cgi?id=235457 Reviewed by Brent Fulgham. Allow access to CFNetwork prefs on internal builds. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288386 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-21 Per Arne Vollan [iOS][WP] Allow access to CFNetwork prefs https://bugs.webkit.org/show_bug.cgi?id=235457 Reviewed by Brent Fulgham. Allow access to CFNetwork prefs on internal builds. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2022-01-24 Alan Coon Cherry-pick r288375. rdar://problem/76403140 [macOS][GPUP] Add access to IOKit property https://bugs.webkit.org/show_bug.cgi?id=235450 Reviewed by Brent Fulgham. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288375 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-21 Per Arne Vollan [macOS][GPUP] Add access to IOKit property https://bugs.webkit.org/show_bug.cgi?id=235450 Reviewed by Brent Fulgham. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2022-01-24 Alan Coon Cherry-pick r288269. rdar://problem/86943871 Grant access to GlobalPreferences and GlobalPreferences_m uniformly https://bugs.webkit.org/show_bug.cgi?id=235387 Reviewed by Per Arne Vollan. We should allow access to GlobalPreferences_m.plist in the places where we currently allow GlobalPreferences.plist. We are inconsistent about this in our sandboxes, and telemetry shows that we need to provide access. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288269 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-19 Brent Fulgham Grant access to GlobalPreferences and GlobalPreferences_m uniformly https://bugs.webkit.org/show_bug.cgi?id=235387 Reviewed by Per Arne Vollan. We should allow access to GlobalPreferences_m.plist in the places where we currently allow GlobalPreferences.plist. We are inconsistent about this in our sandboxes, and telemetry shows that we need to provide access. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb: 2022-01-24 Alan Coon Cherry-pick r288238. rdar://problem/87272534 WebsiteDataStore.cpp uses switch statements for WebKit::ProcessAccessType enum that fall through ASSERT_NOT_REACHED() https://bugs.webkit.org/show_bug.cgi?id=234986 Reviewed by Darin Adler. Clean up / clarify processAccessType logic in WebsiteDataStore.cpp. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288238 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-19 Chris Dumez WebsiteDataStore.cpp uses switch statements for WebKit::ProcessAccessType enum that fall through ASSERT_NOT_REACHED() https://bugs.webkit.org/show_bug.cgi?id=234986 Reviewed by Darin Adler. Clean up / clarify processAccessType logic in WebsiteDataStore.cpp. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): 2022-01-24 Alan Coon Cherry-pick r288232. rdar://problem/87265153 WebKit::DownloadProxy::publishProgress() falls through ASSERT_NOT_REACHED() https://bugs.webkit.org/show_bug.cgi?id=234975 Reviewed by Darin Adler. * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::publishProgress): Let's not send the IPC if we failed to create the handle since the recipient code early returns when the handle is invalid. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288232 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-19 Chris Dumez WebKit::DownloadProxy::publishProgress() falls through ASSERT_NOT_REACHED() https://bugs.webkit.org/show_bug.cgi?id=234975 Reviewed by Darin Adler. * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::publishProgress): Let's not send the IPC if we failed to create the handle since the recipient code early returns when the handle is invalid. 2022-01-24 Alan Coon Cherry-pick r288180. rdar://problem/84440841 Loupe sometimes flips to the bottom of the page when dragging the end of a selection to the top of a page with selection flipping. https://bugs.webkit.org/show_bug.cgi?id=235220 Reviewed by Tim Horton. Source/WebCore: Test: fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-overflow.html When selecting on an EPUB in books, if you had a selection near the top of the page, and you dragged the end of the selection past the start and into the upper margin, sometimes this would result in the selection ending up on the previous page of content, which would result in the loupe being pushed to the bottom of the page (because the selection was on the previous page at the bottom), which is incorrect. The most solid way to keep this from happening is to clamp the selection to the unobscured content rect, which will keep selection from reaching back to the previous page. * platform/graphics/FloatPoint.cpp: (WebCore::FloatPoint::constrainedWithin const): * platform/graphics/FloatPoint.h: * platform/graphics/IntPoint.cpp: (WebCore::IntPoint::constrainedWithin const): * platform/graphics/IntPoint.h: Source/WebKit: When selecting on an EPUB in books, if you had a selection near the top of the page, and you dragged the end of the selection past the start and into the upper margin, sometimes this would result in the selection ending up on the previous page of content, which would result in the loupe being pushed to the bottom of the page (because the selection was on the previous page at the bottom), which is incorrect. The most solid way to keep this from happening is to clamp the selection to the unobscured content rect, which will keep selection from reaching back to the previous page. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::rangeForPointInRootViewCoordinates): LayoutTests: * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-overflow-expected.txt: Added. * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text-overflow.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288180 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-18 Megan Gardner Loupe sometimes flips to the bottom of the page when dragging the end of a selection to the top of a page with selection flipping. https://bugs.webkit.org/show_bug.cgi?id=235220 Reviewed by Tim Horton. When selecting on an EPUB in books, if you had a selection near the top of the page, and you dragged the end of the selection past the start and into the upper margin, sometimes this would result in the selection ending up on the previous page of content, which would result in the loupe being pushed to the bottom of the page (because the selection was on the previous page at the bottom), which is incorrect. The most solid way to keep this from happening is to clamp the selection to the unobscured content rect, which will keep selection from reaching back to the previous page. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::rangeForPointInRootViewCoordinates): 2022-01-24 Alan Coon Cherry-pick r288039. rdar://problem/79220540 [iOS] Occasional crash under -[UITargetedPreview initWithView:parameters:target:] when focusing form controls https://bugs.webkit.org/show_bug.cgi?id=235248 rdar://79220540 Reviewed by Tim Horton and Aditya Keerthi. Source/WebKit: It's possible for `-resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:` to return a `nil` snapshot view in the case where a screen update has not been performed yet (among other scenarios). In the case where UIKit returns `nil` when we're creating the targeted preview for the context menu when focusing a select element or file input, we'll crash due to an Objective-C exception in the initializer of UITargetedPreview. Mitigate this by falling back to an empty UIView after requesting the snapshot view to make our code robust against this scenario. Test: KeyboardInputTests.DoNotCrashWhenFocusingSelectWithoutViewSnapshot * UIProcess/ios/WKContentViewInteraction.mm: (createFallbackTargetedPreview): Tools: Add an API test that exercises the crash by forcing `-resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:` to return nil via swizzling. * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm: (TestWebKitAPI::nilResizableSnapshotViewFromRect): (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288039 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-14 Wenson Hsieh [iOS] Occasional crash under -[UITargetedPreview initWithView:parameters:target:] when focusing form controls https://bugs.webkit.org/show_bug.cgi?id=235248 rdar://79220540 Reviewed by Tim Horton and Aditya Keerthi. It's possible for `-resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:` to return a `nil` snapshot view in the case where a screen update has not been performed yet (among other scenarios). In the case where UIKit returns `nil` when we're creating the targeted preview for the context menu when focusing a select element or file input, we'll crash due to an Objective-C exception in the initializer of UITargetedPreview. Mitigate this by falling back to an empty UIView after requesting the snapshot view to make our code robust against this scenario. Test: KeyboardInputTests.DoNotCrashWhenFocusingSelectWithoutViewSnapshot * UIProcess/ios/WKContentViewInteraction.mm: (createFallbackTargetedPreview): 2022-01-24 Alan Coon Cherry-pick r288034. rdar://problem/86341944 REGRESSION: ARKit example loads a page full of random symbols instead of a 3D model https://bugs.webkit.org/show_bug.cgi?id=235254 Reviewed by Tim Horton. When we enabled the ModelDocument support, we disabled the ContentProvider path. This was a mistake - it has to be a runtime check. * UIProcess/API/Cocoa/WKPreferences.mm: Expose the ModelDocumentEnabled WebPreference so that it can be read from a WKWebViewConfiguration. (-[WKPreferences _setModelDocumentEnabled:]): (-[WKPreferences _modelDocumentEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Rather than the compile-time test, check the WebPreferences to see if ModelDocument is disabled. (-[WKWebViewContentProviderRegistry initWithConfiguration:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288034 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-14 Dean Jackson REGRESSION: ARKit example loads a page full of random symbols instead of a 3D model https://bugs.webkit.org/show_bug.cgi?id=235254 Reviewed by Tim Horton. When we enabled the ModelDocument support, we disabled the ContentProvider path. This was a mistake - it has to be a runtime check. * UIProcess/API/Cocoa/WKPreferences.mm: Expose the ModelDocumentEnabled WebPreference so that it can be read from a WKWebViewConfiguration. (-[WKPreferences _setModelDocumentEnabled:]): (-[WKPreferences _modelDocumentEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Rather than the compile-time test, check the WebPreferences to see if ModelDocument is disabled. (-[WKWebViewContentProviderRegistry initWithConfiguration:]): 2022-01-24 Alan Coon Cherry-pick r288010. rdar://problem/87557846 Expose way to encode CTAP commands with only the hash of ClientDataJSON https://bugs.webkit.org/show_bug.cgi?id=235191 Reviewed by Brent Fulgham. Source/WebKit: CTAP command encoding covered by existing tests (see CtapRequestTest) and the SPI in new API tests. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (+[_WKWebAuthenticationPanel encodeMakeCredentialCommandWithClientDataHash:options:userVerificationAvailability:]): (+[_WKWebAuthenticationPanel encodeGetAssertionCommandWithClientDataHash:options:userVerificationAvailability:]): Tools: * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: (TestWebKitAPI::TEST): Tests for new SPIs. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288010 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-14 J Pascoe Expose way to encode CTAP commands with only the hash of ClientDataJSON https://bugs.webkit.org/show_bug.cgi?id=235191 Reviewed by Brent Fulgham. CTAP command encoding covered by existing tests (see CtapRequestTest) and the SPI in new API tests. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (+[_WKWebAuthenticationPanel encodeMakeCredentialCommandWithClientDataHash:options:userVerificationAvailability:]): (+[_WKWebAuthenticationPanel encodeGetAssertionCommandWithClientDataHash:options:userVerificationAvailability:]): 2022-01-20 Russell Epstein Cherry-pick r288293. rdar://problem/87777915 Prevent empty folders being created during install builds rdar://87777915 Patch by Elliott Williams on 2022-01-20 Reviewed by Brady Eidson. The "Copy Daemon Plists" script phase has output files which aren't always written to. Since Xcode mkdir-p's these output directories, it ends up creating an empty directory under some circumstances. Fix by removing these declared outputs: since this script is install-only and executes quickly, it's not really a problem to have it run redundantly. Once we use XCBuild everywhere, it can be rewritten as a Copy Files phase. * WebKit.xcodeproj/project.pbxproj: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288293 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-20 Elliott Williams Prevent empty folders being created during install builds rdar://87777915 Reviewed by Brady Eidson. The "Copy Daemon Plists" script phase has output files which aren't always written to. Since Xcode mkdir-p's these output directories, it ends up creating an empty directory under some circumstances. Fix by removing these declared outputs: since this script is install-only and executes quickly, it's not really a problem to have it run redundantly. Once we use XCBuild everywhere, it can be rewritten as a Copy Files phase. * WebKit.xcodeproj/project.pbxproj: 2022-01-20 Russell Epstein Cherry-pick r287997. rdar://problem/87274541 Sometimes cannot scroll after using internal trackpad https://bugs.webkit.org/show_bug.cgi?id=235206 Reviewed by Simon Fraser. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::didStartMomentumPhase): (WebKit::MomentumEventDispatcher::setScrollingAccelerationCurve): * WebProcess/WebPage/MomentumEventDispatcher.h: We store std::optional in a map, but then when looking at whether we have a curve (to decide whether or not to even use MomentumEventDispatcher), we check if the map has *any* value for the given page... even an unengaged optional. To fix, check if the optional is engaged. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287997 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-13 Tim Horton Sometimes cannot scroll after using internal trackpad https://bugs.webkit.org/show_bug.cgi?id=235206 Reviewed by Simon Fraser. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::didStartMomentumPhase): (WebKit::MomentumEventDispatcher::setScrollingAccelerationCurve): * WebProcess/WebPage/MomentumEventDispatcher.h: We store std::optional in a map, but then when looking at whether we have a curve (to decide whether or not to even use MomentumEventDispatcher), we check if the map has *any* value for the given page... even an unengaged optional. To fix, check if the optional is engaged. 2022-01-20 Russell Epstein Cherry-pick r287957. rdar://problem/87327557 [WebAuthn] Fix freebie call without user gesture not being given https://bugs.webkit.org/show_bug.cgi?id=235078 rdar://87327557 Reviewed by Brent Fulgham. Source/WebKit: This logic was previously always requiring a user gesture. The desired behavior of giving pages a single "freebie" webauthn call without gesture was lost in a refactor. Tested manually on iOS device with webauthn.me. * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::processingUserGesture): Tools: Updated API test to reflect user gesture freebie. * TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-la-no-mock.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287957 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2022-01-12 J Pascoe [WebAuthn] Fix freebie call without user gesture not being given https://bugs.webkit.org/show_bug.cgi?id=235078 rdar://87327557 Reviewed by Brent Fulgham. This logic was previously always requiring a user gesture. The desired behavior of giving pages a single "freebie" webauthn call without gesture was lost in a refactor. Tested manually on iOS device with webauthn.me. * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::processingUserGesture): 2022-01-09 Sam Weinig Remove support for Direct2D https://bugs.webkit.org/show_bug.cgi?id=234999 Reviewed by Darin Adler. Direct2D and FTW have not been building for over a year. It is time to remove them. * PlatformFTW.cmake: Removed. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::Configuration::encode const): (WebKit::ShareableBitmap::Configuration::decode): (WebKit::ShareableBitmap::ShareableBitmap): (WebKit::ShareableBitmap::~ShareableBitmap): (WebKit::ShareableBitmap::numBytesForSize): * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::createPlatformImage): (WebKit::ShareableBitmap::dxSurface): Deleted. * Shared/win/ShareableBitmapDirect2D.cpp: Removed. * UIProcess/BackingStore.cpp: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/win/BackingStoreDirect2D.cpp: Removed. * UIProcess/win/WebPageProxyWin.cpp: (WebKit::WebPageProxy::device const): Deleted. (WebKit::WebPageProxy::setDevice): Deleted. * UIProcess/win/WebPopupMenuProxyWin.cpp: (WebKit::WebPopupMenuProxyWin::showPopupMenu): (WebKit::WebPopupMenuProxyWin::paint): (WebKit::WebPopupMenuProxyWin::setupSwapChain): Deleted. (WebKit::WebPopupMenuProxyWin::configureBackingStore): Deleted. * UIProcess/win/WebPopupMenuProxyWin.h: * UIProcess/win/WebView.cpp: (WebKit::WebView::WebView): (WebKit::WebView::onSizeEvent): (WebKit::WebView::setupSwapChain): Deleted. (WebKit::WebView::configureBackingStore): Deleted. * UIProcess/win/WebView.h: (WebKit::WebView::d3dDevice const): Deleted. (WebKit::WebView::d3dImmediateContext const): Deleted. * WebProcess/WebCoreSupport/WebPopupMenu.cpp: (WebKit::WebPopupMenu::show): * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::display): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::getImageForFindMatch): 2022-01-08 Tyler Wilcock AX: AccessibilityObject::setFocused(true) should make the webpage focused, and make web content the first responder https://bugs.webkit.org/show_bug.cgi?id=234885 Reviewed by Darin Adler. With this patch, focusing an element via an AX client on iOS makes web content the first responder. This allows a focus ring to be drawn and for web content to perform other important actions upon taking first respondership (see `[WKContentViewInteraction becomeFirstResponderForWebView]`), even when apps that embed WKWebViews don't make web content the first responder themselves. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder): 2022-01-07 Jean-Yves Avenard Remove IPC::SharedBufferDataReference and use IPC::SharedBufferCopy instead https://bugs.webkit.org/show_bug.cgi?id=234921 rdar://problem/87196287 Reviewed by Youenn Fablet. SharedBufferCopy didn't have to create a new SharedBuffer and copy its content; its IPC decoder can instead wrap the underlying SharedMemory into a SharedBuffer. Having removed those copies and extra allocations there's no longer a technical need to have both SharedBufferDataReference and SharedBufferCopy. The biggest winners of this change are the images transferred over IPC. We remove two memory allocation/copy the was occurring at both IPC boundaries. We also remove the need for SharedBufferCopy to use a contiguous SharedBuffer. This makes the IPC encoding much more efficient. Once transferred over IPC, with the current encoding implementation, the SharedBufferCopy automatically becomes a contiguous SharedBuffer, so calling makeContiguous() on the SharedBufferCopy is a no-op; this allows for zero regression speed-wise from this change. Fly-by changes: the PDF code uses IPC::DataReference object; the data was copied into a CFData or a SharedBuffer. By using IPC::SharedBufferCopy was can remove those copies as a SharedBuffer can be wrapped in a CFData. In the future, it's likely where such code pattern was used; more IPC::DataReference can be replaced broadly with IPC::SharedBufferCopy. * GPUProcess/media/RemoteImageDecoderAVFProxy.cpp: (WebKit::RemoteImageDecoderAVFProxy::createDecoder): (WebKit::RemoteImageDecoderAVFProxy::setData): * GPUProcess/media/RemoteImageDecoderAVFProxy.h: * GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in: * GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp: (WebKit::convertToUint8Array): (WebKit::convertToOptionalSharedBuffer): (WebKit::RemoteLegacyCDMSessionProxy::generateKeyRequest): (WebKit::RemoteLegacyCDMSessionProxy::update): (WebKit::RemoteLegacyCDMSessionProxy::cachedKeyForKeyID): (WebKit::RemoteLegacyCDMSessionProxy::sendMessage): * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.cpp: (WebKit::ServiceWorkerDownloadTask::didReceiveData): * Platform/IPC/HandleMessage.h: * Platform/IPC/SharedBufferCopy.cpp: (IPC::SharedBufferCopy::encode const): (IPC::SharedBufferCopy::decode): (IPC::SharedBufferCopy::safeBuffer const): * Platform/IPC/SharedBufferCopy.h: (IPC::SharedBufferCopy::SharedBufferCopy): (IPC::SharedBufferCopy::buffer): (IPC::SharedBufferCopy::buffer const): (IPC::SharedBufferCopy::contiguousBuffer const): * Platform/IPC/SharedBufferDataReference.cpp: Removed. * Platform/IPC/SharedBufferDataReference.h: Removed. * Scripts/webkit/messages.py: (function_parameter_type): (reply_arguments_type): (message_to_struct_declaration): (generate_message_handler): * Shared/WebCompiledContentRuleListData.cpp: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Sources.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView createPDFWithConfiguration:completionHandler:]): * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::platformRegisterAttachment): * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::sendAudioComponentRegistrations): * UIProcess/WebPageProxy.cpp: (WebKit::CompletionHandler [GPU Process] Can't getImageData on canvas larger than 4096x4096 https://bugs.webkit.org/show_bug.cgi?id=234321 Reviewed by Tim Horton. Consult the policy for how big a canvas can be, rather than hardcoding a number. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::updateSharedMemoryForGetPixelBufferHelper): 2022-01-07 Alex Christensen Make FullscreenManager::requestFullscreenForElement more robust https://bugs.webkit.org/show_bug.cgi?id=234995 Reviewed by Darin Adler. * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::requestEnterFullScreen): 2022-01-07 Chris Lord [GTK] REGRESSION: Kinetic scrolling via touch-screen behaves oddly https://bugs.webkit.org/show_bug.cgi?id=234958 Reviewed by Michael Catanzaro. The swipe signal handler didn't take into account Scrollbar::pixelsPerLineStep() and also incorrectly negated the vertical velocity. Ideally, touch scrolling would use precise wheel events, but as the rest of the code works correctly and scales by this amount, make the one-line change that conforms with the previous code. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseTouchSwipe): 2022-01-07 Patrick Angle REGRESSION(r286498): Web Inspector: Inspector^2 fails to load in release builds and crashes with an assertion in debug builds https://bugs.webkit.org/show_bug.cgi?id=234968 Reviewed by Devin Rousso. Inspector^2 would fail to open a local inspector frontend because m_inspectedPageIdentifier was not set before it was used in `WebInspectorUIProxy::createFrontendPage`. To correct this, we now cache the inspected page identifier immediately upon creating the WebInspectorUIProxy, instead of only in `WebInspectorUIProxy::updateForNewPageProcess`. This also allows us to use the cached identifier in `WebInspectorUIProxy::openLocalInspectorFrontend` as discussed in . * UIProcess/Inspector/WebInspectorUIProxy.cpp: (WebKit::WebInspectorUIProxy::WebInspectorUIProxy): (WebKit::WebInspectorUIProxy::openLocalInspectorFrontend): 2022-01-07 Said Abou-Hallawa [GPU Process] Remove the result FilterImage from FilterEffect https://bugs.webkit.org/show_bug.cgi?id=232840 rdar://85425842 Reviewed by Darin Adler. * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::drawFilteredImageBuffer): 2022-01-07 Patrick Angle [Cocoa] Web Driver: WebSocket over TLS failing over WebDriver with acceptInsecureCerts on Big Sur https://bugs.webkit.org/show_bug.cgi?id=234403 Reviewed by BJ Burg. macOS Big Sur and earlier do not use NSURLSession-based WebSockets, so we need a way to allow insecure certificates under automation that does not rely on the `WKNavigationDelegate` to determine if an authentication challenge should be accepted. In order to accomplish this we now plumb through an `_shouldAcceptInsecureCertificatesForWebSockets` value from `_WKAutomationSessionConfiguration` to `SocketStreamHandleImplCFNet` on platforms that do not `HAVE(NSURLSESSION_WEBSOCKET)`, which allows automation clients to enable this behavior when the `acceptInsecureCerts` capability is set on a session. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createSocketStream): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::shouldAcceptInsecureCertificatesForWebSockets const): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): * NetworkProcess/NetworkSocketStream.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _shouldAcceptInsecureCertificatesForWebSockets]): (-[_WKWebsiteDataStoreConfiguration _setShouldAcceptInsecureCertificatesForWebSockets:]): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::shouldAcceptInsecureCertificatesForWebSockets const): (WebKit::WebsiteDataStoreConfiguration::setShouldAcceptInsecureCertificatesForWebSockets): 2021-10-30 Myles C. Maxfield Web process shouldn't crash if ImageBuffer::ensureBackendCreated() fails https://bugs.webkit.org/show_bug.cgi?id=232520 Reviewed by Simon Fraser. Guard against the possibility of it returning null. No new tests because there shouldn't be any behavior change after https://bugs.webkit.org/show_bug.cgi?id=232470. It's still good to do this, though, to be defensive. * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::encode const): * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: (WebKit::RemoteImageBufferProxy::createImageBufferBackendHandle): 2022-01-07 Myles C. Maxfield ImageBuffer with floating point logicalSize() paints into a slightly truncated destination rect https://bugs.webkit.org/show_bug.cgi?id=225377 Reviewed by Tim Horton. This is the rest of https://bugs.webkit.org/show_bug.cgi?id=232470. This is also a follow-up of https://bugs.webkit.org/show_bug.cgi?id=232515. No new tests; the behavior change is covered by fast/backgrounds/hidpi-bitmap-background-origin-on-subpixel-position.html since Tim Horton reverted the workaround for this bug that he landed in r276945. * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer): 2022-01-07 Alex Christensen Unreviewed, reverting r287698. Broke an internal build Reverted changeset: "Start using C++20" https://bugs.webkit.org/show_bug.cgi?id=233963 https://commits.webkit.org/r287698 2022-01-07 Youenn Fablet Use completion handlers for takeAllMessagesForPort methods https://bugs.webkit.org/show_bug.cgi?id=234947 Reviewed by Chris Dumez. * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: 2022-01-07 Peng Liu Clean up FullscreenClient https://bugs.webkit.org/show_bug.cgi?id=233076 Reviewed by Jer Noble. This patch is a follow-up to r285741. - Get rid of `WKFullscreenClientView` and use `WKWebView` instead. * UIProcess/Cocoa/FullscreenClient.h: * UIProcess/Cocoa/FullscreenClient.mm: (WebKit::FullscreenClient::FullscreenClient): (WebKit::FullscreenClient::willEnterFullscreen): (WebKit::FullscreenClient::didEnterFullscreen): (WebKit::FullscreenClient::willExitFullscreen): (WebKit::FullscreenClient::didExitFullscreen): 2022-01-07 Per Arne Vollan [MacCatalyst] Add required syscall https://bugs.webkit.org/show_bug.cgi?id=234962 Reviewed by Brent Fulgham. Add required syscall in MacCatalyst sandbox. * WebProcess/com.apple.WebProcess.sb.in: 2022-01-06 Tim Horton Move linkedOnOrAfter() to WTF https://bugs.webkit.org/show_bug.cgi?id=234942 Reviewed by Darin Adler. * NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::configurationForSessionID): * Shared/Cocoa/AuxiliaryProcessCocoa.mm: (WebKit::AuxiliaryProcess::platformInitialize): * Shared/Cocoa/CompletionHandlerCallChecker.mm: (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): * Shared/Cocoa/DefaultWebBrowserChecks.mm: (WebKit::determineITPState): * Shared/Cocoa/WebKit2InitializeCocoa.mm: (WebKit::InitializeWebKit2): * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultPassiveTouchListenersAsDefaultOnDocument): (WebKit::defaultCSSOMViewScrollingAPIEnabled): (WebKit::defaultPassiveWheelListenersAsDefaultOnDocument): (WebKit::defaultWheelEventGesturesBecomeNonBlocking): (WebKit::defaultOfflineWebApplicationCacheEnabled): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/Cocoa/WKWebView.mm: (shouldAllowPictureInPictureMediaPlayback): (shouldAllowSettingAnyXHRHeaderFromFileURLs): (shouldRequireUserGestureToLoadVideo): (shouldRestrictBaseURLSchemes): (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setupPageConfiguration:]): (-[WKWebView reload]): (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (defaultShouldDecidePolicyBeforeLoadingQuickLookPreview): (-[WKWebViewConfiguration init]): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore init]): * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _computedObscuredInset]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/Inspector/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableOrZoomedMainFrame const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::makeViewBlankIfUnpaintedSinceLastLoadCommit): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessProxy.cpp: (WebKit::isMainThreadOrCheckDisabled): * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _shouldUseContextMenus]): (applicationIsKnownToIgnoreMouseEvents): * UIProcess/ios/WKScrollView.mm: (-[WKScrollView _systemContentInset]): * UIProcess/ios/WKStylusDeviceObserver.mm: (-[WKStylusDeviceObserver start]): (-[WKStylusDeviceObserver stop]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::desktopClassBrowsingRecommended): * WebProcess/cocoa/WebProcessCocoa.mm: 2022-01-06 Wenson Hsieh Add a helper function that returns the value of a std::optional or constructs T if needed https://bugs.webkit.org/show_bug.cgi?id=234865 Reviewed by Darin Adler. Use `valueOrDefault` where appropriate. See WTF/ChangeLog for more details. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::ensureSWServer): * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::fileTimes): * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::NetworkStorageManager): * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::loadRequest): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::registrableDomain const): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::convertFromPDFViewToRootView const): (WebKit::PDFPlugin::boundsOnScreen const): (WebKit::PDFPlugin::geometryDidChange): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScriptInFrameInScriptWorld): * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::didEnterFullscreen): 2022-01-06 Tim Horton Separate "linked-on-or-{before, after}-everything" override from the SDK version https://bugs.webkit.org/show_bug.cgi?id=234930 Reviewed by Wenson Hsieh. * Shared/AuxiliaryProcess.h: * Shared/Cocoa/AuxiliaryProcessCocoa.mm: (WebKit::AuxiliaryProcess::platformInitialize): * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getLinkedOnOrAfterOverride): Plumb the LOA override optional through process initialization (just like we do for SDK version, because linkedOnOrAfter() is used VERY early in JavaScriptCore initialization). * UIProcess/API/Cocoa/WKProcessPool.mm: (+[WKProcessPool _setLinkedOnOrBeforeEverythingForTesting]): (+[WKProcessPool _setLinkedOnOrAfterEverythingForTesting]): (+[WKProcessPool _setLinkedOnOrAfterEverything]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Expose non-testing SPI for Safari to opt in to "linked-on-or-after-everything" so that we can (eventually) stop using a bundle identifier check. * UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/WebProcessPool.cpp: Initialize the LOA override using the same logic we previously used in linkedOnOrAfter(). 2022-01-06 Youenn Fablet Microphone device filtering heuristic is too harsh https://bugs.webkit.org/show_bug.cgi?id=234596 Reviewed by Eric Carlson. * UIProcess/WebPageProxy.cpp: Disable filtering if audio capture happens in GPUProcess. 2022-01-06 Tim Horton Always assume Safari is "linked-on-or-after" any SDK version https://bugs.webkit.org/show_bug.cgi?id=234914 Reviewed by Aditya Keerthi. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Get rid of this special-case AssumeSafariIsAlwaysLinkedOnAfter::No, from r244203, because we no longer target versions of macOS that ship with versions of Safari that require this special case. 2022-01-06 Alex Christensen Start using C++20 https://bugs.webkit.org/show_bug.cgi?id=233963 Reviewed by Yusuke Suzuki. * Configurations/Base.xcconfig: * PlatformMac.cmake: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]): 2022-01-06 Chris Dumez Drop implementation for COOP / COEP violation reporting https://bugs.webkit.org/show_bug.cgi?id=234899 Reviewed by Geoffrey Garen. Drop implementation for COOP / COEP violation reporting. The implementation was based on an outdated version of the specification and has never shipped. Many COOP/COEP reporting tests are also flaky. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::performCORPCheck): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldInterruptNavigationForCrossOriginEmbedderPolicy): (WebKit::NetworkResourceLoader::shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy): (WebKit::NetworkResourceLoader::doCrossOriginOpenerHandlingOfResponse): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_appHighlightsVisible): (WebKit::WebPage::sendCOEPPolicyInheritenceViolation): Deleted. (WebKit::WebPage::sendCOEPCORPViolation): Deleted. (WebKit::WebPage::sendViolationReportWhenNavigatingToCOOPResponse): Deleted. (WebKit::WebPage::sendViolationReportWhenNavigatingAwayFromCOOPResponse): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::webSocketChannelManager): (WebKit::WebProcess::reportingEndpointsCache): Deleted. 2022-01-06 Jean-Yves Avenard Have CachedRawResourceClient and related networking actors use SharedBuffer. https://bugs.webkit.org/show_bug.cgi?id=232424 rdar://84744687 Reviewed by Youenn Fablet. * GPUProcess/media/RemoteMediaResource.cpp: (WebKit::RemoteMediaResource::dataReceived): * GPUProcess/media/RemoteMediaResource.h: * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveData): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveData): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::sendBuffer): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveData): * NetworkProcess/PingLoad.h: * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::didReceiveBuffer): * NetworkProcess/PreconnectTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.cpp: (WebKit::ServiceWorkerDownloadTask::didReceiveData): * NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.messages.in: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::loadBodyFromPreloader): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: (WebKit::ServiceWorkerNavigationPreloader::didReceiveBuffer): * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h: * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveBuffer): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::didReceiveBuffer): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::didReceiveData): * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::curlDidReceiveData): * NetworkProcess/curl/NetworkDataTaskCurl.h: * Platform/IPC/SharedBufferCopy.h: * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: (WebKit::MediaFormatReader::didParseTracks): * Shared/mac/MediaFormatReader/MediaFormatReader.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didReceiveData): * UIProcess/WebURLSchemeTask.h: * WebProcess/GPU/media/RemoteMediaResourceProxy.cpp: (WebKit::RemoteMediaResourceProxy::dataReceived): * WebProcess/GPU/media/RemoteMediaResourceProxy.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveData): (WebKit::WebResourceLoader::didReceiveResource): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::PDFPluginStreamLoaderClient::didReceiveData): (WebKit::PDFPlugin::streamDidReceiveData): (WebKit::PDFPlugin::manualStreamDidReceiveData): * WebProcess/Plugins/Plugin.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::didReceiveData): (WebKit::PluginView::manualLoadDidReceiveData): (WebKit::PluginView::redeliverManualStream): * WebProcess/Plugins/PluginView.h: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk): (WebKit::WebServiceWorkerFetchTaskClient::continueDidReceiveResponse): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::committedLoad): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp: (WebKit::WebPreviewLoaderClient::didReceiveData): * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::urlSchemeTaskDidReceiveData): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::taskDidReceiveData): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::didReceiveData): * WebProcess/WebPage/WebURLSchemeTaskProxy.h: 2022-01-06 Youenn Fablet ServiceWorkerNavigationPreloader::didComplete should make sure to call its bodyCallback https://bugs.webkit.org/show_bug.cgi?id=234884 Reviewed by Alex Christensen. Covered by existing tests. * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: Call to responseCallback may destroy the ServiceWorkerNavigationPreloader. To make sure to call its bodyCallback, we move it in the stack before calling responseCallback. 2021-10-30 Myles C. Maxfield [GPU Process] Small ImageBuffers cause the web process to crash https://bugs.webkit.org/show_bug.cgi?id=232470 Reviewed by Tim Horton. The problem is when the (floating point) size < 1x1, but the size*resolution is >= 1x1. In this situation, calculateSafeBackendSize() is correctly determining that this isn't a zero-sized ImageBuffer, but when we go to actually pass the size to the GPU process, we call this: IntSize logicalSize() const override { return IntSize(m_parameters.logicalSize); } So, the logical size gets truncated down to 0, and then the GPU process fails to allocate the ImageBuffer, and then the web process blocks on the GPU process indefinitely, and then eventually times out and then crashes. I'm going to deal with that last step (the crash itself) in a secondary patch - if the web process doesn't hear from the GPU process, it shouldn't crash. This patch simply exposes a floatLogicalSize() function on ImageBuffer, so we can get the full-fidelity logical size to pass that to the GPU process. This patch is just enough to stop WebKit from crashing. I'm going to continue looking into this bug in https://bugs.webkit.org/show_bug.cgi?id=225377. Test: compositing/device-pixel-image-buffer-hidpi.html * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer): 2022-01-05 Per Arne Vollan REGRESSION(287556): Domain name not shown in Activity Monitor https://bugs.webkit.org/show_bug.cgi?id=234903 Reviewed by Brent Fulgham. After r287556, domain names are no longer shown in Activity Monitor. The Networking process is responsible for setting process information on behalf of the WebContent process. Before r287556, this worked because a connection to the associated mach service was established before entering the sandbox. After r287556 we explicitly need to allow access to the service, since the sandbox has been applied when process information is set. In practice, access to the service was already allowed before, since an open connection to the service was established before entering the sandbox. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: 2022-01-05 Per Arne Vollan [iOS][WP] Allow syscall used on process launch https://bugs.webkit.org/show_bug.cgi?id=234898 Reviewed by Brent Fulgham. Allow syscall used on WebContent process launch on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2022-01-05 Devin Rousso REGRESSION(r285521): `errors` provided to `ApplePaySession.prototype.completeCouponCodeChange` are ignored https://bugs.webkit.org/show_bug.cgi?id=234893 Reviewed by Tim Horton. * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): Make sure to actually set the `errors` of the `PKPaymentRequestCouponCodeUpdate` using the `errors` inside `ApplePayShippingMethodUpdate`. This was accidentally removed in r285521. 2022-01-05 Tim Horton Move more SDK checks to linkedOnOrAfter() https://bugs.webkit.org/show_bug.cgi?id=234875 Reviewed by Sam Weinig. * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultCSSOMViewScrollingAPIEnabled): 2022-01-05 Tim Horton Fix the build * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::createWebWheelEvent): 2022-01-05 Per Arne Vollan [iOS][WP] Unable to consume mach extension https://bugs.webkit.org/show_bug.cgi?id=234889 Reviewed by Brent Fulgham. The WebContent process on iOS is unable to consume mach extensions to the frontboard service. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2022-01-05 Youenn Fablet NetworkRTCProvider::attributedBundleIdentifierFromPageIdentifier should check for m_connection https://bugs.webkit.org/show_bug.cgi?id=234845 Reviewed by Eric Carlson. NetworkRTCProvider may call attributedBundleIdentifierFromPageIdentifier in a background thread, which will then hop to main thread to get its session. NetworkRTCProvider might have been closed when getting to main thread so we need to check m_connection. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::attributedBundleIdentifierFromPageIdentifier): 2022-01-05 Tim Horton Momentum Event Dispatcher: Momentum tails may get truncated if the duration runs longer than the system's https://bugs.webkit.org/show_bug.cgi?id=234535 Reviewed by Simon Fraser. Currently, synthetic momentum dispatch is strictly tied to the duration of the real platform momentum phase, which has two unfortunate implications: - if our phase runs shorter than the platform phase, we'll keep dispatching zero-delta events until the platform momentum ends - more importantly, if our phase runs longer, it will be abruptly terminated when the platform momentum ends In practice, our synthetic phase is very close in duration to the system one, so the impact is minimal. But, to be safe, disentagle the two durations, using a new bit from the platform to determine if the system momentum phase was interrupted by the user (e.g. by tapping the trackpad) or naturally, and ignoring the ended event in the natural case, allowing synthetic events to continue being dispatched. * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): (WebKit::WebWheelEvent::encode const): (WebKit::WebWheelEvent::decode): * Shared/WebWheelEvent.h: (WebKit::WebWheelEvent::momentumEndType const): * Shared/WebWheelEventCoalescer.cpp: (WebKit::WebWheelEventCoalescer::coalesce): Plumb momentumEndType along on WebWheelEvent. Platforms that don't provide information about the interruption reason will always say Unknown. * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebWheelEvent): Only bother looking up the CGEvent/IOHIDEvent once, and extract all relevant details in one go. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::handleWheelEvent): Don't interrupt the synthetic momentum phase if the momentum-ended event comes from the natural end of the deceleration instead of an interruption (or an unknown reason). Keep track of whether we're in the middle of a platform momentum phase that we chose (at momentum-begin time) to override. When deciding whether to eat an incoming event, take *both* this new bit and whether we are currently in the middle of a synthetic phase into account. It is important to continue eating incoming events in the case where the synthetic phase ended early (so `active` became false) but the platform phase continues. (WebKit::MomentumEventDispatcher::dispatchSyntheticMomentumEvent): (WebKit::MomentumEventDispatcher::didEndMomentumPhase): Adjust some logging wording to be more precise. (WebKit::MomentumEventDispatcher::setScrollingAccelerationCurve): Make this log public so that the curve value is visible in logs. (WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime): Make consumeDeltaForCurrentTime inform the client via an optional when we are at the end of the delta table. (WebKit::MomentumEventDispatcher::displayWasRefreshed): Stop the synthetic momentum phase as soon as we run out of deltas. (WebKit::MomentumEventDispatcher::computeNextDelta): * WebProcess/WebPage/MomentumEventDispatcher.h: 2022-01-05 Per Arne Vollan [macCatalyst][GPUP][NetworkProcess] Block WindowServer connections https://bugs.webkit.org/show_bug.cgi?id=234432 Reviewed by Brent Fulgham. Block WindowServer connections on macCatalyst. * GPUProcess/mac/GPUProcessMac.mm: (WebKit::GPUProcess::initializeProcess): * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::initializeProcess): * Shared/Cocoa/AuxiliaryProcessCocoa.mm: (WebKit::AuxiliaryProcess::setApplicationIsDaemon): * WebAuthnProcess/mac/WebAuthnProcessMac.mm: (WebKit::WebAuthnProcess::initializeProcess): 2022-01-05 Per Arne Vollan [macOS][WP] Block sandbox access to syscall https://bugs.webkit.org/show_bug.cgi?id=234846 Reviewed by Brent Fulgham. Block sandbox access to syscall which only is needed on MacCatalyst. * WebProcess/com.apple.WebProcess.sb.in: 2022-01-05 Youenn Fablet Make sure secure websocket connections in service workers can trigger authentication challenge callbacks https://bugs.webkit.org/show_bug.cgi?id=234809 Reviewed by Chris Dumez. In case we are not using fast server trust evaluation, we are going to the UIProcess to check certificates. This is an issue for web socket loads triggered for service workers that have an invalid certificate. Before the patch, the challenge was not provided a top origin, so the default action would be triggered by UIProcess. To make sure this is working as expected, we now always pass the origin if it is the same as the top origin for web socket challenges. This makes sure we get a page with the same top origin and the challenge callback is called on the page. Covered by updated tests. * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkSession.cpp: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSocketChannel.cpp: * NetworkProcess/NetworkSocketChannel.h: * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: * NetworkProcess/cocoa/WebSocketTaskCocoa.h: * NetworkProcess/cocoa/WebSocketTaskCocoa.mm: * NetworkProcess/soup/NetworkSessionSoup.cpp: * NetworkProcess/soup/NetworkSessionSoup.h: * WebProcess/Network/WebSocketChannel.cpp: 2022-01-05 Youenn Fablet WebPageProxy::requestUserMediaPermissionForSpeechRecognition should return early in case of no capture devices https://bugs.webkit.org/show_bug.cgi?id=234837 Reviewed by Chris Dumez. Test: fast/speechrecognition/start-recognition-without-devices.html * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForSpeechRecognition): 2022-01-04 Wenson Hsieh ASSERTION FAILED: pathnames.size() == sandboxExtensionsHandleArray.size() in WebKit::WebPlatformStrategies::getPathnamesForType() https://bugs.webkit.org/show_bug.cgi?id=234851 rdar://87100377 Reviewed by Darin Adler. The new API test added r287547 (WKAttachmentTestsMac.InsertNonExistentImageFileAsAttachment) exercises inserting a nonexistent file as a "progress" attachment element when the WebKit attachment API is enabled. This test is the first on macOS that attempts to paste file paths pointing to nonexistent files on disk, and so it hits an existing assertion due to the number of sandbox extensions opened underneath `getPasteboardPathnamesForType()` not matching the number of file paths found on the pasteboard. This assertion is benign, since we do not expect to be able to read from the missing file path in the web process, so it's expected that we don't have a corresponding sandbox extension for missing files. To address this, we adjust `WebPasteboardProxy::getPasteboardPathnamesForType()` such that it always returns an equal number of path names and pathnames. Each missing path name simply corresponds to a `SandboxExtension::Handle` with a null `m_sandboxExtension`, which is skipped in the web process upon consumption. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): 2022-01-04 Ryan Haddad Unreviewed, reverting r287374. Caused assertion failures on Monterey Reverted changeset: "Re-enable CustomDisplayName and DefaultDisplayName API tests on Monterey" https://bugs.webkit.org/show_bug.cgi?id=234613 https://commits.webkit.org/r287374 2022-01-04 Simon Fraser "canceled" wheel events to non-zero deltas cause scrolling jumps in PDFs and CodeMirror https://bugs.webkit.org/show_bug.cgi?id=234825 Reviewed by Tim Horton. On some macOS versions, interrupting a momentum scroll via a two-finger tap on the trackpad can result in the following sequence of wheel events: momentumPhase:end -> phase:mayBegin -> phase:cancelled, and that last canceled event can have non-zero deltas (rdar://86653042). Protect against this by zeroing out the deltas for cancelled wheel events when constructing WebEvents from NSEvents. Code in Element::dispatchWheelEvent() ensures that we don't dispatch wheel events with zero deltas to script, fixing CodeMirror. Jumps only affected PDFs (and scrollable selects) because those are the code paths that don't go via ScrollingEffectsController, which already ignores Cancelled events. Test: fast/scrolling/mac/canceled-event-with-non-zero-deltas.html * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebWheelEvent): 2022-01-04 Wenson Hsieh Use ICU instead of relying on hard-coded string equality checks in ModalContainerControlClassifier https://bugs.webkit.org/show_bug.cgi?id=234677 Reviewed by Tim Horton. Followup to r287420 - use ICU to check for more strings that resemble either the lowercase or uppercase letter "x", rather than relying on a hard-coded set of symbols. Note that ICU's "confusables" list currently does not consider both ✖ and ✕ to be lookalikes to the letter "x"; since these symbols are actually known to appear in modal containers on several websites, we'll still need to check for these two symbols separately. Test: ModalContainerObservation.ClassifyMultiplySymbol * UIProcess/Cocoa/ModalContainerControlClassifier.mm: (WebKit::SpoofChecker::~SpoofChecker): Add a helper class that wraps calls to `uspoof_areConfusableUTF8`, and also ensures balanced calls to `uspoof_open` and `uspoof_close` when creating a new ICU spoof checker. Use this in the WKModalContainerClassifierInput class below to check for more types of strings that look like the letter "x". (WebKit::SpoofChecker::areConfusable): (WebKit::SpoofChecker::checker): (-[WKModalContainerClassifierInput initWithTokenizer:rawInput:]): 2022-01-04 Per Arne Vollan [iOS][WP] Add telemetry for syscall violations https://bugs.webkit.org/show_bug.cgi?id=234859 Reviewed by Brent Fulgham. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2022-01-04 Kate Cheney CrashTracer: com.apple.WebKit.Networking at com.apple.WebKit: WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess https://bugs.webkit.org/show_bug.cgi?id=234852 Reviewed by Brent Fulgham. Return early if a sqlite statement is null or fails to bind because this will cause a crash when trying to step. Even in cases where it won't crash, we should not continue in the function because this may have undefined behavior. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::getThirdPartyDataForSpecificFirstPartyDomains const): (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::includeTodayAsOperatingDateIfNecessary): (WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting): * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp: (WebKit::PCM::Database::earliestTimesToSend): 2022-01-04 Kate Cheney Partial revert of https://trac.webkit.org/changeset/287371/webkit RS by John Wilander. Keep logging in for test debugging purposes. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setPrivateClickMeasurementAppBundleIDForTesting): 2022-01-04 Tim Horton Momentum Event Dispatcher: Disable noisy logging https://bugs.webkit.org/show_bug.cgi?id=234178 Reviewed by Wenson Hsieh. * WebProcess/WebPage/MomentumEventDispatcher.h: 2022-01-04 Jer Noble [Cocoa] Hang in AVTrackPrivateAVFObjCImpl::bitrate() https://bugs.webkit.org/show_bug.cgi?id=234753 Reviewed by Eric Carlson. Propagate changes to TrackConfigurations upwards from the GPU process -> WebContent process. * GPUProcess/media/AudioTrackPrivateRemoteConfiguration.h: (WebKit::AudioTrackPrivateRemoteConfiguration::encode const): (WebKit::AudioTrackPrivateRemoteConfiguration::decode): * GPUProcess/media/RemoteAudioTrackProxy.cpp: (WebKit::RemoteAudioTrackProxy::configuration): (WebKit::RemoteAudioTrackProxy::configurationChanged): * GPUProcess/media/RemoteAudioTrackProxy.h: * GPUProcess/media/RemoteVideoTrackProxy.cpp: (WebKit::RemoteVideoTrackProxy::configuration): * GPUProcess/media/RemoteVideoTrackProxy.h: * GPUProcess/media/TrackPrivateRemoteConfiguration.h: (WebKit::TrackPrivateRemoteConfiguration::encode const): (WebKit::TrackPrivateRemoteConfiguration::decode): * GPUProcess/media/VideoTrackPrivateRemoteConfiguration.h: (WebKit::VideoTrackPrivateRemoteConfiguration::encode const): (WebKit::VideoTrackPrivateRemoteConfiguration::decode): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp: (WebKit::AudioTrackPrivateRemote::AudioTrackPrivateRemote): (WebKit::AudioTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/AudioTrackPrivateRemote.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::addRemoteAudioTrack): (WebKit::MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged): (WebKit::MediaPlayerPrivateRemote::addRemoteVideoTrack): (WebKit::MediaPlayerPrivateRemote::remoteVideoTrackConfigurationChanged): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in: * WebProcess/GPU/media/VideoTrackPrivateRemote.cpp: (WebKit::VideoTrackPrivateRemote::VideoTrackPrivateRemote): (WebKit::VideoTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/VideoTrackPrivateRemote.h: (WebKit::VideoTrackPrivateRemote::create): 2022-01-03 Per Arne Vollan [macOS] Initialize sandbox before initializing WebKit process https://bugs.webkit.org/show_bug.cgi?id=234827 Reviewed by Brent Fulgham. The sandbox should be initialized as early as possible in WebKit processes. * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initialize): 2022-01-03 Stephan Szabo [PlayStation] Build fix after r287552 https://bugs.webkit.org/show_bug.cgi?id=234828 Unreviewed build fix. Needed WebCore prefixing on SRGBA. * UIProcess/API/C/playstation/WKPagePrivatePlayStation.cpp: 2022-01-03 Sam Weinig Add resolved/unresolved color type accessors to require users to be explicit about whether they will handle missing/none color components https://bugs.webkit.org/show_bug.cgi?id=234798 Reviewed by Antti Koivisto. Replace uses of Color::toSRGBALossy<>() with Color::toColorTypeLossy>() and add calls to resolved() to access color components. * UIProcess/API/C/playstation/WKPagePrivatePlayStation.cpp: (drawPageBackground): * UIProcess/API/wpe/WebKitColor.cpp: (webkitColorFillFromWebCoreColor): * UIProcess/gtk/ViewGestureControllerGtk.cpp: (WebKit::ViewGestureController::beginSwipeGesture): * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (WebKit::animationValueFromKeyframeValue): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::getDocumentBackgroundColor): 2022-01-02 Wenson Hsieh [WebKit2] Camera continuity is disabled in richly editable content https://bugs.webkit.org/show_bug.cgi?id=234773 rdar://46323417 Reviewed by Darin Adler. `-[WKWebView validRequestorForSendType:returnType:]` currently never returns a nonnull result when the given send type is nil, because `WebViewImpl::validRequestorForSendAndReturnTypes` only sets `isValidSendType` to anything other than false if `sendType` is nonnull. Instead of doing this, we should match legacy WebKit behavior by treating the send type as "valid" if it's nil. Test: NSResponderTests.ValidRequestorForReturnTypes * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes): 2022-01-01 Jeff Miller Update user-visible copyright strings to include 2022 https://bugs.webkit.org/show_bug.cgi?id=234263 Reviewed by Anders Carlsson. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist: * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist: * Info.plist: * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-OSX.plist: * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist: * WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-OSX.plist: * WebAuthnProcess/EntryPoint/Cocoa/XPCService/WebAuthnService/Info-iOS.plist: * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist: 2021-12-31 Wenson Hsieh Refactor some Cocoa-specific code in WebCore::FontAttributes to be platform-agnostic https://bugs.webkit.org/show_bug.cgi?id=234757 See comments below (as well as WebCore/ChangeLog) for more details. Reviewed by Darin Adler. * Platform/cocoa/CocoaFont.h: Removed. Move this file into WebCore, as `FontCocoa.h`. * Shared/Cocoa/ArgumentCodersCocoa.mm: * Shared/Cocoa/CoreTextHelpers.h: * Shared/Cocoa/CoreTextHelpers.mm: Adjust a few places that currently import CocoaFont.h to import WebCore/FontCocoa.h instead. Additonally, change CocoaFont to WebCore::CocoaFont where necessary. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encodePlatformData): Deleted. (IPC::ArgumentCoder::decodePlatformData): Deleted. Remove platform-specific FontAttributes encoding/decoding logic. This is no longer needed, since we just propagate a Font instead of an NSFont or UIFont. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder>::encode): (IPC::ArgumentCoder>::decode): Add argument coders for `RefPtr` that encode the font only if it's non-null. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Remove the calls to `encodePlatformData/decodePlatformData`, and instead encode the `RefPtr`. * Shared/WebCoreArgumentCoders.h: * Shared/playstation/WebCoreArgumentCodersPlayStation.cpp: (IPC::ArgumentCoder::encodePlatformData): Deleted. (IPC::ArgumentCoder::decodePlatformData): Deleted. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): Deleted. (IPC::ArgumentCoder::decodePlatformData): Deleted. * Shared/win/WebCoreArgumentCodersWin.cpp: (IPC::ArgumentCoder::encodePlatformData): Deleted. (IPC::ArgumentCoder::decodePlatformData): Deleted. Remove some method stubs that are now unnecessary. * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (fontOfSize): * WebKit.xcodeproj/project.pbxproj: 2021-12-26 Sam Weinig Replace WebKit/CocoaColor.h with WebCore/ColorCocoa.h, not confusing at all https://bugs.webkit.org/show_bug.cgi?id=234693 Reviewed by Simon Fraser. We don't need both. The WebCore one can work for both. * Platform/cocoa/CocoaColor.h: Removed. * Shared/Cocoa/ArgumentCodersCocoa.mm: (IPC::typeFromObject): (IPC::encodeColorInternal): (IPC::encodeObject): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView themeColor]): (-[WKWebView underPageBackgroundColor]): (-[WKWebView setUnderPageBackgroundColor:]): (-[WKWebView _themeColor]): (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _sampledPageTopColor]): * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (-[_WKApplicationManifest initWithCoder:]): (-[_WKApplicationManifest themeColor]): * UIProcess/Cocoa/WKSafeBrowsingWarning.h: * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (colorForItem): (-[WKSafeBrowsingBox setSafeBrowsingBackgroundColor:]): (-[WKSafeBrowsingWarning showDetailsClicked]): (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::PDFPlugin): 2021-12-26 Yousuke Kimoto RemoteInspectorProtocolHandler::inspect() expects ConnectionID as uint32_t https://bugs.webkit.org/show_bug.cgi?id=234657 Reviewed by Don Olmstead. connectionID a parameter of ScriptMessageClient::didPostMessage() is casteed as . Since ConnectionID is define as uint32_t, it should be casted as . * UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp: Fixed cast for connectionID. 2021-12-25 Commit Queue Unreviewed, reverting r285088. https://bugs.webkit.org/show_bug.cgi?id=234680 From A/B test, we probably need to revert both, 285087 and 285088 Reverted changeset: "Web process shouldn't crash if ImageBuffer::ensureBackendCreated() fails" https://bugs.webkit.org/show_bug.cgi?id=232520 https://commits.webkit.org/r285088 2021-12-24 Simon Fraser Apply the scroll delta in the "began" wheel event https://bugs.webkit.org/show_bug.cgi?id=234645 Reviewed by Wenson Hsieh. * Shared/WebWheelEventCoalescer.cpp: (WebKit::WebWheelEventCoalescer::nextEventToDispatch): Fix logging typo. 2021-12-23 Wenson Hsieh Modal container control classifier fails on some neutral controls that contain multiplication symbols https://bugs.webkit.org/show_bug.cgi?id=234651 Reviewed by Tim Horton. Treat several ASCII symbols that resemble the letter "x" (i.e. several types of multiplication signs) as the letter "x" when massaging the raw text content of controls in modal containers into canonical form for the text classifier. This allows such controls to be (correctly) tagged as "neutral" controls, for the purposes of delegating modal container policy decisions to the WebKit client. Test: ModalContainerObservation.ClassifyMultiplySymbol * UIProcess/Cocoa/ModalContainerControlClassifier.mm: (-[WKModalContainerClassifierInput initWithTokenizer:rawInput:]): (WebKit::computePredictions): 2021-12-23 Sihui Liu Don't create LocalStorage database for read if it does not exist https://bugs.webkit.org/show_bug.cgi?id=234569 Reviewed by Alex Christensen. If database does not exists when read, we can return empty or null, instead of creating an empty database. New API test: WKWebView.LocalStorageNoRecordAfterGetItem * NetworkProcess/storage/SQLiteStorageArea.cpp: (WebKit::SQLiteStorageArea::isEmpty): (WebKit::SQLiteStorageArea::prepareDatabase): (WebKit::SQLiteStorageArea::getItemFromDatabase): (WebKit::SQLiteStorageArea::allItems): (WebKit::SQLiteStorageArea::setItem): (WebKit::SQLiteStorageArea::removeItem): (WebKit::SQLiteStorageArea::clear): * NetworkProcess/storage/SQLiteStorageArea.h: 2021-12-23 Matt Woodrow Check allowed network hosts list when we schedule the load in the network process https://bugs.webkit.org/show_bug.cgi?id=234543 Reviewed by Alex Christensen. The check for WKWebViewConfiguration._allowedNetworkHost previously happened before the check to see if the given ResourceRequest would directly from an archive. This moves to the allowed network host list check to happen when we schedule the network request, and thus allows subresources cached within an archive to load, even if their original URL would be blocked. We also need to check when redirecting to prevent an allowed domain from redirecting to a forbidden domain. This also makes it so that WKWebViewConfiguration._loadsSubresources only prevents subresource loads that would touch the network, so we can't use WKURLSchemeHandler to test it any more. That's fine, since the two users of the SPI only load URLs from the network. New test LoadWebArchive.DisallowedNetworkHosts added. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): 2021-12-23 Brent Fulgham Allow a necessary syscall in the WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=234641 Reviewed by Alan Bujtas. Telemetry and testing logs indicate that we need to allow 'SYS_memorystatus_control' in our WebContent sandbox. We allow this in all other sandboxes, so this was likely an oversight. * WebProcess/com.apple.WebProcess.sb.in: 2021-12-23 Brady Eidson Add WTF::UUID class which is natively a 128-bit integer https://bugs.webkit.org/show_bug.cgi?id=234571 Reviewed by Alex Christensen. Notifications - which are UUID identified - are now addressed by a UUID object instead of a v4 UUID string. * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::cancelNotification): (WebKit::NetworkNotificationManager::clearNotifications): (WebKit::NetworkNotificationManager::didDestroyNotification): * NetworkProcess/Notifications/NetworkNotificationManager.h: * Scripts/webkit/messages.py: (forward_declarations_and_headers_for_replies): (headers_for_type): * Shared/Notifications/NotificationManagerMessageHandler.h: * Shared/Notifications/NotificationManagerMessageHandler.messages.in: * UIProcess/API/C/WKNotification.cpp: (WKNotificationCopyCoreIDForTesting): * UIProcess/API/C/WKNotification.h: * UIProcess/API/C/WKNotificationManager.cpp: (WKNotificationManagerProviderDidClickNotification_b): * UIProcess/API/C/WKNotificationManager.h: * UIProcess/Notifications/WebNotification.h: (WebKit::WebNotification::coreNotificationID const): * UIProcess/Notifications/WebNotificationManagerMessageHandler.cpp: (WebKit::WebNotificationManagerMessageHandler::cancelNotification): (WebKit::WebNotificationManagerMessageHandler::clearNotifications): (WebKit::WebNotificationManagerMessageHandler::didDestroyNotification): * UIProcess/Notifications/WebNotificationManagerMessageHandler.h: * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::cancel): (WebKit::WebNotificationManagerProxy::didDestroyNotification): (WebKit::pageIDsMatch): (WebKit::pageAndNotificationIDsMatch): (WebKit::WebNotificationManagerProxy::clearNotifications): (WebKit::WebNotificationManagerProxy::providerDidClickNotification): (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications): * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::cancelNotification): (WebKit::WebPageProxy::clearNotifications): (WebKit::WebPageProxy::didDestroyNotification): * UIProcess/WebPageProxy.h: * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleCopyWebNotificationID): * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::webNotificationID): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::didShowNotification): (WebKit::WebNotificationManager::didClickNotification): (WebKit::WebNotificationManager::didCloseNotifications): * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/Notifications/WebNotificationManager.messages.in: 2021-12-23 Sihui Liu Ensure file handles used in FileSystemAccess API are closed https://bugs.webkit.org/show_bug.cgi?id=234520 Reviewed by Darin Adler. Replace FileSystem::PlatformFileHandle with WebCore::FileHandle in SharedFileHandle to ensure file handle get closed, if it's not released for use. * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::FileSystemStorageHandle::createSyncAccessHandle): * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::createSyncAccessHandle): * Platform/IPC/SharedFileHandle.cpp: (IPC::SharedFileHandle::create): (IPC::SharedFileHandle::close): Deleted. * Platform/IPC/SharedFileHandle.h: (IPC::SharedFileHandle::release): (IPC::SharedFileHandle::SharedFileHandle): (IPC::SharedFileHandle::handle): Deleted. (): Deleted. * Platform/IPC/cocoa/SharedFileHandleCocoa.cpp: (IPC::SharedFileHandle::create): (IPC::SharedFileHandle::encode const): (IPC::SharedFileHandle::decode): * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp: (WebKit::WebFileSystemStorageConnection::createSyncAccessHandle): 2021-12-22 Alex Christensen Re-enable WebPushD.HandleInjectedPush API test https://bugs.webkit.org/show_bug.cgi?id=234627 Reviewed by Brady Eidson. I needed to make an entitlement check return true when using the non-internal SDK, which can't sign private entitlements into a binary. I also needed to make the fake TestWebKitAPI code signing identifier match the identifier that arm64 Macs actually get, or else m_testingPushMessages would not contain the right key in Daemon::getPendingPushMessages on arm64 Macs. * webpushd/PushClientConnection.mm: (WebPushD::ClientConnection::hostAppCodeSigningIdentifier): (WebPushD::ClientConnection::hostHasEntitlement): 2021-12-22 Michael Saboff Fix WebKit Build issues when using system content path https://bugs.webkit.org/show_bug.cgi?id=234624 Reviewed by Filip Pizlo. Added SYSTEM_CONTENT_PATH processing to the nested frameworks path (UMBRELLA_FRAMEWORKS_DIR). * Configurations/BaseTarget.xcconfig: * Configurations/WebKit.xcconfig: 2021-12-22 Aditya Keerthi [iOS] metromile.com element, when one is tapped. Note that calling focus() on an already focused element still sends the ElementDidFocus message to the UIProcess, to support scenarios where the initial call to focus did not bring up an input peripheral. One example of such a scenario is when the initial call is not a result of user interaction, however, there are additional scenarios that are dependent on UIProcess state. This makes it difficult to ensure that ElementDidFocus is only called when it is time to show an input peripheral. `-[WKContentView _elementDidFocus:...]` already contains some logic to prevent showing another input peripheral for the same element. This logic was added in r168744, checking for the same element by comparing input types and bounding rects. However, in between the first and second call to focus(), the page applies additional padding to the element, changing its bounding rect. This results in `_elementDidFocus:` going past the same element check and presenting another dropdown. In the time since r168744 was written, a more robust mechanism to check for the same element was added – ElementContext. To fix, update the same element check to use ElementContext, ensuring an attempt to present a new peripheral for the same element is not made. Test: fast/forms/ios/refocus-select-after-size-change.html * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]): 2021-12-22 Sihui Liu WebsiteDataStore::excludeDirectoryFromBackup should set attribute for existing directories https://bugs.webkit.org/show_bug.cgi?id=234404 Reviewed by Youenn Fablet. createDirectoryAtURL returning false means directory cannot be created, but the cause can be that directory already exists; so we should set exclude attribute on the directory no matter createDirectoryAtURL returns true or false. Also, we can use existing FileSystem functions. API test: WKWebView.LocalStorageDirectoryExcludedFromBackup * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::excludeDirectoryFromBackup): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: 2021-12-22 Alex Christensen Re-enable CustomDisplayName and DefaultDisplayName API tests on Monterey https://bugs.webkit.org/show_bug.cgi?id=234613 Reviewed by Brady Eidson. When we introduced setting the display name from the network process, we didn't update the tests to get the information from the process that can access it. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/mac/NetworkConnectionToWebProcessMac.mm: (WebKit::NetworkConnectionToWebProcess::updateActivePages): (WebKit::NetworkConnectionToWebProcess::getProcessDisplayName): * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::getProcessDisplayName): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::auditTokenForSelf): (WebKit::WebProcess::updateProcessName): (WebKit::WebProcess::getProcessDisplayName): (WebKit::WebProcess::updateActivePages): 2021-12-22 Commit Queue Unreviewed, reverting r287364. https://bugs.webkit.org/show_bug.cgi?id=234620 broke 3 API tests Reverted changeset: "Preferences that read from NSUserDefaults need to be initialied from platformInitializeStore()" https://bugs.webkit.org/show_bug.cgi?id=234488 https://commits.webkit.org/r287364 2021-12-22 Kate Cheney PCM tests crashing with 'unlink' errors https://bugs.webkit.org/show_bug.cgi?id=234565 Reviewed by Alex Christensen. Close PCM and ITP databases before deleting their database files in API testing. This adds 2 new SPIs on WKWebsiteDataStore to close the respective databases. It also addresses the renaming FIXME for NetworkProcess::simulatePrivateClickMeasurementSessionRestart. No new tests. This will fix existing crashing PCM API tests. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::closeITPDatabase): (WebKit::NetworkProcess::closePCMDatabase): (WebKit::NetworkProcess::simulatePrivateClickMeasurementSessionRestart): (WebKit::NetworkProcess::simulateResourceLoadStatisticsSessionRestart): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::destroyPrivateClickMeasurementStore): (WebKit::NetworkSession::setPrivateClickMeasurementAppBundleIDForTesting): (WebKit::NetworkSession::recreatePrivateClickMeasurementStore): Renamed. Renamed to be more accurate. This function only deletes the database, then the call in the completion handler recreates it. This also makes it more clear when we reuse it to close the database. * NetworkProcess/NetworkSession.h: * UIProcess/API/C/WKPage.cpp: (WKPageSimulatePrivateClickMeasurementSessionRestart): (WKPageSimulateResourceLoadStatisticsSessionRestart): Deleted. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _closeDatabases:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::simulatePrivateClickMeasurementSessionRestart): (WebKit::WebPageProxy::simulateResourceLoadStatisticsSessionRestart): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::closeDatabases): * UIProcess/WebsiteData/WebsiteDataStore.h: 2021-12-22 Alex Christensen Fix compiling with pickier compiler https://bugs.webkit.org/show_bug.cgi?id=234593 Reviewed by Brady Eidson. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): 2021-12-22 Wenson Hsieh [iOS] Scroll view pinch zoom gesture sometimes fails to recognize in WKWebView https://bugs.webkit.org/show_bug.cgi?id=234584 rdar://84379650 Reviewed by Simon Fraser. WKWebView may get into a state where the pinch zoom gesture recognizer on its scroll view sometimes fails to transition to Changed state (and invoke its action, which sets the zoomScale of the scroll view); this happens because the scroll view pinch gesture requires the touch start deferring gesture recognizer (TSDG) to fail, but it's possible for TSDG to remain stuck in Possible state over the duration of a gesture after beginning a touch over content with either passive touch event listeners, or no touch event listeners. In the case where the TSDG is stuck in Possible state, we observe the following sequence of events (let's suppose the user is starting a touch over a passive touch event listener on a web page): 1. The UITouch is delivered to the web touch event gesture recognizer, which fires the action (`-_webTouchEventsRecognized:`). We observe that we're over an async touch event handling region (i.e. passive or no touch event listeners), so we immediately "lift the gesture gate" by transitioning all deferring gesture recognizers to Failed state, (with the intent that they won't prevent native gestures from recognizing). 2. A UITouch is then delivered to the TSDG in the same runloop as UIKit continues to deliver the touch event to all gestures in the `NSSet` of gesture recognizers on the window. Receiving the UITouch causes TSDG (which we already set to Failed state in step (1)) to internally reset and transition back to Possible state, underneath WebKit. 3. TSDG is now in possible state after the gesture has begun, but we've already tried to unblock native gestures. When performing the second touch of the pinch zoom gesture, the pinch zoom gesture fails to commence because it's stuck waiting for TSDG to fail. In the normal (working) scenario, step (2) happens before step (1); this ensures that TSDG is set to Failed state and remains in Failed state over the course of the gesture, thereby preventing the bug from happening. The order in which (1) and (2) happen is dependent on the order in which the web touch event gesture and TSDG are iterated in UIKit's `NSSet` of gestures, which explains why this bug only reproduces some of the time. This patch mitigates this by adding a mechanism to keep track of touch start deferrers that we've already transitioned to Failed state during the course of a gesture, and uses this information to avoid adding failure requirements to these deferring gestures that have already been "ungated". This ensures that even if the deferring gesture resets to Possible state from underneath WebKit, we still avoid pushing out native gesture recognition due to these deferring gestures. As an aside, I initially attempted to avoid having TSDG transition back to Possible state altogether in this scenario, but this doesn't seem to be avoidable (short of overriding the SPI method `-_resetGestureRecognizer` and not calling the superclass, which does not seem to be supported behavior). Test: fast/events/touch/ios/pinch-zoom-with-passive-touch-event-listeners.html * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _doneDeferringTouchStart:]): (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): 2021-12-22 Simon Fraser Preferences that read from NSUserDefaults need to be initialied from platformInitializeStore() https://bugs.webkit.org/show_bug.cgi?id=234488 Reviewed by Sam Weinig. Having the default value for a preference read from NSUserDefaults can cause issues if the UIProcess and WebProcess values don't match. Instead, have platformInitializeStore() explicitly add values for these keys; this is done for scrollAnimatorEnabledKey. * UIProcess/Cocoa/WebPreferencesCocoa.mm: (WebKit::WebPreferences::initializePlatformDependentPreferences): (WebKit::WebPreferences::platformInitializeStore): * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::initializePlatformDependentPreferences): * UIProcess/WebPreferences.h: 2021-12-22 Commit Queue Unreviewed, reverting r285087. https://bugs.webkit.org/show_bug.cgi?id=234605 iPad PLUM3 GPUP 10% regression Reverted changeset: "[GPU Process] Small ImageBuffers cause the web process to crash" https://bugs.webkit.org/show_bug.cgi?id=232470 https://commits.webkit.org/r285087 2021-12-21 Brent Fulgham Propagate app-initiated state to new ResourceRequests https://bugs.webkit.org/show_bug.cgi?id=234015 Reviewed by Kate Cheney. While reviewing logging we have found that some ResourceRequest objects are missing the correct state for app-initiated loads. Typically, these are cases where a new ResourceRequest is created from a URL string, losing the context that came with the original load (or the context of the page triggering the load). This patch corrects a number of such cases. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): Propagate app-initiated state to newly created page. * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourceInfo::encode const): Correct missing serialization for app-initiated state. (WebKit::NetworkCache::SubresourceInfo::decode): (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo): 2021-12-21 Alex Christensen Fix some API tests after r287341 https://bugs.webkit.org/show_bug.cgi?id=232857 I found the cause of the strange failures and verified my "fix" on an Intel Mac and an Apple Silicon Mac. * webpushd/PushClientConnection.mm: (WebPushD::ClientConnection::hostAppCodeSigningIdentifier): 2021-12-21 Sihui Liu Use fileURLWithPath instead of URLWithString in WebsiteDataStore::excludeDirectoryFromBackup https://bugs.webkit.org/show_bug.cgi?id=234582 rdar://86787798 Reviewed by Simon Fraser. URLWithString may return nil while fileURLWithPath does not; and fileURLWithPath adds file:// to path correctly. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::excludeDirectoryFromBackup): 2021-12-21 Alex Christensen Re-enable ContextMenu API tests https://bugs.webkit.org/show_bug.cgi?id=234585 Reviewed by Tim Horton. UIKit changed the internal driver interface to simulate events to show context menus for our tests. This follows the change and makes our tests work again. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _registerPreview]): 2021-12-21 Brady Eidson Make Notification identifiers be a UUID string instead of a uint64_t https://bugs.webkit.org/show_bug.cgi?id=234534 Reviewed by Alex Christensen. This is mostly changing a whole bunch of uint64_ts to Strings, but also gets rid of lots of weird and fragile maps. * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::cancelNotification): (WebKit::NetworkNotificationManager::clearNotifications): (WebKit::NetworkNotificationManager::didDestroyNotification): * NetworkProcess/Notifications/NetworkNotificationManager.h: * Shared/Notifications/NotificationManagerMessageHandler.h: * Shared/Notifications/NotificationManagerMessageHandler.messages.in: * UIProcess/API/C/WKNotification.cpp: (WKNotificationCopyCoreIDForTesting): * UIProcess/API/C/WKNotification.h: * UIProcess/API/C/WKNotificationManager.cpp: (WKNotificationManagerProviderDidClickNotification_b): (WKNotificationManagerProviderDidRemoveNotificationPolicies): (WKNotificationManagerGetLocalIDForTesting): Deleted. * UIProcess/API/C/WKNotificationManager.h: * UIProcess/Notifications/WebNotification.cpp: (WebKit::WebNotification::WebNotification): * UIProcess/Notifications/WebNotification.h: (WebKit::WebNotification::create): (WebKit::WebNotification::notificationID const): (WebKit::WebNotification::coreNotificationID const): (WebKit::WebNotification::pageIdentifier const): * UIProcess/Notifications/WebNotificationManagerMessageHandler.cpp: (WebKit::WebNotificationManagerMessageHandler::cancelNotification): (WebKit::WebNotificationManagerMessageHandler::clearNotifications): (WebKit::WebNotificationManagerMessageHandler::didDestroyNotification): * UIProcess/Notifications/WebNotificationManagerMessageHandler.h: * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::show): (WebKit::WebNotificationManagerProxy::cancel): (WebKit::WebNotificationManagerProxy::didDestroyNotification): (WebKit::pageIDsMatch): (WebKit::pageAndNotificationIDsMatch): (WebKit::WebNotificationManagerProxy::clearNotifications): (WebKit::WebNotificationManagerProxy::providerDidShowNotification): (WebKit::WebNotificationManagerProxy::providerDidClickNotification): (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications): (WebKit::generateGlobalNotificationID): Deleted. (WebKit::WebNotificationManagerProxy::notificationLocalIDForTesting): Deleted. * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::cancelNotification): (WebKit::WebPageProxy::clearNotifications): (WebKit::WebPageProxy::didDestroyNotification): * UIProcess/WebPageProxy.h: * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleCopyWebNotificationID): (WKBundleGetWebNotificationID): Deleted. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::webNotificationID): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::cancel): (WebKit::WebNotificationManager::didDestroyNotification): (WebKit::WebNotificationManager::didShowNotification): (WebKit::WebNotificationManager::didClickNotification): (WebKit::WebNotificationManager::didCloseNotifications): (WebKit::generateNotificationID): Deleted. (WebKit::WebNotificationManager::notificationIDForTesting): Deleted. (WebKit::WebNotificationManager::clearNotifications): Deleted. (WebKit::WebNotificationManager::removeNotificationFromContextMap): Deleted. * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/Notifications/WebNotificationManager.messages.in: * WebProcess/WebCoreSupport/WebNotificationClient.cpp: (WebKit::WebNotificationClient::show): (WebKit::WebNotificationClient::cancel): (WebKit::WebNotificationClient::notificationObjectDestroyed): (WebKit::WebNotificationClient::clearNotifications): Deleted. * WebProcess/WebCoreSupport/WebNotificationClient.h: 2021-12-21 Eliot Hsu Fix Safari-side SafeBrowsing telemetry https://bugs.webkit.org/show_bug.cgi?id=234439 Reviewed by Alex Christensen. Fix old (and privacy-preserving) telemetry for Safe Browsing, which were previously reported from the Safari side. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::showSafeBrowsingWarning): 2021-12-21 Kate Cheney Harden PCM and ITP databases against crashes https://bugs.webkit.org/show_bug.cgi?id=234528 Reviewed by Brent Fulgham. This patch does two things. First, it specifies a column type for the new destination token, keyID and signature columns. This was causing the crashes in rdar://86347439 by comparing the defined CREATE TABLE query with types to the existing query with no types. Second, it adds hardening to the migration code to abort migration if one of the steps fails. This will help prevent future crashes like rdar://86347439 by aborting a migration early if a failure occurs and not leaving the db in a messy state. No new tests. No behavior change, this will harden against flaky issues that may cause a migration to fail part way through, like I/O errors. * NetworkProcess/DatabaseUtilities.cpp: (WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary): * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp: (WebKit::PCM::Database::addDestinationTokenColumnsIfNecessary): 2021-12-21 Wenson Hsieh Add support for a UI delegate method to decide how to handle detected modal containers https://bugs.webkit.org/show_bug.cgi?id=234440 rdar://77073735 Reviewed by Darin Adler. Add support for a new UI delegate method, `-_webView:decidePolicyForModalContainer:decisionHandler:`, that is invoked when a modal container has been detected and suppressed due to a WebKit client specifying the `_WKWebsiteModalContainerObservationPolicyPrompt` option in webpage preferences. This new delegate method is invoked with a new `_WKModalContainerInfo` object, which (for now) just encapsulates an option set of ModalContainerControlTypes that indicates which types of modal containers are available. * Scripts/webkit/messages.py: (headers_for_type): * SourcesCocoa.txt: * UIProcess/API/APIUIClient.h: (API::UIClient::decidePolicyForModalContainer): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (WebKit::modalContainerObservationPolicy): (WebKit::coreModalContainerObservationPolicy): * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: Remove support for two unused policy flags, `_WKWebsiteModalContainerObservationPolicyAllow` and `_WKWebsiteModalContainerObservationPolicyDisallow`. These are now obviated by the new decision handler return values `_WKModalContainerDecisionHideAndAllow` and `_WKModalContainerDecisionHideAndDisallow`, respectively. While this leaves us with only two policy modes (such that the policy can now be turned into a single BOOL switch), I'm keeping the named enum flags for now, since: 1. The existing names do a better job of describing their respective behaviors than a single BOOL flag like `modalContainerObserverShouldPrompt`, or `modalContainerObserverEnabled`, and... 2. We'll probably need to extend this policy set to add a new value in the near future, anyways. * UIProcess/API/Cocoa/_WKModalContainerInfo.h: * UIProcess/API/Cocoa/_WKModalContainerInfo.mm: (-[_WKModalContainerInfo initWithTypes:]): * UIProcess/API/Cocoa/_WKModalContainerInfoInternal.h: * UIProcess/Cocoa/ModalContainerControlClassifier.mm: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::coreModalContainerDecision): (WebKit::UIDelegate::UIClient::decidePolicyForModalContainer): Add plumbing for the new chrome client hook through WebChromeClient, WebPage, WebPageProxy, and finally the UI client. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForModalContainer): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::decidePolicyForModalContainer): * WebProcess/WebCoreSupport/WebChromeClient.h: 2021-12-21 Alex Christensen ASSERT NOT REACHED under WebKit::Daemon::ConnectionToMachService seen with TestWebKitAPI.WebPushD.BasicCommunication and PermissionManagement https://bugs.webkit.org/show_bug.cgi?id=232857 Reviewed by Darin Adler. When using the public SDK, don't code sign with an entitlements file that contains restricted entitlements, otherwise webpushd won't launch. Also, don't compile files we aren't going to use. * Configurations/webpushd.xcconfig: * WebKit.xcodeproj/project.pbxproj: 2021-12-21 J Pascoe [WebAuthn] Authenticator is not falling back to clientPIN after internal verification fails and is blocked. https://bugs.webkit.org/show_bug.cgi?id=232501 Reviewed by Darin Adler. Whenever internal uv gets blocked, the user agent should fall back to using a pin for user verification. This patch starts doing that by going into the pin flow whenever the authenticator returns the pin required error code. Added API test for fallback. * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::makeCredential): (WebKit::CtapAuthenticator::getAssertion): (WebKit::CtapAuthenticator::tryRestartPin): 2021-12-21 Kimmo Kinnunen IPC streams should not accept 0-length stream buffers https://bugs.webkit.org/show_bug.cgi?id=234552 Reviewed by Antti Koivisto. Make decoding 0-length stream buffers fail. These buffers are not useful. No new tests, tests need additional implementation, will be added in subsequent commits. * Platform/IPC/StreamConnectionBuffer.cpp: (IPC::StreamConnectionBuffer::StreamConnectionBuffer): (IPC::StreamConnectionBuffer::decode): 2021-12-20 Wenson Hsieh Add ModalContainerControlClassifier and use it to implement classifyModalContainerControls() https://bugs.webkit.org/show_bug.cgi?id=234322 Reviewed by Devin Rousso. Introduce and implement ModalContainerControlClassifier. This singleton uses the NaturalLanguage and CoreML frameworks on Cocoa to classify strings as one of four modal container control types. See below for more details. * SourcesCocoa.txt: * UIProcess/Cocoa/ModalContainerControlClassifier.h: Added. * UIProcess/Cocoa/ModalContainerControlClassifier.mm: Added. (-[WKModalContainerClassifierBatch initWithRawInputs:]): (-[WKModalContainerClassifierBatch count]): (-[WKModalContainerClassifierBatch featuresAtIndex:]): (-[WKModalContainerClassifierInput initWithTokenizer:rawInput:]): (-[WKModalContainerClassifierInput featureNames]): (-[WKModalContainerClassifierInput featureValueForName:]): Add Objective-C objects that implement the MLBatchProvider and MLFeatureProvider protocols, respectively. WKModalContainerClassifierBatch is essentially a wrapper around a list of WKModalContainerClassifierInput; each WKModalContainerClassifierInput is initialized with a raw string, and uses NLTokenizer to filter out non-word characters and tokenize the raw input into a single space-separated, lower case string (referred to as the "canonical" input format). (WebKit::ModalContainerControlClassifier::ModalContainerControlClassifier): (WebKit::ModalContainerControlClassifier::sharedClassifier): Return the singleton instance (this must be accessed on the main thread). (WebKit::computePredictions): Static helper method that takes a list of strings and an MLModel, and classifies each string using the model, and the Objective-C helper classes above. (WebKit::ModalContainerControlClassifier::classify): This method exposes the primary functionality of the classifier, which is to take a list of raw strings representing text in clickable controls, and asynchronously return a list of class labels representing the predicted control type for each of the strings. Note that this method needs to be invoked on the main thread (and will also invoke the completion handler on the main thread), but the process of loading the MLModel and using it to predict input strings is done in a work queue ("com.apple.WebKit.ModalContainerControlClassifier"). (WebKit::ModalContainerControlClassifier::loadModelIfNeeded): Load the MLModel from a predetermined bundle resource name; returns immediately if the model has already been created. While this happens synchronously, this is always invoked on a background queue and never blocks the main thread. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::classifyModalContainerControls): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::classifyModalContainerControls): * WebKit.xcodeproj/project.pbxproj: 2021-12-20 Alexey Shvayka [WebIDL] convertVariadicArguments() should return a FixedVector https://bugs.webkit.org/show_bug.cgi?id=232639 Reviewed by Yusuke Suzuki. Add / remove tokens one by one because there is no way to retrieve the size of va_list in advance so we could construct a FixedVector. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp: (webkit_dom_dom_token_list_add): (webkit_dom_dom_token_list_remove): 2021-12-20 Fujii Hironori WC variant RemoteGraphicsContextGL::platformLayer() should be removed https://bugs.webkit.org/show_bug.cgi?id=233756 Reviewed by Kimmo Kinnunen. WinCairo is using TextureMapperGCGLPlatformLayer as the WebGL PlatformLayer at the moment, that is using only a single output buffer. And, WinCairo doesn't transfer the WebGL output buffer cross-process boundary even in GPU process mode. Based on these assumptions, r285099 added platformLayer() method to RemoteGraphicsContextGL to get a PlatformLayer and pass it to the compositor in GPU process. However, this is not appropriate. The output buffer identifier should be transferred to web process by using the completion handler of RemoteGraphicsContextGL::PrepareForDisplay message. Then, the identifier will be passed back to GPU process. Added WCContentBufferManager to manage the WebGL output buffer identifiers. However, because TextureMapperGCGLPlatformLayer has only a single output buffer, the maximum number of identifiers is one for each PlatformLayer now. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::didClose): (WebKit::GPUConnectionToWebProcess::releaseWCLayerTreeHost): (WebKit::GPUConnectionToWebProcess::findRemoteGraphicsContextGL): Deleted. * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/graphics/RemoteGraphicsContextGL.h: * GPUProcess/graphics/RemoteGraphicsContextGL.messages.in: * GPUProcess/graphics/RemoteGraphicsContextGLWin.cpp: (WebKit::RemoteGraphicsContextGLWin::prepareForDisplay): (WebKit::RemoteGraphicsContextGL::prepareForDisplay): Deleted. (WebKit::RemoteGraphicsContextGL::platformLayer const): Deleted. * GPUProcess/graphics/wc/RemoteWCLayerTreeHost.cpp: (WebKit::RemoteWCLayerTreeHost::RemoteWCLayerTreeHost): (WebKit::RemoteWCLayerTreeHost::update): * GPUProcess/graphics/wc/RemoteWCLayerTreeHost.h: * GPUProcess/graphics/wc/WCContentBuffer.h: Added. * GPUProcess/graphics/wc/WCContentBufferManager.cpp: Added. (WebKit::WCContentBufferManager::ProcessInfo::ProcessInfo): (WebKit::WCContentBufferManager::ProcessInfo::acquireContentBufferIdentifier): (WebKit::WCContentBufferManager::ProcessInfo::releaseContentBufferIdentifier): (WebKit::WCContentBufferManager::ProcessInfo::removeContentBuffer): (WebKit::WCContentBufferManager::singleton): (WebKit::WCContentBufferManager::acquireContentBufferIdentifier): (WebKit::WCContentBufferManager::releaseContentBufferIdentifier): (WebKit::WCContentBufferManager::removeContentBuffer): (WebKit::WCContentBufferManager::removeAllContentBuffersForProcess): * GPUProcess/graphics/wc/WCContentBufferManager.h: Added. * GPUProcess/graphics/wc/WCScene.cpp: (WebKit::WCScene::WCScene): (WebKit::WCScene::update): * GPUProcess/graphics/wc/WCScene.h: * PlatformWin.cmake: * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): (conditions_for_header): * Shared/wc/WCContentBufferIdentifier.h: Added. * WebProcess/GPU/graphics/wc/RemoteGraphicsContextGLProxyWC.cpp: * WebProcess/GPU/graphics/wc/WCPlatformLayerGCGL.h: (WebKit::WCPlatformLayerGCGL::takeContentBufferIdentifiers): (WebKit::WCPlatformLayerGCGL::addContentBufferIdentifier): (WebKit::WCPlatformLayerGCGL::WCPlatformLayerGCGL): Deleted. (WebKit::WCPlatformLayerGCGL::graphicsContextGLIdentifier): Deleted. * WebProcess/WebPage/wc/GraphicsLayerWC.cpp: (WebKit::GraphicsLayerWC::setContentsNeedsDisplay): (WebKit::GraphicsLayerWC::flushCompositingStateForThisLayerOnly): * WebProcess/WebPage/wc/WCUpateInfo.h: (WebKit::WCLayerUpateInfo::encode const): (WebKit::WCLayerUpateInfo::decode): 2021-12-20 Wenson Hsieh Add some missing API availability macros around some WebXR SPI https://bugs.webkit.org/show_bug.cgi?id=234521 Reviewed by Tim Horton. Add some missing API availability macros around some WebXR-related SPI that was introduced in r286318. Also remove a few unnecessary `PLATFORM(COCOA)` compile-time guards, and add a missing `#import` to fix the non-unified build. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/PlatformXRCoordinator.mm: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): 2021-12-20 Alex Christensen Prevent test functionality in AdAttributionDaemon when not running tests https://bugs.webkit.org/show_bug.cgi?id=231258 Reviewed by Brady Eidson. adattributiond already has a private entitlement check to make sure that only the network process has permission to connect to it. This makes it so that the network process can't manipulate state only intended to be manipulated for tests when told to do so by an application misusing SPI. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::allowsPrivateClickMeasurementTestFunctionality const): (WebKit::NetworkProcess::setPrivateClickMeasurementOverrideTimerForTesting): (WebKit::NetworkProcess::simulateResourceLoadStatisticsSessionRestart): (WebKit::NetworkProcess::markAttributedPrivateClickMeasurementsAsExpiredForTesting): (WebKit::NetworkProcess::setPrivateClickMeasurementEphemeralMeasurementForTesting): (WebKit::NetworkProcess::setPrivateClickMeasurementTokenPublicKeyURLForTesting): (WebKit::NetworkProcess::setPrivateClickMeasurementTokenSignatureURLForTesting): (WebKit::NetworkProcess::setPrivateClickMeasurementAttributionReportURLsForTesting): (WebKit::NetworkProcess::markPrivateClickMeasurementsAsExpiredForTesting): (WebKit::NetworkProcess::setPCMFraudPreventionValuesForTesting): (WebKit::NetworkProcess::setPrivateClickMeasurementAppBundleIDForTesting): * NetworkProcess/NetworkProcess.h: 2021-12-20 Alex Christensen [ Monterey ] TestWebKitAPI.WebSocket.PageWithAttributedBundleIdentifierDestroyed (API-test) is a constant timeout https://bugs.webkit.org/show_bug.cgi?id=233224 Reviewed by Darin Adler. Using NSURLSession._attributedBundleIdentifier requires the com.apple.private.network.socket-delegate entitlement, which can't be signed into the network process with the public SDK. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::addWebPageNetworkParameters): 2021-12-20 Wenson Hsieh Minor cleanup in AuthenticationServicesCoreSPI.h https://bugs.webkit.org/show_bug.cgi?id=234514 Reviewed by Devin Rousso. When using the Apple internal SDK, directly import instead of relying on forward declarations (or, in this case, relying on a previous unified source to import the header through WebKitAdditions). Additionally leave a FIXME to clean up the rest of this file by importing the private headers directly when building with the internal SDK (and falling back to forward declarations in non-internal builds). * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: 2021-12-20 Youenn Fablet Improve UserMediaPermissionRequestManagerProxy logging https://bugs.webkit.org/show_bug.cgi?id=234508 Reviewed by Eric Carlson. Make sure the log identifier is correct and log whether there are cameras and/or microphones exposed. No observable change of behavior. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): 2021-12-19 Wenson Hsieh Add client layer plumbing for classifying modal container controls https://bugs.webkit.org/show_bug.cgi?id=234320 Reviewed by Dean Jackson. See WebCore/ChangeLog for more details. * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::classifyModalContainerControls): Add a method stub with a comment for now. The next patch in the sequence will implement this method hook on Cocoa platforms. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestCookieConsent): Drive-by fix: remove an unnecessary WebCore:: prefix. (WebKit::WebChromeClient::classifyModalContainerControls): * WebProcess/WebCoreSupport/WebChromeClient.h: 2021-12-18 Darin Adler Hash tables, read/write, and heap memory are used unnecessarily, which may hurt performance https://bugs.webkit.org/show_bug.cgi?id=234438 Reviewed by Anders Carlsson. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::sortedTables): Simplify unnecessarily complicated expression to initialize the Span. * Shared/Cocoa/DefaultWebBrowserChecks.h: Return a Span instead of an optional Vector. * Shared/Cocoa/DefaultWebBrowserChecks.mm: (WebKit::appBoundDomainsForTesting): Renamed from getAppBoundDomainsTesting to fit WebKit coding style a bit better, and be a little more grammatical. Removed an un-needed HashMap that had only a single entry, used a NeverDestroyed std::array rather than a Vector so we don't use any heap or read/write memory. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::addTestDomains const): Rewrite to use the function above. Fewer special cases needed since we are just using an empty Span, which efficiently does nothing, so no need to have a distinct null value. 2021-12-18 Chris Dumez Move CacheStorage engines from NetworkProcess to NetworkSession https://bugs.webkit.org/show_bug.cgi?id=234448 Reviewed by Alex Christensen. Move CacheStorage engines from NetworkProcess to NetworkSession, as they are per-session. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): (WebKit::NetworkProcess::~NetworkProcess): Deleted. (WebKit::NetworkProcess::findCacheEngine): Deleted. (WebKit::NetworkProcess::ensureCacheEngine): Deleted. (WebKit::NetworkProcess::removeCacheEngine): Deleted. (WebKit::NetworkProcess::cacheStorageRootPath): Deleted. (WebKit::NetworkProcess::setCacheStorageParameters): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): (WebKit::NetworkSession::ensureCacheEngine): (WebKit::NetworkSession::clearCacheEngine): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::cacheEngine): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::create): (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): (WebKit::CacheStorage::Engine::lock): (WebKit::CacheStorage::Engine::unlock): (WebKit::CacheStorage::Engine::clearMemoryRepresentation): (WebKit::CacheStorage::Engine::representation): (WebKit::CacheStorage::Engine::clearAllCaches): (WebKit::CacheStorage::Engine::clearCachesForOrigin): (WebKit::CacheStorage::Engine::Engine): (WebKit::CacheStorage::Engine::from): Deleted. (WebKit::CacheStorage::Engine::destroyEngine): Deleted. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection): (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::retrieveRecords): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): (WebKit::CacheStorageEngineConnection::reference): (WebKit::CacheStorageEngineConnection::dereference): (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): (WebKit::CacheStorageEngineConnection::engineRepresentation): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: 2021-12-17 Simon Fraser Read the default value of the ScrollAnimatorEnabled setting from NSUserDefaults https://bugs.webkit.org/show_bug.cgi?id=234456 Reviewed by Tim Horton. It's impossible for a test to run with an animated keyboard scroll because platformAllowsScrollAnimation(), which reads from NSUserDefaults, always trumps the Setting. Fix by initializing the setting from NSUserDefaults and removing the platformAllowsScrollAnimation() check. This allows for a WebKitTestRunner test override the setting. Remove the WTR code that sets @"NSScrollAnimationEnabled" to @NO. Unfortunately in WebKitLegacy AppKit code consults the @"NSScrollAnimationEnabled" key, so DumpRenderTree has to continue to initialize this NSUserDefault to @NO and tests that try to change the Setting will fail. * Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm: (WebKit::defaultScrollAnimatorEnabled): * Shared/WebPreferencesDefaultValues.h: 2021-12-18 Chris Dumez Convert ProtectionSpace enums into enum classes https://bugs.webkit.org/show_bug.cgi?id=234455 Reviewed by Alex Christensen. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveChallenge): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost): * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection): (WebKit::NetworkDataTaskCurl::restartWithCredential): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::completeAuthentication): (WebKit::NetworkDataTaskSoup::cancelAuthentication): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::canCoalesceChallenge): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * Shared/curl/WebCoreArgumentCodersCurl.cpp: (IPC::ArgumentCoder::decodePlatformData): * UIProcess/API/C/WKAPICast.h: (WebKit::toAPI): * UIProcess/API/glib/WebKitAuthenticationRequest.cpp: (webkit_authentication_request_get_security_origin): * UIProcess/Authentication/WebProtectionSpace.cpp: (WebKit::WebProtectionSpace::serverType const): (WebKit::WebProtectionSpace::authenticationScheme const): * UIProcess/Authentication/WebProtectionSpace.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::processAuthenticationChallenge): (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): 2021-12-17 Wenson Hsieh Add support for detecting modal containers that contain a given search term https://bugs.webkit.org/show_bug.cgi?id=234214 Reviewed by Tim Horton and Devin Rousso. Add a WebKitAdditions hook that implements a new chrome client method. See WebCore/ChangeLog for more details. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::searchStringForModalContainerObserver const): * WebProcess/WebCoreSupport/WebChromeClient.h: 2021-12-17 Alex Christensen Remove API::Object::Type::BundlePageGroup https://bugs.webkit.org/show_bug.cgi?id=225611 Reviewed by Brady Eidson. Its last use was removed in rdar://77775952 and rdar://78783988 * Shared/API/APIObject.h: * Shared/API/APIPageGroupHandle.cpp: Removed. * Shared/API/APIPageGroupHandle.h: Removed. * Shared/API/c/cg/WKImageCG.cpp: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/UserData.cpp: (WebKit::UserData::encode): (WebKit::UserData::decode): * Shared/mac/MediaFormatReader/CoreMediaWrapped.cpp: * Sources.txt: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::transformHandlesToObjects): (WebKit::WebProcessProxy::transformObjectsToHandles): * WebKit.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm: (-[WKWebProcessPlugInPageGroup identifier]): Deleted. (-[WKWebProcessPlugInPageGroup dealloc]): Deleted. (-[WKWebProcessPlugInPageGroup _apiObject]): Deleted. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h: Removed. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController pageGroup]): Deleted. * WebProcess/WebPage/WebPageGroupProxy.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::transformHandlesToObjects): (WebKit::WebProcess::transformObjectsToHandles): 2021-12-17 Chris Dumez Move storage managers from the NetworkProcess to the NetworkSession class https://bugs.webkit.org/show_bug.cgi?id=234409 Reviewed by Alex Christensen. Move storage managers from the NetworkProcess to the NetworkSession class since they are per session. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::lowMemoryHandler): (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::hasLocalStorage): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): (WebKit::NetworkProcess::syncLocalStorage): (WebKit::NetworkProcess::clearStorage): (WebKit::NetworkProcess::renameOriginInWebsiteData): (WebKit::NetworkProcess::connectionToWebProcessClosed): (WebKit::NetworkProcess::addStorageManagerForSession): Deleted. (WebKit::NetworkProcess::removeStorageManagerForSession): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): (WebKit::NetworkSession::lowMemoryHandler): (WebKit::NetworkSession::addStorageManagerSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::storageManager): 2021-12-17 Chris Dumez Unreviewed, reverting r286850. Put r282794 back in. It turns out it was an overall progression after all Reverted changeset: "Unreviewed, reverting r282794." https://bugs.webkit.org/show_bug.cgi?id=230517 https://commits.webkit.org/r286850 2021-12-16 Per Arne Vollan [macOS] Adjust syscall filter https://bugs.webkit.org/show_bug.cgi?id=234401 Reviewed by Tim Horton. Adjust syscall filter in the WebContent process' sandbox on macOS. A syscall that was previously believed to only be used on Intel, is being used on all architectures. * WebProcess/com.apple.WebProcess.sb.in: 2021-12-16 Alex Christensen Remove more NPAPI plugin code https://bugs.webkit.org/show_bug.cgi?id=234379 Reviewed by Anders Carlsson. * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::pluginComplexTextInputIdentifier const): Deleted. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::doneWithKeyEvent): (WebKit::WebViewImpl::interpretKeyEvent): (WebKit::WebViewImpl::inputContext): (WebKit::WebViewImpl::performKeyEquivalent): (WebKit::WebViewImpl::keyDown): (WebKit::WebViewImpl::disableComplexTextInputIfNecessary): Deleted. (WebKit::WebViewImpl::handlePluginComplexTextInputKeyDown): Deleted. (WebKit::WebViewImpl::tryHandlePluginComplexTextInputKeyDown): Deleted. (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged): Deleted. (WebKit::WebViewImpl::tryPostProcessPluginComplexTextInputKeyDown): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::pluginFocusOrWindowFocusChanged): Deleted. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::pluginFocusOrWindowFocusChanged): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::sendComplexTextInputToPlugin): Deleted. (WebKit::WebPageProxy::pluginFocusOrWindowFocusChanged): Deleted. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::canCreateTransientPaintingSnapshot const): Deleted. * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::destroyPluginAndReset): (WebKit::PluginView::shouldCreateTransientPaintingSnapshot const): (WebKit::PluginView::sendComplexTextInput): Deleted. (WebKit::PluginView::privateBrowsingStateChanged): Deleted. (WebKit::PluginView::getFormValue): Deleted. (WebKit::PluginView::shouldNotAddLayer const): Deleted. (WebKit::PluginView::pluginFocusOrWindowFocusChanged): Deleted. * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::accessibilityPosition const): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::sendComplexTextInputToPlugin): Deleted. 2021-12-16 Chris Dumez Move WebIDBServers from NetworkProcess to NetworkSession class https://bugs.webkit.org/show_bug.cgi?id=234366 Reviewed by Darin Adler. Move WebIDBServers from NetworkProcess to NetworkSession class, since they are per session. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFilesForIndexedDB): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didClose): (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): (WebKit::NetworkProcess::suspendIDBServers): (WebKit::NetworkProcess::resume): (WebKit::CompletionHandler REGRESSION (r286601): storage/filesystemaccess/sync-access-handle-read-write-worker.html and file-system-access/sandboxed_FileSystemSyncAccessHandle-truncate.https.tentative.worker.html are consistently failing https://bugs.webkit.org/show_bug.cgi?id=234271 Reviewed by Youenn Fablet. * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::FileSystemStorageHandle::close): (WebKit::FileSystemStorageHandle::closeSyncAccessHandle): * NetworkProcess/storage/FileSystemStorageHandle.h: * NetworkProcess/storage/FileSystemStorageManager.cpp: (WebKit::FileSystemStorageManager::closeHandle): * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::closeSyncAccessHandle): (WebKit::NetworkStorageManager::closeAccessHandle): Deleted. * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.messages.in: * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp: (WebKit::WebFileSystemStorageConnection::getFileHandle): (WebKit::WebFileSystemStorageConnection::getDirectoryHandle): (WebKit::WebFileSystemStorageConnection::closeSyncAccessHandle): (WebKit::WebFileSystemStorageConnection::getHandle): (WebKit::WebFileSystemStorageConnection::close): Deleted. * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h: 2021-12-16 Adrian Perez de Castro Non-unified build fixes, late-ish December 2021 edition https://bugs.webkit.org/show_bug.cgi?id=234392 Unreviewed non-unified build fixes. * NetworkProcess/NetworkDataTask.cpp: Add missing NetworkProcess.h header inclusion. * NetworkProcess/NetworkSession.cpp: Add missing WebCore/SWServer.h heeader inclusion. * UIProcess/Notifications/WebNotificationManagerProxy.cpp: Add missing WebCore/NotificationData.h header inclusion. 2021-12-16 Per Arne Vollan [watchOS] Adjust sandbox message filter https://bugs.webkit.org/show_bug.cgi?id=234385 Reviewed by Brent Fulgham. Add required items to sandbox message filter in the WebContent process on watchOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-12-16 Alex Christensen Unreviewed, reverting r287056. Caused performance regression...again Reverted changeset: "Remove properties set by NSURLProtocol on NSURLRequest before serializing" https://bugs.webkit.org/show_bug.cgi?id=232332 https://commits.webkit.org/r287056 2021-12-15 Darin Adler Many call sites use makeNeverDestroyed, but could instead take advantage of the NeverDestroyed deduction guide https://bugs.webkit.org/show_bug.cgi?id=234350 Reviewed by Sam Weinig. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::expectedTableAndIndexQueries): Use deduction. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp: (WebKit::PCM::Database::expectedTableAndIndexQueries): Ditto. * Shared/Cocoa/DefaultWebBrowserChecks.mm: (WebKit::getAppBoundDomainsTesting): Ditto. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::createHandlesForResources): Make this more generic so it works with other kinds of collections, not just Vector. Also right-size the Vector this returns rather than letting it grow organically. (WebKit::SandboxExtension::createReadOnlyHandlesForFiles): Ditto. (WebKit::SandboxExtension::createHandleForReadWriteDirectory): Ditto. (WebKit::SandboxExtension::createHandlesForMachLookup): Ditto. Also update this function to take a Span or an initializer_list instead of a Vector. (WebKit::SandboxExtension::createHandlesForIOKitClassExtensions): Ditto. (WebKit::SandboxExtension::consumePermanently): Ditto. * Shared/SandboxExtension.h: Updated for the above. Also corrected some unusual use of #if to share a single declaration of some functions for both enabled and disabled SANDBOX_EXTENSIONS. * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::nonBrowserServices): Use deduction. * UIProcess/WebPageProxy.cpp: Remove unused MERGE_WHEEL_EVENTS. (WebKit::attachmentElementServices): Return a Span, allowing us to use a constexpr obviating the need for memory allocation or read/write memory, (WebKit::gpuIOKitClasses): Ditto. (WebKit::gpuMachServices): Ditto. (WebKit::mediaRelatedMachServices): Ditto. (WebKit::mediaRelatedIOKitClasses): Ditto. * UIProcess/ios/TextCheckerIOS.mm: (WebKit::mutableState): Use deduction. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView supportedPasteboardTypesForCurrentSelection]): Ditto. * UIProcess/mac/TextCheckerMac.mm: (WebKit::mutableState): Ditto. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::temporaryPDFDirectoryPath): Ditto. 2021-12-16 Michael Saboff https://bugs.webkit.org/show_bug.cgi?id=234173 Update Install Paths for build system changes Reviewed by Filip Pizlo. Added build variables and build step to create symlinks pointing to the alternate build locations from the current framework install location. * Configurations/BaseXPCService.xcconfig: * Configurations/adattributiond.xcconfig: * Configurations/webpushd.xcconfig: * Scripts/create-symlink-to-altroot.sh: Added. * WebKit.xcodeproj/project.pbxproj: 2021-12-15 Brady Eidson Some webpushtool improvements. https://bugs.webkit.org/show_bug.cgi?id=234372 Reviewed by Alex Christensen. - Make the list of current connections be reliably ordered - If the invocation is solely about injecting a push message, exit afterwards - Some other tiny niceties * webpushd/WebPushDaemon.mm: (WebPushD::Daemon::broadcastAllConnectionIdentities): (WebPushD::Daemon::injectPushMessageForTesting): * webpushd/webpushtool/WebPushToolConnection.h: * webpushd/webpushtool/WebPushToolConnection.mm: (WebPushTool::Connection::create): (WebPushTool::Connection::Connection): (WebPushTool::Connection::connectToService): (WebPushTool::Connection::startAction): (WebPushTool::Connection::sendPushMessage): * webpushd/webpushtool/WebPushToolMain.mm: (main): 2021-12-15 Brady Eidson Add a "NotificationData" object to encompass local Notification-related parameters, instead of passing tons of them around everywhere. https://bugs.webkit.org/show_bug.cgi?id=234370 Reviewed by Tim Horton. * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::showNotification): * NetworkProcess/Notifications/NetworkNotificationManager.h: * Shared/Notifications/NotificationManagerMessageHandler.h: * Shared/Notifications/NotificationManagerMessageHandler.messages.in: * UIProcess/Notifications/WebNotification.cpp: (WebKit::WebNotification::WebNotification): * UIProcess/Notifications/WebNotification.h: (WebKit::WebNotification::create): * UIProcess/Notifications/WebNotificationManagerMessageHandler.cpp: (WebKit::WebNotificationManagerMessageHandler::showNotification): * UIProcess/Notifications/WebNotificationManagerMessageHandler.h: * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::show): * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showNotification): * UIProcess/WebPageProxy.h: * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::show): 2021-12-15 Alex Christensen Remove unreachable code in Plugin and PluginController https://bugs.webkit.org/show_bug.cgi?id=234365 Reviewed by Geoff Garen and Anders Carlsson. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPageCacheSupportsPlugins): (WKPreferencesGetPageCacheSupportsPlugins): (WKPreferencesSetAsynchronousPluginInitializationEnabled): (WKPreferencesGetAsynchronousPluginInitializationEnabled): (WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins): (WKPreferencesGetAsynchronousPluginInitializationEnabledForAllPlugins): (WKPreferencesSetArtificialPluginInitializationDelayEnabled): (WKPreferencesGetArtificialPluginInitializationDelayEnabled): (WKPreferencesSetPluginSandboxProfilesEnabledForAllPlugins): (WKPreferencesGetPluginSandboxProfilesEnabledForAllPlugins): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setPageCacheSupportsPlugins:]): (-[WKPreferences _pageCacheSupportsPlugins]): (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]): (-[WKPreferences _asynchronousPluginInitializationEnabled]): (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]): (-[WKPreferences _artificialPluginInitializationDelayEnabled]): (-[WKPreferences _setExperimentalPlugInSandboxProfilesEnabled:]): (-[WKPreferences _experimentalPlugInSandboxProfilesEnabled]): * WebProcess/Plugins/PDF/PDFPlugin.h: (isType): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::PDFPlugin): (WebKit::PDFPlugin::getSelectionForWordAtPoint const): Deleted. * WebProcess/Plugins/Plugin.cpp: (WebKit::Plugin::Plugin): Deleted. * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::type const): Deleted. (WebKit::Plugin::isPluginProxy const): Deleted. (WebKit::Plugin::isNetscapePlugin const): Deleted. (WebKit::Plugin::isPDFPlugin const): Deleted. * WebProcess/Plugins/PluginController.h: (WebKit::PluginController::asynchronousPluginInitializationEnabled const): Deleted. (WebKit::PluginController::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted. (WebKit::PluginController::artificialPluginInitializationDelayEnabled const): Deleted. (WebKit::PluginController::PluginDestructionProtector::PluginDestructionProtector): Deleted. (WebKit::PluginController::PluginDestructionProtector::~PluginDestructionProtector): Deleted. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::initializePlugin): (WebKit::PluginView::pluginFocusOrWindowFocusChanged): (WebKit::PluginView::didFailToInitializePlugin): Deleted. (WebKit::PluginView::getSelectionForWordAtPoint const): Deleted. (WebKit::PluginView::invalidate): Deleted. (WebKit::PluginView::userAgent): Deleted. (WebKit::PluginView::cancelStreamLoad): Deleted. (WebKit::PluginView::continueStreamLoad): Deleted. (WebKit::PluginView::cancelManualStreamLoad): Deleted. (WebKit::PluginView::setStatusbarText): Deleted. (WebKit::PluginView::isAcceleratedCompositingEnabled): Deleted. (WebKit::PluginView::compositingRenderServerPort): Deleted. (WebKit::PluginView::getAuthenticationInfo): Deleted. (WebKit::PluginView::isPrivateBrowsingEnabled): Deleted. (WebKit::PluginView::asynchronousPluginInitializationEnabled const): Deleted. (WebKit::PluginView::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted. (WebKit::PluginView::artificialPluginInitializationDelayEnabled const): Deleted. (WebKit::PluginView::protectPluginFromDestruction): Deleted. (WebKit::PluginView::unprotectPluginFromDestruction): Deleted. * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::asynchronousPluginInitializationEnabled const): Deleted. (WebKit::WebPage::setAsynchronousPluginInitializationEnabled): Deleted. (WebKit::WebPage::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted. (WebKit::WebPage::setAsynchronousPluginInitializationEnabledForAllPlugins): Deleted. (WebKit::WebPage::artificialPluginInitializationDelayEnabled const): Deleted. (WebKit::WebPage::setArtificialPluginInitializationDelayEnabled): Deleted. 2021-12-15 J Pascoe [WebAuthn] Allow same-site, cross-origin iframe get() https://bugs.webkit.org/show_bug.cgi?id=234309 rdar://problem/86486313 Reviewed by Brent Fulgham. The Web Authentication level 2 specifies a feature policy to allow get calls in cross-origin i-frames. This patch implements this feature policy partially. Only same-site, cross-origin i-frames are supported instead. This is for tracking prevention purposes. https://w3c.github.io/webauthn/#sctn-iframe-guidance This patch also starts passing ClientDataJSON hashes to ASC to avoid the situation where WebKit includes crossOrigin or other fields in ClientDataJSON that ASC is unaware of when generating ClientDataJSON. Added layout test cases for same-site, cross-origin get calls. * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (produceClientDataJson): * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::configureRegistrationRequestContext): (WebKit::configurationAssertionRequestContext): (WebKit::WebAuthenticatorCoordinatorProxy::contextForRequest): 2021-12-15 Alex Christensen Remove ProxyServer https://bugs.webkit.org/show_bug.cgi?id=234362 Reviewed by Geoffrey Garen. * WebProcess/Plugins/PluginView.cpp: 2021-12-15 Chris Dumez RELEASE_ASSERT in WTF::Deque::first() https://bugs.webkit.org/show_bug.cgi?id=234301 Reviewed by Geoffrey Garen. WebPageProxy::interpretKeyEvent() gets called as the result of IPC from the WebProcess and assumes that WebPageProxy::m_keyEventQueue is non-empty. We have evidence based on the Chrome crash report that this assertion doesn't always hold. Also, the WebProcess is not a trusted process so we shouldn't be making such assumptions in the first place. Add a check in WebPageProxy::interpretKeyEvent() to properly deal with an empty queue. No new tests, unknown how to reproduce. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::interpretKeyEvent): 2021-12-15 Alex Christensen Actually use adattributiond.entitlements when code signing adattributiond https://bugs.webkit.org/show_bug.cgi?id=234329 Reviewed by Tim Horton. r283897 got me so close. I generate the entitlements and the sandbox profile. Now I need to actually sign with the entitlements. I verified by building two roots that before this change, the codesign invocation looked like this: /usr/bin/codesign --force --sign - --generate-entitlement-der .../Root/System/Library/Frameworks/WebKit.framework/Daemons/adattributiond and after this change it looks like this: /usr/bin/codesign --force --sign - --entitlements .../TempContent/Objects/WebKit.build/adattributiond.build/adattributiond.entitlements --generate-entitlement-der .../Root/System/Library/Frameworks/WebKit.framework/Daemons/adattributiond * Configurations/adattributiond.xcconfig: 2021-12-15 Per Arne Vollan [iOS][WP] Add access to required syscall https://bugs.webkit.org/show_bug.cgi?id=234336 Reviewed by Brent Fulgham. Add access to required system call in the WebProcess sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-12-15 Jer Noble [Mac] Adopt -[NSScreen safeAreaInsets] https://bugs.webkit.org/show_bug.cgi?id=234291 Reviewed by Eric Carlson. Drive-by fix: use the safeAreaFrame() when determining where to place the exit fullscreen placeholder image. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimationAndExitImmediately:]): 2021-12-15 Alex Christensen More cleanup after PluginProcess removal https://bugs.webkit.org/show_bug.cgi?id=234354 Reviewed by Tim Horton. Remove some unused code, unify some sources. * Configurations/PluginProcessShim.xcconfig: Removed. * Configurations/PluginService.xcconfig: Removed. * DerivedSources.make: * Shared/Cocoa/SharedRingBufferStorage.cpp: (WebKit::ReadOnlySharedRingBufferStorage::allocate): (WebKit::SharedRingBufferStorage::setStorage): (WebKit::SharedRingBufferStorage::allocate): * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultMediaSessionCoordinatorEnabled): * Sources.txt: * UIProcess/WebProcessPool.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::platformLayer const): (WebKit::PluginView::contentsScaleFactor): (WebKit::PluginView::pluginProcessCrashed): Deleted. (WebKit::PluginView::proxiesForURL): Deleted. (WebKit::PluginView::cookiesForURL): Deleted. (WebKit::PluginView::setCookiesForURL): Deleted. * WebProcess/Plugins/PluginView.h: 2021-12-15 Sihui Liu REGRESSION (r286936): Many webstorage layout tests have become flaky failures https://bugs.webkit.org/show_bug.cgi?id=234274 Reviewed by Chris Dumez. Connection (listener) is not added properly to existing MemoryStorageAreas, so events are not dispatched. Also according to the old behavior, we don't add connection (listener) to StorageArea when creating it, but when there is a connection message. * NetworkProcess/storage/SessionStorageManager.cpp: (WebKit::SessionStorageManager::addStorageArea): (WebKit::SessionStorageManager::connectToSessionStorageArea): (WebKit::SessionStorageManager::cloneStorageArea): * NetworkProcess/storage/SessionStorageManager.h: 2021-12-15 Chris Dumez Move SWServers from NetworkProcess to NetworkSession https://bugs.webkit.org/show_bug.cgi?id=234179 Reviewed by Darin Adler. Move SWServers from NetworkProcess to NetworkSession since they are per session. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection): (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::lowMemoryHandler): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): (WebKit::NetworkProcess::processPushMessage): (WebKit::NetworkProcess::forEachSWServer): Deleted. (WebKit::NetworkProcess::swServerForSession): Deleted. (WebKit::NetworkProcess::existingSWOriginStoreForSession const): Deleted. (WebKit::NetworkProcess::registerSWServerConnection): Deleted. (WebKit::NetworkProcess::unregisterSWServerConnection): Deleted. (WebKit::NetworkProcess::addServiceWorkerSession): Deleted. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::swServerForSessionIfExists): Deleted. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::lowMemoryHandler): (WebKit::NetworkSession::swOriginStore const): (WebKit::NetworkSession::registerSWServerConnection): (WebKit::NetworkSession::unregisterSWServerConnection): (WebKit::NetworkSession::ensureSWServer): (WebKit::NetworkSession::addServiceWorkerSession): (WebKit::NetworkSession::hasServiceWorkerDatabasePath const): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::swServer): * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::~WebSWServerConnection): * WebProcess/WebPage/WebPage.h: 2021-12-15 Youenn Fablet RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit should only reset once https://bugs.webkit.org/show_bug.cgi?id=234340 Reviewed by Eric Carlson. As seen in logs, there are cases where the unit is notified reset several times before it gets stopped and restarted. This triggers resetting on WebProcess side several times which is unneeded. Instead, we now only call reset once in a start/stop cycle of the audio unit. Manually tested. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.cpp: (WebKit::RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit::notifyReset): (WebKit::RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit::start): 2021-12-15 Per Arne Vollan [iOS][WP] Add access to required syscall https://bugs.webkit.org/show_bug.cgi?id=234336 Reviewed by Tim Horton. Add required syscall to the WebContent process' sandbox on iOS. This syscall was blocked in https://trac.webkit.org/changeset/286673/webkit. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-12-14 Jean-Yves Avenard SourceBufferParser should be using contiguous shared buffer https://bugs.webkit.org/show_bug.cgi?id=233865 rdar://problem/86085253 Reviewed by Eric Carlson. * WebProcess/GPU/media/SourceBufferPrivateRemote.cpp: (WebKit::SourceBufferPrivateRemote::append): * WebProcess/GPU/media/SourceBufferPrivateRemote.h: 2021-12-14 Alex Christensen Remove properties set by NSURLProtocol on NSURLRequest before serializing https://bugs.webkit.org/show_bug.cgi?id=232332 Reviewed by Geoff Garen. NSURLRequest encodeWithCoder: encodes the protocol properties, which are not used by WebKit. They exist to be used by NSURLProtocol. Serializing them can serialize a large amount of data, so to be more efficient and hopefully run out of memory less, remove the properties before serializing. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encodePlatformData): 2021-12-14 Jer Noble Safari intermittently stopping playing Spotify Web Player (currentTime goes backwards) https://bugs.webkit.org/show_bug.cgi?id=233257 Reviewed by Eric Carlson. Test: media/video-currentTime-duration.html Clamp currentMediaTime() to [0, durationMediaTime()]. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::currentMediaTime const): 2021-12-14 Alex Christensen Revert r284816 https://bugs.webkit.org/show_bug.cgi?id=234308 Reviewed by Eric Carlson. * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged): 2021-12-14 Alex Christensen Add _WKContentRuleListAction.redirected and .modifiedHeaders https://bugs.webkit.org/show_bug.cgi?id=234289 Reviewed by Tim Hatcher. * UIProcess/API/APIContentRuleListAction.cpp: (API::ContentRuleListAction::redirected const): (API::ContentRuleListAction::modifiedHeaders const): * UIProcess/API/APIContentRuleListAction.h: * UIProcess/API/Cocoa/_WKContentRuleListAction.h: * UIProcess/API/Cocoa/_WKContentRuleListAction.mm: (-[_WKContentRuleListAction redirected]): (-[_WKContentRuleListAction modifiedHeaders]): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentRuleListNotification): 2021-12-14 Alex Christensen Move FTP disabling from NetworkLoad::start to NetworkDataTask::NetworkDataTask https://bugs.webkit.org/show_bug.cgi?id=234280 Reviewed by Brady Eidson. A NetworkLoad synchronously failing has caused several issues. This issue is when a WKDownload is prevented in this way, we don't have a WKDownload in the UI process yet, and we haven't assigned it an identifier in the network process yet either, so we dereference null and send unreceived messages in many places. To fix this issue, I move the FTP check to the NetworkDataTask constructor like we do with blocked port checks and invalid URL checks. I also found that there is a race condition with CFNetwork also failing to load an empty FTP URL, so we need to prevent us from asking CFNetwork to start a load for which we have scheduled a failure. Covered by an API test which used to hit all the horrible failures and now passes reliably. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::wasBlockedByDisabledFTP): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::NetworkDataTask): (WebKit::NetworkDataTask::scheduleFailure): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::start): (WebKit::NetworkLoad::wasBlockedByDisabledFTP): * NetworkProcess/NetworkLoad.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::wasBlockedByDisabledFTP): * NetworkProcess/PingLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::resume): * Shared/WebErrors.cpp: (WebKit::ftpDisabledError): * Shared/WebErrors.h: 2021-12-14 Tim Horton Fix the build * Configurations/webpushtool.xcconfig: 2021-12-14 Megan Gardner Attachment does not update after markup. https://bugs.webkit.org/show_bug.cgi?id=234266 Reviewed by Wenson Hsieh. If we don't call the deligate to inform Mail about the new attachment data, it will not update and the original image will be sent. * UIProcess/mac/WKSharingServicePickerDelegate.mm: (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): 2021-12-11 Dean Jackson Allow override of system's preferred color scheme https://bugs.webkit.org/show_bug.cgi?id=234199 Reviewed by Tim Horton. Expose new Private API that allows the user to give an explicit per-page preference for light or dark color schemes rather than reading the system value. * Scripts/webkit/messages.py: (headers_for_type): Add header for DocumentLoader. * Shared/WebsitePoliciesData.cpp: Encode the new value in the policies sent to the Web Process. (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: Expose a new policy "colorSchemePreference". (API::WebsitePolicies::copy const): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: Expose a new private API "_colorSchemePreference". (-[WKWebpagePreferences _colorSchemePreference]): (-[WKWebpagePreferences _setColorSchemePreference:]): * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: 2021-12-14 Jean-Yves Avenard 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: 2021-12-13 Carlos Garcia Campos [GTK][a11y] Handle the Embedded method sent by AtkSocket from AccessibilityRootAtspi https://bugs.webkit.org/show_bug.cgi?id=234233 Reviewed by Adrian Perez de Castro. I added some hacks to send the socket path to the web process using WebKit IPC because Embedded message is not in the DBus interface. We can simply add the message to the interface definition and handle it instead to simplify everything. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::bindAccessibilityTree): (WebKit::ProvisionalPageProxy::didReceiveMessage): * UIProcess/ProvisionalPageProxy.h: (WebKit::ProvisionalPageProxy::accessibilityPlugID): (WebKit::ProvisionalPageProxy::CompletionHandler PCM: Remove old DB update and migration code, and add a unit test for destination token DB columns https://bugs.webkit.org/show_bug.cgi?id=234281 Reviewed by Alex Christensen and Kate Cheney. WebKit::Database::needsUpdatedSchema() in PrivateClickMeasurement.cpp has a comment saying it should be removed late 2021. WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary() returns directly if WebKit::Database::needsUpdatedSchema() returns false so always returning false for WebKit::Database::needsUpdatedSchema() in PrivateClickMeasurement.cpp effectively disables WebKit::DatabaseUtilities::migrateDataToNewTablesIfNecessary() for PCM. New unit/API test PrivateClickMeasurement.MigrateWithDestinationToken added. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp: (WebKit::PCM::Database::Database): No longer calls the deleted DatabaseUtilities::migrateDataToNewTablesIfNecessary(). (WebKit::PCM::Database::attributionToStringForTesting const): Now outputs destination token info. (WebKit::PCM::Database::needsUpdatedSchema): Deleted. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h: needsUpdatedSchema() now always returns false. 2021-12-13 Alex Christensen Allow WKContentRuleList to run regexes on current frame's URL, not just top frame's URL https://bugs.webkit.org/show_bug.cgi?id=233889 Reviewed by Timothy Hatcher. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::processContentRuleListsForLoad): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::setContentExtensionController): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::initialize): * Shared/WebCompiledContentRuleList.cpp: (WebKit::WebCompiledContentRuleList::urlFiltersBytecode const): (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const): Deleted. (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const): Deleted. * Shared/WebCompiledContentRuleList.h: * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::encode const): (WebKit::WebCompiledContentRuleListData::decode): * Shared/WebCompiledContentRuleListData.h: (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData): * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListMetaData::fileSize const): (API::encodeContentRuleListMetaData): (API::decodeContentRuleListMetaData): (API::compiledToFile): (API::createExtension): (API::getContentRuleListSourceFromMappedFile): * UIProcess/API/APIContentRuleListStore.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::startPingLoad): 2021-12-13 Brady Eidson Teach webpushtool to register and "host" the daemon. https://bugs.webkit.org/show_bug.cgi?id=234265 Reviewed by Tim Horton. Covered by API tests verifying hosting mode operation. As various engineers work on various parts of the project, it's become apparent that it's super useful to have a tool handle the "setting up" of the daemon itself, to avoid launchctl, etc. Implement that, as well as a few other niceties found while testing. * Configurations/webpushtool.xcconfig: * Resources/webpushtool.entitlements: * Shared/Daemon/DaemonUtilities.mm: (WebKit::startListeningForMachServiceConnections): * webpushd/AppBundleRequest.mm: (WebPushD::AppBundleRequest::start): * webpushd/PushClientConnection.h: * webpushd/PushClientConnection.mm: (WebPushD::ClientConnection::setHostAppAuditTokenData): (WebPushD::ClientConnection::broadcastDebugMessage): * webpushd/WebPushDaemon.h: * webpushd/WebPushDaemon.mm: (WebPushD::Daemon::broadcastAllConnectionIdentities): * webpushd/webpushtool/WebPushToolConnection.h: * webpushd/webpushtool/WebPushToolConnection.mm: (WebPushTool::Connection::connectToService): (WebPushTool::Connection::connectionDropped): * webpushd/webpushtool/WebPushToolMain.mm: (printUsageAndTerminate): (registerDaemonWithLaunchD): (main): 2021-12-13 Commit Queue Unreviewed, reverting r286993. https://bugs.webkit.org/show_bug.cgi?id=234283 Reverted changeset: "[WebAuthn] Allow same-site, cross-origin iframe get()" https://bugs.webkit.org/show_bug.cgi?id=234180 https://commits.webkit.org/r286993 2021-12-13 Tim Horton Momentum Event Dispatcher: Excessive "kick" at the beginning of scrolling (especially on 60fps displays) https://bugs.webkit.org/show_bug.cgi?id=234279 Reviewed by Simon Fraser. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::handleWheelEvent): (WebKit::MomentumEventDispatcher::didStartMomentumPhase): Instead of back-dating the animation to try to acquire a momentum-start delta, pass the one we got from the event through, and start the animation curve at momentum-start time. Also, critically, inset ourselves along the curve by the amount of that initial delta (since the time starts now). Tested at both 60fps and 120fps, this significantly smooths out the transition from fingers-down phase to the generated momentum phase, avoiding the overly large initial delta. * WebProcess/WebPage/MomentumEventDispatcher.h: 2021-12-13 J Pascoe [WebAuthn] Allow same-site, cross-origin iframe get() https://bugs.webkit.org/show_bug.cgi?id=234180 rdar://85161142 Reviewed by Brent Fulgham. The Web Authentication level 2 specifies a feature policy to allow get calls in cross-origin i-frames. This patch implements this feature policy partially. Only same-site, cross-origin i-frames are supported instead. This is for tracking prevention purposes. https://w3c.github.io/webauthn/#sctn-iframe-guidance This patch also starts passing ClientDataJSON hashes to ASC to avoid the situation where WebKit includes crossOrigin or other fields in ClientDataJSON that ASC is unaware of when generating ClientDataJSON. Added layout test cases for same-site, cross-origin get calls. * Platform/spi/Cocoa/AuthenticationServicesCoreSPI.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (produceClientDataJson): * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::configureRegistrationRequestContext): (WebKit::configurationAssertionRequestContext): (WebKit::WebAuthenticatorCoordinatorProxy::contextForRequest): 2021-12-13 Jean-Yves Avenard Add SharedBufferBuilder class https://bugs.webkit.org/show_bug.cgi?id=233442 rdar://85693939 Reviewed by Youenn Fablet. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::bufferingTimerFired): (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse): (WebKit::NetworkCache::SpeculativeLoad::didReceiveBuffer): (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::WebURLSchemeTask): (WebKit::WebURLSchemeTask::didReceiveData): (WebKit::WebURLSchemeTask::didComplete): * UIProcess/WebURLSchemeTask.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::PluginView): (WebKit::PluginView::manualLoadDidReceiveData): (WebKit::PluginView::manualLoadDidFail): (WebKit::PluginView::liveResourceData const): (WebKit::PluginView::redeliverManualStream): * WebProcess/Plugins/PluginView.h: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData): (WebKit::WebServiceWorkerFetchTaskClient::continueDidReceiveResponse): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp: (WebKit::WebPreviewLoaderClient::didFinishLoading): (WebKit::WebPreviewLoaderClient::didFail): * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h: 2021-12-13 Per Arne Vollan [WP][iOS] Add access to required system call https://bugs.webkit.org/show_bug.cgi?id=234232 Reviewed by Brent Fulgham. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-12-13 Chris Dumez Regression(r283565) Unable to report private messages as Spam in Twitter app https://bugs.webkit.org/show_bug.cgi?id=234253 Reviewed by Alex Christensen. In r283565, we aligned WebKit's behavior with the Fetch specification and with Gecko / Blink by keeping the Authorization header on same origin redirects. However, when reporting a private message in the twitter app, it does a same-origin redirect from `https://twitter.com/account/authenticate_web_view?...` to `https://twitter.com/account/authenticate_web_view?...` and the HTTP server reponds with a 401/Unauthorized when we send the Authorization on the post-redirect request. As far as I can tell, our behavior is correct here and I suspect this is an issue with the twitter server. As a result, I am simply gating the new behavior behind a linked-on-or-after check to give twitter a chance to address the issue on their end. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): 2021-12-13 Youenn Fablet REGRESSION (r286841): [ iOS ] Many webrtc tests flaky failing on iOS https://bugs.webkit.org/show_bug.cgi?id=234181 Reviewed by Eric Carlson. Use network connection state change callback to know when connection fails or is cancelled. Introduce ConnectionStateTracker to know when to stop reading new UDP packets. ConnectionStateTracker will be stopped when state is changed to failed or cancelled as well as when the whole connection is closed. Renaming m_nwConnections to m_connections as m_nwConnections name was already used. Reduce error logging to only new error codes or when connectino enters unrecoverable failure (hence changing to failed state). Covered by existing tests. * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: 2021-12-13 Elliott Williams Deployment target for macOS 11+ does not follow minor version bumps https://bugs.webkit.org/show_bug.cgi?id=233906 Reviewed by Alexey Proskuryakov. * Configurations/DebugRelease.xcconfig: 2021-12-13 Joonghun Park Unreviewed. Fix build error since r286946. ClientOrigin should be forward declared as struct, not class. * NetworkProcess/storage/SessionStorageManager.h: 2021-12-13 Adrian Perez de Castro Unreviewed build fix after r286936 No new tests needed. * NetworkProcess/storage/OriginStorageManager.cpp: Add missing inclusion of MemoryStorageArea.h, which broke non-unified builds. * NetworkProcess/storage/SQLiteStorageArea.cpp: Add missing inclusion of Logging.h, broke the build in some configurations. * NetworkProcess/storage/SessionStorageManager.h: Add missing inclusion of Connection.h, and add missing forward declaration for WebCore::ClientOrigin, which broke the build for non-Apple ports. 2021-12-13 Youenn Fablet Fix ServiceWorker downloads https://bugs.webkit.org/show_bug.cgi?id=202142 Reviewed by Alex Christensen. Add ServiceWorkerDownloadTask class as a NetworkDataTask whose purpose is to download the content of a response given from service worker. Add a way to convert ServiceWorkerFetchTask into downloads: - If a preload is ongoing and can be used for navigation, use this preload as the download NetworkLoad. - If a preload does not exist, create a ServiceWorkerDownloadTask and a corresponding NetworkLoad to start downloading the service worker response data. When creating a ServiceWorkerDownloadTask, the WebServiceWorkerFetchTaskClient will be notified to start sending response data using ServiceWorkerDownloadTask instead of ServiceWorkerFetchTask messages. This allows cancelling the ServiceWorkerFetchTask without any issue. Note that the service worker lifetime is not augmented: if the service worker exits due to all its clients being closed, the download will fail. Increase unified build files to 112. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkLoad.cpp: * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.cpp: Added. * NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.h: Added. * NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.messages.in: Added. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * NetworkProcess/storage/NetworkStorageManager.cpp: * Scripts/generate-unified-sources.sh: * Scripts/webkit/messages.py: * Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp: (WebKit::TestWithCVPixelBuffer::didReceiveMessage): * Scripts/webkit/tests/TestWithIfMessageMessageReceiver.cpp: (WebKit::TestWithIfMessage::didReceiveMessage): * Scripts/webkit/tests/TestWithImageDataMessageReceiver.cpp: (WebKit::TestWithImageData::didReceiveMessage): * Scripts/webkit/tests/TestWithLegacyReceiverMessageReceiver.cpp: (WebKit::TestWithLegacyReceiver::didReceiveTestWithLegacyReceiverMessage): * Scripts/webkit/tests/TestWithSemaphoreMessageReceiver.cpp: (WebKit::TestWithSemaphore::didReceiveMessage): * Scripts/webkit/tests/TestWithStreamBufferMessageReceiver.cpp: (WebKit::TestWithStreamBuffer::didReceiveMessage): * Scripts/webkit/tests/TestWithStreamMessageReceiver.cpp: (WebKit::TestWithStream::didReceiveStreamMessage): * Scripts/webkit/tests/TestWithoutAttributesMessageReceiver.cpp: (WebKit::TestWithoutAttributes::didReceiveMessage): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): (WebKit::WebProcessPool::createDownloadProxy): * Sources.txt: * UnifiedSources-output.xcfilelist: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: 2021-12-13 Kimmo Kinnunen Cocoa WebGL should support UI side compositing https://bugs.webkit.org/show_bug.cgi?id=231009 Reviewed by Simon Fraser. Implement the capability to assign IOSurfaces to PlatformCALayerRemote contents. Make RemoteGraphicsContextGLProxyCocoa use the added GraphicsLayerContentsDisplayDelegate. Second try, previous was reverted due to a test failure. The test failure happened due to RemoteLayerBackingStore sending the same drawn backing store with different properties but same image. The original patch tried to use RemoteLayerBackingStore::m_bufferHandle also on the send side to store the handle. This handle was encoded multiple times. The underlying ShareableBitmap::Handle IPC encoding destroys the underlying mach send right even though the encoding API signature would signify that the Handle stays intact. ShareableBitmap, SharedMemory will be fixed in future commits. * GPUProcess/graphics/GPUProcessGraphicsContextGL.h: * GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp: (WebKit::RemoteGraphicsContextGLCocoa::prepareForDisplay): * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: (WebKit::RemoteLayerBackingStore::hasFrontBuffer const): * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::clearBackingStore): (WebKit::RemoteLayerBackingStore::encode const): (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): (WebKit::RemoteLayerBackingStore::setContents): (WebKit::RemoteLayerBackingStore::display): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::description const): * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm: (WebKit::RemoteGraphicsContextGLProxy::create): * WebProcess/GPU/graphics/wc/RemoteGraphicsContextGLProxyWC.cpp: (WebKit::RemoteGraphicsContextGLProxy::create): Deleted. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): (WebKit::PlatformCALayerRemote::setContents): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom): (WebKit::PlatformCALayerRemoteCustom::clone const): (WebKit::PlatformCALayerRemoteCustom::setNeedsDisplayInRect): (WebKit::PlatformCALayerRemoteCustom::setNeedsDisplay): * WebProcess/WebPage/wc/GraphicsLayerWC.cpp: (WebKit::GraphicsLayerWC::setContentsDisplayDelegate): 2021-12-13 Jean-Yves Avenard Distinguish contiguous SharedBuffer from non-contiguous one and guarantee immutability https://bugs.webkit.org/show_bug.cgi?id=233030 rdar://85333814 Reviewed by Darin Adler. * GPUProcess/webrtc/RemoteMediaRecorder.cpp: (WebKit::RemoteMediaRecorder::fetchData): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::sendReplyToSynchronousRequest): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveBuffer): * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::encode): (WebKit::CacheStorage::Cache::decode): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::encodeAsStorageRecord const): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didReadDataURL): * Platform/IPC/SharedBufferCopy.cpp: (IPC::SharedBufferCopy::decode): * Platform/IPC/SharedBufferCopy.h: (IPC::SharedBufferCopy::SharedBufferCopy): (IPC::SharedBufferCopy::buffer): (IPC::SharedBufferCopy::buffer const): * Platform/SharedMemory.cpp: (WebKit::SharedMemory::createSharedBuffer const): * Platform/SharedMemory.h: * Shared/APIWebArchiveResource.mm: (API::WebArchiveResource::data): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder>::decodePlatformData): * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp: (WebKit::CGDisplayListImageBufferBackend::createImageBufferBackendHandle const): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer const): * Shared/ShareableResource.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::decodeSharedBuffer): (IPC::encodeTypesAndData): (IPC::decodeTypesAndData): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder>::encode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder>::encode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/gtk/ArgumentCodersGtk.cpp: (IPC::ArgumentCoder::decode): * Shared/win/WebCoreArgumentCodersWin.cpp: (IPC::ArgumentCoder>::decodePlatformData): * UIProcess/API/APIAttachment.cpp: (API::Attachment::createSerializedRepresentation const): (API::Attachment::updateFromSerializedRepresentation): * UIProcess/API/APIAttachment.h: * UIProcess/API/APIContentRuleListStore.cpp: (API::getData): * UIProcess/API/Cocoa/APIAttachmentCocoa.mm: (API::Attachment::createSerializedRepresentation const): (API::Attachment::updateFromSerializedRepresentation): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _storeAppHighlight:]): * UIProcess/API/gtk/DropTargetGtk3.cpp: (WebKit::DropTarget::dataReceived): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::writeSelectionToPasteboard): (WebKit::WebViewImpl::setPromisedDataForImage): (WebKit::WebViewImpl::provideDataForPasteboard): (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): (WebKit::WebViewImpl::requestDOMPasteAccess): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didComplete): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::saveImageToLibrary): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): (allPasteboardItemOriginsMatchOrigin): (-[WKContentView actionSheetAssistant:shareElementWithImage:rect:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dataSelectionForPasteboard): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::dataSelectionForPasteboard): * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: (API::InjectedBundle::EditorClient::getPasteboardDataForRange): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::releaseSharedBuffer): (WebKit::InjectedBundlePageLoaderClient::willLoadDataRequest): * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm: (WebKit::ARKitInlinePreviewModelPlayerMac::createFile): * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didCacheResource): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveData): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::getClientPasteboardData): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::finishedLoading): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::bufferForType): (WebKit::WebPlatformStrategies::readBufferFromClipboard): (WebKit::WebPlatformStrategies::readBufferFromPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::source const): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::getDataSelectionForPasteboard): * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreen const): (WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const): 2021-12-12 Sihui Liu Merge StorageManager with NetworkStorageManager to manage WebStorage by origin https://bugs.webkit.org/show_bug.cgi?id=234087 Reviewed by Chris Dumez. In network process, WebStorage data is managed by WebKit::StorageManager class. Each StorageManager owns one or many StorageNameSpaces, and each StorageNamespace owns one or more StorageAreas. Each StorageArea correponds to one storage map (one localStorage or sessionStorage object), using either a SQLite database or a in-memory map as backend. Now that we have NetworkStorageManager, which manages storage by origin. We can merge StorageManager with NetworkStorageManager, since localStorage and sessionStorage are not shared between different origins. The new structure is: NetworkStorageManager (manage storage for a session, owns one or more OriginStorageManagers) OriginStorageManager (manage storage for an origin, owns one LocalStorageManager and one SessionStorageManager) LocalStorageManager / SessionStorageManager (manage LocalStorage and SessionStorage, owns one or more StorageAreaBases) MemoryStorageArea / SQLiteStorageArea (inherits StorageAreaBases; manage one local or session storage, like Webkit::StorageArea) StorageNamespace layer is removed. For SessionStorage, different StorageNamespaces means different web pages, and same origin can have different sessionStorages on different pages, so we keep a StorageNamespace <=> StorageArea map in SessionStorageManager. For LocalStorage, differnt StorageNamespaces means different page groups. Our original plan was the same origin can have different localStorages in different page groups, but our old implementation actually made all page groups point to the same database file. To keep existing behavior that all page groups with same origin share the storage, we now keep one local StorageArea and one transient StorageArea per LocalStorageManager. Mostly refactoring and covered by existing tests. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::lowMemoryHandler): (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::addStorageManagerForSession): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::hasLocalStorage): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): (WebKit::NetworkProcess::syncLocalStorage): (WebKit::NetworkProcess::renameOriginInWebsiteData): (WebKit::NetworkProcess::connectionToWebProcessClosed): (WebKit::NetworkProcess::getLocalStorageOriginDetails): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/storage/LocalStorageManager.cpp: Added. (WebKit::fileNameToOrigin): (WebKit::originToFileName): (WebKit::LocalStorageManager::originsOfLocalStorageData): (WebKit::LocalStorageManager::localStorageFilePath): (WebKit::LocalStorageManager::LocalStorageManager): (WebKit::LocalStorageManager::isActive const): (WebKit::LocalStorageManager::hasDataInMemory const): (WebKit::LocalStorageManager::clearDataInMemory): (WebKit::LocalStorageManager::clearDataOnDisk): (WebKit::LocalStorageManager::close): (WebKit::LocalStorageManager::handleLowMemoryWarning): (WebKit::LocalStorageManager::syncLocalStorage): (WebKit::LocalStorageManager::connectionClosed): (WebKit::LocalStorageManager::connectionClosedForLocalStorageArea): (WebKit::LocalStorageManager::connectionClosedForTransientStorageArea): (WebKit::LocalStorageManager::connectToLocalStorageArea): (WebKit::LocalStorageManager::connectToTransientLocalStorageArea): (WebKit::LocalStorageManager::disconnectFromStorageArea): * NetworkProcess/storage/LocalStorageManager.h: Added. * NetworkProcess/storage/MemoryStorageArea.cpp: Added. (WebKit::MemoryStorageArea::MemoryStorageArea): (WebKit::MemoryStorageArea::isEmpty): (WebKit::MemoryStorageArea::clear): (WebKit::MemoryStorageArea::allItems): (WebKit::MemoryStorageArea::setItem): (WebKit::MemoryStorageArea::removeItem): (WebKit::MemoryStorageArea::clone const): * NetworkProcess/storage/MemoryStorageArea.h: Added. (isType): * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::readOriginFromFile): (WebKit::writeOriginToFileIfNecessary): (WebKit::NetworkStorageManager::create): (WebKit::NetworkStorageManager::NetworkStorageManager): (WebKit::NetworkStorageManager::canHandleTypes): (WebKit::NetworkStorageManager::close): (WebKit::originDirectoryPath): (WebKit::originFilePath): (WebKit::NetworkStorageManager::localOriginStorageManager): (WebKit::NetworkStorageManager::removeOriginStorageManagerIfPossible): (WebKit::NetworkStorageManager::deleteOriginDirectoryIfPossible): (WebKit::NetworkStorageManager::clearStorageForTesting): (WebKit::NetworkStorageManager::forEachOriginDirectory): (WebKit::NetworkStorageManager::getAllOrigins): (WebKit::NetworkStorageManager::fetchDataFromDisk): (WebKit::NetworkStorageManager::deleteDataOnDisk): (WebKit::NetworkStorageManager::moveData): (WebKit::NetworkStorageManager::suspend): (WebKit::NetworkStorageManager::resume): (WebKit::NetworkStorageManager::handleLowMemoryWarning): (WebKit::NetworkStorageManager::syncLocalStorage): (WebKit::NetworkStorageManager::connectToLocalStorageArea): (WebKit::NetworkStorageManager::connectToTransientLocalStorageArea): (WebKit::NetworkStorageManager::connectToSessionStorageArea): (WebKit::NetworkStorageManager::disconnectFromStorageArea): (WebKit::NetworkStorageManager::cloneSessionStorageNamespace): (WebKit::NetworkStorageManager::getValues): (WebKit::NetworkStorageManager::setItem): (WebKit::NetworkStorageManager::removeItem): (WebKit::NetworkStorageManager::clear): (WebKit::toWebsiteDataType): Deleted. * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.messages.in: * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::StorageBucket::StorageBucket): (WebKit::OriginStorageManager::StorageBucket::toWebsiteDataType): (WebKit::OriginStorageManager::StorageBucket::toStorageIdentifier): (WebKit::OriginStorageManager::StorageBucket::localStorageManager): (WebKit::OriginStorageManager::StorageBucket::existingLocalStorageManager): (WebKit::OriginStorageManager::StorageBucket::sessionStorageManager): (WebKit::OriginStorageManager::StorageBucket::existingSessionStorageManager): (WebKit::OriginStorageManager::StorageBucket::isActive const): (WebKit::OriginStorageManager::StorageBucket::isEmpty const): (WebKit::OriginStorageManager::StorageBucket::fetchDataTypesInList): (WebKit::OriginStorageManager::StorageBucket::deleteData): (WebKit::OriginStorageManager::StorageBucket::moveData): (WebKit::OriginStorageManager::StorageBucket::fetchDataTypesInListFromMemory): (WebKit::OriginStorageManager::StorageBucket::fetchDataTypesInListFromDisk): (WebKit::OriginStorageManager::StorageBucket::deleteLocalStorageData): (WebKit::OriginStorageManager::StorageBucket::deleteSessionStorageData): (WebKit::OriginStorageManager::OriginStorageManager): (WebKit::OriginStorageManager::defaultBucket): (WebKit::OriginStorageManager::localStorageManager): (WebKit::OriginStorageManager::existingLocalStorageManager): (WebKit::OriginStorageManager::sessionStorageManager): (WebKit::OriginStorageManager::existingSessionStorageManager): (WebKit::OriginStorageManager::isEmpty): (WebKit::OriginStorageManager::fetchDataTypesInList): (WebKit::OriginStorageManager::deleteData): (WebKit::OriginStorageManager::moveData): (WebKit::OriginStorageManager::StorageBucket::isActive): Deleted. * NetworkProcess/storage/OriginStorageManager.h: * NetworkProcess/storage/SQLiteStorageArea.cpp: Added. (WebKit::SQLiteStorageArea::statementString const): (WebKit::SQLiteStorageArea::SQLiteStorageArea): (WebKit::SQLiteStorageArea::close): (WebKit::SQLiteStorageArea::~SQLiteStorageArea): (WebKit::SQLiteStorageArea::isEmpty): (WebKit::SQLiteStorageArea::clear): (WebKit::SQLiteStorageArea::createTableIfNecessary): (WebKit::SQLiteStorageArea::prepareDatabase): (WebKit::SQLiteStorageArea::startTransactionIfNecessary): (WebKit::SQLiteStorageArea::cachedStatement): (WebKit::SQLiteStorageArea::getItem): (WebKit::SQLiteStorageArea::getItemFromDatabase): (WebKit::SQLiteStorageArea::allItems): (WebKit::SQLiteStorageArea::setItem): (WebKit::SQLiteStorageArea::removeItem): (WebKit::SQLiteStorageArea::commitTransactionIfNecessary): (WebKit::SQLiteStorageArea::handleLowMemoryWarning): * NetworkProcess/storage/SQLiteStorageArea.h: Added. (isType): * NetworkProcess/storage/SessionStorageManager.cpp: Added. (WebKit::SessionStorageManager::SessionStorageManager): (WebKit::SessionStorageManager::isActive const): (WebKit::SessionStorageManager::hasDataInMemory const): (WebKit::SessionStorageManager::clearData): (WebKit::SessionStorageManager::connectionClosed): (WebKit::SessionStorageManager::addStorageArea): (WebKit::SessionStorageManager::connectToSessionStorageArea): (WebKit::SessionStorageManager::disconnectFromStorageArea): (WebKit::SessionStorageManager::cloneStorageArea): * NetworkProcess/storage/SessionStorageManager.h: Added. * NetworkProcess/storage/StorageAreaBase.cpp: Added. Some code is moved from NetworkProcess/WebStoreage/StorageArea.cpp. (WebKit::StorageAreaBase::StorageAreaBase): (WebKit::StorageAreaBase::addListener): (WebKit::StorageAreaBase::removeListener): (WebKit::StorageAreaBase::hasListeners const): (WebKit::StorageAreaBase::notifyListenersAboutClear): (WebKit::StorageAreaBase::dispatchEvents const): * NetworkProcess/storage/StorageAreaBase.h: Added. Some code is moved from NetworkProcess/WebStoreage/StorageArea.h. (WebKit::StorageAreaBase::identifier const): (WebKit::StorageAreaBase::origin const): (WebKit::StorageAreaBase::quota const): * NetworkProcess/storage/StorageAreaRegistry.cpp: Added. (WebKit::StorageAreaRegistry::registerStorageArea): (WebKit::StorageAreaRegistry::unregisterStorageArea): (WebKit::StorageAreaRegistry::getStorageArea): * NetworkProcess/storage/StorageAreaRegistry.h: Added. * Scripts/generate-unified-sources.sh: * Sources.txt: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getLocalStorageDetails): Deleted. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::excludeDirectoryFromBackup): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): (WebKit::WebsiteDataStore::getLocalStorageDetails): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: * UnifiedSources-output.xcfilelist: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::setItem): (WebKit::StorageAreaMap::removeItem): (WebKit::StorageAreaMap::clear): (WebKit::StorageAreaMap::ensureMap): (WebKit::StorageAreaMap::connect): (WebKit::StorageAreaMap::disconnect): * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::copy): 2021-12-11 Tim Horton Momentum Event Dispatcher: Tail frames are the wrong velocity if momentum event dispatch rate doesn't match screen refresh rate https://bugs.webkit.org/show_bug.cgi?id=234168 Reviewed by Simon Fraser. In r286671, I scaled the tail frames into the momentum event disaptch rate, but they are actually always dispatched at display refresh frequency. In many cases these things are the same, but in some cases can differ (most commonly a 120Hz display with 60Hz event dispatch), so to always have the tail move at the right rate, scale into the display refresh rate instead). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::windowScreenDidChange): * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::pageScreenDidChange): * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/EventDispatcher.messages.in: * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::didStartMomentumPhase): (WebKit::MomentumEventDispatcher::displayProperties const): (WebKit::MomentumEventDispatcher::startDisplayLink): (WebKit::MomentumEventDispatcher::stopDisplayLink): (WebKit::MomentumEventDispatcher::pageScreenDidChange): (WebKit::MomentumEventDispatcher::displayWasRefreshed): (WebKit::MomentumEventDispatcher::displayID const): Deleted. * WebProcess/WebPage/MomentumEventDispatcher.h: Plumb and store the nominal display refresh rate. (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta): Scale the tail frames from the 60Hz ideal rate into the display refresh rate, instead of the event dispatch rate. Incoming events still scale *in* from the event dispatch rate, since that's... the rate they come at. 2021-12-11 Don Olmstead Add a std::nullptr_t constructor for RefPtr https://bugs.webkit.org/show_bug.cgi?id=234192 Reviewed by Yusuke Suzuki. Remove uses of `0` when creating an empty RefPtr. * WebProcess/win/WebProcessWin.cpp: (loadResourceIntoBuffer): 2021-12-11 Lauro Moura Non-unified build fixes, mid mid December 2021 edition https://bugs.webkit.org/show_bug.cgi?id=234191 Unreviewed build fix. A few more fixes already a couple of days after the last fix. Full build still failing due to the issue discussed on bug226088. All changes are inclusion of missing headers. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp: 2021-12-11 Commit Queue Unreviewed, reverting r286893. https://bugs.webkit.org/show_bug.cgi?id=234197 Breaks the build Reverted changeset: "[macOS] Add new screen and window capture backend" https://bugs.webkit.org/show_bug.cgi?id=234029 https://commits.webkit.org/r286893 2021-12-11 Jer Noble Add an experimental trackConfiguration accessor on AudioTrack & VideoTrack. https://bugs.webkit.org/show_bug.cgi?id=230841 Reviewed by Eric Carlson. * GPUProcess/media/RemoteAudioTrackProxy.cpp: (WebKit::RemoteAudioTrackProxy::configuration): * GPUProcess/media/RemoteAudioTrackProxy.h: * GPUProcess/media/RemoteVideoTrackProxy.cpp: (WebKit::RemoteVideoTrackProxy::configuration): (WebKit::RemoteVideoTrackProxy::updateConfiguration): (WebKit::RemoteVideoTrackProxy::selectedChanged): (WebKit::RemoteVideoTrackProxy::idChanged): (WebKit::RemoteVideoTrackProxy::labelChanged): (WebKit::RemoteVideoTrackProxy::languageChanged): (WebKit::RemoteVideoTrackProxy::configurationChanged): Deleted. * GPUProcess/media/RemoteVideoTrackProxy.h: * GPUProcess/media/TrackPrivateRemoteConfiguration.h: (WebKit::TrackPrivateRemoteConfiguration::encode const): (WebKit::TrackPrivateRemoteConfiguration::decode): * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp: (WebKit::AudioTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/AudioTrackPrivateRemote.h: * WebProcess/GPU/media/VideoTrackPrivateRemote.cpp: (WebKit::VideoTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/VideoTrackPrivateRemote.h: 2021-12-10 Simon Fraser Scrolling can drop frames when CoreAnimation commits take a long time https://bugs.webkit.org/show_bug.cgi?id=234160 Reviewed by Tim Horton. In r261985 I added a mechanism that has the scrolling thread wait for the main thread to finish a rendering update, and, if the main thread fails to complete in time, then the scrolling thread commits. This allows for scrolling synchronization when the main thread is responsive, but smooth scrolling when the main thread is busy. However, r261985 only waits for WebKit work to finish; what we really care about is whether the main thread completes its CA commit in time (because that determines whether the scroll shows on the screen). So plumb through pre-/post-commit hooks from TiledCoreAnimationDrawingArea, which already had them for inspector instrumentation. Then have ThreadedScrollingTree notify m_stateCondition in didCompletePlatformRenderingUpdate(), instead of didCompleteRenderingUpdate(). Also, now we can call the inspector hooks from Page, rather than out in TiledCoreAnimationDrawingArea. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willStartPlatformRenderingUpdate): (WebKit::WebPage::didCompletePlatformRenderingUpdate): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::addCommitHandlers): 2021-12-10 Tim Horton Momentum Event Dispatcher: Magic Mouse doesn't use momentum event dispatcher https://bugs.webkit.org/show_bug.cgi?id=234189 Reviewed by Simon Fraser. * Shared/mac/ScrollingAccelerationCurveMac.mm: (WebKit::fromIOHIDDevice): Fix the FIXME here about the additional fallback values; it turns out Magic Mouse is one device that does not have a value for kIOHIDScrollAccelerationTypeKey, so we need the full fallback chain to support it. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sendWheelEvent): Un-wrapping this optional results in losing the engaged state, and sending a garbage ScrollingAccelerationCurve across the wire. The message argument is also an optional, so just pass it along. The result of this bug was that if you had ever used a device with a curve for a given page, and then used a device with no curve, MomentumEventDispatcher would have a garbage curve (from this message trying to "unset" the optional), and a garbage curve results in chaotic scrolling. 2021-12-10 Michael Saboff https://bugs.webkit.org/show_bug.cgi?id=234173 Update Install Paths for build system changes Reviewed by Yusuke Suzuki. Updated install paths for changes in the build system that use a system path prefix. * Configurations/BaseTarget.xcconfig: * Configurations/WebKit.xcconfig: 2021-12-10 Devin Rousso WKWebView doesn’t respond to -copyFont: and -pasteFont: https://bugs.webkit.org/show_bug.cgi?id=191379 Reviewed by Wenson Hsieh. * UIProcess/API/mac/WKView.mm: * UIProcess/API/mac/WKWebViewMac.mm: Add `-copyFont:` and `-pasteFont:` methods via `WEBCORE_COMMAND`. * UIProcess/WebPageProxy.cpp: (WebKit::pasteAccessCategoryForCommand): The `PasteFont` command should be categorized as `DOMPasteAccessCategory::Fonts`. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::pasteboardNameForAccessCategory): (WebKit::pasteboardForAccessCategory): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::willPerformPasteCommand): Correlate `DOMPasteAccessCategory::Fonts` with `NSPasteboardNameFont`. * UIProcess/ios/WKContentViewInteraction.mm: (pasteboardNameForAccessCategory): (pasteboardForAccessCategory): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::willPerformPasteCommand): Correlate `DOMPasteAccessCategory::Fonts` with `UIPasteboardNameGeneral`. 2021-12-10 Eric Carlson [macOS] Add new screen and window capture backend https://bugs.webkit.org/show_bug.cgi?id=234029 Reviewed by Jer Noble and Youenn Fablet. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKPreferences.mm: Add _useScreenCaptureKit private preference. (-[WKPreferences _useScreenCaptureKit]): (-[WKPreferences _setUseScreenCaptureKit:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add private delegate for a getDisplayMedia-specific prompt. * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _setIndexOfGetDisplayMediaDeviceSelectedForTesting:]): Set the index of the screen or window device to return for getDisplayMedia without prompting. * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::promptForDisplayCapturePermission): Call new screen/window capture delegate. (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::promptForGetDisplayMedia): Add parameter specifying a window or screen capture prompt. * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::manager const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setIndexOfGetDisplayMediaDeviceSelectedForTesting): * UIProcess/WebPageProxy.h: * UIProcess/mac/DisplayCaptureSessionManager.h: Added. (WebKit::DisplayCaptureSessionManager::setIndexOfDeviceSelectedForTesting): * UIProcess/mac/DisplayCaptureSessionManager.mm: Added. (WebKit::getMockWindowList): (WebKit::getCGWindowList): (WebKit::getWindowList): (WebKit::alertForWindowSelection): (WebKit::DisplayCaptureSessionManager::alertForGetDisplayMedia): (WebKit::DisplayCaptureSessionManager::isAvailable): (WebKit::DisplayCaptureSessionManager::singleton): (WebKit::DisplayCaptureSessionManager::DisplayCaptureSessionManager): (WebKit::DisplayCaptureSessionManager::~DisplayCaptureSessionManager): (WebKit::DisplayCaptureSessionManager::promptForGetDisplayMedia): (WebKit::DisplayCaptureSessionManager::deviceSelectedForTesting): (WebKit::DisplayCaptureSessionManager::showWindowPicker): (WebKit::DisplayCaptureSessionManager::showScreenPicker): * UIProcess/mac/UserMediaPermissionRequestProxyMac.h: Added. * UIProcess/mac/UserMediaPermissionRequestProxyMac.mm: Added. (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxyMac::UserMediaPermissionRequestProxyMac): (WebKit::UserMediaPermissionRequestProxyMac::~UserMediaPermissionRequestProxyMac): (WebKit::UserMediaPermissionRequestProxyMac::promptForGetDisplayMedia): (WebKit::UserMediaPermissionRequestProxyMac::canPromptForGetDisplayMedia): * WebKit.xcodeproj/project.pbxproj: 2021-12-10 Megan Gardner Image does not update after Markup Pane is dismissed. https://bugs.webkit.org/show_bug.cgi?id=234162 Reviewed by Devin Rousso. Once the item is retured from the Sharing Service, we need to pipe the information back to the attachement element so that it can be properly updated. This includes holding onto the attachment ID of the controlled image so that it can later be found and updated. * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::encode const): (WebKit::ContextMenuContextData::decode): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::controlledImageAttachmentID const): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * UIProcess/API/Cocoa/_WKAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.mm: (-[_WKAttachment setData:newContentType:]): * UIProcess/API/Cocoa/_WKAttachmentInternal.h: * UIProcess/mac/WKSharingServicePickerDelegate.h: * UIProcess/mac/WKSharingServicePickerDelegate.mm: (-[WKSharingServicePickerDelegate setAttachmentID:]): (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleImageServiceClick): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::handleImageServiceClick): 2021-12-10 Aditya Keerthi [iOS] Support find-in-page keyboard shortcuts https://bugs.webkit.org/show_bug.cgi?id=234163 rdar://86333128 Reviewed by Devin Rousso. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/ios/WKWebViewIOS.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView findForWebView:]): (-[WKContentView findNextForWebView:]): (-[WKContentView findPreviousForWebView:]): 2021-12-10 Brady Eidson Teach webpushd to launch an app in response to an injected message. https://bugs.webkit.org/show_bug.cgi?id=234122 Reviewed by Alex Christensen. To by covered by future API test. When a message comes in, webpushd knows which code signing identifier it was targetted for. It launches that app in a special mode so the app can then "take it from there" * webpushd/WebPushDaemon.h: * webpushd/WebPushDaemon.mm: (WebPushD::Daemon::injectPushMessageForTesting): (WebPushD::Daemon::notifyClientPushMessageIsAvailable): 2021-12-10 Antoine Quint Expose the maximum device frame rate to the Web Animations model https://bugs.webkit.org/show_bug.cgi?id=234161 rdar://85983792 Reviewed by Simon Fraser. The display's nominal frame rate was only provided to the Page on macOS. We also expose it on iOS such that the new DocumentTimeline property also works on iOS. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]): * UIProcess/WebPageProxy.h: 2021-12-10 Devin Rousso Allow `Pasteboard::readBuffer` to read from the pasteboard as a whole instead of a specific item https://bugs.webkit.org/show_bug.cgi?id=233940 Reviewed by Wenson Hsieh. In order to match the WK1 implementation of `-pasteFont:` , we need to read from the font pasteboard as a whole, not a specific item. Make the `index` into an `std::optional` so that we can have this behavior without needing to have a new method. No change in behavior. * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::readBufferFromPasteboard): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::readBufferFromPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::readBufferFromPasteboard): 2021-12-10 Alex Christensen Move if-domain and unless-domain conversion to WKContentRuleList parsing https://bugs.webkit.org/show_bug.cgi?id=234126 Reviewed by Tim Hatcher. * Shared/WebCompiledContentRuleList.cpp: (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const): Deleted. * Shared/WebCompiledContentRuleList.h: * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::encode const): (WebKit::WebCompiledContentRuleListData::decode): * Shared/WebCompiledContentRuleListData.h: (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData): * UIProcess/API/APIContentRuleListStore.cpp: (API::encodeContentRuleListMetaData): (API::decodeContentRuleListMetaData): (API::compiledToFile): (API::createExtension): (API::getContentRuleListSourceFromMappedFile): * UIProcess/API/APIContentRuleListStore.h: 2021-12-10 Per Arne Vollan [WP] Block access to container manager service for Mail https://bugs.webkit.org/show_bug.cgi?id=234080 Reviewed by Brent Fulgham. Local testing is not showing access to this daemon when running Mail. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/com.apple.WebProcess.sb.in: 2021-12-10 Said Abou-Hallawa [GPU Process] [Filters] Make FilterEffectVector a Vector of Ref https://bugs.webkit.org/show_bug.cgi?id=234108 Reviewed by Cameron McCormack. * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::drawFilteredImageBuffer): 2021-12-10 Per Arne Vollan [WP][macOS] Add required system call https://bugs.webkit.org/show_bug.cgi?id=234129 Reviewed by Brent Fulgham. * WebProcess/com.apple.WebProcess.sb.in: 2021-12-09 Darin Adler Use simpler idioms for std::less and std::greater possible in modern C++ https://bugs.webkit.org/show_bug.cgi?id=234117 Reviewed by Anders Carlsson. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::equalizeTailGaps): Removed unneeded template arguments for std::greater, and removed explicit use of std::less, since that's what std::sort does by default. 2021-12-10 Per Arne Vollan Fix sandbox build error https://bugs.webkit.org/show_bug.cgi?id=234146 Unreviewed fix sandbox build error after r286460. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2021-12-10 Chris Dumez Unreviewed, reverting r282794. Regressed PLT5 Reverted changeset: "Avoid doing a second server pre-connect after a process-swap" https://bugs.webkit.org/show_bug.cgi?id=230517 https://commits.webkit.org/r282794 2021-12-10 Youenn Fablet REGRESSION (iOS 15): Safari loses Network access when establishing WebRTC session https://bugs.webkit.org/show_bug.cgi?id=233752 Reviewed by Geoffrey Garen. When we get an error from a UDP nw socket, we do not need to stop reading and close it. We can just log the error and continue reading as the error might get fixed later on. Not easily testable. * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: 2021-12-10 Kimmo Kinnunen IOSurface memory attribution is hard to use in constructors https://bugs.webkit.org/show_bug.cgi?id=232988 Reviewed by Chris Dumez. Remove ifdefs and direct use of task_id_token_t. Instead, use WebCore::ProcessIdentifier. This way the cross-platform code is easier to author. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): * GPUProcess/GPUConnectionToWebProcess.h: (WebKit::GPUConnectionToWebProcess::webProcessIdentity const): (WebKit::GPUConnectionToWebProcess::webProcessIdentityToken const): Deleted. * GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp: (WebKit::RemoteGraphicsContextGLCocoa::RemoteGraphicsContextGLCocoa): (WebKit::RemoteGraphicsContextGLCocoa::platformWorkQueueInitialize): (WebKit::RemoteGraphicsContextGLCocoa::prepareForDisplay): * GPUProcess/graphics/RemoteImageBuffer.h: (WebKit::RemoteImageBuffer::setOwnershipIdentity): (WebKit::RemoteImageBuffer::setProcessOwnership): Deleted. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::RemoteRenderingBackend): (WebKit::RemoteRenderingBackend::createImageBufferWithQualifiedIdentifier): * GPUProcess/graphics/RemoteRenderingBackend.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: (WebKit::Function Non-unified build fixes, mid December 2021 edition https://bugs.webkit.org/show_bug.cgi?id=234106 Unreviewed non-unified build fixes. * NetworkProcess/storage/OriginStorageManager.cpp: Add missing WebsiteDataType.h and wtf/FileSystem.h headers. 2021-12-09 Simon Fraser Inspector "composite" events are all very short https://bugs.webkit.org/show_bug.cgi?id=234114 Reviewed by Tim Horton. The kCATransactionPhasePreCommit callbacks fire after painting, but we want the composite time to include painting so use kCATransactionPhasePreLayout. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::addCommitHandlers): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::addCommitHandlers): 2021-12-09 Aditya Keerthi Fix the tvOS and watchOS builds after r286641 https://bugs.webkit.org/show_bug.cgi?id=234124 Unreviewed build fix. * UIProcess/API/Cocoa/WKWebViewPrivate.h: WKWebView does not conform to the protocol on watchOS/tvOS. 2021-12-09 Ryan Haddad Add ability to inject messages into webpushd https://bugs.webkit.org/show_bug.cgi?id=233988 Unreviewed attempt to fix some builds. * Configurations/webpushtool.xcconfig: 2021-12-09 Wenson Hsieh Add a new WKWebpagePreferences SPI for modal container observation policies https://bugs.webkit.org/show_bug.cgi?id=234013 rdar://86219613 Reviewed by Brent Fulgham. Add a new website policy flag `ModalContainerObservationPolicy`, and expose it as SPI on WKWebpagePreferences. Refer to rdar://86219613 for additional details. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::copy const): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (WebKit::modalContainerObservationPolicy): (WebKit::coreModalContainerObservationPolicy): (-[WKWebpagePreferences _setModalContainerObservationPolicy:]): (-[WKWebpagePreferences _modalContainerObservationPolicy]): * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: 2021-12-09 Jigen Zhou [Playstation] Fix build break after r286751 with INTELLIGENT_TRACKING_PREVENTION enabled https://bugs.webkit.org/show_bug.cgi?id=234095 Reviewed by Darin Adler. Added a forward declaration of class ResourceError to NetworkSession.h to resolve a compiling error. No new test is need since no behavior change is expected. * NetworkProcess/NetworkSession.h: 2021-12-09 Devin Rousso Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting https://bugs.webkit.org/show_bug.cgi?id=233939 Reviewed by Wenson Hsieh. Implementing `-pasteFont:` requires that we read from the font pasteboard instead of the general pasteboard. In order to allow web content to trigger this (e.g. `document.execCommand("PasteFont"))`) we must have a way for the WebProcess to signal that it wishes to read from the font pasteboard instead of the general pasteboard. As such, create and pass along a `DOMPasteAccessCategory` to `requestDOMPasteAccess`. No change in behavior. * Scripts/webkit/messages.py: (headers_for_type): Indicate which header is associated with `DOMPasteAccessCategory`. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (-[WKDOMPasteMenuDelegate initWithWebViewImpl:pasteAccessCategory:]): Added. (-[WKDOMPasteMenuDelegate menuDidClose:]): (-[WKDOMPasteMenuDelegate _web_grantDOMPasteAccess]): Added. (WebKit::WebViewImpl::handleProcessSwapOrExit): (WebKit::pasteboardNameForAccessCategory): Added. (WebKit::pasteboardForAccessCategory): Added. (WebKit::WebViewImpl::requestDOMPasteAccess): (WebKit::WebViewImpl::handleDOMPasteRequestForCategoryWithResult): (WebKit::WebViewImpl::hideDOMPasteMenuWithResult): Added. (-[WKDOMPasteMenuDelegate initWithWebViewImpl:]): Deleted. (WebKit::WebViewImpl::handleDOMPasteRequestWithResult): Deleted. * UIProcess/API/mac/WKView.mm: (-[WKView _web_grantDOMPasteAccess]): Deleted. * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _web_grantDOMPasteAccess]): Deleted. Pass the `DOMPasteAccessCategory` to the `WKDOMPasteMenuDelegate` and use it as the `target` of the `NSMenuItem` so that we can pass along the `DOMPasteAccessCategory` in the `action`. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (pasteboardNameForAccessCategory): Added. (pasteboardForAccessCategory): Added. (-[WKContentView _handleDOMPasteRequestWithResult:]): (-[WKContentView _requestDOMPasteAccessForCategory:elementRect:originIdentifier:completionHandler:]): Added. (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]): Deleted. * UIProcess/PageClient.h: * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/playstation/PageClientImpl.h: * UIProcess/playstation/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/win/PageClientImpl.h: * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::requestDOMPasteAccess): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::requestDOMPasteAccess): Pass along the `DOMPasteAccessCategory`. * UIProcess/WebPageProxy.messages.in: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::pasteAccessCategoryForCommand): Added. (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::requestDOMPasteAccess): (WebKit::WebPageProxy::willPerformPasteCommand): (WebKit::isPasteCommandName): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::willPerformPasteCommand): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::willPerformPasteCommand) Create a mapping between paste command name and `DOMPasteAccessCategory`. 2021-12-09 Said Abou-Hallawa [GPU Process] [Filters] Add the encoding and decoding for FEImage https://bugs.webkit.org/show_bug.cgi?id=234099 Reviewed by Wenson Hsieh. Add the support to encode and decode the FEImage through FilterReference. The RenderingResourceIdentifier of the Image or the ImageBuffer will be used while encoding and decoding the FEImage. Resolving the decoded RenderingResourceIdentifier back to an Image or ImageBuffer will happen in RemoteDisplayListRecorder::drawFilteredImageBuffer). * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::drawFilteredImageBuffer): * Platform/IPC/FilterReference.h: (IPC::FilterReference::encodeFilterEffect): (IPC::FilterReference::decodeFilterEffect): 2021-12-09 Aditya Keerthi [iOS] Add SPI to enable find interactions on WKWebView https://bugs.webkit.org/show_bug.cgi?id=234017 rdar://86140542 Reviewed by Wenson Hsieh. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _findInteractionEnabled]): (-[WKWebView _setFindInteractionEnabled:]): Make the contentView the searchableObject, rather than self (the WKWebView) to avoid a retain cycle. (-[WKWebView _findInteraction]): (-[WKWebView offsetFromPosition:toPosition:inDocument:]): (-[WKWebView decorateFoundTextRange:inDocument:usingStyle:]): * UIProcess/ios/WKContentViewInteraction.h: Make WKContentView conform to _UITextSearching so that it can be set as the interaction's searchableObject. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView decorateFoundTextRange:inDocument:usingStyle:]): (-[WKContentView offsetFromPosition:toPosition:inDocument:]): (-[WKContentView decorateFoundTextRange:usingStyle:]): Deleted. 2021-12-09 Alex Christensen Prepare for transition to C++20 https://bugs.webkit.org/show_bug.cgi?id=234022 Reviewed by Yusuke Suzuki. * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: (WebKit::MediaFormatReader::didParseTracks): * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::MediaSampleCursor::getSampleMap const): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setRequiresPageVisibilityToPlayAudio:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration setRequiresSecureHTTPSProxyConnection:]): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::setRequiresSecureHTTPSProxyConnection): 2021-12-09 Alex Christensen Use Span for IPC::ArrayReference and DataReference https://bugs.webkit.org/show_bug.cgi?id=233931 Reviewed by Wenson Hsieh. No change in behavior, just simplifying some code. * Platform/IPC/ArgumentCoders.h: * Platform/IPC/ArrayReference.h: (): Deleted. (IPC::ArrayReference::ArrayReference): Deleted. (IPC::ArrayReference::isEmpty const): Deleted. (IPC::ArrayReference::size const): Deleted. (IPC::ArrayReference::data const): Deleted. (IPC::ArrayReference::vector const): Deleted. * Platform/IPC/DataReference.h: * Platform/IPC/SharedBufferDataReference.cpp: (IPC::SharedBufferDataReference::encode const): * Shared/API/APIData.cpp: (API::Data::create): * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtension::Handle::decode): * Shared/UserData.cpp: (WebKit::UserData::decode): * Shared/cf/ArgumentCodersCF.cpp: (IPC::ArgumentCoder>::decode): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView createPDFWithConfiguration:completionHandler:]): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::createData): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::registerWebProcessAccessibilityToken): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::didPostMessage): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::loadSimulatedRequest): (WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld): (WebKit::WebPageProxy::wrapCryptoKey): (WebKit::WebPageProxy::unwrapCryptoKey): * UIProcess/ios/WKContentView.mm: (-[WKContentView _wk_pageCountForPrintFormatter:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication): * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxyFunctionsGenerated.cpp: (WebKit::RemoteGraphicsContextGLProxy::getShaderPrecisionFormat): * WebProcess/Network/WebSocketChannel.cpp: (WebKit::WebSocketChannel::didReceiveBinaryData): * WebProcess/Network/webrtc/RTCDataChannelRemoteManager.cpp: (WebKit::RTCDataChannelRemoteManager::receiveData): * WebProcess/UserContent/WebUserContentController.cpp: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::replaceSelectionWithPasteboardData): 2021-12-09 Robert Jenner Unreviewed, reverting r286754. Broke 2 tests on all mac an iOS Reverted changeset: "Add an experimental trackConfiguration accessor on AudioTrack & VideoTrack." https://bugs.webkit.org/show_bug.cgi?id=230841 https://commits.webkit.org/r286754 2021-12-09 Megan Gardner Markup Pane not displaying. https://bugs.webkit.org/show_bug.cgi?id=234089 Reviewed by Tim Horton. An optional method on NSSharingServiceDelegate was not implemented, meaning that the markup pane did not know where to present, and would assert and fail to show up. Make sure this is implemented for the image controls menu and also give it the correct location to present form. * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::encode const): (WebKit::ContextMenuContextData::decode): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::controlledImageFrame const): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * UIProcess/mac/WKSharingServicePickerDelegate.h: * UIProcess/mac/WKSharingServicePickerDelegate.mm: (-[WKSharingServicePickerDelegate setSourceFrame:]): (-[WKSharingServicePickerDelegate sharingService:sourceFrameOnScreenForShareItem:]): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleImageServiceClick): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::handleImageServiceClick): 2021-12-09 Tim Horton Momentum Generator: Scroll tail hiccup only when scrolling up on 60Hz displays https://bugs.webkit.org/show_bug.cgi?id=234104 Reviewed by Simon Fraser. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::equalizeTailGaps): Sort in the correct direction based on the sign of the first delta... 2021-12-09 Chris Dumez [WPE] Crash under WebProcessProxy::setIsInProcessCache when closing web view in debug builds https://bugs.webkit.org/show_bug.cgi?id=233933 Reviewed by Geoffrey Garen. The crash would occur because the WebProcessPool destructor would call WebProcessCache::clear() which would destroy WebProcessCache::CachedProcess objects, causing WebProcessProxy::setIsInProcessCache(false) to get called. Previously, this call to setIsInProcessCache() would convert the WeakPtr the WebProcessProxy held to its process pool into a RefPtr, thus causing the WebProcessPool to get ref'd while in the middle of destruction. To address the issue, the setIsInProcessCache() setter now takes a WillShutDown flag that gets set in the CachedProcess destructor and which causes setIsInProcessCache() to return early right after setting the m_isInProcessCache flag, without trying to send IPC to the WebProcess or trying to ref the WebProcessPool. * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::CachedProcess::~CachedProcess): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::setIsInProcessCache): * UIProcess/WebProcessProxy.h: 2021-12-08 BJ Burg [Cocoa] Web Inspector: provide a way for _WKInspectorExtension clients to be to notified when an extension tab navigates https://bugs.webkit.org/show_bug.cgi?id=233935 Reviewed by Patrick Angle. Add plumbing to notify clients when an extension tab loads. This is implemented similarly to -inspectorExtension:didShowExtensionTab: and -inspectorExtension:didHideExtensionTab:. * UIProcess/API/APIInspectorExtensionClient.h: (API::InspectorExtensionClient::didNavigateExtensionTab): * UIProcess/API/Cocoa/_WKInspectorExtensionDelegate.h: * UIProcess/Inspector/Cocoa/InspectorExtensionDelegate.h: * UIProcess/Inspector/Cocoa/InspectorExtensionDelegate.mm: (WebKit::InspectorExtensionDelegate::InspectorExtensionDelegate): (WebKit::InspectorExtensionDelegate::InspectorExtensionClient::didNavigateExtensionTab): * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.messages.in: * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.h: * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp: (WebKit::WebInspectorUIExtensionControllerProxy::didNavigateExtensionTab): * WebProcess/Inspector/RemoteWebInspectorUI.h: * WebProcess/Inspector/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::didNavigateExtensionTab): * WebProcess/Inspector/WebInspectorUI.h: * WebProcess/Inspector/WebInspectorUI.cpp: (WebKit::WebInspectorUI::didHideExtensionTab): (WebKit::WebInspectorUI::didNavigateExtensionTab): * WebProcess/Inspector/WebInspectorUIExtensionController.h: * WebProcess/Inspector/WebInspectorUIExtensionController.cpp: (WebKit::WebInspectorUIExtensionController::createTabForExtension): Standardize on returning {result: value} for showExtensionTab. (WebKit::WebInspectorUIExtensionController::showExtensionTab): Standardize on returning {result: value} for showExtensionTab. Also, there's no need to inspect the result value if it's not an error. (WebKit::WebInspectorUIExtensionController::didNavigateExtensionTab): Add plumbing. 2021-12-09 Brady Eidson Add ability to inject messages into webpushd https://bugs.webkit.org/show_bug.cgi?id=233988 Reviewed by Alex Christensen. Covered by API tests. This patch: - Adds WKWebsiteDataStore SPI to fetch pending push messages for the embedding application - Gives webpushd code to inject a push message for a given bundle identifier - Gives webpushtool the ability to send one of these fake messages - Gives webpushtool the ability to reconnect to the next daemon instance after the current connection is dropped - Tests the injection and fetching of push messages via TestWebKitAPI * Configurations/webpushtool.xcconfig: * WebKit.xcodeproj/project.pbxproj: * Resources/webpushtool.entitlements: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::getPendingPushMessages): (WebKit::NetworkProcess::processPushMessage): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::getPendingPushMessages): (WebKit::ReplyCaller::callReply): * NetworkProcess/Notifications/NetworkNotificationManager.h: * Shared/Cocoa/WebPushMessageCocoa.mm: Copied from Source/WebKit/webpushd/webpushtool/WebPushToolConnection.h. (WebKit::WebPushMessage::fromDictionary): (WebKit::WebPushMessage::toDictionary const): * Shared/PushMessageForTesting.h: Copied from Source/WebKit/Shared/WebPushDaemonConstants.h. (WebKit::WebPushD::PushMessageForTesting::encode const): (WebKit::WebPushD::PushMessageForTesting::decode): * Shared/WebPushDaemonConstants.h: (WebKit::WebPushD::messageTypeSendsReply): * Shared/WebPushMessage.h: Copied from Source/WebKit/webpushd/webpushtool/WebPushToolConnection.h. (WebKit::WebPushMessage::encode const): (WebKit::WebPushMessage::decode): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _getPendingPushMessages:]): (-[WKWebsiteDataStore _processPushMessage:completionHandler:]): (-[WKWebsiteDataStore _processPushMessage:registration:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getPendingPushMessages): (WebKit::NetworkProcessProxy::processPushMessage): * UIProcess/Network/NetworkProcessProxy.h: * webpushd/PushClientConnection.h: * webpushd/PushClientConnection.mm: (WebPushD::ClientConnection::hostAppHasPushEntitlement): (WebPushD::ClientConnection::hostAppHasPushInjectEntitlement): (WebPushD::ClientConnection::hostHasEntitlement): (WebPushD::ClientConnection::broadcastDebugMessage): * webpushd/WebPushDaemon.h: * webpushd/WebPushDaemon.mm: (WebPushD::MessageInfo::injectPushMessageForTesting::encodeReply): (WebPushD::MessageInfo::getPendingPushMessages::encodeReply): (WebPushD::Daemon::decodeAndHandleMessage): (WebPushD::Daemon::injectPushMessageForTesting): (WebPushD::Daemon::getPendingPushMessages): * webpushd/webpushtool/WebPushToolConnection.h: (WebPushTool::Connection::setPushMessage): * webpushd/webpushtool/WebPushToolConnection.mm: (WebPushTool::Connection::startAction): (WebPushTool::Connection::sendPushMessage): * webpushd/webpushtool/WebPushToolMain.mm: (printUsageAndTerminate): (pushMessageFromArguments): (main): 2021-12-09 J Pascoe [WebAuthn] Remove user gesture requirement for using platform authenticator on the web https://bugs.webkit.org/show_bug.cgi?id=230893 Reviewed by Brent Fulgham. This patch loosens the user gesture requirement around using WebAuthn with respect to user gestures by removing the Quirks.h allowlist of sites that get a freebie. Instead the new behavior is all sites get one freebie, then on subsequent attempts they show a non-modal consent dialog. * UIProcess/API/APIUIClient.h: (API::UIClient::requestWebAuthenticationNoGesture): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::requestWebAuthenticationNoGesture): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::processingUserGesture): 2021-12-09 Chris Dumez Unreviewed fix after r286778 to address WebContent crashes on launch * WebProcess/com.apple.WebProcess.sb.in: 2021-12-09 Per Arne Vollan [macOS][WP] Block access to unused system calls https://bugs.webkit.org/show_bug.cgi?id=234003 Reviewed by Brent Fulgham. Based on telemetry, block access to unused system calls in the WebContent process on macOS. * WebProcess/com.apple.WebProcess.sb.in: 2021-12-09 Commit Queue Unreviewed, reverting r286764. https://bugs.webkit.org/show_bug.cgi?id=234081 broke the build Reverted changeset: "Add ability to inject messages into webpushd" https://bugs.webkit.org/show_bug.cgi?id=233988 https://commits.webkit.org/r286764 2021-12-09 Youenn Fablet Copy ServiceWorkerNavigationPreloader error when failing its ServiceWorkerFetchTask https://bugs.webkit.org/show_bug.cgi?id=234002 Reviewed by Chris Dumez. Covered by existing tests. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: When failing a ServiceWorkerNavigationPreloader, we might delete it, so it is not safe to manage a reference to its error. Instead copy the error. 2021-12-09 Myles C. Maxfield and Don Olmstead Move TextCodec files from WebCore/platform/text to WebCore/PAL/text https://bugs.webkit.org/show_bug.cgi?id=233683 Reviewed by Yusuke Suzuki. Update to use the new PAL files. * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: * NetworkProcess/WebStorage/StorageManager.cpp: * NetworkProcess/WebStorage/StorageManagerSet.cpp: (WebKit::StorageManagerSet::StorageManagerSet): * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::suggestedFilename const): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::suggestedFilename const): * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: * UIProcess/API/glib/WebKitFileChooserRequest.cpp: (webkit_file_chooser_request_select_files): * UIProcess/API/glib/WebKitSettings.cpp: * UIProcess/Inspector/WebInspectorUIProxy.cpp: (WebKit::WebInspectorUIProxy::isMainOrTestInspectorPage): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): 2021-12-09 Carlos Garcia Campos Unreviewed. Fix GTK build. WebKitBuild/Release/WTF/Headers/wtf/persistence/PersistentCoder.h:40:11: error: ‘const class WTF::String’ has no member named ‘encode’ 40 | t.encode(encoder); | ~~^~~~~~ * NetworkProcess/storage/NetworkStorageManager.cpp: Include wtf/persistence/PersistentCoders.h 2021-12-09 Myles C. Maxfield [WebGPU] [MacCatalyst] Fix WebGPU Mac Catalyst build in Apple's internal build system https://bugs.webkit.org/show_bug.cgi?id=234072 Unreviewed. No new tests because there is no behavior change. * Configurations/BaseTarget.xcconfig: 2021-12-09 Myles C. Maxfield [WebGPU] Fix WebGPU build in Apple's internal build system https://bugs.webkit.org/show_bug.cgi?id=234070 Unreviewed. The PAL headers get put in a different place. No new tests because there is no behavior change. * Configurations/BaseTarget.xcconfig: 2021-12-09 Carlos Garcia Campos [GTK][a11y] Ensure atspi wrappers have root set at construction time https://bugs.webkit.org/show_bug.cgi?id=233804 Reviewed by Joanmarie Diggs. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKAccessibilityRootObject): Remove ATSPI specific code. (WKAccessibilityFocusedObject): Ditto. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::accessibilityRootObject const): Deleted. 2021-12-08 Brady Eidson Add ability to inject messages into webpushd https://bugs.webkit.org/show_bug.cgi?id=233988 Reviewed by Alex Christensen. Covered by API tests. This patch: - Adds WKWebsiteDataStore SPI to fetch pending push messages for the embedding application - Gives webpushd code to inject a push message for a given bundle identifier - Gives webpushtool the ability to send one of these fake messages - Gives webpushtool the ability to reconnect to the next daemon instance after the current connection is dropped - Tests the injection and fetching of push messages via TestWebKitAPI * Configurations/webpushtool.xcconfig: * WebKit.xcodeproj/project.pbxproj: * Resources/webpushtool.entitlements: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::getPendingPushMessages): (WebKit::NetworkProcess::processPushMessage): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::getPendingPushMessages): (WebKit::ReplyCaller::callReply): * NetworkProcess/Notifications/NetworkNotificationManager.h: * Shared/Cocoa/WebPushMessageCocoa.mm: Copied from Source/WebKit/webpushd/webpushtool/WebPushToolConnection.h. (WebKit::WebPushMessage::fromDictionary): (WebKit::WebPushMessage::toDictionary const): * Shared/PushMessageForTesting.h: Copied from Source/WebKit/Shared/WebPushDaemonConstants.h. (WebKit::WebPushD::PushMessageForTesting::encode const): (WebKit::WebPushD::PushMessageForTesting::decode): * Shared/WebPushDaemonConstants.h: (WebKit::WebPushD::messageTypeSendsReply): * Shared/WebPushMessage.h: Copied from Source/WebKit/webpushd/webpushtool/WebPushToolConnection.h. (WebKit::WebPushMessage::encode const): (WebKit::WebPushMessage::decode): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _getPendingPushMessages:]): (-[WKWebsiteDataStore _processPushMessage:completionHandler:]): (-[WKWebsiteDataStore _processPushMessage:registration:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getPendingPushMessages): (WebKit::NetworkProcessProxy::processPushMessage): * UIProcess/Network/NetworkProcessProxy.h: \ * webpushd/PushClientConnection.h: * webpushd/PushClientConnection.mm: (WebPushD::ClientConnection::hostAppHasPushEntitlement): (WebPushD::ClientConnection::hostAppHasPushInjectEntitlement): (WebPushD::ClientConnection::hostHasEntitlement): (WebPushD::ClientConnection::broadcastDebugMessage): * webpushd/WebPushDaemon.h: * webpushd/WebPushDaemon.mm: (WebPushD::MessageInfo::injectPushMessageForTesting::encodeReply): (WebPushD::MessageInfo::getPendingPushMessages::encodeReply): (WebPushD::Daemon::decodeAndHandleMessage): (WebPushD::Daemon::injectPushMessageForTesting): (WebPushD::Daemon::getPendingPushMessages): * webpushd/webpushtool/WebPushToolConnection.h: (WebPushTool::Connection::setPushMessage): * webpushd/webpushtool/WebPushToolConnection.mm: (WebPushTool::Connection::startAction): (WebPushTool::Connection::sendPushMessage): * webpushd/webpushtool/WebPushToolMain.mm: (printUsageAndTerminate): (pushMessageFromArguments): (main): 2021-12-08 Megan Gardner Show correct content menu for images services chevron. https://bugs.webkit.org/show_bug.cgi?id=233970 Reviewed by Tim Horton. Add support for showing the correct context menu for image services. Since this is internal only and can never be affected by web content, we bypass the web content round trip and directly message the UIProcess about showing a context menu for images. And because it would be bizarre if the web content could prevent a menu from popping up on a button they have no control over. * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::m_selectionIsEditable): (WebKit::ContextMenuContextData::setImage): (WebKit::ContextMenuContextData::controlledDataIsEditable const): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::webHitTestResultData): (WebKit::ContextMenuContextData::webHitTestResultData const): * UIProcess/WebContextMenuProxy.cpp: (WebKit::WebContextMenuProxy::show): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contextMenuItemSelected): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::getShareMenuItem): (WebKit::WebContextMenuProxyMac::getContextMenuFromItems): (WebKit::WebContextMenuProxyMac::useContextMenuItems): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::handleContextMenuQuickLookImage): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleImageServiceClick): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::handleImageServiceClick): 2021-12-08 Kyle Piddington [MacCatalyst] Update header search paths for ANGLE Catalyst https://bugs.webkit.org/show_bug.cgi?id=233996 For iOSMac builds, search for ANGLE public headers inside System/iOSSupport Reviewed by Dean Jackson. * Configurations/BaseTarget.xcconfig: 2021-12-08 Jer Noble Add an experimental trackConfiguration accessor on AudioTrack & VideoTrack. https://bugs.webkit.org/show_bug.cgi?id=230841 Reviewed by Eric Carlson. * GPUProcess/media/RemoteAudioTrackProxy.cpp: (WebKit::RemoteAudioTrackProxy::configuration): * GPUProcess/media/RemoteAudioTrackProxy.h: * GPUProcess/media/RemoteVideoTrackProxy.cpp: (WebKit::RemoteVideoTrackProxy::configuration): (WebKit::RemoteVideoTrackProxy::updateConfiguration): (WebKit::RemoteVideoTrackProxy::selectedChanged): (WebKit::RemoteVideoTrackProxy::idChanged): (WebKit::RemoteVideoTrackProxy::labelChanged): (WebKit::RemoteVideoTrackProxy::languageChanged): (WebKit::RemoteVideoTrackProxy::configurationChanged): Deleted. * GPUProcess/media/RemoteVideoTrackProxy.h: * GPUProcess/media/TrackPrivateRemoteConfiguration.h: (WebKit::TrackPrivateRemoteConfiguration::encode const): (WebKit::TrackPrivateRemoteConfiguration::decode): * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp: (WebKit::AudioTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/AudioTrackPrivateRemote.h: * WebProcess/GPU/media/VideoTrackPrivateRemote.cpp: (WebKit::VideoTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/VideoTrackPrivateRemote.h: 2021-12-08 Said Abou-Hallawa [GPU Process] [Filters] Add the encoding and decoding for SVGFilter https://bugs.webkit.org/show_bug.cgi?id=234024 Reviewed by Wenson Hsieh. When encoding the SVGFilter we need to encode the individual FilterEffects in filter.expression(). And for every SVGFilterExpressionTerm we need to encode the index of its Ref in the individual FilterEffects. When decoding the SVGFilter we do the opposite. We get the Ref which corresponds to index of ExpressionReferenceTerm. We send the decoded expression to the constructor of SVGFilter. * Platform/IPC/FilterReference.h: (IPC::FilterReference::decodeFilterEffect): (IPC::FilterReference::ExpressionReferenceTerm::encode const): (IPC::FilterReference::ExpressionReferenceTerm::decode): (IPC::FilterReference::encodeSVGFilter): (IPC::FilterReference::decodeSVGFilter): 2021-12-08 Alex Christensen Add SPI to load a resource in the context of a page https://bugs.webkit.org/show_bug.cgi?id=233908 Reviewed by Tim Horton. This is similar to startDownloadUsingRequest but you don't have to get the data from the disk. This is similar to NSURLSession's dataTaskWithRequest:completionHandler: but using the same session as the page. This is needed because LinkPresentation is currently using _getMainResourceDataWithCompletionHandler after loading in a WKWebView made with _relatedWebView to get the content of a resource, and that's awful and limited to certain mime types. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::requestResource): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::requestResource): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::requestResource): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestResource:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::requestResource): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestResource): * UIProcess/WebPageProxy.h: 2021-12-08 BJ Burg Web Inspector: evaluateScriptForExtension() incorrectly unwraps internal errors, causing an ASSERT https://bugs.webkit.org/show_bug.cgi?id=233961 Reviewed by Patrick Angle. Standardize the unwrapping code based on the evaluateScriptInExtensionTab version, which correctly handles the case where an internal error is returned by the evaluation. This happens, for example, when NotImplemented is returned for unsupported evaluation options. This particular issue was caused by a lack of support for the 'frameURL' option. The fix for that is tracked by https://webkit.org/b/222568/. * WebProcess/Inspector/WebInspectorUIExtensionController.cpp: (WebKit::WebInspectorUIExtensionController::evaluateScriptForExtension): 2021-12-08 J Pascoe [WebAuthn] Consider support for the displayName for FIDO authenticator https://bugs.webkit.org/show_bug.cgi?id=233389 rdar://84938707 Reviewed by Brent Fulgham. Start storing the displayName field with the platform authenticator and add them to the getAllLocalAuthenticatorCredentials SPI. The displayName is part of the WebAuthn level 2 spec: https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialuserentity-displayname * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (getAllLocalAuthenticatorCredentialsImpl): * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification): 2021-12-08 Truitt Savell Unreviewed, reverting r286596. broke 2 tests on iOS Reverted changeset: "Cocoa WebGL should support UI side compositing" https://bugs.webkit.org/show_bug.cgi?id=231009 https://commits.webkit.org/r286596 2021-12-08 Truitt Savell Unreviewed, reverting r286632. Broke 3 tests on iOS Reverted changeset: "Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting" https://bugs.webkit.org/show_bug.cgi?id=233939 https://commits.webkit.org/r286632 2021-12-08 Per Arne Vollan [iOS][WP] Block unused sys calls https://bugs.webkit.org/show_bug.cgi?id=233999 Reviewed by Brent Fulgham. Block sys calls in the WebContent process on iOS that are unused according to telemetry. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-12-08 Tim Horton Momentum Event Dispatcher: Momentum tail should have montonically decreasing deltas and tail gaps https://bugs.webkit.org/show_bug.cgi?id=233993 Reviewed by Simon Fraser. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime): (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta): (WebKit::MomentumEventDispatcher::computeNextDelta): In order to avoid visual stutter due to integral rounding of the deltas we dispatch in the momentum phase, switch to a table of deltas instead of interpolating along the offset curve during the tail end of the animation (when the rounding makes up a large proportion of each delta). (WebKit::MomentumEventDispatcher::equalizeTailGaps): Sort the deltas up until the first zero to ensure a lack of unexpected perceptual acceleration, and then inject skipped frames in order to ensure that frames that have effective scroll movement (non-zero deltas) are always spaced equally-or-further apart than earlier ones, but never closer together (which, again, would be percieved as acceleration). (WebKit::MomentumEventDispatcher::handleWheelEvent): (WebKit::MomentumEventDispatcher::pushLogEntry): (WebKit::MomentumEventDispatcher::flushLog): Lastly, adjust some logging to make it easier to tell which row in the output corresponds to an event delta or generated delta, so it's easier to find skipped frames. * WebProcess/WebPage/MomentumEventDispatcher.h: 2021-12-08 Chris Dumez Make KVO work for WKWebpagePreferences._captivePortalModeEnabled https://bugs.webkit.org/show_bug.cgi?id=233954 Reviewed by Alex Christensen. Make KVO work for WKWebpagePreferences._captivePortalModeEnabled so that the client can observe when the system setting changes. Also add SPI to simulate a change of the system setting so that I can write API tests. * UIProcess/API/Cocoa/WKProcessPool.mm: (+[WKProcessPool _setCaptivePortalModeEnabledGloballyForTesting:]): (+[WKProcessPool _clearCaptivePortalModeEnabledGloballyForTesting]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (-[WKWebpagePreferences init]): (-[WKWebpagePreferences _setCaptivePortalModeEnabled:]): * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h: * UIProcess/CaptivePortalModeObserver.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h. (WebKit::CaptivePortalModeObserver::~CaptivePortalModeObserver): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::captivePortalModeObservers): (WebKit::isCaptivePortalModeEnabledGloballyForTesting): (WebKit::isCaptivePortalModeEnabledBySystemIgnoringCaching): (WebKit::WebProcessPool::captivePortalModeStateChanged): (WebKit::addCaptivePortalModeObserver): (WebKit::removeCaptivePortalModeObserver): (WebKit::captivePortalModeEnabledBySystem): (WebKit::setCaptivePortalModeEnabledGloballyForTesting): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): * UIProcess/WebProcessPool.cpp: (WebKit::addCaptivePortalModeObserver): (WebKit::removeCaptivePortalModeObserver): (WebKit::setCaptivePortalModeEnabledGloballyForTesting): * UIProcess/WebProcessPool.h: * WebKit.xcodeproj/project.pbxproj: 2021-12-08 Aditya Keerthi [iOS] Add support for _UITextSearchOptions when finding a string https://bugs.webkit.org/show_bug.cgi?id=233957 rdar://86140673 Reviewed by Wenson Hsieh. Add support for case-insensitive, full-word, and prefix matching. * Shared/WebFindOptions.h: Introduce AtWordEnds at the WebKit layer to support full-word matching when used with AtWordStarts. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView performTextSearchWithQueryString:usingOptions:resultAggregator:]): * WebProcess/WebPage/FindController.cpp: (WebKit::core): 2021-12-08 Wenson Hsieh Add a missing CompletionHandlerCallChecker around a UI delegate method call after r286640 https://bugs.webkit.org/show_bug.cgi?id=233890 rdar://86117718 Reviewed by Dan Bernstein. Create and pass a `CompletionHandlerCallChecker` through the new delegate call to `-_webView:requestCookieConsentWithMoreInfoHandler:decisionHandler:` added in r286640. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::requestCookieConsent): 2021-12-08 Youenn Fablet Same-site lax cookies not sent by fetch event handler after page reload https://bugs.webkit.org/show_bug.cgi?id=226386 Reviewed by Chris Dumez. StorageBlockingPolicy handling is not covered by generated code so explicit update StorageBlockingPolicy setting from preference store. This impacts the computation of cookie/cache partitioning. * WebProcess/Storage/WebSWContextManagerConnection.cpp: 2021-12-08 Youenn Fablet Let RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit switch to VPIO unit if VPIO is running https://bugs.webkit.org/show_bug.cgi?id=233316 Reviewed by Eric Carlson. We track which process is the last to start audio capture. In that case, we register its RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit to the capture unit. This allows RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit to switch between RemoteIO if capture unit does not run or the capture unit if running. This allows to remove the x5 gain workaround. * GPUProcess/GPUConnectionToWebProcess.cpp: * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUProcess.cpp: * GPUProcess/GPUProcess.h: * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.cpp: * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: 2021-12-08 Myles C. Maxfield [MacCatalyst] Various build fixes https://bugs.webkit.org/show_bug.cgi?id=233995 Unreviewed. * UIProcess/WebPageProxy.cpp: (WebKit::mediaRelatedMachServices): 2021-12-07 Aditya Keerthi [iOS] Add initial support for find-in-page SPI https://bugs.webkit.org/show_bug.cgi?id=233915 rdar://86140501 Reviewed by Wenson Hsieh. Expose new find-in-page SPI for use by clients. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView selectedTextRange]): (-[WKWebView offsetFromPosition:toPosition:inDocument:]): (-[WKWebView performTextSearchWithQueryString:usingOptions:resultAggregator:]): (-[WKWebView decorateFoundTextRange:inDocument:usingStyle:]): (-[WKWebView clearAllDecoratedFoundText]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::findRectsForStringMatches): (WebKit::WebPageProxy::hideFindIndicator): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView offsetFromPosition:toPosition:]): The implementation here is needed to determine the relative ordering of two search results. (-[WKContentView performTextSearchWithQueryString:usingOptions:resultAggregator:]): Call into the WebProcess to perform the search, and asynchronously mark the search as complete. A search result is represented as a WKFoundTextRange, and contains two pieces of information. 1. A rect – so that clients can determine whether or not the result is visible. 2. An index – to allow for highlighting of a result and to enable determining relative ordering between two results. (-[WKContentView decorateFoundTextRange:usingStyle:]): (-[WKContentView clearAllDecoratedFoundText]): (+[WKFoundTextRange foundTextRangeWithRect:index:]): (-[WKFoundTextRange start]): (-[WKFoundTextRange end]): (-[WKFoundTextRange isEmpty]): (+[WKFoundTextPosition textPositionWithIndex:]): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::findString): Prevent Editor from revealing the selection on all platforms, as the existing call to didFindString is now responsible for revealing selection on all platforms. (WebKit::FindController::findRectsForStringMatches): Gather rects for all search results and return them to the UIProcess. (WebKit::FindController::indicateFindMatch): This method was previously unused on iOS, and required some changes to work correctly. Wrap the call to select the current match with calls to {will|did}FindString to account for iOS specific selection behavior. See the existing comment in didFindString for more details. No behavior change on other platforms, since willFindString is empty, and didFindString now reveals the selection. (WebKit::FindController::didFindString): * WebProcess/WebPage/FindController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::findRectsForStringMatches): (WebKit::WebPage::hideFindIndicator): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Added two new WebPage messages. 1. findRectsForStringMatches returns an vector of string match rects for use in the UIProcess. 2. Expose hideFindIndicator via IPC so that the UIProcess can hide the indicator without dismissing the overlay entirely. 2021-12-07 Wenson Hsieh Add support for `navigator.requestCookieConsent()` behind a disabled feature flag https://bugs.webkit.org/show_bug.cgi?id=233890 rdar://86117718 Reviewed by Darin Adler. Add plumbing for an async `requestCookieConsent()` method on ChromeClient that plumbs through the WebKit2 client layer, into a new private (for the time being) UI delegate method. If the new delegate method is not implemented (or there is no UI delegate at all), we immediately invoke the decision handler with a result of `NotSupported`, allowing us to reject the promise with a `NotSupportedError`. See WebCore ChangeLog for more details. * UIProcess/API/APIUIClient.h: (API::UIClient::requestCookieConsent): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::requestCookieConsent): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestCookieConsent): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestCookieConsent): * WebProcess/WebCoreSupport/WebChromeClient.h: 2021-12-07 Devin Rousso Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting https://bugs.webkit.org/show_bug.cgi?id=233939 Reviewed by Wenson Hsieh. Implementing `-pasteFont:` requires that we read from the font pasteboard instead of the general pasteboard. In order to allow web content to trigger this (e.g. `document.execCommand("PasteFont"))`) we must have a way for the WebProcess to signal that it wishes to read from the font pasteboard instead of the general pasteboard. As such, create and pass along a `DOMPasteAccessCategory` to `requestDOMPasteAccess`. No change in behavior. * Scripts/webkit/messages.py: (headers_for_type): Indicate which header is associated with `DOMPasteAccessCategory`. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (-[WKDOMPasteMenuDelegate initWithWebViewImpl:pasteAccessCategory:]): Added. (-[WKDOMPasteMenuDelegate menuDidClose:]): (-[WKDOMPasteMenuDelegate _web_grantDOMPasteAccess]): Added. (WebKit::WebViewImpl::handleProcessSwapOrExit): (WebKit::pasteboardNameForAccessCategory): Added. (WebKit::pasteboardForAccessCategory): Added. (WebKit::WebViewImpl::requestDOMPasteAccess): (WebKit::WebViewImpl::handleDOMPasteRequestForCategoryWithResult): (WebKit::WebViewImpl::hideDOMPasteMenuWithResult): Added. (-[WKDOMPasteMenuDelegate initWithWebViewImpl:]): Deleted. (WebKit::WebViewImpl::handleDOMPasteRequestWithResult): Deleted. * UIProcess/API/mac/WKView.mm: (-[WKView _web_grantDOMPasteAccess]): Deleted. * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _web_grantDOMPasteAccess]): Deleted. Pass the `DOMPasteAccessCategory` to the `WKDOMPasteMenuDelegate` and use it as the `target` of the `NSMenuItem` so that we can pass along the `DOMPasteAccessCategory` in the `action`. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanUpInteraction]): (-[WKContentView resignFirstResponderForWebView]): (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _willHideMenu:]): (-[WKContentView pasteForWebView:]): (pasteboardNameForAccessCategory): Added. (pasteboardForAccessCategory): Added. (-[WKContentView _hidePasteMenuWithResult:]): Added. (-[WKContentView _handleDOMPasteRequestForCategory:result:]): Added. (-[WKContentView _willPerformAction:sender:]): (-[WKContentView _didPerformAction:sender:]): (-[WKContentView handleKeyWebEvent:withCompletionHandler:]): (-[WKContentView _requestDOMPasteAccessForCategory:elementRect:originIdentifier:completionHandler:]): Added. (-[WKContentView _handleDOMPasteRequestWithResult:]): Deleted. (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]): Deleted. * UIProcess/PageClient.h: * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/playstation/PageClientImpl.h: * UIProcess/playstation/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/win/PageClientImpl.h: * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::requestDOMPasteAccess): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::requestDOMPasteAccess): Pass along the `DOMPasteAccessCategory`. * UIProcess/WebPageProxy.messages.in: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::pasteAccessCategoryForCommand): Added. (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::requestDOMPasteAccess): (WebKit::WebPageProxy::willPerformPasteCommand): (WebKit::isPasteCommandName): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::willPerformPasteCommand): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::willPerformPasteCommand) Create a mapping between paste command name and `DOMPasteAccessCategory`. 2021-12-07 Simon Fraser [Scroll Momentum Generator] Pages lose ability to momentum scroll after dragging between displays https://bugs.webkit.org/show_bug.cgi?id=233948 rdar://86110813 Reviewed by Tim Horton. This is a conservative fix for the bug. When a view moves to a new screen, WebPageProxy needs to unregister for full speed updates using the old displayID, and register using the new one. Longer term, it would be better if "full speed updates" was a per-observer concept, but that would mean registering an observer while wheel events are being received, which needs a bit more thought. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::windowScreenDidChange): 2021-12-07 Cameron McCormack Move FontCache singleton and instance on WorkerGlobalScope to ThreadGlobalData https://bugs.webkit.org/show_bug.cgi?id=233747 Reviewed by Darin Adler. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::terminate): Update existing main threa callers of FontCache::singleton() to use FontCache::forCurrentThread(). 2021-12-07 Ben Nham webpushd should run with regular user permissions https://bugs.webkit.org/show_bug.cgi?id=233844 Reviewed by Brady Eidson. Currently webpushd runs as root, which is unneessary. This patch makes it so that we run with regular user permissions. This is done by specifying a UserName in the launchd plist on iOS and by installing the plist to /System/Library/LaunchAgents on Mac. Since the plists now differ based on platform, I changed the "Copy Daemon Plists" build phase in the WebKit target to copy the appropriate plist to either /S/L/LaunchDaemons or /S/L/LaunchAgents. Additionally, webpushd needs the `aps-connection-initiate` or `com.apple.private.aps-connection-initiate` to receive pushes from apsd on iOS and Mac respectively, so I gave the daemon those entitlements. Finally, webpushd now registers for the `com.apple.aps.webkit.webpushd.incoming-push` Mach service so that it can be launched on demand in response to a push. Right now we just `bootstrap_check_in` to the service at launch time, but eventually we'll remove that and use APSConnection to check in to the service instead. Since the `bootstrap_check_in` call is temporary, I chose not to make a header file in wtf/spi and declared the prototype in the implementation file instead. * Configurations/webpushd.xcconfig: * Scripts/process-entitlements.sh: * WebKit.xcodeproj/project.pbxproj: * webpushd/WebPushDaemonMain.mm: (WebKit::WebPushDaemonMain): * webpushd/com.apple.webkit.webpushd.ios.plist: Added. * webpushd/com.apple.webkit.webpushd.mac.plist: Added. * webpushd/com.apple.webkit.webpushd.plist: Removed. 2021-12-07 Chris Dumez ASSERTION FAILED: m_messagesBeingDispatched.isEmpty() on http/tests/resourceLoadStatistics/website-data-removal-for-site-with-user-interaction.html https://bugs.webkit.org/show_bug.cgi?id=228164 Reviewed by Darin Adler. dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() has an assertion to make sure that m_messagesBeingDispatched was empty when getting called. However, in the case where there is a nested run loop, the call to `m_messagesBeingDispatched.takeFirst().dispatch()` at the end of the function may cause the function to re-enter. When entering, m_messagesBeingDispatched may not be empty so the assertion is wrong. Looking at the code, I think dropping the assertion is the right thing to do as the implementation seems to be doing something sane upon re-entering. It will just append new messages to m_messagesBeingDispatched and then try and dispatch them. Based on how it is implemented, message ordering would be preserved. No new tests, unskipped existing test. * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection): 2021-12-07 Chris Dumez Make WebLockRegistryProxy::processDidExit() return early if process never registered any locks https://bugs.webkit.org/show_bug.cgi?id=233832 Reviewed by Darin Adler. Make WebLockRegistryProxy::processDidExit() return early if process never registered any locks. This avoids calling LocalWebLockRegistry::clientsAreGoingAway() (which can be expensive) in the case we know for sure no locks were registered by this process. * UIProcess/WebLockRegistryProxy.cpp: (WebKit::WebLockRegistryProxy::requestLock): (WebKit::WebLockRegistryProxy::processDidExit): * UIProcess/WebLockRegistryProxy.h: 2021-12-07 Chris Dumez Reload web views when toggling the captive portal mode at system level https://bugs.webkit.org/show_bug.cgi?id=233900 Reviewed by Brent Fulgham. Reload web views when toggling the captive portal mode at system level, so that the views end up being backed by WebProcesses with the proper captive portal mode. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::cachedCaptivePortalModeEnabledGlobally): (WebKit::WebProcessPool::captivePortalModeStateChanged): (WebKit::captivePortalModeEnabledBySystem): (WebKit::WebProcessPool::notifyPreferencesChanged): * UIProcess/WebProcessPool.h: 2021-12-07 Sihui Liu Fetch and remove file system data via WKWebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=233567 Reviewed by Youenn Fablet. Introduce a new WebsiteDataType value FileSystem for FileSystemAccess data. Network process now can fetch and delete this type of data when fetching and deleteing website data (if FileSystem type is included in target types). To track origins that have FileSystem data, this patch introduces a new file named origin in the origin's directory. This file will be created when OriginStorageManager is created. To delete existing FileSystem data, network process finds origins that are requested to be deleted and have data on disk, closes active access handles, and deletes the files. The origin file mentioned above will be deleted if there is no other file left in the same directory, and empty directories will be deleted. New API tests: FileSystemAccess.FetchAndRemoveData FileSystemAccess.RemoveDataByModificationTime FileSystemAccess.FetchDataForThirdParty * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): * NetworkProcess/storage/FileSystemStorageHandle.h: (WebKit::FileSystemStorageHandle::activeSyncAccessHandle const): * NetworkProcess/storage/FileSystemStorageManager.cpp: (WebKit::FileSystemStorageManager::~FileSystemStorageManager): (WebKit::FileSystemStorageManager::close): * NetworkProcess/storage/FileSystemStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::readOriginFromFile): (WebKit::writeOriginToFileIfNecessary): (WebKit::deleteOriginFileIfNecessary): (WebKit::originDirectoryPath): (WebKit::originFilePath): (WebKit::NetworkStorageManager::localOriginStorageManager): (WebKit::NetworkStorageManager::removeOriginStorageManagerIfPossible): (WebKit::NetworkStorageManager::persist): (WebKit::NetworkStorageManager::clearStorageForTesting): Only reset persisted state here as our test bot can run tests in parallel. If one worker finishes a test and asks to clear storage, while another worker is running a filesystem test; the test may fail as data is gone. (The workers are using the same network process.) (WebKit::toWebsiteDataType): (WebKit::NetworkStorageManager::forEachOriginDirectory): (WebKit::NetworkStorageManager::fetchDataFromDisk): (WebKit::NetworkStorageManager::fetchData): (WebKit::NetworkStorageManager::deleteDataOnDisk): (WebKit::NetworkStorageManager::deleteData): (WebKit::NetworkStorageManager::deleteDataModifiedSince): (WebKit::NetworkStorageManager::deleteDataForRegistrableDomains): (WebKit::originPath): Deleted. * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::StorageBucket::toStorageIdentifier): (WebKit::OriginStorageManager::StorageBucket::typeStoragePath const): (WebKit::OriginStorageManager::StorageBucket::fileSystemStorageManager): (WebKit::OriginStorageManager::StorageBucket::isActive): (WebKit::OriginStorageManager::StorageBucket::deleteData): (WebKit::OriginStorageManager::StorageBucket::deleteFileSystemStorageData): (WebKit::OriginStorageManager::OriginStorageManager): (WebKit::OriginStorageManager::fileSystemStorageManager): (WebKit::OriginStorageManager::isActive): (WebKit::OriginStorageManager::deleteData): (WebKit::OriginStorageManager::setPersisted): (WebKit::OriginStorageManager::persist): Deleted. * NetworkProcess/storage/OriginStorageManager.h: * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::ownerProcess): * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.messages.in: Added. 2021-12-07 Kimmo Kinnunen Cocoa WebGL should support UI side compositing https://bugs.webkit.org/show_bug.cgi?id=231009 Reviewed by Simon Fraser. Implement the capability to assign IOSurfaces to PlatformCALayerRemote contents. Make RemoteGraphicsContextGLProxyCocoa use the added GraphicsLayerContentsDisplayDelegate. * GPUProcess/graphics/GPUProcessGraphicsContextGL.h: * GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp: (WebKit::RemoteGraphicsContextGLCocoa::prepareForDisplay): * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: (WebKit::RemoteLayerBackingStore::hasFrontBuffer const): * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::clearBackingStore): (WebKit::RemoteLayerBackingStore::encode const): (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): (WebKit::RemoteLayerBackingStore::setContents): (WebKit::RemoteLayerBackingStore::display): Change the contract of what RemoteLayerBackingStore serializes to the transaction. Before, it serialized the front buffer. After, it serializes the m_bufferHandle. The buffer handle is produced by display() phase either by delegated display setting the contents or drawing to front buffer and then assigning the front buffer handle. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::description const): * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm: (WebKit::RemoteGraphicsContextGLProxy::create): * WebProcess/GPU/graphics/wc/RemoteGraphicsContextGLProxyWC.cpp: (WebKit::RemoteGraphicsContextGLProxy::create): Deleted. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): (WebKit::PlatformCALayerRemote::setContents): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom): (WebKit::PlatformCALayerRemoteCustom::clone const): (WebKit::PlatformCALayerRemoteCustom::setNeedsDisplayInRect): (WebKit::PlatformCALayerRemoteCustom::setNeedsDisplay): * WebProcess/WebPage/wc/GraphicsLayerWC.cpp: (WebKit::GraphicsLayerWC::setContentsDisplayDelegate): 2021-12-06 Per Arne [iOS] Remove mach service extensions for the WebContent process https://bugs.webkit.org/show_bug.cgi?id=232952 Reviewed by Brent Fulgham. Remove mach service extensions for the WebContent process, which we think are no longer needed, based on local testing. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::nonBrowserServices): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::attachmentElementServices): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2021-12-06 Patrick Angle [Cocoa] Web Inspector: Unify Grid overlay drawing code https://bugs.webkit.org/show_bug.cgi?id=233773 Reviewed by Devin Rousso. Remove the (almost) 1-to-1 duplicated logic currently being used to turn Grid Overlays into a layer hierarchy and instead use a graphics context to draw the overlays straight into the view to take advantage of the existing drawing code we use for macOS in WebCore::InspectorOverlay. To accommodate this, we now correctly set the content scale factor of the view itself (so that our drawing does not appear blurry) and set the frame of the view equal to the current visible portion of the parent scroll view, which helps us to avoid having an incredibly large graphics context to draw into (which we would if the view's frame was just set to match the frame of the webpage's view). This frame will not always be the same size, such as when zooming in where less of the frame is visible. Combined with the current content scale, this actually means that on zoom the effective number of pixels that need to be drawn is consistent. * UIProcess/Inspector/ios/WKInspectorHighlightView.h: * UIProcess/Inspector/ios/WKInspectorHighlightView.mm: (-[WKInspectorHighlightView initWithFrame:]): - Explicitly set this view to be non-opaque so that page content can be seen below this view. This wasn't previously necessary because the bounds of this view were a zero-rect, which meant the background was never painted. (-[WKInspectorHighlightView _removeAllLayers]): (-[WKInspectorHighlightView _createLayers:]): - Because the view's frame origin is now offset, we need to create the node highlight layers offset by the negation of the frame's origin so that they still line up correctly with page content. (-[WKInspectorHighlightView drawRect:]): (-[WKInspectorHighlightView update:scale:frame:]): (-[WKInspectorHighlightView _createGridOverlayLayers:scale:]): Deleted. (createLayoutHatchingLayer): Deleted. (createLayoutLabelLayer): Deleted. (-[WKInspectorHighlightView _createGridOverlayLayer:scale:]): Deleted. (-[WKInspectorHighlightView update:scale:]): Deleted. * UIProcess/ios/WKContentView.mm: (-[WKContentView _showInspectorHighlight:]): 2021-12-06 Lauro Moura REGRESSION(r286535) [GTK] Fix clean builds after DerivedSources/WebKit2 move https://bugs.webkit.org/show_bug.cgi?id=233881 Reviewed by Don Olmstead. Build fix. Covered by existing tests The previous approach of this patch created the links to the header derived sources into the target webkit2/ folder, which in turn was a link to /Source/WebKit/UIProcess/API/gtk. So it ended up actually creating the links inside the Source directory. This commit instead links a different webkit2/ folder from the generated webkit folder for the WebKitGTK/WPE derived sources headers. * PlatformGTK.cmake: * PlatformWPE.cmake: 2021-12-06 Brady Eidson webpushd/webpushtool debugging additions https://bugs.webkit.org/show_bug.cgi?id=233864 Reviewed by Alex Christensen. Covered by API tests. This patch: - Teaches webpushtool the ability to wait for a reconnect after losing its connection - Starts actually broadcasting meaningful debug messages from webpushd * webpushd/AppBundleRequest.mm: (WebPushD::AppBundleRequest::start): (WebPushD::AppBundlePermissionsRequest::didCheckForExistingBundle): (WebPushD::AppBundlePermissionsRequest::didCreateAppBundle): (WebPushD::AppBundleDeletionRequest::didDeleteExistingBundleWithError): * webpushd/PushClientConnection.h: * webpushd/PushClientConnection.mm: (WebPushD::ClientConnection::setDebugModeIsEnabled): (WebPushD::ClientConnection::broadcastDebugMessage): (WebPushD::ClientConnection::connectionClosed): * webpushd/WebPushDaemon.mm: (WebPushD::Daemon::connectionAdded): * webpushd/webpushtool/WebPushToolConnection.h: * webpushd/webpushtool/WebPushToolConnection.mm: (WebPushTool::Connection::create): (WebPushTool::Connection::Connection): (WebPushTool::Connection::connectToService): (WebPushTool::Connection::connectionDropped): * webpushd/webpushtool/WebPushToolMain.mm: (printUsageAndTerminate): (main): 2021-12-06 Chris Dumez Regression(r286505) imported/w3c/web-platform-tests/html/cross-origin-opener-policy/javascript-url.https.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=233874 Reviewed by Darin Adler. r286505 fixed ProvisionalPageProxy so that ProvisionalPageProxy::m_provisionalLoadURL gets properly initialized when the ProvisionalPageProxy gets constructed *after* the provisional load has already started (COOP proces-swap case). One side effect of this though is that ProvisionalPageProxy::cancel() no longer returns early and will try to notify the client that the provisional load failed, dereferencing m_mainFrame in doing so. In the event where the main frame has not yet been created in the new provisional process, this would do a null-dereference of m_mainFrame. To address the issue, we now early return in ProvisionalPageProxy::cancel() if m_isProcessSwappingOnNavigationResponse is true (i.e. The ProvisionalPageProxy was created after the provisional load had started). In such situations, we don't want to ProvisionalPageProxy to be the one notifying the client of the provisional load failure anyway. The reason is that there is still a provisional load going on in the committed process/page. No new tests, covered by existing test that is flakily crashing. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::cancel): 2021-12-06 Ryan Haddad REGRESSION (r286507): [macOS] Many file system access layout tests became flaky failures https://bugs.webkit.org/show_bug.cgi?id=233892 Unreviewed, revert r286507. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): * NetworkProcess/storage/FileSystemStorageHandle.h: (WebKit::FileSystemStorageHandle::activeSyncAccessHandle const): Deleted. * NetworkProcess/storage/FileSystemStorageManager.cpp: (WebKit::FileSystemStorageManager::~FileSystemStorageManager): (WebKit::FileSystemStorageManager::close): Deleted. * NetworkProcess/storage/FileSystemStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::originPath): (WebKit::NetworkStorageManager::localOriginStorageManager): (WebKit::readOriginFromFile): Deleted. (WebKit::writeOriginToFileIfNecessary): Deleted. (WebKit::deleteOriginFileIfNecessary): Deleted. (WebKit::originDirectoryPath): Deleted. (WebKit::originFilePath): Deleted. (WebKit::NetworkStorageManager::removeOriginStorageManagerIfPossible): Deleted. (WebKit::toWebsiteDataType): Deleted. (WebKit::NetworkStorageManager::forEachOriginDirectory): Deleted. (WebKit::NetworkStorageManager::fetchDataFromDisk): Deleted. (WebKit::NetworkStorageManager::fetchData): Deleted. (WebKit::NetworkStorageManager::deleteDataOnDisk): Deleted. (WebKit::NetworkStorageManager::deleteData): Deleted. (WebKit::NetworkStorageManager::deleteDataModifiedSince): Deleted. (WebKit::NetworkStorageManager::deleteDataForRegistrableDomains): Deleted. * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::StorageBucket::typeStoragePath const): (WebKit::OriginStorageManager::StorageBucket::fileSystemStorageManager): (WebKit::OriginStorageManager::OriginStorageManager): (WebKit::OriginStorageManager::StorageBucket::toStorageIdentifier): Deleted. (WebKit::OriginStorageManager::StorageBucket::isActive): Deleted. (WebKit::OriginStorageManager::StorageBucket::deleteData): Deleted. (WebKit::OriginStorageManager::StorageBucket::deleteFileSystemStorageData): Deleted. (WebKit::OriginStorageManager::isActive): Deleted. (WebKit::OriginStorageManager::deleteData): Deleted. * NetworkProcess/storage/OriginStorageManager.h: * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::ownerProcess): * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.messages.in: Removed. 2021-12-06 Mark Lam Reverting local test code that should not have been landed. Not reviewed. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: 2021-12-06 Tim Horton Momentum Event Dispatcher: Momentum phase runs backwards with natural scrolling disabled https://bugs.webkit.org/show_bug.cgi?id=233894 Reviewed by Simon Fraser. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime): Only flip the deltas if the trackpad is configured to use "natural" scrolling (in which "directionInvertedFromDevice" is true). (WebKit::MomentumEventDispatcher::computeNextDelta): Fix initial queue state logging to log both axes before setting the "did log" bit. 2021-12-06 Brady Eidson Put webpushd code in WebKit.framework. https://bugs.webkit.org/show_bug.cgi?id=233886 Reviewed by Alex Christensen. This fixes some build/mastering/linking issues. * Configurations/webpushd.xcconfig: * Shared/API/Cocoa/WKMain.h: * Shared/API/Cocoa/WKMain.mm: (WKWebPushDaemonMain): * WebKit.xcodeproj/project.pbxproj: * webpushd/WebPushDaemonMain.h: Copied from Source/WebKit/Shared/API/Cocoa/WKMain.mm. * webpushd/WebPushDaemonMain.mm: (WebKit::WebPushDaemonMain): (main): Deleted. * webpushd/webpushd.cpp: Copied from Source/WebKit/Shared/API/Cocoa/WKMain.mm. (main): 2021-12-06 Brent Fulgham REGRESSION (r286527): Three API tests crashing under WebKit::ProcessLauncher::launchProcess() https://bugs.webkit.org/show_bug.cgi?id=233882 Reviewed by Brent Fulgham. Correct the eventHandler to capture the process name, rather than using a raw pointer to the character string. * UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm: (WebKit::ProcessLauncher::launchProcess): 2021-12-06 Per Arne Vollan [iOS][WP] Block access to unused IOKit class https://bugs.webkit.org/show_bug.cgi?id=233866 Reviewed by Brent Fulgham. Block access to IOKit class IOMobileFramebufferUserClient in the WebContent process' sandbox on iOS, which is unused according to telemetry. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * UIProcess/WebPageProxy.cpp: (WebKit::gpuIOKitClasses): 2021-12-06 Matt Gilligan [iOS] Allow WKWebView clients to override undoManager https://bugs.webkit.org/show_bug.cgi?id=233297 Reviewed by Wenson Hsieh. Move WKContentView's undoManager up the responder chain to WKWebView so web view subclasses can customize the undo manager used when WKContentView is first responder. Test: KeyboardInputTests.OverrideUndoManager * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView undoManager]): Return the undo manager provided by _contentView when it is current. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView undoManagerForWebView]): Provide the view's undo manager via this property so that -undoManager will look up the responder chain to WKWebView. (-[WKContentView undoManager]): Deleted. 2021-12-06 Lauro Moura REGRESSION(r286535) [GTK] Fix clean builds after DerivedSources/WebKit2 move https://bugs.webkit.org/show_bug.cgi?id=233881 Reviewed by Žan Doberšek. Build fix. Covered by exiting tests. * PlatformGTK.cmake: Add symbolic links for the public generated like we do for the regular headers. It happened to work before because they were created already in a webkit2 folder. 2021-12-06 Alex Christensen WKWebpagePreferences._activeContentRuleListActionPatterns should be an NSDictionary of identifier to allowed patterns https://bugs.webkit.org/show_bug.cgi?id=233842 Reviewed by Timothy Hatcher. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::decode): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (-[WKWebpagePreferences _setActiveContentRuleListActionPatterns:]): (-[WKWebpagePreferences _activeContentRuleListActionPatterns]): * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: 2021-12-05 Said Abou-Hallawa [GPU Process] Add the encoding/decoding for Filter and FilterEffect https://bugs.webkit.org/show_bug.cgi?id=232844 Reviewed by Wenson Hsieh. * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::drawFilteredImageBuffer): * GPUProcess/graphics/RemoteDisplayListRecorder.h: * GPUProcess/graphics/RemoteDisplayListRecorder.messages.in: * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::getFilteredImageForImageBuffer): * GPUProcess/graphics/RemoteRenderingBackend.h: * GPUProcess/graphics/RemoteRenderingBackend.messages.in: * Platform/IPC/FilterReference.h: Added. (IPC::FilterReference::FilterReference): (IPC::FilterReference::takeFilter): (IPC::FilterReference::encodeFilterEffect): (IPC::FilterReference::decodeFilterEffect): (IPC::FilterReference::encodeSVGFilter): (IPC::FilterReference::decodeSVGFilter): (IPC::FilterReference::encodeCSSFilter): (IPC::FilterReference::decodeCSSFilter): (IPC::FilterReference::encodeFilter): (IPC::FilterReference::decodeFilter): (IPC::FilterReference::encode const): (IPC::FilterReference::decode): * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp: (WebKit::RemoteDisplayListRecorderProxy::recordDrawFilteredImageBuffer): * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h: * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::getFilteredImage): * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h: 2021-12-05 Simon Fraser Add trace points for generated momentum events https://bugs.webkit.org/show_bug.cgi?id=233857 Reviewed by Tim Horton. Add start/end points for synthetic momentum, and a trace point for each generated event. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::dispatchSyntheticMomentumEvent): (WebKit::MomentumEventDispatcher::didStartMomentumPhase): (WebKit::MomentumEventDispatcher::didEndMomentumPhase): 2021-12-04 Myles C. Maxfield Rename DerivedSources/WebKit2 to DerivedSources/WebKit https://bugs.webkit.org/show_bug.cgi?id=233803 Reviewed by Tim Horton. Mechanical rename. No new tests because there is no behavior change. * Configurations/BaseTarget.xcconfig: * DerivedSources-output.xcfilelist: * PlatformGTK.cmake: * Scripts/generate-derived-sources.sh: * Scripts/generate-unified-sources.sh: * UnifiedSources-output.xcfilelist: * WebKit.xcodeproj/project.pbxproj: 2021-12-04 Brady Eidson Add command line `webpushtool` for daemon development and debugging. https://bugs.webkit.org/show_bug.cgi?id=233845 Reviewed by Tim Horton. No behavior change. This utility will eventually be quite fleshed out. For now, it can act as a terminal that prints debug messages from webpushd. * Configurations/webpushtool.xcconfig: Added. * Resources/webpushtool.entitlements: Added. * WebKit.xcodeproj/project.pbxproj: * WebKit.xcodeproj/xcshareddata/xcschemes/webpushtool.xcscheme: Added. * webpushd/webpushtool/WebPushToolConnection.h: Added. * webpushd/webpushtool/WebPushToolConnection.mm: Added. (WebPushTool::Connection::create): (WebPushTool::maybeConnectToService): (WebPushTool::Connection::Connection): (WebPushTool::Connection::connectToService): (WebPushTool::Connection::startAction): (WebPushTool::Connection::startDebugStreamAction): (WebPushTool::Connection::sendAuditToken): (WebPushTool::Connection::connectionDropped): (WebPushTool::Connection::messageReceived): * webpushd/webpushtool/WebPushToolMain.mm: Added. (printUsageAndTerminate): (main): 2021-12-04 Brent Fulgham [Cocoa] Launch Captive Portal WebContent process when requested https://bugs.webkit.org/show_bug.cgi?id=233824 Reviewed by Darin Adler. When the WebKit client requests a Captive Portal process, launch the dedicated XPC service with Captive Portal entitlements. * UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm: (WebKit::webContentServiceName): New helper function. (WebKit::serviceName): Update to use new helper. (WebKit::ProcessLauncher::launchProcess): Log errors when launching. * WebKit.xcodeproj/project.pbxproj: Include the CaptivePortal xpc service when creating development symlinks. 2021-12-03 Wenson Hsieh [iOS] Web content process sometimes crashes under WebPage::positionInformation() https://bugs.webkit.org/show_bug.cgi?id=233841 rdar://85917212 Reviewed by Geoffrey Garen. Add a missing null check in the case where the hit-tested node is null in `WebPage::positionInformation`. This can happen in a number of ways (one of which is exercised by the new API test). Test: ImageAnalysisTests.DoNotCrashWhenHitTestingOutsideOfWebView * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): 2021-12-03 John Wilander PCM: Unlinkable tokens for triggering event to prevent fraud https://bugs.webkit.org/show_bug.cgi?id=233673 Reviewed by Alex Christensen. This patch allows triggering events to have an optional query parameter like this: https://destination.example/.well-known/private-click-measurement/trigger-attribution/11?attributionDestinationNonce=ABCDEFabcdef0123456789 The presence of an attributionDestinationNonce triggers PrivateClickMeasurementManager to ask the server to sign an unlinkable token for the triggering event and then stores the corresponding secret token plus the signature for later inclusion in the attribution report. New API/unit test PrivateClickMeasurement.DestinationClickFraudPrevention. * NetworkProcess/DatabaseUtilities.cpp: (WebKit::DatabaseUtilities::buildPrivateClickMeasurementFromDatabase const): Now handles destination tokens. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::willSendRedirectedRequest): Now sets destinationSite in WebCore::PrivateClickMeasurement::AttributionTriggerData. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp: (WebKit::PCM::Database::Database): Now calls addDestinationTokenColumnsIfNecessary(). (WebKit::PCM::Database::insertPrivateClickMeasurement): Now does insertion of optional destination tokens. (WebKit::PCM::Database::addDestinationTokenColumnsIfNecessary): Database migration. (WebKit::PCM::Database::addBundleIDColumnIfNecessary): Deleted. Temporary migration function for non-customer builds. No longer needed. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp: (WebKit::PrivateClickMeasurementManager::storeUnattributed): Just name changes. (WebKit::PrivateClickMeasurementManager::getTokenPublicKey): Not changed afaik. Seems like the diff is confused. (WebKit::PrivateClickMeasurementManager::configureForTokenSigning): New function to extract shared code. (WebKit::PrivateClickMeasurementManager::getSignatureBase64URLFromTokenSignatureResponse): New function to extract shared code. (WebKit::PrivateClickMeasurementManager::getSignedUnlinkableTokenForSource): Renamed to add "ForSource" and all shared code extracted. (WebKit::PrivateClickMeasurementManager::getSignedUnlinkableTokenForDestination): Different than for the source in that it results in an attribution call. (PrivateClickMeasurementManager::handleAttribution): Now does signing of destination token if the optional nonce is in the triggering event. (PrivateClickMeasurementManager::fireConversionRequest): (WebKit::PrivateClickMeasurementManager::setPCMFraudPreventionValuesForTesting): Added empty initializer strings for the destination test token values not in use yet. (WebKit::PrivateClickMeasurementManager::getSignedUnlinkableToken): Deleted. Renamed PrivateClickMeasurementManager::getSignedUnlinkableTokenForSource(). * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h: 2021-12-03 ujwal koneru Fix playstation build after r286484 https://bugs.webkit.org/show_bug.cgi?id=233823 unreviewed build fix. * UIProcess/playstation/WebProcessPoolPlayStation.cpp: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/playstation/WebProcessPlayStation.cpp: (WebKit::WebProcess::platformInitializeWebProcess): 2021-12-03 Tim Horton Fix the build * NetworkProcess/storage/NetworkStorageManager.cpp: 2021-12-03 Tim Horton Add more logging for MomentumEventDispatcher https://bugs.webkit.org/show_bug.cgi?id=233811 Reviewed by Simon Fraser. Add a temporary event log to MomentumEventDispatcher, to debug delta/offset/curve issues. * WebProcess/WebPage/EventDispatcher.h: (WebKit::EventDispatcher::queue): * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::handleWheelEvent): Accumulate event deltas. Also accumulate event deltas for the fingers-down phase in the "generated" offset. Store the phase and momentum phase smooshed into a single field. (WebKit::MomentumEventDispatcher::dispatchSyntheticMomentumEvent): Accumulate generated deltas. (WebKit::MomentumEventDispatcher::didEndMomentumPhase): Attempt to dump the log 1 second after each momentum phase. We'll skip it if another scroll has started since. (WebKit::MomentumEventDispatcher::setScrollingAccelerationCurve): (WebKit::MomentumEventDispatcher::startDisplayLink): (WebKit::MomentumEventDispatcher::stopDisplayLink): (WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime): (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta): (WebKit::MomentumEventDispatcher::computeNextDelta): Adopt more MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING. Error logging we leave outside of this, because that we'll keep around. (WebKit::MomentumEventDispatcher::pushLogEntry): (WebKit::MomentumEventDispatcher::flushLog): Dump the event log in an easy-to-copy-into-a-CSV format. * WebProcess/WebPage/MomentumEventDispatcher.h: 2021-12-03 Robert Jenner Unreviewed, reverting r286487. Broke multiple builds. Reverted changeset: "Rename DerivedSources/WebKit2 to DerivedSources/WebKit" https://bugs.webkit.org/show_bug.cgi?id=233803 https://commits.webkit.org/r286487 2021-12-03 Sihui Liu Fetch and remove file system data via WKWebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=233567 Reviewed by Youenn Fablet. Introduce a new WebsiteDataType value FileSystem for FileSystemAccess data. Network process now can fetch and delete this type of data when fetching and deleteing website data (if FileSystem type is included in target types). To track origins that have FileSystem data, this patch introduces a new file named origin in the origin's directory. This file will be created when OriginStorageManager is created. To delete existing FileSystem data, network process finds origins that are requested to be deleted and have data on disk, closes active access handles, and deletes the files. The origin file mentioned above will be deleted if there is no other file left in the same directory, and empty directories will be deleted. New API tests: FileSystemAccess.FetchAndRemoveData FileSystemAccess.RemoveDataByModificationTime FileSystemAccess.FetchDataForThirdParty * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): * NetworkProcess/storage/FileSystemStorageHandle.h: (WebKit::FileSystemStorageHandle::activeSyncAccessHandle const): * NetworkProcess/storage/FileSystemStorageManager.cpp: (WebKit::FileSystemStorageManager::~FileSystemStorageManager): (WebKit::FileSystemStorageManager::close): * NetworkProcess/storage/FileSystemStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::readOriginFromFile): (WebKit::writeOriginToFileIfNecessary): (WebKit::deleteOriginFileIfNecessary): (WebKit::originDirectoryPath): (WebKit::originFilePath): (WebKit::NetworkStorageManager::localOriginStorageManager): (WebKit::NetworkStorageManager::removeOriginStorageManagerIfPossible): (WebKit::toWebsiteDataType): (WebKit::NetworkStorageManager::forEachOriginDirectory): (WebKit::NetworkStorageManager::fetchDataFromDisk): (WebKit::NetworkStorageManager::fetchData): (WebKit::NetworkStorageManager::deleteDataOnDisk): (WebKit::NetworkStorageManager::deleteData): (WebKit::NetworkStorageManager::deleteDataModifiedSince): (WebKit::NetworkStorageManager::deleteDataForRegistrableDomains): (WebKit::originPath): Deleted. * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/OriginStorageManager.cpp: (WebKit::OriginStorageManager::StorageBucket::toStorageIdentifier): (WebKit::OriginStorageManager::StorageBucket::typeStoragePath const): (WebKit::OriginStorageManager::StorageBucket::fileSystemStorageManager): (WebKit::OriginStorageManager::StorageBucket::isActive): (WebKit::OriginStorageManager::StorageBucket::deleteData): (WebKit::OriginStorageManager::StorageBucket::deleteFileSystemStorageData): (WebKit::OriginStorageManager::OriginStorageManager): (WebKit::OriginStorageManager::isActive): (WebKit::OriginStorageManager::deleteData): * NetworkProcess/storage/OriginStorageManager.h: * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::ownerProcess): * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.messages.in: Added. 2021-12-03 Chris Dumez Follow-up to r286479 to add API test and address issues found by the test https://bugs.webkit.org/show_bug.cgi?id=233798 Reviewed by Darin Adler. Add functionality needed for API testing and fix issues found by the API test. * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _isLayerTreeFrozenForTesting:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::destroyProvisionalPage): (WebKit::WebPageProxy::isLayerTreeFrozen): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::isLayerTreeFrozen): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add new SPI to check if the layer tree is frozen in the WebProcess so that I could write an API test for this. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): Make sure m_provisionalLoadURL gets initialized when the ProvisionalPageProxy gets constructed *after* the provisional load has already started (which is the case when the process swap is triggered by COOP). (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): If the provisional load load fails in the provisional process, and the ProvisionalPageProxy was constructed on resource response (COOP case), then no longer forward the didFailProvisionalLoadForFrame() to the WebPageProxy. Instead, we destroy the ProvisionalPageProxy. This is to avoid duplicate calls to didFailProvisionalLoadForFrame(). In this case, there is still a provisional load ongoing in the committed process and the ProvisionalPageProxy destructor will take care of stopping that provisional load (due to r286479), which will cause the committed process to send its own didFailProvisionalLoadForFrame IPC. 2021-12-03 Wenson Hsieh [ Monterey wk2 ] http/tests/media/video-webm-stall.html (layout-test) is a constant text failure https://bugs.webkit.org/show_bug.cgi?id=233717 rdar://85933254 Reviewed by Peng Liu. After r274117, we call `PlatformMediaSessionManager::setWebMFormatReaderEnabled` in GPUProcess with `m_webMParserEnabled` instead of the value of `m_webMFormatReaderEnabled`. Since we (arbitrarily) update WebM parser enablement before WebM format reader enablement, this means that the first call to update preferences leaves the WebM format reader disabled on PlatformMediaSessionManager even though it should be enabled. Prior to the more recent change in r285477, this would be corrected on subsequent calls into `GPUProcessProxy::updatePreferences()`, which previously sent `GPUProcess::SetWebMFormatReaderEnabled()` messages even if the value of the preference hadn't changed. r285477 removed those redundant IPC messages when the enablement value hasn't changed, so we can no longer rely on PlatformMediaSessionManager being eventually updated to `true` due to `m_webMParserEnabled` being set to true. Simply fix this by using `m_webMFormatReaderEnabled` instead of `m_webMParserEnabled`. * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::setWebMFormatReaderEnabled): 2021-12-03 BJ Burg Web Inspector: Web Inspector^2 crashes after closing if Web Inspector^1 closed first https://bugs.webkit.org/show_bug.cgi?id=233293 Reviewed by Devin Rousso. Cache the inspected page's identifier. During frontend teardown, use the cached indentifier to remove the message receiver that was added to receive messages from the inspected page. Other operations using m_inspectedPage should be guarded in case that the inspected page already been closed and destroyed. * UIProcess/Inspector/WebInspectorUIProxy.cpp: (WebKit::WebInspectorUIProxy::createFrontendPage): (WebKit::WebInspectorUIProxy::closeFrontendPageAndWindow): * UIProcess/Inspector/WebInspectorUIProxy.h: 2021-12-03 BJ Burg [Cocoa] Web Inspector: fix completion handler type signature for _WKInspectorExtension methods https://bugs.webkit.org/show_bug.cgi?id=233792 Reviewed by Devin Rousso. * UIProcess/API/Cocoa/_WKInspectorExtension.h: * UIProcess/API/Cocoa/_WKInspectorExtension.mm: (-[_WKInspectorExtension evaluateScript:frameURL:contextSecurityOrigin:useContentScriptContext:completionHandler:]): (-[_WKInspectorExtension evaluateScript:inTabWithIdentifier:completionHandler:]): Replace the completionHandler's NSDictionary argument type with `id`. A dictionary is not necessarily returned here because the implementation deserializes a SerializedScriptValue. This could be a string, number, array, dictionary, or other serializable values. While the frontend does return a dictionary payload, this is unpacked on the WebProcess-side before being sent back out via the _WKInspectorExtension APi. 2021-12-03 Alex Christensen Add room for more bytecode in WKContentRuleList file format https://bugs.webkit.org/show_bug.cgi?id=233780 Reviewed by Tim Hatcher. * Shared/WebCompiledContentRuleList.cpp: (WebKit::WebCompiledContentRuleList::frameURLFiltersBytecode const): * Shared/WebCompiledContentRuleList.h: * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::encode const): (WebKit::WebCompiledContentRuleListData::decode): * Shared/WebCompiledContentRuleListData.h: (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData): * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListMetaData::fileSize const): (API::encodeContentRuleListMetaData): (API::decodeContentRuleListMetaData): (API::compiledToFile): (API::createExtension): (API::getContentRuleListSourceFromMappedFile): * UIProcess/API/APIContentRuleListStore.h: 2021-12-03 Eric Carlson DisplayCaptureSource doesn't initialize base class correctly https://bugs.webkit.org/show_bug.cgi?id=233722 Reviewed by Youenn Fablet. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): Pass the hash salt to the factory. * WebProcess/cocoa/RemoteRealtimeDisplaySource.cpp: (WebKit::RemoteRealtimeDisplaySource::create): Remove 'name' parameter because CaptureDevice already has the name. (WebKit::RemoteRealtimeDisplaySource::RemoteRealtimeDisplaySource): Pass name to base class from device.label(). (WebKit::RemoteRealtimeDisplaySource::createRemoteMediaSource): Don't call setName with settings, it was already set in the constructor. * WebProcess/cocoa/RemoteRealtimeDisplaySource.h: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::DisplayFactory::createDisplayCaptureSource): Pass hash salt to RemoteRealtimeDisplaySource::create. * WebProcess/cocoa/UserMediaCaptureManager.h: 2021-12-03 Myles C. Maxfield Rename DerivedSources/WebKit2 to DerivedSources/WebKit https://bugs.webkit.org/show_bug.cgi?id=233803 Reviewed by Tim Horton. Mechanical rename. No new tests because there is no behavior change. * Configurations/BaseTarget.xcconfig: * Scripts/generate-derived-sources.sh: * Scripts/generate-unified-sources.sh: * UnifiedSources-output.xcfilelist: * WebKit.xcodeproj/project.pbxproj: 2021-12-03 Kimmo Kinnunen Network process does not seem to initialize logging https://bugs.webkit.org/show_bug.cgi?id=233360 Reviewed by Fujii Hironori. Move GPUProcess and WebProcess process creation arguments related to logging strings to new AuxiliaryProcessCreationParameters. Use this in all auxiliary processes GPUProcess, WebProcess, AuthnProcess and NetworkProcess. Use the canonical WTF::logLevelString(), WebCore::logLevelString(), WebKit::logLevelString() to initialize Cocoa WebKit2 logging settings for process creation arguments. Fixes bugs where Tools/Scripts/run-minibrowser --debug -WebKit2Logging IPCMessages would not print IPCMessages logging for NetworkProcess. * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * GPUProcess/GPUProcessCreationParameters.cpp: (WebKit::GPUProcessCreationParameters::encode const): (WebKit::GPUProcessCreationParameters::decode): * GPUProcess/GPUProcessCreationParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::applyProcessCreationParameters): * Shared/AuxiliaryProcess.h: * Shared/AuxiliaryProcessCreationParameters.cpp: Copied from Source/WebKit/WebAuthnProcess/WebAuthnProcessCreationParameters.cpp. (WebKit::AuxiliaryProcessCreationParameters::encode const): (WebKit::AuxiliaryProcessCreationParameters::decode): * Shared/AuxiliaryProcessCreationParameters.h: Copied from Source/WebKit/WebAuthnProcess/WebAuthnProcessCreationParameters.h. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Sources.txt: * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::auxiliaryProcessParameters): * UIProcess/AuxiliaryProcessProxy.h: * UIProcess/Cocoa/GPUProcessProxyCocoa.mm: (WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::GPUProcessProxy): (WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters): * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::sendCreationParametersToNewProcess): * UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp: (WebKit::WebAuthnProcessProxy::singleton): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * WebAuthnProcess/WebAuthnProcess.cpp: (WebKit::WebAuthnProcess::initializeWebAuthnProcess): * WebAuthnProcess/WebAuthnProcessCreationParameters.cpp: (WebKit::WebAuthnProcessCreationParameters::encode const): (WebKit::WebAuthnProcessCreationParameters::decode): * WebAuthnProcess/WebAuthnProcessCreationParameters.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/playstation/WebProcessPlayStation.cpp: (WebKit::WebProcess::platformInitializeWebProcess): 2021-12-02 Tim Horton MomentumEventDispatcher curve sometimes doesn't match the system curve https://bugs.webkit.org/show_bug.cgi?id=233801 Reviewed by Simon Fraser. Three small changes to get us closer to the system curve: 1) Fetch the momentum event dispatch interval from the system, and use it to scale the momentum start event's delta (which we use as our initial velocity) into the "ideal" curve's frame rate (which is always 60fps regardless). 2) Back-date the animation start time to the fingers-down phase end event, so that the momentum start phase has a delta. This seems to match what the system does. 3) Switch to MonotonicTime for the animation time, since it doesn't need to be in the same timebase as events (which are oddly in WallTime), and certainly should be monotonic. * Shared/ScrollingAccelerationCurve.cpp: (WebKit::ScrollingAccelerationCurve::ScrollingAccelerationCurve): (WebKit::ScrollingAccelerationCurve::interpolate): (WebKit::ScrollingAccelerationCurve::encode const): (WebKit::ScrollingAccelerationCurve::decode): (WebKit::operator<<): * Shared/ScrollingAccelerationCurve.h: (WebKit::ScrollingAccelerationCurve::frameRate): (WebKit::ScrollingAccelerationCurve::operator== const): * Shared/mac/ScrollingAccelerationCurveMac.mm: (WebKit::fromIOHIDCurve): (WebKit::fromIOHIDCurveArrayWithAcceleration): (WebKit::fromIOHIDDevice): Fetch and propagate the dispatch frame rate. This isn't *really* a ScrollingAccelerationCurve property, but neither is `resolution`; this is just currently the only place we look up HID properties and push them to the Web Content process; some re-architecture is warranted here in the future. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::handleWheelEvent): Keep track of the last fingers-down phase ended event timestamp. (WebKit::MomentumEventDispatcher::didStartMomentumPhase): Backdate the start time so that the first event has the appropriate delta. Divide out the dispatch frame rate so that the initial velocity is as if the curve were running at 60fps (since we *will* run it at 60fps and interpolate). (WebKit::MomentumEventDispatcher::didEndMomentumPhase): (WebKit::MomentumEventDispatcher::consumeDeltaForTime): (WebKit::MomentumEventDispatcher::displayWasRefreshed): Factor the consume-a-delta-from-the-ideal-curve code out from displayWasRefreshed so we can use it in the start phase too. (WebKit::MomentumEventDispatcher::offsetAtTime): (WebKit::MomentumEventDispatcher::computeNextDelta): Rename idealCurveFrameRate->idealCurveFrameInterval for accuracy. * WebProcess/WebPage/MomentumEventDispatcher.h: 2021-12-02 Simon Fraser A Safari tab can rarely get stuck in a state where rendering updates stop happening https://bugs.webkit.org/show_bug.cgi?id=233784 rdar://85445072 Reviewed by Chris Dumez. Sometimes a Safari tab can get into a state where rendering updates cease to happen, which manifests as partially broken scrolling, blank tiles revealed when scrolling, and somewhat broken page updates. I was able to sometimes reproduce this by clicking on links in eBay emails from Mail on a system with two displays. From the one time I reproduce with logging, the output indicated that DisplayRefreshMonitor::displayLinkFired() would early return because isPreviousFrameDone() was false. The only way for that to occur, barring memory corruption, is if DisplayRefreshMonitorMac::dispatchDisplayDidRefresh() returned early, which it does if the callback comes twice in a single event loop; this may explain the rarity. So fix DisplayRefreshMonitorMac::dispatchDisplayDidRefresh() call setIsPreviousFrameDone(true) so the next callback can make progress Also add some locking annotations and fix one missing lock, and some release logging. * WebProcess/WebPage/mac/DisplayRefreshMonitorMac.cpp: (WebKit::DisplayRefreshMonitorMac::dispatchDisplayDidRefresh): 2021-12-02 Chris Dumez Regression(r283179) Google Drive freezes after downloading a folder https://bugs.webkit.org/show_bug.cgi?id=233783 Reviewed by Darin Adler. When process-swapping on a navigation response due to COOP, we create a new ProvisionalPageProxy to trigger a provisional load in a new WebProcess. In the common case, the ProvisionalPageProxy gets committed, we process-swap and everything works fine. However, if the client decides to convert the navigation into a download (like in the Google Drive case), then the ProvisionalPageProxy gets destroyed without being committed. The issue is that the committed process still thinks at this point that it is in the middle of a navigation and its layer tree is thus frozen with reason=PageTransition. This is what makes Google Drive look frozen after the download. This is not an issue with PSON because the process-swap happens in decidePolicyForNavigationAction() and we tell the previous process to ignore the navigation when we process-swap. To address the issue, we now tell the committed process to cancel its navigation if the ProvisionalPageProxy ends up getting destroyed without being committed. This lets the committed process know there is no point in waiting for this navigation to happen and allows it to unfreeze its layer tree. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): * UIProcess/ProvisionalPageProxy.h: (WebKit::ProvisionalPageProxy::isProcessSwappingOnNavigationResponse const): (WebKit::ProvisionalPageProxy::shouldClosePreviousPageAfterCommit const): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::WebPageProxy::continueNavigationInNewProcess): 2021-12-02 Rachel Ginsberg Make enum values consisten in ApplicationManifest::Icon::Purpose and _WKApplicationManifestIconPurpose https://bugs.webkit.org/show_bug.cgi?id=233764 rdar://85976270 Reviewed by Brent Fulgham. The ApplicationManifest tests already check for 1, 2, and 4 respectively. * UIProcess/API/Cocoa/_WKApplicationManifest.h: Set the _WKApplicationManifestIconPurpose enum values to 1, 2, 4 to match the enum values set in ApplicationManifest::Icon::Purpose. Those values are used in ApplicationManifest because an OptionSet is used. 2021-12-02 Per Arne Vollan [WP][iOS] Add telemetry to determine which system calls are only used on process launch https://bugs.webkit.org/show_bug.cgi?id=233649 Reviewed by Brent Fulgham. Add telemetry to determine which system calls are only used on WebContent process launch on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::create): 2021-12-02 Per Arne Vollan [WP] Strengthen sandbox when AppCache is disabled https://bugs.webkit.org/show_bug.cgi?id=233746 Reviewed by Brent Fulgham. When AppCache is disabled, we can remove access to some resources in the WebContent process' sandbox. This is implemented using a new sandbox state variable representing the AppCache state. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/WebPage/WebPage.cpp: * WebProcess/com.apple.WebProcess.sb.in: 2021-12-02 Megan Gardner Re-add support of image control menus. https://bugs.webkit.org/show_bug.cgi?id=233305 Reviewed by Tim Horton. Image control menus are needed for mail transition to modern WebKit, so re-add them after the removal in https://trac.webkit.org/changeset/272117/webkit * Platform/spi/mac/AppKitSPI.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetImageControlsEnabled): (WKPreferencesGetImageControlsEnabled): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setupPageConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _imageControlsEnabled]): (-[WKWebViewConfiguration _setImageControlsEnabled:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2021-12-02 Per Arne Vollan [iOS] Add required system call to WebKit sandboxes https://bugs.webkit.org/show_bug.cgi?id=233730 Reviewed by Brent Fulgham. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2021-12-02 Myles C. Maxfield [WebGPU] Hook up navigator.gpu.requestAdapter() https://bugs.webkit.org/show_bug.cgi?id=233619 Reviewed by Dean Jackson. This hooks up a new message, GPUConnectionToWebProcess::createRemoteGPU(), which starts the whole WebGPU GPU process infrastructure. * Configurations/BaseTarget.xcconfig: We have to be able to #include files from WebGPU. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::createRemoteGPU): GPUConnectionToWebProcess owns the RemoteGPUs. * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUConnectionToWebProcess.messages.in: * Sources.txt: * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp: (WebKit::RemoteGPUProxy::RemoteGPUProxy): Creating a RemoteGPUProxy needs to send a message to the GPU process to start the GPU process infrastructure. We block while we're waiting for the reply from the GPU process. This was copied from RemoteGraphicsContextGL. (WebKit::RemoteGPUProxy::gpuProcessConnectionDidClose): * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: Hook up RemoteGPUProxy to WebCore. (WebKit::WebChromeClient::createGPUForWebGPU const): * WebProcess/WebCoreSupport/WebChromeClient.h: 2021-12-02 Chris Dumez [WK2] Make Web Lock API work across multiple WebProcesses https://bugs.webkit.org/show_bug.cgi?id=233719 Reviewed by Alex Christensen. See WebCore changelog. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): * Sources.txt: * UIProcess/WebLockRegistryProxy.cpp: Added. (WebKit::WebLockRegistryProxy::WebLockRegistryProxy): (WebKit::WebLockRegistryProxy::~WebLockRegistryProxy): (WebKit::WebLockRegistryProxy::requestLock): (WebKit::WebLockRegistryProxy::releaseLock): (WebKit::WebLockRegistryProxy::abortLockRequest): (WebKit::WebLockRegistryProxy::snapshot): (WebKit::WebLockRegistryProxy::clientIsGoingAway): (WebKit::WebLockRegistryProxy::processDidExit): * UIProcess/WebLockRegistryProxy.h: Added. * UIProcess/WebLockRegistryProxy.messages.in: Added. * UIProcess/WebProcessProxy.cpp: (WebKit::m_webLockRegistry): (WebKit::WebProcessProxy::shutDown): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::webLockRegistry): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/WebCoreSupport/RemoteWebLockRegistry.cpp: Added. (WebKit::RemoteWebLockRegistry::LocksSnapshot::isEmpty const): (WebKit::RemoteWebLockRegistry::RemoteWebLockRegistry): (WebKit::RemoteWebLockRegistry::~RemoteWebLockRegistry): (WebKit::RemoteWebLockRegistry::requestLock): (WebKit::RemoteWebLockRegistry::releaseLock): (WebKit::RemoteWebLockRegistry::abortLockRequest): (WebKit::RemoteWebLockRegistry::snapshot): (WebKit::RemoteWebLockRegistry::clientIsGoingAway): (WebKit::RemoteWebLockRegistry::didCompleteLockRequest): (WebKit::RemoteWebLockRegistry::didStealLock): * WebProcess/WebCoreSupport/RemoteWebLockRegistry.h: Added. * WebProcess/WebCoreSupport/RemoteWebLockRegistry.messages.in: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_appHighlightsVisible): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::webLockRegistry): 2021-12-02 Commit Queue Unreviewed, reverting r286437. https://bugs.webkit.org/show_bug.cgi?id=233776 Introduced test failure Reverted changeset: "[WP] Strengthen sandbox when AppCache is disabled" https://bugs.webkit.org/show_bug.cgi?id=233746 https://commits.webkit.org/r286437 2021-12-02 Per Arne Vollan [WP] Strengthen sandbox when AppCache is disabled https://bugs.webkit.org/show_bug.cgi?id=233746 Reviewed by Brent Fulgham. When AppCache is disabled, we can remove access to some resources in the WebContent process' sandbox. This is implemented using a new sandbox state variable representing the AppCache state. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/WebPage/WebPage.cpp: * WebProcess/com.apple.WebProcess.sb.in: 2021-12-02 Youenn Fablet Add some logging to NetworkRTCProvider https://bugs.webkit.org/show_bug.cgi?id=233759 Reviewed by Eric Carlson. No change of behavior. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::addSocket): * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: (WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections): 2021-12-02 Per Arne Vollan REGRESSION(r285722): Introduced performance regression https://bugs.webkit.org/show_bug.cgi?id=233718 Unreviewed partial revert of r285722. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-12-02 Kimmo Kinnunen GraphicsContextGLANGLE should not have Cocoa Mac specific display reconfiguration code https://bugs.webkit.org/show_bug.cgi?id=233695 Reviewed by Antti Koivisto. Previous GraphicsContextGLANGLE::displayWasReconfigured() was renamed to updateContextOnDisplayReconfiguration(). The displayWasReconfigured() was taken into use in the notification interface DisplayConfigurationMonitor::Client::displayWasReconfigured(). * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::displayWasReconfigured): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::displayConfigurationChanged): 2021-12-02 Youenn Fablet Add support for NavigationPreloadManager https://bugs.webkit.org/show_bug.cgi?id=233523 Reviewed by Chris Dumez. Make use of ServiceWorkerNavigationPreloader when preload flag is true. We only start as soon as created the preload in case of main frame navigation when preload flag is true. Update ServiceWorkerNavigationPreloader to differentiate explicit preloads (enabled by NavigationPreloadManager) from implict preloads. Implict preloads can be used when fetch event is not handled, which is not guaranteed for explicit preloads, given the Service-Worker-Navigation-Preload header. Add IPC to read and set preload state (enabled and header value). * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2021-12-01 Sihui Liu FileSystemSyncAccessHandle should be invalidated when network process crashes https://bugs.webkit.org/show_bug.cgi?id=232605 Reviewed by Youenn Fablet. * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp: (WebKit::WebFileSystemStorageConnection::connectionClosed): (WebKit::WebFileSystemStorageConnection::registerSyncAccessHandle): (WebKit::WebFileSystemStorageConnection::unregisterSyncAccessHandle): (WebKit::WebFileSystemStorageConnection::invalidateAccessHandle): * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h: 2021-12-01 Jean-Yves Avenard Avoid allocating and copy memory from a SharedMemory into a SharedBuffer https://bugs.webkit.org/show_bug.cgi?id=233401 rdar://85637721 Reviewed by Eric Carlson. We can directly wrap a SharedMemory into a SharedBuffer using SharedMemory::createSharedBuffer instead. No change in observable behaviour other than total memory size reduction. Fly-by fix: check for null when mapping a SharedMemory to an IPC handle in a couple of spots. * Shared/ShareableResource.h: Make ShareableResource use thread-safe refcount. A ShareableResource once created is immutable and the SharedMemory object itself has thread-safe refounting. Deleting the object outside the main thread is safe. Make members const. * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): Refactor method, using DataSegment::Provider instead of platfom specific code. * Shared/WebCoreArgumentCoders.cpp: (IPC::decodeSharedBuffer): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::setPasteboardBufferForType): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::saveImageToLibrary): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::dataSelectionForPasteboard): (WebKit::WebPageProxy::setPromisedDataForImage): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::bufferForType): Hardening code, checking for nullability. (WebKit::WebPlatformStrategies::readBufferFromPasteboard): Hardening code, checking for nullability. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::restoreAppHighlightsAndScrollToIndex): 2021-12-01 Chris Fleizach AX: Support accessibility attributes for https://bugs.webkit.org/show_bug.cgi?id=233620 Reviewed by Dean Jackson, Andres Gonzalez. * WebProcess/Model/ARKitInlinePreviewModelPlayer.h: * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: (WebKit::ARKitInlinePreviewModelPlayer::accessibilityChildren): 2021-12-01 Alex Christensen Use Span instead of pointer/length in CompiledContentExtension https://bugs.webkit.org/show_bug.cgi?id=233727 Reviewed by Tim Hatcher. * Shared/WebCompiledContentRuleList.cpp: (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const): (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const): (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const): (WebKit::WebCompiledContentRuleList::serializedActions const): (WebKit::WebCompiledContentRuleList::spanWithOffsetAndLength const): (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecodeLength const): Deleted. (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecodeLength const): Deleted. (WebKit::WebCompiledContentRuleList::topURLFiltersBytecodeLength const): Deleted. (WebKit::WebCompiledContentRuleList::actions const): Deleted. (WebKit::WebCompiledContentRuleList::actionsLength const): Deleted. * Shared/WebCompiledContentRuleList.h: 2021-12-01 Commit Queue Unreviewed, reverting r286037. https://bugs.webkit.org/show_bug.cgi?id=233724 Introduced WebRTC crash Reverted changeset: "[macOS][GPUP] Remove access in sandbox to com.apple.audio.AudioComponentRegistrar" https://bugs.webkit.org/show_bug.cgi?id=231694 https://commits.webkit.org/r286037 2021-12-01 Per Arne Vollan [WP] Sandbox telemetry is missing for some system calls https://bugs.webkit.org/show_bug.cgi?id=233594 Reviewed by Brent Fulgham. Sandbox telemetry is missing for some system calls, since telemetry rules are automatically overridden in some cases. This patch is addressing this by disabling system call inference. * WebProcess/com.apple.WebProcess.sb.in: 2021-12-01 Chris Dumez Unreviewed build fixes after r286346. * WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::startDisplayLink): (WebKit::MomentumEventDispatcher::displayWasRefreshed): (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval): (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta): (WebKit::MomentumEventDispatcher::offsetAtTime): (WebKit::momentumDecayRate): (WebKit::MomentumEventDispatcher::computeNextDelta): * WebProcess/WebPage/MomentumEventDispatcher.h: 2021-12-01 Youenn Fablet Reuse navigation preload if service worker is fetching the corresponding navigation request https://bugs.webkit.org/show_bug.cgi?id=233490 Reviewed by Chris Dumez. Store navigation preloader in NetworkSession, keyed by the corresponding fetch identifier. When a navigation request is coming from fetch with the corresponding navigation preload identifier we look at ongoing preloads and use it if available to answer the fetch. To do so, we create a new ServiceWorkerFetchTask that will take the preloader of the initial ServiceWorkerFetchTask. * NetworkProcess/NetworkResourceLoadParameters.cpp: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkSession.cpp: * NetworkProcess/NetworkSession.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: * WebProcess/Network/WebLoaderStrategy.cpp: 2021-12-01 Youenn Fablet WebSWServerConnection::createFetchTask does not need to query twice for a registration https://bugs.webkit.org/show_bug.cgi?id=233467 Reviewed by Chris Dumez. Instead of searching for a worker and then searching for a registration, we now search for a registration and, if not null, directly get its active worker. This makes it clear the registration is not null in follow-up code and removes a redundant query. No change of behavior, this is a refactoring. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::createFetchTask): 2021-12-01 Brady Eidson Add WKWebsiteDataStore configuration option to enable Mock app bundle testing. https://bugs.webkit.org/show_bug.cgi?id=233679 Reviewed by Tim Horton. Covered by API tests. We're about to land actual implementations of app permissions bundles. But the mock bundles still have a place for testing. We need a way to switch between Mock and Native. This patch takes the opportunity to plumb out a WebPushDaemonConnectionConfiguration object that can easily be augmented in future patches to add new options without messing with messaging directly. * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::webpushdUsesMockBundlesForTesting const): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::maybeSendConnectionConfiguration const): (WebKit::NetworkNotificationManager::sendMessage const): (WebKit::NetworkNotificationManager::sendMessageWithReply const): (WebKit::NetworkNotificationManager::maybeSendHostAppAuditToken const): Deleted. * NetworkProcess/Notifications/NetworkNotificationManager.h: * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Shared/WebPushDaemonConnectionConfiguration.h: Copied from Source/WebKit/Shared/WebPushDaemonConstants.h. (WebKit::WebPushD::WebPushDaemonConnectionConfiguration::encode const): (WebKit::WebPushD::WebPushDaemonConnectionConfiguration::decode): * Shared/WebPushDaemonConstants.h: (WebKit::WebPushD::messageTypeSendsReply): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration webpushdUsesMockBundlesForTesting]): (-[_WKWebsiteDataStoreConfiguration setWebpushdUsesMockBundlesForTesting:]): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): (WebKit::WebsiteDataStoreConfiguration::webPushDaemonConnectionConfiguration const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::webpushdUsesMockBundlesForTesting const): (WebKit::WebsiteDataStoreConfiguration::setWebpushdUsesMockBundlesForTesting): * WebKit.xcodeproj/project.pbxproj: * webpushd/AppBundleRequest.mm: (WebPushD::AppBundleRequest::AppBundleRequest): (WebPushD::AppBundleRequest::start): * webpushd/PushClientConnection.h: (WebPushD::ClientConnection::hasHostAppAuditToken const): (WebPushD::ClientConnection::useMockBundlesForTesting const): * webpushd/PushClientConnection.mm: (WebPushD::ClientConnection::updateConnectionConfiguration): (WebPushD::ClientConnection::setHostAppAuditTokenData): * webpushd/WebPushDaemon.h: * webpushd/WebPushDaemon.mm: (WebPushD::Daemon::decodeAndHandleMessage): (WebPushD::Daemon::getOriginsWithPushAndNotificationPermissions): (WebPushD::Daemon::setDebugModeIsEnabled): (WebPushD::Daemon::updateConnectionConfiguration): (WebPushD::Daemon::setHostAppAuditToken): Deleted. 2021-12-01 Lauro Moura [GTK][GTK4][WebDriver] Flaky crashes exiting many prompty-related webdriver tests https://bugs.webkit.org/show_bug.cgi?id=233505 Reviewed by Carlos Garcia Campos. Covered by existing tests. When building for GTK4, upon dialog closure the dialog widgets might be removed with `webkitWebViewDialogSetChild(dialog, NULL)` while the button is still registered as the default widget of the toplevel. This commit makes sure we don't have a default widget while the dialog is unmapped, to mirror the map() behavior. * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp: (webkitScriptDialogImplUnmap): Added to unset the default widget. (webkit_script_dialog_impl_class_init): Register unmap callback. 2021-11-30 Antoine Quint replace-webkit-additions-includes should assume unknown or empty deployment targets are supported https://bugs.webkit.org/show_bug.cgi?id=233650 Reviewed by Tim Horton. * mac/replace-webkit-additions-includes.py: (is_supported_os): 2021-11-30 Simon Fraser Pass the timestamp for scrolling thread animations through all the serviceScrollAnimation() calls https://bugs.webkit.org/show_bug.cgi?id=233678 Reviewed by Tim Horton. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: 2021-11-30 Simon Fraser Remove the scrolling tree plumbing of the momentumScrollingAnimatorEnabled() setting, which is no longer needed https://bugs.webkit.org/show_bug.cgi?id=233680 Reviewed by Tim Horton. We no longer consult the momentumScrollingAnimatorEnabled setting in the scrolling tree, so remove the plumbing. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): 2021-11-30 Tim Horton Add a momentum event synthesizer https://bugs.webkit.org/show_bug.cgi?id=233653 Reviewed by Simon Fraser. * Platform/Logging.h: Add ScrollAnimations log channel to WebKit (it already exists in WebCore). * Shared/ScrollingAccelerationCurve.cpp: Added. (WebKit::ScrollingAccelerationCurve::ScrollingAccelerationCurve): (WebKit::ScrollingAccelerationCurve::interpolate): (WebKit::ScrollingAccelerationCurve::computeIntermediateValuesIfNeeded): (WebKit::ScrollingAccelerationCurve::evaluateQuartic): (WebKit::ScrollingAccelerationCurve::accelerationFactor): (WebKit::ScrollingAccelerationCurve::encode const): (WebKit::ScrollingAccelerationCurve::decode): (WebKit::operator<<): (WebKit::ScrollingAccelerationCurve::fromNativeWheelEvent): * Shared/ScrollingAccelerationCurve.h: Added. (WebKit::ScrollingAccelerationCurve::operator== const): (WebKit::ScrollingAccelerationCurve::operator!= const): Add a class that represents a quartic scrolling acceleration curve with a trailing linear tangent region, and allows interpolation between curves and evaluation of the curve at a point. * Shared/mac/ScrollingAccelerationCurveMac.mm: Added. (WebKit::fromFixedPoint): (WebKit::readFixedPointParameter): (WebKit::fromIOHIDCurve): (WebKit::fromIOHIDCurveArrayWithAcceleration): (WebKit::ScrollingAccelerationCurve::fromNativeWheelEvent): Given a NativeWebWheelEvent, extract its underlying platform event and fetch the ScrollingAccelerationCurve for the originating device. * Sources.txt: * SourcesCocoa.txt: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleWheelEvent): Fetch the current ScrollingAccelerationCurve on each momentum begin event, if the feature is enabled. (WebKit::WebPageProxy::sendWheelEvent): Send the ScrollingAccelerationCurve to EventDispatcher just before we send the momentum begin event along, if it has changed. (WebKit::WebPageProxy::windowScreenDidChange): Keep EventDispatcher apprised of changes to the current screen of the page. (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::EventDispatcher): (WebKit::EventDispatcher::internalWheelEvent): Factor most of wheelEvent out into internalWheelEvent, so that MomentumEventDispatcher can call internalWheelEvent(), skipping the code in wheelEvent() that forwards the event... to MomentumEventDispatcher. Also, keep track of where the event came from (UI process or MomentumEventDispatcher) and avoid sending didReceiveEvent replies to the UI process for synthetic events that it doesn't know about. (WebKit::EventDispatcher::wheelEvent): Forward wheel events to MomentumEventDispatcher. (WebKit::EventDispatcher::setScrollingAccelerationCurve): Forward scrolling curve changes to MomentumEventDispatcher. (WebKit::EventDispatcher::displayWasRefreshed): Forward display refresh callbacks to MomentumEventDispatcher. (WebKit::EventDispatcher::windowScreenDidChange): Forward page screen changes to MomentumEventDispatcher. * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/EventDispatcher.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::wheelEvent): (WebKit::WebPage::dispatchWheelEventWithoutScrolling): * WebProcess/WebPage/WebPage.h: Don't send didReceiveEvent for synthetic events from the main thread either. * WebProcess/WebPage/MomentumEventDispatcher.cpp: Added. (WebKit::MomentumEventDispatcher::MomentumEventDispatcher): (WebKit::MomentumEventDispatcher::~MomentumEventDispatcher): (WebKit::MomentumEventDispatcher::eventShouldStartSyntheticMomentumPhase const): If we have everything we need (a scrolling curve - which also implies that the setting is enabled - and raw platform deltas), and the event is a momentum begin event, we can use it to start a synthetic momentum phase. (WebKit::MomentumEventDispatcher::handleWheelEvent): Start or stop the momentum phase as appropriate. Record any incoming fingers-down phase events in a rolling event history structure. Block platform-event-driven events from being further handled by WebKit if we are inside a synthetic momentum phase, since we'll be replacing them. (WebKit::appKitScrollMultiplierForEvent): Determine the AppKit scroll muliplier ("accelerated" vs "unaccelerated" deltas in NSEvent parlance) from the event via division. (WebKit::MomentumEventDispatcher::dispatchSyntheticMomentumEvent): Dispatch a synthetic event with the given momentum phase and delta. We borrow some properties from the event that initiated the momentum phase (e.g. the position), and some from whatever event we've most recently seen (even if we told the rest of WebKit to ignore it), so that we get the most up-to-date state for e.g. the keyboard modifiers. (WebKit::MomentumEventDispatcher::didStartMomentumPhase): Record relevant information about the start event, generate the momentum curve, and start a full-rate display link. Also, send a momentum begin event, since we blocked the real one. (WebKit::MomentumEventDispatcher::didEndMomentumPhase): Send a momentum ended event, shut down the display link, and reset all per-gesture state. (WebKit::MomentumEventDispatcher::setScrollingAccelerationCurve): Store ScrollingAccelerationCurves on a per-page basis. (WebKit::MomentumEventDispatcher::displayID const): Look up the displayID for the current gesture's page. (WebKit::MomentumEventDispatcher::startDisplayLink): (WebKit::MomentumEventDispatcher::stopDisplayLink): Start and stop a display link, which will - in a roundabout manner - eventually call back into displayWasRefreshed. (WebKit::MomentumEventDispatcher::windowScreenDidChange): Store DisplayIDs on a per-page basis. (WebKit::MomentumEventDispatcher::displayWasRefreshed): When the display link calls us back, emit a single momentum changed event of sufficient delta to move us to the desired offset along the curve. (WebKit::MomentumEventDispatcher::didScrollWithInterval): (WebKit::MomentumEventDispatcher::didScroll): Record incoming scrolling events into a rolling history deque. (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta): Compute the offsets for the entire "ideal curve" table (at 60Hz) by running the animation and accumulating the deltas. (WebKit::interpolate): (WebKit::MomentumEventDispatcher::offsetAtTime): Interpolate along the "ideal curve" to determine the intended offset at a given time. (WebKit::momentumDecayRate): (WebKit::MomentumEventDispatcher::computeNextDelta): Compute the next delta given a delta (and the event history) by applying a bit of exponential decay and then passing it through the ScrollingAccelerationCurve. We return both the unaccelerated and accelerated deltas, because the input to the next iteration of computeNextDelta is the unaccelerated delta, but the delta applied to the actual scroll position is the accelerated delta. * WebProcess/WebPage/MomentumEventDispatcher.h: Added. 2021-11-30 BJ Burg Web Inspector: add ExtensionTabActivation diagnostic event https://bugs.webkit.org/show_bug.cgi?id=233101 Reviewed by Devin Rousso. Add plumbing for new argument 'extensionBundleIdentifier' that's passed to WebInspectorUI when registering an extension. * UIProcess/API/Cocoa/_WKInspector.mm: (-[_WKInspector registerExtensionWithID:extensionBundleIdentifier:displayName:completionHandler:]): (-[_WKInspector registerExtensionWithID:displayName:completionHandler:]): Deleted. * UIProcess/API/Cocoa/_WKInspectorExtensionHost.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (-[_WKRemoteWebInspectorViewController registerExtensionWithID:extensionBundleIdentifier:displayName:completionHandler:]): (-[_WKRemoteWebInspectorViewController registerExtensionWithID:displayName:completionHandler:]): Deleted. * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp: (WebKit::WebInspectorUIExtensionControllerProxy::registerExtension): * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.h: * WebProcess/Inspector/WebInspectorUIExtensionController.cpp: (WebKit::WebInspectorUIExtensionController::registerExtension): * WebProcess/Inspector/WebInspectorUIExtensionController.h: * WebProcess/Inspector/WebInspectorUIExtensionController.messages.in: 2021-11-30 Myles C. Maxfield [WebGPU] Hook up StreamServerConnection to Remote*** classes https://bugs.webkit.org/show_bug.cgi?id=233600 Reviewed by Kimmo Kinnunen. In order for all the various Remote*** classes in the GPU process to be able to receive messages, they have to be able to call streamConnection->startReceivingMessages(*this), and when they're done receiving messages, they need to call streamConnection->stopReceivingMessages(). This means that all the Remote*** objects have to have a Ref to the StreamServerConnection so they can call into it when they're done receiving messages. The object model for this matches the object model for RemoteRenderingBackend: - RemoteGPU is the WebGPU analogue of RemoteRenderingBackend. - WebGPU::ObjectHeap is the WebGPU analogue of RemoteResourceCache. - The WebGPU::Remote*** objects are the WebGPU analogues of the ImageBuffers, NativeImages, and Fonts retained by the RemoteResourceCache. So, here's an ASCII-art diagram of the object model: +-----------+ | RemoteGPU | +-----------+ / | ---------------- | / | / +--------------------+ / | WebGPU::ObjectHeap | / +--------------------+ / / | \ / / | \ | / | \ | +---------------+ +--------------+ +-------------+ | | RemoteTexture | | RemoteDevice | | RemoteQueue | ... etc. | +---------------+ +--------------+ +-------------+ \ \ | / \ \ | / -------------- \ | / \ \ | / +------------------------+ | StreamServerConnection | +------------------------+ Now that the StreamServerConnection is being hooked up, this patch mirrors the design of RemoteGraphicsContextGL. In this design, the web process sends a create() message with the StreamConnectionBuffer to the gpu process, which creates a RemoteGraphicsContextGL. The RemoteGraphicsContextGL owns a StreamConnectionWorkQueue, and upon being created, it starts up the work queue and enqueues an initialization task to the work queue, which then sends a reply to the web process including the wakeUpSemaphore from the work queue. While the GPU process is busy doing this, the web process is blocked, because it can't send any messages through the stream until it has received the semaphore. Once it has received the semaphore, the connection has been established, and messages can start flowing. This patch follows this model, except instead of RemoteGraphicsContextGLProxy communicating with RemoteGraphicsContextGL, RemoteGPUProxy is communicating with RemoteGPU. There is one more patch to wire up all the pieces together before we can actually call our first WebGPU command in Javascript. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/graphics/WebGPU/RemoteAdapter.cpp: (WebKit::RemoteAdapter::RemoteAdapter): (WebKit::RemoteAdapter::stopListeningForIPC): (WebKit::RemoteAdapter::requestDevice): * GPUProcess/graphics/WebGPU/RemoteAdapter.h: * GPUProcess/graphics/WebGPU/RemoteBindGroup.cpp: (WebKit::RemoteBindGroup::RemoteBindGroup): (WebKit::RemoteBindGroup::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteBindGroup.h: * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.cpp: (WebKit::RemoteBindGroupLayout::RemoteBindGroupLayout): (WebKit::RemoteBindGroupLayout::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.h: * GPUProcess/graphics/WebGPU/RemoteBuffer.cpp: (WebKit::RemoteBuffer::RemoteBuffer): (WebKit::RemoteBuffer::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteBuffer.h: * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.cpp: (WebKit::RemoteCommandBuffer::RemoteCommandBuffer): (WebKit::RemoteCommandBuffer::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.h: * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.cpp: (WebKit::RemoteCommandEncoder::RemoteCommandEncoder): (WebKit::RemoteCommandEncoder::stopListeningForIPC): (WebKit::RemoteCommandEncoder::beginRenderPass): (WebKit::RemoteCommandEncoder::beginComputePass): (WebKit::RemoteCommandEncoder::finish): * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.h: * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.cpp: (WebKit::RemoteComputePassEncoder::RemoteComputePassEncoder): (WebKit::RemoteComputePassEncoder::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.h: * GPUProcess/graphics/WebGPU/RemoteComputePipeline.cpp: (WebKit::RemoteComputePipeline::RemoteComputePipeline): (WebKit::RemoteComputePipeline::stopListeningForIPC): (WebKit::RemoteComputePipeline::getBindGroupLayout): * GPUProcess/graphics/WebGPU/RemoteComputePipeline.h: * GPUProcess/graphics/WebGPU/RemoteDevice.cpp: (WebKit::RemoteDevice::RemoteDevice): (WebKit::RemoteDevice::stopListeningForIPC): (WebKit::RemoteDevice::createBuffer): (WebKit::RemoteDevice::createTexture): (WebKit::RemoteDevice::createSampler): (WebKit::RemoteDevice::importExternalTexture): (WebKit::RemoteDevice::createBindGroupLayout): (WebKit::RemoteDevice::createPipelineLayout): (WebKit::RemoteDevice::createBindGroup): (WebKit::RemoteDevice::createShaderModule): (WebKit::RemoteDevice::createComputePipeline): (WebKit::RemoteDevice::createRenderPipeline): (WebKit::RemoteDevice::createComputePipelineAsync): (WebKit::RemoteDevice::createRenderPipelineAsync): (WebKit::RemoteDevice::createCommandEncoder): (WebKit::RemoteDevice::createRenderBundleEncoder): (WebKit::RemoteDevice::createQuerySet): * GPUProcess/graphics/WebGPU/RemoteDevice.h: * GPUProcess/graphics/WebGPU/RemoteExternalTexture.cpp: (WebKit::RemoteExternalTexture::RemoteExternalTexture): (WebKit::RemoteExternalTexture::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteExternalTexture.h: * GPUProcess/graphics/WebGPU/RemoteGPU.cpp: (WebKit::RemoteGPU::RemoteGPU): (WebKit::RemoteGPU::initialize): (WebKit::RemoteGPU::stopListeningForIPC): (WebKit::RemoteGPU::workQueueInitialize): (WebKit::RemoteGPU::workQueueUninitialize): (WebKit::RemoteGPU::requestAdapter): * GPUProcess/graphics/WebGPU/RemoteGPU.h: * GPUProcess/graphics/WebGPU/RemoteGPU.messages.in: * GPUProcess/graphics/WebGPU/RemotePipelineLayout.cpp: (WebKit::RemotePipelineLayout::RemotePipelineLayout): (WebKit::RemotePipelineLayout::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemotePipelineLayout.h: * GPUProcess/graphics/WebGPU/RemoteQuerySet.cpp: (WebKit::RemoteQuerySet::RemoteQuerySet): (WebKit::RemoteQuerySet::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteQuerySet.h: * GPUProcess/graphics/WebGPU/RemoteQueue.cpp: (WebKit::RemoteQueue::RemoteQueue): (WebKit::RemoteQueue::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteQueue.h: * GPUProcess/graphics/WebGPU/RemoteRenderBundle.cpp: (WebKit::RemoteRenderBundle::RemoteRenderBundle): (WebKit::RemoteRenderBundle::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteRenderBundle.h: * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.cpp: (WebKit::RemoteRenderBundleEncoder::RemoteRenderBundleEncoder): (WebKit::RemoteRenderBundleEncoder::stopListeningForIPC): (WebKit::RemoteRenderBundleEncoder::finish): * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.h: * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.cpp: (WebKit::RemoteRenderPassEncoder::RemoteRenderPassEncoder): (WebKit::RemoteRenderPassEncoder::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.h: * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.cpp: (WebKit::RemoteRenderPipeline::RemoteRenderPipeline): (WebKit::RemoteRenderPipeline::stopListeningForIPC): (WebKit::RemoteRenderPipeline::getBindGroupLayout): * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.h: * GPUProcess/graphics/WebGPU/RemoteSampler.cpp: (WebKit::RemoteSampler::RemoteSampler): (WebKit::RemoteSampler::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteSampler.h: * GPUProcess/graphics/WebGPU/RemoteShaderModule.cpp: (WebKit::RemoteShaderModule::RemoteShaderModule): (WebKit::RemoteShaderModule::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteShaderModule.h: * GPUProcess/graphics/WebGPU/RemoteTexture.cpp: (WebKit::RemoteTexture::RemoteTexture): (WebKit::RemoteTexture::stopListeningForIPC): (WebKit::RemoteTexture::createView): * GPUProcess/graphics/WebGPU/RemoteTexture.h: * GPUProcess/graphics/WebGPU/RemoteTextureView.cpp: (WebKit::RemoteTextureView::RemoteTextureView): (WebKit::RemoteTextureView::stopListeningForIPC): * GPUProcess/graphics/WebGPU/RemoteTextureView.h: * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.cpp: (WebKit::WebGPU::ObjectHeap::addObject): (WebKit::WebGPU::ObjectHeap::convertAdapterFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertDeviceFromBacking): (WebKit::WebGPU::ObjectHeap::convertExternalTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertPipelineLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertQuerySetFromBacking): (WebKit::WebGPU::ObjectHeap::convertQueueFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertSamplerFromBacking): (WebKit::WebGPU::ObjectHeap::convertShaderModuleFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureViewFromBacking): * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp: (WebKit::RemoteGPUProxy::RemoteGPUProxy): (WebKit::RemoteGPUProxy::abandonGPUProcess): (WebKit::RemoteGPUProxy::wasCreated): (WebKit::RemoteGPUProxy::waitUntilInitialized): (WebKit::RemoteGPUProxy::requestAdapter): (WebKit::RemoteGPUProxy::~RemoteGPUProxy): Deleted. * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.messages.in: Added. 2021-11-30 Ada Chan [WebXR] Implement ChromeClient API to allow getting explicit consent from user on session features https://bugs.webkit.org/show_bug.cgi?id=233617 Reviewed by Dean Jackson. Set up WKUIDelegate method for asking user for permission on XR session features. * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): (headers_for_type): * UIProcess/API/APIUIClient.h: (API::UIClient::requestPermissionOnXRSessionFeatures): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declare a WK enum that represents XR session mode and a WK flag that represents XR session features for use in the new WKUIDelegate method. Declare a new WKUIDelegate method for requesting user permission for XR session features that takes in the security origin, the session mode, the list of device supported features, the list of features that require consent, and the list of features that optionally require consent. * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKXRSessionMode): (WebKit::toWKXRSessionFeatureFlags): (WebKit::toPlatformXRFeatures): (WebKit::UIDelegate::UIClient::requestPermissionOnXRSessionFeatures): If the WKUIDelegate method for requesting permission is implemented, call it to get the list of user permitted features. Otherwise, preserve the current behavior by returning the initially granted features based on device support. * UIProcess/XR/PlatformXRCoordinator.h: (WebKit::PlatformXRCoordinator::requestPermissionOnSessionFeatures): Default implementation returns the initially granted features based on device support. * UIProcess/XR/PlatformXRSystem.cpp: (WebKit::PlatformXRSystem::requestPermissionOnSessionFeatures): * UIProcess/XR/PlatformXRSystem.h: * UIProcess/XR/PlatformXRSystem.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestPermissionOnXRSessionFeatures): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/XR/PlatformXRSystemProxy.cpp: (WebKit::PlatformXRSystemProxy::requestPermissionOnSessionFeatures): Send a message to the UI process to request user consent on session features. * WebProcess/XR/PlatformXRSystemProxy.h: 2021-11-30 Commit Queue Unreviewed, reverting r286227. https://bugs.webkit.org/show_bug.cgi?id=233652 Broke some Apple-internal builds Reverted changeset: "[Model] clean up compile-time flags and condition IDL methods behind them" https://bugs.webkit.org/show_bug.cgi?id=233407 https://commits.webkit.org/r286227 2021-11-30 BJ Burg [Cocoa] Web Inspector: fix bundle identifier lookup for enabling remote inspection https://bugs.webkit.org/show_bug.cgi?id=233015 Reviewed by Darin Adler. * UIProcess/Inspector/WebInspectorUtilities.h: * UIProcess/Inspector/WebInspectorUtilities.cpp: (WebKit::bundleIdentifierForSandboxBroker): To avoid repeating the logic, extract this code to a helper. * UIProcess/Cocoa/WebInspectorPreferenceObserver.mm: (-[WKWebInspectorPreferenceObserver init]): * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::shouldEnableRemoteInspector): Use the helper method. 2021-11-30 Brent Fulgham Correct serialization error in _WKApplicationManifestIcon https://bugs.webkit.org/show_bug.cgi?id=233602 Reviewed by Devin Rousso. The 'initWithCoder' method had two mistakes: (1) It attempted to decode the 'purposes' member as an NSArray of NSString, rather than NSNumber, and (2) it attempted to decode the 'src' member as an NSString, when it is in fact an NSURL. These errors caused serialization to fail (since NSSecureCoding correctly rejected the serialization). This patch corrects both errors and adds a new test to exercise this code path. Tested by a new TestWebKitAPI Test: ApplicationManifest.IconCoding * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (-[_WKApplicationManifestIcon initWithCoder:]): Correct decoding logic. 2021-11-30 BJ Burg Web Inspector: fix IPC race between unregistering an extension and Web Inspector closing https://bugs.webkit.org/show_bug.cgi?id=233264 Reviewed by Devin Rousso. * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp: (WebKit::WebInspectorUIExtensionControllerProxy::inspectorFrontendWillClose): Remaining registrations will not be removed via unregisterExtension() if the frontend is already in the midst of closing. Clear out the registry. (WebKit::WebInspectorUIExtensionControllerProxy::registerExtension): (WebKit::WebInspectorUIExtensionControllerProxy::unregisterExtension): Bail out if the inspector has closed between the IPC message being sent and receiving the async response. 2021-11-30 Youenn Fablet Migrate some WebSWClientConnection messages to async replies https://bugs.webkit.org/show_bug.cgi?id=233627 Reviewed by Chris Dumez. Migrate didMatchRegistration, didGetRegistrations and registrationReady to async replies. This is easier to understand and is more robust to connection closure. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::matchRegistration): (WebKit::WebSWServerConnection::getRegistrations): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::matchRegistration): (WebKit::WebSWClientConnection::whenRegistrationReady): (WebKit::WebSWClientConnection::getRegistrations): (WebKit::WebSWClientConnection::clear): (WebKit::WebSWClientConnection::didMatchRegistration): Deleted. (WebKit::WebSWClientConnection::didGetRegistrations): Deleted. (WebKit::WebSWClientConnection::registrationReady): Deleted. * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2021-11-30 Youenn Fablet ServiceWorkerContainer does not respond well to network process crash https://bugs.webkit.org/show_bug.cgi?id=233626 Reviewed by Chris Dumez. Set SW client connection as closed when IPC connection gets closed. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::connectionToServerLost): 2021-11-30 Kimmo Kinnunen GraphicsContextGL should have ANGLE-specific subclass https://bugs.webkit.org/show_bug.cgi?id=233522 Reviewed by Antti Koivisto. * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::paintPixelBufferToImageBuffer): Function paintToCanvas was moved to GraphicsContextGL. * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequest.cpp: (WebKit::ScopedWebGLRenderingResourcesRequest::freeWebGLRenderingResources): Use static functions from GraphicsContextGLANGLE. 2021-11-30 Youenn Fablet Preload navigation request if the service worker is not immediately ready to handle the navigation request fetch event https://bugs.webkit.org/show_bug.cgi?id=233471 Reviewed by Chris Dumez. Launching a service worker might take time due to parsing and running the service worker script. This might delay navigation loads, especially if the service worker is pass through on these loads. To optimize this code path, we preload the navigation request in case service worker is not running or not yet activated. We then wait for the service worker to handle the fetch event, which will tell us to either go to the network, in which case we use the preload, or will provide its own response in which case we use it and cancel the preload. Test: http/wpt/service-workers/service-worker-preload-when-not-activated.https.html * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.cpp: Added. * NetworkProcess/ServiceWorker/ServiceWorkerNavigationPreloader.h: Added. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/webrtc/NetworkMDNSRegister.h: * Sources.txt: * WebKit.xcodeproj/project.pbxproj: 2021-11-30 Youenn Fablet Remove unnecessary service worker page settings handling https://bugs.webkit.org/show_bug.cgi?id=233468 Reviewed by Chris Dumez. Use ServiceWorkerThreadProxy::setupPageForServiceWorker and remove WebPreferences specific handling. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferencesStore): (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: 2021-11-29 Tim Horton Fix the build * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::createWebWheelEvent): 2021-11-29 Brady Eidson Make webpushd "fake registration for testing" much more complicated by adding a "mock app bundle" install https://bugs.webkit.org/show_bug.cgi?id=233454 Reviewed by Alex Christensen. Covered by API tests. Before this patch, webpushd remembered "registrations" using a simple in-memory HashMap. In the near future, registrations will actually be represented with a placeholder app bundle on disk. The process of installing placeholders (and checking for existing ones) is complicated and asynchronous. This patch shifts the in-memory testing implementation from a simple HashMap to a "complicated and asynchronous" registration mechanism that simulates how app-bundle installs will work. Once the "real" mechanisms are in place there will be much more in-depth testing that we can do. For now, this is a "no behavior change" patch. * NetworkProcess/Notifications/Cocoa/WebPushDaemonConnectionCocoa.mm: (WebKit::WebPushD::Connection::connectionReceivedEvent const): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * WebKit.xcodeproj/project.pbxproj: "PushAppBundle" is an abstract base class for representing a placeholder application bundle for a registration. Eventually there will be a native one for each platform that actually does system operations. For now, the concrete implementation is the in-memory "Mock" app bundle. * webpushd/PushAppBundle.h: Copied from Source/WebKit/webpushd/PushClientConnection.h. * webpushd/PushAppBundle.mm: Copied from Source/WebKit/webpushd/PushClientConnection.h. (WebPushD::PushAppBundleClient::~PushAppBundleClient): (WebPushD::PushAppBundle::PushAppBundle): (WebPushD::PushAppBundle::~PushAppBundle): (WebPushD::PushAppBundle::detachFromClient): An "AppBundleRequest" is a queable operation meant to do something with an "App bundle". For now the operations are "create" and "delete" * webpushd/AppBundleRequest.h: Added. (WebPushD::AppBundleRequestImpl::AppBundleRequestImpl): (WebPushD::AppBundleRequestImpl::~AppBundleRequestImpl): (WebPushD::AppBundleRequestImpl::callCompletionHandlerAndCleanup): (WebPushD::AppBundlePermissionsRequest::AppBundlePermissionsRequest): (WebPushD::AppBundleDeletionRequest::AppBundleDeletionRequest): * webpushd/AppBundleRequest.mm: Added. (WebPushD::AppBundleRequest::AppBundleRequest): (WebPushD::AppBundleRequest::~AppBundleRequest): (WebPushD::AppBundleRequest::start): (WebPushD::AppBundleRequest::cancel): (WebPushD::AppBundleRequest::cleanupAfterCompletionHandler): (WebPushD::AppBundlePermissionsRequest::startInternal): (WebPushD::AppBundlePermissionsRequest::didCheckForExistingBundle): (WebPushD::AppBundlePermissionsRequest::didCreateAppBundle): (WebPushD::AppBundleDeletionRequest::startInternal): (WebPushD::AppBundleDeletionRequest::didDeleteExistingBundleWithError): * webpushd/MockAppBundleForTesting.h: Copied from Source/WebKit/webpushd/PushClientConnection.h. (WebPushD::MockAppBundleForTesting::create): * webpushd/MockAppBundleForTesting.mm: Added. (WebPushD::MockAppBundleForTesting::MockAppBundleForTesting): (WebPushD::MockAppBundleForTesting::~MockAppBundleForTesting): (WebPushD::MockAppBundleForTesting::checkForExistingBundle): (WebPushD::MockAppBundleForTesting::deleteExistingBundle): (WebPushD::MockAppBundleForTesting::createBundle): (WebPushD::MockAppBundleForTesting::stop): * webpushd/MockAppBundleRegistry.h: Copied from Source/WebKit/webpushd/PushClientConnection.h. * webpushd/MockAppBundleRegistry.mm: Added. (WebPushD::MockAppBundleRegistry::singleton): (WebPushD::MockAppBundleRegistry::getOriginsWithRegistrations): (WebPushD::MockAppBundleRegistry::doesBundleExist): (WebPushD::MockAppBundleRegistry::createBundle): (WebPushD::MockAppBundleRegistry::deleteBundle): * webpushd/PushClientConnection.h: * webpushd/PushClientConnection.mm: (WebPushD::ClientConnection::create): (WebPushD::ClientConnection::enqueueAppBundleRequest): (WebPushD::ClientConnection::maybeStartNextAppBundleRequest): (WebPushD::ClientConnection::didCompleteAppBundleRequest): (WebPushD::ClientConnection::connectionClosed): * webpushd/WebPushDaemon.h: * webpushd/WebPushDaemon.mm: (WebPushD::Daemon::connectionAdded): (WebPushD::Daemon::connectionRemoved): (WebPushD::Daemon::requestSystemNotificationPermission): (WebPushD::Daemon::getOriginsWithPushAndNotificationPermissions): (WebPushD::Daemon::deletePushAndNotificationRegistration): 2021-11-29 David Kilzer Disable experimental web features on platforms without UI to enable them Reviewed by Brent Fulgham. * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.mm: - Fix build when ENABLE(MODEL_ELEMENT) is false. 2021-11-29 Tim Horton Plumb raw platform scrolling deltas along in wheel events https://bugs.webkit.org/show_bug.cgi?id=233583 Reviewed by Simon Fraser. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): (WebKit::WebWheelEvent::encode const): (WebKit::WebWheelEvent::decode): * Shared/WebWheelEvent.h: (WebKit::WebWheelEvent::rawPlatformDelta const): * Shared/WebWheelEventCoalescer.cpp: (WebKit::WebWheelEventCoalescer::coalesce): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebWheelEvent): Extract and plumb raw unaccelerated (in the HID sense) deltas in scroll events for use in a future patch. 2021-11-29 Chris Dumez Add WebKitAdditions bits for captive portal mode https://bugs.webkit.org/show_bug.cgi?id=233569 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKWebpagePreferences.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: 2021-11-29 Per Arne Vollan [WP] Sandbox telemetry is missing for some system calls https://bugs.webkit.org/show_bug.cgi?id=233594 Reviewed by Brent Fulgham. Sandbox telemetry is missing for some system calls, since telemetry rules are automatically overridden in some cases. This patch is addressing this by disabling system call inference. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-11-29 Wenson Hsieh WKContentView should allow -captureTextFromCamera: with a caret selection unless the sender is the callout bar https://bugs.webkit.org/show_bug.cgi?id=233378 rdar://85478344 Reviewed by Tim Horton. Allow clients to query whether or not the "capture text from camera" action should be enabled on WKWebView in contexts outside of the callout bar. Currently, WKContentView returns NO for this action when there is a non- collapsed selection range, but this behavior is only intended for the callout bar; in the case where the action is (for instance) triggered by a button in the web view chrome, it doesn't make sense to only enable it when the selection is a caret. Additionally, adjust the check to use focused element information instead of editor state, such that WebKit clients can easily query this API (`-canPerformAction:withSender:`) inside of input delegate callbacks when beginning an input session to know whether or not "capture text from camera" should be allowed. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): 2021-11-29 Chris Fleizach AX: Unify speech synthesizer platform usage for Mac/iOS https://bugs.webkit.org/show_bug.cgi?id=231895 Reviewed by Andres Gonzalez. Create a new message for resetting speech synthesis state when the DOMWindow changes but the Page (and its referenced speech synthesis) stays the same. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::speechSynthesisResetState): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp: (WebKit::WebSpeechSynthesisClient::resetState): * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.h: 2021-11-29 Brent Fulgham REGRESSION(286219): Build fix. https://bugs.webkit.org/show_bug.cgi?id=233388 Unreviewed build fix after r286219. * WebKit.xcodeproj/project.pbxproj: Don't make duplicate copies of WebContent resources when building the CaptivePortal version of the WCP. 2021-11-29 Myles C. Maxfield [WebGPU] Delete ObjectRegistry in favor of ObjectHeap https://bugs.webkit.org/show_bug.cgi?id=233549 Reviewed by Dean Jackson. Originally, I made these two classes distinct because I thought there were two separate use cases: 1. ObjectHeap is the object that owns all WebGPU objects in the GPU process 2. ObjectRegistry is the object that can map between WebGPUIdentifiers and their full objects. This is needed when we receive a message that contains a WebGPUIdentifier, and we need to look up its represented object. The original idea was for ObjectHeap to own the objects, and each object would hold a reference to the shared ObjectRegistry. However, this turns out not to be necessary, because new objects are created via creation routines on _other objects_. This means that every object is going to have to know about its owning ObjectHeap anyway (to be able to add newly created objects to it), so there aren't any separation-of-concerns benefits to be had. If the ObjectHeap owned all the objects by just storing them in a HashMap> map, that would allow it to do double duty - it could own all the objects _and_ be able to look up which WebGPUIdentifier is associated with which object. So there's no point in having two distinct objects, when just one is sufficient. So, accepting that, this patch is fairly straightforward, despite being large: - Before, we were doing m_objectRegistry.addObject(m_identifier, m_backing) and m_objectHeap.addObject(remoteRenderPassEncoder). Now, we just do m_objectHeap.addObject(identifier, remoteRenderPassEncoder) instead. - convertFromBacking() calls go from m_objectRegistry.convertFromBacking() to m_objectHeap.convertFromBacking(). - objectRegistry.removeObject() calls can be entirely deleted, because the ObjectHeap already knows when objects are deleted, because it owns them in the first place. No new tests because there is no behavior change. * GPUProcess/graphics/WebGPU/RemoteAdapter.cpp: (WebKit::RemoteAdapter::RemoteAdapter): (WebKit::RemoteAdapter::requestDevice): (WebKit::RemoteAdapter::~RemoteAdapter): Deleted. * GPUProcess/graphics/WebGPU/RemoteAdapter.h: * GPUProcess/graphics/WebGPU/RemoteBindGroup.cpp: (WebKit::RemoteBindGroup::RemoteBindGroup): (WebKit::RemoteBindGroup::~RemoteBindGroup): Deleted. * GPUProcess/graphics/WebGPU/RemoteBindGroup.h: * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.cpp: (WebKit::RemoteBindGroupLayout::RemoteBindGroupLayout): (WebKit::RemoteBindGroupLayout::~RemoteBindGroupLayout): Deleted. * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.h: * GPUProcess/graphics/WebGPU/RemoteBuffer.cpp: (WebKit::RemoteBuffer::RemoteBuffer): (WebKit::RemoteBuffer::~RemoteBuffer): Deleted. * GPUProcess/graphics/WebGPU/RemoteBuffer.h: * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.cpp: (WebKit::RemoteCommandBuffer::RemoteCommandBuffer): (WebKit::RemoteCommandBuffer::~RemoteCommandBuffer): Deleted. * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.h: * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.cpp: (WebKit::RemoteCommandEncoder::RemoteCommandEncoder): (WebKit::RemoteCommandEncoder::beginRenderPass): (WebKit::RemoteCommandEncoder::beginComputePass): (WebKit::RemoteCommandEncoder::copyBufferToBuffer): (WebKit::RemoteCommandEncoder::copyBufferToTexture): (WebKit::RemoteCommandEncoder::copyTextureToBuffer): (WebKit::RemoteCommandEncoder::copyTextureToTexture): (WebKit::RemoteCommandEncoder::fillBuffer): (WebKit::RemoteCommandEncoder::writeTimestamp): (WebKit::RemoteCommandEncoder::resolveQuerySet): (WebKit::RemoteCommandEncoder::finish): (WebKit::RemoteCommandEncoder::~RemoteCommandEncoder): Deleted. * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.h: * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.cpp: (WebKit::RemoteComputePassEncoder::RemoteComputePassEncoder): (WebKit::RemoteComputePassEncoder::setPipeline): (WebKit::RemoteComputePassEncoder::dispatchIndirect): (WebKit::RemoteComputePassEncoder::beginPipelineStatisticsQuery): (WebKit::RemoteComputePassEncoder::setBindGroup): (WebKit::RemoteComputePassEncoder::~RemoteComputePassEncoder): Deleted. * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.h: * GPUProcess/graphics/WebGPU/RemoteComputePipeline.cpp: (WebKit::RemoteComputePipeline::RemoteComputePipeline): (WebKit::RemoteComputePipeline::getBindGroupLayout): (WebKit::RemoteComputePipeline::~RemoteComputePipeline): Deleted. * GPUProcess/graphics/WebGPU/RemoteComputePipeline.h: * GPUProcess/graphics/WebGPU/RemoteDevice.cpp: (WebKit::RemoteDevice::RemoteDevice): (WebKit::RemoteDevice::createBuffer): (WebKit::RemoteDevice::createTexture): (WebKit::RemoteDevice::createSampler): (WebKit::RemoteDevice::importExternalTexture): (WebKit::RemoteDevice::createBindGroupLayout): (WebKit::RemoteDevice::createPipelineLayout): (WebKit::RemoteDevice::createBindGroup): (WebKit::RemoteDevice::createShaderModule): (WebKit::RemoteDevice::createComputePipeline): (WebKit::RemoteDevice::createRenderPipeline): (WebKit::RemoteDevice::createComputePipelineAsync): (WebKit::RemoteDevice::createRenderPipelineAsync): (WebKit::RemoteDevice::createCommandEncoder): (WebKit::RemoteDevice::createRenderBundleEncoder): (WebKit::RemoteDevice::createQuerySet): (WebKit::RemoteDevice::~RemoteDevice): Deleted. * GPUProcess/graphics/WebGPU/RemoteDevice.h: * GPUProcess/graphics/WebGPU/RemoteExternalTexture.cpp: (WebKit::RemoteExternalTexture::RemoteExternalTexture): (WebKit::RemoteExternalTexture::~RemoteExternalTexture): Deleted. * GPUProcess/graphics/WebGPU/RemoteExternalTexture.h: * GPUProcess/graphics/WebGPU/RemoteGPU.cpp: (WebKit::RemoteGPU::RemoteGPU): (WebKit::RemoteGPU::requestAdapter): (WebKit::RemoteGPU::~RemoteGPU): Deleted. * GPUProcess/graphics/WebGPU/RemoteGPU.h: * GPUProcess/graphics/WebGPU/RemotePipelineLayout.cpp: (WebKit::RemotePipelineLayout::RemotePipelineLayout): (WebKit::RemotePipelineLayout::~RemotePipelineLayout): Deleted. * GPUProcess/graphics/WebGPU/RemotePipelineLayout.h: * GPUProcess/graphics/WebGPU/RemoteQuerySet.cpp: (WebKit::RemoteQuerySet::RemoteQuerySet): (WebKit::RemoteQuerySet::~RemoteQuerySet): Deleted. * GPUProcess/graphics/WebGPU/RemoteQuerySet.h: * GPUProcess/graphics/WebGPU/RemoteQueue.cpp: (WebKit::RemoteQueue::RemoteQueue): (WebKit::RemoteQueue::submit): (WebKit::RemoteQueue::writeBuffer): (WebKit::RemoteQueue::writeTexture): (WebKit::RemoteQueue::copyExternalImageToTexture): (WebKit::RemoteQueue::~RemoteQueue): Deleted. * GPUProcess/graphics/WebGPU/RemoteQueue.h: * GPUProcess/graphics/WebGPU/RemoteRenderBundle.cpp: (WebKit::RemoteRenderBundle::RemoteRenderBundle): (WebKit::RemoteRenderBundle::~RemoteRenderBundle): Deleted. * GPUProcess/graphics/WebGPU/RemoteRenderBundle.h: * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.cpp: (WebKit::RemoteRenderBundleEncoder::RemoteRenderBundleEncoder): (WebKit::RemoteRenderBundleEncoder::setPipeline): (WebKit::RemoteRenderBundleEncoder::setIndexBuffer): (WebKit::RemoteRenderBundleEncoder::setVertexBuffer): (WebKit::RemoteRenderBundleEncoder::drawIndirect): (WebKit::RemoteRenderBundleEncoder::drawIndexedIndirect): (WebKit::RemoteRenderBundleEncoder::setBindGroup): (WebKit::RemoteRenderBundleEncoder::finish): (WebKit::RemoteRenderBundleEncoder::~RemoteRenderBundleEncoder): Deleted. * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.h: * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.cpp: (WebKit::RemoteRenderPassEncoder::RemoteRenderPassEncoder): (WebKit::RemoteRenderPassEncoder::setPipeline): (WebKit::RemoteRenderPassEncoder::setIndexBuffer): (WebKit::RemoteRenderPassEncoder::setVertexBuffer): (WebKit::RemoteRenderPassEncoder::drawIndirect): (WebKit::RemoteRenderPassEncoder::drawIndexedIndirect): (WebKit::RemoteRenderPassEncoder::setBindGroup): (WebKit::RemoteRenderPassEncoder::setBlendConstant): (WebKit::RemoteRenderPassEncoder::beginPipelineStatisticsQuery): (WebKit::RemoteRenderPassEncoder::executeBundles): (WebKit::RemoteRenderPassEncoder::~RemoteRenderPassEncoder): Deleted. * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.h: * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.cpp: (WebKit::RemoteRenderPipeline::RemoteRenderPipeline): (WebKit::RemoteRenderPipeline::getBindGroupLayout): (WebKit::RemoteRenderPipeline::~RemoteRenderPipeline): Deleted. * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.h: * GPUProcess/graphics/WebGPU/RemoteSampler.cpp: (WebKit::RemoteSampler::RemoteSampler): (WebKit::RemoteSampler::~RemoteSampler): Deleted. * GPUProcess/graphics/WebGPU/RemoteSampler.h: * GPUProcess/graphics/WebGPU/RemoteShaderModule.cpp: (WebKit::RemoteShaderModule::RemoteShaderModule): (WebKit::RemoteShaderModule::~RemoteShaderModule): Deleted. * GPUProcess/graphics/WebGPU/RemoteShaderModule.h: * GPUProcess/graphics/WebGPU/RemoteTexture.cpp: (WebKit::RemoteTexture::RemoteTexture): (WebKit::RemoteTexture::createView): (WebKit::RemoteTexture::~RemoteTexture): Deleted. * GPUProcess/graphics/WebGPU/RemoteTexture.h: * GPUProcess/graphics/WebGPU/RemoteTextureView.cpp: (WebKit::RemoteTextureView::RemoteTextureView): (WebKit::RemoteTextureView::~RemoteTextureView): Deleted. * GPUProcess/graphics/WebGPU/RemoteTextureView.h: * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.cpp: (WebKit::WebGPU::ObjectHeap::addObject): (WebKit::WebGPU::ObjectHeap::removeObject): (WebKit::WebGPU::ObjectHeap::convertAdapterFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertDeviceFromBacking): (WebKit::WebGPU::ObjectHeap::convertExternalTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertPipelineLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertQuerySetFromBacking): (WebKit::WebGPU::ObjectHeap::convertQueueFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertSamplerFromBacking): (WebKit::WebGPU::ObjectHeap::convertShaderModuleFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureViewFromBacking): * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.h: * GPUProcess/graphics/WebGPU/WebGPUObjectRegistry.cpp: Removed. * GPUProcess/graphics/WebGPU/WebGPUObjectRegistry.h: Removed. * GPUProcess/media/RemoteAudioSourceProviderProxy.cpp: (WebKit::RemoteAudioSourceProviderProxy::create): (WebKit::RemoteAudioSourceProviderProxy::createRingBuffer): (WebKit::RemoteAudioSourceProviderProxy::storageChanged): * Platform/IPC/ScopedActiveMessageReceiveQueue.h: * Shared/WebGPU/WebGPUConvertFromBackingContext.h: * Sources.txt: * WebKit.xcodeproj/project.pbxproj: 2021-11-29 Myles C. Maxfield [WebGPU] Provide default values for descriptor struct members https://bugs.webkit.org/show_bug.cgi?id=233431 Reviewed by Alex Christensen. No new tests because there is no behavior change. * Shared/WebGPU/WebGPUBindGroupEntry.h: * Shared/WebGPU/WebGPUBindGroupLayoutEntry.h: * Shared/WebGPU/WebGPUBlendComponent.h: * Shared/WebGPU/WebGPUBufferBinding.h: * Shared/WebGPU/WebGPUBufferBindingLayout.h: * Shared/WebGPU/WebGPUBufferDescriptor.h: * Shared/WebGPU/WebGPUCanvasConfiguration.h: * Shared/WebGPU/WebGPUColor.h: * Shared/WebGPU/WebGPUColorTargetState.h: * Shared/WebGPU/WebGPUCompilationMessage.h: * Shared/WebGPU/WebGPUComputePassTimestampWrites.h: * Shared/WebGPU/WebGPUDepthStencilState.h: * Shared/WebGPU/WebGPUExtent3D.h: * Shared/WebGPU/WebGPUExternalTextureDescriptor.h: * Shared/WebGPU/WebGPUImageCopyTexture.h: * Shared/WebGPU/WebGPUImageCopyTextureTagged.h: * Shared/WebGPU/WebGPUImageDataLayout.h: * Shared/WebGPU/WebGPUMultisampleState.h: * Shared/WebGPU/WebGPUOrigin2D.h: * Shared/WebGPU/WebGPUOrigin3D.h: * Shared/WebGPU/WebGPUPrimitiveState.h: * Shared/WebGPU/WebGPUQuerySetDescriptor.h: * Shared/WebGPU/WebGPURenderBundleEncoderDescriptor.h: * Shared/WebGPU/WebGPURenderPassColorAttachment.h: * Shared/WebGPU/WebGPURenderPassDepthStencilAttachment.h: * Shared/WebGPU/WebGPURenderPassLayout.h: * Shared/WebGPU/WebGPURenderPassTimestampWrites.h: * Shared/WebGPU/WebGPURequestAdapterOptions.h: * Shared/WebGPU/WebGPUSamplerBindingLayout.h: * Shared/WebGPU/WebGPUSamplerDescriptor.h: * Shared/WebGPU/WebGPUStencilFaceState.h: * Shared/WebGPU/WebGPUStorageTextureBindingLayout.h: * Shared/WebGPU/WebGPUTextureBindingLayout.h: * Shared/WebGPU/WebGPUTextureDescriptor.h: * Shared/WebGPU/WebGPUTextureViewDescriptor.h: * Shared/WebGPU/WebGPUVertexAttribute.h: * Shared/WebGPU/WebGPUVertexBufferLayout.h: 2021-11-29 Chris Dumez Make support for WebKitAdditions in Framework headers conditional based on deployment target https://bugs.webkit.org/show_bug.cgi?id=233566 Reviewed by Wenson Hsieh. Only support using WebKitAdditions in framework headers on macOS 12+, iOS 16+, tvOS 16+ and watchOS 9+. * mac/replace-webkit-additions-includes.py: (is_supported_os): (main): 2021-11-24 Antoine Quint [Model] clean up compile-time flags and condition IDL methods behind them https://bugs.webkit.org/show_bug.cgi?id=233407 Reviewed by Tim Horton. On top of adopting the changes made to flags in wtf/PlatformEnableCocoa.h and wtf/PlatformHave.h, we condition the definition of code related to IDL methods recently added to HTMLModelElement by the new set of ENABLE_MODEL_ELEMENT_XXX_CONTROL flags, uncluding WebPageProxy messages allowing for this feature to work. * Shared/ModelIdentifier.h: (WebKit::ModelIdentifier::encode const): (WebKit::ModelIdentifier::decode): * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::previewHasCameraSupport): (WebKit::ModelElementController::getCameraForModelElement): (WebKit::ModelElementController::setCameraForModelElement): (WebKit::previewHasAnimationSupport): (WebKit::ModelElementController::isPlayingAnimationForModelElement): (WebKit::ModelElementController::setAnimationIsPlayingForModelElement): (WebKit::ModelElementController::isLoopingAnimationForModelElement): (WebKit::ModelElementController::setIsLoopingAnimationForModelElement): (WebKit::ModelElementController::animationDurationForModelElement): (WebKit::ModelElementController::animationCurrentTimeForModelElement): (WebKit::ModelElementController::setAnimationCurrentTimeForModelElement): (WebKit::previewHasAudioSupport): (WebKit::ModelElementController::hasAudioForModelElement): (WebKit::ModelElementController::isMutedForModelElement): (WebKit::ModelElementController::setIsMutedForModelElement): * UIProcess/ModelElementController.h: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WKModelInteractionGestureRecognizer.h: * UIProcess/ios/WKModelInteractionGestureRecognizer.mm: * UIProcess/ios/WKModelView.h: * UIProcess/ios/WKModelView.mm: * WebProcess/Model/ARKitInlinePreviewModelPlayer.h: * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: * WebProcess/Model/WebModelPlayerProvider.cpp: (WebKit::WebModelPlayerProvider::createModelPlayer): * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.h: * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.mm: * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h: * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm: (WebKit::ARKitInlinePreviewModelPlayerMac::supportsMouseInteraction): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setWebsiteDataStoreParameters): 2021-11-29 Myles C. Maxfield [WebGPU] IPC class refactorings https://bugs.webkit.org/show_bug.cgi?id=233546 Reviewed by Dean Jackson. Make classes fast allocated. Also, make the root() function recursive, instead of hardcoding each class's distance from the root. RemoteGPUProxy has to be in the WebKit namespace, rather than the WebKit::WebGPU namespace, because it will be a message receiver, and our code generator doesn't know anything about the nested namespace. Also make sure that async functions call their callbacks in every codepath. No new tests because there is no behavior change. * GPUProcess/graphics/WebGPU/RemoteAdapter.h: * GPUProcess/graphics/WebGPU/RemoteBindGroup.h: * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.h: * GPUProcess/graphics/WebGPU/RemoteBuffer.h: * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.h: * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.h: * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.h: * GPUProcess/graphics/WebGPU/RemoteComputePipeline.h: * GPUProcess/graphics/WebGPU/RemoteDevice.h: * GPUProcess/graphics/WebGPU/RemoteExternalTexture.h: * GPUProcess/graphics/WebGPU/RemoteGPU.h: * GPUProcess/graphics/WebGPU/RemotePipelineLayout.h: * GPUProcess/graphics/WebGPU/RemoteQuerySet.h: * GPUProcess/graphics/WebGPU/RemoteQueue.h: * GPUProcess/graphics/WebGPU/RemoteRenderBundle.h: * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.h: * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.h: * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.h: * GPUProcess/graphics/WebGPU/RemoteSampler.h: * GPUProcess/graphics/WebGPU/RemoteShaderModule.h: * GPUProcess/graphics/WebGPU/RemoteTexture.h: * GPUProcess/graphics/WebGPU/RemoteTextureView.h: * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.h: * GPUProcess/graphics/WebGPU/WebGPUObjectRegistry.h: * WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupLayoutProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteBufferProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteCommandBufferProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteCommandEncoderProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteComputePassEncoderProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteComputePipelineProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteExternalTextureProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp: (WebKit::RemoteGPUProxy::requestAdapter): (WebKit::WebGPU::RemoteGPUProxy::RemoteGPUProxy): Deleted. (WebKit::WebGPU::RemoteGPUProxy::~RemoteGPUProxy): Deleted. (WebKit::WebGPU::RemoteGPUProxy::requestAdapter): Deleted. * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.h: * WebProcess/GPU/graphics/WebGPU/RemotePipelineLayoutProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteQuerySetProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleEncoderProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteRenderPassEncoderProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteRenderPipelineProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteSamplerProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteShaderModuleProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteTextureViewProxy.h: * WebProcess/GPU/graphics/WebGPU/WebGPUDowncastConvertToBackingContext.h: 2021-11-29 Brent Fulgham Create a new XPC service with specific entitlements to support Captive Portal use cases https://bugs.webkit.org/show_bug.cgi?id=233388 Reviewed by Per Arne Vollan. This initial patch builds a new XPC service with entitlements tailored to our Captive Portal use case. * Configurations/WebContentService.CaptivePortal.xcconfig: Added. * Configurations/WebContentService.xcconfig: * Scripts/process-entitlements.sh: Add new sections for captive portal mode * WebKit.xcodeproj/project.pbxproj: Add new configuration file. 2021-11-29 Youenn Fablet Apply WebPreferences on ServiceWorker settings https://bugs.webkit.org/show_bug.cgi?id=233466 Reviewed by Chris Dumez. Make WebPage::updateSettingsGenerated as static to reuse it in service worker code path just after creation of the dummy Page attached to each service worker. This allows correct initialization of the settings that are then used by the service worker. * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb: * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: 2021-11-29 Chris Dumez Make WebKitCaptivePortalModeEnabled user default work on macOS https://bugs.webkit.org/show_bug.cgi?id=233560 Reviewed by Anders Carlsson. Make WebKitCaptivePortalModeEnabled user default work on macOS, not just iOS. This helps with testing. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/WebProcessPool.cpp: 2021-11-29 Kimmo Kinnunen GPUP GraphicsContextGL creation failure cannot be detected https://bugs.webkit.org/show_bug.cgi?id=233517 Reviewed by Antti Koivisto. If GPUP `GraphicsContextGL` creation fails, return nullptr instead of trying to create a in-process context. Enable `WebChromeClient::createGraphicsContextGL()` call for non-GPU process compilation, as the function is now always called. Returning nullptr signifies failure to create the context, not a signal to retry some other type. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createGraphicsContextGL const): * WebProcess/WebCoreSupport/WebChromeClient.h: 2021-11-28 Myles C. Maxfield [WebGPU] Add WebKit DerivedSources to Xcode project https://bugs.webkit.org/show_bug.cgi?id=233544 Reviewed by Simon Fraser. This allows for things like searching from the UI to work. No new tests because there is no behavior change. * WebKit.xcodeproj/project.pbxproj: 2021-11-26 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.35.1 release * wpe/NEWS: Add release notes for 2.35.1. 2021-11-26 Adrian Perez de Castro Non-unified build fixes, late November 2021 edition https://bugs.webkit.org/show_bug.cgi?id=233493 Unreviewed non-unified build fixes. * WebProcess/Network/webrtc/RTCDataChannelRemoteManager.h: Add missing WebCore/ProcessQualified.h header. 2021-11-25 Kimmo Kinnunen GraphicsContextGL implementations should have separate class definitions https://bugs.webkit.org/show_bug.cgi?id=233491 Reviewed by Antti Koivisto. Use the new concrete classes GraphicsContextGLCocoa and GraphicsContextGLTextureMapper in GPUP WebGL implemetation. Remove GPUProcessGraphicsContextGL as the added functionality is now in the GraphicsContextGLCocoa. * GPUProcess/graphics/GPUProcessGraphicsContextGL.h: Removed. * GPUProcess/graphics/RemoteGraphicsContextGL.h: * GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp: (WebKit::RemoteGraphicsContextGLCocoa::platformWorkQueueInitialize): * GPUProcess/graphics/RemoteGraphicsContextGLWin.cpp: (WebKit::RemoteGraphicsContextGLWin::platformWorkQueueInitialize): * WebKit.xcodeproj/project.pbxproj: 2021-11-25 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.35.1 release * gtk/NEWS: Add release notes for 2.35.1. 2021-11-23 Don Olmstead Non-unified build fixes, mid November 2021 edition https://bugs.webkit.org/show_bug.cgi?id=233450 Unreviewed non-unified build fixes. * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.cpp: 2021-11-23 Alexander Mikhaylenko [GTK] Effective appearance doesn't update on the old process after PSON https://bugs.webkit.org/show_bug.cgi?id=233451 Reviewed by Michael Catanzaro. When reinitializing a WebPage, we get effective appearance from the page creation parameters. Actually apply them. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::reinitializeWebPage): 2021-11-23 Carlos Garcia Campos [GTK] Many network process crashes when running WPT tests https://bugs.webkit.org/show_bug.cgi?id=232629 Reviewed by Martin Robinson. For some reason there's a runtime critical warning coming from GLib under flatpak when trying to inherit the current thread scheduler settings in newly created ones. As a workaround we don't use QOS::Background for network cache background IO queue when running under flatpak. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::qosForBackgroundIOQueue): (WebKit::NetworkCache::Storage::Storage): 2021-11-23 Carlos Garcia Campos [GTK] Change hardware-acceleration-policy setting default value to always https://bugs.webkit.org/show_bug.cgi?id=233418 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): 2021-11-22 Wenson Hsieh Remove old concurrent display list logic that's no longer necessary https://bugs.webkit.org/show_bug.cgi?id=233433 Reviewed by Sam Weinig. See WebCore ChangeLog for more details. * GPUProcess/graphics/DisplayListReaderHandle.cpp: Removed. * GPUProcess/graphics/DisplayListReaderHandle.h: Removed. * GPUProcess/graphics/RemoteRenderingBackend.h: * GPUProcess/graphics/RemoteRenderingBackendState.h: Removed. * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.cpp: Add missing include to fix the build with unified sources. * Shared/GPUProcessWakeupMessageArguments.h: Removed. * Shared/SharedDisplayListHandle.h: Removed. * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/DisplayListWriterHandle.cpp: Removed. * WebProcess/GPU/graphics/DisplayListWriterHandle.h: Removed. * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h: * WebProcess/Network/webrtc/LibWebRTCNetworkManager.h: Add another missing include to fix the build with unified sources. 2021-11-22 Fujii Hironori [MSVC] IPC\DaemonConnection.h(80): warning C4661: 'void WebKit::Daemon::ConnectionToMachService::initializeConnectionIfNeeded(void) const': no suitable definition provided for explicit template instantiation request https://bugs.webkit.org/show_bug.cgi?id=233413 Reviewed by Ross Kirsling. WinCairo build reports the following warnings. > Source\WebKit\Platform\IPC\DaemonConnection.h(80): warning C4661: 'void WebKit::Daemon::ConnectionToMachService::initializeConnectionIfNeeded(void) const': no suitable definition provided for explicit template instantiation request > Source\WebKit\Platform\IPC\DaemonConnection.h(77): note: see declaration of 'WebKit::Daemon::ConnectionToMachService::initializeConnectionIfNeeded' > Source\WebKit\Platform/IPC/DaemonConnection.cpp(40): warning C4661: 'void WebKit::Daemon::ConnectionToMachService::initializeConnectionIfNeeded(void) const': no suitable definition provided for explicit template instantiation request > Source\WebKit\Platform\IPC\DaemonConnection.h(77): note: see declaration of 'WebKit::Daemon::ConnectionToMachService::initializeConnectionIfNeeded' * Platform/IPC/DaemonConnection.cpp: (WebKit::Daemon::ConnectionToMachService::initializeConnectionIfNeeded const): Added. 2021-11-20 Myles C. Maxfield [WebGPU] Send WebGPU messages in the web process https://bugs.webkit.org/show_bug.cgi?id=233396 Reviewed by Dean Jackson. This hooks up our Remote***Proxy() WebGPU implementation to the serializable structs. There are 2 pieces: adding converter functions from PAL::WebGPU::X to WebKit::WebGPU::X structs (which are serializable) and actually calling the send() function itself. Because streaming IPC doesn't support async replies yet, all the async calls are currently sync in this patch. I'll be adding support for async streaming messages in a subsequent patch, which will migrate callers to use sendAsync() instead of sendSync(). No new tests because there is no behavior change yet. This is the last untested foundational patch in the series. All subsequent WebGPU patches should have tests. * GPUProcess/graphics/WebGPU/RemoteGPU.cpp: (WebKit::RemoteGPU::requestAdapter): * GPUProcess/graphics/WebGPU/RemoteGPU.h: * GPUProcess/graphics/WebGPU/RemoteGPU.messages.in: * Shared/WebGPU/WebGPUBindGroupDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUBindGroupEntry.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUBindGroupLayoutEntry.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUBlendComponent.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUBlendState.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUBufferBinding.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUBufferBindingLayout.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUBufferDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUCanvasConfiguration.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUColor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUColorTargetState.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUCommandBufferDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUCommandEncoderDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUCompilationMessage.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUComputePassDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUComputePassTimestampWrites.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUComputePipelineDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUConvertToBackingContext.h: * Shared/WebGPU/WebGPUDepthStencilState.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUDeviceDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUError.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUExtent3D.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUExternalTextureBindingLayout.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUExternalTextureDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUFragmentState.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUImageCopyBuffer.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyExternalImage.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUImageCopyTexture.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyTextureTagged.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUImageDataLayout.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUMultisampleState.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUObjectDescriptorBase.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUOrigin2D.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUOrigin3D.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUOutOfMemoryError.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUPipelineDescriptorBase.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUPipelineLayoutDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUPrimitiveState.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUProgrammableStage.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUQuerySetDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPURenderBundleDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPURenderBundleEncoderDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPURenderPassColorAttachment.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassDepthStencilAttachment.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPURenderPassLayout.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPURenderPassTimestampWrites.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPURenderPipelineDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPURequestAdapterOptions.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUSamplerBindingLayout.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUSamplerDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUShaderModuleDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUStencilFaceState.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUStorageTextureBindingLayout.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUSupportedFeatures.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUSupportedLimits.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUTextureBindingLayout.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUTextureDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUTextureViewDescriptor.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUValidationError.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUVertexAttribute.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUVertexBufferLayout.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * Shared/WebGPU/WebGPUVertexState.cpp: (WebKit::WebGPU::ConvertToBackingContext::convertToBacking): * WebKit.xcodeproj/xcshareddata/xcschemes/WebKit.xcscheme: * WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.cpp: (WebKit::WebGPU::RemoteAdapterProxy::RemoteAdapterProxy): (WebKit::WebGPU::RemoteAdapterProxy::requestDevice): * WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupLayoutProxy.cpp: (WebKit::WebGPU::RemoteBindGroupLayoutProxy::RemoteBindGroupLayoutProxy): (WebKit::WebGPU::RemoteBindGroupLayoutProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupLayoutProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupProxy.cpp: (WebKit::WebGPU::RemoteBindGroupProxy::RemoteBindGroupProxy): (WebKit::WebGPU::RemoteBindGroupProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteBufferProxy.cpp: (WebKit::WebGPU::RemoteBufferProxy::RemoteBufferProxy): (WebKit::WebGPU::RemoteBufferProxy::mapAsync): (WebKit::WebGPU::RemoteBufferProxy::getMappedRange): (WebKit::WebGPU::RemoteBufferProxy::unmap): (WebKit::WebGPU::RemoteBufferProxy::destroy): (WebKit::WebGPU::RemoteBufferProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteBufferProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteCommandBufferProxy.cpp: (WebKit::WebGPU::RemoteCommandBufferProxy::RemoteCommandBufferProxy): (WebKit::WebGPU::RemoteCommandBufferProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteCommandBufferProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteCommandEncoderProxy.cpp: (WebKit::WebGPU::RemoteCommandEncoderProxy::RemoteCommandEncoderProxy): (WebKit::WebGPU::RemoteCommandEncoderProxy::beginRenderPass): (WebKit::WebGPU::RemoteCommandEncoderProxy::beginComputePass): (WebKit::WebGPU::RemoteCommandEncoderProxy::copyBufferToBuffer): (WebKit::WebGPU::RemoteCommandEncoderProxy::copyBufferToTexture): (WebKit::WebGPU::RemoteCommandEncoderProxy::copyTextureToBuffer): (WebKit::WebGPU::RemoteCommandEncoderProxy::copyTextureToTexture): (WebKit::WebGPU::RemoteCommandEncoderProxy::fillBuffer): (WebKit::WebGPU::RemoteCommandEncoderProxy::pushDebugGroup): (WebKit::WebGPU::RemoteCommandEncoderProxy::popDebugGroup): (WebKit::WebGPU::RemoteCommandEncoderProxy::insertDebugMarker): (WebKit::WebGPU::RemoteCommandEncoderProxy::writeTimestamp): (WebKit::WebGPU::RemoteCommandEncoderProxy::resolveQuerySet): (WebKit::WebGPU::RemoteCommandEncoderProxy::finish): (WebKit::WebGPU::RemoteCommandEncoderProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteCommandEncoderProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteComputePassEncoderProxy.cpp: (WebKit::WebGPU::RemoteComputePassEncoderProxy::RemoteComputePassEncoderProxy): (WebKit::WebGPU::RemoteComputePassEncoderProxy::setPipeline): (WebKit::WebGPU::RemoteComputePassEncoderProxy::dispatch): (WebKit::WebGPU::RemoteComputePassEncoderProxy::dispatchIndirect): (WebKit::WebGPU::RemoteComputePassEncoderProxy::beginPipelineStatisticsQuery): (WebKit::WebGPU::RemoteComputePassEncoderProxy::endPipelineStatisticsQuery): (WebKit::WebGPU::RemoteComputePassEncoderProxy::endPass): (WebKit::WebGPU::RemoteComputePassEncoderProxy::setBindGroup): (WebKit::WebGPU::RemoteComputePassEncoderProxy::pushDebugGroup): (WebKit::WebGPU::RemoteComputePassEncoderProxy::popDebugGroup): (WebKit::WebGPU::RemoteComputePassEncoderProxy::insertDebugMarker): (WebKit::WebGPU::RemoteComputePassEncoderProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteComputePassEncoderProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteComputePipelineProxy.cpp: (WebKit::WebGPU::RemoteComputePipelineProxy::RemoteComputePipelineProxy): (WebKit::WebGPU::RemoteComputePipelineProxy::getBindGroupLayout): (WebKit::WebGPU::RemoteComputePipelineProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteComputePipelineProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.cpp: (WebKit::WebGPU::RemoteDeviceProxy::RemoteDeviceProxy): (WebKit::WebGPU::RemoteDeviceProxy::createBuffer): (WebKit::WebGPU::RemoteDeviceProxy::createTexture): (WebKit::WebGPU::RemoteDeviceProxy::createSampler): (WebKit::WebGPU::RemoteDeviceProxy::importExternalTexture): (WebKit::WebGPU::RemoteDeviceProxy::createBindGroupLayout): (WebKit::WebGPU::RemoteDeviceProxy::createPipelineLayout): (WebKit::WebGPU::RemoteDeviceProxy::createBindGroup): (WebKit::WebGPU::RemoteDeviceProxy::createShaderModule): (WebKit::WebGPU::RemoteDeviceProxy::createComputePipeline): (WebKit::WebGPU::RemoteDeviceProxy::createRenderPipeline): (WebKit::WebGPU::RemoteDeviceProxy::createComputePipelineAsync): (WebKit::WebGPU::RemoteDeviceProxy::createRenderPipelineAsync): (WebKit::WebGPU::RemoteDeviceProxy::createCommandEncoder): (WebKit::WebGPU::RemoteDeviceProxy::createRenderBundleEncoder): (WebKit::WebGPU::RemoteDeviceProxy::createQuerySet): (WebKit::WebGPU::RemoteDeviceProxy::pushErrorScope): (WebKit::WebGPU::RemoteDeviceProxy::popErrorScope): (WebKit::WebGPU::RemoteDeviceProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteExternalTextureProxy.cpp: (WebKit::WebGPU::RemoteExternalTextureProxy::RemoteExternalTextureProxy): (WebKit::WebGPU::RemoteExternalTextureProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteExternalTextureProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp: (WebKit::WebGPU::RemoteGPUProxy::RemoteGPUProxy): (WebKit::WebGPU::RemoteGPUProxy::requestAdapter): * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.h: * WebProcess/GPU/graphics/WebGPU/RemotePipelineLayoutProxy.cpp: (WebKit::WebGPU::RemotePipelineLayoutProxy::RemotePipelineLayoutProxy): (WebKit::WebGPU::RemotePipelineLayoutProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemotePipelineLayoutProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteQuerySetProxy.cpp: (WebKit::WebGPU::RemoteQuerySetProxy::RemoteQuerySetProxy): (WebKit::WebGPU::RemoteQuerySetProxy::destroy): (WebKit::WebGPU::RemoteQuerySetProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteQuerySetProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.cpp: (WebKit::WebGPU::RemoteQueueProxy::RemoteQueueProxy): (WebKit::WebGPU::RemoteQueueProxy::submit): (WebKit::WebGPU::RemoteQueueProxy::onSubmittedWorkDone): (WebKit::WebGPU::RemoteQueueProxy::writeBuffer): (WebKit::WebGPU::RemoteQueueProxy::writeTexture): (WebKit::WebGPU::RemoteQueueProxy::copyExternalImageToTexture): (WebKit::WebGPU::RemoteQueueProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleEncoderProxy.cpp: (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::RemoteRenderBundleEncoderProxy): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setPipeline): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setIndexBuffer): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setVertexBuffer): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::draw): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::drawIndexed): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::drawIndirect): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::drawIndexedIndirect): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setBindGroup): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::pushDebugGroup): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::popDebugGroup): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::insertDebugMarker): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::finish): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleEncoderProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleProxy.cpp: (WebKit::WebGPU::RemoteRenderBundleProxy::RemoteRenderBundleProxy): (WebKit::WebGPU::RemoteRenderBundleProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteRenderPassEncoderProxy.cpp: (WebKit::WebGPU::RemoteRenderPassEncoderProxy::RemoteRenderPassEncoderProxy): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setPipeline): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setIndexBuffer): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setVertexBuffer): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::draw): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::drawIndexed): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::drawIndirect): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::drawIndexedIndirect): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setBindGroup): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::pushDebugGroup): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::popDebugGroup): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::insertDebugMarker): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setViewport): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setScissorRect): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setBlendConstant): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setStencilReference): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::beginOcclusionQuery): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::endOcclusionQuery): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::beginPipelineStatisticsQuery): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::endPipelineStatisticsQuery): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::executeBundles): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::endPass): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteRenderPassEncoderProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteRenderPipelineProxy.cpp: (WebKit::WebGPU::RemoteRenderPipelineProxy::RemoteRenderPipelineProxy): (WebKit::WebGPU::RemoteRenderPipelineProxy::getBindGroupLayout): (WebKit::WebGPU::RemoteRenderPipelineProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteRenderPipelineProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteSamplerProxy.cpp: (WebKit::WebGPU::RemoteSamplerProxy::RemoteSamplerProxy): (WebKit::WebGPU::RemoteSamplerProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteSamplerProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteShaderModuleProxy.cpp: (WebKit::WebGPU::RemoteShaderModuleProxy::RemoteShaderModuleProxy): (WebKit::WebGPU::RemoteShaderModuleProxy::compilationInfo): (WebKit::WebGPU::RemoteShaderModuleProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteShaderModuleProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp: (WebKit::WebGPU::RemoteTextureProxy::RemoteTextureProxy): (WebKit::WebGPU::RemoteTextureProxy::createView): (WebKit::WebGPU::RemoteTextureProxy::destroy): (WebKit::WebGPU::RemoteTextureProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteTextureViewProxy.cpp: (WebKit::WebGPU::RemoteTextureViewProxy::RemoteTextureViewProxy): (WebKit::WebGPU::RemoteTextureViewProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteTextureViewProxy.h: * WebProcess/GPU/graphics/WebGPU/WebGPUDowncastConvertToBackingContext.cpp: (WebKit::WebGPU::DowncastConvertToBackingContext::convertToBacking): * WebProcess/GPU/graphics/WebGPU/WebGPUDowncastConvertToBackingContext.h: 2021-11-20 Jean-Yves Avenard Remove unnecessary flattening of SharedBuffer when sending them over IPC https://bugs.webkit.org/show_bug.cgi?id=233363 rdar://85600684 Reviewed by Sam Weinig. In several places, a SharedMemory was allocated followed by a copy. To perform this copy, the SharedBuffer was flattened which could involve a memory allocation followed by a copy of all segments into the final vector. We instead make use of SharedBuffer::copyBuffer convenience method which will simply copy the individual segment into the newly allocated SharedMemory. No change in user observable behaviour. Fly-by fix: SharedMemory::allocate is fallible; few instances didn't check the returned value. So test that it succeeded and prevent a crash (null deref) * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardBufferForType): (WebKit::WebPasteboardProxy::readBufferFromPasteboard): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::setBufferForType): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performActionOnElement): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::getDataSelectionForPasteboard): 2021-11-20 Carlos Garcia Campos Report the initiating url instead of the redirected one https://bugs.webkit.org/show_bug.cgi?id=233037 Reviewed by Brent Fulgham. Pass pre-redirect URL to allowChildContextFromSource() and allowScriptFromSource(). * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): 2021-11-19 Myles C. Maxfield [WebGPU] Implement GPU process's message receivers https://bugs.webkit.org/show_bug.cgi?id=233358 Reviewed by Dean Jackson. The message receivers have two helper objects: 1. ObjectHeap, which owns all the message receivers. There is intended to be only one of them per document. 2. ObjectRegistry, which doesn't own anything, but maintains a mapping from WebGPUIdentifiers to objects. This registry is necessary because when an object needs to be destroyed, we have to look up which object it is by ID. Beyond that, this patch just hooks up those two message receivers, and then forwards all received messages to the virtual interface that implements WebGPU. No new tests because there is no behavior change. * GPUProcess/graphics/WebGPU/RemoteAdapter.cpp: (WebKit::RemoteAdapter::RemoteAdapter): (WebKit::RemoteAdapter::~RemoteAdapter): (WebKit::RemoteAdapter::requestDevice): * GPUProcess/graphics/WebGPU/RemoteAdapter.h: * GPUProcess/graphics/WebGPU/RemoteBindGroup.cpp: (WebKit::RemoteBindGroup::RemoteBindGroup): (WebKit::RemoteBindGroup::~RemoteBindGroup): (WebKit::RemoteBindGroup::setLabel): * GPUProcess/graphics/WebGPU/RemoteBindGroup.h: * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.cpp: (WebKit::RemoteBindGroupLayout::RemoteBindGroupLayout): (WebKit::RemoteBindGroupLayout::~RemoteBindGroupLayout): (WebKit::RemoteBindGroupLayout::setLabel): * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.h: * GPUProcess/graphics/WebGPU/RemoteBuffer.cpp: (WebKit::RemoteBuffer::RemoteBuffer): (WebKit::RemoteBuffer::~RemoteBuffer): (WebKit::RemoteBuffer::mapAsync): (WebKit::RemoteBuffer::unmap): (WebKit::RemoteBuffer::destroy): (WebKit::RemoteBuffer::setLabel): * GPUProcess/graphics/WebGPU/RemoteBuffer.h: * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.cpp: (WebKit::RemoteCommandBuffer::RemoteCommandBuffer): (WebKit::RemoteCommandBuffer::~RemoteCommandBuffer): (WebKit::RemoteCommandBuffer::setLabel): * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.h: * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.cpp: (WebKit::RemoteCommandEncoder::RemoteCommandEncoder): (WebKit::RemoteCommandEncoder::~RemoteCommandEncoder): (WebKit::RemoteCommandEncoder::beginRenderPass): (WebKit::RemoteCommandEncoder::beginComputePass): (WebKit::RemoteCommandEncoder::copyBufferToBuffer): (WebKit::RemoteCommandEncoder::copyBufferToTexture): (WebKit::RemoteCommandEncoder::copyTextureToBuffer): (WebKit::RemoteCommandEncoder::copyTextureToTexture): (WebKit::RemoteCommandEncoder::fillBuffer): (WebKit::RemoteCommandEncoder::pushDebugGroup): (WebKit::RemoteCommandEncoder::popDebugGroup): (WebKit::RemoteCommandEncoder::insertDebugMarker): (WebKit::RemoteCommandEncoder::writeTimestamp): (WebKit::RemoteCommandEncoder::resolveQuerySet): (WebKit::RemoteCommandEncoder::finish): (WebKit::RemoteCommandEncoder::setLabel): * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.h: * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.cpp: (WebKit::RemoteComputePassEncoder::RemoteComputePassEncoder): (WebKit::RemoteComputePassEncoder::~RemoteComputePassEncoder): (WebKit::RemoteComputePassEncoder::setPipeline): (WebKit::RemoteComputePassEncoder::dispatch): (WebKit::RemoteComputePassEncoder::dispatchIndirect): (WebKit::RemoteComputePassEncoder::beginPipelineStatisticsQuery): (WebKit::RemoteComputePassEncoder::endPipelineStatisticsQuery): (WebKit::RemoteComputePassEncoder::endPass): (WebKit::RemoteComputePassEncoder::setBindGroup): (WebKit::RemoteComputePassEncoder::pushDebugGroup): (WebKit::RemoteComputePassEncoder::popDebugGroup): (WebKit::RemoteComputePassEncoder::insertDebugMarker): (WebKit::RemoteComputePassEncoder::setLabel): * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.h: * GPUProcess/graphics/WebGPU/RemoteComputePipeline.cpp: (WebKit::RemoteComputePipeline::RemoteComputePipeline): (WebKit::RemoteComputePipeline::~RemoteComputePipeline): (WebKit::RemoteComputePipeline::getBindGroupLayout): (WebKit::RemoteComputePipeline::setLabel): * GPUProcess/graphics/WebGPU/RemoteComputePipeline.h: * GPUProcess/graphics/WebGPU/RemoteDevice.cpp: (WebKit::RemoteDevice::RemoteDevice): (WebKit::RemoteDevice::~RemoteDevice): (WebKit::RemoteDevice::destroy): (WebKit::RemoteDevice::createBuffer): (WebKit::RemoteDevice::createTexture): (WebKit::RemoteDevice::createSampler): (WebKit::RemoteDevice::importExternalTexture): (WebKit::RemoteDevice::createBindGroupLayout): (WebKit::RemoteDevice::createPipelineLayout): (WebKit::RemoteDevice::createBindGroup): (WebKit::RemoteDevice::createShaderModule): (WebKit::RemoteDevice::createComputePipeline): (WebKit::RemoteDevice::createRenderPipeline): (WebKit::RemoteDevice::createComputePipelineAsync): (WebKit::RemoteDevice::createRenderPipelineAsync): (WebKit::RemoteDevice::createCommandEncoder): (WebKit::RemoteDevice::createRenderBundleEncoder): (WebKit::RemoteDevice::createQuerySet): (WebKit::RemoteDevice::pushErrorScope): (WebKit::RemoteDevice::popErrorScope): (WebKit::RemoteDevice::setLabel): * GPUProcess/graphics/WebGPU/RemoteDevice.h: * GPUProcess/graphics/WebGPU/RemoteExternalTexture.cpp: (WebKit::RemoteExternalTexture::RemoteExternalTexture): (WebKit::RemoteExternalTexture::~RemoteExternalTexture): (WebKit::RemoteExternalTexture::setLabel): * GPUProcess/graphics/WebGPU/RemoteExternalTexture.h: * GPUProcess/graphics/WebGPU/RemoteGPU.cpp: (WebKit::RemoteGPU::RemoteGPU): (WebKit::RemoteGPU::~RemoteGPU): (WebKit::RemoteGPU::requestAdapter): * GPUProcess/graphics/WebGPU/RemoteGPU.h: * GPUProcess/graphics/WebGPU/RemoteGPU.messages.in: * GPUProcess/graphics/WebGPU/RemotePipelineLayout.cpp: (WebKit::RemotePipelineLayout::RemotePipelineLayout): (WebKit::RemotePipelineLayout::~RemotePipelineLayout): (WebKit::RemotePipelineLayout::setLabel): * GPUProcess/graphics/WebGPU/RemotePipelineLayout.h: * GPUProcess/graphics/WebGPU/RemoteQuerySet.cpp: (WebKit::RemoteQuerySet::RemoteQuerySet): (WebKit::RemoteQuerySet::~RemoteQuerySet): (WebKit::RemoteQuerySet::destroy): (WebKit::RemoteQuerySet::setLabel): * GPUProcess/graphics/WebGPU/RemoteQuerySet.h: * GPUProcess/graphics/WebGPU/RemoteQueue.cpp: (WebKit::RemoteQueue::RemoteQueue): (WebKit::RemoteQueue::~RemoteQueue): (WebKit::RemoteQueue::submit): (WebKit::RemoteQueue::onSubmittedWorkDone): (WebKit::RemoteQueue::writeBuffer): (WebKit::RemoteQueue::writeTexture): (WebKit::RemoteQueue::copyExternalImageToTexture): (WebKit::RemoteQueue::setLabel): * GPUProcess/graphics/WebGPU/RemoteQueue.h: * GPUProcess/graphics/WebGPU/RemoteRenderBundle.cpp: (WebKit::RemoteRenderBundle::RemoteRenderBundle): (WebKit::RemoteRenderBundle::~RemoteRenderBundle): (WebKit::RemoteRenderBundle::setLabel): * GPUProcess/graphics/WebGPU/RemoteRenderBundle.h: * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.cpp: (WebKit::RemoteRenderBundleEncoder::RemoteRenderBundleEncoder): (WebKit::RemoteRenderBundleEncoder::~RemoteRenderBundleEncoder): (WebKit::RemoteRenderBundleEncoder::setPipeline): (WebKit::RemoteRenderBundleEncoder::setIndexBuffer): (WebKit::RemoteRenderBundleEncoder::setVertexBuffer): (WebKit::RemoteRenderBundleEncoder::draw): (WebKit::RemoteRenderBundleEncoder::drawIndexed): (WebKit::RemoteRenderBundleEncoder::drawIndirect): (WebKit::RemoteRenderBundleEncoder::drawIndexedIndirect): (WebKit::RemoteRenderBundleEncoder::setBindGroup): (WebKit::RemoteRenderBundleEncoder::pushDebugGroup): (WebKit::RemoteRenderBundleEncoder::popDebugGroup): (WebKit::RemoteRenderBundleEncoder::insertDebugMarker): (WebKit::RemoteRenderBundleEncoder::finish): (WebKit::RemoteRenderBundleEncoder::setLabel): * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.h: * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.cpp: (WebKit::RemoteRenderPassEncoder::RemoteRenderPassEncoder): (WebKit::RemoteRenderPassEncoder::~RemoteRenderPassEncoder): (WebKit::RemoteRenderPassEncoder::setPipeline): (WebKit::RemoteRenderPassEncoder::setIndexBuffer): (WebKit::RemoteRenderPassEncoder::setVertexBuffer): (WebKit::RemoteRenderPassEncoder::draw): (WebKit::RemoteRenderPassEncoder::drawIndexed): (WebKit::RemoteRenderPassEncoder::drawIndirect): (WebKit::RemoteRenderPassEncoder::drawIndexedIndirect): (WebKit::RemoteRenderPassEncoder::setBindGroup): (WebKit::RemoteRenderPassEncoder::pushDebugGroup): (WebKit::RemoteRenderPassEncoder::popDebugGroup): (WebKit::RemoteRenderPassEncoder::insertDebugMarker): (WebKit::RemoteRenderPassEncoder::setViewport): (WebKit::RemoteRenderPassEncoder::setScissorRect): (WebKit::RemoteRenderPassEncoder::setBlendConstant): (WebKit::RemoteRenderPassEncoder::setStencilReference): (WebKit::RemoteRenderPassEncoder::beginOcclusionQuery): (WebKit::RemoteRenderPassEncoder::endOcclusionQuery): (WebKit::RemoteRenderPassEncoder::beginPipelineStatisticsQuery): (WebKit::RemoteRenderPassEncoder::endPipelineStatisticsQuery): (WebKit::RemoteRenderPassEncoder::executeBundles): (WebKit::RemoteRenderPassEncoder::endPass): (WebKit::RemoteRenderPassEncoder::setLabel): * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.h: * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.cpp: (WebKit::RemoteRenderPipeline::RemoteRenderPipeline): (WebKit::RemoteRenderPipeline::~RemoteRenderPipeline): (WebKit::RemoteRenderPipeline::getBindGroupLayout): (WebKit::RemoteRenderPipeline::setLabel): * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.h: * GPUProcess/graphics/WebGPU/RemoteSampler.cpp: (WebKit::RemoteSampler::RemoteSampler): (WebKit::RemoteSampler::~RemoteSampler): (WebKit::RemoteSampler::setLabel): * GPUProcess/graphics/WebGPU/RemoteSampler.h: * GPUProcess/graphics/WebGPU/RemoteShaderModule.cpp: (WebKit::RemoteShaderModule::RemoteShaderModule): (WebKit::RemoteShaderModule::~RemoteShaderModule): (WebKit::RemoteShaderModule::compilationInfo): (WebKit::RemoteShaderModule::setLabel): * GPUProcess/graphics/WebGPU/RemoteShaderModule.h: * GPUProcess/graphics/WebGPU/RemoteTexture.cpp: (WebKit::RemoteTexture::RemoteTexture): (WebKit::RemoteTexture::~RemoteTexture): (WebKit::RemoteTexture::createView): (WebKit::RemoteTexture::destroy): (WebKit::RemoteTexture::setLabel): * GPUProcess/graphics/WebGPU/RemoteTexture.h: * GPUProcess/graphics/WebGPU/RemoteTextureView.cpp: (WebKit::RemoteTextureView::RemoteTextureView): (WebKit::RemoteTextureView::~RemoteTextureView): (WebKit::RemoteTextureView::setLabel): * GPUProcess/graphics/WebGPU/RemoteTextureView.h: * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.cpp: (WebKit::WebGPU::ObjectHeap::addObject): (WebKit::WebGPU::ObjectHeap::removeObject): (WebKit::WebGPU::ObjectHeap::convertAdapterFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertBindGroupFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertBindGroupLayoutFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertBufferFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertCommandBufferFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertCommandEncoderFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertComputePassEncoderFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertComputePipelineFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertDeviceFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertExternalTextureFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertGPUFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertPipelineLayoutFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertQuerySetFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertQueueFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertRenderBundleEncoderFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertRenderBundleFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertRenderPassEncoderFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertRenderPipelineFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertSamplerFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertShaderModuleFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertTextureFromBacking): Deleted. (WebKit::WebGPU::ObjectHeap::convertTextureViewFromBacking): Deleted. * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.h: * GPUProcess/graphics/WebGPU/WebGPUObjectRegistry.cpp: Added. (WebKit::WebGPU::ObjectRegistry::ObjectRegistry): (WebKit::WebGPU::ObjectRegistry::~ObjectRegistry): (WebKit::WebGPU::ObjectRegistry::addObject): (WebKit::WebGPU::ObjectRegistry::removeObject): (WebKit::WebGPU::ObjectRegistry::convertAdapterFromBacking): (WebKit::WebGPU::ObjectRegistry::convertBindGroupFromBacking): (WebKit::WebGPU::ObjectRegistry::convertBindGroupLayoutFromBacking): (WebKit::WebGPU::ObjectRegistry::convertBufferFromBacking): (WebKit::WebGPU::ObjectRegistry::convertCommandBufferFromBacking): (WebKit::WebGPU::ObjectRegistry::convertCommandEncoderFromBacking): (WebKit::WebGPU::ObjectRegistry::convertComputePassEncoderFromBacking): (WebKit::WebGPU::ObjectRegistry::convertComputePipelineFromBacking): (WebKit::WebGPU::ObjectRegistry::convertDeviceFromBacking): (WebKit::WebGPU::ObjectRegistry::convertExternalTextureFromBacking): (WebKit::WebGPU::ObjectRegistry::convertGPUFromBacking): (WebKit::WebGPU::ObjectRegistry::convertPipelineLayoutFromBacking): (WebKit::WebGPU::ObjectRegistry::convertQuerySetFromBacking): (WebKit::WebGPU::ObjectRegistry::convertQueueFromBacking): (WebKit::WebGPU::ObjectRegistry::convertRenderBundleEncoderFromBacking): (WebKit::WebGPU::ObjectRegistry::convertRenderBundleFromBacking): (WebKit::WebGPU::ObjectRegistry::convertRenderPassEncoderFromBacking): (WebKit::WebGPU::ObjectRegistry::convertRenderPipelineFromBacking): (WebKit::WebGPU::ObjectRegistry::convertSamplerFromBacking): (WebKit::WebGPU::ObjectRegistry::convertShaderModuleFromBacking): (WebKit::WebGPU::ObjectRegistry::convertTextureFromBacking): (WebKit::WebGPU::ObjectRegistry::convertTextureViewFromBacking): * GPUProcess/graphics/WebGPU/WebGPUObjectRegistry.h: Copied from Source/WebKit/GPUProcess/graphics/WebGPU/WebGPUObjectHeap.h. * Shared/WebGPU/WebGPUConvertFromBackingContext.h: * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebKit.xcodeproj/xcshareddata/xcschemes/WebKit.xcscheme: 2021-11-19 Alex Christensen Implement extension-path variant of redirect action in WKContentRuleList https://bugs.webkit.org/show_bug.cgi?id=233351 Reviewed by Tim Hatcher. * NetworkProcess/NetworkContentRuleListManager.cpp: (WebKit::NetworkContentRuleListManager::addContentRuleLists): * NetworkProcess/NetworkContentRuleListManager.h: * NetworkProcess/NetworkContentRuleListManager.messages.in: * Shared/ServiceWorkerInitializationData.cpp: (WebKit::ServiceWorkerInitializationData::decode): * Shared/ServiceWorkerInitializationData.h: * Shared/UserContentControllerParameters.cpp: (WebKit::UserContentControllerParameters::decode): * Shared/UserContentControllerParameters.h: * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::encode const): (WebKit::WebCompiledContentRuleListData::decode): * Shared/WebCompiledContentRuleListData.h: (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData): * UIProcess/API/APIContentRuleList.cpp: (API::ContentRuleList::ContentRuleList): (API::ContentRuleList::name const): * UIProcess/API/APIContentRuleList.h: * UIProcess/API/APIContentRuleListStore.cpp: (API::createExtension): * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController _addContentRuleList:extensionBaseURL:]): * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::contentExtensionRules): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::contentRuleListData const): (WebKit::WebUserContentControllerProxy::addContentRuleList): * UIProcess/UserContent/WebUserContentControllerProxy.h: (WebKit::WebUserContentControllerProxy::addContentRuleList): (WebKit::WebUserContentControllerProxy::contentExtensionRules): * UIProcess/WebProcessProxy.cpp: (WebKit::contentRuleListsFromIdentifier): * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addContentRuleLists): * WebProcess/UserContent/WebUserContentController.h: * WebProcess/UserContent/WebUserContentController.messages.in: 2021-11-19 Antoine Quint [Model] Use RefPtr across ARKitInlinePreviewModelPlayer when creating strong pointers https://bugs.webkit.org/show_bug.cgi?id=233375 Reviewed by Wenson Hsieh. * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: (WebKit::ARKitInlinePreviewModelPlayer::getCamera): (WebKit::ARKitInlinePreviewModelPlayer::setCamera): (WebKit::ARKitInlinePreviewModelPlayer::isPlayingAnimation): (WebKit::ARKitInlinePreviewModelPlayer::setAnimationIsPlaying): * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.mm: (WebKit::ARKitInlinePreviewModelPlayerIOS::enterFullscreen): * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm: (WebKit::ARKitInlinePreviewModelPlayerMac::load): 2021-11-19 Antoine Quint [Model] Reduce use of callOnMainRunLoop in ModelElementControllerCocoa https://bugs.webkit.org/show_bug.cgi?id=233376 Reviewed by Wenson Hsieh. We only need to use callOnMainRunLoop inside of blocks. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::getCameraForModelElement): (WebKit::ModelElementController::setCameraForModelElement): (WebKit::ModelElementController::isPlayingAnimationForModelElement): (WebKit::ModelElementController::setAnimationIsPlayingForModelElement): 2021-11-19 Chris Dumez Revert r282446 to bring back support for WebKitAdditions in Framework headers https://bugs.webkit.org/show_bug.cgi?id=233374 Reviewed by Wenson Hsieh. * WebKit.xcodeproj/project.pbxproj: * mac/replace-webkit-additions-includes.py: Added. (read_content_from_webkit_additions): (main): 2021-11-19 J Pascoe [WebAuthn] Add headers for [_WKWebAuthenticationPanel makeCredentialWithClientDataHash] and [_WKWebAuthenticationPanel getAssertionWithClientDataHash] https://bugs.webkit.org/show_bug.cgi?id=233371 Reviewed by Brent Fulgham. These SPIs were added in https://bugs.webkit.org/show_bug.cgi?id=233216, but were not added to the header file _WKWebAuthenticationPanel.h, this change adds them. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: 2021-11-19 Myles C. Maxfield [WebGPU] Add converters from serializable descriptors to interface descriptors https://bugs.webkit.org/show_bug.cgi?id=233310 Reviewed by Dean Jackson. * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.cpp: (WebKit::WebGPU::ObjectHeap::convertAdapterFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertDeviceFromBacking): (WebKit::WebGPU::ObjectHeap::convertExternalTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertGPUFromBacking): (WebKit::WebGPU::ObjectHeap::convertPipelineLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertQuerySetFromBacking): (WebKit::WebGPU::ObjectHeap::convertQueueFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertSamplerFromBacking): (WebKit::WebGPU::ObjectHeap::convertShaderModuleFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureViewFromBacking): * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.h: * Scripts/generate-unified-sources.sh: * Shared/WebGPU/WebGPUBindGroupDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUFragmentState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBindGroupDescriptor.h: * Shared/WebGPU/WebGPUBindGroupEntry.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBindGroupDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBindGroupEntry.h: * Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.cpp: Copied from Source/WebCore/Modules/WebGPU/GPUBindGroupLayoutDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.h: * Shared/WebGPU/WebGPUBindGroupLayoutEntry.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBindGroupLayoutEntry.h: * Shared/WebGPU/WebGPUBlendComponent.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBlendComponent.h: * Shared/WebGPU/WebGPUBlendState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBlendState.h: * Shared/WebGPU/WebGPUBufferBinding.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUValidationError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBufferBinding.h: * Shared/WebGPU/WebGPUBufferBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUValidationError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBufferBindingLayout.h: * Shared/WebGPU/WebGPUBufferDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBufferDescriptor.h: * Shared/WebGPU/WebGPUCanvasConfiguration.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUFragmentState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUCanvasConfiguration.h: * Shared/WebGPU/WebGPUColor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUColor.h: * Shared/WebGPU/WebGPUColorTargetState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUColorTargetState.h: * Shared/WebGPU/WebGPUCommandBufferDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUCommandBufferDescriptor.h: * Shared/WebGPU/WebGPUCommandEncoderDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUCommandEncoderDescriptor.h: * Shared/WebGPU/WebGPUCompilationMessage.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUCompilationMessage.h: * Shared/WebGPU/WebGPUComputePassDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUComputePassDescriptor.h: * Shared/WebGPU/WebGPUComputePassTimestampWrites.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUComputePassDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUComputePassTimestampWrites.h: * Shared/WebGPU/WebGPUComputePipelineDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUComputePipelineDescriptor.h: * Shared/WebGPU/WebGPUConvertFromBackingContext.h: * Shared/WebGPU/WebGPUDepthStencilState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUDepthStencilState.h: * Shared/WebGPU/WebGPUDeviceDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUDeviceDescriptor.h: * Shared/WebGPU/WebGPUError.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUOrigin2D.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUError.h: * Shared/WebGPU/WebGPUExtent3D.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUExtent3D.h: * Shared/WebGPU/WebGPUExternalTextureBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUExternalTextureBindingLayout.h: * Shared/WebGPU/WebGPUExternalTextureDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUExternalTextureDescriptor.h: * Shared/WebGPU/WebGPUFragmentState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUPipelineDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUFragmentState.h: * Shared/WebGPU/WebGPUImageCopyBuffer.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyBuffer.h: * Shared/WebGPU/WebGPUImageCopyExternalImage.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyExternalImage.h: * Shared/WebGPU/WebGPUImageCopyTexture.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyTexture.h: * Shared/WebGPU/WebGPUImageCopyTextureTagged.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyTextureTagged.h: * Shared/WebGPU/WebGPUImageDataLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageDataLayout.h: * Shared/WebGPU/WebGPUMultisampleState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUMultisampleState.h: * Shared/WebGPU/WebGPUObjectDescriptorBase.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUObjectDescriptorBase.h: * Shared/WebGPU/WebGPUOrigin2D.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUPipelineLayoutDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUOrigin2D.h: * Shared/WebGPU/WebGPUOrigin3D.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUOrigin3D.h: * Shared/WebGPU/WebGPUOutOfMemoryError.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUOutOfMemoryError.h: * Shared/WebGPU/WebGPUPipelineDescriptorBase.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUPipelineDescriptorBase.h: * Shared/WebGPU/WebGPUPipelineLayoutDescriptor.cpp: Copied from Source/WebCore/Modules/WebGPU/GPUPipelineLayoutDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUPipelineLayoutDescriptor.h: * Shared/WebGPU/WebGPUPrimitiveState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUValidationError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUPrimitiveState.h: * Shared/WebGPU/WebGPUProgrammableStage.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUProgrammableStage.h: * Shared/WebGPU/WebGPUQuerySetDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUQuerySetDescriptor.h: * Shared/WebGPU/WebGPURenderBundleDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderBundleDescriptor.h: * Shared/WebGPU/WebGPURenderBundleEncoderDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderBundleEncoderDescriptor.h: * Shared/WebGPU/WebGPURenderPassColorAttachment.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassColorAttachment.h: * Shared/WebGPU/WebGPURenderPassDepthStencilAttachment.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyBuffer.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassDepthStencilAttachment.h: * Shared/WebGPU/WebGPURenderPassDescriptor.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassDescriptor.h: * Shared/WebGPU/WebGPURenderPassLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassLayout.h: * Shared/WebGPU/WebGPURenderPassTimestampWrites.cpp: Copied from Source/WebCore/Modules/WebGPU/GPURenderPassTimestampWrite.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassTimestampWrites.h: * Shared/WebGPU/WebGPURenderPipelineDescriptor.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPipelineDescriptor.h: * Shared/WebGPU/WebGPURequestAdapterOptions.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUValidationError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURequestAdapterOptions.h: * Shared/WebGPU/WebGPUSamplerBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUSamplerBindingLayout.h: * Shared/WebGPU/WebGPUSamplerDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUSamplerDescriptor.h: * Shared/WebGPU/WebGPUShaderModuleDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUShaderModuleDescriptor.h: * Shared/WebGPU/WebGPUStencilFaceState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUValidationError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUStencilFaceState.h: * Shared/WebGPU/WebGPUStorageTextureBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSupportedFeatures.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUStorageTextureBindingLayout.h: * Shared/WebGPU/WebGPUSupportedFeatures.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUSupportedFeatures.h: * Shared/WebGPU/WebGPUSupportedLimits.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUSupportedLimits.h: * Shared/WebGPU/WebGPUTextureBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUValidationError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUTextureBindingLayout.h: * Shared/WebGPU/WebGPUTextureDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUTextureDescriptor.h: * Shared/WebGPU/WebGPUTextureViewDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUTextureViewDescriptor.h: * Shared/WebGPU/WebGPUValidationError.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUValidationError.h: * Shared/WebGPU/WebGPUVertexAttribute.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUVertexAttribute.h: * Shared/WebGPU/WebGPUVertexBufferLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyBuffer.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUVertexBufferLayout.h: * Shared/WebGPU/WebGPUVertexState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUVertexState.h: * Sources.txt: * UnifiedSources-output.xcfilelist: * WebKit.xcodeproj/project.pbxproj: 2021-11-19 Brady Eidson More webpushd architecture work https://bugs.webkit.org/show_bug.cgi?id=233295 Reviewed by Alex Christensen. Covered by API tests. This patch: - Adds entitlement checks for connections to webpushd - Adds a "ClientConnection" object to the daemon to manage per-connection state - Adds a debug enabled setting - Adds the ability for the connecting app (com.apple.WebKit.Networking) to pass the host app's audit_token - Tests some of the above - Adds the beginnings of other future infrastructure * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::NetworkNotificationManager): * Resources/ios/XPCService-embedded-simulator.entitlements: * Scripts/process-entitlements.sh: * Shared/Cocoa/CodeSigning.h: * Shared/Cocoa/CodeSigning.mm: (WebKit::codeSigningIdentifierAndPlatformBinaryStatus): (WebKit::codeSigningIdentifier): * Shared/WebPushDaemonConstants.h: (WebKit::WebPushD::messageTypeSendsReply): * WebKit.xcodeproj/project.pbxproj: * webpushd/PushClientConnection.h: Copied from Source/WebKit/Shared/Cocoa/CodeSigning.h. (WebPushD::ClientConnection::hasAuditToken const): (WebPushD::ClientConnection::debugModeIsEnabled const): * webpushd/PushClientConnection.mm: Added. (WebPushD::ClientConnection::ClientConnection): (WebPushD::ClientConnection::setAuditTokenData): (WebPushD::ClientConnection::hostCodeSigningIdentifier): (WebPushD::ClientConnection::hostHasPushEntitlement): (WebPushD::ClientConnection::setDebugModeIsEnabled): * webpushd/WebPushDaemon.h: * webpushd/WebPushDaemon.mm: (WebPushD::handleWebPushDMessageWithReply): (WebPushD::handleWebPushDMessage): (WebPushD::Daemon::broadcastDebugMessage): (WebPushD::Daemon::connectionEventHandler): (WebPushD::Daemon::connectionAdded): (WebPushD::Daemon::connectionRemoved): (WebPushD::Daemon::decodeAndHandleMessage): (WebPushD::Daemon::echoTwice): (WebPushD::Daemon::canRegisterForNotifications): (WebPushD::Daemon::requestSystemNotificationPermission): (WebPushD::Daemon::getOriginsWithPushAndNotificationPermissions): (WebPushD::Daemon::deletePushAndNotificationRegistration): (WebPushD::Daemon::setHostAppAuditToken): (WebPushD::Daemon::setDebugModeIsEnabled): (WebPushD::Daemon::toClientConnection): * webpushd/WebPushDaemonMain.mm: (main): 2021-11-19 Brent Fulgham Add support for web app manifest icons in WebKit/UI Process layer https://bugs.webkit.org/show_bug.cgi?id=233350 Reviewed by Chris Dumez. This patch builds on the work in Bug 231339 and threads the new icons feature through the WebKit layer. Note: This change also moves the implementation of _WKApplicationManifestIcon earlier in the file since the implementation is needed for proper serialization of the _WKApplicationManifest. Tested by TestWebKitAPI (ApplicationManifest.Icons) test. * UIProcess/API/Cocoa/_WKApplicationManifest.h: * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (fromPurposes): New helper function. (makeVectorElement): Ditto. (-[_WKApplicationManifestIcon initWithCoder:]): Updated to call proper serialization methods. (-[_WKApplicationManifestIcon initWithCoreIcon:]): Added. (-[_WKApplicationManifest initWithCoder:]): Updated to properly handle serializing the object. (-[_WKApplicationManifest icons]): Added. 2021-11-19 Per Arne [macOS] Enable message filtering for all WebKit processes https://bugs.webkit.org/show_bug.cgi?id=233334 Reviewed by Brent Fulgham. The sandbox parameter enabling message filtering should be set in all WebKit processes. * Shared/mac/AuxiliaryProcessMac.mm: (WebKit::AuxiliaryProcess::initializeSandbox): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeSandbox): 2021-11-19 Antoine Quint [Model] add support for seeking animations https://bugs.webkit.org/show_bug.cgi?id=233362 Reviewed by Wenson Hsieh. Expose new WebPageProxy messages to let the WebProcess message the UIProcess to call into ASVInlinePreview methods to get and set the animation's current time as well as getting its duration. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::animationDurationForModelElement): (WebKit::ModelElementController::animationCurrentTimeForModelElement): (WebKit::ModelElementController::setAnimationCurrentTimeForModelElement): * UIProcess/ModelElementController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::modelElementAnimationDuration): (WebKit::WebPageProxy::modelElementAnimationCurrentTime): (WebKit::WebPageProxy::modelElementSetAnimationCurrentTime): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Model/ARKitInlinePreviewModelPlayer.h: * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: (WebKit::ARKitInlinePreviewModelPlayer::animationDuration): (WebKit::ARKitInlinePreviewModelPlayer::animationCurrentTime): (WebKit::ARKitInlinePreviewModelPlayer::setAnimationCurrentTime): 2021-11-19 Ryan Haddad Unreviewed, reverting r286047. Breaks internal builds Reverted changeset: "[WebGPU] Add converters from serializable descriptors to interface descriptors" https://bugs.webkit.org/show_bug.cgi?id=233310 https://commits.webkit.org/r286047 2021-11-19 Antoine Quint [Model] add support for controlling looping animations https://bugs.webkit.org/show_bug.cgi?id=233356 Reviewed by Wenson Hsieh. Expose new WebPageProxy messages to let the WebProcess message the UIProcess to call into ASVInlinePreview methods to get and set the animation's looping state. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::isLoopingAnimationForModelElement): (WebKit::ModelElementController::setIsLoopingAnimationForModelElement): * UIProcess/ModelElementController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::modelElementIsLoopingAnimation): (WebKit::WebPageProxy::modelElementSetIsLoopingAnimation): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Model/ARKitInlinePreviewModelPlayer.h: * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: (WebKit::ARKitInlinePreviewModelPlayer::isLoopingAnimation): (WebKit::ARKitInlinePreviewModelPlayer::setIsLoopingAnimation): 2021-11-19 Antoine Quint [Model] add audio support https://bugs.webkit.org/show_bug.cgi?id=233365 Reviewed by Wenson Hsieh. Expose new WebPageProxy messages to let the WebProcess message the UIProcess to call into ASVInlinePreview methods to get and set the muted state and get whehter the model contains audio. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::previewHasAudioSupport): (WebKit::ModelElementController::hasAudioForModelElement): (WebKit::ModelElementController::isMutedForModelElement): (WebKit::ModelElementController::setIsMutedForModelElement): * UIProcess/ModelElementController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::modelElementHasAudio): (WebKit::WebPageProxy::modelElementIsMuted): (WebKit::WebPageProxy::modelElementSetIsMuted): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Model/ARKitInlinePreviewModelPlayer.h: * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: (WebKit::ARKitInlinePreviewModelPlayer::hasAudio): (WebKit::ARKitInlinePreviewModelPlayer::isMuted): (WebKit::ARKitInlinePreviewModelPlayer::setIsMuted): 2021-11-18 Antoine Quint [Model] add support for pausing and resuming animations https://bugs.webkit.org/show_bug.cgi?id=233319 Reviewed by Wenson Hsieh. Expose new WebPageProxy messages to let the WebProcess message the UIProcess to call into ASVInlinePreview methods to get and set the animation's playback state. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::previewHasAnimationSupport): (WebKit::ModelElementController::isPlayingAnimationForModelElement): (WebKit::ModelElementController::setAnimationIsPlayingForModelElement): * UIProcess/ModelElementController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::modelElementIsPlayingAnimation): (WebKit::WebPageProxy::modelElementSetAnimationIsPlaying): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Model/ARKitInlinePreviewModelPlayer.h: * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: (WebKit::ARKitInlinePreviewModelPlayer::isPlayingAnimation): (WebKit::ARKitInlinePreviewModelPlayer::setAnimationIsPlaying): 2021-11-18 Myles C. Maxfield [WebGPU] Add converters from serializable descriptors to interface descriptors https://bugs.webkit.org/show_bug.cgi?id=233310 Reviewed by Dean Jackson. The WebGPU abstract interface (in PAL/graphics/WebGPU) has a set of structs for descriptors. These descriptors hold references to objects, so these interfaces can't be serialized directly. Instead, we have a parallel set of structs (in WebKit/Shared/WebGPU) which replace the object references with WebGPUIdentifiers. The web process side will convert the abstract interface structs to the serializable ones, and the GPU process side will convert back. This patch implements the converters back, from the serializable structs to the abstract interface structs. No new tests because there is no behavior change. * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.cpp: (WebKit::WebGPU::ObjectHeap::convertAdapterFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertDeviceFromBacking): (WebKit::WebGPU::ObjectHeap::convertExternalTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertGPUFromBacking): (WebKit::WebGPU::ObjectHeap::convertPipelineLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertQuerySetFromBacking): (WebKit::WebGPU::ObjectHeap::convertQueueFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertSamplerFromBacking): (WebKit::WebGPU::ObjectHeap::convertShaderModuleFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureViewFromBacking): * Shared/WebGPU/WebGPUBindGroupDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUFragmentState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBindGroupDescriptor.h: * Shared/WebGPU/WebGPUBindGroupEntry.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBindGroupDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBindGroupEntry.h: * Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.h: * Shared/WebGPU/WebGPUBindGroupLayoutEntry.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBindGroupLayoutEntry.h: * Shared/WebGPU/WebGPUBlendComponent.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUOutOfMemoryError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBlendComponent.h: * Shared/WebGPU/WebGPUBlendState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBlendState.h: * Shared/WebGPU/WebGPUBufferBinding.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBufferBinding.h: * Shared/WebGPU/WebGPUBufferBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBufferBindingLayout.h: * Shared/WebGPU/WebGPUBufferDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUBufferDescriptor.h: * Shared/WebGPU/WebGPUCanvasConfiguration.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyBuffer.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUCanvasConfiguration.h: * Shared/WebGPU/WebGPUColor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUColor.h: * Shared/WebGPU/WebGPUColorTargetState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUColorTargetState.h: * Shared/WebGPU/WebGPUCommandBufferDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUCommandBufferDescriptor.h: * Shared/WebGPU/WebGPUCommandEncoderDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUCommandEncoderDescriptor.h: * Shared/WebGPU/WebGPUCompilationMessage.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUCompilationMessage.h: * Shared/WebGPU/WebGPUComputePassDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUComputePassDescriptor.h: * Shared/WebGPU/WebGPUComputePassTimestampWrites.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUComputePassDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUComputePassTimestampWrites.h: * Shared/WebGPU/WebGPUComputePipelineDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUComputePipelineDescriptor.h: * Shared/WebGPU/WebGPUConvertFromBackingContext.h: * Shared/WebGPU/WebGPUDepthStencilState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUComputePassDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUDepthStencilState.h: * Shared/WebGPU/WebGPUDeviceDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUDeviceDescriptor.h: * Shared/WebGPU/WebGPUError.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUCommandBufferDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUError.h: * Shared/WebGPU/WebGPUExtent3D.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUComputePassDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUExtent3D.h: * Shared/WebGPU/WebGPUExternalTextureBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUExternalTextureBindingLayout.h: * Shared/WebGPU/WebGPUExternalTextureDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUExternalTextureDescriptor.h: * Shared/WebGPU/WebGPUFragmentState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUPipelineDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUFragmentState.h: * Shared/WebGPU/WebGPUImageCopyBuffer.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyBuffer.h: * Shared/WebGPU/WebGPUImageCopyExternalImage.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyExternalImage.h: * Shared/WebGPU/WebGPUImageCopyTexture.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyTexture.h: * Shared/WebGPU/WebGPUImageCopyTextureTagged.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageCopyTextureTagged.h: * Shared/WebGPU/WebGPUImageDataLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUImageDataLayout.h: * Shared/WebGPU/WebGPUMultisampleState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUMultisampleState.h: * Shared/WebGPU/WebGPUObjectDescriptorBase.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUOutOfMemoryError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUObjectDescriptorBase.h: * Shared/WebGPU/WebGPUOrigin2D.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUPipelineLayoutDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUOrigin2D.h: * Shared/WebGPU/WebGPUOrigin3D.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUComputePipelineDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUOrigin3D.h: * Shared/WebGPU/WebGPUOutOfMemoryError.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUOutOfMemoryError.h: * Shared/WebGPU/WebGPUPipelineDescriptorBase.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUPipelineDescriptorBase.h: * Shared/WebGPU/WebGPUPipelineLayoutDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBufferBinding.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUPipelineLayoutDescriptor.h: * Shared/WebGPU/WebGPUPrimitiveState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUPrimitiveState.h: * Shared/WebGPU/WebGPUProgrammableStage.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUProgrammableStage.h: * Shared/WebGPU/WebGPUQuerySetDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUQuerySetDescriptor.h: * Shared/WebGPU/WebGPURenderBundleDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderBundleDescriptor.h: * Shared/WebGPU/WebGPURenderBundleEncoderDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderBundleEncoderDescriptor.h: * Shared/WebGPU/WebGPURenderPassColorAttachment.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassColorAttachment.h: * Shared/WebGPU/WebGPURenderPassDepthStencilAttachment.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyBuffer.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassDepthStencilAttachment.h: * Shared/WebGPU/WebGPURenderPassDescriptor.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassDescriptor.h: * Shared/WebGPU/WebGPURenderPassLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUSamplerBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassLayout.h: * Shared/WebGPU/WebGPURenderPassTimestampWrites.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUProgrammableStage.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPassTimestampWrites.h: * Shared/WebGPU/WebGPURenderPipelineDescriptor.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURenderPipelineDescriptor.h: * Shared/WebGPU/WebGPURequestAdapterOptions.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPURequestAdapterOptions.h: * Shared/WebGPU/WebGPUSamplerBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUSamplerBindingLayout.h: * Shared/WebGPU/WebGPUSamplerDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUSamplerDescriptor.h: * Shared/WebGPU/WebGPUShaderModuleDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUShaderModuleDescriptor.h: * Shared/WebGPU/WebGPUStencilFaceState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUStencilFaceState.h: * Shared/WebGPU/WebGPUStorageTextureBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUStorageTextureBindingLayout.h: * Shared/WebGPU/WebGPUSupportedFeatures.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUSupportedFeatures.h: * Shared/WebGPU/WebGPUSupportedLimits.cpp: Added. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUSupportedLimits.h: * Shared/WebGPU/WebGPUTextureBindingLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUTextureBindingLayout.h: * Shared/WebGPU/WebGPUTextureDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUBlendState.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUTextureDescriptor.h: * Shared/WebGPU/WebGPUTextureViewDescriptor.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUObjectDescriptorBase.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUTextureViewDescriptor.h: * Shared/WebGPU/WebGPUValidationError.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUError.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUValidationError.h: * Shared/WebGPU/WebGPUVertexAttribute.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUExternalTextureBindingLayout.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUVertexAttribute.h: * Shared/WebGPU/WebGPUVertexBufferLayout.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUImageCopyExternalImage.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUVertexBufferLayout.h: * Shared/WebGPU/WebGPUVertexState.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPUComputePipelineDescriptor.h. (WebKit::WebGPU::ConvertFromBackingContext::convertFromBacking): * Shared/WebGPU/WebGPUVertexState.h: 2021-11-18 Fujii Hironori [TextureMapper][GraphicsLayerTextureMapper][GraphicsLayerWC] setBackgroundColor support https://bugs.webkit.org/show_bug.cgi?id=233244 Reviewed by Don Olmstead. * GPUProcess/graphics/wc/WCScene.cpp: (WebKit::WCScene::update): * WebProcess/WebPage/wc/GraphicsLayerWC.cpp: (WebKit::GraphicsLayerWC::setBackgroundColor): (WebKit::GraphicsLayerWC::flushCompositingStateForThisLayerOnly): * WebProcess/WebPage/wc/GraphicsLayerWC.h: * WebProcess/WebPage/wc/WCUpateInfo.h: (WebKit::WCLayerUpateInfo::encode const): (WebKit::WCLayerUpateInfo::decode): 2021-11-18 Alex Christensen Allow all redirect schemes when compiling a content rule list https://bugs.webkit.org/show_bug.cgi?id=233338 Reviewed by Tim Hatcher. * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::lookupContentRuleList): (API::ContentRuleListStore::compileContentRuleList): * UIProcess/API/APIContentRuleListStore.h: * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: (WKUserContentExtensionStoreCompile): * UIProcess/API/Cocoa/WKContentRuleListStore.mm: (-[WKContentRuleListStore compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]): (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:allowedRedirectSchemes:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h: * UIProcess/API/glib/WebKitUserContentFilterStore.cpp: (webkitUserContentFilterStoreSaveBytes): 2021-11-18 Per Arne Vollan [macOS][GPUP] Remove access in sandbox to com.apple.audio.AudioComponentRegistrar https://bugs.webkit.org/show_bug.cgi?id=231694 Reviewed by Brent Fulgham. After https://trac.webkit.org/changeset/274435/webkit, there is no need to allow access to this service. This patch also implements sending the Audio component registrations to the GPU process, which is a requirement before blocking the service in the GPU process. * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * GPUProcess/cocoa/GPUProcessCocoa.mm: (WebKit::GPUProcess::consumeAudioComponentRegistrations): * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Shared/Cocoa/AudioComponentRegistration.cpp: Added. (WebKit::consumeAudioComponentRegistrations): * Shared/Cocoa/AudioComponentRegistration.h: Added. (WebKit::sendAudioComponentRegistrations): * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::sendAudioComponentRegistrations): Deleted. * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::didFinishLaunching): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::revokeAudioCaptureExtension): * WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::consumeAudioComponentRegistrations): 2021-11-18 Per Arne Vollan Add syscall telemetry in the Networking process https://bugs.webkit.org/show_bug.cgi?id=233203 Reviewed by Brent Fulgham. Add syscall telemetry in the Networking process on macOS and iOS. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Scripts/process-entitlements.sh: 2021-11-18 Per Arne [macOS][GPUP] Remove access to mach services in sandbox https://bugs.webkit.org/show_bug.cgi?id=232208 Unreviewed, revert minor part of initial patch. Add back Mach service which is potentially still needed, although telemetry shows no usage. We will reevaluate the need for this service when more telemetry is available. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-18 Antoine Quint [Model] add support for getting and setting the camera https://bugs.webkit.org/show_bug.cgi?id=233265 Unreviewed build fix. Fix the Montery build, making sure we guard calls to the new ARQL SPIs. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::getCameraForModelElement): (WebKit::ModelElementController::setCameraForModelElement): 2021-11-18 Per Arne [iOS] Block access to unused resources in the Networking process' sandbox https://bugs.webkit.org/show_bug.cgi?id=233129 Unreviewed, fix sandbox syntax errors. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2021-11-18 Antoine Quint [Model] add support for getting and setting the camera https://bugs.webkit.org/show_bug.cgi?id=233265 Reviewed by Darin Adler. The ARQL APIs we'd adopted so far were specific to either macOS or iOS. The new camera methods are different since they exist on both platforms. In order to expose a single message for both platforms, we introduce a new ModelIdentifier struct which wraps the UUID string for macOS and the layer identifier for iOS. Then on ModelElementController, we have the previewForModelIdentifier() method to get the matching ASVInlinePreview for the provided ModelIdentifier. This allows getCameraForModelElement() and setCameraForModelElement to be specified for both iOS and macOS with a single implementation. We also modify takeModelElementFullscreen() to take advantage of ModelIdentifier which showed that we had some lingering code in ChromeClient related to this method that was no longer necessary following r285922. * Shared/ModelIdentifier.h: Copied from Source/WebCore/Modules/model-element/scenekit/SceneKitModelPlayer.h. (WebKit::ModelIdentifier::encode const): (WebKit::ModelIdentifier::decode): * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::modelViewForModelIdentifier): (WebKit::ModelElementController::previewForModelIdentifier): (WebKit::ModelElementController::takeModelElementFullscreen): (WebKit::previewHasCameraSupport): (WebKit::ModelElementController::getCameraForModelElement): (WebKit::ModelElementController::setCameraForModelElement): * UIProcess/ModelElementController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::modelElementGetCamera): (WebKit::WebPageProxy::modelElementSetCamera): (WebKit::WebPageProxy::takeModelElementFullscreen): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Model/ARKitInlinePreviewModelPlayer.h: * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: (WebKit::ARKitInlinePreviewModelPlayer::getCamera): (WebKit::ARKitInlinePreviewModelPlayer::setCamera): * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.h: * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.mm: (WebKit::ARKitInlinePreviewModelPlayerIOS::modelIdentifier): (WebKit::ARKitInlinePreviewModelPlayerIOS::enterFullscreen): * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h: * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm: (WebKit::ARKitInlinePreviewModelPlayerMac::modelIdentifier): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::takeModelElementFullscreen const): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::takeModelElementFullscreen): Deleted. * WebProcess/WebPage/WebPage.h: 2021-11-18 Chris Dumez Drop ServiceWorkerClientIdentifier / DocumentIdentifier and use ScriptExecutionContextIdentifier instead https://bugs.webkit.org/show_bug.cgi?id=233288 Reviewed by Darin Adler. Drop ServiceWorkerClientIdentifier / DocumentIdentifier and use ScriptExecutionContextIdentifier instead. We need to generic identifier type to identify script execution contexts globally. This patch augments ScriptExecutionContextIdentifier with a process identifier to make it app-global, and then gets rid of ServiceWorkerClientIdentifier & DocumentIdentifier (which become obsolete). This is useful for Web Lock API support as we need a clientId that is consistent between the Web Lock API and the service worker API (tested by imported/w3c/web-platform-tests/web-locks//clientids.tentative.https.html). The clientId in service workers was using the ServiceWorkerClientIdentifier type, which made little sense to use for the Web Lock API given its name. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::swServerForSession): * NetworkProcess/NetworkProcess.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::notifyClientsOfControllerChange): (WebKit::WebSWServerConnection::controlClient): (WebKit::WebSWServerConnection::createFetchTask): (WebKit::WebSWServerConnection::postMessageToServiceWorker): (WebKit::WebSWServerConnection::clientURLFromIdentifier): (WebKit::WebSWServerConnection::scheduleUnregisterJobInServer): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection): (WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: (WebKit::NetworkMDNSRegister::unregisterMDNSNames): (WebKit::NetworkMDNSRegister::registerMDNSName): * NetworkProcess/webrtc/NetworkMDNSRegister.h: * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in: * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::establishServiceWorkerContext): * UIProcess/WebProcessProxy.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::liveDocumentURLs): * WebProcess/Network/webrtc/LibWebRTCNetworkManager.cpp: (WebKit::LibWebRTCNetworkManager::getOrCreate): (WebKit::LibWebRTCNetworkManager::LibWebRTCNetworkManager): * WebProcess/Network/webrtc/LibWebRTCNetworkManager.h: * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::LibWebRTCProvider::createPeerConnection): * WebProcess/Network/webrtc/LibWebRTCProvider.h: * WebProcess/Network/webrtc/WebMDNSRegister.cpp: (WebKit::WebMDNSRegister::unregisterMDNSNames): (WebKit::WebMDNSRegister::registerMDNSName): * WebProcess/Network/webrtc/WebMDNSRegister.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleUnregisterJobInServer): (WebKit::WebSWClientConnection::unregisterServiceWorkerClient): (WebKit::WebSWClientConnection::setDocumentIsControlled): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection): (WebKit::WebSWContextManagerConnection::startFetch): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient): (WebKit::WebSWContextManagerConnection::findClientByIdentifier): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2021-11-18 Per Arne Vollan [macOS] Block access to unused resources in the Networking process' sandbox https://bugs.webkit.org/show_bug.cgi?id=233086 Reviewed by Brent Fulgham. Follow-up patch, allow access to logging service for root. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: 2021-11-18 Youenn Fablet MediaPlayerAVFoundation should support rvfc https://bugs.webkit.org/show_bug.cgi?id=231945 Reviewed by Chris Dumez. Unreviewed, rebasing generator tests. * Scripts/webkit/tests/MessageArgumentDescriptions.cpp: * Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp: * Scripts/webkit/tests/TestWithCVPixelBufferMessages.h: 2021-11-18 Per Arne Vollan [iOS] Block access to unused resources in the Networking process' sandbox https://bugs.webkit.org/show_bug.cgi?id=233129 Reviewed by Brent Fulgham. Based on telemetry, block access to unused resources in the Networking process' sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2021-11-18 Per Arne Vollan [macOS] Block access to unused resources in the Networking process' sandbox https://bugs.webkit.org/show_bug.cgi?id=233086 Reviewed by Brent Fulgham. Based on telemetry, block access to unused resources in the Networking process' sandbox on macOS. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: 2021-10-25 Carlos Garcia Campos [GTK][a11y] Add initial WTR accessibility support when building with ATSPI https://bugs.webkit.org/show_bug.cgi?id=230259 Reviewed by Adrian Perez de Castro. In case of ATSPI we need the web page accessibility object to get the root and focused object wrappers. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKAccessibilityRootObject): (WKAccessibilityFocusedObject): 2021-11-18 Youenn Fablet MediaPlayerAVFoundation should support rvfc https://bugs.webkit.org/show_bug.cgi?id=231945 Reviewed by Eric Carlson. Add IPC messaging to start/stop metadata gathering from WebProcess to GPUProcess. Add IPC messaging to push metadata to WebProcess, including sending the corresponding CVPixelBuffer for the current metadata. MediaPlayerPrivateRemote will then serve that buffer when being requested the current image. This ensures that painting on a canvas does not mark the current buffer as acquired, which would then skip the video frame metadata gathering. This also ensures the same buffer is used if a video element is painted several times during the same rvfc callback. This has the side benefit of removing the synchronous IPC to paint the video element in a canvas. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm: * Scripts/webkit/messages.py: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in: * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: 2021-11-18 Chris Lord [GLIB] twitch.tv forces synchronous scrolling https://bugs.webkit.org/show_bug.cgi?id=232376 Reviewed by Simon Fraser. Don't force synchronous wheel event delivery for scroll events when a user scroll is in progress. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): 2021-11-18 Kimmo Kinnunen RemoteGraphicsContextGLProxyBase should not have platform-specific implementations https://bugs.webkit.org/show_bug.cgi?id=233175 Reviewed by Antti Koivisto. Move platform-specific code from RemoteGraphicsContextGLProxyBase to WebKit::RemoteGraphicsContextGLProxyCocoa and WebKit::RemoteGraphicsContextGLProxyWC. The platform-specific code is trivial and anyway used by the WebKit side concrete classes. * PlatformWin.cmake: * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy): (WebKit::RemoteGraphicsContextGLProxy::create): Deleted. (WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay): Deleted. * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.h: * WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm: (WebKit::RemoteGraphicsContextGLProxy::create): (WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay): Deleted. * WebProcess/GPU/graphics/wc/RemoteGraphicsContextGLProxyWC.cpp: Added. (WebKit::RemoteGraphicsContextGLProxy::create): 2021-11-18 Antoine Quint [Model] [macOS] Add support for interaction on macOS https://bugs.webkit.org/show_bug.cgi?id=233105 Reviewed by Wenson Hsieh. Forward mouse events captured in the Web process to the matching ASVInlinePreview. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::previewForUUID): (WebKit::ModelElementController::handleMouseDownForModelElement): (WebKit::ModelElementController::handleMouseMoveForModelElement): (WebKit::ModelElementController::handleMouseUpForModelElement): * UIProcess/ModelElementController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleMouseDownForModelElement): (WebKit::WebPageProxy::handleMouseMoveForModelElement): (WebKit::WebPageProxy::handleMouseUpForModelElement): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.h: * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.mm: (WebKit::ARKitInlinePreviewModelPlayerIOS::handleMouseDown): (WebKit::ARKitInlinePreviewModelPlayerIOS::handleMouseMove): (WebKit::ARKitInlinePreviewModelPlayerIOS::handleMouseUp): * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h: * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm: (WebKit::ARKitInlinePreviewModelPlayerMac::supportsMouseInteraction): (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseDown): (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseMove): (WebKit::ARKitInlinePreviewModelPlayerMac::handleMouseUp): 2021-11-17 Youenn Fablet Add support for more rvfc metadata https://bugs.webkit.org/show_bug.cgi?id=233185 Reviewed by Eric Carlson. Make sure to receive frame metadats, send it through IPC to WebProcess and pipe it to media source observers. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp: * WebProcess/GPU/webrtc/MediaRecorderPrivate.h: * WebProcess/cocoa/RemoteCaptureSampleManager.cpp: * WebProcess/cocoa/RemoteCaptureSampleManager.h: * WebProcess/cocoa/RemoteCaptureSampleManager.messages.in: * WebProcess/cocoa/RemoteRealtimeDisplaySource.h: * WebProcess/cocoa/RemoteRealtimeVideoSource.cpp: * WebProcess/cocoa/RemoteRealtimeVideoSource.h: 2021-11-17 Myles C. Maxfield [WebGPU] Add IPC message handlers for WebGPU https://bugs.webkit.org/show_bug.cgi?id=233247 Reviewed by Dean Jackson. Add classes in GPUProcess/graphics/WebGPU to receive WebGPU's IPC messages. Each one of these classes has an associated messages.in file. Each of these objects holds a backing PAL::WebGPU object which is the actual implementation. The methods that receive the IPC messages are currently unimplemented, but in a subsequent patch they'll just forward on the calls to their backing PAL::WebGPU object. This also adds serialization routines for all the structs in Shared/WebGPU. No new tests because there is no behavior change (yet). We're very close, though!!!! * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/graphics/WebGPU/RemoteAdapter.cpp: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.cpp. (WebKit::RemoteAdapter::RemoteAdapter): (WebKit::RemoteAdapter::~RemoteAdapter): (WebKit::RemoteAdapter::requestDevice): * GPUProcess/graphics/WebGPU/RemoteAdapter.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteAdapter.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteBindGroup.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemoteBindGroup::RemoteBindGroup): (WebKit::RemoteBindGroup::~RemoteBindGroup): (WebKit::RemoteBindGroup::setLabel): * GPUProcess/graphics/WebGPU/RemoteBindGroup.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteBindGroup.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemoteBindGroupLayout::RemoteBindGroupLayout): (WebKit::RemoteBindGroupLayout::~RemoteBindGroupLayout): (WebKit::RemoteBindGroupLayout::setLabel): * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteBindGroupLayout.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteBuffer.cpp: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp. (WebKit::RemoteBuffer::RemoteBuffer): (WebKit::RemoteBuffer::~RemoteBuffer): (WebKit::RemoteBuffer::mapAsync): (WebKit::RemoteBuffer::unmap): (WebKit::RemoteBuffer::destroy): (WebKit::RemoteBuffer::setLabel): * GPUProcess/graphics/WebGPU/RemoteBuffer.h: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.h. * GPUProcess/graphics/WebGPU/RemoteBuffer.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemoteCommandBuffer::RemoteCommandBuffer): (WebKit::RemoteCommandBuffer::~RemoteCommandBuffer): (WebKit::RemoteCommandBuffer::setLabel): * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteCommandBuffer.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.cpp: Added. (WebKit::RemoteCommandEncoder::RemoteCommandEncoder): (WebKit::RemoteCommandEncoder::~RemoteCommandEncoder): (WebKit::RemoteCommandEncoder::beginRenderPass): (WebKit::RemoteCommandEncoder::beginComputePass): (WebKit::RemoteCommandEncoder::copyBufferToBuffer): (WebKit::RemoteCommandEncoder::copyBufferToTexture): (WebKit::RemoteCommandEncoder::copyTextureToBuffer): (WebKit::RemoteCommandEncoder::copyTextureToTexture): (WebKit::RemoteCommandEncoder::fillBuffer): (WebKit::RemoteCommandEncoder::pushDebugGroup): (WebKit::RemoteCommandEncoder::popDebugGroup): (WebKit::RemoteCommandEncoder::insertDebugMarker): (WebKit::RemoteCommandEncoder::writeTimestamp): (WebKit::RemoteCommandEncoder::resolveQuerySet): (WebKit::RemoteCommandEncoder::finish): (WebKit::RemoteCommandEncoder::setLabel): * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.h: Added. * GPUProcess/graphics/WebGPU/RemoteCommandEncoder.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.cpp: Added. (WebKit::RemoteComputePassEncoder::RemoteComputePassEncoder): (WebKit::RemoteComputePassEncoder::~RemoteComputePassEncoder): (WebKit::RemoteComputePassEncoder::setPipeline): (WebKit::RemoteComputePassEncoder::dispatch): (WebKit::RemoteComputePassEncoder::dispatchIndirect): (WebKit::RemoteComputePassEncoder::beginPipelineStatisticsQuery): (WebKit::RemoteComputePassEncoder::endPipelineStatisticsQuery): (WebKit::RemoteComputePassEncoder::endPass): (WebKit::RemoteComputePassEncoder::setBindGroup): (WebKit::RemoteComputePassEncoder::pushDebugGroup): (WebKit::RemoteComputePassEncoder::popDebugGroup): (WebKit::RemoteComputePassEncoder::insertDebugMarker): (WebKit::RemoteComputePassEncoder::setLabel): * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.h: Added. * GPUProcess/graphics/WebGPU/RemoteComputePassEncoder.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteComputePipeline.cpp: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp. (WebKit::RemoteComputePipeline::RemoteComputePipeline): (WebKit::RemoteComputePipeline::~RemoteComputePipeline): (WebKit::RemoteComputePipeline::getBindGroupLayout): (WebKit::RemoteComputePipeline::setLabel): * GPUProcess/graphics/WebGPU/RemoteComputePipeline.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteComputePipeline.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteDevice.cpp: Added. (WebKit::RemoteDevice::RemoteDevice): (WebKit::RemoteDevice::~RemoteDevice): (WebKit::RemoteDevice::destroy): (WebKit::RemoteDevice::createBuffer): (WebKit::RemoteDevice::createTexture): (WebKit::RemoteDevice::createSampler): (WebKit::RemoteDevice::importExternalTexture): (WebKit::RemoteDevice::createBindGroupLayout): (WebKit::RemoteDevice::createPipelineLayout): (WebKit::RemoteDevice::createBindGroup): (WebKit::RemoteDevice::createShaderModule): (WebKit::RemoteDevice::createComputePipeline): (WebKit::RemoteDevice::createRenderPipeline): (WebKit::RemoteDevice::createComputePipelineAsync): (WebKit::RemoteDevice::createRenderPipelineAsync): (WebKit::RemoteDevice::createCommandEncoder): (WebKit::RemoteDevice::createRenderBundleEncoder): (WebKit::RemoteDevice::createQuerySet): (WebKit::RemoteDevice::pushErrorScope): (WebKit::RemoteDevice::popErrorScope): (WebKit::RemoteDevice::setLabel): * GPUProcess/graphics/WebGPU/RemoteDevice.h: Added. * GPUProcess/graphics/WebGPU/RemoteDevice.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteExternalTexture.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemoteExternalTexture::RemoteExternalTexture): (WebKit::RemoteExternalTexture::~RemoteExternalTexture): (WebKit::RemoteExternalTexture::setLabel): * GPUProcess/graphics/WebGPU/RemoteExternalTexture.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteExternalTexture.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteGPU.cpp: Copied from Source/WebKit/Shared/WebGPU/WebGPURenderPipelineDescriptor.h. (WebKit::RemoteGPU::RemoteGPU): (WebKit::RemoteGPU::~RemoteGPU): (WebKit::RemoteGPU::requestAdapter): * GPUProcess/graphics/WebGPU/RemoteGPU.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUAdapter.h. * GPUProcess/graphics/WebGPU/RemoteGPU.messages.in: Added. * GPUProcess/graphics/WebGPU/RemotePipelineLayout.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemotePipelineLayout::RemotePipelineLayout): (WebKit::RemotePipelineLayout::~RemotePipelineLayout): (WebKit::RemotePipelineLayout::setLabel): * GPUProcess/graphics/WebGPU/RemotePipelineLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemotePipelineLayout.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteQuerySet.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemoteQuerySet::RemoteQuerySet): (WebKit::RemoteQuerySet::~RemoteQuerySet): (WebKit::RemoteQuerySet::destroy): (WebKit::RemoteQuerySet::setLabel): * GPUProcess/graphics/WebGPU/RemoteQuerySet.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteQuerySet.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteQueue.cpp: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp. (WebKit::RemoteQueue::RemoteQueue): (WebKit::RemoteQueue::~RemoteQueue): (WebKit::RemoteQueue::submit): (WebKit::RemoteQueue::onSubmittedWorkDone): (WebKit::RemoteQueue::writeBuffer): (WebKit::RemoteQueue::writeTexture): (WebKit::RemoteQueue::copyExternalImageToTexture): (WebKit::RemoteQueue::setLabel): * GPUProcess/graphics/WebGPU/RemoteQueue.h: Added. * GPUProcess/graphics/WebGPU/RemoteQueue.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteRenderBundle.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemoteRenderBundle::RemoteRenderBundle): (WebKit::RemoteRenderBundle::~RemoteRenderBundle): (WebKit::RemoteRenderBundle::setLabel): * GPUProcess/graphics/WebGPU/RemoteRenderBundle.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteRenderBundle.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.cpp: Added. (WebKit::RemoteRenderBundleEncoder::RemoteRenderBundleEncoder): (WebKit::RemoteRenderBundleEncoder::~RemoteRenderBundleEncoder): (WebKit::RemoteRenderBundleEncoder::setPipeline): (WebKit::RemoteRenderBundleEncoder::setIndexBuffer): (WebKit::RemoteRenderBundleEncoder::setVertexBuffer): (WebKit::RemoteRenderBundleEncoder::draw): (WebKit::RemoteRenderBundleEncoder::drawIndexed): (WebKit::RemoteRenderBundleEncoder::drawIndirect): (WebKit::RemoteRenderBundleEncoder::drawIndexedIndirect): (WebKit::RemoteRenderBundleEncoder::setBindGroup): (WebKit::RemoteRenderBundleEncoder::pushDebugGroup): (WebKit::RemoteRenderBundleEncoder::popDebugGroup): (WebKit::RemoteRenderBundleEncoder::insertDebugMarker): (WebKit::RemoteRenderBundleEncoder::finish): (WebKit::RemoteRenderBundleEncoder::setLabel): * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.h: Added. * GPUProcess/graphics/WebGPU/RemoteRenderBundleEncoder.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.cpp: Added. (WebKit::RemoteRenderPassEncoder::RemoteRenderPassEncoder): (WebKit::RemoteRenderPassEncoder::~RemoteRenderPassEncoder): (WebKit::RemoteRenderPassEncoder::setPipeline): (WebKit::RemoteRenderPassEncoder::setIndexBuffer): (WebKit::RemoteRenderPassEncoder::setVertexBuffer): (WebKit::RemoteRenderPassEncoder::draw): (WebKit::RemoteRenderPassEncoder::drawIndexed): (WebKit::RemoteRenderPassEncoder::drawIndirect): (WebKit::RemoteRenderPassEncoder::drawIndexedIndirect): (WebKit::RemoteRenderPassEncoder::setBindGroup): (WebKit::RemoteRenderPassEncoder::pushDebugGroup): (WebKit::RemoteRenderPassEncoder::popDebugGroup): (WebKit::RemoteRenderPassEncoder::insertDebugMarker): (WebKit::RemoteRenderPassEncoder::setViewport): (WebKit::RemoteRenderPassEncoder::setScissorRect): (WebKit::RemoteRenderPassEncoder::setBlendConstant): (WebKit::RemoteRenderPassEncoder::setStencilReference): (WebKit::RemoteRenderPassEncoder::beginOcclusionQuery): (WebKit::RemoteRenderPassEncoder::endOcclusionQuery): (WebKit::RemoteRenderPassEncoder::beginPipelineStatisticsQuery): (WebKit::RemoteRenderPassEncoder::endPipelineStatisticsQuery): (WebKit::RemoteRenderPassEncoder::executeBundles): (WebKit::RemoteRenderPassEncoder::endPass): (WebKit::RemoteRenderPassEncoder::setLabel): * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.h: Added. * GPUProcess/graphics/WebGPU/RemoteRenderPassEncoder.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.cpp: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp. (WebKit::RemoteRenderPipeline::RemoteRenderPipeline): (WebKit::RemoteRenderPipeline::~RemoteRenderPipeline): (WebKit::RemoteRenderPipeline::getBindGroupLayout): (WebKit::RemoteRenderPipeline::setLabel): * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteRenderPipeline.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteSampler.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemoteSampler::RemoteSampler): (WebKit::RemoteSampler::~RemoteSampler): (WebKit::RemoteSampler::setLabel): * GPUProcess/graphics/WebGPU/RemoteSampler.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteSampler.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteShaderModule.cpp: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp. (WebKit::RemoteShaderModule::RemoteShaderModule): (WebKit::RemoteShaderModule::~RemoteShaderModule): (WebKit::RemoteShaderModule::compilationInfo): (WebKit::RemoteShaderModule::setLabel): * GPUProcess/graphics/WebGPU/RemoteShaderModule.h: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.h. * GPUProcess/graphics/WebGPU/RemoteShaderModule.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteTexture.cpp: Copied from Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp. (WebKit::RemoteTexture::RemoteTexture): (WebKit::RemoteTexture::~RemoteTexture): (WebKit::RemoteTexture::createView): (WebKit::RemoteTexture::destroy): (WebKit::RemoteTexture::setLabel): * GPUProcess/graphics/WebGPU/RemoteTexture.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteTexture.messages.in: Added. * GPUProcess/graphics/WebGPU/RemoteTextureView.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUMapMode.h. (WebKit::RemoteTextureView::RemoteTextureView): (WebKit::RemoteTextureView::~RemoteTextureView): (WebKit::RemoteTextureView::setLabel): * GPUProcess/graphics/WebGPU/RemoteTextureView.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUTexture.h. * GPUProcess/graphics/WebGPU/RemoteTextureView.messages.in: Added. * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.cpp: Added. (WebKit::WebGPU::ObjectHeap::ObjectHeap): (WebKit::WebGPU::ObjectHeap::~ObjectHeap): (WebKit::WebGPU::ObjectHeap::convertAdapterFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupFromBacking): (WebKit::WebGPU::ObjectHeap::convertBindGroupLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandBufferFromBacking): (WebKit::WebGPU::ObjectHeap::convertCommandEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertComputePipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertDeviceFromBacking): (WebKit::WebGPU::ObjectHeap::convertGPUFromBacking): (WebKit::WebGPU::ObjectHeap::convertPipelineLayoutFromBacking): (WebKit::WebGPU::ObjectHeap::convertQuerySetFromBacking): (WebKit::WebGPU::ObjectHeap::convertQueueFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderBundleFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPassEncoderFromBacking): (WebKit::WebGPU::ObjectHeap::convertRenderPipelineFromBacking): (WebKit::WebGPU::ObjectHeap::convertSamplerFromBacking): (WebKit::WebGPU::ObjectHeap::convertShaderModuleFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureFromBacking): (WebKit::WebGPU::ObjectHeap::convertTextureViewFromBacking): * GPUProcess/graphics/WebGPU/WebGPUObjectHeap.h: Added. * GPUProcess/media/RemoteImageDecoderAVFProxy.h: * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): (headers_for_type): * Shared/WebGPU/WebGPUBindGroupDescriptor.h: (WebKit::WebGPU::BindGroupDescriptor::encode const): (WebKit::WebGPU::BindGroupDescriptor::decode): * Shared/WebGPU/WebGPUBindGroupEntry.h: (WebKit::WebGPU::BindGroupEntry::encode const): (WebKit::WebGPU::BindGroupEntry::decode): * Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.h: (WebKit::WebGPU::BindGroupLayoutDescriptor::encode const): (WebKit::WebGPU::BindGroupLayoutDescriptor::decode): * Shared/WebGPU/WebGPUBindGroupLayoutEntry.h: (WebKit::WebGPU::BindGroupLayoutEntry::encode const): (WebKit::WebGPU::BindGroupLayoutEntry::decode): * Shared/WebGPU/WebGPUBlendComponent.h: (WebKit::WebGPU::BlendComponent::encode const): (WebKit::WebGPU::BlendComponent::decode): * Shared/WebGPU/WebGPUBlendState.h: (WebKit::WebGPU::BlendState::encode const): (WebKit::WebGPU::BlendState::decode): * Shared/WebGPU/WebGPUBufferBinding.h: (WebKit::WebGPU::BufferBinding::encode const): (WebKit::WebGPU::BufferBinding::decode): * Shared/WebGPU/WebGPUBufferBindingLayout.h: (WebKit::WebGPU::BufferBindingLayout::encode const): (WebKit::WebGPU::BufferBindingLayout::decode): * Shared/WebGPU/WebGPUBufferDescriptor.h: (WebKit::WebGPU::BufferDescriptor::encode const): (WebKit::WebGPU::BufferDescriptor::decode): * Shared/WebGPU/WebGPUCanvasConfiguration.h: (WebKit::WebGPU::CanvasConfiguration::encode const): (WebKit::WebGPU::CanvasConfiguration::decode): * Shared/WebGPU/WebGPUColor.h: (WebKit::WebGPU::ColorDict::encode const): (WebKit::WebGPU::ColorDict::decode): * Shared/WebGPU/WebGPUColorTargetState.h: (WebKit::WebGPU::ColorTargetState::encode const): (WebKit::WebGPU::ColorTargetState::decode): * Shared/WebGPU/WebGPUCommandBufferDescriptor.h: (WebKit::WebGPU::CommandBufferDescriptor::encode const): (WebKit::WebGPU::CommandBufferDescriptor::decode): * Shared/WebGPU/WebGPUCommandEncoderDescriptor.h: (WebKit::WebGPU::CommandEncoderDescriptor::encode const): (WebKit::WebGPU::CommandEncoderDescriptor::decode): * Shared/WebGPU/WebGPUCompilationMessage.h: Added. (WebKit::WebGPU::CompilationMessage::encode const): (WebKit::WebGPU::CompilationMessage::decode): * Shared/WebGPU/WebGPUComputePassDescriptor.h: (WebKit::WebGPU::ComputePassDescriptor::encode const): (WebKit::WebGPU::ComputePassDescriptor::decode): * Shared/WebGPU/WebGPUComputePassTimestampWrites.h: (WebKit::WebGPU::ComputePassTimestampWrite::encode const): (WebKit::WebGPU::ComputePassTimestampWrite::decode): * Shared/WebGPU/WebGPUComputePipelineDescriptor.h: (WebKit::WebGPU::ComputePipelineDescriptor::encode const): (WebKit::WebGPU::ComputePipelineDescriptor::decode): * Shared/WebGPU/WebGPUConvertFromBackingContext.h: * Shared/WebGPU/WebGPUDepthStencilState.h: (WebKit::WebGPU::DepthStencilState::encode const): (WebKit::WebGPU::DepthStencilState::decode): * Shared/WebGPU/WebGPUDeviceDescriptor.h: (WebKit::WebGPU::DeviceDescriptor::encode const): (WebKit::WebGPU::DeviceDescriptor::decode): * Shared/WebGPU/WebGPUError.h: Copied from Source/WebKit/Shared/WebGPU/WebGPUCommandEncoderDescriptor.h. * Shared/WebGPU/WebGPUExtent3D.h: (WebKit::WebGPU::Extent3DDict::encode const): (WebKit::WebGPU::Extent3DDict::decode): * Shared/WebGPU/WebGPUExternalTextureBindingLayout.h: (WebKit::WebGPU::ExternalTextureBindingLayout::encode const): (WebKit::WebGPU::ExternalTextureBindingLayout::decode): * Shared/WebGPU/WebGPUExternalTextureDescriptor.h: (WebKit::WebGPU::ExternalTextureDescriptor::encode const): (WebKit::WebGPU::ExternalTextureDescriptor::decode): * Shared/WebGPU/WebGPUFragmentState.h: (WebKit::WebGPU::FragmentState::encode const): (WebKit::WebGPU::FragmentState::decode): * Shared/WebGPU/WebGPUImageCopyBuffer.h: (WebKit::WebGPU::ImageCopyBuffer::encode const): (WebKit::WebGPU::ImageCopyBuffer::decode): * Shared/WebGPU/WebGPUImageCopyExternalImage.h: (WebKit::WebGPU::ImageCopyExternalImage::encode const): (WebKit::WebGPU::ImageCopyExternalImage::decode): * Shared/WebGPU/WebGPUImageCopyTexture.h: (WebKit::WebGPU::ImageCopyTexture::encode const): (WebKit::WebGPU::ImageCopyTexture::decode): * Shared/WebGPU/WebGPUImageCopyTextureTagged.h: (WebKit::WebGPU::ImageCopyTextureTagged::encode const): (WebKit::WebGPU::ImageCopyTextureTagged::decode): * Shared/WebGPU/WebGPUImageDataLayout.h: (WebKit::WebGPU::ImageDataLayout::encode const): (WebKit::WebGPU::ImageDataLayout::decode): * Shared/WebGPU/WebGPUMultisampleState.h: (WebKit::WebGPU::MultisampleState::encode const): (WebKit::WebGPU::MultisampleState::decode): * Shared/WebGPU/WebGPUObjectDescriptorBase.h: (WebKit::WebGPU::ObjectDescriptorBase::encode const): (WebKit::WebGPU::ObjectDescriptorBase::decode): * Shared/WebGPU/WebGPUOrigin2D.h: (WebKit::WebGPU::Origin2DDict::encode const): (WebKit::WebGPU::Origin2DDict::decode): * Shared/WebGPU/WebGPUOrigin3D.h: (WebKit::WebGPU::Origin3DDict::encode const): (WebKit::WebGPU::Origin3DDict::decode): * Shared/WebGPU/WebGPUOutOfMemoryError.h: Copied from Source/WebKit/Shared/WebGPU/WebGPUCommandBufferDescriptor.h. (WebKit::WebGPU::OutOfMemoryError::encode const): (WebKit::WebGPU::OutOfMemoryError::decode): * Shared/WebGPU/WebGPUPipelineDescriptorBase.h: (WebKit::WebGPU::PipelineDescriptorBase::encode const): (WebKit::WebGPU::PipelineDescriptorBase::decode): * Shared/WebGPU/WebGPUPipelineLayoutDescriptor.h: (WebKit::WebGPU::PipelineLayoutDescriptor::encode const): (WebKit::WebGPU::PipelineLayoutDescriptor::decode): * Shared/WebGPU/WebGPUPrimitiveState.h: (WebKit::WebGPU::PrimitiveState::encode const): (WebKit::WebGPU::PrimitiveState::decode): * Shared/WebGPU/WebGPUProgrammableStage.h: (WebKit::WebGPU::ProgrammableStage::encode const): (WebKit::WebGPU::ProgrammableStage::decode): * Shared/WebGPU/WebGPUQuerySetDescriptor.h: (WebKit::WebGPU::QuerySetDescriptor::encode const): (WebKit::WebGPU::QuerySetDescriptor::decode): * Shared/WebGPU/WebGPURenderBundleDescriptor.h: (WebKit::WebGPU::RenderBundleDescriptor::encode const): (WebKit::WebGPU::RenderBundleDescriptor::decode): * Shared/WebGPU/WebGPURenderBundleEncoderDescriptor.h: (WebKit::WebGPU::RenderBundleEncoderDescriptor::encode const): (WebKit::WebGPU::RenderBundleEncoderDescriptor::decode): * Shared/WebGPU/WebGPURenderPassColorAttachment.h: (WebKit::WebGPU::RenderPassColorAttachment::encode const): (WebKit::WebGPU::RenderPassColorAttachment::decode): * Shared/WebGPU/WebGPURenderPassDepthStencilAttachment.h: (WebKit::WebGPU::RenderPassDepthStencilAttachment::encode const): (WebKit::WebGPU::RenderPassDepthStencilAttachment::decode): * Shared/WebGPU/WebGPURenderPassDescriptor.h: (WebKit::WebGPU::RenderPassDescriptor::encode const): (WebKit::WebGPU::RenderPassDescriptor::decode): * Shared/WebGPU/WebGPURenderPassLayout.h: (WebKit::WebGPU::RenderPassLayout::encode const): (WebKit::WebGPU::RenderPassLayout::decode): * Shared/WebGPU/WebGPURenderPassTimestampWrites.h: (WebKit::WebGPU::RenderPassTimestampWrite::encode const): (WebKit::WebGPU::RenderPassTimestampWrite::decode): * Shared/WebGPU/WebGPURenderPipelineDescriptor.h: (WebKit::WebGPU::RenderPipelineDescriptor::encode const): (WebKit::WebGPU::RenderPipelineDescriptor::decode): * Shared/WebGPU/WebGPURequestAdapterOptions.h: (WebKit::WebGPU::RequestAdapterOptions::encode const): (WebKit::WebGPU::RequestAdapterOptions::decode): * Shared/WebGPU/WebGPUSamplerBindingLayout.h: (WebKit::WebGPU::SamplerBindingLayout::encode const): (WebKit::WebGPU::SamplerBindingLayout::decode): * Shared/WebGPU/WebGPUSamplerDescriptor.h: (WebKit::WebGPU::SamplerDescriptor::encode const): (WebKit::WebGPU::SamplerDescriptor::decode): * Shared/WebGPU/WebGPUShaderModuleDescriptor.h: (WebKit::WebGPU::ShaderModuleDescriptor::encode const): (WebKit::WebGPU::ShaderModuleDescriptor::decode): * Shared/WebGPU/WebGPUStencilFaceState.h: (WebKit::WebGPU::StencilFaceState::encode const): (WebKit::WebGPU::StencilFaceState::decode): * Shared/WebGPU/WebGPUStorageTextureBindingLayout.h: (WebKit::WebGPU::StorageTextureBindingLayout::encode const): (WebKit::WebGPU::StorageTextureBindingLayout::decode): * Shared/WebGPU/WebGPUSupportedFeatures.h: Copied from Source/WebKit/Shared/WebGPU/WebGPUColor.h. (WebKit::WebGPU::SupportedFeatures::encode const): (WebKit::WebGPU::SupportedFeatures::decode): * Shared/WebGPU/WebGPUSupportedLimits.h: Added. (WebKit::WebGPU::SupportedLimits::encode const): (WebKit::WebGPU::SupportedLimits::decode): * Shared/WebGPU/WebGPUTextureBindingLayout.h: (WebKit::WebGPU::TextureBindingLayout::encode const): (WebKit::WebGPU::TextureBindingLayout::decode): * Shared/WebGPU/WebGPUTextureDescriptor.h: (WebKit::WebGPU::TextureDescriptor::encode const): (WebKit::WebGPU::TextureDescriptor::decode): * Shared/WebGPU/WebGPUTextureViewDescriptor.h: (WebKit::WebGPU::TextureViewDescriptor::encode const): (WebKit::WebGPU::TextureViewDescriptor::decode): * Shared/WebGPU/WebGPUValidationError.h: Copied from Source/WebKit/Shared/WebGPU/WebGPUColor.h. (WebKit::WebGPU::ValidationError::encode const): (WebKit::WebGPU::ValidationError::decode): * Shared/WebGPU/WebGPUVertexAttribute.h: (WebKit::WebGPU::VertexAttribute::encode const): (WebKit::WebGPU::VertexAttribute::decode): * Shared/WebGPU/WebGPUVertexBufferLayout.h: (WebKit::WebGPU::VertexBufferLayout::encode const): (WebKit::WebGPU::VertexBufferLayout::decode): * Shared/WebGPU/WebGPUVertexState.h: (WebKit::WebGPU::VertexState::encode const): (WebKit::WebGPU::VertexState::decode): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.cpp: (WebKit::WebGPU::RemoteAdapterProxy::requestDevice): * WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp: (WebKit::WebGPU::RemoteTextureProxy::createView): (WebKit::WebGPU::RemoteTextureProxy::createView const): Deleted. * WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.h: 2021-11-17 Alex Christensen Implement most of redirect and modify-headers action types https://bugs.webkit.org/show_bug.cgi?id=233268 Reviewed by Tim Hatcher. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::lookupContentRuleList): (API::ContentRuleListStore::compileContentRuleList): * UIProcess/API/APIContentRuleListStore.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::copy const): (API::WebsitePolicies::data): (API::WebsitePolicies::~WebsitePolicies): Deleted. * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: (WKUserContentExtensionStoreCompile): * UIProcess/API/Cocoa/WKContentRuleListStore.mm: (-[WKContentRuleListStore compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]): (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:allowedRedirectSchemes:completionHandler:]): (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (-[WKWebpagePreferences _setActiveContentRuleListActionsPatterns:]): (-[WKWebpagePreferences _activeContentRuleListActionsPatterns]): * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::remove): Fix a regression from https://trac.webkit.org/changeset/276193/webkit When fetching a resource with a forbidden port and a custom scheme and {mode:"no-cors"}, WebLoaderStrategy::remove is called with a resource that doesn't have an identifier. My test hit this, so I moved the check to before the identifier is used. 2021-11-17 Tim Horton Unified source build fix * Shared/GPUProcessConnectionParameters.h: 2021-11-17 Per Arne Vollan [macOS][GPUP] Add access to logging service for root https://bugs.webkit.org/show_bug.cgi?id=233300 Reviewed by Brent Fulgham. Access to logging service is required for root in the GPU process on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-17 Cameron McCormack Protect against null SharedBitmaps when starting a drag https://bugs.webkit.org/show_bug.cgi?id=233217 Reviewed by Wenson Hsieh. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startDrag): 2021-11-17 Wenson Hsieh [Live Text] Plumb an identifier string through `ChromeClient::requestTextRecognition()` https://bugs.webkit.org/show_bug.cgi?id=233210 Reviewed by Dean Jackson. Add an optional (i.e. null-by-default) identifier string to the `requestTextRecognition()` WebKit client hook, and call into a new helper function in TextRecognitionUtilities.h, that's implemented in WebKitAdditions (with an empty stub in open source code). See corresponding radar for more information. * Platform/cocoa/TextRecognitionUtilities.h: * Platform/cocoa/TextRecognitionUtilities.mm: (WebKit::requestImageAnalysisWithIdentifier): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::requestTextRecognition): * UIProcess/PageClient.h: (WebKit::PageClient::requestTextRecognition): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestTextRecognition): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::requestTextRecognition): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView requestTextRecognition:imageData:identifier:completionHandler:]): (-[WKContentView requestTextRecognition:imageData:completionHandler:]): Deleted. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::requestTextRecognition): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestTextRecognition): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::requestTextRecognition): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::requestTextRecognition): 2021-11-17 John Wilander PCM: Add capability for click destination to fire triggering event without cross-site requests to the click source https://bugs.webkit.org/show_bug.cgi?id=233173 Reviewed by Alex Christensen. This patch enables click destination sites a non-JavaScript way to fire triggering events without a requirement to make cross-site requests to source sites. This is referred to as a "same-site pixel API" and has been discussed in W3C Privacy CG: https://github.com/privacycg/private-click-measurement/issues/71 The reason why some merchants want such an "API" is reluctance to deploy new JavaScript on their sites. In some industries it's even a compliance issue. Legacy "pixels" are however accepted and so a same-site "pixel" can work for them. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp: (WebKit::PCM::Database::insertPrivateClickMeasurement): These changes are just a correction of a function name: - sourceUnlinkableToken() to sourceSecretToken() Note that it was always the secret token used, just bad renaming earlier. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp: (WebKit::PrivateClickMeasurementManager::handleAttribution): Now checks if the incoming WebCore::PrivateClickMeasurement::AttributionTriggerData carries a sourceRegistrableDomain. If so, it accepts that domain as the source site for attribution if the triggering event was same-site as the first-party. (WebKit::PrivateClickMeasurementManager::attribute): (WebKit::PrivateClickMeasurementManager::fireConversionRequest): These changes are just a correction of a function name: - sourceUnlinkableToken() to sourceSecretToken() Note that it was always the secret token used, just bad renaming earlier. (WebKit::PrivateClickMeasurementManager::fireConversionRequestImpl): These changes are because of clarification in naming: - attributionReportSourceURL to attributionReportClickSourceURL - attributionReportAttributeOnURL to attributionReportClickDestinationURL * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp: (WebKit::PCM::Store::attributePrivateClickMeasurement): * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h: 2021-11-17 Wenson Hsieh Add a Translation WebKit2 logging category https://bugs.webkit.org/show_bug.cgi?id=233286 Reviewed by Tim Horton. Add the new category. * Platform/Logging.h: 2021-11-17 J Pascoe [WebAuthn] Add SPI for makeCredential / getAssertion using clientDataHash https://bugs.webkit.org/show_bug.cgi?id=233216 Reviewed by Brent Fulgham. In order to avoid needing to make and coordinate changes to ASC to support new fields or changes within ClientDataJSON and to maintain a single source of truth, calls to ASC from WebKit will contain a precomputed ClientDataHash. This change creates new SPIs that will be called from ASC using the ClientDataHash. * UIProcess/API/Cocoa/_WKAuthenticatorResponse.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (-[_WKWebAuthenticationPanel makeCredentialWithClientDataHash:options:completionHandler:]): (-[_WKWebAuthenticationPanel getAssertionWithClientDataHash:options:completionHandler:]): New functions to take in ClientDataHash instead of the data needed to construct it. 2021-11-17 Per Arne Vollan [macOS] Add message filter guard in the GPU process' sandbox https://bugs.webkit.org/show_bug.cgi?id=233282 Reviewed by Brent Fulgham. Add message filter guard in the GPU process' sandbox. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-17 Tim Horton Momentum animator sometimes starts the animation at a very high velocity https://bugs.webkit.org/show_bug.cgi?id=233245 Reviewed by Simon Fraser. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): Ensure that wheel events always have velocities attached, even for events that don't go through the delta filter. 2021-11-17 Wenson Hsieh Add a helper class to coordinate batch analysis of images https://bugs.webkit.org/show_bug.cgi?id=233075 Reviewed by Dean Jackson. Add a couple of WKWebView SPI methods to kick off (and cancel) batch image analysis for mainframe content. See WebCore ChangeLog for more details. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _startImageAnalysis:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startImageAnalysis): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::startImageAnalysis): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2021-11-17 Dean Jackson Add ModelDocument for directly showing content that can be handled by https://bugs.webkit.org/show_bug.cgi?id=233057 rdar://85265880 Reviewed by Darin Adler. We don't need to use WKUSDPreviewView if we have ModelDocument. * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry initWithConfiguration:]): 2021-11-17 Antoine Quint [Model] Create iOS ModelPlayer implementation https://bugs.webkit.org/show_bug.cgi?id=233192 Reviewed by Dean Jackson. Bug 232848 factored platform-specific code out of HTMLModelElement with the use of a new ModelPlayer abstraction with a concrete ARKitInlinePreviewModelPlayer implementation. This first patch moved the macOS code, and this patch moves the remaining iOS code. To do so we make ARKitInlinePreviewModelPlayer a parent class of two platform-specific subclasses: ARKitInlinePreviewModelPlayerMac and ARKitInlinePreviewModelPlayerIOS. We add a new enterFullscreen() method to ModelPlayer, with an implementation in the iOS subclass. To support this new method, we add a new platformLayerID() on ModelPlayerClient. * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Model/ARKitInlinePreviewModelPlayer.h: Added. (WebKit::ARKitInlinePreviewModelPlayer::page): (WebKit::ARKitInlinePreviewModelPlayer::client): * WebProcess/Model/ARKitInlinePreviewModelPlayer.mm: Added. (WebKit::ARKitInlinePreviewModelPlayer::ARKitInlinePreviewModelPlayer): (WebKit::ARKitInlinePreviewModelPlayer::~ARKitInlinePreviewModelPlayer): (WebKit::ARKitInlinePreviewModelPlayer::load): (WebKit::ARKitInlinePreviewModelPlayer::layer): (WebKit::ARKitInlinePreviewModelPlayer::enterFullscreen): * WebProcess/Model/WebModelPlayerProvider.cpp: (WebKit::WebModelPlayerProvider::createModelPlayer): * WebProcess/Model/WebModelPlayerProvider.h: * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.h: Added. * WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.mm: Added. (WebKit::ARKitInlinePreviewModelPlayerIOS::create): (WebKit::ARKitInlinePreviewModelPlayerIOS::ARKitInlinePreviewModelPlayerIOS): (WebKit::ARKitInlinePreviewModelPlayerIOS::~ARKitInlinePreviewModelPlayerIOS): (WebKit::ARKitInlinePreviewModelPlayerIOS::enterFullscreen): * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h: Renamed from Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayer.h. * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm: Renamed from Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayer.mm. (WebKit::ARKitInlinePreviewModelPlayerMac::create): (WebKit::ARKitInlinePreviewModelPlayerMac::ARKitInlinePreviewModelPlayerMac): (WebKit::ARKitInlinePreviewModelPlayerMac::~ARKitInlinePreviewModelPlayerMac): (WebKit::ARKitInlinePreviewModelPlayerMac::setModelElementCacheDirectory): (WebKit::ARKitInlinePreviewModelPlayerMac::createFile): (WebKit::ARKitInlinePreviewModelPlayerMac::clearFile): (WebKit::ARKitInlinePreviewModelPlayerMac::load): (WebKit::ARKitInlinePreviewModelPlayerMac::layer): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setWebsiteDataStoreParameters): 2021-11-17 Zixing Liu [GTK][WPE] Support getting and setting HTTP headers in custom URI scheme handlers https://bugs.webkit.org/show_bug.cgi?id=203273 Reviewed by Carlos Garcia Campos. * UIProcess/API/glib/WebKitURISchemeRequest.cpp: (webkit_uri_scheme_request_get_http_headers): Added new API function (webkitURISchemeRequestReadCallback): Include user-specified headers * UIProcess/API/glib/WebKitURISchemeResponse.cpp: (WebKitURISchemeResponseGetHeaders): Added a new private getter (webkit_uri_scheme_response_set_http_headers): Added new API function * UIProcess/API/glib/WebKitURISchemeResponsePrivate.h: * UIProcess/API/gtk/WebKitURISchemeRequest.h: Added function prototype for webkit_uri_scheme_request_get_http_headers * UIProcess/API/gtk/WebKitURISchemeResponse.h: Added function prototype for webkit_uri_scheme_request_set_http_headers * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new symbols * UIProcess/API/wpe/WebKitURISchemeRequest.h: Added function prototype for webkit_uri_scheme_request_get_http_headers * UIProcess/API/wpe/WebKitURISchemeResponse.h: Added function prototype for webkit_uri_scheme_request_set_http_headers * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: Added new symbols 2021-11-16 Ross Kirsling Unreviewed, fix WinCairo build following r285881. * CMakeLists.txt: * WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.h: * WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.h: 2021-11-16 Sihui Liu Implement FileSystemFileHandle.getFile() https://bugs.webkit.org/show_bug.cgi?id=232716 Reviewed by Youenn Fablet. Let web process send message to network process for file path. * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::getFile): * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.messages.in: * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp: (WebKit::WebFileSystemStorageConnection::getFile): * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h: 2021-11-16 Per Arne Vollan [macOS] Add sandbox telemetry for preference access https://bugs.webkit.org/show_bug.cgi?id=233194 Reviewed by Brent Fulgham. Add sandbox telemetry for preference access on macOS. * Shared/Sandbox/preferences.sb: 2021-11-16 Devin Rousso [iOS] use PhotosUIPrivate instead of PhotosUI https://bugs.webkit.org/show_bug.cgi?id=233213 Reviewed by Aditya Keerthi. * Platform/spi/ios/PhotosUISPI.h: * UIProcess/ios/forms/WKFileUploadPanel.mm: 2021-11-16 Per Arne Vollan [iOS] Reduce telemetry https://bugs.webkit.org/show_bug.cgi?id=233218 Reviewed by Brent Fulgham. Reduce telemetry with backtrace for the system calls we have information about. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-11-16 Devin Rousso [Apple Pay] handle unknown setup features https://bugs.webkit.org/show_bug.cgi?id=233212 Reviewed by Wenson Hsieh. * Shared/ApplePay/ApplePayPaymentSetupFeatures.mm: (WebKit::PaymentSetupFeatures::operator Vector> const): Skip `PKPaymentSetupFeature` that have an unknown `PKPaymentSetupFeatureType`. This ensures that `WebCore::ApplePaySetupFeature` will only ever be created with known/supported `PKPaymentSetupFeatureType`. 2021-11-16 Nikolaos Mouchtaris Add overscroll behavior to ScrollableAreaParameters https://bugs.webkit.org/show_bug.cgi?id=233159 Reviewed by Simon Fraser. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: 2021-11-16 Per Arne Vollan Adjust graphics related message filter https://bugs.webkit.org/show_bug.cgi?id=233151 Reviewed by Brent Fulgham. Adjust graphics related message filter in the WebContent process' sandbox on iOS. This patch unifies the filter for different OS versions. * WebProcess/com.apple.WebProcess.sb.in: 2021-11-16 Per Arne Vollan [iOS] Limit graphics related IOKit method filtering https://bugs.webkit.org/show_bug.cgi?id=233209 Reviewed by Brent Fulgham. Limit graphics related IOKit method filtering based on OS version. This patch also adds an entitlement which will enable a replacement for the disabled filtering. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * Scripts/process-entitlements.sh: 2021-11-16 Myles C. Maxfield [WebGPU] Start preparing for serializing commands to the GPU process https://bugs.webkit.org/show_bug.cgi?id=233179 Reviewed by Alex Christensen. The interaction between WebGPU and the GPU process will work as such: 1. We have a virtual interface in PAL which holds 3 things: a) Refcounted objects (command buffer, queue, device, etc.). b) Structs holding descriptors for commands. E.g. device.createRenderPipeline(RenderPipelineDescriptor) c) Enums The virtual interface holds all 3 of these things. For refcounted objects, it holds virtual interfaces with no implementations. (There is one implementation of these interfaces which connects them to WebGPU.framework.) 2. This patch adds a new implementation of these virtual interfaces, called Remote***Proxy, in WebKit/WebProcess/GPU/graphics/WebGPU. The implementation of all the methods in this implementation will simply send messages to the GPU process. In this patch, these methods are still stubs - they'll be filled in in a subsequent patch. 3. The arguments to the commands consist of the structs and enums from PAL. However, we can't use the structs directly, because the structs hold references to the refcounted objects. E.g. a BindGroupDescriptor holds a reference to the Buffer which should be part of the bind group. We can't send refcounted objects across IPC, so instead of sending the objects, we send a WebGPUIdentifier instead. Every refcounted object gets a unique WebGPU identifier. However, because these references to RefCounted objects are buried deep inside nested structs, we can't simply use the structs out of the box. Instead, we have to have a parallel set of structs, where the references are replaced with WebGPUIdentifiers. These structs will be the ones actually sent across the wire. 4. The enums don't have this problem, so those are untouched. A subsequent patch will be adding the EnumTraits directly in PAL to make them serializable. 5. Upon receiving a struct from the wire, we're going to have to convert it back into its corresponding PAL type, which means we have to find the object associated with the WebGPUIdentifier. The serializers themselves can't do this, because they lack the context necessary for performing the lookup. This patch adds two new context objects which we'll use ourselves when implementing our own conversions - ConvertToBackingContext and ConvertFromBackingContext. Only the first one is implemented in this patch; the second will be implemented in a subsequent patch. 6. The GPU process side won't actually implement the virtual interface - only the web process side will implement it. Instead, the GPU process has to manage lifetime of the objects. Just like how 2D canvas in the GPU process has a RemoteResourceCache, the WebGPU objects will be owned by a high-level object in the GPU process. The ownership will be top-down in the GPU process, where Devices have strong references to Textures, and Textures have strong references to TextureViews. On the other hand, in the Web process, ownership will be bottom-up: JavaScript will have strong references to TextureViews, TextureViews will have strong references to Textures, and Textures will have strong references to Devices. This works out quite nicely - it means that, when GC runs and a TextureView gets deleted, the TextureView tells its owner that it's getting destroyed, its owner sends a message to the GPU process, and the corresponding owner in the GPU process looks up its relevant child in its children list, and delete it. Easy peasy. No new tests because there is no behavior change (yet). We're getting close, though! * Shared/WebGPU/WebGPUBindGroupDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBindGroupDescriptor.h. * Shared/WebGPU/WebGPUBindGroupEntry.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassColorAttachment.h. * Shared/WebGPU/WebGPUBindGroupLayoutDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUBindGroupLayoutEntry.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPUBlendComponent.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUBlendState.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUBufferBinding.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPUBufferBindingLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUBufferDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUCanvasConfiguration.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyTexture.h. * Shared/WebGPU/WebGPUColor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUColorTargetState.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPUCommandBufferDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUCommandEncoderDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUComputePassDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUComputePassTimestampWrites.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUComputePassTimestampWrites.h. * Shared/WebGPU/WebGPUComputePipelineDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUConvertFromBackingContext.h: Added. * Shared/WebGPU/WebGPUConvertToBackingContext.h: Added. * Shared/WebGPU/WebGPUDepthStencilState.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPUDeviceDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBindGroupDescriptor.h. * Shared/WebGPU/WebGPUExtent3D.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassTimestampWrites.h. * Shared/WebGPU/WebGPUExternalTextureBindingLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUExternalTextureDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUFragmentState.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUIdentifier.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUImageCopyBuffer.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUImageCopyExternalImage.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPUImageCopyTexture.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyTexture.h. * Shared/WebGPU/WebGPUImageCopyTextureTagged.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUImageDataLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPUMultisampleState.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUObjectDescriptorBase.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUOrigin2D.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineLayoutDescriptor.h. * Shared/WebGPU/WebGPUOrigin3D.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineLayoutDescriptor.h. * Shared/WebGPU/WebGPUPipelineDescriptorBase.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUPipelineLayoutDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineLayoutDescriptor.h. * Shared/WebGPU/WebGPUPrimitiveState.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPUProgrammableStage.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUProgrammableStage.h. * Shared/WebGPU/WebGPUQuerySetDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBindGroupDescriptor.h. * Shared/WebGPU/WebGPURenderBundleDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPURenderBundleEncoderDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPURenderPassColorAttachment.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassColorAttachment.h. * Shared/WebGPU/WebGPURenderPassDepthStencilAttachment.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. * Shared/WebGPU/WebGPURenderPassDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineLayoutDescriptor.h. * Shared/WebGPU/WebGPURenderPassLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineLayoutDescriptor.h. * Shared/WebGPU/WebGPURenderPassTimestampWrites.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassTimestampWrites.h. * Shared/WebGPU/WebGPURenderPipelineDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPURequestAdapterOptions.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Shared/WebGPU/WebGPUSamplerBindingLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUSamplerDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUShaderModuleDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUStencilFaceState.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUStorageTextureBindingLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUTextureBindingLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUTextureDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUTextureViewDescriptor.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineDescriptorBase.h. * Shared/WebGPU/WebGPUVertexAttribute.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUImageCopyBuffer.h. * Shared/WebGPU/WebGPUVertexBufferLayout.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUPipelineLayoutDescriptor.h. * Shared/WebGPU/WebGPUVertexState.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUBufferBinding.h. * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteAdapterProxy::RemoteAdapterProxy): (WebKit::WebGPU::RemoteAdapterProxy::~RemoteAdapterProxy): (WebKit::WebGPU::RemoteAdapterProxy::requestDevice): * WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupLayoutProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteBindGroupLayoutProxy::RemoteBindGroupLayoutProxy): (WebKit::WebGPU::RemoteBindGroupLayoutProxy::~RemoteBindGroupLayoutProxy): (WebKit::WebGPU::RemoteBindGroupLayoutProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupLayoutProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteBindGroupProxy::RemoteBindGroupProxy): (WebKit::WebGPU::RemoteBindGroupProxy::~RemoteBindGroupProxy): (WebKit::WebGPU::RemoteBindGroupProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteBindGroupProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteBufferProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteBufferProxy::RemoteBufferProxy): (WebKit::WebGPU::RemoteBufferProxy::~RemoteBufferProxy): (WebKit::WebGPU::RemoteBufferProxy::mapAsync): (WebKit::WebGPU::RemoteBufferProxy::getMappedRange): (WebKit::WebGPU::RemoteBufferProxy::unmap): (WebKit::WebGPU::RemoteBufferProxy::destroy): (WebKit::WebGPU::RemoteBufferProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteBufferProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteCommandBufferProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteCommandBufferProxy::RemoteCommandBufferProxy): (WebKit::WebGPU::RemoteCommandBufferProxy::~RemoteCommandBufferProxy): (WebKit::WebGPU::RemoteCommandBufferProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteCommandBufferProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteCommandEncoderProxy.cpp: Added. (WebKit::WebGPU::RemoteCommandEncoderProxy::RemoteCommandEncoderProxy): (WebKit::WebGPU::RemoteCommandEncoderProxy::~RemoteCommandEncoderProxy): (WebKit::WebGPU::RemoteCommandEncoderProxy::beginRenderPass): (WebKit::WebGPU::RemoteCommandEncoderProxy::beginComputePass): (WebKit::WebGPU::RemoteCommandEncoderProxy::copyBufferToBuffer): (WebKit::WebGPU::RemoteCommandEncoderProxy::copyBufferToTexture): (WebKit::WebGPU::RemoteCommandEncoderProxy::copyTextureToBuffer): (WebKit::WebGPU::RemoteCommandEncoderProxy::copyTextureToTexture): (WebKit::WebGPU::RemoteCommandEncoderProxy::fillBuffer): (WebKit::WebGPU::RemoteCommandEncoderProxy::pushDebugGroup): (WebKit::WebGPU::RemoteCommandEncoderProxy::popDebugGroup): (WebKit::WebGPU::RemoteCommandEncoderProxy::insertDebugMarker): (WebKit::WebGPU::RemoteCommandEncoderProxy::writeTimestamp): (WebKit::WebGPU::RemoteCommandEncoderProxy::resolveQuerySet): (WebKit::WebGPU::RemoteCommandEncoderProxy::finish): (WebKit::WebGPU::RemoteCommandEncoderProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteCommandEncoderProxy.h: Added. * WebProcess/GPU/graphics/WebGPU/RemoteComputePassEncoderProxy.cpp: Added. (WebKit::WebGPU::RemoteComputePassEncoderProxy::RemoteComputePassEncoderProxy): (WebKit::WebGPU::RemoteComputePassEncoderProxy::~RemoteComputePassEncoderProxy): (WebKit::WebGPU::RemoteComputePassEncoderProxy::setPipeline): (WebKit::WebGPU::RemoteComputePassEncoderProxy::dispatch): (WebKit::WebGPU::RemoteComputePassEncoderProxy::dispatchIndirect): (WebKit::WebGPU::RemoteComputePassEncoderProxy::beginPipelineStatisticsQuery): (WebKit::WebGPU::RemoteComputePassEncoderProxy::endPipelineStatisticsQuery): (WebKit::WebGPU::RemoteComputePassEncoderProxy::endPass): (WebKit::WebGPU::RemoteComputePassEncoderProxy::setBindGroup): (WebKit::WebGPU::RemoteComputePassEncoderProxy::pushDebugGroup): (WebKit::WebGPU::RemoteComputePassEncoderProxy::popDebugGroup): (WebKit::WebGPU::RemoteComputePassEncoderProxy::insertDebugMarker): (WebKit::WebGPU::RemoteComputePassEncoderProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteComputePassEncoderProxy.h: Added. * WebProcess/GPU/graphics/WebGPU/RemoteComputePipelineProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteComputePipelineProxy::RemoteComputePipelineProxy): (WebKit::WebGPU::RemoteComputePipelineProxy::~RemoteComputePipelineProxy): (WebKit::WebGPU::RemoteComputePipelineProxy::getBindGroupLayout): (WebKit::WebGPU::RemoteComputePipelineProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteComputePipelineProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.cpp: Added. (WebKit::WebGPU::RemoteDeviceProxy::RemoteDeviceProxy): (WebKit::WebGPU::RemoteDeviceProxy::~RemoteDeviceProxy): (WebKit::WebGPU::RemoteDeviceProxy::destroy): (WebKit::WebGPU::RemoteDeviceProxy::createBuffer): (WebKit::WebGPU::RemoteDeviceProxy::createTexture): (WebKit::WebGPU::RemoteDeviceProxy::createSampler): (WebKit::WebGPU::RemoteDeviceProxy::importExternalTexture): (WebKit::WebGPU::RemoteDeviceProxy::createBindGroupLayout): (WebKit::WebGPU::RemoteDeviceProxy::createPipelineLayout): (WebKit::WebGPU::RemoteDeviceProxy::createBindGroup): (WebKit::WebGPU::RemoteDeviceProxy::createShaderModule): (WebKit::WebGPU::RemoteDeviceProxy::createComputePipeline): (WebKit::WebGPU::RemoteDeviceProxy::createRenderPipeline): (WebKit::WebGPU::RemoteDeviceProxy::createComputePipelineAsync): (WebKit::WebGPU::RemoteDeviceProxy::createRenderPipelineAsync): (WebKit::WebGPU::RemoteDeviceProxy::createCommandEncoder): (WebKit::WebGPU::RemoteDeviceProxy::createRenderBundleEncoder): (WebKit::WebGPU::RemoteDeviceProxy::createQuerySet): (WebKit::WebGPU::RemoteDeviceProxy::pushErrorScope): (WebKit::WebGPU::RemoteDeviceProxy::popErrorScope): (WebKit::WebGPU::RemoteDeviceProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.h: Added. * WebProcess/GPU/graphics/WebGPU/RemoteExternalTextureProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteExternalTextureProxy::RemoteExternalTextureProxy): (WebKit::WebGPU::RemoteExternalTextureProxy::~RemoteExternalTextureProxy): (WebKit::WebGPU::RemoteExternalTextureProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteExternalTextureProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteGPUProxy::RemoteGPUProxy): (WebKit::WebGPU::RemoteGPUProxy::~RemoteGPUProxy): (WebKit::WebGPU::RemoteGPUProxy::requestAdapter): * WebProcess/GPU/graphics/WebGPU/RemoteGPUProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemotePipelineLayoutProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemotePipelineLayoutProxy::RemotePipelineLayoutProxy): (WebKit::WebGPU::RemotePipelineLayoutProxy::~RemotePipelineLayoutProxy): (WebKit::WebGPU::RemotePipelineLayoutProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemotePipelineLayoutProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteQuerySetProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteQuerySetProxy::RemoteQuerySetProxy): (WebKit::WebGPU::RemoteQuerySetProxy::~RemoteQuerySetProxy): (WebKit::WebGPU::RemoteQuerySetProxy::destroy): (WebKit::WebGPU::RemoteQuerySetProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteQuerySetProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.cpp: Added. (WebKit::WebGPU::RemoteQueueProxy::RemoteQueueProxy): (WebKit::WebGPU::RemoteQueueProxy::~RemoteQueueProxy): (WebKit::WebGPU::RemoteQueueProxy::submit): (WebKit::WebGPU::RemoteQueueProxy::onSubmittedWorkDone): (WebKit::WebGPU::RemoteQueueProxy::writeBuffer): (WebKit::WebGPU::RemoteQueueProxy::writeTexture): (WebKit::WebGPU::RemoteQueueProxy::copyExternalImageToTexture): (WebKit::WebGPU::RemoteQueueProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteQueueProxy.h: Added. * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleEncoderProxy.cpp: Added. (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::RemoteRenderBundleEncoderProxy): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::~RemoteRenderBundleEncoderProxy): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setPipeline): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setIndexBuffer): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setVertexBuffer): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::draw): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::drawIndexed): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::drawIndirect): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::drawIndexedIndirect): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setBindGroup): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::pushDebugGroup): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::popDebugGroup): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::insertDebugMarker): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::finish): (WebKit::WebGPU::RemoteRenderBundleEncoderProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleEncoderProxy.h: Added. * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteRenderBundleProxy::RemoteRenderBundleProxy): (WebKit::WebGPU::RemoteRenderBundleProxy::~RemoteRenderBundleProxy): (WebKit::WebGPU::RemoteRenderBundleProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteRenderBundleProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteRenderPassEncoderProxy.cpp: Added. (WebKit::WebGPU::RemoteRenderPassEncoderProxy::RemoteRenderPassEncoderProxy): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::~RemoteRenderPassEncoderProxy): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setPipeline): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setIndexBuffer): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setVertexBuffer): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::draw): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::drawIndexed): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::drawIndirect): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::drawIndexedIndirect): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setBindGroup): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::pushDebugGroup): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::popDebugGroup): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::insertDebugMarker): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setViewport): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setScissorRect): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setBlendConstant): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setStencilReference): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::beginOcclusionQuery): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::endOcclusionQuery): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::beginPipelineStatisticsQuery): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::endPipelineStatisticsQuery): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::executeBundles): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::endPass): (WebKit::WebGPU::RemoteRenderPassEncoderProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteRenderPassEncoderProxy.h: Added. * WebProcess/GPU/graphics/WebGPU/RemoteRenderPipelineProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteRenderPipelineProxy::RemoteRenderPipelineProxy): (WebKit::WebGPU::RemoteRenderPipelineProxy::~RemoteRenderPipelineProxy): (WebKit::WebGPU::RemoteRenderPipelineProxy::getBindGroupLayout): (WebKit::WebGPU::RemoteRenderPipelineProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteRenderPipelineProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteSamplerProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUProgrammableStage.h. (WebKit::WebGPU::RemoteSamplerProxy::RemoteSamplerProxy): (WebKit::WebGPU::RemoteSamplerProxy::~RemoteSamplerProxy): (WebKit::WebGPU::RemoteSamplerProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteSamplerProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteShaderModuleProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteShaderModuleProxy::RemoteShaderModuleProxy): (WebKit::WebGPU::RemoteShaderModuleProxy::~RemoteShaderModuleProxy): (WebKit::WebGPU::RemoteShaderModuleProxy::compilationInfo): (WebKit::WebGPU::RemoteShaderModuleProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteShaderModuleProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteTextureProxy::RemoteTextureProxy): (WebKit::WebGPU::RemoteTextureProxy::~RemoteTextureProxy): (WebKit::WebGPU::RemoteTextureProxy::createView const): (WebKit::WebGPU::RemoteTextureProxy::destroy): (WebKit::WebGPU::RemoteTextureProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/RemoteTextureViewProxy.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/WebGPURenderPassDepthStencilAttachment.h. (WebKit::WebGPU::RemoteTextureViewProxy::RemoteTextureViewProxy): (WebKit::WebGPU::RemoteTextureViewProxy::~RemoteTextureViewProxy): (WebKit::WebGPU::RemoteTextureViewProxy::setLabelInternal): * WebProcess/GPU/graphics/WebGPU/RemoteTextureViewProxy.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.h. * WebProcess/GPU/graphics/WebGPU/WebGPUDowncastConvertToBackingContext.cpp: Added. (WebKit::WebGPU::DowncastConvertToBackingContext::convertToBacking): * WebProcess/GPU/graphics/WebGPU/WebGPUDowncastConvertToBackingContext.h: Added. * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp: 2021-11-16 Per Arne Vollan Adjust graphics related message filter https://bugs.webkit.org/show_bug.cgi?id=233151 Reviewed by Brent Fulgham. Adjust graphics related message filter in the WebContent process' sandbox on iOS. This patch unifies the filter for different OS versions. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2021-11-16 Chris Dumez Crash under WebKit::WebPageProxy::commitProvisionalPage() https://bugs.webkit.org/show_bug.cgi?id=233199 Reviewed by Youenn Fablet. In the event where the committed WebProcess would crash while a cross-site provisional load is going on in a provisional page / WebProcess, we would do a null dereference of the page's drawing area when trying to commit the provisional page later on. We would also hit various assertions in debug since the page's state gets completely reset when its WebProcess crashes. To address the issue, we now clear the provisional page if the page's WebProcess crashes. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetStateAfterProcessExited): 2021-11-16 Chris Dumez [iOS] Do not require the web browser entitlement to opt into captive portal mode https://bugs.webkit.org/show_bug.cgi?id=233191 Reviewed by Brent Fulgham. Do not require the web browser entitlement to opt into captive portal mode on iOS, only require it to opt out. * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (-[WKWebpagePreferences _setCaptivePortalModeEnabled:]): 2021-11-16 Per Arne Vollan [macOS][GPUP] Add telemetry for syscalls https://bugs.webkit.org/show_bug.cgi?id=232888 Reviewed by Brent Fulgham. Add more telemetry for syscalls in the GPU process' sandbox on macOS. Also add entitlement for the GPU process to use message filtering. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Scripts/process-entitlements.sh: 2021-11-16 Chris Dumez Decoder::unwrapForTesting() is unnecessarily inefficient https://bugs.webkit.org/show_bug.cgi?id=233145 Reviewed by Darin Adler. Decoder::unwrapForTesting() is unnecessarily inefficient. It can take the whole m_attachments data members from the decoder instead of calling removeAttachment() repeatedly on the Decoder. Also rename removeAttachment() to takeAttachment() since it returns the Attachment. Update it to return a std::optional instead of using an out-parameter. * Platform/IPC/Attachment.cpp: (IPC::Attachment::decode): * Platform/IPC/Attachment.h: * Platform/IPC/Decoder.cpp: (IPC::Decoder::unwrapForTesting): (IPC::Decoder::takeAttachment): (IPC::Decoder::removeAttachment): Deleted. * Platform/IPC/Decoder.h: * Platform/IPC/win/AttachmentWin.cpp: (IPC::Attachment::decode): 2021-11-16 Chris Dumez Do some hardening in IPC::createMessageDecoder() https://bugs.webkit.org/show_bug.cgi?id=233148 Reviewed by Darin Adler. Do more bound validation insde createMessageDecoder() to make sure we stay within the bounds of our ReceiveBuffer. Also, when the body is out of line, set `out_of_line.deallocate` to false since we are taking ownership of the memory and will vm_deallocate() it ourselves. Normally the sender (Connection::sendOutgoingMessage) sets that flag to false but it is better not to rely on the sender setting a particular flag. * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::createMessageDecoder): (IPC::Connection::receiveSourceEventHandler): 2021-11-16 J Pascoe [WebAuthn] WebKitTestRunner/TWAPI lacks an entitlement and bundle identifier to use required [ASCAgent performAuthorizationRequestsForContext] https://bugs.webkit.org/show_bug.cgi?id=232846 rdar://problem/85170633 Reviewed by Brent Fulgham. Covered by existing tests. Calling to ASC requires converting WebAuthenticationRequestData to ASCCredentialRequestContext and then making a call to _WKAuthenticatorAssertionResponse, while also requiring entitlements currently unavailable in OpenSource. This change avoids calling out to ASC in tests using mock / virtual authenticators to avoid this problem, the serialization to and from ASCAgent can be tested seperately. * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: Refactor creation of ASCCredentialRequestContext. (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): Refactor use of ASC and add clarifying comment about flow. 2021-11-16 Kimmo Kinnunen RemoteGraphicsContextGLCocoa::m_swapChain is unused https://bugs.webkit.org/show_bug.cgi?id=233176 Reviewed by Antti Koivisto. Remove the unused variable. * GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp: 2021-11-15 Commit Queue Unreviewed, reverting r285812. https://bugs.webkit.org/show_bug.cgi?id=233162 Introduced test failures Reverted changeset: "[macOS][GPUP] Add telemetry for syscalls" https://bugs.webkit.org/show_bug.cgi?id=232888 https://commits.webkit.org/r285812 2021-11-15 Sam Weinig Add another backend backed by SceneKit to prove out ModelPlayer infrastructure a bit more https://bugs.webkit.org/show_bug.cgi?id=233112 Reviewed by Dean Jackson. Add support for instantiating the new SceneKit backed ModelPlayer. If both ARKit based ModelPlayer and SceneKit based ModelPlayer are enabled, the ARKit one wins. * WebProcess/Model/WebModelPlayerProvider.cpp: (WebKit::WebModelPlayerProvider::createModelPlayer): Add support for creating a SceneKit based ModelPlayer and add checks for whether the backend is enabled. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::useARKitForModel const): (WebKit::WebPage::useSceneKitForModel const): Add bits to store which backends are enabled. 2021-11-15 Eric Liang _AXSCopyPathForAccessibilityBundle is going to be deprecated. https://bugs.webkit.org/show_bug.cgi?id=233081 Reviewed by Andres Gonzalez. To support macOS Accessibility v2 runtime, on macOS there are two places where bundles can live. By doing so, `_AXSCopyPathForAccessibilityBundle` will going to be deprecated because it won’t always return the correct path you would expect. * Platform/spi/Cocoa/AccessibilitySupportSPI.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::webProcessLoaderAccessibilityBundlePath): 2021-11-15 Michael Catanzaro Make valgrind work properly without extra environment variables https://bugs.webkit.org/show_bug.cgi?id=230460 Reviewed by Carlos Garcia Campos. WebKitGTK and WPE WebKit users also have to set the WEBKIT_FORCE_SANDBOX=0 environment variable, because the web process sandbox breaks valgrind for some reason I never attempted to understand. If we have bmalloc expose valgrind.h as a public header, then we can check for valgrind in higher layers and make this work automatically too. * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::ProcessLauncher::launchProcess): 2021-11-15 Chris Dumez Remove some dead code from IPC::Encoder / IPC::Decoder https://bugs.webkit.org/show_bug.cgi?id=233134 Reviewed by Sam Weinig. Remove some dead code from IPC::Encoder / IPC::Decoder and make sure both types are non-copyable / non-movable. * Platform/IPC/Decoder.cpp: * Platform/IPC/Decoder.h: (IPC::Decoder::decodeSingleObject): Deleted. (): Deleted. * Platform/IPC/Encoder.cpp: (IPC::Encoder::Encoder): * Platform/IPC/Encoder.h: 2021-11-15 Per Arne Vollan [macOS][GPUP] Add telemetry for syscalls https://bugs.webkit.org/show_bug.cgi?id=232888 Reviewed by Brent Fulgham. Add more telemetry for syscalls in the GPU process' sandbox on macOS. Also add entitlement for the GPU process to use message filtering. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Scripts/process-entitlements.sh: 2021-11-15 Commit Queue Unreviewed, reverting r285774. https://bugs.webkit.org/show_bug.cgi?id=233136 Introduced GPUP crash on some configurations Reverted changeset: "[macOS][GPUP] Add telemetry for syscalls" https://bugs.webkit.org/show_bug.cgi?id=232888 https://commits.webkit.org/r285774 2021-11-14 Brady Eidson Get daemon API ready to work in the iOS simulator (starting with WebPushD) https://bugs.webkit.org/show_bug.cgi?id=232982 Reviewed by Geoff Garen. Move all the "enable Notifications" SPI from Mac-only to cross platform: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setNotificationsEnabled:]): (-[WKPreferences _notificationsEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest): * WebKit.xcodeproj/project.pbxproj: Add a build phase script to install the daemon executables inside a Daemons directory within the built WebKit.framework for engineering builds. * webpushd/WebPushDaemon.mm: 2021-11-14 Fujii Hironori [GraphicsLayerWC] Incorrect compositing debug border color https://bugs.webkit.org/show_bug.cgi?id=233107 Reviewed by Don Olmstead. GraphicsLayer::updateDebugIndicators() should be called after changing some layer properties. * WebProcess/WebPage/wc/GraphicsLayerWC.cpp: (WebKit::GraphicsLayerWC::setMasksToBounds): (WebKit::GraphicsLayerWC::setDrawsContent): (WebKit::GraphicsLayerWC::setContentsToPlatformLayer): (WebKit::GraphicsLayerWC::setBackdropFilters): Call updateDebugIndicators. 2021-11-14 Simon Fraser Attach IOHIDEvent timestamps to wheel events https://bugs.webkit.org/show_bug.cgi?id=233051 Reviewed by Wenson Hsieh. On some macOS devices, there can be significant deltas between NSEvent timestamps, and the timestamps on underlying IOHIDEvents (rdar://85309639). This makes momentum velocity computation unpredictable; we can get better results by using IOHIDEvent timestamps. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): (WebKit::WebWheelEvent::encode const): (WebKit::WebWheelEvent::decode): * Shared/WebWheelEvent.h: (WebKit::WebWheelEvent::ioHIDEventTimestamp const): * Shared/WebWheelEventCoalescer.cpp: (WebKit::WebWheelEventCoalescer::coalesce): * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::createWebWheelEvent): * Shared/mac/NativeWebGestureEventMac.mm: * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): 2021-11-13 Per Arne Vollan [macOS][GPUP] Remove logging of used syscalls https://bugs.webkit.org/show_bug.cgi?id=232839 Reviewed by Brent Fulgham. Based on telemetry, remove logging of used unix syscalls in the GPU process on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-13 Per Arne Vollan [macOS][GPUP] Add telemetry for syscalls https://bugs.webkit.org/show_bug.cgi?id=232888 Reviewed by Brent Fulgham. Add more telemetry for syscalls in the GPU process' sandbox on macOS. Also add entitlement for the GPU process to use message filtering. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Scripts/process-entitlements.sh: 2021-11-13 Per Arne Vollan [iOS][GPUP] Add system call logging https://bugs.webkit.org/show_bug.cgi?id=233079 Reviewed by Brent Fulgham. Add telemetry for system calls in the GPU process' sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-12 Darin Adler Make sort-Xcode-project-file idempotent https://bugs.webkit.org/show_bug.cgi?id=233077 Reviewed by Wenson Hsieh. * WebKit.xcodeproj/project.pbxproj: Sorted. 2021-11-12 Garrett Davidson _WKWebAuthenticationPanel should expose a way to encode CTAP commands https://bugs.webkit.org/show_bug.cgi?id=232977 Reviewed by David Kilzer. Expose the existing CTAP command encoding through _WKWebAuthenticationPanel. Covered by existing tests. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (coreUserVerificationAvailability): (+[_WKWebAuthenticationPanel getClientDataJSONForAuthenticationType:challenge:origin:]) (+[_WKWebAuthenticationPanel encodeMakeCredentialCommandWithClientDataJSON:options:userVerificationAvailability:]): (+[_WKWebAuthenticationPanel encodeGetAssertionCommandWithClientDataJSON:options:userVerificationAvailability:]): 2021-11-12 Per Arne Vollan [iOS][GPUP] Allow access to syscalls https://bugs.webkit.org/show_bug.cgi?id=232825 Reviewed by Brent Fulgham. Based on telemetry, add access to unix syscalls in the GPU process on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-12 Sihui Liu Set default general storage directory to websiteDataDirectory https://bugs.webkit.org/show_bug.cgi?id=232985 Reviewed by Geoffrey Garen. New API test: FileSystemAccess.MigrateToNewStorageDirectory * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::defaultGeneralStorageDirectory): 2021-11-12 Timothy Hatcher Remove non-completionHandler version of -[WKWebView _loadServiceWorker:] https://bugs.webkit.org/show_bug.cgi?id=233069 rdar://problem/85355540 Reviewed by Chris Dumez. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _loadServiceWorker:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed _loadServiceWorker:. 2021-11-12 Peng Liu Promote WKPreferences._fullScreenEnabled to API https://bugs.webkit.org/show_bug.cgi?id=230784 Reviewed by Jer Noble. * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences isElementFullscreenEnabled]): (-[WKPreferences setElementFullscreenEnabled:]): * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView fullscreenState]): * UIProcess/Cocoa/FullscreenClient.h: * UIProcess/Cocoa/FullscreenClient.mm: (WebKit::FullscreenClient::willEnterFullscreen): (WebKit::FullscreenClient::didEnterFullscreen): (WebKit::FullscreenClient::willExitFullscreen): (WebKit::FullscreenClient::didExitFullscreen): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): * UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::willEnterFullScreen): (WebKit::WebFullScreenManagerProxy::didEnterFullScreen): (WebKit::WebFullScreenManagerProxy::willExitFullScreen): (WebKit::WebFullScreenManagerProxy::didExitFullScreen): * UIProcess/WebFullScreenManagerProxy.h: (WebKit::WebFullScreenManagerProxy::fullscreenState const): 2021-11-12 Chris Dumez Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI https://bugs.webkit.org/show_bug.cgi?id=233059 Reviewed by Geoffrey Garen. Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI until we reach agreement on a suitable API name. * UIProcess/API/Cocoa/WKWebpagePreferences.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (-[WKWebpagePreferences _setCaptivePortalModeEnabled:]): (-[WKWebpagePreferences _captivePortalModeEnabled]): (-[WKWebpagePreferences setCaptivePortalModeEnabled:]): Deleted. (-[WKWebpagePreferences captivePortalModeEnabled]): Deleted. * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: 2021-11-12 Chris Dumez Rename ProcessLauncherMac.mm to ProcessLauncherCocoa.mm https://bugs.webkit.org/show_bug.cgi?id=233045 Reviewed by Brent Fulgham. Follow-up to r285729 to rename to ProcessLauncherCocoa.mm instead of ProcessLauncherDarwin.mm given that the implementation is using NSBundle. * SourcesCocoa.txt: * UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm: Renamed from Source/WebKit/UIProcess/Launcher/darwin/ProcessLauncherDarwin.mm. (WebKit::serviceName): (WebKit::shouldLeakBoost): (WebKit::systemDirectoryPath): (WebKit::ProcessLauncher::launchProcess): (WebKit::ProcessLauncher::terminateProcess): (WebKit::ProcessLauncher::platformInvalidate): (WebKit::ProcessLauncher::terminateXPCConnection): (WebKit::terminateWithReason): * WebKit.xcodeproj/project.pbxproj: 2021-11-12 Brent Fulgham REGRESSION (r285698): Build correction after refactoring id handling https://bugs.webkit.org/show_bug.cgi?id=233052 Reviewed by Chris Dumez. Build fix after r285698. The new 'toNSData' method needs its namespace included. * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::toASCDescriptor): (WebKit::configureRegistrationRequestContext): (WebKit::configurationAssertionRequestContext): (WebKit::toNSData): Deleted. 2021-11-12 Per Arne [macOS][GPUP] Block access to mach register https://bugs.webkit.org/show_bug.cgi?id=232259 Reviewed by Brent Fulgham. Based on telemetry, block access to mach register in the GPU process on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-12 Chris Dumez Disable MathML when in Captive Portal Mode https://bugs.webkit.org/show_bug.cgi?id=233013 Reviewed by Brent Fulgham. Turn off MathML support when in Captive Portal Mode. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2021-11-12 Chris Dumez Rename ProcessLauncherMac.mm to ProcessLauncherDarwin.mm https://bugs.webkit.org/show_bug.cgi?id=233045 Reviewed by Brent Fulgham. Rename ProcessLauncherMac.mm to ProcessLauncherDarwin.mm since this implementation is used by both macOS and iOS. I chose the Darwin naming (as opposed to the Cocoa one) because the implementation only relies on libXPC and mach. * SourcesCocoa.txt: * UIProcess/Launcher/darwin/ProcessLauncherDarwin.mm: Renamed from Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm. (WebKit::serviceName): (WebKit::shouldLeakBoost): (WebKit::systemDirectoryPath): (WebKit::ProcessLauncher::launchProcess): (WebKit::ProcessLauncher::terminateProcess): (WebKit::ProcessLauncher::platformInvalidate): (WebKit::ProcessLauncher::terminateXPCConnection): (WebKit::terminateWithReason): * WebKit.xcodeproj/project.pbxproj: 2021-11-12 Chris Dumez Unreviewed, partial revert of r285565 to resolve a PLT5 regression. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::sessionWrapperForTask): (WebKit::NetworkSessionCocoa::isolatedSession): (WebKit::SessionSet::isolatedSession): (WebKit::NetworkSessionCocoa::hasIsolatedSession const): (WebKit::NetworkSessionCocoa::clearIsolatedSessions): (WebKit::NetworkSessionCocoa::invalidateAndCancelSessionSet): 2021-11-12 Adrian Perez de Castro Some C++ source files use #pragma once https://bugs.webkit.org/show_bug.cgi?id=233040 Remove spurious usage of "#pragma once" in implementation files. Reviewed by Chris Dumez. * WebProcess/WebCoreSupport/WebCaptionPreferencesDelegate.cpp: 2021-11-12 Per Arne Vollan [macOS][GPUP] Remove sandbox write access to files https://bugs.webkit.org/show_bug.cgi?id=232247 Reviewed by Brent Fulgham. Based on telemetry, remove sandbox write access to files in the GPU process on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-12 Per Arne Vollan [iOS][GPU] Remove access to IOKit classes https://bugs.webkit.org/show_bug.cgi?id=232344 Reviewed by Darin Adler. Based on telemetry, remove access to unused IOKit classes in the GPU process' sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-12 Per Arne [macOS][GPUP] Add syscalls to sandbox https://bugs.webkit.org/show_bug.cgi?id=232210 Reviewed by Brent Fulgham. Based on telemetry, add syscalls to the GPU process' sandbox on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-12 Chris Dumez WebKit is unable to recover if a WebProcess gets terminated while it is launching https://bugs.webkit.org/show_bug.cgi?id=233001 Reviewed by Brent Fulgham. While investigating , I found that the WebAuthn Process would get jetsammed, which would cause us to call WebProcessPool::terminateAllWebContentProcesses(). I also noticed that if one of these WebProcesses was still launching at the time of the termination, then the WebProcessProxy / WebPageProxy would keep thinking the WebProcess is still launching and would never attempt to relaunch it. This would result in a blank and unresponsive WKWebView which wouldn't be able to do any loads. The issue was due to ProcessLauncher::terminateProcess() calling invalidate(), which it would not only terminate the XPC connection, it would also null out m_client. As a result, we wouldn't notify the client that the process failed to launch. To address the issue, I move the XPC connection termination logic out of invalidate() and into its own terminateXPCConnection() function. I then called terminateXPCConnection() instead of invalidate() inside ProcessLauncher::terminateProcess(). * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateAllWebContentProcesses]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::invalidate): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::terminateProcess): (WebKit::ProcessLauncher::platformInvalidate): (WebKit::ProcessLauncher::terminateXPCConnection): 2021-11-12 Chris Dumez Disable getUserMedia() when in Captive Portal Mode https://bugs.webkit.org/show_bug.cgi?id=233021 Reviewed by Brent Fulgham. Disable getUserMedia() when in Captive Portal Mode. No new tests, covered by updated API test. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2021-11-11 Sergio Villar Senin [css-flexbox] Add flex-basis: content support https://bugs.webkit.org/show_bug.cgi?id=221479 Reviewed by Javier Fernandez. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Handle content in switch. (IPC::ArgumentCoder::decode): Ditto. 2021-11-11 Per Arne Vollan [macOS][GPUP] Remove access to mach services in sandbox https://bugs.webkit.org/show_bug.cgi?id=232208 Reviewed by Darin Adler. Remove access to mach services in the GPU process on macOS based on telemetry and similar changes previously made in the WebContent process' sandbox. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-11 Brent Fulgham [WebAuthn] Stop serializing BufferSource and Vector duplicates of identifiers https://bugs.webkit.org/show_bug.cgi?id=233011 Reviewed by Chris Dumez. The original WebAuthn logic converted WebCore::BufferSource objects to Vector during serialization, which created a weird design where some code dealt with BufferSource objects, and other with Vectors, and lots of converting to and from these types. It also caused WebAuthn data structures to have two places where this information might live, with the UIProcess using one representation, and the WebContent process using another. This patch revises the code as follows: 1. The identifiers are always stored as BufferSource, and the same member is used in UIProcess and WebContent process when accessing this information. 2. We now serialize BufferSource directly. Tested by existing WebAuthn test cases (API and Layout tests) * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (publicKeyCredentialUserEntity): (publicKeyCredentialDescriptors): * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticatorInternal::produceHashSet): (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification): (WebKit::LocalAuthenticator::deleteDuplicateCredential const): * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::toASCDescriptor): (WebKit::configureRegistrationRequestContext): (WebKit::configurationAssertionRequestContext): * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::issueSignCommand): (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived): 2021-11-11 Michael Catanzaro Misc compiler warnings https://bugs.webkit.org/show_bug.cgi?id=232989 Reviewed by Darin Adler. * UIProcess/WebPageProxy.cpp: 2021-11-11 Per Arne [macOS] Add required methods to IOKit message filter https://bugs.webkit.org/show_bug.cgi?id=233012 Reviewed by Brent Fulgham. Add required methods to IOKit message filter on macOS. * WebProcess/com.apple.WebProcess.sb.in: 2021-11-11 Wenson Hsieh Move image overlay code out of HTMLElement and into a separate helper file https://bugs.webkit.org/show_bug.cgi?id=232974 Reviewed by Antti Koivisto. See WebCore/ChangeLog for more details. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::dictionaryPopupInfoForRange): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindIndicator): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): (WebKit::WebPage::findDataDetectionResultElementInImageOverlay): (WebKit::WebPage::requestTextRecognition): (WebKit::WebPage::updateWithTextRecognitionResult): * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::findTextIndicatorOptions): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::insideImageOverlay): (WebKit::rangeForPointInRootViewCoordinates): (WebKit::hostVideoElementIgnoringImageOverlay): (WebKit::elementPositionInformation): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performImmediateActionHitTestAtLocation): 2021-11-11 Ben Nham Log memory usage metadata when WebContent crosses critical or warning level memory thresholds https://bugs.webkit.org/show_bug.cgi?id=232976 Reviewed by Darin Adler. Added callbacks to log memory usage metadata the first time a process hits these milestones: - exceeded inactive memory limit while active (on Mac) - exceeded warning process limit threshold (on other non-Mac Apple platforms) - exceeded critical process limit threshold (on other non-Mac Apple platforms) The reason for this is we receive a large number of out of memory reports with very little info in the logs. We want to log more metadata about memory usage (similar to what we do on Mac in `WebCore::logMemoryStatisticsAtTimeOfDeath`) to help us debug those reports. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: 2021-11-11 Rachel Ginsberg Add support in WebCore for web app manifest icons https://bugs.webkit.org/show_bug.cgi?id=231339 rdar://84311306 Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/_WKApplicationManifest.h: * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (makeVectorElement): Used by makeVector in initWithCoder:. Takes a _WKApplicationManifestIcon and returns a WebCore::ApplicationManifest::Icon. (-[_WKApplicationManifest initWithCoder:]): Added icons. (-[_WKApplicationManifest encodeWithCoder:]): Added icons. (-[_WKApplicationManifest icons]): Should appease build error before full support for icons is built into _WKApplicationManifest (+[_WKApplicationManifestIcon supportsSecureCoding]): (-[_WKApplicationManifestIcon initWithCoder:]): (-[_WKApplicationManifestIcon encodeWithCoder:]): (-[_WKApplicationManifestIcon dealloc]): * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: 2021-11-11 Kimmo Kinnunen REGRESSION (iOS 15, GPU Process): Fails to load texture map https://bugs.webkit.org/show_bug.cgi?id=231471 Reviewed by Tim Horton. Use the normal "draw image buffer" call to draw the image buffer to the shareable bitmap. Before, it was manually re-implementing this API call via the lower level calls. The drawImageBuffer call now fixes up the IOSurface -backed source ImageBuffers to not keep referencing to the CGImage that provided the data to the draw. Otherwise GPU process jetsams as the CGImage inside IOSurface is counted against GPU process memory limit. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdentifier): 2021-11-11 Tomoki Imai [RemoteInspector][Socket] Can't find the target since r277787 https://bugs.webkit.org/show_bug.cgi?id=232986 Reviewed by Don Olmstead. Remote Inspector has the same issue as bug 226908. RemoteInspectorProtocolHandler needs the same fix as r278748. * UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp: Copy WebURLSchemeTask.request().url() to avoid obtaining the temporary object. 2021-11-11 Nikolaos Mouchtaris Make scroll granularity an enum class https://bugs.webkit.org/show_bug.cgi?id=232641 Reviewed by Cameron McCormack. * Scripts/webkit/messages.py: (headers_for_type): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]): * UIProcess/ios/WKKeyboardScrollingAnimator.mm: (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]): (-[WKKeyboardScrollingAnimator beginWithEvent:]): (-[WKKeyboardScrollViewAnimator distanceForIncrement:inDirection:]): * UIProcess/win/WebPopupMenuProxyWin.cpp: (WebKit::WebPopupMenuProxyWin::onMouseWheel): * UIProcess/win/WebView.cpp: (WebKit::WebView::onHorizontalScroll): (WebKit::WebView::onVerticalScroll): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::scrollBy): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::performDefaultBehaviorForKeyEvent): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performNonEditingBehaviorForSelector): * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::performDefaultBehaviorForKeyEvent): 2021-11-11 Carlos Garcia Campos Drop support for making interactive https://bugs.webkit.org/show_bug.cgi?id=222642 Reviewed by Antti Koivisto. Remove support for usemap attribute in GTK DOM API adding a warning message instead. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp: (webkit_dom_html_object_element_get_use_map): (webkit_dom_html_object_element_set_use_map): 2021-11-11 Sam Weinig Factor platform specific code out of HTMLModelElement https://bugs.webkit.org/show_bug.cgi?id=232848 Reviewed by Dean Jackson. Move implementation details of the macOS ARKit implementation into an ARKit model player implementation. * CMakeLists.txt: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: Add new files. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::modelElementDidCreatePreview): * UIProcess/ModelElementController.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Make modelElementDidCreatePreview() an async callback rather than using a ElementContext to reconnect on the way back. * WebProcess/Model: Added. * WebProcess/Model/WebModelPlayerProvider.cpp: Added. * WebProcess/Model/WebModelPlayerProvider.h: Added. Add ModelPlayerProvider implementation for WebKit. * WebProcess/Model/mac: Added. * WebProcess/Model/mac/ARKitInlinePreviewModelPlayer.h: Added. * WebProcess/Model/mac/ARKitInlinePreviewModelPlayer.mm: Added. Move code from HTMLModelElementCocoa here, and implement the ModelPlayer interface using it. Rather than using the ChromeClient, we can now directly use an async IPC message to set up the link. * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: (WebKit::NotificationPermissionRequestManager::startRequest): Fix build issue caused by adding new files. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setWebsiteDataStoreParameters): Update call to setModelElementCacheDirectory to be on the ARKitInlinePreviewModelPlayer. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::modelElementDidCreatePreview const): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: Remove no longer needed modelElementDidCreatePreview client function. 2021-11-11 Dean Jackson WKSystemPreviewView should be called WKUSDPreviewView https://bugs.webkit.org/show_bug.cgi?id=232961 Reviewed by Sam Weinig. WKSystemPreviewView is a uninformative name. WKUSDPreviewView is more accurate. * SourcesCocoa.txt: * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry initWithConfiguration:]): * UIProcess/SystemPreviewController.cpp: (WebKit::SystemPreviewController::canPreview const): * UIProcess/ios/WKUSDPreviewView.h: Renamed from Source/WebKit/UIProcess/ios/WKSystemPreviewView.h. * UIProcess/ios/WKUSDPreviewView.mm: Renamed from Source/WebKit/UIProcess/ios/WKSystemPreviewView.mm. (getUTIForSystemPreviewMIMEType): (-[WKUSDPreviewView web_initWithFrame:webView:mimeType:]): (-[WKUSDPreviewView web_setContentProviderData:suggestedFilename:]): (-[WKUSDPreviewView _layoutThumbnailView]): (-[WKUSDPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]): (-[WKUSDPreviewView web_contentView]): (+[WKUSDPreviewView web_requiresCustomSnapshotting]): (-[WKUSDPreviewView web_setMinimumSize:]): (-[WKUSDPreviewView web_setOverlaidAccessoryViewsInset:]): (-[WKUSDPreviewView web_computedContentInsetDidChange]): (-[WKUSDPreviewView web_setFixedOverlayView:]): (-[WKUSDPreviewView web_didSameDocumentNavigation:]): (-[WKUSDPreviewView web_isBackground]): (-[WKUSDPreviewView web_countStringMatches:options:maxCount:]): (-[WKUSDPreviewView web_findString:options:maxCount:]): (-[WKUSDPreviewView web_hideFindUI]): (-[WKUSDPreviewView provideDataForItem:]): * WebKit.xcodeproj/project.pbxproj: 2021-11-11 Chris Dumez Turn off various preferences when in captive portal mode https://bugs.webkit.org/show_bug.cgi?id=232958 Reviewed by Brent Fulgham. Disable the following settings when in captive portal mode: - WebGL - WebGL2 - Gamepads - RemotePlayback - FileSystemAccess - AllowsPictureInPictureMediaPlayback - PictureInPictureAPI - SpeechRecognition - Notifications - WebXR - WebXRAugmentedRealityModule - WebAudio - DownloadableBinaryFonts - PeerConnection (WebRTC) Covered by updated API tests. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::isCaptivePortalModeEnabled const): 2021-11-11 Per Arne Vollan [macOS][GPUP] Allow access to power logging service https://bugs.webkit.org/show_bug.cgi?id=232978 Reviewed by Brent Fulgham. Access to this logging service is still required in the GPU process on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-10 Chris Dumez We should not kill all WebContent processes whenever the WebAuthn process crashes https://bugs.webkit.org/show_bug.cgi?id=232970 Reviewed by Geoff Garen. We should not kill all WebContent processes whenever the WebAuthn process crashes. This is overly aggressive. We should instead do like for the network process and have the WebProcess re-initiate the connection to the WebAuthn process when it's gone. No new tests, updated existing API test. * UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp: (WebKit::WebAuthnProcessProxy::webAuthnProcessCrashed): Do not terminate all WebProcesses when the WebAuthn process crashes. * WebProcess/WebAuthentication/WebAuthnProcessConnection.cpp: (WebKit::WebAuthnProcessConnection::didClose): Make sure we call WebProcess::webAuthnProcessConnectionClosed() when the WebProcess loses its connection to the WebAuthn process. This makes sure we clear m_webAuthnProcessConnection and properly re-initiate a new WebAuthn process connection the next time WebProcess::ensureWebAuthnProcessConnection() is called. 2021-11-10 J Pascoe [WebAuthn] Unify _WKWebAuthenticationPanel SPI and AuthenticatorCoordinator's ClientDataJson generation https://bugs.webkit.org/show_bug.cgi?id=232965 Reviewed by Brent Fulgham. The _WKWebAuthenticationPanel SPI and AuthenticatorCoordinator use different methods of generating clientDataJson, which results in strings with the keys in a different order. This causes problems because when generating asserts via ASC ui, the hash signed and the client data json used to generate that hash are different from the client data json returned to js. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (produceClientDataJson): 2021-11-10 Per Arne Vollan Block sandbox access to consume mach extensions https://bugs.webkit.org/show_bug.cgi?id=232254 Reviewed by Brent Fulgham. Block sandbox access to consume mach extensions that are not issued by WebKit. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2021-11-10 Devin Rousso Unreviewed internal build fix after r285444 * Platform/spi/Cocoa/AppleMediaServicesUISPI.h: Make sure that `AppleMediaServicesSPI.h` is always included. * Platform/spi/Cocoa/AppleMediaServicesSPI.h: Add missing `;`. 2021-11-10 Devin Rousso Add support for marking an `` as being autofilled with obscured content https://bugs.webkit.org/show_bug.cgi?id=232903 Reviewed by Aditya Keerthi. * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndObscured const): Added. (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndObscured): Added. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndObscured]): Added. (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndObscured:]): Added. * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (WKBundleNodeHandleSetHTMLInputElementAutoFilledAndObscured): Added. Expose a way to get/set the CSS `-webkit-autofill-and-obscured` pseudo-class on an ``. 2021-11-10 Wenson Hsieh Refactor some image overlay logic to work with built-in media controls https://bugs.webkit.org/show_bug.cgi?id=232899 rdar://83173597 Reviewed by Antoine Quint and Tim Horton. See WebCore/ChangeLog for more details. * Shared/ios/InteractionInformationAtPosition.h: * UIProcess/ios/WKContentViewInteraction.mm: (canAttemptTextRecognitionForNonImageElements): Add a new WebKitAdditions integration point. (-[WKContentView imageAnalysisGestureDidBegin:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionPositionInformation): Adjust for the changes to the built-in media controls stylesheet by adding logic to prevent the magnifier from showing up when long pressing (or long pressing inside) video elements on iOS. 2021-11-10 Per Arne Vollan [macOS][GPUP] Remove access to sysctl properties https://bugs.webkit.org/show_bug.cgi?id=232329 Reviewed by Darin Adler. Based on telemetry, remove access to unused sysctl properties in the GPU process' sandbox on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-10 Chris Dumez Add basic support for launching CaptivePortalMode WebProcesses https://bugs.webkit.org/show_bug.cgi?id=232737 Reviewed by Brent Fulgham. Add new `WKWebpagePreferences.captivePortalModeEnabled` API to allow clients apps to opt in or out of captive portal mode for each navigation (WKWebpagePreferences is passed with the navigation policy decision). For setting the default state of this setting, the client can set `WebWebViewConfiguration.defaultWebpagePreferences.captivePortalModeEnabled` (will impact all views using this configuration). Note that both this property can only be set by apps with the browser entitlement on iOS (no restriction on macOS). On iOS, the default value of WKWebpagePreferences.captivePortalModeEnabled depends on the corresponding system setting. For now, this is simulated by a NSUserDefault but it will eventually come from somewhere else (TCC?). Whenever transitioning in or out of captive portal mode, we process-swap on navigation policy decision. Whenever captive portal mode is enabled, we turn off JIT, generational and concurrent GC in the WebProcess, as soon as it launches. Covered by new API tests. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::captivePortalModeEnabled const): * UIProcess/API/APIPageConfiguration.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::copy const): (API::WebsitePolicies::captivePortalModeEnabled const): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/Cocoa/WKWebpagePreferences.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (-[WKWebpagePreferences setCaptivePortalModeEnabled:]): (-[WKWebpagePreferences captivePortalModeEnabled]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::captivePortalModeEnabledBySystem): * UIProcess/Launcher/ProcessLauncher.h: (WebKit::ProcessLauncher::Client::shouldEnableCaptivePortalMode const): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::findReusableSuspendedPageProcess): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcess): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::triggerBrowsingContextGroupSwitchForNavigation): (WebKit::WebPageProxy::isJITEnabled): (WebKit::WebPageProxy::shouldEnableCaptivePortalMode const): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::takeProcess): * UIProcess/WebProcessCache.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::tryTakePrewarmedProcess): (WebKit::WebProcessPool::prewarmProcess): (WebKit::WebProcessPool::processForRegistrableDomain): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): (WebKit::captivePortalModeEnabledBySystem): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::create): (WebKit::WebProcessProxy::createForServiceWorkers): (WebKit::WebProcessProxy::WebProcessProxy): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::captivePortalMode const): 2021-11-10 Per Arne Vollan [iOS][GPUP] Remove sandbox read access to files https://bugs.webkit.org/show_bug.cgi?id=232389 Reviewed by Brent Fulgham. Based on telemetry, remove read access to files in the GPU process' sandbox on iOS. This patch also adds some new telemetry for rules related to reading of files. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-10 Darin Adler [CF] Reduce duplication and unneeded buffer allocations and copying in URL code, also remove unused methods and functions https://bugs.webkit.org/show_bug.cgi?id=232220 Reviewed by Alex Christensen. * Shared/API/c/cf/WKURLCF.mm: (WKURLCreateWithCFURL): Use bytesAsString, saving creation and destruction of a CString each time this is called. * Shared/Cocoa/ArgumentCodersCocoa.mm: (-[WKSecureCodingURLWrapper encodeWithCoder:]): Use bytesAsVector. * Shared/Cocoa/WKNSURLExtras.h: Removed unused methods +[NSURL _web_URLWithWTFString:relativeToURL:] and -[NSURL _web_originalDataAsWTFString]. * Shared/Cocoa/WKNSURLExtras.mm: (+[NSURL _web_URLWithWTFString:relativeToURL:]): Deleted. (-[NSURL _web_originalDataAsWTFString]): Deleted. * Shared/Cocoa/WKNSURLRequest.mm: (-[WKNSURLRequest URL]): Removed unneeded call to +[NSURL _web_URLWithWTFString:] because this code is converting a WTF::URL to an NSURL, which can use the conversion operator in the WTF::URL class. * Shared/cf/ArgumentCodersCF.cpp: (IPC::ArgumentCoder::encode): Use bytesAsVector. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]): Use bytesAsString and bridge_cast. (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]): Ditto. (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]): Ditto. (setUpPagePolicyClient): Removed unneeded call to +[NSURL _web_URLWithWTFString:] because this code is converting a WTF::URL to an NSURL, which can use the conversion operator in the WTF::URL class. * UIProcess/Cocoa/LegacyDownloadClient.mm: (WebKit::LegacyDownloadClient::willSendRequest): Removed unneeded call to +[NSURL _web_URLWithWTFString:] because this code is converting a WTF::URL to an NSURL, which can use the conversion operator in the WTF::URL class. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame URL]): Ditto. 2021-11-10 Alex Christensen [macOS] Unable to build WebKit with multiple users in the same machine, webpushd uses /tmp/WebKit.dst https://bugs.webkit.org/show_bug.cgi?id=232940 Reviewed by Alexey Proskuryakov. * WebKit.xcodeproj/project.pbxproj: 2021-11-10 Jer Noble [iOS] Adopt -[AVAudioSession setAuditTokensForProcessAssertion:] https://bugs.webkit.org/show_bug.cgi?id=232909 Reviewed by Eric Carlson. When a page is loaded through SafariViewService, the UIProcess is SVS, but the "presenting" application is the client of SafariViewController. To further compliate things, multiple apps all using a SafariViewController will use a singleton SafariViewService application. When such an application goes to the background while playing audio, the audio subsystem will keep the UIProcess from suspending, but not the presenting application. The audio subsystem will see that the presenting application has become suspended, and will interrupt audio playback. Opt into a AVAudioSession behavior where a client can provide an array of audit tokens for those processes which are "presenting" the audio playback to the user. This will include the UIProcess, but also the process which is hosting the SafariViewController. The audio subsystem will keep the processes in that list from becoming suspended during audio playback. Since there may be different clients of SafariViewService existing simultaneously, only include those presenting application tokens whose WebContent processes require an "active" audio session. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): * GPUProcess/GPUConnectionToWebProcess.h: (WebKit::GPUConnectionToWebProcess::presentingApplicationAuditToken const): * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::audioSessionManager const): * GPUProcess/media/RemoteAudioSessionProxy.cpp: (WebKit::RemoteAudioSessionProxy::tryToSetActive): * GPUProcess/media/RemoteAudioSessionProxy.h: (WebKit::RemoteAudioSessionProxy::gpuConnectionToWebProcess const): * GPUProcess/media/RemoteAudioSessionProxyManager.cpp: (WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager): (WebKit::RemoteAudioSessionProxyManager::updatePresentingProcesses): * GPUProcess/media/RemoteAudioSessionProxyManager.h: * Scripts/process-entitlements.sh: * Shared/GPUProcessConnectionParameters.h: (WebKit::GPUProcessConnectionParameters::encode const): (WebKit::GPUProcessConnectionParameters::decode): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setPresentingApplicationProcessToken:]): (-[_WKProcessPoolConfiguration presentingApplicationProcessToken]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getGPUProcessConnection): * WebProcess/GPU/GPUProcessConnection.h: 2021-11-10 Per Arne Vollan [iOS][GPUP] Remove access to sysctl properties https://bugs.webkit.org/show_bug.cgi?id=232821 Reviewed by Brent Fulgham. Based on telemetry, remove access to unused sysctl properties in the GPU process' sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-10 Per Arne Vollan [iOS][GPUP] Remove access to mach-register https://bugs.webkit.org/show_bug.cgi?id=232442 Reviewed by Darin Adler. Based on telemetry, remove access to mach-register in the GPU process' sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-10 Per Arne Vollan [iOS][GPUP] Block access to mapping of executables https://bugs.webkit.org/show_bug.cgi?id=232824 Reviewed by Brent Fulgham. Block access to mapping of certain executables in the GPU process on iOS. These changes are based on collected telemetry. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-10 Per Arne Vollan [macOS][GPUP] Remove access to IOKit classes https://bugs.webkit.org/show_bug.cgi?id=232308 Reviewed by Brent Fulgham. Based on telemetry, remove access to unused IOKit classes in the GPU process' sandbox on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-10 Youenn Fablet Update libwebrtc to M96 https://bugs.webkit.org/show_bug.cgi?id=232873 Reviewed by Alex Christensen. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::NetworkRTCProvider): 2021-11-10 Youenn Fablet [iOS] Add audio gain in case category switches to PlayAndRecord https://bugs.webkit.org/show_bug.cgi?id=232941 Reviewed by Eric Carlson. In case of PlayAndRecord, apply a static gain of 5 to audio rendered from MediaStreamTracks. For that purpose, observe changes to the AudioSession category and react upon it. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.cpp: (WebKit::RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit::Unit): (WebKit::RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit::start): (WebKit::RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit::render): (WebKit::RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit::categoryDidChange): 2021-11-10 Tim Nguyen Migrate DialogElementEnabled from RuntimeFlags to Settings https://bugs.webkit.org/show_bug.cgi?id=232926 Reviewed by Youenn Fablet. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDialogElementEnabled): Deleted. (WKPreferencesGetDialogElementEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: 2021-11-10 Sihui Liu Perform FileSystemSyncAccessHandle operations in web process https://bugs.webkit.org/show_bug.cgi?id=232146 Reviewed by Youenn Fablet. Network process no longer needs to hold open file handle for FileSystemSyncAccessHandle. Now it creates an open file handle, pass it to web process and close it. * NetworkProcess/storage/FileSystemStorageError.h: (WebKit::convertToException): * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::FileSystemStorageHandle::createSyncAccessHandle): (WebKit::FileSystemStorageHandle::close): (WebKit::FileSystemStorageHandle::move): (WebKit::FileSystemStorageHandle::~FileSystemStorageHandle): Deleted. (WebKit::FileSystemStorageHandle::getSize): Deleted. (WebKit::FileSystemStorageHandle::truncate): Deleted. (WebKit::FileSystemStorageHandle::flush): Deleted. * NetworkProcess/storage/FileSystemStorageHandle.h: (): Deleted. * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::createSyncAccessHandle): (WebKit::NetworkStorageManager::getSizeForAccessHandle): Deleted. (WebKit::NetworkStorageManager::truncateForAccessHandle): Deleted. (WebKit::NetworkStorageManager::flushForAccessHandle): Deleted. * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.messages.in: * Platform/IPC/SharedFileHandle.cpp: (IPC::SharedFileHandle::close): * Platform/IPC/SharedFileHandle.h: * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp: (WebKit::WebFileSystemStorageConnection::getSize): Deleted. (WebKit::WebFileSystemStorageConnection::truncate): Deleted. (WebKit::WebFileSystemStorageConnection::flush): Deleted. * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h: 2021-11-09 Chris Dumez [macOS] Enable NSURLSession partitioning based on first-party domain at CFNetwork level https://bugs.webkit.org/show_bug.cgi?id=230750 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (overrideAttributionContext): Deleted. Stop disabling CFNetwork NSURLSession partitioning based on first-party domain on macOS. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::sessionWrapperForTask): (WebKit::NetworkSessionCocoa::hasIsolatedSession const): (WebKit::NetworkSessionCocoa::clearIsolatedSessions): (WebKit::NetworkSessionCocoa::invalidateAndCancelSessionSet): Disable ITP session partitioning of certain prevalent domains on platforms where CFNetwork already does full partitioning of all domains (now that it is enabled on macOS 12+ and iOS15+). 2021-11-09 Per Arne Vollan [iOS][GPUP] Remove shared memory access https://bugs.webkit.org/show_bug.cgi?id=232823 Reviewed by Brent Fulgham. Based on telemetry, remove shared memory access in the GPU process' sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-09 Per Arne [iOS][GPUP] Remove read access to preferences https://bugs.webkit.org/show_bug.cgi?id=232439 Reviewed by Darin Adler. Based on telemetry, remove access to reading some preference domains in the GPU process' sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-09 Per Arne Vollan [macOS] Add telemetry for system calls in WP https://bugs.webkit.org/show_bug.cgi?id=231836 Reviewed by Brent Fulgham. Add telemetry for system calls in WP to understand in which context they are being used. * WebProcess/com.apple.WebProcess.sb.in: 2021-11-09 Per Arne Vollan [macOS][GPUP] Remove shared memory access https://bugs.webkit.org/show_bug.cgi?id=232281 Reviewed by Darin Adler. Based on telemetry, remove shared memory access in the GPU process' sandbox on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-09 Per Arne [macOS][GPUP] Block access to mapping of executables https://bugs.webkit.org/show_bug.cgi?id=232257 Reviewed by Brent Fulgham. Block access to mapping of certain executables in the GPU process on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-09 Chris Dumez REGRESSION (Safari 15): AudioContext.currentTime speeds up (and audio won't play) when Bluetooth speaker connected https://bugs.webkit.org/show_bug.cgi?id=232728 Reviewed by Jer Noble. This was a regression from us moving WebAudio to the GPUProcess in Safari 15. The issue occurred because the WebProcess (writer) would get further and further ahead of the GPUProcess (reader) after a hardware sample rate change. When rendering on https://mdn.github.io/webaudio-examples/audiocontext-states/ with a hardware sample rate of 96Khz, RemoteAudioDestination::render() would get called with a numberOfFrame=128. Each time RemoteAudioDestination::render() was called, it would signal the IPC semaphore, causing the WebProcess to produce one WebAudio rendering quantum (128 frames). This would match perfectly and there would be no issues. However, if during playback, the hardware sample rate changes (which can happen when connecting to bluetooth speakers), CoreAudio would start calling RemoteAudioDestination::render() with a different numberOfFrame. For example, when switching the hardware sample rate to 44.1Khz, numberOfFrames would be 278. Every time it is called, render() would signal the semaphore 3 times, causing the WebProcess to produce 3 WebAudio rendering quantums (3 * 128 = 384 frames). So each time render() is called, the WebProcess would generate `384 - 278 = 105` frames too many, causing it to get further and further ahead of the GPUProcess. One symptom would be that AudioContext.currentTime would progress too fast. Also, eventually, our RingBuffer between the 2 process would fill up and lead to rendering issues. To address the issue, I updated RemoteAudioDestination::render() to keep track of how many extra samples it requested from the WebProcess previously. This avoids signalling the IPC semaphore too many times and the WebProcess can no longer get too far ahead of the GPUProcess. The logic matches what was already done in RemoteAudioMediaStreamTrackRendererInternalUnitManager::Unit::render(). * GPUProcess/media/RemoteAudioDestinationManager.cpp: 2021-11-09 Commit Queue Unreviewed, reverting r285536. https://bugs.webkit.org/show_bug.cgi?id=232915 causes API test crashes Reverted changeset: "[CF] Reduce duplication and unneeded buffer allocations and copying in URL code, also remove unused methods and functions" https://bugs.webkit.org/show_bug.cgi?id=232220 https://commits.webkit.org/r285536 2021-11-09 Per Arne [iOS][GPUP] Add syscalls to sandbox https://bugs.webkit.org/show_bug.cgi?id=232211 Reviewed by Darin Adler. Based on telemetry, add syscalls to the GPU process' sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-09 Per Arne [iOS][GPUP] Remove sandbox access to mach services https://bugs.webkit.org/show_bug.cgi?id=232209 Reviewed by Darin Adler. Remove access to mach services in the GPU process' sandbox that are unused according to telemetry. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2021-11-09 Devin Rousso Unreviewed internal build fix after r285444 * Platform/spi/Cocoa/AppleMediaServicesSPI.h: 2021-11-09 J Pascoe [WebAuthn] User handle is not saved on create via ASC https://bugs.webkit.org/show_bug.cgi?id=232900 rdar://85216105 Reviewed by Brent Fulgham. This value is required to be stored along the credential on create calls such that it can be returned via get calls. Currently, it is always read as empty because user.id is empty after ipc, while the id is decoded to idVector. * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::configureRegistrationRequestContext): 2021-10-28 Darin Adler [CF] Reduce duplication and unneeded buffer allocations and copying in URL code, also remove unused methods and functions https://bugs.webkit.org/show_bug.cgi?id=232220 Reviewed by Alex Christensen. * Shared/API/c/cf/WKURLCF.mm: (WKURLCreateWithCFURL): Use bytesAsString, saving creation and destruction of a CString each time this is called. * Shared/Cocoa/ArgumentCodersCocoa.mm: (-[WKSecureCodingURLWrapper encodeWithCoder:]): Use bytesAsVector. * Shared/Cocoa/WKNSURLExtras.h: Removed unused methods +[NSURL _web_URLWithWTFString:relativeToURL:] and -[NSURL _web_originalDataAsWTFString]. * Shared/Cocoa/WKNSURLExtras.mm: (+[NSURL _web_URLWithWTFString:relativeToURL:]): Deleted. (-[NSURL _web_originalDataAsWTFString]): Deleted. * Shared/Cocoa/WKNSURLRequest.mm: (-[WKNSURLRequest URL]): Removed unneeded call to +[NSURL _web_URLWithWTFString:] because this code is converting a WTF::URL to an NSURL, which can use the conversion operator in the WTF::URL class. * Shared/cf/ArgumentCodersCF.cpp: (IPC::ArgumentCoder::encode): Use bytesAsVector. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]): Use bytesAsString and bridge_cast. (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]): Ditto. (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]): Ditto. (setUpPagePolicyClient): Removed unneeded call to +[NSURL _web_URLWithWTFString:] because this code is converting a WTF::URL to an NSURL, which can use the conversion operator in the WTF::URL class. * UIProcess/Cocoa/LegacyDownloadClient.mm: (WebKit::LegacyDownloadClient::willSendRequest): Removed unneeded call to +[NSURL _web_URLWithWTFString:] because this code is converting a WTF::URL to an NSURL, which can use the conversion operator in the WTF::URL class. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame URL]): Ditto. 2021-11-09 Chris Dumez BroadcastChannel is still disabled in service workers https://bugs.webkit.org/show_bug.cgi?id=232855 Reviewed by Darin Adler. No new tests, rebaselined existing test. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): Make sure BroadcastChannel is functional is Service Workers by setting up proper BroadcastChannelRegistry on the PageConfiguration we use to construct the service worker's dummy page. 2021-11-09 Antoine Quint REGRESSION(r272201): Safari showed red distortion on webview after using Web Inspector, returning from another app https://bugs.webkit.org/show_bug.cgi?id=231358 Reviewed by Devin Rousso. * WebProcess/Inspector/WebInspectorClient.h: 2021-11-09 Tim Horton Add runtime flag for momentum scrolling https://bugs.webkit.org/show_bug.cgi?id=232898 Reviewed by Simon Fraser. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): 2021-11-09 Devin Rousso REGRESSION(r271735): PaymentShippingOption.selected ignored https://bugs.webkit.org/show_bug.cgi?id=221960 Reviewed by Tim Horton. Leverage new `PKShippingMethods` SPI to provide both the general list of `PKShippingMethod` and the default selected `PKShippingMethods` when creating/updating a payment request. * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKShippingMethods): Added. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Add new helper to generate the `PKShippingMethods` from WebCore objects. * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection): (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): (WebKit::toPKShippingMethods): Deleted. * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]): (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): (-[WKPaymentAuthorizationDelegate completeCouponCodeChange:]): (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]): (toShippingMethod): (-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]): (-[WKPaymentAuthorizationDelegate summaryItems]): Deleted. (-[WKPaymentAuthorizationDelegate shippingMethods]): Deleted. Drive-by: Delete unused methods. 2021-11-09 Sihui Liu Keep track of captured data time in SpeechRecognizer https://bugs.webkit.org/show_bug.cgi?id=232867 Reviewed by Youenn Fablet. Removed a redundant call. * WebProcess/cocoa/RemoteCaptureSampleManager.cpp: (WebKit::RemoteCaptureSampleManager::RemoteAudio::setStorage): 2021-11-09 Devin Rousso Unreviewed internal build fix after r285424 ``` WKScrollView.mm:227:35: error: incompatible pointer to integer conversion assigning to 'BOOL' (aka 'signed char') from 'UIColor * _Nullable' ``` * UIProcess/ios/WKScrollView.mm: (-[WKScrollView setBackgroundColor:]): 2021-11-09 Sihui Liu Fix wrong frame count of CARingBuffer in SpeechRecognitionRemoteRealtimeMediaSource https://bugs.webkit.org/show_bug.cgi?id=232863 Reviewed by Youenn Fablet. SpeechRecognitionRealtimeMediaSourceManager::Source uses shared ring buffer to pass audio data to SpeechRecognitionRemoteRealtimeMediaSource. We used to ask CARingBuffer in SpeechRecognitionRealtimeMediaSourceManager::Source to allocate with m_numberOfFrames and send m_numberOfFrames to SpeechRecognitionRemoteRealtimeMediaSource (so SpeechRecognitionRemoteRealtimeMediaSource can create a corresponding CARingBuffer). This is wrong because CARingBuffer::allocate() rounds up frameCount to power of two, which means m_numberOfFrames may be not the number used. We should get the actual frameCount in the setStorage callback of SharedRingBufferStorage, and pass that value to SpeechRecognitionRemoteRealtimeMediaSource. Manually tested. * UIProcess/SpeechRecognitionRemoteRealtimeMediaSource.cpp: (WebKit::SpeechRecognitionRemoteRealtimeMediaSource::setStorage): * WebProcess/Speech/SpeechRecognitionRealtimeMediaSourceManager.cpp: (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::Source): (WebKit::SpeechRecognitionRealtimeMediaSourceManager::Source::storageChanged): 2021-11-09 Brent Fulgham Reduce telemetry for well-understood sandbox rules https://bugs.webkit.org/show_bug.cgi?id=232885 Reviewed by Per Arne Vollan. Now that we have telemetry showing the use case for this syscall, remove the telemetry. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-11-09 Chris Dumez New spec: Block external protocol handler in sandboxed frames https://bugs.webkit.org/show_bug.cgi?id=231727 Reviewed by Brent Fulgham. Per the HTML specification [1][2], we should prevent sandboxed iframes from opening external applications by navigating to a URL with a custom procotol (e.g. rdar://). Indeed, it would be surprising if malvertisers would be able to redirect you to an external app. To support valid use cases, we still allow such navigations in sandboxed iframes if any of the following is true: - sandboxFlags contains "allow-top-navigation-by-user-activation" and hasTransientActivation is true - sandboxFlags contains "allow-top-navigation" - sandboxFlags contains "allow-popups" [1] https://github.com/whatwg/html/issues/2191 [2] https://html.spec.whatwg.org/#hand-off-to-external-software * UIProcess/WebPageProxy.cpp: (WebKit::frameSandboxAllowsOpeningExternalCustomProtocols): (WebKit::WebPageProxy::decidePolicyForNavigationAction): 2021-11-09 Wenson Hsieh [iOS] Add a position information bit to indicate whether the hit-tested element is a paused video https://bugs.webkit.org/show_bug.cgi?id=232861 Reviewed by Megan Gardner. Add `InteractionInformationAtPosition::isPausedVideo`, a flag that is true when the position information request is over a paused video element (or inside the media control shadow root underneath that paused video element, in the case where native controls are shown). * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Also rename `imageElementContext` to `hostImageOrVideoElementContext` to clarify that it (1) may now include element contexts for video elements, and (2) unlike the regular `elementContext`, this includes the image or video element that is the host for hit-tested content in the UA shadow root of the element corresponding to `elementContext`. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView imageAnalysisGestureDidBegin:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::videoPositionInformation): Additionally populate the `image` of the position information, in the case where `includeImageData` is set on the incoming request. (WebKit::hostVideoElementIgnoringImageOverlay): (WebKit::imagePositionInformation): (WebKit::elementPositionInformation): (WebKit::WebPage::positionInformation): 2021-11-08 Commit Queue Unreviewed, reverting r285432. https://bugs.webkit.org/show_bug.cgi?id=232864 Introduced audio capture regression Reverted changeset: "[macOS][GPUP] Remove access in sandbox to com.apple.audio.AudioComponentRegistrar" https://bugs.webkit.org/show_bug.cgi?id=231694 https://commits.webkit.org/r285432 2021-11-08 Wenson Hsieh Make it possible to toggle several experimental media features when GPU Process is enabled https://bugs.webkit.org/show_bug.cgi?id=232818 Reviewed by Tim Horton. Refactor a bit of logic around `GPUProcessProxy::updatePreferences`, such that the experimental features that are set underneath this method can be toggled by checking or unchecking the preference in the experimental features menu in Safari, and then restarting Safari (or simply killing and relaunching the GPU process). As detailed in the existing FIXME, we currently consult the global WebPageGroups' WebPreferences, which do not account for changes to the experimental feature defaults since they initialize their own WebPreferences that are (1) prefixed with a unique identifier, and (2) have `keyPrefix` and `globalDebugKeyPrefix` that are different from normal WebPreferences on WebPageProxy. Instead, we can add some plumbing to provide a WebProcessProxy to `updatePreferences()`, and use this to determine whether we need to enable any experimental features by iterating over each WebPageProxy's preferences and enabling each feature if it's enabled by at least one web page (roughly matching the current behavior). While it's still not ideal, these features are all process-global and there is only one GPU process, so in lieu of more extensive refactoring around these media feature flags, it makes sense to just turn them on if it's enabled in any individual instance of WebPreferences. * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::getOrCreate): Hoist the call to `updatePreferences()` out of this method and into `WebProcessPool::ensureGPUProcess` instead, so that we can pass in WebProcessProxy. (WebKit::GPUProcessProxy::updatePreferences): See above for more details. (WebKit::GPUProcessProxy::updateScreenPropertiesIfNeeded): Split out logic to update screen properties into a separate method, so that we don't end up unnecessarily computing and sending redundant screen properties `WebProcessPool::ensureGPUProcess()`. * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureGPUProcess): (WebKit::WebProcessPool::createWebPage): 2021-11-08 J Pascoe [WebAuthn] challenge does not get passed to -[_WKWebAuthenticationPanel getAssertionWithChallenge:origin:options:completionHandler:] https://bugs.webkit.org/show_bug.cgi?id=232836 rdar://85163927 Reviewed by Brent Fulgham. -[_WKWebAuthenticationPanel getAssertionWithChallenge:origin:options:completionHandler:] receives an empty challenge, causing _WKWebAuthenticationPanel to immediately close when using the new UNIFIED_ASC_AUTH_UI. This change encodes/decodes challenge in PublicKeyCredentialRequestOptions. Before this field was not used after xpc, but with the new UNIFIED_ASC_AUTH_UI it is. * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::configureRegistrationRequestContext): (WebKit::configurationAssertionRequestContext): Use challengeVector instead of challenge as it's available after being passed via xpc. 2021-11-08 Devin Rousso [Payment Request] Add a new payment method for showing AMS UI https://bugs.webkit.org/show_bug.cgi?id=232634 Reviewed by Tim Horton. Leverage the W3C Payment Request API as a way for Apple domains to show alternate native payment UIs without having to add new proprietary APIs (e.g. Apple Pay JS). This new payment method is quite bare-bones in that it just takes some JSON and passes it to AMS, which then decides what UI to show based on that. No data is exposed back to the page other than either an error or a yes/no as to whether the payment was successful. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::startApplePayAMSUISession): Added. (WebKit::WebChromeClient::abortApplePayAMSUISession): Added. Add plumbing between WebCore/WebProcess and UIProcess. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::startApplePayAMSUISession): Added. (WebKit::WebPageProxy::abortApplePayAMSUISession): Added. Use AMS to present UI for the given engagement request data and originating URL. * UIProcess/API/APIUIClient.h: (API::UIClient::presentingViewController): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::presentingViewController): Add support for `-[WKUIDelegatePrivate _presentingViewControllerForWebView:]` on macOS too. * Platform/spi/Cocoa/AppleMediaServicesSPI.h: Added. * Platform/spi/Cocoa/AppleMediaServicesUISPI.h: Added. * WebKit.xcodeproj/project.pbxproj: 2021-11-08 Alex Christensen Parse redirect and modify-headers actions for WKContentRuleList https://bugs.webkit.org/show_bug.cgi?id=232838 Reviewed by Tim Hatcher. * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::compileContentRuleList): 2021-11-08 Adrian Perez de Castro [GLIB][SOUP] Unify memoryPressureMonitorDisabled implementation https://bugs.webkit.org/show_bug.cgi?id=232706 Reviewed by Michael Catanzaro. No new tests needed. * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): Add missing OS(LINUX) guard around MemoryPressureMonitor. 2021-11-08 Per Arne [macOS][GPUP] Remove sandbox read access to files https://bugs.webkit.org/show_bug.cgi?id=232245 Reviewed by Brent Fulgham. Based on telemetry, remove sandbox read access to files in the GPU process on macOS. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: 2021-11-08 Brent Fulgham Add additional mach message filter https://bugs.webkit.org/show_bug.cgi?id=232819 Reviewed by Per Arne Vollan. Add support for an additional mach message trap endpoint when available. I also adjusted some whitespace to make the rules easier for me to follow. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2021-11-08 Per Arne Vollan [macOS][GPUP] Remove access in sandbox to com.apple.audio.AudioComponentRegistrar https://bugs.webkit.org/show_bug.cgi?id=231694 Reviewed by Brent Fulgham. After https://trac.webkit.org/changeset/274435/webkit, there is no need to allow access to this service. This patch also implements sending the Audio component registrations to the GPU process, which is a requirement before blocking the service in the GPU process. * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * GPUProcess/cocoa/GPUProcessCocoa.mm: (WebKit::GPUProcess::consumeAudioComponentRegistrations): * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Shared/Cocoa/AudioComponentRegistration.cpp: Added. (WebKit::consumeAudioComponentRegistrations): * Shared/Cocoa/AudioComponentRegistration.h: Added. (WebKit::sendAudioComponentRegistrations): * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::sendAudioComponentRegistrations): Deleted. * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::didFinishLaunching): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::revokeAudioCaptureExtension): * WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::consumeAudioComponentRegistrations): 2021-11-08 Wenson Hsieh WKSyntheticTapGestureRecognizer's action targets should be weak pointers https://bugs.webkit.org/show_bug.cgi?id=232812 Reviewed by Tim Horton. Make WKSyntheticTapGestureRecognizer robust against the case where it outlives its WKContentView, by making its "reset", "gesture identified", and "gesture failed" targets weak pointers instead of raw pointers. * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm: (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]): Drive-by fix: we can also make `_lastTouchedScrollView` use the __weak ivar attribute instead of WeakObjCPtr, now that __weak is enabled in WebKit2. 2021-11-08 Devin Rousso webView.scrollView.indicatorStyle does not work on iOS 15 https://bugs.webkit.org/show_bug.cgi?id=232295 Reviewed by Wenson Hsieh. Keep track of whether the `backgroundColor` and/or `indicatorStyle` of the `WKScrollView` has been set by the `WKWebView` owner/client. If so, don't allow the `WKWebView` to override it when it updates. Clients can opt-out of this "override prevention" by setting to `nil` and `UIScrollViewIndicatorStyleDefault` respectively. Tests: WKScrollViewTests.IndicatorStyleSetByClient WKScrollViewTests.BackgroundColorSetByClient * UIProcess/ios/WKScrollView.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollView setBackgroundColor:]): Added. (-[WKScrollView _setBackgroundColorInternal:]): Added. (-[WKScrollView setIndicatorStyle:]): Added. (-[WKScrollView _setIndicatorStyleInternal:]): Added. * UIProcess/API/ios/WKWebViewIOS.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _resetCachedScrollViewBackgroundColor]): Added. (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _updateScrollViewIndicatorStyle]): Added. (-[WKWebView _processDidExit]): 2021-11-08 Per Arne Vollan Unify sandbox rules for diagnostic services https://bugs.webkit.org/show_bug.cgi?id=232207 Reviewed by Darin Adler. In the WebContent process, we only allow access to diagnostic services for internal builds. We should do the same in all WebKit sandboxes. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::isInternalInstall): Deleted. (WebKit::diagnosticServices): Deleted. * WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/com.apple.WebProcess.sb.in: 2021-11-08 Wenson Hsieh Enabling "media source inline painting" by default should work when using GPU Process for media https://bugs.webkit.org/show_bug.cgi?id=232802 Reviewed by Eric Carlson. Propagate the bit for `MediaSourceInlinePaintingEnabled` over to the GPU process when updating preferences in GPUProcessProxy. * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::setMediaSourceInlinePaintingEnabled): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::updatePreferences): Also, add a couple of FIXMEs here. Note that due to the latter FIXME, this change *still* doesn't allow us to turn on media source inline painting when using GPU process for media by simply toggling the feature in user defaults or through UI. This is because preferences on WebPageGroups are not modified when changing experimental feature user defaults, so logic that iterates through all page groups and looks at preferences will still only get the default value of each feature flag (as defined in the yaml file). 2021-11-08 Kate Cheney trustd network connections occasionally omitted from App Privacy report https://bugs.webkit.org/show_bug.cgi?id=232770 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (NetworkSessionCocoa::setClientAuditToken): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): 2021-11-08 Andres Gonzalez WTR::AccessibilityController::focusedElement() cannot get the focused object via WKAccessibilityFocusedObject in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=232756 Reviewed by Chris Fleizach. WTR::AccessibilityController::focusedElement() was getting the focused object from WKAccessibilityFocusedObject, which has to run on the main thread. WKAccessibilityFocusedObject was in turn calling AXObjectCache:: focusedUIElementForPage that tried to return the isolated focused object. The problem with this is that the isolated focused object can only be retrieved on the secondary thread. The solution in this patch is to retrieve the focused object from the root object as an AT client would do. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKAccessibilityFocusedObject): Now uses AXObjectCache::focusedObejctForPage(). 2021-11-08 Philippe Normand [GStreamer] fast/mediastream/media-stream-video-track-interrupted.html is failing since added in 242093@main https://bugs.webkit.org/show_bug.cgi?id=231057 Reviewed by Xabier Rodriguez-Calvar. Wire up mock camera interruption IPC support in WPE/GTK. * UIProcess/API/C/WKPage.cpp: (WKPageSetMockCameraIsInterrupted): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMockCameraIsInterrupted): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setMockCameraIsInterrupted): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2021-11-06 Simon Fraser WheelEventDeltaFilter::shouldApplyFilteringForEvent can be a static function https://bugs.webkit.org/show_bug.cgi?id=232786 Reviewed by Wenson Hsieh. This function just looks at event phase. It can be static. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): 2021-11-05 Simon Fraser Simplify code that makes use of WheelEventDeltaFilter https://bugs.webkit.org/show_bug.cgi?id=232536 Reviewed by Wenson Hsieh. Push the decision about which kinds of wheel events to apply filtering to down into WheelEventDeltaFilter, which simplifies call sites. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): 2021-11-05 Chris Dumez [iOS] IPC decoder for ResourceRequest loses systemPreviewInfo when there is platform data https://bugs.webkit.org/show_bug.cgi?id=232769 Reviewed by Wenson Hsieh. The IPC decoder for ResourceRequest decodes systemPreviewInfo and sets it on the ResourceRequest. It then uses different code paths to decode the rest of the ResourceRequest based on whether or not there is underlying platform data. If there is underlying platform data, we call decodePlatformData() which creates a brand-new ResourceRequest, and thus loses the systemPreviewInfo we've just set. To address the issue, we now decode extra data members *after* decoding platform data instead of *before*. This was causing the ProcessSwap.SameOriginSystemPreview API test to fail on iOS with the patch for Bug 231727. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2021-11-05 Nikolaos Mouchtaris Make scroll bar mode an enum class https://bugs.webkit.org/show_bug.cgi?id=232651 Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setAlwaysShowsHorizontalScroller): (WebKit::WebPage::setAlwaysShowsVerticalScroller): 2021-11-05 Nikolaos Mouchtaris Make scroll elasticity an enum class https://bugs.webkit.org/show_bug.cgi?id=232646 Reviewed by Simon Fraser. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setEnableVerticalRubberBanding): (WebKit::WebPage::setEnableHorizontalRubberBanding): 2021-11-05 Devin Rousso [css-values-4] viewport units should be floats https://bugs.webkit.org/show_bug.cgi?id=231644 Reviewed by Tim Horton. Views can be fractional pixels wide. We should not round, especially since viewport units are used as percentage values (e.g. `50dvh` is "50% of the height of the current viewport"). * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setViewportSizeForCSSViewportUnits:]): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits): * Shared/WebPageCreationParameters.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setViewportSizeForCSSViewportUnits): (WebKit::WebPage::viewportSizeForCSSViewportUnits const): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateViewportSizeForCSSViewportUnits): 2021-11-04 Jean-Yves Avenard Have RemoteMediaResource use SharedMemory https://bugs.webkit.org/show_bug.cgi?id=232744 rdar://85045948 Reviewed by Alex Christensen. When playing a non-mse media element, the loading gets initiated in the GPU Process and proxied to the WebContent process via a RemoteMediaResource. By using a SharedBuffer in the RemoteMediaResource wrapping a SharedMemory we can allocate the buffer in the content process and pass it to the GPU process without copy nor new allocations. Playing a 694MB mp4, the GPU memory usage goes from 868MB to 14MB on an iPhone running iOS 15. This is a follow-up on bug 232422, what landed was missing this part. * GPUProcess/media/RemoteMediaResource.cpp: (WebKit::RemoteMediaResource::dataReceived): * GPUProcess/media/RemoteMediaResource.h: * GPUProcess/media/RemoteMediaResourceManager.cpp: (WebKit::RemoteMediaResourceManager::dataReceived): Wrap SharedMemory into a SharedBuffer. * GPUProcess/media/RemoteMediaResourceManager.h: * GPUProcess/media/RemoteMediaResourceManager.messages.in: Change data type from an IPCDataReference to a ShareMemory's handle. * WebProcess/GPU/media/RemoteMediaResourceProxy.cpp: (WebKit::RemoteMediaResourceProxy::dataReceived): Allocate a SharedMemory and copy the download data into it, before sending it to the GPU process. 2021-11-04 Dean Jackson REGRESSION: AR Quicklook asset is shared instead of page URL https://bugs.webkit.org/show_bug.cgi?id=232674 rdar://84220997 Reviewed by Antoine Quint. There was a typo. ENABLE(ARKIT_QUICK_LOOK_PREVIEW_ITEM) should be HAVE(ARKIT_QUICK_LOOK_PREVIEW_ITEM). * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: 2021-11-04 Nikolaos Mouchtaris Make scrollbar orientation an enum class https://bugs.webkit.org/show_bug.cgi?id=232648 Reviewed by Simon Fraser. * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::updateScrollbars): (WebKit::PDFPlugin::createScrollbar): (WebKit::PDFPlugin::destroyScrollbar): (WebKit::PDFPlugin::destroy): 2021-11-04 Aditya Keerthi Crash when opening and closing color picker while resetting form https://bugs.webkit.org/show_bug.cgi?id=232689 rdar://84979791 Reviewed by Simon Fraser. Resetting a
element containing an resets the value of the color input. If the WebProcess believes that a color picker is visible in the UIProcess, an IPC message (WebPageProxy_SetColorPickerColor) is sent to the UIProcess to update the selected color. If the color picker is closed by user action (on macOS, clicking outside the popover), the UIProcess nulls out `m_colorPicker`, and notifies the WebProcess that the color picker is no longer visible by sending the WebPage_DidEndColorPicker message. Consequently, it is possible for WebPageProxy_SetColorPickerColor to be dispatched in the UIProcess after `m_colorPicker` is nulled out, while the WebProcess is still waiting to process WebPage_DidEndColorPicker. This sequence of events results in a MESSAGE_CHECK failure in WebPageProxy::setColorPickerColor, leading to WebProcess termination. To fix, remove the MESSAGE_CHECK and replace it with a null check, since a null `m_colorPicker` is a valid state. Test: fast/forms/color/color-input-reset-crash.html * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setColorPickerColor): 2021-11-04 John Pascoe [WebAuthn] Implement add/remove_virtual_authenticator for transport=internal https://bugs.webkit.org/show_bug.cgi?id=232635 Reviewed by Brent Fulgham. This change implements much of the plumbing needed to call the virtual authenticator commands from safaridriver. The idea is that virtual authenticators are added via the add_virtual_authenticator call, which replaces the default AuthenticatorManager with a VirtualAuthenticatorManager similar to how we do it for mocks. Then the VirtualService will create the virtual connections for authenticators as nessesary to make webauthn calls within WebDriver based tests. Tested manually via safaridriver. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::toAuthenticatorTransport): (WebKit::WebAutomationSession::removeVirtualAuthenticator): (WebKit::WebAutomationSession::addVirtualAuthenticatorCredential): (WebKit::WebAutomationSession::removeVirtualAuthenticatorCredential): (WebKit::WebAutomationSession::removeAllVirtualAuthenticatorCredentials): (WebKit::WebAutomationSession::setVirtualAuthenticatorUserVerified): * UIProcess/Automation/WebAutomationSession.h: Plumbing to call from safaridriver * UIProcess/WebAuthentication/AuthenticatorManager.h: (WebKit::AuthenticatorManager::isVirtual const): * UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorConfiguration.h: Added. * UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorManager.cpp: Added. (WebKit::VirtualAuthenticatorManager::VirtualAuthenticatorManager): (WebKit::VirtualAuthenticatorManager::createAuthenticator): (WebKit::VirtualAuthenticatorManager::removeAuthenticator): (WebKit::VirtualAuthenticatorManager::createService const): Manages virtual authenticators, replaces the default manager when used similar to MockAuthenticatorManager. * UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorManager.h: Added. * UIProcess/WebAuthentication/Virtual/VirtualLocalConnection.h: Added. * UIProcess/WebAuthentication/Virtual/VirtualLocalConnection.mm: Added. (WebKit::VirtualLocalConnection::VirtualLocalConnection): (WebKit::VirtualLocalConnection::verifyUser): (WebKit::VirtualLocalConnection::getAttestation const): (WebKit::VirtualLocalConnection::filterResponses const): * UIProcess/WebAuthentication/Virtual/VirtualService.h: Added. * UIProcess/WebAuthentication/Virtual/VirtualService.mm: Added. (WebKit::VirtualService::VirtualService): (WebKit::VirtualService::createVirtual): (WebKit::VirtualService::startDiscoveryInternal): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::virtualAuthenticatorManager): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit.xcodeproj/project.pbxproj: 2021-11-04 Lauro Moura REGRESSION(r285077) [GLIB] 'MemoryPressureMonitor' has not been declared https://bugs.webkit.org/show_bug.cgi?id=232706 Unreviewed non-linux build fix. MemoryPressureMonitor is only available on Linux, so its usage should be guarded, like WebProcessPool.cpp does when starting it. * UIProcess/glib/WebProcessPoolGLib.cpp: (WebKit::WebProcessPool::platformInitialize): Add OS(LINUX) guard. (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. 2021-11-04 Brent Fulgham [iOS] Update IOKit message filters for later iOS releases https://bugs.webkit.org/show_bug.cgi?id=232681 Reviewed by Per Arne Vollan. Now that method ordinals have stabilized, we can re-enable message filtering in our trunk builds. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-11-04 Commit Queue Unreviewed, reverting r285228. https://bugs.webkit.org/show_bug.cgi?id=232704 Broke iOS builds Reverted changeset: "REGRESSION: AR Quicklook asset is shared instead of page URL" https://bugs.webkit.org/show_bug.cgi?id=232674 https://commits.webkit.org/r285228 2021-11-03 Jer Noble [macOS] MediaSession coordinator enabled in UIProcess, disabled in WebContent https://bugs.webkit.org/show_bug.cgi?id=232687 Reviewed by Eric Carlson. The default value of defaultMediaSessionCoordinatorEnabled() will be true if the UIProcess has the correct entitlement. However, this value is not passed across the XPC boundary unless it has been overridden, which means defaultMediaSessionCoordinatorEnabled() will control the setting in the WebContent process, which is not entitled. Have the WebContent process check its parent process's entitlement rather than its own when determining the default value for defaultMediaSessionCoordinatorEnabled(). * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultMediaSessionCoordinatorEnabled): 2021-11-03 Tyler Wilcock AX: WKAccessibilityWebPageObjectMac.mm should expose accessibilityChildrenInNavigationOrder and NSAccessibilityChildrenInNavigationOrderAttribute https://bugs.webkit.org/show_bug.cgi?id=232654 Reviewed by Chris Fleizach. Some clients expect accessibilityChildrenInNavigationOrder and NSAccessibilityChildrenInNavigationOrderAttribute to be available, and WKAccessibilityWebPageObjectMac didn't expose them. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityChildrenInNavigationOrder]): Added. (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]): Handle NSAccessibilityChildrenInNavigationOrderAttribute. (-[WKAccessibilityWebPageObject accessibilityAttributeNames:]): Add NSAccessibilityChildrenInNavigationOrderAttribute. 2021-11-03 Wenson Hsieh [GPU Process] Rendering backend may stop processing IPC stream messages after a sync message timeout https://bugs.webkit.org/show_bug.cgi?id=232580 Reviewed by Tim Horton. Currently, it's possible for sync IPC messages that are sent through IPC streams to time out and subsequently cause the IPC stream server (e.g. RemoteRenderingBackend) to stop processing IPC stream messages altogether. The following example illustrates how this might happen: 1. Web process sends the sync message at offset `n` (relative to the start of the ring buffer). Web process then begins to wait for the sync stream response under `tryAcquireAll()`. 2. GPU process receives the sync message, and takes a while (> 1 sec.) attempting to dispatch it. 3. Meanwhile in the web process, we hit the IPC timeout and bail from `tryAcquireAll()`. The client offset is still at `n`. Shortly afterwards, the web process tries to send a regular stream message, calling `tryAcquire()` and waiting for the client semaphore to be signaled. 4. The GPU process finally finishes dispatching the sync message from (2), sends a sync reply (unaware that the web process has already given up waiting), and finally calls `releaseAll()`, signaling the client semaphore. The server offset is then reset back to 0. 5. The web process finishes waiting, returns from `tryAcquire()`, proceeds to write the new stream message after offset `n`, and wakes up the GPU process with the intention of handling this message. 6. The GPU process wakes up and begins reading from offset 0. The first message it encounters is the `SyncMessageReply` it just wrote in step (4), and subsequently bails from the processing loop because it isn't capable of dispatching this message (which was meant to be consumed in the web process in the first place). In summary, the sync IPC timeout causes us to enter a state where the web process continues to encode messages at the buffer offset prior to timeout (i.e. offset `n`), while the GPU process is reading from the start of the buffer (offset `0`). To avoid this, simply replace the timeouts when synchronously grabbing image data from the GPU process. This ensures that we're never in a state where we're continuing to send stream messages to a rendering backend connection stream after timing out when waiting for a previous sync message to that stream to finish. * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::sharedMemoryForGetPixelBuffer): (WebKit::RemoteRenderingBackendProxy::waitForGetPixelBufferToComplete): * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h: 2021-11-03 Tim Horton Fix the build. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::modelElementDidCreatePreview): 2021-11-03 Dean Jackson REGRESSION: AR Quicklook asset is shared instead of page URL https://bugs.webkit.org/show_bug.cgi?id=232674 rdar://84220997 Reviewed by Antoine Quint. There was a typo. ENABLE(ARKIT_QUICK_LOOK_PREVIEW_ITEM) should be HAVE(ARKIT_QUICK_LOOK_PREVIEW_ITEM). * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: 2021-11-03 Chris Dumez Clicking a link should preconnect to destination as first party https://bugs.webkit.org/show_bug.cgi?id=232668 Reviewed by Alex Christensen. Clicking a link should preconnect to destination as first party, not third-party. Otherwise, the preconnect is wasted when session isolation based on registrable domain is enabled. This is a follow-up to r284730. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/Network/WebLoaderStrategy.h: 2021-11-03 Jer Noble [Catalina] HLS streams will not select HDR variants when GPU Process is enabled https://bugs.webkit.org/show_bug.cgi?id=232671 Reviewed by Eric Carlson. Tested manually. In Catalina, fall back to a MediaToolbox API for setting a global HDR override in the GPU process which instructs all AVPlayer instances whether HDR playback is supported for the current set of displays. Pass the required data across from the UIProcess to the GPU process at process start up and when the displays are reconfigured. * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * GPUProcess/mac/GPUProcessMac.mm: (WebKit::GPUProcess::setScreenProperties): * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::setScreenProperties): (WebKit::GPUProcessProxy::updatePreferences): * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::screenPropertiesStateChanged): (WebKit::displayReconfigurationCallBack): 2021-11-03 David Kilzer Leak of UUID in WebKit::ModelElementController::modelElementDidCreatePreview() Reviewed by Brent Fulgham. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::modelElementDidCreatePreview): - Use adoptNS() to fix the leak. 2021-11-03 Kate Cheney [iOS] Need API for marking file requests as non-app-initiated https://bugs.webkit.org/show_bug.cgi?id=232506 Reviewed by Brent Fulgham. Pass app initiated value through to the WebPage so file loads can be attributed correctly. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView loadFileRequest:allowingReadAccessToURL:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadFile): * UIProcess/WebPageProxy.h: 2021-11-02 Don Olmstead Non-unified build fixes early November 2021 edition https://bugs.webkit.org/show_bug.cgi?id=232589 Unreviewed non-unified build fixes. * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::createGPUConnectionToWebProcess): (WebKit::GPUProcess::webProcessConnection const): (WebKit::GPUProcess::updateCaptureAccess): (WebKit::GPUProcess::updateCaptureOrigin): (WebKit::GPUProcess::nowPlayingManager): * GPUProcess/graphics/RemoteRenderingBackend.cpp: 2021-11-02 Chris Dumez Crash under WebPage::sendCOEPCORPViolation() https://bugs.webkit.org/show_bug.cgi?id=232631 Reviewed by Alex Christensen. Add missing null checks for the frame after calling `WebProcess::singleton().webFrame(frameID)`. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::sendCOEPPolicyInheritenceViolation): (WebKit::WebPage::sendCOEPCORPViolation): (WebKit::WebPage::sendViolationReportWhenNavigatingToCOOPResponse): (WebKit::WebPage::sendViolationReportWhenNavigatingAwayFromCOOPResponse): 2021-11-02 Sihui Liu Terminate unresponsive network process by crashing it https://bugs.webkit.org/show_bug.cgi?id=232603 Reviewed by Chris Dumez. UI process currently kills network process when it does not respond message in some time (network process being unresponsive). We've found one common case where network process becomes unresponsive is that it is blocked by some slow operation on the main thread (like file operation in rdar://84511633). To understand what the operations are and make a fix, we now ask network process to crash itself on IPC thread. In this way, we can get crash report that includes the call stack of the main thread. To avoid generating too many crash reports, we only send the crash message to network process when it becomes unresponsive multiple times in a short time period. * Platform/IPC/Connection.cpp: (IPC::terminateDueToIPCTerminateMessage): (IPC::Connection::processIncomingMessage): * Scripts/webkit/model.py: * Scripts/webkit/tests/MessageNames.cpp: (IPC::description): (IPC::receiverName): (IPC::isValidMessageName): * Scripts/webkit/tests/MessageNames.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::shouldTerminateNetworkProcessBySendingMessage): (WebKit::NetworkProcessProxy::didBecomeUnresponsive): 2021-11-02 Kate Cheney PCM: Safari on iOS and macOS are not sending ad click attribution reports for Private Click Measurement https://bugs.webkit.org/show_bug.cgi?id=228104 Reviewed by John Wilander. firePendingAttributionRequests() was sometimes scheduling the next timer fire to be the raw time value instead of the difference between now and the scheduled send time. This was resulting in some reports not being sent within the 24-48 hour range. To test this, this patch removes the immediate timer fire for testing and instead sets the earliest time to send values to both be 1 second. This will test that the proper timer gets set to send both reports. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp: (WebKit::PCM::Database::attributePrivateClickMeasurement): * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.cpp: (WebKit::PrivateClickMeasurementManager::startTimer): (WebKit::PrivateClickMeasurementManager::attribute): (WebKit::PrivateClickMeasurementManager::randomlyBetweenFifteenAndThirtyMinutes const): (WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests): In the case of both times being past due to report, schedule one for 15 - 30 minutes later. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManager.h: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp: (WebKit::PCM::Store::attributePrivateClickMeasurement): * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.h: 2021-11-02 Simon Fraser Revert the wheel event coalescing added in r277587 https://bugs.webkit.org/show_bug.cgi?id=232602 Reviewed by Wenson Hsieh. This wheel event coalescing was added to allow the tail end of momentum scrolls on 120Hz devices to fall back to 60fps for power reasons. However, the OS does this for us, so we don't need to do our own coalescing. * Shared/WebWheelEventCoalescer.cpp: (WebKit::WebWheelEventCoalescer::shouldDispatchEvent): (WebKit::WebWheelEventCoalescer::isMomentumPhaseEvent): Deleted. * Shared/WebWheelEventCoalescer.h: (WebKit::WebWheelEventCoalescer::shouldCoalesceEventsDuringDeceleration const): Deleted. (WebKit::WebWheelEventCoalescer::setShouldCoalesceEventsDuringDeceleration): Deleted. (): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::wheelEventCoalescer): (WebKit::WebPageProxy::windowScreenDidChange): (WebKit::WebPageProxy::shouldCoalesceWheelEventsDuringDeceleration const): Deleted. * UIProcess/WebPageProxy.h: 2021-11-02 Patrick Angle WebDriver: [Cocoa] support `acceptInsecureCerts` capability https://bugs.webkit.org/show_bug.cgi?id=231789 Reviewed by BJ Burg. Add necessary plumbing to support the `acceptInsecureCerts` WebDriver capability. * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h: * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm: (-[_WKAutomationSessionConfiguration init]): (-[_WKAutomationSessionConfiguration copyWithZone:]): * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::requestAutomationSession): 2021-11-02 Kate Cheney https://bugs.webkit.org/show_bug.cgi?id=232593 Remove isAppInitiated from _WKSessionState Reviewed by Brent Fulgham. After https://bugs.webkit.org/show_bug.cgi?id=232486 we no longer need the isAppInitiated value on _WKSessionState. It will be set automatically when session state is retrieved. No new tests. Confirmed by existing RestoreFromSessionState* API tests. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _restoreSessionState:andNavigate:]): * UIProcess/API/Cocoa/_WKSessionState.h: * UIProcess/API/Cocoa/_WKSessionState.mm: (-[_WKSessionState _sessionStateWithAppInitiatedValue]): Deleted. * UIProcess/API/Cocoa/_WKSessionStateInternal.h: 2021-11-02 Chris Dumez Use higher QoS for WheelEvent and DisplayWasRefreshed IPCs https://bugs.webkit.org/show_bug.cgi?id=232458 Reviewed by Simon Fraser. Use higher QoS for WheelEvent and DisplayWasRefreshed IPCs since those are high priority. The UIProcess's main thread has high UserInteractive QoS but the IPC thread has a lower QoS by default. We cannot raise the QoS of the IPC thread without regressing some performance benchmarks since not all IPC is high priority. Making this change helps with responsiveness under heavy load scenarios. * Platform/IPC/Connection.cpp: (IPC::Connection::sendMessage): * Platform/IPC/Connection.h: (IPC::Connection::send): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sendWheelEvent): * UIProcess/mac/DisplayLink.cpp: (WebKit::DisplayLink::notifyObserversDisplayWasRefreshed): 2021-11-02 Zixing Liu [GTK][WPE] Support setting status code and getting HTTP method in custom URI scheme handlers https://bugs.webkit.org/show_bug.cgi?id=231880 Reviewed by Carlos Garcia Campos. * SourcesGTK.txt: Added WebKitURISchemeResponse.cpp * SourcesWPE.txt: Added WebKitURISchemeResponse.cpp * UIProcess/API/glib/WebKitURISchemeRequest.cpp: (webkit_uri_scheme_request_get_http_method): Added new API function (webkit_uri_request_finish_with_response): Added new API function * UIProcess/API/glib/WebKitURISchemeRequestPrivate.h: Added. * UIProcess/API/glib/WebKitURISchemeResponse.cpp: Added. (webkit_uri_scheme_response_class_init): Added init function for the new type (webkit_uri_scheme_response_new): Added new API function (webkit_uri_scheme_response_set_status): Added new API function (webkit_uri_scheme_response_set_content_type): Added new API function * UIProcess/API/glib/WebKitURISchemeResponsePrivate.h: Copied from Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequestPrivate.h. * UIProcess/API/gtk/WebKitAutocleanups.h: Register clean-up function for WebkitURISchemeResponse * UIProcess/API/gtk/WebKitURISchemeRequest.h: Added function prototype for webkit_uri_scheme_request_get_http_method * UIProcess/API/gtk/WebKitURISchemeResponse.h: Added. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new symbols and new types * UIProcess/API/gtk/webkit2.h: Include a new header: WebKitURISchemeResponse.h * UIProcess/API/wpe/WebKitURISchemeRequest.h: Added function prototype for webkit_uri_scheme_request_get_http_method * UIProcess/API/gtk/WebKitURISchemeResponse.h: Added. * UIProcess/API/wpe/webkit.h: Include a new header: WebKitURISchemeResponse.h * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: Added new symbols and new types 2021-11-01 Michael[tm] Smith [WebInspector][CORS] Show HTTP status code in CORS messages. https://bugs.webkit.org/show_bug.cgi?id=231928 Reviewed by Darin Adler Make the HTTP status be included in all CORS messages that might get logged to the Inspector console when a 4xx or 5xx error occurs. That means these: * Failed to load resource: Origin foo is not allowed by Access-Control-Allow-Origin * Failed to load resource: Preflight response is not successful The change makes those messages read as follows (in the case of, for example, a 500 error): * Failed to load resource: Origin foo is not allowed by Access-Control-Allow-Origin. Status code: 500 * Failed to load resource: Preflight response is not successful. Status code: 500 Tests: Updates 100+ existing tests, by changing expected messages. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection): 2021-11-01 Chris Dumez Avoid heap-allocating ImportanceAssertion https://bugs.webkit.org/show_bug.cgi?id=232579 Reviewed by Alex Christensen. Avoid heap-allocating ImportanceAssertion since this is just a wrapper around a mach_port. Also update the ImportanceAssertion destructor to null out the mach port as hardening given . * Platform/IPC/Decoder.cpp: (IPC::Decoder::setImportanceAssertion): * Platform/IPC/Decoder.h: * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::Connection::receiveSourceEventHandler): * Platform/IPC/cocoa/ImportanceAssertion.h: (IPC::ImportanceAssertion::ImportanceAssertion): (IPC::ImportanceAssertion::operator=): (IPC::ImportanceAssertion::~ImportanceAssertion): 2021-11-01 Per Arne [macOS] Opening local html files is failing https://bugs.webkit.org/show_bug.cgi?id=232572 Reviewed by Brent Fulgham. On some macOS versions, opening local html files is failing. In order for the WebContent process to successfully issue the file extension to the Networking process, the flags for the extension in the WebContent process must include the user intent flag when the extension is issued with an audit token. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::sandboxExtensionForType): 2021-11-01 Fujii Hironori [WinCairo] Enable gpu_process_canvas_rendering and gpu_process_webgl by default https://bugs.webkit.org/show_bug.cgi?id=232555 Reviewed by Don Olmstead. They can be disabled by the registry. > reg add HKEY_CURRENT_USER\Software\WebKit /v gpu_process_canvas_rendering /t REG_DWORD /d 0 /f > reg add HKEY_CURRENT_USER\Software\WebKit /v gpu_process_webgl /t REG_DWORD /d 0 /f * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultUseGPUProcessForCanvasRenderingEnabled): (WebKit::defaultUseGPUProcessForWebGLEnabled): * Shared/win/WebPreferencesDefaultValuesWin.cpp: (WebKit::isFeatureFlagEnabled): 2021-11-01 Fujii Hironori HashMap>::get can't compile https://bugs.webkit.org/show_bug.cgi?id=232554 Reviewed by Kimmo Kinnunen. Because IPC::ScopedActiveMessageReceiveQueue didn't have own HashTraits, it used GenericHashTraits. So, HashMap::get tried to return PeekType, that was ScopedActiveMessageReceiveQueue. But, it couldn't construct ScopedActiveMessageReceiveQueue from "const ScopedActiveMessageReceiveQueue&". * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::findRemoteGraphicsContextGL): Use get() instead of find(). * Platform/IPC/ScopedActiveMessageReceiveQueue.h: Added HashTraits for it. 2021-11-01 Brady Eidson webpushd: Add mock in-memory registration, and the WKWebsiteDataStore SPI to manage them https://bugs.webkit.org/show_bug.cgi?id=232539 Reviewed by Alex Christensen. Covered by API test. The old SPI to ask the client if notifications should be allowed will remain. Assuming the client okays notifications, in the case of built-in notifications, the *actual* registration interaction with the system will take place as an additional step in webpushd This patch: - Adds in-memory notification registration for webpushd - Adds SPI to WKWebsiteDataStore to manage registrations - Tests the SPI * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deletePushAndNotificationRegistration): (WebKit::NetworkProcess::getOriginsWithPushAndNotificationPermissions): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::notificationManager): * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::requestSystemNotificationPermission): (WebKit::NetworkNotificationManager::deletePushAndNotificationRegistration): (WebKit::NetworkNotificationManager::getOriginsWithPushAndNotificationPermissions): (WebKit::ReplyCaller::callReply): (WebKit::ReplyCaller::callReply): * NetworkProcess/Notifications/NetworkNotificationManager.h: * Shared/API/APISecurityOrigin.h: (API::SecurityOrigin::create): * Shared/Notifications/NotificationManagerMessageHandler.h: * Shared/Notifications/NotificationManagerMessageHandler.messages.in: * Shared/WebPushDaemonConstants.h: (WebKit::WebPushD::messageTypeSendsReply): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _deletePushAndNotificationRegistration:completionHandler:]): (-[WKWebsiteDataStore _getOriginsWithPushAndNotificationPermissions:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::deletePushAndNotificationRegistration): (WebKit::NetworkProcessProxy::getOriginsWithPushAndNotificationPermissions): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Notifications/WebNotificationManagerMessageHandler.cpp: (WebKit::WebNotificationManagerMessageHandler::requestSystemNotificationPermission): * UIProcess/Notifications/WebNotificationManagerMessageHandler.h: * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: (WebKit::NotificationPermissionRequestManager::startRequest): * webpushd/WebPushDaemon.h: * webpushd/WebPushDaemon.mm: (WebPushD::MessageInfo::getOriginsWithPushAndNotificationPermissions::encodeReply): (WebPushD::MessageInfo::deletePushAndNotificationRegistration::encodeReply): (WebPushD::MessageInfo::requestSystemNotificationPermission::encodeReply): (WebPushD::Daemon::decodeAndHandleMessage): (WebPushD::Daemon::requestSystemNotificationPermission): (WebPushD::Daemon::getOriginsWithPushAndNotificationPermissions): (WebPushD::Daemon::deletePushAndNotificationRegistration): 2021-11-01 Kimmo Kinnunen GPU process WebKit logging is not initialised https://bugs.webkit.org/show_bug.cgi?id=232563 Reviewed by Chris Dumez. The file was not including LogInitialization.h. "using namespace WebCore" caused WebKit::logChannels() to mean WebCore::logChannels(). * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): 2021-11-01 Sihui Liu Increase responsiveness timeout for network process https://bugs.webkit.org/show_bug.cgi?id=232505 Reviewed by Chris Dumez. * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::AuxiliaryProcessProxy): * UIProcess/AuxiliaryProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): (WebKit::NetworkProcessProxy::getNetworkProcessConnection): * UIProcess/ResponsivenessTimer.cpp: (WebKit::ResponsivenessTimer::ResponsivenessTimer): (WebKit::ResponsivenessTimer::timerFired): (WebKit::ResponsivenessTimer::start): (): Deleted. * UIProcess/ResponsivenessTimer.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::getNetworkProcessConnection): 2021-11-01 Tim Horton Add a testing preference to replay CG display lists manually https://bugs.webkit.org/show_bug.cgi?id=232566 Reviewed by Wenson Hsieh. * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::replayCGDisplayListsIntoBackingStore const): Plumb the preference through to _setWKContents. * UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h: * UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm: (-[WKCompositingLayer _setWKContents:withDisplayList:replayForTesting:]): (-[WKCompositingLayer drawInContext:]): (-[WKCompositingLayer _setWKContents:withDisplayList:]): Deleted. If the preference is set, store the display list instead of setting it on the layer, and call setNeedsDisplay, and then replay the display list in drawInContext. 2021-11-01 Ayumi Kojima Unreviewed, reverting r285055. Reverting because this commit may have caused webgl/1.0.x/conformance/textures/misc/texture-corner-case- videos.html and webgl/2.0.y/conformance/textures/misc/texture- corner-case-videos.html to time out Reverted changeset: "Avoid sending video data to Web process for canvas.drawImage(video)" https://bugs.webkit.org/show_bug.cgi?id=230766 https://commits.webkit.org/r285055 2021-11-01 Daniel Kolesa Fix build with GCC 8.4 on Ubuntu 18.04 https://bugs.webkit.org/show_bug.cgi?id=232305 Reviewed by Adrian Perez de Castro. Thes sections of the code trigger an internal compiler error with GCC 8.4, segfaulting the compiler. This adds a workaround that makes it work again. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): 2021-10-31 Fujii Hironori [WinCairo] New GraphicsLayer for GPU process mode https://bugs.webkit.org/show_bug.cgi?id=228308 Reviewed by Don Olmstead. Added a new GraphicsLayer implementation GraphicsLayerWC which transfers GraphicsLayer tree to GPU process and runs the compositor (TextureMapper) in GPU process. In GPU process mode, WebGL is run in GPU process. So, the compositor should be run in GPU process. Otherwise, the output texture of WebGL has to be transferred from GPU process to the compositor process (UI process or web process). Because ANGLE isn't thread-safe, the compositor and WebGL should be run in the same thread in GPU process. Enabling gpu_process_webgl also enables GPU process compositing now. > reg add HKEY_CURRENT_USER\Software\WebKit /v gpu_process_webgl /t REG_DWORD /d 1 /f gpu_process_canvas_rendering can also be enabled. > reg add HKEY_CURRENT_USER\Software\WebKit /v gpu_process_canvas_rendering /t REG_DWORD /d 1 /f Enabling gpu_process_dom_rendering is still experimental. > reg add HKEY_CURRENT_USER\Software\WebKit /v gpu_process_dom_rendering /t REG_DWORD /d 1 /f The following commands restore the non-GPU process mode. > reg delete HKEY_CURRENT_USER\Software\WebKit /v gpu_process_canvas_rendering /f > reg delete HKEY_CURRENT_USER\Software\WebKit /v gpu_process_webgl /f > reg delete HKEY_CURRENT_USER\Software\WebKit /v gpu_process_dom_rendering /f * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::createWCLayerTreeHost): (WebKit::GPUConnectionToWebProcess::releaseWCLayerTreeHost): (WebKit::GPUConnectionToWebProcess::findRemoteGraphicsContextGL): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUConnectionToWebProcess.messages.in: * GPUProcess/GPUProcess.h: (WebKit::GPUProcess::sharedSceneContext): * GPUProcess/graphics/RemoteGraphicsContextGL.h: (WebKit::RemoteGraphicsContextGL::platformLayer const): * GPUProcess/graphics/ScopedWebGLRenderingResourcesRequest.cpp: (WebKit::ScopedWebGLRenderingResourcesRequest::scheduleFreeWebGLRenderingResources): * GPUProcess/graphics/wc/RemoteWCLayerTreeHost.cpp: Added. (WebKit::RemoteWCLayerTreeHost::create): (WebKit::RemoteWCLayerTreeHost::RemoteWCLayerTreeHost): (WebKit::RemoteWCLayerTreeHost::~RemoteWCLayerTreeHost): (WebKit::RemoteWCLayerTreeHost::messageSenderConnection const): (WebKit::RemoteWCLayerTreeHost::messageSenderDestinationID const): (WebKit::RemoteWCLayerTreeHost::update): * GPUProcess/graphics/wc/RemoteWCLayerTreeHost.h: Added. * GPUProcess/graphics/wc/RemoteWCLayerTreeHost.messages.in: Added. * GPUProcess/graphics/wc/WCScene.cpp: Added. (WebKit::WCScene::initialize): (WebKit::WCScene::~WCScene): (WebKit::WCScene::update): * GPUProcess/graphics/wc/WCScene.h: Added. * GPUProcess/graphics/wc/WCSceneContext.cpp: Added. (WebKit::WCSceneContext::WCSceneContext): (WebKit::WCSceneContext::makeContextCurrent): (WebKit::WCSceneContext::createTextureMapper): (WebKit::WCSceneContext::swapBuffers): * GPUProcess/graphics/wc/WCSceneContext.h: Added. * GPUProcess/graphics/wc/WCSharedSceneContextHolder.h: Added. (WebKit::WCSharedSceneContextHolder::ensureHolderForWindow): (WebKit::WCSharedSceneContextHolder::removeHolder): * GPUProcess/win/GPUProcessMainWin.cpp: (WebKit::GPUProcessMain): * PlatformWin.cmake: * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): (conditions_for_header): * Shared/DrawingAreaInfo.h: * UIProcess/wc/DrawingAreaProxyWC.cpp: Added. (WebKit::DrawingAreaProxyWC::DrawingAreaProxyWC): (WebKit::DrawingAreaProxyWC::paint): (WebKit::DrawingAreaProxyWC::sizeDidChange): (WebKit::DrawingAreaProxyWC::update): (WebKit::DrawingAreaProxyWC::enterAcceleratedCompositingMode): (WebKit::DrawingAreaProxyWC::incorporateUpdate): (WebKit::DrawingAreaProxyWC::discardBackingStore): * UIProcess/wc/DrawingAreaProxyWC.h: Added. * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/win/WebView.cpp: (WebKit::WebView::paint): * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: (WebKit::RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy): * WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy.cpp: Added. (WebKit::RemoteWCLayerTreeHostProxy::RemoteWCLayerTreeHostProxy): (WebKit::RemoteWCLayerTreeHostProxy::~RemoteWCLayerTreeHostProxy): (WebKit::RemoteWCLayerTreeHostProxy::messageSenderConnection const): (WebKit::RemoteWCLayerTreeHostProxy::ensureGPUProcessConnection): (WebKit::RemoteWCLayerTreeHostProxy::disconnectGpuProcessIfNeeded): (WebKit::RemoteWCLayerTreeHostProxy::gpuProcessConnectionDidClose): (WebKit::RemoteWCLayerTreeHostProxy::messageSenderDestinationID const): (WebKit::RemoteWCLayerTreeHostProxy::update): (WebKit::RemoteWCLayerTreeHostProxy::didUpdate): * WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy.h: Added. (WebKit::RemoteWCLayerTreeHostProxy::wcLayerTreeHostIdentifier const): * WebProcess/GPU/graphics/wc/RemoteWCLayerTreeHostProxy.messages.in: Added. * WebProcess/GPU/graphics/wc/WCLayerTreeHostIdentifier.h: Added. * WebProcess/GPU/graphics/wc/WCPlatformLayerGCGL.h: Added. (WebKit::WCPlatformLayerGCGL::WCPlatformLayerGCGL): (WebKit::WCPlatformLayerGCGL::graphicsContextGLIdentifier): * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create): (WebKit::DrawingArea::supportsGPUProcessRendering): * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::updateGeometry): * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/wc/DrawingAreaWC.cpp: Added. (WebKit::DrawingAreaWC::DrawingAreaWC): (WebKit::DrawingAreaWC::~DrawingAreaWC): (WebKit::DrawingAreaWC::graphicsLayerFactory): (WebKit::DrawingAreaWC::updateRootLayers): (WebKit::DrawingAreaWC::setRootCompositingLayer): (WebKit::DrawingAreaWC::attachViewOverlayGraphicsLayer): (WebKit::DrawingAreaWC::setLayerTreeStateIsFrozen): (WebKit::DrawingAreaWC::updateGeometry): (WebKit::DrawingAreaWC::setNeedsDisplay): (WebKit::DrawingAreaWC::setNeedsDisplayInRect): (WebKit::DrawingAreaWC::scroll): (WebKit::DrawingAreaWC::triggerRenderingUpdate): (WebKit::flushLayerImageBuffers): (WebKit::DrawingAreaWC::isCompositingMode): (WebKit::DrawingAreaWC::updateRendering): (WebKit::DrawingAreaWC::sendUpdateAC): (WebKit::shouldPaintBoundsRect): (WebKit::DrawingAreaWC::sendUpdateNonAC): (WebKit::DrawingAreaWC::graphicsLayerAdded): (WebKit::DrawingAreaWC::graphicsLayerRemoved): (WebKit::DrawingAreaWC::commitLayerUpateInfo): (WebKit::DrawingAreaWC::createImageBuffer): (WebKit::DrawingAreaWC::didUpdate): (WebKit::DrawingAreaWC::RootLayerClient::RootLayerClient): (WebKit::DrawingAreaWC::RootLayerClient::paintContents): (WebKit::DrawingAreaWC::RootLayerClient::deviceScaleFactor const): * WebProcess/WebPage/wc/DrawingAreaWC.h: Added. * WebProcess/WebPage/wc/GraphicsLayerWC.cpp: Added. (WebKit::GraphicsLayerWC::GraphicsLayerWC): (WebKit::GraphicsLayerWC::~GraphicsLayerWC): (WebKit::GraphicsLayerWC::generateLayerID): (WebKit::GraphicsLayerWC::primaryLayerID const): (WebKit::GraphicsLayerWC::setNeedsDisplay): (WebKit::GraphicsLayerWC::setNeedsDisplayInRect): (WebKit::GraphicsLayerWC::setContentsNeedsDisplay): (WebKit::GraphicsLayerWC::setChildren): (WebKit::GraphicsLayerWC::addChild): (WebKit::GraphicsLayerWC::addChildAtIndex): (WebKit::GraphicsLayerWC::addChildBelow): (WebKit::GraphicsLayerWC::addChildAbove): (WebKit::GraphicsLayerWC::replaceChild): (WebKit::GraphicsLayerWC::removeFromParent): (WebKit::GraphicsLayerWC::setMaskLayer): (WebKit::GraphicsLayerWC::setReplicatedLayer): (WebKit::GraphicsLayerWC::setReplicatedByLayer): (WebKit::GraphicsLayerWC::setPosition): (WebKit::GraphicsLayerWC::setAnchorPoint): (WebKit::GraphicsLayerWC::setSize): (WebKit::GraphicsLayerWC::setBoundsOrigin): (WebKit::GraphicsLayerWC::setTransform): (WebKit::GraphicsLayerWC::setChildrenTransform): (WebKit::GraphicsLayerWC::setPreserves3D): (WebKit::GraphicsLayerWC::setMasksToBounds): (WebKit::GraphicsLayerWC::setOpacity): (WebKit::GraphicsLayerWC::setContentsRect): (WebKit::GraphicsLayerWC::setContentsClippingRect): (WebKit::GraphicsLayerWC::setDrawsContent): (WebKit::GraphicsLayerWC::setContentsVisible): (WebKit::GraphicsLayerWC::setBackfaceVisibility): (WebKit::GraphicsLayerWC::setContentsToSolidColor): (WebKit::GraphicsLayerWC::setContentsToPlatformLayer): (WebKit::GraphicsLayerWC::usesContentsLayer const): (WebKit::GraphicsLayerWC::setShowDebugBorder): (WebKit::GraphicsLayerWC::setDebugBorder): (WebKit::GraphicsLayerWC::setShowRepaintCounter): (WebKit::filtersCanBeComposited): (WebKit::GraphicsLayerWC::setFilters): (WebKit::GraphicsLayerWC::setBackdropFilters): (WebKit::GraphicsLayerWC::setBackdropFiltersRect): (WebKit::GraphicsLayerWC::noteLayerPropertyChanged): (WebKit::GraphicsLayerWC::flushCompositingState): (WebKit::GraphicsLayerWC::flushCompositingStateForThisLayerOnly): * WebProcess/WebPage/wc/GraphicsLayerWC.h: Added. * WebProcess/WebPage/wc/WCBackingStore.h: Added. (WebKit::WCBackingStore::WCBackingStore): (WebKit::WCBackingStore::imageBuffer): (WebKit::WCBackingStore::setImageBuffer): (WebKit::WCBackingStore::bitmap const): (WebKit::WCBackingStore::encode const): (WebKit::WCBackingStore::decode): * WebProcess/WebPage/wc/WCLayerFactory.cpp: Added. (WebKit::WCLayerFactory::WCLayerFactory): (WebKit::WCLayerFactory::createGraphicsLayer): * WebProcess/WebPage/wc/WCLayerFactory.h: Added. * WebProcess/WebPage/wc/WCUpateInfo.h: Added. (WebKit::WCLayerUpateInfo::encode const): (WebKit::WCLayerUpateInfo::decode): (WebKit::WCUpateInfo::encode const): (WebKit::WCUpateInfo::decode): 2021-10-31 Simon Fraser Scroll animations should run at 120Hz on 120Hz displays https://bugs.webkit.org/show_bug.cgi?id=232534 Reviewed by Tim Horton. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: * WebProcess/WebPage/mac/TiledCoreAnimationScrollingCoordinator.mm: (WebKit::TiledCoreAnimationScrollingCoordinator::hasNodeWithAnimatedScrollChanged): 2021-10-30 Myles C. Maxfield Migrate the first few callers from ImageBuffer::truncatedLogicalSize() to ImageBuffer::logicalSize() https://bugs.webkit.org/show_bug.cgi?id=232528 Reviewed by Tim Horton. * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: (WebKit::RemoteImageBufferProxy::RemoteImageBufferProxy): 2021-10-30 Wenson Hsieh Layer tree should not be stuck in frozen state after explicitly stopping a page load https://bugs.webkit.org/show_bug.cgi?id=232532 rdar://84522357 Reviewed by Tim Horton. From diagnostic logs gathered in rdar://84522357, it's apparently possible for the layer tree to be stuck in a state where it's indefinitely frozen after the user explicitly stops the page load (e.g. by tapping on the "x" button in Safari). Specifically, these logs indicate that the `PageTransition` layer tree freeze reason may persist even after the user has canceled the load, leading to situations where content may be visible but unresponsive. From code inspection, this may happen for multiple reasons, one of which is that a media element has incremented the load event delay count, which in turn prevents us from transitioning to completed state inside `FrameLoader::checkLoadCompleteForThisFrame()`. It's unknown whether this (in particular) is the cause of unresponsiveness observed by the reporter of rdar://84522357, but we can at least use this in order to come up with a layout test; to mitigate all instances where the `PageTransition` reason may persist after the load has been stopped, we make `WebPage::stopLoading()` complete the page transition (thereby lifting the freeze reason) if needed. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopLoading): 2021-10-30 Myles C. Maxfield Web process shouldn't crash if ImageBuffer::ensureBackendCreated() fails https://bugs.webkit.org/show_bug.cgi?id=232520 Reviewed by Simon Fraser. Guard against the possibility of it returning null. No new tests because there shouldn't be any behavior change after https://bugs.webkit.org/show_bug.cgi?id=232470. It's still good to do this, though, to be defensive. * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::encode const): * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: (WebKit::RemoteImageBufferProxy::createImageBufferBackendHandle): 2021-10-30 Myles C. Maxfield [GPU Process] Small ImageBuffers cause the web process to crash https://bugs.webkit.org/show_bug.cgi?id=232470 Reviewed by Tim Horton. The problem is when the (floating point) size < 1x1, but the size*resolution is >= 1x1. In this situation, calculateSafeBackendSize() is correctly determining that this isn't a zero-sized ImageBuffer, but when we go to actually pass the size to the GPU process, we call this: IntSize logicalSize() const override { return IntSize(m_parameters.logicalSize); } So, the logical size gets truncated down to 0, and then the GPU process fails to allocate the ImageBuffer, and then the web process blocks on the GPU process indefinitely, and then eventually times out and then crashes. I'm going to deal with that last step (the crash itself) in a secondary patch - if the web process doesn't hear from the GPU process, it shouldn't crash. This patch simply exposes a floatLogicalSize() function on ImageBuffer, so we can get the full-fidelity logical size to pass that to the GPU process. Test: compositing/device-pixel-image-buffer-hidpi.html * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer): 2021-10-30 Chris Dumez Improve error handling in sendWithAsyncReply() https://bugs.webkit.org/show_bug.cgi?id=232508 Reviewed by Darin Adler. * Platform/IPC/Connection.cpp: (IPC::Connection::invalidate): We stop delivering messages as soon as |m_valid| becomes false. It is thus a good idea to cancel any pending async reply handlers as soon as we set m_isValid to false. We were doing it correctly in connectionDidClose() but not in invalidate(). The Connection destructor would eventually call the async reply handlers. However, I have noticed when investigating a leak that this may delay the calling of the reply handler for a long time if something keeps the Connection alive (or forever in case of a leak). * Platform/IPC/Connection.h: (IPC::Connection::sendWithAsyncReply): Return early if the connection is no longer valid and call the completion handler right away (but asynchronously). Previously, we'd register the async reply handler and then the call to sendMessage() would fail. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _getContentsAsStringWithCompletionHandlerKeepIPCConnectionAliveForTesting:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add helper SPI for API test. 2021-10-30 Kate Cheney [iOS 15] Loads after WKWebView session restore are marked as app-initiated https://bugs.webkit.org/show_bug.cgi?id=232486 Reviewed by Brent Fulgham. Return app initiated value in the page's SessionState so it can be restored by third party apps using the [WKWebView setInteractionState] API. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sessionState const): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeLegacySessionState): (WebKit::decodeLegacySessionState): 2021-10-29 Lauro Moura [GLIB][SOUP] Unify memoryPressureMonitorDisabled implementation https://bugs.webkit.org/show_bug.cgi?id=232519 Reviewed by Carlos Garcia Campos. Covered by existing tests. Follow up the fix of r285062, to avoid having two copies of the same function around. * UIProcess/glib/WebProcessPoolGLib.cpp: (WebKit::WebProcessPool::platformInitialize): (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::memoryPressureMonitorDisabled): Deleted. * UIProcess/linux/MemoryPressureMonitor.cpp: (WebKit::MemoryPressureMonitor::disabled): * UIProcess/linux/MemoryPressureMonitor.h: * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::memoryPressureMonitorDisabledSoup): Deleted. 2021-10-29 Tim Horton Add release logging of display list size to CGDisplayListImageBufferBackend https://bugs.webkit.org/show_bug.cgi?id=232496 Reviewed by Wenson Hsieh. No new tests, just new logging. * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp: (WebKit::CGDisplayListImageBufferBackend::createImageBufferBackendHandle const): 2021-10-29 Myles C. Maxfield Rename ImageBuffer.logicalSize to ImageBuffer.truncatedLogicalSize https://bugs.webkit.org/show_bug.cgi?id=232515 Reviewed by Tim Horton. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdentifier): * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: (WebKit::RemoteImageBufferProxy::RemoteImageBufferProxy): * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer): 2021-10-29 Kate Cheney Crash setting up AVCaptureSession https://bugs.webkit.org/show_bug.cgi?id=232507 Reviewed by Jer Noble. * GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm: (WebKit::GPUConnectionToWebProcess::setTCCIdentity): 2021-10-29 Alex Christensen Fix WPE build after r285047 https://bugs.webkit.org/show_bug.cgi?id=232462 * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::memoryPressureMonitorDisabledSoup): (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::memoryPressureMonitorDisabled): Deleted. 2021-10-29 Alex Christensen Unreviewed, reverting r284917. Likely caused significant performance regression Reverted changeset: "Remove properties set by NSURLProtocol on NSURLRequest before serializing" https://bugs.webkit.org/show_bug.cgi?id=232332 https://commits.webkit.org/r284917 2021-10-29 John Pascoe Add last modified and creation time to +[_WKWebAuthenticationPanel getAllLocalAuthenticatorCredentials] https://bugs.webkit.org/show_bug.cgi?id=232390 Reviewed by Darin Adler. This change adds new fields to returned credentials useful for providing context about them, namely when they were created and last modified. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (getAllLocalAuthenticatorCredentialsImpl): 2021-10-29 Cameron McCormack Avoid sending video data to Web process for canvas.drawImage(video). https://bugs.webkit.org/show_bug.cgi?id=230766 Reviewed by Simon Fraser. * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: 2021-10-29 Alex Christensen Fix internal macOS build after r285047 https://bugs.webkit.org/show_bug.cgi?id=232462 * Modules/OSX.modulemap: 2021-10-29 Alex Christensen Remove code inside ENABLE(NETSCAPE_PLUGIN_API) https://bugs.webkit.org/show_bug.cgi?id=232462 Reviewed by Anders Carlsson. * Configurations/PluginService.xcconfig: * Configurations/WebKit.xcconfig: * DerivedSources.make: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::removeDataRecords): (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes): * PlatformMac.cmake: * PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.Info.plist: Removed. * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm: Removed. * PluginProcess/PluginControllerProxy.cpp: Removed. * PluginProcess/PluginControllerProxy.h: Removed. * PluginProcess/PluginControllerProxy.messages.in: Removed. * PluginProcess/PluginCreationParameters.cpp: Removed. * PluginProcess/PluginCreationParameters.h: Removed. * PluginProcess/PluginProcess.cpp: Removed. * PluginProcess/PluginProcess.h: Removed. * PluginProcess/PluginProcess.messages.in: Removed. * PluginProcess/WebProcessConnection.cpp: Removed. * PluginProcess/WebProcessConnection.h: Removed. * PluginProcess/WebProcessConnection.messages.in: Removed. * PluginProcess/mac/PluginControllerProxyMac.mm: Removed. * PluginProcess/mac/PluginProcessMac.mm: Removed. * PluginProcess/mac/PluginProcessShim.h: Removed. * PluginProcess/mac/PluginProcessShim.mm: Removed. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Removed. * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.sb: Removed. * Resources/PlugInSandboxProfiles/com.apple.BocomSubmitCtrl.sb: Removed. * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb: Removed. * Resources/PlugInSandboxProfiles/com.apple.NPSafeSubmit.sb: Removed. * Resources/PlugInSandboxProfiles/com.apple.QuickTime Plugin.plugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.apple.appstore.CodeRedeemerNetscapePlugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.cisco.webex.plugin.gpc64.sb: Removed. * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb: Removed. * Resources/PlugInSandboxProfiles/com.ftsafe.NPAPI-Core-Safe-SoftKeybaord.plugin.rfc1034identifier.sb: Removed. * Resources/PlugInSandboxProfiles/com.google.googletalkbrowserplugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.google.o1dbrowserplugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player ESR.plugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb: Removed. * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb: Removed. * Shared/API/c/WKPluginInformation.cpp: (WKPluginInformationBundleIdentifierKey): (WKPluginInformationBundleVersionKey): (WKPluginInformationBundleShortVersionKey): (WKPluginInformationPathKey): (WKPluginInformationDisplayNameKey): (WKPluginInformationDefaultLoadPolicyKey): (WKPluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey): (WKPluginInformationHasSandboxProfileKey): (WKPluginInformationFrameURLKey): (WKPluginInformationMIMETypeKey): (WKPluginInformationPageURLKey): (WKPluginInformationPluginspageAttributeURLKey): (WKPluginInformationPluginURLKey): (WKPlugInInformationReplacementObscuredKey): * Shared/Plugins/NPIdentifierData.cpp: Removed. * Shared/Plugins/NPIdentifierData.h: Removed. * Shared/Plugins/NPObjectMessageReceiver.cpp: Removed. * Shared/Plugins/NPObjectMessageReceiver.h: Removed. * Shared/Plugins/NPObjectMessageReceiver.messages.in: Removed. * Shared/Plugins/NPObjectProxy.cpp: Removed. * Shared/Plugins/NPObjectProxy.h: Removed. * Shared/Plugins/NPRemoteObjectMap.cpp: Removed. * Shared/Plugins/NPRemoteObjectMap.h: Removed. * Shared/Plugins/NPVariantData.cpp: Removed. * Shared/Plugins/NPVariantData.h: Removed. * Shared/Plugins/Netscape/NetscapePluginModule.cpp: Removed. * Shared/Plugins/Netscape/NetscapePluginModule.h: Removed. * Shared/Plugins/Netscape/PluginInformation.cpp: Removed. * Shared/Plugins/Netscape/PluginInformation.h: Removed. * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: Removed. * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: Removed. * Shared/Plugins/PluginModuleInfo.h: Removed. * Shared/Plugins/PluginProcessAttributes.h: Removed. * Shared/Plugins/PluginProcessCreationParameters.cpp: Removed. * Shared/Plugins/PluginProcessCreationParameters.h: Removed. * Shared/Plugins/PluginQuirks.h: Removed. * Shared/Plugins/mac/PluginComplexTextInputState.h: Removed. * Shared/Plugins/mac/PluginSandboxProfile.h: Removed. * Shared/Plugins/mac/PluginSandboxProfile.mm: Removed. * Shared/WebProcessCreationParameters.h: * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::encode const): (WebKit::WebsiteData::decode): (WebKit::WebsiteData::ownerProcess): (WebKit::WebsiteData::isolatedCopy const): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/APILoaderClient.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::contentRuleListNotification): (API::NavigationClient::didFailToInitializePlugIn): Deleted. (API::NavigationClient::didBlockInsecurePluginVersion): Deleted. (API::NavigationClient::decidePolicyForPluginLoad): Deleted. * UIProcess/API/APIUIClient.h: (API::UIClient::mouseDidMoveOverElement): (API::UIClient::unavailablePluginButtonClicked): Deleted. * UIProcess/API/C/WKAPICast.h: (WebKit::toWKPluginLoadPolicy): Deleted. (WebKit::toWKPluginLoadClientPolicy): Deleted. (WebKit::toPluginModuleLoadPolicy): Deleted. (WebKit::toPluginLoadClientPolicy): Deleted. * UIProcess/API/C/WKContext.cpp: (WKContextSetAdditionalPluginsDirectory): (WKContextRefreshPlugIns): (WKContextAddSupportedPlugin): (WKContextClearSupportedPlugins): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPluginSandboxProfilesEnabledForAllPlugins): * UIProcess/API/C/mac/WKContextPrivateMac.mm: (WKContextCopyPlugInInfoForBundleIdentifier): (WKContextGetInfoForInstalledPlugIns): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setExperimentalPlugInSandboxProfilesEnabled:]): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _pluginProcessCount]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::getLaunchOptions): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::toWKPlugInUnavailabilityReason): Deleted. (WebKit::UIDelegate::UIClient::unavailablePluginButtonClicked): Deleted. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::updateProcessSuppressionState): * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::pluginComplexTextInputState const): Deleted. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::disableComplexTextInputIfNecessary): (WebKit::WebViewImpl::handlePluginComplexTextInputKeyDown): (WebKit::WebViewImpl::tryHandlePluginComplexTextInputKeyDown): (WebKit::WebViewImpl::tryPostProcessPluginComplexTextInputKeyDown): (WebKit::WebViewImpl::setPluginComplexTextInputState): Deleted. (WebKit::WebViewImpl::setPluginComplexTextInputStateAndIdentifier): Deleted. * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * UIProcess/PageClient.h: * UIProcess/Plugins/PluginInfoStore.cpp: Removed. * UIProcess/Plugins/PluginInfoStore.h: Removed. * UIProcess/Plugins/PluginProcessManager.cpp: Removed. * UIProcess/Plugins/PluginProcessManager.h: Removed. * UIProcess/Plugins/PluginProcessProxy.cpp: Removed. * UIProcess/Plugins/PluginProcessProxy.h: Removed. * UIProcess/Plugins/PluginProcessProxy.messages.in: Removed. * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: Removed. * UIProcess/Plugins/mac/PluginProcessManagerMac.mm: Removed. * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: Removed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::canShowMIMEType): (WebKit::WebPageProxy::findPlugin): Deleted. (WebKit::WebPageProxy::unavailablePluginButtonClicked): Deleted. (WebKit::WebPageProxy::didFailToInitializePlugin): Deleted. (WebKit::WebPageProxy::didBlockInsecurePluginVersion): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::sendMemoryPressureEvent): (WebKit::WebProcessPool::addSupportedPlugin): (WebKit::WebProcessPool::clearSupportedPlugins): (WebKit::WebProcessPool::setAdditionalPluginsDirectory): Deleted. (WebKit::WebProcessPool::refreshPlugins): Deleted. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getPlugins): Deleted. (WebKit::WebProcessProxy::getPluginProcessConnection): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain): (WebKit::WebsiteDataRecord::isolatedCopy const): (WebKit::WebsiteDataRecord::addPluginDataHostName): Deleted. * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::plugins const): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::setPluginComplexTextInputState): Deleted. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::setPluginComplexTextInputState): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setPluginComplexTextInputState): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Plugins/Netscape/JSNPMethod.cpp: Removed. * WebProcess/Plugins/Netscape/JSNPMethod.h: Removed. * WebProcess/Plugins/Netscape/JSNPObject.cpp: Removed. * WebProcess/Plugins/Netscape/JSNPObject.h: Removed. * WebProcess/Plugins/Netscape/NPJSObject.cpp: Removed. * WebProcess/Plugins/Netscape/NPJSObject.h: Removed. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: Removed. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: Removed. * WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp: Removed. * WebProcess/Plugins/Netscape/NPRuntimeUtilities.h: Removed. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: Removed. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h: Removed. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: Removed. * WebProcess/Plugins/Netscape/NetscapePlugin.h: Removed. * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: Removed. * WebProcess/Plugins/Netscape/NetscapePluginStream.h: Removed. * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: Removed. * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: Removed. * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginProcessConnection.cpp: Removed. * WebProcess/Plugins/PluginProcessConnection.h: Removed. * WebProcess/Plugins/PluginProcessConnection.messages.in: Removed. * WebProcess/Plugins/PluginProcessConnectionManager.cpp: Removed. * WebProcess/Plugins/PluginProcessConnectionManager.h: Removed. * WebProcess/Plugins/PluginProcessConnectionManager.messages.in: Removed. * WebProcess/Plugins/PluginProxy.cpp: Removed. * WebProcess/Plugins/PluginProxy.h: Removed. * WebProcess/Plugins/PluginProxy.messages.in: Removed. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::didFinishLoading): (WebKit::PluginView::destroyPluginAndReset): (WebKit::PluginView::didFailToInitializePlugin): (WebKit::PluginView::scriptObject): (WebKit::PluginView::pageMutedStateDidChange): (WebKit::PluginView::windowScriptNPObject): Deleted. (WebKit::PluginView::pluginElementNPObject): Deleted. (WebKit::PluginView::evaluate): Deleted. (WebKit::PluginView::setPluginIsPlayingAudio): Deleted. (WebKit::PluginView::isMuted const): Deleted. (WebKit::PluginView::setComplexTextInputState): Deleted. * WebProcess/Plugins/PluginView.h: * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::refreshPlugins): (WebKit::WebPluginInfoProvider::pluginInfo): (WebKit::WebPluginInfoProvider::populatePluginCache): Deleted. * WebProcess/Plugins/WebPluginInfoProvider.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::unavailablePluginButtonClicked const): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): (WebKit::WebPage::canPluginHandleResponse): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::initializeConnection): (WebKit::WebProcess::refreshPlugins): (WebKit::WebProcess::pluginProcessConnectionManager): Deleted. * WebProcess/WebProcess.h: 2021-10-29 Yusuke Suzuki Unreviewed, revert r284440, r284397, r284359 * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2021-10-29 Sihui Liu Release FileSystemStorageHandle when it is not in use https://bugs.webkit.org/show_bug.cgi?id=232363 Reviewed by Youenn Fablet. * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::FileSystemStorageHandle::close): * NetworkProcess/storage/FileSystemStorageHandle.h: * NetworkProcess/storage/FileSystemStorageManager.cpp: (WebKit::FileSystemStorageManager::closeHandle): (WebKit::FileSystemStorageManager::connectionClosed): * NetworkProcess/storage/FileSystemStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::closeHandle): * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.messages.in: * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp: (WebKit::WebFileSystemStorageConnection::closeHandle): * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h: 2021-10-29 Ayumi Kojima Unreviewed, reverting r285007. Reverting r285007 because it caused storage/filesystemaccess /sync-access-handle-basics-worker.html to constantly fail. Reverted changeset: "Release FileSystemStorageHandle when it is not in use" https://bugs.webkit.org/show_bug.cgi?id=232363 https://commits.webkit.org/r285007 2021-10-29 Takashi Komori WKAPI does not have any APIs to set cookie path to WKWebsiteDataStoreConfigurationRef https://bugs.webkit.org/show_bug.cgi?id=232336 Reviewed by Alex Christensen. Add cookie-path setting API for WKWebasiteDataStoreConfigurationRef. Test: CookieStorageFile.CustomPath * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: (WKWebsiteDataStoreConfigurationCopyCookieStorageFile): (WKWebsiteDataStoreConfigurationSetCookieStorageFile): * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp: (WebKit::WebsiteDataStore::platformSetNetworkParameters): 2021-10-28 Tim Horton Yahoo.com has fragments of wrongly-scaled content throughout when using CGDisplayListImageBufferBackend https://bugs.webkit.org/show_bug.cgi?id=232459 Reviewed by Dean Jackson. Similar to r284991, 2D transforms that getCTM() from a CGBitmap context and set the result on a CGDisplayList with setCTM() (via BifurcatedGraphicsContext) corrupt the display list's CTM, because it starts out in a different initial state, because the display list is always recorded with a 1x scale. To fix this, sneak the fake scale into setCTM/getCTM (multiplying it in in get, dividing it out in set) so that it appears to the outside as if it has the same base transform as the CGBitmap context. * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp: (WebKit::GraphicsContextCGDisplayList::GraphicsContextCGDisplayList): (WebKit::CGDisplayListImageBufferBackend::create): * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::display): 2021-10-28 Sihui Liu Release FileSystemStorageHandle when it is not in use https://bugs.webkit.org/show_bug.cgi?id=232363 Reviewed by Youenn Fablet. * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::FileSystemStorageHandle::close): * NetworkProcess/storage/FileSystemStorageHandle.h: * NetworkProcess/storage/FileSystemStorageManager.cpp: (WebKit::FileSystemStorageManager::closeHandle): (WebKit::FileSystemStorageManager::connectionClosed): * NetworkProcess/storage/FileSystemStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.cpp: (WebKit::NetworkStorageManager::closeHandle): * NetworkProcess/storage/NetworkStorageManager.h: * NetworkProcess/storage/NetworkStorageManager.messages.in: * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp: (WebKit::WebFileSystemStorageConnection::closeHandle): * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h: 2021-10-28 Alex Christensen Disable NETSCAPE_PLUGIN_API at build time on macOS and Windows https://bugs.webkit.org/show_bug.cgi?id=232396 Reviewed by Geoff Garen. * UIProcess/API/Cocoa/WKPreferences.mm: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _pluginProcessCount]): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: * WebProcess/Plugins/PDF/PDFPlugin.mm: 2021-10-28 Michael Catanzaro [WPE][GTK] Add warning comments regarding use of child setup functions https://bugs.webkit.org/show_bug.cgi?id=232444 Reviewed by Adrian Perez de Castro. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::XDGDBusProxyLauncher::launch): * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::ProcessLauncher::launchProcess): 2021-10-28 Adrian Perez de Castro [WPE][Qt] Do not use WebKit internals in the implementation https://bugs.webkit.org/show_bug.cgi?id=232228 Reviewed by Philippe Normand. Remove usage of GRefPtr, GUniquePtr, WTF macros, and usage of the config.h header from the WPE Qt API implementation, as all the funcionality can be achieved on top of the public API. This allows building the Qt plug-in in a standalone fashion, without involving any of the WebKit machinery, and a sample CMakeLists.txt which does that is provided as well. Distributors may prefer to build using this approach instead of as part of the whole WebKit compilation process, specially if when providing split packages on top of their base WPE WebKit ones. No new tests needed. * UIProcess/API/wpe/qt/CMakeLists.txt: Added. * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: * UIProcess/API/wpe/qt/WPEQtView.cpp: (WPEQtView::createWebView): (jsAsyncReadyCallback): * UIProcess/API/wpe/qt/WPEQtView.h: * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: (WPEQtViewBackend::displayImage): * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: 2021-10-28 Wenson Hsieh Add WebPageProxy identifiers to `ViewGestures` category logging https://bugs.webkit.org/show_bug.cgi?id=232437 Reviewed by Tim Horton. Make it easier to correlate release logging from "ViewGestures" and "ViewState" categories in WebKit2 by having "ViewGestures" logging include "pageProxyID=...", instead of just the content view pointer. This makes it more straightforward to (for instance) detect when the user is trying to interact with a page that has stopped receiving layer tree commits in the UI process for an extended period of time. Note that in all of the below codepaths, we either already call into `_page`, or they're called as a result of gesture recognizer delegate methods that should never be invoked by WebKit clients prior to common initialization (where we initialize `_page`), so null checks for `_page` are unnecessary here. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _didRelaunchProcess]): Also log the web process pid here, to make it easier to correlate logging in WKWebView with logs from the corresponding web process. * UIProcess/ios/WKContentViewInteraction.h: Drive-by fix: also rename `m_commitPotentialTapPointerId` to `_commitPotentialTapPointerId`, so that it is consistent with the other Objective-C ivar names. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:nodeIsRootLevel:]): (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]): (-[WKContentView _singleTapIdentified:]): (-[WKContentView _singleTapDidReset:]): (-[WKContentView _doubleTapDidFail:]): (-[WKContentView _commitPotentialTapFailed]): (-[WKContentView _didCompleteSyntheticClick]): (-[WKContentView _singleTapRecognized:]): (-[WKContentView _doubleTapRecognized:]): 2021-10-28 Tim Horton Unreviewed build fix. * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm: 2021-10-28 Tim Horton DOM GPUP: Yahoo.com has fragments of wrongly-scaled content throughout https://bugs.webkit.org/show_bug.cgi?id=232356 Reviewed by Simon Fraser. * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.cpp: (WebKit::ImageBufferShareableIOSurfaceBackend::backendSize const): Implement backendSize() so that ImageBufferShareableIOSurfaceBackend doesn't always report itself as being 0x0. * WebProcess/GPU/graphics/cocoa/ImageBufferShareableIOSurfaceBackend.h: 2021-10-28 Daniel Kolesa Non-unified build fixes https://bugs.webkit.org/show_bug.cgi?id=232318 Reviewed by Don Olmstead. * UIProcess/API/APIWebAuthenticationAssertionResponse.cpp: * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h: 2021-10-28 Adrian Perez de Castro [WPE][Qt] String memory leak in WPEQtView.cpp https://bugs.webkit.org/show_bug.cgi?id=232435 Reviewed by Michael Catanzaro. No new tests needed. * UIProcess/API/wpe/qt/WPEQtView.cpp: (jsAsyncReadyCallback): Remove unneeded usage of g_strdup(), and replace direct usage of the QString constructor with QString::fromUtf8(), which better indicates that the call will copy the string contents. 2021-10-28 Youenn Fablet [ Mac wk1 ] 2 media-capabilities/webrtc tests are flaky failures https://bugs.webkit.org/show_bug.cgi?id=232283 Reviewed by Eric Carlson. * WebProcess/WebPage/WebPage.cpp: 2021-10-28 Youenn Fablet Fetch API: Network process leaks when blobs are unused https://bugs.webkit.org/show_bug.cgi?id=232371 Reviewed by Geoffrey Garen. Make sure to unregister blobs created by a WebProcess in case WebProcess terminates. * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: 2021-10-27 David Kilzer [WebKit] Enable -Wformat=2 warnings Reviewed by Darin Adler. With one exception noted below, this patch changes calls from WEB_UI_STRING() to WEB_UI_NSSTRING(), which includes the proper compiler attribute to be used with +[NSString stringWithFormat:]. This fixes the -Wformat-nonliteral warnings that occurred after adding -Wformat=2. * Configurations/Base.xcconfig: (WARNING_CFLAGS): - Add -Wformat=2 switch, which includes -Wformat-nonliteral. * GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm: (WebKit::GPUConnectionToWebProcess::setCaptureAttributionString): * GPUProcess/mac/GPUProcessMac.mm: (WebKit::GPUProcess::initializeProcessName): * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::initializeProcessName): * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeProcessName): * UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm: (WebKit::WebInspectorUIProxy::updateInspectorWindowTitle const): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::experimentalFeatureEnabled): - Change `format` to be a constant NSString pointer to fix the -Wformat-nonliteral warnings. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant _appendAppLinkOpenActionsForURL:actions:elementInfo:]): * UIProcess/ios/WKPDFPageNumberIndicator.mm: (-[WKPDFPageNumberIndicator _updateLabel]): * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: (-[WKFullScreenViewController _showPhishingAlert]): * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: (-[WKDataListSuggestionsController showSuggestionsDropdown:]): * WebAuthnProcess/mac/WebAuthnProcessMac.mm: (WebKit::WebAuthnProcess::initializeProcessName): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): 2021-10-27 Aditya Keerthi REGRESSION (iOS 15): Touch events are not fired during quick successive taps https://bugs.webkit.org/show_bug.cgi?id=232324 rdar://83455472 Reviewed by Wenson Hsieh. To support Live Text on iOS 15, two new gesture recognizers were added to `WKContentView`. When the gesture recognizers were added, `-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]` was not updated, resulting in a failure dependency between the new gesture recognizers and the touchstart deferring gesture recognizer for "immediately resettable" gestures. The failure dependency causes the entire "immediately resettable" subgraph (which contains UIWebTouchEventsGestureRecognizer) to have a delayed reset, as the new gestures recognizers are connected to the "delayed resettable" subgraph by way of UIKit's exclusion gestures that control context menu presentation. The delayed reset prevents successive touches from being recognized, and touch events are only recognized after the delay has passed. Consequently, quick successive taps result in some touch events being dropped. To fix, remove the existing failure dependency and instead add an explicit failure dependency to the "delayed resettable" subgraph. This ensures the immediately resettable subgraph can reset as intended. No new tests, as the issue has been difficult to reproduce in WebKitTestRunner, even though it reproduces consistently in Safari. Filed webkit.org/b/232326 as a follow-up to investigate a testing strategy. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): 2021-10-27 Martin Robinson Eliminate duplicated platform-specific code in ScrollingTreeStickyNode https://bugs.webkit.org/show_bug.cgi?id=231571 Reviewed by Simon Fraser. Abstract code from the Nicosia and Cooca version of ScrollingTreeStickyNode, so that it can be shared by both ports. * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createScrollingTreeNode): * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: 2021-10-26 Alex Christensen Remove properties set by NSURLProtocol on NSURLRequest before serializing https://bugs.webkit.org/show_bug.cgi?id=232332 Reviewed by Geoff Garen. NSURLRequest encodeWithCoder: encodes the protocol properties, which are not used by WebKit. They exist to be used by NSURLProtocol. Serializing them can serialize a large amount of data, so to be more efficient and hopefully run out of memory less, remove the properties before serializing. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encodePlatformData): 2021-10-26 Kate Cheney NetworkProcess::updateBundleIdentifier, a testing function, overrides the actual bundleID instead of the override value https://bugs.webkit.org/show_bug.cgi?id=232327 Reviewed by John Wilander. No new tests, behavior confirmed by existing App Bound Domains tests. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateBundleIdentifier): We should only ever set the override bundleID for testing purposes. 2021-10-26 Brent Fulgham [AppSSO] Avoid attempting to display a nil view controller https://bugs.webkit.org/show_bug.cgi?id=232311 Reviewed by Kate Cheney. Avoid attempting to present a nil NSViewController. Instead, just treat the interaction as if the authentication was cancelled. * UIProcess/Cocoa/SOAuthorization/WKSOAuthorizationDelegate.mm: (-[WKSOAuthorizationDelegate authorization:presentViewController:withCompletion:]): 2021-10-26 Wenson Hsieh REGRESSION (r281054): [iOS] Context menu presents from wrong location when long pressing a link in Mail https://bugs.webkit.org/show_bug.cgi?id=232287 rdar://82671325 Reviewed by Tim Horton. In the case where the WebKit client isn't overriding the context menu configuration via WebKit context menu UI delegate methods, `_contextMenuElementInfo` on WKContentView will end up being nil while presenting the context menu via long press. After the changes in r281054, this means that when the last view is removed from our WKTargetedPreviewContainer, we'll unparent WKTargetedPreviewContainer too early, since `_contextMenuElementInfo` won't prevent us from bailing in `-_removeContextMenuHintContainerIfPossible`. To fix this, we add a boolean flag to track when the context menu presentation animation is running, and avoid unparenting the preview container if the flag is set. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setUpInteraction]): (-[WKContentView _removeContextMenuHintContainerIfPossible]): (-[WKContentView _contentsOfUserInterfaceItem:]): (-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]): To test this change, add an assertion that fires if the context menu preview hint container has already been unparented by the time we've presented the context menu. This assertion already fires during the extant layout test fast/events/touch/ios/long-press-on-link.html, which technically exhibits the bug (albeit in a more subtle way). (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]): 2021-10-26 Brady Eidson Add helper classes and messaging infrastructure to launch webpushd and round trip a message to it https://bugs.webkit.org/show_bug.cgi?id=232262 Reviewed by Alex Christensen. No new tests (No behavior change yet) This patch: - Adds classes representing the WebPushDaemon and connections to it - Adds classes/constants/macros related to messaging that daemon - Adds SPI for configuring a connect to that daemon - Gets MiniBrowser closer to supporting built-in notifications - Has way more commented out code than usual for a patch, but that enables a great stopping-point milestone * NetworkProcess/Notifications/Cocoa/WebPushDaemonConnectionCocoa.mm: Added. (WebKit::WebPushD::addVersionAndEncodedMessageToDictionary): (WebKit::WebPushD::Connection::newConnectionWasInitialized const): (WebKit::WebPushD::Connection::connectionReceivedEvent const): (WebKit::WebPushD::Connection::dictionaryFromMessage const): * NetworkProcess/Notifications/NetworkNotificationManager.cpp: (WebKit::NetworkNotificationManager::NetworkNotificationManager): (WebKit::NetworkNotificationManager::showNotification): (WebKit::NetworkNotificationManager::cancelNotification): (WebKit::NetworkNotificationManager::clearNotifications): (WebKit::NetworkNotificationManager::didDestroyNotification): (WebKit::NetworkNotificationManager::sendMessage const): (WebKit::ReplyCaller<>::callReply): (WebKit::ReplyCaller::callReply): (WebKit::NetworkNotificationManager::sendMessageWithReply const): * NetworkProcess/Notifications/NetworkNotificationManager.h: (WebKit::NetworkNotificationManager::networkSession const): * NetworkProcess/Notifications/WebPushDaemonConnection.cpp: Copied from Source/WebKit/Platform/IPC/DaemonConnection.cpp. (WebKit::WebPushD::Connection::Connection): (WebKit::WebPushD::Connection::networkSession const): * NetworkProcess/Notifications/WebPushDaemonConnection.h: Copied from Source/WebKit/NetworkProcess/Notifications/NetworkNotificationManager.h. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Platform/IPC/DaemonConnection.cpp: * Platform/IPC/DaemonConnection.h: (WebKit::Daemon::ConnectionToMachService::machServiceName const): * Platform/IPC/cocoa/DaemonConnectionCocoa.mm: * Platform/Logging.h: * Shared/WebPushDaemonConstants.h: Copied from Source/WebKit/Platform/IPC/DaemonConnection.cpp. (WebKit::WebPushD::messageTypeSendsReply): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): * webpushd/WebPushDaemon.h: Copied from Source/WebKit/NetworkProcess/Notifications/NetworkNotificationManager.h. * webpushd/WebPushDaemon.mm: Copied from Source/WebKit/webpushd/WebPushDaemonMain.mm. (WebPushD::MessageInfo::echoTwice::encodeReply): (WebPushD::handleWebPushDMessageWithReply): (WebPushD::Daemon::singleton): (WebPushD::Daemon::connectionEventHandler): (WebPushD::Daemon::connectionAdded): (WebPushD::Daemon::connectionRemoved): (WebPushD::CompletionHandler [ App Privacy Report ] Restoring a session after clearing the cache results in app initiated loads in Safari https://bugs.webkit.org/show_bug.cgi?id=232292 Reviewed by Brent Fulgham. Update session restore code to also set the app initiated value on the current document loader. Previously, this was only set on the new document loader. This is a problem because the main resource load uses the old document loader, so if we restore from a previous session state, the main resource load will have the incorrect attribution value. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::goToBackForwardItem): 2021-10-26 Chris Dumez Improve didFailProvisionalLoadForFrame logging to indicate if it is for the main frame https://bugs.webkit.org/show_bug.cgi?id=232273 Reviewed by Darin Adler. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): 2021-10-26 Per Arne [iOS][WP] Reduce sandbox telemetry https://bugs.webkit.org/show_bug.cgi?id=232279 Reviewed by Brent Fulgham. Reduce sandbox telemetry for rules we already have collected information for. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-10-26 Youenn Fablet Only one AudioSampleDataSource::pullSamples is needed https://bugs.webkit.org/show_bug.cgi?id=232145 Reviewed by Eric Carlson. * WebProcess/GPU/webrtc/AudioMediaStreamTrackRendererInternalUnitManager.cpp: 2021-10-26 Adrian Perez de Castro Multiple build issues with ENABLE_VIDEO=OFF https://bugs.webkit.org/show_bug.cgi?id=232264 Reviewed by Carlos Garcia Campos. * WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp: (WebKit::createShareableBitmap): Guard usage of RenderVideo with ENABLE(VIDEO). 2021-10-25 John Wilander Remove assert failure expectations after r284846 landed https://bugs.webkit.org/show_bug.cgi?id=232048 https://bugs.webkit.org/show_bug.cgi?id=232102 https://bugs.webkit.org/show_bug.cgi?id=231255 https://bugs.webkit.org/show_bug.cgi?id=231431 Unreviewed test gardening. Depends on this fix: https://trac.webkit.org/changeset/284846/webkit * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setPrivateClickMeasurementAppBundleIDForTesting): Removed comment with Bugzilla reference. I decided to keep the logging since it was so useful in finding the root cause of the assertion crashes. Logging is only triggered when we will fail the assertion. 2021-10-25 Wenson Hsieh Rename a few variable and parameter names in WKContentViewInteraction.mm https://bugs.webkit.org/show_bug.cgi?id=232275 Reviewed by Tim Horton. The `ProceedWithTextSelectionInImage` enum flag was being stored in a variable named `ProceedWithTextSelectionInImage` in a few places, likely due to mass renaming when upstreaming WebKit support for Live Text. Rename this so that we use lowercase for these variable names. No change in behavior. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView _doAfterPendingImageAnalysis:]): (-[WKContentView _invokeAllActionsToPerformAfterPendingImageAnalysis:]): (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]): 2021-10-25 Alex Christensen Use xpc_connection_copy_invalidation_reason where available for debugging daemon connection failures https://bugs.webkit.org/show_bug.cgi?id=232152 Reviewed by Brady Eidson. * Platform/IPC/cocoa/DaemonConnectionCocoa.mm: (WebKit::Daemon::ConnectionToMachService::initializeConnectionIfNeeded const): * Shared/Daemon/DaemonUtilities.mm: (WebKit::startListeningForMachServiceConnections): 2021-10-25 Kate Cheney [App Privacy Report] CORS preflight requests attributed incorrectly https://bugs.webkit.org/show_bug.cgi?id=232221 Reviewed by Brent Fulgham. HTTP redirects should already be marked as app-initiated or not based on the NSURLRequest that initiated the redirect, either because the same NSURLRequest is used or because it is set in the completion handler of the networkDataTask->willPerformHTTPRedirection call in NetworkSessionCocoa. However, checking the request before calling the completion handler can initiate CORS preflight checks that create loads that are incorrectly marked for App Privacy Report. This patch sets the app initiated value in the ResourceRequest object before the new NetworkDataTask is created to fix this. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): 2021-10-25 Wenson Hsieh REGRESSION (r284079): Audio continues playing on hulu.com in private browsing mode after closing the tab https://bugs.webkit.org/show_bug.cgi?id=232113 rdar://84399283 Reviewed by Chris Dumez. I inadvertently introduced a ref-counting cycle between RemoteRenderingBackend and RemoteDisplayListRecorder after IPC stream refactoring in r284079, since RemoteDisplayListRecorder directly strongly refs the rendering backend, and the rendering backend indirectly holds on to RemoteDisplayListRecorders through remote image buffers in the resource cache. Since RemoteRenderingBackend also strongly refs GPUConnectionToWebProcess as well, this caused the entire GPUConnectionToWebProcess to leak after tearing down the connected web process, if the web process ever installed a remote rendering backend for 2D canvas. To avoid this cycle, turn RemoteDisplayListRecorder's `m_renderingBackend` into a RefPtr instead of a Ref, and clear it out in `stopListeningForIPC()`. This also means that we no longer need a separate boolean flag to ensure that `RemoteDisplayListRecorder::stopListeningForIPC()` is idempotent, so we also remove `m_isListeningForIPC` altogether. Test: GPUProcess.DoNotLeakConnectionAfterClosingWebPage * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::~GPUConnectionToWebProcess): * GPUProcess/GPUConnectionToWebProcess.h: (WebKit::GPUConnectionToWebProcess::objectCountForTesting): * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::webProcessConnectionCountForTesting): Add support for a testing-only SPI hook to ask for the live GPUConnectionToWebProcess count. This retrieves a statically incremented/decremented count of the GPUConnectionToWebProcess instances that exist in the GPU process; importantly, this is different from asking the GPUProcess for the number of connections in `m_webProcessConnections`, since the latter will be 0 even when one or more GPUConnectionToWebProcesses are still alive. * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::RemoteDisplayListRecorder): Also fix a leak caused by RemoteDisplayListRecorder and RemoteImageBuffer strongly reffing each other. Since RemoteImageBuffer owns RemoteDisplayListRecorder, the backpointer from RemoteDisplayListRecorder to the image buffer should be weak, not strong. (WebKit::RemoteDisplayListRecorder::startListeningForIPC): (WebKit::RemoteDisplayListRecorder::stopListeningForIPC): (WebKit::RemoteDisplayListRecorder::paintFrameForMedia): * GPUProcess/graphics/RemoteDisplayListRecorder.h: (): Deleted. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::stopListeningForIPC): Adjust this logic to ensure that we finish pending work and destroy cached resources *right before* we stop listening for all stream IPC messages. Since RemoteDisplayListRecorder now clears out its pointer to the rendering backend in `stopListeningForIPC()`, we'll need to ensure that any pending IPC stream messages that might cause RemoteDisplayListRecorder to call into the back end are processed before we sever the IPC stream connection for good by removing all receivers. * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: Add the new testing SPI (see above for more details). * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _gpuToWebProcessConnectionCountForTesting:]): * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::webProcessConnectionCountForTesting): * UIProcess/GPU/GPUProcessProxy.h: 2021-10-25 Sam Sneddon [Python] rename assertEquals/assertNotEquals https://bugs.webkit.org/show_bug.cgi?id=232214 Reviewed by Alexey Proskuryakov. This is assert(Not)?Equals -> assert(\1)Equal Python 3.11 (currently CPython main branch) removes the deprecated aliases assertEquals/assertNotEquals. These have long been deprecated, and the modern names exist all the way back to Python 2.7, hence there's no reason not to switch. * Scripts/webkit/messages_unittest.py: (GeneratedFileContentsTest.assertGeneratedFileContentsEqual): * Scripts/webkit/model_unittest.py: * Scripts/webkit/parser_unittest.py: (ParsingTest.check_message): (ParsingTest.test_receiver): 2021-10-24 Wenson Hsieh RemoteRenderingBackend should not send IPC in the middle of destruction https://bugs.webkit.org/show_bug.cgi?id=232179 Reviewed by Darin Adler. Make a couple of minor adjustments to RemoteRenderingBackend (see below for more details). This is necessary in order to avoid flaky crashes after fixing bug #232113, after which the RemoteRenderingBackend will no longer be leaked in the GPU process. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::startListeningForIPC): (WebKit::RemoteRenderingBackend::stopListeningForIPC): (WebKit::RemoteRenderingBackend::didCreateImageBufferBackend): (WebKit::RemoteRenderingBackend::releaseRemoteResourceWithQualifiedIdentifier): (WebKit::RemoteRenderingBackend::~RemoteRenderingBackend): Deleted. Move logic to flush remaining incoming IPC messages in the GPU process out of the destructor, and into `stopListeningForIPC()` instead. This is because the act of processing certain stream IPC messages (such as CreateImageBuffer or FlushContext) may cause RemoteRenderingBackend to try and send IPC back to the web process. However, if RemoteRenderingBackend is in the middle of destruction, it will crash when attempting to do so (when attempting to call into IPC::MessageSender). To avoid this, we need to do this work earlier, after we've already stopped listening for further IPC messages. * GPUProcess/graphics/RemoteRenderingBackend.h: Turn `m_remoteDisplayLists` into a regular hash map containing RemoteDisplayListRecorders by their process- qualified rendering resource identifiers. Since this map may be modified from different threads, we (1) don't want to be using weak pointers here, and (2) need to ensure that access to this table is guarded behind a lock. To avoid reference cycles, entries in this table are cleared out when the remote image buffer corresponding to each RemoteDisplayListRecorder is released in the GPU process. 2021-10-24 Wenson Hsieh REGRESSION (iOS 15): Safari shows zoom callout even if -webkit-user-select is none https://bugs.webkit.org/show_bug.cgi?id=231161 rdar://83863266 Reviewed by Darin Adler. Make several minor tweaks to prevent the text interaction assistant's loupe gesture from beginning when long pressing inside content with `-webkit-user-select: none;`. Importantly, this prevents both the text interaction's haptic feedback and the text selection magnifier UI (introduced in iOS 15) from showing up. See comments below for more details. Test: editing/selection/ios/do-not-allow-text-selection-in-user-select-none.html * Shared/ios/InteractionInformationAtPosition.h: (WebKit::InteractionInformationAtPosition::isSelectable const): Add a helper method to return whether the `selectability` flag is equal to `Selectable`, and use this in places where we current check the `isSelectable` flag. * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Break the current `isSelectable` flag out into different enum types, which enumerate the reasons why we might need to treat hit-tested content as non-user-selectable. Importantly, this allows us to only early return inside `-textInteractionGesture:shouldBeginAtPoint:` below if the element has an explicit `-webkit-user-select: none;`, and not because of the other reasons (i.e. large element bounds or the fact that we're long pressing editable text while not editing). This nuance is important in order to continue allowing the loupe gesture (which manifests as a floating caret) to begin when long pressing inside a focused a text field. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): Return NO here in the case where we're recognizing a loupe gesture (i.e. long press) inside content with `-webkit-user-select: none;` (by consulting the new `selectability` enumeration). This allows us to prevent both haptic feedback as well as the new magnifier UI from triggering when long pressing inside content that has explicitly disabled text selection. (-[WKContentView closestPositionToPoint:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionPositionInformation): (WebKit::WebPage::positionInformation): Additionally populate the `selectability` flag even when long pressing inside images and links. Instead of putting the call to `selectionPositionInformation` behind the `isLink`/`isImage` check, move that condition into `selectionPositionInformation` in the form of an early return, and always populate `selectability` in either case. 2021-10-24 Darin Adler [Cocoa] Adopt bridge_cast and makeVector in a few more places, including cases where adoptCF/NS was used incorrectly https://bugs.webkit.org/show_bug.cgi?id=232200 Reviewed by Anders Carlsson. * Shared/Cocoa/ArgumentCodersCocoa.mm: (-[WKSecureCodingURLWrapper encodeWithCoder:]): Use bridge_cast. (-[WKSecureCodingURLWrapper initWithCoder:]): Use bridge_cast after calling adoptCF rather than first doing a bridging cast and then doing adoptNS and relying on it correctly adopting a CF object. This fixes an ARC incompatibility. (IPC::encodeDataInternal): Use bridge_cast. (IPC::decodeDataInternal): Use bridge_cast/WTFMove instead of adoptNS/cast/leakRef. This fixes an ARC incompatibility (IPC::encodeDateInternal): Use bridge_cast. (IPC::decodeDateInternal): Use bridge_cast/WTFMove as above. (IPC::encodeNumberInternal): Use bridge_cast. (IPC::decodeNumberInternal): Use bridge_cast/WTFMove as above. (IPC::decodeSecureCodingInternal): Use bridge_cast. (IPC::encodeStringInternal): Use bridge_cast. (IPC::decodeStringInternal): Use bridge_cast/WTFMove as above. (IPC::encodeURLInternal): Use bridge_cast. (IPC::decodeURLInternal): Use bridge_cast/WTFMove as above. * UIProcess/API/Cocoa/WKConnection.mm: (didReceiveMessage): Use bridge_cast and remove unneeded use of RetainPtr/get on the body. * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::pluginPathsInDirectory): Use bridge_cast and makeVectort. 2021-10-23 Dean Jackson Disable PiP when HAVE(UIKIT_WEBKIT_INTERNALS) https://bugs.webkit.org/show_bug.cgi?id=232206 rdar://84516632 Reviewed by Tim Horton. In preparation for moving to AVPictureInPictureController, disable PiP when HAVE(UIKIT_WEBKIT_INTERNALS) is true so that we are no longer creating an AVPlayerViewController. The rationale for the move is to use API rather than SPI, and this will allow changes to be made to AVPlayerViewController in this special configuration. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreen const): Only support regular fullscreen, not PiP. (WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const): Don't support "video fullscreen standby", which is another name for PiP. 2021-10-23 Brandon Stewart WebContent crash when sending invalid IPC message using IPC testing API https://bugs.webkit.org/show_bug.cgi?id=232060 Reviewed by Wenson Hsieh. Do not trigger a crash in WebContent Process when sending an invalid IPC message using the IPC testing API. Test: ipc/send-invalid-message.html * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchSyncMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): 2021-10-22 Jean-Yves Avenard video appears blank with only audio playing if video element isn't appended to the dom tree https://bugs.webkit.org/show_bug.cgi?id=232124 rdar://83438282 Reviewed by Eric Carlson. Ensure that we inform the GPU process whenever MediaPlayer::renderingCanBeAccelerated value could have changed. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::readyStateChanged): (WebKit::MediaPlayerPrivateRemote::checkAcceleratedRenderingState): (WebKit::MediaPlayerPrivateRemote::updateConfiguration): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenLayer): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 2021-10-22 Chris Fleizach AX: Inform AX when the injected bundle sends a synchronous message https://bugs.webkit.org/show_bug.cgi?id=232159 Reviewed by Andres Gonzalez. When an injected bundle sends a synchronous message we need to inform accessibility clients, so they don't get stuck trying to message the WebContent process. This is already handled for synchronous messages generated from the WebPage. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::postSynchronousMessage): 2021-10-22 Alex Christensen Use C++17 nested namespace syntax for WebKit::PCM https://bugs.webkit.org/show_bug.cgi?id=232162 Reviewed by Yusuke Suzuki. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementClientImpl.cpp: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementConnection.cpp: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDaemonClient.cpp: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDaemonClient.h: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.h: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDebugInfo.cpp: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDebugInfo.h: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerInterface.cpp: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementManagerProxy.cpp: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementNetworkLoader.cpp: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementNetworkLoader.h: * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementStore.cpp: * NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementConnectionCocoa.mm: * NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementNetworkLoaderCocoa.mm: * NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementXPCUtilities.h: * NetworkProcess/PrivateClickMeasurement/cocoa/PrivateClickMeasurementXPCUtilities.mm: * Shared/EntryPointUtilities/Cocoa/Daemon/PCMDaemonConnectionSet.mm: 2021-10-22 Per Arne Vollan [iOS] Add required syscall https://bugs.webkit.org/show_bug.cgi?id=232153 Reviewed by Brent Fulgham. Add required syscall to WP sandbox on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: 2021-10-22 Takashi Komori WKErrorRef.h does't have some error definitions https://bugs.webkit.org/show_bug.cgi?id=232116 Reviewed by Alex Christensen. Add error definitions which exist in APIrror.h but do not exist in WKErrorRef.h kWKErrorCodeCancelled kWKErrorCodeFileDoesNotExist No test as this patch does not change code behavior. * Shared/API/c/WKErrorRef.cpp: (WKErrorGetErrorCode): * Shared/API/c/WKErrorRef.h: 2021-10-22 Wenson Hsieh RemoteRenderingBackend::CreateImageBuffer should be an async IPC stream message https://bugs.webkit.org/show_bug.cgi?id=231970 Reviewed by Kimmo Kinnunen. This patch reverts the changes in r284476, which worked around a race when adding receive queues for newly created IPC stream destinations and simultaneously dispatching IPC messages to those destinations. Rather than making the IPC message that creates and adds the new image buffer's RemoteDisplayListRecorder synchronous, we instead keep that message async and make adjustments to ensure that incoming out-of-stream IPC messages for RemoteDisplayListRecorder can always be mapped to an appropriate receive queue. See below for more details. * GPUProcess/graphics/RemoteDisplayListRecorder.cpp: (WebKit::RemoteDisplayListRecorder::startListeningForIPC): Move the main runloop bounce down to `StreamServerConnectionBase::startReceivingMessagesImpl()` instead (to deal with the fact that `addMessageReceiveQueue` currently needs to be invoked on the main runloop). This allows us to call `StreamServerConnection::startReceivingMessages()` from the processing queue while creating a remote image buffer, which (in turn) ensures that incoming out-of-stream messages from the IPC thread will be sent to the correct RemoteDisplayListRecorder destination by the time they're dispatched on the work queue thread. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::startListeningForIPC): (WebKit::RemoteRenderingBackend::stopListeningForIPC): Additionally register a "0-destination" receiver to ensure that all RemoteDisplayListRecorder messages (even without pre-existing destinations) will be enqueued on the same IPC stream connection as this remote rendering backend. (WebKit::RemoteRenderingBackend::createImageBuffer): * GPUProcess/graphics/RemoteRenderingBackend.h: * GPUProcess/graphics/RemoteRenderingBackend.messages.in: Make `CreateImageBuffer` an async stream message once again. * Platform/IPC/StreamConnectionWorkQueue.cpp: (IPC::StreamConnectionWorkQueue::processStreams): * Platform/IPC/StreamConnectionWorkQueue.h: Change `m_connections` into a HashCountedSet (from a HashSet), to ensure that the same server connection object can be added to and removed from the work queue multiple times, without removing the connection from the map early. * Platform/IPC/StreamServerConnection.cpp: (IPC::StreamServerConnectionBase::startReceivingMessagesImpl): (IPC::StreamServerConnectionBase::stopReceivingMessagesImpl): * Platform/IPC/StreamServerConnection.h: (IPC::StreamServerConnection::startReceivingMessages): (IPC::StreamServerConnection::stopReceivingMessages): Add new methods to start and stop receiving all messages for a given ReceiverName, regardless of incoming destination ID. RemoteRenderingBackend now uses this to register a "catch-all" listener for all RemoteDisplayListRecorder messages. * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer): 2021-10-22 Sihui Liu Followup to r284652: ensure file handle is closed in web process https://bugs.webkit.org/show_bug.cgi?id=232127 Reviewed by Youenn Fablet. * NetworkProcess/storage/FileSystemStorageHandle.cpp: (WebKit::FileSystemStorageHandle::~FileSystemStorageHandle): (WebKit::FileSystemStorageHandle::createSyncAccessHandle): (WebKit::FileSystemStorageHandle::close): * NetworkProcess/storage/FileSystemStorageHandle.h: * Platform/IPC/cocoa/SharedFileHandleCocoa.cpp: an extra fd is created here and does not get closed. (IPC::SharedFileHandle::decode): 2021-10-22 Youenn Fablet REGRESSION (Safari 15 - iOS15): [WebRTC] Increased audio latency while playing webrtc audio stream over audio element https://bugs.webkit.org/show_bug.cgi?id=230903 Reviewed by Eric Carlson. We used to render audio tracks in process and are now doing rendering in GPU process. Current implementation requests data with a fixed chunk size, that we were setting as the max of preferred buffer size and web audio chunk size. If we are reading too close to the end of data in AudioSampleDataSource, we will delay reading the data by this buffer size. This triggers delay but allows getting a consistent rendering. To reduce delay, we are now using the maximum of web audio chunk size and 10 ms chunk size, as WebRTC tracks are usually manipulating 10 ms chunks. Manually tested. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.cpp: 2021-10-22 Per Arne Vollan [macOS] Add needed syscall https://bugs.webkit.org/show_bug.cgi?id=232110 Reviewed by Brent Fulgham. Add required syscall in WP sandbox. * WebProcess/com.apple.WebProcess.sb.in: 2021-10-22 Kimmo Kinnunen StreamConnectionWorkQueue::processStreams() has a incorrect protection ref https://bugs.webkit.org/show_bug.cgi?id=232070 Reviewed by Wenson Hsieh. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::~RemoteRenderingBackend): Additionally remove redundant protection ref from `RemoteRenderingBackend` cleanup task. Since `m_workQueue->stop()` is run after dispatching the task, and since `stop()` waits until queue has executed the all the tasks, the `m_workQueue` ref outlives the protection ref. * Platform/IPC/StreamConnectionWorkQueue.cpp: (IPC::StreamConnectionWorkQueue::processStreams): Remove the redundant protection ref so it does not cause confusion. The protection ref cannot hold the last ref, as that would mean that the `StreamConnectionWorkQueue` thread would run the code to destroy the work queue itself. There has to be a external ref for `queue->stop()` that outlives the protection ref, as the `stop()` will wait until the queue thread stops. (IPC::StreamConnectionWorkQueue::stopAndWaitForCompletion): (IPC::StreamConnectionWorkQueue::stop): Deleted. * Platform/IPC/StreamConnectionWorkQueue.h: Rename `stop()` to `stopAndWaitForCompletion()` to signify what the function does. 2021-10-22 Alberto Garcia Unreviewed, fix typo in the WebKitWebInspector documentation. * UIProcess/API/gtk/WebKitWebInspector.cpp: 2021-10-22 Youenn Fablet Audio over peer connection becomes latent when changing the output https://bugs.webkit.org/show_bug.cgi?id=231110 Reviewed by Eric Carlson. When detecting an audio timeline change, send it from GPUProcess to WebProcess. Let the WebProcess reset the sources to properly restart. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererInternalUnitManager.cpp: * WebProcess/GPU/GPUProcessConnection.cpp: * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/GPUProcessConnection.messages.in: * WebProcess/GPU/webrtc/AudioMediaStreamTrackRendererInternalUnitManager.cpp: * WebProcess/GPU/webrtc/AudioMediaStreamTrackRendererInternalUnitManager.h: * WebProcess/WebProcess.cpp: * WebProcess/cocoa/UserMediaCaptureManager.cpp: 2021-10-22 Kimmo Kinnunen StreamConnectionWorkQueue is not thread-safe https://bugs.webkit.org/show_bug.cgi?id=232068 Reviewed by Wenson Hsieh. Make StreamConnectionWorkQueue thread-safe so that addStreamConnection works from multiple threads. In the future, this will be called when a new RemoteDisplayListRecorder is added during the StreamConnectionWorkQueue message processing invocation for RemoteRenderingBackend::createRemoteImageBuffer. * Platform/IPC/StreamConnectionWorkQueue.cpp: (IPC::StreamConnectionWorkQueue::~StreamConnectionWorkQueue): (IPC::StreamConnectionWorkQueue::dispatch): (IPC::StreamConnectionWorkQueue::addStreamConnection): (IPC::StreamConnectionWorkQueue::removeStreamConnection): Change semantics so that adding and removing connections during shutdown is ok. This is required for simpler code since during stop we must dispatch all pending messages, but during message code we might have unconditional start listening when the message creates a new RemoteDisplayListRecorder. As a consequence it's not an error to add a connection, stop and destroy the work queue without removing it. (IPC::StreamConnectionWorkQueue::stop): (IPC::StreamConnectionWorkQueue::startProcessingThread): (IPC::StreamConnectionWorkQueue::wakeUpProcessingThread): Deleted. * Platform/IPC/StreamConnectionWorkQueue.h: 2021-10-21 Alex Christensen Add webpushd plist https://bugs.webkit.org/show_bug.cgi?id=231981 Reviewed by Brady Eidson. This can be done once rdar://83086960 is approved. * WebKit.xcodeproj/project.pbxproj: * webpushd/com.apple.webkit.webpushd.plist: Added. 2021-10-21 Alex Christensen Unreviewed, reverting r284570. No longer needed Reverted changeset: "Remove com.apple.webkit.adattributiond.plist from build temporarily" https://bugs.webkit.org/show_bug.cgi?id=232045 https://commits.webkit.org/r284570 2021-10-21 Chris Dumez Call to [NSURL URLByAppendingPathComponent:] under NetworkSessionCocoa() may be inefficient https://bugs.webkit.org/show_bug.cgi?id=232098 Reviewed by Alex Christensen. Call [NSURL URLByAppendingPathComponent:isDirectory:] whenever possible instead of [NSURL URLByAppendingPathComponent], as it is more efficient. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/Cocoa/WKShareSheet.mm: (+[WKShareSheet createRandomSharingDirectoryForFile:]): (+[WKShareSheet writeFileToShareableURL:data:temporaryDirectory:]): 2021-10-21 John Wilander PCM: Add temporary logging when isRunningTest() assertion is about to fail to be able to investigate https://bugs.webkit.org/show_bug.cgi?id=232108 Unreviewed. Just adding logging for test-only functionality. This patch adds logging to when we are about to fail the assert of isRunningTest() in WebKit::NetworkSession::setPrivateClickMeasurementAppBundleIDForTesting)(). This is added to help investigate https://bugs.webkit.org/show_bug.cgi?id=232048. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setPrivateClickMeasurementAppBundleIDForTesting): 2021-10-21 Simon Fraser Rare crash under DisplayLink::displayLinkCallback() https://bugs.webkit.org/show_bug.cgi?id=232101 Reviewed by Tim Horton. The crash was a divide by zero under m_currentUpdate.nextUpdate(), indicating that m_currentUpdate.updatesPerSecond was zero. Previous assumptions that this was caused by weird display configs were wrong. The actual issue is a race condition where the callback can fire while we're still inside CVDisplayLinkStart(), or at least before we've updated m_currentUpdate. The fix is to initialize m_currentUpdate before we call CVDisplayLinkStart(). * UIProcess/mac/DisplayLink.cpp: (WebKit::DisplayLink::addObserver): 2021-10-21 Per Arne Vollan Launch Services database is not always sent to GPUP https://bugs.webkit.org/show_bug.cgi?id=232047 Unreviewed, address post commit review feedback. Address review feedback. Also rename a data member which had a misleading name. * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::didFinishLaunching): (WebKit::GPUProcessProxy::addSession): * UIProcess/GPU/GPUProcessProxy.h: 2021-10-19 Darin Adler [Cocoa] Merge and simplify the nsColor family of functions https://bugs.webkit.org/show_bug.cgi?id=231992 Reviewed by Anders Carlsson. * Shared/Cocoa/ArgumentCodersCocoa.mm: (IPC::encodeColorInternal): Merged the NSColor and UIColor implementations into a single one that uses CocoaColor. (IPC::decodeColorInternal): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView themeColor]): Use cocoaColorOrNil instead of isValid and platformColor. (-[WKWebView underPageBackgroundColor]): Use cocoaColor instead of platformColor. (-[WKWebView _pageExtendedBackgroundColor]): Use cocoaColorOrNil instead of isValid and platformColor. (-[WKWebView _sampledPageTopColor]): Ditto. * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (-[_WKApplicationManifest themeColor]): Use cocoaColor instead of platformColor. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _updateScrollViewBackground]): Use cocoaColor instead of -[UIColor initWithCGColor:] and cachedCGColor. * UIProcess/API/ios/WKWebViewTestingIOS.mm: (-[WKWebView _serializedSelectionCaretBackgroundColorForTesting]): Use colorFromCocoaColor instead of colorFromUIColor. * UIProcess/Cocoa/WebViewImpl.mm: (-[WKTextTouchBarItemController _wkChangeColor:]): Use cocoaColor instead of nsColor. (WebKit::WebViewImpl::updateTextTouchBar): Use colorFromCocoaColor instead of colorFromNSColor. (WebKit::WebViewImpl::setUnderlayColor): Use cocoaColorOrNil instead of isValid and nsColor. (WebKit::WebViewImpl::underlayColor const): Ditto. (WebKit::WebViewImpl::pageExtendedBackgroundColor const): Ditto. (WebKit::WebViewImpl::changeFontColorFromSender): Ditto. (WebKit::extractUnderlines): Use colorFromCocoaColor instead of colorFromNSColor. * UIProcess/ios/DragDropInteractionState.mm: (WebKit::DragDropInteractionState::deliverDelayedDropPreview): Use cocoaColor instead of +[UIColor colorWithCGColor:] and cachedCGColor. (WebKit::DragDropInteractionState::previewForDragItem const): Ditto. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Use cocoaColor instead of -[UIColor initWithCGColor:] and cachedCGColor. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateTapHighlight]): Use cocoaColor instead of -[UIColor initWithCGColor:] and cachedCGColor. (-[WKContentView _cascadeInteractionTintColor]): Use cocoaColor instead of +[UIColor colorWithCGColor:] and cachedCGColor. (compositionHighlights): Use colorFromCocoaColor instead of colorFromUIColor. (-[WKContentView _createTargetedContextMenuHintPreviewIfPossible]): Use cocoaColor instead of +[UIColor colorWithCGColor:] and cachedCGColor. * UIProcess/ios/forms/WKFormColorControl.mm: (-[WKColorPicker focusedElementSuggestedColors]): Use createNSArray and cocoaColor instead of +[NSMutableArray array], a for loop, -[NSMutableArray addObject:], +[UIColor colorWithCGColor:], and cachedCGColor (-[WKColorPicker updateColorPickerState]): Use cocoaColor instead of +[UIColor colorWithCGColor:] and cachedCGColor. * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::accentColor): Use cocoaColor instead of nsColor. * UIProcess/mac/WebColorPickerMac.mm: (WebKit::WebColorPickerMac::setSelectedColor): Use cocoaColor instead of nsColor. (WebKit::WebColorPickerMac::showColorPicker): Ditto. (-[WKColorPopoverMac setAndShowPicker:withColor:suggestions:]): Ditto. (-[WKColorPopoverMac didChooseColor:]): Ditto. * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Use colorFromCocoaColor instead of colorFromNSColor * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::createAnnotationElement): Ditto. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::setAccentColor): Use cocoaColorOrNil instead of isValid and nsColor. 2021-10-21 Devin Rousso [css-values-4] Support small (sv*), large (lv*) and dynamic (dv*) viewport units https://bugs.webkit.org/show_bug.cgi?id=219287 Reviewed by Simon Fraser. Spec: Tests: CSSViewportUnits.AllSame CSSViewportUnits.EmptyUnobscuredSizeOverrides CSSViewportUnits.SameUnobscuredSizeOverrides CSSViewportUnits.DifferentUnobscuredSizeOverrides * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _processWillSwapOrDidExit]): (-[WKWebView _dispatchSetMinimumUnobscuredSize:]): Added. (-[WKWebView _frameOrBoundsChanged]): (activeMinimumUnobscuredSize): Added. (-[WKWebView _didCompleteAnimatedResize]): (-[WKWebView _minimumUnobscuredSizeOverride]): Added. (-[WKWebView _setMinimumUnobscuredSizeOverride:]): Added. (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _clearOverrideLayoutParameters]): When this value is set from `-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]` it should be used as the value for "small viewport" `svw`/`svh`/`svmin`/`svmax`, but only from that codepath. Dynamic viewport changes should not update it as they don't necessarily represent a change in the minimum/maximum viewport size, just the current size. "large viewport" `lvw`/`lvh`/`lvmin`/`lvmax` and "dynamic viewport" `dvw`/`dvh`/`dvmin`/`dvmax` (as well as the existing "UA-default viewport" `vw`/`vh`/`vmin`/`vmax`) can be derived from existing logic. See the WebCore ChangeLog for more information. * Shared/WebPageCreationParameters.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setMinimumUnobscuredSize): Added. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::setViewportSizeForCSSViewportUnits): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setMinimumUnobscuredSize): Added. (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::updateViewportSizeForCSSViewportUnits): Add piping from the UIProcess to the WebProcess for the new minimum unobscured size override. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Drive-by: Rename `setViewportSizeForCSSViewportUnits` to `setSizeForCSSLargeViewportUnits` for clarity. 2021-10-21 Devin Rousso [iOS] Zooming out should use the page's background color instead of fading https://bugs.webkit.org/show_bug.cgi?id=232036 Reviewed by Tim Horton. * UIProcess/API/ios/WKWebViewIOS.mm: (scrollViewBackgroundColor): 2021-10-21 John Pascoe Followup: Fix crash when calling setUsernameForLocalCredentialWithID https://bugs.webkit.org/show_bug.cgi?id=232057 Reviewed by David Kilzer. Follow up to address David's comment. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (getAllLocalAuthenticatorCredentialsImpl): (+[_WKWebAuthenticationPanel deleteLocalAuthenticatorCredentialWithID:]): (+[_WKWebAuthenticationPanel setUsernameForLocalCredentialWithID:username:]): - Use 2021-10-21 Chris Dumez WebKit should process-swap for initial navigation of a popup if it has no opener https://bugs.webkit.org/show_bug.cgi?id=231990 Reviewed by Brent Fulgham. WebKit should process-swap for initial navigation of a popup if it has no opener, even if the navigation is same-site. Swapping process is not Web-observable here since there is no opener relationship. However, swapping processes has benefits here since we don't want to end up with too many tabs sharing the same process. This impacts Google Drive where double-clicking a document will open Google Docs in a new tab and in the same WebProcess as Google Drive. No new tests, updated existing API tests and this is not Web-observable. * Shared/FrameInfoData.cpp: (WebKit::FrameInfoData::encode const): (WebKit::FrameInfoData::decode): * Shared/FrameInfoData.h: * Shared/LoadParameters.cpp: (WebKit::LoadParameters::encode const): (WebKit::LoadParameters::decode): * Shared/LoadParameters.h: * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: * UIProcess/API/APINavigation.h: (API::Navigation::effectiveSandboxFlags const): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::cancel): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadSimulatedRequest): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): * UIProcess/WebProcessPool.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::info const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2021-10-21 Chris Lord [WPE][GTK] Enable smooth scrolling by default https://bugs.webkit.org/show_bug.cgi?id=220512 Reviewed by Carlos Garcia Campos. Enable smooth scrolling by default on GTK and WPE platforms. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): 2021-10-20 Brady Eidson WebKit Managed Notifications: Skeleton NotificationProvider https://bugs.webkit.org/show_bug.cgi?id=231786 Reviewed by Alex Christensen. Currently, notification messages route from WebContent to the UI process. When "WebKit-managed built-in notifications" are enabled, notification requests will route from WebContent to Networking instead. From there they will head off to webpushd to be handled. This patch just sets up the switch where messages can optionally head off to the Networking process instead of the UIProcess. (It also lays the SPI groundwork for the webpushd mach service name) * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): (WebKit::NetworkSession::~NetworkSession): * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/Notifications/NetworkNotificationManager.cpp: Added. (WebKit::NetworkNotificationManager::NetworkNotificationManager): (WebKit::NetworkNotificationManager::showNotification): (WebKit::NetworkNotificationManager::cancelNotification): (WebKit::NetworkNotificationManager::clearNotifications): (WebKit::NetworkNotificationManager::didDestroyNotification): * NetworkProcess/Notifications/NetworkNotificationManager.h: Added. * NetworkProcess/WebStorage/LocalStorageDatabase.cpp: Unified build fixup. * Sources.txt: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration webPushMachServiceName]): (-[_WKWebsiteDataStoreConfiguration setWebPushMachServiceName:]): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::setWebPushMachServiceName): (WebKit::WebsiteDataStoreConfiguration::webPushMachServiceName const): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::sendNotificationMessage): (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::cancel): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::didDestroyNotification): 2021-10-20 Per Arne Vollan Launch Services database is not always sent to GPUP https://bugs.webkit.org/show_bug.cgi?id=232047 Reviewed by Brent Fulgham. Currently, the XPC endpoint for receiving the Launch Services database is being sent to GPUP in GPUProcessProxy::addSession. If GPUP has not finished launching at that point, the endpoint will not be sent on the first page load. This is addressed by sending the XPC endpoint in GPUProcessProxy::didFinishLaunching, since the XPC connection over which the XPC endpoint is being sent is available then. * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::didFinishLaunching): (WebKit::GPUProcessProxy::addSession): * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::sendNetworkProcessXPCEndpointToProcess const): * UIProcess/WebsiteData/WebsiteDataStore.h: 2021-10-20 John Pascoe Fix crash when calling setUsernameForLocalCredentialWithID https://bugs.webkit.org/show_bug.cgi?id=231986 Reviewed by David Kilzer. Using a copy here results in a crash when the NSData deallocs because the [NSData dataWithBytesNoCopy] was used a buffer that was not allocated with malloc. This is fixed by instead using [NSData initWithBytes] and RetainPtr. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (+[_WKWebAuthenticationPanel setUsernameForLocalCredentialWithID:username:]): 2021-10-20 Alex Christensen Remove com.apple.webkit.adattributiond.plist from build temporarily https://bugs.webkit.org/show_bug.cgi?id=232045 Reviewed by Tim Horton. There are some problems with the internal verifiers that will take some time to resolve. Until they are resolved, don't install the plist and don't tell the network process to connect to the daemon registered by the plist. * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration): * WebKit.xcodeproj/project.pbxproj: 2021-10-20 Brady Eidson Factor out some Notifications-specific messages from WebPageProxy messages https://bugs.webkit.org/show_bug.cgi?id=232021 Reviewed by Alex Christensen. In a future patch, there will be a runtime switch where WebContent sometimes sends these Notification related messages to an objecting in Networking, and othertimes sends them to a WebPageProxy in the UIProcess. To accomodate this switch, let's split them out into their own Notifications specific object and messages. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * Shared/Notifications/NotificationManagerMessageHandler.h: Added. * Shared/Notifications/NotificationManagerMessageHandler.messages.in: Added. * UIProcess/Notifications/WebNotificationManagerMessageHandler.cpp: Added. (WebKit::WebNotificationManagerMessageHandler::WebNotificationManagerMessageHandler): (WebKit::WebNotificationManagerMessageHandler::showNotification): (WebKit::WebNotificationManagerMessageHandler::cancelNotification): (WebKit::WebNotificationManagerMessageHandler::clearNotifications): (WebKit::WebNotificationManagerMessageHandler::didDestroyNotification): * UIProcess/Notifications/WebNotificationManagerMessageHandler.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::m_notificationManagerMessageHandler): (WebKit::WebPageProxy::addAllMessageReceivers): (WebKit::WebPageProxy::removeAllMessageReceivers): (WebKit::WebPageProxy::launchProcess): (WebKit::WebPageProxy::swapToProvisionalPage): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::m_limitsNavigationsToAppBoundDomains): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::cancel): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::didDestroyNotification): 2021-10-20 David Kilzer WebKit Objective-C classes should use weak delegates Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/WKConnection.h: * UIProcess/API/Cocoa/WKProcessGroup.h: * UIProcess/API/mac/WKScrollViewMac.h: - Change `delegate` property from `assign` to `weak` to document that WeakObjCPtr<> is used to store the value. * UIProcess/ios/forms/WKFileUploadPanel.h: - Change `delegate` property from `assign` to `weak` to make the instance variable weak. 2021-10-20 Said Abou-Hallawa [iOS] Ensure the CA transaction has been synchronously committed before snapshotting it https://bugs.webkit.org/show_bug.cgi?id=230085 Reviewed by Tim Horton. Because committing the CA transaction may be an asynchronous operation, we need to ensure the CALayer is fully updated before snapshotting it. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _snapshotRectAfterScreenUpdates:rectInViewCoordinates:intoImageOfWidth:completionHandler:]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 2021-10-20 Ross Kirsling Mac CMake build should not need to include iOS headers https://bugs.webkit.org/show_bug.cgi?id=231998 Reviewed by Alex Christensen. * GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm: * PlatformMac.cmake: * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode const): (WebKit::RemoteLayerTreeTransaction::decode): * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: * UIProcess/Cocoa/UIDelegate.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.h: 2021-10-20 Antti Koivisto Don't re-evaluate viewport dependent media queries if the viewport doesn't change https://bugs.webkit.org/show_bug.cgi?id=231949 rdar://77240171 Reviewed by Alan Bujtas. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::handlePreferenceChange): Remember to signal accessibility settings change on this code path too. 2021-10-20 Michael Catanzaro Do not use strerror() https://bugs.webkit.org/show_bug.cgi?id=231913 Reviewed by Chris Dumez. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::readyReadHandler): (IPC::Connection::sendOutputMessage): * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::allocate): * Shared/mac/AuxiliaryProcessMac.mm: (WebKit::setAndSerializeSandboxParameters): (WebKit::sandboxDataVaultParentDirectory): (WebKit::ensureSandboxCacheDirectory): (WebKit::tryApplyCachedSandbox): (WebKit::applySandbox): 2021-10-20 John Pascoe [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials https://bugs.webkit.org/show_bug.cgi?id=219813 Reviewed by Brent Fulgham. Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent and return a different error depending on consent was obtained. A fixme to add this was inadvertently removed in https://bugs.webkit.org/attachment.cgi?id=393180&action=prettypatch Added api test TestWebKitAPI.WebAuthenticationPanel.LADuplicateCredentialWithConsent * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::makeCredential): 2021-10-20 Youenn Fablet Add support for requestVideoFrameCallback API and MediaStreamTrack-based backend support https://bugs.webkit.org/show_bug.cgi?id=231803 Reviewed by Eric Carlson. Add temporary getter/setter of rvfc feature flag. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetRequestVideoFrameCallbackEnabled): (WKPreferencesGetRequestVideoFrameCallbackEnabled): * UIProcess/API/C/WKPreferencesRef.h: 2021-10-20 Carlos Garcia Campos [WPE] Reenable -fvisibility=hidden and -fvisibility-inlines-hidden https://bugs.webkit.org/show_bug.cgi?id=222860 Reviewed by Don Olmstead. * PlatformWPE.cmake: 2021-10-20 Carlos Garcia Campos [GTK][WPE] UserInteractive threads are not Real-time in Linux https://bugs.webkit.org/show_bug.cgi?id=220115 Reviewed by Michael Catanzaro. Enable real time threads in the web process only when there's a visible page. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::createWebPage): (WebKit::WebProcess::removeWebPage): (WebKit::WebProcess::pageActivityStateDidChange): (WebKit::WebProcess::platformInitializeProcess): Deleted. * WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::platformInitializeProcess): * WebProcess/playstation/WebProcessPlayStation.cpp: (WebKit::WebProcess::platformInitializeProcess): * WebProcess/win/WebProcessWin.cpp: (WebKit::WebProcess::platformInitializeProcess): 2021-10-20 Michael Catanzaro REGRESSION(r276635): [GTK] local HTML file is downloaded instead of displayed if any application has ever called g_desktop_app_info_set_as_default_for_extension(info, "html") https://bugs.webkit.org/show_bug.cgi?id=230797 Reviewed by Carlos Garcia Campos. Let's revert this change. Disabling content sniffing prevents WebKit from distinguishing between different content types with the same file extension, which is something it needs to be able to do. In this bug report, it is conflating text/html with application/x-extension-html, but it could just as well confuse text/html with application/xhtml+xml, causing rendering issues. I don't think we can remove the content sniffing. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didGetFileInfo): 2021-10-19 Ben Nham Add NetworkProcess stubs for push subscriptions https://bugs.webkit.org/show_bug.cgi?id=231922 Reviewed by Youenn Fablet. Added stubs in NetworkProcess for push subscription-related IPC. Currently the stubs return that subscribing is unsupported and that there are no active push subscriptions. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::subscribeToPushService): (WebKit::WebSWServerConnection::unsubscribeFromPushService): (WebKit::WebSWServerConnection::getPushSubscription): (WebKit::WebSWServerConnection::getPushPermissionState): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::subscribeToPushService): (WebKit::WebSWClientConnection::unsubscribeFromPushService): (WebKit::WebSWClientConnection::getPushSubscription): (WebKit::WebSWClientConnection::getPushPermissionState): * WebProcess/Storage/WebSWClientConnection.h: 2021-10-19 Jigen Zhou Fix build break after r284406 if ENABLE_SERVICE_WORKER=OFF https://bugs.webkit.org/show_bug.cgi?id=231968 Reviewed by Don Olmstead. r284406 made m_isServiceWorkerPage of WebPageProxy not available if !ENABLE(SERVICE_WORKER), but the change was incomplete and can cause build failure if ENABLE_SERVICE_WORKER=OFF. This patch avoids accessing m_isServiceWorkerPage if !ENABLE(SERVICE_WORKER) in WebPageProxy methods isServiceWorkerPage, loadDataWithNavigationShared, and resetStateAfterProcessExited. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: 2021-10-19 Don Olmstead Non-unified build fixes, mid October 2021 edition https://bugs.webkit.org/show_bug.cgi?id=231915 Unreviewed non-unified build fixes. * NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementConnection.cpp: * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp: 2021-10-19 Ross Kirsling [CMake] Align OptionsMac with Xcode build https://bugs.webkit.org/show_bug.cgi?id=231982 Reviewed by Don Olmstead. * CMakeLists.txt: Enable -fobjc-weak to support r284329. 2021-10-19 Alexey Proskuryakov Eagerly resolve python3 path in Makefiles https://bugs.webkit.org/show_bug.cgi?id=231979 Reviewed by Jonathan Bedard. * DerivedSources.make: 2021-10-19 Commit Queue Unreviewed, reverting r284099. https://bugs.webkit.org/show_bug.cgi?id=231984 Introduced build failure Reverted changeset: "[iOS] Stop including 'util.sb' in the WebContent process' sandbox" https://bugs.webkit.org/show_bug.cgi?id=231570 https://commits.webkit.org/r284099 2021-10-19 Garrett Davidson WebAuthn Platform UI callbacks are not guaranteed to happen on the main thread https://bugs.webkit.org/show_bug.cgi?id=231963 Reviewed by Brent Fulgham. - The clearanceHandler is not guaranteed to happen on the main thread, but weakThis.get() needs to happen there. - `proxy` needs to stay alive for the whole transaction, otherwise it will tear down the connection and cancel the request, so explicitly capture it everywhere. - Start logging if we get an error from clearanceHandler. Covered by existing tests. * UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm: (WebKit::WebAuthenticatorCoordinatorProxy::performRequest): 2021-10-19 Wenson Hsieh REGRESSION (r284079): fast/canvas/gradient-with-clip.html and fast/canvas/gradient-text-with-shadow.html are flaky failures https://bugs.webkit.org/show_bug.cgi?id=231681 rdar://84202478 Reviewed by Kimmo Kinnunen. These tests occasionally fail when we time out while waiting for the pixel buffer to be populated underneath `RemoteImageBufferProxy::getPixelBuffer`; this happens because the GPU process sometimes halts (and never resumes) while processing stream messages, and consequently never ends up processing the GetPixelBuffer IPC stream message that's necessary to populate the shared memory buffer for GetPixelBuffer. This, in turn, happens when the IPC stream buffer is about to exhaust all available capacity (i.e. the write cursor is nearing the end of the 2MB buffer), and as a result, we send messages that would normally be encoded in the IPC stream as out-of-line IPC messages instead, which are received in the GPU process on the IPC thread and appended to the receive queue corresponding to the destination ID in `Connection::processIncomingMessage()`. If we happen to have sent `RemoteRenderingBackend::CreateImageBuffer(a)` right before exhausting capacity and sending out-of-line messages targeting the RemoteDisplayListRecorder corresponding to the newly created image buffer `a`, we'll end up with a race condition where the IPC thread may receive the out-of-line messages meant for the new remote display list destination *before* the new remote display list has added itself as an IPC receive queue by calling into `StreamServerConnection::startReceivingMessages()`. In this particular scenario (where we "lose" the race), `Connection::processIncomingMessage` will skip past the early return where it would normally find its corresponding receive queue via `m_receiveQueues.get(*message)`, and instead falls through to `Connection::SyncMessageState::processIncomingMessage()`, which will attempt to dispatch the incoming message to the Connection's client (GPUConnectionToWebProcess). Of course, the GPUConnectionToWebProcess isn't aware of how to process this incoming message, so it simply gets dropped. By the time the receive queue is added for the new RemoteDisplayListRecorder, we'll observe a ProcessOutOfStreamMessage and end up waiting forever for this out-of-line message to be added to the receive queue, but this never ends up happening because it has already been received and dropped by GPUConnectionToWebProcess. To address the flaky tests in the short term, we work around this issue by making `CreateImageBuffer` a sync message, so we guarantee that any subsequent messages sent to the image buffer's RemoteDisplayListRecorder will not be dropped. In the (slightly) longer term, we should turn this back into an async stream message, and add a mechanism to redirect all receiver-less RemoteDisplayListRecorder messages to a separate queue. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::createImageBuffer): * GPUProcess/graphics/RemoteRenderingBackend.h: * GPUProcess/graphics/RemoteRenderingBackend.messages.in: Make `CreateImageBuffer` a synchronous stream message for now. * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp: (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer): 2021-10-19 Youenn Fablet Guarantee order of WebSocket events in case of being resumed https://bugs.webkit.org/show_bug.cgi?id=231664 Reviewed by Chris Dumez. We no longer need to handle resume/suspend in WebSocketChannel layer since WebSocket will deal with itself by enqueuing a task in the event loop. * WebProcess/Network/WebSocketChannel.cpp: (WebKit::WebSocketChannel::disconnect): (WebKit::WebSocketChannel::didConnect): (WebKit::WebSocketChannel::didReceiveText): (WebKit::WebSocketChannel::didReceiveBinaryData): (WebKit::WebSocketChannel::didClose): (WebKit::WebSocketChannel::didReceiveMessageError): (WebKit::WebSocketChannel::suspend): (WebKit::WebSocketChannel::resume): (WebKit::WebSocketChannel::didSendHandshakeRequest): (WebKit::WebSocketChannel::didReceiveHandshakeResponse): (WebKit::WebSocketChannel::enqueueTask): Deleted. * WebProcess/Network/WebSocketChannel.h: 2021-10-19 David Kilzer Follow-up #2: WebKit::LocalConnection::createCredentialPrivateKey leaks an NSMutableDictionary Unreviewed follow-up to address Darin's comment. * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: (WebKit::LocalConnection::createCredentialPrivateKey const): - Use WTFMove() to avoid ref count churn. 2021-10-19 Chris Dumez cachedCGColor() and nsColor() should return smart pointers https://bugs.webkit.org/show_bug.cgi?id=231909 Reviewed by Tim Horton. r276283 attempted to make cachedCGColor() and nsColor() thread-safe but the fix was incomplete since those functions return unretained objects that can be released from the cache on any other thread. This patch updates cachedCGColor() and nsColor() to return a RetainPtr to address the issue. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::cgColorFromColor): (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView themeColor]): (-[WKWebView underPageBackgroundColor]): (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _sampledPageTopColor]): * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (-[_WKApplicationManifest themeColor]): * UIProcess/API/mac/WKView.mm: (-[WKView underlayColor]): (-[WKView _pageExtendedBackgroundColor]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _underlayColor]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateTextTouchBar): (WebKit::WebViewImpl::underlayColor const): (WebKit::WebViewImpl::pageExtendedBackgroundColor const): * UIProcess/PDF/WKPDFHUDView.mm: (-[WKPDFHUDView _setupLayer:]): * UIProcess/mac/WebColorPickerMac.mm: (WebKit::WebColorPickerMac::setSelectedColor): (WebKit::WebColorPickerMac::showColorPicker): (-[WKColorPopoverMac setAndShowPicker:withColor:suggestions:]): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::setAccentColor): * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): 2021-10-19 Michael Catanzaro Update seccomp filters with latest changes from flatpak https://bugs.webkit.org/show_bug.cgi?id=231479 Reviewed by Adrian Perez de Castro. Additionally, let's fix a minor inconsistency in our error-handling code: all but one of our codepaths carefully free and close resources, but the process is about to crash so there's not really any reason to do so. The code is slightly simpler if we don't bother. The seemingly-extraneous include order changes are required to placate the style checker. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::seccompStrerror): (WebKit::setupSeccomp): * UIProcess/Launcher/glib/Syscalls.h: Added. 2021-10-19 Martin Robinson [css-scroll-snap] Triggering a layout during scroll causes jittery scrolling on iOS https://bugs.webkit.org/show_bug.cgi?id=173887 Reviewed by Simon Fraser. Tests: fast/scrolling/ios/scroll-snap-with-relayouts-horizontal.html fast/scrolling/ios/scroll-snap-with-relayouts-vertical.html Ensure that when the root node is scrolling, it is added to the list of nodes with an active user scroll. This prevents the web process from resnapping during layout when the user is actively scrolling. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView scrollViewWillBeginDragging:]): Call RemoteScrollingCoordinatorProxy::setRootNodeIsInUserScroll when a scdroll starts and ends. * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Added method declaration. * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::setRootNodeIsInUserScroll): Added setRootNodeIsInUserScroll method. 2021-10-19 Youenn Fablet getDisplayMedia MediaStreamTrack.applyConstraints behavior regressed in Safari 15 https://bugs.webkit.org/show_bug.cgi?id=231286 Reviewed by Eric Carlson. Display tracks are different in that they do not have presets. Revert back to directly linking the WebProcess track with the remote display source without going through RealtimeVideoSource. This restores past behavior. Refactoring of UserMediaCaptureManager to use a single map. We do not yet support cloning tracks to get different sizes, this should be done as a follow-up. Covered by fast/mediastream/getDisplayMedia-size.html. * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/RemoteCaptureSampleManager.cpp: * WebProcess/cocoa/RemoteCaptureSampleManager.h: * WebProcess/cocoa/RemoteRealtimeAudioSource.cpp: * WebProcess/cocoa/RemoteRealtimeAudioSource.h: * WebProcess/cocoa/RemoteRealtimeDisplaySource.cpp: Added. * WebProcess/cocoa/RemoteRealtimeDisplaySource.h: Added. * WebProcess/cocoa/RemoteRealtimeVideoSource.cpp: * WebProcess/cocoa/UserMediaCaptureManager.cpp: * WebProcess/cocoa/UserMediaCaptureManager.h: 2021-10-19 Youenn Fablet Close peer connection sockets when entering page cache https://bugs.webkit.org/show_bug.cgi?id=231890 Reviewed by Eric Carlson. We proactively close all peer connection sockets when entering page cache. This makes peer connection go to disconnected and then failed state. Covered by updated tests. * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: 2021-10-18 Sergio Villar Senin [css-flexbox] Add flex-basis: content support https://bugs.webkit.org/show_bug.cgi?id=221479 Reviewed by Javier Fernandez. Handle LengthType::Content in encode/decode functions. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2021-10-19 Cameron McCormack Ensure CanvasRenderingContext2D.drawImage(video) uses the right color space https://bugs.webkit.org/show_bug.cgi?id=229025 Reviewed by Sam Weinig. When GPU process media handling is enabled, ctx.drawImage(video) calls work by sending a NativeImageForCurrentTime message to the GPU process, which returns an IOSurface around which a CGImage is created. There's no good way to get the color space off the IOSurface, so we add a second return argument to NativeImageForCurrentTime to indicate the color space used. ImageBitmap creates an ImageBuffer for that image to be painted into, and for that we also need to know the color space of the video. The code that sends NativeImageForCurrentTime and then paints the resulting image into the GraphicsContext is further down. So we add a separate IPC message that gets the color space of the video's current frame. (It would be better if we could avoid a second synchronous IPC message call, but either ImageBitmap's scaling and cropping code, or the ImageBuffer creation call, would need to be moved down into MediaPlayerPrivateRemote::paintCurrentFrameInContext, which doesn't seem like the right place for it.) * GPUProcess/media/RemoteImageDecoderAVFProxy.cpp: (WebKit::RemoteImageDecoderAVFProxy::createFrameImageAtIndex): * GPUProcess/media/RemoteImageDecoderAVFProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm: (WebKit::RemoteMediaPlayerProxy::nativeImageForCurrentTime): (WebKit::RemoteMediaPlayerProxy::colorSpace): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::colorSpace): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm: (WebKit::MediaPlayerPrivateRemote::nativeImageForCurrentTime): Add a second return argument to NativeImageForCurrentTime to indicate the color space of the returned IOSurface. (WebKit::MediaPlayerPrivateRemote::colorSpace): Add a new IPC message to get the color space of a video's current frame. 2021-10-18 Commit Queue Unreviewed, reverting r284413. https://bugs.webkit.org/show_bug.cgi?id=231936 BrokeSafariBuildByAddingANewEnum Reverted changeset: "[WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials" https://bugs.webkit.org/show_bug.cgi?id=219813 https://commits.webkit.org/r284413 2021-10-18 Commit Queue Unreviewed, reverting r284240. https://bugs.webkit.org/show_bug.cgi?id=231931 NeedDifferentArchitectureToWorkWithWebpushd Reverted changeset: "WebKit Managed Notifications: Skeleton NotificationProvider." https://bugs.webkit.org/show_bug.cgi?id=231786 https://commits.webkit.org/r284240 2021-10-18 Wenson Hsieh GPU process occasionally crashes under `StreamConnectionWorkQueue::processStreams()` in layout tests https://bugs.webkit.org/show_bug.cgi?id=231897 Reviewed by Simon Fraser. Certain layout tests (e.g. in `LayoutTests/compositing`) currently cause the GPU process to crash on the remote rendering backend thread ("RemoteRenderingBackend work queue") in `StreamConnectionWorkQueue::processStreams()`. This happens because the `dispatch()` call to delete cached resources underneath `~RemoteRenderingBackend()` may fire after the destructor is finished running (thereby destroying `m_workQueue` itself). This leaves the stream work queue in a bad state and causes various crashes when the function is eventually dispatched. Since StreamConnectionWorkQueue is already ThreadSafeRefCounted, it doesn't make sense to directly store StreamConnectionWorkQueue as a member of RemoteRenderingBackend; to fix these crashes, we make `m_workQueue` on RemoteRenderingBackend a strong Ref, and additionally make `StreamConnectionWorkQueue::processStreams()` protect itself to avoid destroying the work queue in the middle of processing. * GPUProcess/graphics/RemoteRenderingBackend.cpp: Drive-by fix: remove an unnecessary header include. (WebKit::RemoteRenderingBackend::RemoteRenderingBackend): (WebKit::RemoteRenderingBackend::~RemoteRenderingBackend): Ensure that the work queue is protected through the final dispatch call that deletes cached resources, and also explicitly `stop()` the work queue when this is done to ensure that the thread permanently stops waiting for additional work. (WebKit::RemoteRenderingBackend::dispatch): * GPUProcess/graphics/RemoteRenderingBackend.h: Replace the IPC::StreamConnectionWorkQueue member with a Ref instead, so that it isn't immediately destroyed when the rendering backend is destroyed, and can instead be protected by strong references on the stack. * Platform/IPC/StreamConnectionWorkQueue.cpp: (IPC::StreamConnectionWorkQueue::processStreams): * Platform/IPC/StreamConnectionWorkQueue.h: Add a boilerplate `StreamConnectionWorkQueue::create()` function that returns a Ref. 2021-10-18 John Pascoe [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials https://bugs.webkit.org/show_bug.cgi?id=219813 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent and return a different error depending on consent was obtained. A fixme to add this was inadvertently removed in https://bugs.webkit.org/attachment.cgi?id=393180&action=prettypatch Reviewed by Brent Fulgham. Added api test TestWebKitAPI.WebAuthenticationPanel.LADuplicateCredentialWithConsent * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::makeCredential): * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: (WebKit::wkWebAuthenticationPanelUpdate): * UIProcess/WebAuthentication/WebAuthenticationFlags.h: 2021-10-18 Chris Dumez Add a callback to know when the service worker loads via -[WKWebView _loadServiceWorker:] https://bugs.webkit.org/show_bug.cgi?id=231771 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _loadServiceWorker:completionHandler:]): (-[WKWebView _loadServiceWorker:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didFinishServiceWorkerPageRegistration): (WebKit::WebPageProxy::didFailLoadForFrame): (WebKit::WebPageProxy::resetStateAfterProcessExited): (WebKit::WebPageProxy::loadServiceWorker): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::didFinishServiceWorkerPageRegistration): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2021-10-18 Alex Christensen Revert r284216 https://webkit.org/b/231523 There is an internal build configuration that doesn't know how to find libWebCoreStatic.a and I have reason to believe that this is not necessary anyways. * Configurations/adattributiond.xcconfig: * Shared/API/Cocoa/WKMain.h: * Shared/API/Cocoa/WKMain.mm: (WKAdAttributionDaemonMain): * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: 2021-10-18 Wenson Hsieh Web process occasionally crashes under `RemoteDisplayListRecorderProxy::recordRestore()` https://bugs.webkit.org/show_bug.cgi?id=231900 Reviewed by Tim Horton. It's apparently possible for a RemoteImageBufferProxy in the web process to outlive RemoteRenderingBackendProxy. Before the IPC stream refactoring in r284079, we were robust against this possibility because RemoteImageBufferProxy checked for a null rendering backend in `canAppendItemOfType` and returned `false`, which prevented us from trying to call into the rendering backend. However, I accidentally omitted this null check in the new RemoteDisplayListRecorderProxy, which currently assumes that `m_renderingBackend` is always non-null when sending any IPC stream messages. Fix this crash by restoring the null check for the weak `m_renderingBackend` pointer. I only observed this crash once locally and, unfortunately, haven't been able to come up with a test case that consistently reproduces it. * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h: (WebKit::RemoteDisplayListRecorderProxy::send): 2021-10-18 David Kilzer Bug 231882: WebKit::GPUConnectionToWebProcess::setTCCIdentity() leaks a tcc_identity_t Reviewed by Chris Dumez. * GPUProcess/cocoa/GPUConnectionToWebProcessCocoa.mm: (WebKit::GPUConnectionToWebProcess::setTCCIdentity): - Use WTF::adoptOSObject() to fix the leak. - Expand the scope of !PLATFORM(MACCATALYST) since none of this code needs to run on the MacCatalyst platform. 2021-10-18 Kimmo Kinnunen Cocoa GraphicsContextGLOpenGL should not use WebGLLayer https://bugs.webkit.org/show_bug.cgi?id=231804 Reviewed by Dean Jackson. Implement changes so that GPU process side GraphicsContextGLOpenGL, the new class GPUProcessGraphicsContextGL, does not use WebGLLayer. Instead, the swap chain is in GraphicsContextGLOpenGL and the GPUProcessGraphicsContextGL exposes a function to extract the display buffer out to be sent to WebContent process. * GPUProcess/graphics/GPUProcessGraphicsContextGL.h: Added. Add a simpler class for GPUProcess side GraphicsContextGLOpenGL instance, one that can get the display buffer from the instance. * GPUProcess/graphics/RemoteGraphicsContextGL.h: * GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp: (WebKit::RemoteGraphicsContextGLCocoa::platformWorkQueueInitialize): (WebKit::RemoteGraphicsContextGLCocoa::prepareForDisplay): * GPUProcess/graphics/RemoteGraphicsContextGLWin.cpp: (WebKit::RemoteGraphicsContextGLWin::platformWorkQueueInitialize): * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp: (WebKit::RemoteGraphicsContextGLProxy::~RemoteGraphicsContextGLProxy): (WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay): Move Cocoa implemenation to an Objective-C++ file. * WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm: Added. (WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay): Set the display buffer contents directly to the WebGLLayer after prepare. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.mm: (WebKit::PlatformCALayerRemoteModelHosting::dumpAdditionalProperties): Unified build fixes. 2021-10-18 Carlos Garcia Campos [GLIB] Simplify SleepDisabler by checking if we are under sandbox https://bugs.webkit.org/show_bug.cgi?id=231670 Reviewed by Adrian Perez de Castro. Move functions to check if running inside a sandbox to WTF. * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::isInsideDocker): Deleted. (WebKit::isInsideFlatpak): Deleted. (WebKit::isInsideSnap): Deleted. 2021-10-18 Philippe Normand [GStreamer] fast/mediastream/video-rotation tests are failing due to missing TestController::takeViewPortSnapshot https://bugs.webkit.org/show_bug.cgi?id=231059 Reviewed by Xabier Rodriguez-Calvar. Implement setOrientationForMediaCapture for GStreamer ports. Because media capture runs in the WebProcess for those ports, we need a new IPC message, sent from the UIProcess to the WebProcess. * UIProcess/API/C/WKPage.cpp: (WKPageSetMockCameraOrientation): (WKPageIsMockRealtimeMediaSourceCenterEnabled): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setOrientationForMediaCapture): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setOrientationForMediaCapture): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2021-10-18 Tim Nguyen Fix mouse selection on modal text nodes https://bugs.webkit.org/show_bug.cgi?id=231741 Reviewed by Antti Koivisto. Tests: - editing/selection/modal-dialog-select-paragraph.html (tests this bug) - imported/w3c/web-platform-tests/inert/inert-node-is-unselectable.tentative.html (tests what the canStartSelection check was supposed to fix) The inert check in Node::canStartSelection() was too restrictive, which caused this bug to happen because we set the root node as inert and then reset it for the modal itself, causing the text in the to be unselectable. Instead, just mirror how -webkit-user-select: none; is implemented by introducing RenderStyle::userSelectIncludingInert(). * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::isSelectableTextNode const): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionPositionInformation): 2021-10-18 David Kilzer Use-after-move of m_sockets in NetworkRTCProvider::close() Reviewed by Youenn Fablet. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::close): - Replace WTFMove() with std::exchange() to make it clear that m_sockets will be emptied, then iterate on `sockets` to close them. Update ASSERT() to check that no sockets were added to m_sockets during the loop. 2021-10-17 David Kilzer Build fix #3: Adopt attribution AVCaptureSession SPI for GPU process https://bugs.webkit.org/show_bug.cgi?id=231621 Unreviewed build fix. * Shared/Cocoa/TCCSoftLink.h: (tcc_identity_create): * Shared/Cocoa/TCCSoftLink.mm: (tcc_identity_create): - Use HAVE(TCC_IOS_14_BIG_SUR_SPI). 2021-10-17 David Kilzer Follow-up: WebKit::LocalConnection::createCredentialPrivateKey leaks an NSMutableDictionary Unreviewed follow-up to address Darin's comments. * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: (WebKit::LocalConnection::createCredentialPrivateKey const): - Remove need for C-style cast by using a local variable for the mutable copy of the NSDictionary. 2021-10-17 BJ Burg [Cocoa] Web Inspector: remove _WKInspectorExtensionPrivateForTesting https://bugs.webkit.org/show_bug.cgi?id=231784 Reviewed by Timothy Hatcher. Promote the only method to be API for _WKInspectorExtension. It is needed to implement some parts of the devtools API. * SourcesCocoa.txt: * UIProcess/API/Cocoa/_WKInspectorExtension.h: * UIProcess/API/Cocoa/_WKInspectorExtension.mm: (-[_WKInspectorExtension evaluateScript:inTabWithIdentifier:completionHandler:]): * UIProcess/API/Cocoa/_WKInspectorExtensionPrivateForTesting.h: Removed. * UIProcess/API/Cocoa/_WKInspectorExtensionTesting.mm: Removed. * WebKit.xcodeproj/project.pbxproj: 2021-10-16 David Kilzer [WebAuthn] Many Objective-C classes leak their instance variables Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/_WKAuthenticationExtensionsClientInputs.mm: (-[_WKAuthenticationExtensionsClientInputs dealloc]): * UIProcess/API/Cocoa/_WKPublicKeyCredentialCreationOptions.mm: (-[_WKPublicKeyCredentialCreationOptions dealloc]): * UIProcess/API/Cocoa/_WKPublicKeyCredentialDescriptor.mm: (-[_WKPublicKeyCredentialDescriptor dealloc]): * UIProcess/API/Cocoa/_WKPublicKeyCredentialEntity.mm: (-[_WKPublicKeyCredentialEntity dealloc]): * UIProcess/API/Cocoa/_WKPublicKeyCredentialParameters.mm: (-[_WKPublicKeyCredentialParameters dealloc]): * UIProcess/API/Cocoa/_WKPublicKeyCredentialRelyingPartyEntity.mm: (-[_WKPublicKeyCredentialRelyingPartyEntity dealloc]): * UIProcess/API/Cocoa/_WKPublicKeyCredentialRequestOptions.mm: (-[_WKPublicKeyCredentialRequestOptions dealloc]): * UIProcess/API/Cocoa/_WKPublicKeyCredentialUserEntity.mm: (-[_WKPublicKeyCredentialUserEntity dealloc]): - Add -dealloc methods that release instance variables. 2021-10-16 David Kilzer _WKRemoteWebInspectorViewController leaks an instance variable and should use a weak delegate Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: - Use a weak reference for the delegate. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (-[_WKRemoteWebInspectorViewController dealloc]): Add. - Fix leak by releasing _configuration instance variable. 2021-10-16 Tim Horton WebKit ignores inherited GCC_PREPROCESSOR_DEFINITIONS https://bugs.webkit.org/show_bug.cgi?id=231867 Reviewed by Sam Weinig. * Configurations/BaseTarget.xcconfig: Add a $(inherited) here like in every other project, so that we don't just drop defines that come from above. 2021-10-16 Simon Fraser Page zoom is messed up after navigating back from a PDF https://bugs.webkit.org/show_bug.cgi?id=231841 Reviewed by Tim Horton. A navigation back from a PDF is a FrameLoadType::Back, so resetting m_mainFramePluginHandlesPageScaleGesture only for FrameLoadType::Standard is wrong. For all navigations, the plugins seem to call pluginScaleFactorDidChange/pluginZoomFactorDidChange/ mainFramePluginHandlesPageScaleGestureDidChange so it's safe to reset them for all navigation types. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): 2021-10-16 Commit Queue Unreviewed, reverting r284300. https://bugs.webkit.org/show_bug.cgi?id=231866 broke-apple-silicon-performance Reverted changeset: "[macOS] Add telemetry for system calls in WP" https://bugs.webkit.org/show_bug.cgi?id=231836 https://commits.webkit.org/r284300 2021-10-16 David Kilzer WebKit::LocalConnection::createCredentialPrivateKey leaks an NSMutableDictionary Reviewed by Kate Cheney. * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: (WebKit::LocalConnection::createCredentialPrivateKey const): - Use RetainPtr<> and adoptNS to fix the leak. 2021-10-16 Lauro Moura [GTK4] Update signal name to monitor window resize https://bugs.webkit.org/show_bug.cgi?id=231854 Reviewed by Carlos Garcia Campos. Using size-changed (previous signal name) makes the MiniBrowser crash running the WebDriver tests. The signal name was changed in https://gitlab.gnome.org/GNOME/gtk/-/commit/b7380543449ea679a2c912b66aab4855b2bb41f2, as part of GTK 3.99.5. Covered by existing tests. * UIProcess/API/glib/WebKitUIClient.cpp: 2021-10-15 Alex Christensen Start using adattributiond on iOS https://bugs.webkit.org/show_bug.cgi?id=231829 Reviewed by Brady Eidson. This makes one small change to use adattributiond on iOS by default instead of the network process. The rest of this patch is to keep the tests doing what they used to. * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: (WKWebsiteDataStoreConfigurationCopyPCMMachServiceName): (WKWebsiteDataStoreConfigurationSetPCMMachServiceName): * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration): 2021-10-15 Alex Christensen Use attributedBundleIdentifier instead of applicationBundleIdentifier when present for handling PCM attribution https://bugs.webkit.org/show_bug.cgi?id=231827 Reviewed by Brady Eidson. This is the same identifier that SafariViewController uses in _setEphemeralUIEventAttribution:forApplicationWithBundleID: If we don't do this, then SafariViewController looks in the database for PCMs from com.apple.SafariViewService and doesn't find any and doesn't send any reports. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::attributedBundleIdentifier): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::attributedBundleIdentifier): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::handlePrivateClickMeasurementConversion): * NetworkProcess/NetworkSession.h: * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _addEventAttributionWithSourceID:destinationURL:sourceDescription:purchaser:reportEndpoint:optionalNonce:applicationBundleID:ephemeral:]): (-[WKWebView _addEventAttributionWithSourceID:destinationURL:sourceDescription:purchaser:reportEndpoint:optionalNonce:applicationBundleID:]): Deleted. 2021-10-15 Per Arne Vollan [macOS] Add telemetry for system calls in WP https://bugs.webkit.org/show_bug.cgi?id=231836 Reviewed by Brent Fulgham. Add telemetry for system calls in WP to understand in which context they are being used. * WebProcess/com.apple.WebProcess.sb.in: 2021-10-15 Ross Kirsling Realize Mac CMake build of WebCore and WebKit https://bugs.webkit.org/show_bug.cgi?id=231749 Reviewed by Alex Christensen. * CMakeLists.txt: * PlatformMac.cmake: 2021-10-15 Eric Carlson [iOS] Support getDisplayMedia https://bugs.webkit.org/show_bug.cgi?id=231455 Reviewed by Youenn Fablet and Jer Noble. * UIProcess/Cocoa/MediaPermissionUtilities.mm: (WebKit::alertMessageText): Add text for default screen capture prompt. (WebKit::allowButtonText): Ditto. (WebKit::doNotAllowButtonText): Ditto. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Call default getDisplayMedia prompt if the delegate doesn't implement the private prompt selector. * UIProcess/MediaPermissionUtilities.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::promptForGetDisplayMedia): New default getDisplayMedia prompt. (WebKit::UserMediaPermissionRequestProxy::promptForGetUserMedia): (WebKit::UserMediaPermissionRequestProxy::doDefaultAction): Call promptForGetDisplayMedia or promptForGetUserMedia according to the request type. (WebKit::UserMediaPermissionRequestProxy::canPromptForGetDisplayMedia): (WebKit::UserMediaPermissionRequestProxy::prompt): Deleted. * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::doDefaultAction): Deleted. 2021-10-15 Jer Noble [iOS] Screen Sharing doesn't switch to AirPlay when