2020-02-15 Pavel Feldman [Geoclue] Avoid usage of provider in callbacks after it has been destroyed https://bugs.webkit.org/show_bug.cgi?id=207420 GeoclueGeolocationProvider was making non-cancelable g_dbus_proxy_call(s) with bare |this| pointer. Reviewed by Carlos Garcia Campos. * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: (WebKit::GeoclueGeolocationProvider::start): (WebKit::GeoclueGeolocationProvider::stop): (WebKit::GeoclueGeolocationProvider::setupManager): (WebKit::GeoclueGeolocationProvider::createClient): (WebKit::GeoclueGeolocationProvider::startClient): (WebKit::GeoclueGeolocationProvider::didFail): * UIProcess/geoclue/GeoclueGeolocationProvider.h: 2020-02-14 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.26.4 release * wpe/NEWS: Add release notes for 2.26.4. 2020-02-14 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.26.4 release * gtk/NEWS: Add release notes for 2.26.4. 2020-02-05 Patrick Griffis [GTK][WPE] Add more fontconfig paths into the sandbox https://bugs.webkit.org/show_bug.cgi?id=207293 Reviewed by Michael Catanzaro. These paths were reported to be used on Debian. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bindFonts): 2019-09-18 Yury Semikhatsky [GTK] Compilation errors when GL is disabled https://bugs.webkit.org/show_bug.cgi?id=200223 Fix following compilation error when building with ENABLE_OPENGL=OFF ../../Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp:123:51: error: use of undeclared identifier 'WaylandCompositor' parameters.waylandCompositorDisplayName = WaylandCompositor::singleton().displayName(); ^ Reviewed by Philippe Normand. * UIProcess/glib/WebProcessPoolGLib.cpp: (WebKit::WebProcessPool::platformInitializeWebProcess): only make a call when using EGL, this matches guards in WaylandCompositor.h. The condition was changed in r245807. 2019-09-12 Charlie Turner [GTK] Allow CacheStore::destroyEngine to destroy default engine for soup. https://bugs.webkit.org/show_bug.cgi?id=201690 Reviewed by Carlos Garcia Campos. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::destroyEngine): As we do for NetworkProcess::destroySession, also allow destroying the engine for the default session for the same reason. 2019-12-16 Emilio Cobos Álvarez [GTK] Build with USE_WPE_RENDERER=No fails with undefined EGL_WAYLAND_BUFFER_WL https://bugs.webkit.org/show_bug.cgi?id=205250 Reviewed by Carlos Garcia Campos. Define the enum if not present. No new tests, just a build fix. * UIProcess/gtk/WaylandCompositor.cpp: 2020-01-28 Carlos Garcia Campos [GTK] Should use light theme unless website declares support for dark themes in color-schemes property https://bugs.webkit.org/show_bug.cgi?id=197947 Reviewed by Michael Catanzaro. Handle the theme changes in the UI process, converting dark variant to the light one before sending the theme name to the web process. The web process is still notified when a dark theme is in use, so that if website prefers a dark color scheme it will be used, but the gtk theme that will be used for controls styling will always be light. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): Encode themeName. (WebKit::WebPageCreationParameters::decode): Decode themeName. * Shared/WebPageCreationParameters.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::themeName const): Get the theme name that should be used by the web process. * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (themeChanged): Call WebPageProxy::themeDidChange(). (applicationPreferDarkThemeChanged): (webkitWebViewBaseSetToplevelOnScreenWindow): Use a different callback for the theme name change. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::themeDidChange): Send ThemeDidChange message to the web process with the theme name to use. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Initialize the theme name. (WebKit::WebPage::effectiveAppearanceDidChange): Use this now for GTK port too. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add ThemeDidChange message. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::themeDidChange): Set the theme given name in gtk settings. * WebProcess/gtk/WebProcessMainGtk.cpp: 2019-09-26 Patrick Griffis [GTK] Fix logic of dark theme detection https://bugs.webkit.org/show_bug.cgi?id=202276 - If GTK_THEME is set it has a higher priority to GtkSettings. - GTK_THEME may be a -dark theme or :dark variant, handle both. Reviewed by Michael Catanzaro. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::effectiveAppearanceIsDark const): 2020-01-28 Carlos Garcia Campos [GTK][WPE] QR code not loaded in web.whatsapp.com https://bugs.webkit.org/show_bug.cgi?id=203404 Reviewed by Michael Catanzaro. This is a regression of the switch to use libsoup API for the WebSockets implementation. The QR code is loaded using a WebSocket connection, but the server is always replying with a 400 Bad Request to the Upgrade requests coming from an existing HTTP connection. We need to ensure a new dedicated connection is used for WebSockets. * NetworkProcess/soup/WebSocketTaskSoup.cpp: (WebKit::WebSocketTask::WebSocketTask): Set the SOUP_MESSAGE_NEW_CONNECTION flag to the SoupMessage before starting the connection. 2020-01-23 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.26.3 release * wpe/NEWS: Add release notes 2.26.3. 2020-01-22 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.26.3 release * gtk/NEWS: Add release notes for 2.26.3. 2020-01-07 Carlos Garcia Campos [SOUP] HSTS Support causes page loading to fail with "Operation was cancelled" https://bugs.webkit.org/show_bug.cgi?id=203620 Reviewed by Michael Catanzaro. The problem is that we are assuming that request cancellation happens synchronously, but it can happen that the async ready callback for the previous request is called after the new one has started. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::sendRequestCallback): Return early if this is a previous request already cancelled. 2019-10-04 Ross Kirsling Unreviewed WinCairo build fix for r250717. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: (WebKit::LayerTreeHost::invalidate): Deleted. 2019-11-07 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.26.2 release * wpe/NEWS: Add release notes for 2.26.2. 2019-11-07 Adrian Perez de Castro Unreviewed build fixed for non-unified builds. * NetworkProcess/NetworkConnectionToWebProcess.cpp: Add missin inclusion of the Logging.h header 2019-11-06 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.26.2 release * gtk/NEWS: Add release notes for 2.26.2. 2019-10-22 Carlos Garcia Campos [GTK] C++ comments used in C header files https://bugs.webkit.org/show_bug.cgi?id=203191 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitAutocleanups.h: * UIProcess/API/gtk/WebKitDefines.h: * UIProcess/API/gtk/WebKitForwardDeclarations.h: * UIProcess/API/gtk/WebKitWebViewBase.h: * UIProcess/API/wpe/WebKitAutocleanups.h: * UIProcess/API/wpe/WebKitDefines.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebEditor.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: 2019-10-21 Carlos Garcia Campos [GTK] Objects category in emoji picker is empty https://bugs.webkit.org/show_bug.cgi?id=203189 Reviewed by Adrian Perez de Castro. There's a typo in the first emopi name of objects section. * UIProcess/API/gtk/WebKitEmojiChooser.cpp: (webkitEmojiChooserSetupEmojiSections): uted speaker -> muted speaker 2019-10-14 Carlos Garcia Campos [GTK] White pages in AC mode: Cannot get default EGL display: EGL_BAD_PARAMETER https://bugs.webkit.org/show_bug.cgi?id=202362 Reviewed by Carlos Alberto Lopez Perez. * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): Disable accelerated compositing mode when we failed to reate the shared display for compositing. * WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Destroy the wpe display when initialization fails. 2019-10-03 Carlos Garcia Campos [GTK] WebAutomation: make setWindowRect synchronous https://bugs.webkit.org/show_bug.cgi?id=202530 Reviewed by Carlos Alberto Lopez Perez. Move/resize window is asynchronous in GTK, but automation expects it to be synchronous so that get window rect after setting it always returns the value set. Use a nested run loop to wait for the configure events after the move/resize. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::windowConfigureEventCallback): (UIClient::setWindowFrameTimerFired): 2019-09-23 Patrick Griffis [GTK][WPE] Don't use prgname in dbus-proxy socket path https://bugs.webkit.org/show_bug.cgi?id=201979 The path length for the socket is limited to 108 bytes so it is easy for a long prgname to cause it to get truncated and fail. Since we only allow the socket path into the sandbox the unique directory isn't necessary. Reviewed by Michael Catanzaro. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::XDGDBusProxyLauncher::setAddress): 2019-10-04 Carlos Garcia Campos [GTK] Crash in WebChromeClient::createDisplayRefreshMonitor https://bugs.webkit.org/show_bug.cgi?id=202551 Reviewed by Žan Doberšek. The crash happens when the drawing area is destroyed due to a page close. The layer tree host is invalidated causing a layer flush that ends up trying to create a display refresh monitor, which requires the drawing area. We need to null-check the drawing area in WebChromeClient::createDisplayRefreshMonitor() but we should also ensure that layer flush is not performed after layer tree host is destroyed. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createDisplayRefreshMonitor const): Null-check drawing area before using it. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): Receive a WebPage instead of a WebCore::Page and create the root layer here. (WebKit::CompositingCoordinator::~CompositingCoordinator): Do not purge backing stores again, invalidate should always be called right before the object is destroyed. (WebKit::CompositingCoordinator::flushPendingLayerChanges): Get WebCore::Page from WebPage. (WebKit::CompositingCoordinator::timestamp const): Ditto. (WebKit::CompositingCoordinator::syncDisplayState): Ditto. (WebKit::CompositingCoordinator::notifyFlushRequired): Do not continue if m_rootLayer is nullptr. (WebKit::CompositingCoordinator::deviceScaleFactor const): Get WebCore::Page from WebPage. (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto. (WebKit::CompositingCoordinator::createGraphicsLayer): Call attachLayer() instead of duplicating the code. (WebKit::CompositingCoordinator::setVisibleContentsRect): Get WebCore::Page from WebPage. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost): Do not call LayerTreeHost::invalidate() that has been removed. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: (WebKit::LayerTreeHost::LayerTreeHost): Construct the coordinator after the sceneIntegration. (WebKit::LayerTreeHost::~LayerTreeHost): Invalidate everything here now. We don't really need invalidate() method since LayerTreeHost is not refcounted and we always called invalidate right before deleting the object. (WebKit::LayerTreeHost::layerFlushTimerFired): This can't happen on invalid state anymore. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: 2019-10-08 Adrian Perez de Castro [WPE][GTK] Build fails with ENABLE_WEBDRIVER=OFF https://bugs.webkit.org/show_bug.cgi?id=202658 Reviewed by Carlos Garcia Campos. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Add missing ENABLE(WEBDRIVER_MOUSE_INTERACTIONS) and ENABLE(WEBDRIVER_KEYBOARD_INTERACTIONS) preprocessor guards. * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Ditto. 2019-09-24 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.26.1 release * wpe/NEWS: Add release notes for 2.26.1. 2019-09-23 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.26.1 release * gtk/NEWS: Add release notes for 2.26.1. 2019-09-23 Michael Catanzaro [SOUP] Stop setting G_TLS_GNUTLS_PRIORITY https://bugs.webkit.org/show_bug.cgi?id=172154 Reviewed by Carlos Garcia Campos. Nowadays, I maintain glib-networking. WebKit doesn't need to override its defaults to be secure anymore. By overriding glib-networking's default priority, WebKit is force-reenabling TLS 1.0 and TLS 1.1 even when glib-networking has disabled them. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: (main): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2019-09-14 Adrian Perez de Castro [GTK][WPE] Check for a Snap sandbox a bit harder https://bugs.webkit.org/show_bug.cgi?id=201793 Reviewed by Michael Catanzaro. * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::isInsideSnap): Check whether the SNAP_NAME and SNAP_REVISION environment variables are defined as well. 2019-09-17 Carlos Garcia Campos [GTK] Initial view loading is slow https://bugs.webkit.org/show_bug.cgi?id=201451 Reviewed by Sergio Villar Senin. The problem is that now we are always calling DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() after a new process is launched and we used to do that only when launching a new process after a crash. This makes m_hasReceivedFirstUpdate useless, because it's always set to true right after a process is launched. Then, we wait up to half a second (which is usually the case for the initial load) until the first update. We only want to do that when recovering from a crash or when swapping processes to avoid flashing effect. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcess): Add ProcessLaunchReason parameter and pass it to finishAttachingToWebProcess instead of IsProcessSwap. (WebKit::WebPageProxy::swapToWebProcess): Pass ProcessLaunchReason::ProcessSwap to finishAttachingToWebProcess(). (WebKit::WebPageProxy::finishAttachingToWebProcess): Do not call DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() when process launch reason is ProcessLaunchReason::InitialProcess. (WebKit::WebPageProxy::launchProcessForReload): Pass ProcessLaunchReason::Reload to launchProcess(). * UIProcess/WebPageProxy.h: Remove IsProcessSwap and add ProcessLaunchReason instead that is passed to launchProcess and finishAttachingToWebProcess. 2019-09-18 Carlos Alberto Lopez Perez [GTK][WPE] bubblewrap sandbox should be disabled when running inside docker https://bugs.webkit.org/show_bug.cgi?id=201914 Reviewed by Michael Catanzaro. Detect if running inside Docker by checking the file /.dockerenv In that case, disable the sandbox. * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::isInsideDocker): (WebKit::ProcessLauncher::launchProcess): 2019-09-17 Carlos Garcia Campos [GTK] Crash closing web view while hardware acceleration is enabled https://bugs.webkit.org/show_bug.cgi?id=200856 Reviewed by Michael Catanzaro. The crash happens when destroying the WaylandCompositor::Surface because the web view GL context is used to release the texture, but the GL context is no longer valid after web view unrealize. AcceleratedBackingStoreWayland should handle the web view unrealize to destroy the GL context. It will be created on demand again after the web view is realized. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize): Notify AcceleratedBackingStore. (webkitWebViewBaseUnrealize): Ditto. * UIProcess/gtk/AcceleratedBackingStore.h: (WebKit::AcceleratedBackingStore::realize): Added. (WebKit::AcceleratedBackingStore::unrealize): Added. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::realize): In case of using WaylandCompositor, call WaylandCompositor::bindWebPage() to bind the WebPageProxy to the Wayland surface. (WebKit::AcceleratedBackingStoreWayland::unrealize): Destroy GL resources and the GL context. (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Do not try to create the GL context if the web view is not realized. (WebKit::AcceleratedBackingStoreWayland::displayBuffer): Remove the code to initialize the texture. (WebKit::AcceleratedBackingStoreWayland::paint): And add it here. * UIProcess/gtk/AcceleratedBackingStoreWayland.h: * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::setWebPage): Return early if given page is the current one already. (WebKit::WaylandCompositor::bindWebPage): Set the surface WebPageProxy. (WebKit::WaylandCompositor::unbindWebPage): Unset the surface WebPageProxy. * UIProcess/gtk/WaylandCompositor.h: * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): When restoring a previous layer tree host, always call resumeRendering() to balance the suspendRendering() called in exitAcceleratedCompositingMode(). 2019-09-16 Carlos Garcia Campos REGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely https://bugs.webkit.org/show_bug.cgi?id=201544 Reviewed by Michael Catanzaro. WebPageProxy::loadAlternateHTML() is an exception, because it's an API request but always sets the navigationID to 0. We always want to reset the pending API request URL when alternate HTML load starts. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Check also that it's an API alternate HTML load to reset the pending API request URL. 2019-09-12 Adrian Perez de Castro [GTK][WPE] webkit_settings_set_user_agent() allows content forbidden in HTTP headers https://bugs.webkit.org/show_bug.cgi?id=201077 Reviewed by Carlos Garcia Campos. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_set_user_agent): Check the passed string using the new WebCore::isValidUserAgentHeaderValue() function, and return early without changing the setting if the string is not usable in the User-Agent HTTP header. 2019-09-20 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.26.0 release * wpe/NEWS: Add release notes for 2.26.0 2019-09-09 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.25.91 release * wpe/NEWS: Add release notes for 2.25.91. 2019-09-09 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.26.0 release * gtk/NEWS: Add release notes for 2.26.0. 2019-09-06 Patrick Griffis [GTK][WPE] Do not enable the sandbox in Snap https://bugs.webkit.org/show_bug.cgi?id=201486 Reviewed by Carlos Garcia Campos. Running inside of Snap adds its own complications and is simply not supported for now. Also update isInsideFlatpak() for consistency. * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::isInsideFlatpak): (WebKit::isInsideSnap): (WebKit::ProcessLauncher::launchProcess): 2019-09-04 Patrick Griffis [WPE][GTK] Fix sandbox parsing DISPLAY on X11 https://bugs.webkit.org/show_bug.cgi?id=201462 Reviewed by Michael Catanzaro. On some setups the DISPLAY env var was incorrectly parsed. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bindX11): 2019-09-06 Carlos Garcia Campos Unreviewed. Disable PSON in GTK port There are some issues causing problems in applications. * Shared/WebPreferencesDefaultValues.h: 2019-09-03 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.92 release * gtk/NEWS: Add release notes for 2.25.92. 2019-09-03 Carlos Garcia Campos Unreviewed. Add an env var to force single process model WEBKIT_USE_SINGLE_WEB_PROCESS=1 can now be used to force the single process model. This is a temporary solution for applications still depending on the single process mode behavior. It will be only available in 2.26 series. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): 2019-09-03 Carlos Garcia Campos [WPE][GTK] Deprecate nonfunctional process limit APIs https://bugs.webkit.org/show_bug.cgi?id=193749 Reviewed by Žan Doberšek. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_set_process_model): (webkit_web_context_get_process_model): (webkit_web_context_set_web_process_count_limit): (webkit_web_context_get_web_process_count_limit): * UIProcess/API/gtk/WebKitWebContext.h: * UIProcess/API/wpe/WebKitWebContext.h: 2019-09-01 Fujii Hironori [Cairo] out-of-bounds read in ShareableBitmap::paint if a fractional device scale factor is used https://bugs.webkit.org/show_bug.cgi?id=196340 Reviewed by Brent Fulgham. In ShareableBitmap::paint, srcRectScaled can be out-of-bounds of the surface if a fractional device scale factor is used. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::paint): Use cairoSurfaceSetDeviceScale to set a device scale factor to the surface instead of multiplying srcRect with a device scale factor. 2019-08-30 Alex Christensen Allow process cache to cache processes when using a non-default persistent WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=201329 Reviewed by Chris Dumez. Treat all persistent sessions the same when deciding whether to clear all cached web processes using a particular website data store. This removes a huge performance regression on warm plt when switching to using a non-default persistent session. I also removed a call to removeSession which is redundant with the one in the WebsiteDataStore destructor, which is where it should be. * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::canCacheProcess const): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore): (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore): 2019-08-30 Adrian Perez de Castro [WPE][GTK] New API to remove a filter from an user content manager given its identifier https://bugs.webkit.org/show_bug.cgi?id=200479 Reviewed by Carlos Garcia Campos. * UIProcess/API/glib/WebKitUserContentManager.cpp: (webkit_user_content_manager_remove_filter_by_id): Add new public API function. * UIProcess/API/gtk/WebKitUserContentManager.h: Add declaration for webkit_user_content_manager_remove_filter_by_id(). * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: List new function. * UIProcess/API/wpe/WebKitUserContentManager.h: Add declaration for webkit_user_content_manager_remove_filter_by_id(). * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: List new function. 2019-08-30 Philippe Normand [WPE][Qt] loadingChanged signal parameter is unusable https://bugs.webkit.org/show_bug.cgi?id=201301 Reviewed by Carlos Garcia Campos. * UIProcess/API/wpe/qt/WPEQtView.h: Explicitely name signal parameter. It is a runtime requirement for QML. 2019-08-29 Chris Dumez Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string https://bugs.webkit.org/show_bug.cgi?id=201318 Reviewed by Alex Christensen. Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity. * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const): (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const): (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics): * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const): (WebKit::NetworkCache::BlobStorage::synchronize): (WebKit::NetworkCache::BlobStorage::blobPathForHash const): * NetworkProcess/cache/NetworkCacheBlobStorage.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::basePathIsolatedCopy const): (WebKit::NetworkCache::Storage::versionPath const): (WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const): (WebKit::NetworkCache::Storage::synchronize): (WebKit::NetworkCache::Storage::recordDirectoryPathForKey const): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::clear): (WebKit::NetworkCache::Storage::shrink): (WebKit::NetworkCache::Storage::deleteOldVersions): * NetworkProcess/cache/NetworkCacheStorage.h: 2019-08-29 Alex Christensen Speculative loads should use the NetworkSession owning their Cache https://bugs.webkit.org/show_bug.cgi?id=201314 Reviewed by Chris Dumez. This provides a performance improvement when using non-default persistent WKWebsiteDataStores. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::open): (WebKit::NetworkCache::Cache::Cache): * NetworkProcess/cache/NetworkCache.h: (WebKit::NetworkCache::Cache::sessionID const): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): 2019-08-29 Chris Dumez Use inline data member initialization in ProcessLauncher https://bugs.webkit.org/show_bug.cgi?id=201247 Reviewed by Ryosuke Niwa. * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::ProcessLauncher): * UIProcess/Launcher/ProcessLauncher.h: 2019-08-28 Said Abou-Hallawa All image drawing functions should take an argument of type ImagePaintingOptions https://bugs.webkit.org/show_bug.cgi?id=201059 Reviewed by Simon Fraser. GraphicsContext::drawImage() now takes an ImagePaintingOptions. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::imagePositionInformation): 2019-08-28 Chris Dumez Have WebPageProxy generate the page identifier by itself https://bugs.webkit.org/show_bug.cgi?id=201223 Reviewed by Ryosuke Niwa. Have WebPageProxy generate the page identifier by itself instead of having the WebProcessProxy do it. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::m_serviceWorkerPageID): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::create): (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createWebPage): (WebKit::WebProcessProxy::generatePageID): Deleted. * UIProcess/WebProcessProxy.h: 2019-08-28 Carlos Garcia Campos REGRESSION(r243434): Wrong URL passed to WebKitWebView::load-failed when cancelling previous load https://bugs.webkit.org/show_bug.cgi?id=201176 Reviewed by Žan Doberšek. Use the current provisional/committed url when faking an error event, instead of the current active URI that can be the pending api request of a new load. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewWillStartLoad): 2019-08-28 Claudio Saavedra [GTK][WPE] Implement HSTS for the soup network backend https://bugs.webkit.org/show_bug.cgi?id=192074 Reviewed by Carlos Garcia Campos. libsoup 2.67.1 introduced HSTS support via a SoupSessionFeature. Add support to the soup network backend by adding the feature to SoupNetworkSession and handling HSTS protocol upgrades, by propagating the scheme change further to clients. This patch adds the HSTS feature unconditionally, but it still possible to add a boolean property to the web context class if desired. Additionally, add API to the WebKitWebsiteDataManager to specify the directory where the HSTS database is saved. If the directory is not set or if the data manager is ephemeral, use a non-persistent, memory only HSTS enforcer. Implement as well the methods needed to clean-up and delete HSTS policies from the storage and expose the feature in GTK+ MiniBrowser's about:data. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::createRequest): (WebKit::NetworkDataTaskSoup::clearRequest): (WebKit::NetworkDataTaskSoup::shouldAllowHSTSPolicySetting const): (WebKit::NetworkDataTaskSoup::shouldAllowHSTSProtocolUpgrade const): (WebKit::NetworkDataTaskSoup::protocolUpgradedViaHSTS): (WebKit::NetworkDataTaskSoup::hstsEnforced): * NetworkProcess/soup/NetworkDataTaskSoup.h: * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::getHostNamesWithHSTSCache): (WebKit::NetworkProcess::deleteHSTSCacheForHostNames): (WebKit::NetworkProcess::clearHSTSCache): (WebKit::NetworkProcess::platformInitializeNetworkProcess): * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: (API::WebsiteDataStore::defaultHSTSDirectory): * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): * UIProcess/API/glib/WebKitWebsiteData.cpp: (recordContainsSupportedDataTypes): (toWebKitWebsiteDataTypes): * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerGetProperty): (webkitWebsiteDataManagerSetProperty): (webkitWebsiteDataManagerConstructed): (webkit_website_data_manager_class_init): (webkitWebsiteDataManagerGetDataStore): (webkit_website_data_manager_get_hsts_cache_directory): (toWebsiteDataTypes): * UIProcess/API/gtk/WebKitWebsiteData.h: * UIProcess/API/gtk/WebKitWebsiteDataManager.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebsiteData.h: * UIProcess/API/wpe/WebKitWebsiteDataManager.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::hstsStorageDirectory const): (WebKit::WebsiteDataStoreConfiguration::setHSTSStorageDirectory): 2019-08-27 Mark Lam Refactor to use VM& instead of VM* at as many places as possible. https://bugs.webkit.org/show_bug.cgi?id=201172 Reviewed by Yusuke Suzuki. * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: (webkit_dom_node_for_js_value): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::getOrCreate): * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::getOwnPropertyNames): * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::identifierFromIdentifierRep): (WebKit::NPJSObject::enumerate): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue): (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::counterValue): 2019-08-27 James Savage Populate alternate URL for _WKActivatedElementInfo in UIContextMenu SPI. https://bugs.webkit.org/show_bug.cgi?id=201165. rdar://problem/54729648. Reviewed by Dean Jackson. * UIProcess/API/APIContextMenuElementInfo.h: * UIProcess/API/APIContextMenuElementInfo.cpp: (API::ContextMenuElementInfo::ContextMenuElementInfo): Initialize new memeber. * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm: (-[WKContextMenuElementInfo _activatedElementInfo]): Use new initializer. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): Ditto. * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:userInfo:]): Ditto. (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:userInfo:]): Set new ivar. (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:]): Deleted. (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]): Deleted. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView assignLegacyDataForContextMenuInteraction]): Use new initializer. (-[WKContentView continueContextMenuInteraction:]): If the context menu is being generated for an image, and we do not have a URL associated with the position information, try to generate one using existing SPI. This change also passes through the userInfo via a new property on _WKActivatedElementInfo. We only do this for the SPI version of this delegate method, because the API is not called for image previews. (-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]): Use new initializer. 2019-08-27 Basuke Suzuki [RemoteInspector][Socket] Restructuring the components of Socket implementation https://bugs.webkit.org/show_bug.cgi?id=201079 Reviewed by Ross Kirsling. RemoteInspectorClient is now free from creation of SocketEndpoint. All communication to SocketEndpoint id now the duty of super class. * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): Remove direct communication to Socket Endpoint. (WebKit::RemoteInspectorClient::sendWebInspectorEvent): Ditto. * UIProcess/socket/RemoteInspectorClient.h: 2019-08-27 Chris Dumez Introduce subclasses to RemoteObjectRegistry for the UIProcess and the WebProcess https://bugs.webkit.org/show_bug.cgi?id=201153 Reviewed by Alex Christensen. This better factoring improves code clarity. * PlatformMac.cmake: * Shared/API/Cocoa/RemoteObjectRegistry.h: (WebKit::RemoteObjectRegistry::~RemoteObjectRegistry): (WebKit::RemoteObjectRegistry::takeBackgroundActivityToken): * Shared/API/Cocoa/RemoteObjectRegistry.mm: (WebKit::RemoteObjectRegistry::RemoteObjectRegistry): (WebKit::RemoteObjectRegistry::sendInvocation): (WebKit::RemoteObjectRegistry::sendReplyBlock): (WebKit::RemoteObjectRegistry::sendUnusedReply): * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm: (-[_WKRemoteObjectRegistry _initWithWebPage:]): (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]): * SourcesCocoa.txt: * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp: Added. (WebKit::UIRemoteObjectRegistry::takeBackgroundActivityToken): (WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry): (WebKit::UIRemoteObjectRegistry::sendInvocation): (WebKit::UIRemoteObjectRegistry::messageSender): * UIProcess/Cocoa/UIRemoteObjectRegistry.h: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::setRemoteObjectRegistry): (WebKit::WebPage::remoteObjectRegistry): * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp: Added. (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry): (WebKit::WebRemoteObjectRegistry::~WebRemoteObjectRegistry): (WebKit::WebRemoteObjectRegistry::close): (WebKit::WebRemoteObjectRegistry::messageSender): * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): * WebProcess/WebPage/WebPage.h: 2019-08-26 Jer Noble Removing fullscreen element in rAF() callback after requestFullscreen() can leave fullscreen in inconsistent state. https://bugs.webkit.org/show_bug.cgi?id=201101 Reviewed by Eric Carlson. Add more state to track in which direction the animation is flowing to allow in-process animations to be cancelled more gracefully. * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController requestExitFullScreen]): (-[WKFullScreenWindowController exitFullScreen]): * WebProcess/cocoa/VideoFullscreenManager.h: (WebKit::VideoFullscreenInterfaceContext::animationState const): (WebKit::VideoFullscreenInterfaceContext::setAnimationState): (WebKit::VideoFullscreenInterfaceContext::isAnimating const): Deleted. (WebKit::VideoFullscreenInterfaceContext::setIsAnimating): Deleted. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::didEnterFullscreen): (WebKit::VideoFullscreenManager::didCleanupFullscreen): 2019-08-27 Carlos Garcia Campos Do not clear the pending api request when there's no navigation ID https://bugs.webkit.org/show_bug.cgi?id=201175 Reviewed by Chris Dumez. After r247851, the pending API request URL is cleared for subresources in some cases. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): (WebKit::WebPageProxy::decidePolicyForNavigationAction): 2019-08-27 Zan Dobersek [CoordGraphics] Delay LayerTreeHost creation in always-on AC until DrawingArea painting is enabled https://bugs.webkit.org/show_bug.cgi?id=201178 Reviewed by Carlos Garcia Campos. When in always-on AC mode, the LayerTreeHost spawning should be delayed until the WebPage construction (which sets up the LayerTreeHost-owning DrawingArea implementation) is further done with initializing relevant state, and not immediately after the DrawingArea is done with preference updates. This is necessary in order to enable the LayerTreeHost instance to take into account additional WebPage-creation attributes like the correct device scale factor. Until now, when the LayerTreeHost was spawned in always-on AC mode, the device scale factor was not yet updated in the WebPage construction to the appropriate value, leaving the LayerTreeHost with the default 1.0 value instead of the intended one. DrawingArea::setPaintingEnabled() is repurposed into enablePainting() that is to be called once everything should be set for painting (i.e. when setPaintingEnabled(true) was being called until now). Inside the DrawingAreaProxyCoordinatedGraphics class (only one to provide an implementation for this method), the LayerTreeHost is now spawned if in always-on AC mode. At this point, all relevant state coming from the owning WebPage object should be readily available for the host to correctly set up initial graphics scene. * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): (WebKit::DrawingAreaCoordinatedGraphics::enablePainting): * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::enablePainting): (WebKit::DrawingArea::setPaintingEnabled): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_textAutoSizingAdjustmentTimer): (WebKit::WebPage::reinitializeWebPage): 2019-08-26 Devin Rousso Web Inspector: use more C++ keywords for defining agents https://bugs.webkit.org/show_bug.cgi?id=200959 Reviewed by Joseph Pecoraro. - make constructors `protected` when the agent isn't meant to be constructed directly - add `virtual` destructors that are defined in the *.cpp so forward-declarations work - use `final` wherever possible - add comments to indicate where any virtual functions come from * UIProcess/WebPageInspectorTargetAgent.h: * UIProcess/WebPageInspectorTargetAgent.cpp: 2019-08-26 Chris Dumez Regression: ITP started doing a lot more IPC after its logic was moved to the network process https://bugs.webkit.org/show_bug.cgi?id=201155 Reviewed by John Wilander. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2019-08-26 Wenson Hsieh REGRESSION (iOS 13): Tests that simulate multiple back-to-back single taps fail or time out https://bugs.webkit.org/show_bug.cgi?id=201129 Reviewed by Tim Horton. Adds a new SPI hook in WebKit to let clients know when a synthetic tap gesture that has ended has been reset. See Tools/ChangeLog and LayoutTests/ChangeLog for more details. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _doAfterResettingSingleTapGesture:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _singleTapDidReset:]): (-[WKContentView _doAfterResettingSingleTapGesture:]): 2019-08-26 Brent Fulgham [FTW] Go back to ID2D1Bitmap as our NativeImage type https://bugs.webkit.org/show_bug.cgi?id=201122 Reviewed by Alex Christensen. In Bug 200093 I switched the OS type of NativeImagePtr from ID2D1Bitmap to IWICBitmap. However, this was an ill-advised approach, because it dramatically harmed performance due to the heavy use of software rendering. I originally made this change because I thought this was the only way to get to the backing bits of the bitmaps, but it turns out that a more recent Direct2D data type (ID2D1Bitmap1) has the ability to map its memory to CPU-accessible memory, allowing software filter effects. This patch switches back to the ID2D1Bitap data type, and hooks up the ID2D1Bitmap1 data type to access the underlying memory of the bitmaps when software filter effects are used. Reviewed by Alex Christensen. * Shared/ShareableBitmap.h: * Shared/win/ShareableBitmapDirect2D.cpp: * UIProcess/win/BackingStoreDirect2D.cpp: * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: 2019-08-26 Jiewen Tan [WebAuthn] Support HID authenticators on iOS https://bugs.webkit.org/show_bug.cgi?id=201084 Reviewed by Youenn Fablet. This patch makes the macOS HID implementation available in iOS as well. Mostly, it removes the PLATFORM(MAC) compile time flag. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManagerInternal::collectTransports): * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp: (WebKit::AuthenticatorTransportService::create): (WebKit::AuthenticatorTransportService::createMock): * UIProcess/WebAuthentication/Cocoa/HidConnection.h: * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: * UIProcess/WebAuthentication/Cocoa/HidService.h: * UIProcess/WebAuthentication/Cocoa/HidService.mm: * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: (WebKit::NfcConnection::NfcConnection): A tentative solution before there is an official UI. * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: * UIProcess/WebAuthentication/Mock/MockHidConnection.h: * UIProcess/WebAuthentication/Mock/MockHidService.cpp: * UIProcess/WebAuthentication/Mock/MockHidService.h: * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: * UIProcess/WebAuthentication/fido/CtapHidDriver.h: 2019-08-26 Russell Epstein Unreviewed, rolling out r248961. Same patch was re-landed after being rolled out. Patch is causing Catalina/iOS 13 test failures. Rolling out. Reverted changeset: "Verify Prefetch and credential behavior" https://bugs.webkit.org/show_bug.cgi?id=200000 https://trac.webkit.org/changeset/248961 2019-08-26 Youenn Fablet Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages https://bugs.webkit.org/show_bug.cgi?id=196870 Reviewed by Alex Christensen. Make NetworkProcess provide the session ID for any authentication challenge. In case there is no associated page for the authentication challenge or this is related to a service worker, ask the website data store to take a decision. Add website data store delegate to allow applications to make the decision. Restrict using the delegate to server trust evaluation only. Make ping loads reuse the same mechanism. Covered by service worker tests and updated beacon test. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::sessionID const): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::networkProcess): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveChallenge): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h. * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h. (WebKit::toAuthenticationChallengeDisposition): * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (WebsiteDataStoreClient::WebsiteDataStoreClient): * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/ServiceWorkerProcessProxy.cpp: * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::isServiceWorkerPageID const): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStoreClient.h: (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge): * WebKit.xcodeproj/project.pbxproj: 2019-08-25 Simon Fraser [iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs https://bugs.webkit.org/show_bug.cgi?id=199983 Reviewed by Dean Jackson. Add TransactionID which is a MonotonicObjectIdentifier. This is modeled after ObjectIdentifier<>, but we can't use that because it doesn't have a guarantee of values always increasing by 1 (all derived classes share the same value source). Also, we need a per-RemoteLayerTreeDrawingArea set of values, but a static seed would cause values to be incremented by all RemoteLayerTreeDrawingAreas in a WebProcess. Replace all the bare uint64_t with TransactionID, fixing message generation codegen. * Scripts/webkit/messages.py: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::transactionID const): (WebKit::RemoteLayerTreeTransaction::setTransactionID): * Shared/TransactionID.h: Added. (WebKit::MonotonicObjectIdentifier::MonotonicObjectIdentifier): (WebKit::MonotonicObjectIdentifier::isHashTableDeletedValue const): (WebKit::MonotonicObjectIdentifier::encode const): (WebKit::MonotonicObjectIdentifier::decode): (WebKit::MonotonicObjectIdentifier::operator== const): (WebKit::MonotonicObjectIdentifier::operator> const): (WebKit::MonotonicObjectIdentifier::operator>= const): (WebKit::MonotonicObjectIdentifier::operator< const): (WebKit::MonotonicObjectIdentifier::operator<= const): (WebKit::MonotonicObjectIdentifier::operator!= const): (WebKit::MonotonicObjectIdentifier::increment): (WebKit::MonotonicObjectIdentifier::next const): (WebKit::MonotonicObjectIdentifier::toUInt64 const): (WebKit::MonotonicObjectIdentifier::operator bool const): (WebKit::MonotonicObjectIdentifier::loggingString const): (WebKit::MonotonicObjectIdentifier::hashTableDeletedValue): (WebKit::MonotonicObjectIdentifier::isValidIdentifier): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionID const): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processWillSwapOrDidExit]): * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::commitPotentialTap): (WebKit::WebPageProxy::handleTap): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID const): (WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID const): (WebKit::RemoteLayerTreeDrawingArea::takeNextTransactionID): * WebProcess/WebPage/WebFrame.h: (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad const): (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleTap): (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint): (WebKit::WebPage::commitPotentialTap): 2019-08-24 Chris Dumez Make CacheStorageEngineCaches's decodeCachesNames() more robust against bad input data https://bugs.webkit.org/show_bug.cgi?id=201102 Reviewed by Antti Koivisto. Use Vector::tryReserveCapacity() instead of Vector::reserveInitialCapacity() in CacheStorage::decodeCachesNames() since the size is read from disk and thus cannot be trusted. If the size is too large, reserveInitialCapacity() would end up crashing the network process. Now, we merely discard the data if tryReserveCapacity() fails because the size is too large. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::decodeCachesNames): 2019-08-23 Wenson Hsieh [iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing https://bugs.webkit.org/show_bug.cgi?id=201085 Reviewed by Tim Horton. Currently, logic in applyAutocorrectionInternal only selects the range to autocorrect if the text of the range matches the string to replace (delivered to us from UIKit). In the case of changing "I’" to "I’m", the string to replace is "I'" (with a straight quote rather than an apostrophe), even though the DOM contains an apostrophe. This is because kbd believes that the document context contains straight quotes (rather than apostrophes). For native text views, this works out because UIKit uses relative UITextPositions to determine the replacement range rather than by checking against the contents of the document. However, WKWebView does not have the ability to synchronously compute and reason about arbitrary UITextPositions relative to the selection, so we instead search for the string near the current selection when applying autocorrections. Of course, this doesn't work in this scenario because the replacement string contains a straight quote, yet the text node contains an apostrophe, so we bail and don't end up replacing any text. To address this, we repurpose TextIterator helpers currently used to allow find-in-page to match straight quotes against apostrophes; instead of matching the replacement string exactly, we instead match the quote-folded versions of these strings when finding the range to replace. Test: fast/events/ios/autocorrect-with-apostrophe.html * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applyAutocorrectionInternal): 2019-08-23 Jiewen Tan Unreviewed, build fix after r249059 * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: (WebKit::NfcConnection::NfcConnection): Remove the HAVE() macro. 2019-08-23 Chris Dumez [geolocation] Rename interfaces and remove [NoInterfaceObject] https://bugs.webkit.org/show_bug.cgi?id=200885 Reviewed by Alex Christensen. * Shared/WebGeolocationPosition.cpp: (WebKit::WebGeolocationPosition::create): * Shared/WebGeolocationPosition.h: (WebKit::WebGeolocationPosition::corePosition const): (WebKit::WebGeolocationPosition::WebGeolocationPosition): * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate_c): * UIProcess/WebGeolocationManagerProxy.h: (WebKit::WebGeolocationManagerProxy::lastPosition const): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKLegacyCoreLocationProvider positionChanged:]): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didChangePosition): * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/Geolocation/WebGeolocationManager.messages.in: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::lastPosition): * WebProcess/WebCoreSupport/WebGeolocationClient.h: 2019-08-23 Ryan Haddad Unreviewed, rolling out r249001. Caused one layout test to fail on all configurations and another to time out on Catalina / iOS 13. Reverted changeset: "Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages" https://bugs.webkit.org/show_bug.cgi?id=196870 https://trac.webkit.org/changeset/249001 2019-08-23 Brian Burg REGRESSION(r248713): WebDriver commands which target the implicit main frame now hit an ASSERT https://bugs.webkit.org/show_bug.cgi?id=200793 Reviewed by Chris Dumez. SimulatedInputDispatcher and its callers need to support Optional and WTF::nullopt as an encoding for the implicit main frame. * UIProcess/Automation/SimulatedInputDispatcher.h: * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputDispatcher::resolveLocation): (WebKit::SimulatedInputDispatcher::run): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): (WebKit::WebAutomationSession::performInteractionSequence): (WebKit::WebAutomationSession::cancelInteractionSequence): 2019-08-20 Jiewen Tan [WebAuthn] Support NFC authenticators for iOS https://bugs.webkit.org/show_bug.cgi?id=188624 Reviewed by Chris Dumez. This patch implements support for NFC authenticators including both FIDO2 and U2F ones. It utilizes a private framework called NearField instead of CoreNFC to be able to supply a custom UI later if necessary. The patch follows almost the same flow as previous HID and Local authenticator support. 1) Discovery is via NfcService which will invoke NFHardwareManager to start a generic NFC reader session. 2) Once a reader session is established, a NfcConnection is created to start the polling and register the WKNFReaderSessionDelegate to wait for 'didDetectTags'. 3) When tags are detected, NfcConnection will determine if it meets our requriements: { type, connectability, fido applet availability }. The first tag that meets all requirement will then be returned for WebAuthn operations. 4) The first WebAuthn operation is to send authenticatorGetInfo command to determine the supported protocol, and then initialize corresponding authenticators. Noted, the sending/receiving of this command is now abstracted into FidoService which will be shared across HidService and NfcService. 5) From then, the actual WebAuthn request, either makeCredential or getAssertion will be sent. For testing, this patch follows the same flow as well. 1) MockNfcService overrides NfcService to mock the behavior of NFC Tags discovery. 2) The same class also swizzles methods from NFReaderSession to mock tag connection and communication. * Platform/spi/Cocoa/NearFieldSPI.h: Added. * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManagerInternal::collectTransports): * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp: (WebKit::AuthenticatorTransportService::create): (WebKit::AuthenticatorTransportService::createMock): * UIProcess/WebAuthentication/Cocoa/HidService.h: * UIProcess/WebAuthentication/Cocoa/HidService.mm: (WebKit::HidService::HidService): (WebKit::HidService::deviceAdded): (WebKit::HidService::continueAddDeviceAfterGetInfo): Deleted. * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: Added. (WebKit::fido::compareVersion): (WebKit::NfcConnection::NfcConnection): (WebKit::NfcConnection::~NfcConnection): (WebKit::NfcConnection::transact const): (WebKit::NfcConnection::didDetectTags const): * UIProcess/WebAuthentication/Cocoa/NfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. * UIProcess/WebAuthentication/Cocoa/NfcService.mm: Added. (WebKit::NfcService::NfcService): (WebKit::NfcService::~NfcService): (WebKit::NfcService::didConnectTag): (WebKit::NfcService::startDiscoveryInternal): (WebKit::NfcService::platformStartDiscovery): * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. (-[WKNFReaderSessionDelegate initWithConnection:]): (-[WKNFReaderSessionDelegate readerSession:didDetectTags:]): * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::send): (WebKit::MockHidConnection::registerDataReceivedCallbackInternal): (WebKit::MockHidConnection::parseRequest): (WebKit::MockHidConnection::feedReports): (WebKit::MockHidConnection::shouldContinueFeedReports): * UIProcess/WebAuthentication/Mock/MockNfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. * UIProcess/WebAuthentication/Mock/MockNfcService.mm: Added. (-[WKMockNFTag type]): (-[WKMockNFTag initWithNFTag:]): (-[WKMockNFTag description]): (-[WKMockNFTag isEqualToNFTag:]): (-[WKMockNFTag initWithType:]): (WebKit::MockNfcService::MockNfcService): (WebKit::MockNfcService::transceive): (WebKit::MockNfcService::platformStartDiscovery): (WebKit::MockNfcService::detectTags const): * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h: * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: Added. (WebKit::CtapNfcDriver::CtapNfcDriver): (WebKit::CtapNfcDriver::transact): (WebKit::CtapNfcDriver::respondAsync const): * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. * UIProcess/WebAuthentication/fido/FidoService.cpp: Added. (WebKit::FidoService::FidoService): (WebKit::FidoService::getInfo): (WebKit::FidoService::continueAfterGetInfo): * UIProcess/WebAuthentication/fido/FidoService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h. * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: * UIProcess/WebAuthentication/fido/U2fAuthenticator.h: * UIProcess/ios/WebPageProxyIOS.mm: * WebKit.xcodeproj/project.pbxproj: 2019-08-23 Kate Cheney Support ITP on a per-session basis (198923) https://bugs.webkit.org/show_bug.cgi?id=198923 Reviewed by Chris Dumez. The original implementation of resourceLoadStatisticsUpdated did not allow for ITP on a per session basis due to the sessionID not being passed to the resourceLoadStatisticsUpdated function. This patch allows access of the correct networkSession by passing all resourceLoadStatistics in a new data structure of key-value pairs, where the sessionID is the key. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated): * NetworkProcess/NetworkConnectionToWebProcess.h: * WebProcess/WebProcess.cpp: 2019-08-23 Russell Epstein Unreviewed, rolling out r249031. Causes multiple test failures on iOS simulator Reverted changeset: "[iOS] Should show input view when became first responder if keyboard was showing when the view was resigned" https://bugs.webkit.org/show_bug.cgi?id=200902 https://trac.webkit.org/changeset/249031 2019-08-22 Andy Estes [watchOS] Disable Content Filtering in the simulator build https://bugs.webkit.org/show_bug.cgi?id=201047 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: 2019-08-22 Daniel Bates [iOS] Should show input view when became first responder if keyboard was showing when the view was resigned https://bugs.webkit.org/show_bug.cgi?id=200902 Reviewed by Wenson Hsieh. When resigning first responder save whether the peripheral host has an input view on screen, including the software keyboard, so that we show the input view(s) again when the WKWebView is made first responder. In Safari, this avoids the need for a person to explicitly focus an editable element again to bring up the keyboard when returning to a tab they were previously typing in. It also makes the behavior of switching tabs in Safari with a software keyboard match the behavior of doing the same thing when a hardware keyboard attached. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::focusedElementDidChangeInputMode): Pass a diff of the activity state from the web process to the UI process so that we can differentiate between an inputmode change as a result of page deactivation vs a change caused by some other means. We need to differentiate these cases because we want to ignore a page that sets inputmode "none" (i.e. a request to hide the keyboard) from inside a focus event handler if the handler was called as part of the process of page activation (i.e. switching to the tab). Google Docs is one example of a web site that sets inputmode to "none" as a result of the page activation process. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): Clear out state. (-[WKContentView resignFirstResponderForWebView]): Save whether the peripheral host is on screen into a local before ending the editing session. We then copy the local into the ivar if we actually will resign. This ordering is explicitly done because: 1. Ending the editing session may dismiss the keyboard => we need to query the peripheral host first. 2. If the view is being resigned as a result of a keyboard dismissal (i.e. a person pressed the hide keyboard button on iPad) then the user has indicated that they are finished with the keyboard and we do not want to show the keyboard on page re-activation => we do not want to copy the local to the ivar. 3. If the view refuses to resign itself then it does not make sense to save the keyboard state as responder status hasn't changed. (-[WKContentView shouldShowAutomaticKeyboardUI]): Ignore inputmode="none", if needed. (-[WKContentView _didCommitLoadForMainFrame]): Clear out state. (-[WKContentView isFirstResponderOrBecomingFirstResponder]): Added. (-[WKContentView shouldShowInputViewOnPageActivation:]): Added. (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]): Update ivar if this element is being focused as a result of page activation. (-[WKContentView _didUpdateInputMode:activityStateChanges:]): Modified to take the activity state diff. If the input mode was changed as a result of page activation then we want to update our ivar so that when we call -reloadInputViews and UIKit calls us back in -shouldShowAutomaticKeyboardUI we will know to ignore inputmode set to "none" when determining whether to show the automatic keyboard UI. Note that we do not need to check/track whether an earlier -_elementDidFocus actually started an input session as part of updating the value of our ivar because if an input session was not started, say the embedding client disallowed it, then we would not have a focused element => we early return from this function. Also remove duplication and improve code readbility by making use of the convenience function hasFocusedElement() instead of duplicating what it does. (-[WKContentView _didUpdateInputMode:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::focusedElementDidChangeInputMode): Modified to take the activity state diff and pass it through. (WebKit::WebPageProxy::didReleaseAllTouchPoints): Pass the empty set for the activity state diff to keep our current behavior. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::focusedElementDidChangeInputMode): Send the activity state diff to the UI process. 2019-08-22 Keith Rollin Remove logging that contains a URL https://bugs.webkit.org/show_bug.cgi?id=201052 Reviewed by Chris Dumez. checkURLReceivedFromWebProcess in WebProcessProxy.cpp contains an old logging line that logs a URL. We don't log URLs any more for privacy reasons, so remove this. A search for WTFLogAlways.*url turns up other matches, but those are either false positives or cases where the URLs are logged only on demand by the developer as part of debugging. checkURLReceivedFromWebProcess is the only place where a URL is logged as a matter of course. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess): 2019-08-22 Adrian Perez de Castro [GTK][WPE] Fixes for non-unified builds after r248547 https://bugs.webkit.org/show_bug.cgi?id=201044 Reviewed by Philippe Normand. * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Add missing inclusion of the wtf/CrossThreadCopier.h header. * WebProcess/WebStorage/StorageNamespaceImpl.h: Add missing inclusion of the WebCore/PageIdentifier.h header. 2019-08-22 Alex Christensen Disable legacy TLS versions and add a temporary default to re-enable it https://bugs.webkit.org/show_bug.cgi?id=200945 Reviewed by Brady Eidson. * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::privateSessionParameters): (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-08-17 Darin Adler Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends https://bugs.webkit.org/show_bug.cgi?id=200862 Reviewed by Ryosuke Niwa. * Shared/mac/AuxiliaryProcessMac.mm: (WebKit::setAndSerializeSandboxParameters): Use one append instead of multiple. 2019-08-22 Wenson Hsieh Typing Korean in title field after typing in the body inserts extraneous characters on blog.naver.com https://bugs.webkit.org/show_bug.cgi?id=201023 Reviewed by Ryosuke Niwa. After r242833, we began to avoid sending redundant ElementDidFocus updates in the case where a focused element was blurred and refocused within the same runloop. This was done to prevent the input view from flickering due to input view reloading, as well as scrolling to reveal the focused element, when tapping to change selection on Microsoft Word online. However, on blog.naver.com, these ElementDidFocus messages were necessary in order to ensure that the platform input context changes when moving between the title and body fields, or when tapping to change selection. This is because blog.naver.com uses a hidden contenteditable area under a subframe (see WebCore ChangeLog for more detail here). While text is never directly inserted into this hidden contenteditable, the events are observed and used to "play back" editing in the main visible content area. Thus, when moving between the title and body fields (or when changing selection within either), the only hint we get is that the hidden editable element is blurred and immediately refocused. Since we no longer send ElementDidFocus updates in this scenario, UIKeyboardImpl and kbd are not aware that the page has effectively changed input contexts. Combined with the fact that Korean IME on iOS may insert additional text given the document context (i.e. text that the input manager, kbd, thinks we've previously inserted), this means that when typing several characters into the body field on naver and then switching to edit the title, initial keystrokes may insert unexpected text in the title field. To fix this, we add some hooks to notify the UI process when an element that was blurred has been immediately refocused. Upon receiving this message, the UI process then tells UIKeyboardImpl to re-retrieve its input context, which calls into -requestAutocorrectionContextWithCompletionHandler: in WKContentView. While notorious for being synchronous IPC, this is mitigated by (1) being limiting to only instances where we have a hidden editable area, and (2) being limited by a batching mechanism in the web process, such that if the focused element is blurred, refocused, re-blurred, and refocused many times in the same runloop, we'll only send a single UpdateInputContextAfterBlurringAndRefocusingElement message (as opposed to the many ElementDidFocus messages we would've sent in previous releases). * Platform/spi/ios/UIKitSPI.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add a new mechanism to update the platform input context (on iOS, UIKeyboardImpl's document state) when focus moves away from and immediately returns to a hidden editable element. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::updateInputContextAfterBlurringAndRefocusingElement): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateInputContextAfterBlurringAndRefocusingElement]): Tell the active UIKeyboardImpl to refetch document state from the WKContentView. While this does result in a new autocorrection context request (which, unfortunately, triggers synchronous IPC to the web process), this request would've still happened anyways in the case where we would previously have sent an ElementDidFocus message. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateInputContextAfterBlurringAndRefocusingElement): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::elementDidFocus): In the case where we avoid sending a full ElementDidFocus message to the UI process due to refocusing the same element, we should still notify the UI process so that it can synchronize state between the application process and kbd. See above for more details. (WebKit::WebPage::elementDidBlur): (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded): 2019-08-22 Youenn Fablet Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages https://bugs.webkit.org/show_bug.cgi?id=196870 Reviewed by Alex Christensen. Make NetworkProcess provide the session ID for any authentication challenge. In case there is no associated page for the authentication challenge or this is related to a service worker, ask the website data store to take a decision. Add website data store delegate to allow applications to make the decision. Restrict using the delegate to server trust evaluation only. Make ping loads reuse the same mechanism. Covered by service worker tests and updated beacon test. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::sessionID const): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::networkProcess): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveChallenge): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h. * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h. (WebKit::toAuthenticationChallengeDisposition): * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (WebsiteDataStoreClient::WebsiteDataStoreClient): * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/ServiceWorkerProcessProxy.cpp: * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::isServiceWorkerPageID const): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStoreClient.h: (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge): * WebKit.xcodeproj/project.pbxproj: 2019-08-22 Claudio Saavedra [SOUP] NetworkProcessSoup does not initialize CacheOptions correctly https://bugs.webkit.org/show_bug.cgi?id=200886 Reviewed by Philippe Normand. r247567 wrongly initializes CacheOptions in a local variable that is never used instead of using NetworkProcess's member variable, that is later used by the NetworkSession to initialize the cache. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): 2019-08-21 Tim Horton [Mail] Tapping top of message scrolls back to copied text instead of top of the message https://bugs.webkit.org/show_bug.cgi?id=200999 Reviewed by Wenson Hsieh. In the case where you have a WebCore selection but are not first responder, when you tap the WKWebView to become first responder, EventHandler would bail from setting the selection, assuming UIKit was going to do it. This behavior was introduced in r233311. However, since we are not first responder, UIKit does not change the selection, since it considers the view to not be editable. Fix this by letting WebCore set the selection in this case, as it used to. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::isShowingInputViewForFocusedElement const): Copy the logic from EventHandler, with the added caveat (which fixes the aforementioned behavior) that we will allow EventHandler to change the selection if we don't have a focused node in the UIKit sense, because we know that the platform text interaction code will *not* change the selection if that is the case, so it's up to us. 2019-08-21 Chris Dumez Crash under NetworkCache::Data::mapToFile() https://bugs.webkit.org/show_bug.cgi?id=200996 Reviewed by Geoffrey Garen. Make sure NetworkCache::Data::mapToFile() calls makeSafeToUseMemoryMapForPath() between creating the file and calling mmap(). * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::add): * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::Data::mapToFile const): 2019-08-21 Chris Dumez Have NetworkCache::store() null check its completion handler before calling it https://bugs.webkit.org/show_bug.cgi?id=200994 Reviewed by Geoffrey Garen. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): Stop passing nullptr for the completion handler now that the parameter has a default value. Note that passing nullptr here was likely wrong since the NetworkCache::store() implementation did not null-check the completion handler before calling it. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::store): Have NetworkCache::store() null check its completion handler before calling it as calling a null WTF::Function crashes. * NetworkProcess/cache/NetworkCache.h: Use nullptr as default parameter value for the completion handler. 2019-08-21 Rob Buis Verify Prefetch and credential behavior https://bugs.webkit.org/show_bug.cgi?id=200000 Reviewed by Youenn Fablet. Cancel cross-origin prefetches for Vary: Cookie. Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::didReceiveResponse): * NetworkProcess/cache/PrefetchCache.cpp: (WebKit::PrefetchCache::take): 2019-08-21 Ryosuke Niwa Put keygen element behind a runtime flag and disable it by default https://bugs.webkit.org/show_bug.cgi?id=200850 Reviewed by Antti Koivisto. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetKeygenElementEnabled): (WKPreferencesGetKeygenElementEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2019-08-21 Chris Dumez Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains() https://bugs.webkit.org/show_bug.cgi?id=200986 Reviewed by Brent Fulgham. Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied. The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor does not take care of this for you, despite its name (the createCrossThreadTask() function does though). * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): 2019-08-21 Chris Dumez Add internal setting to disable SecureContext checks https://bugs.webkit.org/show_bug.cgi?id=200980 Reviewed by Alex Christensen. Add internal setting to disable SecureContext checks, in order to facilitate development for features like Service workers or device orientation / motion. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _secureContextChecksEnabled]): (-[WKPreferences _setSecureContextChecksEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2019-08-21 Chris Dumez registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap https://bugs.webkit.org/show_bug.cgi?id=200985 Reviewed by John Wilander. registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap. It is more efficient to simply return a Vector since we never need to look up keys. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor): * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor): * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: (WebKit::domainsToString): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::deleteCookiesForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains): * NetworkProcess/NetworkSession.h: 2019-08-21 Russell Epstein Unreviewed, rolling out r248942. Causes multiple layout test crashes on MacOS Bots Reverted changeset: "Verify Prefetch and credential behavior" https://bugs.webkit.org/show_bug.cgi?id=200000 https://trac.webkit.org/changeset/248942 2019-08-21 Keith Rollin Remove support for watchOS < 6.0 https://bugs.webkit.org/show_bug.cgi?id=200937 Reviewed by Darin Adler. Update conditionals that reference __WATCH_OS_VERSION_MIN_REQUIRED and __WATCH_OS_VERSION_MAX_ALLOWED, assuming that they both have values >= 60000. This means that expressions like "__WATCH_OS_VERSION_MIN_REQUIRED < 60000" are always False and "__WATCH_OS_VERSION_MIN_REQUIRED >= 60000" are always True. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 2019-08-21 Adrian Perez de Castro [GTK] Build failure due to unwieldy definition of “None” from X11 headers https://bugs.webkit.org/show_bug.cgi?id=200984 Reviewed by Carlos Alberto Lopez Perez. * SourcesGTK.txt: Mark AcceleratedBackingStore.cpp with @no-unify because it includes AcceleratedSurfaceX11.h when building with ENABLE_X11_TARGET=ON, which in turn will include the X11 headers. It is just lucky that most of the time the order of the generated #include statements in the unified sources has been masking this problem. 2019-08-21 Rob Buis Verify Prefetch and credential behavior https://bugs.webkit.org/show_bug.cgi?id=200000 Reviewed by Youenn Fablet. Cancel cross-origin prefetches for Vary: Cookie. Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::didReceiveResponse): * NetworkProcess/cache/PrefetchCache.cpp: (WebKit::PrefetchCache::take): 2019-08-21 Pablo Saavedra [WPE] Build failure after r248846 ([WTF] Add makeUnique, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part) https://bugs.webkit.org/show_bug.cgi?id=200973 WPE fails to build with `-DENABLE_WPE_QT_API=ON` after changes done by r248846 in: Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp ; to forces FastMalloc use. Related to: https://bugs.webkit.org/show_bug.cgi?id=200611 https://bugs.webkit.org/show_bug.cgi?id=200620 This patch puts WPEQt... classes into FastMalloc in the same way it was done by many others in r248603. Reviewed by Philippe Normand. * UIProcess/API/wpe/qt/WPEQtView.cpp: (WPEQtView::runJavaScript): * UIProcess/API/wpe/qt/WPEQtViewBackend.h: * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: 2019-08-20 Said Abou-Hallawa [iOS] REGRESSION (248501): gmail.com images are still not shown on some versions of iPhone iOS13 https://bugs.webkit.org/show_bug.cgi?id=200948 Reviewed by Tim Horton. Apply the gmail.com quirk for all iPhone iOS versions till the gmail.com bug is fixed. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformUserAgent const): 2019-08-20 Chris Dumez WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread https://bugs.webkit.org/show_bug.cgi?id=200925 Reviewed by Geoffrey Garen. WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread, which is not safe. Use WeakPtr to address the issue. * Shared/WebSQLiteDatabaseTracker.cpp: (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker): (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction): (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction): * Shared/WebSQLiteDatabaseTracker.h: 2019-08-20 Brent Fulgham [FTW] Fix scrolling in modern WebKit views https://bugs.webkit.org/show_bug.cgi?id=200923 Reviewed by Don Olmstead. The initial implementation of scrolling in Direct2D had errors that caused hilarious rendering glitches. This patch corrects the logic so that page scroll is correct. This patch also fixes a bug that would trigger when resizing windows. * Shared/win/ShareableBitmapDirect2D.cpp: (WebKit::ShareableBitmap::paint): * UIProcess/BackingStore.h: (WebKit::BackingStore::renderTarget): Deleted. * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange): (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange): * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: * UIProcess/win/BackingStoreDirect2D.cpp: (WebKit::BackingStore::paint): (WebKit::BackingStore::incorporateUpdate): (WebKit::BackingStore::scroll): * UIProcess/win/WebView.cpp: (WebKit::WebView::paint): (WebKit::WebView::onSizeEvent): 2019-08-20 Chris Dumez Unsafe usage of CookieStorageObserver from a background thread https://bugs.webkit.org/show_bug.cgi?id=200920 Reviewed by Alex Christensen. * UIProcess/API/APIHTTPCookieStore.h: * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore): 2019-08-20 Chris Dumez Use a strongly typed identifier for StorageNamespace's identifier https://bugs.webkit.org/show_bug.cgi?id=200895 Reviewed by Alex Christensen and Youenn Fablet. Use a strongly typed identifier for StorageNamespace's identifier instead of uint64_t, to avoid type confusion. * NetworkProcess/WebStorage/LocalStorageNamespace.cpp: (WebKit::LocalStorageNamespace::LocalStorageNamespace): * NetworkProcess/WebStorage/LocalStorageNamespace.h: * NetworkProcess/WebStorage/StorageManager.cpp: (WebKit::StorageManager::createSessionStorageNamespace): (WebKit::StorageManager::destroySessionStorageNamespace): (WebKit::StorageManager::cloneSessionStorageNamespace): (WebKit::StorageManager::createLocalStorageArea): (WebKit::StorageManager::createTransientLocalStorageArea): (WebKit::StorageManager::createSessionStorageArea): (WebKit::StorageManager::getOrCreateLocalStorageNamespace): (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace): (WebKit::StorageManager::getOrCreateSessionStorageNamespace): * NetworkProcess/WebStorage/StorageManager.h: * NetworkProcess/WebStorage/StorageManagerSet.cpp: (WebKit::StorageManagerSet::connectToLocalStorageArea): (WebKit::StorageManagerSet::connectToTransientLocalStorageArea): (WebKit::StorageManagerSet::connectToSessionStorageArea): (WebKit::StorageManagerSet::cloneSessionStorageNamespace): * NetworkProcess/WebStorage/StorageManagerSet.h: * NetworkProcess/WebStorage/StorageManagerSet.messages.in: * Scripts/webkit/messages.py: * WebKit.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_textAutoSizingAdjustmentTimer): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sessionStorageNamespaceIdentifier const): * WebProcess/WebPage/WebPageGroupProxy.h: (WebKit::WebPageGroupProxy::localStorageNamespaceIdentifier const): * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::dispatchSessionStorageEvent): (WebKit::StorageAreaMap::dispatchLocalStorageEvent): * WebProcess/WebStorage/StorageNamespaceIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h. * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::createSessionStorageNamespace): (WebKit::StorageNamespaceImpl::createLocalStorageNamespace): (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace): (WebKit::StorageNamespaceImpl::StorageNamespaceImpl): (WebKit::StorageNamespaceImpl::copy): (WebKit::StorageNamespaceImpl::sessionStoragePageID const): (WebKit::StorageNamespaceImpl::pageGroupID const): * WebProcess/WebStorage/StorageNamespaceImpl.h: (WebKit::StorageNamespaceImpl::storageNamespaceID const): * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp: (WebKit::WebStorageNamespaceProvider::getOrCreate): (WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider): (WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider): (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace): (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace): (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace): * WebProcess/WebStorage/WebStorageNamespaceProvider.h: 2019-08-20 Dean Jackson REGRESSION: Open in New Tab is missing from context menu https://bugs.webkit.org/show_bug.cgi?id=200909 Reviewed by Simon Fraser. Don't assume the new API if webView:contextMenuWillPresentForElement: is implemented. * UIProcess/ios/WKContentViewInteraction.mm: (needsDeprecatedPreviewAPI): 2019-08-20 Joseph Pecoraro Web Inspector: Support for JavaScript BigInt https://bugs.webkit.org/show_bug.cgi?id=180731 Reviewed by Devin Rousso. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::WebInspectorUI): Enable BigInt in the Web Inspector process. It only makes use of `globalThis.BigInt(...)` to hold the value. 2019-08-19 Fujii Hironori [CMake] WebKit2.dll can't link because of missing PAL's import symbols for WinCairo port https://bugs.webkit.org/show_bug.cgi?id=200910 Unreviewed build fix for Windows port. * CMakeLists.txt: Added -DSTATICALLY_LINKED_WITH_PAL=1 if PAL_LIBRARY_TYPE is STATIC. 2019-08-19 Fujii Hironori Unreviewed build fix for WinCairo port. The base class of NetworkDataTask has been changed in r248874. * NetworkProcess/curl/NetworkDataTaskCurl.h: (ref): (deref): Call 'ref' and 'deref' of NetworkDataTask instead of RefCounted. 2019-08-19 Keith Rollin Unreviewed build fix for security entitlements. Bug 200242 (r248164) changed the way that entitlements were generated and applied during the build. In that refactoring, the codesign parameter "-o library" was dropped. This change adds it back. * Configurations/BaseXPCService.xcconfig: 2019-08-19 Chris Dumez NetworkDataTask is being ref'd / deref'd from several threads and is not ThreadSafeRefCounted https://bugs.webkit.org/show_bug.cgi?id=200897 Reviewed by Geoffrey Garen. NetworkDataTask subclasses RefCounted and is ref'd / deref'd on the main thread. However, there is code in NetworkDataTaskCocoa::resume() that was ref'ing / deref'ing it on a background thread, which is unsafe. To address the issue, Have NetworkDataTask subclass ThreadSafeRefCounted, and make sure it always gets destroyed on the main thread. * NetworkProcess/NetworkDataTask.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::resume): Avoid some unnecessary refcounting churn. 2019-08-19 Alex Christensen Move call to initializeMainThread introduced in r248549 to after WebKit.framework has been loaded https://bugs.webkit.org/show_bug.cgi?id=200896 Reviewed by Chris Dumez. In XPCServiceMain we haven't been told which WebKit.framework to load yet, so when using staged frameworks it causes problems if we call a function from a WebKit framework. We need to wait until after initializerFunctionPtr is called. * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm: (NetworkServiceInitializer): * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm: (PluginServiceInitializer): * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceMain): * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm: (WebContentServiceInitializer): 2019-08-19 Yusuke Suzuki Unreviewed, build fix for PLATFORM_DRIVEN_TEXT_CHECKING https://bugs.webkit.org/show_bug.cgi?id=200620 It is enabled if PLATFORM(MACCATALYST) is true. * UIProcess/Cocoa/TextCheckingController.h: 2019-08-19 Sihui Liu Remove IDB-specific quota https://bugs.webkit.org/show_bug.cgi?id=196545 Reviewed by Youenn Fablet. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::createIDBServer): (WebKit::NetworkProcess::addIndexedDatabaseSession): (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/C/WKContext.cpp: (WKContextSetIDBPerOriginQuota): Deleted. * UIProcess/API/C/WKContextPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted. * UIProcess/WebProcessPool.h: 2019-08-19 Youenn Fablet Remove SessionID::emptySessionID() https://bugs.webkit.org/show_bug.cgi?id=200811 Reviewed by Alex Christensen. Update SessionID call sites to use toUInt64. Remove debug asserts to isValid since construction of invalid session IDs can only happen in very specific cases typically for HashMaps. * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::storageSession): (WebKit::NetworkConnectionToWebProcess::logUserInteraction): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::networkSession const): (WebKit::NetworkProcess::networkSessionByConnection const): (WebKit::NetworkProcess::setSession): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): (WebKit::NetworkProcess::existingSWOriginStoreForSession const): (WebKit::NetworkProcess::webProcessWasDisconnected): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::maybeRegisterWithSessionIDMap): (WebKit::WebsiteDataStore::existingNonDefaultDataStoreForSessionID): * WebProcess/Cache/WebCacheStorageProvider.cpp: (WebKit::WebCacheStorageProvider::createCacheStorageConnection): * WebProcess/Cache/WebCacheStorageProvider.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::WebSWClientConnection): (WebKit::WebSWClientConnection::initializeConnectionIfNeeded): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_textAutoSizingAdjustmentTimer): 2019-08-19 Yusuke Suzuki Unreviewed, speculative build fix for GTK and WinCairo https://bugs.webkit.org/show_bug.cgi?id=200620 * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: 2019-08-19 Yusuke Suzuki Unreviewed, build fix in WinCairo and GTK ports https://bugs.webkit.org/show_bug.cgi?id=200767 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): 2019-08-19 Youenn Fablet enumerateDevices should return the same JS objects if called twice https://bugs.webkit.org/show_bug.cgi?id=200767 Reviewed by Eric Carlson. Update code as enumerate device request is now gone. Make use of async IPC to simplify code since we are now passing a completion handler directly. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: (WebKit::WebUserMediaClient::enumerateMediaDevices): * WebProcess/WebCoreSupport/WebUserMediaClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-08-18 Yusuke Suzuki [WTF] Add makeUnique, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part https://bugs.webkit.org/show_bug.cgi?id=200620 Reviewed by Geoffrey Garen. * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): (WebKit::DownloadManager::convertNetworkLoadToDownload): (WebKit::DownloadManager::resumeDownload): * NetworkProcess/Downloads/DownloadMap.cpp: (WebKit::DownloadMap::add): * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection): * NetworkProcess/NetworkContentRuleListManager.cpp: (WebKit::NetworkContentRuleListManager::addContentRuleLists): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): (WebKit::NetworkDataTaskBlob::download): * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponse): * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight): (WebKit::NetworkLoadChecker::contentSecurityPolicy): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::switchToNewTestingSession): (WebKit::NetworkProcess::ensureSession): (WebKit::NetworkProcess::swServerForSession): (WebKit::NetworkProcess::initializeQuotaUsers): (WebKit::NetworkProcess::storageQuotaManager): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::addSupplement): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::m_shouldCaptureExtraNetworkLoadMetrics): (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/NetworkSocketChannel.cpp: (WebKit::NetworkSocketChannel::create): * NetworkProcess/PreconnectTask.cpp: * NetworkProcess/WebStorage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate): * NetworkProcess/WebStorage/LocalStorageNamespace.cpp: (WebKit::LocalStorageNamespace::getOrCreateStorageArea): * NetworkProcess/WebStorage/SessionStorageNamespace.cpp: (WebKit::SessionStorageNamespace::getOrCreateStorageArea): * NetworkProcess/WebStorage/StorageArea.cpp: (WebKit::StorageArea::clone const): * NetworkProcess/WebStorage/StorageManager.cpp: (WebKit::StorageManager::createSessionStorageNamespace): (WebKit::StorageManager::getOrCreateLocalStorageNamespace): (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace): (WebKit::StorageManager::getOrCreateSessionStorageNamespace): * NetworkProcess/WebStorage/StorageManagerSet.cpp: (WebKit::StorageManagerSet::add): * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp: (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::Cache): (WebKit::NetworkCache::Cache::makeEntry): (WebKit::NetworkCache::Cache::makeRedirectEntry): (WebKit::NetworkCache::Cache::update): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::decodeStorageRecord): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad): (WebKit::NetworkCache::SpeculativeLoadManager::retrieve): (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry): (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests): (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource): (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::synchronize): (WebKit::NetworkCache::Storage::readRecord): (WebKit::NetworkCache::retrieveFromMemory): (WebKit::NetworkCache::Storage::retrieve): (WebKit::NetworkCache::Storage::store): (WebKit::NetworkCache::Storage::traverse): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord): * NetworkProcess/cache/PrefetchCache.cpp: (WebKit::PrefetchCache::store): (WebKit::PrefetchCache::storeRedirect): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformCreateDefaultStorageSession const): (WebKit::NetworkProcess::networkHTTPSUpgradeChecker): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): (WebKit::NetworkSessionCocoa::create): (WebKit::NetworkSessionCocoa::createWebSocketTask): * NetworkProcess/curl/NetworkProcessCurl.cpp: (WebKit::NetworkProcess::platformCreateDefaultStorageSession const): * NetworkProcess/curl/NetworkSessionCurl.h: * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm: (WebKit::NetworkConnectionToWebProcess::paymentCoordinator): (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::download): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformCreateDefaultStorageSession const): * NetworkProcess/soup/NetworkSessionSoup.cpp: (WebKit::NetworkSessionSoup::NetworkSessionSoup): (WebKit::NetworkSessionSoup::createWebSocketTask): * NetworkProcess/soup/NetworkSessionSoup.h: * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: (webkitSoupRequestInputStreamReadAsync): * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: (WebKit::NetworkMDNSRegister::registerMDNSName): * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdating): * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::NetworkRTCProvider): (WebKit::NetworkRTCProvider::createSocket): (WebKit::NetworkRTCProvider::wrapNewTCPConnection): * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchWorkQueueMessageReceiverMessage): (IPC::Connection::createSyncMessageEncoder): (IPC::Connection::enableIncomingMessagesThrottling): (IPC::Connection::dispatchSyncMessage): * Platform/IPC/Connection.h: (IPC::Connection::send): (IPC::Connection::sendWithAsyncReply): * Platform/IPC/Decoder.cpp: (IPC::Decoder::unwrapForTesting): * Platform/IPC/HandleMessage.h: (IPC::handleMessageAsync): * Platform/IPC/MessageSender.h: * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): (IPC::Connection::open): (IPC::createMessageDecoder): (IPC::Connection::receiveSourceEventHandler): * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): (IPC::Connection::sendOutputMessage): * Platform/IPC/win/ConnectionWin.cpp: (IPC::Connection::readEventHandler): * Platform/mac/LayerHostingContext.mm: (WebKit::LayerHostingContext::createForPort): (WebKit::LayerHostingContext::createForExternalHostingProcess): (WebKit::LayerHostingContext::createForExternalPluginHostingProcess): * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::createPluginInternal): * Shared/API/APIURL.h: (API::URL::create): (API::URL::parseURLIfNecessary const): * Shared/API/Cocoa/RemoteObjectInvocation.mm: (WebKit::RemoteObjectInvocation::decode): * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm: (-[_WKRemoteObjectRegistry _initWithWebPage:]): (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]): (-[_WKRemoteObjectRegistry _sendInvocation:interface:]): * Shared/API/glib/WebKitContextMenuItem.cpp: (webkitContextMenuItemCreate): (webkit_context_menu_item_new): (webkit_context_menu_item_new_from_gaction): (webkit_context_menu_item_new_from_stock_action): (webkit_context_menu_item_new_from_stock_action_with_label): (webkit_context_menu_item_new_with_submenu): (webkit_context_menu_item_new_separator): * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtension::Handle::decode): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::texmapLayer): (WebKit::CoordinatedGraphicsScene::ensureRootLayer): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::ThreadedCompositor): * Shared/Plugins/NPRemoteObjectMap.cpp: (WebKit::NPRemoteObjectMap::registerNPObject): * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::tryLoad): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::RemoteLayerTreeTransaction::decode): * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingCoordinatorTransaction::decode): * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::createGraphicsContext): * Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmap::createGraphicsContext): * Shared/win/ShareableBitmapDirect2D.cpp: (WebKit::ShareableBitmap::createGraphicsContext): * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::registerObserver): * UIProcess/API/C/WKContext.cpp: (WKContextSetInjectedBundleClient): (WKContextSetHistoryClient): (WKContextSetDownloadClient): * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerSetProvider): * UIProcess/API/C/WKNotificationManager.cpp: (WKNotificationManagerSetProvider): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): (WKPageSetPageDiagnosticLoggingClient): (WKPageSetPageFindClient): (WKPageSetPageFindMatchesClient): (WKPageSetPageFormClient): (WKPageSetPageLoaderClient): (WKPageSetPagePolicyClient): (WKPageSetPageUIClient): (WKPageSetPageStateClient): * UIProcess/API/C/mac/WKPagePrivateMac.mm: (-[WKObservablePageState initWithPage:]): * UIProcess/API/C/wpe/WKView.cpp: (WKViewSetViewClient): * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController _initWithPageRef:]): * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: (-[WKHTTPCookieStore addObserver:]): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setDownloadDelegate:]): (-[WKProcessPool _setAutomationDelegate:]): * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addScriptMessageHandler:name:]): (-[WKUserContentController _addScriptMessageHandler:name:userContentWorld:]): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView setAllowsBackForwardNavigationGestures:]): (-[WKWebView _setInputDelegate:]): * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession setDelegate:]): * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (-[_WKRemoteWebInspectorViewController init]): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::readySQLiteStatement): * UIProcess/API/glib/WebKitAutomationSession.cpp: (webkitAutomationSessionConstructed): * UIProcess/API/glib/WebKitContextMenuClient.cpp: (attachContextMenuClientToView): * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp: (attachCustomProtocolManagerClientToContext): * UIProcess/API/glib/WebKitDownloadClient.cpp: (attachDownloadClientToContext): * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (webkitFaviconDatabaseOpen): * UIProcess/API/glib/WebKitFindController.cpp: (webkitFindControllerConstructed): * UIProcess/API/glib/WebKitFormClient.cpp: (attachFormClientToView): * UIProcess/API/glib/WebKitGeolocationManager.cpp: (webkitGeolocationManagerCreate): * UIProcess/API/glib/WebKitIconLoadingClient.cpp: (attachIconLoadingClientToView): * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: (attachInjectedBundleClientToContext): * UIProcess/API/glib/WebKitNotificationProvider.cpp: (WebKitNotificationProvider::WebKitNotificationProvider): * UIProcess/API/glib/WebKitUIClient.cpp: (attachUIClientToView): * UIProcess/API/glib/WebKitUserContentManager.cpp: (webkit_user_content_manager_register_script_message_handler): (webkit_user_content_manager_register_script_message_handler_in_world): * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_set_automation_allowed): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/API/gtk/WebKitEmojiChooser.cpp: (webkitEmojiChooserSetupEmojiSections): * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::handleRequest): * UIProcess/API/gtk/WebKitWebInspector.cpp: (webkitWebInspectorCreate): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseConstructed): (webkitWebViewBaseGestureController): (webkitWebViewBaseDragAndDropHandler): (webkitWebViewBaseDidRelaunchWebProcess): * UIProcess/API/mac/WKView.mm: (-[WKView maybeInstallIconLoadingClient]): (-[WKView initWithFrame:processPool:configuration:]): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::PageClientImpl): (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::View): (WKWPE::View::setClient): * UIProcess/API/wpe/qt/WPEQtView.cpp: (WPEQtView::notifyLoadChangedCallback): (WPEQtView::notifyLoadFailedCallback): (WPEQtView::runJavaScript): * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: (WPEQtViewBackend::create): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::WebAutomationSession): * UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::send): * UIProcess/Cocoa/IconLoadingDelegate.mm: (WebKit::IconLoadingDelegate::createIconLoadingClient): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::createContextMenuClient): (WebKit::UIDelegate::createUIClient): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): (WebKit::WebProcessPool::startDisplayLink): * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::createDrawingAreaProxy): (WebKit::WebViewImpl::setTextIndicator): (WebKit::WebViewImpl::ensureGestureController): * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate): (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing): * UIProcess/DeviceIdHashSaltStorage.cpp: (WebKit::DeviceIdHashSaltStorage::getDataFromDecoder const): (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): * UIProcess/Downloads/DownloadProxyMap.cpp: (WebKit::DownloadProxyMap::createDownloadProxy): * UIProcess/Gamepad/UIGamepadProvider.cpp: (WebKit::UIGamepadProvider::setInitialConnectedGamepads): (WebKit::UIGamepadProvider::platformGamepadConnected): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::createDownloadProxy): (WebKit::NetworkProcessProxy::takeUploadAssertion): * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy): (WebKit::WebNotificationManagerProxy::setProvider): * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::pluginRequiresGtk2): * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::didConnectToProcess): * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator): * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: (WebKit::RemoteLayerTreeNode::createWithPlainLayer): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren): * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS): * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac): * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac): * UIProcess/WebAuthentication/Cocoa/HidService.mm: (WebKit::HidService::deviceAdded): * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy): (WebKit::WebGeolocationManagerProxy::setProvider): * UIProcess/WebMediaSessionFocusManager.cpp: (WebKit::WebMediaSessionFocusManager::setFocusedMediaElement): * UIProcess/WebPageInspectorController.cpp: (WebKit::WebPageInspectorController::WebPageInspectorController): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::m_resetRecentCrashCountTimer): (WebKit::WebPageProxy::setFormClient): (WebKit::WebPageProxy::setUIClient): (WebKit::WebPageProxy::setIconLoadingClient): (WebKit::WebPageProxy::setFindClient): (WebKit::WebPageProxy::setFindMatchesClient): (WebKit::WebPageProxy::setContextMenuClient): (WebKit::WebPageProxy::setInjectedBundleClient): (WebKit::WebPageProxy::suspendCurrentPageIfPossible): (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::setDrawingArea): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::handleWheelEvent): (WebKit::WebPageProxy::processNextQueuedWheelEvent): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::setFullscreenClient): (WebKit::WebPageProxy::userMediaPermissionRequestManager): (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled): (WebKit::WebPageProxy::speechSynthesisData): * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::addProcessIfPossible): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::setInjectedBundleClient): (WebKit::WebProcessPool::setHistoryClient): (WebKit::WebProcessPool::setDownloadClient): (WebKit::WebProcessPool::setAutomationClient): (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient): (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::didCollectPrewarmInformation): (WebKit::WebProcessPool::setWebProcessHasUploads): (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia): * UIProcess/WebProcessProxy.cpp: * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::createBackend): * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::inspect): * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::checkRequirements): * UIProcess/gtk/DragAndDropHandler.cpp: (WebKit::DragAndDropHandler::dragDataSelection): * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::initializeEGL): * UIProcess/ios/EditableImageController.mm: (WebKit::EditableImageController::ensureEditableImage): * UIProcess/ios/WKApplicationStateTrackingView.mm: (-[WKApplicationStateTrackingView didMoveToWindow]): * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): (-[WKContentView initWithFrame:processPool:configuration:webView:]): (-[WKContentView _createDrawingAreaProxy:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView becomeFirstResponderForWebView]): (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::elementDidFocus): (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter): * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::PageClientImpl): * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController initWithWindow:webView:page:]): * UIProcess/mac/WKTextFinderClient.mm: (-[WKTextFinderClient initWithPage:view:usePlatformFindUI:]): * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::inspect): * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::platformStartTask): * UIProcess/win/BackingStoreDirect2D.cpp: (WebKit::BackingStore::createBackend): * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/win/WebView.cpp: (WebKit::WebView::WebView): * WebProcess/Gamepad/WebGamepadProvider.cpp: (WebKit::WebGamepadProvider::setInitialGamepads): (WebKit::WebGamepadProvider::gamepadConnected): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetClient): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetContextMenuClient): (WKBundlePageSetEditorClient): (WKBundlePageSetFormClient): (WKBundlePageSetPageLoaderClient): (WKBundlePageSetResourceLoadClient): (WKBundlePageSetUIClient): * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: (WKBundlePageOverlayCreate): * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm: (WKBundlePageBannerCreateBannerWithCALayer): * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: (WebKit::getOrCreateDOMObjectCacheFrameObserver): (WebKit::DOMObjectCache::put): * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp: (WebKit::WebKitExtensionManager::initialize): * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp: (webkitWebEditorCreate): * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: (webkitWebExtensionCreate): * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkitFrameGetOrCreate): (webkitWebPageCreate): * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm: (-[WKDOMTextIterator initWithRange:]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::InjectedBundle): (WebKit::InjectedBundle::setClient): * WebProcess/Network/WebSocketChannel.cpp: (WebKit::PendingMessage::PendingMessage): (WebKit::WebSocketChannel::send): * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::LibWebRTCProvider::createPeerConnection): (WebKit::LibWebRTCProvider::createSocketFactory): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::createServerTcpSocket): (WebKit::LibWebRTCSocketFactory::createUdpSocket): (WebKit::LibWebRTCSocketFactory::createClientTcpSocket): (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket): (WebKit::LibWebRTCSocketFactory::createAsyncResolver): * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::PluginDestructionProtector::PluginDestructionProtector): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::scheduleTimer): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::deliverData): * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::NetscapePluginX11::create): * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent const): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createColorChooser): (WebKit::WebChromeClient::createDataListSuggestionPicker): * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::showPaintRect): * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: (WebKit::WebPasteboardOverrides::addOverride): * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::ensureBackingStore): (WebKit::PlatformCALayerRemote::setTransform): (WebKit::PlatformCALayerRemote::setSublayerTransform): (WebKit::PlatformCALayerRemote::setFilters): (WebKit::PlatformCALayerRemote::setShapeRoundedRect): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp: (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::flushLayers): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createSubframe): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_textAutoSizingAdjustmentTimer): (WebKit::WebPage::setInjectedBundleContextMenuClient): (WebKit::WebPage::setInjectedBundleEditorClient): (WebKit::WebPage::setInjectedBundleFormClient): (WebKit::WebPage::setInjectedBundlePageLoaderClient): (WebKit::WebPage::setInjectedBundleResourceLoadClient): (WebKit::WebPage::setInjectedBundleUIClient): (WebKit::WebPage::close): (WebKit::WebPage::beginPrinting): * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: (WebKit::WebPrintOperationGtk::print): * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::updateFindIndicator): * WebProcess/WebPage/mac/DrawingAreaMac.cpp: (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::markAllLayersVolatile): (WebKit::WebProcess::ensureAutomationSessionProxy): (WebKit::WebProcess::libWebRTCNetwork): (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::addSupplement): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::Source): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::updateCPUMonitorState): 2019-08-18 Per Arne Vollan [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions https://bugs.webkit.org/show_bug.cgi?id=200543 Reviewed by Brent Fulgham. Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process identifier of the WebContent process. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::sandboxExtensionForType): (WebKit::SandboxExtension::createHandleForReadByPid): * Shared/SandboxExtension.h: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadFile): 2019-08-17 Tim Horton Layout tests that call resizeTo() crash when run on iOS with IOSurface support enabled https://bugs.webkit.org/show_bug.cgi?id=200866 Reviewed by Simon Fraser. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::convertToDeviceSpace): (WebKit::PageClientImpl::convertToUserSpace): Implement convertTo{Device,User}Space in PageClientImplIOS. We don't actually do any conversion. For our purposes, the window is "device" space, and we never allow iOS WebKit clients to resize the window... except for in tests! So just pass the rects straight through, instead of returning an empty rect. 2019-08-17 Eric Liang Use bundlePath SPI in AccessibilitySupport for WebProcessLoader https://bugs.webkit.org/show_bug.cgi?id=200367 Reviewed by Darin Adler. * Platform/spi/ios/AccessibilitySupportSPI.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::accessibilityWebProcessLoaderBundlePath): (WebKit::registerWithAccessibility): 2019-08-17 Sam Weinig Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...) https://bugs.webkit.org/show_bug.cgi?id=200756 Reviewed by Darin Adler. Update call sites for rename from StringBuilder::flexibleAppend(...) to StringBuilder::append(...). * WebProcess/WebPage/WebPage.cpp: (WebKit::dumpHistoryItem): We have to explicitly access the underlying String of the URL rather than relying on the implicit conversion since it is now ambiguous which append(...) overload should be used. 2019-08-17 Devin Rousso Web Inspector: make the initial height bigger when attached https://bugs.webkit.org/show_bug.cgi?id=200855 Reviewed by Joseph Pecoraro. * Shared/WebPreferences.yaml: Increase the default attached height from `300px` to `500px`, which is close to the same amount of area given a 15" MacBook Pro's aspect ratio (default attached width is `750px`). 2019-08-17 Simon Fraser [iOS WK2] Scroll indicators disappear sometimes https://bugs.webkit.org/show_bug.cgi?id=200791 Reviewed by Tim Horton. _web_setSubviews: replaces all of the views subviews with the supplied array, but this blows away views not managed by WebKit, including UIScrollViews scroll indicators. Fix by having WebKit-managed views implement the WKWebKitControlled protocol, and only removing views implementing that protocol. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (-[UIView _web_setSubviews:]): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: 2019-08-17 Antti Koivisto Content in