2017-12-30 Wenson Hsieh [Attachment Support] Remove current macOS support for dragging file-backed attachments https://bugs.webkit.org/show_bug.cgi?id=181188 Reviewed by Dan Bernstein. See WebCore/ChangeLog for more detail. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::setPromisedDataForAttachment): Deleted. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setPromisedDataForAttachment): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::setPromisedDataForAttachment): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setPromisedDataForAttachment): Deleted. * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteAttachment): Deleted. 2017-12-28 Brady Eidson Add a ProcessIdentifier, vended from the UI process, to each child process https://bugs.webkit.org/show_bug.cgi?id=181155 Reviewed by Brent Fulgham. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): Set the process-wide identifier if the initialization parameters have it. Cocoa ASSERTS it exists; non-Cocoa platforms will have to figure this out soon. * Shared/ChildProcess.h: * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getProcessIdentifier): * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::getLaunchOptions): * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::coreProcessIdentifier const): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): 2017-12-28 Yusuke Suzuki Remove std::chrono if it is not used for ArgumentCoder or PersistentCoder https://bugs.webkit.org/show_bug.cgi?id=181174 Reviewed by Konstantin Tokarev. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::retrieve): * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::initialize): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::log const): (WebKit::ViewGestureController::SnapshotRemovalTracker::start): * UIProcess/Cocoa/ViewGestureController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::loadCommitTime const): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::registerWithStateDumper): 2017-12-24 David Kilzer WebKit fixes to enable -Wstrict-prototypes for Safari Reviewed by Dan Bernstein. * Shared/API/c/WKGeometry.cpp: (WKSizeGetTypeID): (WKPointGetTypeID): (WKRectGetTypeID): * Shared/API/c/WKGeometry.h: (WKSizeGetTypeID): (WKPointGetTypeID): (WKRectGetTypeID): * Shared/API/c/WKImage.cpp: (WKImageGetTypeID): * Shared/API/c/WKImage.h: (WKImageGetTypeID): - Add 'void' to C function declarations and implementations as necessary. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: - Add 'void' to block declarations as necessary. 2017-12-24 David Kilzer REGRESSION (r224313): Fix build warning when compiling WebKit.xcassets Reviewed by Dan Bernstein. Fixes the following build warning: Opensource/Source/WebKit/WebKit.xcassets: warning: Failed to read file attributes for "Opensource/Source/WebKit/WebKit.xcassets" Failure Reason: No such file or directory * WebKit.xcodeproj/project.pbxproj: Fix relative path with case-insensitive filesystem and repository name assumptions. 2017-12-22 Jeff Miller Update user-visible copyright strings to include 2018 https://bugs.webkit.org/show_bug.cgi?id=181141 Reviewed by Dan Bernstein. * Info.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: * StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: 2017-12-22 Jeff Miller Allow WebsitePolicies API object to be bridged to _WKWebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=181135 Reviewed by Dan Bernstein. _WKWebsitePolicies already wraps WebsitePolicies, we just never hooked this up in newObject(). * Shared/Cocoa/APIObject.mm: (API::Object::newObject): 2017-12-22 Wenson Hsieh Fix build failures due to using deprecated AppKit symbols https://bugs.webkit.org/show_bug.cgi?id=181110 Reviewed by Dan Bernstein and Tim Horton. See WebCore ChangeLog for more details. * Shared/mac/PasteboardTypes.mm: (WebKit::PasteboardTypes::forEditing): (WebKit::PasteboardTypes::forURL): (WebKit::PasteboardTypes::forImages): (WebKit::PasteboardTypes::forImagesWithArchive): (WebKit::PasteboardTypes::forSelection): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::setIntrinsicContentSize): (WebKit::WebViewImpl::writeSelectionToPasteboard): (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes): (WebKit::WebViewImpl::validateUserInterfaceItem): (WebKit::WebViewImpl::performDragOperation): (WebKit::WebViewImpl::setFileAndURLTypes): (WebKit::WebViewImpl::setPromisedDataForImage): (WebKit::WebViewImpl::setPromisedDataForAttachment): (WebKit::WebViewImpl::provideDataForPasteboard): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _drawPDFDocument:page:atPoint:]): (-[WKPrintingView _drawPreview:]): * UIProcess/mac/WKSharingServicePickerDelegate.mm: (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKMenuTarget forwardContextMenuAction:]): (WebKit::WebContextMenuProxyMac::createContextMenuItem): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::searchTheWeb): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::drawPDFPage): 2017-12-22 Chris Dumez [Service Workers] Implement "Soft Update" algorithm https://bugs.webkit.org/show_bug.cgi?id=180702 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-22 Michael Catanzaro [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds https://bugs.webkit.org/show_bug.cgi?id=179914 Unreviewed. I messed up a last-minute change, and inverted the conditional that determines whether to use the version script. I did test this change to ensure that it worked properly by checking that the library size was correct, but only in non-developer mode. My test was thwarted by -fvisibility=hidden. It looks like so few internal symbols are exported that missing the version script had little impact on the size of the resulting libraries. That's good, I suppose. * PlatformGTK.cmake: * PlatformWPE.cmake: 2017-12-22 Michael Catanzaro [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds https://bugs.webkit.org/show_bug.cgi?id=179914 Reviewed by Carlos Garcia Campos. Mark a few InjectedBundle symbols with default visibility, so they don't get hidden by -fvisibility=hidden. Also, remove Windows conditionals, since Windows is not supported by any GLib ports. Also, move the symbols map to here, and share it between WPE and GTK. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformWPE.cmake: * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: * WebProcess/InjectedBundle/API/glib/WebKitInjectedBundleMain.cpp: * webkitglib-symbols.map: Renamed from Source/cmake/gtksymbols.filter. 2017-12-21 Michael Catanzaro [WPE][GTK] Deprecate and replace webkit_form_submission_request_get_text_fields https://bugs.webkit.org/show_bug.cgi?id=176725 Reviewed by Carlos Garcia Campos. The problem is this function returns results in a GHashTable, but many fields can have the same name, or no name at all, and those fields are currently just dropped. It's impossible to fix, since the GHashTable is part of the API, so deprecate it and add a new function that returns two GPtrArrays instead. * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: (webkitFormSubmissionRequestCreate): (webkit_form_submission_request_get_text_fields): (webkit_form_submission_request_list_text_fields): * UIProcess/API/gtk/WebKitFormSubmissionRequest.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitFormSubmissionRequest.h: 2017-12-21 Youenn Fablet ServiceWorkerThreadProxy should set the correct cookie and cache partitioning options https://bugs.webkit.org/show_bug.cgi?id=181000 Reviewed by Chris Dumez. Update Service Worker WebPreferencesStore based on the first web page added. This allows having the right storage blocking policy. Storing that policy in the context manager to set it properly when creating a new service worker thread proxy. Set up correctly partitioning parameters in the dummy Document used by the service worker. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::updatePreferencesStore): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebProcessPool.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getAuthenticationInfo): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferencesStore): (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-21 Dan Bernstein WKPreferences doesn’t expose editable link behavior https://bugs.webkit.org/show_bug.cgi?id=181111 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKPreferences.mm: (toAPI): Added. Converts WebCore::EditableLinkBehavior to _WKEditableLinkBehavior. (toEditableLinkBehavior): Added. Converts the other way. (-[WKPreferences _editableLinkBehavior]): Added this getter. (-[WKPreferences _setEditableLinkBehavior:]): Ditto. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared new property. 2017-12-21 Andy Estes Address additional review feedback after r226182. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentRequest): 2017-12-21 Jeremy Jones Update FULLSCREEN_API feature defines. https://bugs.webkit.org/show_bug.cgi?id=181015 Reviewed by Tim Horton. Change enabled iphone sdk for FULLSCREEN_API. * Configurations/FeatureDefines.xcconfig: 2017-12-21 John Wilander Storage Access API: Make DocumentLoader::willSendRequest() and WebFrameLoaderClient::detachedFromParent2() tell the network process to get rid of any sub frame access entries https://bugs.webkit.org/show_bug.cgi?id=180728 Reviewed by Youenn Fablet. This change calls the network process to clear any storage access entries when a subframe navigates or is detached. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::removeStorageAccess): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::removeStorageAccess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::removeStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::hasStorageAccess): (WebKit::WebsiteDataStore::requestStorageAccess): (WebKit::WebsiteDataStore::removeStorageAccess): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::detachedFromParent2): (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-21 Jeremy Jones Second Build fix after r226223 https://bugs.webkit.org/show_bug.cgi?id=181089 Unreviewed. * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): 2017-12-21 Jer Noble Add initial DOM support for Media Capabilities https://bugs.webkit.org/show_bug.cgi?id=181064 Reviewed by Eric Carlson. Add a new preference to enable the (disabled-by-default) Media Capabilities API. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaCapabilitiesEnabled): (WKPreferencesGetMediaCapabilitiesEnabled): * UIProcess/API/C/WKPreferencesRef.h: 2017-12-21 Keith Rollin Add optional logging of per-resource cookie information https://bugs.webkit.org/show_bug.cgi?id=180883 Reviewed by Brent Fulgham. In order to support the tracking of the efficacy of Intelligent Tracking Protection, add some logging of the cookie information associated with each loaded resource. This logging is off by default and is enabled with `defaults write -g WebKitLogCookieInformation -bool true`. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::shouldLogCookieInformation const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::sendResultForCacheEntry): (WebKit::NetworkResourceLoader::shouldLogCookieInformation const): (WebKit::NetworkResourceLoader::logCookieInformation const): * NetworkProcess/NetworkResourceLoader.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2017-12-21 Brent Fulgham Unreviewed Debug build fix after r226217 * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: 2017-12-21 Jeremy Jones Element fullscreen interface should display the location https://bugs.webkit.org/show_bug.cgi?id=181006 rdar://problem/36143176 Reviewed by Simon Fraser. Show a short user visible location string with a lock if secure and green when trusted. Includes other interface cleanup and tweaks. * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]): (-[_WKFullScreenViewController visualEffectViewWithFrame:]): (mirrorEdgeInsets): (-[_WKFullScreenViewController _updateLayoutMargins]): (-[_WKFullScreenViewController viewDidLayoutSubviews]): (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): (-[_WKFullScreenViewController createSubviews]): (-[_WKFullScreenViewController loadView]): (-[_WKFullScreenViewController viewDidAppear:]): (-[_WKFullScreenViewController hideCancelButton]): (-[_WKFullScreenViewController showCancelButton:]): (-[_WKFullscreenRootViewController setShowsStatusBar:]): (-[_WKFullscreenRootViewController prefersStatusBarHidden]): (-[WKFullScreenWindowController _invalidateEVOrganizationName]): (-[WKFullScreenWindowController isSecure]): (-[WKFullScreenWindowController _serverTrust]): (-[WKFullScreenWindowController _EVOrganizationName]): (-[WKFullScreenWindowController updateLocationInfo]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[_WKFullScreenViewController prefersStatusBarHidden]): Deleted. * WebKit.xcassets/Done.imageset/Contents.json: Removed. * WebKit.xcassets/LockMini.imageset/Contents.json: Added. * WebKit.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Copied from Source/WebKit/WebKit.xcassets/Done.imageset/Done.pdf. * WebKit.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Renamed from Source/WebKit/WebKit.xcassets/Done.imageset/Done.pdf. 2017-12-21 Jeremy Jones Enable picture-in-picture from inline element on suspend. https://bugs.webkit.org/show_bug.cgi?id=180942 rdar://problem/34745234 Reviewed by Jer Noble. Add support for video fullscreen standby and imporved fullscreen state transition process. Video fullscreen standby allows a video element to have its fullscreen interface state created and continuously updated so that it can quickly change presentation state on application state. In order to accomplish this, this change allows the fullscreen presentation to decide when it needs an updated inline rect, or the presence of the video layer. This is conditionalized until mac supports this model. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenModelContext::requestUpdateInlineRect): (WebKit::VideoFullscreenModelContext::requestVideoContentLayer): (WebKit::VideoFullscreenModelContext::returnVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::requestUpdateInlineRect): (WebKit::VideoFullscreenManagerProxy::requestVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::returnVideoContentLayer): * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::didEnterFullScreen): (WebKit::WebFullScreenManager::willExitFullScreen): * WebProcess/FullScreen/WebFullScreenManager.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::supportsVideoFullscreenStandby): (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/cocoa/VideoFullscreenManager.h: (WebKit::VideoFullscreenInterfaceContext::fullscreenStandby const): (WebKit::VideoFullscreenInterfaceContext::setFullscreenStandby): * WebProcess/cocoa/VideoFullscreenManager.messages.in: * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const): (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::requestUpdateInlineRect): (WebKit::VideoFullscreenManager::requestVideoContentLayer): (WebKit::VideoFullscreenManager::returnVideoContentLayer): (WebKit::VideoFullscreenManager::didSetupFullscreen): (WebKit::VideoFullscreenManager::didExitFullscreen): (WebKit::VideoFullscreenManager::didCleanupFullscreen): 2017-12-20 Eric Carlson [MediaStream] Add screen capture IDL and stub functions https://bugs.webkit.org/show_bug.cgi?id=181070 Reviewed by Youenn Fablet. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _screenCaptureEnabled]): (-[WKPreferences _setScreenCaptureEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-12-20 Youenn Fablet Crash when clearing std::optional https://bugs.webkit.org/show_bug.cgi?id=181061 Reviewed by Alex Christensen. * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didFinishBlobLoading): moving the object to not destroy 'this' too soon. 2017-12-20 Youenn Fablet Support service worker interception of request with blob body https://bugs.webkit.org/show_bug.cgi?id=181035 Reviewed by Chris Dumez. In case of service worker, remove the connection check to get access to the blob registry. Apply this for cloning blobs registered by another process. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURL): 2017-12-20 Daniel Bates Remove Alternative Presentation Button https://bugs.webkit.org/show_bug.cgi?id=180500 Reviewed by Simon Fraser. We no longer need the alternative presentation button. * Configurations/FeatureDefines.xcconfig: * UIProcess/API/APIUIClient.h: (API::UIClient::didClickAlternativePresentationButton): Deleted. * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleAutoFillButtonClick): (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: (API::InjectedBundle::PageUIClient::didClickAutoFillButton): (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Deleted. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Deleted. (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Deleted. (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Deleted. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleFrameFocus): (WKBundleSubstituteWithAlternativePresentationButton): Deleted. (WKBundleRemoveAlternativePresentationButton): Deleted. (WKBundleElementsReplacedByAlternativePresentationButton): Deleted. * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h: * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Deleted. * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-12-20 Andy Estes [Apple Pay] Tell PassKit whether Apple Pay JS or Payment Request was used to start an Apple Pay session https://bugs.webkit.org/show_bug.cgi?id=181001 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toAPIType): (WebKit::toPKPaymentRequest): 2017-12-20 Ms2ger REGRESSION(r226160) Build broken when MEDIA_STREAM is disabled with MediaStreamRequest namespace confusion https://bugs.webkit.org/show_bug.cgi?id=181026 Unreviewed build fix. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Remove UNUSED_PARAM macros that check for (undefined) members rather than params. 2017-12-19 Myles C. Maxfield Refactor user-installed font setting for clarity https://bugs.webkit.org/show_bug.cgi?id=181013 Reviewed by Simon Fraser. There are no clients of this SPI yet, so we can rename it to remove the grammatical negative. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetShouldAllowUserInstalledFonts): (WKPreferencesGetShouldAllowUserInstalledFonts): (WKPreferencesSetShouldDisallowUserInstalledFonts): Deleted. (WKPreferencesGetShouldDisallowUserInstalledFonts): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldAllowUserInstalledFonts]): (-[WKPreferences _setShouldAllowUserInstalledFonts:]): (-[WKPreferences _shouldDisallowUserInstalledFonts]): Deleted. (-[WKPreferences _setShouldDisallowUserInstalledFonts:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-12-19 Eric Carlson [MediaStream] Clean up RealtimeMediaSource interfaces https://bugs.webkit.org/show_bug.cgi?id=180934 Reviewed by Youenn Fablet. * Shared/WebCoreArgumentCoders.h: Update CaptureDevice encoder. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Renamed from createRequest. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Update for API change. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter the vector returned by getMediaStreamDevices. (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): Update for API change. (WebKit::UserMediaPermissionRequestProxy::allow): Ditto. * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::requestType const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Ditto. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): m_blockedRequests -> m_blockedUserMediaRequests. (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): Ditto. (WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto. (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: 2017-12-19 Jer Noble Playing media elements which call "pause(); play()" will have the play promise rejected. https://bugs.webkit.org/show_bug.cgi?id=180781 Reviewed by Eric Carlson. shouldRequireUserGestureToLoadVideo() should default to false on Mac. * UIProcess/API/Cocoa/WKWebView.mm: (shouldRequireUserGestureToLoadVideo): 2017-12-19 Chris Dumez Handle Fetch should wait for the service worker's state to become activated https://bugs.webkit.org/show_bug.cgi?id=180959 Reviewed by Youenn Fablet. Handle Fetch should wait for the service worker's state to become activated when it is currently activating. Specification: - https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (Step 16) * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): 2017-12-19 Youenn Fablet Service Worker should not clean HTTP headers added by the application or by fetch specification before service worker interception https://bugs.webkit.org/show_bug.cgi?id=180939 Reviewed by Chris Dumez. Passing referrer as an explicit parameter of StartFetch. Cleaning request headers based on ResourceLoaderOptions.httpHeadersToKeep. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::start): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-19 Andy Estes [Apple Pay] Stop maintaining a list of payment networks https://bugs.webkit.org/show_bug.cgi?id=180965 Reviewed by Tim Horton. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: Defined availablePaymentNetworks. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toSupportedNetworks): (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks): Called +[PKPaymentRequest availableNetworks]. (WebKit::toSupportedNetwork): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): Set parameters.availablePaymentNetworks by calling WebPaymentCoordinatorProxy::availablePaymentNetworks. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Set pageConfiguration.availablePaymentNetworks to parameters.availablePaymentNetworks. 2017-12-18 Brady Eidson Add ability to API test Service Workers via a custom protocol. https://bugs.webkit.org/show_bug.cgi?id=180911 Reviewed by Chris Dumez. This adds a set of "Service Workers can handle this" schemes to the scheme registry and most of these WebKit changes are to support getting those values out to all processes. Additionally, WebsiteDataRecords used to be file/http(s)-only. That seems bizarre and definitely got in the way of testing. So I also added a way to allow any scheme to result in a valid record. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const): * Shared/ChildProcess.h: * Shared/ChildProcess.messages.in: * Shared/Storage/StorageProcessCreationParameters.cpp: (WebKit::StorageProcessCreationParameters::encode const): (WebKit::StorageProcessCreationParameters::decode): * Shared/Storage/StorageProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::initializeWebsiteDataStore): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _registerURLSchemeServiceWorkersCanHandle:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::allowWebsiteDataRecordsForAllOrigins): (WebKit::WebsiteDataStore::fetchDataAndApply): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-12-18 Brady Eidson Apps that use both WK1 and WK2 can crash creating a WKWebsiteDataStore. https://bugs.webkit.org/show_bug.cgi?id=180953 Reviewed by Chris Dumez. * UIProcess/WebsiteData/WebsiteDataStore.cpp: Make an isMainThread() asset be an isUIThread() assert. 2017-12-18 Brent Fulgham [macOS, iOS] Add new mach lookup port for CoreMedia remote control https://bugs.webkit.org/show_bug.cgi?id=180938 Reviewed by Eric Carlson. Update the app sandbox to support a new XPC endpoint for CoreMedia. This endpoint exposes existing functions through a new, more-focused interface. This will (hopefully) allow us to remove the more generic endpoints in a future update. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2017-12-18 Megan Gardner Support Autoscrolling in contenteditable for WK2 https://bugs.webkit.org/show_bug.cgi?id=180789 Reviewed by Simon Frasier and Wenson Hsieh. Implements the UIKit protocol for autoscrolling and alerts the Web Process to start (or stop) an autoscroll to the specified position. Allows for scrolling in contenteditable in WebKit2. * Platform/spi/ios/UIKitSPI.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView startAutoscroll:]): (-[WKContentView cancelAutoscroll]): (-[WKContentView scrollSelectionToVisible:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAutoscrollAtPosition): (WebKit::WebPageProxy::cancelAutoscroll): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::startAutoscrollAtPosition): (WebKit::WebPage::cancelAutoscroll): 2017-12-18 Youenn Fablet Add support for response blob given to fetch events https://bugs.webkit.org/show_bug.cgi?id=180894 Reviewed by Darin Adler. In case of blob data, read it from Service Worker process and send it to WebProcess. At some point, web process should be able to read it directly from NetworkProcess. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk): (WebKit::WebServiceWorkerFetchTaskClient::didFinishBlobLoading): (WebKit::WebServiceWorkerFetchTaskClient::didFinish): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: 2017-12-18 Daniel Bates Add SPI to query for the current and last auto fill button type and pass user data object to _webView:focusShouldStartInputSession: https://bugs.webkit.org/show_bug.cgi?id=180774 Reviewed by Tim Horton. Have WKFocusedElementInfo own the optional user data object associated with the focused element as opposed to having WKFormInputSession own it. This allows the Injected Bundle's _webView:focusShouldStartInputSession: delegate callback to make use of this user data to determine whether focus should start a new input session. * UIProcess/API/Cocoa/_WKFocusedElementInfo.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession initWithContentView:focusedElementInfo:]): (-[WKFormInputSession userObject]): (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): (-[WKFocusedElementInfo userObject]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): (-[WKFormInputSession initWithContentView:focusedElementInfo:userObject:]): Deleted. (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:]): Deleted. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (toWKAutoFillButtonType): (-[WKWebProcessPlugInNodeHandle htmlInputElementAutoFillButtonType]): (-[WKWebProcessPlugInNodeHandle htmlInputElementLastAutoFillButtonType]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (toWKAutoFillButtonType): (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonType): (WKBundleNodeHandleGetHTMLInputElementLastAutoFillButtonType): * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonType const): (WebKit::InjectedBundleNodeHandle::htmlInputElementLastAutoFillButtonType const): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: 2017-12-18 Carlos Garcia Campos [GTK][WPE] Add WebKitWebView::web-process-terminated signal and deprecate web-process-crashed https://bugs.webkit.org/show_bug.cgi?id=180862 Reviewed by Michael Catanzaro. Once the memory pressure web process monitor is enabled in bug #180861 the web process can be killed due to memory limits. We need to expose the reason of the web process termination to allow applications handle the memory limit case. * UIProcess/API/glib/WebKitNavigationClient.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewWebProcessTerminated): (webkitWebViewWebProcessCrashed): Deleted. * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebView.h: 2017-12-18 Carlos Garcia Campos [GTK][WPE] Enable WebProcess memory monitor https://bugs.webkit.org/show_bug.cgi?id=180861 Reviewed by Michael Catanzaro. For some reason this is only enabled in mac. We want to enable it also in GTK and WPE ports. This runs every 30 seconds to release memory or even kill the process if necessary. Carlos López has realized that in some applications using video tags, the memory grows a lot and it's never released. It seems it's not memory leaked, but simply large memory allocations (I guess it's gst allocating video frames) that make the heap grow. The memory pressure calls malloc_trim that releases all that memory keeping the web process footprint stable. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-12-17 John Wilander Storage Access API: Make document.hasStorageAccess() retrieve current status from the network process https://bugs.webkit.org/show_bug.cgi?id=180681 Reviewed by Alex Christensen. This change makes an asynchronous request to the network process to see if storage access has been granted for this frame, on this page, for this domain. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): (WebKit::WebsiteDataStore::hasStorageAccess): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::hasStorageAccess): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::hasStorageAccess): * WebProcess/WebPage/WebPage.h: 2017-12-16 Dan Bernstein WKWebView has no equivalent of -[WebView setAlwaysShowVerticalScroller:] https://bugs.webkit.org/show_bug.cgi?id=180613 Reviewed by Geoff Garen. Added _alwaysShowsHorizontalScroller and _alwaysShowsVerticalScroller properties to WKWebView. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): Encode new alwaysShowsHorizontalScroller and alwaysShowsVerticalScroller parameters. (WebKit::WebPageCreationParameters::decode): Decode new parameters. * Shared/WebPageCreationParameters.h: Added new alwaysShowsHorizontalScroller and alwaysShowsVerticalScroller boolean parameters. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _alwaysShowsHorizontalScroller]): New accessor that calls through to the WebPageProxy. (-[WKWebView _setAlwaysShowsHorizontalScroller:]): Ditto. (-[WKWebView _alwaysShowsVerticalScroller]): Ditto. (-[WKWebView _setAlwaysShowsVerticalScroller:]): Ditto. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declare new properties. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller): Update member variable and send a message to the page. (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller): Ditto. (WebKit::WebPageProxy::creationParameters): Initialize new parameters from the new member variables. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::alwaysShowsHorizontalScroller const): New getter. (WebKit::WebPageProxy::alwaysShowsVerticalScroller const): Ditto. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Factor alwaysShowsHorizontalScroller and alwaysShowsVerticalScroller into the initial scroller modes and scroller locks when creating the FrameView. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Initialize new m_alwaysShowsHorizontalScroller and m_alwaysShowsVerticalScroller member variables from the corresponding new creation parameters. (WebKit::WebPage::setAlwaysShowsHorizontalScroller): Update the member variable and set new scrollbar mode on the frame view if needed. (WebKit::WebPage::setAlwaysShowsVerticalScroller): Ditto. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::alwaysShowsHorizontalScroller const): New getter. (WebKit::WebPage::alwaysShowsVerticalScroller const): Ditto. * WebProcess/WebPage/WebPage.messages.in: Added new messages. 2017-12-16 Brady Eidson Implement getting ServiceWorker registrations for the WKWebsiteDataStore API https://bugs.webkit.org/show_bug.cgi?id=180886 Reviewed by Chris Dumez. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::fetchWebsiteData): 2017-12-16 Brent Fulgham Plugin processes are repeatedly spun up to do nothing https://bugs.webkit.org/show_bug.cgi?id=180885 Reviewed by Geoffrey Garen. Tested by TestWebKitAPI. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): Don't ask plugins to remove data when no websites are passed to the function. 2017-12-15 Chris Dumez Support updating a service worker registration's updateViaCache flag https://bugs.webkit.org/show_bug.cgi?id=180888 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::setRegistrationUpdateViaCache): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-15 Alex Christensen Introduce SPI _WKWebsitePolicies.websiteDataStore https://bugs.webkit.org/show_bug.cgi?id=180880 Reviewed by Andy Estes. The SPI doesn't do anything yet, but it already has some restrictions and tests! WKWebView._updateWebsitePolicies can't be used to update a WKWebsiteDataStore. Only during navigation. Even during navigation, we are only supporting the default and ephemeral data stores right now. This functionality won't be supported in the C API. This is enforced with RELEASE_ASSERTs. If we change our minds, we can change them and add restrictions similar to the ObjC restrictions. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::WebsitePolicies): (API::WebsitePolicies::setWebsiteDataStore): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKPage.cpp: (WKPageUpdateWebsitePolicies): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies websiteDataStore]): (-[_WKWebsitePolicies setWebsiteDataStore:]): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 2017-12-15 Alex Christensen Fix GTK build. * UIProcess/API/glib/WebKitPolicyDecision.cpp: (webkit_policy_decision_use): 2017-12-15 Brent Fulgham Avoid waking plugin process up unnecessarily https://bugs.webkit.org/show_bug.cgi?id=180819 Reviewed by Geoffrey Garen. WebKit purges data from origins marked as prevalent on an hourly interval. This includes waking up plugins and removing relevant data stored in those plugins. This causes multiple plugin processes to be spawned, even though the user is not interacting with any plugins. Instead, we should delay removing data from plugins until they are loaded due to the user interacting with a website using a plugin. Make the following changes: 1. When looking for plugin data related to prevalent sites, only examine plugin data if the relevant plugin is already running. 2. When the state of the active plugins changes, trigger a data removal check. * Shared/WebsiteData/WebsiteDataFetchOption.h: Add a new option 'DoNotCreateProcesses' * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::getPluginProcessConnection): Pass new argument 'Launch', since we always want to launch processes in this case. (WebKit::PluginProcessManager::fetchWebsiteData): Pass a new parameter 'processAccessType' so that the caller can specify if they only want to examine already-active plugins, or if they want to spawn new processes. Call the completion handler if we need to exit early when no process exists. (WebKit::PluginProcessManager::deleteWebsiteData): Always launch new processes. (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames): Ditto. (WebKit::PluginProcessManager::getOrCreatePluginProcess): Accept new parameter indicating if new processes shoudl be launched. Also switch to C++ style loops. * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Use the new 'DoNotCreatePrcesses' access type. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Update the active plugin count when we remove data. (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords const): Return true if the active plugin process count changed since the last time data was removed. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): Check fetch option for new 'DoNotCreateProcesses' flag, and tell the PluginProcessManager which mode we are using. 2017-12-15 Brady Eidson Make sure only WebsiteDataStores with valid SessionIDs register themselves. https://bugs.webkit.org/show_bug.cgi?id=180869 Reviewed by Chris Dumez. Some code in WebsiteDataStore assumes an invalid SessionID is a possibility, but we didn't account for that in the map added in r225935. Seems prudent to make sure we're not doing hash table operations with invalid keys. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::maybeRegisterWithSessionIDMap): (WebKit::WebsiteDataStore::existingNonDefaultDataStoreForSessionID): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-12-14 Simon Fraser Rotating when zoomed in with fingers down can result in a broken tab https://bugs.webkit.org/show_bug.cgi?id=180859 rdar://problem/34532817 Reviewed by Tim Horton. If you zoom in fully, then, with two fingers down, rotate the iPhone and rotate back, then the tab can get into a broken state where the WKContentView has a non-zero position which may push it entirely off-screen. The tab never recovers. This is caused by a bug in UIKit (rdar://problem/36065495) so work around it by always re-setting the position of the content view after zooming. We initialize contentView.frame from self.bounds, so setting the position (via "center") to the bounds origin should always be safe. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): 2017-12-15 Brady Eidson API test WebKit.WebsiteDataStoreCustomPaths is failing https://bugs.webkit.org/show_bug.cgi?id=180870 Reviewed by Chris Dumez. To avoid unintentionally creating the default WebsiteDataStore we need to pass around the relevant SessionID to more places. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::start): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getStorageProcessConnection): (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getStorageProcessConnection): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::messageSenderConnection): * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureWebToStorageProcessConnection): (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-12-15 Alex Christensen Move WebKit::WebsitePolicies to API::WebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=180873 Reviewed by Joseph Pecoraro. It's just an API data object now. I need it to be in the API namespace so we can give it references to other API namespace objects without weird layering violations. * CMakeLists.txt: * Shared/WebsiteAutoplayPolicy.h: Added. * Shared/WebsiteAutoplayQuirk.h: Added. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::fromWebsitePolicies): Deleted. * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: Added. (API::WebsitePolicies::~WebsitePolicies): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: Copied from Source/WebKit/UIProcess/WebsitePolicies.h. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKPage.cpp: (WKPageUpdateWebsitePolicies): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesGetTypeID): (WKWebsitePoliciesCreate): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies dealloc]): (-[_WKWebsitePolicies init]): * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: (WebKit::wrapper): Deleted. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/WebFormSubmissionListenerProxy.cpp: * UIProcess/WebsitePolicies.h: Removed. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: 2017-12-14 Zan Dobersek Unreviewed GTK+ build fix after r225954. * UIProcess/API/glib/WebKitPolicyDecision.cpp: Explicitly include the WebsitePoliciesData.h header, avoiding build failures due to incomplete WebsitePoliciesData type. 2017-12-14 David Kilzer Enable -Wstrict-prototypes for WebKit Rubber-stamped by Joseph Pecoraro. * Configurations/Base.xcconfig: (CLANG_WARN_STRICT_PROTOTYPES): Add. Set to YES. * Platform/spi/ios/UIKitSPI.h: (_UIDragInteractionDefaultLiftDelay): Add 'void' to C function declaration. (UIKeyboardEnabledInputModesAllowOneToManyShortcuts): Ditto. 2017-12-14 Alex Christensen Serialize WebsitePoliciesData instead of WebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=180847 Reviewed by Joseph Pecoraro. No change in behavior. This will allow me to add things to WebsitePolicies that have a different form when serialized to another process. Also, remove API::WebsitePolicies because the wrapper isn't necessary. WebsitePolicies is now the API type that only exists in the UIProcess. * Shared/WebsitePolicies.cpp: Removed. * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::contentBlockersEnabled const): Deleted. (WebKit::WebsitePolicies::setContentBlockersEnabled): Deleted. (WebKit::WebsitePolicies::allowedAutoplayQuirks const): Deleted. (WebKit::WebsitePolicies::setAllowedAutoplayQuirks): Deleted. (WebKit::WebsitePolicies::autoplayPolicy const): Deleted. (WebKit::WebsitePolicies::setAutoplayPolicy): Deleted. (WebKit::WebsitePolicies::customHeaderFields): Deleted. (WebKit::WebsitePolicies::takeCustomHeaderFields): Deleted. (WebKit::WebsitePolicies::setCustomHeaderFields): Deleted. * Shared/WebsitePoliciesData.cpp: Copied from Source/WebKit/Shared/WebsitePolicies.cpp. (WebKit::WebsitePoliciesData::fromWebsitePolicies): (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): (WebKit::WebsitePolicies::WebsitePolicies): Deleted. (WebKit::WebsitePolicies::encode const): Deleted. (WebKit::WebsitePolicies::decode): Deleted. (WebKit::WebsitePolicies::applyToDocumentLoader): Deleted. * Shared/WebsitePoliciesData.h: Added. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::decidePolicyForNavigationAction): (API::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/API/APIPolicyClient.h: (API::PolicyClient::decidePolicyForNavigationAction): (API::PolicyClient::decidePolicyForNewWindowAction): (API::PolicyClient::decidePolicyForResponse): * UIProcess/API/APIWebsitePolicies.cpp: Removed. * UIProcess/API/APIWebsitePolicies.h: Removed. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUse): (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKPage.cpp: (WKPageUpdateWebsitePolicies): (WKPageSetPagePolicyClient): (WKPageSetPageNavigationClient): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesGetTypeID): (WKWebsitePoliciesCreate): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies dealloc]): (-[_WKWebsitePolicies init]): * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: (WebKit::wrapper): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/WebFrameListenerProxy.cpp: (WebKit::WebFrameListenerProxy::receivedPolicyDecision): * UIProcess/WebFrameListenerProxy.h: * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * UIProcess/WebFramePolicyListenerProxy.h: * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::receivedPolicyDecision): * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::updateWebsitePolicies): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::applyToDocumentLoader): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): (WebKit::WebPage::updateWebsitePolicies): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-14 Ryan Haddad Unreviewed, rolling out r225931. Breaks internal builds. Reverted changeset: "Fix Mac CMake build" https://bugs.webkit.org/show_bug.cgi?id=180835 https://trac.webkit.org/changeset/225931 2017-12-14 Chris Dumez Clearing WebSite data on iOS does not clear the Fetch Cache https://bugs.webkit.org/show_bug.cgi?id=180846 Reviewed by Youenn Fablet. When clearing WebSite data, construct the engine for the given sessionID if missing, instead of not clearing anything when the engine is missing. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): 2017-12-14 Chris Dumez self.importScripts() should obey updateViaCache inside service workers https://bugs.webkit.org/show_bug.cgi?id=180826 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::setRegistrationLastUpdateTime): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-14 Yusuke Suzuki Drop Thread::tryCreate https://bugs.webkit.org/show_bug.cgi?id=180808 Reviewed by Darin Adler. We still return bool since IconDatabase::open returns `false` if it is opened twice. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::open): * UIProcess/API/glib/IconDatabase.h: 2017-12-14 Brady Eidson REGRESSION (r225789): API tests WKProcessPool.InitialWarmedProcessUsed and WebKit.WebsiteDataStoreCustomPaths are failing. https://bugs.webkit.org/show_bug.cgi?id=180722 Reviewed by Chris Dumez. - Add a test-only accessor to get the number of WebProcesses hosting WebPages - Have WebsiteDataStore keep track of all instances so they can be looked up by SessionID - When the StorageProcess needs to establish a SW context connection on behalf of a specific SessionID, the UI process will now prefer using the WebsiteDataStore associated with that SessionID. This allows us to continue deferring creation of the default data store if it's not needed. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::connectionToContextProcessWasClosed): (WebKit::StorageProcess::createServerToContextConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishSWServerConnection): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webPageContentProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess): (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::existingDataStoreForSessionID): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-12-14 John Wilander Storage Access API: Implement frame-specific access in the document.cookie layer https://bugs.webkit.org/show_bug.cgi?id=180682 Reviewed by Alex Christensen. CookiesStrategy::cookiesForDOM(), CookiesStrategy::setCookiesFromDOM(), CookiesStrategy::cookieRequestHeaderFieldValue(), and CookiesStrategy::getRawCookies() now take optional parameters for frameID and pageID to allow frame-specific scoping of cookies. This change makes the return values of FrameLoaderClient::frameID() and FrameLoaderClient::pageID() std::optional so that WebCore can call those getters and get the right return values in WebKit and std:nullopt in WebKitLegacy. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): (WebKit::NetworkConnectionToWebProcess::getRawCookies): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): Now handles the fact that FrameLoaderClient::frameID() and FrameLoaderClient::pageID() return an optional. * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::pageID const): (WebKit::WebFrameLoaderClient::frameID const): Now return an optional. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): (WebKit::WebPlatformStrategies::setCookiesFromDOM): (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): (WebKit::WebPlatformStrategies::getRawCookies): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-12-14 Alex Christensen Fix Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=180835 Reviewed by Andy Estes. * PlatformMac.cmake: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::ephemeralParametersWithSessionID): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/APIAttachment.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSessionID): 2017-12-14 Alex Christensen Use move semantics for SandboxExtension::Handle https://bugs.webkit.org/show_bug.cgi?id=180792 Reviewed by Andy Estes. Passing them around as const SandboxExtension::Handle& is wrong because ownership is transferred and they are consumed. It only works now because their contents are mutable, which isn't a good use of mutable. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::decideDestinationWithSuggestedFilename): (WebKit::Download::didDecideDownloadDestination): * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueDecidePendingDownloadDestination): (WebKit::DownloadManager::resumeDownload): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): * NetworkProcess/Downloads/ios/DownloadIOS.mm: (WebKit::Download::resume): * NetworkProcess/Downloads/mac/DownloadMac.mm: (WebKit::Download::resume): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL): (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::setPendingDownloadLocation): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation): * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::resumeDownload): (WebKit::NetworkProcess::continueDecidePendingDownloadDestination): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation): * Shared/SandboxExtension.h: (WebKit::SandboxExtension::create): * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::start): (WebKit::WebMemorySampler::initializeSandboxedLogFile): * Shared/WebMemorySampler.h: * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtension::create): * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): * StorageProcess/StorageProcess.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dragEntered): (WebKit::WebPageProxy::dragUpdated): (WebKit::WebPageProxy::dragExited): (WebKit::WebPageProxy::performDragOperation): (WebKit::WebPageProxy::performDragControllerAction): * UIProcess/WebPageProxy.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::create): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: (WebKit::MediaDeviceSandboxExtensions::operator[]): (WebKit::MediaDeviceSandboxExtensions::operator[] const): Deleted. * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getPathnamesForType): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::goToItem): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): (WebKit::WebPage::reload): (WebKit::WebPage::performDragControllerAction): (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): (WebKit::WebPage::SandboxExtensionTracker::beginLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startMemorySampler): * WebProcess/WebProcess.h: 2017-12-14 Alex Christensen Make WebsitePolicies a proper class with getters and setters https://bugs.webkit.org/show_bug.cgi?id=180788 Reviewed by Andy Estes. Also introduce WebsitePolicies::applyToDocumentLoader to reduce duplicate code. This has a side-effect of now applying custom http header fields and content blocking enabled status when updating WebsitePolicies. This will result in these being applied when a user updates the per-site settings, and they weren't before. * CMakeLists.txt: * Shared/WebsitePolicies.cpp: Added. (WebKit::WebsitePolicies::WebsitePolicies): (WebKit::WebsitePolicies::encode const): (WebKit::WebsitePolicies::decode): (WebKit::WebsitePolicies::applyToDocumentLoader): * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::contentBlockersEnabled const): (WebKit::WebsitePolicies::setContentBlockersEnabled): (WebKit::WebsitePolicies::allowedAutoplayQuirks const): (WebKit::WebsitePolicies::setAllowedAutoplayQuirks): (WebKit::WebsitePolicies::autoplayPolicy const): (WebKit::WebsitePolicies::setAutoplayPolicy): (WebKit::WebsitePolicies::customHeaderFields): (WebKit::WebsitePolicies::takeCustomHeaderFields): (WebKit::WebsitePolicies::setCustomHeaderFields): (WebKit::WebsitePolicies::encode const): Deleted. (WebKit::WebsitePolicies::decode): Deleted. * UIProcess/API/APIWebsitePolicies.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::applyToDocumentLoader): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateWebsitePolicies): * WebProcess/WebPage/WebPage.h: 2017-12-14 Chris Dumez Enable Service Workers on iOS https://bugs.webkit.org/show_bug.cgi?id=180836 Reviewed by Alex Christensen. * Shared/WebPreferencesDefaultValues.h: * UIProcess/WebProcessPool.cpp: Enable Service Workers on iOS. (WebKit::WebProcessPool::ensureNetworkProcess): Fall back to defaultCacheStorageDirectory() instead of the empty string for the cache storage directory, when we do not have a store. 2017-12-14 Chris Dumez Service worker script fetching currently always uses the network cache https://bugs.webkit.org/show_bug.cgi?id=180816 Reviewed by Alex Christensen. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-14 Chris Dumez StorageProcess::deleteWebsiteData() should ensure there is a SWServer for the given sessionID https://bugs.webkit.org/show_bug.cgi?id=180784 Reviewed by Youenn Fablet. StorageProcess::deleteWebsiteData() should ensure there is a SWServer for the given sessionID instead of not clearing anything when no such SWServer exists. This will be useful on iOS once is fully fixed. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): 2017-12-14 Chris Dumez WebsiteDataStore::defaultDataStoreConfiguration() fails to set default value for serviceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=180794 Reviewed by Youenn Fablet. Set the default IndexedDB and ServiceWorker database paths in WebsiteDataStore::defaultDataStoreConfiguration(). Without this, the client is forced to set the expected path. * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultDataStoreConfiguration): * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: (API::WebsiteDataStore::defaultDataStoreConfiguration): 2017-12-14 Joseph Pecoraro Web Inspector: Cmd-Option-R in docked inspector causes the inspector to reload instead of the inspected page https://bugs.webkit.org/show_bug.cgi?id=180775 Reviewed by Brian Burg. * WebKit.xcodeproj/project.pbxproj: Remove old files add new files. * PlatformMac.cmake: * UIProcess/mac/WKWebInspectorWKWebView.h: Removed. * UIProcess/mac/WKWebInspectorWKWebView.mm: Removed. Remove unused WKWebInspectorWKWebView. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController dealloc]): (-[WKInspectorViewController webView]): (-[WKInspectorViewController inspectorWKWebViewReload:]): (-[WKInspectorViewController inspectorWKWebViewReloadFromOrigin:]): Handle WKWebView IBActions sent to the inspector frontend WKWebView. * UIProcess/mac/WKInspectorWKWebView.h: * UIProcess/mac/WKInspectorWKWebView.mm: (-[WKInspectorWKWebView tag]): (-[WKInspectorWKWebView inspectorWKWebViewDelegate]): (-[WKInspectorWKWebView setInspectorWKWebViewDelegate:]): (-[WKInspectorWKWebView reload:]): (-[WKInspectorWKWebView reloadFromOrigin:]): Move WKInspectorWKWebView into its own file. Include a delegate to handle reload IBActions that will want to override. 2017-12-13 Chris Dumez Fix copy/paste error in ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration() https://bugs.webkit.org/show_bug.cgi?id=180782 Reviewed by Youenn Fablet. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): 2017-12-13 Daniel Bates Add more auto fill button types https://bugs.webkit.org/show_bug.cgi?id=180651 And Reviewed by Brent Fulgham. Adds enumerators for the new auto fill button types. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (toAutoFillButtonType): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (toAutoFillButtonType): * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: 2017-12-13 Matt Lewis Unreviewed, rolling out r225864. This caused the Layout test step to crash out on Debug testers Reverted changeset: "REGRESSION (r225789): API tests WKProcessPool.InitialWarmedProcessUsed and WebKit.WebsiteDataStoreCustomPaths are failing." https://bugs.webkit.org/show_bug.cgi?id=180722 https://trac.webkit.org/changeset/225864 2017-12-13 Brady Eidson REGRESSION (r225789): API tests WKProcessPool.InitialWarmedProcessUsed and WebKit.WebsiteDataStoreCustomPaths are failing. https://bugs.webkit.org/show_bug.cgi?id=180722 Reviewed by Chris Dumez. - Add a test-only accessor to get the number of WebProcesses hosting WebPages - Have WebsiteDataStore keep track of all instances so they can be looked up by SessionID - When the StorageProcess needs to establish a SW context connection on behalf of a specific SessionID, the UI process will now prefer using the WebsiteDataStore associated with that SessionID. This allows us to continue deferring creation of the default data store if it's not needed. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::connectionToContextProcessWasClosed): (WebKit::StorageProcess::createServerToContextConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishSWServerConnection): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webPageContentProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess): (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::existingDataStoreForSessionID): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-12-13 Per Arne Vollan REGRESSION(225597): Can't select a text box or web view on a page when VO is on. https://bugs.webkit.org/show_bug.cgi?id=180756 Reviewed by Brent Fulgham. * Platform/IPC/mac/ConnectionMac.mm: (IPC::AccessibilityProcessSuspendedNotification): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::shouldLeakBoost): * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeProcess): 2017-12-13 Brent Fulgham [iOS] Further Trim WebContent Process sandbox https://bugs.webkit.org/show_bug.cgi?id=180727 Reviewed by Eric Carlson. Take another pass over the contents of the file and remove addition items that don't have call sites in WebKit. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-12-13 Daniel Bates Move out-parameter in API::FormClient::willBeginInputSession() to the end of the parameter list https://bugs.webkit.org/show_bug.cgi?id=180754 Reviewed by Wenson Hsieh. Group all in-parameters in the signature of API::FormClient::willBeginInputSession() at the front of the parameter list instead of interspersing in- and out- parameters. No functionality changed. So, no new tests. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: (API::InjectedBundle::FormClient::willBeginInputSession): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::elementDidFocus): 2017-12-13 Chris Dumez [iOS] Take process assertion to prevent the service worker process from getting suspended https://bugs.webkit.org/show_bug.cgi?id=180735 Reviewed by Brady Eidson. Take process assertion to prevent the service worker process from getting suspended while it is still needed. We use the same policy as for the network process, meaning that unsuspended WebContent processes prevent the service worker process from getting suspended. This patch still does not enable service workers on iOS. The demo at https://mdn.github.io/sw-test/ appears to work. However, things are not working as expected for mobile.twitter.com where I see the fetches intercepted by the service worker fail when offline for some reason (unrelated to process suspension). * UIProcess/WebProcessPool.cpp: (WebKit::m_foregroundWebProcessCounter): (WebKit::m_backgroundWebProcessCounter): (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::updateProcessAssertions): (WebKit::WebProcessPool::reinstateNetworkProcessAssertionState): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didSetAssertionState): * UIProcess/WebProcessProxy.h: 2017-12-13 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.3 release. * gtk/NEWS: Add release notes for 2.19.3. 2017-12-12 Daniel Bates [WK] Add modern WebKit SPI to set auto fill button type and query if the auto fill button is enabled https://bugs.webkit.org/show_bug.cgi?id=180686 Reviewed by Alex Christensen. * WebKit.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (-[WKWebProcessPlugInNodeHandle isHTMLInputElementAutoFillButtonEnabled]): (toAutoFillButtonType): (-[WKWebProcessPlugInNodeHandle setHTMLInputElementAutoFillButtonEnabledWithButtonType:]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h: 2017-12-12 John Wilander Storage Access API: Implement frame-specific access in the network storage session layer https://bugs.webkit.org/show_bug.cgi?id=180679 Reviewed by Alex Christensen. This changes adds frameID and pageID to what is communicated for storage access and also stored in the network process' table of partitioning exceptions. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): Now stores frameID and pageID for the task for easy retrieval in the HSTS checks. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): These two methods now submit frameID and pageID to the partitioning query call. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): These two methods now submit frameID and pageID to the partitioning query call. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): (WebKit::WebsiteDataStore::requestStorageAccess): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestStorageAccess): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::requestStorageAccess): * WebProcess/WebPage/WebPage.h: 2017-12-12 Alex Christensen Modernize WebsiteDataStoreParameters and SandboxExtension::Handle decoding https://bugs.webkit.org/show_bug.cgi?id=180621 Reviewed by Youenn Fablet. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * Shared/LoadParameters.cpp: (WebKit::LoadParameters::decode): * Shared/SandboxExtension.h: (WebKit::decode): (WebKit::SandboxExtension::Handle::decode): Deleted. * Shared/Storage/StorageProcessCreationParameters.cpp: (WebKit::StorageProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::decode): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtension::Handle::decode): (WebKit::SandboxExtension::HandleArray::HandleArray): (WebKit::SandboxExtension::HandleArray::encode const): (WebKit::SandboxExtension::HandleArray::decode): (WebKit::SandboxExtension::SandboxExtension): 2017-12-12 John Wilander Dispatch resource load statistics telemetry on the main thread https://bugs.webkit.org/show_bug.cgi?id=180602 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): Now switches to the main thread for the telemetry submission through a webpage proxy. The reason is that the webpage we use may go away while we're still using it. This kind of telemetry isn't associated with a specific webpage but the infrastructure requires a webpage proxy. 2017-12-12 Myles C. Maxfield IPC code doesn't understand NSDictionaries with non-NSString keys https://bugs.webkit.org/show_bug.cgi?id=180307 Reviewed by Alex Christensen. Variable fonts have a dictionary inside its descriptor which represents the values of all the axes of the variable font. Our IPC code wasn't expecting this. * Shared/mac/ArgumentCodersMac.mm: (IPC::encode): (IPC::decode): 2017-12-12 Brent Fulgham Unreviewed build fix after r225763. Remove dangling close-parentheses character. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-12-12 Zach Li [WK2] Expose image via WKBundleHitTestResult API. https://bugs.webkit.org/show_bug.cgi?id=180552. rdar://problem/23951521 Reviewed by Simon Fraser. * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: (WKBundleHitTestResultGetImage): * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h: * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::image const): Convert from WebCore::Image to WebImage by creating a WebImage and paint the WebCore::Image into its graphics context. For now, only handle bitmap images. * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: 2017-12-12 Simon Fraser Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace https://bugs.webkit.org/show_bug.cgi?id=180689 Reviewed by Tim Horton. Remove encoding of ColorSpaceDeviceRGB. * Shared/WebCoreArgumentCoders.h: 2017-12-12 Brent Fulgham REGRESSION(r216941): Plugin Process can't access AppStore Plugin Service https://bugs.webkit.org/show_bug.cgi?id=180701 Reviewed by Daniel Bates. The PluginProcess needs access to the AppStore Plugin XPC service. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-12-12 Brady Eidson Make ServiceWorkers follow the DEFAULT_EXPERIMENTAL_FEATURES_ENABLED flag on Mac. and https://bugs.webkit.org/show_bug.cgi?id=180697 Reviewed by Chris Dumez. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2017-12-12 Chris Dumez Simplify IPC code between WebProcess and StorageProcess for serviceWorker.postMessage() https://bugs.webkit.org/show_bug.cgi?id=180683 Reviewed by Brady Eidson. Merge the 2 code paths from calling postMessage() from a ServiceWorkerClient and from a ServiceWorker. Also, postMessage() now only IPCs an identifier from the WebContent process to the StorageProcess. The ServiceWorkerClientData is looked up on Storage process side from the identifier before being sent to the context process. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorker): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorker): * WebProcess/Storage/WebSWClientConnection.h: 2017-12-12 Yusuke Suzuki [WTF] Thread::create should have Thread::tryCreate https://bugs.webkit.org/show_bug.cgi?id=180333 Reviewed by Darin Adler. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::open): * UIProcess/linux/MemoryPressureMonitor.cpp: (WebKit::MemoryPressureMonitor::MemoryPressureMonitor): 2017-12-11 Zan Dobersek [CoordGraphics] Move UpdateAtlas, AreaAllocator into the platform layer https://bugs.webkit.org/show_bug.cgi?id=180641 Reviewed by Michael Catanzaro. Move the UpdateAtlas and AreaAllocator classes into the platform layer, moving over build targets and adjust UpdateAtlas class references in CompositingCoordinator. * PlatformGTK.cmake: * PlatformWPE.cmake: * PlatformWin.cmake: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-12-11 Alex Christensen Add a WKPageGroupRef setter in WKWebViewConfiguration https://bugs.webkit.org/show_bug.cgi?id=180674 Reviewed by Brady Eidson. There is a Mac app trying to transition to WKWebView, and it uses WKPageGroupRef extensively. To help it transition, we are temporarily giving it an ObjC way to use this organization for its UserContentControllers to be united per PageGroup before it transitions away from SPIs like WKBundleAddUserScript. Make it Mac-only to indicate that this should be transitioned away from, rather than adopted on iOS. No change in behavior for apps not using the new WKWebViewConfiguration._pageGroup SPI. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _pageGroup]): (-[WKWebViewConfiguration _setPageGroup:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-12-11 Brent Fulgham [iOS] Remove unused services from WebContent Process sandbox https://bugs.webkit.org/show_bug.cgi?id=180670 Reviewed by Eric Carlson. Pare down the set of sandbox exceptions in the iOS WebContent process sandbox to just those services actually in use: 1. Remove unused code. 2. Instead of defining a 'UIKit-app' function and calling it, just declare the individual sandbox commands inline. This will allow them to be more easily consolidated with other parts of the sandbox in a future step. This update should not change behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-12-11 Chris Dumez Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData https://bugs.webkit.org/show_bug.cgi?id=180669 Reviewed by Youenn Fablet. Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData, for consistency with ServiceWorkerIdentifier / ServiceWorkerData, and start simplifying the postMessage() code. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::~WebSWServerConnection): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): (WebKit::WebSWServerConnection::registerServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::matchAllCompleted): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::registerServiceWorkerClient): (WebKit::WebSWClientConnection::unregisterServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker): (WebKit::WebSWContextManagerConnection::matchAllCompleted): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-11 Youenn Fablet RTCPacketOptions::packet_id should be encoded as 32 bits integer. https://bugs.webkit.org/show_bug.cgi?id=180654 Reviewed by Eric Carlson. packet_id is a 16 bit unsigned integer, but it can also take -1 if its value is not set. Before the patch, it was IPC encoded as a 16 bit signed integer which is not large enough. * Shared/RTCPacketOptions.cpp: (WebKit::RTCPacketOptions::encode const): (WebKit::RTCPacketOptions::decode): 2017-12-11 Chris Dumez Layout Test http/tests/workers/service/postmessage-after-sw-process-crash.https.html is flaky https://bugs.webkit.org/show_bug.cgi?id=180659 Reviewed by Youenn Fablet. Fix flaky crash due to capturing an IPC::DataReference in a lambda, which would point to invalid memory when the lambda is called asynchronously. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): 2017-12-11 Brent Fulgham [iOS] Don't import 'UIKit-apps.sb' to the WebContent process sandbox https://bugs.webkit.org/show_bug.cgi?id=180610 Reviewed by Dean Jackson. Stop including 'system.sb', and just include the portions of that sandbox that we actually use in WebContent Process. This is the first step in some further sandbox tightening. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-12-11 Yusuke Suzuki [WTF] Add Converter traits to StringHasher instead of function pointer https://bugs.webkit.org/show_bug.cgi?id=180656 Reviewed by JF Bastien. * WebProcess/WebProcess.cpp: (WebKit::addCaseFoldedCharacters): 2017-12-11 David Quesada Turn on ENABLE_APPLICATION_MANIFEST https://bugs.webkit.org/show_bug.cgi?id=180562 rdar://problem/35924737 Reviewed by Geoffrey Garen. * Configurations/FeatureDefines.xcconfig: 2017-12-11 Dean Jackson Add a runtime feature flag for ImageBitmap and OffscreenCanvas https://bugs.webkit.org/show_bug.cgi?id=180652 Reviewed by Antoine Quint. Add an experimental feature flag for these interfaces. * Shared/WebPreferences.yaml: 2017-12-10 Stephan Szabo APIClient.h uses things from without including it explicitly https://bugs.webkit.org/show_bug.cgi?id=180609 Reviewed by Darin Adler. * Shared/API/APIClient.h: 2017-12-08 Youenn Fablet Service Worker should use a correct user agent https://bugs.webkit.org/show_bug.cgi?id=180566 Reviewed by Chris Dumez. Addendum to landed patch. This change was removed from the last version of the patch but proves to be needed by Safari. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): Added back setting the user agent at start of service worker in case a page is already created. 2017-12-08 Brady Eidson Delay some service worker operations until after the database import completes. https://bugs.webkit.org/show_bug.cgi?id=180573 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: (WebKit::WebSWOriginStore::importComplete): Tell the Origin Table on all connects that the import is complete. (WebKit::WebSWOriginStore::registerSWServerConnection): * StorageProcess/ServiceWorker/WebSWOriginStore.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const): (WebKit::WebSWClientConnection::setSWOriginTableIsImported): Run deferred tasks! (WebKit::WebSWClientConnection::matchRegistration): If the import isn't complete yet, delay the match registration task until later. (WebKit::WebSWClientConnection::runOrDelayTask): Either send the message now or save off the task to wait until the import is complete. (WebKit::WebSWClientConnection::getRegistrations): If the import isn't complete yet, delay the get registrations task until later. (WebKit::WebSWClientConnection::initializeSWOriginTableAsEmpty): Deleted. * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWOriginTable.cpp: (WebKit::WebSWOriginTable::setSharedMemory): * WebProcess/Storage/WebSWOriginTable.h: (WebKit::WebSWOriginTable::isImported const): (WebKit::WebSWOriginTable::setIsImported): (WebKit::WebSWOriginTable::isInitialized const): Deleted. (WebKit::WebSWOriginTable::initializeAsEmpty): Deleted. 2017-12-08 Youenn Fablet Service Worker should use a correct user agent https://bugs.webkit.org/show_bug.cgi?id=180566 Reviewed by Chris Dumez. Add support to set service worker user agent from UIProcess to service worker process. One user agent is currently supported per service worker process and it can be changed at any given time. Only new service worker will use the new value. Once a service worker is launched, it will stay with the same user agent value. This sets both navigator.userAgent and User-Agent header name used for fetch within a service worker. Compute the service worker process user agent by picking the last user agent set for a web page. * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::start): (WebKit::ServiceWorkerProcessProxy::setUserAgent): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setApplicationNameForUserAgent): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): * UIProcess/WebProcessPool.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): (WebKit::WebSWContextManagerConnection::setUserAgent): (WebKit::WebSWContextManagerConnection::removeFrameLoaderClient): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-07 Simon Fraser Wrong caret position for input field inside a fixed position parent on iOS 11 https://bugs.webkit.org/show_bug.cgi?id=176896 rdar://problem/33726145 Reviewed by Tim Horton. In r219668 I added code to compute a layout viewport rect in the web process, so that after programmatic scrolling, getBoundingClientRect() would return the correct values. However, that computation sometimes used a different visual viewport than the UI process, resulting in a different layout viewport being set. This would happen when the keyboard was visible, and the combination of this and zooming when focusing an input would result in a state where the scrolling tree contained notes computed with the bad layout viewport. This could cause apparently offset fixed elements, and bad caret positioning if those fixed elements contained the focused input. Fix by passing to the web process the same visual viewport rect that the UI process is using, namely "unobscuredContentRectRespectingInputViewBounds". This was already being set in VisibleContentRectUpdateInfo but wasn't encoded/decoded, so fix that. Set it as an optional<> on FrameView when different from the normal visual viewport, and return it from visualViewportRect(). Some other minor logging changes. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode const): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2017-12-06 Simon Fraser When the iPhone keyboard is up, sometimes we never commit a stable update and re-show the caret https://bugs.webkit.org/show_bug.cgi?id=180498 Reviewed by Tim Horton. When the keyboard is showing, we would think that the page was in a rubber-banding state because contentOffsetBoundedInValidRange() would always clamp the content offset to a different value. This happened because scrollView.contentInset don't change when the keyboard is showing, but UIKit actually consults scrollView.adjustedContentInset, which does. If we use scrollView.adjustedContentInset in this computation, we'll get a correct answer. Also rewrote the clamping logic to be more similar to what UIKit does internally when computing min/max content offset. * UIProcess/API/Cocoa/WKWebView.mm: (contentOffsetBoundedInValidRange): 2017-12-08 Chris Dumez Clearing all Website Data should remove service worker registrations on disk https://bugs.webkit.org/show_bug.cgi?id=180558 Reviewed by Youenn Fablet. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): 2017-12-08 Youenn Fablet WebServiceWorkerProvider should use Cancellation error to notify DTL that it cannot handle a fetch https://bugs.webkit.org/show_bug.cgi?id=180584 Reviewed by Alex Christensen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): 2017-12-08 Youenn Fablet Service Worker should use a correct SessionID https://bugs.webkit.org/show_bug.cgi?id=180585 Reviewed by Alex Christensen. Store SessionID in SWServer and send it as part of service worker instantiation. Use it when creating service worker thread in service worker process. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::installServiceWorkerContext): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::swServerForSession): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-08 Youenn Fablet FetchResponse should keep unfiltered ResourceResponse so that it can be used in Service Worker https://bugs.webkit.org/show_bug.cgi?id=179641 Reviewed by Alex Christensen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): In case of opaque redirected response, handle it as a regular response. 2017-12-08 Alex Christensen Remove unused code in WebPageGroup https://bugs.webkit.org/show_bug.cgi?id=180604 Reviewed by Youenn Fablet. * UIProcess/WebPageGroup.cpp: (WebKit::WebPageGroup::userContentController): (WebKit::WebPageGroup::createNonNull): Deleted. (WebKit::WebPageGroup::preferencesDidChange): Deleted. * UIProcess/WebPageGroup.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): 2017-12-08 Alex Christensen Modernize APIWebsiteDataStore.h and WebProcessPool.h https://bugs.webkit.org/show_bug.cgi?id=180588 Reviewed by Chris Dumez. pragma once, Ref instead of RefPtr, initializer list in header instead of literals in constructor. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): * UIProcess/WebProcessPool.h: 2017-12-08 Yusuke Suzuki Remove pthread_once in favor of dispatch_once https://bugs.webkit.org/show_bug.cgi?id=180591 Reviewed by Saam Barati. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::shouldCallRealDebugger): (WebKit::initShouldCallRealDebugger): Deleted. 2017-12-08 Chris Dumez ProcessPoolConfiguration::copy() fails to copy the service worker path https://bugs.webkit.org/show_bug.cgi?id=180595 Reviewed by Brady Eidson. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): 2017-12-08 Chris Dumez Different WebKitTestRunner instances should use different service worker registrations databases https://bugs.webkit.org/show_bug.cgi?id=180589 Reviewed by Brady Eidson. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyServiceWorkerDatabaseDirectory): (WKContextConfigurationSetServiceWorkerDatabaseDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: 2017-12-08 Alex Christensen Pass std::optional instead of WebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=180563 Reviewed by Andy Estes. WebsitePolicies are only passed along when a decidePolicyForNavigationAction SPI completion handler is called with a valid _WKWebsitePolicies object. In other cases, we don't have one. Rather than making WebsitePolicies have a default value for everything that won't change policies, pass a std::optional which indicates better when we don't have new policies. No change in behavior, but this will enable me to add things to WebsitePolicies that have no default value. * Shared/WebsitePolicies.h: Make WebsitePolicies a class with public members because the IPC code generators don't understand std::optional * UIProcess/API/C/WKAPICast.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryAppLink): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/WebFrameListenerProxy.cpp: (WebKit::WebFrameListenerProxy::receivedPolicyDecision): * UIProcess/WebFrameListenerProxy.h: * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::use): * UIProcess/WebFramePolicyListenerProxy.h: * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::receivedPolicyDecision): * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-08 Yusuke Suzuki [WTF] Remove remaining use of Mutex https://bugs.webkit.org/show_bug.cgi?id=180579 Reviewed by Alex Christensen. Remove unused "BinarySemaphore.h". * Platform/IPC/win/ConnectionWin.cpp: 2017-12-08 Michael Catanzaro [GTK] WebInspectorProxyClient needs a virtual destructor https://bugs.webkit.org/show_bug.cgi?id=180533 Reviewed by Carlos Garcia Campos. Otherwise the derived class portion of the object, WebKitInspectorClient, is not destroyed. * UIProcess/gtk/WebInspectorProxyClient.h: 2017-12-07 Yousuke Kimoto [WinCairo] Fix ResourceError handling in ArgumentCoder for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=180483 Reviewed by Alex Christensen. * Shared/curl/WebCoreArgumentCodersCurl.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2017-12-07 Youenn Fablet StartFetch should take a ServiceWorkerIdentifier https://bugs.webkit.org/show_bug.cgi?id=180478 Reviewed by Brady Eidson. Before the patch, StartFetch was taking an optional ServiceWorkerIdentifier. Now that every navigation fetch is querying its matching registration, it can no longer be optional. In the case there is a problem in running the service worker at start fetch time, answer to the WebProcess to go to network so that the request does not get stalled. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-07 Saam Barati We need to grab the JSLock in InjectedBundle::createWebDataFromUint8Array https://bugs.webkit.org/show_bug.cgi?id=180492 Reviewed by Alex Christensen. InjectedBundle::createWebDataFromUint8Array calls into WebCore APIs that allocate out of the JS heap. It's only legal to allocate out of the JS heap when holding the JS lock. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::createWebDataFromUint8Array): 2017-12-07 Simon Fraser Propagate WebKit2Logging channels to the Web Process https://bugs.webkit.org/show_bug.cgi?id=180517 Reviewed by Tim Horton. If you set WebKit2Logging, you want those channels active in both the UI process and the web process, but without tricky 'defaults' gyrations, setting them in the web process was hard. Instead, send them through to the process via WebProcessCreationParameters, as we do for WebCoreLogging channels. * Platform/LogInitialization.h: * Platform/Logging.cpp: (WebKit::initializeLogChannelsIfNecessary): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2017-12-07 Simon Fraser Add logging for EditorState in RemoteLayerTree transactions https://bugs.webkit.org/show_bug.cgi?id=180515 Reviewed by Wenson Hsieh. Make EditorState TextStream-able, and dump it in layer tree transactions. * Shared/EditorState.cpp: (WebKit::operator<<): * Shared/EditorState.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::description const): 2017-12-07 Youenn Fablet CacheStorage Cache should not remove any disk entry when clearing its memory representation https://bugs.webkit.org/show_bug.cgi?id=180546 Reviewed by Brady Eidson. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::clearMemoryRepresentation): 2017-12-07 Myles C. Maxfield [Cocoa] Add SPI to disallow user-installed fonts https://bugs.webkit.org/show_bug.cgi?id=180062 Reviewed by Simon Fraser. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetShouldDisallowUserInstalledFonts): (WKPreferencesGetShouldDisallowUserInstalledFonts): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldDisallowUserInstalledFonts]): (-[WKPreferences _setShouldDisallowUserInstalledFonts:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-12-07 David Quesada [Web App Manifest] Support display-mode media feature https://bugs.webkit.org/show_bug.cgi?id=180376 rdar://problem/35837993 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/_WKApplicationManifest.h: * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (-[_WKApplicationManifest initWithCoder:]): (-[_WKApplicationManifest encodeWithCoder:]): (-[_WKApplicationManifest displayMode]): 2017-12-07 Chris Dumez Unreviewed build fix after r225622. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): 2017-12-06 Chris Dumez We should be able to recover after a Service Worker process crash https://bugs.webkit.org/show_bug.cgi?id=180477 Reviewed by Brady Eidson and Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): Update calls to SWServer::runServiceWorkerIfNecessary() that that it is asynchronous and takes in a lambda. * StorageProcess/ServiceWorker/WebSWServerConnection.h: (WebKit::WebSWServerConnection::ipcConnection const): Add getter for the underlying IPC connection. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didClose): (WebKit::StorageProcess::connectionToContextProcessWasClosed): Move some code to connectionToContextProcessWasClosed() to avoid duplication. Also, relaunch the Service Worker process if it has exited but we still have SWServer connections to regular Web Processes. (WebKit::StorageProcess::needsServerToContextConnection const): Utility function to determine if we still need the service worker process. The current rule is that we need the service worker (aka "context") process if we still have SWServer connections to regular Web Processes. * StorageProcess/StorageProcess.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didClose): If didClose() is called for the connection to the service worker context, let the StorageProcess know so that it can clear its state and relaunch the process if necessary. * UIProcess/API/C/WKContext.cpp: (WKContextTerminateServiceWorkerProcess): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateServiceWorkerProcess]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Add SPI to terminate the service worker process. * UIProcess/WebProcessPool.cpp: (WebKit::m_serviceWorkerProcessTerminationTimer): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::terminateServiceWorkerProcess): * UIProcess/WebProcessPool.h: We used to shutdown the ServiceWorker process right away as soon as the last regular WebProcess was gone. We now give it a grace period of 5 seconds in case a new WebProcess gets launched shortly after. 2017-12-02 Darin Adler Modernize some aspects of text codecs, eliminate WebKit use of strcasecmp https://bugs.webkit.org/show_bug.cgi?id=180009 Reviewed by Alex Christensen. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::initializeProtectionSpace): Use equalLettersIgnoringASCIICase instead of strcasecmp. 2017-12-06 David Quesada [Web App Manifest] Add SPI for applying a manifest to a top-level browsing context https://bugs.webkit.org/show_bug.cgi?id=180368 rdar://problem/34748067 Reviewed by Geoffrey Garen. Add a new property WKWebViewConfiguration._applicationManifest to specify manifest to apply to application contexts (aka. top-level browsing contexts, i.e. web views). The manifest is ultimately stored on the MainFrame of the Pages created from the web view configuration. No new tests, no change in behavior. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy const): (API::PageConfiguration::applicationManifest const): (API::PageConfiguration::setApplicationManifest): * UIProcess/API/APIPageConfiguration.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _applicationManifest]): (-[WKWebViewConfiguration _setApplicationManifest:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2017-12-06 Jeff Miller -[WKWebViewConfiguration copyWithZone] doesn't copy _groupIdentifier https://bugs.webkit.org/show_bug.cgi?id=180504 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): Copy _groupIdentifier. 2017-12-06 David Quesada [Web App Manifest] Add SPI for fetching the manifest https://bugs.webkit.org/show_bug.cgi?id=180294 rdar://problem/34747968 Reviewed by Geoffrey Garen. Add a new method -[WKWebView _getApplicationManifestWithCompletionHandler:] to request the manifest associated with the current page. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h. Add a new API object type for application manifests. * UIProcess/API/C/WKPage.cpp: (WKPageGetApplicationManifest_b): Add a C version of this SPI for WebKitTestRunner. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _getApplicationManifestWithCompletionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h. * UIProcess/API/Cocoa/_WKApplicationManifest.mm: Added. (-[_WKApplicationManifest initWithCoder:]): (-[_WKApplicationManifest encodeWithCoder:]): (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]): (-[_WKApplicationManifest _apiObject]): (nullableNSString): (-[_WKApplicationManifest name]): (-[_WKApplicationManifest shortName]): (-[_WKApplicationManifest applicationDescription]): (-[_WKApplicationManifest scope]): (-[_WKApplicationManifest startURL]): * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h. (API::wrapper): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::applicationManifestCallback): (WebKit::WebPageProxy::getApplicationManifest): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::finishedLoadingApplicationManifest): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getApplicationManifest): (WebKit::WebPage::didFinishLoadingApplicationManifest): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-06 Per Arne Vollan The WebProcess should use the NSRunLoop runloop type. https://bugs.webkit.org/show_bug.cgi?id=179804 Reviewed by Brent Fulgham. * Platform/IPC/mac/ConnectionMac.mm: (IPC::AccessibilityProcessSuspendedNotification): * Shared/ChildProcess.h: * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::launchServicesCheckIn): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::shouldLeakBoost): * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeProcess): 2017-12-06 Nan Wang AX: [iOS] Post accessibility notification when a web process changes its suspended state https://bugs.webkit.org/show_bug.cgi?id=180458 Reviewed by Chris Dumez. Post accessibility notification with the pid information when a web process becomes suspended or resumes running. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::actualPrepareToSuspend): (WebKit::WebProcess::processDidResume): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::accessibilityProcessSuspendedNotification): 2017-12-06 Ryan Haddad Unreviewed build fix, removed unused lambda capture. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): 2017-12-06 John Wilander Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes https://bugs.webkit.org/show_bug.cgi?id=176944 Reviewed by Brent Fulgham. This change introduces document.hasStorageAccess() as a function which returns a promise instead of being a property. Since cookie access can be due to both a granted request and recent user interaction as first party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Now adds an entry for granted access. A bug found through testing. Switched from WTF::Function to WTF::CompletionHandler. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::hasStorageAccess): (WebKit::WebsiteDataStore::requestStorageAccess): Switched from WTF::Function to WTF::CompletionHandler. * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::hasStorageAccess): (WebKit::WebChromeClient::requestStorageAccess): Switched from WTF::Function to WTF::CompletionHandler. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::hasStorageAccess): (WebKit::WebPage::requestStorageAccess): Switched from WTF::Function to WTF::CompletionHandler. * WebProcess/WebPage/WebPage.h: 2017-12-06 Youenn Fablet CacheStorageEngineConnection should protect its IPC Connection when doing asynchronous tasks https://bugs.webkit.org/show_bug.cgi?id=180461 Reviewed by Chris Dumez. Protecting the IPC connection instead of the CacheStorageEngineConnection since CacheStorageEngineConnection only keeps a reference to the NetworkConnectionToWebProcess. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::retrieveRecords): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): 2017-12-06 Zan Dobersek [CoordGraphics] Introduce Nicosia::PaintingContext, add Cairo implementation https://bugs.webkit.org/show_bug.cgi?id=180239 Reviewed by Michael Catanzaro. With Nicosia::Buffer now only providing the memory area into which the tile content was rasterized, we can simplify the BitmapTexture update greatly -- we don't have to create a BitmapImage anymore and retrieve memory pointer from the contained cairo_surface_t object. Instead, we just copy to GPU the memory that Nicosia::Buffer controls. * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::swapBuffers): 2017-12-05 Brent Fulgham Limit user agent versioning to an upper bound https://bugs.webkit.org/show_bug.cgi?id=180365 Reviewed by Joseph Pecoraro. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::standardUserAgent): Don't pass the WebKit bundle version when creatin the User Agent string. (WebKit::webKitBundleVersionString): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::standardUserAgent): Ditto. (WebKit::webKitBundleVersionString): Deleted. 2017-12-05 Alex Christensen Fix crash when loading a file URL that does not have a fileSystemPath representation https://bugs.webkit.org/show_bug.cgi?id=180448 Reviewed by Chris Dumez. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::assumeReadAccessToBaseURL): Check if a String is null before adding it to a HashSet. 2017-12-05 Youenn Fablet Implement https://w3c.github.io/ServiceWorker/#clients-claim https://bugs.webkit.org/show_bug.cgi?id=180261 Reviewed by Chris Dumez. Add IPC plumbery for clients claim between ServiceWorker process and Storage process. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::claimCompleted): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::claim): (WebKit::WebSWContextManagerConnection::claimCompleted): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-05 Chris Dumez Add support for ServiceWorkerContainer.prototype.ready https://bugs.webkit.org/show_bug.cgi?id=180383 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::whenRegistrationReady): (WebKit::WebSWServerConnection::resolveRegistrationReadyRequests): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::matchRegistration): (WebKit::WebSWClientConnection::whenRegistrationReady): (WebKit::WebSWClientConnection::registrationReady): (WebKit::WebSWClientConnection::getRegistrations): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-12-05 Youenn Fablet Implement setting of service worker to client in SWServer without going to WebProcess https://bugs.webkit.org/show_bug.cgi?id=180382 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::registerServiceWorkerClient): (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): Deleted. (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): Deleted. * WebProcess/Storage/WebSWClientConnection.h: 2017-12-04 Chris Dumez Support container.getRegistration() / getRegistrations() inside service workers https://bugs.webkit.org/show_bug.cgi?id=180360 Reviewed by Youenn Fablet. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::didMatchRegistration): (WebKit::WebSWClientConnection::didGetRegistrations): (WebKit::WebSWClientConnection::matchRegistration): (WebKit::WebSWClientConnection::getRegistrations): 2017-12-04 Brady Eidson Followup to: Get a directory path to SWServers for storing ServiceWorker registrations https://bugs.webkit.org/show_bug.cgi?id=180362 Unreviewed. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::swServerForSession): Change this ASSERT which is invalid in private browsing sessions. 2017-12-04 Simon Fraser Minor DisplayRefreshMonitor-related cleanup https://bugs.webkit.org/show_bug.cgi?id=179802 Reviewed by Sam Weinig. Use RunLoopObserver::WellKnownRunLoopOrders. We want to fire before layer flushing. * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): 2017-12-04 Brent Fulgham Don't force creation of process pool when enabling resource load statistics https://bugs.webkit.org/show_bug.cgi?id=180374 Reviewed by Alex Christensen. Pass appropriate arguments to the 'processPool' accessor so that we only get the set of existing process pools. We don't want to pay the cost of launching new process pools just to set this flag. The flag will be properly set when the pools are created as soon as a WebView is instantiated. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): 2017-12-04 David Quesada Add a class for parsing application manifests https://bugs.webkit.org/show_bug.cgi?id=177973 rdar://problem/34747949 Reviewed by Geoffrey Garen. * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag. 2017-12-04 Wenson Hsieh Rename a static helper in TouchBarMenuItemData.cpp to match style guidelines. https://bugs.webkit.org/show_bug.cgi?id=180305 Reviewed by Andy Estes. Style guidelines state that we should use bare words for getters, so getItemType should just be itemType. Since this collides with the itemType member variable, this patch also renames that member variable to the more concise "type". No change in behavior. * Shared/TouchBarMenuItemData.cpp: (WebKit::itemType): (WebKit::TouchBarMenuItemData::TouchBarMenuItemData): (WebKit::TouchBarMenuItemData::encode const): (WebKit::TouchBarMenuItemData::decode): (WebKit::getItemType): Deleted. * Shared/TouchBarMenuItemData.h: (WebKit::operator==): 2017-12-04 Brian Burg Web Automation: add flag to preserve legacy page screenshot behavior https://bugs.webkit.org/show_bug.cgi?id=180313 Reviewed by Joseph Pecoraro. For compatibility with JSON Wire Protocol implemented by Safari, we need to retain the ability to perform whole page contents snapshots using Automation.takeScreenshot. Add an extra flag, clipToViewport, which can be used by W3C-conforming drivers. * UIProcess/Automation/Automation.json: Add new flag. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::takeScreenshot): * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::snapshotRectForScreenshot): (WebKit::WebAutomationSessionProxy::takeScreenshot): If the flag is false, take a screenshot of the whole page contents. 2017-12-04 JF Bastien Update std::expected to match libc++ coding style https://bugs.webkit.org/show_bug.cgi?id=180264 Reviewed by Alex Christensen. Update various uses of Expected, mostly renaming valueOr and hasValue to the STL naming convention. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::Engine::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord): (WebKit::CacheStorage::Cache::updateRecordToDisk): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::readCachesFromDisk): * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createResolver): * Platform/IPC/ArgumentCoders.h: 2017-12-04 Brady Eidson Get a directory path to SWServers for storing ServiceWorker registrations. https://bugs.webkit.org/show_bug.cgi?id=180362 Reviewed by Chris Dumez. This gets all of the plumbing in place for specifying a ServiceWorker registration storage path in a particular WebsiteDataStore. * Shared/Storage/StorageProcessCreationParameters.cpp: (WebKit::StorageProcessCreationParameters::encode const): (WebKit::StorageProcessCreationParameters::decode): * Shared/Storage/StorageProcessCreationParameters.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::initializeWebsiteDataStore): (WebKit::StorageProcess::swServerForSession): * StorageProcess/StorageProcess.h: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithLegacyOptions): (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::storageProcessParameters): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const): * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory): * UIProcess/wpe/WebProcessPoolWPE.cpp: (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory): 2017-12-04 Frederic Wang Make ScrollingTreeNode::enclosingFrameNode return the node itself for frame nodes https://bugs.webkit.org/show_bug.cgi?id=180353 Reviewed by Antonio Gomes. This function was introduced in bug 175135 to solve a rendering bug with fixed positioned nodes in overflow nodes. For a frame node, the reference frame to use for fixed nodes is actually the frame node itself or otherwise we will get the same rendering bug. This patch makes enclosingFrameNode return the node itself when it is a frame node and renames it to clarify this behavior. Currently, enclosingFrameNode is not used for frame nodes so the behavior is unchanged. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Use auto* and the new function name. 2017-12-04 Michael Catanzaro [GTK] Implement PAL::SleepDisabler https://bugs.webkit.org/show_bug.cgi?id=178485 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseDispose): (webkitWebViewBaseEnterFullScreen): (webkitWebViewBaseExitFullScreen): (screenSaverInhibitedCallback): Deleted. (webkitWebViewBaseSendInhibitMessageToScreenSaver): Deleted. (screenSaverProxyCreatedCallback): Deleted. (webkitWebViewBaseInhibitScreenSaver): Deleted. (webkitWebViewBaseUninhibitScreenSaver): Deleted. 2017-12-03 Yusuke Suzuki WTF shouldn't have both Thread and ThreadIdentifier https://bugs.webkit.org/show_bug.cgi?id=180308 Reviewed by Darin Adler. * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): 2017-12-03 Chris Dumez Support serviceWorker.postMessage() inside service workers https://bugs.webkit.org/show_bug.cgi?id=180328 Reviewed by Darin Adler. Support serviceWorker.postMessage() inside service workers. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorker): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromClient): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-03 Chris Dumez Implement self.skipWaiting() inside service workers https://bugs.webkit.org/show_bug.cgi?id=180329 Reviewed by Darin Adler. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::skipWaiting): (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-02 Youenn Fablet Implement https://w3c.github.io/ServiceWorker/#clients-getall https://bugs.webkit.org/show_bug.cgi?id=180276 Reviewed by Chris Dumez. Add IPC plumbery for clients.matchAll between ServiceWorker process and Storage process. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::matchAllCompleted): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::matchAll): (WebKit::WebSWContextManagerConnection::matchAllCompleted): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-02 Joseph Pecoraro Remote Web Inspector window always shows up at the default size https://bugs.webkit.org/show_bug.cgi?id=180284 Reviewed by Brian Burg. * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): Give remote web inspector windows an autosave name so that their frame can be automatically saved and restored by the system. 2017-12-02 Simon Fraser Add a log channel for viewports https://bugs.webkit.org/show_bug.cgi?id=180295 Reviewed by Zalan Bujtas. Add a "Viewports" log channel to log viewport scaling information, and enhance the WebKit "VisibleRects" channel to log additional data for the same reason. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): (-[WKWebView _dispatchSetMinimumLayoutSize:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setFixedLayoutSize): (WebKit::WebPage::mainFrameDidLayout): (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::scaleAfterViewportWidthChange): (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::resetViewportDefaultConfiguration): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateVisibleContentRects): 2017-12-02 Carlos Garcia Campos WebDriver: handle user prompts shown while executing scripts https://bugs.webkit.org/show_bug.cgi?id=179979 Reviewed by Brian Burg. * UIProcess/Automation/Automation.json: Add UnexpectedAlertOpen error. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::willShowJavaScriptDialog): Finish pending evaluateJavaScriptFunction operations with UnexpectedAlertOpen error. 2017-12-02 Wenson Hsieh Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData https://bugs.webkit.org/show_bug.cgi?id=180305 Reviewed by Joseph Pecoraro. Mark some methods and parameters as const, use the default constructor in more places, and also remove a few extraneous imported headers. * Shared/TouchBarMenuData.cpp: (WebKit::TouchBarMenuData::TouchBarMenuData): Add a FIXME regarding the use of the 'id' attribute. (WebKit::TouchBarMenuData::decode): * Shared/TouchBarMenuData.h: (WebKit::TouchBarMenuData::items const): (WebKit::TouchBarMenuData::setID): (WebKit::TouchBarMenuData::isPageCustomized const): (WebKit::TouchBarMenuData::items): Deleted. (WebKit::TouchBarMenuData::isPageCustomized): Deleted. * Shared/TouchBarMenuItemData.cpp: (WebKit::getItemType): Change a helper method from a static class function to a static function in the implementation file. (WebKit::TouchBarMenuItemData::TouchBarMenuItemData): (WebKit::TouchBarMenuItemData::encode const): (WebKit::TouchBarMenuItemData::decode): (WebKit::TouchBarMenuItemData::getItemType): Deleted. * Shared/TouchBarMenuItemData.h: (WebKit::operator==): Remove the commandName member variable, since it doesn't make sense to propagate an event handler attribute from WebCore to the client layer. * UIProcess/WebPageProxy.messages.in: 2017-12-01 Zan Dobersek Unreviewed GTK+ debug build fix. Replace ASSERT_UNUSED() with UNUSED_PARAM() in WebKit::WebPage methods that used to operate on HTMLMenuElement pointer values (which have been converted to references). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didInsertMenuElement): (WebKit::WebPage::didRemoveMenuElement): (WebKit::WebPage::didInsertMenuItemElement): (WebKit::WebPage::didRemoveMenuItemElement): 2017-12-01 Simon Fraser Reduce the number of calls to ViewportConfiguration::updateConfiguration() https://bugs.webkit.org/show_bug.cgi?id=180299 Reviewed by Zalan Bujtas. There are several calls to ViewportConfiguration::setDefaultConfiguration() during loading with the same arguments. We can avoid unnecessary calls to updateConfiguration() by returning early if the configuration hasn't changed. Also move the fetching of ViewportConfiguration::xhtmlMobileParameters() from didReceiveMobileDocType() into resetViewportDefaultConfiguration() where we grab all the other default configs. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::didReceiveMobileDocType): (WebKit::WebPage::resetViewportDefaultConfiguration): 2017-12-01 Aishwarya Nirmal [Touch Bar Web API] Object representing Touch Bar Menu to send between Web and UI Processes https://bugs.webkit.org/show_bug.cgi?id=179714 Reviewed by Wenson Hsieh. These changes define the TouchBarMenuData and TouchBarMenuItemData objects which draw information from touch bar HTMLMenuElement and HTMLMenuItemElement. These objects represent the contents of the page-customized touch bar. Changes to the html elements representing the touch bar are sent to the UI process. * Shared/TouchBarMenuData.cpp: Copied from Source/WebCore/html/HTMLMenuItemElement.cpp. (WebKit::TouchBarMenuData::TouchBarMenuData): (WebKit::TouchBarMenuData::addMenuItem): (WebKit::TouchBarMenuData::removeMenuItem): (WebKit::TouchBarMenuData::encode const): (WebKit::TouchBarMenuData::decode): * Shared/TouchBarMenuData.h: Copied from Source/WebCore/html/HTMLMenuItemElement.h. (WebKit::TouchBarMenuData::items): (WebKit::TouchBarMenuData::isPageCustomized): (WebKit::TouchBarMenuData::setIsPageCustomized): * Shared/TouchBarMenuItemData.cpp: Added. (WebKit::TouchBarMenuItemData::getItemType): (WebKit::TouchBarMenuItemData::TouchBarMenuItemData): (WebKit::TouchBarMenuItemData::encode const): (WebKit::TouchBarMenuItemData::decode): * Shared/TouchBarMenuItemData.h: Added. (WebKit::operator<): (WebKit::operator>): (WebKit::operator<=): (WebKit::operator>=): (WebKit::operator==): (WebKit::operator!=): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::touchBarMenuDataChanged): (WebKit::WebPageProxy::touchBarMenuItemDataAdded): (WebKit::WebPageProxy::touchBarMenuItemDataRemoved): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::touchBarMenuData const): * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didInsertMenuElement): (WebKit::WebChromeClient::didRemoveMenuElement): (WebKit::WebChromeClient::didInsertMenuItemElement): (WebKit::WebChromeClient::didRemoveMenuItemElement): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didInsertMenuElement): (WebKit::WebPage::didRemoveMenuElement): (WebKit::WebPage::didInsertMenuItemElement): (WebKit::WebPage::didRemoveMenuItemElement): (WebKit::WebPage::sendTouchBarMenuDataRemovedUpdate): (WebKit::WebPage::sendTouchBarMenuDataAddedUpdate): (WebKit::WebPage::sendTouchBarMenuItemDataAddedUpdate): (WebKit::WebPage::sendTouchBarMenuItemDataRemovedUpdate): * WebProcess/WebPage/WebPage.h: 2017-12-01 Daniel Bates Alternative Presentation Button: Provide a way to query for the replaced elements https://bugs.webkit.org/show_bug.cgi?id=180114 Reviewed by Tim Horton. Add SPI to query for the elements that were replaced by an Alternative Presentation Button. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Added. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleElementsReplacedByAlternativePresentationButton): Added. * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: 2017-12-01 Youenn Fablet Implement https://w3c.github.io/ServiceWorker/#clients-get https://bugs.webkit.org/show_bug.cgi?id=180167 Reviewed by Chris Dumez. Add IPC plumbery for clientFromId between ServiceWorker process and Storage process. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::clientFromIdCompleted): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::findClientByIdentifier): (WebKit::WebSWContextManagerConnection::findClientByIdentifierCompleted): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-12-01 Brian Burg Web Inspector: move Inspector::Protocol::Array to JSON namespace https://bugs.webkit.org/show_bug.cgi?id=173662 Reviewed by Joseph Pecoraro. Adopt new type names. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::getNextContext): (WebKit::WebAutomationSession::getBrowsingContexts): (WebKit::buildArrayForCookies): (WebKit::WebAutomationSession::getSessionPermissions): * UIProcess/Automation/WebAutomationSession.h: 2017-12-01 Wenson Hsieh [Attachment Support] Implement SPI for clients to update a given attachment's data https://bugs.webkit.org/show_bug.cgi?id=180184 Reviewed by Tim Horton. Add plumbing to the web process for setting the attachment data (and optionally, the content type and/or file name) of a given attachment. See WebCore ChangeLog for more detail. Changes covered by new API tests. * UIProcess/API/APIAttachment.cpp: (API::Attachment::setDataAndContentType): * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.h: Add nullability annotations around _WKAttachment SPI methods. * UIProcess/API/Cocoa/_WKAttachment.mm: (-[_WKAttachment setData:newContentType:newFilename:completion:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setAttachmentDataAndContentType): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setAttachmentDataAndContentType): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-12-01 Brady Eidson Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage. https://bugs.webkit.org/show_bug.cgi?id=180170 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::syncTerminateWorker): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::syncTerminateWorker): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::terminateWorker): (WebKit::WebSWContextManagerConnection::syncTerminateWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveSyncMessage): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-12-01 Youenn Fablet Clear WebSWClientConnection in case storage process IPC connection is closing https://bugs.webkit.org/show_bug.cgi?id=180210 Reviewed by Chris Dumez. Clear the sw connection maps when connection is closing. Call related completion handlers for each connection. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::connectionToServerLost): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didClose): (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-12-01 Eric Carlson [MediaStream] Use CaptureDevice instead of device ID to identify devices https://bugs.webkit.org/show_bug.cgi?id=180206 Reviewed by Youenn Fablet. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::allow): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-12-01 Carlos Garcia Campos WebDriver: link and partial links queries don't work in xhtml documents https://bugs.webkit.org/show_bug.cgi?id=180191 Reviewed by Brian Burg. We convert the queries to use xpath, which works for html documents, but it doesn't work for xhtml. In case of xhtml we would need to provide a namespace resolver and elements would need to be prefixed with 'xhtml:'. It's easier to simply iterate the link elements and compare the text. Fixes: imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[link text-full link text] imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[partial link text-link text] imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[link text-full link text] imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[partial link text-link text] imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[link text-full link text] imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[partial link text-link text] imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[link text-full link text] imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[partial link text-link text] * UIProcess/Automation/atoms/FindNodes.js: (switch): (tryToFindNode): 2017-11-30 Alex Christensen REGRESSION (r224791): cookies are shared between ephemeral sessions in the same process pool https://bugs.webkit.org/show_bug.cgi?id=180235 Reviewed by Joseph Pecoraro. In r224791 I assumed that uiProcessCookieStorageIdentifier would be empty in the ephemeral session initialization message. This is not the case. We did not catch this because almost all of our ephemeral session testing uses the legacyPrivateSessionID. I add checks for if the SessionID is ephemeral like we already have in WebFrameNetworkingContext::ensureWebsiteDataStoreSession. I also add an API test that makes sure cookies are not shared between ephemeral sessions the way they are made through the API. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): 2017-11-30 Stephan Szabo Make LegacyCustomProtocolManager optional for network process https://bugs.webkit.org/show_bug.cgi?id=176230 Reviewed by Alex Christensen. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::initializeNetworkProcess): * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): (WebKit::NetworkProcessProxy::didClose): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient): (WebKit::WebProcessPool::registerSchemeForCustomProtocol): (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): 2017-11-30 Ryan Haddad Unreviewed build fix, suppress deprecation warnings. * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtensionImpl::sandboxExtensionForType): 2017-11-30 Daniel Bates Expose SPI didClickAlternativePresentationButtonWithUserInfo on iOS https://bugs.webkit.org/show_bug.cgi?id=180218 Reviewed by Alex Christensen. We want to support the SPI didClickAlternativePresentationButtonWithUserInfo on Cocoa platforms. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): 2017-11-30 Joseph Pecoraro [Cocoa] Web Automation: _WKAutomationSessionConfiguration leak https://bugs.webkit.org/show_bug.cgi?id=180222 Reviewed by Brian Burg. * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): 2017-11-30 Joseph Pecoraro Fix some NSOperationQueue leaks https://bugs.webkit.org/show_bug.cgi?id=180221 Reviewed by Wenson Hsieh. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): 2017-11-30 Brian Burg Web Automation: computeElementLayout does not correctly translate iframe client coordinates to main frame coordinates https://bugs.webkit.org/show_bug.cgi?id=180213 Reviewed by Simon Fraser. The current implementation computes points in terms of the frame in which the element is located. However, WebDriver expects coordinates to be relative to the top-level document since these coordinates are used for generating click events, among other things. To convert from frame client coordinates to main frame client coordinates, round-trip both inViewCenterPoint and elementBounds to root view coordinates and back to the main frame's contents/client coordinates. Then convert this to page coordinates if needed. This progresses several tests in the Selenium Python test suite: - event_firing_webdriver_tests.py::test_should_fire_navigation_events - frame_switching_tests.py::testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement - frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs - position_and_size_tests.py::testShouldGetCoordinatesOfAnInvisibleElement * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::computeElementLayout): Get both the frame and main frame FrameViews and convert coordinates to the root view. This is somewhat lossy as clientToDocument* deals with FloatPoints but contentsToRootView deals with IntPoints. For the purposes of WebDriver, lossiness is not a problem since integer values are expected anyway. The imperative nature of the coordinate calculations is difficult to debug, so I converted this function to only assign to each variable once. 2017-11-30 Alex Christensen WKURLSchemeHandler.request should include HTTPBody https://bugs.webkit.org/show_bug.cgi?id=180220 Reviewed by Brady Eidson. * Shared/URLSchemeTaskParameters.cpp: Added. (WebKit::URLSchemeTaskParameters::encode const): (WebKit::URLSchemeTaskParameters::decode): * Shared/URLSchemeTaskParameters.h: Added. * UIProcess/API/Cocoa/WKURLSchemeTask.mm: (-[WKURLSchemeTaskImpl request]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::create): (WebKit::WebURLSchemeTask::WebURLSchemeTask): * UIProcess/WebURLSchemeTask.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::startLoading): 2017-11-30 Darin Adler [Mac] remove unneeded RetainPtr use introduced in r225142 https://bugs.webkit.org/show_bug.cgi?id=180202 Reviewed by Tim Horton. * WebProcess/Plugins/PDF/PDFPlugin.h: Got rid of unnecessary RetainPtr. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::lookupTextAtLocation const): Ditto. * WebProcess/WebPage/WebPage.h: Ditto. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto. (WebKit::WebPage::performDictionaryLookupForSelection): Ditto. (WebKit::WebPage::performImmediateActionHitTestAtLocation): Ditto. (WebKit::WebPage::lookupTextAtLocation): Ditto. 2017-11-30 Zan Dobersek [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine https://bugs.webkit.org/show_bug.cgi?id=180141 Reviewed by Carlos Garcia Campos. CompositingCoordinator must implement the paintingEngine() method now that the method's been added to the CoordinatedGraphicsLayerClient interface. The CompositingCoordinator manages the Nicosia::PaintingEngine object through the new m_paintingEngine member variable, and returns the reference to this object in the paintingEngine() method. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): (WebKit::CompositingCoordinator::paintingEngine): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Drop unnecessary typedefs. 2017-11-29 Wenson Hsieh [Attachment Support] Implement SPI for clients to make an attachment element display in-place https://bugs.webkit.org/show_bug.cgi?id=180153 Reviewed by Tim Horton. Add new WebKit SPI, -[_WKAttachment setDisplayOptions:completion:], and add plumbing for attachment display options to the web content process. Changes covered by 4 new API tests. * Scripts/webkit/messages.py: (headers_for_type): * UIProcess/API/APIAttachment.cpp: (API::Attachment::setDisplayOptions): * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): Respect given display options when inserting a new attachment. * UIProcess/API/Cocoa/_WKAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.mm: (-[_WKAttachmentDisplayOptions coreDisplayOptions]): Introduce a helper to convert from the Cocoa _WKAttachmentDisplayOptions object to platform-agnostic AttachmentDisplayOptions. (-[_WKAttachment setDisplayOptions:completion:]): (WebKit::if): Deleted. * UIProcess/API/Cocoa/_WKAttachmentInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::insertAttachment): (WebKit::WebPageProxy::setAttachmentDisplayOptions): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertAttachment): (WebKit::WebPage::requestAttachmentData): (WebKit::WebPage::setAttachmentDisplayOptions): (WebKit::WebPage::attachmentElementWithIdentifier const): Pull common logic to retrieve an attachment element matching a given identifier out into a helper. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-11-29 Brent Fulgham Part 2: Adopt updated NSKeyed[Un]Archiver API when available https://bugs.webkit.org/show_bug.cgi?id=180127 Reviewed by Simon Fraser. The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer) to the modern API. Use the original API for macOS builds prior to 10.12. * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encodePlatformData): * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setObject:forBundleParameter:]): (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): 2017-11-29 Brady Eidson When managing context startups, make ServiceWorkerJobDataIdentifier's optional. https://bugs.webkit.org/show_bug.cgi?id=180166 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::didFinishInstall): * WebProcess/Storage/WebSWContextManagerConnection.h: 2017-11-29 Youenn Fablet Add support for service worker generated redirections https://bugs.webkit.org/show_bug.cgi?id=179498 Reviewed by Darin Adler. Small refactoring to allow a service worker redirected fetch to follow the redirection through the service worker. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): Make use of the loader request in case a network load is needed after a service worker redirection. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::create): (WebKit::ServiceWorkerClientFetch::~ServiceWorkerClientFetch): (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch): (WebKit::ServiceWorkerClientFetch::start): (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Check for response. Generate redirected request if needed and call loader callback to process the redirection. Adding some states so that if didFinish is called before the willSendRequest callback, redirection is followed. (WebKit::ServiceWorkerClientFetch::didFinish): In case redirection should be followed, wait for didFinish to follow it. This simplifies the model although introducing some limited latency. * WebProcess/Storage/ServiceWorkerClientFetch.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): 2017-11-29 Youenn Fablet Add support for FetchEvent.clientId https://bugs.webkit.org/show_bug.cgi?id=180052 Reviewed by Chris Dumez. Using FetchOption persistency coders for cache API and modernizing IPC FetchOptions decoding. * WebKit/Shared/WebCoreArgumentCoders.cpp: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::encode): (WebKit::CacheStorage::Cache::decodeRecordHeader): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): 2017-11-29 Alex Christensen Make WebFrameLoaderClient more robust against null pointer dereferencing https://bugs.webkit.org/show_bug.cgi?id=180157 Reviewed by Tim Horton. There has always been rare null pointer crashes in this code, but they have become more common now that we are waiting for completion handlers for redirects, which makes it more likely that we are hitting this code after we have detached from the core frame. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::page const): 2017-11-29 Alex Christensen Fix Mac CMake build. * PlatformMac.cmake: 2017-11-29 Chris Dumez StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection https://bugs.webkit.org/show_bug.cgi?id=180147 Reviewed by Brady Eidson. StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection. Otherwise, we have with 2 IPC::Connections between the StorageProcess and the ServiceWorker (aka Context) process, which makes synchronization of IPC messages difficult. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::createStorageToWebProcessConnection): (WebKit::StorageProcess::createServerToContextConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::start): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::getStorageProcessConnection): (WebKit::StorageProcessProxy::didFinishLaunching): (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getStorageProcessConnection): (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getStorageProcessConnection): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::isServiceWorkerProcess const): * UIProcess/WebProcessProxy.messages.in: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveMessage): (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-11-29 Chris Dumez ensure*Connection() methods on WebProcess should return a reference https://bugs.webkit.org/show_bug.cgi?id=180149 Reviewed by Alex Christensen. ensure*Connection() methods on WebProcess should return a reference instead of not returning anything. Also get rid of the non-ensure variants which called "ensure" internally and are no longer needed. * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::connection): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::messageSenderConnection): (WebKit::preregisterSandboxExtensionsIfNecessary): * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): (WebKit::BlobRegistryProxy::registerBlobURL): (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked): (WebKit::BlobRegistryProxy::unregisterBlobURL): (WebKit::BlobRegistryProxy::registerBlobURLForSlice): (WebKit::BlobRegistryProxy::blobSize): (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles): * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::remove): (WebKit::WebLoaderStrategy::setDefersLoading): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::preconnectTo): (WebKit::WebLoaderStrategy::storeDerivedDataToCache): (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::messageSenderConnection): * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::WebSocketStream): (WebKit::WebSocketStream::messageSenderConnection): * WebProcess/Network/webrtc/LibWebRTCResolver.cpp: (WebKit::sendOnMainThread): * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::sendOnMainThread): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket): (WebKit::LibWebRTCSocketFactory::CreateUdpSocket): (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket): (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::sendOnMainThread): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): (WebKit::WebPlatformStrategies::setCookiesFromDOM): (WebKit::WebPlatformStrategies::cookiesEnabled): (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): (WebKit::WebPlatformStrategies::getRawCookies): (WebKit::WebPlatformStrategies::deleteCookie): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::startDownload): (WebKit::WebFrame::convertMainResourceLoadToDownload): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess): (WebKit::WebProcess::ensureNetworkProcessConnection): (WebKit::WebProcess::ensureWebToStorageProcessConnection): (WebKit::WebProcess::prefetchDNS): * WebProcess/WebProcess.h: 2017-11-29 Alex Christensen Modernize API::SerializedScriptValue https://bugs.webkit.org/show_bug.cgi?id=180115 Reviewed by Brady Eidson. Also remove some SPI that hasn't been used anywhere since Mountain Lion. * Shared/API/APISerializedScriptValue.h: (API::SerializedScriptValue::create): (API::SerializedScriptValue::internalRepresentation): (API::SerializedScriptValue::SerializedScriptValue): * Shared/API/c/WKSerializedScriptValue.cpp: (WKSerializedScriptValueDeserialize): (WKSerializedScriptValueCreateWithInternalRepresentation): Deleted. (WKSerializedScriptValueGetInternalRepresentation): Deleted. * Shared/API/c/WKSerializedScriptValuePrivate.h: Removed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): * WebKit.xcodeproj/project.pbxproj: 2017-11-29 Michael Catanzaro REGRESSION(r218064): [GTK] Broke entering fullscreen mode in debug builds https://bugs.webkit.org/show_bug.cgi?id=180120 Reviewed by Carlos Garcia Campos. These assertions need to be swapped. Fixes /webkit2/WebKitWebView/fullscreen in debug mode. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseEnterFullScreen): (webkitWebViewBaseExitFullScreen): 2017-11-29 Zan Dobersek [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer https://bugs.webkit.org/show_bug.cgi?id=180135 Reviewed by Carlos Garcia Campos. Adjust code to the CoordinatedBuffer -> Nicosia::Buffer transition. * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::setBackBuffer): (WebKit::CoordinatedBackingStore::updateTile): * Shared/CoordinatedGraphics/CoordinatedBackingStore.h: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): (WebKit::CoordinatedGraphicsScene::updateImageBacking): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::updateImageBacking): (WebKit::CompositingCoordinator::createUpdateAtlas): (WebKit::CompositingCoordinator::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): (WebKit::UpdateAtlas::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2017-11-28 Brent Fulgham Adopt updated NSKeyed[Un]Archiver API when available https://bugs.webkit.org/show_bug.cgi?id=180127 Reviewed by Alex Christensen. Switch to new NSKeyed[Un]Archiver methods when available. We do not attempt to adopt secure coding in places we were not under the original API. * Platform/ios/AccessibilityIOS.mm: (WebKit::newAccessibilityRemoteToken): Use secure-by-default API. * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): Ditto. (WebKit::DataDetectionResult::decode): Ditto. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): Ditto. (WebKit::InteractionInformationAtPosition::decode): Ditto. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): Ditto. (WebKit::WebHitTestResultData::platformDecode): Ditto. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setObject:forBundleParameter:]): Ditto. (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): Ditto. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): Ditto. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): Ditto. (WebKit::InjectedBundle::setBundleParameter): Ditto. (WebKit::InjectedBundle::setBundleParameters): Ditto. 2017-11-28 Youenn Fablet NetworkCache::Storage should protect itself when removing operations from its maps https://bugs.webkit.org/show_bug.cgi?id=180118 Reviewed by Antti Koivisto. The operations can contain ref to the Storage object and removing them from the map may destroy the Storage object * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::remove): (WebKit::NetworkCache::Storage::finishReadOperation): (WebKit::NetworkCache::Storage::finishWriteOperation): (WebKit::NetworkCache::Storage::traverse): 2017-11-28 Youenn Fablet Register Documents as ServiceWorker clients to the StorageProcess https://bugs.webkit.org/show_bug.cgi?id=180047 Reviewed by Brady Eidson. Adding IPC to register/unregister clients to the storage process. This will be used to enable service worker termination, and implementation of Clients API. WebSWServerConnection keeps a hash map of all its related clients. This allows unregistering these clients if the corresponding web process crashes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::~WebSWServerConnection): (WebKit::WebSWServerConnection::registerServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::registerServiceWorkerClient): (WebKit::WebSWClientConnection::unregisterServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: 2017-11-28 Said Abou-Hallawa [CG] PostScript images should be supported if they are sub-resource images https://bugs.webkit.org/show_bug.cgi?id=178502 Reviewed by Simon Fraser. Make convertPostScriptDataToPDF() be as static function of PDFDocumentImage in WebCore. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::convertPostScriptDataIfNeeded): (WebKit::convertPostScriptDataToPDF): Deleted. 2017-11-28 Alex Christensen Add SPI for adding strings directly to a _WKVisitedLinkStore https://bugs.webkit.org/show_bug.cgi?id=180100 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/_WKVisitedLinkStore.h: * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm: (-[_WKVisitedLinkStore addVisitedLinkWithString:]): This is a performance optimization for rdar://problem/16321391 2017-11-28 Joseph Pecoraro REGRESSION: Web Inspector: context menu actions "Download Image" and "Open Image in New Window" don't work https://bugs.webkit.org/show_bug.cgi?id=178808 Reviewed by Brian Burg. * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController _webView:contextMenu:forElement:]): Continue to hide the image context menu actions like we used to. Investigating making these context menus work can be done as a follow-up task. * UIProcess/mac/WKWebInspectorWKWebView.mm: (-[WKWebInspectorWKWebView initWithFrame:configuration:]): Use nullptr instead of 0. 2017-11-14 Carlos Garcia Campos Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h https://bugs.webkit.org/show_bug.cgi?id=173793 Reviewed by Joseph Pecocaro. Based on patch by Brian Burg. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::navigationOccurredForFrame): (WebKit::WebAutomationSession::documentLoadedForFrame): (WebKit::WebAutomationSession::inspectorFrontendLoaded): (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::setFilesToSelectForFileUpload): (WebKit::WebAutomationSession::addSingleCookie): (WebKit::WebAutomationSession::setSessionPermissions): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Automation/WebAutomationSession.h: 2017-11-28 Daniel Bates [Cocoa] First pass at implementing alternative presentation button element https://bugs.webkit.org/show_bug.cgi?id=179785 Part of Reviewed by Brent Fulgham. Expose SPI to substitute the alternative presentation button for one or more elements and remove the alternative presentation button. Add a private delegate callback when the alternative presentation button is clicked. * UIProcess/API/APIUIClient.h: (API::UIClient::didClickAlternativePresentationButton): Added. * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Wired up delegate callback. (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Added. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Added. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Added. (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Added. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleSubstituteWithAlternativePresentationButton): Added. (WKBundleRemoveAlternativePresentationButton): Added. * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h: * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Added. * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Added. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-11-27 Chris Dumez ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingRegistration(WebCore::ServiceWorkerClientIdentifier const&) + 141 https://bugs.webkit.org/show_bug.cgi?id=180049 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): * WebProcess/Storage/WebSWClientConnection.h: 2017-11-27 Jeremy Jones downcast to WebKit::FullscreenClient can sometimes fail. https://bugs.webkit.org/show_bug.cgi?id=179849 Reviewed by Darin Adler. There are cases during teardown where fullscreenClient() has been cleared back to an API::FullscreenClient. Because those cases, WKWebView should test before downcasting to WebKit::FullscreenClient. This is causing a crash when fullscreen delegate is cleared after a page is closed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): 2017-11-27 Chris Dumez Give Document a strongly typed identifier instead of a uint64_t https://bugs.webkit.org/show_bug.cgi?id=180041 Reviewed by Youenn Fablet. Give Document a strongly typed identifier instead of a uint64_t, for clarity. * Platform/IPC/ArgumentCoders.h: * Scripts/webkit/messages.py: (forward_declarations_and_headers): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::notifyClientsOfControllerChange): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-27 Yacine Bandou [GTK][WPE] Add "enable-encrypted-media" property to WebKitWebSettings https://bugs.webkit.org/show_bug.cgi?id=18005 Reviewed by Michael Catanzaro. EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML. This property will only work as intended if the EncryptedMedia feature is enabled at build time with the ENABLE_ENCRYPTED_MEDIA flag. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): (webKitSettingsGetProperty): (webkit_settings_class_init): (webkit_settings_get_enable_encrypted_media): (webkit_settings_set_enable_encrypted_media): * UIProcess/API/gtk/WebKitSettings.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitSettings.h: 2017-11-27 Tim Horton One too many zeroes in macOS version number in FeatureDefines https://bugs.webkit.org/show_bug.cgi?id=180011 Reviewed by Dan Bernstein. * Configurations/FeatureDefines.xcconfig: 2017-11-27 Zan Dobersek [CoordGraphics] Prettify ID value handling in UpdateAtlas and UpdateAtlas::Client https://bugs.webkit.org/show_bug.cgi?id=180038 Reviewed by Carlos Garcia Campos. In the UpdateAtlas class, provide an ID type that aliases to uint32_t. The m_id member variable (ex-m_ID) uses this type, and it's also now used in the Client interface. While poking around, the header is modified to use '#pragma once', and m_id is moved to the more logical first position among member variables. The static ID variable is modified to use the new type, and renamed to s_nextID. Comment alongside the namespace scope closure is fixed to use the appropriate name. createUpdateAtlas() and removeUpdateAtlas() methods in the CompositingCoordinator class are modified to use the UpdateAtlas::ID type, and the former has the second parameter changed from RefPtr<> to Ref<>. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::createUpdateAtlas): (WebKit::CompositingCoordinator::removeUpdateAtlas): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): (WebKit::UpdateAtlas::~UpdateAtlas): (WebKit::UpdateAtlas::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2017-11-27 Zan Dobersek [CoordGraphics] CompositingCoordinator: clean up Client vtable, GraphicsLayerClient overrides https://bugs.webkit.org/show_bug.cgi?id=180037 Reviewed by Carlos Garcia Campos. Remove the CompositingCoordinator::Client::paintLayerContents() method since the only implementation in CoordinatedLayerTreeHost was empty. Subsequently, the CompositingCoordinator::paintContents() override of the GraphicsLayerClient method can also be removed. The notifyAnimationStarted() override is empty, just like the base method, so it's removed as well. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::deviceScaleFactor const): Bring method up to the notifyFlushRequired() code, since both are overrides of the GraphicsLayerClient-inherited methods. (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto. (WebKit::CompositingCoordinator::notifyAnimationStarted): Deleted. (WebKit::CompositingCoordinator::paintContents): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::paintLayerContents): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: 2017-11-27 Carlos Garcia Campos REGRESSION(r223073): disk cache directory is no longer copied in ProcessPoolConfiguration::copy() https://bugs.webkit.org/show_bug.cgi?id=180031 Reviewed by Youenn Fablet. This has caused GTK/WPE test /webkit2/WebKitWebsiteData/configuration to fail, and the wrong directory is used by the network process. I think it was removed by mistake in r223073. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): Copy m_diskCacheDirectory too. 2017-11-27 Adrian Perez de Castro [WPE][GTK] Improve contents of pkg-config .pc files https://bugs.webkit.org/show_bug.cgi?id=180032 Reviewed by Carlos Garcia Campos. * gtk/webkit2gtk-web-extension.pc.in: Add URL, edit Name and Description. * gtk/webkit2gtk.pc.in: Add URL, edit Name. * wpe/wpe-webkit.pc.in: Add URL, edit Name and Description. 2017-11-23 Darin Adler Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby https://bugs.webkit.org/show_bug.cgi?id=179981 Reviewed by Sam Weinig. * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more things final and private. Changed functions with multiple return values to use tuples instead of out arguments for clarity, especially because some were using pointers and it was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization of data members into the class definition. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::create): Take a reference. (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition. (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument. (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options. Simplified slightly confusing match count code that was doing some unnecessary comparisons with the maximum match count. Use auto a bit. (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++ and overloading works based on the argument type. (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change. (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out arguments and use a RetainPtr so we don't leak the options dictionary. * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h. * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference. * WebProcess/WebPage/FindController.cpp: (WebKit::core): Use |= instead of | to build up a FindOptions. (WebKit::FindController::FindController): Initialize data members in the class definition. (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame. (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code. (WebKit::FindController::findString): Use |= rather than | to add in an option. (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options. * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core function that converts WebKit::FindOptions to WebCore::FindOptions. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame. (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM. (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame. (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer. Use is/downcast insteadof more ad hoc coding style. (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two enumrations matching! The stricter type checking of OptionSet helps us catch mistakes like this. * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if statements, made forward declarations unconditional, and re-sorted them. Changed the Mac-specific lookupTextAtLocation to return a tuple (see below). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr to fix code that used to leak. (WebKit::WebPage::performDictionaryLookupForSelection): Ditto. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference. (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types. (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the tuple result from the lookupTextAtLocation functions. (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr for the NSDictionary to help fix the leak. 2017-11-24 Zan Dobersek [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer https://bugs.webkit.org/show_bug.cgi?id=179977 Reviewed by Carlos Garcia Campos. Make CompositingCoordinator::getCoordinatedBuffer() return a Ref value. In case an UpdateAtlas with enough free area is found, its CoordinatedBuffer is dereferenced into the return value. In case a new UpdateAtlas is created, the returned CoordinatedBuffer pointer is asserted to be non-null and dereferenced. The retrieved CoordinatedBuffer pointer on a newly-created UpdateAtlas should never be null since the tiles are smaller in size than the UpdateAtlas area. The assert is done in release configurations as well since the code in CoordinatedGraphicsLayer assumes the returned pointer will be non-null, so it's just a matter of where to crash first in case somehow a null value is returned. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-11-24 Zan Dobersek [CoordGraphics] UpdateAtlas constructor should receive an IntSize, not a dimension value https://bugs.webkit.org/show_bug.cgi?id=179976 Reviewed by Carlos Garcia Campos. Have the UpdateAtlas constructor receive an IntSize object that specifies the desired size for the CoordinatedBuffer. Passing in a dimension doesn't really make sense since this value isn't dynamically configurable, and the only value that is passed in is already a power-of-two. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::getCoordinatedBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2017-11-23 Sam Weinig Remove unneeded ScriptController::processingUserGesture() forwarding functions https://bugs.webkit.org/show_bug.cgi?id=179954 Reviewed by Darin Adler. Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia() with direct calls to the corresponding UserGestureIndicator functions. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::isProcessingUserGesture): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addResourceRequest): 2017-11-23 Chris Dumez WebSWServerConnection should register/unregister itself with the StorageProcess https://bugs.webkit.org/show_bug.cgi?id=179965 Reviewed by Darin Adler. WebSWServerConnection should register/unregister itself with the StorageProcess instead of relying on StorageToWebProcessConnection to do so on its behalf. This is less error-prone. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::~WebSWServerConnection): * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): 2017-11-23 Darin Adler Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII https://bugs.webkit.org/show_bug.cgi?id=179907 Reviewed by Sam Weinig. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::isMediaMIMEType): Use startsWithLettersIgnoringASCIICase. * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::hashString): Use isAllASCII.. * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetCustomHeaderFields): Use startsWithLettersIgnoringASCIICase.. * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setCustomHeaderFields:]): Ditto. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): Use endsWithIgnoringASCIICase. * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::WebPreferences): Initialize m_identifier explicitly. Somehow changing the String default constructor to be "= default" led to a warning that we otherwise did not get about not initializing m_identifier. Arguably a compiler bug, but legitimately strange that the copy constructor does not copy m_identifier and so nice to be explicit about it, I guess. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Use endsWithIgnoringASCIICase. (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Ditto. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): Use isAllSpecialCharacters. 2017-11-23 Zan Dobersek [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates https://bugs.webkit.org/show_bug.cgi?id=179972 Reviewed by Carlos Garcia Campos. In CompositingCoordinator, add the getCoordinatedBuffer() method, replacing paintToSurface(). The new method traverses the list of UpdateAtlases and returns any CoordinatedBuffer object that was free to use. If none exist, a new UpdateAtlas object is created, and its CoordinatedBuffer is returned. In UpdateAtlas, the paintOnAvailableBuffer() method is replaced with getCoordinatedBuffer(). The latter allocates the necessary area but then returns a reference to the CoordinatedBuffer buffer, along with the atlas ID and the allocated rectangle information, and does not invoke any painting operation like paintOnAvailableBuffer() did. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::getCoordinatedBuffer): (WebKit::CompositingCoordinator::paintToSurface): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::getCoordinatedBuffer): (WebKit::UpdateAtlas::paintOnAvailableBuffer): Deleted. * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: 2017-11-23 Zan Dobersek [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations https://bugs.webkit.org/show_bug.cgi?id=179970 Reviewed by Carlos Garcia Campos. Drop the helper UpdateAtlasSurfaceClient class and instead directly use the CoordinatedBuffer's GraphicsContext to perform clip and translation operations based on the allocated rectangle, to pre-fill the target rect with transparent color in case the alpha channel is supported, and to then invoke CoordinatedBuffer::Client::paintToSurfaceContext() method, passing the GraphicsContext as the argument. * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::paintOnAvailableBuffer): (): Deleted. 2017-11-23 Zan Dobersek [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer https://bugs.webkit.org/show_bug.cgi?id=179967 Reviewed by Carlos Garcia Campos. Replace uses of CoordinatedSurface class with CoordinatedBuffer. The ThreadSafeCoordinatedSurface class is removed, along with the code in CoordinatedLayerTreeHost that established a CoordinatedSurface factory. * PlatformGTK.cmake: * PlatformWPE.cmake: * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::swapBuffers): (WebKit::CoordinatedBackingStoreTile::setBackBuffer): (WebKit::CoordinatedBackingStore::updateTile): * Shared/CoordinatedGraphics/CoordinatedBackingStore.h: Rename m_surface to m_buffer, m_surfaceOffset to m_bufferOffset. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): (WebKit::CoordinatedGraphicsScene::updateImageBacking): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: Removed. * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: Removed. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::updateImageBacking): (WebKit::CompositingCoordinator::createUpdateAtlas): (WebKit::CompositingCoordinator::paintToSurface): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: (WebKit::UpdateAtlas::UpdateAtlas): (WebKit::UpdateAtlas::~UpdateAtlas): (WebKit::UpdateAtlas::paintOnAvailableBuffer): * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Rename m_surface to m_buffer. (WebKit::UpdateAtlas::size const): (WebKit::UpdateAtlas::supportsAlpha const): 2017-11-22 Ali Juma Implement VisualViewport API attributes https://bugs.webkit.org/show_bug.cgi?id=179385 Reviewed by Frédéric Wang. Add a VisualViewportAPI experimental feature. * Shared/WebPreferences.yaml: 2017-11-22 Tim Horton and Michael Catanzaro Remove build-webkit's notion of feature flags having a default value https://bugs.webkit.org/show_bug.cgi?id=177338 Reviewed by Carlos Alberto Lopez Perez. Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime experimental features. * Shared/WebPreferencesDefaultValues.h: 2017-11-22 Commit Queue Unreviewed, rolling out r225093. https://bugs.webkit.org/show_bug.cgi?id=179938 Compilation failed on WinCairo 64-bit Release (Requested by fredw on #webkit). Reverted changeset: "Implement VisualViewport API attributes" https://bugs.webkit.org/show_bug.cgi?id=179385 https://trac.webkit.org/changeset/225093 2017-11-21 Ali Juma Implement VisualViewport API attributes https://bugs.webkit.org/show_bug.cgi?id=179385 Reviewed by Frédéric Wang. Add a VisualViewportAPI experimental feature. * Shared/WebPreferences.yaml: 2017-11-21 Christopher Reid [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras https://bugs.webkit.org/show_bug.cgi?id=179504 Reviewed by Darin Adler. * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: 2017-11-21 Carlos Garcia Campos [WPE] WPEWebProcess: Couldn't find current GLX or EGL context https://bugs.webkit.org/show_bug.cgi?id=179883 Reviewed by Žan Doberšek. I'm seeing that message quite often when running the unit tests. The problem seems to be that some tests run so fast that the web process never renders the first frame, so the context is created but never made current. I've checked with apitrace that there are calls to eglQueryContext with null display, causing a EGL_BAD_DISPLAY, but I don't know where those calls are originated. Making the context current right after it's created fixes the problem. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::createGLContext): Always call makeContextCurrent() right after the context is created. 2017-11-20 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.2 release. * gtk/NEWS: Add release notes for 2.19.2. 2017-11-20 Don Olmstead Add declspec within WebKit API https://bugs.webkit.org/show_bug.cgi?id=179893 Reviewed by Darin Adler. * Shared/API/c/WKDeclarationSpecifiers.h: 2017-11-20 Mario Sanchez Prada [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager https://bugs.webkit.org/show_bug.cgi?id=177932 Reviewed by Carlos Garcia Campos. Added new API to WebKitCookieManager to add, retrieve and delete complete cookies into/out-of a running session, and updated documentation sections. * UIProcess/API/glib/WebKitCookieManager.cpp: (webkit_cookie_manager_add_cookie): New function. (webkit_cookie_manager_add_cookie_finish): Ditto. (webkit_cookie_manager_get_cookies): Ditto. (webkit_cookie_manager_get_cookies_finish): Ditto. (webkit_cookie_manager_delete_cookie): Ditto. (webkit_cookie_manager_delete_cookie_finish): Ditto. * UIProcess/API/gtk/WebKitCookieManager.h: Added new functions. * UIProcess/API/wpe/WebKitCookieManager.h: Ditto. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Ditto. 2017-11-20 Carlos Garcia Campos [WPE] webkit_web_view_new() should enable specifying wpe_view_backend object https://bugs.webkit.org/show_bug.cgi?id=178655 Reviewed by Michael Catanzaro. Update all WebKitWebView constructors to receive a WebKitWebViewBackend as argument. It's now required to provide a backend to create a web view, but it can be NULL to use the default one. WebKitWebViewBackend is a boxed type wrapping a struct wpe_view_backend* used as construct only property of WebKitWebView. The view always takes the ownership of the WebKitWebViewBackend which owns the struct wpe_view_backend*. An optional GDestroyNotify and user data pointer can be passed to the WebKitWebViewBackend constructor to provide a custom deleter for the backend. In the C API the struct wpe_view_backend* is also mandatory now, but it can't be NULL and it's owned by the caller, not the view. * PlatformWPE.cmake: * UIProcess/API/C/wpe/WKView.cpp: (WKViewCreate): * UIProcess/API/C/wpe/WKView.h: * UIProcess/API/glib/WebKitWebView.cpp: (_WebKitWebViewPrivate::~_WebKitWebViewPrivate): (webkitWebViewConstructed): (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkit_web_view_class_init): (webkitWebViewCreatePage): (webkit_web_view_get_backend): * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_backend): (WKWPE::View::~View): * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/WebKitWebViewBackend.cpp: Added. (_WebKitWebViewBackend::_WebKitWebViewBackend): (_WebKitWebViewBackend::~_WebKitWebViewBackend): (webkitWebViewBackendRef): (webkitWebViewBackendUnref): (webkitWebViewBackendCreateDefault): (webkit_web_view_backend_new): (webkit_web_view_backend_get_wpe_backend): * UIProcess/API/wpe/WebKitWebViewBackend.h: Added. * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: Added. * UIProcess/API/wpe/WebKitWebViewWPE.cpp: (webkit_web_view_new): (webkit_web_view_new_with_context): (webkit_web_view_new_with_related_view): (webkit_web_view_new_with_settings): (webkit_web_view_new_with_user_content_manager): * UIProcess/API/wpe/webkit.h: 2017-11-20 Carlos Garcia Campos [GTK][WPE] webkit_cookie_manager_delete_all_cookies doesn't delete the cookies if called before a web process is running https://bugs.webkit.org/show_bug.cgi?id=175265 Reviewed by Michael Catanzaro. This is what happens: 1- We create our WebKitWebContext that creates its WebProcessPool. 2- We set a persistent cookies storage. 3- We ask the website data store to delete all cookies, but since website data store is a web process observer and we haven't spawned any web process yet, it creates a new WebProcessPool with the default configuration (no persistent cookies) and sends the message to delete the cookies there. 4- The network process of the second process pool does nothing because it doesn't have cookies at all. We need to set the primary data store of the WebProcessPool when WebKitWebContext is constructed to ensure that one is used before the web process is launched. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): 2017-11-19 Tim Horton Remove unused TOUCH_ICON_LOADING feature flag https://bugs.webkit.org/show_bug.cgi?id=179873 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-11-19 Tim Horton Remove unused LEGACY_VENDOR_PREFIXES feature flag https://bugs.webkit.org/show_bug.cgi?id=179872 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: 2017-11-18 Chris Dumez ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier) https://bugs.webkit.org/show_bug.cgi?id=179846 Reviewed by Darin Adler. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::rejectJobInClient): (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient): (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::didFinishInstall): * WebProcess/Storage/WebSWContextManagerConnection.h: 2017-11-18 Tim Horton Rename some Network Capture debugging defines https://bugs.webkit.org/show_bug.cgi?id=179870 Reviewed by Darin Adler. * NetworkProcess/capture/NetworkCaptureLogging.h: * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::findMatch): (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): These shouldn't have WTF in their name - they have nothing to do with WTF. These shouldn't use ENABLE(), since they're not features, just debugging macros. 2017-11-17 Chris Dumez [Service Workers] Implement "Notify Controller Change" algorithm https://bugs.webkit.org/show_bug.cgi?id=179822 Reviewed by Youenn Fablet. * Scripts/webkit/messages.py: (class_template_headers): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::notifyClientsOfControllerChange): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-17 Chris Dumez Use a strongly typed identifier for SWServer::Connection https://bugs.webkit.org/show_bug.cgi?id=179848 Reviewed by Brady Eidson. Use a strongly typed identifier for SWServer::Connection, for clarity. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (forward_declarations_and_headers.templates): (headers_for_type): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFailFetch): (WebKit::StorageProcess::didNotHandleFetch): (WebKit::StorageProcess::didReceiveFetchResponse): (WebKit::StorageProcess::didReceiveFetchData): (WebKit::StorageProcess::didReceiveFetchFormData): (WebKit::StorageProcess::didFinishFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): (WebKit::generateIDBConnectionToServerIdentifier): (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): * StorageProcess/StorageToWebProcessConnection.h: * StorageProcess/StorageToWebProcessConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-11-17 John Wilander Storage Access API: UI process should update network process about granted access https://bugs.webkit.org/show_bug.cgi?id=176943 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Updates storage access on the session. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): (WebKit::NetworkProcess::setStorageAccessAPIEnabled): * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerSetStorageAccessAPIEnabled): * UIProcess/API/C/WKCookieManager.h: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _isStorageAccessAPIEnabled]): (-[WKProcessPool _setStorageAccessAPIEnabled:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]): Test infrastructure. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::WebProcessPool::setStorageAccessAPIEnabled): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::nextRequestStorageAccessContextId): (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Sends a message to the network process to update storage access. (WebKit::NetworkProcessProxy::storageAccessRequestResult): Receives a message from the network process that storage access was updated. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebProcessPool.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): Test infrastructure. (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Now makes the API call even if the only operation is to clear first. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Propagates the storage access directive to the network process proxy. (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-11-16 Yousuke Kimoto [WinCairo] Add network (curl) files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=179474 Reviewed by Alex Christensen. * Shared/curl/WebCoreArgumentCodersCurl.cpp: (IPC::ArgumentCoder::decode): Fidex return value since currently no operation is needed for wincairo webkit. (IPC::ArgumentCoder::decodePlatformData): Fidex return value since currently no operation is needed for wincairo webkit. * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp. (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h. 2017-11-16 Don Olmstead [WinCairo] Update WinCairoRequirements https://bugs.webkit.org/show_bug.cgi?id=179790 Reviewed by Alex Christensen. * PlatformWin.cmake: 2017-11-16 Youenn Fablet Service Worker should get the body of intercepted requests https://bugs.webkit.org/show_bug.cgi?id=179776 Reviewed by Alex Christensen. Pass a FormDataReference when starting fetch IPC. Convert this FormDataReference in a FormData and using it to set the FetchRequest body properly in Service Worker process. Forbid fetch interception when URL is not HTTP/HTTPS. * Platform/IPC/FormDataReference.h: (IPC::FormDataReference::FormDataReference): (IPC::FormDataReference::takeData): (IPC::FormDataReference::encode const): (IPC::FormDataReference::decode): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::startFetch): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): 2017-11-16 Daniel Bates Add feature define for alternative presentation button element https://bugs.webkit.org/show_bug.cgi?id=179692 Part of Reviewed by Andy Estes. Only enabled on Cocoa platforms by default. * Configurations/FeatureDefines.xcconfig: 2017-11-16 Chris Dumez [Service Worker] Implement "Try Clear Registration" algorithm https://bugs.webkit.org/show_bug.cgi?id=179791 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): * WebProcess/Storage/WebSWClientConnection.h: 2017-11-16 Michael Catanzaro REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState https://bugs.webkit.org/show_bug.cgi?id=179797 Reviewed by Simon Fraser. r224179 introduced a performance regression. The newly-added code in WebPage::editorState is part of a performance-critical path. (The editor state is computed and sent to the UI process during the layer flush.) Calls to Editor::canUndo and Editor::canRedo were added, but these calls are both implemented with sync IPC calls to WebPageProxy in the UI process. WebPageProxy passes them along to PageClientImpl to compute the availability of the commands. That's all pointless because this code only exists for the purpose of getting editing command availability to the UI process. In the case of undo and redo, it's not needed at all. I did not realize that when writing the code. So canUndo and canRedo should be removed from EditorState. This ought to be sufficient to avoid the perf regression. No changes are needed to the GTK/WPE WebKitEditorState API. The API is reimplemented using WebPageProxy::canUndoRedo instead of EditorState. There should be no changes in behavior, only performance. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: * UIProcess/API/glib/WebKitEditorState.cpp: (webkitEditorStateCreate): (webkitEditorStateChanged): * UIProcess/API/glib/WebKitEditorStatePrivate.h: * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_get_editor_state): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::canUndo): (WebKit::WebPageProxy::canRedo): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): 2017-11-16 Megan Gardner Remove allowBlockSelection as block selection is not supported anymore https://bugs.webkit.org/show_bug.cgi?id=179738 Reviewed by Tim Horton. Remove all instances of the alloweBlockSelection flag. Blocks selection is fully disabled and thus this flag will do nothing. This was only added as a debug measure last year, and nothing ever actually used it. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _allowsBlockSelection]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _allowsBlockSelection]): Deleted. (-[WKWebViewConfiguration _setAllowsBlockSelection:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::allowsBlockSelection): Deleted. * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: 2017-11-16 Brent Fulgham Whitelist additional IOKit properties based on customer feedback https://bugs.webkit.org/show_bug.cgi?id=179782 Reviewed by Dean Jackson. Expand the IOKit property whitelist to recognize a few more properties as valid based on review of logs from customer systems and our test infrastructure. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-15 Brady Eidson Implement basics of "Terminate Service Worker" algorithm. https://bugs.webkit.org/show_bug.cgi?id=179551 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::terminateWorker): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::terminateWorker): (WebKit::WebSWContextManagerConnection::workerTerminated): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-15 Brent Fulgham Remove access to 'com.apple.mediaaccessibility.public' preferences in WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=179747 Reviewed by Dean Jackson. The 'mediaaccessibilityd' process handles access to MediaAccessibility preferences. We don't need to grant the WebContent Process sandbox access to them. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-15 Alex Christensen Revert r224885 https://bugs.webkit.org/show_bug.cgi?id=179719 * UIProcess/API/APIContentRuleListStore.cpp: (API::compiledToFile): r224885 was a speculative fix that did not fix anything on the bots. 2017-11-15 Brent Fulgham Unreviewed build fix after r224830. * WebProcess/com.apple.WebProcess.sb.in: Add missing sysctl-read permissions needed to support testing on Mac Mini hardware. 2017-11-15 Youenn Fablet Add ServiceWorker to WebProcess plumbery for FormData fetch responses https://bugs.webkit.org/show_bug.cgi?id=179694 Reviewed by Alex Christensen. Added plumbery from Service Worker up to Web Process to pass form data response bodies. A follow-up patch should read the data from Network Process and send it to the ResourceLoader. * Platform/IPC/FormDataReference.h: Added. (IPC::FormDataReference::FormDataReference): (IPC::FormDataReference::takeData): (IPC::FormDataReference::encode const): (IPC::FormDataReference::decode): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::didReceiveFetchFormData): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didReceiveFetchFormData): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveFormData): * WebProcess/Storage/ServiceWorkerClientFetch.h: * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: 2017-11-15 Alex Christensen Move a compiled WKContentRuleList to its destination before calling mmap https://bugs.webkit.org/show_bug.cgi?id=179719 Reviewed by Brady Eidson. Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it. Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist any more. Moving the file before mmaping and closing the file might prevent this failure. * UIProcess/API/APIContentRuleListStore.cpp: (API::compiledToFile): 2017-11-15 Chris Dumez [Service Workers] Implement Client API https://bugs.webkit.org/show_bug.cgi?id=179709 Reviewed by Alex Christensen. * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-15 Ryan Haddad Unreviewed, rolling out r224863. Introduced LayoutTest crashes on iOS Simulator. Reverted changeset: "Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h" https://bugs.webkit.org/show_bug.cgi?id=173793 https://trac.webkit.org/changeset/224863 2017-11-14 Brent Fulgham Remove access to "com.apple.pbs.fetch_services" from WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=179689 Reviewed by Per Arne Vollan. WebKit's WebContent process should not have any need to interact with the fetch_services API exposed to the system. These interactions (if needed) should be happening in the UIProcess, so we should prevent the untrusted Web Content Process from being able to connect. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-15 Michael Catanzaro Remove GTK web inspector images https://bugs.webkit.org/show_bug.cgi?id=179716 Reviewed by Carlos Garcia Campos. * InspectorGResources.cmake: 2017-11-15 Gabriel Ivascu [GTK] Automatically adjust font size when gtk-xft-dpi changes https://bugs.webkit.org/show_bug.cgi?id=142673 Some follow-up fixes for the previous patch. Reviewed by Carlos Garcia Campos. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsDispose): (webKitSettingsConstructed): 2017-11-14 Nan Wang AX: AOM: Implement AccessibleNode class and support label and role attributes https://bugs.webkit.org/show_bug.cgi?id=179494 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAccessibilityObjectModelEnabled): (WKPreferencesGetAccessibilityObjectModelEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2017-11-14 Carlos Garcia Campos Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h https://bugs.webkit.org/show_bug.cgi?id=173793 Reviewed by Brian Burg. Based on patch by Brian Burg. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): (WebKit::WebAutomationSession::navigationOccurredForFrame): (WebKit::WebAutomationSession::documentLoadedForFrame): (WebKit::WebAutomationSession::inspectorFrontendLoaded): (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::setFilesToSelectForFileUpload): (WebKit::WebAutomationSession::addSingleCookie): (WebKit::WebAutomationSession::setSessionPermissions): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Automation/WebAutomationSession.h: 2017-11-14 Chris Dumez [Service Workers] Implement container.getRegistrations() https://bugs.webkit.org/show_bug.cgi?id=179672 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::getRegistrations): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::didGetRegistrations): (WebKit::WebSWClientConnection::getRegistrations): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-14 Youenn Fablet Implement ServiceWorker handle fetch for navigation loads https://bugs.webkit.org/show_bug.cgi?id=179404 Reviewed by Alex Christensen and Chris Dumez. Update handle fetch algorithm to support navigation requests. In case of navigation requests, set service worker response mime type to text/html if none is provided. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): (WebKit::WebServiceWorkerProvider::handleFetch): 2017-11-14 Alex Christensen Remove Cocoa CFURLConnection loading code https://bugs.webkit.org/show_bug.cgi?id=179688 Reviewed by Antti Koivisto. * NetworkProcess/Downloads/Download.h: 2017-11-14 Daniel Bates Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files for feature defines Following r195498 and r201917 the Visual Studio property files for feature defines have moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops. Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these files. * Configurations/FeatureDefines.xcconfig: 2017-11-14 Brent Fulgham Whitelist some IOKIt properties to avoid sandbox violations on YouTube https://bugs.webkit.org/show_bug.cgi?id=179683 Reviewed by Dean Jackson. YouTube video playback on some hardware (and some video encodings) generates sandbox violations. Add whitelist entries for the relevant IOKit properties needed to support these activities. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-14 Daniel Bates Mark WebChromeClient::requestStorageAccess() as final https://bugs.webkit.org/show_bug.cgi?id=179673 Reviewed by Sam Weinig. Mark WebChromeClient::requestStorageAccess() as final so that it overrides the virtual function in ChromeClient with the same name and hence we actually call it through a ChromeClient pointer. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-11-14 Youenn Fablet WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized https://bugs.webkit.org/show_bug.cgi?id=179668 Reviewed by Chris Dumez. There may be cases where the origin table is not initialized and we would think there is no service worker registration. In such a case, we should go to the StorageProcess. StorageProcess is now sending an IPC message back to each registered SW connection so that WebProcess will know whether its map is correctly initialized or not. Renaming hasServiceWorkerRegisteredForOrigin in mayHaveServiceWorkerRegisteredForOrigin. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const): (WebKit::WebSWClientConnection::matchRegistration): (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): Deleted. * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWOriginTable.h: (WebKit::WebSWOriginTable::isInitialized const): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): 2017-11-14 Brent Fulgham Consolidate sysctl-read rules in WebProcess sandbox https://bugs.webkit.org/show_bug.cgi?id=179674 Reviewed by Dean Jackson. Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into the main function in the sandbox profile. Remove the statement to grant global sysctl-read permissions that was copied into this sandbox profile in an earlier checkin. We started blocking the blanket read permissions in macOS 10.13, and want to continue to do so. The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads to occur before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking systcl reads from the start, we need to add whitelist entries for a few more entries to avoid creating new sandbox violations. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-14 Alex Christensen Remove WebKit CFURLConnection code https://bugs.webkit.org/show_bug.cgi?id=179645 Reviewed by Alexey Proskuryakov. The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/mac/DownloadMac.mm: * NetworkProcess/NetworkLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::serverTrustCredential): * NetworkProcess/mac/NetworkLoadMac.mm: * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::useCredentialForSingleChallenge): (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): (WebKit::AuthenticationManager::cancelSingleChallenge): (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: * Shared/Authentication/mac/AuthenticationManager.mac.mm: (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * config.h: 2017-11-14 Alex Christensen Remove assertions added in r224791 https://bugs.webkit.org/show_bug.cgi?id=178751#c10 * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): I had added assertions that sandbox extension handle consumption succeeds. In the API test IndexedDB.StructuredCloneBackwardCompatibility we get a sandbox extension handle to give access to a directory that does not exist and consumption fails. We want it to fail, so my optimistic addition of a success assertion was incorrect. The test passes without it and behaves like it used to. 2017-11-14 Tim Horton Don't use -[NSString stringWithFormat:] to build defaults keys https://bugs.webkit.org/show_bug.cgi?id=179680 Reviewed by Simon Fraser. * UIProcess/mac/WebPreferencesMac.mm: (WebKit::makeKey): (WebKit::debugUserDefaultsValue): Use string concatenation instead of stringWithFormat to build preference keys. This wasn't a huge cost, but it shaves a few milliseconds off process launch. 2017-11-14 Alex Christensen Clean up old URL parser remnants https://bugs.webkit.org/show_bug.cgi?id=179573 Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::searchWithGoogle): Use https if we do end up searching with google. 2017-11-14 Antti Koivisto Enable display:contents by default https://bugs.webkit.org/show_bug.cgi?id=179655 Reviewed by Sam Weinig. * Shared/WebPreferences.yaml: Make non-experimental and enabled. 2017-11-10 Brent Fulgham Consolidate mach-lookup calls in WebProcess sandbox https://bugs.webkit.org/show_bug.cgi?id=179650 Reviewed by Dean Jackson. Consolidate the various calls to 'allow mach-lookup' imported during Bug 179548 into the main function in the sandbox profile. Remove some entries that are not needed by WebKit. Remove the statement to grant global permission to perform mach-lookup for any xpc service name that was copied into this sandbox profile in Bug 179548. We started blocking this in macOS 10.13 and want to continue to do so. The earlier "grant global permission" in 'system.sb' apparently allowed some xpc lookups to occur before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking mach lookups we need to add whitelist entries for a few more services to avoid creating new sandbox violations. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-14 Tim Horton Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet https://bugs.webkit.org/show_bug.cgi?id=179646 Reviewed by Simon Fraser. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant showLinkSheet]): (-[WKActionSheetAssistant showDataDetectorsSheet]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): Make use of canBePresentedByDataDetectors with our WebCore URL instead of (sometimes unsucessfully) reparsing the URL with NSURL's parser. Also, avoid a few unnecessary round-trips through String when converting from URL to NSURL. 2017-11-14 Brent Fulgham REGRESSION(r224799): WebKit crashes on Sierra due to sandbox violation https://bugs.webkit.org/show_bug.cgi?id=179656 Unreviewed build fix. * WebProcess/com.apple.WebProcess.sb.in: Switch to Dan's recommended version check. 2017-11-13 Joseph Pecoraro Give a ServiceWorker WebContentProcess a different display name https://bugs.webkit.org/show_bug.cgi?id=179653 Reviewed by Brady Eidson. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::create): Call connect after construction so virtual methods will use subclass implementations. * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::create): Copy the pattern from WebProcessProxy to ensure connect() gets called after construction. (WebKit::ServiceWorkerProcessProxy::getLaunchOptions): Set a launch option to signal this is a Service Worker process. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeProcessName): Consume the launch option to configuration the process name. 2017-11-13 Ryosuke Niwa REGRESSION(r224799): WebKit crashes at launch on macOS Sierra due to a sandbox violation https://bugs.webkit.org/show_bug.cgi?id=179656 Unreviewed. Revert r224799 on macOS Sierra. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-13 Chris Dumez Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers https://bugs.webkit.org/show_bug.cgi?id=179649 Reviewed by Brady Eidson. * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateRegistrationStateInClient): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-13 Brady Eidson Massive "Server-process-to-context-process" connection overhaul. https://bugs.webkit.org/show_bug.cgi?id=179554 Reviewed by Chris Dumez. * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::sendToContextProcess): (WebKit::WebSWServerConnection::installServiceWorkerContext): Deleted. (WebKit::WebSWServerConnection::fireInstallEvent): Deleted. (WebKit::WebSWServerConnection::fireActivateEvent): Deleted. (WebKit::WebSWServerConnection::setContextConnection): Deleted. * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp. (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection): (WebKit::WebSWServerToContextConnection::messageSenderConnection): (WebKit::WebSWServerToContextConnection::messageSenderDestinationID): (WebKit::WebSWServerToContextConnection::connectionClosed): (WebKit::WebSWServerToContextConnection::installServiceWorkerContext): (WebKit::WebSWServerToContextConnection::fireInstallEvent): (WebKit::WebSWServerToContextConnection::fireActivateEvent): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerTypes.h. (WebKit::WebSWServerToContextConnection::create): (WebKit::WebSWServerToContextConnection::ipcConnection const): * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didClose): (WebKit::StorageProcess::didReceiveMessage): (WebKit::StorageProcess::globalServerToContextConnection): (WebKit::StorageProcess::createServerToContextConnection): (WebKit::StorageProcess::didGetWorkerContextProcessConnection): (WebKit::StorageProcess::workerContextProcessConnection): Deleted. (WebKit::StorageProcess::createWorkerContextProcessConnection): Deleted. (WebKit::StorageProcess::serviceWorkerContextFailedToStart): Deleted. (WebKit::StorageProcess::serviceWorkerContextStarted): Deleted. (WebKit::StorageProcess::didFinishServiceWorkerInstall): Deleted. (WebKit::StorageProcess::didFinishServiceWorkerActivation): Deleted. (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): Deleted. * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::fireInstallEvent): (WebKit::WebSWContextManagerConnection::fireActivateEvent): (WebKit::WebSWContextManagerConnection::didFinishInstall): (WebKit::WebSWContextManagerConnection::didFinishActivation): (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-13 Brent Fulgham WebContent sandbox should not include 'system.sb' https://bugs.webkit.org/show_bug.cgi?id=179548 Reviewed by Darin Adler. Stop including 'system.sb', and just include the portions of that sandbox that we actually use in WebContent Process. This is the first step in some further sandbox tightening. * WebProcess/com.apple.WebProcess.sb.in: 2017-11-13 Simon Fraser When navigating back to a page, compositing layers may not use accelerated drawing https://bugs.webkit.org/show_bug.cgi?id=178749 rdar://problem/35158946 Reviewed by Dean Jackson. Avoid assertions when a test enables accelerated drawing (which we can't support in the iOS simulator). * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::ensureBackingStore): 2017-11-13 Youenn Fablet matchRegistration does not need to go to StorageProcess if no service worker is registered https://bugs.webkit.org/show_bug.cgi?id=179480 Reviewed by Chris Dumez. Removed origin store handling from StorageProcess since it is now handled within SWServer. Updated clearing of web site data accordingly. Optimized matchRegistration by looking at the origin store before doing any IPC. Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess. * StorageProcess/ServiceWorker/WebSWOriginStore.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient): * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): (WebKit::StorageProcess::swServerForSession): (WebKit::StorageProcess::swOriginStoreForSession): (WebKit::StorageProcess::registerSWServerConnection): (WebKit::StorageProcess::unregisterSWServerConnection): (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted. (WebKit::StorageProcess::swOriginStoreForSession const): Deleted. * StorageProcess/StorageProcess.h: * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: (WebKit::WebSWOriginStore::addToStore): (WebKit::WebSWOriginStore::removeFromStore): (WebKit::WebSWOriginStore::clearStore): (WebKit::WebSWOriginStore::add): Deleted. (WebKit::WebSWOriginStore::remove): Deleted. (WebKit::WebSWOriginStore::clear): Deleted. * StorageProcess/ServiceWorker/WebSWOriginStore.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::matchRegistration): 2017-11-13 Alex Christensen Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type https://bugs.webkit.org/show_bug.cgi?id=178751 Reviewed by Brady Eidson. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted. * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): * Shared/WebsiteDataStoreParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::pageAddedToProcess): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSessionID): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-11-13 Alex Christensen Add logs to debug content extension test failures https://bugs.webkit.org/show_bug.cgi?id=179624 Reviewed by Chris Dumez. * UIProcess/API/APIContentRuleListStore.cpp: (API::compiledToFile): Right now I'm seeing this log: "Rule list compilation failed: Unspecified error during compile." I need more information to debug what is failing on the bots. 2017-11-07 Brian Burg Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates https://bugs.webkit.org/show_bug.cgi?id=179129 Reviewed by Simon Fraser. When computing the in view center point per W3C specification, the top content inset is inadvertently added back in when converting to the root view coordinate system. This patch reworks the protocol command so that it explicitly requests a coordinate system, with options for "Page" (root / contents), "LayoutViewport", and "VisualViewport". The latter is not implemented in this patch, since it is intended for use on iOS someday. * UIProcess/Automation/Automation.json: Change usesViewport to CoordinateSystem. Add a new coordinate system enum type and use it. Fix relevant comments for Automation.computElementLayout. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::protocolStringToCoordinateSystem): (WebKit::WebAutomationSession::computeElementLayout): Parse the requested coordinate system and send it in the message to the web process. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::computeElementLayout): Rework the implementation. Get the element bounds and in-view center point in client coordinates and convert back to root view coordinates for CoordinateSystem::Page. 2017-11-08 Keith Miller Async iteration should only fetch the next method once and add feature flag https://bugs.webkit.org/show_bug.cgi?id=179451 Reviewed by Geoffrey Garen. Add feature flag for Async iteration. * Configurations/FeatureDefines.xcconfig: 2017-11-13 Mark Lam Add more overflow check book-keeping for MarkedArgumentBuffer. https://bugs.webkit.org/show_bug.cgi?id=179634 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::construct): (WebKit::NPJSObject::invoke): 2017-11-13 Timothy Horton Address some post-landing review comments from r224728 https://bugs.webkit.org/show_bug.cgi?id=179576 * Platform/IPC/mac/MachMessage.h: (IPC::MachMessage::setMessageReceiverName): (IPC::MachMessage::setMessageName): More moving! 2017-11-13 Tim Horton Occasional MobileSafari crash under -[WKPDFView web_setMinimumSize:] https://bugs.webkit.org/show_bug.cgi?id=179628 Reviewed by Simon Fraser. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _computePageAndDocumentFrames]): Similar to r223444, avoid propagating null CGRects into the view hierarchy. In this case, the null rect comes from applying margins to a rect that is smaller than the margins. We could check for that specifically, but a more-general check for a null rect seems reasonable. 2017-11-13 Tim Horton Use the real mach type instead of reinterpret_casting in MachMessage https://bugs.webkit.org/show_bug.cgi?id=179629 Reviewed by Dan Bernstein. * Platform/IPC/mac/MachMessage.cpp: (IPC::MachMessage::header): * Platform/IPC/mac/MachMessage.h: Just use mach_msg_header_t proper, and avoid the reinterpret_cast. This also corrects the alignment of the struct on platforms where alignof(mach_msg_header_t) != alignof(uint8_t). 2017-11-13 Gabriel Ivascu [GTK] Automatically adjust font size when gtk-xft-dpi changes https://bugs.webkit.org/show_bug.cgi?id=142673 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsDispose): (webKitSettingsConstructed): (webkit_settings_class_init): 2017-11-13 Chris Dumez Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms https://bugs.webkit.org/show_bug.cgi?id=179618 Reviewed by Brady Eidson. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents): * WebProcess/Storage/WebSWContextManagerConnection.h: 2017-11-13 Wenson Hsieh [Attachment Support] Implement SPI for clients to request data for a given attachment https://bugs.webkit.org/show_bug.cgi?id=179586 Reviewed by Darin Adler. Adds support in WebKit for fetching data for a given attachment element. See WebCore/ChangeLog for more details. Most of the changes here are boilerplate plumbing of -requestAttachmentData through the client layers. Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests. * UIProcess/API/APIAttachment.cpp: (API::Attachment::requestData): * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.h: * UIProcess/API/Cocoa/_WKAttachment.mm: (-[_WKAttachment requestData:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sharedBufferCallback): Add a new IPC callback helper type, SharedBufferCallback. This is similar to the existing DataCallback, but instead of deserializing to an API::Data, we convert to a SharedBuffer instead. Additionally, SharedBufferCallback is able to draw a distinction between null data and empty data. This allows -requestData: to distinguish between cases where (for instance) the data for a given attachment is an empty blob, and when the attachment doesn't exist at all. (WebKit::WebPageProxy::dataCallback): (WebKit::WebPageProxy::insertAttachment): (WebKit::WebPage::invokeSharedBufferCallback): (WebKit::WebPageProxy::requestAttachmentData): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::requestAttachmentData): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-11-12 Darin Adler More is<> and downcast<>, less static_cast<> https://bugs.webkit.org/show_bug.cgi?id=179600 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp: (WebKit::wrap): Use is/downcast. * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): Ditto. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::handleEditingKeyboardEvent): Ditto. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::frameForEvent): Ditto. 2017-11-12 Gabriel Ivascu [GTK] Add functionality to handle font sizes in points https://bugs.webkit.org/show_bug.cgi?id=179285 Reviewed by Carlos Garcia Campos and Michael Catanzaro. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): (webkit_settings_font_size_to_points): (webkit_settings_font_size_to_pixels): * UIProcess/API/gtk/WebKitSettings.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 2017-11-11 Tim Horton Increase the alignment requirement of WKObject's wrapped C++ object https://bugs.webkit.org/show_bug.cgi?id=179518 Reviewed by Dan Bernstein. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::allocateWKObject): (API::Object::fromWKObjectExtraSpace): (API::Object::newObject): * Shared/Cocoa/WKObject.mm: (-[WKObject dealloc]): (-[WKObject _apiObject]): * UIProcess/API/Cocoa/WKConnection.mm: (-[WKConnection dealloc]): (-[WKConnection _apiObject]): (-[WKConnection _connection]): Increase the alignment of the C++ object stored inside WKObject's extra space to 8-bytes, for platforms where some types require greater-than-pointer alignment. To achieve this, increase the size of the extra-space allocation by the difference between 8 bytes and pointer-alignment, and then align within that. 2017-11-11 Tim Horton Avoid composing the message + recipient name for crash logs until a failure actually occurs https://bugs.webkit.org/show_bug.cgi?id=179576 Reviewed by Dan Bernstein. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendMessage): (IPC::Connection::sendOutgoingMessage): * Platform/IPC/mac/MachMessage.h: (IPC::MachMessage::messageReceiverName const): (IPC::MachMessage::setMessageReceiverName): (IPC::MachMessage::messageName const): (IPC::MachMessage::setMessageName): Store the message name and receiver name separately on MachMessage, only composing them into a string if the message is unhandled. This makes the time spent composing the string in sendOutgoingMessage completely disappear. In absolute terms, it wasn't huge, but if you do enough IPC it starts to add up. 2017-11-10 Chris Dumez [Service Workers] Implement "Try Activate" / "Activate" algorithms https://bugs.webkit.org/show_bug.cgi?id=179436 Reviewed by Brady Eidson. Implement proper "Try Activate" / "Activate" algorithms as per: - https://w3c.github.io/ServiceWorker/#try-activate-algorithm - https://w3c.github.io/ServiceWorker/#activation-algorithm * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::fireActivateEvent): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFinishServiceWorkerActivation): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::fireActivateEvent): (WebKit::WebSWContextManagerConnection::didFinishActivation): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-10 John Wilander Ignore HSTS for partitioned, cross-origin subresource requests https://bugs.webkit.org/show_bug.cgi?id=178993 Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (downgradeRequest): Convenience function to downgrade a request if CFNetwork as already upgraded it during canonicalization. This allows the rest of WebKit's processing to function, such as UIR and mixed content blocking. (updateIgnoreStrictTransportSecuritySettingIfNecessary): Adds and removed the ignore request accordingly. (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. 2017-11-10 Alex Christensen _WKThumbnailView initialization with WKWebView needs to call correct initWithFrame https://bugs.webkit.org/show_bug.cgi?id=179537 Reviewed by Darin Adler. I introduced this in r223439 and made an ObjC mistake. This is what I get for adding SPI with no tests. I fixed this by making the existing WKView/_WKThumbnailView API tests work with WKWebView. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView initWithFrame:fromWKWebView:]): 2017-11-10 Carlos Garcia Campos [GTK][WPE] Switch to use API::NavigationClient https://bugs.webkit.org/show_bug.cgi?id=178720 Reviewed by Alex Christensen. Replace WebKitLoaderClient and WebKitPolicyClient with WebKitNavigationClient that implements API::NavigationClient. * PlatformGTK.cmake: * PlatformWPE.cmake: * UIProcess/API/APINavigationAction.h: Add new constructor that receives a target frame name instead of a target frame info. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didDisplayInsecureContent): Added. (API::NavigationClient::didRunInsecureContent): Added. (API::NavigationClient::decidePolicyForNavigationResponse): Change NavigationResponse parameter to be a Ref&& instead of a NavigationResponse&. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): Update NavigationResponse parameter. * UIProcess/API/glib/WebKitBackForwardList.cpp: (webkitBackForwardListChanged): * UIProcess/API/glib/WebKitBackForwardListPrivate.h: * UIProcess/API/glib/WebKitNavigationAction.cpp: (webkitNavigationActionCreate): Wrap the given API::NavigationAction. (webkit_navigation_action_get_navigation_type): Use the wrapped API::NavigationAction. (webkit_navigation_action_get_mouse_button): Ditto. (webkit_navigation_action_get_modifiers): Ditto. (webkit_navigation_action_get_request): Ditto. (webkit_navigation_action_is_user_gesture): Ditto. (webkit_navigation_action_is_redirect): Ditto. * UIProcess/API/glib/WebKitNavigationActionPrivate.h: (_WebKitNavigationAction::_WebKitNavigationAction): * UIProcess/API/glib/WebKitNavigationClient.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.cpp. (NavigationClient::NavigationClient): (attachNavigationClientToView): * UIProcess/API/glib/WebKitNavigationClient.h: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.h. * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: (webkit_navigation_policy_decision_get_frame_name): Add FIXME. (webkitNavigationPolicyDecisionCreate): Get the target frame name from the API::NavigationAction. * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h: * UIProcess/API/glib/WebKitPolicyClient.cpp: Removed. * UIProcess/API/glib/WebKitPolicyClient.h: Removed. * UIProcess/API/glib/WebKitPolicyDecision.cpp: (webkitPolicyDecisionSetListener): Remove the madePolicyDecision boolean member, we can null-check the listener instead. (webkit_policy_decision_use): Ensure listener is nullptr after being invoked to prevent the decision from being made more than once. (webkit_policy_decision_ignore): Ditto. (webkit_policy_decision_download): Ditto. * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h: * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: (webkit_response_policy_decision_get_request): Use the wrapped API::NavigationResponse. (webkit_response_policy_decision_get_response): Ditto. (webkit_response_policy_decision_is_mime_type_supported): Ditto. (webkitResponsePolicyDecisionCreate): Wrap the given API::NavigationResponse. * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h: * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::createNewPage): Create the WebKitNavigationAction from a new API::NavigationAction. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): Attach navigation client. * UIProcess/Cocoa/NavigationState.h: Update API::NavigationResponse parameter of decidePolicyForNavigationResponse. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): Notify the navigation client if it's used. (WebKit::WebPageProxy::didRunInsecureContentForFrame): Ditto. (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Use the new API::NavigationAction constructor to pass the target frame name, instead of a null target frame info. (WebKit::WebPageProxy::decidePolicyForResponse): Move the API::NavigationResponse. 2017-11-09 Chris Dumez Unreviewed, rolling out r224661. Broke build on several internal Mac/iOS bots Reverted changeset: "Ignore HSTS for partitioned, cross-origin subresource requests" https://bugs.webkit.org/show_bug.cgi?id=178993 https://trac.webkit.org/changeset/224661 2017-11-09 Chris Dumez ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects https://bugs.webkit.org/show_bug.cgi?id=179517 Reviewed by Brady Eidson. * Scripts/webkit/messages.py: (forward_declarations_and_headers): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateRegistrationStateInClient): (WebKit::WebSWServerConnection::fireUpdateFoundEvent): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-09 John Wilander Ignore HSTS for partitioned, cross-origin subresource requests https://bugs.webkit.org/show_bug.cgi?id=178993 Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (downgradeRequest): Convenience function to downgrade a request if CFNetwork as already upgraded it during canonicalization. This allows the rest of WebKit's processing to function, such as UIR and mixed content blocking. (updateIgnoreStrictTransportSecuritySettingIfNecessary): Adds and removed the ignore request accordingly. (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. 2017-11-09 Chris Dumez Implement real post 'install' event steps of the Install algorithm (steps 14+) https://bugs.webkit.org/show_bug.cgi?id=179401 Reviewed by Brady Eidson. Implement step 14+ of Install algorithm, as per: - https://w3c.github.io/ServiceWorker/#installation-algorithm * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::didResolveRegistrationPromise): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-09 Megan Gardner Clean out unused selection items from UIKitSPI https://bugs.webkit.org/show_bug.cgi?id=179459 Reviewed by Tim Horton. Many of these should have been removed from previous commits, but they were missed. None of these enums or methods are being used by WebKit anymore, and removing them will keep things clean and allow UIKit to remove things that are not used at all by anyone anymore. * Platform/spi/ios/UIKitSPI.h: 2017-11-09 Christopher Reid Use enum classes within FileSystem https://bugs.webkit.org/show_bug.cgi?id=175172 Reviewed by Darin Adler. * NetworkProcess/Downloads/BlobDownloadClient.cpp: * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/capture/NetworkCaptureManager.cpp: * NetworkProcess/capture/NetworkCaptureRecorder.cpp: * Shared/WebMemorySampler.cpp: * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: 2017-11-09 Youenn Fablet ServiceWorkerClientFetch should create not null ResourceError https://bugs.webkit.org/show_bug.cgi?id=179485 Reviewed by Darin Adler. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): 2017-11-09 Andy Estes [iOS] Adopt UIPreviewDataAttachmentListIsContentManaged https://bugs.webkit.org/show_bug.cgi?id=179458 Reviewed by Dan Bernstein. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dataForPreviewItemController:atPosition:type:]): 2017-11-08 Joseph Pecoraro Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings https://bugs.webkit.org/show_bug.cgi?id=179466 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: (-[WKHTTPCookieStore setCookie:completionHandler:]): (-[WKHTTPCookieStore deleteCookie:completionHandler:]): 2017-11-08 Jeremy Jones Make WKFullScreenWidnowController more robust against modification by the embedding app. https://bugs.webkit.org/show_bug.cgi?id=179413 rdar://problem/35408061 Reviewed by Darin Adler. Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's UIViewController hierarchy. Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window. This prevents the fullscreen interface from getting into an invalid state. Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale. Use a custom root view controller to allow hiding of the status bar. Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView removeFromSuperview]): * UIProcess/ios/WKFullScreenWindowControllerIOS.h: * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: (WebKit::WKWebViewState::applyTo): (WebKit::WKWebViewState::store): (-[_WKFullScreenViewController loadView]): (-[_WKFullscreenRootViewController prefersStatusBarHidden]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController completedExitFullScreen]): (-[WKFullScreenWindowController exitFullscreenImmediately]): (-[WKFullScreenWindowController close]): (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]): (-[_WKFullScreenViewController viewDidDisappear:]): Deleted. 2017-11-08 Jeremy Jones HTMLMediaElement should not use element fullscreen on iOS https://bugs.webkit.org/show_bug.cgi?id=179418 rdar://problem/35409277 Reviewed by Eric Carlson. Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not. * Configurations/FeatureDefines.xcconfig: 2017-11-08 Wenson Hsieh [Attachment Support] Implement delegate hooks for attachment element insertion and removal https://bugs.webkit.org/show_bug.cgi?id=179016 Reviewed by Tim Horton. See WebCore/ChangeLog for more details. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didInsertAttachment:]): (-[WKWebView _didRemoveAttachment:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/PageClientImplCocoa.h: * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::didInsertAttachment): (WebKit::PageClientImplCocoa::didRemoveAttachment): * UIProcess/PageClient.h: (WebKit::PageClient::didInsertAttachment): (WebKit::PageClient::didRemoveAttachment): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didInsertAttachment): (WebKit::WebPageProxy::didRemoveAttachment): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didInsertAttachment): (WebKit::WebEditorClient::didRemoveAttachment): * WebProcess/WebCoreSupport/WebEditorClient.h: 2017-11-08 Carlos Garcia Campos REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window https://bugs.webkit.org/show_bug.cgi?id=179365 Reviewed by Michael Catanzaro. In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from platform specific inspector files to the main file, but in the case of open the mac implementation was not exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and /webkit2/WebKitWebInspector/manual-attach-detach. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function. * UIProcess/WebInspectorProxy.h: Add m_isOpening. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true. 2017-11-07 Carlos Garcia Campos REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179 https://bugs.webkit.org/show_bug.cgi?id=179366 Reviewed by Michael Catanzaro. In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need to ask the web process. * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_can_execute_editing_command): 2017-11-07 Carlos Garcia Campos [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script https://bugs.webkit.org/show_bug.cgi?id=179317 Reviewed by Michael Catanzaro. This is the script used by Apple and it has several advantages: - It allows to combine and minify most of the js and css files, which improves performance and binary size. - It removes the debug resources and assertions in production builds. - It allows to remove the test resources in production builds. The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included by GTK+ and WPE platform cmake files. * InspectorGResources.cmake: Added. * PlatformGTK.cmake: * PlatformWPE.cmake: 2017-11-07 Jeremy Jones Add downcast support for FullscreenClient. https://bugs.webkit.org/show_bug.cgi?id=178824 Reviewed by Simon Fraser. Add SPECIALIZE_TYPE_TRAITS macros for API::FullscreenClient and WebKit::Fullscreen client so downcasts can be done safely. * UIProcess/API/APIFullscreenClient.h: (API::FullscreenClient::isType const): * UIProcess/API/C/mac/WKPagePrivateMac.mm: (WKPageSetFullscreenDelegate): (WKPageGetFullscreenDelegate): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): * UIProcess/Cocoa/FullscreenClient.h: (isType): * UIProcess/Cocoa/FullscreenClient.mm: 2017-11-07 Brady Eidson Implement "UpdateWorkerState" and use it https://bugs.webkit.org/show_bug.cgi?id=179318 Reviewed by Chris Dumez. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateWorkerStateInClient): (WebKit::WebSWServerConnection::installServiceWorkerContext): (WebKit::WebSWServerConnection::setContextConnection): (WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted. * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): (WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-07 Commit Queue Unreviewed, rolling out r224512 and r224521. https://bugs.webkit.org/show_bug.cgi?id=179388 An API test added with this change is failing an assertion on the bots. (Requested by ryanhaddad on #webkit). Reverted changesets: "[Attachment Support] Implement delegate hooks for attachment element insertion and removal" https://bugs.webkit.org/show_bug.cgi?id=179016 https://trac.webkit.org/changeset/224512 "Remove stray logging from a newly added API test" https://trac.webkit.org/changeset/224521 2017-11-07 Chris Dumez [Service Workers] Add support for "install" event https://bugs.webkit.org/show_bug.cgi?id=179338 Reviewed by Youenn Fablet. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::firePostInstallEvents): (WebKit::WebSWServerConnection::fireInstallEvent): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFinishServiceWorkerInstall): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::fireInstallEvent): (WebKit::WebSWContextManagerConnection::didFinishInstall): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-07 Youenn Fablet Support the case of fetch events that are not responded https://bugs.webkit.org/show_bug.cgi?id=179336 Reviewed by Chris Dumez. * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: 2017-11-06 Alex Christensen Make ResourceLoader::willSendRequestInternal asynchronous https://bugs.webkit.org/show_bug.cgi?id=179251 Reviewed by Andy Estes. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::start): 2017-11-06 Wenson Hsieh [Attachment Support] Implement delegate hooks for attachment element insertion and removal https://bugs.webkit.org/show_bug.cgi?id=179016 Reviewed by Tim Horton. Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API tests. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didInsertAttachment:]): (-[WKWebView _didRemoveAttachment:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/PageClientImplCocoa.h: * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::didInsertAttachment): (WebKit::PageClientImplCocoa::didRemoveAttachment): * UIProcess/PageClient.h: (WebKit::PageClient::didInsertAttachment): (WebKit::PageClient::didRemoveAttachment): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didInsertAttachment): (WebKit::WebPageProxy::didRemoveAttachment): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didInsertAttachment): (WebKit::WebEditorClient::didRemoveAttachment): * WebProcess/WebCoreSupport/WebEditorClient.h: 2017-11-06 Jeremy Jones iOS element fullscreen should use a UIGestureRecognizer to detect user interaction. https://bugs.webkit.org/show_bug.cgi?id=179029 rdar://problem/35307882 Reviewed by Simon Fraser. Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively recognizes UITouchBegin events. * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: (-[_WKFullScreenViewController loadView]): (-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[_WKTapDelegatingView setTarget:action:]): Deleted. (-[_WKTapDelegatingView hitTest:withEvent:]): Deleted. 2017-11-06 Chris Dumez [Service Workers] Add proper implementation for 'updatefound' event https://bugs.webkit.org/show_bug.cgi?id=179302 Reviewed by Brady Eidson. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::fireUpdateFoundEvent): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-06 Christopher Reid Use enum classes within FileSystem https://bugs.webkit.org/show_bug.cgi?id=175172 Reviewed by Myles C. Maxfield. * NetworkProcess/Downloads/BlobDownloadClient.cpp: * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/capture/NetworkCaptureManager.cpp: * NetworkProcess/capture/NetworkCaptureRecorder.cpp: * Shared/WebMemorySampler.cpp: * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: 2017-11-06 Michael Catanzaro [WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target https://bugs.webkit.org/show_bug.cgi?id=179097 Reviewed by Žan Doberšek. * PlatformWPE.cmake: 2017-11-05 Yusuke Suzuki JIT call inline caches should cache calls to objects with getCallData/getConstructData traps https://bugs.webkit.org/show_bug.cgi?id=144458 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::JSNPMethod::JSNPMethod): (WebKit::JSNPMethod::getCallData): Deleted. * WebProcess/Plugins/Netscape/JSNPMethod.h: (WebKit::JSNPMethod::createStructure): 2017-11-04 Chris Dumez REGRESSION(r223718): Leaking WebProcessPool after reconfiguration https://bugs.webkit.org/show_bug.cgi?id=179123 Reviewed by Geoff Garen. Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses go away at there is no use keeping it running at this point. Also, this prevents leaking the WebProcessPool since the WebProcessProxy holds a strong reference to the WebProcessPool. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::disconnectProcess): 2017-11-01 Darin Adler Simplify event dispatch code and make it a bit more consistent https://bugs.webkit.org/show_bug.cgi?id=178991 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp: (webkit_dom_event_get_src_element): Call target instead of srcElement. 2017-11-04 Aishwarya Nirmal [Touch Bar Web API] Add support for menuitem tag https://bugs.webkit.org/show_bug.cgi?id=179020 Reviewed by Ryosuke Niwa. Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime- enabled feature. It has a default value of false. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMenuItemElementEnabled): (WKPreferencesGetMenuItemElementEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2017-11-03 Chris Dumez Unreviewed, rolling out r224438. Has caused assertions on the bots Reverted changeset: "REGRESSION(r223718): Leaking WebProcessPool after reconfiguration" https://bugs.webkit.org/show_bug.cgi?id=179123 https://trac.webkit.org/changeset/224438 2017-11-03 Youenn Fablet Requests handled by Service Worker should not go through preflighting https://bugs.webkit.org/show_bug.cgi?id=179250 Reviewed by Alex Christensen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): 2017-11-03 Chris Dumez REGRESSION(r223718): Leaking WebProcessPool after reconfiguration https://bugs.webkit.org/show_bug.cgi?id=179123 Reviewed by Geoffrey Garen. Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses go away at there is no use keeping it running at this point. Also, this prevents leaking the WebProcessPool since the WebProcessProxy holds a strong reference to the WebProcessPool. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::disconnectProcess): 2017-11-03 Youenn Fablet Implement Service Worker Matching Registration algorithm https://bugs.webkit.org/show_bug.cgi?id=178882 Reviewed by Chris Dumez. Added IPC plumbery for matchRegistration request and response. Added some limited clearing of workers and registrations. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::matchRegistration): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::didMatchRegistration): (WebKit::WebSWClientConnection::matchRegistration): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebServiceWorkerProvider.h: 2017-11-03 Jeremy Jones Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame https://bugs.webkit.org/show_bug.cgi?id=179033 rdar://problem/35309279 Reviewed by Darin Adler. Screen coordinates are floats, so use NSRect instead of IntRect on Mac. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): 2017-11-03 Chris Dumez Use a single identifier type to identify Service Workers https://bugs.webkit.org/show_bug.cgi?id=179192 Reviewed by Brady Eidson. Use a single identifier type to identify Service Workers. We had both a String identifier and a uint64_t identifier for each service worker. We now consistently use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a uint64_t. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (forward_declarations_and_headers.templates): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::serviceWorkerContextFailedToStart): (WebKit::StorageProcess::serviceWorkerContextStarted): (WebKit::StorageProcess::postMessageToServiceWorkerClient): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updateServiceWorker): (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::startFetch): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-03 Antti Koivisto Enable display:contents by default as experimental feature https://bugs.webkit.org/show_bug.cgi?id=179239 Reviewed by Darin Adler. We pass most of the WPT tests. What remains is mostly flexbox related edge cases. * Shared/WebPreferences.yaml: 2017-11-03 Frederic Wang Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS https://bugs.webkit.org/show_bug.cgi?id=179238 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: 2017-11-02 Maciej Stachowiak Don't try to guess plugin MIME type from a file extension in a URL (no observable effect) https://bugs.webkit.org/show_bug.cgi?id=178333 Reviewed by Darin Adler. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto 2017-11-02 Brady Eidson SW: Implement "Update Registration State" algorithm (unused for now) https://bugs.webkit.org/show_bug.cgi?id=179186 Reviewed by Chris Dumez. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateRegistrationStateInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer): (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-11-02 Alex Christensen Use CompletionHandlers for redirects https://bugs.webkit.org/show_bug.cgi?id=179163 Reviewed by Tim Horton. * NetworkProcess/Downloads/BlobDownloadClient.cpp: (WebKit::BlobDownloadClient::willSendRequestAsync): * NetworkProcess/Downloads/BlobDownloadClient.h: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::continueWillSendRequest): (WebKit::NetworkLoad::willSendRequestAsync): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::willSendRequest): * UIProcess/API/C/WKContext.cpp: (WKContextSetDownloadClient): * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::willSendRequest): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::~Stream): (WebKit::PluginView::Stream::continueLoad): (WebKit::PluginView::Stream::willSendRequest): * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: 2017-11-02 Christopher Reid Add a FileSystem namespace to FileSystem.cpp https://bugs.webkit.org/show_bug.cgi?id=179063 Reviewed by Darin Adler. * NetworkProcess/Downloads/BlobDownloadClient.cpp: * NetworkProcess/Downloads/BlobDownloadClient.h: * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/cache/CacheStorageEngine.cpp: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: * NetworkProcess/cache/NetworkCacheData.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.cpp: * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: * NetworkProcess/cache/NetworkCacheStatistics.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: * NetworkProcess/capture/NetworkCaptureManager.cpp: * NetworkProcess/capture/NetworkCaptureManager.h: * NetworkProcess/capture/NetworkCaptureRecorder.cpp: * NetworkProcess/capture/NetworkCaptureResource.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: * NetworkProcess/soup/NetworkProcessSoup.cpp: * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: * Shared/Plugins/unix/PluginSearchPath.cpp: * Shared/WebMemorySampler.cpp: * Shared/WebMemorySampler.h: * Shared/gtk/ProcessExecutablePathGtk.cpp: * Shared/ios/ChildProcessIOS.mm: * Shared/mac/ChildProcessMac.mm: * Shared/mac/SandboxExtensionMac.mm: * Shared/wpe/ProcessExecutablePathWPE.cpp: * StorageProcess/StorageProcess.cpp: * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/API/glib/WebKitFaviconDatabase.cpp: * UIProcess/API/glib/WebKitFileChooserRequest.cpp: * UIProcess/API/glib/WebKitWebContext.cpp: * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: * UIProcess/Automation/WebAutomationSession.cpp: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: * UIProcess/Plugins/gtk/PluginInfoCache.cpp: * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: * UIProcess/WebStorage/LocalStorageDatabase.cpp: * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: * UIProcess/WebsiteData/WebsiteDataStore.cpp: * UIProcess/gtk/WebProcessPoolGtk.cpp: * UIProcess/mac/WebPageProxyMac.mm: * UIProcess/wpe/WebProcessPoolWPE.cpp: * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp: * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp: * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: 2017-11-02 Joseph Pecoraro Make ServiceWorker a Remote Inspector debuggable target https://bugs.webkit.org/show_bug.cgi?id=179043 Reviewed by Brian Burg. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (debuggableTypeString): Provide a way to start a Remote Web Inspector frontend for a ServiceWorker target type. 2017-11-02 Ryan Haddad Unreviewed, rolling out r224353. Breaks internal builds. Reverted changeset: "Ignore HSTS for partitioned, cross-origin subresource requests" https://bugs.webkit.org/show_bug.cgi?id=178993 https://trac.webkit.org/changeset/224353 2017-11-02 John Wilander Ignore HSTS for partitioned, cross-origin subresource requests https://bugs.webkit.org/show_bug.cgi?id=178993 Reviewed by Brent Fulgham and Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (downgradeRequest): Convenience function to downgrade a request if CFNetwork as already upgraded it during canonicalization. This allows the rest of WebKit's processing to function, such as UIR and mixed content blocking. (updateIgnoreStrictTransportSecuritySettingIfNecessary): Adds and removed the ignore request accordingly. (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Now asks CFNetwork to ignore HSTS on resource loads we partition cookies for. 2017-11-02 Yousuke Kimoto [WinCairo] Add IPC files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=177919 Reviewed by Alex Christensen. * Platform/IPC/Attachment.cpp: * Platform/IPC/Attachment.h: (IPC::Attachment::Attachment): (IPC::Attachment::handle): * Platform/IPC/Connection.h: (IPC::Connection::identifierIsNull): (IPC::Connection::sendWithReply): * Platform/IPC/win/AttachmentWin.cpp: Added. (IPC::Attachment::encode const): (IPC::getDuplicatedHandle): (IPC::Attachment::decode): * Platform/IPC/win/ConnectionWin.cpp: Added. (IPC::Connection::createServerAndClientIdentifiers): (IPC::Connection::platformInitialize): (IPC::Connection::platformInvalidate): (IPC::Connection::readEventHandler): (IPC::Connection::writeEventHandler): (IPC::Connection::open): (IPC::Connection::platformCanSendOutgoingMessages const): (IPC::Connection::sendOutgoingMessage): (IPC::Connection::willSendSyncMessage): (IPC::Connection::didReceiveSyncReply): * PlatformWin.cmake: 2017-11-02 Megan Gardner Early out selection update when data is not present https://bugs.webkit.org/show_bug.cgi?id=179084 Reviewed by Ryosuke Niwa. We should early out of a selection update when we do not have the data that is necessary to make that update. This mostly helps avoid debug asserts, but will be helpful with the selection changes that are ongoing. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateChangedSelection:]): 2017-11-02 Eric Carlson [MediaStream] audioTrack.label is always empty on macOS https://bugs.webkit.org/show_bug.cgi?id=179175 Reviewed by Youenn Fablet. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): Pass settings.label to Source constructor. 2017-11-02 Frederic Wang Add references to bug 179167 in FIXME comments https://bugs.webkit.org/show_bug.cgi?id=179168 Reviewed by Daniel Bates. * Configurations/FeatureDefines.xcconfig: 2017-11-01 Jeremy Jones Implement WKFullscreenWindowController for iOS. https://bugs.webkit.org/show_bug.cgi?id=178924 rdar://problem/34697120 Reviewed by Simon Fraser. Plumb relevant calls through WKWebView and PageClientImplIOS. This forms the base implementation for element fullscreen. This will animate an element into fullscreen and back to inline. It does this by replacing the WKWebView with a placeholder image and presenting the WKWebView with a fullscreen view controller. This also attempts to preserve UI state of the WKWebView when it is placed back inline. To enable _WKFullscreenDelegate for iOS, this adds an iOS version of the delegate methods that passes WKWebView instead of NSView. The iOS version of these functions are renamed to be more specific and disambiguate them from the video fullscreen delegate methods. This also adds an image asset for the done button. * Configurations/FeatureDefines.xcconfig: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView hasFullScreenWindowController]): (-[WKWebView fullScreenWindowController]): (-[WKWebView closeFullScreenWindowController]): (-[WKWebView fullScreenPlaceholderView]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: * UIProcess/Cocoa/FullscreenClient.h: * UIProcess/Cocoa/FullscreenClient.mm: (WebKit::FullscreenClient::FullscreenClient): (WebKit::FullscreenClient::setDelegate): (WebKit::FullscreenClient::willEnterFullscreen): (WebKit::FullscreenClient::didEnterFullscreen): (WebKit::FullscreenClient::willExitFullscreen): (WebKit::FullscreenClient::didExitFullscreen): * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::closeFullScreenManager): (WebKit::PageClientImpl::isFullScreen): (WebKit::PageClientImpl::enterFullScreen): (WebKit::PageClientImpl::exitFullScreen): (WebKit::PageClientImpl::beganEnterFullScreen): (WebKit::PageClientImpl::beganExitFullScreen): * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKFullscreenDelegate.h. * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Added. (WebKit::replaceViewWithView): (WebKit::WKWebViewState::applyTo): (WebKit::WKWebViewState::store): (-[_WKTapDelgatingView setTarget:action:]): (-[_WKTapDelgatingView hitTest:withEvent:]): (-[_WKFullScreenViewController dealloc]): (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]): (+[_WKFullScreenViewController configureView:withBackgroundFillOfColor:opacity:filter:]): (-[_WKFullScreenViewController _updateTransparencyOfVisualEffectView:]): (-[_WKFullScreenViewController createVisualEffectViewWithFrame:]): (-[_WKFullScreenViewController loadView]): (-[_WKFullScreenViewController viewWillAppear:]): (-[_WKFullScreenViewController viewDidDisappear:]): (-[_WKFullScreenViewController cancelAction:]): (-[_WKFullScreenViewController hideCancelButton]): (-[_WKFullScreenViewController showCancelButton]): (-[_WKFullScreenViewController setTarget:action:]): (-[_WKFullScreenViewController prefersStatusBarHidden]): (-[WKFullscreenAnimationController transitionDuration:]): (-[WKFullscreenAnimationController animateTransition:]): (-[WKFullscreenAnimationController animationEnded:]): (-[WKFullScreenWindowController initWithWebView:page:]): (-[WKFullScreenWindowController dealloc]): (-[WKFullScreenWindowController isFullScreen]): (-[WKFullScreenWindowController webViewPlaceholder]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController completedEnterFullScreen]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController requestExitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController completedExitFullScreen]): (-[WKFullScreenWindowController close]): (-[WKFullScreenWindowController _manager]): (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]): (-[WKFullScreenWindowController animationControllerForDismissedController:]): * WebKit.xcassets/Contents.json: Added. * WebKit.xcassets/Done.imageset/Contents.json: Added. * WebKit.xcassets/Done.imageset/Done.pdf: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::willEnterFullScreen): (WebKit::WebFullScreenManager::willExitFullScreen): 2017-11-01 Daniel Bates XMLHttpRequest should not sniff content encoding https://bugs.webkit.org/show_bug.cgi?id=175597 Reviewed by Alex Christensen. Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped decompressed. Specifically, such a response would be treated analogous to a response with headers "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior breaks the Epic Zen Garden demo: . On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can selectively opt out of content encoding sniffing for other network requests. This will be done in subsequent commits to make it straightforward to identify site breakage (if any). * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::start): Enable content encoding sniff to match existing behavior. (WebKit::Download::startWithHandle): Ditto. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): Pass through the content encoding sniffing policy. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): Ditto. * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): Encode content encoding sniffing policy. (WebKit::NetworkResourceLoadParameters::decode): Decode content encoding sniffing policy. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): Enable content encoding sniff to match existing behavior. We should look to disable content encoding sniffing in a subsequent change. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): Added helper function to apply sniffing policies and bind request to interface, if applicable. (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Modified to take the content encoding sniffing policy. Calls applySniffingPoliciesAndBindRequestToInferfaceIfNeeded() to apply this policy. Also use convenience function URL::isLocalFile() to determine if the URL is a file URL. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Pass through the content encoding sniffing policy. * NetworkProcess/soup/NetworkDataTaskSoup.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Pass through the content encoding sniffing policy. (WebKit::WebLoaderStrategy::loadResourceSynchronously): Enable content encoding sniff to match existing behavior. 2017-11-01 Brady Eidson Plumbing for handling SW scripts failing to evaluate https://bugs.webkit.org/show_bug.cgi?id=178926 Reviewed by Chris Dumez. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::updateServiceWorkerContext): (WebKit::WebSWServerConnection::setContextConnection): (WebKit::WebSWServerConnection::startServiceWorkerContext): Deleted. * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updateServiceWorker): (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage): (WebKit::WebSWContextManagerConnection::startServiceWorker): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-11-01 Frederic Wang Make iOS Find UI reveal matches in scrollable elements https://bugs.webkit.org/show_bug.cgi?id=178789 Reviewed by Tim Horton. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame is handled by the SmartMagnificationController. 2017-11-01 Michael Catanzaro REGRESSION(r224192): [WPE] Fix WebEventFactory::createWebWheelEvent https://bugs.webkit.org/show_bug.cgi?id=179098 Reviewed by Sam Weinig. * Shared/wpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebWheelEvent): 2017-10-31 Tim Horton Clean up some drag and drop feature flags https://bugs.webkit.org/show_bug.cgi?id=179082 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-10-31 Wenson Hsieh Followup to r224238: API::Attachment should generate a _WKAttachment ObjC wrapper https://bugs.webkit.org/show_bug.cgi?id=179080 Reviewed by Tim Horton. Fixes a failing API test. The new Attachment object type added in r224238 was not actually being handled in Object::newObject, so a plain WKObject Objective C wrapper was being created; fix this by allocating a new _WKAttachment object for Type::Attachment. * Shared/Cocoa/APIObject.mm: (API::Object::newObject): 2017-10-31 Tim Horton Fix up some content filtering feature flags https://bugs.webkit.org/show_bug.cgi?id=179079 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-10-31 Youenn Fablet rwt should allow service worker to load localhost HTTPS resources with any certificate https://bugs.webkit.org/show_bug.cgi?id=179018 Reviewed by Chris Dumez. Allowing ServiceWorkerProcessProxy to handle authentication challenge. Temporarily adding a boolean flag through WebProcessPool to lower the SSL certificate verifications for service workers. This allows reducing flakiness in our layout tests for rwt. Future work should be done to expose a correct API for the application level to handle authentication challenges properly. * UIProcess/API/C/WKContext.cpp: (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/ServiceWorkerProcessProxy.h: * UIProcess/WebProcessPool.h: 2017-10-31 Joseph Pecoraro Web Inspector: UIProcess ASSERT in ~RemoteWebInspectorProxy when InspectorProcess crashes https://bugs.webkit.org/show_bug.cgi?id=179044 Reviewed by Alex Christensen. * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::frontendDidClose): Add a protector to keep the proxy alive for the duration of this method. 2017-10-31 Youenn Fablet Crash in: com.apple.WebKit: WebKit::CacheStorage::Caches::initializeSize(WTF::Function&&)>&&) + 30 (CacheStorageEngineCaches.cpp:163) https://bugs.webkit.org/show_bug.cgi?id=179037 Reviewed by Chris Dumez. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initializeSize): the storage backend may be cleared when clearing caches by the UI Process. Returning early in that case. A web application will typically fail to open a cache in this case. On retry, the cache should be opened. 2017-10-31 Wenson Hsieh [Attachment Support] Implement WKWebView SPI for inserting attachment elements https://bugs.webkit.org/show_bug.cgi?id=179013 Reviewed by Tim Horton. Adds native SPI to insert attachment elements given a filename, an optional MIME type, and a data blob. See change-by-change comments below for more detail. Covered by a new API test. * PlatformMac.cmake: * Shared/API/APIObject.h: * Shared/API/Cocoa/WebKitPrivate.h: * UIProcess/API/APIAttachment.cpp: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h. (API::Attachment::create): (API::Attachment::Attachment): (API::Attachment::~Attachment): Introduce API::Attachment, which represents a platform-agnostic Attachment. * UIProcess/API/APIAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): Adds support for inserting a new attachment element. Calls out to WebPageProxy to insert the attachment from the given data blob, and creates a new API-object-backed _WKAttachment. (-[WKWebView _executeEditCommand:argument:completion:]): Support passing in a nil completion block. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h. * UIProcess/API/Cocoa/_WKAttachment.mm: Copied from Source/WebCore/html/HTMLAttachmentElement.h. Introduces _WKAttachment, an Objective C wrapper around the API::Attachment. (-[_WKAttachment _apiObject]): (-[_WKAttachment isEqual:]): (-[_WKAttachment uniqueIdentifier]): (-[_WKAttachment hash]): Add _WKAttachment, a WebKit SPI object that wraps an attachment element unique identifier. Also, allow _WKAttachment to be used as a hashable NSDictionary key. (-[_WKAttachment description]): * UIProcess/API/Cocoa/_WKAttachmentInternal.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h. (API::wrapper): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::insertAttachment): Implement IPC support for inserting an attachment. * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertAttachment): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-10-31 Alex Christensen Fix custom header field setting with reloads and asynchronous navigation action policy decisions https://bugs.webkit.org/show_bug.cgi?id=179064 Reviewed by Tim Horton. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::applyToDocumentLoader): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): 2017-10-31 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.1 release. * gtk/NEWS: Add release notes for 2.19.1. 2017-10-31 Carlos Garcia Campos Unreviewed. Fix GTK+ make distcheck. Include WebCore/TextEncodingRegistry.h to ensure the forwarding header is generated. * UIProcess/API/glib/WebKitSettings.cpp: 2017-10-31 Commit Queue Unreviewed, rolling out r223884. https://bugs.webkit.org/show_bug.cgi?id=179055 It broke GTK+ make distcheck (Requested by KaL on #webkit). Reverted changeset: "[GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework" https://bugs.webkit.org/show_bug.cgi?id=178579 https://trac.webkit.org/changeset/223884 2017-10-30 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames https://bugs.webkit.org/show_bug.cgi?id=175118 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp: (WebKit::wrap): 2017-10-27 Megan Gardner Correctly determine affinity when inserting text via Keyboard Suggestions https://bugs.webkit.org/show_bug.cgi?id=178969 Reviewed by Ryosuke Niwa. Use the logic of VisiblePosition to correctly determine cursor affinity. We were defaulting to upstream, but that in incorrect and resulted in hitting asserts that we should not. This should give us the correct affinity in all cases. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::syncApplyAutocorrection): 2017-10-30 Commit Queue Unreviewed, rolling out r224078. https://bugs.webkit.org/show_bug.cgi?id=179026 MotionMark regression (Requested by shallawa on #webkit). Reverted changeset: "When navigating back to a page, compositing layers may not use accelerated drawing" https://bugs.webkit.org/show_bug.cgi?id=178749 https://trac.webkit.org/changeset/224078 2017-10-30 Sam Weinig [Setting] Only expose experimental features that are compiled in https://bugs.webkit.org/show_bug.cgi?id=179023 Reviewed by Tim Horton. * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Update template to conditionally expose experimental features based on their 'condition' option in WebPreferences.yaml 2017-10-30 Michael Catanzaro [WPE] Fix build warnings https://bugs.webkit.org/show_bug.cgi?id=178899 Reviewed by Carlos Alberto Lopez Perez. * PlatformWPE.cmake: 2017-10-30 Sam Weinig [Settings] Replace macro driven experimental features code with generated code https://bugs.webkit.org/show_bug.cgi?id=178994 Reviewed by Simon Fraser. As a first step toward allowing experimental features to vary based on compile time flags, replace the macro driven implementation of the WebPreferences part of experimental features, with one generated from a template file. * CMakeLists.txt: * DerivedSources.make: * Scripts/GeneratePreferences.rb: * WebKit.xcodeproj/project.pbxproj: Generate the new template. * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Added. * UIProcess/WebPreferences.cpp: (WebKit::createExperimentalFeaturesVector): Deleted. (WebKit::WebPreferences::experimentalFeatures): Deleted. (WebKit::WebPreferences::isEnabledForFeature const): Deleted. (WebKit::WebPreferences::setEnabledForFeature): Deleted. (WebKit::WebPreferences::enableAllExperimentalFeatures): Deleted. Replace macro implementation with template generated one. 2017-10-30 Michael Catanzaro [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target https://bugs.webkit.org/show_bug.cgi?id=178964 Reviewed by Carlos Alberto Lopez Perez. * PlatformWPE.cmake: 2017-10-30 Michael Catanzaro [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState https://bugs.webkit.org/show_bug.cgi?id=168219 Reviewed by Ryosuke Niwa. Expose canCut, canCopy, canPaste, canUndo, and canRedo in EditorState::PostLayouData. Add corresponding new WPE/GTK API. Remove allowsCopy from WebKitTestResultData. It's unused, does not work correctly in all circumstances, and irritates Ryosuke. Also, remove a bunch of #ifs guarding post layout data, since it's now used on all ports. * Shared/EditorState.cpp: (WebKit::EditorState::encode const): (WebKit::EditorState::decode): (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: (WebKit::EditorState::postLayoutData const const): * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): (WebKit::WebHitTestResultData::encode const): (WebKit::WebHitTestResultData::decode): * Shared/WebHitTestResultData.h: * UIProcess/API/APIHitTestResult.h: (API::HitTestResult::allowsCopy const): Deleted. * UIProcess/API/glib/WebKitEditorState.cpp: (webkitEditorStateChanged): (webkit_editor_state_is_cut_available): (webkit_editor_state_is_copy_available): (webkit_editor_state_is_paste_available): (webkit_editor_state_is_undo_available): (webkit_editor_state_is_redo_available): * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_can_execute_editing_command): * UIProcess/API/gtk/WebKitEditorState.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitEditorState.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performImmediateActionHitTestAtLocation): 2017-10-27 Sam Weinig [Settings] Generate more of the WebKit preferences code https://bugs.webkit.org/show_bug.cgi?id=178945 Reviewed by Chris Dumez. Generate WebPreferencesKeys.{h,cpp} and WebPreferencesStoreDefaultsMap.cpp * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: * Scripts/GeneratePreferences.rb: Generate new files. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Update include. * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb: Added. * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb: Added. * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: Added. Add template files for new generated files. * Shared/WebPreferencesDefaultValues.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitionsBase.h. * Shared/WebPreferencesDefinitionsBase.h: Renamed WebPreferencesDefinitionsBase.h to WebPreferencesDefaultValues.h to better indicate what it is. * Shared/WebPreferencesKeys.cpp: Removed. * Shared/WebPreferencesKeys.h: Removed. Replaced with generated versions. * Shared/WebPreferencesStore.cpp: (WebKit::defaults): Deleted. * Shared/WebPreferencesStore.h: Replace macro driven defaults map with generated WebPreferencesStoreDefaultsMap.cpp. 2017-10-28 Chris Dumez self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker https://bugs.webkit.org/show_bug.cgi?id=178976 Reviewed by Sam Weinig. Actually enable the Service Worker RuntimeEnabledFeature in the Service Worker WebProcess. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferences): 2017-10-28 Joseph Pecoraro Make postprocess-framework-headers.sh a little easier to read https://bugs.webkit.org/show_bug.cgi?id=178971 Reviewed by Sam Weinig. * mac/postprocess-framework-headers.sh: 2017-10-27 Daniel Bates Attempt to fix the Apple El Capitan build following (https://bugs.webkit.org/show_bug.cgi?id=178919) Move definition of NetworkLoad::isAllowedToAskUserForCredentials() outside of USE(NETWORK_SESSION)-guarded section. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): 2017-10-27 Daniel Bates Only allow non-mixed content protected subresources to ask for credentials https://bugs.webkit.org/show_bug.cgi?id=178919 Reviewed by Alex Christensen. Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful to allow protected mixed-content subresources to ask for credentials. * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): Initialize m_isAllowedToAskUserForCredentials based on the specified resource load parameters or NetworkLoad object. * NetworkProcess/Downloads/PendingDownload.h: Add override for NetworkLoadClient::isAllowedToAskUserForCredentials(). * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): Added. (WebKit::NetworkLoad::completeAuthenticationChallenge): Ask NetworkLoadClient whether the load is allowed to prompt for credentials. (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Ditto. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize m_isAllowedToAskUserForCredentials based on the specified resource load parameters. (WebKit::NetworkResourceLoader::willSendRedirectedRequest): We do not support prompting for credentials for synchronous loads. (WebKit::NetworkResourceLoader::continueWillSendRequest): Modified to take an argument as to whether the load is allowed to ask the user for credentials and updates state. * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkResourceLoader.messages.in: Modified message ContinueWillSendRequest to take a boolean as to whether the load is allowed to ask the user for credentials. * NetworkProcess/PreconnectTask.h: Override NetworkLoadClient::isAllowedToAskUserForCredentials() such that we never ask for credentials. This matches our current behavior. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): Query ResourceLoader as to whether the load is allowed to ask the user for credentials and pass this state to NetworkResourceLoader. 2017-10-27 Adrian Perez de Castro [GTK][CMake] Incorrect conditional check when adding build dir to GIR runtime library path https://bugs.webkit.org/show_bug.cgi?id=178936 Reviewed by Michael Catanzaro. * PlatformGTK.cmake: Fix spelling of variable used in conditional. 2017-10-27 Chris Dumez Add initial support for serviceWorkerClient.postMessage() https://bugs.webkit.org/show_bug.cgi?id=178794 Reviewed by Youenn Fablet. Add initial support for serviceWorkerClient.postMessage(): - https://w3c.github.io/ServiceWorker/#client-postmessage It is now possible to do bi-directional communication with a service worker via postMessage(). * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::postMessageToServiceWorkerClient): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2017-10-27 David Kilzer REGRESSION (r224077): DeprecatedGlobalSettings::setAVKitEnabled() not protected by HAVE(AVKIT) Unreviewed build fix. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Fix build. 2017-10-26 Jeremy Jones Implement seek tolerance methods in WebAVPlayerController. https://bugs.webkit.org/show_bug.cgi?id=178838 rdar://problem/33781777 Reviewed by Eric Carlson. This implementes additional methods on WebAVPlayerController that allows AVKit more control over seeking. * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: (WebKit::PlaybackSessionModelContext::seekToTime): (WebKit::PlaybackSessionManagerProxy::seekToTime): * WebProcess/cocoa/PlaybackSessionManager.h: * WebProcess/cocoa/PlaybackSessionManager.messages.in: * WebProcess/cocoa/PlaybackSessionManager.mm: (WebKit::PlaybackSessionManager::seekToTime): 2017-10-26 Brian Burg Web Automation: denying user permission for getUserMedia doesn't work https://bugs.webkit.org/show_bug.cgi?id=178895 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): The ordering of special cases is incorrect. Safari configures its automation views to allow mock devices and never prompt for them. These checks were before the check for the automation session's getUserMedia permission. Switch these checks. Also change the deny reason so that subsequent requests are also denied. This matches behavior when a user denies a permission request on a real dialog. With this change, the DOM error changes from SecurityError to NotAllowedError, which makes more sense. 2017-10-26 Michael Catanzaro Unreviewed, fix GCC warning spam after r224077 https://bugs.webkit.org/show_bug.cgi?id=178823 Need to leave a blank line at the bottom of the file. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: 2017-10-25 Simon Fraser When navigating back to a page, compositing layers may not use accelerated drawing https://bugs.webkit.org/show_bug.cgi?id=178749 rdar://problem/35158946 Reviewed by Dean Jackson. Avoid assertions when a test enables accelerated drawing (which we can't support in the iOS simulator). * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::ensureBackingStore): 2017-10-26 Sam Weinig [Settings] Generate the bulk of WebPage::updatePreferences(...) https://bugs.webkit.org/show_bug.cgi?id=178823 Reviewed by Tim Horton. * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: Add new file generation. * Scripts/GeneratePreferences.rb: Replace 'webkitOnly' boolean option with a new 'webcoreBinding' option. 'webcoreBinding' supports the following values: - none (same as webkit only) - custom (means that you do bind to a webcore concept, but currently it must be done in a custom manner) - DeprecatedGlobalSettings (binds to a DeprecatedGlobalSettings setting) - RuntimeEnabledFeatures (binds to a RuntimeEnabledFeatures setting) If 'webcoreBinding' is not provided, the preference binds to WebCore Setting of either the same name or the override name provided by the new 'webcoreName' option (we should try to remove the need for 'webcoreName' by unifying with WebCore on preference/setting naming). A 'condition' option was also added to indicate that the preference is only available when that macro condition is true. Since we are generating most of WebPage::updatePreferences, we can simplify the macros in WebPreferencesDefinitions.h to only have normal/debug/experimental variants and remove the need for per-type macros, which were only used in WebPage::updatePreferences. * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb: Added. Generates bindings from WebPreferences to WebCore::Settings/DeprecatedGlobalSettings/RuntimeEnabledFeatures. Does not generate a binding if the 'webcoreBinding' option is set to either 'none' or 'custom'. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Simplify down to just normal/debug/experimental macros. * Shared/WebPreferences.yaml: Annotate perferences with new optional 'webcoreBinding', 'webcoreName', and 'condition' options. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Replace a ton of hand written preference to settings bindings with a call to updatePreferencesGenerated(). * WebProcess/WebPage/WebPage.h: Add declaration of updatePreferencesGenerated, remove platformPreferencesDidChange. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformPreferencesDidChange): Deleted. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformPreferencesDidChange): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformPreferencesDidChange): Deleted. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::platformPreferencesDidChange): Deleted. * WebProcess/WebPage/wpe/WebPageWPE.cpp: (WebKit::WebPage::platformPreferencesDidChange): Deleted. Remove all the empty platformPreferencesDidChange functions. 2017-10-26 Alex Christensen Move WKWebViewConfiguration validation to WKWebView construction https://bugs.webkit.org/show_bug.cgi?id=178840 Reviewed by Tim Horton. I'm trying to remove WKWebViewConfigurationInternal methods so I can make WKWebViewConfiguration a wrapper around an APIObject like all the other API objects. A small step towards making this easier is to remove the unnecessary method _validate and move its logic to its one callsite. I added an API test that ensures no change in behavior. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _validate]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h: 2017-10-26 Megan Gardner Remove unneeded block selection calculation code https://bugs.webkit.org/show_bug.cgi?id=178889 Reviewed by Tim Horton. Removing more block selection code. Much of this should have been removed before, as the only things that were using these functions were removed in the last patch. Also remove the code decided if you should move to block mode or not, as the answer now is always NO. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateSelectionWithTouches): (WebKit::WebPage::rangeForBlockAtPoint): Deleted. (WebKit::distanceBetweenRectsForPosition): Deleted. (WebKit::rectsEssentiallyTheSame): Deleted. (WebKit::unionDOMRanges): Deleted. (WebKit::computeEdgeCenter): Deleted. (WebKit::WebPage::expandedRangeFromHandle): Deleted. (WebKit::WebPage::contractedRangeFromHandle): Deleted. (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted. (WebKit::WebPage::switchToBlockSelectionAtPoint): Deleted. (WebKit::WebPage::shouldSwitchToBlockModeForHandle): Deleted. 2017-10-26 Jeremy Jones Call setFullscreenClient on iOS. https://bugs.webkit.org/show_bug.cgi?id=178089 Reviewed by Simon Fraser. This was only being set for MacOS. * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): 2017-10-26 Eric Carlson NowPlayingInfo should contain a unique identifier https://bugs.webkit.org/show_bug.cgi?id=178872 Reviewed by Jer Noble. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Take a completion handler. (-[WKWebView _requestActiveNowPlayingSessionInfo]): Deleted. (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo): Ditto. (WebKit::WebPageProxy::nowPlayingInfoCallback): Lookup and call completion handler. (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse const): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Take callback ID. Pass unique ID. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-10-26 Andy Estes [Payment Request] Enable Payment Request whenever Apple Pay is enabled https://bugs.webkit.org/show_bug.cgi?id=178880 Reviewed by Tim Horton. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPaymentRequestEnabled): Deleted. (WKPreferencesGetPaymentRequestEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-10-26 Chris Dumez Bring back SWContextManager abstraction in WebCore https://bugs.webkit.org/show_bug.cgi?id=178876 Reviewed by Geoffrey Garen. Bring back SWContextManager abstraction in WebCore. It was killed in but is actually useful when the ServiceWorker wants to message the storage process. * CMakeLists.txt: * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startServiceWorkerContext): (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp. (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection): (WebKit::WebSWContextManagerConnection::updatePreferences): (WebKit::WebSWContextManagerConnection::startServiceWorker): (WebKit::WebSWContextManagerConnection::startFetch): (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWContextManagerConnection.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h. * WebProcess/Storage/WebSWContextManagerConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveMessage): (WebKit::WebProcess::getWorkerContextConnection): * WebProcess/WebProcess.h: 2017-10-26 Alexey Proskuryakov Remove deprecated WebKit symbols https://bugs.webkit.org/show_bug.cgi?id=178875 rdar://problem/31139070 Reviewed by Dan Bernstein. * PlatformMac.cmake: * Shared/API/c/WKDeprecatedFunctions.cpp: (WKContextSetProcessModel): (WKPageGroupCopyIdentifier): Deleted. (WKPageGroupAddUserContentFilter): Deleted. (WKPageGroupRemoveUserContentFilter): Deleted. * UIProcess/API/C/WKPageGroup.h: * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm: Removed. * UIProcess/API/Cocoa/_WKVisitedLinkStore.h: * WebKit.xcodeproj/project.pbxproj: 2017-10-26 Ryan Haddad Unreviewed, rolling out r223984. Caused LayoutTest assertion failures. Reverted changeset: "When navigating back to a page, compositing layers may not use accelerated drawing" https://bugs.webkit.org/show_bug.cgi?id=178749 https://trac.webkit.org/changeset/223984 2017-10-26 Megan Gardner Remove code to update block selection https://bugs.webkit.org/show_bug.cgi?id=178843 Reviewed by Tim Horton. Removes code for updating block selection, which has been disabled. This code is being slowly pruned to avoid regressions and accidental removal of code that is being used. * Platform/spi/ios/UIKitSPI.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (toSelectionHandlePosition): Deleted. (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted. (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted. (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::shouldExpand): Deleted. (WebKit::WebPage::changeBlockSelection): Deleted. (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted. 2017-10-26 Ryan Haddad Unreviewed, rolling out r223994. The LayoutTest for this change is failing. Reverted changeset: "Add service worker handle fetch support for all subresource requests" https://bugs.webkit.org/show_bug.cgi?id=178769 https://trac.webkit.org/changeset/223994 2017-10-26 Ryan Haddad Unreviewed, rolling out r223908. Causes LayoutTest crashes with newer SDKs. Reverted changeset: "Adopt new secure coding APIs" https://bugs.webkit.org/show_bug.cgi?id=178484 https://trac.webkit.org/changeset/223908 2017-10-26 Christopher Reid Remove scopeguard from platform https://bugs.webkit.org/show_bug.cgi?id=178681 Reviewed by Brady Eidson. * Shared/mac/ChildProcessMac.mm: 2017-10-25 Per Arne Vollan Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge. https://bugs.webkit.org/show_bug.cgi?id=160234 rdar://problem/30675510 Reviewed by Geoffrey Garen. An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork challenge sender, which does not implement this optional method. The methods on the authentication challenge sender are deprecated when network session is used, so we should not call them in that case. * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::useCredentialForSingleChallenge): (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): (WebKit::AuthenticationManager::cancelSingleChallenge): (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: (WebKit::AuthenticationManager::receivedCredential): (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential): (WebKit::AuthenticationManager::receivedCancellation): (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling): (WebKit::AuthenticationManager::receivedChallengeRejection): * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: 2017-10-25 Youenn Fablet Move DNS resolution outside of NetworkRTCProvider https://bugs.webkit.org/show_bug.cgi?id=178796 Reviewed by Geoffrey Garen. Tested through manual testing on external STUN servers. Moving NetworkRTCProvider::Resolver into NetworkRTCResolver. Updating the implementation to use a completion handler. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createResolver): * NetworkProcess/webrtc/NetworkRTCProvider.h: * NetworkProcess/webrtc/NetworkRTCResolver.cpp: (WebKit::NetworkRTCResolver::NetworkRTCResolver): (WebKit::NetworkRTCResolver::~NetworkRTCResolver): (WebKit::NetworkRTCResolver::start): (WebKit::NetworkRTCResolver::stop): (WebKit::NetworkRTCResolver::completed): (WebKit::NetworkRTCProvider::Resolver::~Resolver): Deleted. (WebKit::NetworkRTCProvider::stop): Deleted. (WebKit::NetworkRTCProvider::resolutionCompleted): Deleted. * NetworkProcess/webrtc/NetworkRTCResolver.h: * WebKit.xcodeproj/project.pbxproj: 2017-10-25 Eric Carlson [MediaStream] Clear cached gUM prompt state https://bugs.webkit.org/show_bug.cgi?id=178754 Reviewed by Youenn Fablet. * Shared/WebPreferences.yaml: Define new settings. * Shared/WebPreferencesDefinitionsBase.h: New default values. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes): New. (WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes): Ditto. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _inactiveMediaCaptureSteamRepromptIntervalInMinutes]): Ditto. (-[WKPreferences _setInactiveMediaCaptureSteamRepromptIntervalInMinutes:]): Ditto. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the timer. (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Remove unneeded namespace. (WebKit::toWebCore): Remove unneeded breaks. (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Remove unneeded namespace. (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Set the watchdog timer to the correct interval based on capture state. (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear cached state. * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2017-10-25 Simon Fraser When navigating back to a page, compositing layers may not use accelerated drawing https://bugs.webkit.org/show_bug.cgi?id=178749 rdar://problem/35158946 Reviewed by Dean Jackson. Avoid assertions when a test enables accelerated drawing (which we can't support in the iOS simulator). * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::ensureBackingStore): 2017-10-25 Youenn Fablet Enable ServiceWorker to fetch resources https://bugs.webkit.org/show_bug.cgi?id=178673 Reviewed by Brady Eidson. ServiceWorkerContextManager makes use of the new ServiceWorkerThreadProxy. It creates the necessary environment for the thread to make use of network loads, web sockets and cache storage. Fetch is functional with these changes. ServiceWorkerProcessProxy is introduced as a UIProcess proxy to the service worker process. This process proxy is responsible to give the pageID used by all service worker thread instances for network loads. ServiceWorkerContextManager is responsible to give a unique frameID for all service worker threads. This is necessary as these two ids are currently needed for any network load. ServiceWorkerThreadProxy creates its own FrameLoaderClient which is now used to get pageID, frameID and sessionID. * UIProcess/ServiceWorkerProcessProxy.cpp: Added. (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy): (WebKit::m_serviceWorkerPageID): (WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy): (WebKit::ServiceWorkerProcessProxy::start): * UIProcess/ServiceWorkerProcessProxy.h: Added. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getWorkerContextProcessConnection): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::generatePageID): * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::startPingLoad): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): (WebKit::ServiceWorkerContextManager::startServiceWorker): (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::pageID const): (WebKit::WebFrameLoaderClient::frameID const): (WebKit::WebFrameLoaderClient::sessionID const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-25 Yousuke Kimoto [WinCairo] Add WebKit platform files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=178000 Reviewed by Alex Christensen. * Platform/Module.h: * Platform/SharedMemory.h: (WebKit::SharedMemory::handle const): * Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp (WebKit::logLevelString): * Platform/win/ModuleWin.cpp: Added. (WebKit::Module::load): (WebKit::Module::unload): (WebKit::Module::platformFunctionPointer const): * Platform/win/SharedMemoryWin.cpp: Added. (WebKit::SharedMemory::Handle::Handle): (WebKit::SharedMemory::Handle::~Handle): (WebKit::SharedMemory::Handle::isNull const): (WebKit::SharedMemory::Handle::encode const): (WebKit::SharedMemory::Handle::clear): (WebKit::getDuplicatedHandle): (WebKit::SharedMemory::Handle::decode): (WebKit::protectAttribute): (WebKit::SharedMemory::allocate): (WebKit::SharedMemory::create): (WebKit::accessRights): (WebKit::SharedMemory::map): (WebKit::SharedMemory::adopt): (WebKit::SharedMemory::~SharedMemory): (WebKit::SharedMemory::createHandle): (WebKit::SharedMemory::systemPageSize): * PlatformWin.cmake: 2017-10-25 Chris Dumez Add support for unregistering a service worker https://bugs.webkit.org/show_bug.cgi?id=178735 Reviewed by Brady Eidson. Add support for unregistering a service worker: - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-10-25 Chris Dumez Make SharedStringHashTable less error prone https://bugs.webkit.org/show_bug.cgi?id=178764 Reviewed by Youenn Fablet. SharedStringHashTable is backed by SharedMemory and this SharedMemory may be readonly (and is when used in the WebContent process). As a result, some of the operations on SharedStringHashTable that write to this shared memory will crash if called and the SharedMemory is readonly. To make this less error prone, introduce a new SharedStringHashTableReadOnly base class for SharedStringHashTable and only keep the operations that write to the shared memory on SharedStringHashTableReadOnly (namely, add() / remove() / clear(). Update VisitedLinkTableController and WebSWOriginTable to use SharedStringHashTableReadOnly since they are instantiated in the WebContent process and use readonly shared memory. * Shared/SharedStringHashTable.cpp: (WebKit::SharedStringHashTableReadOnly::SharedStringHashTableReadOnly): (WebKit::SharedStringHashTableReadOnly::~SharedStringHashTableReadOnly): (WebKit::SharedStringHashTableReadOnly::setSharedMemory): (WebKit::doubleHash): (WebKit::SharedStringHashTableReadOnly::contains const): (WebKit::SharedStringHashTableReadOnly::findSlot const): (WebKit::SharedStringHashTable::SharedStringHashTable): (WebKit::SharedStringHashTable::~SharedStringHashTable): (WebKit::SharedStringHashTable::add): (WebKit::SharedStringHashTable::remove): (WebKit::SharedStringHashTable::clear): * Shared/SharedStringHashTable.h: * WebProcess/Storage/WebSWOriginTable.h: * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::removeAllVisitedLinks): * WebProcess/WebPage/VisitedLinkTableController.h: 2017-10-25 Adrian Perez de Castro [WPE] Remove GLib API functions which use Cairo https://bugs.webkit.org/show_bug.cgi?id=178205 Reviewed by Michael Catanzaro. Add PLATFORM(GTK) guards for the parts of of the GLib API which use cairo_surface_t (web page snapshots and favicons), and remove the affected function prototypes from public API headers. This way, the WPE version of the API is not tied to Cairo. * PlatformWPE.cmake: * UIProcess/API/glib/WebKitFaviconDatabase.cpp: * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewGetProperty): (webkitWebViewDispose): (webkit_web_view_class_init): (webkitWebViewLoadChanged): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/wpe/WebKitFaviconDatabase.h: * UIProcess/API/wpe/WebKitWebView.h: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkitWebPageDidReceiveMessage): 2017-10-25 Zan Dobersek Make SERVICE_WORKER feature buildable on GTK, WPE https://bugs.webkit.org/show_bug.cgi?id=178574 Reviewed by Carlos Garcia Campos. * CMakeLists.txt: Add missing files to the build. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didGetWorkerContextProcessConnection): IPC::Attachment object should be accessed through an rvalue reference, making it mutable and enabling releasing the file descriptor. * StorageProcess/StorageProcess.h: Adjust the method signature. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Explicitly include the ResourceError header from WebCore (using a forwarding header). * WebProcess/Storage/WebServiceWorkerProvider.cpp: Include the CachedResource header from WebCore (again using a forwarding header). * WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type. 2017-10-24 Youenn Fablet ServiceWorkerClientFetch should return an error that is not null in case of failure https://bugs.webkit.org/show_bug.cgi?id=178761 Reviewed by Geoffrey Garen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didFail): Generating a General error. 2017-10-24 Youenn Fablet Enable service worker to use cache storage api https://bugs.webkit.org/show_bug.cgi?id=178684 Reviewed by Brady Eidson. Passing the WebPreferences store of the default page group of the WebProcessPool to its ServiceWorker process. ServiceWorkerContextManager then uses it to initialize the preferences accordingly. Patch is covered by new test which is using cache api previously disabled and now enabled through the store. Made use of the new ServiceWorkerThreadProxy in ServiceWorkerContextManager to enable a cache storage connection. Fixed the default size of quota in WebsiteDataStore. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getWorkerContextProcessConnection): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): (WebKit::ServiceWorkerContextManager::updatePreferences): (WebKit::ServiceWorkerContextManager::startServiceWorker): (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): Deleted. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-24 Alex Christensen Selecting and right-clicking URL-like strings with IDNA-disallowed characters in host or authority causes rendering engine crash https://bugs.webkit.org/show_bug.cgi?id=174267 Reviewed by Tim Horton. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageCanHandleRequest): 2017-10-24 Chris Dumez Add initial implementation for serviceWorker.postMessage() https://bugs.webkit.org/show_bug.cgi?id=178534 Reviewed by Youenn Fablet. Add initial implementation for serviceWorker.postMessage(): - https://w3c.github.io/ServiceWorker/#service-worker-postmessage * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/ServiceWorkerContextManager.h: * WebProcess/Storage/ServiceWorkerContextManager.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope): * WebProcess/Storage/WebSWClientConnection.h: 2017-10-24 Brent Fulgham Adopt new secure coding APIs https://bugs.webkit.org/show_bug.cgi?id=178484 Reviewed by Tim Horton. Switch to new NSKeyed[Un]Archiver methods that active and use NSSecureCoding by default. * Platform/ios/AccessibilityIOS.mm: (WebKit::newAccessibilityRemoteToken): Use secure-by-default API. * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): Ditto. (WebKit::DataDetectionResult::decode): Ditto. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): Ditto. (WebKit::InteractionInformationAtPosition::decode): Ditto. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): Ditto. (WebKit::WebHitTestResultData::platformDecode): Ditto. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setObject:forBundleParameter:]): Ditto. (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): Ditto. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): Ditto. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): Ditto. (WebKit::InjectedBundle::setBundleParameter): Ditto. (WebKit::InjectedBundle::setBundleParameters): Ditto. 2017-10-24 Sam Weinig [Settings] Add initial support for generating preferences related code https://bugs.webkit.org/show_bug.cgi?id=178656 Reviewed by Dean Jackson. As a first step towards getting off the macros in WebPreferencesDefinitions.h and reducing the overhead of adding a preference, this change generates adds WebPreferences.yaml where preference changes will go, and generates much of WebPreferencesDefinitions.h from it (all the custom defaults moved to WebPreferencesDefinitionsBase.h). Subsequent changes will remove the need for the macros in WebPreferencesDefinitions.h entirely. * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: Add new files / rules to generate WebPreferencesDefinitions.h. * Scripts/GeneratePreferences.rb: Added. * Scripts/PreferencesTemplates: Added. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Added. Add scripts and template to generate WebPreferencesDefinitions.h from WebPreferences.yaml. * Shared/WebPreferences.yaml: Added. Configuration file for preferences. * Shared/WebPreferencesDefinitions.h: Removed. * Shared/WebPreferencesDefinitionsBase.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitions.h. Moved custom defaults to new WebPreferencesDefinitionsBase.h. Removed the need for FOR_EACH_WEBKIT_STRING_PREFERENCE by using custom defaults for the font family values. 2017-10-24 Matt Lewis Unreviewed, rolling out r223889. This caused multiple crashes on all platforms Reverted changeset: "Adopt new secure coding APIs" https://bugs.webkit.org/show_bug.cgi?id=178484 https://trac.webkit.org/changeset/223889 2017-10-24 Youenn Fablet ASSERTION FAILED: !m_serviceWorkerManager in WebProcess::getWorkerContextConnection() on API tests https://bugs.webkit.org/show_bug.cgi?id=178586 Reviewed by Brady Eidson. Covered by API tests no longer crashing. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getWorkerContextProcessConnection): Sending a worker context process connection message only at creation of the service worker process. 2017-10-24 Brent Fulgham Adopt new secure coding APIs https://bugs.webkit.org/show_bug.cgi?id=178484 Reviewed by Tim Horton. Switch to new NSKeyed[Un]Archiver methods that active and use NSSecureCoding by default. * Platform/ios/AccessibilityIOS.mm: (WebKit::newAccessibilityRemoteToken): Use secure-by-default API. * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): Ditto. (WebKit::DataDetectionResult::decode): Ditto. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): Ditto. (WebKit::InteractionInformationAtPosition::decode): Ditto. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): Ditto. (WebKit::WebHitTestResultData::platformDecode): Ditto. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setObject:forBundleParameter:]): Ditto. (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): Ditto. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): Ditto. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): Ditto. (WebKit::InjectedBundle::setBundleParameter): Ditto. (WebKit::InjectedBundle::setBundleParameters): Ditto. 2017-10-24 Zan Dobersek [GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework https://bugs.webkit.org/show_bug.cgi?id=178579 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: When generating forwarding headers, derived sources should be scanned as well. The DERIVED_SOURCES_WEBKIT_DIR value has to be passed as an include path to the generate-forward-headers.pl script to achieve that. This target then also has to depend on all the derived source files to be generated before this can be performed. * PlatformWPE.cmake: Ditto. 2017-10-23 Brian Burg [Cocoa] Web Automation: add SPI to tell whether the automation session is currently simulating user interactions https://bugs.webkit.org/show_bug.cgi?id=178616 Reviewed by Joseph Pecoraro. This is needed to disambiguate whether an action (such as selectAll:) came from a user clicking on "Edit > Select All" in a menu or whether it was produced by simulating the keystrokes to produce the chord for "Command + a". Some clients, such as Safari, would allow the latter but not the former during automation. * UIProcess/API/Cocoa/_WKAutomationSession.h: * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession isSimulatingUserInteraction]): Add new SPI property that's backed by the same WebAutomationSession method. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::keyboardEventsFlushedForPage): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): Set m_simulatingUserInteraction prior to sending the synthesized events. It will be cleared when keyboardEventsFlushedForPage() is called by WebPageProxy. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): Notify the automation session that the key event queue was flushed *after* giving delegates a chance to do something with the key event. This is necessary so that any actions that are created from the NSEvent by the delegates are handled prior to the automation session finishing its keyboard interaction command. 2017-10-23 Brian Burg [Mac] Web Automation: key modifiers for synthesized NSEvents are incorrect https://bugs.webkit.org/show_bug.cgi?id=178615 Reviewed by Joseph Pecoraro. In both PLATFORM(MAC) platform methods for simulating keyboard interactions, we errantly relied on +[NSEvent modifierFlags] to get the current state of sticky modifiers when creating synthesized events. This is incorrect for two reasons: modifierFlags is never updated when simulating a sequence of events (because all the events are synthesized before any are delivered); and the NSEvent class method only reflects the modifier state of the primary physical keyboard, which is not affected by synthesized NSEvents that happen to have modifier flags. Instead, just keep our own m_currentModifiers state in the session and compute the necessary NSEventModifierFlags to put on each synthesized event. This aligns the implementation with the treatment of sticky keys in the iOS and GTK platform methods. * UIProcess/Automation/WebAutomationSession.h: Every port gets this variable now. * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::platformSimulateKeyStroke): (WebKit::WebAutomationSession::platformSimulateKeySequence): Use and update m_currentModifiers. 2017-10-23 Alex Christensen Fix ASAN test after r222824 https://bugs.webkit.org/show_bug.cgi?id=178688 Reviewed by Tim Horton. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::clear): Resizing a list of Ref after we've WTFMoved all the elements doesn't make ASAN happy. 2017-10-23 Tim Horton Stop using _UIApplicationUsesLegacyUI() https://bugs.webkit.org/show_bug.cgi?id=178680 Reviewed by Dan Bernstein. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]): (-[WKSelectPopover initWithView:hasGroups:]): Resolve _UIApplicationUsesLegacyUI to false and simplify. 2017-10-23 Ryan Haddad Unreviewed, suppress deprecation warnings to fix the build. * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]): (-[WKSelectPopover initWithView:hasGroups:]): 2017-10-23 Youenn Fablet TestController should clear all fetch caches when resetting its state https://bugs.webkit.org/show_bug.cgi?id=178486 Reviewed by Chris Dumez. Adding a new DidNotHandle message to disambiguate with the DidFail fetch case. With DidNotHandle, the loading should go the network process. With DidFail, the loading should return a network error. On receiving an order to start a fetch, ServiceWorkerThread will dispatch a fetch event. The client of this event will retrieve the response and return it to the WebProcess through IPC. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::didNotHandleFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didNotHandleFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didFail): (WebKit::ServiceWorkerClientFetch::didNotHandle): * WebProcess/Storage/ServiceWorkerClientFetch.h: * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Added. (WebKit::WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient): (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData): (WebKit::WebServiceWorkerFetchTaskClient::didFail): (WebKit::WebServiceWorkerFetchTaskClient::didFinish): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startFetchInServiceWorker): * WebProcess/WebProcess.h: 2017-10-22 Wenson Hsieh [iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices https://bugs.webkit.org/show_bug.cgi?id=178640 Reviewed by Youenn Fablet. In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work lazily, the first time the web process requests permissions for user media access. * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: (WebKit::WebUserMediaClient::requestUserMediaAccess): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2017-10-21 Michael Catanzaro Unreviewed, silence a -Wunused-but-set-variable warning * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): 2017-10-20 Alex Christensen Add FIXME comment after r223803 https://bugs.webkit.org/show_bug.cgi?id=178418 * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): We need some work to better support customized persistent data stores. Add a comment indicating such. 2017-10-20 Alex Christensen Fix API tests after r223791. https://bugs.webkit.org/show_bug.cgi?id=178418 * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Whatever NetworkSessionInitializationParameters we send with the NetworkProcess initialization message, that's the default session. This is needed for WebKit.WebsiteDataStoreCustomPaths. (WebKit::WebProcessPool::createNewWebProcess): Don't change behavior or NetworkProcess initialization like I did in r223791. 2017-10-20 Alex Christensen Fix download tests on El Capitan after r223730 https://bugs.webkit.org/show_bug.cgi?id=178547 * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Revert to original behavior. This uses suggestedFilename, which may have come from places like the download attribute, instead of always using the filename from CFNetwork. 2017-10-20 Alex Christensen Expose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate https://bugs.webkit.org/show_bug.cgi?id=178418 Reviewed by Tim Horton. In r213747 I introduced allowsCellularAccess to _WKProcessPoolConfiguration because there was no way to add parameters to the default (and other) NetworkSession constructors. Since clients have not adopted this SPI, we can introduce such a way in NetworkSessionCreationParameters and move the SPI to WKWebsiteDataStore, which is where it and other NetworkSession properties ought to be instead of making them WKProcessPool global. We also need to expose access to NSURLRequest.boundInterfaceIdentifier. Instead of serializing and deserializing that property for each NSURLRequest and then having subresources mysteriously jump back to having no bound interface identifiers, I'm adding this to WKWebsiteDataStore, too, to make it a session networking property. I manually verified that these properties are being set properly with a custom test app and added logs. Unfortunately, these properties don't do anything under circumstances anywhere close to what we test. The architecture change of having NetworkSessionCreationParameters is verified to not have a change in behavior by existing tests, such as any test that uses TestProtocol (which we should eventually remove). * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::clearCachedCredentials): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::create): (WebKit::NetworkSession::defaultSession): Deleted. * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.h: Added. (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): (WebKit::NetworkSessionCocoa::create): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Deleted. (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Deleted. (WebKit::NetworkSessionCocoa::defaultSession): Deleted. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/SessionTracker.cpp: (WebKit::SessionTracker::networkSession): (WebKit::SessionTracker::setSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]): (-[WKWebsiteDataStore _boundInterfaceIdentifier]): (-[WKWebsiteDataStore _setAllowsCellularAccess:]): (-[WKWebsiteDataStore _allowsCellularAccess]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration allowsCellularAccess]): (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier): (WebKit::WebsiteDataStore::boundInterfaceIdentifier): (WebKit::WebsiteDataStore::setAllowsCellularAccess): (WebKit::WebsiteDataStore::allowsCellularAccess): * WebKit.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensurePrivateBrowsingSession): (WebKit::WebProcess::clearCachedCredentials): 2017-10-20 Alex Christensen Add ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient https://bugs.webkit.org/show_bug.cgi?id=178566 Reviewed by Brady Eidson. * UIProcess/API/Cocoa/_WKDownloadDelegate.h: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::didReceiveAuthenticationChallenge): (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): (WebKit::DownloadClient::didCreateDestination): (WebKit::DownloadClient::processDidCrash): 2017-10-20 Youenn Fablet ResourceResponse should have a ServiceWorker source https://bugs.webkit.org/show_bug.cgi?id=178593 Reviewed by Alex Christensen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): setting response source to ServiceWorker. * WebProcess/Storage/ServiceWorkerClientFetch.h: 2017-10-20 Antoine Quint [Web Animations] Provide basic timeline and animation interfaces https://bugs.webkit.org/show_bug.cgi?id=178526 Reviewed by Dean Jackson. Remove the WEB_ANIMATIONS compile-time flag. * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): (WebKit::InjectedBundle::setWebAnimationsEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-10-02 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Move setup and delegates of the inspector frontend page into implementations of WebInspectorProxy::platformCreateFrontendPage. The Mac implementation will be subsumed by WKInspectorViewController, while the GTK implementation is inherited from the cross-platform version that uses C API. Eventually the GTK version should use GTK API rather than the soon to be deprecated C API. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createFrontendPage): (WebKit::webProcessDidCrash): Deleted. (WebKit::decidePolicyForNavigationAction): Deleted. (WebKit::getContextMenuFromProposedMenu): Deleted. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::exceededDatabaseQuota): (WebKit::webProcessDidCrash): (WebKit::decidePolicyForNavigationAction): (WebKit::getContextMenuFromProposedMenu): (WebKit::WebInspectorProxy::platformCreateFrontendPage): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::exceededDatabaseQuota): (WebKit::webProcessDidCrash): (WebKit::decidePolicyForNavigationAction): (WebKit::getContextMenuFromProposedMenu): (WebKit::WebInspectorProxy::platformCreateFrontendPage): 2017-10-02 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Adopt WKInspectorViewController in WebInspectorProxyMac to set up the frontend's web view. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::invalidate): (WebKit::WebInspectorProxy::close): (WebKit::WebInspectorProxy::didClose): (WebKit::WebInspectorProxy::closeFrontendPageAndWindow): Make closeFrontendPageAndWindow into the method that does work. Only use didClose() as the IPC message entry point. * UIProcess/WebInspectorProxy.h: (WebKit::WebInspectorProxy::isUnderTest const): Make public. * UIProcess/mac/WKInspectorViewController.h: * UIProcess/mac/WKInspectorViewController.mm: (+[WKInspectorViewController viewIsInspectorWebView:]): Abstract away the -isInstanceOfClass: check for WKInspectorWKWebView. Clients shouldn't need to know whether we use a subclass or what its name is. * UIProcess/mac/WebInspectorProxyMac.mm: (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]): (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]): Hook up view controller delegates. (WebKit::WebInspectorProxy::platformCreateFrontendPage): (WebKit::WebInspectorProxy::platformCreateFrontendWindow): (WebKit::WebInspectorProxy::closeFrontendPage): New implementation based on the view controller. (WebKit::WebInspectorProxy::platformBringToFront): (WebKit::WebInspectorProxy::platformIsFront): (WebKit::WebInspectorProxy::platformCanAttach): (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): (WebKit::WebInspectorProxy::platformAttach): (WebKit::WebInspectorProxy::platformDetach): (WebKit::WebInspectorProxy::platformStartWindowDrag): Adjust to get the WKWebView out of the view controller for code that needs to do something with the NSView, such as get/set the frame. (WebKit::WebInspectorProxy::createFrontendConfiguration): Deleted. (WebKit::exceededDatabaseQuota): Deleted. (WebKit::webProcessDidCrash): Deleted. (WebKit::decidePolicyForNavigationAction): Deleted. (WebKit::getContextMenuFromProposedMenu): Deleted. 2017-10-02 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Introduce new platform methods to open and close the frontend page and window. This matches how RemoteWebInspectorProxy divides work up into platform methods. Move existing code from platformDidClose, platformOpen, and other methods into the new platform methods. Move some identical platform code into WebInspectorProxy.cpp. * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::connect): (WebKit::WebInspectorProxy::showConsole): (WebKit::WebInspectorProxy::showResources): (WebKit::WebInspectorProxy::showTimelines): (WebKit::WebInspectorProxy::showMainResourceForFrame): (WebKit::WebInspectorProxy::createFrontendPage): (WebKit::WebInspectorProxy::createInspectorPage): (WebKit::WebInspectorProxy::open): (WebKit::WebInspectorProxy::didClose): (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Renamed. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::updateInspectorWindowTitle const): (WebKit::WebInspectorProxy::platformCreateFrontendPage): Do everything necessary to set up the frontend page WebView. (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Do everything necessary to set up the detached NSWindow for the frontend. (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::WebInspectorProxy::platformDetach): (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted. (WebKit::WebInspectorProxy::createInspectorWindow): Deleted. (WebKit::WebInspectorProxy::platformOpen): Deleted. (WebKit::WebInspectorProxy::platformDidClose): Deleted. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::updateInspectorWindowTitle const): (WebKit::WebInspectorProxy::platformCreateFrontendPage): Added. Do everything necessary to set up the frontend page WebView. (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added. Do everything necessary to set up the detached NSWindow for the frontend. (WebKit::WebInspectorProxy::closeFrontendPage): (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired): (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::WebInspectorProxy::platformDidCloseForCrash): (WebKit::WebInspectorProxy::platformInvalidate): (WebKit::WebInspectorProxy::platformBringToFront): Carry through renamings. (WebKit::WebInspectorProxy::platformDetach): Defer to the general open() method to create a window if needed and bring it to front. (WebKit::WebInspectorProxy::platformCanAttach): Move this below open/close code. (WebKit::WebInspectorProxy::closeFrontend): Deleted. (WebKit::WebInspectorProxy::createInspectorWindow): Deleted. (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted. (WebKit::WebInspectorProxy::platformOpen): Deleted. (WebKit::WebInspectorProxy::platformDidClose): Deleted. Defer to the general open() method to create a window if needed and bring it to front. * UIProcess/wpe/WebInspectorProxyWPE.cpp: (WebKit::WebInspectorProxy::platformCreateFrontendPage): (WebKit::WebInspectorProxy::platformCreateFrontendWindow): (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted. (WebKit::WebInspectorProxy::createInspectorWindow): Deleted. (WebKit::WebInspectorProxy::platformOpen): Deleted. (WebKit::WebInspectorProxy::platformDidClose): Deleted. Update stubs. 2017-10-02 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. This patch refactors some Cocoa code pathas. Rename the timer that closes the WebView so it's more obvious what it is for. Extract the common code to close the frontend window so its not implemented by the timer callback. In later patches, this will be extracted further into platform methods to open/close the frontend and window, like how it is for RemoteWebInspectorProxy. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::WebInspectorProxy): * UIProcess/WebInspectorProxy.h: * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired): (WebKit::WebInspectorProxy::closeFrontend): (WebKit::WebInspectorProxy::platformCreateInspectorPage): (WebKit::WebInspectorProxy::platformDidClose): (WebKit::WebInspectorProxy::platformDidCloseForCrash): (WebKit::WebInspectorProxy::platformInvalidate): (WebKit::WebInspectorProxy::closeTimerFired): Deleted. 2017-09-30 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Modernize the ObjC adapter and related code a bit before it is hooked into WKInspectorViewController. * UIProcess/API/C/mac/WKInspectorPrivateMac.h: No need for the ivar to be declared here, move to @implementation. * UIProcess/WebInspectorProxy.h: Simplify the name to match modern convention. * UIProcess/mac/WebInspectorProxyMac.mm: (-[WKWebInspectorProxyObjCAdapter inspectorRef]): (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]): (-[WKWebInspectorProxyObjCAdapter invalidate]): (-[WKWebInspectorProxyObjCAdapter windowDidMove:]): (-[WKWebInspectorProxyObjCAdapter windowDidResize:]): (-[WKWebInspectorProxyObjCAdapter windowWillClose:]): (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]): (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]): (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]): Remove unnecessary casts to and from void*. (WebKit::WebInspectorProxy::attachmentViewDidChange): (WebKit::WebInspectorProxy::setInspectorWindowFrame): (WebKit::WebInspectorProxy::closeTimerFired): (WebKit::WebInspectorProxy::createInspectorWindow): (WebKit::WebInspectorProxy::platformCreateInspectorPage): Fix uses of member variable m_objCAdapter. (-[WKWebInspectorProxyObjCAdapter close]): Deleted. Rename this to invalidate to match modern convention. In this context, 'close' might trick someone into thinking that this closes a window/page. 2017-09-30 Brian Burg Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView https://bugs.webkit.org/show_bug.cgi?id=177661 Reviewed by Joseph Pecoraro. Move code that sets up and controls the inspector WebView into WKInspectorViewController. This will be shared between RemoteWebInspectorProxy and WebInspectorProxy eventually, but for now just pull out code from RemoteWebInspectorProxy. The next patch will move over WebInspectorProxy. WKInspectorViewController uses the ObjC API for setting up the WKWebView's delegates. Previously, a WKWebView was used but the delegates were set up using the C API. In a few cases it uses delegate methods to ask the owning [Remote]WebInspectorProxy some things. In general, WKInspectorViewController doesn't dig into any internals of WebPageProxy or WebInspectorProxy; that is delegated to the client. * UIProcess/RemoteWebInspectorProxy.h: (WebKit::RemoteWebInspectorProxy::isUnderTest const): Add a method stub for now. We might want to enable tests for a _WKRemoteWebInspectorViewController-based UI in the future, and WebInspectorProxy has the same method. Add this and connect it to the view controller delegate method. (WebKit::RemoteWebInspectorProxy::webView const): This returns a plain WKWebView type now. * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]): (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]): (-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]): Deleted. (-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted. Make the ObjCAdapter forward view controller delegate calls to the C++ class. It no longer needs to be the delegate of the WebView, as the view controller handles that. (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): Clean up and move WKWebView setup code into the view controller. (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow): The m_inspectorPage is closed by the caller before calling this method, so we don't need to do it here. (WebKit::RemoteWebInspectorProxy::platformBringToFront): (WebKit::RemoteWebInspectorProxy::platformSave): (WebKit::RemoteWebInspectorProxy::platformAppend): (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Use webView() instead of m_webView. * UIProcess/mac/WKInspectorViewController.h: Added. * UIProcess/mac/WKInspectorViewController.mm: Added. (-[WKInspectorWKWebView tag]): (-[WKInspectorViewController initWithInspectedPage:]): (-[WKInspectorViewController dealloc]): (-[WKInspectorViewController delegate]): (-[WKInspectorViewController webView]): (-[WKInspectorViewController setDelegate:]): (-[WKInspectorViewController configuration]): (-[WKInspectorViewController _webView:getWindowFrameWithCompletionHandler:]): (-[WKInspectorViewController _webView:setWindowFrame:]): (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]): (-[WKInspectorViewController _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]): (-[WKInspectorViewController webViewWebContentProcessDidTerminate:]): (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]): Move code from RemoteWebInspectorProxyMac into here. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createFrontendWindow): Remove commented out code left over from the last time that this method got moved around. * WebKit.xcodeproj/project.pbxproj: Add new class. 2017-10-20 Zan Dobersek [WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl https://bugs.webkit.org/show_bug.cgi?id=178575 Reviewed by Carlos Garcia Campos. * Scripts/generate-forwarding-headers.pl: Remove CoordinatedGraphics as a supported platform prefix. No one invokes the script with this argument anymore. 2017-10-19 Alex Christensen Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename https://bugs.webkit.org/show_bug.cgi?id=178560 Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKDownloadDelegate.h: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::didStart): (WebKit::DownloadClient::didReceiveResponse): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): (WebKit::DownloadClient::didFinish): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::didCancel): (WebKit::DownloadClient::willSendRequest): 2017-10-19 Chris Dumez ServiceWorkerContextManager should be an IPC::MessageReceiver https://bugs.webkit.org/show_bug.cgi?id=178552 Reviewed by Youenn Fablet. ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many ServiceWorker related methods on WebProcess class. * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startServiceWorkerContext): (WebKit::WebSWServerConnection::startFetch): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/ServiceWorkerContextManager.cpp: (WebKit::ServiceWorkerContextManager::startFetchInServiceWorker): (WebKit::ServiceWorkerContextManager::startFetch): Deleted. * WebProcess/Storage/ServiceWorkerContextManager.h: * WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveMessage): (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): Deleted. (WebKit::WebProcess::startFetchInServiceWorker): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-19 Alex Christensen Modernize authentication challenge handling in WebKit https://bugs.webkit.org/show_bug.cgi?id=178555 Reviewed by Tim Horton. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didReceiveAuthenticationChallengeInFrame): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didReceiveAuthenticationChallenge): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): (WKPageSetPageNavigationClient): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace): (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy): 2017-10-19 Alex Christensen Modernize API::DownloadClient https://bugs.webkit.org/show_bug.cgi?id=178547 Reviewed by Andy Estes. Use more C++ references instead of pointers because they're never null. Remove canAuthenticateAgainstProtectionSpace because there are no implementations except the default implementation which always returns true and we don't intend to add this to the SPI because that's just a legacy call anyways from when NSURLConnection hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design. Separate the NetworkSession-only and pre-NetworkSession-only callbacks. All the synchronous IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them! Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to design an asynchronous API. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted. * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync): (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted. * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::didStart): (API::DownloadClient::didReceiveAuthenticationChallenge): (API::DownloadClient::didReceiveResponse): (API::DownloadClient::didReceiveData): (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): (API::DownloadClient::decideDestinationWithSuggestedFilename): (API::DownloadClient::didCreateDestination): (API::DownloadClient::didFinish): (API::DownloadClient::didFail): (API::DownloadClient::didCancel): (API::DownloadClient::processDidCrash): (API::DownloadClient::willSendRequest): (API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted. * UIProcess/API/C/WKContext.cpp: (WKContextSetDownloadClient): * UIProcess/API/glib/WebKitDownloadClient.cpp: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::didStart): (WebKit::DownloadClient::didReceiveResponse): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): (WebKit::DownloadClient::didFinish): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::didCancel): (WebKit::DownloadClient::willSendRequest): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::processDidClose): (WebKit::DownloadProxy::didStart): (WebKit::DownloadProxy::didReceiveAuthenticationChallenge): (WebKit::DownloadProxy::willSendRequest): (WebKit::DownloadProxy::didReceiveResponse): (WebKit::DownloadProxy::didReceiveData): (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): (WebKit::DownloadProxy::didCreateDestination): (WebKit::DownloadProxy::didFinish): (WebKit::DownloadProxy::didFail): (WebKit::DownloadProxy::didCancel): (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted. * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Downloads/DownloadProxy.messages.in: 2017-10-19 Nan Wang AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection https://bugs.webkit.org/show_bug.cgi?id=176247 Reviewed by Ryosuke Niwa. When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a list of totally wrong rects if the user changed the selection to some other text. This is because the calculation is based on the current selection range. Therefore, we need to provide a way for accessibility codepath to store the selection during a speaking session. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _accessibilityStoreSelection]): (-[WKWebView _accessibilityClearSelection]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _accessibilityStoreSelection]): (-[WKContentView _accessibilityClearSelection]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::storeSelectionForAccessibility): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getRectsForGranularityWithSelectionOffset): (WebKit::WebPage::storeSelectionForAccessibility): (WebKit::WebPage::getRectsAtSelectionOffsetWithText): 2017-10-19 Sam Weinig [Settings] Move global settings into their own file https://bugs.webkit.org/show_bug.cgi?id=178512 Reviewed by Darin Adler. Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket): * Shared/WebPreferencesDefinitions.h: * Shared/WebPreferencesStore.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): (WebKit::WebPage::updatePreferences): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setResourceLoadStatisticsEnabled): * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreen const): 2017-10-19 Andy Estes [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices https://bugs.webkit.org/show_bug.cgi?id=178181 Reviewed by Dan Bernstein. * Configurations/BaseTarget.xcconfig: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * WebKit.xcodeproj/project.pbxproj: 2017-10-19 Youenn Fablet Add preliminary support for ServiceWorker Handle Fetch https://bugs.webkit.org/show_bug.cgi?id=178475 Reviewed by Chris Dumez. Relanding now that underlying issue is fixed in https://bugs.webkit.org/show_bug.cgi?id=178527. Preliminary support of Handle Fetch algorithm and integration with fetch spec. Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker. It is similar to WebResourceLoader that do the load through NetworkProcess. In case ServiceWorkerClientFetch is not able to load through ServiceWorker, it will fallback to WebResourceLoader through a fallback callback. Loading through Service Worker is done currently if: - There is a service worker registered for that origin - Request is a subresource - service workers mode is all There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set. Future work should try to reduce the cases where the IPC dance is done unnecessarily. ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader. In particular, it is calling ResourceLoader error callback if response is of type error. It should call ResourceLoader redirection callback if response is a redirection response. This will be done as a follow-up. Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess. In the future, WebProcess should create a direct IPC communication to the ServiceWorker process. Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager. This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate. * CMakeLists.txt: * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::didReceiveFetchResponse): (WebKit::WebSWServerConnection::didReceiveFetchData): (WebKit::WebSWServerConnection::didFinishFetch): (WebKit::WebSWServerConnection::didFailFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::didFailFetch): (WebKit::StorageProcess::didReceiveFetchResponse): (WebKit::StorageProcess::didReceiveFetchData): (WebKit::StorageProcess::didFinishFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::remove): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added. (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch): (WebKit::ServiceWorkerClientFetch::didReceiveResponse): (WebKit::ServiceWorkerClientFetch::didReceiveData): (WebKit::ServiceWorkerClientFetch::didFinish): (WebKit::ServiceWorkerClientFetch::didFail): (WebKit::ServiceWorkerClientFetch::cancel): * WebProcess/Storage/ServiceWorkerClientFetch.h: Copied from Source/WebKit/WebProcess/Storage/WebSWClientConnection.h. * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Copied from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in. * WebProcess/Storage/ServiceWorkerContextManager.cpp: Added. (WebKit::ServiceWorkerContextManager::startServiceWorkerContext): (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h. (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): (WebKit::WebServiceWorkerProvider::handleFetch): (WebKit::WebServiceWorkerProvider::cancelFetch): (WebKit::WebServiceWorkerProvider::fetchFinished): (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): (WebKit::WebProcess::startFetchInServiceWorker): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-19 Youenn Fablet Service Worker process should not be selected to open WebView on it https://bugs.webkit.org/show_bug.cgi?id=178527 Reviewed by Chris Dumez. Selection of process to open a page will no longer use an existing web process if it is the service worker process. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): 2017-10-19 Tim Horton Display link bringup can block the main thread for ~150ms during WKWebView init https://bugs.webkit.org/show_bug.cgi?id=178524 Reviewed by Dean Jackson. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::displayLinkHandler): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): Lazily initialize the display link at first use. 2017-10-19 Tim Horton Expand r209943 to suppress paste during provisional navigation as well https://bugs.webkit.org/show_bug.cgi?id=178429 Reviewed by Dean Jackson. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Adjust to the changed preference name, except at the SPI level. 2017-10-19 Youenn Fablet Add API to clean CacheStorage data https://bugs.webkit.org/show_bug.cgi?id=178034 Unreviewed. * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Using WK_IOS_TBA instead of WK_MAC_TBA for iOS. 2017-10-19 Chris Dumez Unreviewed build fix after r223692. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: 2017-10-19 Chris Dumez Unreviewed, revert r223650 as it caused crashes on the bots. * CMakeLists.txt: * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::remove): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed. * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed. * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed. * WebProcess/Storage/ServiceWorkerContextManager.cpp: Removed. * WebProcess/Storage/WebSWClientConnection.cpp: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-19 Chris Dumez http/tests/workers/service/basic-register.html is a flaky failure. https://bugs.webkit.org/show_bug.cgi?id=178494 Reviewed by Youenn Fablet. In WebSWServerConnection::resolveJobInClient(), when a service worker is registered, we: 1. Add the origin to the WebSWOriginStore 2. Send the IPC to the WebProcess to notify it that the registration succeeded. The assumption was that step 1 would be synchronous and would therefore send the shared memory handle to the WebProcess (if the SharedMemory was invalidated) *before* step 2. The issue is that step 1 was scheduling a zero-timer to schedule the addition. As a result, there was a race and the WebContent process could check the the WebSWOriginTable *after* being notified that a service worker was registered but *before* it received the SharedMemory handle for the WebSWOriginTable. This could lead to false negatives and was causing the layout test to be flaky. To address the issue, step 1 is now synchronous. * Shared/SharedStringHashStore.cpp: (WebKit::SharedStringHashStore::SharedStringHashStore): (WebKit::SharedStringHashStore::scheduleAddition): (WebKit::SharedStringHashStore::scheduleRemoval): (WebKit::SharedStringHashStore::contains): (WebKit::SharedStringHashStore::flushPendingChanges): (WebKit::SharedStringHashStore::processPendingOperations): * Shared/SharedStringHashStore.h: * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: (WebKit::WebSWOriginStore::add): (WebKit::WebSWOriginStore::addAll): (WebKit::WebSWOriginStore::remove): * StorageProcess/ServiceWorker/WebSWOriginStore.h: * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::addVisitedLinkHash): (WebKit::VisitedLinkStore::removeVisitedLinkHash): 2017-10-18 Ryosuke Niwa Don't expose raw HTML in pasteboard to the web content https://bugs.webkit.org/show_bug.cgi?id=178422 Reviewed by Wenson Hsieh. Encode & decode the origin string of the copied content written into the system pasteboard. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-10-18 Chris Dumez Implement ServiceWorkerRegistration.scope / updateViaCache https://bugs.webkit.org/show_bug.cgi?id=178497 Reviewed by Youenn Fablet. * Shared/WebCoreArgumentCoders.h: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: 2017-10-18 Youenn Fablet Add preliminary support for ServiceWorker Handle Fetch https://bugs.webkit.org/show_bug.cgi?id=178475 Reviewed by Chris Dumez. Preliminary support of Handle Fetch algorithm and integration with fetch spec. Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker. It is similar to WebResourceLoader that do the load through NetworkProcess. In case ServiceWorkerClientFetch is not able to load through ServiceWorker, it will fallback to WebResourceLoader through a fallback callback. Loading through Service Worker is done currently if: - There is a service worker registered for that origin - Request is a subresource - service workers mode is all There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set. Future work should try to reduce the cases where the IPC dance is done unnecessarily. ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader. In particular, it is calling ResourceLoader error callback if response is of type error. It should call ResourceLoader redirection callback if response is a redirection response. This will be done as a follow-up. Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess. In the future, WebProcess should create a direct IPC communication to the ServiceWorker process. Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager. This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate. * DerivedSources.make: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::didReceiveFetchResponse): (WebKit::WebSWServerConnection::didReceiveFetchData): (WebKit::WebSWServerConnection::didFinishFetch): (WebKit::WebSWServerConnection::failedFetch): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::failedFetch): (WebKit::StorageProcess::didReceiveFetchResponse): (WebKit::StorageProcess::didReceiveFetchData): (WebKit::StorageProcess::didFinishFetch): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added. (WebKit::ServiceWorkerClientFetch::didReceiveResponse): (WebKit::ServiceWorkerClientFetch::didReceiveData): (WebKit::ServiceWorkerClientFetch::didFinishFetch): (WebKit::ServiceWorkerClientFetch::didFail): * WebProcess/Storage/ServiceWorkerClientFetch.h: Added. * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Added. * WebProcess/Storage/ServiceWorkerContextManager.cpp: Renamed from Source/WebCore/workers/service/context/SWContextManager.cpp. (WebKit::ServiceWorkerContextManager::startServiceWorkerContext): (WebKit::ServiceWorkerContextManager::startFetch): * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h. (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::startFetch): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::shouldHandleFetch): (WebKit::WebServiceWorkerProvider::handleFetch): (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): (WebKit::WebProcess::startFetchInServiceWorker): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-18 Chelsea Pugh [iOS] Use new class name from UIKit when checking UITextSuggestion type https://bugs.webkit.org/show_bug.cgi?id=178416 Reviewed by Tim Horton. Here we start using UITextAutofillSuggestion instead of the old name that was being used for AutoFill text suggestions. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertTextSuggestion:]): Use UITextAutofillSuggestion when checking the class and when casting instead of UIKeyboardLoginCredentialsSuggestion. 2017-10-17 Jiewen Tan Replace some stack raw pointers with RefPtrs within WebCore/html https://bugs.webkit.org/show_bug.cgi?id=178201 Reviewed by Ryosuke Niwa. Change the type of node as toNode() is changed to return RefPtr. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp: (WebKit::wrap): * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::handleEditingKeyboardEvent): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::frameForEvent): 2017-10-18 Chris Dumez [Service Worker] Add stubs for Client / WindowClient / Clients https://bugs.webkit.org/show_bug.cgi?id=178469 Reviewed by Youenn Fablet. Rename PageVisibilityState to VisibilityState. * Shared/API/c/WKSharedAPICast.h: (WebKit::toVisibilityState): * WebProcess/WebPage/WebPage.h: 2017-10-18 John Wilander Check notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=178470 Reviewed by Brian Burg. * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): Add a missing check of notifyPagesWhenTelemetryWasCaptured. The page notification is only for testing purposes. 2017-10-18 Chris Dumez Unreviewed, fix build error after r223608 with some SDKs. * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::ensureSWOriginStoreForSession): 2017-10-18 Chris Dumez Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin https://bugs.webkit.org/show_bug.cgi?id=177876 Reviewed by Ryosuke Niwa. Introduce a Service Worker origin store which gets populated / updated on the StorageProcess side and queried on the WebContent process side via the WebSWOriginTable so that the WebProcess can efficiently check if there is a ServiceWorker registered for a given origin without actually doing an IPC to the StorageProcess. For efficiency, the hash table is backed by SharedMemory so we only pass shared memory handles between the StorageProcess and the WebProcesses. We currently add entries to the WebSWOriginStore whenever a service worker registration succeeds on the StorageProcess side. We also clear this store whenever the API to clear service worker registrations is called. Code to query the WebSWOriginTable from the WebContent process side is there but currently only used by Internals for testing. We will later leverage this code when integrating with Fetch API. * CMakeLists.txt: * Shared/SharedStringHashStore.h: (WebKit::SharedStringHashStore::Client::didUpdateSharedStringHashes): * Shared/SharedStringHashTable.cpp: (WebKit::SharedStringHashTable::clear): * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp. (WebKit::WebSWOriginStore::WebSWOriginStore): (WebKit::WebSWOriginStore::add): (WebKit::WebSWOriginStore::remove): (WebKit::WebSWOriginStore::clear): (WebKit::WebSWOriginStore::registerSWServerConnection): (WebKit::WebSWOriginStore::unregisterSWServerConnection): (WebKit::WebSWOriginStore::sendStoreHandle): (WebKit::WebSWOriginStore::didInvalidateSharedMemory): * StorageProcess/ServiceWorker/WebSWOriginStore.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::resolveJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: (WebKit::WebSWServerConnection::sessionID const): * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): (WebKit::StorageProcess::ensureSWOriginStoreForSession): (WebKit::StorageProcess::swOriginStoreForSession const): (WebKit::StorageProcess::serviceWorkerContextStarted): (WebKit::StorageProcess::registerSWServerConnection): (WebKit::StorageProcess::unregisterSWServerConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::WebSWClientConnection): (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): (WebKit::WebSWClientConnection::setSWOriginTableSharedMemory): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: * WebProcess/Storage/WebSWOriginTable.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h. (WebKit::WebSWOriginTable::contains const): (WebKit::WebSWOriginTable::setSharedMemory): * WebProcess/Storage/WebSWOriginTable.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h. * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startServiceWorkerContext): 2017-10-16 Andy Estes [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError https://bugs.webkit.org/show_bug.cgi?id=178191 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-10-17 Sam Weinig [Settings] Generate Settings.h/cpp https://bugs.webkit.org/show_bug.cgi?id=178361 Reviewed by Dean Jackson. * PlatformGTK.cmake: * PlatformWPE.cmake: Delete the old Settings.h from the forwarding headers directory to allow the build to work. 2017-10-17 John Wilander Add and remove cookie partition accordingly in intermediary redirect requests https://bugs.webkit.org/show_bug.cgi?id=178369 Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::shouldChangePartition): Convenience function. Comment documents the logic. (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): Now adds and removes cookie partition based on the redirect-to URL's domain. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleResourceLoadStatisticsNotifyObserver): Test infrastructure. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: 2017-10-17 Youenn Fablet Cache API implementation should be able to compute storage size for WebKit client applications. https://bugs.webkit.org/show_bug.cgi?id=178350 Reviewed by Chris Dumez. When gathering data from DOM Cache, we compute the size as follows: - If Caches object is not persistent, size is zero - If Caches object is persistent, we use the size computed by NetworkCache::Storage. Covered by updated tests. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::ReadOriginsTaskCounter::create): (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin): (WebKit::CacheStorage::Engine::fetchEntries): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::storageSize const): * NetworkProcess/cache/CacheStorageEngineCaches.h: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreGetFetchCacheSizeForOrigin): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2017-10-17 Keith Miller Change WebCore sources to work with unified source builds https://bugs.webkit.org/show_bug.cgi?id=178229 Rubber stamped by Tim Horton. * Configurations/FeatureDefines.xcconfig: 2017-10-16 Wenson Hsieh Unreviewed, fix the iOS build after r223431 Remove an unused variable captured in a lambda. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): 2017-10-12 Matt Rajca Add API support for quirk that lets an arbitrary click allow auto-play. https://bugs.webkit.org/show_bug.cgi?id=178227 Reviewed by Alex Christensen. Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets an arbitrary click allow auto-play via website policies. * Shared/WebsitePolicies.h: * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): (WKWebsitePoliciesGetAllowedAutoplayQuirks): * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): (-[_WKWebsitePolicies allowedAutoplayQuirks]): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::applyToDocumentLoader): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateWebsitePolicies): 2017-10-16 Andy Estes [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError https://bugs.webkit.org/show_bug.cgi?id=178191 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-10-16 Tim Horton Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:]) https://bugs.webkit.org/show_bug.cgi?id=178358 Reviewed by Wenson Hsieh. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _didFindMatch:]): UIPDFSelection can return a null rect as the selection's bounds. We can't zoom to a null rect (and doing so results in CA throwing an exception later). 2017-10-16 Alex Christensen Add a _WKThumbnailView initializer with a WKWebView https://bugs.webkit.org/show_bug.cgi?id=178351 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _page]): (-[WKWebView _setThumbnailView:]): (-[WKWebView _thumbnailView]): (-[WKWebView _setIgnoresAllEvents:]): (-[WKWebView _ignoresAllEvents]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView initWithFrame:fromWKWebView:]): (-[_WKThumbnailView _viewWasUnparented]): (-[_WKThumbnailView _viewWasParented]): 2017-10-16 Alex Christensen Expose more WKView properties as WKWebViewPrivate SPI https://bugs.webkit.org/show_bug.cgi?id=178349 Reviewed by Tim Horton. _backgroundExtendsBeyondPage was already exposed on iOS, but we need it on Mac, too. A few other properties also need exposing. * UIProcess/API/Cocoa/WKWebView.mm: (toAPIScrollbarStyle): (toCoreScrollbarStyle): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): (-[WKWebView _setOverlayScrollbarStyle:]): (-[WKWebView _overlayScrollbarStyle]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-10-16 Chris Dumez Log using differential privacy domains where the WebContent process crashes https://bugs.webkit.org/show_bug.cgi?id=178346 Reviewed by Alex Christensen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::currentURL const): (WebKit::WebPageProxy::processDidTerminate): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didClose): 2017-10-16 Youenn Fablet Activate Cache API by default https://bugs.webkit.org/show_bug.cgi?id=178186 Reviewed by Chris Dumez. * Shared/WebPreferencesDefinitions.h: 2017-10-16 Sam Weinig [Settings] Remove all custom code from Settings.h/cpp https://bugs.webkit.org/show_bug.cgi?id=178330 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetFrameFlatteningEnabled): (WKPreferencesGetFrameFlatteningEnabled): * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_get_enable_frame_flattening): (webkit_settings_set_enable_frame_flattening): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setFrameFlatteningEnabled): Update for naming changes of FrameFlattening now that it is an enum class. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged const): Ge the effectiveFrameFlattening from the FrameView, rather than the Settings. 2017-10-16 Chris Dumez [WK2][NetworkSession] Add support for resuming downloads https://bugs.webkit.org/show_bug.cgi?id=177625 Reviewed by Alex Christensen. Add support for resuming downloads for the WK2 NETWORK_SESSION code path. This was tested manually. I was unable to write an API test because our tests do not run an HTTP server and CFNetwork does not seem to generate resume data when cancelling a download over non-HTTP. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::didReceiveChallenge): (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): (WebKit::DownloadManager::resumeDownload): * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): This currently includes a workaround for . We update the resume data to include the NSURLSessionResumeInfoLocalPath key with the final destination path so that CFNetwork looks for the temporary data at the right location. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: 2017-10-16 Adrian Perez de Castro [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM https://bugs.webkit.org/show_bug.cgi?id=178090 Reviewed by Michael Catanzaro. EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL implementation, its build options, and the libepoxy build options. Using "static_cast" works when it is a numeric value and the width of the value needs to be optionally extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers, and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other cases. Therefore it seems reasonable to use a plain C cast expression to solve this particular situation. * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: (WebKit::AcceleratedSurfaceWPE::window const): Use a good old plain C cast expression. 2017-10-16 Chris Dumez Clicks on Link with download attribute causes all (other) links to trigger download when clicked https://bugs.webkit.org/show_bug.cgi?id=178267 Reviewed by Darin Adler. When clicking on an anchor with the download attribute, the m_syncNavigationActionHasDownloadAttribute flag on WebPageProxy would get set. This flag would not get reset right away and instead, it would get updated during the next call to WebPageProxy::decidePolicyForNavigationAction(). The issue is that if you later click on a link with target="_blank", WebPageProxy::decidePolicyForNewWindowAction() gets called instead of WebPageProxy::decidePolicyForNavigationAction() and we do not reset the m_syncNavigationActionHasDownloadAttribute flag and we force a download. To address the problem, I got rid of this flag on WebPageProxy and it is error-prone and should really not be at page-level. Instead, I added a shouldForceDownload flag on the navigation object. It makes more sense to associate the flag with the navigation and makes it less error-prone. * UIProcess/API/APINavigation.h: (API::Navigation::setShouldForceDownload): (API::Navigation::shouldForceDownload const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.h: 2017-10-16 Ryan Haddad Unreviewed, rolling out r223271. This change introduced LayoutTest failures on WK1. Reverted changeset: "Use asynchronous ResourceHandleClient calls for WebKit1" https://bugs.webkit.org/show_bug.cgi?id=160677 https://trac.webkit.org/changeset/223271 2017-10-13 Youenn Fablet Implement listing origins for which CacheStorage is storing data https://bugs.webkit.org/show_bug.cgi?id=178236 Reviewed by Chris Dumez. Cache storage is split on per-origin folders which name is obfuscated through salting. To retrieve the origin for each folder, an origin file is now stored within each folder. This file contains the actual origin. Adding support to get the list of origin by iterating through each folder and getting the actual origin by reading the content of the 'origin' file. Adding C API for WebKitTestRunner. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::ReadOriginsTaskCounter::create): (WebKit::CacheStorage::ReadOriginsTaskCounter::~ReadOriginsTaskCounter): (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin): (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::cachesOriginFilename): (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::storeOrigin): (WebKit::CacheStorage::Caches::readOrigin): (WebKit::CacheStorage::Caches::initialize): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::origin const): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreGetFetchCacheOrigins): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2017-10-13 Alex Christensen Fix API tests after r223269. https://bugs.webkit.org/show_bug.cgi?id=178246 * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::getContentRuleListSource): Version 10 also has the ability to recover content rule list source. 2017-10-11 Gustavo Noronha Silva [GLib] WebKitNavigationAction should tell whether it is a redirect https://bugs.webkit.org/show_bug.cgi?id=178178 There is no good way to know whether a given navigation action has been caused by a redirect through the glib API. This is necessary to implement some app mode heuristics for Epiphany. Reviewed by Carlos Garcia Campos. * UIProcess/API/glib/WebKitNavigationAction.cpp: (webkit_navigation_action_is_redirect): returns whether the navigation action is a redirect. * UIProcess/API/glib/WebKitNavigationActionPrivate.h: add isRedirect to the wrapper object. (_WebKitNavigationAction::_WebKitNavigationAction): * UIProcess/API/gtk/WebKitNavigationAction.h: add the new API. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: ditto. * UIProcess/API/wpe/WebKitNavigationAction.h: ditto. 2017-10-12 Brady Eidson SW "Hello world". https://bugs.webkit.org/show_bug.cgi?id=178187 Reviewed by Andy Estes. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::startServiceWorkerContext): 2017-10-12 Alex Christensen Remove unnecessary includes in WebKit https://bugs.webkit.org/show_bug.cgi?id=178235 Reviewed by Tim Horton. * Platform/IPC/ArgumentCoders.h: * WebProcess/WebProcess.cpp: * WebProcess/WebStorage/StorageAreaImpl.h: 2017-10-12 Alex Christensen Increment ContentRuleListStore::CurrentContentRuleListFileVersion https://bugs.webkit.org/show_bug.cgi?id=178246 Reviewed by Tim Horton. * UIProcess/API/APIContentRuleListStore.h: Things are crashing. Something isn't binary reverse compatible. Probably something related to r222602. This is why we have a version number to update. 2017-10-12 Alex Christensen Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate https://bugs.webkit.org/show_bug.cgi?id=178240 Reviewed by Tim Horton. Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _dismissContentRelativeChildWindows]): (-[WKWebView _setFrame:andScrollBy:]): (-[WKWebView _setTotalHeightOfBanners:]): (-[WKWebView _totalHeightOfBanners]): (-[WKWebView _beginDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChangesSync]): (-[WKWebView _gestureEventWasNotHandledByWebCore:]): (-[WKWebView _setIgnoresNonWheelEvents:]): (-[WKWebView _ignoresNonWheelEvents]): (-[WKWebView _setCustomSwipeViews:]): (-[WKWebView _setCustomSwipeViewsTopContentInset:]): (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView _fullScreenWindow]): (-[WKWebView _disableFrameSizeUpdates]): (-[WKWebView _enableFrameSizeUpdates]): (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _underlayColor]): (-[WKWebView _setUnderlayColor:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView createFullScreenWindow]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::fullScreenWindowController): (WebKit::WebViewImpl::fullScreenWindow): (WebKit::WebViewImpl::createFullScreenWindow): Deleted. 2017-10-12 Youenn Fablet Layout Test http/tests/cache-storage/cache-clearing.https.html is failing https://bugs.webkit.org/show_bug.cgi?id=178200 Reviewed by Chris Dumez. Deleting only the per-origin folders inside the CacheStorage engine root folder. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearAllCaches): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllFetchCaches): (WKWebsiteDataStoreRemoveFetchCacheForOrigin): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2017-10-12 Chris Dumez [Mac] Add support for MouseEvent.buttons https://bugs.webkit.org/show_bug.cgi?id=178214 Reviewed by Ryosuke Niwa. * Shared/WebEvent.h: (WebKit::WebMouseEvent::buttons const): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::WebMouseEvent): (WebKit::WebMouseEvent::encode const): (WebKit::WebMouseEvent::decode): * Shared/mac/WebEventFactory.mm: (WebKit::currentlyPressedMouseButtons): (WebKit::WebEventFactory::createWebMouseEvent): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::showContextMenuAtPoint): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPage::simulateMouseDown): (WebKit::WebPage::simulateMouseUp): (WebKit::WebPage::simulateMouseMotion): 2017-10-12 Youenn Fablet Add API to clean CacheStorage data https://bugs.webkit.org/show_bug.cgi?id=178034 Unreviewed. * Shared/WebsiteData/WebsiteDataType.h: fixing the DOMCache value. 2017-10-12 Stephan Szabo [WinCairo] add WebProcess files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=178024 Reviewed by Alex Christensen. * PlatformWin.cmake: * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added. (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: Added. (WebKit::InjectedBundle::initialize): (WebKit::InjectedBundle::setBundleParameter): (WebKit::InjectedBundle::setBundleParameters): * WebProcess/Plugins/Netscape/JSNPObject.cpp: * WebProcess/Plugins/Netscape/win/PluginProxyWin.cpp: Added. (WebKit::PluginProxy::needsBackingStore const): * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added. (WebKit::WebContextMenuClient::lookUpInDictionary): (WebKit::WebContextMenuClient::isSpeaking): (WebKit::WebContextMenuClient::speak): (WebKit::WebContextMenuClient::stopSpeaking): * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added. (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext): (WebKit::WebFrameNetworkingContext::storageSession const): (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const): (WebKit::WebFrameNetworkingContext::blockedError const): * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added. (WebKit::WebFrameNetworkingContext::create): * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Added. (WebKit::WebPopupMenu::setUpPlatformData): * WebProcess/WebPage/win/WebInspectorUIWin.cpp: Added. (WebKit::WebInspectorUI::canSave): (WebKit::WebInspectorUI::localizedStringsURL): (WebKit::RemoteWebInspectorUI::localizedStringsURL): * WebProcess/WebPage/win/WebPageWin.cpp: Added. (WebKit::WebPage::platformInitialize): (WebKit::WebPage::platformDetach): (WebKit::WebPage::platformEditorState const): (WebKit::WebPage::platformPreferencesDidChange): (WebKit::WebPage::performDefaultBehaviorForKeyEvent): (WebKit::WebPage::platformHasLocalDataForURL): (WebKit::WebPage::cachedResponseMIMETypeForURL): (WebKit::WebPage::platformCanHandleRequest): (WebKit::WebPage::cachedSuggestedFilenameForURL): (WebKit::WebPage::cachedResponseDataForURL): (WebKit::WebPage::platformUserAgent const): (WebKit::WebPage::interpretKeyEvent): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureWebToStorageProcessConnection): * WebProcess/win/WebProcessWin.cpp: Added. (loadResourceIntoBuffer): (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::WebProcess::platformTerminate): (WebKit::WebProcess::platformSetCacheModel): 2017-10-12 David Kilzer [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler Reviewed by Chris Fleizach. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]): - Remove unused lambda variable 'touch' which was also passed as an argument. (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]): - Remove unused lambda variable 'gestureState' which was also passed as an argument. (-[WKContentView _simulateLongPressActionAtLocation:]): - Remove unused lambda variable 'location'. 2017-10-12 John Wilander ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url() https://bugs.webkit.org/show_bug.cgi?id=175257 Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]): (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]): Test infrastructure. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Test infrastructure. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-10-12 Andy Estes [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices https://bugs.webkit.org/show_bug.cgi?id=178181 Reviewed by Dan Bernstein. * Configurations/BaseTarget.xcconfig: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * WebKit.xcodeproj/project.pbxproj: 2017-10-12 Youenn Fablet CacheStorage persistent folder should be in /Library/Cache https://bugs.webkit.org/show_bug.cgi?id=178193 Reviewed by Brady Eidson. * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultCacheStorageDirectory): Making CacheStorage directory a subfolder of Caches folder. (API::WebsiteDataStore::defaultDataStoreConfiguration): * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): (WebKit::WebProcessPool::ensureNetworkProcess): Make sure the web site data store has the right cache directory path. Also make sure that the quota is set even if there is no folder specified. Quota may still be useful in case of non persistent sessions. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: (API::WebsiteDataStore::defaultCacheStorageDirectory): 2017-10-11 Sam Weinig Remove out-parameter variants of copyToVector https://bugs.webkit.org/show_bug.cgi?id=178155 Reviewed by Tim Horton. * Shared/API/Cocoa/_WKRemoteObjectInterface.mm: (-[_WKRemoteObjectInterface debugDescription]): * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::dump): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::pendingCookies const): * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]): * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::getHostnamesWithCookies): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didChangePosition): (WebKit::WebGeolocationManager::didFailToDeterminePosition): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired): Replace out-parameter based copyToVector, with one that returns a Vector. 2017-10-11 Jaehun Lim Fix debug build Unreviewed. Add ENABLE(SERVICE_WORKER) guard. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): 2017-10-11 Youenn Fablet Add API to clean CacheStorage data https://bugs.webkit.org/show_bug.cgi?id=178034 Unreviewed. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): Fixing lifetime of aggregator. 2017-10-11 Youenn Fablet Add API to clean CacheStorage data https://bugs.webkit.org/show_bug.cgi?id=178034 Reviewed by Chris Dumez. Introducing a new website data type for DOMCache. Adding API to delete DOMCache for a given origin or for all origins. This is added to WKWebsiteDataStore. Cleaning a CacheStorage will remove all data in the Cache object but the object will stay live for the duration of the NetworkProcess. This allows ensuring that once a cache is cleaned, WebProcess will update to this new state. Fetching of WebsiteData for DOMCache is not implemented yet since we do not keep a list of all origins for which we have data. * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDOMCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::cachesRootPath): (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::ClearTasksHandler::ClearTasksHandler): (WebKit::CacheStorage::ClearTasksHandler::~ClearTasksHandler): (WebKit::CacheStorage::Engine::clearEngines): (WebKit::CacheStorage::Engine::clearCachesForOrigins): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::deleteFolder): (WebKit::CacheStorage::Engine::clearCaches): (WebKit::CacheStorage::Engine::unlock): Removing the assertion as Cache objects are removed when clearing data. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::clear): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::create): * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllDOMCaches): (WKWebsiteDataStoreRemoveDOMCacheForOrigin): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore allWebsiteDataTypes]): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): 2017-10-11 Chris Dumez [Geolocation] Expose Coordinates.floorLevel https://bugs.webkit.org/show_bug.cgi?id=178173 Reviewed by Ryosuke Niwa. * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate): (WKGeolocationPositionCreate_b): (WKGeolocationPositionCreate_c): * UIProcess/API/C/WKGeolocationPosition.h: 2017-10-11 Youenn Fablet Bump default cache storage quota to 20MB https://bugs.webkit.org/show_bug.cgi?id=178132 Reviewed by Alex Christensen. Adding the ability to set the quota per origin through WebsiteDataStore. Moving cache storage directory setting also in WebsiteDataStore. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithLegacyOptions): (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]): (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]): (-[WKWebsiteDataStore _cacheStorageDirectory]): (-[WKWebsiteDataStore _setCacheStorageDirectory:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): (WebKit::WebsiteDataStore::cacheStorageDirectory const): (WebKit::WebsiteDataStore::setCacheStorageDirectory): 2017-10-11 Myles C. Maxfield Allow PAL to log messages https://bugs.webkit.org/show_bug.cgi?id=171523 Reviewed by Alex Christensen. * Platform/Logging.h: * Scripts/generate-forwarding-headers.pl: 2017-10-11 Ryosuke Niwa Sanitize URL in pasteboard for other applications and cross origin content https://bugs.webkit.org/show_bug.cgi?id=178060 Reviewed by Wenson Hsieh. Plubmed the origin identifier through IPC from Pasteboard in WebContent process to PlatformPasteboard in UIProcess. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-10-11 Chris Dumez Modernize Geolocation code https://bugs.webkit.org/show_bug.cgi?id=178148 Reviewed by Ryosuke Niwa. * Shared/WebGeolocationPosition.cpp: (WebKit::WebGeolocationPosition::create): (WebKit::WebGeolocationPosition::~WebGeolocationPosition): * Shared/WebGeolocationPosition.h: (WebKit::WebGeolocationPosition::timestamp const): (WebKit::WebGeolocationPosition::latitude const): (WebKit::WebGeolocationPosition::longitude const): (WebKit::WebGeolocationPosition::accuracy const): (WebKit::WebGeolocationPosition::altitude const): (WebKit::WebGeolocationPosition::altitudeAccuracy const): (WebKit::WebGeolocationPosition::heading const): (WebKit::WebGeolocationPosition::speed const): (WebKit::WebGeolocationPosition::corePosition const): (WebKit::WebGeolocationPosition::WebGeolocationPosition): * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate_b): * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: (WebKit::wrapper): * UIProcess/API/glib/WebKitGeolocationProvider.cpp: (WebKit::WebKitGeolocationProvider::notifyPositionChanged): * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::providerDidChangePosition): * 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: 2017-10-11 Brady Eidson Add a SW context process (where SW scripts will actually execute). https://bugs.webkit.org/show_bug.cgi?id=178156 Reviewed by Andy Estes. This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool. This process is where ServiceWorker scripts will execute, separate from the client WebProcess hosting the page(s) they are serving. This patch also adds all of the plumbing to pass along a fetched service worker script to this context WebProcess, as well as message back failure to actually start the script so we can test. Touches lots of code sites but is basically just a lot of plumbing. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::startServiceWorkerContext): (WebKit::WebSWServerConnection::sendToContextProcess): (WebKit::WebSWServerConnection::setContextConnection): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::workerContextProcessConnection): (WebKit::StorageProcess::createWorkerContextProcessConnection): (WebKit::StorageProcess::didGetWorkerContextProcessConnection): (WebKit::StorageProcess::serviceWorkerContextFailedToStart): (WebKit::StorageProcess::registerSWServerConnection): (WebKit::StorageProcess::unregisterSWServerConnection): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): * StorageProcess/StorageToWebProcessConnection.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::create): (WebKit::StorageProcessProxy::StorageProcessProxy): (WebKit::StorageProcessProxy::didClose): (WebKit::StorageProcessProxy::getWorkerContextProcessConnection): (WebKit::StorageProcessProxy::didGetWorkerContextProcessConnection): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::getWorkerContextProcessConnection): (WebKit::WebProcessPool::didGetWorkerContextProcessConnection): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didGetWorkerContextConnection): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWorkerContextConnection): (WebKit::WebProcess::startServiceWorkerContext): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-10-11 Don Olmstead Remove ENABLE_NETWORK_CACHE https://bugs.webkit.org/show_bug.cgi?id=177424 Reviewed by Antti Koivisto. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::clearDiskCacheEntries): (WebKit::NetworkProcess::setCacheModel): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::cache): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::canUseCachedRedirect const): (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: * NetworkProcess/cache/NetworkCacheBlobStorage.h: * NetworkProcess/cache/NetworkCacheCoders.cpp: * NetworkProcess/cache/NetworkCacheCoders.h: * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: * NetworkProcess/cache/NetworkCacheCodersSoup.cpp: * NetworkProcess/cache/NetworkCacheData.cpp: * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheDataCocoa.mm: * NetworkProcess/cache/NetworkCacheDataSoup.cpp: * NetworkProcess/cache/NetworkCacheEntry.cpp: * NetworkProcess/cache/NetworkCacheEntry.h: * NetworkProcess/cache/NetworkCacheFileSystem.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheIOChannel.h: * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: * NetworkProcess/cache/NetworkCacheKey.cpp: * NetworkProcess/cache/NetworkCacheKey.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: * NetworkProcess/cache/NetworkCacheStatistics.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: * NetworkProcess/cache/NetworkCacheStorage.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): (WebKit::NetworkProcess::clearDiskCache): * NetworkProcess/ios/NetworkProcessIOS.mm: (WebKit::NetworkProcess::clearCacheForAllOrigins): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::clearDiskCache): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::registerUserDefaultsIfNeeded): (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): (WebKit::WebProcessPool::isNetworkCacheEnabled): * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::storeDerivedDataToCache): * config.h: 2017-10-11 Michael Catanzaro Unreviewed, rolling out r223146. Better to not expose cairo in the WPE API Reverted changeset: "[WPE] Header cairo.h is used in GLib API headers but cannot be found" https://bugs.webkit.org/show_bug.cgi?id=178100 http://trac.webkit.org/changeset/223146 2017-09-27 Frederic Wang [iOS] Do not flatten frames when async frame scrolling is enabled https://bugs.webkit.org/show_bug.cgi?id=173704 Reviewed by Simon Fraser. This patch disables frame flattening when async frame scrolling is enabled on iOS, as otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264), developers and beta testers will be able to check it by enabling "Async Frame Scrolling" in the "Experimental WebKit Features" menu of Safari iOS. Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in Source/WebCore. 2017-10-10 Ryosuke Niwa Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner https://bugs.webkit.org/show_bug.cgi?id=178154 Reviewed by Wenson Hsieh. Plumbed customPasteboardDataEnabled flag to be used in WebKitTestRunner. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCustomPasteboardDataEnabled): (WKPreferencesGetCustomPasteboardDataEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-10-10 Adrian Perez de Castro [WPE] Remove the possibility of installing the old WebKit2 C API https://bugs.webkit.org/show_bug.cgi?id=178125 Reviewed by Michael Catanzaro. * PlatformWPE.cmake: Remove support for installing the deprecated C API. 2017-10-10 Chris Dumez [WK2] Add API to clear service worker registrations https://bugs.webkit.org/show_bug.cgi?id=178085 Reviewed by Ryosuke Niwa. Add API to clear service worker registrations. Although the request to clear the registration is passed on to the StorageProcess, it is currently a no-op on StorageProcess side until we actually persist service worker registrations on disk. * Shared/WebsiteData/WebsiteDataType.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::fetchWebsiteData): (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore allWebsiteDataTypes]): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): 2017-10-10 Commit Queue Unreviewed, rolling out r223130. https://bugs.webkit.org/show_bug.cgi?id=178147 Breaks the build when EGLNativeWindowType is a pointer (Requested by aperezdc on #webkit). Reverted changeset: "[WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM" https://bugs.webkit.org/show_bug.cgi?id=178090 http://trac.webkit.org/changeset/223130 2017-10-10 Sam Weinig Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values()) https://bugs.webkit.org/show_bug.cgi?id=178102 Reviewed by Tim Horton. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::dumpChangedLayers): * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextInvalidateCustomProtocolRequests): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]): * UIProcess/GenericCallback.h: (WebKit::invalidateCallbackMap): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shutDown): (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::didBecomeUnresponsive): (WebKit::WebProcessProxy::didBecomeResponsive): (WebKit::WebProcessProxy::willChangeIsResponsive): (WebKit::WebProcessProxy::didChangeIsResponsive): (WebKit::WebProcessProxy::disconnectFramesFromPage): (WebKit::WebProcessProxy::frameCountInPage const): (WebKit::WebProcessProxy::requestTermination): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::invalidate): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::stopAllStreams): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::cancelAllStreams): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::buildTransaction): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didClose): 2017-10-10 Adrian Perez de Castro [WPE] Header cairo.h is used in GLib API headers but cannot be found https://bugs.webkit.org/show_bug.cgi?id=178100 Reviewed by Michael Catanzaro. * wpe/wpe-webkit.pc.in: Add Cairo to the "Requires" field, so its flags get pulled in and the "cairo.h", used in the WPE WebKit GLib API headers, can be found. 2017-10-10 Michael Catanzaro CSS constant properties should not be enabled by default https://bugs.webkit.org/show_bug.cgi?id=177416 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: 2017-10-10 Brady Eidson Random StorageProcess and SWServer cleanup. https://bugs.webkit.org/show_bug.cgi?id=178141 Reviewed by Andy Estes. -StorageProcess should own the set of SWServers -Some renaming and cleanup * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::createStorageToWebProcessConnection): (WebKit::StorageProcess::swServerForSession): * StorageProcess/StorageProcess.h: (WebKit::StorageProcess::queue): * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishSWServerConnection): * StorageProcess/StorageToWebProcessConnection.h: 2017-10-10 Michael Catanzaro Unreviewed, rolling out r223136. Forgot to update GTK API header Reverted changeset: "[WPE] Header cairo.h is used in GLib API headers but cannot be found" https://bugs.webkit.org/show_bug.cgi?id=178100 http://trac.webkit.org/changeset/223136 2017-10-10 Adrian Perez de Castro [WPE] Header cairo.h is used in GLib API headers but cannot be found https://bugs.webkit.org/show_bug.cgi?id=178100 Reviewed by Žan Doberšek. Instead of including , it is better to forward-declare cairo_surface_t, which is the one and only Cairo declaration needed by the WPE API header. * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Add inclusion of . * UIProcess/API/glib/WebKitWebView.cpp: Add inclusion of . * UIProcess/API/wpe/WebKitFaviconDatabase.h: Add forward declaration of cairo_surface_t. 2017-10-10 Adrian Perez de Castro [WPE] Cannot link against libWPEWebkit due to wrong contents of wpe-webkit.pc https://bugs.webkit.org/show_bug.cgi?id=178133 Reviewed by Žan Doberšek. * wpe/wpe-webkit.pc.in: Remove "-lWPE" and replace "Requires.private" with a plain "Requires". 2017-10-10 Adrian Perez de Castro [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM https://bugs.webkit.org/show_bug.cgi?id=178090 Reviewed by Žan Doberšek. * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: (WebKit::AcceleratedSurfaceWPE::window const): Use static_cast instead of reinterpret_cast, this way extending values of EGLNativeWindowType to 64 bits is allowed. 2017-10-10 Adrian Perez de Castro [WPE] GLib API headers WebKitScriptDialog.h and WebKitFileChooserRequest.h are not installed https://bugs.webkit.org/show_bug.cgi?id=178104 Reviewed by Žan Doberšek. * PlatformWPE.cmake: Add missing header paths to the WPE_API_INSTALLED_HEADERS variable. 2017-10-10 Adrian Perez de Castro [WPE][CMake] The “install” target should install all public API headers https://bugs.webkit.org/show_bug.cgi?id=176475 Reviewed by Žan Doberšek. Install the WPE port GLib-based API headers. The deprecated C API is still available, but disabled by default behind the "EXPORT_DEPRECATED_WEBKIT2_C_API" CMake option. * PlatformWPE.cmake: Always install "wpe-webkit.pc" and the GLib C API for WPE. 2017-10-09 Jeremy Jones Fix typo of virtual keyword in PageClientImplIOS.h https://bugs.webkit.org/show_bug.cgi?id=178088 Reviewed by Simon Fraser. This compile error happens when FULLSCREEN_API is enabled for iOS. Remove the redundant virtual keyword since function is marked override. * UIProcess/ios/PageClientImplIOS.h: 2017-10-09 Chris Dumez [iOS][WK2] Tiles outsides the viewport are sometimes missing after relaunching a crashes WebProcess https://bugs.webkit.org/show_bug.cgi?id=178095 Reviewed by Simon Fraser. Make sure we reset WKWebView._hasScheduledVisibleRectUpdate to NO in WKWebView._processDidExit. _scheduleVisibleContentRectUpdateAfterScrollInView would otherwise return early because WKWebView._hasScheduledVisibleRectUpdate is always YES. Normally, _addUpdateVisibleContentRectPreCommitHandler sets a CATransaction commit handler that resets _hasScheduledVisibleRectUpdate to NO, but it does not do so when ![webView _isValid] (which is true when the WebProcess has crashed. Also reset WKWebView._commitDidRestoreScrollPosition to NO in WKWebView._processDidExit even though it does not seem to be the cause of this bug. It seems to make sense to reset this member when the process crashes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): 2017-10-09 Youenn Fablet Add quota to cache API https://bugs.webkit.org/show_bug.cgi?id=177552 Reviewed by Alex Christensen. Adding support for quota checking in CacheStorage::Caches. It is passed to NetworkProcess at creation time. Default quota size is configured to 400Ko by origin per default. This value is suitable for testing. Future patch should raise this default value and allows configuring it. Quota is computed based on the response body size. This size is padded at WebCore for opaque responses. Size is stored persistently as opaque response padded size should remain stable. See https://github.com/whatwg/storage/issues/31 for the rationale about this padding. In case of putting several records at the same time, the size of all records is computed so that all records will be written or rejected together. Sending QuotaExceeded error when quota is exceeded. Future effort should allow asking UIProcess for quota extension. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::cacheStoragePerOriginQuota const): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::readCachesFromDisk): * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::toRecordInformation): (WebKit::CacheStorage::isolatedCopy): (WebKit::CacheStorage::Cache::open): (WebKit::CacheStorage::Cache::storeRecords): (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::writeRecordToDisk): (WebKit::CacheStorage::Cache::updateRecordToDisk): (WebKit::CacheStorage::Cache::removeRecordFromDisk): (WebKit::CacheStorage::Cache::encode): (WebKit::CacheStorage::Cache::decodeRecordHeader): (WebKit::CacheStorage::Cache::decode): * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::requestSpace): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::removeCacheEntry): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::hasEnoughSpace const): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::traverse): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2017-10-09 Sam Weinig Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector https://bugs.webkit.org/show_bug.cgi?id=178072 Reviewed by Darin Adler. * Shared/AsyncRequest.h: (WebKit::AsyncRequestMap::values): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::pages const): Update for type change for HashMap::values(). 2017-10-09 Jeremy Jones Incorrect fullscreen animation when element has a transform. https://bugs.webkit.org/show_bug.cgi?id=177558 rdar://problem/29603741 Reviewed by Jer Noble. Use a bit of code from element fullscreen to do this correctly for video fullscreen. The key is to get the absolute quad from the renderer. This will work for scaling, But since we still take the bounding box, it won't work for rotations. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::inlineVideoFrame): 2017-10-09 Robin Morisset Make the names of the options consistent https://bugs.webkit.org/show_bug.cgi?id=177933 Reviewed by Saam Barati. * NetworkProcess/capture/json.hpp: * Platform/IPC/Connection.cpp: (IPC::Connection::connectionDidClose): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _keyboardWillHide:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runModal): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): 2017-10-09 Adrian Perez de Castro [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config https://bugs.webkit.org/show_bug.cgi?id=178081 Reviewed by Carlos Alberto Lopez Perez. * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebKit. 2017-10-08 Tim Horton mediaPlaybackRequiresUserAction API replacement annotation is wrong https://bugs.webkit.org/show_bug.cgi?id=178063 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: mediaPlaybackRequiresUserAction suggests that you should use requiresUserActionForMediaPlayback instead, but that is also deprecated. Instead, follow the chain and suggest mediaTypesRequiringUserActionForPlayback. 2017-10-06 Wenson Hsieh [iOS WK2] API tests added in r222991 are failing in iOS 11 test runners https://bugs.webkit.org/show_bug.cgi?id=178037 Reviewed by Tim Horton. This patch carries out some minor cleanup around UIKitSPI.h in WebKit2, so that the internal SDK isn't required to implement -[WKContentView insertTextSuggestion:]. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertTextSuggestion:]): 2017-10-06 Chris Dumez [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header https://bugs.webkit.org/show_bug.cgi?id=178027 Reviewed by Youenn Fablet. Use new NSURLSessionConfiguration._suppressedAutoAddedHTTPHeaders CFNetwork SPI to make sure that CFNetwork never adds a Content-Type HTTP headers to our requests when we did not add one. This is covered by the following tests on newer OSes: - imported/w3c/web-platform-tests/beacon/headers/header-content-type.html - http/tests/blink/sendbeacon/beacon-same-origin.html * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 2017-10-06 Aishwarya Nirmal [iOS] Respect the "caret-color" CSS property when editing https://bugs.webkit.org/show_bug.cgi?id=177489 Reviewed by Tim Horton. This change adds support for the caret-color property on iOS. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertionPointColor]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): 2017-10-06 Brian Burg Web Inspector: clicking in Inspector webview clears the selection in the inspected page https://bugs.webkit.org/show_bug.cgi?id=178014 Reviewed by Timothy Hatcher. If the Inspector is docked to the inspected view, clicking on the Inspector webview will cause selection in the inspected view to be lost. This is because the selection is lost when the web view resigns first responder. Add a check in maintainsInactiveSelection to always retain selection if Web Inspector is open. This approach seems simpler than trying to sync a client's usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied and unapplied when an inspector web view is shown or hidden. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maintainsInactiveSelection const): (WebKit::WebPageProxy::inspector const): Drive by, use nullptr. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted. 2017-10-06 Alex Christensen Add more infrastructure to apply custom headers to same-origin requests https://bugs.webkit.org/show_bug.cgi?id=177629 Reviewed by Ryosuke Niwa. * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesCopyCustomHeaderFields): (WKWebsitePoliciesSetCustomHeaderFields): * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies customHeaderFields]): (-[_WKWebsitePolicies setCustomHeaderFields:]): Make the SPI for setting custom header fields take a dictionary instead of an array of Strings with colons. This matches NSURLRequest and other APIs that deal with header fields. 2017-10-06 Wenson Hsieh [iOS] Tweak support for classifying form controls (followup to r222487) https://bugs.webkit.org/show_bug.cgi?id=177917 Reviewed by Dean Jackson. This patch follows up with . It combines the functionality of two SPI hooks implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for more detail. * UIProcess/WebPageProxy.h: Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere else. Instead of introducing new members to remember this state, we can just use the WKContentView's current assisted node information. This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session. * UIProcess/ios/WKContentView.mm: (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted. (-[WKContentView representingPageURL]): Deleted. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _autofillContext]): Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary containing the URL of the focused element's document if and only if WKContentView accepts autofilled login credentials, and there exists a representing page URL. When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact that all members but the element type in the content view's assisted node information could be stale, so this seems worthy of some investigation. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAssistingNode): (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted. (WebKit::WebPageProxy::representingPageURL): Deleted. 2017-10-06 Yousuke Kimoto [WinCairo] Add shared curl files https://bugs.webkit.org/show_bug.cgi?id=177999 Reviewed by Alex Christensen. * PlatformWin.cmake: * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added. (WebKit::AuthenticationManager::receivedCredential): (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential): (WebKit::AuthenticationManager::receivedCancellation): (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling): (WebKit::AuthenticationManager::receivedChallengeRejection): * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added. (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2017-10-06 Brent Fulgham Sandbox rules block PluginProcess using "File Open/Save" dialogs https://bugs.webkit.org/show_bug.cgi?id=177965 Reviewed by Alexey Proskuryakov. Update the PluginProcess sandboxes to allow the same XPC services as the WebContent process. Also allow access to the openAndSavePanelServices. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-10-06 Brady Eidson Add (entirely incorrect) fetching of ServiceWorker scripts. https://bugs.webkit.org/show_bug.cgi?id=176179 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::finishFetchingScriptInServer): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-10-05 Carlos Garcia Campos [GTK][WPE] Add API to configure and enable resource load statistics https://bugs.webkit.org/show_bug.cgi?id=177943 Reviewed by Michael Catanzaro. Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API. * UIProcess/API/glib/WebKitWebContext.cpp: (websiteDataStoreConfigurationForWebProcessPoolConfiguration): (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_resource_load_stats_directory): (webkit_website_data_manager_set_resource_load_stats_enabled): (webkit_website_data_manager_get_resource_load_stats_enabled): (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: 2017-10-05 Carlos Garcia Campos [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049 https://bugs.webkit.org/show_bug.cgi?id=168171 Reviewed by Chris Dumez. Add C API to handle all resource load statistics requests made by the layout tests. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetStatisticsLastSeen): (WKWebsiteDataStoreSetStatisticsPrevalentResource): (WKWebsiteDataStoreIsStatisticsPrevalentResource): (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction): (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction): (WKWebsiteDataStoreSetStatisticsGrandfathered): (WKWebsiteDataStoreIsStatisticsGrandfathered): (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin): (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin): (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo): (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction): (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree): (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords): (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning): (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost): (WKWebsiteDataStoreStatisticsSubmitTelemetry): (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned): (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval): (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured): (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval): (WKWebsiteDataStoreSetStatisticsGrandfatheringTime): (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries): (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo): (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore): (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours): (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval): (WKWebsiteDataStoreStatisticsResetToConsistentState): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2017-10-05 Tim Horton Fix the Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=177985 Unreviewed build fix. * CMakeLists.txt: * PlatformMac.cmake: After r222917, there's one more piece of WebKitSystemInterface left. And some missing bits of PaymentRequest. 2017-10-05 Keith Miller Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS. * Configurations/Base.xcconfig: 2017-10-05 Jer Noble [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting https://bugs.webkit.org/show_bug.cgi?id=177261 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2017-10-05 Alex Christensen Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList https://bugs.webkit.org/show_bug.cgi?id=177966 Reviewed by Tim Horton. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didChangeBackForwardList): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn): (WebKit::NavigationState::NavigationClient::didChangeBackForwardList): (WebKit::NavigationState::NavigationClient::willPerformClientRedirect): (WebKit::NavigationState::NavigationClient::didCancelClientRedirect): (WebKit::NavigationState::NavigationClient::renderingProgressDidChange): (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace): (WebKit::NavigationState::NavigationClient::processDidTerminate): (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive): (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive): (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame): (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData): (WebKit::NavigationState::HistoryClient::didPerformClientRedirect): (WebKit::NavigationState::HistoryClient::didPerformServerRedirect): (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeBackForwardList): 2017-10-05 Alex Christensen Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation https://bugs.webkit.org/show_bug.cgi?id=177974 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation): (WebKit::NavigationState::NavigationClient::didFailNavigationWithError): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): 2017-10-05 John Wilander Storage Access API: Web process should ask UI process for grant/deny https://bugs.webkit.org/show_bug.cgi?id=176941 Reviewed by Chris Dumez and Sam Weinig. This patch adds infrastructure to let WebCore::Document call WebKit::WebResourceLoadStatisticsStore and ask for storage access on behalf of an iframe. The communication goes through the ChromeClient since we might want to add a native prompt. From the ChromeClient it continues to the WebPage which messages the WebPageProxy. The WebPageProxy calls the WebsiteDataStore which owns the WebResourceLoadStatisticsStore. A uint64_t is used to match the right callback with the boolean result. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestStorageAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::requestStorageAccess): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestStorageAccess): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::nextRequestStorageAccessContextId): (WebKit::WebPage::requestStorageAccess): (WebKit::WebPage::storageAccessResponse): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-10-05 Chris Dumez Drop unused parameters for CookiesStrategy::cookiesEnabled() https://bugs.webkit.org/show_bug.cgi?id=177957 Reviewed by Alex Christensen. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesEnabled): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesEnabled): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-10-05 Tim Horton Make progress toward properly-formed XPC services in the Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=177918 Reviewed by Alex Christensen. * CMakeLists.txt: * PlatformMac.cmake: Turn on the storage process on Mac, and fix its build. Move XPC services to Versions/A/XPCServices and add the toplevel XPCServices as a symlink of that. Run the XPC services' Info.plists through configure_file, and substitute the important variables (most critically the bundle identifier). Factor out the service setup so we don't keep duplicating it as it gets more complicated. 2017-10-05 Andy Estes [Payment Request] Add a payment method that supports Apple Pay https://bugs.webkit.org/show_bug.cgi?id=177850 Reviewed by Youenn Fablet. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer. (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber. (WebKit::toPKPaymentSummaryItem): (WebKit::toPKShippingMethod): 2017-10-05 Youenn Fablet Make LibWebRTCProvider port agnostic https://bugs.webkit.org/show_bug.cgi?id=177747 Reviewed by Alex Christensen & Alex Garcia. * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories. 2017-10-04 Alex Christensen Stop linking with WebKitSystemInterface https://bugs.webkit.org/show_bug.cgi?id=177915 Reviewed by Antti Koivisto. * Configurations/DebugRelease.xcconfig: * WebKit.xcodeproj/project.pbxproj: 2017-10-04 Alex Christensen Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms https://bugs.webkit.org/show_bug.cgi?id=177912 Reviewed by Saam Barati. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: * NetworkProcess/mac/NetworkProcessMac.mm: * NetworkProcess/mac/RemoteNetworkingContext.mm: * Platform/IPC/mac/ConnectionMac.mm: * Platform/mac/LayerHostingContext.mm: * PluginProcess/mac/PluginProcessMac.mm: * PluginProcess/mac/PluginProcessShim.mm: * Shared/ios/ChildProcessIOS.mm: * Shared/mac/ChildProcessMac.mm: * Shared/mac/SandboxExtensionMac.mm: * Shared/mac/WebCoreArgumentCodersMac.mm: * Shared/mac/WebEventFactory.mm: * StorageProcess/ios/StorageProcessIOS.mm: * StorageProcess/mac/StorageProcessMac.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: * UIProcess/mac/PageClientImplMac.mm: * UIProcess/mac/WKTextInputWindowController.mm: * UIProcess/mac/WebContextMenuProxyMac.mm: * UIProcess/mac/WebPopupMenuProxyMac.mm: * UIProcess/mac/WindowServerConnection.mm: * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-10-04 Youenn Fablet rtc::PacketOptions should have its own IPC encoding/decoding routines https://bugs.webkit.org/show_bug.cgi?id=177812 Reviewed by Alex Christensen. Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter. Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added. Updating code using rtc::PacketOptions accordingly. * NetworkProcess/webrtc/NetworkRTCSocket.cpp: (WebKit::NetworkRTCSocket::sendTo): * NetworkProcess/webrtc/NetworkRTCSocket.h: * NetworkProcess/webrtc/NetworkRTCSocket.messages.in: * Platform/IPC/Decoder.cpp: (IPC::Decoder::operator>>): (IPC::Decoder::decode): * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.cpp: (IPC::Encoder::encode): * Platform/IPC/Encoder.h: * Shared/RTCPacketOptions.cpp: Added. (WebKit::RTCPacketOptions::encode const): (WebKit::RTCPacketOptions::decode): * Shared/RTCPacketOptions.h: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::SendTo): 2017-10-04 Don Olmstead Include Pasteboard.h for all in WebCoreArgumentCoders https://bugs.webkit.org/show_bug.cgi?id=177902 Reviewed by Alex Christensen. * Shared/WebCoreArgumentCoders.cpp: 2017-10-04 David Kilzer Remove unused variables in lambdas for network process cache Reviewed by Tim Horton. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::reference): - Remove unused |this| from lambda captures. 2017-10-04 Stephan Szabo [WinCairo] add PLATFORM(WIN) configurations to config.h https://bugs.webkit.org/show_bug.cgi?id=177846 Reviewed by Alex Christensen. * config.h: 2017-10-04 Adrian Perez de Castro [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly https://bugs.webkit.org/show_bug.cgi?id=158531 Reviewed by Carlos Alberto Lopez Perez. Do not bypass WebCore event handling when receiving touch events. Based on a patch by Andre Moreira Magalhaes . Thanks to Carlos Garnacho for helping out reviewing the code. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling. * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::reset): Added. (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin. (WebKit::GestureController::Gesture::reset): Added. * UIProcess/gtk/GestureController.h: 2017-10-04 Michael Catanzaro Unreviewed WPE build fix after r222837 https://bugs.webkit.org/show_bug.cgi?id=177449 * Shared/wpe/WebEventFactory.cpp: (WebKit::wallTimeForEventTime): 2017-10-04 Ryosuke Niwa Use blob URL when pasting RTFD instead of overriding DocumentLoader https://bugs.webkit.org/show_bug.cgi?id=177801 Reviewed by Wenson Hsieh. Fixed the assertion failure when RTFD content is empty. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardBufferForType): 2017-10-04 Michael Catanzaro REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps https://bugs.webkit.org/show_bug.cgi?id=177449 Reviewed by Chris Dumez. * Shared/wpe/WebEventFactory.cpp: (WebKit::wallTimeForEventTime): 2017-10-03 Brent Fulgham Correct nullptr dereference during shutdown https://bugs.webkit.org/show_bug.cgi?id=177845 Reviewed by Chris Dumez. It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have already been destroyed, they are in an invalid state when accessed. * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be a reference to completely valid object. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call 'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state. 2017-10-03 Alex Christensen Moderize WebKit's back forward list code https://bugs.webkit.org/show_bug.cgi?id=177843 Reviewed by Tim Horton. Use Ref instead of RefPtr when possible. Use references instead of pointers when possible. Remove unnecessary null checks. Reduce unnecessary Vector copying. * Shared/SessionState.h: * Shared/WebBackForwardListItem.h: * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didChangeBackForwardList): (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::pageClosed): (WebKit::WebBackForwardList::addItem): (WebKit::WebBackForwardList::goToItem): (WebKit::WebBackForwardList::currentItem const): (WebKit::WebBackForwardList::backItem const): (WebKit::WebBackForwardList::forwardItem const): (WebKit::WebBackForwardList::itemAtIndex const): (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const): (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const): (WebKit::WebBackForwardList::removeAllItems): (WebKit::WebBackForwardList::clear): (WebKit::WebBackForwardList::backForwardListState const): (WebKit::WebBackForwardList::restoreFromState): * UIProcess/WebBackForwardList.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcessWithItem): (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::didChangeBackForwardList): (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): (WebKit::WebPageProxy::backForwardGoToItem): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::registerNewWebBackForwardListItem): * UIProcess/WebProcessProxy.h: * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::itemAtIndex): 2017-10-03 Chris Dumez SharedStringHashStore should support removing hashes https://bugs.webkit.org/show_bug.cgi?id=177770 Reviewed by Alex Christensen. SharedStringHashStore should support removing hashes. It currently only supports adding hashes or clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service Worker purposes. * Shared/SharedStringHashStore.cpp: (WebKit::SharedStringHashStore::SharedStringHashStore): (WebKit::SharedStringHashStore::add): (WebKit::SharedStringHashStore::remove): (WebKit::SharedStringHashStore::contains): (WebKit::SharedStringHashStore::clear): (WebKit::SharedStringHashStore::resizeTable): (WebKit::SharedStringHashStore::pendingOperationsTimerFired): * Shared/SharedStringHashStore.h: * Shared/SharedStringHashTable.cpp: (WebKit::SharedStringHashTable::remove): * Shared/SharedStringHashTable.h: * UIProcess/API/Cocoa/_WKVisitedLinkStore.h: * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm: (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]): (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::containsVisitedLinkHash): (WebKit::VisitedLinkStore::removeVisitedLinkHash): (WebKit::VisitedLinkStore::didUpdateSharedStringHashes): * UIProcess/VisitedLinkStore.h: 2017-10-03 Alex Christensen Fix API tests after r222794. https://bugs.webkit.org/show_bug.cgi?id=177825 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willGoToBackForwardListItem): Sometimes there's no navigation client. 2017-10-03 Alex Christensen Add ObjC equivalent of WKPageLoaderClient.pluginDidFail https://bugs.webkit.org/show_bug.cgi?id=177787 Reviewed by Tim Horton. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didFailToInitializePlugin): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::canHandleDidFailToInitializePlugIn const): (API::NavigationClient::didFailToInitializePlugIn): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const): (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailToInitializePlugin): 2017-10-03 Adrian Perez de Castro [GTK] Prefer -webkit-system-font https://bugs.webkit.org/show_bug.cgi?id=177814 Reviewed by Carlos Garcia Campos. Use "font-family: -webkit-system-font" instead of "font: menu". * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet. 2017-10-03 Alex Christensen Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem https://bugs.webkit.org/show_bug.cgi?id=177825 Reviewed by Tim Horton. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::willGoToBackForwardListItem): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::canHandleWillGoToBackForwardListItem const): (API::NavigationClient::willGoToBackForwardListItem): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const): (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willGoToBackForwardListItem): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const): 2017-10-03 Michael Catanzaro REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps https://bugs.webkit.org/show_bug.cgi?id=177449 Reviewed by Chris Dumez. * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): (WebKit::WebEventFactory::createWebTouchEvent): * Shared/wpe/WebEventFactory.cpp: (WebKit::wallTimeForEventTime): (WebKit::WebEventFactory::createWebKeyboardEvent): (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebTouchEvent): 2017-10-03 Carlos Garcia Campos [GTK][WPE] WebProcess should run cleanup on quit to release resources https://bugs.webkit.org/show_bug.cgi?id=168126 Reviewed by Michael Catanzaro. Do not call exit on sync message send failure for GTK and WPE ports. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): 2017-10-02 Ryosuke Niwa Move more code into PasteboardCustomData https://bugs.webkit.org/show_bug.cgi?id=177795 Reviewed by Wenson Hsieh. Added the support for encoding and decoding the origin string in PasteboardCustomData. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-10-02 Adrian Perez de Castro [GTK] Do not hardcode font family in served remote inspector HTML snippets https://bugs.webkit.org/show_bug.cgi?id=177742 Reviewed by Carlos Garcia Campos. Instead of hardcoding Cantarell as the font used for the HTML snippets served by the remote inspector handler, use "font: menu" to obtain the system UI font, plus a "font-size" rule for adjusting the size. * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the CSS rules in the served snippet. 2017-10-02 Joseph Pecoraro Web Inspector: Include Beacon and Ping requests in Network tab https://bugs.webkit.org/show_bug.cgi?id=177641 Reviewed by Chris Dumez. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::didFinish): (WebKit::PingLoad::didReceiveResponseNetworkSession): * NetworkProcess/PingLoad.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didFinishPingLoad): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::didFinishPingLoad): * WebProcess/Network/WebLoaderStrategy.h: Pass an optional ResourceResponse back to the ping completion handler. 2017-10-02 Alex Christensen REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out https://bugs.webkit.org/show_bug.cgi?id=177764 Reviewed by Chris Dumez. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): I shouldn't have reverted the A API telling the listener to continue if there's no client function. 2017-10-02 Carlos Garcia Campos [WPE][GTK] Crash in webkit_web_resource_get_data_finish() https://bugs.webkit.org/show_bug.cgi?id=177107 Reviewed by Michael Catanzaro. Handle errors in webkit_web_resource_get_data() callback. * UIProcess/API/glib/WebKitWebResource.cpp: (resourceDataCallback): (webkit_web_resource_get_data): 2017-10-02 Olivier Blin [WPE] Fix UIProcess build with GStreamer and without VIDEO https://bugs.webkit.org/show_bug.cgi?id=177753 Reviewed by Michael Catanzaro. GStreamer builds fail when WebAudio is enabled but VIDEO disabled. This is the WPE counterpart of bug 153135. * UIProcess/API/wpe/PageClientImpl.h: 2017-10-02 Alex Christensen Expose more WKPreferences SPI to match C SPI https://bugs.webkit.org/show_bug.cgi?id=177697 * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _javaEnabledForLocalFiles]): (-[WKPreferences _setPlugInsEnabled:]): Deleted. (-[WKPreferences _plugInsEnabled]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: _javaEnabledForLocalFiles should return the correct value. _plugInsEnabled has public API. This SPI is not needed. 2017-10-02 Alex Christensen REGRESSION(r214201): WebProcess hangs during policy decisions https://bugs.webkit.org/show_bug.cgi?id=177590 Reviewed by Andy Estes. This is like r222431 but for trunk instead of a branch. It includes the same regression API test so I don't make the same mistake again. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForResponseSync): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::applyToDocumentLoader): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebDocumentLoader.cpp: (WebKit::WebDocumentLoader::setNavigationID): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpPolicyListener): (WebKit::WebFrame::invalidatePolicyListener): (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-10-02 Alex Christensen Remove unnecessary copy of SessionID in WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=177702 Reviewed by Darin Adler. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sessionID const): (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::sessionID const): Deleted. 2017-10-02 Alex Christensen Expose more WKPreferences SPI to match C SPI https://bugs.webkit.org/show_bug.cgi?id=177697 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setJavaEnabledForLocalFiles:]): (-[WKPreferences _javaEnabledForLocalFiles]): (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]): (-[WKPreferences _canvasUsesAcceleratedDrawing]): (-[WKPreferences _setAcceleratedCompositingEnabled:]): (-[WKPreferences _acceleratedCompositingEnabled]): (-[WKPreferences _setDefaultTextEncodingName:]): (-[WKPreferences _defaultTextEncodingName]): (-[WKPreferences _setNeedsSiteSpecificQuirks:]): (-[WKPreferences _needsSiteSpecificQuirks]): (-[WKPreferences _setAuthorAndUserStylesEnabled:]): (-[WKPreferences _authorAndUserStylesEnabled]): (-[WKPreferences _setDOMTimersThrottlingEnabled:]): (-[WKPreferences _domTimersThrottlingEnabled]): (-[WKPreferences _setWebArchiveDebugModeEnabled:]): (-[WKPreferences _webArchiveDebugModeEnabled]): (-[WKPreferences _setLocalFileContentSniffingEnabled:]): (-[WKPreferences _localFileContentSniffingEnabled]): (-[WKPreferences _setUsesPageCache:]): (-[WKPreferences _usesPageCache]): (-[WKPreferences _setPageCacheSupportsPlugins:]): (-[WKPreferences _pageCacheSupportsPlugins]): (-[WKPreferences _setShouldPrintBackgrounds:]): (-[WKPreferences _shouldPrintBackgrounds]): (-[WKPreferences _setWebSecurityEnabled:]): (-[WKPreferences _webSecurityEnabled]): (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]): (-[WKPreferences _universalAccessFromFileURLsAllowed]): (-[WKPreferences _setAVFoundationEnabled:]): (-[WKPreferences _avFoundationEnabled]): (-[WKPreferences _setSuppressesIncrementalRendering:]): (-[WKPreferences _suppressesIncrementalRendering]): (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]): (-[WKPreferences _asynchronousPluginInitializationEnabled]): (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]): (-[WKPreferences _artificialPluginInitializationDelayEnabled]): (-[WKPreferences _setCookieEnabled:]): (-[WKPreferences _cookieEnabled]): (-[WKPreferences _setPlugInSnapshottingEnabled:]): (-[WKPreferences _plugInSnapshottingEnabled]): (-[WKPreferences _setQTKitEnabled:]): (-[WKPreferences _qtKitEnabled]): (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]): (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]): (-[WKPreferences _setMediaSourceEnabled:]): (-[WKPreferences _mediaSourceEnabled]): (-[WKPreferences _setViewGestureDebuggingEnabled:]): (-[WKPreferences _viewGestureDebuggingEnabled]): (-[WKPreferences _setCSSAnimationTriggersEnabled:]): (-[WKPreferences _cssAnimationTriggersEnabled]): (-[WKPreferences _setStandardFontFamily:]): (-[WKPreferences _standardFontFamily]): (-[WKPreferences _setNotificationsEnabled:]): (-[WKPreferences _notificationsEnabled]): (-[WKPreferences _setBackspaceKeyNavigationEnabled:]): (-[WKPreferences _backspaceKeyNavigationEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-10-02 Carlos Garcia Campos [GTK][WPE] Enable interactive forms validation by default https://bugs.webkit.org/show_bug.cgi?id=177737 Reviewed by Michael Catanzaro. It's currently disabled for no reason. * Shared/WebPreferencesDefinitions.h: 2017-10-02 Michael Catanzaro Remove ENABLE_CSS_REGIONS https://bugs.webkit.org/show_bug.cgi?id=177689 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp: (webkit_dom_element_get_webkit_region_overset): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_get_webkit_region_overset): Deleted. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h: 2017-09-30 Darin Adler Have IPC::Connection::Client objects consistently invalidate the connection when destroyed https://bugs.webkit.org/show_bug.cgi?id=177708 Reviewed by Anders Carlsson. I ran into an intermittent crash when running regression tests. It looked like a connection client was being called after it was destroyed. I did an audit of the all the connection clients to make sure they all invalidate their connection before they are destroyed. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the connection since this object opened the connection. There is no obvious guarantee that the connection will already be invalid when this is destroyed. * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto. * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto. * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto. * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto. * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly from IPC::Connection::Client because we can, and this means we don't have to study quite as much code to understand how this is used as a connection client. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto. * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto. * WebProcess/WebPage/WebInspector.h: Ditto. * WebProcess/WebPage/WebInspectorUI.h: Ditto. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a reference cycle cycle leading to a leak that I believe exists here. 2017-09-29 Alex Christensen REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad https://bugs.webkit.org/show_bug.cgi?id=177491 Reviewed by Andy Estes. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpWillSubmitFormListener): (WebKit::WebFrame::continueWillSubmitForm): (WebKit::WebFrame::invalidatePolicyListener): Speculative fix for a flaky assertion. Restore the clearing of the policy listeners we used to have when form submission was treated as a policy. 2017-09-29 Chris Dumez http/tests/preconnect/link-rel-preconnect-https.html is flaky https://bugs.webkit.org/show_bug.cgi?id=177673 Reviewed by Alex Christensen. Update PreconnectTask to query the client when a certificate needs to be validated. This allows WebKitTestRunner to ignore invalid certificates and this causes http/tests/preconnect/link-rel-preconnect-https.html to pass consistently. To avoid duplicating code, PreconnectTask now uses NetworkLoad internally instead of using a NetworkDataTask directly. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::generateCanAuthenticateIdentifier): (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace): (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): (WebKit::NetworkProcess::preconnectTo): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::PreconnectTask): (WebKit::PreconnectTask::~PreconnectTask): (WebKit::PreconnectTask::willSendRedirectedRequest): (WebKit::PreconnectTask::didReceiveResponse): (WebKit::PreconnectTask::didReceiveBuffer): (WebKit::PreconnectTask::didFinishLoading): (WebKit::PreconnectTask::didFailLoading): (WebKit::PreconnectTask::didSendData): (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync): (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace): (WebKit::PreconnectTask::frameID const): (WebKit::PreconnectTask::pageID const): * NetworkProcess/PreconnectTask.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/Network/WebLoaderStrategy.h: 2017-09-29 Alex Christensen Expose WebPreferences::webGLEnabled through WKPreferences https://bugs.webkit.org/show_bug.cgi?id=177692 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setWebGLEnabled:]): (-[WKPreferences _webGLEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-09-29 Chris Dumez [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication https://bugs.webkit.org/show_bug.cgi?id=177667 Reviewed by Alex Christensen. Move some authentication-related code to avoid duplication. This is a preparation code supporting Download authentication as Download uses a NSURLSessionDownloadTask and not a NetworkDataTask. * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::setSuggestedFilename): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost): * NetworkProcess/NetworkSession.h: * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::didReceiveChallenge): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::didReceiveChallenge): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (WebKit::certificatesMatch): (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost): 2017-09-29 Alex Christensen Fix WKWebViewConfigurationPrivate after r222663 https://bugs.webkit.org/show_bug.cgi?id=177644 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-09-29 Chris Dumez Split some logic out of VisitedLinkStore and make it reusable https://bugs.webkit.org/show_bug.cgi?id=177575 Reviewed by Alex Christensen. Split some logic out of VisitedLinkStore and make it reusable for other purposes than visited links and from other processes than the UIProcess. The plan is to reuse the new SharedStringHashStore for Service Worker registration on StorageProcess side and querying on WebContent process side. * CMakeLists.txt: * Shared/SharedStringHashStore.cpp: Added. (WebKit::nextPowerOf2): (WebKit::tableSizeForKeyCount): (WebKit::SharedStringHashStore::SharedStringHashStore): (WebKit::SharedStringHashStore::createSharedMemoryHandle): (WebKit::SharedStringHashStore::add): (WebKit::SharedStringHashStore::clear): (WebKit::SharedStringHashStore::resizeTable): (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired): * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h. (WebKit::SharedStringHashStore::Client::~Client): (WebKit::SharedStringHashStore::isEmpty const): * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp. (WebKit::SharedStringHashTable::SharedStringHashTable): (WebKit::SharedStringHashTable::~SharedStringHashTable): (WebKit::SharedStringHashTable::setSharedMemory): (WebKit::SharedStringHashTable::add): (WebKit::SharedStringHashTable::contains const): (WebKit::SharedStringHashTable::clear): * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h. * UIProcess/API/C/WKContext.cpp: (WKContextAddVisitedLink): * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm: (-[_WKVisitedLinkStore addVisitedLinkWithURL:]): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::VisitedLinkStore): (WebKit::VisitedLinkStore::addProcess): (WebKit::VisitedLinkStore::addVisitedLinkHash): (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage): (WebKit::VisitedLinkStore::sendStoreHandleToProcess): (WebKit::VisitedLinkStore::didInvalidateSharedMemory): (WebKit::VisitedLinkStore::didAddSharedStringHashes): * UIProcess/VisitedLinkStore.h: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::isLinkVisited): (WebKit::VisitedLinkTableController::addVisitedLink): (WebKit::VisitedLinkTableController::visitedLinkStateChanged): * WebProcess/WebPage/VisitedLinkTableController.h: * WebProcess/WebPage/VisitedLinkTableController.messages.in: 2017-09-28 Alex Christensen Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit https://bugs.webkit.org/show_bug.cgi?id=177644 Reviewed by Geoffrey Garen. WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional with no accessor. It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _setCPULimit:]): (-[WKWebViewConfiguration _cpuLimit]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-09-28 Ryosuke Niwa Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items https://bugs.webkit.org/show_bug.cgi?id=170449 Reviewed by Wenson Hsieh. Add sandbox extensions for files in the pasteboard to make copying & pasting image files work. This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently since WebCore will now create File objects for these pasted files. 2017-09-29 Wenson Hsieh [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol https://bugs.webkit.org/show_bug.cgi?id=177662 Reviewed by Tim Horton. Implements -[WKContentView hasText] by propagating a flag through post-layout editor state. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): * Shared/EditorState.h: Add a new flag to EditorState indicating whether or not the current editable root containing the selection has any plain text. Add IPC support for this new flag. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView hasText]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::computeEditableRootHasContentAndPlainText): Add a new helper to compute whether or not the editable root has any content, and any plain text. This is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important things to note here: - If post layout data already indicates that we have selected some plain text, or that there is a plain text character near the selection, just set the flags to true and bail, since the editable root necessarily has content that is plain text. - If hasContent is false, don't even bother computing hasPlainText, because it must also be false. - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText. These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false if we had a range selection rather than a caret selection even when the editable root has content, because the logic to compute the value of hasContent only existed in the branch where we have a caret selection. (WebKit::WebPage::platformEditorState const): 2017-09-28 Timothy Horton Fix the macOS CMake build * CMakeLists.txt: 2017-09-28 Timothy Horton Revise deployment target macros from r222620 Rubber-stamped by Wenson Hsieh. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::pdfDocumentDidLoad): 2017-09-28 Aishwarya Nirmal Request for PDF URL targets for specific pages, sections, etc. https://bugs.webkit.org/show_bug.cgi?id=177582 Reviewed by Tim Horton. This change sets the URL fragment for scroll anchoring in PDFs. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::pdfDocumentDidLoad): 2017-09-28 Ross Kirsling [PAL] Move HysteresisActivity into PAL https://bugs.webkit.org/show_bug.cgi?id=177516 Reviewed by Alex Christensen. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad): * Shared/WebSQLiteDatabaseTracker.cpp: (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker): (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated): * Shared/WebSQLiteDatabaseTracker.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_pageScrolledHysteresis): (WebKit::m_userActivityHysteresis): (WebKit::WebPage::updateUserActivity): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: 2017-09-28 Chris Dumez Add support for https://bugs.webkit.org/show_bug.cgi?id=177474 Reviewed by Alex Christensen. Add support for : - https://w3c.github.io/resource-hints/#preconnect Also add corresponding native private API. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::preconnectTo): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/PreconnectTask.cpp: Added. (WebKit::PreconnectTask::PreconnectTask): (WebKit::PreconnectTask::~PreconnectTask): (WebKit::PreconnectTask::willPerformHTTPRedirection): (WebKit::PreconnectTask::didReceiveChallenge): (WebKit::PreconnectTask::didReceiveResponseNetworkSession): (WebKit::PreconnectTask::didReceiveData): (WebKit::PreconnectTask::didCompleteWithError): (WebKit::PreconnectTask::didSendData): (WebKit::PreconnectTask::wasBlocked): (WebKit::PreconnectTask::cannotShowURL): (WebKit::PreconnectTask::didFinish): * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): * Shared/WebCoreArgumentCoders.h: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKContext.cpp: (WKContextPreconnectToServer): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _preconnectToServer:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::preconnectToServer): * UIProcess/WebProcessPool.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didFinishPreconnection): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::generateLoadIdentifier): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::preconnectTo): (WebKit::WebLoaderStrategy::didFinishPreconnection): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * config.h: 2017-09-28 Zan Dobersek [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer https://bugs.webkit.org/show_bug.cgi?id=177598 Reviewed by Carlos Garcia Campos. * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the header here now that it's not included in GlyphBuffer.h. * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto. 2017-09-27 Alex Christensen Add WKContentRuleList notify action type https://bugs.webkit.org/show_bug.cgi?id=177013 Reviewed by Darin Adler. * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::processContentExtensionRulesForLoad): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::contentRuleListNotification): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::contentRuleListNotification): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contentRuleListNotification): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentRuleListNotification): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-09-27 Wenson Hsieh Drag event DataTransfer has unexpected types "dyn.ah62d4..." https://bugs.webkit.org/show_bug.cgi?id=172526 Reviewed by Ryosuke Niwa. Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for more details. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Add encoder/decoder support for PasteboardCustomData. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Encode and decode dataInHTMLFormat. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): (WebKit::WebPasteboardProxy::writeCustomData): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): (WebKit::WebPasteboardProxy::writeCustomData): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite): (WebKit::WebPlatformStrategies::writeCustomData): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-09-27 Alex Christensen Allow modern decoding of std::optional https://bugs.webkit.org/show_bug.cgi?id=177519 Reviewed by Tim Horton. * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder>::decode): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): 2017-09-27 Commit Queue Unreviewed, rolling out r222541. https://bugs.webkit.org/show_bug.cgi?id=177580 WebCore isn't ready for the asynchronousness this was going to enable (Requested by alexchristensen on #webkit). Reverted changeset: "Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions" https://bugs.webkit.org/show_bug.cgi?id=177509 http://trac.webkit.org/changeset/222541 2017-09-27 Tina Liu Expose setShouldSuppressFirstResponderChanges() as WKView SPI https://bugs.webkit.org/show_bug.cgi?id=177513 Reviewed by Wenson Hsieh. We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on WKView as well for clients using legacy WebKit. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _setShouldSuppressFirstResponderChanges:]): 2017-09-27 Chris Dumez Have PingLoad take a CompletionHandler https://bugs.webkit.org/show_bug.cgi?id=177549 Reviewed by Youenn Fablet. Have PingLoad take a CompletionHandler instead of relying on it calling on method on the NetworkConnectionToWebProcess when it is done. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::didFinish): * NetworkProcess/PingLoad.h: 2017-09-26 Alex Christensen Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions https://bugs.webkit.org/show_bug.cgi?id=177509 Reviewed by Tim Horton. This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs. This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous. This patch has no change in behavior. * CMakeLists.txt: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::decidePolicyForNavigationAction): (API::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/API/APIPolicyClient.h: (API::PolicyClient::decidePolicyForNavigationAction): (API::PolicyClient::decidePolicyForNewWindowAction): (API::PolicyClient::decidePolicyForResponse): * UIProcess/API/C/WKFramePolicyListener.cpp: (WKFramePolicyListenerUseWithPolicies): * UIProcess/API/C/WKPage.cpp: (WKPageSetPagePolicyClient): (WKPageSetPageNavigationClient): * UIProcess/API/Cocoa/WKBrowsingContextController.mm: * UIProcess/API/glib/WebKitPolicyClient.cpp: * UIProcess/Automation/WebAutomationSession.cpp: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/RemoteWebInspectorProxy.cpp: * UIProcess/WebFormSubmissionListenerProxy.h: * UIProcess/WebFrameListenerProxy.cpp: Removed. * UIProcess/WebFrameListenerProxy.h: Removed. * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy): (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy): (WebKit::WebFramePolicyListenerProxy::create): (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * UIProcess/WebFramePolicyListenerProxy.h: (WebKit::WebFramePolicyListenerProxy::create): Deleted. (): Deleted. (WebKit::WebFramePolicyListenerProxy::operator new): Deleted. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::webProcessWillShutDown): (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted. (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted. * UIProcess/WebFrameProxy.h: * UIProcess/WebInspectorProxy.cpp: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponseSync): (WebKit::WebPageProxy::receivedPolicyDecision): Deleted. (WebKit::WebPageProxy::decidePolicyForResponse): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/mac/ViewGestureControllerMac.mm: * WebKit.xcodeproj/project.pbxproj: 2017-09-26 Brian Burg Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible https://bugs.webkit.org/show_bug.cgi?id=177514 Reviewed by Joseph Pecoraro. * UIProcess/Automation/atoms/ElementDisplayed.js: (isShown.isElementSubtreeHiddenByOverflow): Array.prototype.every returns true when passed an empty list, so we need to check for the case where the element has no children and return 'false'. 2017-09-26 Youenn Fablet [Cocoa] Add a modern WKPreferences switch to disable WebRTC https://bugs.webkit.org/show_bug.cgi?id=176638 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _peerConnectionEnabled]): (-[WKPreferences _setPeerConnectionEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-09-26 Brent Fulgham Harden our access to the vector of URL schemes. https://bugs.webkit.org/show_bug.cgi?id=177470 Reviewed by Chris Dumez. Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::stopURLSchemeTask): 2017-09-26 Jer Noble Thrown ObjC exception when right clicking on containing mp4 link https://bugs.webkit.org/show_bug.cgi?id=177370 Reviewed by Darin Adler. Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting to put the results into a NSMutableArray. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::createShareMenuItem): 2017-09-26 Brian Burg Web Automation: add commands to get and set user permissions for pages in an automation session https://bugs.webkit.org/show_bug.cgi?id=177405 Reviewed by Joseph Pecoraro. To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or denying requests for elevated permissions, such as getUserMedia() or geolocation. This patch adds a generic way for a test to configure the automation session's simulated user action that will happen every time a specific permission is requested. A test can set a "session permission", trigger the permission request via Web API, and then verify that the page behaves correctly when the user accepted or denied the request. A proposal will follow shortly to expose this functionality via a new REST API endpoint. * UIProcess/Automation/Automation.json: Add get/set commands. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::getSessionPermissions): (WebKit::WebAutomationSession::setSessionPermissions): For now, store the permission value in a member of the session. The getUserMedia permission only needs a bool, but there is no reason we couldn't use more complicated values for permissions (i.e., strings, numbers, arrays, objects) someday. (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const): Expose the specific decision to be taken based on whether the request is allowed or denied. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): If the page is under automation, then simulate the user action according to the current values of permissions set for the session. 2017-09-25 Alex Christensen Make PolicyAction an encodable enum class https://bugs.webkit.org/show_bug.cgi?id=177480 Reviewed by Antti Koivisto. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueDecidePendingDownloadDestination): (WebKit::DownloadManager::cancelDownload): * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession): * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): (WebKit::NetworkLoad::continueDidReceiveResponse): (WebKit::NetworkLoad::notifyDidReceiveResponse): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveResponseNetworkSession): * NetworkProcess/capture/NetworkDataTaskReplay.cpp: (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): * Scripts/webkit/messages.py: (headers_for_type): * UIProcess/WebFormSubmissionListenerProxy.h: * UIProcess/WebFrameListenerProxy.h: (WebKit::WebFrameListenerProxy::navigation): Deleted. * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::invalidatePolicyListener): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-25 Yoshiaki Jitsukawa [WinCairo] Share default value of font family preferences among non-cocoa builds https://bugs.webkit.org/show_bug.cgi?id=177479 Reviewed by Yusuke Suzuki. * Shared/WebPreferencesDefinitions.h: 2017-09-25 Frederik Riedel Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI https://bugs.webkit.org/show_bug.cgi?id=174394 Reviewed by Ryosuke Niwa. * Platform/spi/ios/UIKitSPI.h: * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode const): Encodes additional node information, including if the node is part of a login screen. (WebKit::AssistedNodeInformation::decode): Decodes the additional assisted node information. * Shared/AssistedNodeInformation.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView acceptsAutofilledLoginCredentials]): Determines if the WKContentView shows a login screen. (-[WKContentView representingPageUrl]): Returns the URL of the currently displayed web page. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertTextSuggestion:]): Inserts the login credentials into the Web View. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAssistingNode): Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl). (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Returns if the Web View shows a login screen. (WebKit::WebPageProxy::representingPageUrl): Returns the Web View's URL. (WebKit::WebPageProxy::autofillLoginCredentials): Insert the credentials into the Web View. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently highlighted node accepts autofilled login credentials. (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the WebPage. 2017-09-25 Youenn Fablet WebRTC video does not resume receiving when switching back to Safari 11 on iOS https://bugs.webkit.org/show_bug.cgi?id=175472 Reviewed by Darin Adler. Notifying LibWebRTC of backgrounding/foregrouding. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationDidEnterBackground): (WebKit::WebPage::applicationWillEnterForeground): 2017-09-25 Sam Weinig Remove unused EditorClient functions https://bugs.webkit.org/show_bug.cgi?id=177463 Reviewed by Alex Christensen. Remove unused EditorClient functions. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::canonicalizeURL): Deleted. (WebKit::WebEditorClient::canonicalizeURLString): Deleted. (WebKit::WebEditorClient::writeDataToPasteboard): Deleted. (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted. (WebKit::WebEditorClient::readDataFromPasteboard): Deleted. (WebKit::WebEditorClient::pasteboardChangeCount): Deleted. * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: (WebKit::WebEditorClient::canonicalizeURL): Deleted. (WebKit::WebEditorClient::canonicalizeURLString): Deleted. 2017-09-25 Alex Christensen Make Attribute an enum class https://bugs.webkit.org/show_bug.cgi?id=177414 Reviewed by Yusuke Suzuki. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::getOwnPropertySlot): 2017-09-25 Alex Christensen Stop using PolicyCallback https://bugs.webkit.org/show_bug.cgi?id=176088 Reviewed by Andy Estes. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::invalidatePolicyListener): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebInspector.cpp: 2017-09-25 Chris Dumez [WK2] Add API to query if a download was user-initiated https://bugs.webkit.org/show_bug.cgi?id=177435 Reviewed by Alex Christensen. Add C and Cocoa private API to query if a download was user-initiated. For clarity, we now construct navigation object for subframe loads as well (we used to do so only for main frame loads). This allows us to store the user-intiated flag and the redirect chain on the navigation object instead of the WebFrameProxy. * UIProcess/API/APINavigation.cpp: (API::Navigation::Navigation): (API::Navigation::appendRedirectionURL): * UIProcess/API/APINavigation.h: (API::Navigation::takeRedirectChain): (API::Navigation::setWasUserInitiated): (API::Navigation::wasUserInitiated const): * UIProcess/API/C/WKDownload.cpp: (WKDownloadGetWasUserInitiated): * UIProcess/API/C/WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload wasUserInitiated]): * UIProcess/Downloads/DownloadProxy.h: (WebKit::DownloadProxy::setWasUserInitiated): (WebKit::DownloadProxy::wasUserInitiated const): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameProxy::didFailProvisionalLoad): (WebKit::WebFrameProxy::didFinishLoad): (WebKit::WebFrameProxy::didFailLoad): * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::title const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForResponse): (WebKit::WebPageProxy::decidePolicyForResponseSync): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): 2017-09-25 Chris Dumez Make StoredCredentials an enum class and rename its header https://bugs.webkit.org/show_bug.cgi?id=177455 Reviewed by Youenn Fablet. Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the opposite behavior. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didCompleteWithError): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): (WebKit::NetworkDataTask::NetworkDataTask): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::shouldUseCredentialStorage): * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::makeCrossOriginAccessRequest): (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest): (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight): (WebKit::PingLoad::preflightSuccess): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): * NetworkProcess/capture/NetworkDataTaskReplay.cpp: (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate existingTask:]): (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::createRequest): (WebKit::NetworkDataTaskSoup::authenticate): (WebKit::NetworkDataTaskSoup::continueAuthenticate): (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): * NetworkProcess/soup/NetworkDataTaskSoup.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): * WebProcess/Network/WebLoaderStrategy.h: 2017-09-25 Sam Weinig Remove unnecessary userVisibleString EditorClient function https://bugs.webkit.org/show_bug.cgi?id=177456 Reviewed by Dan Bernstein. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::userVisibleString): Deleted. * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: (WebKit::WebEditorClient::userVisibleString): Deleted. Remove userVisibleString client function. 2017-09-25 Commit Queue Unreviewed, rolling out r222455. https://bugs.webkit.org/show_bug.cgi?id=177460 broke iOS build (Requested by alexchristensen on #webkit). Reverted changeset: "Add WKContentRuleList notify action type" https://bugs.webkit.org/show_bug.cgi?id=177013 http://trac.webkit.org/changeset/222455 2017-09-25 Alex Christensen Separate form submission from PolicyChecker infrastructure https://bugs.webkit.org/show_bug.cgi?id=177396 Reviewed by Geoffrey Garen. * UIProcess/API/APIFormClient.h: (API::FormClient::willSubmitForm): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): * UIProcess/WebFormClient.cpp: (WebKit::WebFormClient::willSubmitForm): * UIProcess/WebFormClient.h: * UIProcess/WebFormSubmissionListenerProxy.cpp: (WebKit::WebFormSubmissionListenerProxy::continueSubmission): (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): Deleted. * UIProcess/WebFormSubmissionListenerProxy.h: (WebKit::WebFormSubmissionListenerProxy::create): (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): (): Deleted. (WebKit::WebFormSubmissionListenerProxy::operator new): Deleted. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy): Deleted. * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willSubmitForm): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpWillSubmitFormListener): (WebKit::WebFrame::continueWillSubmitForm): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::continueWillSubmitForm): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-25 Alex Christensen Add WKContentRuleList notify action type https://bugs.webkit.org/show_bug.cgi?id=177013 Reviewed by Darin Adler. * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::processContentExtensionRulesForLoad): * UIProcess/API/APINavigationClient.h: (API::NavigationClient::contentRuleListNotification): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::contentRuleListNotification): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contentRuleListNotification): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentRuleListNotification): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-09-25 Timothy Horton Make progress on getting Mac CMake building again https://bugs.webkit.org/show_bug.cgi?id=177443 Unreviewed, just "fixing" the build. * PlatformMac.cmake: Add some missing files and include paths. 2017-09-24 Michael Catanzaro Viewport fit is no longer experimental https://bugs.webkit.org/show_bug.cgi?id=177417 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: 2017-09-24 Michael Catanzaro [GTK] Unreviewed, move webkit_hit_test_result_context_is_scrollbar in documentation * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 2017-09-24 Michael Catanzaro Alphabetize experimental features list https://bugs.webkit.org/show_bug.cgi?id=177374 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: 2017-09-24 Zan Dobersek [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore https://bugs.webkit.org/show_bug.cgi?id=177312 Reviewed by Carlos Garcia Campos. When enabling EME through the InjectedBundle for testing purposes, it's only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore. This causes failures on imported W3C tests that cover EME persistent state licenses and perform parts of that test in a new window, where the original RuntimeEnabledFeatures state doesn't have any effect. To avoid those failures, when enabling EME feature for testing purposes through InjectedBundle, the feature should also be enabled in the WebPreferencesStore. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-09-22 Zalan Bujtas WeakPtrFactory should populate m_ref lazily. https://bugs.webkit.org/show_bug.cgi?id=177375 Reviewed by Geoffrey Garen. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker): * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::createWeakPtr): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::ProcessLauncher): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::createWeakPtr): * UIProcess/WebPageProxy.cpp: (WebKit::m_configurationPreferenceValues): (WebKit::m_weakPtrFactory): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::createWeakPtr const): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): 2017-09-22 John Wilander Re-enable configuration.HTTPCookieStorage on session without credentials https://bugs.webkit.org/show_bug.cgi?id=177393 This patch rolls back the crucial change to the network session without credentials that landed in r221632: Reviewed by Brent Fulgham. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Commented out the disabled cookie jar and added a FIXME referring to https://bugs.webkit.org/show_bug.cgi?id=177394. 2017-09-22 Chris Dumez Enable File and Directory Entries API at runtime https://bugs.webkit.org/show_bug.cgi?id=176616 Reviewed by Geoffrey Garen. Enable File and Directory Entries API at runtime on Mac/WebKit2, now that DataTransfer.items is enabled there. * Shared/WebPreferencesDefinitions.h: 2017-09-22 Matt Lewis Unreviewed, rolling out r222394. This broke the Windows Debug Build. Reverted changeset: "Remove build-webkit's notion of feature flags having a default value" https://bugs.webkit.org/show_bug.cgi?id=177338 http://trac.webkit.org/changeset/222394 2017-09-22 John Wilander Non-prevalent resources should be allowed access to existing cookies in a third-party context https://bugs.webkit.org/show_bug.cgi?id=177336 Reviewed by Brent Fulgham. This patch restructures what is communicated to the network process, from two vectors - with user interaction and without user interaction - to three vectors - to partition, to block, to neither partition nor block. The previous two vectors did not allow proper categorization into which domains should be partitioned, blocked, or left alone. That was the cause of the regression where non-prevalent third-party domains erroneously had their cookies blocked when they should fall back to the old behavior of access but no new cookies allowed to be set. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies): (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const): (WebKit::WebResourceLoadStatisticsStore::shouldBlockCookies const): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains): (WebKit::WebResourceLoadStatisticsStore::resetCookiePartitioningState): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-09-22 Tim Horton and Michael Catanzaro Remove build-webkit's notion of feature flags having a default value https://bugs.webkit.org/show_bug.cgi?id=177338 Reviewed by Alex Christensen. Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime experimental features. * Shared/WebPreferencesDefinitions.h: 2017-09-22 Chris Dumez Use high resolution timestamp for event time https://bugs.webkit.org/show_bug.cgi?id=154246 Reviewed by Ryosuke Niwa. Use WallTime / MonotonicTime instead of double type for clarity. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebEvent.cpp: (WebKit::WebEvent::WebEvent): * Shared/WebEvent.h: (WebKit::WebEvent::timestamp const): (WebKit::WebTouchEvent::WebTouchEvent): * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::WebMouseEvent): * Shared/WebTouchEvent.cpp: (WebKit::WebTouchEvent::WebTouchEvent): * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): (WebKit::WebEventFactory::createWebTouchEvent): * Shared/ios/NativeWebTouchEventIOS.mm: (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::createWebKeyboardEvent): * Shared/mac/NativeWebGestureEventMac.mm: (WebKit::NativeWebGestureEvent::NativeWebGestureEvent): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): * Shared/mac/WebGestureEvent.h: (WebKit::WebGestureEvent::WebGestureEvent): * Shared/wpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebTouchEvent): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSimulateMouseDown): (WKBundlePageSimulateMouseUp): (WKBundlePageSimulateMouseMotion): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::showContextMenuAtPoint): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::WebPage::dragEnded): (WebKit::WebPage::simulateMouseDown): (WebKit::WebPage::simulateMouseUp): (WebKit::WebPage::simulateMouseMotion): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completeSyntheticClick): (WebKit::WebPage::requestAdditionalItemsForDragSession): (WebKit::WebPage::inspectorNodeSearchMovedToPosition): 2017-09-22 Fujii Hironori [GTK] Web Inspector: Can't load three.js https://bugs.webkit.org/show_bug.cgi?id=177340 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: Add JS files of three.js to InspectorFiles variable. * PlatformWPE.cmake: Ditto. 2017-09-21 Ryosuke Niwa Enable dataTransfer.items on macOS and iOS https://bugs.webkit.org/show_bug.cgi?id=177335 Reviewed by Sam Weinig. * Shared/WebPreferencesDefinitions.h: 2017-09-21 Dan Bernstein Try to fix Apple internal builds with the iOS 11.0 SDK. * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 11.0. 2017-09-21 Chris Dumez Regression(r222308): new API tests are failing for !NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=177321 Reviewed by Alex Christensen. When a load is redirected and then converted into a download, CFNetwork seems to call [NSURLDownloadDelegate willSendRequest:] on the download with a non-nil redirectResponse, which was unexpected. To address the issue, we now ignore the willSendRequest call if the new request's URL is the same as the redirectResponse one. * NetworkProcess/Downloads/mac/DownloadMac.mm: (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]): 2017-09-21 Chris Dumez Unreviewed, drop assertion added in r222308. The assertion is hit by a couple of tests still but there is no bad effect to the vector not being empty at this point since we clear it right after. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): 2017-09-21 Chris Dumez [WK2] Add API to get the redirect chain of a WKDownload https://bugs.webkit.org/show_bug.cgi?id=176628 Reviewed by Alex Christensen. Re-enable assertion initially added in r222308 and later disabled in r222320. The assertion was hit because we failed to clear the redirect chain in WebFrameProxy::didFailProvisionalLoad(). * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didFailProvisionalLoad): 2017-09-21 Alex Christensen REGRESSION(r221465) WKWebViews without WebGL delegate callbacks crash when WebGL contexts are created https://bugs.webkit.org/show_bug.cgi?id=177306 Reviewed by Chris Dumez. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const): (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const): I forgot to early return after calling the default completion handler if there's no delegate selector. 2017-09-21 Chris Dumez Unreviewed, temporarily disable assertion added in r222308 while I investigate. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): 2017-09-20 Stephan Szabo [Win] WTF: Add alias for process id to use in place of direct uses of pid_t https://bugs.webkit.org/show_bug.cgi?id=177017 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcessCreationParameters.h: * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContext.cpp: (WKContextGetNetworkProcessIdentifier): (WKContextGetDatabaseProcessIdentifier): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/C/WKPage.cpp: (WKPageGetProcessIdentifier): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::processIdentifier const): * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::didFinishLaunchingProcess): * UIProcess/Launcher/ProcessLauncher.h: (WebKit::ProcessLauncher::processIdentifier const): * UIProcess/ProcessAssertion.cpp: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::ProcessAssertion): * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::didConnectToProcess): * UIProcess/ProcessThrottler.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processIdentifier const): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::networkProcessIdentifier): (WebKit::WebProcessPool::storageProcessIdentifier): * UIProcess/WebProcessPool.h: 2017-09-20 Chris Dumez [WK2] Add API to get the redirect chain of a WKDownload https://bugs.webkit.org/show_bug.cgi?id=176628 Reviewed by Alex Christensen. Add API to get the redirect chain of a WKDwnload. The redirect chain includes redirects that happened during initial load, before the load was converted into a download. * UIProcess/API/C/WKDownload.cpp: (WKDownloadCopyRedirectChain): * UIProcess/API/C/WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload originatingWebView]): (-[_WKDownload redirectChain]): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::willSendRequest): * UIProcess/Downloads/DownloadProxy.h: (WebKit::DownloadProxy::setRedirectChain): (WebKit::DownloadProxy::redirectChain const): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::redirectChain const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): 2017-09-20 Alex Christensen Add infrastructure for adding custom headers to requests per website https://bugs.webkit.org/show_bug.cgi?id=177255 Reviewed by Geoffrey Garen. * Shared/WebsitePolicies.cpp: Added. * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::encode const): (WebKit::WebsitePolicies::decode): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesCopyCustomHeaderFields): (WKWebsitePoliciesSetCustomHeaderFields): * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies customHeaderFields]): (-[_WKWebsitePolicies setCustomHeaderFields:]): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2017-09-20 Michael Catanzaro REGRESSION(r222194) [WPE] Library and executable output names broken https://bugs.webkit.org/show_bug.cgi?id=177273 Reviewed by Carlos Alberto Lopez Perez. Move the WebKit2 output name variables to here from Source/cmake, since this is a better place and where they are set on all other ports. Update them for the changes in r222194. * PlatformWPE.cmake: 2017-09-20 Jonathan Bedard Removed nullable from UIDragItem property https://bugs.webkit.org/show_bug.cgi?id=176264 Unreviewed build fix When a nullable annotation is used in a header file, the Objective-C compiler forces annotations on the entire file. Remove an unneeded annotation in UIKitSPI.h so that we can build in iOS 11. * Platform/spi/ios/UIKitSPI.h: 2017-09-20 Antti Koivisto Remove DOM and styling support for CSS Regions https://bugs.webkit.org/show_bug.cgi?id=177221 Reviewed by Andreas Kling. * Configurations/FeatureDefines.xcconfig: 2017-09-19 Simon Fraser Do more math in terms of FloatSizes and FloatPoints https://bugs.webkit.org/show_bug.cgi?id=177217 Reviewed by Zalan Bujtas. Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&), FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&) and use them in lots of places to do math in terms of points and sizes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): * UIProcess/ios/DragDropInteractionState.mm: (WebKit::createTargetedDragPreview): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/WebPage.cpp: (WebKit::paintSnapshotAtSize): (WebKit::WebPage::snapshotNode): 2017-09-19 Simon Fraser tiled-drawing/tiled-backing-in-window.html fails on Retina displays https://bugs.webkit.org/show_bug.cgi?id=177113 Reviewed by Tim Horton. Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset" behavior. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::deviceScaleFactor const): (WebKit::WebPageProxy::setCustomDeviceScaleFactor): * UIProcess/WebPageProxy.h: 2017-09-19 Alex Christensen Allow modern decoding of Vectors https://bugs.webkit.org/show_bug.cgi?id=177102 Reviewed by Andy Estes. Rather than allow modern decoding of Vectors of types that only allow legacy decoding, I just made modern decoders for all types that we need to decode in Vectors. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * Platform/IPC/ArgumentCoders.h: * Shared/AssistedNodeInformation.cpp: (WebKit::OptionItem::decode): * Shared/AssistedNodeInformation.h: * Shared/CallbackID.h: (WebKit::CallbackID::decode): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): * Shared/Databases/IndexedDB/WebIDBResult.cpp: (WebKit::WebIDBResult::decode): * Shared/FrameInfoData.cpp: (WebKit::FrameInfoData::decode): * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::decode): * Shared/Gamepad/GamepadData.h: * Shared/PlatformPopupMenuData.cpp: (WebKit::PlatformPopupMenuData::decode): * Shared/PlatformPopupMenuData.h: * Shared/Plugins/NPIdentifierData.cpp: (WebKit::NPIdentifierData::decode): * Shared/Plugins/NPIdentifierData.h: * Shared/Plugins/NPVariantData.cpp: (WebKit::NPVariantData::decode): * Shared/Plugins/NPVariantData.h: * Shared/RTCNetwork.cpp: (WebKit::RTCNetwork::IPAddress::decode): (WebKit::RTCNetwork::SocketAddress::decode): (WebKit::RTCNetwork::decode): * Shared/RTCNetwork.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode): (WebKit::RemoteLayerTreeTransaction::decode): * Shared/SessionState.cpp: (WebKit::HTTPBody::Element::decode): (WebKit::FrameState::decode): (WebKit::PageState::decode): (WebKit::BackForwardListItemState::decode): (WebKit::BackForwardListState::decode): * Shared/SessionState.h: * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::decode): * Shared/WebCompiledContentRuleListData.h: * Shared/WebContextMenuItemData.cpp: (WebKit::WebContextMenuItemData::decode): * Shared/WebContextMenuItemData.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder>::decode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebEvent.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): * Shared/WebPlatformTouchPoint.cpp: (WebKit::WebPlatformTouchPoint::decode): * Shared/WebPopupItem.cpp: (WebKit::WebPopupItem::decode): * Shared/WebPopupItem.h: * Shared/WebUserContentControllerDataTypes.cpp: (WebKit::WebUserScriptData::decode): (WebKit::WebUserStyleSheetData::decode): (WebKit::WebScriptMessageHandlerData::decode): * Shared/WebUserContentControllerDataTypes.h: * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::Entry::decode): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::decode): * Shared/ios/WebPlatformTouchPointIOS.cpp: (WebKit::WebPlatformTouchPoint::decode): * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::decode): * UIProcess/LegacySessionStateCodingNone.cpp: (WebKit::decodeLegacySessionState): * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode): (WebKit::PlatformCAAnimationRemote::Properties::decode): 2017-09-19 Ryosuke Niwa On iOS, getData can't get text set by setData during copy event https://bugs.webkit.org/show_bug.cgi?id=176980 Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::copy): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-09-19 Alex Christensen Expose WKPageRef as a private property on WKWebView on Mac https://bugs.webkit.org/show_bug.cgi?id=177022 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pageRefForTransitionToWKWebView]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-09-19 Alex Christensen Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS https://bugs.webkit.org/show_bug.cgi?id=177124 Reviewed by Andy Estes. The boolean added in r213747 was getting lost in two places: 1. The API::ProcessPoolConfiguration gets copied before it's used, so we need to set the bool on the copy. 2. The bool was not getting copied from that ProcessPoolConfiguration to the NetworkProcessCreationParameters to be sent to the NetworkProcess to be given to the NSURLSessionConfiguration in NetworkSessionCocoa.mm. These two problems were fixed and verified manually with a customized iOS app on my phone. Unfortunately, this cannot be tested well with our current test infrastructure. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2017-09-18 Michael Catanzaro [CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit https://bugs.webkit.org/show_bug.cgi?id=174558 Reviewed by Alex Christensen. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * PlatformWin.cmake: * Shared/gtk/WebKitWaylandProtocol.xml: Renamed from Source/WebKit/Shared/gtk/WebKit2WaylandProtocol.xml. * UIProcess/gtk/WaylandCompositor.cpp: * WebProcess/gtk/WaylandCompositorDisplay.cpp: 2017-09-18 Andy Estes [Cocoa] Upstream sandbox-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=177047 Reviewed by Daniel Bates. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): * Platform/spi/mac/QuarantineSPI.h: Added. * Shared/SandboxExtension.h: (): Deleted. * Shared/mac/ChildProcessMac.mm: (WebKit::enableSandboxStyleFileQuarantine): (WebKit::ChildProcess::initializeSandbox): * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtensionImpl::create): (WebKit::SandboxExtensionImpl::SandboxExtensionImpl): (WebKit::SandboxExtensionImpl::~SandboxExtensionImpl): (WebKit::SandboxExtensionImpl::consume): (WebKit::SandboxExtensionImpl::invalidate): (WebKit::SandboxExtensionImpl::getSerializedFormat): (WebKit::SandboxExtension::Handle::Handle): (WebKit::SandboxExtension::Handle::~Handle): (WebKit::SandboxExtension::Handle::encode const): (WebKit::SandboxExtension::Handle::decode): (WebKit::SandboxExtension::createHandleWithoutResolvingPath): (WebKit::SandboxExtension::createHandleForReadWriteDirectory): (WebKit::SandboxExtension::createHandleForTemporaryFile): (WebKit::SandboxExtension::createHandleForGenericExtension): (WebKit::SandboxExtension::SandboxExtension): (WebKit::SandboxExtension::~SandboxExtension): (WebKit::SandboxExtension::revoke): (WebKit::SandboxExtension::consume): (WebKit::SandboxExtension::consumePermanently): (WebKit::wkSandboxExtensionType): Deleted. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::didChooseFilesForOpenPanel): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::processDidFinishLaunching): (WebKit::WebProcessPool::resumeDownload): (WebKit::WebProcessPool::startMemorySampler): * WebKit.xcodeproj/project.pbxproj: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): 2017-09-18 Andy Estes [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface https://bugs.webkit.org/show_bug.cgi?id=177048 Reviewed by Alex Christensen. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendMessage): (IPC::readFromMachPort): * Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm. * Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm. (WebKit::setCrashReportApplicationSpecificInformation): * Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm. * Shared/Cocoa/ChildProcessCocoa.mm: (WebKit::ChildProcess::didReceiveInvalidMessage): * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::_WKSetCrashReportApplicationSpecificInformation): 2017-09-18 Andy Estes [Mac] Upstream miscellaneous WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=177029 Reviewed by Alex Christensen. * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::initializeProcessName): * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeProcessName): * StorageProcess/mac/StorageProcessMac.mm: (WebKit::StorageProcess::initializeProcessName): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::trackingAreaOptions): (WebKit::WebViewImpl::mightBeginScrollWhileInactive): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::NetscapePlugin::popUpContextMenu): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::handleContextMenuEvent): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeProcessName): (WebKit::WebProcess::updateActivePages): 2017-09-17 Michael Catanzaro [WPE][GTK] Merge ProcessLauncher[WPE,GTK] https://bugs.webkit.org/show_bug.cgi?id=177041 Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond to review comments. Not sure why this didn't blow up everything during testing. * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::ProcessLauncher::launchProcess): 2017-09-17 Michael Catanzaro [WPE][GTK] Merge ProcessLauncher[WPE,GTK] https://bugs.webkit.org/show_bug.cgi?id=177041 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: * PlatformWPE.cmake: * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Renamed from Source/WebKit/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp. (WebKit::childSetupFunction): (WebKit::ProcessLauncher::launchProcess): (WebKit::ProcessLauncher::terminateProcess): (WebKit::ProcessLauncher::platformInvalidate): * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Removed. 2017-09-16 Tim Horton Fix the Tools build with CMake on macOS https://bugs.webkit.org/show_bug.cgi?id=177030 Reviewed by Geoffrey Garen. * PlatformMac.cmake: Add some WebKitLegacy headers to forward (for use by the tools). 2017-09-15 JF Bastien WTF: use Forward.h when appropriate instead of Vector.h https://bugs.webkit.org/show_bug.cgi?id=176984 Reviewed by Saam Barati. There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice. * Scripts/webkit/LegacyMessages-expected.h: * Scripts/webkit/Messages-expected.h: * Shared/API/APIData.h: * UIProcess/API/APIContextMenuClient.h: * UIProcess/API/APIFormClient.h: * UIProcess/API/APIHTTPCookieStore.h: * UIProcess/API/APINotificationProvider.h: * UIProcess/API/glib/WebKitNotificationProvider.h: * UIProcess/Notifications/WebNotificationProvider.h: * UIProcess/TextCheckerCompletion.h: * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebOpenPanelResultListenerProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPopupMenuProxy.h: * UIProcess/WebTextCheckerClient.h: * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Gamepad/WebGamepadProvider.h: * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/Network/webrtc/WebRTCResolver.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/WebOpenPanelResultListener.h: 2017-09-15 Tim Horton Fix the macOS CMake build https://bugs.webkit.org/show_bug.cgi?id=177015 Reviewed by Andy Estes. * CMakeLists.txt: Add the new RemoteLayerTree directories to the header search path. Add CookieStorageUtilsCF.mm to Sources. * PlatformMac.cmake: Add a few more files, and fix the generated forwarding headers include path to name "WebKit" instead of "WebKit2". 2017-09-15 Youenn Fablet Add an URL method to remove both query string and fragment identifier https://bugs.webkit.org/show_bug.cgi?id=176911 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::computeKeyURL): 2017-09-15 Andy Estes [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176953 Reviewed by Eric Carlson. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-15 Ryosuke Niwa iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html https://bugs.webkit.org/show_bug.cgi?id=176968 Reviewed by Wenson Hsieh. Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside a WebContent process in release builds and an assertion failure in debug builds. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::readBufferFromPasteboard): 2017-09-14 Youenn Fablet Add Cache API support of records persistency https://bugs.webkit.org/show_bug.cgi?id=176845 Reviewed by Alex Christensen. Introducing asynchronous opening of Cache objects. When opening, Cache objects will read the list of records from the disk. They keep in memory the necessary information to make any match or remove request without reading further information from the disk. Cache objects thus keep during the opening time a list of callbacks to call when being opened. Persistent storage is implemented through NetworkCache::Storage. A Cache object is added a unique name so that records from a Cache cannot be mixed with records from another Cache. This unique name is stored persistenly in addition to the Cache name. This unique name is used as the key type given to the storage. Request, response and responsebody data are no longer kept by the Cache object. For regular sessions, this information is kept on the disk through NetworkCache::Storage. Insertion time is also stored persistently so as to keep the ordering of the records consistent. For private browsing sessions, this information is kept in a map owned by the Caches object. RecordData is renamed to RecordInformation as it now only contains the information used to handle the different Cache actions. For every record retrieval action, a ReadRecordTaskCounter is used. Its purpose is to allow retrieving the record data on the disk in parallel, and then send back the information when everything is read. In case some records cannot be correctly read, they are removed automatically at that point. The current implementation loads all information in memory including response bodies. Further improvements might consider streaming the response bodies progressively. For every stored record, an AsynchronousPutTaskCounter is used. Its purpose is also to wait for all put actions to be completed before executing the completion callback. In some cases, a record needs to be overriden. In that case, as per the specification, only the data related to the response is to be modified. This requires reading the record request data on disk before actually writing the whole record again. This is implemented in updateRecordToDisk. The Cache object is delegating all record writing/reading tasks to its Caches object. The Caches object is responsible to handle persistent/private sessions. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveRecords): Making sure Cache object is opened. (WebKit::CacheStorage::Engine::readCache): Ditto. (WebKit::CacheStorage::Engine::unlock): Disposing the cache without going through initializing it. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::computeKeyURL): (WebKit::CacheStorage::queryCache): (WebKit::CacheStorage::updateVaryInformation): (WebKit::CacheStorage::Cache::toRecordInformation): (WebKit::CacheStorage::Cache::Cache): (WebKit::CacheStorage::Cache::open): (WebKit::CacheStorage::Cache::finishOpening): (WebKit::CacheStorage::ReadRecordTaskCounter::create): (WebKit::CacheStorage::ReadRecordTaskCounter::~ReadRecordTaskCounter): (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord): (WebKit::CacheStorage::ReadRecordTaskCounter::ReadRecordTaskCounter): (WebKit::CacheStorage::Cache::retrieveRecord): (WebKit::CacheStorage::Cache::retrieveRecords): (WebKit::CacheStorage::Cache::addRecord): (WebKit::CacheStorage::Cache::recordsFromURL): (WebKit::CacheStorage::Cache::recordsFromURL const): (WebKit::CacheStorage::AsynchronousPutTaskCounter::create): (WebKit::CacheStorage::AsynchronousPutTaskCounter::~AsynchronousPutTaskCounter): (WebKit::CacheStorage::AsynchronousPutTaskCounter::onCompletion): (WebKit::CacheStorage::AsynchronousPutTaskCounter::setError): (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::remove): (WebKit::CacheStorage::Cache::removeFromRecordList): (WebKit::CacheStorage::Cache::writeRecordToDisk): (WebKit::CacheStorage::Cache::updateRecordToDisk): (WebKit::CacheStorage::Cache::readRecordFromDisk): (WebKit::CacheStorage::Cache::removeRecordFromDisk): (WebKit::CacheStorage::Cache::encode): (WebKit::CacheStorage::decodeRecordHeader): (WebKit::CacheStorage::Cache::decode): (WebKit::CacheStorage::Cache::keys const): * NetworkProcess/cache/CacheStorageEngineCache.h: (WebKit::CacheStorage::Cache::isOpened const): (WebKit::CacheStorage::Cache::uniqueName const): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::Caches::dispose): (WebKit::CacheStorage::encodeCacheNames): (WebKit::CacheStorage::decodeCachesNames): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::readRecordsList): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::readRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::clearMemoryRepresentation): (WebKit::CacheStorage::Caches::salt const): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::shouldPersist const): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::store): * NetworkProcess/cache/NetworkCacheStorage.h: (WebKit::NetworkCache::Storage::writeWithoutWaiting): 2017-09-14 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight https://bugs.webkit.org/show_bug.cgi?id=176889 Reviewed by Andy Estes. * UIProcess/API/C/WKPage.cpp: (WKPageLoadAlternateHTMLString): (WKPageLoadAlternateHTMLStringWithUserData): * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::headerHeight): (WebKit::UIDelegate::UIClient::footerHeight): (WebKit::UIDelegate::UIClient::drawHeader): (WebKit::UIDelegate::UIClient::drawFooter): * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::printOperationWithPrintInfo): * UIProcess/FrameLoadState.cpp: (WebKit::FrameLoadState::didStartProvisionalLoad): (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad): (WebKit::FrameLoadState::didFailProvisionalLoad): (WebKit::FrameLoadState::didCommitLoad): (WebKit::FrameLoadState::didSameDocumentNotification): (WebKit::FrameLoadState::setUnreachableURL): (WebKit::FrameLoadState::FrameLoadState): Deleted. * UIProcess/FrameLoadState.h: (WebKit::FrameLoadState::url const): (WebKit::FrameLoadState::provisionalURL const): (WebKit::FrameLoadState::unreachableURL const): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::loadURL): (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameProxy::didSameDocumentNavigation): (WebKit::WebFrameProxy::setUnreachableURL): * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::url const): (WebKit::WebFrameProxy::provisionalURL const): (WebKit::WebFrameProxy::unreachableURL const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadAlternateHTMLString): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadURLInFrame): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-14 Andy Estes [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176931 Reviewed by Joseph Pecoraro. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-14 Ryan Haddad Unreviewed, rolling out r222033. This change caused API test WebKit.PrintFrame to time out. Reverted changeset: "Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight" https://bugs.webkit.org/show_bug.cgi?id=176889 http://trac.webkit.org/changeset/222033 2017-09-14 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight https://bugs.webkit.org/show_bug.cgi?id=176889 Reviewed by Andy Estes. * UIProcess/API/C/WKPage.cpp: (WKPageLoadAlternateHTMLString): (WKPageLoadAlternateHTMLStringWithUserData): * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::headerHeight): (WebKit::UIDelegate::UIClient::footerHeight): (WebKit::UIDelegate::UIClient::drawHeader): (WebKit::UIDelegate::UIClient::drawFooter): * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::printOperationWithPrintInfo): * UIProcess/FrameLoadState.cpp: (WebKit::FrameLoadState::didStartProvisionalLoad): (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad): (WebKit::FrameLoadState::didFailProvisionalLoad): (WebKit::FrameLoadState::didCommitLoad): (WebKit::FrameLoadState::didSameDocumentNotification): (WebKit::FrameLoadState::setUnreachableURL): (WebKit::FrameLoadState::FrameLoadState): Deleted. * UIProcess/FrameLoadState.h: (WebKit::FrameLoadState::url const): (WebKit::FrameLoadState::provisionalURL const): (WebKit::FrameLoadState::unreachableURL const): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::loadURL): (WebKit::WebFrameProxy::didStartProvisionalLoad): (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameProxy::didSameDocumentNavigation): (WebKit::WebFrameProxy::setUnreachableURL): * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::url const): (WebKit::WebFrameProxy::provisionalURL const): (WebKit::WebFrameProxy::unreachableURL const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadAlternateHTMLString): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadURLInFrame): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-14 Carlos Garcia Campos [GTK][Wayland] Flickering when resizing the window https://bugs.webkit.org/show_bug.cgi?id=176774 Reviewed by Michael Catanzaro. This regressed when we switched to always start the wayland compositor. In AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState() we check if the nested compositor is running, which is always true now (if EGL and the required extensions are available). We should check if we are in AC mode instead. * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): 2017-09-14 Yusuke Suzuki [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray https://bugs.webkit.org/show_bug.cgi?id=176867 Reviewed by Sam Weinig. * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::enumerate): 2017-09-14 Maureen Daum Introduce the option to mark an HTML element as having AutoFill available. https://bugs.webkit.org/show_bug.cgi?id=176710 Reviewed by Alex Christensen. Introduce the option to mark an HTML element as having AutoFill available. Accessibility can use this property when deciding whether to announce that the focused field offers AutoFill. * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (WKBundleNodeHandleGetHTMLInputElementAutoFillAvailable): (WKBundleNodeHandleSetHTMLInputElementAutoFillAvailable): * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const): (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: 2017-09-13 John Wilander Introduce Storage Access API (document parts) as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=175759 Reviewed by Alex Christensen. Storage Access API is an experimental feature which allows cross-origin, sandboxed iframes to request access to their first-party storage (as opposed to partitioned storage). This might be restricted to cookies or might cover all stateful mechanisms. It introduces the following three developer-facing things: - A new readonly attribute, document.hasStorageAccess. - A new function, document.requestStorageAccess(). - A new iframe sandbox token, allow-storage-access-by-user-activation. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Storage handling of the new type of data. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetStorageAccessAPIEnabled): (WKPreferencesGetStorageAccessAPIEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: Bumped the model version from 9 to 10. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-09-13 Andy Estes [Apple Pay] Consider phoneticName when encoding ContactFields https://bugs.webkit.org/show_bug.cgi?id=176885 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-09-13 Matt Lewis Unreviewed, rolling out r221976. The test introduced was flaky from point of addition. Reverted changeset: "Introduce Storage Access API (document parts) as an experimental feature" https://bugs.webkit.org/show_bug.cgi?id=175759 http://trac.webkit.org/changeset/221976 2017-09-13 Youenn Fablet Internals clearCacheStorageMemoryRepresentation should return a Promise https://bugs.webkit.org/show_bug.cgi?id=176818 Reviewed by Alex Christensen. Adding a completion handler to clearMemoryRepresentation. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::clearMemoryRepresentation): (WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted): * WebProcess/Cache/WebCacheStorageConnection.h: * WebProcess/Cache/WebCacheStorageConnection.messages.in: 2017-09-13 Andy Estes [CF] Upstream CFNetwork-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176729 Reviewed by Alex Christensen. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::createSerializableRepresentation): (IPC::dictionaryValueOfType): (IPC::createArchiveList): (IPC::createCFURLRequestFromSerializableRepresentation): (IPC::createNSURLRequestFromSerializableRepresentation): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory): (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-13 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's setIsResizable, getWindowFrame, and setWindowFrame https://bugs.webkit.org/show_bug.cgi?id=176857 Reviewed by Tim Horton. isResizable is unreachable code because nothing sends Messages::WebPageProxy::GetIsResizable, so I removed it. * UIProcess/API/APIUIClient.h: (API::UIClient::setStatusBarIsVisible): (API::UIClient::isResizable): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::setIsResizable): (WebKit::UIDelegate::UIClient::setWindowFrame): (WebKit::UIDelegate::UIClient::windowFrame): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::getIsResizable): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: 2017-09-13 Youenn Fablet Add a lambda-based map for Vectors https://bugs.webkit.org/show_bug.cgi?id=176487 Reviewed by Darin Adler. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::readCachesFromDisk): 2017-09-13 John Wilander Introduce Storage Access API (document parts) as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=175759 Reviewed by Alex Christensen. Storage Access API is an experimental feature which allows cross-origin, sandboxed iframes to request access to their first-party storage (as opposed to partitioned storage). This might be restricted to cookies or might cover all stateful mechanisms. It introduces the following three developer-facing things: - A new readonly attribute, document.hasStorageAccess. - A new function, document.requestStorageAccess(). - A new iframe sandbox token, allow-storage-access-by-user-activation. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Storage handling of the new type of data. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetStorageAccessAPIEnabled): (WKPreferencesGetStorageAccessAPIEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: Bumped the model version from 9 to 10. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-09-13 Sergio Villar Senin [WebVR] Add IDLs and stubs https://bugs.webkit.org/show_bug.cgi?id=174202 Reviewed by Dean Jackson. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-09-12 Ryosuke Niwa Dragging & dropping a file creates an attachment element even when it's disabled https://bugs.webkit.org/show_bug.cgi?id=176769 Reviewed by Tim Horton. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAttachmentElementEnabled): (WKPreferencesGetAttachmentElementEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-09-12 Youenn Fablet Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not https://bugs.webkit.org/show_bug.cgi?id=176579 Reviewed by Alex Christensen. Introducing RecordData that splits its stored data in mandatory data, used to check a record with a request and optional data that is necessary to build a CacheStorageEngine::Record used by WebProcess. The mandatory data contains the URL, Vary header information and identifiers. Adding routines to go from a Record to RecordData and vice versa. Storing in CacheStorage::Cache RecordData instead of Record. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::queryCache): (WebKit::CacheStorage::updateVaryInformation): (WebKit::CacheStorage::toRecord): (WebKit::CacheStorage::toRecordData): (WebKit::CacheStorage::Cache::retrieveRecords const): (WebKit::CacheStorage::Cache::addRecord): (WebKit::CacheStorage::Cache::recordsFromURL): (WebKit::CacheStorage::Cache::recordsFromURL const): (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::writeRecordToDisk): (WebKit::CacheStorage::Cache::removeRecordFromDisk): * NetworkProcess/cache/CacheStorageEngineCache.h: 2017-09-12 Dan Bernstein Tried to fix the iOS 10 build after r221930. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setDragInteractionPolicy:]): 2017-09-12 Dan Bernstein Update availability annotations to match the macOS 10.13 and iOS 11.0 GM seed SDKs https://bugs.webkit.org/show_bug.cgi?id=176793 Reviewed by Tim Horton. Changed WK_MAC_TBA and WK_IOS_TBA to 10.13 and 11.0, respectively, in all declarations that appear in the GM seed SDKs. Additional changes and exceptions are noted below. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added missing availability annotation to -_webView:dataOwnerForDropSession: and -_webView:dataOwnerForDragSession:. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed rednundant __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 guards. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Added missing availability annotation to -_setResourceLoadStatisticsTestingCallback:. * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added missing availability annotation. * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Added availability annotation that had been missing since macOS 10.12.3 and iOS 10.3. Corrected annotation for _WKLinkIconParameters. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Added missing TBA annotation to _resourceLoadStatisticsDirectory. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Removed iOS availability from macOS-only declaration and vice versa. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Removed an availability annotation from this method implementation. * Shared/API/Cocoa/WKDragDestinationAction.h: * UIProcess/API/Cocoa/WKContentRuleList.h: * UIProcess/API/Cocoa/WKContentRuleListStore.h: * UIProcess/API/Cocoa/WKError.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: * UIProcess/API/Cocoa/WKURLSchemeHandler.h: * UIProcess/API/Cocoa/WKURLSchemeTask.h: * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: * UIProcess/API/Cocoa/_WKGeolocationPosition.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/_WKWebViewPrintFormatter.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: 2017-09-12 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's runModal https://bugs.webkit.org/show_bug.cgi?id=176728 Covered by a new API test. Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::runModal): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::canRunModal const): (WebKit::UIDelegate::UIClient::runModal): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runModal): 2017-09-12 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForNotificationPermissionRequest https://bugs.webkit.org/show_bug.cgi?id=176768 Reviewed by Tim Horton. Covered by a new API test. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest): (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): 2017-09-11 Wenson Hsieh [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS https://bugs.webkit.org/show_bug.cgi?id=176721 Reviewed by Tim Horton. Rename elementBounds => dragPreviewFrameInRootViewCoordinates. * UIProcess/ios/DragDropInteractionState.h: * UIProcess/ios/DragDropInteractionState.mm: (WebKit::DragDropInteractionState::previewForDragItem const): (WebKit::DragDropInteractionState::stageDragItem): 2017-09-11 Tim Horton REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes https://bugs.webkit.org/show_bug.cgi?id=176767 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): Reset the "last sent" layout parameters when the Web Content process exits. They're no longer "last sent", and if we short-circuit from sending them again (from under _didRelaunchProcess), we will never send the correct layout width (until it changes). 2017-09-11 Wenson Hsieh [iOS WK2] Support tapping to add items to the current drag session in web content https://bugs.webkit.org/show_bug.cgi?id=176421 Reviewed by Tim Horton. To request additional drag items, end the current drag in the web page and try to begin a drag at the new location. This process is transparent to the UI process, which still maintains the same UIDragSession with the old drag source. As opposed to firing a new event (for instance: `adddragitem`), this approach is taken to ensure that if the page wants to preventDefault() on `dragstart`, it would also prevent the user from adding it as an additional drag item. Using the new event approach, dealing with this case would either require the page to listen for a new event and call preventDefault(), which would break compatibility with pages that only preventDefault() on `dragstart`, or it would require the default behavior of this new event to be _not_ adding a drag item, in which case this approach would require pages to adopt the new event in some form. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAdditionalItemsForDragSession): 2017-09-11 Alex Christensen Clean up API::UIClient https://bugs.webkit.org/show_bug.cgi?id=176568 Reviewed by Brady Eidson. We don't need createNewPage and createNewPageAsync. An async version can support synchronous delegate calls by just calling the completion handler synchronously. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): (API::UIClient::createNewPageAsync): Deleted. (API::UIClient::canCreateNewPageAsync): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/API/glib/WebKitUIClient.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted. (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted. (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: 2017-09-11 Alex Christensen Fix memory leak introduced in r221894. https://bugs.webkit.org/show_bug.cgi?id=176753 * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::createRequest): The NotificationPermissionRequestManagerProxy keeps track of pending requests so they can be denied when invalidating the page. We add them to a HashMap and in r221894 I removed the code that removes them from that map once the request is complete. This code adds the completed task removal back. The NotificationPermissionRequestManagerProxy and WebPageProxy have the same lifetime, so protecting the WebPageProxy (m_page) makes sure there is no use-after-free when the completion handler is called. 2017-09-11 Alex Christensen Make NotificationPermissionRequest work with completion handlers https://bugs.webkit.org/show_bug.cgi?id=176753 Reviewed by Andy Estes. API::UIClient::decidePolicyForNotificationPermissionRequest should take a completion handler which it will eventually call with a bool representing whether notifications are allowed. To do this, I make NotificationPermissionRequest just a wrapper for a lambda. One subtle change in behavior is when invalidating all outstanding requests, we deny them instead of just dropping them. This results in a deny message sent where there wasn't one before, resulting in better cleanup in NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision. * UIProcess/API/APIUIClient.h: (API::UIClient::decidePolicyForNotificationPermissionRequest): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Notifications/NotificationPermissionRequest.cpp: Removed. * UIProcess/Notifications/NotificationPermissionRequest.h: (WebKit::NotificationPermissionRequest::create): (WebKit::NotificationPermissionRequest::allow): (WebKit::NotificationPermissionRequest::deny): (WebKit::NotificationPermissionRequest::NotificationPermissionRequest): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests): (WebKit::NotificationPermissionRequestManagerProxy::createRequest): (WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision): Deleted. * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestNotificationPermission): * WebKit.xcodeproj/project.pbxproj: 2017-09-11 Alex Christensen Modernize and make API::UIClient more asynchronous https://bugs.webkit.org/show_bug.cgi?id=176583 Reviewed by Brian Burg. API::UIClient calls that return values synchronously require synchronous APIs unnecessarily. Having them call completion handlers with the results instead allows us to make asynchronous APIs, and existing synchronous APIs can just call the completion handlers immediately. Unfortunately an assumption that API::UIClient::windowFrame returns synchronously had worked its way into the WebAutomationSession, which calls WebPageProxy::getWindowFrame. Making it asynchronous required making some automation protocols asynchronous so they can send their result once they have the resulting frames from the UIClient. No change in behaviour. * UIProcess/API/APIUIClient.h: (API::UIClient::setToolbarsAreVisible): (API::UIClient::menuBarIsVisible): (API::UIClient::setMenuBarIsVisible): (API::UIClient::statusBarIsVisible): (API::UIClient::setStatusBarIsVisible): (API::UIClient::isResizable): (API::UIClient::setIsResizable): (API::UIClient::setWindowFrame): (API::UIClient::windowFrame): (API::UIClient::headerHeight): (API::UIClient::footerHeight): (API::UIClient::drawHeader): (API::UIClient::drawFooter): (API::UIClient::printFrame): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::buildBrowsingContextForPage): (WebKit::WebAutomationSession::getNextContext): (WebKit::WebAutomationSession::getBrowsingContexts): (WebKit::WebAutomationSession::getBrowsingContext): (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::performMouseInteraction): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::printFrame): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::printOperationWithPrintInfo): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::setToolbarsAreVisible): (WebKit::WebPageProxy::setMenuBarIsVisible): (WebKit::WebPageProxy::getMenuBarIsVisible): (WebKit::WebPageProxy::setStatusBarIsVisible): (WebKit::WebPageProxy::getStatusBarIsVisible): (WebKit::WebPageProxy::setIsResizable): (WebKit::WebPageProxy::getIsResizable): (WebKit::WebPageProxy::setWindowFrame): (WebKit::WebPageProxy::getWindowFrame): (WebKit::WebPageProxy::getWindowFrameWithCompletionHandler): (WebKit::WebPageProxy::screenToRootView): (WebKit::WebPageProxy::rootViewToScreen): (WebKit::WebPageProxy::printFrame): (WebKit::WebPageProxy::headerHeight): (WebKit::WebPageProxy::footerHeight): (WebKit::WebPageProxy::drawHeader): (WebKit::WebPageProxy::drawFooter): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WKPrintingView.h: * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView initWithFrameProxy:view:]): (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): (-[WKPrintingView drawPageBorderWithSize:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::windowAndViewFramesChanged): 2017-09-11 Stephan Szabo [WinCairo] Add entry Web Process files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=176570 Reviewed by Alex Christensen. * PlatformWin.cmake: * WebProcess/EntryPoint/win/WebProcessMain.cpp: Added. * WebProcess/win/WebProcessMainWin.cpp: Added. * WebProcess/win/WebProcessMainWin.h: Added. 2017-09-11 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForGeolocationPermissionRequest https://bugs.webkit.org/show_bug.cgi?id=176642 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): (WebKit::Function [iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable https://bugs.webkit.org/show_bug.cgi?id=176664 Reviewed by Tim Horton. Makes a simple adjustment in DragDropInteractionState::previewForDragItem to respect the drag image supplied to the UI process during a "DHTML"-defined drag (i.e. DragSourceActionDHTML). Test: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateDataInteractionEntered:]): Deleted. (-[WKWebView _simulateDataInteractionUpdated:]): Deleted. (-[WKWebView _simulateDataInteractionPerformOperation:]): Deleted. (-[WKWebView _simulateDataInteractionEnded:]): Deleted. (-[WKWebView _simulateDataInteractionSessionDidEnd:]): Deleted. (-[WKWebView _simulateWillBeginDataInteractionWithSession:]): Deleted. (-[WKWebView _simulatedItemsForSession:]): Deleted. (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted. (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]): Deleted. Remove all -_simulate*: testing helpers on WKWebView. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/DragDropInteractionState.mm: (WebKit::shouldUseDragImageToCreatePreviewForDragSource): (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource): Add shouldUseDragImageToCreatePreviewForDragSource, which returns YES when dragging an image or DHTML-defined draggable element and the drag image exists. This is called from previewForDragItem when constructing the drag preview for a given UIDragItem. (WebKit::DragDropInteractionState::previewForDragItem const): (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _simulateDataInteractionEntered:]): Deleted. (-[WKContentView _simulateDataInteractionUpdated:]): Deleted. (-[WKContentView _simulateDataInteractionEnded:]): Deleted. (-[WKContentView _simulateDataInteractionPerformOperation:]): Deleted. (-[WKContentView _simulateDataInteractionSessionDidEnd:]): Deleted. (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): Deleted. (-[WKContentView _simulatedItemsForSession:]): Deleted. (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): Deleted. (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted. Remove all -_simulate*: testing helpers on WKContentView. 2017-09-11 Alex Christensen Modernize BoxExtent into RectEdges https://bugs.webkit.org/show_bug.cgi?id=176437 Reviewed by Simon Fraser. * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebCoreArgumentCoders.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.messages.in: 2017-09-11 Andy Estes [Mac] Upstream QTKit-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176472 Reviewed by Eric Carlson. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-11 JF Bastien cmake build fix Unreviewed * PlatformMac.cmake: one file was deleted, another renamed. 2017-09-10 Carlos Garcia Campos REGRESSION: [GTK] Generated HTML API documentation is missing descriptions https://bugs.webkit.org/show_bug.cgi?id=176667 Reviewed by Michael Catanzaro. Fix several typos in API documentation. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: 2017-09-10 Brady Eidson Try to avoid creating the default WKWebsiteDataStore until its actually needed. and https://bugs.webkit.org/show_bug.cgi?id=176551 Reviewed by Tim Horton. * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookie): (API::HTTPCookieStore::deleteCookie): * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::defaultDataStore): (API::WebsiteDataStore::defaultDataStoreExists): * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/C/WKContext.cpp: (WKContextGetWebsiteDataStore): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _defaultDataStoreExists]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::m_hiddenPageThrottlingTimer): (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::warmInitialProcess): (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::isAssociatedProcessPool const): 2017-09-09 Mark Lam Avoid duplicate computations of ExecState::vm(). https://bugs.webkit.org/show_bug.cgi?id=176647 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.h: (WebKit::JSNPMethod::create): * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::setProperty): (WebKit::NPJSObject::removeProperty): (WebKit::NPJSObject::enumerate): 2017-09-08 Joseph Pecoraro Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses https://bugs.webkit.org/show_bug.cgi?id=176479 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): Initialize AtomicString statics like emptyAtom(). 2017-09-08 Commit Queue Unreviewed, rolling out r221773. https://bugs.webkit.org/show_bug.cgi?id=176614 This caused build failures. (Requested by mlewis13 on #webkit). Reverted changeset: "[Mac] Upstream QTKit-related WebKitSystemInterface functions" https://bugs.webkit.org/show_bug.cgi?id=176472 http://trac.webkit.org/changeset/221773 2017-09-08 Stephan Szabo [WinCairo] Add Storage Process files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=176567 Reviewed by Alex Christensen. * PlatformWin.cmake: * StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Added. (main): * StorageProcess/win/StorageProcessMainWin.cpp: Added. (WebKit::StorageProcessMainWin): * StorageProcess/win/StorageProcessMainWin.h: Added. 2017-09-08 Ryan Haddad Unreviewed, rolling out r221771. This change caused two API tests to crash. Reverted changeset: "Clean up API::UIClient" https://bugs.webkit.org/show_bug.cgi?id=176568 http://trac.webkit.org/changeset/221771 2017-09-07 Carlos Garcia Campos [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState https://bugs.webkit.org/show_bug.cgi?id=176303 Reviewed by Michael Catanzaro. Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using the last item index instead, so it's not easy to know where the actual problem is. In any case we should still protect the decoder. * UIProcess/API/glib/WebKitWebViewSessionState.cpp: (decodeSessionState): 2017-09-07 Andy Estes [Mac] Upstream QTKit-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176472 Reviewed by Eric Carlson. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-07 Alex Christensen Clean up API::UIClient https://bugs.webkit.org/show_bug.cgi?id=176568 Reviewed by Brady Eidson. We don't need createNewPage and createNewPageAsync. An async version can support synchronous delegate calls by just calling the completion handler synchronously. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): (API::UIClient::createNewPageAsync): Deleted. (API::UIClient::canCreateNewPageAsync): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/API/glib/WebKitUIClient.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted. (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted. (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: 2017-09-07 Alex Christensen Make DragControllerAction an enum class https://bugs.webkit.org/show_bug.cgi?id=176565 Reviewed by Andy Estes. * Shared/DragControllerAction.h: (): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dragEntered): (WebKit::WebPageProxy::dragUpdated): (WebKit::WebPageProxy::dragExited): (WebKit::WebPageProxy::performDragOperation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-09-07 Myles C. Maxfield [PAL] Unify PlatformUserPreferredLanguages.h with Language.h https://bugs.webkit.org/show_bug.cgi?id=176561 Reviewed by Brent Fulgham. * UIProcess/WebProcessPool.cpp: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::userPreferredLanguagesChanged const): 2017-09-07 Youenn Fablet Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache https://bugs.webkit.org/show_bug.cgi?id=176548 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::dereference): 2017-09-07 Chris Dumez [WK2] Add C API to retrieve the originating page of a WKDownload https://bugs.webkit.org/show_bug.cgi?id=176557 Reviewed by Alex Christensen. Add C API to retrieve the original page of a WKDownload. This is the C API equivalent to _WKDownload.originatingWebView which already exists in ObjC. The pointer is weak so as to not keep alive the page for the duration of the download. * UIProcess/API/C/WKDownload.cpp: (WKDownloadGetOriginatingPage): * UIProcess/API/C/WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload originatingWebView]): * UIProcess/API/Cocoa/_WKDownloadInternal.h: * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::originatingPage const): (WebKit::DownloadProxy::setOriginatingPage): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::download): (WebKit::WebProcessPool::resumeDownload): (WebKit::WebProcessPool::createDownloadProxy): * UIProcess/WebProcessPool.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::handleDownloadRequest): * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::handleDownloadRequest): 2017-09-07 Alex Christensen Clean up Geolocation request handling https://bugs.webkit.org/show_bug.cgi?id=176562 Reviewed by Tim Horton. Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled, pass a Function&& completionHandler and return the function if it won't be handled. This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design. * UIProcess/API/APIUIClient.h: (API::UIClient::Function Allow modern decoding of enums and OptionSets https://bugs.webkit.org/show_bug.cgi?id=176480 Reviewed by Andy Estes. * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder>::decode): * Platform/IPC/Decoder.h: (IPC::Decoder::operator>>): * Platform/IPC/Encoder.h: * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::encode const): (WebKit::WebsitePolicies::decode): 2017-09-07 Frederic Wang Move more code from ScrollingTreeScrollingNodeDelegateIOS to ScrollingTreeScrollingNodeDelegate https://bugs.webkit.org/show_bug.cgi?id=174130 Reviewed by Simon Fraser. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Remove some members, headers and pre-declaration that are moved into the delegate. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): Deleted. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Remove some headers and WKOverflowScrollViewDelegate since they are moved into the delegate file. Also fix the comment to closing the WebKit namespace. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS): Remove some code moved into the delegate and call the corresponding helper function to preserve the current behavior. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto. Note that it is only necessary to cast the parameter to a ScrollingStateTreeNode. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Ditto. (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Deleted. (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Deleted. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Import headers and members from ScrollingTreeOverflowScrollingNodeIOS. Define new helper functions for the code imported from ScrollingTreeOverflowScrollingNodeIOS. Remove the friendship with ScrollingTreeOverflowScrollingNodeIOS and only makes public the function used by that class. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollLayer): This function is moved from ScrollingTreeOverflowScrollingNodeIOS. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Add headers, WKOverflowScrollViewDelegate (renamed WKScrollingNodeScrollViewDelegate) and some helper code imported from ScrollingTreeOverflowScrollingNodeIOS. (-[WKScrollingNodeScrollViewDelegate scrollViewDidScroll:]): Moved from ScrollingTreeOverflowScrollingNodeIOS. (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginDragging:]): Ditto. (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Ditto. (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Ditto. (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS): Import code from ScrollingTreeOverflowScrollingNodeIOS. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate): New helper function importing code from ScrollingTreeOverflowScrollingNodeIOS. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Ditto. 2017-09-07 Chris Dumez [WK2] Notify client when downloads are redirected https://bugs.webkit.org/show_bug.cgi?id=176481 Reviewed by Geoffrey Garen. Notify client when downloads are redirected via both ObjC and C API. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::willSendRedirectedRequest): * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/mac/DownloadMac.mm: (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]): * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::willSendRequest): * UIProcess/API/C/WKContext.cpp: (WKContextSetDownloadClient): * UIProcess/API/C/WKContextDownloadClient.h: * UIProcess/API/Cocoa/_WKDownloadDelegate.h: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::willSendRequest): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::willSendRequest): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Downloads/DownloadProxy.messages.in: * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): Set menu proxy before calling menuFromProposedMenu() client delegate. This allows me to perform one of the menu item's action from the menuFromProposedMenu() client delegate in my API test. 2017-09-07 Alex Christensen Modernize Geolocation code https://bugs.webkit.org/show_bug.cgi?id=176496 Reviewed by Andy Estes. Making the GeolocationPermissionRequestManager take a reference instead of a pointer spilled into making the other supplement constructors do the same. * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp: (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager): (WebKit::LegacyCustomProtocolManager::startLoading): (WebKit::LegacyCustomProtocolManager::stopLoading): * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::addSupplement): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::AuthenticationManager): (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/APIUIClient.h: (API::UIClient::decidePolicyForGeolocationPermissionRequest): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestGeolocationPermissionForFrame): * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::WebCookieManager): (WebKit::WebCookieManager::getHostnamesWithCookies): (WebKit::WebCookieManager::deleteCookie): (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): (WebKit::WebCookieManager::getAllCookies): (WebKit::WebCookieManager::getCookies): (WebKit::WebCookieManager::setCookie): (WebKit::WebCookieManager::setCookies): (WebKit::WebCookieManager::notifyCookiesDidChange): (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::GeolocationPermissionRequestManager): (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation): * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::WebGeolocationManager): (WebKit::WebGeolocationManager::registerWebPage): (WebKit::WebGeolocationManager::unregisterWebPage): (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage): (WebKit::WebGeolocationManager::didChangePosition): (WebKit::WebGeolocationManager::didFailToDeterminePosition): (WebKit::WebGeolocationManager::resetPermissions): * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/MediaCache/WebMediaKeyStorageManager.h: (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::WebNotificationManager): (WebKit::WebNotificationManager::show): (WebKit::WebNotificationManager::cancel): (WebKit::WebNotificationManager::clearNotifications): (WebKit::WebNotificationManager::didDestroyNotification): * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::requestPermission): (WebKit::WebGeolocationClient::cancelPermissionRequest): * WebProcess/WebCoreSupport/WebGeolocationClient.h: (WebKit::WebGeolocationClient::WebGeolocationClient): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): * WebProcess/WebProcess.h: (WebKit::WebProcess::addSupplement): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::UserMediaCaptureManager): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-09-06 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's pageDidScroll https://bugs.webkit.org/show_bug.cgi?id=176482 Reviewed by Tim Horton. Covered by a new API test! * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::pageDidScroll): 2017-09-06 Youenn Fablet NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed https://bugs.webkit.org/show_bug.cgi?id=176249 Reviewed by Alex Christensen. CacheStorageEngineConnection will store the number of Caches references for its related WebProcess. For a new reference, CacheStorageEngineConnection will notify its engine to lock the related Cache. When the last reference is gone, CacheStorageEngineConnection will ask the engine to release the lock. CacheStorageEngine will keep locks as a counter for each Cache object. When the counter goes to zero, the engine asks the Cache to dispose itself. Disposal is done by its parent Caches as only Caches knows whether the Cache is persistent or has been removed. The Caches will remove the Cache from memory. For removed caches, all information will be lost. For caches that are not removed, they will keep their identifiers but all in-memory record information will be discarded. If there is a need to reopen the Cache, it will need to read its information from the filesystem. If the Caches has no longer any active Cache object, it will ask the engine to release itself. WebProcess crashing is handled correctly as the CacheStorageEngineConnection will release its locks at destruction time of the connection to the web process. Adding the possiblity to grab an engine representation for test purposes. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::removeCaches): (WebKit::CacheStorage::Engine::lock): (WebKit::CacheStorage::Engine::unlock): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::Cache): (WebKit::CacheStorage::Cache::dispose): (WebKit::CacheStorage::Cache::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineCache.h: (WebKit::CacheStorage::Cache::isActive const): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::dispose): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::create): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection): (WebKit::CacheStorageEngineConnection::reference): (WebKit::CacheStorageEngineConnection::dereference): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::reference): (WebKit::WebCacheStorageConnection::dereference): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-09-06 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange https://bugs.webkit.org/show_bug.cgi?id=176474 Reviewed by Tim Horton. Rather than telling the UIClient that the pinned state changed and having the application check 4 bools like we do with WKPage, I made a KVO property on the WKWebView. I introduce _WKRectEdge for this purpose, which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags. This same structure is used for rubber band state. Covered by a new API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandState]): (-[WKWebView _setRubberBandState:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::pinnedState): (WebKit::WebViewImpl::rubberBandState): (WebKit::WebViewImpl::setRubberBandState): * UIProcess/PageClient.h: (WebKit::PageClient::pinnedStateWillChange): (WebKit::PageClient::pinnedStateDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::pinnedStateWillChange): (WebKit::PageClientImpl::pinnedStateDidChange): 2017-09-06 Youenn Fablet Introduce asynchronous opening of CacheStorageEngine cache https://bugs.webkit.org/show_bug.cgi?id=176425 Reviewed by Alex Christensen. Introducing Cache::open to allow reading from the filesystem to fill the Cache. This is called by Caches when engine requests to open an existing Cache. * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::Cache): (WebKit::CacheStorage::Cache::open): (WebKit::CacheStorage::Cache::finishOpening): (WebKit::CacheStorage::Cache::readRecordsList): * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::find): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::find const): Deleted. * NetworkProcess/cache/CacheStorageEngineCaches.h: 2017-09-06 Alex Christensen Unreviewed, rolling out r221694. broke build Reverted changeset: "Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange" https://bugs.webkit.org/show_bug.cgi?id=176474 http://trac.webkit.org/changeset/221694 2017-09-06 Ryan Haddad Unreviewed, rolling out r221461. The LayoutTest added with this change crashes under GuardMalloc. Reverted changeset: "Add (entirely incorrect) fetching of ServiceWorker scripts." https://bugs.webkit.org/show_bug.cgi?id=176179 http://trac.webkit.org/changeset/221461 2017-09-06 Alex Christensen Add modern decoders for POD types https://bugs.webkit.org/show_bug.cgi?id=176456 Reviewed by Geoffrey Garen. * Platform/IPC/Decoder.cpp: (IPC::Decoder::getOptional): (IPC::Decoder::operator>>): * Platform/IPC/Decoder.h: * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: 2017-09-06 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange https://bugs.webkit.org/show_bug.cgi?id=176474 Reviewed by Tim Horton. Rather than telling the UIClient that the pinned state changed and having the application check 4 bools like we do with WKPage, I made a KVO property on the WKWebView. I introduce _WKRectEdge for this purpose, which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags. This same structure is used for rubber band state. Covered by a new API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandState]): (-[WKWebView _setRubberBandState:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::pinnedState): (WebKit::WebViewImpl::rubberBandState): (WebKit::WebViewImpl::setRubberBandState): * UIProcess/PageClient.h: (WebKit::PageClient::pinnedStateWillChange): (WebKit::PageClient::pinnedStateDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::pinnedStateWillChange): (WebKit::PageClientImpl::pinnedStateDidChange): 2017-09-06 Brent Fulgham Deny third-party cookie creation for prevalent resources without interaction https://bugs.webkit.org/show_bug.cgi?id=175232 Reviewed by Alex Christensen. Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie, but destroy it at some arbitrary moment which is difficult for websites to work with. This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately, which is what sites are expecting from Safari. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: Renamed the UpdateCookiePartitioningForTopPrivatelyOwnedDomains message to UpdatePrevalentDomainsWithAndWithoutInteraction. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Recognize cases where a network session should block cookies, and use the stateless session so we fail immediately when attempting an invalid cookie set operation. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsSetShouldPartitionCookies): Use new helper function to clear partitioning state. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Update for revised naming. (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Track domains with and without interaction so that we can recognize domains that should be immediately blocked from setting cookies. (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Update for revised naming. (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): Added helper function for testing. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Update for revised naming. (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Ditto. (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-09-06 Adrian Perez de Castro [WPE][CMake] Fix path to the WebKitApplicationInfo.h header. Unreviewed build fix. This doesn't really make a difference for the build bots, but it makes it possible to craft working release tarballs of WPE. * PlatformWPE.cmake: Use the WPE version of WebKitApplicationInfo.h 2017-09-06 Frédéric Wang Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling https://bugs.webkit.org/show_bug.cgi?id=174097 Reviewed by Darin Adler. This patch introduces a new ScrollingTreeScrollingNodeDelegateIOS that can be used by WKOverflowScrollViewDelegate to communicate to the scrolling tree and nodes. It can also be used as a helper class by ScrollingTreeOverflowScrollingNodeIOS. For now, only the non- overriden member functions of ScrollingTreeOverflowScrollingNodeIOS are moved to that new class. In follow-up commits, WKOverflowScrollViewDelegate can become a generic ScrollViewDelegate and more code can be moved into the ScrollingTreeScrollingNodeDelegateIOS file. Frame scrolling nodes will then be able to share the same UI code as overflow:auto when iOS frame scrolling is implemented (bug 149264). * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Move non-overriden member functions and m_updatingFromStateNode into the delegate class. Also define a member to store that delegate. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Use the node delegate to communicate to the scrolling tree and node. (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Init with a delegate. (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Call the delegate function. (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Ditto. (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Use the delegate functions or pass by ScrollingTreeScrollingNodeDelegateIOS::scrollingNode(). (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Use the delegate functions. (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS): Init the delegate for this class. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Use the delegate. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Use the delegate function. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Ditto. (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:]): Deleted. This is renamed initWithScrollingTreeNodeDelegate and accepts a delegate. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Deleted. Moved to ScrollingTreeScrollingNodeDelegateIOS. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): Ditto. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::currentSnapPointIndicesDidChange): Ditto. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Added. New delegate class for ScrollingTreeOverflowScrollingNodeIOS. The members used by WKOverflowScrollViewDelegate are public and the others are private. ScrollingTreeOverflowScrollingNodeIOS is a friend of ScrollingTreeScrollingNodeDelegateIOS so that it can access private members e.g. updateChildNodesAfterScroll() or m_updatingFromStateNode. * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Added. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS): (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS): (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Code extracted from ScrollingTreeOverflowScrollingNodeIOS. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollDidEnd): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewWillStartPanGesture): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll): Ditto. (WebKit::ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange): Ditto. * WebKit.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegateIOS files to the build system. 2017-09-05 Wenson Hsieh [iOS WK2] Add plumbing for WKContentView to ask the web process for additional drag items https://bugs.webkit.org/show_bug.cgi?id=176348 Work towards Reviewed by Tim Horton. Adds boilerplate plumbing to request additional items to an existing session. This implements some UI-side logic in WKContentView to send an additional drag items request and handle a response from the web process. To start, WebPageProxy::requestAdditionalItemsForDragSession is invoked by -_dragInteraction: itemsForAddingToSession:withTouchAtPoint:completion: in WKContentView, and the response from the web process is handled in -[WKContentView _didHandleAdditionalDragItemsRequest:]. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add SPI to simulate a request for additional drag items. See Tools/ChangeLog for more detail. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add an IPC message handler for the additional drag items response from the web process. * UIProcess/ios/DragDropInteractionState.h: (WebKit::DragDropInteractionState::BlockPtr for more information. (-[WKContentView dragInteraction:itemsForBeginningSession:]): Refactored to use -_itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:. (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest): (WebKit::WebPageProxy::requestAdditionalItemsForDragSession): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add an IPC message handler for the additional drag items request from the UI process. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAdditionalItemsForDragSession): 2017-09-05 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's mouseDidMoveOverElement https://bugs.webkit.org/show_bug.cgi?id=176428 Reviewed by Tim Horton. Covered by a new API test. * UIProcess/API/APIUIClient.h: (API::UIClient::mouseDidMoveOverElement): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::runJavaScriptAlert): (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): (WebKit::UIDelegate::UIClient::takeFocus): (WebKit::UIDelegate::UIClient::focus): (WebKit::UIDelegate::UIClient::unfocus): (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground): (WebKit::UIDelegate::UIClient::didNotHandleWheelEvent): (WebKit::toNSEventModifierFlags): (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement): (WebKit::UIDelegate::UIClient::toolbarsAreVisible): (WebKit::UIDelegate::UIClient::didClickAutoFillButton): (WebKit::UIDelegate::UIClient::handleAutoplayEvent): (WebKit::requestUserMediaAuthorizationForDevices): (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): (WebKit::UIDelegate::UIClient::printFrame): (WebKit::UIDelegate::UIClient::close): (WebKit::UIDelegate::UIClient::fullscreenMayReturnToInline): (WebKit::UIDelegate::UIClient::didEnterFullscreen): (WebKit::UIDelegate::UIClient::didExitFullscreen): (WebKit::UIDelegate::UIClient::requestPointerLock): (WebKit::UIDelegate::UIClient::didLosePointerLock): (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::mouseDidMoveOverElement): * UIProcess/WebPageProxy.h: 2017-09-05 Brent Fulgham Relax keychain access to permit users to permanently allow client certificates https://bugs.webkit.org/show_bug.cgi?id=175857 Reviewed by Alex Christensen. Further relax the write permissions on the user's Keychain directory to support local certificates. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-09-05 Youenn Fablet Cache Storage Engine should not mix different origin caches https://bugs.webkit.org/show_bug.cgi?id=176394 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::readCachesFromDisk): Initializing the salt before creating the Caches object so that its persistency path is correctly computed. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::cachesRootPath): Setting origin as partition string. 2017-09-05 Brent Fulgham Use a single network storage session for stateless connections https://bugs.webkit.org/show_bug.cgi?id=176386 Reviewed by Alex Christensen. Change the name of 'm_dataTaskMapWithoutCredentials' to 'm_dataTaskMapWithoutState' to reflect that the data tasks do not involve credential or cookie storage. Ditto for the change from 'm_sessionWIthoutCredentialStorage' to 'm_statelessSession'. This update should not change behavior, unless some stateless sessions were depending on cookies to be persistent (which would be a bug!) * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Update for new variable names. (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): Ditto. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Update the configuration to block cookies as well. (WebKit::NetworkSessionCocoa::invalidateAndCancel): Update for new names. (WebKit::NetworkSessionCocoa::clearCredentials): Ditto. (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Ditto. 2017-09-05 Yousuke Kimoto [WinCairo] Add Network Process files for wincairo webkit https://bugs.webkit.org/show_bug.cgi?id=176069 Reviewed by Alex Christensen. * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Added. (WebKit::Download::resume): (WebKit::Download::platformDidFinish): (WebKit::Download::startNetworkLoadWithHandle): (WebKit::Download::startNetworkLoad): (WebKit::Download::platformInvalidate): * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp: Added. (main): * NetworkProcess/curl/NetworkProcessCurl.cpp: Added. (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::platformSetURLCacheSize): (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): (WebKit::NetworkProcess::clearCacheForAllOrigins): (WebKit::NetworkProcess::clearDiskCache): (WebKit::NetworkProcess::platformTerminate): * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp: Added. (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): (WebKit::RemoteNetworkingContext::isValid const): (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::RemoteNetworkingContext::storageSession const): (WebKit::RemoteNetworkingContext::blockedError const): * NetworkProcess/win/NetworkProcessMainWin.cpp: Added. (WebKit::NetworkProcessMainWin): * NetworkProcess/win/NetworkProcessMainWin.h: Added. * NetworkProcess/win/SystemProxyWin.cpp: Added. (WindowsSystemProxy::getSystemHttpProxy): (WindowsSystemProxy::setCurlHttpProxy): (WindowsSystemProxy::parseProxyString): * NetworkProcess/win/SystemProxyWin.h: Added. * PlatformWin.cmake: 2017-09-05 Youenn Fablet Allow retrieving Cache Storage records for a given URL only https://bugs.webkit.org/show_bug.cgi?id=176202 Reviewed by Alex Christensen. Update CacheStorageEngineCache to store records as a map URL -> Vector of Records. This allows regular record retrieval to be faster. Retrieval of all records is less efficient but this should happen less often. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveRecords): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::queryCache): (WebKit::CacheStorage::Cache::retrieveRecords const): (WebKit::CacheStorage::computeKeyURL): (WebKit::CacheStorage::Cache::addNewURLRecord): (WebKit::CacheStorage::Cache::recordsFromURL): (WebKit::CacheStorage::Cache::recordsFromURL const): (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::remove): * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::retrieveRecords): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doRetrieveRecords): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-09-05 Youenn Fablet WebKitTestRunner should set the cache storage directory path https://bugs.webkit.org/show_bug.cgi?id=176373 Reviewed by Chris Dumez. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyCacheStorageDirectory): (WKContextConfigurationSetCacheStorageDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: 2017-09-05 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's unavailablePluginButtonClicked https://bugs.webkit.org/show_bug.cgi?id=176274 Reviewed by Darin Adler. * UIProcess/API/APIUIClient.h: (API::UIClient::unavailablePluginButtonClicked): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setPluginsEnabled:]): (-[WKPreferences _pluginsEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKPluginUnavailabilityReason): (WebKit::UIDelegate::UIClient::unavailablePluginButtonClicked): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::unavailablePluginButtonClicked): 2017-09-04 Alex Christensen Allow classes to have modern and legacy decoders to aid transition https://bugs.webkit.org/show_bug.cgi?id=176186 Reviewed by Zan Dobersek. To illustrate this, I made legacy and modern decoders to WTF::String and transitioned one String decoder. * Platform/IPC/ArgumentCoder.h: * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * Platform/IPC/ArgumentCoders.h: * Platform/IPC/Decoder.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): 2017-09-05 Frederic Wang Use TilesBacking for iframes when async frame scrolling is enabled https://bugs.webkit.org/show_bug.cgi?id=173644 Reviewed by Simon Fraser. This patch adds creation of TilesBacking for non-main frames when async frame scrolling is enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect that tiled backing is not exclusive to the main frame. More adjustments might be needed for non-main frames and will be handled in follow-up commits. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Also use tiled backing when asyncFrameScrollingEnabled is true. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto. 2017-09-05 Carlos Garcia Campos [GTK] Rename PLUGIN_ARCHITECTURE(X11) as PLUGIN_ARCHITECTURE(UNIX) https://bugs.webkit.org/show_bug.cgi?id=176330 Reviewed by Michael Catanzaro. It's no longer X11 specific since it's also used in Wayland when the X11 target is enabled. It should be renamed as UNIX and make it available when building the wayland target even if the X11 on is disabled. * PlatformGTK.cmake: * PlatformWPE.cmake: * PluginProcess/unix/PluginProcessMainUnix.cpp: * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::tryLoad): * Shared/Plugins/Netscape/NetscapePluginModule.h: * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: Renamed from Source/WebKit/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp. * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::getPluginInfo): (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::PluginProcessProxy::scanPlugin): * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_InvalidateRect): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::initialize): (WebKit::NetscapePlugin::destroy): (WebKit::NetscapePlugin::geometryDidChange): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp: * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h: * config.h: 2017-09-05 Carlos Garcia Campos [GTK] Wrong use of PLUGIN_ARCHITECTURE(X11) in several places https://bugs.webkit.org/show_bug.cgi?id=176329 Reviewed by Michael Catanzaro. We are using PLUGIN_ARCHITECTURE(X11) in several places where we should actually be using PLATFORM(X11). This is confusing because PLUGIN_ARCHITECTURE(X11) is no longer specific to X11, it will be renamed as UNIX in a follow up patch. Because of this we only support plugins in Wayland when building with both X11 and Wayland targets enabled. * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginControllerProxy.h: * PluginProcess/unix/PluginProcessMainUnix.cpp: * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: (WebKit::NetscapePluginModule::determineQuirks): * Shared/Plugins/PluginQuirks.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/gtk/WebPageProxyGtk.cpp: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_GetValue): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::shouldLoadSrcURL): (WebKit::NetscapePlugin::initialize): * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp: (WebKit::NetscapePlugin::platformHandleMouseEvent): * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginProxy.cpp: * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginProxy.messages.in: * WebProcess/Plugins/PluginView.cpp: * WebProcess/Plugins/PluginView.h: 2017-09-04 Wenson Hsieh [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session https://bugs.webkit.org/show_bug.cgi?id=176264 Reviewed by Darin Adler. Move DataInteractionState from WKContentViewInteraction.h to DragDropInteractionState.h, and also rename it to DragDropInteractionState. Additionally, refactor drag and drop state in the UI process to capture metadata about the dragged element in a separate DragSourceState struct. This patch also moves drag and drop state transition logic that doesn't involve WKContentView internals out of WKContentView, and into the implementation of DragDropInteractionState. To support multiple drag items per session, we also introduce a simple mechanism to trace a UIDragItem back to the DragSourceState used to generate it. When generating a DragSourceState, we assign it a unique identifier, which we also set as the privateLocalContext of all UIDragItems generated when beginning the drag (this includes drag items returned by an internal client that uses one of the SPI hooks to augment drag items when starting a drag). This is subsequently used in the implementation of lift and cancellation preview delegate methods to supply the appropriate drag preview for each UIDragItem. Lastly, fix a bug wherein the pageX and pageY of mouse drag events are inconsistent with other synthetic mouse events, such as synthetic clicks. For synthetic clicks, the PlatformMouseEvent is initialized with the same position and globalPosition. Whether this is really intended is unclear (see http://webkit.org/b/173855), but it's a trivial change for now to keep mouse events on iOS consistent by tweaking the behavior during drag and drop. See Tools/ChangeLog for some more information. * Platform/spi/ios/UIKitSPI.h: Add -[UIDragItem privateLocalContext]. * UIProcess/ios/DragDropInteractionState.h: Added. (WebKit::DragDropInteractionState::stagedDragSource const): (WebKit::DragDropInteractionState::dropSessionDidExit): (WebKit::DragDropInteractionState::dropSessionWillPerformDrop): (WebKit::DragDropInteractionState::adjustedPositionForDragEnd const): (WebKit::DragDropInteractionState::didBeginDragging const): (WebKit::DragDropInteractionState::isPerformingDrop const): (WebKit::DragDropInteractionState::dragSession const): (WebKit::DragDropInteractionState::dropSession const): Wrap private drag/drop state member variables behind const getters, and move drag and drop logic that involves only the DragDropInteractionState into helper methods on DragDropInteractionState. (WebKit::DragDropInteractionState::BlockPtr _dragInteraction and _dataOperation => _dropInteraction. (uiImageForImage): Deleted. (shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted. (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]): Deleted. (-[WKContentView dragPreviewForCurrentDataInteractionState]): Deleted. (-[WKContentView _transitionDragPreviewToImageIfNecessary:]): Deleted. * WebKit.xcodeproj/project.pbxproj: 2017-09-03 Carlos Garcia Campos [Threaded Compositor] Deadlock in ThreadedDisplayRefreshMonitor https://bugs.webkit.org/show_bug.cgi?id=176296 Reviewed by Žan Doberšek. The main thread tries to schedule a display refresh monitor from RAF, requestDisplayRefreshMonitorUpdate() tries to take the attributes lock to update coordinateUpdateCompletionWithClient. The compositing thread has finished a frame and sceneUpdateFinished() takes the attributes lock to update clientRendersNextFrame and then asks the display refresh monitor if it requires a new callback. ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback() takes its lock to check the state, and requestDisplayRefreshMonitorUpdate() was called by ThreadedDisplayRefreshMonitor::requestRefreshCallback() with the display refresh monitor lock taken. So, the compositing thread has the attributes lock and wants the display refresh monitor one, and main thread has the display refresh monitor lock and wants the attributes one. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): Release the mutex before calling ThreadedCompositor::requestDisplayRefreshMonitorUpdate(). 2017-09-03 Zan Dobersek [GTK] Libgcrypt warning: missing initialization - please fix the application https://bugs.webkit.org/show_bug.cgi?id=171230 Reviewed by Michael Catanzaro. Replicate the libgcrypt initialization in the NetworkProcess entrypoint. This is required due to libgcrypt being used through digest operations originating from the certificate hash computation in SoupNetworkSession. The initialization is moved to the PAL library, and the initialize() function is now leveraged in both NetworkProcess and WebProcess entrypoints. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: (main): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2017-09-03 Zan Dobersek [WPE] Use the device scale factor value in WebPageCreationParameters https://bugs.webkit.org/show_bug.cgi?id=175377 Reviewed by Michael Catanzaro. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): WebPageCreationParameters::deviceScaleFactor value should be used to set the device scale factor on the given WebPage object. This enables correctly leveraging the scale factor for the WPE port which enters accelerated mode unconditionally and as such doesn't wait for the backing store update that would provide that value otherwise. 2017-09-03 Brent Fulgham [WK2][iOS] Remove unnecessary IOHIDEventServiceFastPathUserClient access https://bugs.webkit.org/show_bug.cgi?id=175947 Reviewed by Darin Adler. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-09-03 Dan Bernstein WKContentViewInteraction.mm includes redundant declaration of UIPreviewItemController's presentationSecondaryGestureRecognizer https://bugs.webkit.org/show_bug.cgi?id=176322 Reviewed by Darin Adler. * UIProcess/ios/WKContentViewInteraction.mm: Removed the declaration, which is already made in the SDK or in UIKitSPI.h. 2017-09-03 Timothy Horton Try to fix the iOS build * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (-[WKRemoteView initWithFrame:contextID:]): 2017-09-03 Tim Horton Fix some style issues in the Remote Layer Tree code https://bugs.webkit.org/show_bug.cgi?id=176298 Reviewed by Dan Bernstein. In bugs 176273 and 176297, the style bot noticed some existing style issues in the UI-side compositing code. Fix them, because there aren't many and they're straightforward. * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h: * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: 2017-09-03 Yusuke Suzuki String#utf8() allocates new CString https://bugs.webkit.org/show_bug.cgi?id=176302 Reviewed by Sam Weinig. * NetworkProcess/webrtc/NetworkRTCSocket.cpp: (WebKit::NetworkRTCSocket::sendTo): 2017-09-03 Tim Horton Move shared part of the Remote Layer Tree code out of a Mac-specific directory https://bugs.webkit.org/show_bug.cgi?id=176297 Reviewed by Dan Bernstein. UI-side compositing works on all Cocoa platforms, so the code should not live inside Mac/. Also merge the Scrolling directory in here, since those files are very related. * PlatformMac.cmake: * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: Renamed from Shared/mac/RemoteLayerBackingStore.h. * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: Renamed from Shared/mac/RemoteLayerBackingStore.mm. * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.h. * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.mm. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.h. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.mm. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: Renamed from Shared/mac/RemoteLayerTreeTransaction.h. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: Renamed from Shared/mac/RemoteLayerTreeTransaction.mm. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h. * WebKit.xcodeproj/project.pbxproj: 2017-09-03 Sam Weinig Remove CanvasProxy https://bugs.webkit.org/show_bug.cgi?id=176288 Reviewed by Yusuke Suzuki. CanvasProxy does not appear to be in any current HTML spec and was disabled and unimplemented in our tree. Time to get rid of it. * Configurations/FeatureDefines.xcconfig: 2017-09-02 Andy Estes [CA] Upstream QuartzCore-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176270 Reviewed by Tim Horton. * Platform/mac/LayerHostingContext.mm: (WebKit::LayerHostingContext::createForPort): (WebKit::LayerHostingContext::createForExternalHostingProcess): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::enterAcceleratedCompositingMode): (WebKit::PageClientImpl::updateAcceleratedCompositingMode): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::createLayer): * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: (WebKit::makeRenderLayer): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-02 Tim Horton Move UI Process part of the Remote Layer Tree code out of a Mac-specific directory https://bugs.webkit.org/show_bug.cgi?id=176273 Reviewed by Dan Bernstein. UI-side compositing works on all Cocoa platforms, so the code should not live inside Mac/. Also merge the Scrolling directory in here, since those files are very related. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: Renamed from SourceebKit/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm. * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: Renamed from UIProcess/mac/RemoteLayerTreeHost.h. * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: Renamed from UIProcess/mac/RemoteLayerTreeHost.mm. * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h. * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm. * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp. * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h. * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingTree.cpp. * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: Renamed from UIProcess/Scrolling/RemoteScrollingTree.h. * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: Renamed from UIProcess/ios/RemoteLayerTreeHostIOS.mm. * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Renamed from UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h. * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm. * WebKit.xcodeproj/project.pbxproj: 2017-09-02 Joseph Pecoraro Web Automation: -[_WKAutomationSession init] leaks https://bugs.webkit.org/show_bug.cgi?id=176268 Reviewed by Darin Adler. * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession init]): 2017-09-02 Tim Horton Fix some style issues in the Web Process part of the Remote Layer Tree code https://bugs.webkit.org/show_bug.cgi?id=176272 Reviewed by Dan Bernstein. In bug 176271, the style bot noticed some existing style issues in the UI-side compositing code. Fix them, because there aren't many and they're straightforward. * WebProcess/WebPage/Cocoa/RemoteLayerTree/GraphicsLayerCARemote.cpp: * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::setValues): * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::appendSublayer): (WebKit::PlatformCALayerRemote::insertSublayer): (WebKit::PlatformCALayerRemote::replaceSublayer): * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::clone const): * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeContext.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.h: * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.mm: 2017-09-02 Tim Horton Move Web Process part of the Remote Layer Tree code out of a Mac-specific directory https://bugs.webkit.org/show_bug.cgi?id=176271 Rubber-stamped by Dan Bernstein. UI-side compositing works on all Cocoa platforms, so the code should not live inside Mac/. Also merge the Scrolling directory in here, since those files are very related. * WebKit.xcodeproj/project.pbxproj: * DerivedSources.make: * PlatformMac.cmake: * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp. * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.h. * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.h. * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.cpp. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.h. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.h. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.mm. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm. * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.h. * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in. * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.mm. 2017-09-02 Carlos Garcia Campos [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data https://bugs.webkit.org/show_bug.cgi?id=176226 Reviewed by Michael Catanzaro. Do not create the cairo surface for BackingStoreBackendCairoImpl. When not using X11 we are going to use an image surface anyway, so we don't really need to use the create similar. This way we only need to pass the size and device scale factor to BackingStoreBackendCairoImpl that will create the image surface using fast malloc to allocate the data. * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::createBackend): 2017-09-02 Carlos Garcia Campos [GTK][Wayland] Opening FedoraProject's pastebin chews CPU https://bugs.webkit.org/show_bug.cgi?id=175942 Reviewed by Žan Doberšek. This regressed when we introduced the display refresh monitor. The monitor schedules updates immediately, because we removed the option to not do frame sync in X11 to let swapBuffers do the throttling, but that's not happening in Wayland because the nested compositor is dispatching frame callbacks on surface commit. We need to ensure that frame callbacks are dispatched on every monitor refresh, because swapBuffers waits for frame callbacks to be queued on display. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::~Surface): Destroy pending frame callbacks too. (WebKit::WaylandCompositor::Surface::setWebPage): Add a tick callback to the web view widget to flush all committed frame callbacks on every frame update. (WebKit::WaylandCompositor::Surface::requestFrame): Add the callbacks to m_pendingFrameCallbackList. (WebKit::WaylandCompositor::Surface::flushFrameCallbacks): Dispatch all committed frame callabcks. (WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks): Dispatch all pending frame callbacks. (WebKit::WaylandCompositor::Surface::commit): Do not dispatch frame callbacks here, move them to the list of committed frame callbacks that will be dispatched on the next frame clock update. * UIProcess/gtk/WaylandCompositor.h: (WebKit::WaylandCompositor::Surface::setWebPage): Moved to the cpp. * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp: (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): Move surface initialization and destruction to the compositing thread. (WebKit::AcceleratedSurfaceWayland::initialize): (WebKit::AcceleratedSurfaceWayland::finalize): (WebKit::AcceleratedSurfaceWayland::~AcceleratedSurfaceWayland): Deleted. * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h: 2017-09-01 Youenn Fablet Do not Reject CacheStorage promises when updating the persistent filesystem data fails https://bugs.webkit.org/show_bug.cgi?id=176241 Reviewed by Alex Christensen. Open/Remove caches may succeed in the memory representation but the write-to-disk operation may fail. In that case, the callback does not return an error but a value containing the cache identifier. The value will also contain a boolean flag set to true to notify the client that persistent storage failed this time. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): * NetworkProcess/cache/CacheStorageEngineCaches.h: 2017-09-01 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's toolbarsAreVisible https://bugs.webkit.org/show_bug.cgi?id=176246 Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::toolbarsAreVisible): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::toolbarsAreVisible): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::getToolbarsAreVisible): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: 2017-09-01 Alex Christensen Make PageClientImplCocoa a proper superclass of PageClientImpls for Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=176239 Reviewed by Tim Horton. * UIProcess/Cocoa/PageClientImplCocoa.h: Added. (WebKit::PageClientImplCocoa::PageClientImplCocoa): * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::isPlayingAudioWillChange): (WebKit::PageClientImplCocoa::isPlayingAudioDidChange): (WebKit::PageClientImpl::isPlayingAudioWillChange): Deleted. (WebKit::PageClientImpl::isPlayingAudioDidChange): Deleted. * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::PageClientImpl): * UIProcess/mac/PageClientImpl.h: Removed. * UIProcess/mac/PageClientImpl.mm: Removed. * UIProcess/mac/PageClientImplMac.h: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.h. * UIProcess/mac/PageClientImplMac.mm: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.mm. (WebKit::PageClientImpl::PageClientImpl): * UIProcess/mac/WebContextMenuProxyMac.mm: * UIProcess/mac/WebPageProxyMac.mm: * UIProcess/mac/WebPopupMenuProxyMac.mm: * WebKit.xcodeproj/project.pbxproj: 2017-09-01 Alex Christensen Replace WKUIDelegatePrivate's isPlayingMediaDidChange with KVO _isPlayingAudio on WKWebView https://bugs.webkit.org/show_bug.cgi?id=176212 Reviewed by Tim Horton. Dan suggested this in bug 176203, I think it's a good idea, and I'll need to add more KVO properties soon anyways so I'd better learn how. Determining if audio playing changed is important for Safari, so WKPageUIClient's isPlayingAudioDidChange was correctly named but incorrectly fired if either audio or video playing changed and had you check if audio was playing, possibly too often. * UIProcess/API/APIUIClient.h: (API::UIClient::isPlayingMediaDidChange): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isPlayingAudio]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange): Deleted. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::isPlayingAudioWillChange): (WebKit::WebViewImpl::isPlayingAudioDidChange): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::isPlayingAudioDidChange): (WebKit::PageClientImpl::isPlayingAudioWillChange): 2017-09-01 Alex Christensen Disable ObjC WebGL policy SPI on iOS https://bugs.webkit.org/show_bug.cgi?id=176233 Reviewed by Tim Horton. In r221465 I uploaded new SPI that is only needed on Mac with a beautiful test that only works on Mac. Since it fails on iOS and is not needed on iOS, let's just disable it on iOS. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): 2017-09-01 Andy Estes [CG] Upstream CoreGraphics-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176200 Reviewed by Tim Horton. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): * UIProcess/mac/WindowServerConnection.h: * UIProcess/mac/WindowServerConnection.mm: (WebKit::registerOcclusionNotificationHandler): (WebKit::WindowServerConnection::WindowServerConnection): (WebKit::WindowServerConnection::applicationWindowModificationsStarted): Deleted. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-09-01 Per Arne Vollan [Win] Compile error, 'Cache' is not declared. https://bugs.webkit.org/show_bug.cgi?id=176062 Reviewed by Youenn Fablet. Rename DOMCache to DOMCacheEngine. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::queryCache): (WebKit::CacheStorage::Engine::writeFile): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): * NetworkProcess/cache/CacheStorageEngineCaches.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * WebProcess/Cache/WebCacheStorageConnection.cpp: * WebProcess/Cache/WebCacheStorageConnection.h: * WebProcess/Cache/WebCacheStorageConnection.messages.in: 2017-08-31 Andy Estes [Mac] Upstream AppKit-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176175 Reviewed by Brady Eidson. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::initializeCocoaOverrides): * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): * UIProcess/mac/WKTextInputWindowController.mm: (-[WKTextInputPanel init]): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-08-31 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's isPlayingAudioDidChange https://bugs.webkit.org/show_bug.cgi?id=176203 Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::isPlayingMediaDidChange): (API::UIClient::isPlayingAudioDidChange): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): 2017-08-31 Alex Christensen Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy https://bugs.webkit.org/show_bug.cgi?id=175779 Reviewed by Tim Horton. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::webGLLoadPolicy const): (API::NavigationClient::resolveWebGLLoadPolicy const): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::toWebCoreWebGLLoadPolicy): (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const): (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::webGLPolicyForURL): (WebKit::WebPageProxy::resolveWebGLPolicyForURL): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::webGLPolicyForURL const): (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::webGLPolicyForURL): (WebKit::WebPage::resolveWebGLPolicyForURL): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::webGLPolicyForURL): (WebKit::WebPage::resolveWebGLPolicyForURL): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::webGLPolicyForURL): (WebKit::WebPage::resolveWebGLPolicyForURL): 2017-08-31 Brady Eidson Add (entirely incorrect) fetching of ServiceWorker scripts. https://bugs.webkit.org/show_bug.cgi?id=176179 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::finishFetchingScriptInServer): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-08-31 Megan Gardner Fix error in protocol revving https://bugs.webkit.org/show_bug.cgi?id=176191 Protocol definition was mastered out of later iOS submissions, causing them to not build. Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]): 2017-08-31 Youenn Fablet Update CacheStorage caches only if it is updated https://bugs.webkit.org/show_bug.cgi?id=176135 Reviewed by Alex Christensen. For each change to CacheStorageEngineCaches list of cache, CacheStorageEngineCaches increments a counter. When sending the list of caches, CacheStorageEngineCaches will compare its counter with the one provided. If they sare the same, CacheStorageEngineCaches will return nothing. Otherwise it returns the whole list of caches. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveCaches): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::Caches::clearMemoryRepresentation): (WebKit::CacheStorage::Caches::cacheInfos const): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::updateCounter const): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::caches): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doRetrieveCaches): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-08-31 Youenn Fablet Introduce CacheStorageEngineCache to handle cache records https://bugs.webkit.org/show_bug.cgi?id=176137 Reviewed by Alex Christensen. CacheStorageEngineCache is the equivalent of WebCore Cache. It contains a list of records that it needs to manage (add, update, remove). Moving the logic of this management from CacheStorageEngine to this new class so as to ease future development. * CMakeLists.txt: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): (WebKit::CacheStorage::Engine::cache): (WebKit::CacheStorage::Engine::writeCacheRecords): Deleted. (WebKit::CacheStorage::Engine::removeCacheRecords): Deleted. (WebKit::CacheStorage::Engine::queryCache): Deleted. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: Added. * NetworkProcess/cache/CacheStorageEngineCache.h: (WebKit::CacheStorage::Cache::identifier const): (WebKit::CacheStorage::Cache::name const): (WebKit::CacheStorage::Cache::info const): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::find): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::encodeCacheNames): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::cacheInfos const): * WebKit.xcodeproj/project.pbxproj: 2017-08-31 David Quesada WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading https://bugs.webkit.org/show_bug.cgi?id=176128 rdar://problem/34068476 Reviewed by Brady Eidson. _webView:didPerformClientRedirect: isn't useful for delegates that want to know about client redirects started before the document is finished loading. This is because the method would be called after the navigation scheduler's timer fires and the navigation for the redirect has begun. Since this happens in a later iteration of the run loop, the document has already finished loading. Address this by replacing the method with two that give the navigation delegate more information about when client redirects are scheduled and canceled. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::willPerformClientRedirect): (API::NavigationClient::didCancelClientRedirect): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::willPerformClientRedirect): (WebKit::NavigationState::NavigationClient::didCancelClientRedirect): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willPerformClientRedirectForFrame): (WebKit::WebPageProxy::didCancelClientRedirectForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-08-30 Megan Gardner Remove IsBlockSelection flag https://bugs.webkit.org/show_bug.cgi?id=176141 Reviewed by Dean Jackson. Block selection is disabled. Removed code associated with this flag to allow removal of the flag in UIKit. No tests for a removed feature. * Platform/spi/ios/UIKitSPI.h: * Shared/ios/GestureTypes.h: * UIProcess/ios/WKContentViewInteraction.mm: (toUIWKSelectionFlags): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::contractedRangeFromHandle): (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): (WebKit::WebPage::updateBlockSelectionWithTouch): (WebKit::WebPage::updateSelectionWithTouches): 2017-08-30 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's didClickAutoFillButton https://bugs.webkit.org/show_bug.cgi?id=176139 Reviewed by Tim Horton. Covered by a cool new API test! * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didClickAutoFillButton): 2017-08-31 Chris Dumez Use WTF::crossThreadCopy() in more places https://bugs.webkit.org/show_bug.cgi?id=176169 Reviewed by Andreas Kling. Use WTF::crossThreadCopy() in more places to make code more concise. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): 2017-08-31 Youenn Fablet Take into account removed caches in Caches::remove assertion https://bugs.webkit.org/show_bug.cgi?id=176164 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::remove): 2017-08-31 Youenn Fablet Do not create a salt if the CacheStorage engine should not persist https://bugs.webkit.org/show_bug.cgi?id=176138 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::~Engine): Ensuring that Caches will not try using the engine if it goes away. (WebKit::CacheStorage::Engine::initialize): Removing making a salt if engine data is not persistent. * NetworkProcess/cache/CacheStorageEngine.h: Check persistency according the root path. If it is null, caches should not try to do persistency. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::cachesRootPath): (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::detach): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::writeCachesToDisk): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::shouldPersist const): * NetworkProcess/cache/NetworkCacheData.cpp: Making makeSalt private again. (WebKit::NetworkCache::makeSalt): * NetworkProcess/cache/NetworkCacheData.h: 2017-08-31 Carlos Garcia Campos [GTK] Several InputMethodFilter tests are failing and crashing https://bugs.webkit.org/show_bug.cgi?id=176158 Reviewed by Carlos Alberto Lopez Perez. * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::confirmCurrentComposition): Return early in testing mode because the page is not available. (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting): Use hexadecimal numbers for logging key codes. 2017-08-31 Carlos Garcia Campos [GTK][Wayland] Crash when gdk_keymap_get_entries_for_keyval returns TRUE but n_keys=0 https://bugs.webkit.org/show_bug.cgi?id=176154 Reviewed by Carlos Alberto Lopez Perez. In Wayland gdk_keymap_get_entries_for_keyval() can return TRUE with n_keys=0. We have several places in WebKit where we just check the return value of gdk_keymap_get_entries_for_keyval() and then use the returned array to get the first position assuming it has at least one item. This has always worked in X11 because the GDK X11 backend does the right thing, but it's crashing in Wayland now. It should be fixed in GTK+ but in the meantime it's easy to workaround by also checking n_keys > 0. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::doKeyStrokeEvent): 2017-08-30 Dan Bernstein [iOS] REGRESSION (r218144) -[WKContentView targetForAction:withSender:] returns the content view for actions implemented only by the WKWebView, causing a crash https://bugs.webkit.org/show_bug.cgi?id=176077 Reviewed by Sam Weinig. Test: TestWebKitAPI/Tests/WebKitCocoa/WKContentViewTargetForAction.mm * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView targetForAction:withSender:]): Override and forward WKContentView actions to -[WKContentView targetForActionForWebView:withSender:]. * UIProcess/ios/WKContentViewInteraction.h: Declare -targetForActionForWebView:withSender:. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView targetForAction:withSender:]): Forward to the WKWebView. (-[WKContentView targetForActionForWebView:withSender:]): Call super’s -targetForAction:withSender:. 2017-08-30 Brent Fulgham Fix whitespace and formatting https://bugs.webkit.org/show_bug.cgi?id=176134 Reviewed by Sam Weinig. Bring the file formatting into compliance with WebKit Coding Style. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]): (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]): (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]): (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]): (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]): (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]): (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]): (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]): (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]): (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]): 2017-08-30 Youenn Fablet Remove the list of removed caches from CacheStorageEngine https://bugs.webkit.org/show_bug.cgi?id=176136 Reviewed by Alex Christensen. This list is no longer useful as CacheStorageEngineCaches handles its own removed caches. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::cache): * NetworkProcess/cache/CacheStorageEngine.h: 2017-08-30 Tim Horton REGRESSION (r221068): Graphics corruption when dragging images on iOS https://bugs.webkit.org/show_bug.cgi?id=176132 Reviewed by Dean Jackson. * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::encode): Color space encoding was entirely disabled on iOS, so after r221068, ShareableBitmap would make different decisions about image format on both sides of the wire. Enable color space encoding on iOS (decoding is already implemented) by moving some ifdefs around. 2017-08-30 Youenn Fablet [Cache API] Support cache names persistency https://bugs.webkit.org/show_bug.cgi?id=175995 Reviewed by Alex Christensen. Adding disk read/write capacities to CacheStorage engine. This is used to store per-origin cache names in a file. Making Engine a thread safe refcounted object so that it does read/write in a background thread. Introducing CacheStorage::Caches as the object managing the list of Cache objects for a given origin. Caches will be responsible to do all the read/write operations for all of its caches. It will be responsible for quota limitation as well. Moving part of the logic from CacheStorage::Engine into CacheStorage::Caches. CacheStorage::Engine is initialized asynchronously as it first creates a salt which is used to obfuscate the names of the various files stored on disk. In the same spirit, CacheStorage::Caches is initialized asynchronously as it needs to read from the disk the list of cache names. Once read, the names will be stored in memory. Added the possibility to clear this in-memory representation. This will be useful for testing. This might also be useful to save memory when there is no more use of CacheStorage by web pages. Introducing a new cacheStorageSubdirectoryName parameter for WebsiteDataStore so as to segment the different per session CacheStorageEngine in direct sub folders of the main cacheStorageDirectory folder. * CMakeLists.txt: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::initialize): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::cache): (WebKit::CacheStorage::Engine::writeFile): Making use of default parameter to directly return to the main loop. (WebKit::CacheStorage::Engine::readFile): Ditto. (WebKit::CacheStorage::Engine::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngine.h: (WebKit::CacheStorage::Engine::rootPath const): (WebKit::CacheStorage::Engine::salt const): (WebKit::CacheStorage::Engine::nextCacheIdentifier): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: Added. (WebKit::CacheStorage::cachesRootPath): (WebKit::CacheStorage::cachesListFilename): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::initialize): (WebKit::CacheStorage::Caches::find): (WebKit::CacheStorage::Caches::open): (WebKit::CacheStorage::Caches::remove): (WebKit::CacheStorage::encodeCacheNames): (WebKit::CacheStorage::decodeCachesNames): (WebKit::CacheStorage::Caches::readCachesFromDisk): (WebKit::CacheStorage::Caches::writeCachesToDisk): (WebKit::CacheStorage::Caches::clearMemoryRepresentation): (WebKit::CacheStorage::Caches::cacheInfos const): * NetworkProcess/cache/CacheStorageEngineCaches.h: Added. (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::isInitialized const): (WebKit::CacheStorage::Caches::detach): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::makeSalt): * NetworkProcess/cache/NetworkCacheData.h: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::clearMemoryRepresentation): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-08-30 Brady Eidson Add "Identified" base class to replace a whole bunch of custom identifier generators. https://bugs.webkit.org/show_bug.cgi?id=176120 Reviewed by Alex Christensen. * UIProcess/API/APIUserScript.cpp: (API::UserScript::UserScript): (API::generateIdentifier): Deleted. * UIProcess/API/APIUserScript.h: * UIProcess/API/APIUserStyleSheet.cpp: (API::UserStyleSheet::UserStyleSheet): (API::generateIdentifier): Deleted. * UIProcess/API/APIUserStyleSheet.h: * UIProcess/UserContent/WebScriptMessageHandler.cpp: (WebKit::WebScriptMessageHandler::WebScriptMessageHandler): (WebKit::generateIdentifier): Deleted. * UIProcess/UserContent/WebScriptMessageHandler.h: (WebKit::WebScriptMessageHandler::identifier const): Deleted. * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy): (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy): (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::removeProcess): (WebKit::WebUserContentControllerProxy::addUserContentWorldUse): (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses): (WebKit::WebUserContentControllerProxy::addUserScript): (WebKit::WebUserContentControllerProxy::removeUserScript): (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::addUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers): (WebKit::WebUserContentControllerProxy::addContentRuleList): (WebKit::WebUserContentControllerProxy::removeContentRuleList): (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists): (WebKit::generateIdentifier): Deleted. * UIProcess/UserContent/WebUserContentControllerProxy.h: (WebKit::WebUserContentControllerProxy::identifier const): Deleted. * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::~VisitedLinkStore): (WebKit::VisitedLinkStore::VisitedLinkStore): (WebKit::VisitedLinkStore::addProcess): (WebKit::VisitedLinkStore::removeProcess): (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired): (WebKit::VisitedLinkStore::sendTable): (WebKit::generateIdentifier): Deleted. * UIProcess/VisitedLinkStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::generateIdentifier): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::identifier const): Deleted. * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::WebSocketStream): (WebKit::WebSocketStream::~WebSocketStream): (WebKit::WebSocketStream::messageSenderDestinationID): * WebProcess/Network/WebSocketStream.h: 2017-08-30 Brady Eidson Implement all of "Register" right up until where the script is fetched. https://bugs.webkit.org/show_bug.cgi?id=176082 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::resolveJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2017-08-30 Andy Estes [Mac] Upstream Accessibility-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176093 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setAccessibilityWebProcessToken): (WebKit::WebViewImpl::updateRemoteAccessibilityRegistration): (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformInitialize): (WebKit::WebPage::registerUIProcessAccessibilityTokens): 2017-08-30 Carlos Alberto Lopez Perez [WPE] Enable MEMORY_SAMPLER https://bugs.webkit.org/show_bug.cgi?id=176099 Reviewed by Michael Catanzaro. Enable it at runtime if the environment variable WEBKIT_SAMPLE_MEMORY is set. * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_compositingManagerProxy): 2017-08-30 Andy Estes [Mac] Upstream Carbon-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176087 Reviewed by Alex Christensen. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::cgWindowID): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::scriptCodeFromCurrentKeyboardInputSource): (WebKit::NetscapePlugin::sendComplexTextInput): 2017-08-30 Carlos Garcia Campos Unreviewed. Try to fix layout test timing out after r221344. There seems to be an infinite loop in the web process when WebPage::platformEditorState is called with non content editable result. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformEditorState const): 2017-08-29 Carlos Garcia Campos REGRESSION(r221064): [GTK] Editor not correctly working after r221064 https://bugs.webkit.org/show_bug.cgi?id=176052 Reviewed by Michael Catanzaro. Since r221064 we are not always notified about typing attributes when editor state changes. didChangeSelection no longer includes the typing attributes in EditorStateChange message, it's scheduled to be sent after the compositing layer have been flushed, but that part is not implemented for GTK+ port. Fixes test /webkit2/WebKitWebView/editor-state/typing-attributes. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::updateBackingStoreState): Call WebPage::flushPendingEditorStateUpdate() after the layout. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): Call WebPage::flushPendingEditorStateUpdate() after the display sync. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::display): Call WebPage::flushPendingEditorStateUpdate() after the layout. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformEditorState const): Also return early, setting isMissingPostLayoutData to true, when there's no frame view, the view needs a layout or the result is not for editable content. 2017-08-29 Brent Fulgham ResourceLoadStatistics logic does not understand custom WebsiteData stores https://bugs.webkit.org/show_bug.cgi?id=176037 Reviewed by Alex Christensen. The NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains always notifies the default website data store about observations it has made. This should be revised so that WebKit clients that register custom data stores through the WKWebsiteDataStores API can be assured that observations made in one session do not manipulate data from another session. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Use the passed sessionID to locate the correct NetworkStorageSession to notify about the new partitioning data. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: Accept new argument. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Include the WebsiteDataStore's session ID in the message to update cookie partition data. 2017-08-29 Alex Christensen Automatically determine if a class has a modern decoder https://bugs.webkit.org/show_bug.cgi?id=176084 Reviewed by Sam Weinig. Instead of determining if ModernDecoder is defined in the class, just check the signature of the decode member function. * Platform/IPC/ArgumentCoder.h: (): Deleted. * Shared/WebPageCreationParameters.h: * Shared/WebPageGroupData.h: * Shared/WebsitePolicies.h: 2017-08-29 Alex Christensen Begin transition to modern IPC decoding https://bugs.webkit.org/show_bug.cgi?id=176043 Reviewed by JF Bastien. Right now, if a class is decoded from IPC we must have a default constructor. This prevents us from having Ref or C++ references in such types, which is cluttering up our code. This is because IPC::decode makes a default-constructed object, fills it, and returns a bool indicating success. Making IPC::decode instead return a std::optional makes it so we do not need to call an empty constructor. This could also enable us to add IPC::Decoder::operator>> and other fun things! I also modernized two arbitrary classes, WebsitePolicies and WebPageGroupData with more to come. There's no good way to update the actual generated IPC code until each class has been transitioned. * Platform/IPC/ArgumentCoder.h: (IPC::ArgumentCoder::decode): * Platform/IPC/Decoder.h: (IPC::Decoder::decode): * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * Shared/WebPageGroupData.cpp: (WebKit::WebPageGroupData::decode): * Shared/WebPageGroupData.h: * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::decode): 2017-08-29 Youenn Fablet Setting the cache storage engine root path according the session WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=176055 Reviewed by Alex Christensen. Adding disk read/write capacities to CacheStorage engine. This is used to store per-origin cache names in a file. Making Engine a thread safe refcounted object so that it does read/write in a background thread. Setting the root path of the engine to the directory set for the session in use according the WebsiteDataStore. For each WebsiteDataStore, a path and a sandbox extension is passed to the network process if persistency of the cache storage is wanted. Ephemeral sessions will set the path of the engine to null so that no read/write access is performed. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::cacheStorageDirectory const): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::from): (WebKit::CacheStorage::Engine::defaultEngine): (WebKit::CacheStorage::Engine::Engine): (WebKit::CacheStorage::Engine::writeFile): * NetworkProcess/cache/CacheStorageEngine.h: (WebKit::CacheStorage::Engine::create): (WebKit::CacheStorage::Engine::shouldPersist const): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2017-08-29 Chris Dumez Add initial support for dataTransferItem.webkitGetAsEntry() https://bugs.webkit.org/show_bug.cgi?id=176038 Reviewed by Wenson Hsieh. Make dataTransfer.items an experimental feature so that it can be easily turned on from the Develop menu, for testing convenience. * Shared/WebPreferencesDefinitions.h: 2017-08-29 Andy Estes [Mac] Upstream WKSetMetadataURL() from WebKitSystemInterface https://bugs.webkit.org/show_bug.cgi?id=176046 Reviewed by Alex Christensen. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-08-28 Andy Estes [Cocoa] Upstream WKGetWebDefaultCFStringEncoding() https://bugs.webkit.org/show_bug.cgi?id=176039 Reviewed by Alex Christensen. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2017-08-28 Megan Gardner Fix incorrect enum in atBoundaryOfGranularity call https://bugs.webkit.org/show_bug.cgi?id=176004 Reviewed by Wenson Hsieh and Enrica Casucci Enum that was being used was incorrect, as that case in not covered in called function. Resulted in a no-op. Should now have correct behavior around line boundaries. Not possible to add tests for selections with velocity. Will attempt to add this behavior later. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::rangeAtWordBoundaryForPosition): 2017-08-28 Stephan Szabo [WinCairo] Add PlatformWin cmake for Webkit https://bugs.webkit.org/show_bug.cgi?id=176027 Reviewed by Brent Fulgham. * PlatformWin.cmake: Added. 2017-08-28 Andy Estes [Cocoa] Upstream CFNetwork-related WebKitSystemInterface functions https://bugs.webkit.org/show_bug.cgi?id=176032 Reviewed by Alex Christensen. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::privateBrowsingSession): * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformHasLocalDataForURL): (WebKit::cachedResponseForURL): 2017-08-28 Brent Fulgham Disable access to secure cookies if an HTTPS site loads mixed content (Part 2: Header Requests) https://bugs.webkit.org/show_bug.cgi?id=175992 Reviewed by Daniel Bates. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Use a better label than 'result'. (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): Modify to accept a flag indicating if secure cookies should be included, and return a pair containing the resulting cookie string and a boolean indicating if secure cookies were accessed. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Ditto. * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Ditto. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Ditto. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-08-28 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's didExceedBackgroundResourceLimitWhileInForeground https://bugs.webkit.org/show_bug.cgi?id=176028 Reviewed by Andy Estes. An API test for this did not succeed with either the memory or CPU limit calls, possibly because the app must be in the foreground for this call to be made. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKResourceLimit): (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground): 2017-08-28 Carlos Garcia Campos WebDriver: implement screen capture commands https://bugs.webkit.org/show_bug.cgi?id=174615 Reviewed by Brian Burg. Extend takeScreenshot command to optionally take a screenshot of an element. When no element is provided, the screenshot is taken from the page visible area. * PlatformGTK.cmake: Add WebAutomationSessionCairo.cpp to compilation. * PlatformWPE.cmake: Ditto. * UIProcess/Automation/Automation.json: Add ScreenshotError and several optional parameters to takeScreenshot. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::takeScreenshot): Receive optional frame, node and scrollIntoView that are checked and passed to the web process. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: Added. (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): Cairo implementation. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::snapshotRectForScreenshot): Helper to get the rectangle to be used for a screenshot. (WebKit::WebAutomationSessionProxy::takeScreenshot): If a node handle is provided take the snapshot using the element rectangle, otherwise use the page visible content rectangle. * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Update TakeSnapshot message. 2017-08-28 Carlos Garcia Campos Automation: takeScreenshot should use the visible content rect not the document rect https://bugs.webkit.org/show_bug.cgi?id=175665 Reviewed by Brian Burg. According to the spec, we should get the toplevel browsing context document rectangle and take a screenshot of it using the current viewport width and height. We are currently using the document size. 19. Screen Capture. https://w3c.github.io/webdriver/webdriver-spec.html#dfn-draw-a-bounding-box-from-the-framebuffer * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::takeScreenshot): Use FrameView::visibleContentRect(). 2017-08-28 Carlos Garcia Campos [GTK][WPE] ASSERTION FAILED: !isOpen() in WebKit::IconDatabase::~IconDatabase() https://bugs.webkit.org/show_bug.cgi?id=175719 Reviewed by Michael Catanzaro. This is happening always when running /webkit2/WebKitFaviconDatabase/favicon-database-test in debug builds. The last step we do is removing all icons, then the test finishes, which destroys the WebKitFaviconDatabase object that closes the icon database on dispose. The problem is that removing all icons schedules a main thread notification and IconDatabase is not considered closed until all main thread callbacks have been dispatched. This is never going to happen in the test, because the main loop is no longer running at that point. I don't think it's worth it to consider the database open while main thread callbacks are pending, they are just notifications and the client is no longer insterested on them afer closing the database. I think it's bettter and simpler to simply cancel the pending callbacks on database close. That ensures that isOpen() after close() is always false. This patch adds a helper private class to schedule notifications to the main thread that can be cancelled on database close. It also removes the didClose() notification because it was unused and because it's pointless now that we know the database is closed after close(). * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::open): Mark the main thread notifier as active. (WebKit::IconDatabase::close): Mark the main thread notifier as not active. (WebKit::IconDatabase::IconDatabase): Remove m_mainThreadCallbackCount initialization. (WebKit::IconDatabase::isOpen const): Do what isOpenBesidesMainThreadCallbacks() used to do. (WebKit::IconDatabase::removeAllIconsOnThread): Remove the notification because it's currently unused. (WebKit::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread): Use MainThreadNotifier. (WebKit::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread): Ditto. (WebKit::IconDatabase::dispatchDidFinishURLImportOnMainThread): Ditto. (WebKit::IconDatabase::isOpenBesidesMainThreadCallbacks const): Deleted. (WebKit::IconDatabase::checkClosedAfterMainThreadCallback): Deleted. (WebKit::IconDatabase::dispatchDidRemoveAllIconsOnMainThread): Deleted. * UIProcess/API/glib/IconDatabase.h: (WebKit::IconDatabaseClient::didChangeIconForPageURL): (WebKit::IconDatabaseClient::didFinishURLImport): (WebKit::IconDatabase::MainThreadNotifier::MainThreadNotifier): (WebKit::IconDatabase::MainThreadNotifier::setActive): (WebKit::IconDatabase::MainThreadNotifier::notify): (WebKit::IconDatabase::MainThreadNotifier::stop): (WebKit::IconDatabase::MainThreadNotifier::timerFired): (WebKit::IconDatabaseClient::didRemoveAllIcons): Deleted. (WebKit::IconDatabaseClient::didClose): Deleted. 2017-08-27 Wenson Hsieh Picking an emoji via the emoji dialog (Ctrl+Cmd+Space) fires inconsistent beforeinput events. https://bugs.webkit.org/show_bug.cgi?id=170955 Reviewed by Ryosuke Niwa. Currently, we insert text with TextEventInputAutocompletion as the text event input type if any text range to replace was specified by the platform. Instead, limit this only to when the text replacement range is not empty. This more closely matches the intention of the spec, which states that the "insertReplacementText" inputType should be used when "[replacing] existing text by means of a spell checker, auto-correct or similar". * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertTextAsync): 2017-08-27 Wenson Hsieh [iOS WK2] Web process crashes after changing selection to the end of the document when speaking a selection https://bugs.webkit.org/show_bug.cgi?id=176011 Reviewed by Ryosuke Niwa. Adds an SPI hook to test accessibility codepaths when speaking selected content. This patch does some minor refactoring by introducing _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:, which takes and invokes a completion handler block. The existing _accessibilityRetrieveRectsAtSelectionOffset:withText: method simply turns around and calls the former variant with `nil` as a completion handler. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:]): (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::visiblePositionForPositionWithOffset): Deleted. 2017-08-25 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's saveDataToFileInDownloadsFolder https://bugs.webkit.org/show_bug.cgi?id=176000 Reviewed by Andy Estes. Covered by a new API test. * Shared/Cocoa/WKNSData.h: (wrapper): Deleted. * UIProcess/API/APIUIClient.h: (API::UIClient::saveDataToFileInDownloadsFolder): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder): (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::url const): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::savePDFToFileInDownloadsFolder): * WebProcess/WebPage/WebPage.h: 2017-08-25 David Kilzer Fix -Wunused-lambda-capture warnings in WebKit with new clang compiler Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveCaches): Remove unused lambda capture for 'this'. (WebKit::CacheStorage::Engine::putRecords): Remove unused lambda capture for 'cacheIdentifier'. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::records): Ditto. 2017-08-25 Brian Burg Web Automation: add capabilities to control ICE candidate filtering and insecure media capture https://bugs.webkit.org/show_bug.cgi?id=175563 Reviewed by Joseph Pecoraro. * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): Translate new capabilities to _WKAutomationSessionConfiguration properties. 2017-08-24 Brian Burg Web Automation: use automation session configurations to propagate per-session settings https://bugs.webkit.org/show_bug.cgi?id=175562 Reviewed by Joseph Pecoraro. Some WebDriver capabilities need WebKit support in order to be implemented correctly. There is currently no easy way to forward WebDriver capability keys and values to WebKit at session creation time. This is unfortunate, as it would be best to implement many of them via existing mechanisms (i.e., WKPreferences properties) that need to be set up before any windows are opened in the session. This patch adds WebKit-side plumbing to forward named capabilities from a remote WebDriver client to the _WKAutomationSession and its delegate in WebKit2 UIProcess. These capabilities are exposed via API in ways that abstract away details of how the capabilities are represented in RWI wire protocol messages. In the Cocoa API, these capabilities are exposed via a session configuration object that's similar to WKWebView's WKWebViewConfiguration. A session's configuration is copied and used at initialization and cannot be modified after the session is created. Code in the Cocoa subclass of API::AutomationClient translates between RWI protocol capability names and property values on the _WKAutomationSessionConfiguration it uses to request a new session. Later patches will hook up the two properties present in the configuration in this patch. Most of this patch is just generic plumbing without doing any capability-specific work. * UIProcess/API/Cocoa/_WKAutomationDelegate.h: * UIProcess/API/Cocoa/_WKAutomationSession.h: * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession init]): (-[_WKAutomationSession initWithConfiguration:]): (-[_WKAutomationSession configuration]): * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAutomationDelegate.h. * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.h. (-[_WKAutomationSessionConfiguration init]): (-[_WKAutomationSessionConfiguration description]): * UIProcess/Cocoa/AutomationClient.h: * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::AutomationClient): (WebKit::AutomationClient::requestAutomationSession): (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): * WebKit.xcodeproj/project.pbxproj: 2017-08-25 Brady Eidson Introduce ServerWorkerRegistration task queues. https://bugs.webkit.org/show_bug.cgi?id=175851 Reviewed by Andy Estes. * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::WebSWServerConnection): * StorageProcess/ServiceWorker/WebSWServerConnection.h: (WebKit::WebSWServerConnection::identifier const): Deleted. * WebProcess/Storage/WebSWClientConnection.h: (WebKit::WebSWClientConnection::identifier const): Deleted. 2017-08-25 Youenn Fablet [Cache API] UIProcess should provide the directory path where to store Cache Storage data https://bugs.webkit.org/show_bug.cgi?id=175884 Unreviewed. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Fixing typo. 2017-08-25 Jonathan Bedard Fix build breakage with Public iOS 11 SDK https://bugs.webkit.org/show_bug.cgi?id=175960 Reviewed by Wenson Hsieh. * Platform/spi/ios/UIKitSPI.h: Add UIURLDragPreviewView declaration. 2017-08-24 Chris Dumez [Directory Upload] Add basic support for input.webkitdirectory https://bugs.webkit.org/show_bug.cgi?id=175950 Reviewed by Geoffrey Garen. Add private API to toggle Directory Upload support. Add new member to WKOpenPanelParameters to communicate to the client that the file picker should allow selecting directories. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebPreferencesDefinitions.h: * UIProcess/API/APIOpenPanelParameters.h: (API::OpenPanelParameters::allowDirectories const): * UIProcess/API/C/WKOpenPanelParametersRef.cpp: (WKOpenPanelParametersGetAllowsDirectories): * UIProcess/API/C/WKOpenPanelParametersRef.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDirectoryUploadEnabled): (WKPreferencesGetDirectoryUploadEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKOpenPanelParameters.h: * UIProcess/API/Cocoa/WKOpenPanelParameters.mm: (-[WKOpenPanelParameters allowsDirectories]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-24 Youenn Fablet [Cache API] UIProcess should provide the directory path where to store Cache Storage data https://bugs.webkit.org/show_bug.cgi?id=175884 Reviewed by Brady Eidson. Adding API to set the cache storage directory path. Updating IPC to pass this parameter with its sandbox extension to NetworkProcess at creation time. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::cacheStorageDirectory const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithLegacyOptions): (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultCacheStorageDirectory): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory): * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-08-24 Alex Christensen Add WKUIDelegatePrivate equivalent of WKPageUIClient's handleAutoplayEvent https://bugs.webkit.org/show_bug.cgi?id=175965 Reviewed by Tim Horton. Covered by updating API tests to use UIDelegate instead of _pageForTesting and WKPageUIClient. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKFocusDirection): (WebKit::toWKAutoplayEventFlags): (WebKit::toWKAutoplayEvent): (WebKit::UIDelegate::UIClient::handleAutoplayEvent): 2017-08-24 Brady Eidson Remove duplicate WebCore::URL encoder/decoder https://bugs.webkit.org/show_bug.cgi?id=175952 Reviewed by Chris Dumez. Don't need the WebCoreArgumentCoder in WebKit since the URL class defines its own coders. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: 2017-08-24 Alex Christensen Add WKUIDelegatePrivate callback corresponding to PageUIClient's didNotHandleWheelEvent https://bugs.webkit.org/show_bug.cgi?id=175957 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didNotHandleWheelEvent): 2017-08-24 Tim Horton Overflow scroll views are inset to avoid safe areas even if the parent view is not https://bugs.webkit.org/show_bug.cgi?id=175949 Reviewed by Beth Dakin. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::createLayer): Disable automatic content inset adjustment to avoid safe areas on all of WKWebView's child UIScrollViews. 2017-08-24 Tim Horton Layout size override changes during in-flight animated resize are dropped on the floor forever https://bugs.webkit.org/show_bug.cgi?id=175916 Reviewed by Beth Dakin. Layout size override changes that come in during an animated resize are currently stored, but not sent in a separate message, because they're sent as part of the resize. However, if a layout size override change happens after the animated resize message was already sent, but before the animated resize is ended, that change will be stored, but not sent in the animated resize message (because it's too late), and then subsequent calls with the same size will early-return, because we're testing against the stored size, not the size we last actually sent to the Web Content process. Instead, store the last-sent size, so that subsequent layout size override changes with the same size won't bail, and if it differs from the active state after the animated resize completes, send an out-of-band update. All of the above also applies to device orientation, which follows exactly the same pattern. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _dispatchSetMinimumLayoutSize:]): (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): (-[WKWebView _dispatchSetDeviceOrientation:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _windowDidRotate:]): (-[WKWebView _didRelaunchProcess]): (-[WKWebView _setMinimumLayoutSizeOverride:]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): 2017-08-24 Tim Horton _WKThumbnailView snapshots have to be copied by CA on first commit due to bad row alignment https://bugs.webkit.org/show_bug.cgi?id=175898 Reviewed by Sam Weinig. In order to avoid copying, CGImages used as layer contents need to have certain alignment requirements fulfilled. Align the row stride to the desired value. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::createShareable): (WebKit::ShareableBitmap::numBytesForSize): (WebKit::ShareableBitmap::calculateBytesPerPixel): Deleted. * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::sizeInBytes const): (WebKit::ShareableBitmap::numBytesForSize): Deleted. Merge the interfaces of numBytesPerSize and sizeInBytes between the platforms. numBytesForSize now makes use of the new calculateBytesPerRow, which is implemented by each platform ShareableBitmap implementation to do the requisite alignment for that platform. * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): (WebKit::ShareableBitmap::calculateBytesPerPixel): (WebKit::createSurfaceFromData): (WebKit::ShareableBitmap::numBytesForSize): Deleted. Implement calculateBytesPerRow (which used to be hidden inside of numBytesForSize) and get rid of the now-duplicative numBytesForSize. * Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): (WebKit::ShareableBitmap::createGraphicsContext): (WebKit::ShareableBitmap::createCGImage const): Implement calculateBytesPerRow and make use of it when providing a row stride to CoreGraphics. 2017-08-24 Chris Dumez [iOS] ViewServices started by StoreKitUIService may get suspended unexpectedly https://bugs.webkit.org/show_bug.cgi?id=175922 Reviewed by Tim Horton. ViewServices started by StoreKitUIService may get suspended unexpectedly. This is because StoreKitUIService is itself a ViewService and is therefore in the background. To address the issue, treat StoreKitUIService as initially foreground in ApplicationStateTracker so that its ViewServices do not get suspended. We don't have good way to deal with ViewServices started by other ViewServices unfortunately. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::ApplicationStateTracker): 2017-08-23 Youenn Fablet [Cache API] Unify WebCore and WebKit error handling https://bugs.webkit.org/show_bug.cgi?id=175902 Reviewed by Alex Christensen. Removing all callbacks and error definitions from WebKit and reusing DOMCache ones instead. * NetworkProcess/cache/CacheStorage.h: Removed. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::caches const): (WebKit::CacheStorage::Engine::queryCache): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::putRecords): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doBatchPutOperation): (WebKit::WebCacheStorageConnection::openCompleted): (WebKit::WebCacheStorageConnection::removeCompleted): (WebKit::WebCacheStorageConnection::updateCaches): (WebKit::WebCacheStorageConnection::updateRecords): (WebKit::WebCacheStorageConnection::deleteRecordsCompleted): (WebKit::WebCacheStorageConnection::putRecordsCompleted): * WebProcess/Cache/WebCacheStorageConnection.h: * WebProcess/Cache/WebCacheStorageConnection.messages.in: 2017-08-23 Alex Christensen Clean up UIClients https://bugs.webkit.org/show_bug.cgi?id=175906 Reviewed by Tim Horton. There were some unnecessary checks to see if the client implements something, when the default behavior is to do nothing if the client doesn't implement the callback. Also, make some overrides finals and fix some spacing. * UIProcess/API/APIUIClient.h: (API::UIClient::didNotHandleKeyEvent): (API::UIClient::implementsDidNotHandleKeyEvent const): Deleted. (API::UIClient::implementsDidNotHandleWheelEvent const): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): 2017-08-23 Alex Christensen Add WKUIDelegatePrivate callbacks corresponding to WKPageUIClient's takeFocus, focus, and unfocus https://bugs.webkit.org/show_bug.cgi?id=175896 Reviewed by Tim Horton. I also renamed _webViewShow to _showWebView based on feedback from https://bugs.webkit.org/show_bug.cgi?id=175797 Added an API test. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKFocusDirection): (WebKit::UIDelegate::UIClient::takeFocus): (WebKit::UIDelegate::UIClient::focus): (WebKit::UIDelegate::UIClient::unfocus): (WebKit::UIDelegate::UIClient::showPage): 2017-08-23 Youenn Fablet [CacheAPI] Introduce a WebKit::CacheStorage namespace https://bugs.webkit.org/show_bug.cgi?id=175885 Reviewed by Alex Christensen. Introducing WebKit::CacheStorage namespace. Splitting CacheStorageEngine.h in three files. Updating client code accordingly. * NetworkProcess/cache/CacheStorage.h: Added. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::globalEngineMap): (WebKit::CacheStorage::Engine::from): (WebKit::CacheStorage::Engine::destroyEngine): (WebKit::CacheStorage::Engine::defaultEngine): (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::retrieveRecords): (WebKit::CacheStorage::Engine::putRecords): (WebKit::CacheStorage::Engine::deleteMatchingRecords): (WebKit::CacheStorage::Engine::writeCachesToDisk): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::readCache): (WebKit::CacheStorage::Engine::writeCacheRecords): (WebKit::CacheStorage::Engine::removeCacheRecords): (WebKit::CacheStorage::Engine::cache): (WebKit::CacheStorage::Engine::caches const): (WebKit::CacheStorage::Engine::queryCache): * NetworkProcess/cache/CacheStorageEngineCache.h: Added. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::records): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::openCompleted): (WebKit::WebCacheStorageConnection::removeCompleted): (WebKit::WebCacheStorageConnection::updateCaches): (WebKit::WebCacheStorageConnection::updateRecords): (WebKit::WebCacheStorageConnection::deleteRecordsCompleted): (WebKit::WebCacheStorageConnection::putRecordsCompleted): * WebProcess/Cache/WebCacheStorageConnection.h: 2017-08-23 Youenn Fablet [Cache API] Enable persistent coder to encode FetchOptions https://bugs.webkit.org/show_bug.cgi?id=175883 Reviewed by Alex Christensen. Removing FetchOptions related ArgumentCoders specific code. * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: 2017-08-23 Youenn Fablet CacheStorageEngine readCachesFromDisk callback should return the read Caches https://bugs.webkit.org/show_bug.cgi?id=175882 Reviewed by Alex Christensen. Callback of readCachesFromDisk takes now a Caches or error parameter. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorageEngine::open): (WebKit::CacheStorageEngine::retrieveCaches): (WebKit::CacheStorageEngine::readCachesFromDisk): * NetworkProcess/cache/CacheStorageEngine.h: 2017-08-23 Chris Dumez Regression(r221059): NetworkDataTask::didReceiveResponse() should not use PolicyUse for HTTP/0.9 https://bugs.webkit.org/show_bug.cgi?id=175872 Reviewed by Daniel Bates. r221059 was calling the ResponseCompletionHandler with {} which ended up being PolicyUse. Since this is an error case and do not want to receive the data, it makes more sense to use PolicyIgnore instead. There should not be a behavior change on WebKit side though since we are cancelling the load right after calling the completion handler anyway. Tests under http/tests/security/http-0.9/ are still passing. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): 2017-08-22 Tim Horton _WKThumbnailView should use the screen color space instead of sRGB https://bugs.webkit.org/show_bug.cgi?id=175858 Reviewed by Dean Jackson. Currently, _WKThumbnailView uses software snapshotting via WebPage's takeSnapshot and friends, which always use sRGB. However, it is immediately presented in display space, which causes an expensive color conversion, which could have been avoided if the snapshot was instead originally taken in display space. To solve this, add: - a mechanism allowing ShareableBitmap to be constructed with a configuration, which can include a color space as well as the existing flags (flipping SupportsAlpha to be IsOpaque instead because most callers want alpha) - a WebImage constructor allowing callers to pass a ShareableBitmap configuration through - a bit in SnapshotOptions for callers to indicate that they want to snapshot in the display's color space (repurposed from the ExtendedColor bit) And then make use of that bit in _WKThumbnailView. * Shared/API/c/WKSharedAPICast.h: (WebKit::snapshotOptionsFromImageOptions): Remove this incorrect conversion (WKImageOptions doesn't include kWKSnapshotOptionsExtendedColor). (WebKit::toSnapshotOptions): Plumb kWKSnapshotOptionsExtendedColor to WebKit::SnapshotOptions as the "UseScreenColorSpace". Leave the SPI name intact because it has clients, but the difference isn't so huge that it will be a problem. * Shared/ImageOptions.h: (WebKit::snapshotOptionsToImageOptions): Remove ImageOptionsExtendedColor, and rename SnapshotOptionsExtendedColor to SnapshotOptionsUseScreenColorSpace. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::Handle::Handle): (WebKit::ShareableBitmap::Handle::encode const): (WebKit::ShareableBitmap::Handle::decode): (WebKit::ShareableBitmap::Handle::clear): (WebKit::ShareableBitmap::Configuration::encode const): (WebKit::ShareableBitmap::Configuration::decode): (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::createShareable): (WebKit::ShareableBitmap::createHandle const): (WebKit::ShareableBitmap::ShareableBitmap): (WebKit::ShareableBitmap::calculateBytesPerPixel): (WebKit::calculateBytesPerPixel): Deleted. * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::numBytesForSize): (WebKit::ShareableBitmap::sizeInBytes const): * Shared/cg/ShareableBitmapCG.cpp: (WebKit::colorSpace): (WebKit::bitmapInfo): (WebKit::ShareableBitmap::calculateBytesPerPixel): (WebKit::ShareableBitmap::createGraphicsContext): (WebKit::ShareableBitmap::createCGImage const): Remove ShareableBitmap's flags parameter, and replace it with a configuration parameter. Configuration is a struct that currently encompasses the newly-flipped IsOpaque bit and (on Cocoa platforms) a platform colorspace object. Compute bytesPerPixel dynamically based on the colorspace and whether it uses extended colors or not. * Shared/WebImage.cpp: (WebKit::WebImage::create): * Shared/WebImage.h: Pass ShareableBitmap::Configuration through to the ShareableBitmap constructor, if provided. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView requestSnapshot]): Make use of the new bit, and use the screen's color space. * WebProcess/WebPage/WebPage.cpp: (WebKit::snapshotOptionsToBitmapConfiguration): (WebKit::WebPage::snapshotAtSize): (WebKit::WebPage::snapshotNode): If the snapshot option to use the display color space is set, fill in the colorSpace field in the ShareableBitmap::Configuration with the screen's color space. (WebKit::WebPage::drawRectToImage): * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeImage): * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::snapshot): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::snapshot): * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::geometryDidChange): (WebKit::PluginProxy::updateBackingStore): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): (WebKit::convertCGImageToBitmap): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createSelectionSnapshot const): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): Adopt ShareableBitmap::Configuration. Since IsOpaque defaults to false, all callers who previously constructed ShareableBitmap with SupportsAlpha now don't have to do anything. 2017-08-20 Wenson Hsieh [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div https://bugs.webkit.org/show_bug.cgi?id=175116 Reviewed by Darin Adler and Ryosuke Niwa. Refactors WebPage::editorState to only use the StyleProperties derived from EditingStyle, instead of inserting and removing a temporary node to figure out the style. Also adds hooks to notify the UI delegate of EditorState changes. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (nsTextAlignment): (dictionaryRepresentationForEditorState): (-[WKWebView _didChangeEditorState]): Alerts the private UI delegate of UI-side EditorState updates. (-[WKWebView _web_editorStateDidChange]): (-[WKWebView _executeEditCommand:argument:completion:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _web_editorStateDidChange]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::selectionDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::executeEditCommand): Change executeEditCommand(name, callback) to executeEditCommand(name, argument, callback) and lift out of iOS platform code and into WebPage.cpp. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView executeEditCommandWithCallback:]): (-[WKContentView _selectionChanged]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::executeEditCommand): Deleted. Move the iOS-specific implementation of executeEditCommand that invokes a callback when the web process responds out of WebPageProxyIOS, and into cross-platform WebPageProxy code. Additionally, add a parameter for the edit command's argument. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): Use EditingStyle::styleAtSelectionStart instead of Editor::styleForSelectionStart when computing an EditorState. Tweak bold, italic and underline to use EditingStyle TriStates. (WebKit::WebPage::executeEditCommandWithCallback): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::executeEditCommandWithCallback): Deleted. 2017-08-22 Wenson Hsieh [WK2] EditorState updates should be rolled into the layer update lifecycle when possible https://bugs.webkit.org/show_bug.cgi?id=175370 Reviewed by Ryosuke Niwa. See per-method comments for more detail. WebPage::didChangeSelection now schedules EditorState updates to be sent during the next layer tree transaction rather than sending them synchronously. To ensure that iOS and Mac continue to behave correctly w.r.t. EditorState updates, we immediately dispatch EditorStates in the following cases: - After the composition changes, is confirmed, or is canceled. - After an edit command is executed. - After ending user-triggered selection changes. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::hasEditorState const): (WebKit::RemoteLayerTreeTransaction::editorState const): (WebKit::RemoteLayerTreeTransaction::setEditorState): Attaches an optional EditorState to the RemoteLayerTreeTransaction. This EditorState is computed and sent over when setting up the transaction in WebPage, if something previously scheduled an EditorState update. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode const): (WebKit::RemoteLayerTreeTransaction::decode): Add coder support for sending over a layer tree transaction's EditorState. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _doAfterNextPresentationUpdate:]): Add _doAfterNextPresentationUpdate to WKView (used in TestWebKitAPI -- refer to WebKitAgnosticTest::waitForNextPresentationUpdate). * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::dispatchPresentationCallbacksAfterFlushingLayers): * UIProcess/DrawingAreaProxy.messages.in: Add a new IPC messages, DispatchPresentationCallbacksAfterFlushingLayers, to invoke in-flight presentation callbacks in the UI process following a layer flush in the web process. * UIProcess/WebPageProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::~TiledCoreAnimationDrawingAreaProxy): (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing): (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchPresentationCallbacksAfterFlushingLayers): Run all pending _doAfterNextPresentationUpdate callbacks. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didApplyStyle): (WebKit::WebEditorClient::respondToChangedContents): (WebKit::WebEditorClient::didEndUserTriggeredSelectionChanges): (WebKit::WebEditorClient::didUpdateComposition): Forward editor client calls to the WebPage. (WebKit::WebEditorClient::didChangeSelectionAndUpdateLayout): Deleted. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): (WebKit::WebPage::updateEditorStateAfterLayoutIfEditabilityChanged): (WebKit::WebPage::willCommitLayerTree): (WebKit::WebPage::didApplyStyle): Allow style application to immediately trigger EditorState updates, if we're not currently ignoring selection changes in the Editor. (WebKit::WebPage::didChangeContents): Allow applying top-level edit commands to immediately trigger EditorState updates, if we're not currently ignoring selection changes in the Editor. (WebKit::WebPage::didChangeSelection): (WebKit::WebPage::didUpdateComposition): (WebKit::WebPage::didEndUserTriggeredSelectionChanges): (WebKit::WebPage::discardedComposition): (WebKit::WebPage::canceledComposition): When handling composition updates, always send an EditorState to the UI process. Unlike other cases, IME requires immediate EditorState data, so we need to be explicit here in sending updates right away. (WebKit::WebPage::sendEditorStateUpdate): (WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate): (WebKit::WebPage::flushPendingEditorStateUpdate): Helper methods to schedule an EditorState update to be sent upon the next layer tree update, or flush any pending EditorState update that has been scheduled. The private, more aggressive variant of this is sendEditorStateUpdate, which ignores whether or not there was already an EditorState update scheduled, and sends one anyways (this still fulfills any EditorState update that was previously scheduled). These helper methods are treated as no-ops when invoked while ignoring selection changes. This is to prevent temporary selection state and editor commands during operations such as text indicator snapshotting from pushing bogus information about transient editor states to the UI process. (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): (WebKit::WebPage::executeEditCommandWithCallback): (WebKit::selectionIsInsideFixedPositionContainer): (WebKit::WebPage::updateVisibleContentRects): Fix a hack that was computing an EditorState to figure out whether the current selection starts or ends in a fixed position container. Factors out relevant logic into a separate helper, and also schedules an EditorState update instead of immediately computing it. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::addTransactionCallbackID): Add support for registering and dispatching presentation callbacks that hook into the layer flush lifecycle, using the tiled CA drawing area. These are used by Mac LayoutTests and API tests that need to wait until the next flush before checking for state that depends on EditorState updates in the UI process. (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Tell the WebPage to flush any pending EditorState updates. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformEditorState const): 2017-08-22 Brent Fulgham Relax keychain access to permit users to permanently allow client certificates https://bugs.webkit.org/show_bug.cgi?id=175857 Reviewed by Alex Christensen. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-08-22 Chris Dumez Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs https://bugs.webkit.org/show_bug.cgi?id=175832 Reviewed by Alex Christensen. Use new CompletionHandler type for NetworkDataTaskClient's completion handlers to help catch bugs. It actually already found a bug in our HTTP 0.9 error handling which is fixed in this patch as well. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/NetworkDataTask.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): * Shared/Authentication/AuthenticationManager.h: * Shared/Authentication/mac/AuthenticationManager.mac.mm: (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): 2017-08-22 Alex Christensen Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage https://bugs.webkit.org/show_bug.cgi?id=175797 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::showPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::registerURLSchemeHandler): window.open, createWebViewWithConfiguration, and WKURLSchemeHandlers all used together make it so that URLSchemeHandlers are added to WebPages that already have them. The assertions are no longer valid. 2017-08-22 Matt Lewis Unreviewed, rolling out r221026. This caused a consistent API failure on iOS Simulator. Reverted changeset: "Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage" https://bugs.webkit.org/show_bug.cgi?id=175797 http://trac.webkit.org/changeset/221026 2017-08-22 Ryan Haddad Unreviewed, rolling out r221027. This change caused LayoutTests to exit early with assertion failures. Reverted changeset: "Add sanity check for source origin in WebLoaderStrategy::startPingLoad()" https://bugs.webkit.org/show_bug.cgi?id=175827 http://trac.webkit.org/changeset/221027 2017-08-22 Chris Dumez [WK2] Enable Beacon API by default https://bugs.webkit.org/show_bug.cgi?id=175839 Reviewed by Youenn Fablet. * Shared/WebPreferencesDefinitions.h: 2017-08-22 Tim Horton REGRESSION (High Sierra): PDFPlugin won't render PostScript Files https://bugs.webkit.org/show_bug.cgi?id=175840 Reviewed by Brent Fulgham. * WebProcess/com.apple.WebProcess.sb.in: Add a sandbox exception for the PostScript conversion process. 2017-08-22 Chris Dumez Clean up PingLoad::processContentExtensionRulesForLoad() https://bugs.webkit.org/show_bug.cgi?id=175834 Reviewed by Alex Christensen. * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::processContentExtensionRulesForLoad): * NetworkProcess/PingLoad.h: 2017-08-22 Alex Christensen Remove ChromeClient::scrollbarsModeDidChange https://bugs.webkit.org/show_bug.cgi?id=175805 Reviewed by Daniel Bates. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::scrollbarsModeDidChange const): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-08-22 Chris Dumez Add sanity check for source origin in WebLoaderStrategy::startPingLoad() https://bugs.webkit.org/show_bug.cgi?id=175827 Reviewed by Geoffrey Garen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::startPingLoad): 2017-08-22 Alex Christensen Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage https://bugs.webkit.org/show_bug.cgi?id=175797 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::showPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::registerURLSchemeHandler): window.open, createWebViewWithConfiguration, and WKURLSchemeHandlers all used together make it so that URLSchemeHandlers are added to WebPages that already have them. The assertions are no longer valid. 2017-08-22 Youenn Fablet [Cache API] Add support for overwriting responses with put on an existing record https://bugs.webkit.org/show_bug.cgi?id=175825 Reviewed by Geoffrey Garen. Add support for encoding/decoding the update counter. Incrementing it when overwriting an existing response. Storing the new body in addition to the new response. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorageEngine::putRecords): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-08-22 Alex Christensen Remove ChromeClient::hasOpenedPopup https://bugs.webkit.org/show_bug.cgi?id=175804 Reviewed by Sam Weinig. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::hasOpenedPopup const): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-08-22 Brent Fulgham and Pranjal Jumde Disable access to secure cookies if an HTTPS site loads mixed content https://bugs.webkit.org/show_bug.cgi?id=157053 Reviewed by Dan Bates. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Pass new arguments needed by WebCore. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Updated the CookiesForDOM message with the new foundMixedContent argument and the new didAccessSecureCookies reply. * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Drive-by fix to use the right message. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookiesForDOM): Check and return whether secure cookies were accessed. Accept a new argument indicating whether secure cookies should be included in the response. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-08-22 Zan Dobersek [GTK][WPE] Rename StorageProcessMainGtk.cpp to StorageProcessMainGLib.cpp https://bugs.webkit.org/show_bug.cgi?id=175814 Reviewed by Gyuyoung Kim. Both GTK+ and WPE ports already compile the StorageProcessMainGtk.cpp file, but it should be renamed to StorageProcessMainGLib and moved into the StorageProcess/glib/ directory. * PlatformGTK.cmake: * PlatformWPE.cmake: * StorageProcess/glib/StorageProcessMainGLib.cpp: Renamed from Source/WebKit/StorageProcess/gtk/StorageProcessMainGtk.cpp. 2017-08-21 Zan Dobersek [WK] Add missing ENABLE(NETWORK_CACHE) build guards https://bugs.webkit.org/show_bug.cgi?id=175769 Reviewed by Carlos Alberto Lopez Perez. Given that the build guard exists, it should be possible to compile the WebKit layer with the feature disabled. Missing guards are added in order to achieve that. * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::clearDiskCache): * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::storeDerivedDataToCache): 2017-08-21 Chris Dumez [Beacon] Content extensions should be able to intercept Beacon / Ping redirects https://bugs.webkit.org/show_bug.cgi?id=175746 Reviewed by Alex Christensen. Update PingLoad to process content extension rules upon redirect. This allows content extensions to block and upgrade to HTTPS beacon / ping loads. Because ping loads can outlive the WebProcess, the content extensions rules are passed to the NetworkProcess when starting the Ping load. The PingLoad can then consult those rules upon redirect, on the NetworkProcess side. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::contentExtensionsBackend): (WebKit::PingLoad::processContentExtensionRulesForLoad): * NetworkProcess/PingLoad.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::startPingLoad): 2017-08-21 Adrian Perez de Castro [WPE][GTK] Unused variables in UserMediaProcessManager.cpp https://bugs.webkit.org/show_bug.cgi?id=175799 Reviewed by Alex Christensen. The code which uses the "audioExtensionPath" and "videoExtensionPath" variables is guarded with "#if ENABLE(SANDBOX_EXTENSIONS)”, so do the same for the variables themselves. * UIProcess/UserMediaProcessManager.cpp: Add missing guards. 2017-08-21 Yoshiaki Jitsukawa [PAL] Move spi/mac directory into PAL https://bugs.webkit.org/show_bug.cgi?id=175649 Reviewed by Myles C. Maxfield. * Platform/mac/MenuUtilities.mm: * Shared/mac/WebCoreArgumentCodersMac.mm: * Shared/mac/WebEventFactory.mm: * Shared/mac/WebHitTestResultData.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/mac/ServicesController.mm: * UIProcess/mac/TextCheckerMac.mm: * UIProcess/mac/ViewGestureControllerMac.mm: * UIProcess/mac/WKImmediateActionController.h: * UIProcess/mac/WKImmediateActionController.mm: * UIProcess/mac/WKSharingServicePickerDelegate.mm: * UIProcess/mac/WKTextFinderClient.mm: * UIProcess/mac/WebContextMenuProxyMac.mm: * UIProcess/mac/WebPageProxyMac.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-08-21 Brady Eidson Split the one SWServer::Connection into SWClientConnection and SWServer::Connection. https://bugs.webkit.org/show_bug.cgi?id=175745 Reviewed by Andy Estes. * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.cpp. (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::~WebSWServerConnection): (WebKit::WebSWServerConnection::disconnectedFromWebProcess): (WebKit::WebSWServerConnection::rejectJobInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: Copied from Source/WebKit/WebProcess/Storage/WebSWServerConnection.h. (WebKit::WebSWServerConnection::identifier const): * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWServerConnection.messages.in. * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::didClose): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): * StorageProcess/StorageToWebProcessConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp. (WebKit::WebSWClientConnection::WebSWClientConnection): (WebKit::WebSWClientConnection::~WebSWClientConnection): (WebKit::WebSWClientConnection::scheduleJobInServer): * WebProcess/Storage/WebSWClientConnection.h: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.h. (WebKit::WebSWClientConnection::identifier const): * WebProcess/Storage/WebSWClientConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.messages.in. * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-08-21 Charlie Turner MemoryCache::setCapacities assertion failure maxDeadBytes <= totalBytes https://bugs.webkit.org/show_bug.cgi?id=175571 Reviewed by Antti Koivisto. * Shared/CacheModel.cpp: (WebKit::calculateMemoryCacheSizes): Ensure cacheTotalCapacity is set to a reasonable value even in low-memory environments. 2017-08-20 Chris Dumez Simplify calls to LoaderStrategy::startPingLoad() https://bugs.webkit.org/show_bug.cgi?id=175756 Reviewed by Sam Weinig. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::startPingLoad): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-18 Chris Dumez [Beacon] Improve error reporting https://bugs.webkit.org/show_bug.cgi?id=175723 Reviewed by Darin Adler. Have Ping loads such as beacons report errors via their completion handler. The Beacon API is using this error to log a console message when beacon loads fail, provided that the page is still alive. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::~PingLoad): (WebKit::PingLoad::didFinish): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::didReceiveChallenge): (WebKit::PingLoad::didReceiveResponseNetworkSession): (WebKit::PingLoad::didCompleteWithError): (WebKit::PingLoad::wasBlocked): (WebKit::PingLoad::cannotShowURL): (WebKit::PingLoad::timeoutTimerFired): (WebKit::PingLoad::currentRequest const): (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight): * NetworkProcess/PingLoad.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didFinishPingLoad): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::didFinishPingLoad): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-18 Chris Dumez REGRESSION (r220601): Crash when closing google doc after switching the order of tabs in safari https://bugs.webkit.org/show_bug.cgi?id=175721 Reviewed by Geoffrey Garen. Make sure WebProcess::markAllLayersVolatile() does not call WTFMove() multiple times on the same completion handler. Use a RefCounter to hold on to the completion handler and make sure the handler gets called when the RefCounter's value becomes 0. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::cancelPrepareToSuspend): (WebKit::WebProcess::markAllLayersVolatile): (WebKit::WebProcess::cancelMarkAllLayersVolatile): * WebProcess/WebProcess.h: 2017-08-18 Youenn Fablet [Cache API] Add response body storage https://bugs.webkit.org/show_bug.cgi?id=175658 Reviewed by Alex Christensen. Added IPC serialization of Record response body. Updated CacheStorageEngine implementation as Record has no longer a copy constructor. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorageEngine::retrieveRecords): (WebKit::CacheStorageEngine::deleteMatchingRecords): * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeSharedBuffer): (IPC::decodeSharedBuffer): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-08-18 Brady Eidson Bounce ServiceWorker jobs to the Storage Process. https://bugs.webkit.org/show_bug.cgi?id=175650 Reviewed by Andy Estes. * CMakeLists.txt: * DerivedSources.make: * WebKit.xcodeproj/project.pbxproj: * Platform/Logging.h: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::didClose): (WebKit::StorageToWebProcessConnection::establishSWServerConnection): (WebKit::StorageToWebProcessConnection::removeSWServerConnection): (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): * StorageProcess/StorageToWebProcessConnection.h: * StorageProcess/StorageToWebProcessConnection.messages.in: * WebProcess/Storage/WebSWServerConnection.cpp: Added. (WebKit::WebSWServerConnection::WebSWServerConnection): (WebKit::WebSWServerConnection::~WebSWServerConnection): (WebKit::WebSWServerConnection::disconnectedFromWebProcess): (WebKit::WebSWServerConnection::scheduleJob): (WebKit::WebSWServerConnection::scheduleStorageJob): * WebProcess/Storage/WebSWServerConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerJob.h. (WebKit::WebSWServerConnection::create): (WebKit::WebSWServerConnection::identifier const): * WebProcess/Storage/WebSWServerConnection.messages.in: Copied from Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in. * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): (WebKit::WebServiceWorkerProvider::scheduleJob): Deleted. * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: 2017-08-18 Chris Dumez [Beacon] Add support for quota limitation https://bugs.webkit.org/show_bug.cgi?id=175443 Reviewed by Youenn Fablet. WebLoaderStrategy now generates an identifier for ping loads and keep the completion handler in a local HashMap. Once the ping load is done, the network process sends an IPC message back to the WebContent process so that WebLoaderStrategy can look up the completion handler for the ping load and call it. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::~PingLoad): * NetworkProcess/PingLoad.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didFinishPingLoad): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::generatePingLoadIdentifier): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::didFinishPingLoad): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-18 Youenn Fablet [Cache API] Add a WK2 implementation of CacheStorageConnection https://bugs.webkit.org/show_bug.cgi?id=175640 Reviewed by Alex Christensen & Chris Dumez. Adding WebCacheStorageConnection as an implementation of CacheStorageConnection. Making WebCacheStorageProvider instantiates such class. One WebCacheStorageConnection is created for each session of a given WebProcess. WebCacheStorageConnection is sending IPC calls to the network process. Main implementation of the cache API is done in the network process by CacheStorageEngineConnection and CacheStorageEngine. There is one WebCacheStorageConnection per session. WebCacheStorageConnection is passing the session ID for each call to the network process to ensure the right cache storage engine is used. CacheStorageEngineConnection mirrors WebCacheStorageConnection on the network process. There is one CacheStorageEngine per session and CacheStorageEngineConnection will select the right CacheStorageEngine using the given session ID. CacheStorageEngine is responsible of storing and matching cache API records. Current implementation only keeps in memory the cached objects. CacheStorageEngine is keeping (for each different origin) caches and records as a Vector as the order of insertion is important as per spec. It also keeps a list of removed caches. These caches should remain functional until the last web page having access to these is gone. The mechanism to fully remove these caches is not implemented yet. Adding IPC encodings for WTF::Expected, CacheQueryOptions, FetchOptions, CacheStorageConnection Record and CacheInfo. * CMakeLists.txt: * DerivedSources.make: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::generateCacheStorageConnectionIdentifier): (WebKit::NetworkConnectionToWebProcess::createCacheStorageConnection): (WebKit::NetworkConnectionToWebProcess::closeCacheStorageConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/cache/CacheStorageEngine.cpp: Added. (WebKit::defaultCacheStorageEngine): (WebKit::globalEngineMap): (WebKit::CacheStorageEngine::from): (WebKit::CacheStorageEngine::destroyEngine): (WebKit::CacheStorageEngine::defaultEngine): (WebKit::CacheStorageEngine::open): (WebKit::CacheStorageEngine::remove): (WebKit::CacheStorageEngine::retrieveCaches): (WebKit::CacheStorageEngine::retrieveRecords): (WebKit::CacheStorageEngine::putRecords): (WebKit::CacheStorageEngine::deleteMatchingRecords): (WebKit::CacheStorageEngine::writeCachesToDisk): (WebKit::CacheStorageEngine::readCachesFromDisk): (WebKit::CacheStorageEngine::readCache): (WebKit::CacheStorageEngine::writeCacheRecords): (WebKit::CacheStorageEngine::removeCacheRecords): (WebKit::CacheStorageEngine::cache): (WebKit::CacheStorageEngine::caches const): (WebKit::CacheStorageEngine::records): (WebKit::CacheStorageEngine::queryCache): * NetworkProcess/cache/CacheStorageEngine.h: Added. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: Added. (WebKit::CacheStorageEngineConnection::CacheStorageEngineConnection): (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::remove): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::records): (WebKit::CacheStorageEngineConnection::deleteMatchingRecords): (WebKit::CacheStorageEngineConnection::putRecords): * NetworkProcess/cache/CacheStorageEngineConnection.h: Added. (WebKit::CacheStorageEngineConnection::create): * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: Added. * Platform/IPC/ArgumentCoders.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageConnection.cpp: Added. (WebKit::WebCacheStorageConnection::WebCacheStorageConnection): (WebKit::WebCacheStorageConnection::~WebCacheStorageConnection): (WebKit::WebCacheStorageConnection::messageSenderConnection): (WebKit::WebCacheStorageConnection::doOpen): (WebKit::WebCacheStorageConnection::doRemove): (WebKit::WebCacheStorageConnection::doRetrieveCaches): (WebKit::WebCacheStorageConnection::doRetrieveRecords): (WebKit::WebCacheStorageConnection::doBatchDeleteOperation): (WebKit::WebCacheStorageConnection::doBatchPutOperation): (WebKit::WebCacheStorageConnection::openCompleted): (WebKit::WebCacheStorageConnection::removeCompleted): (WebKit::WebCacheStorageConnection::updateCaches): (WebKit::WebCacheStorageConnection::updateRecords): (WebKit::WebCacheStorageConnection::deleteRecordsCompleted): (WebKit::WebCacheStorageConnection::putRecordsCompleted): * WebProcess/Cache/WebCacheStorageConnection.h: Added. * WebProcess/Cache/WebCacheStorageConnection.messages.in: Added. * WebProcess/Cache/WebCacheStorageProvider.cpp: Copied from Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h. (WebKit::WebCacheStorageProvider::createCacheStorageConnection): * WebProcess/Cache/WebCacheStorageProvider.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): 2017-08-18 Commit Queue Unreviewed, rolling out r220854. https://bugs.webkit.org/show_bug.cgi?id=175716 I'm not sure we really need this (Requested by KaL on #webkit). Reverted changeset: "[GTK][WPE] Add NTLM authentication enabled API" https://bugs.webkit.org/show_bug.cgi?id=122952 http://trac.webkit.org/changeset/220854 2017-08-15 Megan Gardner Update to changeSelectionWithTouchAt:baseIsStart:withFlags: https://bugs.webkit.org/show_bug.cgi?id=175615 Update calls to use the flag versions, as they are used for passing state. Leave old calls, but set them up to be removed next cycle. Reviewed by Tim Horton. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (selectionChangedWithTouch): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]): (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]): 2017-08-17 Chris Dumez Regression(r220817): We should only copy the original request headers for Ping loads https://bugs.webkit.org/show_bug.cgi?id=175679 Reviewed by Youenn Fablet. For performance reason, we should only copy the original request headers for Ping loads (Beacon at the moment), not for all CachedResourceRequests. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::makeCrossOriginAccessRequest): (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest): (WebKit::PingLoad::originalRequestHeaders const): Deleted. * NetworkProcess/PingLoad.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-17 Don Olmstead [PAL] Relocate SessionID to root https://bugs.webkit.org/show_bug.cgi?id=175684 Reviewed by Alex Christensen. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkLoad.cpp: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: * Scripts/webkit/messages.py: (forward_declarations_and_headers.templates): Deleted. (class_template_headers.template): Deleted. * Shared/ChildProcess.cpp: * Shared/SessionTracker.h: * Shared/Storage/StorageProcessCreationParameters.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebPageCreationParameters.h: * Shared/WebProcessCreationParameters.h: * Shared/WebsiteDataStoreParameters.h: * Shared/mac/CookieStorageShim.mm: * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: * StorageProcess/StorageProcess.cpp: * StorageProcess/StorageProcess.h: * StorageProcess/StorageToWebProcessConnection.h: * UIProcess/API/APIPageConfiguration.h: * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/glib/WebKitCookieManager.cpp: * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebDatabaseProvider.cpp: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Network/NetworkProcessConnection.cpp: * WebProcess/Network/WebLoaderStrategy.cpp: * WebProcess/Network/WebSocketStream.cpp: * WebProcess/Network/WebSocketStream.h: * WebProcess/Storage/WebToStorageProcessConnection.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebProcess.h: 2017-08-17 Chris Dumez REGRESSION (r220601): Crash under ProcessAssertion::markAsInvalidated() https://bugs.webkit.org/show_bug.cgi?id=175685 Reviewed by Sam Weinig. After r220601, it is no longer safe to call a default-initialized WTF::Function. * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::markAsInvalidated): 2017-08-17 Andreas Kling Disable CSS regions at compile time https://bugs.webkit.org/show_bug.cgi?id=175630 Reviewed by Antti Koivisto. * Configurations/FeatureDefines.xcconfig: 2017-08-17 Wenson Hsieh [iOS] Respect type fidelities when copying image elements to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=175638 Reviewed by Ryosuke Niwa. Currently, we treat the case when copying an image enclosed by a link by only writing a URL to the pasteboard. This patch tweaks logic in WebPage::performActionOnElement to write both an image and a link to the pasteboard if the hit-tested image element is enclosed by an anchor. * Platform/spi/ios/UIKitSPI.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::containingLinkElement): Tweak this helper to be more restrictive when finding an enclosing 'link' -- only return an element if isLink() is true, and it is an HTMLAnchorElement. Currently, the isLink() also matches HTMLLinkElements, but this isn't the intention here. (WebKit::WebPage::performActionOnElement): 2017-08-17 Jacobo Aragunde Pérez [WPE][GTK] Ensure proper casting of data in gvariants https://bugs.webkit.org/show_bug.cgi?id=175667 Reviewed by Michael Catanzaro. g_variant_builder_add requires data to have the correct width for their types, using casting if necessary. Corrected a call where a single precision float was being put into a double precision parameter without a cast. * UIProcess/API/glib/WebKitWebViewSessionState.cpp: (encodeFrameState): 2017-08-17 Don Olmstead [PAL] Move SessionID into PAL https://bugs.webkit.org/show_bug.cgi?id=174192 Reviewed by Antti Koivisto. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::Download): * NetworkProcess/Downloads/Download.h: (WebKit::Download::Download): * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): (WebKit::DownloadManager::resumeDownload): * NetworkProcess/Downloads/DownloadManager.h: (WebKit::DownloadManager::startDownload): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createSocketStream): (WebKit::storageSession): (WebKit::NetworkConnectionToWebProcess::startDownload): (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): (WebKit::NetworkConnectionToWebProcess::cookiesEnabled): (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): (WebKit::NetworkConnectionToWebProcess::getRawCookies): (WebKit::NetworkConnectionToWebProcess::deleteCookie): (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::startDownload): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkLoad.cpp: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::destroySession): (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::downloadRequest): (WebKit::NetworkProcess::resumeDownload): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::create): (WebKit::NetworkSession::defaultSession): (WebKit::NetworkSession::NetworkSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::sessionID const): * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::configurationForSessionID): (WebKit::NetworkSessionCocoa::create): (WebKit::NetworkSessionCocoa::defaultSession): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * NetworkProcess/soup/NetworkSessionSoup.cpp: (WebKit::NetworkSessionSoup::NetworkSessionSoup): * NetworkProcess/soup/NetworkSessionSoup.h: * Scripts/webkit/messages.py: (forward_declarations_and_headers.templates): Deleted. (class_template_headers.template): Deleted. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): * Shared/SessionTracker.cpp: (WebKit::staticSessionMap): (WebKit::SessionTracker::networkSession): (WebKit::SessionTracker::setSession): (WebKit::SessionTracker::destroySession): * Shared/SessionTracker.h: * Shared/Storage/StorageProcessCreationParameters.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * Shared/WebPageCreationParameters.h: * Shared/WebProcessCreationParameters.h: * Shared/WebsiteDataStoreParameters.h: * Shared/mac/CookieStorageShim.mm: (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::create): (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::idbServer): (WebKit::StorageProcess::fetchWebsiteData): (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): * StorageProcess/StorageToWebProcessConnection.h: * StorageProcess/StorageToWebProcessConnection.messages.in: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::setWebsiteDataStore): (API::PageConfiguration::sessionID): (API::PageConfiguration::setSessionID): * UIProcess/API/APIPageConfiguration.h: * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::defaultDataStore): (API::WebsiteDataStore::createLegacy): (API::WebsiteDataStore::WebsiteDataStore): * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerGetHostnamesWithCookies): (WKCookieManagerDeleteCookiesForHostname): (WKCookieManagerDeleteAllCookies): (WKCookieManagerDeleteAllCookiesModifiedAfterDate): (WKCookieManagerSetHTTPCookieAcceptPolicy): (WKCookieManagerGetHTTPCookieAcceptPolicy): (WKCookieManagerStartObservingCookieChanges): (WKCookieManagerStopObservingCookieChanges): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setCookieAcceptPolicy:]): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/glib/WebKitCookieManager.cpp: (webkit_cookie_manager_set_accept_policy): (webkit_cookie_manager_get_accept_policy): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider): (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash): (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::fetchWebsiteData): (WebKit::StorageProcessProxy::deleteWebsiteData): (WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::deleteCookiesForHostname): (WebKit::WebCookieManagerProxy::deleteAllCookies): (WebKit::WebCookieManagerProxy::deleteCookie): (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): (WebKit::WebCookieManagerProxy::setCookie): (WebKit::WebCookieManagerProxy::setCookies): (WebKit::WebCookieManagerProxy::getAllCookies): (WebKit::WebCookieManagerProxy::getCookies): (WebKit::WebCookieManagerProxy::startObservingCookieChanges): (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): (WebKit::WebCookieManagerProxy::setCookieObserverCallback): (WebKit::WebCookieManagerProxy::registerObserver): (WebKit::WebCookieManagerProxy::unregisterObserver): (WebKit::WebCookieManagerProxy::cookiesDidChange): (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebCookieManagerProxy.messages.in: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::sessionID const): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::pageRemovedFromProcess): (WebKit::WebProcessPool::download): (WebKit::WebProcessPool::resumeDownload): (WebKit::WebProcessPool::addPlugInAutoStartOriginHash): (WebKit::WebProcessPool::plugInDidReceiveUserInteraction): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessPool.messages.in: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::createNonPersistent): (WebKit::WebsiteDataStore::create): (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::sessionID const): * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::getHostnamesWithCookies): (WebKit::WebCookieManager::deleteCookiesForHostname): (WebKit::WebCookieManager::deleteAllCookies): (WebKit::WebCookieManager::deleteCookie): (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): (WebKit::WebCookieManager::getAllCookies): (WebKit::WebCookieManager::getCookies): (WebKit::WebCookieManager::setCookie): (WebKit::WebCookieManager::setCookies): (WebKit::WebCookieManager::notifyCookiesDidChange): (WebKit::WebCookieManager::startObservingCookieChanges): (WebKit::WebCookieManager::stopObservingCookieChanges): * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Cookies/WebCookieManager.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::create): (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/Databases/WebDatabaseProvider.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setPrivateBrowsingEnabled): * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didCacheResource): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebSocketProvider.cpp: (WebKit::WebSocketProvider::createSocketStreamHandle): * WebProcess/Network/WebSocketProvider.h: * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::create): (WebKit::WebSocketStream::WebSocketStream): * WebProcess/Network/WebSocketStream.h: * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): * WebProcess/Storage/WebToStorageProcessConnection.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/WebPlugInClient.cpp: (WebKit::WebPlugInClient::didStartFromOrigin): * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::startDownload): (WebKit::WebFrame::convertMainResourceLoadToDownload): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSessionID): (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sessionID const): * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::ensurePrivateBrowsingSession): (WebKit::WebProcess::destroySession): (WebKit::WebProcess::isPlugInAutoStartOriginHash): (WebKit::WebProcess::plugInDidStartFromOrigin): (WebKit::WebProcess::didAddPlugInAutoStartOriginHash): (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes): (WebKit::WebProcess::resetPlugInAutoStartOriginHashes): (WebKit::WebProcess::plugInDidReceiveUserInteraction): (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-08-17 Joseph Pecoraro Fix typo: setUpInectedBundleClient https://bugs.webkit.org/show_bug.cgi?id=175655 Reviewed by Andreas Kling. * UIProcess/API/Cocoa/WKProcessGroup.mm: (setUpInjectedBundleClient): (-[WKProcessGroup initWithInjectedBundleURL:]): 2017-08-17 Carlos Garcia Campos [GTK][WPE] Add NTLM authentication enabled API https://bugs.webkit.org/show_bug.cgi?id=122952 Reviewed by Michael Catanzaro. Add API to WebKitWebContext to enable/disable NTLM authentication. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::setNTLMAuthenticationEnabled): * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_get_ntlm_authentication_enabled): (webkit_web_context_set_ntlm_authentication_enabled): * UIProcess/API/gtk/WebKitWebContext.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebContext.h: * UIProcess/WebProcessPool.h: * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::setNTLMAuthenticationEnabled): 2017-08-16 Andy Estes [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest https://bugs.webkit.org/show_bug.cgi?id=175648 Reviewed by Tim Horton. * Scripts/webkit/messages.py: (headers_for_type): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (toShippingMethod): (WebKit::toPKContactFields): (WebKit::toPKAddressField): (WebKit::toPKPaymentSummaryItemType): (WebKit::toPKPaymentSummaryItem): (WebKit::toPKPaymentSummaryItems): (WebKit::toPKMerchantCapabilities): (WebKit::toPKShippingType): (WebKit::toPKShippingMethod): (WebKit::toPKPaymentRequest): * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::showPaymentUI): (WebKit::WebPaymentCoordinator::didSelectShippingMethod): * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: 2017-08-16 Chris Dumez Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight https://bugs.webkit.org/show_bug.cgi?id=175628 Reviewed by Geoffrey Garen. Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight. To achieve this, the following changes were made: 1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload 2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS preflight merely because the fetch mode is set to "cors"). * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::startPreflight): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::loadRequest): (WebKit::PingLoad::originalRequestHeaders const): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::isAllowedRedirect const): (WebKit::PingLoad::makeCrossOriginAccessRequest): (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest): (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight): (WebKit::PingLoad::preflightSuccess): * NetworkProcess/PingLoad.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-16 Yoshiaki Jitsukawa [PAL] Move spi/ios and spi/win directories into PAL https://bugs.webkit.org/show_bug.cgi?id=175171 Reviewed by Antti Koivisto. * UIProcess/Cocoa/NavigationState.mm: * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-08-16 Miguel Gomez [GTK] Crash of WebProcess with on-demand AC https://bugs.webkit.org/show_bug.cgi?id=171161 Reviewed by Carlos Garcia Campos. Set the viewOverlayRootLayer to the previous layerTreeHost if it exists. This avoids a crash when reusing the previous layerTreeHost, because it would keep a reference to an already destroyed viewOverlayRootLayer. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer): 2017-08-16 Zan Dobersek [CoordGraphics] Simplify CoordinatedGraphicsScene state updates https://bugs.webkit.org/show_bug.cgi?id=175528 Reviewed by Carlos Garcia Campos. Hold the information about state updates in ThreadedCompositor, in the m_attributes struct. This way we don't need to store the updates in functors and accumulate them in the CoordinatedGraphicsScene class, but instead just apply any pending state update or atlas removal before the scene is rendered. This removes the need to update the CoordinatedGraphicsScene object from the main thread with data that ultimately has to be handled on the composition thread. Similarly, when updating CoordinatedGraphicsScene, we only need to synchronize on the m_attributes lock object once in order to retrieve the scene update information, instead of having each functor do that repeatedly. Outside of CoordinatedGraphicsScene and ThreadedCompositor classes, the CompositingCoordinator class now passes the atlases-to-remove Vector by a const lvalue reference down to ThreadedCompositor, and then manually clears the Vector. Before the Vector was passed as an rvalue reference, depending on the ThreadedCompositor code to clear out the original Vector object by moving its resources into the functor object. This doesn't occur anymore because the Vector object is now appended to another Vector. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::applyStateChanges): (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): (WebKit::CoordinatedGraphicsScene::detach): (WebKit::CoordinatedGraphicsScene::setActive): (WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted. (WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::releaseUpdateAtlases): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::flushPendingLayerChanges): (WebKit::CompositingCoordinator::releaseAtlases): (WebKit::CompositingCoordinator::clearUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 2017-08-16 Andy Estes [Payment Request] Add an ENABLE flag and an experimental feature preference https://bugs.webkit.org/show_bug.cgi?id=175622 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPaymentRequestEnabled): (WKPreferencesGetPaymentRequestEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-15 Carlos Garcia Campos [GTK][WPE] WebKitAutomationSession should set session client to nullptr on dispose https://bugs.webkit.org/show_bug.cgi?id=175564 Reviewed by Carlos Alberto Lopez Perez. WebAutomationSession expects its client to be nullptr in the destructor. * UIProcess/API/glib/WebKitAutomationSession.cpp: (webkitAutomationSessionDispose): 2017-08-15 Tim Horton WKSnapshotConfiguration is missing from the WebKit umbrella header https://bugs.webkit.org/show_bug.cgi?id=175614 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WebKit.h: Add WKSnapshotConfiguration, which is a public header. 2017-08-15 Simon Fraser Allow WebCore logging channels to be set from the UI process https://bugs.webkit.org/show_bug.cgi?id=175608 Reviewed by Tim Horton. The UI process can now read the "WebCoreLogging" default, and pass it to the web process via WebProcessCreationParameters, where WebProcess::platformInitializeWebProcess() uses it to set up WebCore logging channels. Note that these will override channels read from the web process user defaults domain (but those are hard to set anyway). * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2017-08-15 Don Olmstead [PAL] Move Sleep classes into PAL https://bugs.webkit.org/show_bug.cgi?id=175456 Reviewed by Ryosuke Niwa. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: 2017-08-15 Youenn Fablet [Cache API] Adding generic support for CacheStorage and Cache methods https://bugs.webkit.org/show_bug.cgi?id=175455 Reviewed by Chris Dumez. * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageProvider.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::cacheStorageProvider): 2017-08-15 Michael Catanzaro Unreviewed, rolling out r220700. Broke debug bot Reverted changeset: "[CoordGraphics] Simplify CoordinatedGraphicsScene state updates" https://bugs.webkit.org/show_bug.cgi?id=175528 http://trac.webkit.org/changeset/220700 2017-08-15 Carlos Garcia Campos WebDriver: timeout when JavaScript alert is shown in onload handler https://bugs.webkit.org/show_bug.cgi?id=175315 Reviewed by Brian Burg. When a JavaScript alert is shown in an onload handler, the alert prevents the load from finishing in case of normal page load strategy, so navigation commands or any other command for which we wait for navigation to complete end up timing out. There are two selenium tests covering this that are currently timing out: testShouldHandleAlertOnPageLoad and testShouldHandleAlertOnPageLoadUsingGet. The spec says that in case of page load timeout we should only fail with timeout error when there isn't an active alert dialog. If the next command expects an alert it will just work, otherwise it will fail with UnexpectedAlertOpen error when trying to handle user prompts. 9 Navigation. https://w3c.github.io/webdriver/webdriver-spec.html#dfn-wait-for-navigation-to-complete * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::waitForNavigationToComplete): Do not wait for the timeout when the page is loading and there's an active alert in case of normal page load strategy. (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): Respond with timeout unless the page is showing a JavaScript dialog. (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): Ditto. (WebKit::WebAutomationSession::loadTimerFired): Use respondToPendingPageNavigationCallbacksWithTimeout() and respondToPendingFrameNavigationCallbacksWithTimeout(). (WebKit::WebAutomationSession::willShowJavaScriptDialog): The page is about to show a JavaScript dialog, so we wait until the next run loop iteration to give time for the client to show the dialog, then check if page is loading and the dialog is still present. If that's the case we finish all normal strategy pending navigations. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptAlert): If controlled by automation, notify the session. (WebKit::WebPageProxy::runJavaScriptConfirm): Ditto. (WebKit::WebPageProxy::runJavaScriptPrompt): Ditto. (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Ditto. 2017-08-14 Carlos Garcia Campos WebDriver: handle click events on option elements https://bugs.webkit.org/show_bug.cgi?id=174710 Reviewed by Brian Burg. Add selectOptionElement method to automation to select an option element according to the WebDriver specification. 14.1 Element Click. https://w3c.github.io/webdriver/webdriver-spec.html#element-click * UIProcess/Automation/Automation.json: Add selectOptionElement method and ElementNotSelectable error. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::selectOptionElement):Send SelectOptionElement message to the web process. (WebKit::WebAutomationSession::didSelectOptionElement): Notify the driver. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.messages.in: Add DidSelectOptionElement message. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::elementContainer): Helper to get the container of an element according to the spec. (WebKit::WebAutomationSessionProxy::computeElementLayout): Use the container element to scroll the view and compute the in-view center point. (WebKit::WebAutomationSessionProxy::selectOptionElement): Use HTMLSelectElement::optionSelectedByUser(). * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SelectOptionElement message. 2017-08-14 Simon Fraser Remove Proximity Events and related code https://bugs.webkit.org/show_bug.cgi?id=175545 Reviewed by Daniel Bates. No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS) and other related code. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * WebProcess/WebCoreSupport/WebDeviceProximityClient.cpp: Removed. * WebProcess/WebCoreSupport/WebDeviceProximityClient.h: Removed. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2017-08-14 Simon Fraser Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere https://bugs.webkit.org/show_bug.cgi?id=175504 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::didRequestAutocomplete): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-08-14 Simon Fraser Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code https://bugs.webkit.org/show_bug.cgi?id=175557 Reviewed by Jon Lee. No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it. * Configurations/FeatureDefines.xcconfig: 2017-08-14 Andy Estes [Apple Pay] Add support for phonetic contact names https://bugs.webkit.org/show_bug.cgi?id=175537 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Soft-linked PKContactFieldPhoneticName. (WebKit::toPKContactFields): Added code to append PKContactFieldPhoneticName to result if contactFields.phoneticName is true. (WebKit::toNSError): Specified PKContactFieldPhoneticName as the contact field for PaymentError::ContactField::PhoneticName. 2017-08-14 Tim Horton Only create directory and sandbox extension handle for storage directories if they are set https://bugs.webkit.org/show_bug.cgi?id=175522 Reviewed by Brady Eidson. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): If using a non-persistent WebsiteDataStore, all the storage directories are unset, but we still try to create them and make sandbox extensions for them. This has no effect except a ton of noisy logging, but that is reason enough to stop. This is similar to r216053, but for more directories. 2017-08-14 Zan Dobersek [CoordGraphics] Simplify CoordinatedGraphicsScene state updates https://bugs.webkit.org/show_bug.cgi?id=175528 Reviewed by Carlos Garcia Campos. Hold the information about state updates in ThreadedCompositor, in the m_attributes struct. This way we don't need to store the updates in functors and accumulate them in the CoordinatedGraphicsScene class, but instead just apply any pending state update or atlas removal before the scene is rendered. This removes the need to update the CoordinatedGraphicsScene object from the main thread with data that ultimately has to be handled on the composition thread. Similarly, when updating CoordinatedGraphicsScene, we only need to synchronize on the m_attributes lock object once in order to retrieve the scene update information, instead of having each functor do that repeatedly. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::applyStateChanges): (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): (WebKit::CoordinatedGraphicsScene::detach): (WebKit::CoordinatedGraphicsScene::setActive): (WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted. (WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::releaseUpdateAtlases): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2017-08-14 Carlos Garcia Campos [GTK][WPE] Avoid emitting WebKitFaviconDatabase::favicon-changed multiple times while setting an icon https://bugs.webkit.org/show_bug.cgi?id=175531 Reviewed by Michael Catanzaro. When webkitFaviconDatabaseSetIconForPageURL() is called, both setIconURLForPageURL() and setIconDataForIconURL() might notify the client, which ends up emitting the WebKitFaviconDatabase::favicon-changed signal and calling webkitFaviconDatabaseSetIconURLForPageURL(). Both things are already done by webkitFaviconDatabaseSetIconForPageURL() itself, so we can just ignore the client notification while setting a new icon. * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (webkitFaviconDatabaseSetIconURLForPageURL): Return early if isSettingIcon is true. (webkitFaviconDatabaseSetIconForPageURL): Set isSettingIcon to true for the scope. 2017-08-14 Carlos Garcia Campos [GTK][WPE] Crash in IconDatabase::IconRecord::setImageData() https://bugs.webkit.org/show_bug.cgi?id=175527 Reviewed by Žan Doberšek. The problem is that when setImageData() is called from IconDatabase::readFromDatabase() the shared buffer might be nullptr, because getImageDataForIconURLFromSQLDatabase() returns nullptr if the icon data is not in the database. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::IconRecord::setImageData): Return early if passed in buffer is nullptr. 2017-08-14 Zan Dobersek [ThreadedCompositor] Improve composition and update state handling https://bugs.webkit.org/show_bug.cgi?id=172448 Reviewed by Carlos Garcia Campos. In the ThreadedCompositor and related classes, we now track composition and scene update states separately. This enables properly piping in the DisplayRefreshMonitor object, leveraging it for both display refresh notifications and signalling to the client that the scene update is completed. In CompositingRunLoop, two separate states are now used, one for compositing and the other for scene update. Access to both should be done while the related Lock object is held. The pending update state is also tracked in order to schedule any required updates as soon as the current state update is completed. In ThreadedCompositor, the information about client notification and update completion coordination is now also kept under a Lock object, moving away from atomics. DisplayRefreshMonitor can now utilize just two methods in order to either schedule an update or report that update as finished. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::compositionCompleted): (WebKit::CompositingRunLoop::updateCompleted): (WebKit::CompositingRunLoop::updateTimerFired): (WebKit::CompositingRunLoop::isActive): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: (WebKit::CompositingRunLoop::stateLock): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::requestDisplayRefreshMonitorUpdate): (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): (WebKit::ThreadedCompositor::renderNextFrameIfNeeded): Deleted. (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): Deleted. (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback): 2017-08-13 Manuel Rego Casasnovas Composition underline color is always black https://bugs.webkit.org/show_bug.cgi?id=174675 Reviewed by Ryosuke Niwa. This patch uses the current color of the text instead of black for the composition underline marker. This makes it visible in the case we have a black/dark background. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::extractUnderlines): If NSUnderlineColorAttributeName is not present use text color for composition underline. (WebKit::WebViewImpl::setMarkedText): Use text color for composition underline in the plain text case. * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): Use text color for composition underline. (WebKit::InputMethodFilter::updatePreedit): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setCompositionForTesting): Ditto. 2017-08-13 Adrian Perez de Castro [WPE] Implement WebCore::standardUserAgent() https://bugs.webkit.org/show_bug.cgi?id=175507 Reviewed by Carlos Alberto Lopez Perez. Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port. * UIProcess/API/glib/WebKitSettings.cpp: Remove preprocessor conditionals for the WPE port. (webkit_settings_set_user_agent): (webkit_settings_set_user_agent_with_application_details): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::standardUserAgent): Remove hardcoded value and make use of WebCore::standardUserAgent(). 2017-08-11 Ryosuke Niwa Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation https://bugs.webkit.org/show_bug.cgi?id=175474 Reviewed by Wenson Hsieh. Replaced the build flag by a runtime flag and disabled the feature by default. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDataTransferItemsEnabled): Added to be used by WebKitTestRunner. (WKPreferencesGetDataTransferItemsEnabled): Ditto. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-10 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * UIProcess/WebResourceLoadStatisticsStore.h: Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-11 Adrian Perez de Castro [WPE] Build failure with Clang 4.0.1: no matching conversion for functional-style cast from 'pointer' (aka 'unsigned short *') to 'WTF::String' https://bugs.webkit.org/show_bug.cgi?id=175477 Reviewed by Žan Doberšek. * Shared/wpe/WebEventFactory.cpp: (WebKit::singleCharacterStringForKeyEvent): Cast to UChar* to make compiler choose the correct WTF::String constructor. 2017-08-11 Carlos Garcia Campos [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication https://bugs.webkit.org/show_bug.cgi?id=175378 Reviewed by Sergio Villar Senin. In case of HTTPS resource with a proxy, libsoup uses a tunnel internally, that uses its own SoupMessage during the proxy authentication. We were ignoring authentication requests for other messages. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::authenticateCallback): Only return early if the message does't match and it's not HTTPS resource over a proxy. (WebKit::NetworkDataTaskSoup::authenticate): Use the soup message from the authentication challenge. (WebKit::NetworkDataTaskSoup::continueAuthenticate): Ditto. 2017-08-10 Carlos Garcia Campos [Soup] Do not spawn the network process to setup cookie persistent storage https://bugs.webkit.org/show_bug.cgi?id=175424 Reviewed by Sergio Villar Senin. The persistent storage configuration is saved and passed to network process as creation parameters, so we don't need to spawn the network process to configure it, when it's created eventually it will use the configuration. * UIProcess/soup/WebCookieManagerProxySoup.cpp: (WebKit::WebCookieManagerProxy::setCookiePersistentStorage): Use sendToNetworkingProcess() instead of endToNetworkingProcessRelaunchingIfNecessary(). 2017-08-10 Carlos Garcia Campos [GTK][WPE] Assertion failure in TimerBase inside WebCore::IconRecord::setImageData https://bugs.webkit.org/show_bug.cgi?id=173866 Reviewed by Michael Catanzaro. IconDatabase creates and destroys IconRecord objects in both database and main thread. If the IconRecord has a valid icon, its Image could be created in one thread and destroyed in another, something that is not expected to happen, because Image has a Timer member. Since we have all the data and we are decoding it right after creating the Image, we don't really need to keep the Image object around, we could simply take a reference of the encoded data and the decoded native image to be returned by synchronousIconForPageURL(). * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::IconRecord::image): Return NativeImagePtr now. (WebKit::IconDatabase::IconRecord::setImageData): Create a BitmapImage to decode it and keep a reference to the encoded data and decoded native image. (WebKit::IconDatabase::IconRecord::snapshot const): Use m_imageData to get the encoded data. (WebKit::IconDatabase::synchronousIconForPageURL): Return the native image and whether the icon is known or not. (WebKit::IconDatabase::IconRecord::loadImageFromResource): Deleted. * UIProcess/API/glib/IconDatabase.h: * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (getIconSurfaceSynchronously): Use new API. 2017-08-10 Dan Bernstein Restored svn:ignore values that went missing when the project got renamed. * WebKit.xcodeproj: Added property svn:ignore. 2017-08-10 Brady Eidson Rename the source files for the WTF persistent coders. https://bugs.webkit.org/show_bug.cgi?id=175441 Reviewed by Tim Horton. * NetworkProcess/cache/NetworkCacheCoders.h: * NetworkProcess/cache/NetworkCacheKey.cpp: * NetworkProcess/cache/NetworkCacheKey.h: * UIProcess/API/APIContentRuleListStore.cpp: 2017-08-10 John Wilander Resource Load Statistics: Increase grandfathering time to 7 days https://bugs.webkit.org/show_bug.cgi?id=175414 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-08-10 John Wilander Resource Load Statistics: Add significant figures to telemetry calls https://bugs.webkit.org/show_bug.cgi?id=175442 Reviewed by Brent Fulgham. With this change, logged values are allowed to have 3 significant figures as opposed to today's 0 which is wrong. * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::submitTopList): (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): 2017-08-10 Mark Lam Apply the UNLIKELY macro to some unlikely things. https://bugs.webkit.org/show_bug.cgi?id=175440 Reviewed by Yusuke Suzuki. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getBytecodeProfile): 2017-08-10 Chris Dumez Turn on support for Beacon API by default in STP https://bugs.webkit.org/show_bug.cgi?id=175445 Reviewed by Youenn Fablet. * Shared/WebPreferencesDefinitions.h: 2017-08-10 Ross Kirsling Fix iOS simulator build after change "[WTF] Move TextStream into WTF" https://bugs.webkit.org/show_bug.cgi?id=175211 Reviewed by Myles C. Maxfield. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scrollByContentOffset:]): (-[WKWebView _navigationGestureDidBegin]): 2017-08-10 Chris Dumez [Beacon] Do connect-src CSP check on redirects as well https://bugs.webkit.org/show_bug.cgi?id=175410 Reviewed by Youenn Fablet. Pass CSP Response headers to the NetworkProcess via NetworkResourceLoadParameters when doing a PingLoad. This allows PingLoad to do CSP checks (in particular connect-src ones) in case the ping load gets redirected. Those checks need to be done on the NetworkProcess side at this point because there is no guarantee the WebContent process is still around. To do the CSP checks, PingLoad lazily reconstructs a ContentSecurityPolicy object from the CSP response headers. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::contentSecurityPolicy): * NetworkProcess/PingLoad.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-10 Brian Burg WKPreferences should conform to NSCopying https://bugs.webkit.org/show_bug.cgi?id=175303 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Add conformance in the private header, as there is not consensus that this needs to be API. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences copyWithZone:]): Copy the wrapped WebPreferences instance and return its wrapper. 2017-08-10 Michael Catanzaro REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie https://bugs.webkit.org/show_bug.cgi?id=175426 Reviewed by Carlos Alberto Lopez Perez. * PlatformGTK.cmake: 2017-08-10 Brady Eidson Add ServiceWorkerJob. https://bugs.webkit.org/show_bug.cgi?id=175241 Reviewed by Tim Horton. * CMakeLists.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added. (WebKit::WebServiceWorkerProvider::singleton): (WebKit::WebServiceWorkerProvider::WebServiceWorkerProvider): (WebKit::WebServiceWorkerProvider::scheduleJob): * WebProcess/Storage/WebServiceWorkerProvider.h: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-08-10 Tim Horton Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture https://bugs.webkit.org/show_bug.cgi?id=175436 Reviewed by Simon Fraser. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): 2017-08-10 Michael Catanzaro Remove ENABLE_GAMEPAD_DEPRECATED https://bugs.webkit.org/show_bug.cgi?id=175361 Reviewed by Carlos Garcia Campos. * Configurations/FeatureDefines.xcconfig: 2017-08-10 Zan Dobersek [GTK] Don't use --whole-archive linking flags for the WebKit2 target libraries https://bugs.webkit.org/show_bug.cgi?id=175416 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: Drop the ADD_WHOLE_ARCHIVE_TO_LIBRARIES instruction for the WebKit2 target. This unnecessarily bundles complete archive files both into the main .so library as well as single executables that are linked against the WebKit2 target. 2017-08-09 Chris Dumez Disable Beacon API on WK1 DRT and WK2 when not using NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=175401 Reviewed by Brady Eidson. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetBeaconAPIEnabled): (WKPreferencesGetBeaconAPIEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * config.h: 2017-08-09 Yoshiaki Jitsukawa [PAL] Move spi/cocoa and spi/cg directories into PAL https://bugs.webkit.org/show_bug.cgi?id=175175 Reviewed by Myles C. Maxfield. * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: * NetworkProcess/Downloads/mac/DownloadMac.mm: * Platform/cocoa/SharedMemoryCocoa.cpp: * Platform/mac/LayerHostingContext.mm: * Shared/Cocoa/DataDetectionResult.mm: * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: * Shared/cf/CookieStorageUtilsCF.mm: * Shared/ios/InteractionInformationAtPosition.mm: * Shared/mac/HangDetectionDisablerMac.mm: * Shared/mac/RemoteLayerBackingStore.mm: * Shared/mac/RemoteLayerTreePropertyApplier.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/mac/WKView.mm: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: * UIProcess/ios/ViewGestureControllerIOS.mm: * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKPDFPageNumberIndicator.mm: * UIProcess/ios/WKScrollView.mm: * UIProcess/mac/RemoteLayerTreeHost.mm: * UIProcess/mac/ServicesController.mm: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: * UIProcess/mac/ViewGestureControllerMac.mm: * UIProcess/mac/ViewSnapshotStore.mm: * UIProcess/mac/WKViewLayoutStrategy.mm: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-08-09 John Wilander Resource Load Statistics: Increase grandfathering time to 3 days https://bugs.webkit.org/show_bug.cgi?id=175414 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-08-09 Jeremy Jones Invalidate PlaybackSessionManager in same fashion as VideoFullscreenManager. https://bugs.webkit.org/show_bug.cgi?id=175399 rdar://problem/33663344 Reviewed by Eric Carlson. Invalidate PlaybackSessionManager when WebPage is destructed. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::~WebPage): * WebProcess/cocoa/PlaybackSessionManager.h: * WebProcess/cocoa/PlaybackSessionManager.mm: (WebKit::PlaybackSessionManager::~PlaybackSessionManager): (WebKit::PlaybackSessionManager::invalidate): 2017-08-09 Don Olmstead [WTF] Move TextStream into WTF https://bugs.webkit.org/show_bug.cgi?id=175211 Reviewed by Myles C. Maxfield. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: * Shared/VisibleContentRectUpdateInfo.cpp: * Shared/VisibleContentRectUpdateInfo.h: * Shared/mac/RemoteLayerTreeTransaction.mm: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (WebKit::operator<<): * UIProcess/ios/WebPageProxyIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: 2017-08-09 Andy Estes Part 3 of: Rename DatabaseProcess to StorageProcess https://bugs.webkit.org/show_bug.cgi?id=175034 Reviewed by Brady Eidson. We tried renaming com.apple.WebKit.Databases to com.apple.WebKit.Storage in r219986, but this prevented trunk WebKit from running on iOS 11 devices. This is because launchd keeps a codesigned cache of XPC services, and refuses to launch services that aren't in the cache. It's not possibe for us to rebuild the cache with the new service name (only Apple's production build system can do this), and disabling the cache or opting WebKit's XPC services out of the cache might have a negative impact on our performance testing. For now we'll retain the name "com.apple.WebKit.Databases" on iOS 11 devices to work around this issue. If we find a way to allow the new service to run without impacting performance, we can revert this change. We will rename the service to "com.apple.WebKit.Storage" on macOS and iOS Simulator, and in a follow-up patch we'll use the new service name on post-iOS 11 device builds. * Configurations/BaseTarget.xcconfig: Defined WK_STORAGE_SERVICE_PRODUCT_NAME to be com.apple.WebKit.Databases by default, and overrode it to com.apple.WebKit.Storage on macOS and iOS Simulator. * Configurations/StorageService.xcconfig: Changed PRODUCT_NAME to $(WK_STORAGE_SERVICE_PRODUCT_NAME). * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): Changed to return "com.apple.WebKit.Storage" on macOS and iOS Simulator platforms. * WebKit.xcodeproj/project.pbxproj: Updated the "Copy XPC services for engineering builds" build phase to use WK_STORAGE_SERVICE_PRODUCT_NAME. 2017-08-09 Commit Queue Unreviewed, rolling out r220466, r220477, and r220487. https://bugs.webkit.org/show_bug.cgi?id=175411 This change broke existing API tests and follow up fixes did not resolve all the issues. (Requested by ryanhaddad on #webkit). Reverted changesets: https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220466 "WTF::Function does not allow for reference / non-default constructible return types" https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220477 https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220487 2017-08-09 Chris Dumez [Beacon][NetworkSession] Support CORS-preflighting on redirects https://bugs.webkit.org/show_bug.cgi?id=175386 Reviewed by Youenn Fablet. Add support to Beacon for doing CORS-preflighting upon redirect to a different domain. * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::~PingLoad): (WebKit::PingLoad::loadRequest): (WebKit::PingLoad::securityOrigin const): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::didReceiveResponseNetworkSession): (WebKit::PingLoad::needsCORSPreflight const): (WebKit::PingLoad::doCORSPreflight): * NetworkProcess/PingLoad.h: 2017-08-09 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 rdar://problem/33301230 Reviewed by Tim Horton. Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController. * UIProcess/ios/forms/WKAirPlayRoutePicker.h: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker dealloc]): (-[WKAirPlayRoutePicker show:fromRect:]): (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted. (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted. (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted. (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted. (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted. (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted. (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted. 2017-08-09 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * UIProcess/WebResourceLoadStatisticsStore.h: Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-09 Wenson Hsieh [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default https://bugs.webkit.org/show_bug.cgi?id=175392 Reviewed by Tim Horton and Megan Gardner. Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10). * Configurations/FeatureDefines.xcconfig: 2017-08-09 Brady Eidson ServiceWorker experimental feature should not be on by default (definitely not ready). https://bugs.webkit.org/show_bug.cgi?id=175389 Rubberstamped by Andy Estes. * Shared/WebPreferencesDefinitions.h: false, not DEFAULT_EXPERIMENTAL_FEATURES_ENABLED 2017-08-09 Ryan Haddad Unreviewed, rolling out r220457. This change introduced API test failures. Reverted changeset: "WTF::Function does not allow for reference / non-default constructible return types" https://bugs.webkit.org/show_bug.cgi?id=175244 http://trac.webkit.org/changeset/220457 2017-08-09 Daniel Bates REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication https://bugs.webkit.org/show_bug.cgi?id=175247 Reviewed by Brady Eidson. Add SPI WKNavigationAction._isRedirect to query whether the navigation was in response to receiving a redirect response. The majority of the WebKit change is plumbing this knowledge through to connect it with the SPI. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): (WebKit::NavigationActionData::decode): Encode and decode the boolean NavigationActionData::isRedirect. * Shared/NavigationActionData.h: * UIProcess/API/APINavigationAction.h: * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction _isRedirect]): Added. * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Set NavigationActionData::isRedirect depending on whether the navigation is in response to receiving a redirect response. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-08-09 Sam Weinig WTF::Function does not allow for reference / non-default constructible return types https://bugs.webkit.org/show_bug.cgi?id=175244 Reviewed by Chris Dumez. * UIProcess/WebResourceLoadStatisticsStore.h: Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows us to remove support for calling null WTF::Function. No change in behavior. 2017-08-08 Wenson Hsieh Unreviewed, rolling out r220393. This patch regresses the performance of WebPage::editorState. Reverted changeset: "[iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div" https://bugs.webkit.org/show_bug.cgi?id=175116 http://trac.webkit.org/changeset/220393 2017-08-08 Chris Dumez [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION https://bugs.webkit.org/show_bug.cgi?id=175264 Reviewed by Youenn Fablet. Implement CORS-preflighting for beacons with a payload that has a non safelisted MIME type, as per: - https://w3c.github.io/beacon/#privacy - https://www.w3.org/TR/beacon/#sec-processing-model CORS-preflighting is completely handled on Network Process side because a beacon request can outlive its page and therefore its WebContent process. This requires us to pass a little more information to the Network process, in particular the source origin and the corsMode. The current implementation does not currently deal with CORS preflights needed upon a redirect. This will be added in a follow-up. * CMakeLists.txt: * NetworkProcess/NetworkCORSPreflightChecker.cpp: Added. (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker): (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker): (WebKit::NetworkCORSPreflightChecker::startPreflight): (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection): (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession): (WebKit::NetworkCORSPreflightChecker::didReceiveData): (WebKit::NetworkCORSPreflightChecker::didCompleteWithError): (WebKit::NetworkCORSPreflightChecker::didSendData): (WebKit::NetworkCORSPreflightChecker::wasBlocked): (WebKit::NetworkCORSPreflightChecker::cannotShowURL): * NetworkProcess/NetworkCORSPreflightChecker.h: Added. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/PingLoad.cpp: Added. (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::~PingLoad): (WebKit::PingLoad::startNetworkLoad): (WebKit::PingLoad::willPerformHTTPRedirection): (WebKit::PingLoad::didReceiveChallenge): (WebKit::PingLoad::didReceiveResponseNetworkSession): (WebKit::PingLoad::didReceiveData): (WebKit::PingLoad::didCompleteWithError): (WebKit::PingLoad::didSendData): (WebKit::PingLoad::wasBlocked): (WebKit::PingLoad::cannotShowURL): (WebKit::PingLoad::timeoutTimerFired): (WebKit::PingLoad::needsCORSPreflight const): (WebKit::PingLoad::doCORSPreflight): * NetworkProcess/PingLoad.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): * WebProcess/Network/WebLoaderStrategy.h: 2017-08-08 Megan Gardner Remove old and unused pointIsInAssistedNode definition https://bugs.webkit.org/show_bug.cgi?id=175335 Stage removal here to allow removal from UIKit. Replaced by textInteractionGesture:shouldBeginAtPoint: Reviewed by Tim Horton. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView pointIsInAssistedNode:]): Deleted. 2017-08-08 Michael Catanzaro Unreviewed, fix Ubuntu LTS build https://bugs.webkit.org/show_bug.cgi?id=174490 * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): 2017-08-08 Wenson Hsieh Unreviewed, fix the Mac debug build after r220418. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::prepareForMoveToWindow): 2017-08-08 Wenson Hsieh [Mac WK2] WebViewImpl should hold a weak pointer to its WKWebView or WKView https://bugs.webkit.org/show_bug.cgi?id=175302 Reviewed by Tim Horton. Refactor WebViewImpl's m_view from a raw pointer to a WeakObjCPtr to ensure that it is automatically cleared out when the WKWebView or WKView are destroyed, and also changes several places where we implicitly block capture the WebViewImpl to only capture a WeakPtr to the WebViewImpl. Most of the changes here are boilerplate adjustments for how m_view is now a weak pointer. Test: WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView. * Shared/mac/WeakObjCPtr.h: (WebKit::WeakObjCPtr::operator ValueType * const): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateTouchBar): (WebKit::WebViewImpl::updateMediaTouchBar): (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::~WebViewImpl): (WebKit::WebViewImpl::window): (WebKit::WebViewImpl::resignFirstResponder): (WebKit::WebViewImpl::isFocused const): (WebKit::WebViewImpl::renewGState): (WebKit::WebViewImpl::setFrameAndScrollBy): (WebKit::WebViewImpl::updateWindowAndViewFrames): (WebKit::WebViewImpl::updateLayer): (WebKit::WebViewImpl::printOperationWithPrintInfo): (WebKit::WebViewImpl::updateContentInsetsIfAutomatic): (WebKit::WebViewImpl::setLayoutMode): (WebKit::WebViewImpl::intrinsicDeviceScaleFactor const): (WebKit::WebViewImpl::windowDidBecomeKey): (WebKit::WebViewImpl::windowDidResignKey): (WebKit::WebViewImpl::windowDidChangeScreen): (WebKit::WebViewImpl::mightBeginDragWhileInactive): (WebKit::WebViewImpl::acceptsFirstMouse): (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent): (WebKit::WebViewImpl::windowResizeMouseLocationIsInVisibleScrollerThumb): (WebKit::WebViewImpl::viewWillMoveToWindow): (WebKit::WebViewImpl::viewDidMoveToWindow): (WebKit::WebViewImpl::viewDidChangeBackingProperties): (WebKit::WebViewImpl::hitTest): (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent): (WebKit::WebViewImpl::colorSpace): (WebKit::WebViewImpl::prepareForMoveToWindow): (WebKit::WebViewImpl::notifyInputContextAboutDiscardedComposition): (WebKit::WebViewImpl::pressureChangeWithEvent): (WebKit::WebViewImpl::fullScreenWindowController): (WebKit::WebViewImpl::executeSavedCommandBySelector): (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes): (WebKit::WebViewImpl::handleRequestedCandidates): (WebKit::WebViewImpl::preferencesDidChange): (WebKit::WebViewImpl::setTextIndicator): (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly): (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens): (WebKit::WebViewImpl::sendToolTipMouseExited): (WebKit::WebViewImpl::sendToolTipMouseEntered): (WebKit::WebViewImpl::toolTipChanged): (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer): (WebKit::WebViewImpl::updateThumbnailViewLayer): (WebKit::WebViewImpl::setInspectorAttachmentView): (WebKit::WebViewImpl::inspectorAttachmentView): (WebKit::WebViewImpl::draggedImage): (WebKit::WebViewImpl::draggingEntered): (WebKit::WebViewImpl::draggingUpdated): (WebKit::WebViewImpl::draggingExited): (WebKit::WebViewImpl::performDragOperation): (WebKit::WebViewImpl::hitTestForDragTypes): (WebKit::WebViewImpl::startWindowDrag): (WebKit::WebViewImpl::dragImageForView): (WebKit::WebViewImpl::setPromisedDataForImage): (WebKit::WebViewImpl::setPromisedDataForAttachment): (WebKit::WebViewImpl::takeViewSnapshot): (WebKit::WebViewImpl::scrollWheel): (WebKit::WebViewImpl::magnifyWithEvent): (WebKit::WebViewImpl::rotateWithEvent): (WebKit::WebViewImpl::doneWithKeyEvent): (WebKit::WebViewImpl::interpretKeyEvent): (WebKit::WebViewImpl::firstRectForCharacterRange): (WebKit::WebViewImpl::characterIndexForPoint): (WebKit::WebViewImpl::performKeyEquivalent): (WebKit::WebViewImpl::keyUp): (WebKit::WebViewImpl::keyDown): (WebKit::WebViewImpl::mouseMoved): (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse): (WebKit::WebViewImpl::userInterfaceLayoutDirection): 2017-08-08 Filip Pizlo Baseline JIT should do caging https://bugs.webkit.org/show_bug.cgi?id=175037 Reviewed by Mark Lam. Use a better API to disable disabling the primitive gigacage. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::primitiveGigacageDisabled): Deleted. 2017-08-08 John Wilander Resource Load Statistics: Clear web processes' state on history removal https://bugs.webkit.org/show_bug.cgi?id=175271 Reviewed by Chris Dumez. https://bugs.webkit.org/show_bug.cgi?id=175090 introduced state in the web process and that state needs to be cleared when the UI process' statistics are cleared as part of history removal. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::clearResourceLoadStatistics): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::clearResourceLoadStatistics): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-08-08 Adrian Perez de Castro [WPE] Implement WebsiteDataStore::defaultApplicationCacheDirectory() and friends https://bugs.webkit.org/show_bug.cgi?id=175322 Reviewed by Carlos Garcia Campos. This makes WPE use the same implementation as the GTK+ port, with a preprocessor switch to choose the name of the base directory inside the user XDG cache directory. * PlatformGTK.cmake: Add APIWebsiteDataStoreGLib.cpp to the build sources and remove APIWebsiteDataStoreGtk.cpp. * PlatformWPE.cmake: Add APIWebsiteDataStoreGLib.cpp to the built sources. * UIProcess/API/APIWebsiteDataStore.cpp: Remove now dead code. * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp. (API::WebsiteDataStore::defaultApplicationCacheDirectory): (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): (API::WebsiteDataStore::defaultLocalStorageDirectory): (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): 2017-08-08 Ryan Haddad Unreviewed, rolling out r220368. This change caused WK1 tests to exit early with crashes. Reverted changeset: "Baseline JIT should do caging" https://bugs.webkit.org/show_bug.cgi?id=175037 http://trac.webkit.org/changeset/220368 2017-08-08 Michael Catanzaro [CMake] Properly test if compiler supports compiler flags https://bugs.webkit.org/show_bug.cgi?id=174490 Reviewed by Konstantin Tokarev. * CMakeLists.txt: * PlatformGTK.cmake: 2017-08-07 Carlos Garcia Campos Web Automation: setUserInputForCurrentJavaScriptPrompt should fail if current dialog is not a prompt https://bugs.webkit.org/show_bug.cgi?id=175261 Reviewed by Brian Burg. According to the spec, send alert text command should fail if the current dialog is not a prompt. This patch adds JavaScriptDialogType enum to API::AutomationSessionClient and a new virtual method to ask the client about the type of the current dialog. WebAutomationSession::setUserInputForCurrentJavaScriptPrompt() uses the new client method to check the type of the current dialog and fail in case it's not a prompt. Cocoa needs an implementation, for now it always returns Prompt as the type to keep compatibility. 18.4 Send Alert Text. https://w3c.github.io/webdriver/webdriver-spec.html#send-alert-text This fixes selenium test testSettingTheValueOfAnAlertThrows. * UIProcess/API/APIAutomationSessionClient.h: (API::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage): * UIProcess/API/glib/WebKitAutomationSession.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewGetCurrentScriptDialogType): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt): * UIProcess/Cocoa/AutomationSessionClient.h: * UIProcess/Cocoa/AutomationSessionClient.mm: (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage): 2017-08-08 Wenson Hsieh [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div https://bugs.webkit.org/show_bug.cgi?id=175116 Reviewed by Darin Adler and Ryosuke Niwa. Refactors WebPage::editorState to only use the StyleProperties derived from EditingStyle, instead of inserting and removing a temporary node to figure out the style. Also adds hooks to notify the UI delegate of EditorState changes. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (nsTextAlignment): (dictionaryRepresentationForEditorState): (-[WKWebView _didChangeEditorState]): Alerts the private UI delegate of UI-side EditorState updates. (-[WKWebView _web_editorStateDidChange]): (-[WKWebView _executeEditCommand:argument:completion:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _web_editorStateDidChange]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::selectionDidChange): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::executeEditCommand): Change executeEditCommand(name, callback) to executeEditCommand(name, argument, callback) and lift out of iOS platform code and into WebPage.cpp. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView executeEditCommandWithCallback:]): (-[WKContentView _selectionChanged]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::executeEditCommand): Deleted. Move the iOS-specific implementation of executeEditCommand that invokes a callback when the web process responds out of WebPageProxyIOS, and into cross-platform WebPageProxy code. Additionally, add a parameter for the edit command's argument. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState const): Use EditingStyle::styleAtSelectionStart instead of Editor::styleForSelectionStart when computing an EditorState. Tweak bold, italic and underline to use EditingStyle TriStates. (WebKit::shouldEnsureEditorStateUpdateAfterExecutingCommand): (WebKit::WebPage::executeEditCommandWithCallback): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::executeEditCommandWithCallback): Deleted. 2017-08-08 Zan Dobersek [TexMap] Don't expose GraphicsContext3D object https://bugs.webkit.org/show_bug.cgi?id=175310 Reviewed by Carlos Garcia Campos. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Stop using GraphicsContext3D directly and instead use the TextureMapper::clearColor() method to achieve the same result. 2017-08-07 Carlos Garcia Campos [GTK] Implement JavaScript dialog methods of API::AutomationSessionClient https://bugs.webkit.org/show_bug.cgi?id=175259 Reviewed by Michael Catanzaro. Move the default implementation of WebKitScriptDialog from WebKitWebView platform specific files to their own files. Implement all JavaScript dialog methods of API::AutomationSessionClient in WebKitAutomationSession. For now it only works when the user doesn't override WebKitWebView::script-dialog signal and default implementation is used. * PlatformGTK.cmake: Add new files to compilation. * PlatformWPE.cmake: Ditto. * UIProcess/API/glib/WebKitAutomationSession.cpp: (webkitAutomationSessionCreate): Pass the WebKitWebContext to the constructor and keep a pointer to it in session. * UIProcess/API/glib/WebKitAutomationSessionPrivate.h: * UIProcess/API/glib/WebKitScriptDialogPrivate.h: * UIProcess/API/glib/WebKitWebContext.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunJavaScriptAlert): Set the currently script dialog for the scope of the function. (webkitWebViewRunJavaScriptConfirm): Ditto. (webkitWebViewRunJavaScriptPrompt): Ditto. (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto. (webkitWebViewIsShowingScriptDialog): Ask current dialog if there's one. (webkitWebViewGetCurrentScriptDialogMessage): Ditto. (webkitWebViewSetCurrentScriptDialogUserInput): Ditto. (webkitWebViewAcceptCurrentScriptDialog): Ditto. (webkitWebViewDismissCurrentScriptDialog): Ditto. * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp: Added. (webkitWebViewCreateJavaScriptDialog): Moved from WebKitWebViewGtk.cpp. (webkitScriptDialogRun): Run the dialog, this code is moved from WebKitWebViewGtk.cpp. (webkitScriptDialogIsRunning): Return true if the script dialog has a native dialog running. (webkitScriptDialogAccept): Send Ok or Close response to the native dialog depending on the dialog type. (webkitScriptDialogDismiss): Send Close response to the native dialog. (webkitScriptDialogSetUserInput): Set the given text on the prompt dialog entry. * UIProcess/API/gtk/WebKitWebViewGtk.cpp: (webkitWebViewScriptDialog): Simply call webkitScriptDialogRun() now. * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp: Copied from Source/WebKit/UIProcess/API/glib/WebKitAutomationSessionPrivate.h. (webkitScriptDialogRun): (webkitScriptDialogIsRunning): (webkitScriptDialogAccept): (webkitScriptDialogDismiss): (webkitScriptDialogSetUserInput): 2017-08-07 Devin Rousso Web Inspector: Preview Canvas path when viewing a recording https://bugs.webkit.org/show_bug.cgi?id=174967 Reviewed by Brian Burg. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInspectorAdditionsEnabled): (WKPreferencesGetInspectorAdditionsEnabled): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add plumbing for new InspectorAdditions runtime flag. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::WebInspectorUI): Enable InspectorAdditions by default in the WebInspector page. 2017-08-07 Filip Pizlo Baseline JIT should do caging https://bugs.webkit.org/show_bug.cgi?id=175037 Reviewed by Mark Lam. Use a better API to disable disabling the primitive gigacage. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::primitiveGigacageDisabled): Deleted. 2017-08-06 Filip Pizlo Primitive auxiliaries and JSValue auxiliaries should have separate gigacages https://bugs.webkit.org/show_bug.cgi?id=174919 Reviewed by Keith Miller. The disable callback is all about the primitive gigacage. * WebProcess/WebProcess.cpp: (WebKit::primitiveGigacageDisabled): (WebKit::m_webSQLiteDatabaseTracker): (WebKit::gigacageDisabled): Deleted. 2017-08-07 Brian Burg Remove CANVAS_PATH compilation guard https://bugs.webkit.org/show_bug.cgi?id=175207 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: 2017-08-07 Carlos Alberto Lopez Perez [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy. https://bugs.webkit.org/show_bug.cgi?id=175125 Reviewed by Michael Catanzaro. * CMakeLists.txt: When using libepoxy avoid passing the CFLAGS from (E)GL, and instead pass the libepoxy ones. 2017-08-07 Carlos Alberto Lopez Perez [GTK][WPE] CFLAGS from pkg-config for (E)GL are not passed to WebKit https://bugs.webkit.org/show_bug.cgi?id=175125 Unreviewed follow-up fix after r220326. * CMakeLists.txt: Move the block appending to WebKit2_LIBRARIES below where the list itself is created. 2017-08-05 Carlos Garcia Campos [GTK][WPE] Add API to provide browser information required by automation https://bugs.webkit.org/show_bug.cgi?id=175130 Reviewed by Michael Catanzaro. When a new automation session is started, the web driver receives some required capabilities from the client, like browser name and version. The session should be rejected if those required capabilities don't match with the actual browser that is launched. We don't know that information in WebKit, so we need to add API so that users can provide it when a new session request is made. This patch adds boxed object WebKitApplicationInfo that can be used to set the application name and version. This object can be set to a WebKitAutomationSession when WebKitWebContext::automation-started signal is emitted. * PlatformGTK.cmake: * PlatformWPE.cmake: * UIProcess/API/glib/WebKitApplicationInfo.cpp: Added. (webkit_application_info_new): (webkit_application_info_ref): (webkit_application_info_unref): (webkit_application_info_set_name): (webkit_application_info_get_name): (webkit_application_info_set_version): (webkit_application_info_get_version): * UIProcess/API/glib/WebKitAutomationSession.cpp: (webkitAutomationSessionDispose): (webkit_automation_session_class_init): (webkitAutomationSessionGetBrowserName): (webkitAutomationSessionGetBrowserVersion): (webkit_automation_session_set_application_info): (webkit_automation_session_get_application_info): * UIProcess/API/glib/WebKitAutomationSessionPrivate.h: * UIProcess/API/glib/WebKitWebContext.cpp: * UIProcess/API/gtk/WebKitApplicationInfo.h: Added. * UIProcess/API/gtk/WebKitAutomationSession.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: * UIProcess/API/wpe/WebKitApplicationInfo.h: Added. * UIProcess/API/wpe/WebKitAutomationSession.h: * UIProcess/API/wpe/webkit.h: 2017-08-06 Carlos Alberto Lopez Perez [GTK][WPE] CFLAGS from pkg-config for (E)GL are not passed to WebKit https://bugs.webkit.org/show_bug.cgi?id=175125 Reviewed by Michael Catanzaro. Some platforms define cflags on the (E)GL pkg-config files that we need to pass to the build system when including the (E)GL headers. And we are already doing this when building WebCore (after r184954). But now we need to do this also on WebKit (former WebKit2) because we include (E)GL headers (and make use of them) on the UIProcess. * CMakeLists.txt: 2017-08-05 Carlos Garcia Campos WebDriver: Implement page load strategy https://bugs.webkit.org/show_bug.cgi?id=175183 Reviewed by Brian Burg. Split pending navigation maps into normal and eager, and use one or the other depending on the received page load strategy. We need to keep different maps for every page load strategy because every command could use a different strategy. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::waitForNavigationToComplete): Extract page load strategy from parameter and pass it to waitForNavigationToCompleteOnPage() and waitForNavigationToCompleteOnFrame(). (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Return early if page load strategy is none. Otherwise at the pening callback to the normal or eager map depeding on the page load straegy. (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Ditto. (WebKit::respondToPendingNavigationCallbacksWithTimeout): Helper to send pening navigation callback in case of timeout failure. (WebKit::WebAutomationSession::loadTimerFired): Call finishPendingNavigationsWithTimeoutFailure() with all the maps. (WebKit::WebAutomationSession::navigateBrowsingContext): Extract page load strategy from parameter and pass it to waitForNavigationToCompleteOnPage(). (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto. (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto. (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto. (WebKit::WebAutomationSession::navigationOccurredForFrame): Use the normal maps. (WebKit::WebAutomationSession::documentLoadedForFrame): Stop timeout timer and dispatch eager pending navigations. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Notify the automation session. 2017-08-05 Carlos Garcia Campos WebDriver: use in-view center point for clicks instead of bounding box center point https://bugs.webkit.org/show_bug.cgi?id=174863 Reviewed by Simon Fraser. Change computeElementLayout to also return the in-view center point and whether it's obscured by another element. * UIProcess/Automation/Automation.json: Add optional inViewCenterPoint to the result and isObscured. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::didComputeElementLayout): Handle inViewCenterPoint and isObscured. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.messages.in: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::elementInViewClientCenterPoint): Get the client in-view center point and whether it's obscured according to the spec. (WebKit::WebAutomationSessionProxy::computeElementLayout): Pass inViewCenterPoint and isObscured to DidComputeElementLayout message. 2017-08-05 Brian Burg Web Automation: files selected for upload should be matched against 'accept' attribute values case-insensitively https://bugs.webkit.org/show_bug.cgi?id=175191 Reviewed by Carlos Garcia Campos. Values of the "accept" attribute are to be compared in a case-insensitive manner, per https://html.spec.whatwg.org/multipage/input.html#file-upload-state-(type=file) Except for converting MIME types and extensions to lowercase, most of these changes were lost in a rebase prior to landing the patch. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::fileCanBeAcceptedForUpload): Fix some issues: - Handle a file ending in a period. - Handle MIME type inference failing. - Convert extensions and MIMEs to lower case, per specification. (WebKit::WebAutomationSession::handleRunOpenPanel): - Strip the leading period from file extensions. - These range converters crash unless the API::Array is retained by a local variable. 2017-08-04 Youenn Fablet [Cache API] Add Cache and CacheStorage IDL definitions https://bugs.webkit.org/show_bug.cgi?id=175201 Reviewed by Brady Eidson. * Shared/WebPreferencesDefinitions.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-04 Brian Burg Expose WKPreferences SPI for toggling mock capture devices prompt https://bugs.webkit.org/show_bug.cgi?id=175227 Reviewed by Youenn Fablet. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _mockCaptureDevicesPromptEnabled]): (-[WKPreferences _setMockCaptureDevicesPromptEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-08-04 Brian Burg Fix typo in WKPreferences _iceCandidateFiltertingEnabled property https://bugs.webkit.org/show_bug.cgi?id=175224 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _iceCandidateFilteringEnabled]): (-[WKPreferences _iceCandidateFiltertingEnabled]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-08-04 Chris Dumez [Beacon] Update sendBeacon to use the CachedResourceLoader https://bugs.webkit.org/show_bug.cgi?id=175192 Reviewed by Youenn Fablet. Deal with new Beacon CachedResource type. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): 2017-08-04 John Wilander Resource Load Statistics: Report user interaction immediately, but only when needed https://bugs.webkit.org/show_bug.cgi?id=175090 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleClearResourceLoadStatistics): Test infrastructure. Ends up calling WebCore::ResourceLoadObserver::clearState(). * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: 2017-08-04 Matt Lewis Unreviewed, rolling out r220288. This broke multiple builds. Reverted changeset: "Use MPAVRoutingController instead of deprecated versions." https://bugs.webkit.org/show_bug.cgi?id=175063 http://trac.webkit.org/changeset/220288 2017-08-04 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 rdar://problem/33301230 Reviewed by Tim Horton. Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController. * UIProcess/ios/forms/WKAirPlayRoutePicker.h: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker dealloc]): (-[WKAirPlayRoutePicker show:fromRect:]): (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted. (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted. (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted. (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted. (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted. (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted. (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted. 2017-08-04 Tim Horton viewport-fit changes during animated resize can cause layout size to get stuck https://bugs.webkit.org/show_bug.cgi?id=175169 Reviewed by Simon Fraser. If we get a commit that changes viewport-fit state while an animated resize is underway, and that change causes the client to push a new minimumLayoutSizeOverride, the new size will be lost forever, and we will get stuck laying out at the wrong size. This is because we unconditionally apply avoidsUnsafeArea for every commit, while most other changes that come in from a commit are ignored if we're inside animated resize. To fix, also ignore avoidsUnsafeArea changes during animated resize, by moving the code that keeps track of it into WKWebView like all of the rest, and read it out of the commit in didCommitLayerTree *after* the animated-resize early-return. Also, fix the associated layout tests by adding a missing assignment in _computedContentInset, which was broken in r220138. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): (-[WKWebView _processDidExit]): (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _setAvoidsUnsafeArea:]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _didChangeAvoidsUnsafeArea:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::setAvoidsUnsafeArea): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::avoidsUnsafeArea const): Deleted. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): 2017-08-04 Matt Lewis Unreviewed, rolling out r220271. Rolling out due to Layout Test failing on iOS Simulator. Reverted changeset: "Remove STREAMS_API compilation guard" https://bugs.webkit.org/show_bug.cgi?id=175165 http://trac.webkit.org/changeset/220271 2017-08-03 Sam Weinig [Cleanup] Remove ScriptGlobalObject https://bugs.webkit.org/show_bug.cgi?id=175173 Reviewed by Darin Adler. * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::windowObjectCleared): * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::windowObjectCleared): Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead. 2017-08-03 Brian Burg [Cocoa] Web Automation: copy JavaScript atoms to WebKit.framework private headers https://bugs.webkit.org/show_bug.cgi?id=175088 Reviewed by Joseph Pecoraro. * WebKit.xcodeproj/project.pbxproj: - Add a Copy Files phase to WebKit.framework. - Copy atoms to the atoms/ directory in WebKit.framework/PrivateHeaders/. 2017-08-04 Ryan Haddad Unreviewed, rolling out r220268. This change caused assertion failures on macOS and iOS Debug WK2. Reverted changeset: "Resource Load Statistics: Report user interaction immediately, but only when needed" https://bugs.webkit.org/show_bug.cgi?id=175090 http://trac.webkit.org/changeset/220268 2017-08-04 Andreas Kling NetworkLoad should always invoke its redirect completion handler https://bugs.webkit.org/show_bug.cgi?id=175179 Reviewed by Chris Dumez. Make sure the redirect completion handler is always invoked, just like we already did for the response completion handler. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): 2017-08-04 Youenn Fablet Remove STREAMS_API compilation guard https://bugs.webkit.org/show_bug.cgi?id=175165 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-08-04 Brady Eidson Enable ServiceWorkers at runtime for WebKitTestRunner. https://bugs.webkit.org/show_bug.cgi?id=175174 Reviewed by Youenn Fablet. * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::enableAllExperimentalFeatures): 2017-08-04 John Wilander Resource Load Statistics: Report user interaction immediately, but only when needed https://bugs.webkit.org/show_bug.cgi?id=175090 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleClearResourceLoadStatistics): Test infrastructure. Ends up calling WebCore::ResourceLoadObserver::clearState(). * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: 2017-08-04 Antti Koivisto Network cache should be usable as non-singleton https://bugs.webkit.org/show_bug.cgi?id=175139 Reviewed by Sam Weinig. We might want to use it as a non-singleton in the future (for example as a backend for the cache API). This patch makes NetworkCache::Cache and NetworkCache::Storage refcounted objects and takes care to ref them properly during asynchronous operations. The patch doesn't actually create any non-shared instances, it just adds the capability. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::clearDiskCacheEntries): (WebKit::NetworkProcess::setCacheModel): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::cache): Move the shared cache instance to the network process singleton. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): Include shared cache as a reffed member for non-ephemeral instances. (WebKit::NetworkResourceLoader::canUseCache const): (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::open): Open now returns null if it fails. Add RegisterNotify option to set up notify trigger for the shared instance. (WebKit::NetworkCache::Cache::Cache): (WebKit::NetworkCache::Cache::~Cache): Add destructor. (WebKit::NetworkCache::dumpFileChanged): (WebKit::NetworkCache::Cache::setCapacity): (WebKit::NetworkCache::Cache::retrieve): Protect the cache instance during asynchronous operations. (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::Cache::storeRedirect): (WebKit::NetworkCache::Cache::remove): (WebKit::NetworkCache::Cache::traverse): (WebKit::NetworkCache::Cache::dumpContentsToFile): (WebKit::NetworkCache::Cache::clear): (WebKit::NetworkCache::Cache::recordsPath const): (WebKit::NetworkCache::Cache::retrieveData): (WebKit::NetworkCache::Cache::storeData): (WebKit::NetworkCache::singleton): Deleted. (WebKit::NetworkCache::Cache::initialize): Deleted. * NetworkProcess/cache/NetworkCache.h: (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const): (WebKit::NetworkCache::Cache::isEnabled const): Deleted. Remove isEnabled() state as a cache object now always represents an enabled cache. * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest): (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse): (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading): * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::initialize): (WebKit::NetworkCache::Statistics::shrinkIfNeeded): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation): (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation): (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation): Operations now ref the storage. They are already deleted in the main thread so proper destruction is taken care of. (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::Storage::~Storage): (WebKit::NetworkCache::Storage::synchronize): This and other asynchronous methods now protect the Storage instance. (WebKit::NetworkCache::Storage::remove): (WebKit::NetworkCache::Storage::retrieve): (WebKit::NetworkCache::Storage::store): (WebKit::NetworkCache::Storage::traverse): (WebKit::NetworkCache::Storage::clear): (WebKit::NetworkCache::Storage::shrink): (WebKit::NetworkCache::Storage::deleteOldVersions): * NetworkProcess/cache/NetworkCacheStorage.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): (WebKit::NetworkProcess::clearDiskCache): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::NetworkProcess::clearDiskCache): 2017-08-04 Frederic Wang ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle https://bugs.webkit.org/show_bug.cgi?id=175135 Reviewed by Simon Fraser. This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so that it uses the fixed position rectangle relative of the first frame ancestor instead of the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS and RenderLayerCompositor. This fixes some flickering issues on iOS. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Use the fixed position rect of a non-main frame if there is one. 2017-08-03 Brian Burg Remove ENABLE(WEB_SOCKET) guards https://bugs.webkit.org/show_bug.cgi?id=167044 Reviewed by Joseph Pecoraro. * Configurations/FeatureDefines.xcconfig: * WebProcess/Network/WebSocketProvider.cpp: * WebProcess/Network/WebSocketProvider.h: 2017-08-03 Chris Dumez Multiple Layout tests from web-platform-tests/beacon/ are timing out. https://bugs.webkit.org/show_bug.cgi?id=175076 Reviewed by Alexey Proskuryakov. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::completeAuthenticationChallenge): In the NETWORK_SESSION code path, we did not ask the client about server trust evaluation when the clientCredentialPolicy was CannotAskClientForCredentials. This is because the same delegate is used for HTTP authentication and server trust evaluation in the NETWORK_SESSION code path. To align both code paths, we now ask the client about server trust evaluation even if the policy CannotAskClientForCredentials. This allows WKTR to trust certificates for localhost / 127.0.0.1 unconditionally and consistently. 2017-08-03 Yoshiaki Jitsukawa [PAL] Move spi/cf directory into PAL https://bugs.webkit.org/show_bug.cgi?id=175057 Reviewed by Antti Koivisto. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: * NetworkProcess/ios/NetworkProcessIOS.mm: * NetworkProcess/mac/NetworkLoadMac.mm: * NetworkProcess/mac/NetworkProcessMac.mm: * Shared/cf/CookieStorageUtilsCF.h: * Shared/mac/ChildProcessMac.mm: * Shared/mac/CookieStorageShim.mm: * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: * UIProcess/API/Cocoa/WKProcessPool.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: * UIProcess/WebsiteData/WebsiteDataStore.h: * UIProcess/mac/WebCookieManagerProxyMac.mm: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-08-03 Youenn Fablet Remove FETCH_API compilation guard https://bugs.webkit.org/show_bug.cgi?id=175154 Reviewed by Chris Dumez. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-03 Matt Lewis Unreviewed, rolling out r220209. This caused internal build failures. Reverted changeset: "Use MPAVRoutingController instead of deprecated versions." https://bugs.webkit.org/show_bug.cgi?id=175063 http://trac.webkit.org/changeset/220209 2017-08-02 Brian Burg Web Automation: consider file extensions in the "accept" attribute when deciding if a file can be uploaded https://bugs.webkit.org/show_bug.cgi?id=175081 Reviewed by Joseph Pecoraro. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::fileCanBeAcceptedForUpload): (WebKit::WebAutomationSession::handleRunOpenPanel): In cases where a file has an extension, try to match it against the accepted extensions list. Give up if there's no extension. Otherwise, proceed as normal to infer a MIME type based on the extension. In cases where extension-less files are inside hidden folders, the MIME inference will fail as well. 2017-08-03 Brady Eidson Add SW IDLs and stub out basic functionality. https://bugs.webkit.org/show_bug.cgi?id=175115 Reviewed by Chris Dumez. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::enableAllExperimentalFeatures): Explicitly skip SW for now. The ramifications to layouttests are complicated, and we'd like to follow up in a separate patch. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-03 Yoshiaki Jitsukawa [WebKit] Sort Xcode project file https://bugs.webkit.org/show_bug.cgi?id=175122 Reviewed by Antti Koivisto. * WebKit.xcodeproj/project.pbxproj: 2017-08-02 Sam Weinig [WebIDL] Convert MutationCallback to be a normal generated callback https://bugs.webkit.org/show_bug.cgi?id=174140 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilterPrivate.h: Pass, now necessary, Document to NativeNodeFilter constructor. 2017-08-03 Jeremy Jones Use MPAVRoutingController instead of deprecated versions. https://bugs.webkit.org/show_bug.cgi?id=175063 rdar://problem/33301230 Reviewed by Tim Horton. Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController. * UIProcess/ios/forms/WKAirPlayRoutePicker.h: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker dealloc]): (-[WKAirPlayRoutePicker show:fromRect:]): (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted. (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted. (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted. (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted. (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted. (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted. (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted. 2017-08-03 Chris Dumez Improve our support for referrer policies https://bugs.webkit.org/show_bug.cgi?id=175069 Reviewed by Darin Adler. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): 2017-08-02 Chris Dumez NetworkResourceLoader::setDefersLoading() may cause start() to be called multiple times https://bugs.webkit.org/show_bug.cgi?id=175109 Reviewed by Brady Eidson. If NetworkResourceLoader::setDefersLoading(false) is called by the client while m_networkLoad is null then we call NetworkResourceLoader::start() to start the load. This is needed in the case where a NetworkResourceLoader is constructed in deferred mode so that the load can later be started via setDefersLoading(). However, it is possible for setDefersLoading(false) to be called when start() has already been called, which causes start() to be called multiple times and leads to an assertion hit in debug. Normally, setDefersLoading(false) returns without calling start() if m_networkLoad is not null. It relies on m_networkLoad being non-null to determine if start() should be called. This is bad because start() checks the disk cache asynchronously *before* calling startNetworkLoad() and initializing m_networkLoad. Therefore, if setDefersLoading(false) is called *while* we are checking the cache, then we will call incorrectly call start() again. In the case of the radar, this happens when we: 1. Call start() and check the disk cache 2. Retrieve a cached redirect from the cache, which causes a WillSendRequest IPC to be sent to the WebProcess 3. The WebProcess calls setDefersLoading(true), sends the ContinueWillSendRequest IPC back and then calls setDefersLoading(false) The call to continueWillSendRequest() causes us to retrieve the redirected entry from the cache, asynchronously, which will return no entry and start a load. The later call to setDefersLoading(false) causes us to call start() again and we end up back to step 1. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::setDefersLoading): * NetworkProcess/NetworkResourceLoader.h: 2017-08-02 Andreas Kling NetworkRTCProvider::createResolver() leaks CFHost objects https://bugs.webkit.org/show_bug.cgi?id=175103 Reviewed by Youenn Fablet. Add a missing adoptCF() so we don't leak the CFHost. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createResolver): 2017-08-02 Jeremy Jones Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically https://bugs.webkit.org/show_bug.cgi?id=175080 Reviewed by Jon Lee. This is obsolete because of the alternate solution in https://bugs.webkit.org/show_bug.cgi?id=174850 * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]): Deleted. (-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-02 Filip Pizlo We should be OK with the gigacage being disabled on gmalloc https://bugs.webkit.org/show_bug.cgi?id=175082 Reviewed by Michael Saboff. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): 2017-08-02 Brian Burg Web Automation: files selected for upload should be checked against values of the 'accept' attribute https://bugs.webkit.org/show_bug.cgi?id=174803 Reviewed by Carlos Garcia Campos. Use the parsed values of the file input element's "accept" attribute to reject files that don't match the specified values. This is normally done by Safari using NSOpenPanel, but since a real open panel isn't shown during automation, it needs to be done here. Support for limiting accepted files by file extensions will be added when the same is implemented in the normal code path for the C and Objective-C APIs. This change is covered by internal WebDriver tests that will be rewritten for the public Webdriver W3C test suite someday, when safaridriver runs those tests itself. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::handleRunOpenPanel): Since we already have the proposed files, there's no need to compute a list of supported extensions based on wildcard MIME types. First check the extension, then the inferred MIME type for the extension, and then the wildcard MIME type if the inferred type is not an exact match. 2017-08-02 Tim Horton WKPDFView doesn't respect safe area insets https://bugs.webkit.org/show_bug.cgi?id=175046 Reviewed by Wenson Hsieh. * Platform/spi/ios/UIKitSPI.h: Add some SPI. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Drive-by fix two small custom content view issues: - Reset _scrollViewBackgroundColor; it is used to early-return from updating the background color if it hasn't changed, but if you go from a site with (for example) a white background, to a PDF, to another site with a white background, we will early-return and not reset the background color from the grey WKPDFView background. - When installing a custom content view, scroll to the origin. We miss the usual mechanism for scrolling to the origin when custom content views are installed, so do it here. (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]): Ignore _obscuredInsetEdgesAffectedBySafeArea for custom content views. This is fairly arbitrary, and we should find a different way to express different edge sets for different kinds of content (perhaps bake this into default viewports?), but for now this works. (-[WKWebView _computedContentInset]): Use _effectiveObscuredInsetEdgesAffectedBySafeArea instead of the ivar directly. (-[WKWebView _safeAreaShouldAffectObscuredInsets]): Force safe areas to not affect obscured insets for custom content views, so that it's up to every custom content view to take safe areas into account themselves. * UIProcess/API/Cocoa/WKWebViewInternal.h: Expose _computedUnobscuredSafeAreaInset for WKPDFView's use. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_setMinimumSize:]): Avoid rebuilding the WKPDFView if the minimum size didn't change. (-[WKPDFView _offsetForPageNumberIndicator]): Take unobscured safe area insets into account when insetting the page number indicator. (-[WKPDFView web_computedContentInsetDidChange]): Watch for unobscured safe area inset changes, and apply them to the layout of the WKPDFView. (-[WKPDFView _computePageAndDocumentFrames]): Make it possible to only update the WKPDFView's size and position, without rebuilding its subviews, if the width did not change. This prevents lots of flashing of the child UIPDFPageViews when the unobscured safe area insets change dynamically. Take the safe area insets into account when determining what width to lay out to. (-[WKPDFView _updateDocumentFrame]): Take the safe area insets into account when positioning the WKPDFView inside the WKScrollView. 2017-08-02 John Wilander ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel() should check the return value of storagePath() https://bugs.webkit.org/show_bug.cgi?id=175055 Reviewed by David Kilzer. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: (WebKit::ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel): Now uses dispatch_once() instead of NeverDestroyed and checks the return value of storagePath() before using it to load the model. 2017-08-01 Brian Burg HTML file input elements do not support file extensions in the "accept" attribute https://bugs.webkit.org/show_bug.cgi?id=95698 Reviewed by Darin Adler. Plumb accepted file extensions out to the C API. The Cocoa API will be improved in a later patch. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/API/APIOpenPanelParameters.cpp: (API::OpenPanelParameters::acceptFileExtensions const): * UIProcess/API/APIOpenPanelParameters.h: * UIProcess/API/C/WKOpenPanelParametersRef.cpp: (WKOpenPanelParametersCopyAcceptedFileExtensions): * UIProcess/API/C/WKOpenPanelParametersRef.h: 2017-08-02 Fujii Hironori Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName https://bugs.webkit.org/show_bug.cgi?id=175010 Reviewed by Alex Christensen. * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::compileContentRuleList): Call QualifiedName::init(). 2017-08-01 Chris Dumez Add initial support for navigator.sendBeacon https://bugs.webkit.org/show_bug.cgi?id=175007 Reviewed by Sam Weinig. Add experimental feature flag for the Beacon API, disabled by default. * Shared/WebPreferencesDefinitions.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-08-01 Filip Pizlo Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region) https://bugs.webkit.org/show_bug.cgi?id=174727 Reviewed by Mark Lam. The WebProcess should never disable the Gigacage by allocating typed arrays outside the Gigacage. So, we add a callback that crashes the process. * WebProcess/WebProcess.cpp: (WebKit::gigacageDisabled): (WebKit::m_webSQLiteDatabaseTracker): 2017-08-01 Brian Burg Web Automation: add event to notify service when a page's main frame window object has cleared https://bugs.webkit.org/show_bug.cgi?id=174987 Reviewed by Carlos Garcia Campos. * UIProcess/Automation/Automation.json: Add new event. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::navigationOccurredForFrame): (WebKit::WebAutomationSession::willClosePage): When a WebPage navigates or closes, send the browsingContextCleared event. Any element handles for elements in the browsing context are no longer valid. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): Add a new hook into the active automation session so it is notified when a page closes. 2017-08-01 Brady Eidson API test URLSchemeHandler.Exceptions is Exiting out early on macOS Debug.. https://bugs.webkit.org/show_bug.cgi?id=175030 Reviewed by Andy Estes. * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: (WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Release the API wrapped on the next spin of the runloop. 2017-08-01 Brady Eidson Part 2 of: Rename DatabaseProcess to StorageProcess. https://bugs.webkit.org/show_bug.cgi?id=174880 Reviewed by Andy Estes. Rename some more variables, classes, etc. to reflect the change. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted. (WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Shared/ProcessExecutablePath.h: * Shared/gtk/ProcessExecutablePathGtk.cpp: (WebKit::executablePathOfStorageProcess): (WebKit::executablePathOfDatabaseProcess): Deleted. * Shared/wpe/ProcessExecutablePathWPE.cpp: (WebKit::executablePathOfStorageProcess): (WebKit::executablePathOfDatabaseProcess): Deleted. * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::putOrAdd): * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::initializeWebsiteDataStore): (WebKit::StorageProcess::postStorageTask): (WebKit::StorageProcess::performNextStorageTask): (WebKit::StorageProcess::createStorageToWebProcessConnection): (WebKit::StorageProcess::fetchWebsiteData): (WebKit::StorageProcess::postDatabaseTask): Deleted. (WebKit::StorageProcess::performNextDatabaseTask): Deleted. (WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted. * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/mac/StorageProcessMac.mm: (WebKit::StorageProcess::initializeProcessName): * UIProcess/API/C/WKContext.cpp: (WKContextGetDatabaseProcessIdentifier): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateStorageProcess]): (-[WKProcessPool _storageProcessIdentifier]): (-[WKProcessPool _terminateDatabaseProcess]): Deleted. (-[WKProcessPool _databaseProcessIdentifier]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::getLaunchOptions): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::getLaunchOptions): (WebKit::StorageProcessProxy::getStorageProcessConnection): (WebKit::StorageProcessProxy::didClose): (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection): (WebKit::StorageProcessProxy::didFinishLaunching): (WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted. (WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted. * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::storageProcessDidCrash): (WebKit::WebContextClient::databaseProcessDidCrash): Deleted. * UIProcess/WebContextClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::getStorageProcessConnection): (WebKit::WebProcessPool::storageProcessCrashed): (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::storageProcessIdentifier): (WebKit::WebProcessPool::terminateStorageProcess): (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted. (WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted. (WebKit::WebProcessPool::databaseProcessCrashed): Deleted. (WebKit::WebProcessPool::databaseProcessIdentifier): Deleted. (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted. * UIProcess/WebProcessPool.h: (WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary): (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getStorageProcessConnection): (WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::storageProcessParameters): (WebKit::WebsiteDataStore::databaseProcessParameters): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::messageSenderConnection): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection): (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): (WebKit::WebToStorageProcessConnection::didReceiveMessage): (WebKit::WebToStorageProcessConnection::didClose): (WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage): (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted. (WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted. (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted. (WebKit::WebToDatabaseProcessConnection::didClose): Deleted. (WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted. (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted. * WebProcess/Storage/WebToStorageProcessConnection.h: (WebKit::WebToStorageProcessConnection::create): (WebKit::WebToDatabaseProcessConnection::create): Deleted. (WebKit::WebToDatabaseProcessConnection::connection): Deleted. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::webToStorageProcessConnectionClosed): (WebKit::WebProcess::webToStorageProcessConnection): (WebKit::WebProcess::ensureWebToStorageProcessConnection): (WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted. (WebKit::WebProcess::webToDatabaseProcessConnection): Deleted. (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted. * WebProcess/WebProcess.h: 2017-08-01 Brady Eidson Part 1 of: Rename DatabaseProcess to StorageProcess. https://bugs.webkit.org/show_bug.cgi?id=174879 Reviewed by Andy Estes. This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc). Some renaming in actual code did result (Some class/struct names, method names, etc) Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage" * CMakeLists.txt: * DerivedSources.make: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * WebKit.xcodeproj/project.pbxproj: * Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig. * StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist. * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in. * Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp. * Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h. * StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm. * StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp. * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp. * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h. * StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in. * StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp. * StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h. * StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in. * StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp. * StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h. * StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in. * StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp. * StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm. * StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm. * StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h. * UIProcess/Network/NetworkProcessProxy.cpp: * UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp. * UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h. * UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in. * UIProcess/WebContextSupplement.h: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: * WebProcess/Databases/WebDatabaseProvider.cpp: * WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp. * WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h. * WebProcess/WebProcess.cpp: 2017-08-01 Michael Catanzaro [CMake] WebKitFS.cmake depends on options set in Option cmake files that are included later https://bugs.webkit.org/show_bug.cgi?id=174855 Reviewed by Carlos Garcia Campos. Don't create derived sources directory here anymore. * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: 2017-07-31 Daniel Bates WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() may not be able to determine page that initiated navigation https://bugs.webkit.org/show_bug.cgi?id=174531 Remove a comment from WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() about determining the originating page independently from the originating frame. There does not seem to be much value to fixing this. We can always revisit this issue if we discover a strong motivating example. See for more details. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2017-07-31 Sam Weinig Remove unnecessary exceptions from storage code https://bugs.webkit.org/show_bug.cgi?id=174572 Reviewed by Chris Dumez. * WebProcess/Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::canAccessStorage): Deleted. * WebProcess/Storage/StorageAreaImpl.h: * WebProcess/Storage/StorageNamespaceImpl.cpp: Remove canAccessStorage. It is no longer called. 2017-07-30 Brady Eidson Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks. https://bugs.webkit.org/show_bug.cgi?id=174958 Reviewed by Darin Adler. * UIProcess/API/APIURLSchemeTask.h: * UIProcess/API/C/WKTestingSupport.cpp: (WKGetAPIURLSchemeTaskInstanceCount): (WKGetWebURLSchemeTaskInstanceCount): * UIProcess/API/C/WKTestingSupport.h: * UIProcess/WebURLSchemeTask.h: * WebKit.xcodeproj/project.pbxproj: 2017-07-29 Yusuke Suzuki Unreviewed, build fix for GTK and WPE about StorageProcess renaming * CMakeLists.txt: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: 2017-07-28 Brent Fulgham [Mac][WebKit2] WebKit sandbox errors while streaming Netflix https://bugs.webkit.org/show_bug.cgi?id=174955 Reviewed by Alex Christensen. Wider testing with the stricter sandboxing rules identified three more IOKit properties we need to expose: - CEAModeID - CEAPixelRepetition - IOFBHDMIDongleROM * WebProcess/com.apple.WebProcess.sb.in: 2017-07-28 Commit Queue Unreviewed, rolling out r219986. https://bugs.webkit.org/show_bug.cgi?id=174962 "broke PLT on iOS (rdar://problem/33602751)" (Requested by estes on #webkit). Reverted changeset: "Part 1 of: Rename DatabaseProcess to StorageProcess." https://bugs.webkit.org/show_bug.cgi?id=174879 http://trac.webkit.org/changeset/219986 2017-07-28 Commit Queue Unreviewed, rolling out r219990. https://bugs.webkit.org/show_bug.cgi?id=174961 "broke PLT on iOS (rdar://problem/33602751)" (Requested by estes on #webkit). Reverted changeset: "Part 2 of: Rename DatabaseProcess to StorageProcess." https://bugs.webkit.org/show_bug.cgi?id=174880 http://trac.webkit.org/changeset/219990 2017-07-28 Brady Eidson API tests that use URLSchemeHandler are failing. https://bugs.webkit.org/show_bug.cgi?id=174950 Reviewed by Alex Christensen. Make sure that in all cases where we remove the last task from the page->task map... ...We also remove the map itself. * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::stopTask): (WebKit::WebURLSchemeHandler::taskCompleted): (WebKit::WebURLSchemeHandler::removeTaskFromPageMap): * UIProcess/WebURLSchemeHandler.h: 2017-07-28 Brady Eidson WKURLSchemeTaskImpl instances are being abandoned (except if the task is stopped). and https://bugs.webkit.org/show_bug.cgi?id=174895 Reviewed by Alex Christensen. There was a lot going on here: - There was an unbroken cycle between URLSchemeHandlers and URLSchemeTasks - WKURLSchemeTasks were not destroying their API::URLSchemeTask implementation object - When a WKWebView was dealloc'ed, it was not cleaning up the related UIProcess tasks - If the NetworkingProcess crashed, WebProcesses were not cleaning up their tasks (and therefore the UIProcess tasks were also not getting cleaned up) - If a WebProcess crashed, the UIProcess was not cleaning up the related tasks * UIProcess/API/Cocoa/WKURLSchemeTask.mm: (-[WKURLSchemeTaskImpl dealloc]): Call API::~URLSchemeTask * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h: * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: (WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Clear out the API wrapper map so the wrapper and implementation object can both be destroyed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): Call stopAllURLSchemeTasks. (WebKit::WebPageProxy::processDidTerminate): Call stopAllURLSchemeTasks. (WebKit::WebPageProxy::stopAllURLSchemeTasks): * UIProcess/WebPageProxy.h: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): (WebKit::WebURLSchemeHandler::stopAllTasksForPage): (WebKit::WebURLSchemeHandler::stopTask): (WebKit::WebURLSchemeHandler::taskCompleted): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::WebURLSchemeTask): * UIProcess/WebURLSchemeTask.h: (WebKit::WebURLSchemeTask::pageID): Store separate from the WebPage so messaging is possible even after the WebPage* has been cleared. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopAllURLSchemeTasks): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::stopAllTasks): (WebKit::WebURLSchemeHandlerProxy::taskDidComplete): (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading): (WebKit::WebURLSchemeHandlerProxy::removeTask): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): Call stopAllURLSchemeTasks for each WebPage. 2017-07-28 Frederic Wang Fix typo in scrollPositionChangedViaDelegatedScrolling https://bugs.webkit.org/show_bug.cgi?id=174937 Reviewed by Wenson Hsieh. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): 2017-07-28 Jeremy Jones Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes. https://bugs.webkit.org/show_bug.cgi?id=174437 Reviewed by Darin Adler. Remove redundant Web- prefix from classes in WebKit namespace. * DerivedSources.make: * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h. * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in. * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: Added. * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h. * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in. * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Removed. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): * UIProcess/WebPageProxy.cpp: (WebKit::m_weakPtrFactory): (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::playbackSessionManager): (WebKit::WebPageProxy::videoFullscreenManager): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::playbackSessionManager): (WebKit::WebPage::videoFullscreenManager): * WebProcess/WebPage/WebPage.h: * WebProcess/cocoa/PlaybackSessionManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.h. * WebProcess/cocoa/PlaybackSessionManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.messages.in. * WebProcess/cocoa/PlaybackSessionManager.mm: Added. * WebProcess/cocoa/VideoFullscreenManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.h. (WebKit::VideoFullscreenInterfaceContext::create): * WebProcess/cocoa/VideoFullscreenManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.messages.in. * WebProcess/cocoa/VideoFullscreenManager.mm: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.mm. * WebProcess/cocoa/WebPlaybackSessionManager.mm: Removed. 2017-07-27 Zan Dobersek [CMake] Re-add the StorageProcess executable target https://bugs.webkit.org/show_bug.cgi?id=174929 Reviewed by Carlos Garcia Campos. Re-add the StorageProcess executable target that was removed in r219960. Back then it was still named DatabaseProcess, but the name changed in the following patches. * CMakeLists.txt: 2017-07-27 Brady Eidson Part 2 of: Rename DatabaseProcess to StorageProcess. https://bugs.webkit.org/show_bug.cgi?id=174880 Reviewed by Andy Estes. Rename some more variables, classes, etc. to reflect the change. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): (WebKit::NetworkProcess::didgrantSandboxExtensionsToStorageProcessForBlobs): (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted. (WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Shared/ProcessExecutablePath.h: * Shared/gtk/ProcessExecutablePathGtk.cpp: (WebKit::executablePathOfStorageProcess): (WebKit::executablePathOfDatabaseProcess): Deleted. * Shared/wpe/ProcessExecutablePathWPE.cpp: (WebKit::executablePathOfStorageProcess): (WebKit::executablePathOfDatabaseProcess): Deleted. * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::putOrAdd): * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::initializeWebsiteDataStore): (WebKit::StorageProcess::postStorageTask): (WebKit::StorageProcess::performNextStorageTask): (WebKit::StorageProcess::createStorageToWebProcessConnection): (WebKit::StorageProcess::fetchWebsiteData): (WebKit::StorageProcess::postDatabaseTask): Deleted. (WebKit::StorageProcess::performNextDatabaseTask): Deleted. (WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted. * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * StorageProcess/mac/StorageProcessMac.mm: (WebKit::StorageProcess::initializeProcessName): * UIProcess/API/C/WKContext.cpp: (WKContextGetDatabaseProcessIdentifier): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateStorageProcess]): (-[WKProcessPool _storageProcessIdentifier]): (-[WKProcessPool _terminateDatabaseProcess]): Deleted. (-[WKProcessPool _databaseProcessIdentifier]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::getLaunchOptions): (WebKit::StorageProcessProxy::getStorageProcessConnection): (WebKit::StorageProcessProxy::didClose): (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection): (WebKit::StorageProcessProxy::didFinishLaunching): (WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted. (WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted. * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::storageProcessDidCrash): (WebKit::WebContextClient::databaseProcessDidCrash): Deleted. * UIProcess/WebContextClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::getStorageProcessConnection): (WebKit::WebProcessPool::storageProcessCrashed): (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::storageProcessIdentifier): (WebKit::WebProcessPool::terminateStorageProcess): (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted. (WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted. (WebKit::WebProcessPool::databaseProcessCrashed): Deleted. (WebKit::WebProcessPool::databaseProcessIdentifier): Deleted. (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted. * UIProcess/WebProcessPool.h: (WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary): (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getStorageProcessConnection): (WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::storageProcessParameters): (WebKit::WebsiteDataStore::databaseProcessParameters): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::messageSenderConnection): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection): (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): (WebKit::WebToStorageProcessConnection::didReceiveMessage): (WebKit::WebToStorageProcessConnection::didClose): (WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage): (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted. (WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted. (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted. (WebKit::WebToDatabaseProcessConnection::didClose): Deleted. (WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted. (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted. * WebProcess/Storage/WebToStorageProcessConnection.h: (WebKit::WebToStorageProcessConnection::create): (WebKit::WebToDatabaseProcessConnection::create): Deleted. (WebKit::WebToDatabaseProcessConnection::connection): Deleted. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::webToStorageProcessConnectionClosed): (WebKit::WebProcess::webToStorageProcessConnection): (WebKit::WebProcess::ensureWebToStorageProcessConnection): (WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted. (WebKit::WebProcess::webToDatabaseProcessConnection): Deleted. (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted. * WebProcess/WebProcess.h: 2017-07-27 Nan Wang AX: A11Y: Zoom no longer follows keyboard insertion point in safari https://bugs.webkit.org/show_bug.cgi?id=174869 Reviewed by David Kilzer. There was a recent change by denying XPC services access by default. In UAZoomChangeFocus we need to send message to HIServices, so let's allow the connection to XPC services for that. * WebProcess/com.apple.WebProcess.sb.in: 2017-07-27 Brady Eidson Part 1 of: Rename DatabaseProcess to StorageProcess. https://bugs.webkit.org/show_bug.cgi?id=174879 Reviewed by Andy Estes. This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc). Some renaming in actual code did result (Some class/struct names, method names, etc) Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage" * CMakeLists.txt: * Configurations/Storage-iOS.entitlements: Renamed from Source/WebKit/Configurations/Databases-iOS.entitlements. * Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig. * Configurations/WebKit.xcconfig: * DerivedSources.make: * Platform/ExtraPrivateSymbolsForTAPI.h: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Renamed from Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb. * Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp. (WebKit::StorageProcessCreationParameters::StorageProcessCreationParameters): (WebKit::StorageProcessCreationParameters::encode): (WebKit::StorageProcessCreationParameters::decode): * Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h. * StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist. * StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm. (StorageServiceInitializer): * StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp. (main): * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp. * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h. * StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in. * StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp. * StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h. * StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in. * StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp. * StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h. * StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in. * StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp. (WebKit::StorageProcessMainUnix): * StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm. (WebKit::StorageProcess::initializeProcess): (WebKit::StorageProcess::initializeProcessName): (WebKit::StorageProcess::initializeSandbox): * StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm. (WebKit::StorageProcess::initializeProcess): (WebKit::StorageProcess::initializeProcessName): (WebKit::StorageProcess::initializeSandbox): * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Copied from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in. * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in. * StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): * UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp. * UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h. * UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in. * UIProcess/WebContextSupplement.h: (WebKit::WebContextSupplement::processDidClose): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): (WebKit::WebProcessPool::databaseProcessCrashed): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::databaseProcessParameters): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer): * WebProcess/Databases/WebDatabaseProvider.cpp: * WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp. * WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h. * WebProcess/WebProcess.cpp: 2017-07-27 Tim Horton PDF page number indicator is very flashy when scrolling https://bugs.webkit.org/show_bug.cgi?id=174882 Reviewed by Andy Estes. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKPDFPageNumberIndicator.mm: (-[WKPDFPageNumberIndicator initWithFrame:]): Increase the backdrop rendering resolution to reduce flashiness. It's still not perfect, but it's quite visibly better. 2017-07-26 Brady Eidson ResourceLoadStatistics API tests fail on El Capitan. https://bugs.webkit.org/show_bug.cgi?id=174877 Reviewed by Chris Dumez. Always install the testing callback. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): 2017-07-26 Tim Horton REGRESSION (r211160): Can't pinch to zoom unlocked encrypted PDFs in WKWebView https://bugs.webkit.org/show_bug.cgi?id=174881 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _hidePasswordView]): WKPasswordView saves and restores a bunch of scroll view properties, including those relating to zoom limits. The restoration happens in -[WKPasswordView hide], which is never called. Instead, the code added in r211160 just calls removeFromSuperview after unlocking, never restoring the old zoom limits, causing the then fully unlocked PDF to not be zoomable. Fix this by calling -hide instead of -removeFromSuperview (which -hide also calls). 2017-07-26 Brady Eidson Rename {Web/UI}Process/Storage to {Web/UI}Process/WebStorage. https://bugs.webkit.org/show_bug.cgi?id=174871 Reviewed by Chris Dumez. The standard these directories help implement is the "Web Storage" standard. "Storage" is too general of a word that we have plans to start using in other contexts soon. * CMakeLists.txt: * DerivedSources.make: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * WebKit.xcodeproj/project.pbxproj: * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: Renamed from Source/WebKit/UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp. * UIProcess/ResourceLoadStatisticsPersistentStorage.h: Renamed from Source/WebKit/UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h. * UIProcess/WebStorage/LocalStorageDatabase.cpp: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabase.cpp. * UIProcess/WebStorage/LocalStorageDatabase.h: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabase.h. * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabaseTracker.cpp. * UIProcess/WebStorage/LocalStorageDatabaseTracker.h: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabaseTracker.h. * UIProcess/WebStorage/StorageManager.cpp: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.cpp. * UIProcess/WebStorage/StorageManager.h: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.h. * UIProcess/WebStorage/StorageManager.messages.in: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.messages.in. * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: Renamed from Source/WebKit/UIProcess/Storage/ios/LocalStorageDatabaseTrackerIOS.mm. * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Renamed from Source/WebKit/UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm. * WebProcess/WebStorage/StorageAreaImpl.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaImpl.cpp. * WebProcess/WebStorage/StorageAreaImpl.h: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaImpl.h. * WebProcess/WebStorage/StorageAreaMap.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.cpp. * WebProcess/WebStorage/StorageAreaMap.h: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.h. * WebProcess/WebStorage/StorageAreaMap.messages.in: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.messages.in. * WebProcess/WebStorage/StorageNamespaceImpl.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageNamespaceImpl.cpp. * WebProcess/WebStorage/StorageNamespaceImpl.h: Renamed from Source/WebKit/WebProcess/Storage/StorageNamespaceImpl.h. * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp: Renamed from Source/WebKit/WebProcess/Storage/WebStorageNamespaceProvider.cpp. * WebProcess/WebStorage/WebStorageNamespaceProvider.h: Renamed from Source/WebKit/WebProcess/Storage/WebStorageNamespaceProvider.h. 2017-07-26 Brady Eidson Remove DATABASE_PROCESS build flag. https://bugs.webkit.org/show_bug.cgi?id=174868 Reviewed by Andy Estes. * CMakeLists.txt: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * DatabaseProcess/DatabaseToWebProcessConnection.cpp: * DatabaseProcess/DatabaseToWebProcessConnection.h: * DatabaseProcess/DatabaseToWebProcessConnection.messages.in: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp: * DatabaseProcess/ios/DatabaseProcessIOS.mm: * DatabaseProcess/mac/DatabaseProcessMac.mm: * DatabaseProcess/unix/DatabaseProcessMainUnix.h: * Shared/Databases/DatabaseProcessCreationParameters.cpp: * Shared/Databases/DatabaseProcessCreationParameters.h: * Shared/ProcessExecutablePath.h: * Shared/gtk/ProcessExecutablePathGtk.cpp: (WebKit::executablePathOfDatabaseProcess): * Shared/wpe/ProcessExecutablePathWPE.cpp: (WebKit::executablePathOfDatabaseProcess): * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::getLaunchOptions): * UIProcess/Databases/DatabaseProcessProxy.cpp: * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Databases/DatabaseProcessProxy.messages.in: * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::databaseProcessCrashed): (WebKit::WebProcessPool::databaseProcessIdentifier): (WebKit::WebProcessPool::terminateDatabaseProcess): * UIProcess/WebProcessPool.h: (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getDatabaseProcessConnection): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): * WebKit2Prefix.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: * WebProcess/Databases/WebToDatabaseProcessConnection.h: * WebProcess/WebProcess.cpp: * WebProcess/WebProcess.h: 2017-07-26 Brady Eidson Add test to verify certain child processes are not launched as a side effect of enabling ResourceLoadStatistics. https://bugs.webkit.org/show_bug.cgi?id=174851 Reviewed by Chris Dumez. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _databaseProcessIdentifier]): (-[WKProcessPool _pluginProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Plugins/PluginProcessManager.h: (WebKit::PluginProcessManager::pluginProcesses): 2017-07-26 Brian Burg Remove WEB_TIMING feature flag https://bugs.webkit.org/show_bug.cgi?id=174795 Reviewed by Alex Christensen. * Configurations/FeatureDefines.xcconfig: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::createRequest): (WebKit::NetworkDataTaskSoup::didSendRequest): (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError): (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): (WebKit::NetworkDataTaskSoup::didGetHeaders): (WebKit::NetworkDataTaskSoup::didRestart): * NetworkProcess/soup/NetworkDataTaskSoup.h: 2017-07-26 Brian Burg Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process https://bugs.webkit.org/show_bug.cgi?id=174828 Reviewed by Tim Horton. In the previous change I forgot to hoist the HandleArray and message-send out of the loop, so the code wasn't actually sending fewer messages. That's fixed now. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon): (WebKit::WebPageProxy::didChooseFilesForOpenPanel): 2017-07-26 Zan Dobersek Unreviewed. Fix a compiler warning that springs up when building the WPE port with Clang. * UIProcess/API/wpe/ScrollGestureController.h: Let ScrollGestureController be a class, and not a struct. This fits the usual pattern, and also matches the forward declaration used in WPE's PageClientImpl.h. 2017-07-26 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.5 release. * gtk/NEWS: Add release notes for 2.17.5. 2017-07-25 Carlos Garcia Campos Icon loader error on startup https://bugs.webkit.org/show_bug.cgi?id=174787 Reviewed by Brady Eidson. Ignore non HTTP favicons in glib API. * UIProcess/API/glib/WebKitIconLoadingClient.cpp: 2017-07-25 Brady Eidson ResourceLoadStatistics grandfathering happens much too often. and https://bugs.webkit.org/show_bug.cgi?id=174825 Reviewed by Chris Dumez. The ResourceLoadStatistics grandfathering procedure happens too often. - With an empty memory store, even though an empty memory store is a perfectly valid state. - On each launch, even if grandfathering happened on the last launch - because grandfathering data would not automatically be saved to disk. - After clearing all website data, at which point no grandfathering can possibly be relevant because there is no data to grandfather. This patch fixes those cases and adds API tests to verify they remain fixed. * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): allWebsiteDataTypes, but even with the private ones. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): If the types being cleared cover all of the types that ResourceLoadStatistics care about, don't grandfather afterwards. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Ditto. (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): Don't grandfather if the store read from disk is empty (as being empty is perfectly fine), and also log the event of "populated without grandfathering". * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes): (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Schedule a write right away so we don't re-grandfather on next launch, and also log the grandfathering event. (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Takes a ShouldGrandfather flag to tell whether or not data should be re-grandfathered after the store is cleared. (WebKit::WebResourceLoadStatisticsStore::logTestingEvent): Log the event to the testing client. (WebKit::dataTypesToRemove): Deleted. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Handles enabling ResourceLoadStatistics both with and without a testing callback. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-07-25 Andy Estes [Apple Pay] Add "carteBancaire" as a supported payment network https://bugs.webkit.org/show_bug.cgi?id=174841 Reviewed by Alex Christensen. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toSupportedNetwork): 2017-07-25 Brian Burg Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process https://bugs.webkit.org/show_bug.cgi?id=174828 Reviewed by Tim Horton. Send all of the sandbox extension handles in a single message, rather than one message per extension. Update message name and parameter types to match. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon): (WebKit::WebPageProxy::didChooseFilesForOpenPanel): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::extendSandboxForFilesFromOpenPanel): (WebKit::WebPage::extendSandboxForFileFromOpenPanel): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-07-25 Alex Christensen Fix API tests after r219871. https://bugs.webkit.org/show_bug.cgi?id=174807 WebKit2.OpenAndCloseWindowAsync and WebKit2.OpenAsyncWithNil API tests are fixed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): createNewPageAsync or createNewPage should be called, not both. 2017-07-25 Said Abou-Hallawa Async image decoding for large images should be disabled after the first time a tile is painted https://bugs.webkit.org/show_bug.cgi?id=174451 Reviewed by Simon Fraser. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::paintContents): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-07-25 Brian Burg Web Automation: add support for uploading files https://bugs.webkit.org/show_bug.cgi?id=174797 Reviewed by Joseph Pecoraro. The general strategy is to have automation clients set the list of files they want to select ahead of time. Then, the client simulates a click on the element. When that causes WebPageProxy to ask the UI delegate to runOpenPanel, it instead gives WebAutomationSession a chance to select files if the page is under control of automation. WebAutomationSession validates its file list and selects the files if valid. * CMakeLists.txt: Add frontend dispatcher files. * DerivedSources.make: Add frontend dispatcher code generator scripts as dependencies of the generated code. Add generated frontend dispatcher files to the list of output files. * UIProcess/Automation/Automation.json: Add a command to set the canned list of files that should be selected when prompted. If no files are selected, then the effect is as if the user had clicked "cancel" in the file chooser dialog. Add an event to signal to the WebDriver service that the file selection request has been either fulfilled or cancelled. This event is necessary because otherwise remotes cannot distinguish whether selecting the files failed for some reason, or if the UIProcess has not yet selected the files and sent them to the web content process. In either case, the input element's "files" attribute would return an empty FileList. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::WebAutomationSession): Add the frontend dispatcher for Automation domain. This is named m_domainNotifier since m_domainDispatcher is already being used for the backend command dispatcher. (WebKit::WebAutomationSession::handleRunOpenPanel): Validate that the files-to-select list has valid entries and select the files if so. If anything goes wrong, pretend to cancel out of the file chooser. Either way, notify the frontend with an event that the file chooser was dismissed due to selecting files or cancelling. Automation protocol clients may implement additional strategies to further restrict the conditions upon which local files can be uploaded. (WebKit::WebAutomationSession::setFilesToSelectForFileUpload): Added. Store the list of files as a vector of strings. The file list is always replaced. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runOpenPanel): If the page is under automation, delegating the runOpenPanel is likely to hang because WebDriver cannot interact directly with the file chooser dialog. Instead, give WebAutomationSession a chance to select files and don't tell the delegate. * WebKit.xcodeproj/project.pbxproj: Add frontend dispatcher files to "Derived Sources" group. 2017-07-25 Alex Christensen Modernize NavigationAction code https://bugs.webkit.org/show_bug.cgi?id=174807 Reviewed by Darin Adler. Mostly just use more move semantics. * Platform/IPC/HandleMessage.h: (IPC::callMemberFunctionImpl): * Shared/API/APIURLRequest.h: * Shared/NavigationActionData.h: * UIProcess/API/APINavigation.cpp: (API::Navigation::Navigation): * UIProcess/API/APINavigation.h: (API::Navigation::create): * UIProcess/API/APINavigationAction.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::decidePolicyForNavigationAction): * UIProcess/API/APIPolicyClient.h: * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): (API::UIClient::createNewPageAsync): (API::UIClient::canCreateNewPageAsync): * UIProcess/API/C/WKPage.cpp: (WKPageLoadURLRequest): (WKPageLoadURLRequestWithUserData): (WKPageSetPageUIClient): (WKPageSetPageNavigationClient): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): (WebKit::UIDelegate::UIClient::createNewPageAsync): * UIProcess/WebInspectorProxy.cpp: (WebKit::decidePolicyForNavigationAction): * UIProcess/WebNavigationState.cpp: (WebKit::WebNavigationState::createLoadRequestNavigation): * UIProcess/WebNavigationState.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: 2017-07-25 Carlos Garcia Campos REGRESSION(r218629): [GTK] ASSERTION FAILED: m_eglDisplay == EGL_NO_DISPLAY in WebCore::PlatformDisplay::~PlatformDisplay https://bugs.webkit.org/show_bug.cgi?id=174789 Reviewed by Žan Doberšek. Before r218629, the wayland nested compositor display was a singleton created on demand by AcceleratedSurfaceWayland, but now it's created unconditionally on web process creation when a valid display name is received from the UI process. The side effect of this is that now the shared display is created after the nested compositor display that is not a singleton anymore. The atexit used by PlatformDisplay to shutdown egl display assumes that it will be registered by the shared display. Since we switched to on demand AC mode, the shared display is only used in the web process when entering AC mode, that's why it only crashes when we have entered AC at least once. We just need to ensure that the shared display is created before the nested compositor display. * WebProcess/gtk/WaylandCompositorDisplay.cpp: (WebKit::WaylandCompositorDisplay::create): Check we are under wayland before creating the WaylandCompositorDisplay. 2017-07-24 Michael Catanzaro [GTK] ASSERTION FAILED: client in WebKit::IconDatabase::setClient https://bugs.webkit.org/show_bug.cgi?id=174788 Reviewed by Carlos Garcia Campos. IconDatabase ensures that setClient is never called with nullptr, but WebKitFaviconDatabase does exactly that. First, ensure it's safe to unset the client. Next, we can either remove the assertions from setClient or else automatically unset the client in IconDatabase::close. I opted to do both. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::close): (WebKit::IconDatabase::setIconDataForIconURL): (WebKit::IconDatabase::setIconURLForPageURL): * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate): Deleted. (webkitFaviconDatabaseDispose): Deleted. 2017-07-24 Michael Catanzaro [GTK][WPE] Remove useless conditional in IconDatabase::setIconDataForIconURL https://bugs.webkit.org/show_bug.cgi?id=174792 Reviewed by Carlos Garcia Campos. We have in IconDatabase::setIconDataForIconURL some code in a conditional to check if it's not being executed on the icon sync thread. But at the top of the function is an assertion to ensure the code is never executed on the icon sync thread. The condition is therefore useless and the code should be executed unconditionally. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::setIconDataForIconURL): 2017-07-24 Carlos Garcia Campos [GTK] Icon database error and crash https://bugs.webkit.org/show_bug.cgi?id=174760 Reviewed by Michael Catanzaro. The crash is a debug ASSERT that happens when the IconRecord image is created in one thread and destroyed in another one. IconDatabase creates and destroys IconRecord objects in both database and main thread. The IconRecord is destroyed when the icon is no longer retained, and we only release icons when we fail to get the image data (including pages that don't have a favicon). We can prevent this crash from happening if we ensure we never create an Image for an IconRecord when the given image data is nullptr. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::IconRecord::setImageData): 2017-07-24 Chris Dumez [WK2][Cocoa] Allow overriding the ITP data removal internal using a default https://bugs.webkit.org/show_bug.cgi?id=174802 Reviewed by Sam Weinig. Allow overriding the ITP data removal internal using a default to facilitate testing. Can be used like so: defaults write -g ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval 60 Will cause us to write every 60 seconds instead of 3600. * Shared/WebPreferencesDefinitions.h: * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded): 2017-07-24 Simon Fraser [iOS WK2] Crash under PageOverlayController::uninstallPageOverlay when doing multiple finds https://bugs.webkit.org/show_bug.cgi?id=174806 rdar://problem/33501664 Reviewed by Tim Horton. Calling TextIndicator::createWithSelectionInFrame can trigger layout via VisibleSelection code, which can re-enter FindController::updateFindIndicator which has by now removed m_findIndicatorOverlay from pageOverlayController's map, but not deleted it. The second call to uninstallPageOverlay() thus crashes at m_overlayGraphicsLayers.take(&overlay)->removeFromParent(). Fix by nulling out m_findIndicatorOverlay as soon as we uninstall it. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::updateFindIndicator): 2017-07-24 Chris Dumez Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore() https://bugs.webkit.org/show_bug.cgi?id=174790 Reviewed by Brady Eidson. Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore(). WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to |this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can get executed after the store is gone. To address the issue, we now use a RunLoop::Timer to schedule the write, instead of a WorkQueue::dispatchAfter() call. This way, we are guaranteed that the callback will not get called after the store has been destroyed. * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired): (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): (WebKit::ResourceLoadStatisticsPersistentStorage::ref): (WebKit::ResourceLoadStatisticsPersistentStorage::deref): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: 2017-07-24 Chris Dumez Unreviewed, rolling out r219828. Causes debug assertions to be hit on iOS Reverted changeset: "Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()" https://bugs.webkit.org/show_bug.cgi?id=174790 http://trac.webkit.org/changeset/219828 2017-07-24 Michael Catanzaro [GTK][WPE] Stop using AutodrainedPool in IconDatabase https://bugs.webkit.org/show_bug.cgi?id=174791 Reviewed by Alex Christensen. AutodrainedPool seems to be some NS garbage collection thing that has no implementation on other platforms. Now that IconDatabase is used only by GTK and WPE, we can stop using it. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::setIconDataForIconURL): (WebKit::IconDatabase::setIconURLForPageURL): (WebKit::IconDatabase::iconDatabaseSyncThread): (WebKit::IconDatabase::performURLImport): (WebKit::IconDatabase::readFromDatabase): 2017-07-24 Chris Dumez Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore() https://bugs.webkit.org/show_bug.cgi?id=174790 Reviewed by Brady Eidson. Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore(). WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to |this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can get executed after the store is gone. * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: (WebKit::ResourceLoadStatisticsPersistentStorage::createWeakPtr): 2017-07-23 Carlos Garcia Campos Unreviewed. REGRESSION(r219713): [GTK][WPE] Fix default favicon database patch. When nullptr is passed to webkit_web_context_set_favicon_database_directory() the default database directory was taken from WebProcessPool::platformDefaultIconDatabasePath(), that has been removed in r219713 without properly replacing it, now it uses an empty string. This causes that the current directory is used to create the favicon database. * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_set_favicon_database_directory): Use the default icon database directory instead of an empty string when nullptr is passed. 2017-07-23 Wenson Hsieh [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values https://bugs.webkit.org/show_bug.cgi?id=174769 Reviewed by Tim Horton. Fixes several API tests in the DataInteractionTests suite. See Source/WebCore/ChangeLog for more details. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-07-20 Carlos Garcia Campos WebDriver: implement page load timeout https://bugs.webkit.org/show_bug.cgi?id=174672 Reviewed by Brian Burg. Always start a timer when waiting for a navigation to complete. When the timer fires, pending callbacks for navigations are removed and invoked with a timeout error. If navigation completes before the timer is fired, then the timer is stopped. All navigation commands now receive the page load strategy and timeout as optional parameters, when not provided the default timeout (300 seconds) is used. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::WebAutomationSession): (WebKit::WebAutomationSession::waitForNavigationToComplete): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): (WebKit::WebAutomationSession::loadTimerFired): (WebKit::WebAutomationSession::navigateBrowsingContext): (WebKit::WebAutomationSession::goBackInBrowsingContext): (WebKit::WebAutomationSession::goForwardInBrowsingContext): (WebKit::WebAutomationSession::reloadBrowsingContext): (WebKit::WebAutomationSession::navigationOccurredForFrame): * UIProcess/Automation/WebAutomationSession.h: 2017-07-23 Takuro Ashie [GTK] Correct a typo in the reference manual of WebKitWebInspector https://bugs.webkit.org/show_bug.cgi?id=174767 Reviewed by Michael Catanzaro. * UIProcess/API/gtk/WebKitWebInspector.cpp: 2017-07-23 Chris Dumez Drop ExceptionCodeDescription class https://bugs.webkit.org/show_bug.cgi?id=174757 Reviewed by Darin Adler. Update GTK bindings to use new API on DOMException instead of ExceptionCodeDescription. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp: (webkit_dom_attr_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp: (webkit_dom_cdata_section_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp: (webkit_dom_css_rule_set_css_text): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp: (webkit_dom_css_style_declaration_set_property): (webkit_dom_css_style_declaration_set_css_text): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp: (webkit_dom_css_style_sheet_insert_rule): (webkit_dom_css_style_sheet_delete_rule): (webkit_dom_css_style_sheet_add_rule): (webkit_dom_css_style_sheet_remove_rule): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp: (webkit_dom_css_value_set_css_text): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp: (webkit_dom_character_data_dispatch_event): (webkit_dom_character_data_insert_data): (webkit_dom_character_data_delete_data): (webkit_dom_character_data_replace_data): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp: (webkit_dom_comment_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp: (webkit_dom_dom_implementation_create_document_type): (webkit_dom_dom_implementation_create_document): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp: (webkit_dom_dom_selection_collapse_to_end): (webkit_dom_dom_selection_collapse_to_start): (webkit_dom_dom_selection_extend): (webkit_dom_dom_selection_get_range_at): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp: (webkit_dom_dom_token_list_add): (webkit_dom_dom_token_list_remove): (webkit_dom_dom_token_list_toggle): (webkit_dom_dom_token_list_replace): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp: (webkit_dom_dom_window_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp: (webkit_dom_node_set_prefix): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_dispatch_event): (webkit_dom_document_create_element): (webkit_dom_document_create_cdata_section): (webkit_dom_document_create_processing_instruction): (webkit_dom_document_create_attribute): (webkit_dom_document_import_node): (webkit_dom_document_create_element_ns): (webkit_dom_document_create_attribute_ns): (webkit_dom_document_adopt_node): (webkit_dom_document_create_event): (webkit_dom_document_create_expression): (webkit_dom_document_evaluate): (webkit_dom_document_query_selector): (webkit_dom_document_query_selector_all): (webkit_dom_document_set_xml_version): (webkit_dom_document_set_cookie): (webkit_dom_document_set_body): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp: (webkit_dom_document_fragment_dispatch_event): (webkit_dom_document_fragment_query_selector): (webkit_dom_document_fragment_query_selector_all): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp: (webkit_dom_document_type_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_dispatch_event): (webkit_dom_element_set_attribute): (webkit_dom_element_set_attribute_node): (webkit_dom_element_remove_attribute_node): (webkit_dom_element_set_attribute_ns): (webkit_dom_element_set_attribute_node_ns): (webkit_dom_element_matches): (webkit_dom_element_closest): (webkit_dom_element_insert_adjacent_element): (webkit_dom_element_insert_adjacent_html): (webkit_dom_element_insert_adjacent_text): (webkit_dom_element_remove): (webkit_dom_element_query_selector): (webkit_dom_element_query_selector_all): (webkit_dom_element_set_inner_html): (webkit_dom_element_set_outer_html): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp: (webkit_dom_html_anchor_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp: (webkit_dom_html_applet_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp: (webkit_dom_html_area_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp: (webkit_dom_html_br_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp: (webkit_dom_html_base_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp: (webkit_dom_html_body_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp: (webkit_dom_html_button_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp: (webkit_dom_html_canvas_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp: (webkit_dom_html_d_list_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp: (webkit_dom_html_directory_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp: (webkit_dom_html_div_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp: (webkit_dom_html_document_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp: (webkit_dom_html_element_dispatch_event): (webkit_dom_html_element_set_inner_text): (webkit_dom_html_element_set_outer_text): (webkit_dom_html_element_set_content_editable): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp: (webkit_dom_html_embed_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp: (webkit_dom_html_field_set_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp: (webkit_dom_html_font_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp: (webkit_dom_html_form_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp: (webkit_dom_html_frame_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp: (webkit_dom_html_frame_set_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp: (webkit_dom_html_hr_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp: (webkit_dom_html_head_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp: (webkit_dom_html_heading_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp: (webkit_dom_html_html_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp: (webkit_dom_html_iframe_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp: (webkit_dom_html_image_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp: (webkit_dom_html_input_element_dispatch_event): (webkit_dom_html_input_element_set_max_length): (webkit_dom_html_input_element_set_size): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp: (webkit_dom_html_li_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp: (webkit_dom_html_label_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp: (webkit_dom_html_legend_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp: (webkit_dom_html_link_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp: (webkit_dom_html_map_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp: (webkit_dom_html_marquee_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp: (webkit_dom_html_menu_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp: (webkit_dom_html_meta_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp: (webkit_dom_html_mod_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp: (webkit_dom_html_o_list_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp: (webkit_dom_html_object_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp: (webkit_dom_html_opt_group_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp: (webkit_dom_html_option_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp: (webkit_dom_html_paragraph_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp: (webkit_dom_html_param_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp: (webkit_dom_html_pre_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp: (webkit_dom_html_quote_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp: (webkit_dom_html_script_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp: (webkit_dom_html_select_element_dispatch_event): (webkit_dom_html_select_element_add): (webkit_dom_html_select_element_set_length): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp: (webkit_dom_html_style_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp: (webkit_dom_html_table_caption_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp: (webkit_dom_html_table_cell_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp: (webkit_dom_html_table_col_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp: (webkit_dom_html_table_element_dispatch_event): (webkit_dom_html_table_element_insert_row): (webkit_dom_html_table_element_delete_row): (webkit_dom_html_table_element_set_caption): (webkit_dom_html_table_element_set_t_head): (webkit_dom_html_table_element_set_t_foot): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp: (webkit_dom_html_table_row_element_dispatch_event): (webkit_dom_html_table_row_element_insert_cell): (webkit_dom_html_table_row_element_delete_cell): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp: (webkit_dom_html_table_section_element_dispatch_event): (webkit_dom_html_table_section_element_insert_row): (webkit_dom_html_table_section_element_delete_row): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp: (webkit_dom_html_text_area_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp: (webkit_dom_html_title_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp: (webkit_dom_html_u_list_element_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp: (webkit_dom_media_list_delete_medium): (webkit_dom_media_list_append_medium): (webkit_dom_media_list_set_media_text): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp: (webkit_dom_named_node_map_set_named_item): (webkit_dom_named_node_map_remove_named_item): (webkit_dom_named_node_map_remove_named_item_ns): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp: (webkit_dom_node_dispatch_event): (webkit_dom_node_insert_before): (webkit_dom_node_replace_child): (webkit_dom_node_remove_child): (webkit_dom_node_append_child): (webkit_dom_node_clone_node_with_error): (webkit_dom_node_set_node_value): (webkit_dom_node_set_text_content): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp: (webkit_dom_processing_instruction_dispatch_event): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp: (webkit_dom_range_set_start): (webkit_dom_range_set_end): (webkit_dom_range_set_start_before): (webkit_dom_range_set_start_after): (webkit_dom_range_set_end_before): (webkit_dom_range_set_end_after): (webkit_dom_range_select_node): (webkit_dom_range_select_node_contents): (webkit_dom_range_compare_boundary_points): (webkit_dom_range_delete_contents): (webkit_dom_range_extract_contents): (webkit_dom_range_clone_contents): (webkit_dom_range_insert_node): (webkit_dom_range_surround_contents): (webkit_dom_range_create_contextual_fragment): (webkit_dom_range_compare_node): (webkit_dom_range_intersects_node): (webkit_dom_range_compare_point): (webkit_dom_range_is_point_in_range): (webkit_dom_range_expand): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp: (webkit_dom_text_dispatch_event): (webkit_dom_text_split_text): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp: (webkit_dom_xpath_expression_evaluate): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp: (webkit_dom_xpath_result_iterate_next): (webkit_dom_xpath_result_snapshot_item): (webkit_dom_xpath_result_get_number_value): (webkit_dom_xpath_result_get_boolean_value): (webkit_dom_xpath_result_get_single_node_value): (webkit_dom_xpath_result_get_snapshot_length): 2017-07-22 Wenson Hsieh [iOS WK2] Remove _WKDraggableElementInfo and fold PositionInformationTests into WKRequestActivatedElementInfo https://bugs.webkit.org/show_bug.cgi?id=174758 Reviewed by Dan Bernstein. _WKDraggableElementInfo is no longer used in WebKit, so it should be removed. However, some of the scenarios in PositionInformationTests that depend on _WKDraggableElementInfo are still useful to exercise: namely, performing both synchronous and asynchronous position information updates while an async position information update is in flight. This patch refactors these unit tests into 2 new unit tests in the existing WKRequestActivatedElementInfo test suite. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _draggableElementAtPosition:]): Deleted. (-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Removed. * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Removed. * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Removed. * UIProcess/ios/WKContentViewInteraction.mm: * WebKit.xcodeproj/project.pbxproj: 2017-07-22 Wenson Hsieh [Mac WK2] Fix null dereference in asynchronous NSTextInputClient methods when deallocating a WKWebView https://bugs.webkit.org/show_bug.cgi?id=174751 Reviewed by Darin Adler. Tweaks -[WKWebView dealloc] to close the WebPageProxy at an earlier time, prior to destroying the WebViewImpl. This fixes a NSTextInputClient crash in WKWebView when exercising the following scenario: (1) Suppose that NSTextInputContext invokes an asynchronous text input query on WKWebView immediately before WKWebView is deallocated, such that WebPageProxy's CallbackMap contains an NSTextInputContext callback at the time that -[WKWebView dealloc] is called. Additionally, suppose that this callback from NSTextInputContext invokes additional NSTextInputClient methods on the WKWebView that involve plumbing through to the WebViewImpl (which is stored as _impl on the WKWebView). (2) Observe that when calling [super dealloc] in [WKWebView dealloc], we will destroy the WebViewImpl as a result of setting our unique pointer to _impl to be null. In ~WebViewImpl, we invoke WebPageProxy::close, which in turn invokes WebPageProxy::resetState. (3) WebPageProxy::resetState then calls m_callbacks.invalidate(error), which triggers all pending callbacks. This invokes the block described in (1), which causes us to try and call back into WKWebView, invoking NSTextInputClient methods. Without the fix in this patch, these methods currently assume that _impl is nonnull, even though we've already cleared out the pointer in (2), so we segfault with a null dereference. After this patch, we close the _page at an earlier time, such that the state is reset before the WebViewImpl (and corresponding _impl unique_ptr in WKWebView) is torn down. This ensures that _impl will not be null for callbacks invoked after beginning to deallocate the WKWebView. Forcing this scenario in a custom AppKit root that triggers async NSTextInputClient methods immediately when a WKWebView is being deallocated produces a crash with the same stack trace as what we observe in the radar, but there are no known steps to actually reproduce this crash in shipping software. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): 2017-07-22 Chris Dumez REGRESSION(r204565): WKObject is broken https://bugs.webkit.org/show_bug.cgi?id=174736 Reviewed by Dan Bernstein. Revert r204565 as making WKObject a root class caused unexpected crashes. Instead, we now have WKObject inherit from NSProxy (instead of previously NSObject) and we forward calls to the target. We also need to provide an implementation for private methods such as isNSString__ to address the issue with NSStrings that r204565 was trying to fix. * Shared/Cocoa/APIObject.mm: (API::Object::unwrap): * Shared/Cocoa/WKObject.h: * Shared/Cocoa/WKObject.mm: (-[WKObject dealloc]): (-[WKObject hash]): (-[WKObject isKindOfClass:]): (-[WKObject isMemberOfClass:]): (-[WKObject respondsToSelector:]): (-[WKObject conformsToProtocol:]): (-[WKObject forwardingTargetForSelector:]): (-[WKObject description]): (-[WKObject debugDescription]): (-[WKObject classForCoder]): (-[WKObject classForKeyedArchiver]): (-[WKObject _web_createTarget]): (-[WKObject forwardInvocation:]): (-[WKObject methodSignatureForSelector:]): (-[WKObject isNSObject__]): (-[WKObject isNSArray__]): (-[WKObject isNSCFConstantString__]): (-[WKObject isNSData__]): (-[WKObject isNSDate__]): (-[WKObject isNSDictionary__]): (-[WKObject isNSNumber__]): (-[WKObject isNSOrderedSet__]): (-[WKObject isNSSet__]): (-[WKObject isNSString__]): (-[WKObject isNSTimeZone__]): (-[WKObject isNSValue__]): 2017-07-21 Chris Dumez Drop IDBDatabaseException class https://bugs.webkit.org/show_bug.cgi?id=174743 Reviewed by Darin Adler. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::connectionToServerLost): 2017-07-21 Brady Eidson Crash in many WebKit apps marking a connection invalid under Messages::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace. and https://bugs.webkit.org/show_bug.cgi?id=174729 Reviewed by Tim Horton. Previously, when a NetworkLoad generated a "CanAuthenticateAgainstProtectionSpace" event, the message went from Network process -> Web process -> UI process. In that case, MESSAGE_CHECKing the validity of the frame in WebPageProxy made sense. In r202511 we cut the WebProcess out of this and had Networking go straight to UI process. As a result, the message check became invalid. The Networking process cannot possible know the validity of particular WebPage or WebFrame identifiers. We simply need to validate the input in NetworkProcessProxy. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Validate both the page and frame ids before passing the call along to the WebPageProxy. Also, if either of those validations fail, respond to the network process. 2017-07-21 Andy Estes [iOS] Adopt UIImagePickerControllerImageURL for photo uploads https://bugs.webkit.org/show_bug.cgi?id=174723 Reviewed by Joseph Pecoraro. In iOS 11, use the URL provided by UIImagePickerControllerImageURL, if available, as the file URL for photo uploads. Since we use the UIImagePickerController imageExportPreset of UIImagePickerControllerImageURLExportPresetCompatible, UIKit will take care of converting HEIF images to JPEG for us. For other types (GIF, JPEG, and PNG), it will preserve the original format. Since UIImagePickerController now provides GIF and PNG representations, we no longer need to use PHImageManager to access the original assets. This patch removes the PHAsset/PHImageManager code added in r185241. * Platform/spi/ios/PhotosSPI.h: Removed. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]): (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]): Deleted. * WebKit.xcodeproj/project.pbxproj: 2017-07-21 Konstantin Tokarev [cmake][Mac] Unreviewed, fix linking WebKitSystemInterface After r219560 link_directories() in PlatformXXX.cmake files does not affect corresponding targets. * PlatformMac.cmake: 2017-07-21 Andreas Kling Use more references in event dispatch code https://bugs.webkit.org/show_bug.cgi?id=174681 Reviewed by Geoffrey Garen. * WebProcess/Plugins/PDF/PDFPluginAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::handleEvent): (WebKit::PDFPluginAnnotation::PDFPluginAnnotationEventListener::handleEvent): * WebProcess/Plugins/PDF/PDFPluginPasswordField.h: * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: (WebKit::PDFPluginPasswordField::handleEvent): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::handleEvent): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent): (WebKit::PluginView::handleEvent): * WebProcess/Plugins/PluginView.h: 2017-07-21 Chris Dumez WebResourceLoadStatisticsStore::m_operatingDates is unsafely modified from several threads https://bugs.webkit.org/show_bug.cgi?id=174721 Reviewed by Brent Fulgham. WebResourceLoadStatisticsStore::m_operatingDates is supposed to only be modified on the background thread. However, WebResourceLoadStatisticsStore::performDailyTasks() was mistakenly calling includeTodayAsOperatingDateIfNecessary() on the main thread, which would modify m_operatingDates. This could lead to crashes such as the one in , as the main thread may modify m_operatingDates while we are interating over it on the background thread to save it to disk. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::performDailyTasks): (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): 2017-07-21 Brady Eidson Get rid of WebCore IconDatabase code. https://bugs.webkit.org/show_bug.cgi?id=174700 Reviewed by Tim Horton. * UIProcess/API/glib/WebKitWebContext.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-07-21 Carlos Garcia Campos Web Automation: implicit navigations don't cause browsing context switch https://bugs.webkit.org/show_bug.cgi?id=174633 Reviewed by Brian Burg. When a new page load replaces the current frameset, for example when a link in the current browser context has a _top target, there's no explicit context switch, so the web driver doesn't know that the current browsing context is no longer valid. Following commands will still be using the previous frame as the current browsing context, but they don't fail with no such frame because the frame is still alive in the page cache and referenced in the internal maps used in both UI and web processes. This causes test testShouldFocusOnTheReplacementWhenAFrameFollowsALinkToA_TopTargetedPage to fail, since it expects a no such frame exception. When a new page navigation happens we can simply remove references to frames from m_handleWebFrameMap in WebAutomationSession, because any existing frame reference in the map should be for a previous page. With this, before the next command is executed, waitForNavigationToComplete will be called and it will fail with no such frame, condition that is handled to switch to the top level browser context. The test still fails, because the find element command is called with the top level browsing context, returning no such element, instead of no such frame. This is consistent with Chrome. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::navigationOccurredForFrame): Clear the m_handleWebFrameMap when a new page load finished. 2017-07-21 Carlos Garcia Campos WebDriver: wait until navigation is complete before running new commands and after a click https://bugs.webkit.org/show_bug.cgi?id=174670 Reviewed by Brian Burg. Add waitForNavigationToComplete method to Automation to allow WebDriver to wait for pending navigations to complete. The new method already receives page load strategy and timeout, but they are not implemented yet. * UIProcess/Automation/Automation.json: Add waitForNavigationToComplete method and PageLoadStrategy new type. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::waitForNavigationToComplete): Call waitForNavigationToCompleteOnPage or waitForNavigationToCompleteOnFrame depending on whether the current borwsing context is the main frame or not. (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Check if there's an ongoing load for the page, and wait for it to complete if needed. (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Check if there's an ongoing load for the frame, and wait for it to complete if needed. (WebKit::WebAutomationSession::navigateBrowsingContext): Use waitForNavigationToCompleteOnPage() now. (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto. (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto. (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto. (WebKit::WebAutomationSession::navigationOccurredForFrame): Renamed since it now receives the notification for all the frames. Complete page operations if it's a main frame, or frame operations otherwise. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishLoadForFrame): Notify about all frames, not only the main one. (WebKit::WebPageProxy::didFailLoadForFrame): Ditto. (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Ditto. 2017-07-20 Carlos Garcia Campos Unreviewed. Remove WKIconDatabaseCairo. * PlatformGTK.cmake: * PlatformWPE.cmake: * UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp: Removed. * UIProcess/API/C/cairo/WKIconDatabaseCairo.h: Removed. 2017-07-20 Brady Eidson Get rid of IconDatabase related code in WebKit. https://bugs.webkit.org/show_bug.cgi?id=174693 Reviewed by Tim Horton. This leaves the C-API class but guts it. No explanations of the other changes are needed. * CMakeLists.txt: * DerivedSources.make: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/C/WKContext.cpp: (WKContextGetIconDatabase): (WKContextSetIconDatabasePath): * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseSetIconDatabaseClient): (WKIconDatabaseRetainIconForURL): (WKIconDatabaseReleaseIconForURL): (WKIconDatabaseSetIconDataForIconURL): (WKIconDatabaseSetIconURLForPageURL): (WKIconDatabaseCopyIconURLForPageURL): (WKIconDatabaseCopyIconDataForPageURL): (WKIconDatabaseEnableDatabaseCleanup): (WKIconDatabaseRemoveAllIcons): (WKIconDatabaseCheckIntegrityBeforeOpening): (WKIconDatabaseClose): * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: (WKIconDatabaseTryGetCGImageForURL): (WKIconDatabaseTryCopyCGImageArrayForURL): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted. * UIProcess/WebIconDatabase.cpp: Removed. * UIProcess/WebIconDatabase.h: (WebKit::WebIconDatabase::clearProcessPool): Deleted. * UIProcess/WebIconDatabase.messages.in: Removed. * UIProcess/WebIconDatabaseClient.cpp: Removed. * UIProcess/WebIconDatabaseClient.h: Removed. * UIProcess/WebProcessPool.cpp: (WebKit::m_hiddenPageThrottlingTimer): (WebKit::WebProcessPool::~WebProcessPool): (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::setIconDatabasePath): Deleted. (WebKit::WebProcessPool::iconDatabasePath): Deleted. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::processWillShutDown): (WebKit::WebProcessProxy::retainIconForPageURL): Deleted. (WebKit::WebProcessProxy::releaseIconForPageURL): Deleted. (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted. * UIProcess/wpe/WebProcessPoolWPE.cpp: (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Removed. * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Removed. * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Removed. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::getWebCoreStatistics): * WebProcess/WebProcess.h: 2017-07-20 David Quesada Add SPI to notify WKNavigationDelegate about client redirects https://bugs.webkit.org/show_bug.cgi?id=174680 rdar://problem/33184886 Reviewed by Brady Eidson. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didPerformClientRedirectForNavigation): Add a new virtual method for navigation clients to implement if they want to be informed when the page is initiating a navigation that is a client redirect. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declare the new WKNavigationDelegate method -_webView:didPerformClientRedirectForNavigation: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::didPerformClientRedirectForNavigation): Add a new method to NavigationState method to tell the WKNavigationDelegate when a client redirect happens. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformClientRedirectForLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Allow the WebPageProxy to receive a message from the web process when a client redirect happens. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidPerformClientRedirect): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Send this new message to the UI process on client redirects. 2017-07-20 Chris Dumez Drop legacy XPathException type https://bugs.webkit.org/show_bug.cgi?id=174679 Reviewed by Sam Weinig. Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome no longer expose XPathException. * UIProcess/Automation/atoms/FindNodes.js: (tryToFindNode): 2017-07-20 Chris Dumez Unreviewed, rolling out r219706. Broke iOS build Reverted changeset: "Drop legacy XPathException type" https://bugs.webkit.org/show_bug.cgi?id=174679 http://trac.webkit.org/changeset/219706 2017-07-20 Chris Dumez Drop legacy XPathException type https://bugs.webkit.org/show_bug.cgi?id=174679 Reviewed by Sam Weinig. Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome no longer expose XPathException. * UIProcess/Automation/atoms/FindNodes.js: (tryToFindNode): 2017-07-20 Chris Dumez Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() https://bugs.webkit.org/show_bug.cgi?id=174686 Reviewed by Geoffrey Garen. Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords(). The most common call site is already on the right thread. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-20 Chris Dumez Regression(ITP): May get frequently logged out of wsj.com https://bugs.webkit.org/show_bug.cgi?id=174661 Reviewed by Geoffrey Garen. Bump statistics file version to blow away old statistics on disk since those do not take into account associated domains. * UIProcess/WebResourceLoadStatisticsStore.cpp: 2017-07-20 Chris Dumez Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable https://bugs.webkit.org/show_bug.cgi?id=174660 Reviewed by Geoffrey Garen. Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable. This essentially replaces a branch to figure out if the new size is less or greater than the current size by an assertion. * Platform/IPC/ArgumentCoders.h: * UIProcess/Gamepad/UIGamepadProvider.cpp: (WebKit::UIGamepadProvider::platformGamepadConnected): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setInitialConnectedGamepads): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: (WebKit::WebPasteboardOverrides::getDataForOverride): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAutocorrectionData): 2017-07-20 Chris Dumez Regression(ITP): Can no longer log in on abc.go.com https://bugs.webkit.org/show_bug.cgi?id=174533 Reviewed by Geoffrey Garen. Bump statistics database version to blow away any existing statistics. Without this, SSO providers for which we added a quirk may already be in the database and identified as trackers. The quirk merely prevents the specified SSO providers from being identified as trackers. * UIProcess/WebResourceLoadStatisticsStore.cpp: 2017-07-19 Simon Fraser getBoundingClientRects not updated for programmatic scrolls https://bugs.webkit.org/show_bug.cgi?id=174538 rdar://problem/33049012 Reviewed by Tim Horton. Feed ViewportRectStability and ScrollingLayerPositionAction into reconcileScrollingState(). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2017-07-19 Brady Eidson iBooks sometimes crashes when closing a book. and https://bugs.webkit.org/show_bug.cgi?id=174658 Reviewed by Oliver Hunt. - LegacyCustomProtocolManagerProxy should not reference a WebProcessPool directly. - LegacyCustomProtocolManagerProxy should invalidate in its destructor. * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp: (WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy): (WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy): (WebKit::LegacyCustomProtocolManagerProxy::startLoading): (WebKit::LegacyCustomProtocolManagerProxy::stopLoading): (WebKit::LegacyCustomProtocolManagerProxy::invalidate): (WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest): (WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse): (WebKit::LegacyCustomProtocolManagerProxy::didLoadData): (WebKit::LegacyCustomProtocolManagerProxy::didFailWithError): (WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading): (WebKit::LegacyCustomProtocolManagerProxy::processDidClose): Deleted. * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): (WebKit::NetworkProcessProxy::didClose): * UIProcess/Network/NetworkProcessProxy.h: (WebKit::NetworkProcessProxy::processPool): 2017-07-19 Yusuke Suzuki [WTF] Implement WTF::ThreadGroup https://bugs.webkit.org/show_bug.cgi?id=174081 Reviewed by Mark Lam. * Shared/AsyncRequest.h: 2017-07-18 Carlos Garcia Campos WebDriver: handle invalid selector errors https://bugs.webkit.org/show_bug.cgi?id=174619 Reviewed by Brian Burg. We are currently handling only XPathException and only when it's an invalid expression. In the xpath case, the spec also says "If any item in result is not an element return an error with error code invalid selector.", so we should also handle TYPE_ERR (The expression could not be converted to return the specified type.). However, since the spec says "or other error", I think we can simplify this and simply throw InvalidSelector inside the catch, without checking any specific error. This is causing 14 failures in selenium tests. §12. Element Retrieval. Step 6: If a DOMException, SyntaxError, XPathException, or other error occurs during the execution of the element location strategy, return error invalid selector. https://www.w3.org/TR/webdriver/#dfn-find * UIProcess/Automation/Automation.json: Add InvalidSelector error. * UIProcess/Automation/atoms/FindNodes.js: (tryToFindNode): Raise InvalidSelector in case of error. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidSelector exceptions. 2017-07-18 Carlos Garcia Campos Web Automation: error details not passed to DidEvaluateJavaScriptFunction message when callback was not called before page unload https://bugs.webkit.org/show_bug.cgi?id=174624 Reviewed by Brian Burg. There's a variable errorMessage, but it's unused. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Pass errorMessage instead of String() to DidEvaluateJavaScriptFunction. 2017-07-18 Carlos Garcia Campos Web Automation: evaluateJavaScriptFunction should always notify the web process before returning early https://bugs.webkit.org/show_bug.cgi?id=174623 Reviewed by Brian Burg. It currently returns early if page, frame or scriptObject are nullptr, in which cases the UI process is not notified. This causes test testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs to hang, because message DidEvaluateJavaScriptFunction is never sent when the given frame no longer exists. We should send DidEvaluateJavaScriptFunction with WindowNotFound in case of page is nullptr and FrameNotFound if the frame is nullptr. The scriptObject early return is actually wrong, because scriptObjectForFrame creates a new script if there's isn't one for the given frame. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): 2017-07-18 Carlos Garcia Campos Web Automation: pending evaluate script callbacks are stored with the wrong frame ID when using the default main frame https://bugs.webkit.org/show_bug.cgi?id=174622 Reviewed by Brian Burg. The frameHandle argument is optional in evaluateJavaScriptFunction(), when not provided we pass 0 to the web process. The proxy gets the web page main frame when received frame ID is 0, but the given frameID is still used as key of m_webFramePendingEvaluateJavaScriptCallbacksMap and also passed to the javascript function as argument. I think r203442 was actually a workaround to this bug, making it even more hidden. Both m_webFrameScriptObjectMap and m_webFramePendingEvaluateJavaScriptCallbacksMap should never have 0 as a key, since they always use a frame ID, and the frame identifier counter starts at 1. This is causing test testShouldDetectPageLoadsWhileWaitingOnAnAsyncScriptAndReturnAnError to hang, because when the page is unloaded and didClearWindowObjectForFrame is called, we try to get the pending callbacks of frame 1, but they were stored as frame 0 so DidEvaluateJavaScriptFunction message is never sent to the UI process. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use always the actual frameID from the WebFrame we are using. * WebProcess/Automation/WebAutomationSessionProxy.h: Do not allow 0 as a key of m_webFramePendingEvaluateJavaScriptCallbacksMap and m_webFrameScriptObjectMap. 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Shared/API/APIArray.cpp: (API::Array::toStringVector): * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel presentWithParameters:resultListener:]): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Sam Weinig. * Configurations/Base.xcconfig: 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Dan Bernstein. * Configurations/Base.xcconfig: 2017-07-18 Matt Lewis Unreviewed, rolling out r219610. This caused an api failure on all platforms for the test SnapshotImageLargeAsyncDecoding Reverted changeset: "Async image decoding for large images should be disabled after the first time a tile is painted" https://bugs.webkit.org/show_bug.cgi?id=174451 http://trac.webkit.org/changeset/219610 2017-07-18 Andy Estes [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING https://bugs.webkit.org/show_bug.cgi?id=174631 Reviewed by Darin Adler. * Configurations/Base.xcconfig: 2017-07-18 Said Abou-Hallawa Async image decoding for large images should be disabled after the first time a tile is painted https://bugs.webkit.org/show_bug.cgi?id=174451 Reviewed by Simon Fraser. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::paintContents): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-07-17 Carlos Garcia Campos Web Automation: link and partial link queries don't work if text link contains trailing or leading whitespaces https://bugs.webkit.org/show_bug.cgi?id=174499 Reviewed by Brian Burg. This is causing test test_Driver_Can_Get_Link_By_Link_Test_Ignoring_Trailing_Whitespace to fail. * UIProcess/Automation/atoms/FindNodes.js: (switch): Use normalize-space() in in the links xpath expressions. 2017-07-17 Darin Adler Improve use of NeverDestroyed https://bugs.webkit.org/show_bug.cgi?id=174348 Reviewed by Sam Weinig. * DatabaseProcess/DatabaseProcess.h: Removed unneeded include of NeverDestroyed.h. * NetworkProcess/cache/NetworkCacheKey.cpp: Ditto. * NetworkProcess/capture/NetworkCaptureManager.cpp: Moved include of NeverDestroyed.h here ... * NetworkProcess/capture/NetworkCaptureManager.h: ... from here. * PluginProcess/PluginProcess.cpp: Moved include of NeverDestroyed.h here ... * PluginProcess/PluginProcess.h: ... from here. * Shared/API/Cocoa/_WKRemoteObjectInterface.mm: (isContainerClass): Removed trivial inefficient use of LazyNeverDestroyed to check against two classes. Instead wrote out the boolean expression. * Shared/mac/SecItemShim.cpp: Removed unneeded include of NeverDestroyed.h. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): Call installMemoryPressureHandler instead of WebMemoryPressureHandler::singleton. * UIProcess/Gamepad/UIGamepadProvider.h: Removed unneeded include of NeverDestroyed.h. * UIProcess/Plugins/PluginProcessManager.cpp: Moved include of NeverDestroyed.h here ... * UIProcess/Plugins/PluginProcessManager.h: ... from here. * UIProcess/WebInspectorProxy.cpp: Removed unneeded include of NeverDestroyed.h. * UIProcess/WebPageProxy.h: Added now-needed include of MediaPlaybackTargetContext.h. * UIProcess/WebPasteboardProxy.cpp: Moved include of NeverDestroyed.h here ... * UIProcess/WebPasteboardProxy.h: ... from here. * UIProcess/ios/WebMemoryPressureHandlerIOS.h: Removed the WebMemoryPressureHandler class from this header. Callers don't need to know if there is a class. They simply indicate when it's time to install the handler. Another way to put it is that this class had no functions other than the singleton function. * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: (WebKit::installMemoryPressureHandler): Replaced the class with this function. It creates a dispatch source and then resumes it. To avoid having the source look like a leak, we keep it in a global variable. * WebProcess/Gamepad/WebGamepadProvider.h: Include Forward.h instead of NeverDestroyed.h. * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Moved include of NeverDestroyed.h here ... * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: ... from here. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Removed unneeded include of NeverDestroyed.h. 2017-07-17 Timothy Horton Page using safe area constant properties jumps to correct layout after resize https://bugs.webkit.org/show_bug.cgi?id=174598 Reviewed by Simon Fraser. Test: fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): Plumb unobscured safe area insets through in the dynamicViewportSizeUpdate, like we do in VisibleContentRectUpdate (once again sad that these aren't more similar), so that it will be correct in the during-rotation snapshot, instead of only becoming correct in the first visible content rect update post-rotation. 2017-07-17 Chris Dumez UserMediaPermissionRequestManagerProxy should not use WebCore::Timer https://bugs.webkit.org/show_bug.cgi?id=174599 Reviewed by Tim Horton. UserMediaPermissionRequestManagerProxy should not use WebCore::Timer since it runs in the UIProcess. Switch to using RunLoop::Timer instead. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2017-07-17 Chris Dumez NETWORK_SESSION does not need didReceiveAuthenticationChallenge(uint64_t, uint64_t, const AuthenticationChallenge&) https://bugs.webkit.org/show_bug.cgi?id=174595 Reviewed by Alex Christensen. * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: 2017-07-17 Wenson Hsieh [iOS DnD] Web process uses too much memory when beginning a drag on a very large image https://bugs.webkit.org/show_bug.cgi?id=174585 Reviewed by Tim Horton. Add IPC support for serializing/deserializing the size of an image written to the pasteboard. See WebCore ChangeLogs for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-07-17 Konstantin Tokarev Unreviewed attempt to fix Mac cmake build * PlatformMac.cmake: Remove reference to file which is gone since r219025 2017-07-17 Michael Catanzaro [CMake] Include most CMake modules from WebKitCommon.cmake https://bugs.webkit.org/show_bug.cgi?id=174546 Reviewed by Konstantin Tokarev. * CMakeLists.txt: 2017-07-17 Michael Catanzaro [CMake] Macros in WebKitMacros.cmake should be prefixed with WEBKIT_ namespace https://bugs.webkit.org/show_bug.cgi?id=174547 Reviewed by Alex Christensen. * CMakeLists.txt: 2017-07-17 Alex Christensen Modernize content extension code https://bugs.webkit.org/show_bug.cgi?id=174588 Reviewed by Sam Weinig. * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addContentRuleLists): 2017-07-17 Jeremy Jones Add video fullscreen transition logging. https://bugs.webkit.org/show_bug.cgi?id=174474 Reviewed by Jer Noble. No functional change. Just adds logging. * Platform/Logging.h: * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): (WebKit::WebVideoFullscreenManager::didSetupFullscreen): (WebKit::WebVideoFullscreenManager::didEnterFullscreen): (WebKit::WebVideoFullscreenManager::didExitFullscreen): (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): 2017-07-17 Konstantin Tokarev [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called https://bugs.webkit.org/show_bug.cgi?id=174557 Reviewed by Michael Catanzaro. * CMakeLists.txt: 2017-07-17 Carlos Garcia Campos Web Automation: link and partial link queries don't work if the link contains formatting tags https://bugs.webkit.org/show_bug.cgi?id=174498 Reviewed by Brian Burg. So, for example, if we find links with text "Foo" and there's a link like Foo we fail with no such element error. This causes test test_Link_With_Formatting_Tags to fail. * UIProcess/Automation/atoms/FindNodes.js: (switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions. 2017-07-16 Carlos Garcia Campos Web Automation: FindNodes should throw an error in case of invalid strategy https://bugs.webkit.org/show_bug.cgi?id=174497 Reviewed by Brian Burg. We are currently returning null or empty list. According to the spec in 12.2 Find Element and 12.3 Find Elements, step 4: "If location strategy is not present as a keyword in the table of location strategies, return error with error code invalid argument.". https://www.w3.org/TR/webdriver/#find-element. This is causing test test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements to fail. * UIProcess/Automation/atoms/FindNodes.js: (switch): Throw an error in case of unknown strategy. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidParameter exceptions. 2017-07-16 Brady Eidson Crash when a WKHTTPCookieStore outlives its owning WKWebsiteDataStore. and https://bugs.webkit.org/show_bug.cgi?id=174574 Reviewed by Tim Horton. Instead of holding a weak reference to its owning API::WebsiteDataStore, API::HTTPCookieStore can hold a strong reference to the owner's implementation WebKit::WebsiteDataStore. * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::HTTPCookieStore): (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookie): (API::HTTPCookieStore::deleteCookie): (API::HTTPCookieStore::registerObserver): (API::HTTPCookieStore::unregisterObserver): (API::HTTPCookieStore::cookieManagerDestroyed): (API::HTTPCookieStore::registerForNewProcessPoolNotifications): * UIProcess/API/APIHTTPCookieStore.h: 2017-07-15 Brady Eidson Make sure all CFHTTPCookieStorageRefs we create are scheduled. and https://bugs.webkit.org/show_bug.cgi?id=174513 Reviewed by Tim Horton. Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled. We need to schedule it on the appropriate RunLoop. This patch also cleans up the creation of the identifying data itself. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/cf/CookieStorageUtilsCF.h: Added. * Shared/cf/CookieStorageUtilsCF.mm: Added. (WebKit::cookieStorageFromIdentifyingData): (WebKit::identifyingDataFromCookieStorage): * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::setSharedHTTPCookieStorage): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): 2017-07-15 Wenson Hsieh [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating https://bugs.webkit.org/show_bug.cgi?id=174539 Reviewed by Darin Adler. Small tweak to avoid presenting at the element rect or text rect if the interaction information failed to capture valid bounds for the element. We instead fall back to presenting at the touch location. This addresses problems when presenting the action sheet popover on image maps on iPad, where GetPositionInformation fails to capture correct data about for the . * UIProcess/ios/WKActionSheetAssistant.mm: (presentationStyleForView): 2017-07-14 Jonathan Bedard Add iOS 11 SPI https://bugs.webkit.org/show_bug.cgi?id=174430 Reviewed by Tim Horton. * Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11. * UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h. 2017-07-14 Jeff Miller -[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey https://bugs.webkit.org/show_bug.cgi?id=174524 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm: (-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:]): Pass the dictionary key and value in the correct order. 2017-07-14 Brent Fulgham Monitor directory for new statistics files after a delete operation https://bugs.webkit.org/show_bug.cgi?id=174521 Reviewed by Chris Dumez. Create a FileMonitor to watch the data directory when the statistics file is deleted by an external process. If it sees the file get created externally, merge those data into the in-memory store. * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): Added. (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: 2017-07-14 Matt Lewis Unreviewed, rolling out r219516. This caused an API failure on macOS. Reverted changeset: "Make sure all CFHTTPCookieStorageRefs we create are scheduled." https://bugs.webkit.org/show_bug.cgi?id=174513 http://trac.webkit.org/changeset/219516 2017-07-14 Daniel Bates REGRESSION (r219013): Compute source frame info for frameless document https://bugs.webkit.org/show_bug.cgi?id=174385 Reviewed by Brady Eidson. Fixes an issue where we would crash in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() when computing the frame info for a now-frameless document. One way this can happen is when the frame that contains the document that initiated the navigation is removed from the page. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check that we have a valid page ID before looking up the WebPage object corresponding to it. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Compute a FrameInfoData object from the source document directly as opposed to using WebFrame::info() as the latter requires that we have a valid WebCore frame and the source document may not have a frame. 2017-07-14 Jer Noble Allow clients to override their own hardware media requirements where no fallback media exists. https://bugs.webkit.org/show_bug.cgi?id=174426 Reviewed by Eric Carlson. Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both to control WebCore's new allowMediaContentTypesRequiringHardwareSupportAsFallback setting. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetAllowMediaContentTypesRequiringHardwareSupportAsFallback): (WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _setAllowMediaContentTypesRequiringHardwareSupportAsFallback:]): (-[WKWebViewConfiguration _allowMediaContentTypesRequiringHardwareSupportAsFallback]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-07-14 Chris Dumez Possible crash under NetworkSocketStream::didFailSocketStream() https://bugs.webkit.org/show_bug.cgi?id=174526 Reviewed by Brent Fulgham. For robustness, initialize the SocketStreamHandleImpl after the other data members. We are passing |this| to the SocketStreamHandleImpl when constructing it so it is unsafe to have uninitialized data members at this point. * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::NetworkSocketStream): * NetworkProcess/NetworkSocketStream.h: 2017-07-14 Michael Catanzaro [CMake] Unclear distinction between WebKitHelpers and WebKitMacros https://bugs.webkit.org/show_bug.cgi?id=153189 Reviewed by Antonio Gomes. New location for macros that are exclusively needed here. * CMakeLists.txt: 2017-07-14 Brady Eidson Make sure all CFHTTPCookieStorageRefs we create are scheduled. and https://bugs.webkit.org/show_bug.cgi?id=174513 Reviewed by Tim Horton. Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled. We need to schedule it on a RunLoop. This patch also cleans up the creation of the identifying data itself. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/cf/CookieStorageUtilsCF.cpp: Added. (WebKit::cookieStorageFromIdentifyingData): (WebKit::identifyingDataFromCookieStorage): * Shared/cf/CookieStorageUtilsCF.h: Added. * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::setSharedHTTPCookieStorage): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): 2017-07-14 Chris Dumez Potential null-dereference under NetworkRTCProvider::resolvedName() https://bugs.webkit.org/show_bug.cgi?id=174507 Reviewed by Youenn Fablet. NetworkRTCProvider::resolvedName() could do a null dereference of m_connection because m_connection is nullified in NetworkRTCProvider::close() but resolvers were only closed later on in the NetworkRTCProvider destructor. To address the issue, we now stop DNS resolvers earlier, in NetworkRTCProvider::close(). Also fix unsafe modification of m_resolvers HashMap when iterating over it. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::~NetworkRTCProvider): (WebKit::NetworkRTCProvider::close): (WebKit::NetworkRTCProvider::Resolver::~Resolver): (WebKit::NetworkRTCProvider::stopResolver): 2017-07-14 Youenn Fablet Report CoreAudioCaptureSource failure in case shared unit stops working properly https://bugs.webkit.org/show_bug.cgi?id=174494 Reviewed by Eric Carlson. In case of capture failure, send a CaptureFailure message so that the correct behavior happens in the Web process. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::captureFailed): * WebProcess/cocoa/UserMediaCaptureManager.h: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: 2017-07-13 Chris Dumez Better deal with changes to the ResourceLoadStatisticsStore file on disk https://bugs.webkit.org/show_bug.cgi?id=174487 Reviewed by Brent Fulgham. Rename WebResourceLoadStatisticsStore's resetDataFromDecoder() to mergeWithDataFromDecoder() and update it so that it actual merges the data from the disk with the one we have in memory, instead of replacing it. This avoid data loss. We leverage the existing WebResourceLoadStatisticsStore::mergeStatistics() to merge the statistics. To faciliate merging the operating dates, they are now represented as OperatingDate objects instead of WallTime objects. OperatingDate only include date precision, no time information. As a result, the merge 2 vectors of OperatingDate objects, we can: 1. Merge the 2 sorted vectors (using std::merge()) 2. Get rid of duplicates (easy because of date-level precision) 3. Drop old dates until the vector has at most 30 items. * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::OperatingDate::fromWallTime): (WebKit::OperatingDate::today): (WebKit::OperatingDate::secondsSinceEpoch): (WebKit::OperatingDate::operator==): (WebKit::OperatingDate::operator<): (WebKit::OperatingDate::operator<=): (WebKit::OperatingDate::OperatingDate): (WebKit::mergeOperatingDates): (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData): (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder): (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-13 Dan Bernstein Removed empty project directories left behind after the rename * WebKit2.xcodeproj: Removed. 2017-07-13 Matthew Hanson Fix the cMake builds (GTK and WPE.) https://bugs.webkit.org/show_bug.cgi?id=174164 rdar://problem/33137595 Reviewed by Dan Bernstein. * Scripts/generate-forwarding-headers.pl: (collectFrameworkHeaderPaths): (createForwardingHeadersForFramework): 2017-07-13 Matthew Hanson Rename WebKit2.xcodeproj to WebKit.xcodeproj. https://bugs.webkit.org/show_bug.cgi?id=174164 rdar://problem/33137595 Reviewed by Dan Bernstein. * WebKit.xcodeproj/project.pbxproj: Renamed from Source/WebKit/WebKit2.xcodeproj/project.pbxproj. 2017-07-13 Matthew Hanson Update tools and configurations after renaming Source/WebKit2 to Source/WebKit. https://bugs.webkit.org/show_bug.cgi?id=174164 rdar://problem/33137595 Reviewed by Dan Bernstein. * PlatformGTK.cmake: * Shared/API/c/wpe/WebKit.h: 2017-07-13 Michael Catanzaro Fix compiler warnings when building with GCC 7 https://bugs.webkit.org/show_bug.cgi?id=174463 Reviewed by Darin Adler. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::sendOutputMessage): 2017-07-13 Chris Dumez Moved filesystem code out of WebResourceLoadStatisticsStore class https://bugs.webkit.org/show_bug.cgi?id=174435 Reviewed by Brent Fulgham. Moved filesystem code out of WebResourceLoadStatisticsStore class and into a new ResourceLoadStatisticsPersistentStorage class to decrease complexity. * CMakeLists.txt: * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added. (WebKit::hasFileChangedSince): (WebKit::createDecoderForFile): (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath): (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath): (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): (WebKit::ResourceLoadStatisticsPersistentStorage::clear): (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added. * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added. (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder): * UIProcess/WebResourceLoadStatisticsStore.h: * WebKit2.xcodeproj/project.pbxproj: 2017-07-13 Chris Dumez Unreviewed, rolling out r219453. Seems to cause some crashes on the bots Reverted changeset: "Moved filesystem code out of WebResourceLoadStatisticsStore class" https://bugs.webkit.org/show_bug.cgi?id=174435 http://trac.webkit.org/changeset/219453 2017-07-13 Jeremy Jones Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers. https://bugs.webkit.org/show_bug.cgi?id=174448 Reviewed by Eric Carlson. No behavior change. * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: * WebProcess/cocoa/WebVideoFullscreenManager.h: 2017-07-13 Jeremy Jones Style fix. Replace strongThis with protectedThis. https://bugs.webkit.org/show_bug.cgi?id=174444 Reviewed by Eric Carlson. Rename, no behavior change. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::didSetupFullscreen): (WebKit::WebVideoFullscreenManager::didEnterFullscreen): (WebKit::WebVideoFullscreenManager::didExitFullscreen): (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): 2017-07-13 Chris Dumez Moved filesystem code out of WebResourceLoadStatisticsStore class https://bugs.webkit.org/show_bug.cgi?id=174435 Reviewed by Brent Fulgham. Moved filesystem code out of WebResourceLoadStatisticsStore class and into a new ResourceLoadStatisticsPersistentStorage class to decrease complexity. * CMakeLists.txt: * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added. (WebKit::hasFileChangedSince): (WebKit::createDecoderForFile): (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath): (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath): (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): (WebKit::ResourceLoadStatisticsPersistentStorage::clear): (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added. * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added. (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder): * UIProcess/WebResourceLoadStatisticsStore.h: * WebKit2.xcodeproj/project.pbxproj: 2017-07-12 Carlos Garcia Campos Web Automation: evaluateJavaScriptFunction should start the callback timeout after the function is applied https://bugs.webkit.org/show_bug.cgi?id=174421 Reviewed by Brian Burg. This is causing selenium test testShouldNotTimeoutIfScriptCallsbackInsideAZeroTimeout to fail, because JavaScriptTimeout error is generated unexpectedly. When no script timeout is specified, 0 is used by default, which means we do a setTimeout with 0 and then the script does another setTimeout with 0, but ours is dispatched before and reportTimeoutError is called. We should start our timeout after applying the function, and only if the result hasn't been reported yet. * WebProcess/Automation/WebAutomationSessionProxy.js: (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): 2017-07-12 Wenson Hsieh [iOS DnD] [WK2] Add SPI to enable, disable, or follow default behavior for DnD on a WKWebView https://bugs.webkit.org/show_bug.cgi?id=174440 Reviewed by Beth Dakin. Adds a new _dragInteractionPolicy property to WKWebView, which an internal client may use to always allow dragging out of the web view (_WKDragInteractionPolicyAlwaysEnable), never allow (_WKDragInteractionPolicyAlwaysDisable) or just use the default device-dependent behavior (_WKDragInteractionPolicyDefault). Also removes an extraneous class from WKContentViewInteraction.mm that is no longer used anywhere. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Set _dragInteractionPolicy to _WKDragInteractionPolicyDefault upon initialization. (-[WKWebView _dragInteractionPolicy]): (-[WKWebView _setDragInteractionPolicy:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (shouldEnableDragInteractionForPolicy): (-[WKContentView _didChangeDragInteractionPolicy]): Called by the WKWebView when its _dragInteractionPolicy changes. The content view updates its UIDragInteraction's -enabled property here in response. (-[WKContentView setupDataInteractionDelegates]): 2017-07-12 Said Abou-Hallawa Async image decoding for large images should be disabled by default https://bugs.webkit.org/show_bug.cgi?id=174432 Reviewed by Simon Fraser. -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None by AllowAsyncImageDecoding. -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir by resetting the bit PaintBehaviorAllowAsyncImageDecoding. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): 2017-07-12 Eric Carlson [MediaStream] a capture source failure should end the MediaStreamTrack https://bugs.webkit.org/show_bug.cgi?id=174375 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Consolidate start/end. (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): Call captureStateChanged if the capture state changes. Consider interrupted flags. 2017-07-12 Daniel Bates NavigationAction should track whether the navigation was initiated by the main frame https://bugs.webkit.org/show_bug.cgi?id=174386 Reviewed by Brady Eidson. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): Pass whether the load was initiated by the main frame when instantiating the NavigationAction. 2017-07-12 Daniel Bates Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame https://bugs.webkit.org/show_bug.cgi?id=174427 Rubber-stamped by Brady Eidson. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): 2017-07-12 Matt Lewis Unreviewed, rolling out r219401. This revision rolled out the previous patch, but after talking with reviewer, a rebaseline is what was needed.Rolling back in before rebaseline. Reverted changeset: "Unreviewed, rolling out r219379." https://bugs.webkit.org/show_bug.cgi?id=174400 http://trac.webkit.org/changeset/219401 2017-07-12 Daniel Bates Update description of Secure Contexts experimental flag https://bugs.webkit.org/show_bug.cgi?id=174401 Reviewed by Simon Fraser. Change the description of the Secure Contexts experimental flag from "isSecureContext attribute" to "Secure Contexts API". * Shared/WebPreferencesDefinitions.h: 2017-07-12 Matt Lewis Unreviewed, rolling out r219379. This revision caused a consistent failure in the test fast/dom/Window/property-access-on-cached-window-after-frame- removed.html. Reverted changeset: "Remove NAVIGATOR_HWCONCURRENCY" https://bugs.webkit.org/show_bug.cgi?id=174400 http://trac.webkit.org/changeset/219379 2017-07-12 Zan Dobersek [WPE] Use libepoxy https://bugs.webkit.org/show_bug.cgi?id=172104 Reviewed by Michael Catanzaro. * PlatformWPE.cmake: Drop the EGL_INCLUDE_DIRS compilation flags. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: Include when compiling with libepoxy usage enabled. 2017-07-12 Carlos Garcia Campos Web Automation: upstream safaridriver's JavaScript atom implementations https://bugs.webkit.org/show_bug.cgi?id=172060 Reviewed by Brian Burg. * UIProcess/Automation/atoms/ElementAttribute.js: Added. * UIProcess/Automation/atoms/ElementDisplayed.js: Added. * UIProcess/Automation/atoms/FindNodes.js: Added. * UIProcess/Automation/atoms/FormElementClear.js: Added. * UIProcess/Automation/atoms/FormSubmit.js: Added. 2017-07-11 Dean Jackson Remove NAVIGATOR_HWCONCURRENCY https://bugs.webkit.org/show_bug.cgi?id=174400 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: 2017-07-11 Ansh Shukla WKWindowFeatures needs to expose scrollbar, fullscreen, and dialog configuration properties https://bugs.webkit.org/show_bug.cgi?id=174239 Reviewed by Brady Eidson. Add a new private header to expose getters for window feature properties already available in the TFB APIWindowFeatures class. These properties are necessary for Safari to adopt more modern API. * UIProcess/API/Cocoa/WKWindowFeatures.mm: (-[WKWindowFeatures _locationBarVisibility]): (-[WKWindowFeatures _scrollbarsVisibility]): (-[WKWindowFeatures _fullscreenDisplay]): (-[WKWindowFeatures _dialogDisplay]): * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: Expose some window features as read-only properties. * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h: * WebKit2.xcodeproj/project.pbxproj: 2017-07-11 Chris Dumez Avoid duplicating default parameter values in [WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState] https://bugs.webkit.org/show_bug.cgi?id=174402 Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::performDailyTasks): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies): (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired): (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries): (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo): (WebKit::WebResourceLoadStatisticsStore::pruneStatisticsIfNeeded): (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-11 Dean Jackson Rolling out r219372. * Configurations/FeatureDefines.xcconfig: 2017-07-11 Dean Jackson Remove NAVIGATOR_HWCONCURRENCY https://bugs.webkit.org/show_bug.cgi?id=174400 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: 2017-07-11 Dean Jackson Viewport fit experimental feature should be always on by default https://bugs.webkit.org/show_bug.cgi?id=174398 Reviewed by Simon Fraser. Even though this is experimental, it should be enabled by default, and not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. * Shared/WebPreferencesDefinitions.h: 2017-07-11 Adrian Perez de Castro Fix typo: ContentRuleListStore::nonLegacyDdefaultStore() https://bugs.webkit.org/show_bug.cgi?id=174387 Reviewed by Michael Catanzaro. Rename nonLegacyDdefaultStore() to nonLegacyDefaultStore(). * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::nonLegacyDefaultStore): (API::ContentRuleListStore::defaultStore): * UIProcess/API/APIContentRuleListStore.h: 2017-07-11 Chris Dumez Simplify primary domain lambda captures in WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174381 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::isolatedPrimaryDomain): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setLastSeen): (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): (WebKit::primaryDomain): Deleted. 2017-07-11 Timothy Hatcher Fix a build failure in WebDragClient when !PLATFORM(COCOA) && !PLATFORM(GTK). https://bugs.webkit.org/show_bug.cgi?id=174372 Reviewed by Beth Dakin. * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::didConcludeEditDrag): Added empty method. 2017-07-11 Brent Fulgham Reset cookie partitioning state after network process crashes https://bugs.webkit.org/show_bug.cgi?id=174306 Reviewed by Chris Dumez. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Move cookie partioning state code to helper function. (WebKit::ResourceLoadStatisticsStore::resetPartitionCookiesState): Added. * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Inform the statistics store that the network process crashed. (WebKit::WebProcessPool::terminateNetworkProcess): Mark network process as crashed. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::networkProcessDidCrash): Reset the cookie partitioning state after a crash. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::notifyResourceLoadStatisticsNetworkProcessDidCrash): Relay information to the statistics store. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-07-11 Timothy Hatcher Fix broken build when !ENABLE(INDEXED_DATABASE) https://bugs.webkit.org/show_bug.cgi?id=174370 Reviewed by Alex Christensen. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageAddedToProcess): 2017-07-11 Youenn Fablet Changing the web page muted state for playing audio should not disable other tabs capture https://bugs.webkit.org/show_bug.cgi?id=174349 Unreviewed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Fixes non MEDIA_STREAM builds. 2017-07-11 Wenson Hsieh Address post-review feedback after http://trac.webkit.org/r219310 https://bugs.webkit.org/show_bug.cgi?id=174300 Reviewed by Simon Fraser. Removes plumbing introduced in r219310 for telling WKContentView when the user has finished panning or zooming. This was previously used to reset allowing asynchronous touch event after preventing the web touch events gesture recognizer from firing. However, a far simpler (and much less fragile) solution is to just set _canSendTouchEventsAsynchronously to NO at the beginning of the gesture, before the first `touchstart` event is dispatched. This way, we always ensure that _canSendTouchEventsAsynchronously is NO when beginning to process a touch event. This approach is correct because the only place where we query _canSendTouchEventsAsynchronously is in -_webTouchEventsRecognized:, where (when we are beginning a new gesture) we are guaranteed that -gestureRecognizer:shouldIgnoreWebTouchWithEvent: has already been called and _canSendTouchEventsAsynchronously is NO. Confirmed that the LayoutTests added in r219310 still pass. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): * UIProcess/PageClient.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted. * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): Deleted. * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]): (-[WKContentView scrollViewDidEndPanOrPinchGesture]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): Deleted. 2017-07-11 Brent Fulgham Unreviewed clean-up after r219323 Simplify algorithm slightly based on a suggestion Chris Dumez made in the review. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::pruneResources): Don't create a second variable to track the pruning operation. 2017-07-11 Alex Christensen SharedBuffer::size should return a size_t https://bugs.webkit.org/show_bug.cgi?id=174328 Reviewed by Andreas Kling. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): 2017-07-11 Youenn Fablet We should do ICE candidate filtering at the Document level https://bugs.webkit.org/show_bug.cgi?id=173861 Reviewed by Eric Carlson. Removing ICE candidate filtering handling at UIProcess level. ICE candidate filtering is now disabled at UserMediaRequest level. WebPage forwards the ICE candidate filtering option to the page so as to set the default option correctly for every document of the page. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willCreateMediaStream): (WebKit::UserMediaProcessManager::endedCaptureSession): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::disableICECandidateFiltering): (WebKit::WebPage::enableICECandidateFiltering): 2017-07-11 Youenn Fablet Changing the web page muted state for playing audio should not disable other tabs capture https://bugs.webkit.org/show_bug.cgi?id=174349 rdar://problem/33223988 Reviewed by Eric Carlson. Make sure to mute capturing streams of any other tab if the current tab will start capturing or will unmute existing capturing streams. Manually tested by having a tab doing capture and another tab playing a video. Muting or unmuting the tab playing video should not change the capture tab. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): (WebKit::WebPageProxy::setMuted): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): 2017-07-11 Youenn Fablet NetworkProcess should close listening WebRTC sockets when being suspended https://bugs.webkit.org/show_bug.cgi?id=174270 rdar://problem/33139844 Reviewed by Chris Dumez. To prevent potential spinning of the NetworkProcess, NetworkProcess will now close listening sockets when being notified that it will be suspended. When the network process is being suspended, it will stop creating listening sockets, until it resumes. Future additional efforts might be to improve select/cancel so that we can stop listening sockets at resume time, or to reimplement part of the stack using CFStream. Tested through manual testing by going to a website doing WebRTC, homing out so that the network process is suspended and reopening Safari. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension): Proxying call to clean for suspension to rtc provider so that it will close listening sockets. (WebKit::NetworkConnectionToWebProcess::resumeFromSuspension): Authorizing back listening sockets. * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension): Clean-up is done asynchronously as it can happen in background threads. Hence why passing a callback as parameter. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::notifyProcessReadyToSuspend): Helper routine to notify UI process that network process clean up is done. (WebKit::TaskCounter::TaskCounter): Helper class to call notifyProcessReadyToSuspend when sded. (WebKit::TaskCounter::~TaskCounter): (WebKit::NetworkProcess::actualPrepareToSuspend): Doing the clean-up for each connection that needs it. Making sure to notify UI process of clean-up being completed once all connections are cleaned. (WebKit::NetworkProcess::processWillSuspendImminently): (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::processDidResume): Reenable listening sockets. * NetworkProcess/NetworkProcess.h: * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient): * NetworkProcess/webrtc/LibWebRTCSocketClient.h: Adding type getter and making close public. Used by NetworkRTCProvider to identifiy listening sockets and close them. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::closeListeningSockets): We close the webrtc socket and we also notify the Web Process that the socket is closed so that it can take actions to recreate some if needed. (WebKit::NetworkRTCProvider::finishClosingListeningSockets): * NetworkProcess/webrtc/NetworkRTCProvider.h: (WebKit::NetworkRTCProvider::authorizeListeningSockets): Authorize creation of listening sockets. 2017-07-10 Brent Fulgham Resource Load Statistics: Prune statistics in orders of importance https://bugs.webkit.org/show_bug.cgi?id=174215 Unreviewed test correction. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::pruneResources): The revised algorithm did not update the remaining count to be pruned, causing a test failure. 2017-07-10 John Wilander Resource Load Statistics: Prune statistics in orders of importance https://bugs.webkit.org/show_bug.cgi?id=174215 Reviewed by Chris Dumez. New functionality. Prunes statistics in this order: 1. Non-prevalent resources without user interaction. 2. Prevalent resources without user interaction. 3. Non-prevalent resources with user interaction. 4. Prevalent resources with user interaction. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Added timestamp field lastSeen. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]): (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): Test infrastructure. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries): Test infrastructure. (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo): Test infrastructure. (WebKit::sortAndPrune): Convenience function. (WebKit::ResourceLoadStatisticsStore::pruneStatisticsIfNeeded): The new pruning function. * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Now calls ResourceLoadStatisticsStore::pruneStatisticsIfNeeded(). (WebKit::WebResourceLoadStatisticsStore::setLastSeen): Test infrastructure. (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries): Test infrastructure. (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo): Test infrastructure. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-10 Dean Jackson const() experimental feature should always be on by default https://bugs.webkit.org/show_bug.cgi?id=174341 Reviewed by Simon Fraser. Even though this is experimental, it should be enabled by default, and not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. * Shared/WebPreferencesDefinitions.h: 2017-07-10 Chris Dumez [iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily https://bugs.webkit.org/show_bug.cgi?id=174326 Reviewed by Simon Fraser. Only call [scrollView setZoomScale] if the new zoom scale is actually different to avoid doing unnecessary work in UIKit. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): 2017-07-10 Chris Dumez Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174203 Reviewed by Brent Fulgham. Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore. The 2 classes have a similar purpose and there is no clean separation between the 2. It makes more sense to have a single store class for resource load statistics. If we want to simplify the WebResourceLoadStatisticsStore class, I think it'd make more sense to split the file system I/O code out. This code adds quite a bit of complexity. * CMakeLists.txt: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Removed. * UIProcess/Storage/ResourceLoadStatisticsStore.h: Removed. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): (WebKit::WebResourceLoadStatisticsStore::performDailyTasks): (WebKit::WebResourceLoadStatisticsStore::submitTelemetry): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData): (WebKit::WebResourceLoadStatisticsStore::populateFromDecoder): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::WebResourceLoadStatisticsStore::processStatistics): (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction): (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::sortedPrevalentResourceTelemetry): (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): * UIProcess/WebResourceLoadStatisticsTelemetry.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): * WebKit2.xcodeproj/project.pbxproj: 2017-07-10 Wenson Hsieh [WK2] Ignore touch events that interrupt platform-driven momentum scrolling https://bugs.webkit.org/show_bug.cgi?id=174300 Reviewed by Simon Fraser. Adds support for immediately failing WKContentView's UIWebTouchEventsGestureRecognizer if any touch interrupts scroll view deceleration. Covered by 3 new LayoutTests (see Source/WebCore/ChangeLog). * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): * UIProcess/PageClient.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Adds plumbing in the UI process to alert the WKContentView when scroll view dragging has ended in an overflow momentum scrolling region (tracked by an overflow scrolling tree node). This parallels UI process plumbing for ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture. * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView scrollViewDidEndPanOrPinchGesture]): When the dragging phase of a scroll gesture ends, ensure that _canSendTouchEventsAsynchronously is reset to NO. When touches are not being prevented, this flag is set to YES in -scrollViewWillStartPanOrPinchGesture: and normally reset to NO in -_webTouchEventsRecognized: after all touch points have been released. However, in the case where we've prematurely failed the web touch events gesture recognizer after -touchesBegan:, -_webTouchEventsRecognized: will not be called again in a state where all touches have been released. Thus, we also need to bookend the place where we begin allowing async touch event dispatch in -scrollViewWillStartPanOrPinchGesture by disallowing async touch event dispatch in -scrollViewDidEndPanOrPinchGesture. This has no impact in the normal case where the user scrolls without momentum, since -scrollViewDidEndPanOrPinchGesture will fire after async touch events have already been disallowed in -_webTouchEventsRecognized:, and in the case where the page prevents default on touches, scrolling doesn't happen anyways, so neither scrollViewWillStartPanOrPinchGesture nor scrollViewDidEndPanOrPinchGesture will be invoked. (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]): Implements a new SPI hook in UIKit. This serves an identical purpose as -shouldIgnoreWebTouch, but additionally passes the triggering UIEvent, as well as the gesture recognizer itself (following standard convention for Objective C delegate methods). Here, we return YES in the case where one or more of the touches recognized by the gesture is currently interrupting scroll deceleration. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): 2017-07-10 Brent Fulgham [WK2][macOS] Allow access to com.apple.cfnetwork.cfnetworkagent in the Network Process https://bugs.webkit.org/show_bug.cgi?id=174320 Reviewed by Geoffrey Garen. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: 2017-07-10 Megan Gardner Add location to NavigationActionData https://bugs.webkit.org/show_bug.cgi?id=174233 Reviewed by Simon Fraser. Add the root view location of a tap to a NavigationAction to vend to Safari. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: * UIProcess/API/APINavigationAction.h: * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction description]): (-[WKNavigationAction _clickLocationInRootViewCoordinates]): * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp: (WebKit::clickLocationInRootViewCoordinatesForMouseEvent): (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction): (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction): * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h: (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinates): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2017-07-03 Brian Burg Web Replay: remove some unused code https://bugs.webkit.org/show_bug.cgi?id=173903 Rubber-stamped by Joseph Pecoraro. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::tryClose): (WebKit::WebPage::loadRequest): (WebKit::WebPage::stopLoadingFrame): (WebKit::WebPage::stopLoading): (WebKit::WebPage::reload): (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::handleContextMenuEvent): (WebKit::handleMouseEvent): (WebKit::handleWheelEvent): (WebKit::handleKeyEvent): (WebKit::WebPage::scroll): (WebKit::WebPage::logicalScroll): 2017-07-10 Chris Dumez Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up https://bugs.webkit.org/show_bug.cgi?id=174301 Reviewed by Brent Fulgham. General clean up and various simplifications / optimizations to WebResourceLoadStatisticsStore and ResourceLoadStatisticsStore classes. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::create): (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore): (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): (WebKit::ResourceLoadStatisticsStore::populateFromDecoder): (WebKit::ResourceLoadStatisticsStore::clearInMemory): (WebKit::ResourceLoadStatisticsStore::mergeStatistics): (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::ResourceLoadStatisticsStore::processStatistics): (WebKit::ResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction): (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath): (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::scheduleOrWriteStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): (WebKit::WebResourceLoadStatisticsStore::performDailyTasks): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::WebResourceLoadStatisticsStore::setDataRecordsBeingRemoved): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::sortedPrevalentResourceTelemetry): (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-07-10 Michael Catanzaro [SOUP] Remove WebKitSoupCookieJarSqlite https://bugs.webkit.org/show_bug.cgi?id=174310 Reviewed by Carlos Garcia Campos. It seems WebKitSoupCookieJarSqlite uses exactly the same database format as the upstream SoupCookieJarDb class. WebKitSoupCookieJarSqlite is a copy of SoupCookieJarSqlite that uses WebCore's SQLite wrapper and WTF stuff. WebKitSoupCookieJarSqlite exists only because SoupCookieJarDb is relatively new, and the older SoupCookieJarSqlite class existed only in libsoup-gnome rather than libsoup proper. The advantage of continuing to use our WebKitSoupCookieJarSqlite class, besides that we already know it works, is that it utilizes the same SQLiteDatabase class that is used elsewhere in WebKit. But that's not really any reason to keep the class around, when SoupCookieJarDb does exactly the same thing. It was introduced in libsoup 2.42 and that is already our minimum required version, so we can switch now. This passes a quick sanity-check of Epiphany's cookies dialog and also TestCookieManager. * PlatformGTK.cmake: * PlatformWPE.cmake: * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: (WebKit::WebCookieManager::setCookiePersistentStorage): * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp: Removed. * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.h: Removed. 2017-07-10 Myles C. Maxfield REGRESSION(r213590): UI process updates the visible content rects more often than it did in iOS 10 https://bugs.webkit.org/show_bug.cgi?id=174282 Reviewed by Simon Fraser. In r213590, we accidentally refactored -[WKWebView _didCommitLayerTree:] to call _scheduleVisibleContentRectUpdate more often. Instead, this should be triggered from inside the "if" statements. No tests because there is no behavior change. Performance change is tested in MotionMark. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isShowingVideoPictureInPicture]): (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView goBack]): (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): (-[WKWebView scrollViewDidScroll:]): (-[WKWebView _visibleContentRect]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _navigationGestureDidBegin]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _reloadExpiredOnly]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): (-[WKWebView _clearOverrideLayoutParameters]): (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): (-[WKWebView _propertiesOfLayerWithID:]): 2017-07-10 Carlos Garcia Campos [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around) https://bugs.webkit.org/show_bug.cgi?id=166029 Reviewed by Michael Catanzaro. Clear the SoupNetworkSession and cookie storage after the main loop quits. * NetworkProcess/soup/NetworkProcessMainSoup.cpp: (WebKit::NetworkProcessMainUnix): 2017-07-10 Wenson Hsieh [WK2] Action sheets for links fail to present in WebKit2 PDF view https://bugs.webkit.org/show_bug.cgi?id=174307 Reviewed by Tim Horton. Currently, presenting an action sheet for a link always uses the WKActionSheetPresentAtClosestIndicatorRect codepath, which requires text indicator data for the link. However, when showing an action sheet for a link via WKPDFView, a text indicator for the link is not included, so the popover rect ends up being an empty rect at the origin, which causes us to bail from presenting the popover. To address this, we tweak our heuristic for determining which action sheet presentation style to use, so that we only use the closest indicator rect for a link if the text indicator data is also present (otherwise, we fall back to using the element rect). All other behavior is the same. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showImageSheet]): (presentationStyleForView): Refactor _shouldPresentAtTouchLocationForElementRect into presentationStyleForView, a static function that returns a WKActionSheetPresentationStyle. (-[WKActionSheetAssistant showLinkSheet]): (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]): Deleted. 2017-07-09 Brady Eidson Remove some obsolete WebKitVersionChecks. https://bugs.webkit.org/show_bug.cgi?id=174294 Reviewed by Dan Bernstein. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-07-08 Chris Dumez Simplify WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174290 Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]): (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Rename a couple of functions in the Cocoa SPI for clarity and to match the name of their internal implementation. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::create): (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): Stylistic changes. (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): Make const. (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): Use HashMap::add() instead of HashMap::set(). There is not supposed to have any duplicate keys so add() is sufficient and more efficient. (WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Removed. clearInMemoryAndPersistent() was only called from WebResourceLoadStatisticsStore and the m_deletePersistentStoreHandler / m_grandfatherExistingWebsiteDataHandler were both set by the WebResourceLoadStatisticsStore as well. Therefore, we don't really need this function, WebResourceLoadStatisticsStore now calls ResourceLoadStatisticsStore::clearInMemory() instead and takes care of doing what the m_deletePersistentStoreHandler / m_grandfatherExistingWebsiteDataHandler handlers were doing on its side. (WebKit::ResourceLoadStatisticsStore::mergeStatistics): Pass Vector as rvalue reference, as a preparation for a future optimization. Added FIXME comment about the optimization. (WebKit::ResourceLoadStatisticsStore::setNotificationCallback): Removed. (WebKit::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback): Removed. (WebKit::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Removed. (WebKit::ResourceLoadStatisticsStore::setFireTelemetryCallback): Removed. Drop those callback setters. WebResourceLoadStatisticsStore is the only client of ResourceLoadStatisticsStore and those callbacks were always called as a result of an operation requested by the WebResourceLoadStatisticsStore. Therefore, those are not needed. WebResourceLoadStatisticsStore can take care of doing what those callbacks were doing on its side. (WebKit::ResourceLoadStatisticsStore::processStatistics): Pass parameter by const reference since we clearly do not intend to transfer ownership of it. (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords): (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): Stylistic changes. (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): Removed. (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): Removed. (WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved): Removed. Those were moved to WebResourceLoadStatisticsStore since they do not require any access to the statistics, and are only used by WebResourceLoadStatisticsStore. * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Store registering most callbacks on the coreStore. Instead, the logic of those callbacks is now inlined in the few methods in WebResourceLoadStatisticsStore that were causing these callbacks to be called. (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Access some methods on WebResourceLoadStatisticsStore instead of the coreStore since those were moved. (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Drop unnecessary mutable for lambda. (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Pass parameter as rvalue reference as a preparation for a future optimization. (WebKit::WebResourceLoadStatisticsStore::hasStatisticsFileChangedSinceLastSync): Make const. (WebKit::WebResourceLoadStatisticsStore::submitTelemetry): Add assertion to make sure this is called on the main thread. (WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler): Removed. This was dispatching to a background queue to call fireDataModificationHandler() on the ResourceLoadStatisticsStore. The coreStore would then dispatch back on the main thread to call the WebResourceLoadStatisticsStore's modification handler. This modification handler was merely calling processStatisticsAndDataRecords(). Therefore, callers of WebResourceLoadStatisticsStore::fireDataModificationHandler() can call WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() directly instead. (WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler): Removed. This was calling ResourceLoadStatisticsStore::fireTelemetryHandler(), which was calling back WebResourceLoadStatisticsStore's fireTelemetryHandler. The handler in question was merely calling submitTelemetry(). Therefore, callers of WebResourceLoadStatisticsStore::fireTelemetryHandler() can call WebResourceLoadStatisticsStore::submitTelemetry() directly instead. (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent): Call ResourceLoadStatisticsStore::clearInMemory() instead of clearInMemoryAndPersistent(), which was removed. ResourceLoadStatisticsStore::clearInMemoryAndPersistent() was calling clearInMemory() and then 2 of WebResourceLoadStatisticsStore's handlers. Instead, we now call the functions that those handlers were calling directly, thus eliminating the need for those handlers. (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval): Set m_minimumTimeBetweenDataRecordsRemoval directly as it is now store on this class instead of the coreStore. (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::WebResourceLoadStatisticsStore::dataRecordsBeingRemoved): (WebKit::WebResourceLoadStatisticsStore::dataRecordsWereRemoved): Those were merely moved from the ResourceLoadStatisticsStore. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): Check for sortedPrevalentResources.isEmpty() instead of checking if the size if less than minimumPrevalentResourcesForTelemetry. ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry() either returns an empty vector or a vector with more than minimumPrevalentResourcesForTelemetry items. Therefore, there is no need to expose minimumPrevalentResourcesForTelemetry. 2017-07-08 Yusuke Suzuki Drop NOSNIFF compile flag https://bugs.webkit.org/show_bug.cgi?id=174289 Reviewed by Michael Catanzaro. * Configurations/FeatureDefines.xcconfig: 2017-07-07 Chris Dumez [WK2] Use a rolling 30-day uptime for processing statistics https://bugs.webkit.org/show_bug.cgi?id=174235 Reviewed by Brent Fulgham. Follow-up fix for r219274 because it caused this test to time out: http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html The test sets TimeToLiveUserInteraction to 0 so our implementation cannot use 0 as magic value to see if it was set. Instead, use std::optional. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired): * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-07 Brent Fulgham [WK2] Use a rolling 30-day uptime for processing statistics https://bugs.webkit.org/show_bug.cgi?id=174235 Reviewed by Chris Dumez. * UIProcess/API/Cocoa/WKWebsiteDataStore.cpp: (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsResetToConsistentState): Initialize time-to-live to zero by default. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): Write out vector of operating dates. (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): Read in vector of operating dates. (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): Check new convenience method. (WebKit::ResourceLoadStatisticsStore::markTodayAsOperatingDate): Added. (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired): Added. * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): When reading a new data file, update the current operating date (if needed). (WebKit::WebResourceLoadStatisticsStore::handleDailyTasks): Roll uptime dates as needed, then handle telemetry. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-07 Wenson Hsieh [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging https://bugs.webkit.org/show_bug.cgi?id=174219 Reviewed by Ryosuke Niwa. Tweak some testing SPI to return a drop operation flag instead of whether or not the drop operation was not UIDropOperationCancel. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateDataInteractionUpdated:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _simulateDataInteractionUpdated:]): 2017-07-07 Commit Queue Unreviewed, rolling out r219238, r219239, and r219241. https://bugs.webkit.org/show_bug.cgi?id=174265 "fast/workers/dedicated-worker-lifecycle.html is flaky" (Requested by yusukesuzuki on #webkit). Reverted changesets: "[WTF] Implement WTF::ThreadGroup" https://bugs.webkit.org/show_bug.cgi?id=174081 http://trac.webkit.org/changeset/219238 "Unreviewed, build fix after r219238" https://bugs.webkit.org/show_bug.cgi?id=174081 http://trac.webkit.org/changeset/219239 "Unreviewed, CLoop build fix after r219238" https://bugs.webkit.org/show_bug.cgi?id=174081 http://trac.webkit.org/changeset/219241 2017-07-07 Antti Koivisto WKWebSiteDataStore.removeDataOfTypes should wait until disk cache files are actually removed before invoking completion handler https://bugs.webkit.org/show_bug.cgi?id=174224 Reviewed by Sam Weinig. Currently we dispatch file deletion operations to a background queue and call the completion handler without waiting for the I/O to complete. * NetworkProcess/NetworkProcess.cpp: (WebKit::clearDiskCacheEntries): Call a new version of NetworkCache::remove() for bulk deletion. Note that it is fine to call this with an empty vector. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::remove): Bulk deletion with a completion handler. (WebKit::NetworkCache::Cache::deleteFiles): Added. Factor to a helper function. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::remove): Remove files for all the provided keys in a queue and invoke the completion handler in the main thread when done. * NetworkProcess/cache/NetworkCacheStorage.h: 2017-07-06 Chris Dumez Fix bad usage of static variables in ResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174237 Reviewed by Brent Fulgham. Fix bad usage of static variables in ResourceLoadStatisticsStore. Those can be set via member functions on ResourceLoadStatisticsStore so they should be data members. The API to set them is associated to a particular store and there can in theory be several stores. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::shouldPartitionCookies): (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval): (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime): (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::shouldPartitionCookies): Deleted. * UIProcess/Storage/ResourceLoadStatisticsStore.h: 2017-07-05 Yusuke Suzuki [WTF] Implement WTF::ThreadGroup https://bugs.webkit.org/show_bug.cgi?id=174081 Reviewed by Mark Lam. * Shared/AsyncRequest.h: * UIProcess/Storage/ResourceLoadStatisticsStore.h: 2017-07-06 Chris Dumez Drop unused ResourceLoadStatistics members https://bugs.webkit.org/show_bug.cgi?id=174226 Reviewed by Brent Fulgham. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): 2017-07-06 Wenson Hsieh Unreviewed, fix the internal iOS 11 build It turns out, our internal bots are still on an older version of the iOS 11 SDK that's missing _UIDataOwner in . To ensure that we can build on both current and slightly older versions of the iOS 11 SDK, fall back to using NSInteger instead of _UIDataOwner. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:dataOwnerForSession:]): (-[WKContentView _dropInteraction:dataOwnerForSession:]): 2017-07-06 Wenson Hsieh [iOS DnD] [WK2] Add delegate hooks for specifying the data owner for a drag or drop session https://bugs.webkit.org/show_bug.cgi?id=174139 Reviewed by Beth Dakin. Add hooks to query the UI delegate for a _UIDataOwner on both drag and drop sides. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:dataOwnerForSession:]): (-[WKContentView _dropInteraction:dataOwnerForSession:]): 2017-07-06 Brent Fulgham [WK2] ResourceLoadStatistics should batch its writes https://bugs.webkit.org/show_bug.cgi?id=174111 Reviewed by Chris Dumez. Revise the data writing operation to only write on a specific interval (currently set to 5 minutes). Also make 'writeStoreToDisk' simpler to use by moving the deleting (before write) and creating (after write) of the FileMonitor into the method, rather than requiring this knowledge in multiple places. Make sure that we write our statistics file out before exiting so that we do not lose any data if we exit before the five-minute window has elapsed. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Deleted. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Remove the stop and start monitoring into 'writeStoreToDisk'. Also check if enough time has elapsed since the last write to commit to disk. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Remove the stop and start monitoring into 'writeStoreToDisk'. (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Add the stop and start monitoring commands here, so callers don't have to know to do so. 2017-07-06 Chris Dumez FileMonitor should not be ref counted https://bugs.webkit.org/show_bug.cgi?id=174166 Reviewed by Brent Fulgham. Update code using FileMonitor to reflect API change. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-06 Matt Rajca Fix build with VIDEO support disabled. https://bugs.webkit.org/show_bug.cgi?id=174217 Unreviewed build fix. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateWebsitePolicies): 2017-07-06 Chris Dumez Crash under WebResourceLoadStatisticsStore::persistentStoragePath(WTF::String const&) https://bugs.webkit.org/show_bug.cgi?id=174205 Reviewed by Brent Fulgham. Make sure we isolateCopy() m_statisticsStoragePath before using it from the background thread. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath): (WebKit::WebResourceLoadStatisticsStore::statisticsFilePath): (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): (WebKit::WebResourceLoadStatisticsStore::deleteStoreFromDisk): (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Deleted. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-06 Alex Christensen Fix CFURLRequestRef serialization after r207330 https://bugs.webkit.org/show_bug.cgi?id=163332 * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): The CFURLConnection code was not updated. We did not catch this because nobody uses the WebKit2 CFURLConnection code, but I need to use it to debug something. 2017-07-06 Chris Dumez Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver https://bugs.webkit.org/show_bug.cgi?id=174194 Reviewed by Brent Fulgham. Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver. This makes more sense and decreases the complexity of the WebProcess class. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::statisticsChangedTimerFired): Deleted. * WebProcess/WebProcess.h: 2017-07-06 Chris Dumez WebResourceLoadStatisticsStore should only be constructed when the feature is enabled https://bugs.webkit.org/show_bug.cgi?id=174189 Reviewed by Brent Fulgham. Delay the construction of the WebResourceLoadStatisticsStore until the feature gets enabled via WebsiteDataStore::setResourceLoadStatisticsEnabled(). Previously, we would always construct a store and then have a boolean on the store to indicate if it is enabled or not. Also simplify the initialization process of the WebResourceLoadStatisticsStore, we used to have: 1. WebResourceLoadStatisticsStore constructor 2. WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver() 3. WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled(true) All 3 steps are now taken care of by the WebResourceLoadStatisticsStore constructor. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformInitialize): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled): (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resourceLoadStatistics): * UIProcess/wpe/WebProcessPoolWPE.cpp: (WebKit::WebProcessPool::platformInitialize): 2017-07-06 Claudio Saavedra [GTK] It should process MouseMoved events when the parent window is not active https://bugs.webkit.org/show_bug.cgi?id=116691 Reviewed by Michael Catanzaro. From reading the comments in the related code, only in Safari it is desired that MouseMoved events are not processed when the parent window is not active. In other ports, in particular those targeting Linux, these events should be processed for consistency with other browsers. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setCursor): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setCursor): * WebProcess/WebPage/WebPage.cpp: (WebKit::handleMouseEvent): (WebKit::WebPage::mouseEvent): No need to always pass a boolean parameter that is only checked for one type of event. Do the check internally in handleMouseEvent() only when needed and only in Cocoa. 2017-07-05 Don Olmstead [WTF] Move SoftLinking.h into WTF https://bugs.webkit.org/show_bug.cgi?id=174000 Reviewed by Alex Christensen. * Platform/mac/StringUtilities.mm: * Platform/spi/ios/ManagedConfigurationSPI.h: * Shared/Cocoa/DataDetectionResult.mm: * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: * Shared/ios/InteractionInformationAtPosition.mm: * Shared/ios/WebIconUtilities.mm: * Shared/mac/CookieStorageShim.mm: * Shared/mac/WebCoreArgumentCodersMac.mm: * UIProcess/API/Cocoa/_WKElementAction.mm: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: * UIProcess/Cocoa/UIDelegate.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: * UIProcess/ios/WKActionSheetAssistant.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: * UIProcess/ios/forms/WKFileUploadPanel.mm: * UIProcess/mac/WKImmediateActionController.mm: * UIProcess/mac/WebInspectorProxyMac.mm: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: * WebProcess/WebPage/mac/WebInspectorUIMac.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-07-05 Brady Eidson Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow". and https://bugs.webkit.org/show_bug.cgi?id=174178 Reviewed by Alex Christensen. Adopt to the new constructor for FrameLoadRequest. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): 2017-07-05 Ryosuke Niwa Remove unnecessary forward declartions now that we include Foundation.h * UIProcess/API/Cocoa/WKContentRuleListStore.h: 2017-07-05 Ryosuke Niwa Make WebKit's public headers on Mac and iOS C++ module safe https://bugs.webkit.org/show_bug.cgi?id=174175 Reviewed by Alex Christensen. Fixed the header files. * UIProcess/API/Cocoa/WKContentRuleList.h: * UIProcess/API/Cocoa/WKContentRuleListStore.h: * UIProcess/API/Cocoa/WKUIDelegate.h: 2017-07-05 Chris Dumez [WK2] WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with https://bugs.webkit.org/show_bug.cgi?id=174174 Reviewed by Brent Fulgham. WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with. Fix this by iterating over WebsiteDataStore::processPools() instead of WebProcessPool::allProcessPools(). Also rename shouldPartitionCookiesForTopPrivatelyOwnedDomains methods / IPC messages to updateCookiePartitioningForTopPrivatelyOwnedDomains since this is a setter, not a getter. Finally, drop ShouldPartitionCookiesForTopPrivatelyOwnedDomains IPC message to the NetworkProcessProxy as well as corresponding methods as those appear to be unused. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-07-05 Tim Horton Async Image Decoding: Image flashes away briefly when tapping on tab in iPad tab picker https://bugs.webkit.org/show_bug.cgi?id=174173 Reviewed by Geoffrey Garen. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID): When a client uses e.g. doAfterNextPresentationUpdate (or internally, dispatchAfterEnsuringDrawing), they're doing so in the hopes that the callback is called after the page is well-painted -- for example, to remove a snapshot (in the tab picker case, as well as for navigation gestures), or to *take* a snapshot. In all of these cases, it is preferable to do a synchronous decode, to ensure that the image does not flash away temporarily. Use the existing mechanism that was implemented for the synchronous activity state change flush to also force synchronous image decoding any time there is a post-commit transaction callback. 2017-07-05 Wenson Hsieh [iOS DnD] [WK2] 3D touch fails to recognize when UIDragInteraction is enabled on phone https://bugs.webkit.org/show_bug.cgi?id=174171 Reviewed by Tim Horton. By default, UIKit defers all competing long press gesture recognizers if dragging is enabled. However, this would cause 3D touch to be prevented, due to UIKit asking us whether or not we can proceed with the 3D touch gesture in -_interactionShouldBeginFromPreviewItemController:forPosition:, while the highlight long press gesture recognizer is being deferred. To address this, we use SPI on UIDragInteraction to allow the highlight long press gesture recognizer to recognize alongside the drag lift gesture. We then (already) manually cancel the highlight long press gesture in _dragInteraction:prepareForSession:completion:. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:shouldDelayCompetingGestureRecognizer:]): 2017-07-03 Myles C. Maxfield Remove copy of ICU headers from WebKit https://bugs.webkit.org/show_bug.cgi?id=116407 Reviewed by Alex Christensen. * Configurations/BaseTarget.xcconfig: 2017-07-05 Chris Dumez Regression(r218821): Bad cast to WebKit::DiagnosticLoggingClient in WKWebView's _setDiagnosticLoggingDelegate https://bugs.webkit.org/show_bug.cgi?id=174163 Reviewed by Alex Christensen. After r218821, WebPageProxy::setDiagnosticLoggingClient() would no longer set the client in private session. This is an issue because there is code in WKWebView which expects the DiagnosticLoggingClient to be set and of a specific type. This would lead to bad casts in WKWebView's _diagnosticLoggingDelegate / _setDiagnosticLoggingDelegate. To avoid the issue, we now unconditionally update the client in WebPageProxy::setDiagnosticLoggingClient(). Instead, we implement the logic for disabling logging in private session in the logging methods themselves, via the WebPageProxy::effectiveDiagnosticLoggingClient() helper instead. I also added null checks in WKWebView's _diagnosticLoggingDelegate / _setDiagnosticLoggingDelegate. Even though the WKWebView sets itself as the diagnostic logging client, WebPageProxy::diagnosticLoggingClient() can still return null after calling WebPageProxy::close(). Previously, we would have done a bad cast if the WKWebView's client would have used this API after calling 'close' as well. * UIProcess/API/APIDiagnosticLoggingClient.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _diagnosticLoggingDelegate]): (-[WKWebView _setDiagnosticLoggingDelegate:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::setDiagnosticLoggingClient): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::effectiveDiagnosticLoggingClient): (WebKit::WebPageProxy::logDiagnosticMessage): (WebKit::WebPageProxy::logDiagnosticMessageWithResult): (WebKit::WebPageProxy::logDiagnosticMessageWithValue): (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::diagnosticLoggingClient): 2017-07-05 Daniel Bates Do not pass API::FrameInfo for source frame or clear out page of target frame on API navigation https://bugs.webkit.org/show_bug.cgi?id=174170 Reviewed by Brady Eidson. As a step towards making it straightforward for an embedding client to determine whether a WebPageProxy::decidePolicyForNavigationAction() callback was initiated from API we should not pass frame info for the source frame and should not nullify the page pointer in the target frame info. Currently we always pass frame info for the source frame and nullify the page pointer in both the source frame info and target frame info if the navigation was initiated from API. This seems subtle and error prone. Instead we should not pass frame info for the source frame and not nullify the page pointer in the target frame info as a step towards making using this API less error-prone. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): 2017-07-05 Chris Dumez Add a few more WebKit2 owners https://bugs.webkit.org/show_bug.cgi?id=174169 Reviewed by Brady Eidson. * Owners: 2017-07-05 Brent Fulgham [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events https://bugs.webkit.org/show_bug.cgi?id=174062\ Reviewed by Chris Dumez. ResourceLoadStatistics was triggering periods of high CPU use due to a cascade of read/write operations: (1) The 'makeRefPtr' call in FileMonitor::startMonitoring was capturing a reference to itself, preventing the FileMonitor from being destroyed. This caused the file modification handler to fire in response to our own write events, creating a ridiculous read/write cycle. This problem was addressed in the short term by stopping the file monitor in WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage, rather than relying on the destructor to shut things down. This will be improved in a subsequent patch. (2) 'syncWithExistingStatisticsStorageIfNeeded' was creating a FileMonitor during the write operation, which exacerbated the chain of read/writes already present due to the self-reference described above. (3) Because VNODE dispatch sources are low level, they do not offer a means of filtering out operations triggered by the current process. To avoid this, I added code to track the file modification time, so that we don't bother reading a file that holds data that is older than the in-memory data, even though we receive a file modification dispatch. Writes seem to trigger a chain of notification events in rapid succession. Once we've responded to the first of these events, we don't need to to further reads until the data on disk changes again. We also shouldn't allow the ResourceLoadStatistics worker thread to consume high CPU resources. Run it as utility QoS, avoiding using the CPU when other work is going on. Drive-by fix: The closure in setWritePersistentStoreCallback() should stop monitoring before writing data, and should start monitoring after the write completes. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Run our worker queue as a utility-level process. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Stop checking for updates before writing, and begin checking again once the write is complete. (WebKit::WebResourceLoadStatisticsStore::statisticsFileModificationTime): Added. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Avoid reading the file if it was last modified on (or before) the time we last read the file. (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): Ditto. (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): Explicitly stop file monitoring so that the active file modification handler will terminate. (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): Do not begin monitoring the file after syncing, since this is only used as part of an ongoing write operation. 2017-07-05 Jonathan Bedard Add WebKitPrivateFrameworkStubs for iOS 11 https://bugs.webkit.org/show_bug.cgi?id=173988 Reviewed by David Kilzer. * Configurations/BaseTarget.xcconfig: iphoneos and iphonesimulator should use the same directory for private framework stubs. 2017-07-05 Andy Estes [iOS] WKActionSheetAssistants can outlive their host views https://bugs.webkit.org/show_bug.cgi?id=174160 Reviewed by Tim Horton. WKActionSheetAssistant keeps a raw pointer to its host UIView, and nothing clears it when the host view is deallocated. If the assistant outlives the view, we can end up accessing a pointer to a deallocated UIView and crashing. I don't know how to reproduce such a crash, but this patch guards against it by doing the following: 1. Make _view a WeakObjCPtr in WKActionSheetAssistant to ensure it gets set to nil when the UIView is deallocated. 2. Call -[WKActionSheetAssistant cleanupSheet] when a WKContentView or WKPDFView is deallocated, or when the Web process crashes. This will ensure the action sheet is dismissed and prevent the user from tapping on an action that's no longer valid. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant superviewForSheet]): (-[WKActionSheetAssistant _presentationRectForSheetGivenPoint:inHostView:]): (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]): (-[WKActionSheetAssistant presentationRectForIndicatedElement]): (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView dealloc]): 2017-07-05 Frederic Wang Move ScrolledContentsLayer property to ScrollingStateScrollingNode https://bugs.webkit.org/show_bug.cgi?id=174134 Reviewed by Simon Fraser. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): Add encoding for scrolled contents layer. (ArgumentCoder::encode): Remove encoding for scrolled contents layer. (ArgumentCoder::encode): Ditto. (ArgumentCoder::decode): Add decoding for scrolled contents layer. (ArgumentCoder::decode): Remove decoding for scrolled contents layer. (ArgumentCoder::decode): Ditto. (WebKit::dump): Move dumping of scrolled contents layer from overflow/frame nodes to scrolling node. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Adjust enum value to use ScrollingStateScrollingNode::ScrolledContentsLayer. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto. * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Ditto. 2017-07-05 Ada Chan Fix crash in UIKit: +[UIViewController _viewControllerForFullScreenPresentationFromView:] https://bugs.webkit.org/show_bug.cgi?id=174143 Reviewed by Wenson Hsieh. In -[WKActionSheet willRotate], we can't guarantee that the action sheet belongs in a window, and passing nil to +[UIViewController _viewControllerForFullScreenPresentationFromView:] throws an exception. To fix this, bail early if the result from -hostViewForSheet is nil. * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet willRotate]): 2017-07-05 Eric Carlson [MediaStream] Protect request and web view during gUM client callback https://bugs.webkit.org/show_bug.cgi?id=174096 Reviewed by Youenn Fablet. Retain the message and WebView during asynchronous calls so they won't be released if a navigation happens during a call to the UA for getUserMedia or enumerateMediaDevices. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::requestUserMediaAuthorizationForDevices): (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): 2017-07-05 Matt Lewis Unreviewed, rolling out r219128. Spoke with engineer who originally submitted, Patch for APi test to follow. Reverted changeset: "Unreviewed, rolling out r219070." https://bugs.webkit.org/show_bug.cgi?id=174082 http://trac.webkit.org/changeset/219128 2017-07-05 Matt Lewis Unreviewed, rolling out r219070. This revision caused consistent failures of the API test UIPasteboardTests.DoNotPastePlainTextAsURL on iOS. Reverted changeset: "Pasting single words copied to UIPasteboard inserts URLs in editable areas" https://bugs.webkit.org/show_bug.cgi?id=174082 http://trac.webkit.org/changeset/219070 2017-07-05 Zan Dobersek [GLib] Incorrect include in WebKitWebsiteData https://bugs.webkit.org/show_bug.cgi?id=174093 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitWebsiteData.cpp: Include rather than , since the former has to be included in a library while the latter should only be included in a standalone application. 2017-07-04 Joseph Pecoraro Cleanup some StringBuilder use https://bugs.webkit.org/show_bug.cgi?id=174118 Reviewed by Andreas Kling. * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::hashToPath): * UIProcess/WebPageProxy.cpp: 2017-07-03 Wenson Hsieh [iOS DnD] [WK2] Callout bar should reappear after dragging ends for a text selection https://bugs.webkit.org/show_bug.cgi?id=174116 Reviewed by Ryosuke Niwa. -willStartScrollingOverflow -didEndScrollingOverflow are helper methods on both the UIWKTextInteractionAssistant and UIWebSelectionAssistant that handle hiding selection and callout bar UI during overflow scrolling and making it reappear after scrolling ends. However, these hooks do not contain logic specific to scrolling, and simply tell the inner UIWebSelectionView to either show or hide and are safe to invoke outside of the context of scrolling. This patch invokes these hooks when beginning a drag on a selection, and when a dragging ends, if it called -willStartScrollingOverflow to begin with. We should rename these in the future to be something along the lines of -hideSelectionViewAndControls and -showSelectionViewAndControls, respectively, and adopt these new names in WebKit. We also move logic to hide the callout out of -itemsForBeginningSession: and into -willAnimateLiftWithAnimator:, when the lift actually begins. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanUpDragSourceSessionState]): (-[WKContentView _restoreCalloutBarIfNeeded]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): 2017-07-03 Matt Rajca Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called https://bugs.webkit.org/show_bug.cgi?id=174103 Reviewed by Alex Christensen. Currently, when -[WKWebView evaluateJavaScript:completionHandler:] is invoked, we end up simulating a user gesture unconditionally. This is not desireable for some tests, so I added a private variant of this method that takes a boolean that is ultimately passed to `executeScript` for the `forceUserGesture` parameter (instead of unconditionally passing `true`). * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView evaluateJavaScript:completionHandler:]): (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptInMainFrame): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScriptInMainFrame): (WebKit::WebPage::updateWebsitePolicies): Update behavior restrictions on any existing media elements. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-07-03 Matt Lewis Unreviewed, rolling out r219103. Caused multiple build failures. Reverted changeset: "Remove copy of ICU headers from WebKit" https://bugs.webkit.org/show_bug.cgi?id=116407 http://trac.webkit.org/changeset/219103 2017-07-03 Myles C. Maxfield Remove copy of ICU headers from WebKit https://bugs.webkit.org/show_bug.cgi?id=116407 Reviewed by Alex Christensen. Use WTF's copy of ICU headers. * Configurations/BaseTarget.xcconfig: 2017-07-03 Brady Eidson Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism. https://bugs.webkit.org/show_bug.cgi?id=174073 Reviewed by Andy Estes. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::getLoadDecisionForIcons): (WebKit::WebFrameLoaderClient::dispatchDidReceiveIcon): Deleted. (WebKit::WebFrameLoaderClient::registerForIconNotification): Deleted. (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-07-03 Sam Weinig [WebIDL] Remove more unnecessary uses of the preprocessor in idl files https://bugs.webkit.org/show_bug.cgi?id=174083 Reviewed by Alex Christensen. * Configurations/FeatureDefines.xcconfig: Add ENABLE_NAVIGATOR_STANDALONE. 2017-07-03 Matt Lewis Unreviewed, rolling out r219083. The revision caused an API failure on all testing platforms. Reverted changeset: "[MediaStream] Protect request and web view during gUM client callback" https://bugs.webkit.org/show_bug.cgi?id=174096 http://trac.webkit.org/changeset/219083 2017-07-03 Ryosuke Niwa WebContent processes crash when the network process crashes with pending connection requests https://bugs.webkit.org/show_bug.cgi?id=174065 Reviewed by Tim Horton. The bug was caused by the UI process clearing away pending network connection requests whenever the existing network process crashed. This resulted in WebContent process killing itself inside ensureNetworkProcessConnection. Fixed the bug by re-launching a new network process when this happens. We don't try to re-launch a new process if the previous attempt to launch a network process had failed. This patch splits NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch into networkProcessFailedToLaunch and networkProcessCrashed to differentiate those two cases, and invoke the respective callbacks in WebProcessPool. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _networkProcessIdentifier]): Added. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::networkProcessCrashed): Added. (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch): Split into the two following functions. (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch): Extracted from networkProcessCrashedOrFailedToLaunch. (WebKit::NetworkProcessProxy::clearCallbackStates): Extracted from networkProcessCrashedOrFailedToLaunch (WebKit::NetworkProcessProxy::didClose): Call networkProcessCrashed. (WebKit::NetworkProcessProxy::didFinishLaunching): Call networkProcessFailedToLaunch. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::networkProcessCrashed): Start a new network process when there are pending connection requests the crached network failed to fullfil. (WebKit::WebProcessPool::networkProcessFailedToLaunch): * UIProcess/WebProcessPool.h: 2017-07-03 Eric Carlson [MediaStream] Protect request and web view during gUM client callback https://bugs.webkit.org/show_bug.cgi?id=174096 Reviewed by Youenn Fablet. Retain the message and WebView during asynchronous calls so they won't be released if a navigation happens during a call to the UA for getUserMedia or enumerateMediaDevices. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::requestUserMediaAuthorizationForDevices): (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): 2017-07-03 Andy Estes [Xcode] Add an experimental setting to build with ccache https://bugs.webkit.org/show_bug.cgi?id=173875 Reviewed by Tim Horton. * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. 2017-07-03 Chris Dumez Drop ResourceLoadStatisticsStore's statisticsLock https://bugs.webkit.org/show_bug.cgi?id=174080 Reviewed by Brent Fulgham. Drop ResourceLoadStatisticsStore's statisticsLock. It added complexity and was only needed do that the SPI exposed to WebKitTestRunner would query the store synchronously from the main thread. Instead, I made the SPI asynchronous and make sure we always access the store from the same background thread. As a result, there is no longer any need for locking. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]): (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]): (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::isPrevalentResource): (WebKit::ResourceLoadStatisticsStore::isGrandFathered): (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): (WebKit::ResourceLoadStatisticsStore::clearInMemory): (WebKit::ResourceLoadStatisticsStore::mergeStatistics): (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): (WebKit::ResourceLoadStatisticsStore::processStatistics): (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): (WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry): (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords): (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): (WebKit::WebResourceLoadStatisticsStore::clearInMemoryData): (WebKit::WebResourceLoadStatisticsStore::submitTelemetry): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-03 Wenson Hsieh Pasting single words copied to UIPasteboard inserts URLs in editable areas https://bugs.webkit.org/show_bug.cgi?id=174082 Reviewed by Tim Horton. Add a hook to WKPreferences to allow programatic pasting. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setDOMPasteAllowed:]): (-[WKPreferences _domPasteAllowed]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-07-03 Zan Dobersek Unreviewed GTK+ and WPE build fix when building with GCC 4.9. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::renderNextFrame): Don't use brace-list initialization to override the m_forceRepaintAsync struct. Instead, manually assign the OptionalCallbackID() value to the m_forceRepaintAsync.callbackID member variable, and override the m_forceRepaintAsync.needsFreshFlush member variable with `false`. 2017-07-03 Zan Dobersek [ThreadedCompositor] Update and retrieve scene attributes under a Lock https://bugs.webkit.org/show_bug.cgi?id=173762 Reviewed by Carlos Garcia Campos. Instead of dispatching separate tasks on the composition run loop, update various scene attributes by locking a common lock object and updating the appropriate attribute. In ThreadedCompositor::renderLayerTree(), where these attributes are used in scene composition, the lock is again obtained and the attributes copied into local variables, releasing the lock afterwards. The attribute values in local copies are then used for that renderLayerTree() invocation. This approach is more efficient than dispatching separate tasks that can race against renderLayerTree() dispatches. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::ThreadedCompositor): (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::setScaleFactor): (WebKit::ThreadedCompositor::setScrollPosition): (WebKit::ThreadedCompositor::setViewportSize): (WebKit::ThreadedCompositor::setDrawsBackground): (WebKit::ThreadedCompositor::renderLayerTree): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2017-07-01 Dan Bernstein [iOS] Remove code only needed when building for iOS 9.x https://bugs.webkit.org/show_bug.cgi?id=174068 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: * Configurations/WebKit.xcconfig: * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession setSuggestions:]): (-[WKFormInputSession invalidate]): (-[WKContentView insertTextSuggestion:]): (contentTypeFromFieldName): (-[WKContentView textInputTraits]): (-[WKContentView _dataForPreviewItemController:atPosition:type:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): * config.h: 2017-07-01 Brady Eidson When setting a custom cookie storage location on a WKWebsiteDataStore, cookies aren't actually removed. and https://bugs.webkit.org/show_bug.cgi?id=174035 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateNetworkProcess]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Take an optional WebsiteDataStore. If one is passed in, send it to either the existing or new network process. * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): Resolve paths first. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): 2017-07-01 Ryosuke Niwa Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h https://bugs.webkit.org/show_bug.cgi?id=174004 Reviewed by Simon Fraser. * WebProcess/Plugins/WebPluginInfoProvider.cpp: * WebProcess/WebPage/WebInspector.cpp: 2017-07-01 Dan Bernstein [macOS] Remove code only needed when building for OS X Yosemite https://bugs.webkit.org/show_bug.cgi?id=174067 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Configurations/BaseTarget.xcconfig: * Configurations/BaseXPCService.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: * Configurations/NetworkService.xcconfig: * Configurations/PluginService.32.xcconfig: * Configurations/PluginService.64.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebContentService.xcconfig: * Configurations/WebKit.xcconfig: * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Removed. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): (IPC::Connection::platformInitialize): (IPC::Connection::open): (IPC::Connection::exceptionSourceEventHandler): Deleted. (IPC::Connection::setShouldCloseConnectionOnMachExceptions): Deleted. * Platform/mac/LayerHostingContext.h: * Platform/mac/LayerHostingContext.mm: (WebKit::LayerHostingContext::createFencePort): * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Removed. * PluginProcess/mac/PluginControllerProxyMac.mm: (WebKit::PluginControllerProxy::updateLayerHostingContext): * PluginProcess/mac/PluginProcessShim.mm: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * Shared/ChildProcess.h: * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::getPluginInfoFromPropertyLists): (WebKit::NetscapePluginModule::getPluginInfo): (WebKit::contentsOfPropertyListAtURL): Deleted. (WebKit::getMIMETypesFromPluginBundle): Deleted. * Shared/Plugins/PluginProcessCreationParameters.cpp: (WebKit::PluginProcessCreationParameters::encode): (WebKit::PluginProcessCreationParameters::decode): * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::setSharedHTTPCookieStorage): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): (fixUpBotchedPageUIClient): Deleted. * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::didFinishLaunching): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateLayer): (WebKit::WebViewImpl::startWindowDrag): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted. * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::didFinishLaunching): * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformInitializePluginProcess): (WebKit::PluginProcessProxy::createPropertyListFile): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setTopContentInset): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::rootViewToWindow): (WebKit::PageClientImpl::startWindowDrag): * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createFrontendWindow): (WebKit::WebInspectorProxy::platformStartWindowDrag): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Removed. * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::addAnimationToLayer): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): (WebKit::TiledCoreAnimationDrawingArea::updateGeometry): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/com.apple.WebProcess.sb.in: 2017-07-01 Chris Dumez Replace ResourceLoadStatisticsStore C API with Cocoa SPI https://bugs.webkit.org/show_bug.cgi?id=174060 Reviewed by Brent Fulgham. Replace ResourceLoadStatisticsStore C API by Cocoa SPI. The new Cocoa SPI is on WKWebsiteDataStore, which allows us to get rid of the WebResourceLoadStatisticsManager singleton as the SPI can now interact directly with the WebResourceLoadStatisticsStore. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Removed. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: Removed. Drop old C API. * UIProcess/WebResourceLoadStatisticsManager.cpp: Removed. * UIProcess/WebResourceLoadStatisticsManager.h: Removed. Drop WebResourceLoadStatisticsManager singleton which was only required by the C API. This is because the C API was global, rather than working on a specific store. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Add new Cocoa SPI on WKWebsiteDataStore. This is only used for testing. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Stop registering the store with the WebResourceLoadStatisticsManager singleton, as this singleton is gone. * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resourceLoadStatistics): Add new getter to retrieve the WebResourceLoadStatisticsStore from the WebsiteDataStore. This is needed by the new Cocoa SPI. * WebKit2.xcodeproj/project.pbxproj: Drop some files. 2017-06-30 Megan Gardner Unreviewed mac build fix. * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: 2017-06-30 Megan Gardner Add API to get WKActivatedElementInfo https://bugs.webkit.org/show_bug.cgi?id=174001 Adding a way to get a WKActivatedElementInfo for a point on a WKWebView. Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView requestActivatedElementAtPosition:completionBlock:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: (+[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]): (-[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]): * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: 2017-06-30 Tim Horton Use API instead of SPI for content inset adjustment behavior https://bugs.webkit.org/show_bug.cgi?id=174050 Reviewed by Sam Weinig. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollView initWithFrame:]): (-[WKScrollView setContentInsetAdjustmentBehavior:]): (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]): (-[WKScrollView _setContentInsetAdjustmentBehavior:]): Deleted. Switch over to the API. The old SPI calls the API internally, so our override will now cover all callers. 2017-06-30 Chris Dumez Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174038 Reviewed by Brent Fulgham. Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore. WebResourceLoadStatisticsManager is now essentially a proxy to the WebResourceLoadStatisticsStore to support the current C API. In a follow-up, I plan to to replace the C API with a Cocoa SPI which works on a WebResourceLoadStatisticsStore directly instead of requiring a WebResourceLoadStatisticsManager singleton. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetMinimumTimeBetweenDataRecordsRemoval): (WKResourceLoadStatisticsManagerResetToConsistentState): * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Removed. * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded): * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::WebResourceLoadStatisticsManager): (WebKit::WebResourceLoadStatisticsManager::~WebResourceLoadStatisticsManager): (WebKit::WebResourceLoadStatisticsManager::setStatisticsStore): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): (WebKit::WebResourceLoadStatisticsManager::logUserInteraction): (WebKit::WebResourceLoadStatisticsManager::clearUserInteraction): (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::primaryDomain): (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler): (WebKit::WebResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): * WebKit2.xcodeproj/project.pbxproj: 2017-06-30 John Wilander [WK2] Resource load statistics code is spamming the WebProcess with a test-only message https://bugs.webkit.org/show_bug.cgi?id=174048 Reviewed by Brent Fulgham. Fix the telemetry data message send so that it is not generated during normal operations. This is only meant to be used by WebKitTestRunner. * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): 2017-06-30 Daniel Bates Attempt to fix the WPE build following (https://bugs.webkit.org/show_bug.cgi?id=165160) Update the prototype of UIClient::createNewPage() to take a API::FrameInfo& instead of a WebFrameProxy* and a const WebCore::SecurityOriginData&. * UIProcess/API/glib/WebKitUIClient.cpp: 2017-06-30 Alex Christensen Stop soft linking with CFNetwork https://bugs.webkit.org/show_bug.cgi?id=174029 Reviewed by Jer Noble. * Shared/mac/CookieStorageShim.mm: 2017-06-30 Daniel Bates API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo https://bugs.webkit.org/show_bug.cgi?id=165160 Reviewed by Brady Eidson. Expose a property on WKFrameInfo to retrieve the WKWebView of the web page that contains the frame. This will allow an embedding client to know the web view that initiated the navigation request as well as differentiate between a navigation initiated by web content from one initiated via API. The majority of this change is passing the document D that initiated the targeted navigation or called window.open() through the loading machinery to the FrameLoaderClient. The changes to pass this information to the FrameLoaderClient when creating a new window are straightforward. For targeted navigation, the WebKit2 FrameLoaderClient implementation now computes the info for the originating frame regardless of the navigation type (NavigationAction::type()). (Currently we only compute the originating frame for hyperlink activated navigations, form submissions, and form resubmissions). The WebProcess computes the page ID of the page that contains the originating frame and sends that to the UIProcess so that it can create an API::FrameInfo for the originating frame and associate the page that contains the frame, if the navigation was triggered by web content. If the navigation was triggered by API (e.g. -[WKWebView goBack]) then the created API::FrameInfo does not have an associated page so that an embedding client can distinguish between a navigation initiated by web content from a navigation that it initiated via API depending on whether API::FrameInfo::page() is nullptr. We expose property webView on the Mac and iOS API class WKFrameInfo to return the WKWebView corresponding to API::FrameInfo::page(). A small change that this patch makes is to have the WebProcess compute the originating frame info (call WebFrame::info()) and send it over to the UIProcess as opposed to sending the frame ID of the originating frame and having the UIProcess compute the frame info from it. We do this because the UIProcess may not be able to compute the frame info for the originating frame if the window that it was contained in was closed between the time the WebProcess sent the frame ID to the UIProcess and the UIProcess received it. * UIProcess/API/APIFrameInfo.cpp: (API::FrameInfo::create): (API::FrameInfo::FrameInfo): (API::FrameInfo::clearPage): * UIProcess/API/APIFrameInfo.h: * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): (API::UIClient::createNewPageAsync): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKFrameInfo.mm: (-[WKFrameInfo description]): (-[WKFrameInfo webView]): * UIProcess/API/Cocoa/WKUserContentController.mm: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageAsync): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): 2017-06-29 Jer Noble Make Legacy EME API controlled by RuntimeEnabled setting. https://bugs.webkit.org/show_bug.cgi?id=173994 Reviewed by Sam Weinig. Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both able to control WebCore's new RuntimeEnabledFeature setting for the Legacy EME API. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetLegacyEncryptedMediaAPIEnabled): (WKPreferencesSetLegacyEncryptedMediaAPIEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _setLegacyEncryptedMediaAPIEnabled:]): (-[WKWebViewConfiguration _legacyEncryptedMediaAPIEnabled]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-30 Jer Noble REGRESSION (r218757): Touch Bar's media scrubber timeline runs from 00:00 to 00:00 and has no playhead https://bugs.webkit.org/show_bug.cgi?id=174032 Reviewed by Eric Carlson. Fix a copypasta error where durationChange notifications were changing the value of muted. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionManagerProxy::durationChanged): 2017-06-30 Chris Dumez Move ResourceLoadStatisticsStore to WebKit2/UIProcess https://bugs.webkit.org/show_bug.cgi?id=174033 Reviewed by Brent Fulgham. Move ResourceLoadStatisticsStore to WebKit2/UIProcess since it is only used in the WebKit2 UIProcess. * CMakeLists.txt: * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Renamed from Source/WebCore/loader/ResourceLoadStatisticsStore.cpp. (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): (WebKit::ResourceLoadStatisticsStore::clearInMemory): (WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): (WebKit::ResourceLoadStatisticsStore::mergeStatistics): (WebKit::ResourceLoadStatisticsStore::fireDataModificationHandler): (WebKit::ResourceLoadStatisticsStore::fireTelemetryHandler): (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): (WebKit::ResourceLoadStatisticsStore::processStatistics): (WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry): (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): (WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved): (WebKit::ResourceLoadStatisticsStore::statisticsLock): * UIProcess/Storage/ResourceLoadStatisticsStore.h: Renamed from Source/WebCore/loader/ResourceLoadStatisticsStore.h. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::primaryDomain): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: * UIProcess/WebResourceLoadStatisticsTelemetry.h: * WebKit2.xcodeproj/project.pbxproj: 2017-06-30 Ryosuke Niwa Ran sort-Xcode-project-file. * WebKit2.xcodeproj/project.pbxproj: 2017-06-30 Chris Dumez ResourceLoadObserver does not need a ResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174013 Reviewed by Brent Fulgham. ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs. ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess in a follow-up. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::statisticsChangedTimerFired): * WebProcess/WebProcess.h: 2017-06-30 Brent Fulgham [WK2][iOS][macOS] Update XPC services process launch dictionary https://bugs.webkit.org/show_bug.cgi?id=173995 Reviewed by Alex Christensen. Update the WebProcess and Plugin Process XPC launch dictionaries to activate improved ALSR features when launching. * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: 2017-06-30 Chris Dumez Merge WebResourceLoadStatisticsManager and WebResourceLoadObserver https://bugs.webkit.org/show_bug.cgi?id=174008 Reviewed by Brent Fulgham. Merge WebResourceLoadStatisticsManager and WebResourceLoadObserver. One was basically a proxy to the other. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetPrevalentResource): (WKResourceLoadStatisticsManagerIsPrevalentResource): (WKResourceLoadStatisticsManagerSetHasHadUserInteraction): (WKResourceLoadStatisticsManagerIsHasHadUserInteraction): (WKResourceLoadStatisticsManagerSetGrandfathered): (WKResourceLoadStatisticsManagerIsGrandfathered): (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin): (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin): (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo): (WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction): (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree): (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetGrandfatheringTime): (WKResourceLoadStatisticsManagerFireDataModificationHandler): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain): (WKResourceLoadStatisticsManagerFireTelemetryHandler): (WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned): (WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetNotifyPagesWhenTelemetryWasCaptured): (WKResourceLoadStatisticsManagerSetShouldSubmitTelemetry): (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore): (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours): (WKResourceLoadStatisticsManagerResetToConsistentState): * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): * UIProcess/WebResourceLoadObserver.cpp: Removed. * UIProcess/WebResourceLoadObserver.h: Removed. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::primaryDomain): (WebKit::WebResourceLoadStatisticsManager::shared): (WebKit::WebResourceLoadStatisticsManager::setStatisticsStore): (WebKit::WebResourceLoadStatisticsManager::setStatisticsQueue): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): (WebKit::WebResourceLoadStatisticsManager::logUserInteraction): (WebKit::WebResourceLoadStatisticsManager::clearUserInteraction): (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): * WebKit2.xcodeproj/project.pbxproj: 2017-06-30 Wenson Hsieh [iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes https://bugs.webkit.org/show_bug.cgi?id=174017 Reviewed by Simon Fraser. Send the drag caret rect in root view coordinates over to the UI process. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _dragCaretRect]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add basic test plumbing to fetch the current drag caret rect. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-06-30 Youenn Fablet Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration https://bugs.webkit.org/show_bug.cgi?id=169389 Reviewed by Alex Christensen. * fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt: 2017-06-29 Ryosuke Niwa Assert that callback ID is not 0 or -1 during encoding and decoding https://bugs.webkit.org/show_bug.cgi?id=173803 Reviewed by Brady Eidson. To diagnosing the hang inside Safari (), add assertions for the callback ID to be not 0 or -1 during encoding and decoding of IPC messages since the latest analysis seems to indicate the hang is caused by the hash map getting corrupted by the insertion of 0 (empty value). Wrapped the uint64_t in CallbackID and OptionalCallbackID to add assertions. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): * Shared/CallbackID.h: Added. (WebKit::CallbackID::CallbackID): (WebKit::CallbackID::operator==): (WebKit::CallbackID::toInteger): (WebKit::CallbackID::isValid): (WebKit::CallbackID::isValidCallbackID): A callback ID is valid when it's neither 0 nor -1. (WebKit::CallbackID::fromInteger): Create a CallbackID object from potentially unsafe value. (WebKit::CallbackID::generateID): Generates the next callback ID. Moved from CallbackBase. (WebKit::CallbackID::encode): Added. Assert that it's neither 0 nor -1. (WebKit::CallbackID::decode): Ditto. (WTF::CallbackIDHash::hash): (WTF::CallbackIDHash::equal): (WTF::HashTraits::emptyValue): (WTF::HashTraits::constructDeletedValue): (WTF::HashTraits::isDeletedValue): * Shared/OptionalCallbackID.h: Added. Unlike CallbackID, callback ID here can be 0. (WebKit::OptionalCallbackID::OptionalCallbackID): (WebKit::OptionalCallbackID::toInteger): (WebKit::OptionalCallbackID::callbackID): Returns a valid CallbackID object. The caller of this function must have verified that the ID is neither 0 or -1 before calling this function. (WebKit::OptionalCallbackID::operator bool): (WebKit::OptionalCallbackID::isValid): (WebKit::OptionalCallbackID::isValidCallbackID): (WebKit::OptionalCallbackID::encode): Since OptionalCallbackID can be 0, only assert that it's not -1. (WebKit::OptionalCallbackID::decode): Ditto. * Shared/mac/RemoteLayerTreeTransaction.h: * Shared/mac/RemoteLayerTreeTransaction.h: * UIProcess/GenericCallback.h: (WebKit::CallbackBase::callbackID): Returns a CallbackID object instead of uint64_t. (WebKit::CallbackBase::CallbackBase): (WebKit::CallbackBase::generateCallbackID): Deleted. (WebKit::CallbackMap::put): Returns a callback ID. Also added a version that doesn't take activity token as used in WebCookieManagerProxy (WebKit::CallbackMap::take): Takes a callback ID. * UIProcess/WebCookieManagerProxy.cpp: Updated the code as callback maps are merged. (WebKit::WebCookieManagerProxy::processPoolDestroyed): (WebKit::WebCookieManagerProxy::processDidClose): (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): (WebKit::WebCookieManagerProxy::deleteCookie): (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): (WebKit::WebCookieManagerProxy::setCookie): (WebKit::WebCookieManagerProxy::setCookies): (WebKit::WebCookieManagerProxy::getAllCookies): (WebKit::WebCookieManagerProxy::getCookies): (WebKit::WebCookieManagerProxy::didSetCookies): (WebKit::WebCookieManagerProxy::didGetCookies): (WebKit::WebCookieManagerProxy::didDeleteCookies): (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebCookieManagerProxy.messages.in: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setInitialFocus): (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getSamplingProfilerOutput): (WebKit::WebPageProxy::getContentsAsMHTMLData): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::getSelectionAsWebArchiveData): (WebKit::WebPageProxy::getMainResourceDataOfFrame): (WebKit::WebPageProxy::getResourceDataFromFrame): (WebKit::WebPageProxy::getWebArchiveOfFrame): (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::clearLoadDependentCallbacks): (WebKit::WebPageProxy::voidCallback): (WebKit::WebPageProxy::dataCallback): (WebKit::WebPageProxy::imageCallback): (WebKit::WebPageProxy::stringCallback): (WebKit::WebPageProxy::invalidateStringCallback): (WebKit::WebPageProxy::scriptValueCallback): (WebKit::WebPageProxy::computedPagesCallback): (WebKit::WebPageProxy::validateCommandCallback): (WebKit::WebPageProxy::unsignedCallback): (WebKit::WebPageProxy::editingRangeCallback): (WebKit::WebPageProxy::machSendRightCallback): (WebKit::WebPageProxy::rectForCharacterRangeCallback): (WebKit::WebPageProxy::printFinishedCallback): (WebKit::WebPageProxy::computePagesForPrinting): (WebKit::WebPageProxy::drawRectToImage): (WebKit::WebPageProxy::drawPagesToPDF): (WebKit::WebPageProxy::drawPagesForPrinting): (WebKit::WebPageProxy::getMarkedRangeAsync): (WebKit::WebPageProxy::getSelectedRangeAsync): (WebKit::WebPageProxy::characterIndexForPointAsync): (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): (WebKit::WebPageProxy::takeSnapshot): (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler): (WebKit::WebPageProxy::getLoadDecisionForIcon): (WebKit::WebPageProxy::finishedLoadingIcon): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::gestureCallback): (WebKit::WebPageProxy::touchesCallback): (WebKit::WebPageProxy::autocorrectionDataCallback): (WebKit::WebPageProxy::selectionContextCallback): (WebKit::WebPageProxy::autocorrectionContextCallback): (WebKit::WebPageProxy::selectionRectsCallback): (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::updateSelectionWithTouches): (WebKit::WebPageProxy::requestAutocorrectionData): (WebKit::WebPageProxy::applyAutocorrection): (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::selectTextWithGranularityAtPoint): (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection): (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection): (WebKit::WebPageProxy::selectPositionAtPoint): (WebKit::WebPageProxy::beginSelectionInDirection): (WebKit::WebPageProxy::updateSelectionWithExtentPoint): (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPageProxy::requestDictationContext): (WebKit::WebPageProxy::requestAutocorrectionContext): (WebKit::WebPageProxy::getSelectionContext): (WebKit::WebPageProxy::selectWithTwoTouches): (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset): (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText): (WebKit::WebPageProxy::moveSelectionByOffset): (WebKit::WebPageProxy::focusNextAssistedNode): (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF): (WebKit::WebPageProxy::drawToPDFCallback): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): (-[WKPrintingView _askPageToComputePageRects]): (-[WKPrintingView _drawPreview:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): (WebKit::WebPageProxy::attributedStringForCharacterRangeCallback): (WebKit::WebPageProxy::fontAtSelection): (WebKit::WebPageProxy::fontAtSelectionCallback): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::getHostnamesWithCookies): (WebKit::WebCookieManager::deleteCookie): (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): (WebKit::WebCookieManager::getAllCookies): (WebKit::WebCookieManager::getCookies): (WebKit::WebCookieManager::setCookie): (WebKit::WebCookieManager::setCookies): (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Cookies/WebCookieManager.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): (WebKit::WebFrameLoaderClient::finishedLoadingIcon): * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::forceRepaintAsync): (WebKit::AcceleratedDrawingArea::activityStateDidChange): * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): (WebKit::CoordinatedLayerTreeHost::renderNextFrame): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::forceRepaintAsync): (WebKit::DrawingArea::activityStateDidChange): (WebKit::DrawingArea::addTransactionCallbackID): * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/LayerTreeHost.h: (WebKit::LayerTreeHost::forceRepaintAsync): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::takeSnapshot): (WebKit::WebPage::validateCommand): (WebKit::WebPage::setInitialFocus): (WebKit::WebPage::setActivityState): (WebKit::WebPage::runJavaScriptInMainFrame): (WebKit::WebPage::getContentsAsString): (WebKit::WebPage::getContentsAsMHTMLData): (WebKit::WebPage::getRenderTreeExternalRepresentation): (WebKit::WebPage::getSelectionAsWebArchiveData): (WebKit::WebPage::getSelectionOrContentsAsString): (WebKit::WebPage::getSourceForFrame): (WebKit::WebPage::getMainResourceDataOfFrame): (WebKit::WebPage::getResourceDataFromFrame): (WebKit::WebPage::getWebArchiveOfFrame): (WebKit::WebPage::forceRepaint): (WebKit::WebPage::computePagesForPrinting): (WebKit::WebPage::drawRectToImage): (WebKit::WebPage::drawPagesToPDF): (WebKit::WebPage::drawPagesForPrinting): (WebKit::WebPage::didFinishPrintOperation): (WebKit::WebPage::getMarkedRangeAsync): (WebKit::WebPage::getSelectedRangeAsync): (WebKit::WebPage::characterIndexForPointAsync): (WebKit::WebPage::firstRectForCharacterRangeAsync): (WebKit::WebPage::getBytecodeProfile): (WebKit::WebPage::getSamplingProfilerOutput): (WebKit::WebPage::didGetLoadDecisionForIcon): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: (WebKit::WebPrintOperationGtk::WebPrintOperationGtk): * WebProcess/WebPage/gtk/WebPrintOperationGtk.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getSelectionContext): (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::updateSelectionWithTouches): (WebKit::WebPage::selectWithTwoTouches): (WebKit::WebPage::moveSelectionByOffset): (WebKit::WebPage::getRectsForGranularityWithSelectionOffset): (WebKit::WebPage::getRectsAtSelectionOffsetWithText): (WebKit::WebPage::selectPositionAtPoint): (WebKit::WebPage::selectPositionAtBoundaryWithDirection): (WebKit::WebPage::moveSelectionAtBoundaryWithDirection): (WebKit::WebPage::selectTextWithGranularityAtPoint): (WebKit::WebPage::beginSelectionInDirection): (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPage::updateSelectionWithExtentPoint): (WebKit::WebPage::requestDictationContext): (WebKit::WebPage::requestAutocorrectionData): (WebKit::WebPage::applyAutocorrection): (WebKit::WebPage::executeEditCommandWithCallback): (WebKit::WebPage::requestAutocorrectionContext): (WebKit::WebPage::focusNextAssistedNode): (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange): (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync): (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::attributedSubstringForCharacterRangeAsync): (WebKit::WebPage::fontAtSelection): 2017-06-29 Andy Estes [iOS] Don't confuse coordinate spaces when computing the size of PDF snapshots https://bugs.webkit.org/show_bug.cgi?id=173996 Reviewed by Tim Horton. When computing the printing rect for PDF snapshots, we were getting the width the WKContentView's bounds and the height from the WKScrollView's contentSize. These sizes are in different coordinate spaces, leading to incorrect clipping on sites that have a non-1 scale factor. Fix this by using the WKContentView's bounds for both width and height. * UIProcess/ios/WKContentView.mm: (-[WKContentView _wk_pageCountForPrintFormatter:]): 2017-06-29 Matt Lewis Unreviewed, rolling out r218903. This patch and its fix cause immediate flakiness on all WK2 testers Reverted changeset: "Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration" https://bugs.webkit.org/show_bug.cgi?id=169389 http://trac.webkit.org/changeset/218903 2017-06-29 Chris Dumez Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess https://bugs.webkit.org/show_bug.cgi?id=173990 Reviewed by Brent Fulgham. Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess. They really have different API and there is therefore close to no code duplication. * CMakeLists.txt: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): * UIProcess/WebResourceLoadObserver.cpp: Added. (WebKit::primaryDomain): (WebKit::WebResourceLoadObserver::sharedObserver): (WebKit::WebResourceLoadObserver::setStatisticsStore): (WebKit::WebResourceLoadObserver::setStatisticsQueue): (WebKit::WebResourceLoadObserver::clearInMemoryStore): (WebKit::WebResourceLoadObserver::clearInMemoryAndPersistentStore): (WebKit::WebResourceLoadObserver::logUserInteraction): (WebKit::WebResourceLoadObserver::clearUserInteraction): (WebKit::WebResourceLoadObserver::hasHadUserInteraction): (WebKit::WebResourceLoadObserver::setPrevalentResource): (WebKit::WebResourceLoadObserver::isPrevalentResource): (WebKit::WebResourceLoadObserver::clearPrevalentResource): (WebKit::WebResourceLoadObserver::setGrandfathered): (WebKit::WebResourceLoadObserver::isGrandfathered): (WebKit::WebResourceLoadObserver::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadObserver::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadObserver::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadObserver::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadObserver::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadObserver::setGrandfatheringTime): (WebKit::WebResourceLoadObserver::fireDataModificationHandler): (WebKit::WebResourceLoadObserver::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadObserver::fireTelemetryHandler): * UIProcess/WebResourceLoadObserver.h: Added. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::setHasHadUserInteraction): (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain): (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): * WebKit2.xcodeproj/project.pbxproj: 2017-06-29 Sam Weinig [WebIDL] Remove custom binding for UserMessageHandlersNamespace https://bugs.webkit.org/show_bug.cgi?id=173956 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp: (webkit_dom_dom_window_webkit_message_handlers_post_message): Update for name change. 2017-06-29 John Wilander Fix for intermittent Layout Test fail http/tests/loading/resourceLoadStatistics/telemetry-generation.html https://bugs.webkit.org/show_bug.cgi?id=173940 Reviewed by Brent Fulgham. This change allows the TestController to turn off regular resource load statistics telemetry submission and to manually control when telemetry is calculated and submitted. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetShouldSubmitTelemetry): New test infrastructure. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setShouldSubmitTelemetry): New test infrastructure. * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry): New test infrastructure. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): The test function now calls WebResourceLoadStatisticsStore::submitTelemetry() directly instead of firing the timer. (WebKit::WebResourceLoadStatisticsStore::telemetryTimerFired): Now checks whether it should submit telemetry or not. (WebKit::WebResourceLoadStatisticsStore::submitTelemetry): Split out so that the test code doesn't have to fire the timer. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): Now doesn't submit if it's executed by test code. 2017-06-29 Chris Dumez Slight clean up of WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=173976 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::dataTypesToRemove): (WebKit::WebResourceLoadStatisticsStore::classifyResource): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): (WebKit::initializeDataTypesToRemove): Deleted. * UIProcess/WebResourceLoadStatisticsStore.h: (WebKit::WebResourceLoadStatisticsStore::coreStore): Deleted. 2017-06-29 Alex Christensen WKContentRuleLists with if-top-url or unless-top-url should run regex against entire top URL https://bugs.webkit.org/show_bug.cgi?id=173980 Reviewed by Tim Horton. if-top-url and unless-top-url were broken inside WebKit2 apps. This fixes them and adds a test. ContentExtension::populateConditionCacheIfNeeded was calling WebCompiledContentRuleList::conditionsApplyOnlyToDomain but m_data.conditionsApplyOnlyToDomainOffset was always 0 instead of ConditionsApplyOnlyToDomainOffset because it wasn't being encoded and decoded when telling the WebProcess about the content rule list. This was causing us to use whatever was at offset 0 in the file instead of the correct value stored in the file to determine whether to run regular expressions against the entire top URL for if-top-url or unless-top-url or against just the domain for if-top-domain or unless-top-domain. Luckily, offset 0 in the file is always ContentRuleListStore::CurrentContentRuleListFileVersion, so it was deterministic and easy to debug. I should have added a LayoutTest with r213669 to verify correct behavior in an actual WKWebView, but I didn't because it wouldn't have caught regressions since the contentextension tests are marked as flaky since r206914, but once that is fixed the new test http/tests/contentextensions/top-url.html will verify that this feature is behaving correctly. It failed before this change and passes after. * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::encode): (WebKit::WebCompiledContentRuleListData::decode): 2017-06-29 Chris Dumez statistics.mostRecentUserInteraction should be of type WallTime https://bugs.webkit.org/show_bug.cgi?id=173974 Reviewed by Brent Fulgham. statistics.mostRecentUserInteraction should be of type WallTime for clarity. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-06-29 Wenson Hsieh Replace staging-prefixed UIKit drag and drop delegate methods with their public SDK versions https://bugs.webkit.org/show_bug.cgi?id=173959 Reviewed by Sam Weinig. Remove references to _api_-prefixed UIDragInteractionDelegate and UIDropInteractionDelegate methods, and replace them with their counterparts in the public SDK. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dragInteraction:previewForLiftingItem:session:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]): (-[WKContentView dropInteraction:sessionDidEnter:]): (-[WKContentView dropInteraction:sessionDidUpdate:]): (-[WKContentView _simulateDataInteractionEntered:]): (-[WKContentView _simulateDataInteractionUpdated:]): (-[WKContentView _simulateDataInteractionSessionDidEnd:]): (-[WKContentView _api_dragInteraction:previewForLiftingItem:session:]): Deleted. (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): Deleted. (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]): Deleted. (-[WKContentView _api_dropInteraction:sessionDidEnter:]): Deleted. (-[WKContentView _api_dropInteraction:sessionDidUpdate:]): Deleted. 2017-06-29 Carlos Garcia Campos Unreviewed. Fix GTK+ unit tests crashing after r218922. We need to check if icon database exists and is open now on dispose and API entry points. * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (webkitFaviconDatabaseDispose): (webkit_favicon_database_get_favicon_uri): (webkit_favicon_database_clear): 2017-06-29 Carlos Garcia Campos [GTK][WPE] Implement API::IconLoadingClient and rework WebKitFaviconDatabase to use IconDatabase directly https://bugs.webkit.org/show_bug.cgi?id=173877 Reviewed by Brady Eidson. This way IconDatabase and its related classes can be removed from WebCore, as well as the WebKit2 implementation and C API. For now I've copied IconDatabase from WebCore to WebKit2 under the glib API directory, adding the related classes as private inside IconDatabase, and removing some methods that are not used by the GLib API. * PlatformGTK.cmake: * UIProcess/API/glib/IconDatabase.cpp: Added. (WebKit::urlForLogging): (WebKit::defaultClient): (WebKit::IconDatabase::IconRecord::IconRecord): (WebKit::IconDatabase::IconRecord::~IconRecord): (WebKit::IconDatabase::IconRecord::image): (WebKit::IconDatabase::IconRecord::setImageData): (WebKit::IconDatabase::IconRecord::loadImageFromResource): (WebKit::IconDatabase::IconRecord::imageDataStatus): (WebKit::IconDatabase::IconRecord::snapshot): (WebKit::IconDatabase::PageURLRecord::PageURLRecord): (WebKit::IconDatabase::PageURLRecord::~PageURLRecord): (WebKit::IconDatabase::PageURLRecord::setIconRecord): (WebKit::IconDatabase::PageURLRecord::snapshot): (WebKit::IconDatabase::setClient): (WebKit::IconDatabase::open): (WebKit::IconDatabase::close): (WebKit::IconDatabase::removeAllIcons): (WebKit::documentCanHaveIcon): (WebKit::IconDatabase::synchronousIconForPageURL): (WebKit::IconDatabase::synchronousIconURLForPageURL): (WebKit::IconDatabase::retainIconForPageURL): (WebKit::IconDatabase::performRetainIconForPageURL): (WebKit::IconDatabase::releaseIconForPageURL): (WebKit::IconDatabase::performReleaseIconForPageURL): (WebKit::IconDatabase::setIconDataForIconURL): (WebKit::IconDatabase::setIconURLForPageURL): (WebKit::IconDatabase::synchronousLoadDecisionForIconURL): (WebKit::IconDatabase::synchronousIconDataKnownForIconURL): (WebKit::IconDatabase::setEnabled): (WebKit::IconDatabase::isEnabled): (WebKit::IconDatabase::setPrivateBrowsingEnabled): (WebKit::IconDatabase::isPrivateBrowsingEnabled): (WebKit::IconDatabase::delayDatabaseCleanup): (WebKit::IconDatabase::allowDatabaseCleanup): (WebKit::IconDatabase::checkIntegrityBeforeOpening): (WebKit::IconDatabase::IconDatabase): (WebKit::IconDatabase::~IconDatabase): (WebKit::IconDatabase::wakeSyncThread): (WebKit::IconDatabase::scheduleOrDeferSyncTimer): (WebKit::IconDatabase::syncTimerFired): (WebKit::IconDatabase::isOpen): (WebKit::IconDatabase::isOpenBesidesMainThreadCallbacks): (WebKit::IconDatabase::databasePath): (WebKit::IconDatabase::defaultDatabaseFilename): (WebKit::IconDatabase::getOrCreateIconRecord): (WebKit::IconDatabase::getOrCreatePageURLRecord): (WebKit::IconDatabase::shouldStopThreadActivity): (WebKit::IconDatabase::iconDatabaseSyncThread): (WebKit::databaseVersionNumber): (WebKit::isValidDatabase): (WebKit::createDatabaseTables): (WebKit::IconDatabase::performOpenInitialization): (WebKit::IconDatabase::checkIntegrity): (WebKit::IconDatabase::performURLImport): (WebKit::IconDatabase::syncThreadMainLoop): (WebKit::IconDatabase::performPendingRetainAndReleaseOperations): (WebKit::IconDatabase::readFromDatabase): (WebKit::IconDatabase::writeToDatabase): (WebKit::IconDatabase::pruneUnretainedIcons): (WebKit::IconDatabase::checkForDanglingPageURLs): (WebKit::IconDatabase::removeAllIconsOnThread): (WebKit::IconDatabase::deleteAllPreparedStatements): (WebKit::IconDatabase::cleanupSyncThread): (WebKit::readySQLiteStatement): (WebKit::IconDatabase::setIconURLForPageURLInSQLDatabase): (WebKit::IconDatabase::setIconIDForPageURLInSQLDatabase): (WebKit::IconDatabase::removePageURLFromSQLDatabase): (WebKit::IconDatabase::getIconIDForIconURLFromSQLDatabase): (WebKit::IconDatabase::addIconURLToSQLDatabase): (WebKit::IconDatabase::getImageDataForIconURLFromSQLDatabase): (WebKit::IconDatabase::removeIconFromSQLDatabase): (WebKit::IconDatabase::writeIconSnapshotToSQLDatabase): (WebKit::IconDatabase::checkClosedAfterMainThreadCallback): (WebKit::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread): (WebKit::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread): (WebKit::IconDatabase::dispatchDidRemoveAllIconsOnMainThread): (WebKit::IconDatabase::dispatchDidFinishURLImportOnMainThread): * UIProcess/API/glib/IconDatabase.h: Added. (WebKit::IconDatabaseClient::didImportIconURLForPageURL): (WebKit::IconDatabaseClient::didImportIconDataForPageURL): (WebKit::IconDatabaseClient::didChangeIconForPageURL): (WebKit::IconDatabaseClient::didRemoveAllIcons): (WebKit::IconDatabaseClient::didFinishURLImport): (WebKit::IconDatabaseClient::didClose): (WebKit::IconDatabase::IconSnapshot::IconSnapshot): (WebKit::IconDatabase::IconSnapshot::iconURL): (WebKit::IconDatabase::IconSnapshot::timestamp): (WebKit::IconDatabase::IconSnapshot::data): (WebKit::IconDatabase::IconRecord::create): (WebKit::IconDatabase::IconRecord::getTimestamp): (WebKit::IconDatabase::IconRecord::setTimestamp): (WebKit::IconDatabase::IconRecord::iconURL): (WebKit::IconDatabase::IconRecord::retainingPageURLs): (WebKit::IconDatabase::PageURLSnapshot::PageURLSnapshot): (WebKit::IconDatabase::PageURLSnapshot::pageURL): (WebKit::IconDatabase::PageURLSnapshot::iconURL): (WebKit::IconDatabase::PageURLRecord::url): (WebKit::IconDatabase::PageURLRecord::iconRecord): (WebKit::IconDatabase::PageURLRecord::retain): (WebKit::IconDatabase::PageURLRecord::release): (WebKit::IconDatabase::PageURLRecord::retainCount): * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate): (getIconSurfaceSynchronously): (webkitFaviconDatabaseSetIconURLForPageURL): (webkitFaviconDatabaseCreate): (webkitFaviconDatabaseOpen): (webkitFaviconDatabaseIsOpen): (webkitFaviconDatabaseSetPrivateBrowsingEnabled): (webkitFaviconDatabaseGetLoadDecisionForIcon): (webkitFaviconDatabaseSetIconForPageURL): (webkit_favicon_database_get_favicon): (webkit_favicon_database_get_favicon_uri): * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: * UIProcess/API/glib/WebKitIconLoadingClient.cpp: Added. (IconLoadingClient::IconLoadingClient): (attachIconLoadingClientToView): * UIProcess/API/glib/WebKitIconLoadingClient.h: Copied from Source/WebKit2/UIProcess/API/glib/WebKitFaviconDatabasePrivate.h. * UIProcess/API/glib/WebKitWebContext.cpp: (ensureFaviconDatabase): (webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded): (webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded): (webkit_web_context_set_favicon_database_directory): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewGetLoadDecisionForIcon): (webkitWebViewSetIcon): * UIProcess/API/glib/WebKitWebViewPrivate.h: 2017-06-28 Tim Horton MobileSafari was constantly using 10-15% CPU viewing a PDF https://bugs.webkit.org/show_bug.cgi?id=173944 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _doAfterNextStablePresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): Bail early and just dispatch_async the completion block if we are using a custom content view; these methods are very specific to the implementation of WKContentView and don't make sense with custom content views. doAfterNextStablePresentationUpdate is particularly egregious because, since we will never call the stable update callbacks (because we bail from didCommitLayerTree if we aren't using WKContentView), it will keep calling doAfterNextPresentationUpdate over and over again. 2017-06-28 Brent Fulgham [WK2][macOS][iOS] Don't request microphone access for clients that don't need it. https://bugs.webkit.org/show_bug.cgi?id=173948 Reviewed by Eric Carlson. Don't bother requesting a sandbox extension to access the microphone for any clients on the Cocoa platform that are not Safari. Other clients don't have the necessary system entitlements, and always fail leading to annoying SandboxViolation reports. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): 2017-06-29 Zalan Bujtas Move RenderEmbeddedObject::isReplacementObscured to HTMLPlugInElement https://bugs.webkit.org/show_bug.cgi?id=173802 Reviewed by Simon Fraser. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): 2017-06-28 Ryosuke Niwa REGRESSION (r218842): com.apple.WebKit crash in WebKit::ProcessLauncher::launchProcess https://bugs.webkit.org/show_bug.cgi?id=173950 Reviewed by Chris Dumez. Added a null check as m_xpcConnection could be nullptr here in the case platformInvalidate had been called. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): 2017-06-28 Youenn Fablet Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration https://bugs.webkit.org/show_bug.cgi?id=169389 Reviewed by Alex Christensen. Updating according new WebCore LIbWebRTCProvider API. * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::LibWebRTCProvider::createPeerConnection): * WebProcess/Network/webrtc/LibWebRTCProvider.h: 2017-06-28 Chris Dumez [iOS] Allow WKWebView clients to play audio in the background https://bugs.webkit.org/show_bug.cgi?id=173932 Reviewed by Ryosuke Niwa. Allow WKWebView clients (such as MobileSafari) to play audio in the background by taking a process assertion whenever a WebPage is audible. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateThrottleState): 2017-06-28 Brent Fulgham Teach ResourceLoadStatistics to recognize changes in the file system https://bugs.webkit.org/show_bug.cgi?id=173800 Reviewed by Chris Dumez. We want to support the case where multiple UI processes choose to share the same statistics file. To support this, update the ResourceLoadStatistics logic to be aware that the statistics data file might change underneath it, and to take appropriate action when it does. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): When we enable the statistics, read in the data and then watch for changes. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Add a 'delete data' handler to remove the file on disk, not just write an empty store. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Use ASCIILiteral. (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): Convenience function. (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Sync with any on-disk storage before writing out. (WebKit::openAndLockFile): Convenience function. (WebKit::closeAndUnlockFile): Ditto. (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Revise to lock file (on platforms that support it) before writing to disk. (WebKit::WebResourceLoadStatisticsStore::deleteStoreFromDisk): Added convenience function. (WebKit::WebResourceLoadStatisticsStore::clearInMemoryData): Ditto. (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): Create a file system monitor to watch for file changes. (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): Added convenience function. (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): Revise to read data directly so we can control file locking. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-06-28 Wenson Hsieh Followup to r218885: adjust for further UIKit SPI changes https://bugs.webkit.org/show_bug.cgi?id=173927 Reviewed by Tim Horton. On ToT, UIKit now invokes -_dragInteraction:item:shouldDelaySetDownAnimationWithCompletion: before the completion block of -dragInteraction:willAnimateLiftWithAnimator:session: is called. This means we now need to store the completion block in -shouldDelaySetDownAnimationWithCompletion: and wait until the UIDragAnimating completion block in -willAnimateCancelWithAnimator: before invoking it. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanUpDragSourceSessionState]): Ensure that the set-down completion block is invoked when a drag session ends (e.g., if the web content process crashes). (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]): (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]): 2017-06-28 Wenson Hsieh dropInteraction:sessionDidEnd: invokes dragEnded with a UIDragOperation rather than a WebCore::DragOperation https://bugs.webkit.org/show_bug.cgi?id=173935 Reviewed by Tim Horton. Replaces a use of UIDragOperationNone with DragOperationNone. Currently, there is no change in behavior since these are currently the same value (0). * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dropInteraction:sessionDidEnd:]): 2017-06-28 Alex Christensen WebsitePolicies given with navigation policy for redirects should apply to the provisional document https://bugs.webkit.org/show_bug.cgi?id=173886 Reviewed by Andy Estes. If, for example, we deny video autoplay for the initial request but allow it for the redirect destination location, the document should allow video autoplay. We were putting these settings onto the wrong DocumentLoader. When a navigation policy is given to a response of a redirect location, we currently have the DocumentLoader for the loading document in the FrameLoader's provisionalDocumentLoader, not the documentLoader. Covered by a new API test. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2017-06-28 Konstantin Tokarev [cmake] Improve configuration tests for librt and libatomic https://bugs.webkit.org/show_bug.cgi?id=173921 Reviewed by Michael Catanzaro. 1. Both tests are converted to use specialized CMake modules 2. Both libraries are now linked only if they are really needed and usable by compiler 3. librt is no more required to be detected by find_library(), which may fail in case of cross-compilation 4. libatomic test moved to port-independent CMakeLists.txt * CMakeLists.txt: * PlatformGTK.cmake: 2017-06-28 Alex Christensen Fix CMake build. * PlatformMac.cmake: 2017-06-28 Wenson Hsieh [iOS DnD] [WK2] Dragged content flashes after the preview sets down when cancelling a drag https://bugs.webkit.org/show_bug.cgi?id=173927 Reviewed by Tim Horton. When a drag is cancelled, UIKit normally animates fly-back and set-down animations back-to-back. However, for WebKit2, we need to call out to the web process in order to trigger a repaint of the dragged content at normal opacity when the drag cancel animation completes. Thus, we can hook into UIKit SPI to split the cancellation animation into two discrete phases: the fly-back and the set-down (the latter of which may be deferred using a completion block). To do this, we implement a new SPI hook, _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:, to indicate that the set-down should be deferred, and call the completion block after the next layer tree commit. Since -shouldDelaySetDownAnimationWithCompletion: is invoked after the UIDragAnimating completion block in -willAnimateCancelWithAnimator:, this layer tree commit is guaranteed to come after we've told the web process to repaint at full opacity. This patch also accounts for additional changes in UIKit. Once -shouldDelaySetDownAnimationWithCompletion: becomes available, -sessionDidEnd: will no longer be invoked after a cancelled drag lift if the user did not begin moving. This means that our cleanup logic in -sessionDidEnd: will no longer be executed in this case, leaving the view with an inconsistent dragging state. To fix this, we need to implement -dragInteraction:willAnimateLiftWithAnimator:session: to perform drag session cleanup following a cancelled drag lift, for which the drag animator's final position will be UIViewAnimatingPositionStart. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]): 2017-06-28 Chris Dumez Avoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() https://bugs.webkit.org/show_bug.cgi?id=173904 Reviewed by Brent Fulgham. Avoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). It calls fetchData() which dispatches to the main queue, then fetchDataForTopPrivatelyControlledDomains() dispatches to the background queue. It should be possible to get fetchData() to dispatch directly on the right queue. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-06-27 Chris Dumez [ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute https://bugs.webkit.org/show_bug.cgi?id=173895 Reviewed by Brent Fulgham. Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute to save battery. Also port code to modern time types. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction): (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree): (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetGrandfatheringTime): * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.h: 2017-06-27 Chris Dumez Port HysteresisActivity to Seconds type https://bugs.webkit.org/show_bug.cgi?id=173902 Reviewed by Simon Fraser. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_pageScrolledHysteresis): 2017-06-27 Chris Dumez Move WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() https://bugs.webkit.org/show_bug.cgi?id=173882 Reviewed by Darin Adler. Move WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() as we have data showing it is slow and hangs the UIProcess' main thread. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): 2017-06-27 Brent Fulgham [WK2][macOS] Expand sandbox to allow access to the CoreMedia volume control endpoint https://bugs.webkit.org/show_bug.cgi?id=173898 Reviewed by Ryosuke Niwa. * WebProcess/com.apple.WebProcess.sb.in: 2017-06-27 Wenson Hsieh [iOS DnD] Support dragging out of contenteditable areas without a prior selection https://bugs.webkit.org/show_bug.cgi?id=173854 Reviewed by Ryosuke Niwa and Tim Horton. Instead of allowing a drag to occur only if a position information request discovers a clickable node, remove the position information request entirely and just call into WebCore to try and begin the drag. Currently, the position information request serves two purposes: 1. To adjust the hit-test location to account for nearby clickable nodes. 2. To obtain information about the content being dragged. The first requirement is fulfilled by performing the drag location adjustment in WebCore instead (see ChangeLogs for more detail). The second requirement is fulfilled by refactoring in https://bugs.webkit.org/show_bug.cgi?id=173832 to fold all information relevant to starting a drag into the DragItem struct, and then propagating the DragItem struct. The relevant information from the position information update is now populated when the UI process receives the drag start response. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDrag:item:]): (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView _api_dropInteraction:sessionDidEnter:]): (-[WKContentView _api_dropInteraction:sessionDidUpdate:]): (positionInformationMayStartDataInteraction): Deleted. 2017-06-27 Chris Dumez [iOS] Avoid taking / releasing process assertions too quickly due to database activity https://bugs.webkit.org/show_bug.cgi?id=173879 Reviewed by Antti Koivisto. Specify an activity name when taking the process assertion to facilitate debugging in the future. It took me a while to figure out this assertion was the one that was too aggressive because it was anonymous. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setUpSQLiteDatabaseTrackerClient]): 2017-06-27 Don Olmstead [PAL] Add symbol export macros for PAL https://bugs.webkit.org/show_bug.cgi?id=171519 Reviewed by Konstantin Tokarev. * config.h: 2017-06-27 Ryosuke Niwa ProcessLauncherMac could leak a xpc connection when the process had failed to launch https://bugs.webkit.org/show_bug.cgi?id=173865 Reviewed by Antti Koivisto. Explicitly cancel the XPC connection even When the process launch had failed to avoid a leak. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): 2017-06-27 John Wilander Resource Load Statistics: Add telemetry https://bugs.webkit.org/show_bug.cgi?id=173499 Reviewed by Brent Fulgham. * PlatformGTK.cmake: Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp * PlatformMac.cmake: Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp * PlatformWPE.cmake: Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerFireTelemetryHandler): (WKResourceLoadStatisticsManagerSetNotifyPagesWhenTelemetryWasCaptured): Test infrastructure. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::notifyPageStatisticsTelemetryFinished): Test infrastructure. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler): (WebKit::WebResourceLoadStatisticsManager::setNotifyPagesWhenTelemetryWasCaptured): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Test infrastructure. * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Configures a timer for telemetry capture. Fires 5 seconds after launch and then every 24 hours. (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::telemetryTimerFired): Calls WebResourceLoadStatisticsTelemetry::calculateAndSubmit(). * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: Added. (WebKit::numberOfResourcesWithUserInteraction): (WebKit::median): (WebKit::nonEphemeralWebPageProxy): (WebKit::submitTopList): (WebKit::submitTopLists): (WebKit::notifyPages): (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): (WebKit::WebResourceLoadStatisticsTelemetry::setNotifyPagesWhenTelemetryWasCaptured): * UIProcess/WebResourceLoadStatisticsTelemetry.h: Added. * WebKit2.xcodeproj/project.pbxproj: 2017-06-27 Ting-Wei Lan Add missing includes to fix compilation error on FreeBSD https://bugs.webkit.org/show_bug.cgi?id=172919 Reviewed by Mark Lam. * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/C/WKPagePrivate.h: * UIProcess/ProcessAssertion.h: 2017-06-27 Wenson Hsieh Refactor drag start codepaths to plumb a DragItem to client layers https://bugs.webkit.org/show_bug.cgi?id=173832 Work towards Reviewed by Ryosuke Niwa and Tim Horton. Add support for serializing a DragItem over IPC. This encodes and decodes all members of DragItem except for the PasteboardWriterData and the DragImage's image. The DragItem is sent over to the UI process in WebDragClient::startDrag via the WebPageProxy::startDrag IPC message (renamed from WebPageProxy::setDragImage) which now takes a DragItem. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::setDragImage): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Rename SetDragImage to StartDrag and refactor to receive only a DragItem and shareable bitmap handle. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startDrag): (WebKit::PageClientImpl::startDataInteractionWithImage): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDrag:item:]): (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]): Deleted. Rename startDataInteractionWithImage to startDrag. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::setDragImage): Deleted. * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::startDrag): * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::WebDragClient::startDrag): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::startDrag): 2017-06-27 Wenson Hsieh [iOS DnD] [WK2] WKWebView does not handle drag sessions that exit and re-enter https://bugs.webkit.org/show_bug.cgi?id=173856 Reviewed by Ryosuke Niwa. Upon exiting a WKContentView, the dropSession tracked by _dataInteractionState is not cleared out. If the drag session re-enters the WKWebView, a _different_ UIDropSession is sent to the drop delegate, causing us to bail from handling the session altogether in -dropInteraction:canHandleSession:. To fix this, we need to clear out the dropSession when the drag session exits the view. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dropInteraction:sessionDidExit:]): 2017-06-26 Chris Dumez WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient https://bugs.webkit.org/show_bug.cgi?id=173850 Reviewed by Ryosuke Niwa. Update WebsiteDataRecord::matchesTopPrivatelyControlledDomain() to rely on SecurityOriginData::host rather than SecurityOriginData::securityOrigin()->host(). SecurityOriginData::securityOrigin() is expensive and it seems unnecessary to call it here since we already have the host. Also update WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() to return domains as a HashSet rather than a Vector to avoid having duplicate domains. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-06-26 Jeremy Jones Invalidate WebVideoFullscreenManager when WebPage is destroyed. https://bugs.webkit.org/show_bug.cgi?id=173835 rdar://problem/32969161 Reviewed by Jer Noble. WebVideoFullscreenManager has a pointer to WebPage, and even null checks it in a few places, but the only place it is nulled out is in the destructor. This allows a dangling reference. This changes invalidates that reference when WebPage is destructed and adds nullchecks or asserts throughout WebVideoFullscreenManager as appropriate. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::~WebPage): * WebProcess/cocoa/WebVideoFullscreenManager.h: (WebKit::WebVideoFullscreenManager::invalidate): * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): (WebKit::WebVideoFullscreenManager::hasVideoChanged): (WebKit::WebVideoFullscreenManager::videoDimensionsChanged): (WebKit::WebVideoFullscreenManager::didSetupFullscreen): (WebKit::WebVideoFullscreenManager::didEnterFullscreen): (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline): 2017-06-26 Chris Dumez Disable diagnostic logging in ephemeral sessions https://bugs.webkit.org/show_bug.cgi?id=173849 Reviewed by Geoffrey Garen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setDiagnosticLoggingClient): Construct a dummy logging client if the page's session is ephemeral. (WebKit::WebPageProxy::logDiagnosticMessage): (WebKit::WebPageProxy::logDiagnosticMessageWithResult): (WebKit::WebPageProxy::logDiagnosticMessageWithValue): (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy): Slight cleanup to make the code look a bit safer. 2017-06-26 Zan Dobersek [GCrypt] Properly initialize libgcrypt before using it https://bugs.webkit.org/show_bug.cgi?id=173589 Reviewed by Michael Catanzaro. Initialize libgcrypt in the Unix-specific main() entrypoint. This is early enough to ensure no other libgcrypt API function is invoked and to also ensure this is done in a thread-safe manner. Initialization is initiated through the gcry_check_version() call. 16 kilobytes of secure memory is pre-allocated before we mark the initialization as complete, as recommended by the libgcrypt documentation. * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2017-06-26 Jeremy Jones When Mission Control closes fullscreen window, allow media element to update its state. https://bugs.webkit.org/show_bug.cgi?id=173671 rdar://problem/32892671 Reviewed by Eric Carlson. When Mission Control closes element fullscreen without an animation, we need to notify the media element that fullscreen has exited. Without this change, the page still behaves like the element is in fullscreen. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): 2017-06-26 Wenson Hsieh [iOS DnD] [WK2] Beginning a drag session should prevent clicking via long press https://bugs.webkit.org/show_bug.cgi?id=173838 Reviewed by Tim Horton. After r218579, WebKit no longer attempts to replace out-of-the-box UIKit long-press/drag lift disambiguation by firing events immediately. However, this means that dragging will defer the highlight long press gesture recognizer until dragging ends rather than cancel it immediately, which causes WKContentView to dispatch a synthetic click immediately upon lift. To fix this, we should bail out of the highlight long press gesture when beginning a drag. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:prepareForSession:completion:]): 2017-06-26 Konstantin Tokarev Unreviewed, add missing header icncludes * WebProcess/soup/WebKitSoupRequestInputStream.cpp: 2017-06-26 Konstantin Tokarev [GTK] Unreviewed, added missing includes to fix debug build * NetworkProcess/NetworkSession.cpp: 2017-06-25 Konstantin Tokarev Remove excessive headers from WebCore/platform https://bugs.webkit.org/show_bug.cgi?id=173822 Reviewed by Tim Horton. * WebProcess/WebCoreSupport/SessionStateConversion.cpp: 2017-06-25 Michael Catanzaro Unreviewed, rolling out r215190. Broke product select element on GNOME Bugzilla Reverted changeset: "[GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup()" https://bugs.webkit.org/show_bug.cgi?id=170553 http://trac.webkit.org/changeset/215190 2017-06-25 Michael Catanzaro [GTK][WPE] Unreviewed, fix typo in translatable string Thanks to Yuri Chornoivan for reporting this typo. * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): 2017-06-25 Konstantin Tokarev Remove excessive headers from JavaScriptCore https://bugs.webkit.org/show_bug.cgi?id=173812 Reviewed by Darin Adler. * WebProcess/Plugins/Netscape/NPJSObject.cpp: 2017-06-24 Chris Dumez [WK2] Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly https://bugs.webkit.org/show_bug.cgi?id=173813 Reviewed by Ryosuke Niwa. Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly. The previous IPC encoder code would assume types and data vector have the same length. It would first encode the length of data using |data.size()| but then would encode types.size() values from the data vector. While there are debug assertions to ensure both vectors have the same size, this seems unnecessarily fragile in release builds. If both vectors happen to have different sizes, this will lead to weird IPC bugs. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeClientTypesAndData): (IPC::decodeClientTypesAndData): 2017-06-24 Michael Catanzaro [GTK] Introspection: webkit_web_view_new_with_related_view needs to be marked as a constructor https://bugs.webkit.org/show_bug.cgi?id=173765 Reviewed by Carlos Garcia Campos. Because the first parameter to this WebKitWebView constructor is itself a WebKitWebView, the gi-scanner's heuristics decide that it's probably an object method rather than a constructor, resulting in improper introspection generation. Annotate it with (constructor) to override this behavior. * UIProcess/API/gtk/WebKitWebViewGtk.cpp: * UIProcess/API/wpe/WebKitWebViewWPE.cpp: 2017-06-24 Commit Queue Unreviewed, rolling out r218785. https://bugs.webkit.org/show_bug.cgi?id=173808 This change broke the macOS Sierra build (Requested by annulen|home on #webkit). Reverted changeset: "Removed unused lambda captures from WebKit2" https://bugs.webkit.org/show_bug.cgi?id=173555 http://trac.webkit.org/changeset/218785 2017-06-24 Konstantin Tokarev Removed unused lambda captures from WebKit2 https://bugs.webkit.org/show_bug.cgi?id=173555 Reviewed by Alex Christensen. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): 2017-06-23 Chris Dumez Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon() https://bugs.webkit.org/show_bug.cgi?id=173792 Reviewed by Ryosuke Niwa. Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon() as this could cause HashTable corruption on WebPageProxy side. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::finishedLoadingIcon): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-06-23 Chris Dumez Stop passing Vector by value in WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores() https://bugs.webkit.org/show_bug.cgi?id=173782 Reviewed by Brent Fulgham. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): 2017-06-23 Chris Dumez Avoid copying HashSet to Vector in WebPageProxy::clearLoadDependentCallbacks() https://bugs.webkit.org/show_bug.cgi?id=173786 Reviewed by Geoffrey Garen. Avoid copying HashSet to Vector in WebPageProxy::clearLoadDependentCallbacks(). Instead, just move the HashSet and iterate on that. This is OK since we were clearing the HashSet right after copying it to the vector anyway. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::clearLoadDependentCallbacks): 2017-06-23 Chris Dumez Unreviewed, fix Debug build after r218763 * NetworkProcess/NetworkDataTask.cpp: 2017-06-23 Chris Dumez Add more release logging for process assertions https://bugs.webkit.org/show_bug.cgi?id=173624 Reviewed by Geoffrey Garen. Add more release logging for process assertions to help debug issues such as . * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::didConnectToProcess): * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::~ProcessAssertion): (WebKit::ProcessAssertion::setState): 2017-06-23 Chris Dumez Consistently use RunLoop::isMain() in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=173745 Reviewed by Brent Fulgham. Consistently use RunLoop:isMain() on WebKit2 instead of WTF::isMainThread(). WTF::isMainThread() returns true for the WebThread instead of the UIThread in WebKit1. Therefore WTF::isMainThread() is unsafe to use in the UIProcess as the application may be using WebKit1 as well and have a WebThread. Technically, we only *need* to move from WTF::isMainThread() to RunLoop::isMain() in the UIProcess code but I ported all of WebKit2 for consistency. RunLoop::isMain() is always safe in WebKit2. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::NetworkDataTask): (WebKit::NetworkDataTask::~NetworkDataTask): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::getSizeForNext): (WebKit::NetworkDataTaskBlob::didGetSize): (WebKit::NetworkDataTaskBlob::seek): (WebKit::NetworkDataTaskBlob::read): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponseNetworkSession): (WebKit::NetworkLoad::notifyDidReceiveResponse): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::defaultSession): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::resourceType): (WebKit::NetworkCache::Cache::initialize): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::readSyncInThread): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (WebKit::NetworkSessionCocoa::defaultSession): (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): (WebKit::CoordinatedGraphicsScene::syncRemoteContent): (WebKit::CoordinatedGraphicsScene::detach): (WebKit::CoordinatedGraphicsScene::appendUpdate): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::WorkQueuePool::singleton): (WebKit::WorkQueuePool::dispatch): (WebKit::CompositingRunLoop::~CompositingRunLoop): (WebKit::CompositingRunLoop::performTask): (WebKit::CompositingRunLoop::performTaskSync): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::createGLContext): (WebKit::ThreadedCompositor::renderNextFrame): (WebKit::ThreadedCompositor::commitScrollOffset): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::releaseUpdateAtlases): (WebKit::ThreadedCompositor::frameComplete): * Shared/Plugins/NPObjectProxy.cpp: (WebKit::NPObjectProxy::NP_Deallocate): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]): * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): * WebProcess/soup/WebKitSoupRequestInputStream.cpp: (webkitSoupRequestInputStreamReadAsync): 2017-06-23 David Kilzer v3: REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies] Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKProcessPool.mm: (policiesHashMapToDictionary): Use adoptNS().get() to avoid dumping objects into autoreleasepools unnecessarily. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: (-[WKProcessPool _pluginLoadClientPolicies]): Add back 'copy' attribute to document that we're returning a new object on each invocation. I shouldn't have removed it in the v2 patch. 2017-06-23 Youenn Fablet LibWebRTCSocketClient should not destroy its socket within signalClose callback https://bugs.webkit.org/show_bug.cgi?id=173739 Reviewed by Brent Fulgham. * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: (WebKit::LibWebRTCSocketClient::signalClose): Destroy 'this' asynchronously to make the caller of signalClose valid until it is not used. 2017-06-23 Chris Dumez Fix typo in WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData() naming https://bugs.webkit.org/show_bug.cgi?id=173781 Reviewed by Brent Fulgham. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): 2017-06-23 Jer Noble [WK2] Support -[WebAVPlayerController setMuted:] https://bugs.webkit.org/show_bug.cgi?id=173777 Reviewed by Eric Carlson. Add a SetMuted message to WebPlaybackSessionManager. Drive-by refactoring: Because the new setMuted() method conflicts with the existing setMuted() notification, do a giant rename of the notificiation methods from set(Value) -> (value)Changed. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setMuted): (WebKit::WebPlaybackSessionModelContext::playbackStartedTimeChanged): (WebKit::WebPlaybackSessionModelContext::durationChanged): (WebKit::WebPlaybackSessionModelContext::currentTimeChanged): (WebKit::WebPlaybackSessionModelContext::bufferedTimeChanged): (WebKit::WebPlaybackSessionModelContext::rateChanged): (WebKit::WebPlaybackSessionModelContext::seekableRangesChanged): (WebKit::WebPlaybackSessionModelContext::canPlayFastReverseChanged): (WebKit::WebPlaybackSessionModelContext::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionModelContext::audioMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionModelContext::externalPlaybackChanged): (WebKit::WebPlaybackSessionModelContext::wirelessVideoPlaybackDisabledChanged): (WebKit::WebPlaybackSessionModelContext::mutedChanged): (WebKit::WebPlaybackSessionManagerProxy::currentTimeChanged): (WebKit::WebPlaybackSessionManagerProxy::bufferedTimeChanged): (WebKit::WebPlaybackSessionManagerProxy::seekableRangesVectorChanged): (WebKit::WebPlaybackSessionManagerProxy::canPlayFastReverseChanged): (WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionManagerProxy::externalPlaybackPropertiesChanged): (WebKit::WebPlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged): (WebKit::WebPlaybackSessionManagerProxy::mutedChanged): (WebKit::WebPlaybackSessionManagerProxy::durationChanged): (WebKit::WebPlaybackSessionManagerProxy::playbackStartedTimeChanged): (WebKit::WebPlaybackSessionManagerProxy::rateChanged): (WebKit::WebPlaybackSessionManagerProxy::setMuted): (WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface): (WebKit::WebPlaybackSessionModelContext::setPlaybackStartedTime): Deleted. (WebKit::WebPlaybackSessionModelContext::setDuration): Deleted. (WebKit::WebPlaybackSessionModelContext::setCurrentTime): Deleted. (WebKit::WebPlaybackSessionModelContext::setBufferedTime): Deleted. (WebKit::WebPlaybackSessionModelContext::setRate): Deleted. (WebKit::WebPlaybackSessionModelContext::setSeekableRanges): Deleted. (WebKit::WebPlaybackSessionModelContext::setCanPlayFastReverse): Deleted. (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Deleted. (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Deleted. (WebKit::WebPlaybackSessionModelContext::setExternalPlayback): Deleted. (WebKit::WebPlaybackSessionModelContext::setWirelessVideoPlaybackDisabled): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setDuration): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setPlaybackStartedTime): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setRate): Deleted. * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::durationChanged): (WebKit::WebPlaybackSessionManager::currentTimeChanged): (WebKit::WebPlaybackSessionManager::bufferedTimeChanged): (WebKit::WebPlaybackSessionManager::playbackStartedTimeChanged): (WebKit::WebPlaybackSessionManager::rateChanged): (WebKit::WebPlaybackSessionManager::seekableRangesChanged): (WebKit::WebPlaybackSessionManager::canPlayFastReverseChanged): (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::externalPlaybackChanged): (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionManager::wirelessVideoPlaybackDisabledChanged): (WebKit::WebPlaybackSessionManager::mutedChanged): (WebKit::WebPlaybackSessionManager::setMuted): 2017-06-23 Frederic Wang Use window.internals instead of overridePreference to set WebCore settings in tests https://bugs.webkit.org/show_bug.cgi?id=173714 Reviewed by Simon Fraser. This commit remove preference to settings mapping in overrideBoolPreferenceForTestRunner that are no longer necessary after the changes done in LayoutTests. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove mapping for preferences that no longer require testRunner.overridePreference calls in tests. 2017-06-23 Brent Fulgham Avoid moving the same vector multiple times https://bugs.webkit.org/show_bug.cgi?id=173748 Reviewed by Chris Dumez. We discovered that a Vector was being moved inside a loop, causing it to be moved more than once. We should never do this! * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Do not perform a move at each step of the iteration. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Receive vector of top privately controlled domains as a const reference. Copy this vector into the completion handler. Do not move origins out of the vector in the inner loop. (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Receive vector of top privately controlled domains as a const reference. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-06-23 Alex Christensen Add SPI to WKURLSchemeTask for redirection https://bugs.webkit.org/show_bug.cgi?id=173730 Reviewed by Brady Eidson. This is needed for testing an upcoming fix for redirect callbacks, and it might be necessary for loading with custom schemes in general. Right now just responding with an HTTP 301/302/307/308 response code doesn't work because there is nothing that synthesizes an NSURLRequest from the Location header like we do in SynchronousResourceHandleCFURLConnectionDelegate::willSendRequest et al. for HSTS, and that would require using an NSHTTPURLResponse for non-HTTP responses, which is conceptually wrong. Instead of waiting for a completion handler in the API, we are following the pattern of WKNavigationDelegate.didReceiveServerRedirectForProvisionalNavigation and allowing the SPI to indicate that a redirect has happened to update the state of WebKit, but not allowing the SPI to wait for a processed request and slow down loading. This adds WKURLSchemeTaskPrivate._didPerformRedirection which is covered by new API tests. * UIProcess/API/Cocoa/WKURLSchemeTask.mm: (raiseExceptionIfNecessary): (-[WKURLSchemeTaskImpl _didPerformRedirection:newRequest:completionHandler:]): * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::stopURLSchemeTask): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): (WebKit::WebURLSchemeHandler::stopTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didReceiveResponse): Deleted. (WebKit::WebURLSchemeTask::didReceiveData): Deleted. (WebKit::WebURLSchemeTask::didComplete): Deleted. * UIProcess/WebURLSchemeTask.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::urlSchemeTaskDidPerformRedirection): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::taskDidPerformRedirection): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::didPerformRedirection): * WebProcess/WebPage/WebURLSchemeTaskProxy.h: 2017-06-23 Brent Fulgham [WK2][macOS] Support Mac Mini Flash Player Features https://bugs.webkit.org/show_bug.cgi?id=173581 Reviewed by Dean Jackson. Revise the sandboxes for additional IOKit properties identified during Flash video player testing. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-06-23 Zan Dobersek [CoordinatedGraphics] Clean up type aliases in CoordinatedGraphicsScene https://bugs.webkit.org/show_bug.cgi?id=173764 Reviewed by Carlos Garcia Campos. Drop the various type aliases created in the CoordinatedGraphicsScene class. We can leave without these by leveraging `auto` where necessary. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded): (WebKit::CoordinatedGraphicsScene::updateImageBacking): (WebKit::CoordinatedGraphicsScene::clearImageBackingContents): (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: 2017-06-23 Carlos Garcia Campos [WPE] Crash in wpe_view_backend_get_renderer_host_fd https://bugs.webkit.org/show_bug.cgi?id=173760 Reviewed by Žan Doberšek. This can happen if views are created and destroyed quickly. The problem is that CompositingManagerProxy adds a message receiver but never removes it, so it's possible that the message arrives right after the view has been destroyed. This is happening most of the times running /wpe/WebKitAutomationSession/request-session that creates 3 web views in a row that are deleted when the test finishes. Fixes /wpe/WebKitAutomationSession/request-session. * UIProcess/API/wpe/CompositingManagerProxy.cpp: (WebKit::CompositingManagerProxy::finalize): Remove the message handler. * UIProcess/API/wpe/CompositingManagerProxy.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::~View): Call CompositingManagerProxy::finalize(). 2017-06-23 Carlos Garcia Campos [WPE] User script messages don't work https://bugs.webkit.org/show_bug.cgi?id=173712 Reviewed by Žan Doberšek. When a user script message is received we need to create a WebKitJavascriptResult to deserialize the script value. WebKitJavascriptResult is created with a WebKitWebView for two reasons: to get its JavaScript global context and to take a reference that ensures the JavaScript context will be alive while the results is alive. However, we could create the WebKitJavascriptResult with the JavaScript global context and take a reference of the context itself. This way we don't need to access the WebKitWebView from the WebScriptMessageHandler client. But we still need access to the JavaScript context, so I've added a javascriptGlobalContext() method to WebPageProxy for GTK+ and WPE that is implemented from the page client. Fixes /wpe/WebKitUserContentManager/script-message-received. * UIProcess/API/glib/WebKitJavascriptResult.cpp: (_WebKitJavascriptResult::_WebKitJavascriptResult): Create the WebKitJavascriptResult with a JSGlobalContextRef instead of a WEbKitWebView. (webkitJavascriptResultCreate): Pass the js context to the constructor. (webkit_javascript_result_get_global_context): Return the js context. * UIProcess/API/glib/WebKitJavascriptResultPrivate.h: * UIProcess/API/glib/WebKitUserContentManager.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (_WebKitWebViewPrivate::~_WebKitWebViewPrivate): Use JSRetainPtr (webkit_web_view_get_javascript_global_context): (webkitWebViewRunJavaScriptCallback): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::javascriptGlobalContext): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/wpe/APIViewClient.h: (API::ViewClient::javascriptGlobalContext): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::javascriptGlobalContext): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::javascriptGlobalContext): * UIProcess/API/wpe/WPEView.h: * UIProcess/PageClient.h: (WebKit::PageClient::javascriptGlobalContext): * UIProcess/WebPageProxy.h: * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::javascriptGlobalContext): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::javascriptGlobalContext): 2017-06-22 Wenson Hsieh [iOS DnD] [WK2] Enable in-app dragging from WKWebView on the phone https://bugs.webkit.org/show_bug.cgi?id=173736 Reviewed by Tim Horton. Flip the drag interaction enabled switch on when initializing WKContentView's UIDragInteraction. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupDataInteractionDelegates]): 2017-06-22 Chris Dumez isMainThread() assertions in CallbackMap are incorrectly failing on some iOS apps https://bugs.webkit.org/show_bug.cgi?id=173738 Reviewed by Brady Eidson. The assertions hit on certain iOS apps even though the crash traces clearly show them on the main thread. We have verified locally that RunLoop::isMain() propertly return true in this case (while WTF::isMainThread() returns false). Update the assertions to use RunLoop::isMain() instead. * UIProcess/GenericCallback.h: (WebKit::CallbackMap::put): (WebKit::CallbackMap::take): (WebKit::CallbackMap::invalidate): 2017-06-22 Daniel Bates Make FrameLoadRequest a move-only type https://bugs.webkit.org/show_bug.cgi?id=173682 Reviewed by Alex Christensen and Darin Adler. A FrameLoadRequest groups together the information to perform a load into a single object that is more manageable to pass around than its constituent parts. Code that receives a FrameLoadRequest is expected to extract out the information it needs to complete its task. And it does not make sense to re-use the same FrameLoadRequest object for more than one load. Therefore, it is sufficient to make FrameLoadRequest a move-only type. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::URLRequest::create): (WebKit::PluginView::URLRequest::URLRequest): (WebKit::PluginView::performFrameLoadURLRequest): (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2017-06-22 Chris Dumez Add release assertion in CallbackMap::invalidate() https://bugs.webkit.org/show_bug.cgi?id=173722 Reviewed by Brady Eidson. Add release assertion in CallbackMap::invalidate() to make sure it is called on the main thread. * UIProcess/GenericCallback.h: (WebKit::CallbackMap::invalidate): 2017-06-22 Brady Eidson Add some thread safety guards to GenericCallback. https://bugs.webkit.org/show_bug.cgi?id=173693 Reviewed by Sam Weinig. A callback should be created, performed, invalidated, and/or destroyed all on the same thread. Let's write code to notify us if that doesn't happen. * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): (WebKit::GenericCallback::invalidate): 2017-06-22 David Kilzer v2: REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies] Reviewed by Chris Dumez. * UIProcess/API/Cocoa/WKProcessPool.mm: (policiesHashMapToDictionary): Use -dictionaryWithCapacity: instead of -new since the former returns an autoreleased object while the latter does not. This has the added benefit of tuning the size of each NSMutableDictionary. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: (-[WKProcessPool _pluginLoadClientPolicies]): Remove 'copy' attribute from @property declaration since it is read-only. 2017-06-22 Carlos Garcia Campos [WPE] Downloads never have a web view associated in WPE https://bugs.webkit.org/show_bug.cgi?id=173709 Reviewed by Žan Doberšek. Convert the WPE view client into an API client and add handleDownloadRequest(). WebKitWebView now uses it to associate itself to the download like the GTK+ port does. * PlatformWPE.cmake: * UIProcess/API/C/wpe/WKView.cpp: (WKViewSetViewClient): Add C API client implementation here. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): Set the view client in WPE. * UIProcess/API/wpe/APIViewClient.h: Renamed from Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h. (API::ViewClient::frameDisplayed): (API::ViewClient::handleDownloadRequest): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::handleDownloadRequest): Call WKWPE::View::handleDownloadRequest(). * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::View): Initialize the view client. (WKWPE::View::setClient): Set or reset the client. (WKWPE::View::handleDownloadRequest): Notify the client. * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WPEViewClient.cpp: Removed. 2017-06-22 Carlos Garcia Campos [WPE] Page should be closed on WebKitWebView dispose https://bugs.webkit.org/show_bug.cgi?id=173707 Reviewed by Žan Doberšek. In the GTK+ port it's done in the WebKitWebViewBase dispose implementation. It fixes TestMultiprocess. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewDispose): Call WKWPE::View::close(). * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::close): Close the WebPageProxy. * UIProcess/API/wpe/WPEView.h: 2017-06-22 Carlos Garcia Campos Remove unused coordinated graphics C API https://bugs.webkit.org/show_bug.cgi?id=173706 Reviewed by Žan Doberšek. * UIProcess/API/C/CoordinatedGraphics/WKView.cpp: Removed. * UIProcess/API/C/CoordinatedGraphics/WKView.h: Removed. * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp: Removed. * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h: Removed. 2017-06-22 Carlos Garcia Campos [WPE] Add initial web extensions API https://bugs.webkit.org/show_bug.cgi?id=173640 Reviewed by Žan Doberšek. Build the glib web extensions API files and the builtin injected bundle library for WPE. * PlatformWPE.cmake: * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): Use a different injected bundle filename in WPE and GTK+. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkit_web_page_class_init): Do not expose DOM bindings in WPE. (webkitWebPageCreate): Ditto. * WebProcess/InjectedBundle/API/wpe/WebKitConsoleMessage.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitScriptWorld.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitWebEditor.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Added. * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Added. 2017-06-21 David Kilzer REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies] Reviewed by Chris Dumez. Caught by the clang static analyzer. * UIProcess/API/Cocoa/WKProcessPool.mm: (policiesHashMapToDictionary): Switch from using [[NSMutableDictionary alloc] init] which returns a +1 retained object in MRR to [NSMutableDictionary new] which returns an autoreleased object under MRR. This bug caused 3 leaks when calling -[WKProcessPool _pluginLoadClientPolicies], which should return an autoreleased object based on its signature. 2017-06-21 Ryosuke Niwa Add release assertions help diagnose a hang in CallbackMap https://bugs.webkit.org/show_bug.cgi?id=173680 Reviewed by Chris Dumez. Assert that these functions are only called in the main thread and the empty value is never used as a key. * UIProcess/GenericCallback.h: (WebKit::CallbackMap::put): (WebKit::CallbackMap::take): 2017-06-21 Wenson Hsieh [iOS DnD] [WK2] Cancelling a drag interaction using the ObjC SPI causes subsequent dragging to fail https://bugs.webkit.org/show_bug.cgi?id=173659 Reviewed by Tim Horton. Currently, a drag session that failed to begin is cleaned up either when the web process responds in -[WKContentView _didHandleStartDataInteractionRequest:] with started = NO, or if started is YES, in -dragInteraction:session:didEndWithOperation: instead. However, it is possible that even when the pasteboard has items and the drag has started in the web process, something in the UI process may then cause the drag to be cancelled (for instance, an SPI client returning empty arrays for all adjusted item providers, or UIKit not even calling into -dragInteraction:itemsForBeginningSession: when we invoke their completion block). In any case, if the drag session is drag-item-less after calling the drag start completion block, clean up and cancel the drag. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didHandleStartDataInteractionRequest:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): 2017-06-21 Tim Horton REGRESSION (r218606): 3D Touch action menu for links is missing items https://bugs.webkit.org/show_bug.cgi?id=173669 Reviewed by Wenson Hsieh. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant defaultActionsForLinkSheet:]): defaultActionsForLinkSheet is used outside the usual action sheet flow, by 3D Touch code. Therefore, we're not guaranteed to have a _positionInformation. We don't need one, though -- we can get the URL from the passed-in _WKActivatedElementInfo, exactly like defaultActionsForImageSheet already did. (-[WKActionSheetAssistant defaultActionsForImageSheet:]): Remove the delegate null check, which isn't used after r218606. 2017-06-21 Daniel Bates Cleanup FrameLoadRequest https://bugs.webkit.org/show_bug.cgi?id=173564 Reviewed by Brent Fulgham. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): Explicitly pass the null-string for the target frame name as we do not have one. Use C++11 brace initialization syntax. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): Ditto. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): It is no longer necessary to pass ReplaceDocumentIfJavaScriptURL when instantiating the FrameLoadRequest as it defaults to this policy. Use C++11 brace initialization syntax. 2017-06-21 Wenson Hsieh [iOS DnD] [WK2] Add drag-and-drop release logging around WKContentView https://bugs.webkit.org/show_bug.cgi?id=173636 Reviewed by Tim Horton. Add logging at key points in the drag-and-drop lifecycle in the UI process, so that sysdiagnoses will contain sufficient information to debug sparse failures. * Platform/Logging.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didHandleStartDataInteractionRequest:]): (-[WKContentView cleanUpDragSourceSessionState]): (-[WKContentView _didPerformDataInteractionControllerOperation:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView dragInteraction:sessionWillBegin:]): (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): (-[WKContentView dropInteraction:canHandleSession:]): (-[WKContentView _api_dropInteraction:sessionDidEnter:]): (-[WKContentView dropInteraction:sessionDidExit:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dropInteraction:sessionDidEnd:]): 2017-06-21 Jeremy Jones Don't clear audio mute when muting capture. https://bugs.webkit.org/show_bug.cgi?id=173639 rdar://problem/32749737 Reviewed by Eric Carlson. Setting capture mute was clearing audio mute. Added setMediaStreamCaptureMuted to set just the capture mute bit. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _muteMediaCapture]): * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaStreamCaptureMuted): * UIProcess/WebPageProxy.h: 2017-06-21 Miguel Gomez [GTK][WAYLAND] Create WaylandCompositorDisplay unconditionally when initializing the WebProcess https://bugs.webkit.org/show_bug.cgi?id=173598 Reviewed by Carlos Garcia Campos. Move WaylandCompositorDisplay code to its own files so it can be used from other classes. Then, instead of storing the waylandCompositorDisplayName in the WebProcess, keep a WaylandCompositorDisplay instance that is created during the initialization. This way the appropriate sharedDisplayForCompositing will be set since the creation of the WebProcess. * PlatformGTK.cmake: * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp: (WebKit::AcceleratedSurfaceWayland::create): (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::waylandCompositorDisplay): * WebProcess/gtk/WaylandCompositorDisplay.cpp: Added. (WebKit::WaylandCompositorDisplay::create): (WebKit::WaylandCompositorDisplay::bindSurfaceToPage): (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay): (WebKit::WaylandCompositorDisplay::registryGlobal): * WebProcess/gtk/WaylandCompositorDisplay.h: Added. * WebProcess/soup/WebProcessSoup.cpp: (WebKit::WebProcess::platformInitializeWebProcess): 2017-06-21 Carlos Garcia Campos [GTK] Move WebGtkExtensionManager and WebGtkInjectedBundleMain to glib API dir https://bugs.webkit.org/show_bug.cgi?id=173606 Reviewed by Žan Doberšek. And rename them to use WebKit prefix instead of WebGtk. * PlatformGTK.cmake: * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.cpp. (WebKit::WebKitExtensionManager::singleton): (WebKit::WebKitExtensionManager::WebKitExtensionManager): (WebKit::WebKitExtensionManager::scanModules): (WebKit::WebKitExtensionManager::initializeWebExtension): (WebKit::WebKitExtensionManager::initialize): * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h. * WebProcess/InjectedBundle/API/glib/WebKitInjectedBundleMain.cpp: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp. (WKBundleInitialize): 2017-06-20 Frederic Wang Pass the argument of DrawingArea::shouldUseTiledBackingForFrameView by reference https://bugs.webkit.org/show_bug.cgi?id=173605 DrawingArea::shouldUseTiledBackingForFrameView is only called from WebChromeClient::shouldUseTiledBackingForFrameView where the frame view is already available as a reference. This patch makes the argument of DrawingArea::shouldUseTiledBackingForFrameView a reference, so it does not need to be converted to a pointer or to perform nullchecks. Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Just pass the reference. * WebProcess/WebPage/DrawingArea.h: Make the parameter a reference. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Ditto. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Use the reference to frame view and remove the nullcheck. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto. 2017-06-20 Myles C. Maxfield Disable font variations on macOS Sierra and iOS 10 https://bugs.webkit.org/show_bug.cgi?id=173618 Reviewed by Jon Lee. * Configurations/FeatureDefines.xcconfig: 2017-06-20 Daniel Bates Have FrameLoadRequest takes a Frame& instead of a Frame* https://bugs.webkit.org/show_bug.cgi?id=173614 Reviewed by Brent Fulgham. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performFrameLoadURLRequest): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadURLInFrame): (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadDataImpl): 2017-06-20 Tim Horton Occasional deadlocks under ensurePositionInformationIsUpToDate (incoming sync message with waitForAndDispatchImmediately) https://bugs.webkit.org/show_bug.cgi?id=173570 Reviewed by Wenson Hsieh. * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::getPositionInformation): Deleted. Get rid of getPositionInformation; it only has one caller, and it's easier to reason about the code if it's all in one place. Also, we shouldn't add more callers... * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView ensurePositionInformationIsUpToDate:]): Add a return value to ensurePositionInformationIsUpToDate that indicates whether we succeeded in that effort. Add the flag to our waitForAndDispatchImmediately that causes the wait to be interrupted if a sync message arrives. (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView positionInformationForActionSheetAssistant:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): If anything happens to interrupt our position information update, fail in the most graceful possible way at each callsite (generally by bailing from doing whatever action required position information). * UIProcess/ios/WKPDFView.mm: (-[WKPDFView positionInformationForActionSheetAssistant:]): * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant synchronouslyRetrievePositionInformation]): (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]): (-[WKActionSheetAssistant presentationRectForIndicatedElement]): (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]): (-[WKActionSheetAssistant presentationRectInHostViewForSheet]): (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant defaultActionsForLinkSheet:]): (-[WKActionSheetAssistant showLinkSheet]): (-[WKActionSheetAssistant showDataDetectorsSheet]): (-[WKActionSheetAssistant cleanupSheet]): Instead of constantly re-querying the position information, save it aside when presenting an action sheet, and use it to respond to all of the subsequent questions. Also, bail from presenting the action sheet if we fail to retrieve correct position information. 2017-06-20 Matt Lewis Unreviewed, rolling out r218530. This revision caused multiple media stream test crashes on Debug builds. Reverted changeset: "Merge MediaDevicesRequest and MediaDevicesEnumerationRequest to tighten up code and object lifetime" https://bugs.webkit.org/show_bug.cgi?id=173527 http://trac.webkit.org/changeset/218530 2017-06-20 Wenson Hsieh [iOS DnD] [WK2] Remove custom logic for disambiguating long press action sheet gestures and drag lift https://bugs.webkit.org/show_bug.cgi?id=173578 Reviewed by Tim Horton. Custom logic to cancel the long press action gesture recognizer in WebKit2 was added months ago to achieve spec'ed behavior when initiating a drag on an element with an action sheet to show on long press. Now that UIKit defers firing long-press gesture recognizers while a drag lift is recognizing, no extra work in WebKit is needed to achieve expected behavior. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateLongPressActionAtLocation:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add testing SPI for showing an action sheet popover at a given location in content view coordinates. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]): (-[WKContentView _didHandleStartDataInteractionRequest:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:sessionWillBegin:]): (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): (-[WKContentView _simulateLongPressActionAtLocation:]): (longPressActionDelayAfterLift): Deleted. (-[WKContentView performDeferredActionAtDragOrigin]): Deleted. (-[WKContentView cancelDeferredActionAtDragOrigin]): Deleted. 2017-06-20 Carlos Garcia Campos [WPE] Add initial implementation of glib API https://bugs.webkit.org/show_bug.cgi?id=173546 Reviewed by Žan Doberšek. Make current API files under glib directories build in WPE, and add the minimum implementation to make it work. For now it doesn't have web extensions API, and there are a few FIXMEs that will be fixed in follow up commits. It doesn't include install rules yet, since it's still not ready to be installed. * PlatformGTK.cmake: * PlatformWPE.cmake: * Shared/API/glib/WebKitContextMenuActions.cpp: (webkitContextMenuActionGetActionTag): (webkitContextMenuActionGetForContextMenuItem): (webkitContextMenuActionGetLabel): * Shared/API/glib/WebKitContextMenuItem.cpp: * UIProcess/API/glib/WebKitEditorState.cpp: (webkitEditorStateChanged): * UIProcess/API/glib/WebKitError.cpp: * UIProcess/API/glib/WebKitFileChooserRequest.cpp: (webkitFileChooserRequestGetProperty): (webkit_file_chooser_request_class_init): * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: (createGstInstallPluginsContext): (webkitInstallMissingMediaPluginsPermissionRequestAllow): * UIProcess/API/glib/WebKitNavigationAction.cpp: * UIProcess/API/glib/WebKitNavigationActionPrivate.h: (_WebKitNavigationAction::_WebKitNavigationAction): * UIProcess/API/glib/WebKitNotificationPrivate.h: * UIProcess/API/glib/WebKitNotificationProvider.cpp: (WebKitNotificationProvider::show): * UIProcess/API/glib/WebKitPrivate.cpp: (toPlatformModifiers): (toWebKitError): (toWebCoreError): * UIProcess/API/glib/WebKitPrivate.h: * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): (webKitSettingsGetProperty): (webkit_settings_class_init): (webkit_settings_set_user_agent): (webkit_settings_set_user_agent_with_application_details): * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/API/glib/WebKitURISchemeRequest.cpp: (webkit_uri_scheme_request_get_web_view): * UIProcess/API/glib/WebKitUserContentManager.cpp: * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewCreate): (webkit_web_view_class_init): (webkitWebViewCreatePage): (webkitWebViewRunAsModal): (webkitWebViewMouseTargetChanged): (webkitWebViewEnterFullScreen): (webkitWebViewExitFullScreen): (webkitWebViewPopulateContextMenu): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/glib/WebKitWindowProperties.cpp: (webkitWindowPropertiesGetProperty): (webkitWindowPropertiesSetProperty): (webkit_window_properties_class_init): (webkitWindowPropertiesUpdateFromWebWindowFeatures): * UIProcess/API/glib/WebKitWindowPropertiesPrivate.h: * UIProcess/API/gtk/WebKitWebViewGtk.cpp: Added. (webkitWebViewAuthenticate): (webkitWebViewCreateJavaScriptDialog): (webkitWebViewScriptDialog): (fileChooserDialogResponseCallback): (webkitWebViewRunFileChooser): (webkit_web_view_new): (webkit_web_view_new_with_context): (webkit_web_view_new_with_related_view): (webkit_web_view_new_with_settings): (webkit_web_view_new_with_user_content_manager): * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WebKitAuthenticationRequest.h: Added. * UIProcess/API/wpe/WebKitAutomationSession.h: Added. * UIProcess/API/wpe/WebKitBackForwardList.h: Added. * UIProcess/API/wpe/WebKitBackForwardListItem.h: Added. * UIProcess/API/wpe/WebKitContextMenu.h: Added. * UIProcess/API/wpe/WebKitContextMenuActions.h: Added. * UIProcess/API/wpe/WebKitContextMenuItem.h: Added. * UIProcess/API/wpe/WebKitCookieManager.h: Added. * UIProcess/API/wpe/WebKitCredential.h: Added. * UIProcess/API/wpe/WebKitDefines.h: Copied from Source/WebKit2/UIProcess/API/glib/WebKitPrivate.h. * UIProcess/API/wpe/WebKitDownload.h: Added. * UIProcess/API/wpe/WebKitEditingCommands.h: Added. * UIProcess/API/wpe/WebKitEditorState.h: Added. * UIProcess/API/wpe/WebKitEnumTypes.cpp.template: Added. * UIProcess/API/wpe/WebKitEnumTypes.h.template: Copied from Source/WebKit2/UIProcess/API/glib/WebKitNotificationPrivate.h. * UIProcess/API/wpe/WebKitError.h: Added. * UIProcess/API/wpe/WebKitFaviconDatabase.h: Added. * UIProcess/API/wpe/WebKitFileChooserRequest.h: Added. * UIProcess/API/wpe/WebKitFindController.h: Added. * UIProcess/API/wpe/WebKitFormSubmissionRequest.h: Added. * UIProcess/API/wpe/WebKitGeolocationPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitHitTestResult.h: Added. * UIProcess/API/wpe/WebKitInstallMissingMediaPluginsPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitJavascriptResult.h: Added. * UIProcess/API/wpe/WebKitMimeInfo.h: Added. * UIProcess/API/wpe/WebKitNavigationAction.h: Added. * UIProcess/API/wpe/WebKitNavigationPolicyDecision.h: Added. * UIProcess/API/wpe/WebKitNetworkProxySettings.h: Added. * UIProcess/API/wpe/WebKitNotification.h: Added. * UIProcess/API/wpe/WebKitNotificationPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitPlugin.h: Added. * UIProcess/API/wpe/WebKitPolicyDecision.h: Added. * UIProcess/API/wpe/WebKitResponsePolicyDecision.h: Added. * UIProcess/API/wpe/WebKitScriptDialog.h: Added. * UIProcess/API/wpe/WebKitSecurityManager.h: Added. * UIProcess/API/wpe/WebKitSecurityOrigin.h: Added. * UIProcess/API/wpe/WebKitSettings.h: Added. * UIProcess/API/wpe/WebKitURIRequest.h: Added. * UIProcess/API/wpe/WebKitURIResponse.h: Added. * UIProcess/API/wpe/WebKitURISchemeRequest.h: Added. * UIProcess/API/wpe/WebKitUserContent.h: Added. * UIProcess/API/wpe/WebKitUserContentManager.h: Added. * UIProcess/API/wpe/WebKitUserMediaPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitWebContext.h: Added. * UIProcess/API/wpe/WebKitWebResource.h: Added. * UIProcess/API/wpe/WebKitWebView.h: Added. * UIProcess/API/wpe/WebKitWebViewSessionState.h: Added. * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Added. (webkitWebViewAuthenticate): (webkitWebViewScriptDialog): (webkitWebViewRunFileChooser): (webkit_web_view_new): (webkit_web_view_new_with_context): (webkit_web_view_new_with_related_view): (webkit_web_view_new_with_settings): (webkit_web_view_new_with_user_content_manager): * UIProcess/API/wpe/WebKitWebsiteData.h: Added. * UIProcess/API/wpe/WebKitWebsiteDataManager.h: Added. * UIProcess/API/wpe/WebKitWindowProperties.h: Added. * UIProcess/API/wpe/webkit.h: Added. 2017-06-19 Frederic Wang [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled https://bugs.webkit.org/show_bug.cgi?id=173405 Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/WebChromeClient.h: Set the ScrollableNonMainFrameTrigger bit by default on iOS too. RenderLayerCompositor::requiresCompositingForScrollableFrame will ignore this change when async frame scrolling is disabled. 2017-06-19 Frederic Wang [Mac] Add an experimental feature setting for async frame scrolling https://bugs.webkit.org/show_bug.cgi?id=173359 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: Add experimental feature "async frame scrolling". * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetAsyncFrameScrollingEnabled): Add setter for async frame scrolling. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Declare setter. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setAsyncFrameScrollingEnabled): Add setter for async frame scrolling. * WebProcess/InjectedBundle/InjectedBundle.h: Declare setter. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Take into account preference update for async frame scrolling. 2017-06-19 Darin Adler Merge MediaDevicesRequest and MediaDevicesEnumerationRequest to tighten up code and object lifetime https://bugs.webkit.org/show_bug.cgi?id=173527 Reviewed by Sam Weinig. * UIProcess/API/C/WKUserMediaPermissionCheck.h: Fixed incorrect file name in comment. * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Use the new frame function from MediaDevicesEnumerationRequest rather than finding the frame with our own code. * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: Removed unneeded include of UserMediaController.h. 2017-06-19 Chris Dumez Regression(r217570): com.apple.WebKit.Networking crash at com.apple.WebKit: WebKit::ChildProcess::didReceiveInvalidMessage (Breaks 32-bit apps) https://bugs.webkit.org/show_bug.cgi?id=173576 Reviewed by Tim Horton. The IPC encoding / decoding code cannot be architecture-specific because a 32bit UIProcess talks to a 64bit NetworkProcess. The WEB_RTC build time flag is enabled on 64bit only. Therefore, we should not use #if ENABLE(WEB_RTC) in IPC encoding / decoding code. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: 2017-06-19 Chris Dumez Unreviewed, partial rollout of r218501 to address crashes on iOS. * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryAppLink): 2017-06-19 Darin Adler [Cocoa] implement URLSession:task:needNewBodyStream: delegate method https://bugs.webkit.org/show_bug.cgi?id=173551 rdar://problem/32250512 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate existingTask:]): Added helper method. (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]): Updated to use existingTask: method. (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]): Added. (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Updated to use existingTask: method. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Ditto. (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): Ditto. (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): Ditto. (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Ditto. (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): Ditto. (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): Ditto. (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): Ditto. (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Ditto. (WebKit::globalAllowsCellularAccess): Deleted. Just use a normal global. (WebKit::globalLegacyCustomProtocolManager): Deleted. Just use a normal global. (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Updated for normal global. (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Ditto. (WebKit::NetworkSessionCocoa::defaultSession): Ditto. (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. 2017-06-19 Ryan Haddad Unreviewed, rolling out r218503. This change broke the macOS Sierra build. Reverted changeset: "Removed unused lambda captures from WebKit2" https://bugs.webkit.org/show_bug.cgi?id=173555 http://trac.webkit.org/changeset/218503 2017-06-19 Wenson Hsieh [iOS DnD] [WK2] Add an internal hook to change the drag lift delay https://bugs.webkit.org/show_bug.cgi?id=173523 Reviewed by Tim Horton. Add a new private property on WKWebViewConfiguration, _dragLiftDelay, for changing the UIDragInteraction's lift delay to one of three values: short, medium or long. The short setting simply uses UIKit's default drag lift delay (at the time of writing, this is 325ms); medium and long are 500ms and 650ms, respectively. In combination with an internal switch to toggle between lift delays, the purpose of this change is to make it easier to choose a drag lift delay for web content that doesn't easily cause unintended dragging while panning. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (toDragLiftDelay): Converts an integer (e.g. retrieved from user defaults) to a drag lift delay type. (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _dragLiftDelay]): Add boilerplate plumbing for the _dragLiftDelay setting. (-[WKWebViewConfiguration _setDragLiftDelay:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Add _dragLiftDelay to as a private property of WKWebViewConiguration. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dragLiftDelay]): Convert the web view configuration's _WKDragLiftDelay to an actual time interval. (-[WKContentView setupDataInteractionDelegates]): 2017-06-19 Konstantin Tokarev Removed unused lambda captures from WebKit2 https://bugs.webkit.org/show_bug.cgi?id=173555 Reviewed by Alex Christensen. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): 2017-06-19 Chris Dumez Use WTF::Function instead of std::function in more places in WebCore/ https://bugs.webkit.org/show_bug.cgi?id=173535 Reviewed by Antti Koivisto. Use WTF::Function instead of std::function in more places in WebCore/ to avoid copying. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpPolicyListener): (WebKit::WebFrame::invalidatePolicyListener): * WebProcess/WebPage/WebFrame.h: 2017-06-19 Chris Dumez [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies https://bugs.webkit.org/show_bug.cgi?id=173472 Reviewed by Antti Koivisto. Follow-up to r218419 to avoid copying the HashMap unnecessarily. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::resetPluginLoadClientPolicies): * UIProcess/WebProcessPool.h: 2017-06-19 Youenn Fablet A cloned MediaStreamTrack should mute independently other tracks using the same source https://bugs.webkit.org/show_bug.cgi?id=172831 Reviewed by Eric Carlson. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setStorage): 2017-06-19 Carlos Garcia Campos [GTK] Move GTK+ API files that could be shared to glib dirs https://bugs.webkit.org/show_bug.cgi?id=173545 Reviewed by Žan Doberšek. Most of the files don't use GTK+ at all, or only for a few things that could be ifdefed. Public headers can never be shared, so move only private headers and cpp files. This patch moves the files without any modification to make everything easier, in follow up commits we will add the required ifdefs and refactorings to ensure the code can actually be shared. * PlatformGTK.cmake: * Shared/API/glib/WebKitContextMenu.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp. * Shared/API/glib/WebKitContextMenuActions.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp. * Shared/API/glib/WebKitContextMenuActionsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h. * Shared/API/glib/WebKitContextMenuItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp. * Shared/API/glib/WebKitContextMenuItemPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h. * Shared/API/glib/WebKitContextMenuPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h. * Shared/API/glib/WebKitHitTestResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp. * Shared/API/glib/WebKitHitTestResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h. * Shared/API/glib/WebKitURIRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp. * Shared/API/glib/WebKitURIRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequestPrivate.h. * Shared/API/glib/WebKitURIResponse.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp. * Shared/API/glib/WebKitURIResponsePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h. * UIProcess/API/glib/WebKitAuthenticationRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequest.cpp. * UIProcess/API/glib/WebKitAuthenticationRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h. * UIProcess/API/glib/WebKitAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSession.cpp. * UIProcess/API/glib/WebKitAutomationSessionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSessionPrivate.h. * UIProcess/API/glib/WebKitBackForwardList.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp. * UIProcess/API/glib/WebKitBackForwardListItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp. * UIProcess/API/glib/WebKitBackForwardListPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h. * UIProcess/API/glib/WebKitContextMenuClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.cpp. * UIProcess/API/glib/WebKitContextMenuClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.h. * UIProcess/API/glib/WebKitCookieManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp. * UIProcess/API/glib/WebKitCookieManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h. * UIProcess/API/glib/WebKitCredential.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredential.cpp. * UIProcess/API/glib/WebKitCredentialPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredentialPrivate.h. * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp. * UIProcess/API/glib/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h. * UIProcess/API/glib/WebKitDownload.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp. * UIProcess/API/glib/WebKitDownloadClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp. * UIProcess/API/glib/WebKitDownloadClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.h. * UIProcess/API/glib/WebKitDownloadPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h. * UIProcess/API/glib/WebKitEditorState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.cpp. * UIProcess/API/glib/WebKitEditorStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorStatePrivate.h. * UIProcess/API/glib/WebKitError.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp. * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp. * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h. * UIProcess/API/glib/WebKitFileChooserRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp. * UIProcess/API/glib/WebKitFileChooserRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h. * UIProcess/API/glib/WebKitFindController.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp. * UIProcess/API/glib/WebKitFormClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp. * UIProcess/API/glib/WebKitFormClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.h. * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp. * UIProcess/API/glib/WebKitFormSubmissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h. * UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp. * UIProcess/API/glib/WebKitGeolocationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h. * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp. * UIProcess/API/glib/WebKitGeolocationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h. * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.cpp. * UIProcess/API/glib/WebKitInjectedBundleClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.h. * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp. * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h. * UIProcess/API/glib/WebKitJavascriptResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp. * UIProcess/API/glib/WebKitJavascriptResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h. * UIProcess/API/glib/WebKitLoaderClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp. * UIProcess/API/glib/WebKitLoaderClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.h. * UIProcess/API/glib/WebKitMimeInfo.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfo.cpp. * UIProcess/API/glib/WebKitMimeInfoPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfoPrivate.h. * UIProcess/API/glib/WebKitNavigationAction.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp. * UIProcess/API/glib/WebKitNavigationActionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h. * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp. * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h. * UIProcess/API/glib/WebKitNetworkProxySettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettings.cpp. * UIProcess/API/glib/WebKitNetworkProxySettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h. * UIProcess/API/glib/WebKitNotification.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp. * UIProcess/API/glib/WebKitNotificationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp. * UIProcess/API/glib/WebKitNotificationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h. * UIProcess/API/glib/WebKitNotificationPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h. * UIProcess/API/glib/WebKitNotificationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp. * UIProcess/API/glib/WebKitNotificationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h. * UIProcess/API/glib/WebKitPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPermissionRequest.cpp. * UIProcess/API/glib/WebKitPlugin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPlugin.cpp. * UIProcess/API/glib/WebKitPluginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPluginPrivate.h. * UIProcess/API/glib/WebKitPolicyClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp. * UIProcess/API/glib/WebKitPolicyClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h. * UIProcess/API/glib/WebKitPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp. * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h. * UIProcess/API/glib/WebKitPrivate.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp. * UIProcess/API/glib/WebKitPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h. * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp. * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h. * UIProcess/API/glib/WebKitScriptDialog.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.cpp. * UIProcess/API/glib/WebKitScriptDialogPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h. * UIProcess/API/glib/WebKitSecurityManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp. * UIProcess/API/glib/WebKitSecurityManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h. * UIProcess/API/glib/WebKitSecurityOrigin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOrigin.cpp. * UIProcess/API/glib/WebKitSecurityOriginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOriginPrivate.h. * UIProcess/API/glib/WebKitSettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp. * UIProcess/API/glib/WebKitSettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h. * UIProcess/API/glib/WebKitUIClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp. * UIProcess/API/glib/WebKitUIClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.h. * UIProcess/API/glib/WebKitURISchemeRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp. * UIProcess/API/glib/WebKitURISchemeRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h. * UIProcess/API/glib/WebKitUserContent.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContent.cpp. * UIProcess/API/glib/WebKitUserContentManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManager.cpp. * UIProcess/API/glib/WebKitUserContentManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManagerPrivate.h. * UIProcess/API/glib/WebKitUserContentPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentPrivate.h. * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp. * UIProcess/API/glib/WebKitUserMediaPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h. * UIProcess/API/glib/WebKitWebContext.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp. * UIProcess/API/glib/WebKitWebContextPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h. * UIProcess/API/glib/WebKitWebResource.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp. * UIProcess/API/glib/WebKitWebResourcePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h. * UIProcess/API/glib/WebKitWebView.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp. * UIProcess/API/glib/WebKitWebViewPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h. * UIProcess/API/glib/WebKitWebViewSessionState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionState.cpp. * UIProcess/API/glib/WebKitWebViewSessionStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionStatePrivate.h. * UIProcess/API/glib/WebKitWebsiteData.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp. * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp. * UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h. * UIProcess/API/glib/WebKitWebsiteDataPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataPrivate.h. * UIProcess/API/glib/WebKitWindowProperties.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp. * UIProcess/API/glib/WebKitWindowPropertiesPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp. * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp. * WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFramePrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp. * WebProcess/InjectedBundle/API/glib/WebKitScriptWorldPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorldPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp. * WebProcess/InjectedBundle/API/glib/WebKitWebEditorPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp. * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResult.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp. * WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResultPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp. * WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h. 2017-05-14 Frederic Wang Add heuristic to avoid flattening "fullscreen" iframes https://bugs.webkit.org/show_bug.cgi?id=171914 Reviewed by Simon Fraser. This commit ajusts the preference API to internally treat frame flattening as an enum. However, the "partial frame flattening" value is not exposed to GTK, C or InjectedBundle APIs yet. * Shared/WebPreferencesDefinitions.h: Define frame flattening as an enum. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetFrameFlatteningEnabled): Treat frame flattening as an enum. (WKPreferencesGetFrameFlatteningEnabled): Ditto. * UIProcess/API/gtk/WebKitSettings.cpp: (webkit_settings_get_enable_frame_flattening): Ditto. (webkit_settings_set_enable_frame_flattening): Ditto. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Do not handle frame flattening since it is an enum. For now, this breaks one test checking preference overriding because of bug 128594. (WebKit::InjectedBundle::setFrameFlatteningEnabled): Treat frame flattening as an enum. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged): Use enum value. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Ditto. 2017-06-18 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.4 release. * gtk/NEWS: Add release notes for 2.17.4. 2017-06-18 Chris Dumez Drop redundant IPC in WebPage::tryClose() https://bugs.webkit.org/show_bug.cgi?id=173533 Reviewed by Sam Weinig. Drop redundant IPC to stop the responsiveness timer in WebPage::tryClose(). The destructor for the SendStopResponsivenessTimer already takes care of sending the IPC. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::tryClose): 2017-06-18 Chris Dumez Drop unused UserMediaPermissionRequestManager::cancelPendingRequests() https://bugs.webkit.org/show_bug.cgi?id=173529 Reviewed by Sam Weinig. Drop UserMediaPermissionRequestManager::cancelPendingRequests() as it is unused and its implementation is wrong (modifies the hash maps it is iterating on). * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): Deleted. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: 2017-06-17 Chris Dumez Unreviewed, follow-up build fix after r218457. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-06-17 Chris Dumez Unreviewed, follow-up build fix after r218457. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-06-17 Chris Dumez Use WTF::Function instead of std::function in WebKit2/ https://bugs.webkit.org/show_bug.cgi?id=173504 Reviewed by Darin Adler. Use WTF::Function instead of std::function in WebKit2/ to avoid unnecessary copying. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): * DatabaseProcess/DatabaseProcess.h: * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheFileSystem.h: * Platform/IPC/Connection.cpp: (IPC::Connection::installIncomingSyncMessageCallback): * Platform/IPC/Connection.h: * Platform/IPC/glib/GSocketMonitor.h: * Platform/Logging.h: * Shared/API/APIObject.h: * Shared/AsyncRequest.cpp: (WebKit::AsyncRequest::AsyncRequest): (WebKit::AsyncRequest::setAbortHandler): * Shared/AsyncRequest.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/WebContextMenuItemData.h: * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::willSendRequest): * UIProcess/API/APIIconLoadingClient.h: (API::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPageAsync): * UIProcess/API/C/WKPage.cpp: (toGenericCallbackFunction): * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/mac/WKView.mm: (-[WKView maybeInstallIconLoadingClient]): * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/AcceleratedDrawingAreaProxy.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Cocoa/IconLoadingDelegate.h: * UIProcess/Cocoa/IconLoadingDelegate.mm: (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryAppLink): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::createNewPageAsync): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::start): * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::prepareForMoveToWindow): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): (WebKit::DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing): * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/GenericCallback.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/PageClient.h: * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::fetchWebsiteData): (WebKit::PluginProcessManager::deleteWebsiteData): (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames): * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::fetchWebsiteData): (WebKit::PluginProcessProxy::deleteWebsiteData): (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames): * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/ProcessAssertion.h: * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::backForwardListState): * UIProcess/WebBackForwardList.h: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::setCookieObserverCallback): (WebKit::WebCookieManagerProxy::cookiesDidChange): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setInitialFocus): (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::sessionState): (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getSamplingProfilerOutput): (WebKit::WebPageProxy::isWebProcessResponsive): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::createNewPage): (WebKit::WebPageProxy::getMarkedRangeAsync): (WebKit::WebPageProxy::getSelectedRangeAsync): (WebKit::WebPageProxy::characterIndexForPointAsync): (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): (WebKit::WebPageProxy::takeSnapshot): (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler): (WebKit::WebPageProxy::callAfterNextPresentationUpdate): (WebKit::WebPageProxy::getLoadDecisionForIcon): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::isResponsive): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.h: * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::XDamageNotifier::add): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::requestPasswordForQuickLookDocument): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::updateSelectionWithTouches): (WebKit::WebPageProxy::requestAutocorrectionData): (WebKit::WebPageProxy::applyAutocorrection): (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::selectTextWithGranularityAtPoint): (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection): (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection): (WebKit::WebPageProxy::selectPositionAtPoint): (WebKit::WebPageProxy::beginSelectionInDirection): (WebKit::WebPageProxy::updateSelectionWithExtentPoint): (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPageProxy::requestDictationContext): (WebKit::WebPageProxy::requestAutocorrectionContext): (WebKit::WebPageProxy::getSelectionContext): (WebKit::WebPageProxy::selectWithTwoTouches): (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset): (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText): (WebKit::WebPageProxy::moveSelectionByOffset): (WebKit::WebPageProxy::focusNextAssistedNode): (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/mac/WKTextFinderClient.mm: * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKSelectionHandlerWrapper initWithSelectionHandler:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): (WebKit::WebPageProxy::fontAtSelection): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard): (WebKit::WebPaymentCoordinator::openPaymentSetup): * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::willSendRequest): * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::dispatchAfterEnsuringUpdatedScrollPosition): * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::markLayersVolatile): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::markLayersVolatile): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::markAllLayersVolatile): * WebProcess/WebProcess.h: 2017-06-17 Alex Christensen Fix CMake build * CMakeLists.txt: * NetworkProcess/capture/NetworkCaptureEvent.cpp: * PlatformGTK.cmake: * PlatformWPE.cmake: 2017-06-17 Dan Bernstein Tried to fix non-iOS builds. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-06-17 Carlos Garcia Campos [GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib https://bugs.webkit.org/show_bug.cgi?id=173469 Reviewed by Michael Catanzaro. Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port. * PlatformGTK.cmake: * Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp. (WebKit::gtkStockIDFromContextMenuAction): (WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib): (WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib): (WebKit::WebContextMenuItemGlib::buildActionName): (WebKit::WebContextMenuItemGlib::createActionIfNeeded): * Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h. * UIProcess/API/gtk/WebKitContextMenu.cpp: (webkitContextMenuPopulate): * UIProcess/API/gtk/WebKitContextMenuActions.cpp: (webkitContextMenuActionGetForContextMenuItem): * UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h: * UIProcess/API/gtk/WebKitContextMenuItem.cpp: (webkitContextMenuItemCreate): (webkitContextMenuItemToWebContextMenuItemGlib): (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): * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h: * UIProcess/API/gtk/WebKitContextMenuPrivate.h: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewPopulateContextMenu): * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::WebContextMenuProxyGtk::append): (WebKit::WebContextMenuProxyGtk::buildMenu): (WebKit::WebContextMenuProxyGtk::populate): * UIProcess/gtk/WebContextMenuProxyGtk.h: 2017-06-16 Dan Bernstein [Cocoa] Some declarations have missing or incorrect availability attributes https://bugs.webkit.org/show_bug.cgi?id=173508 Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Removed a redundant attribute. In all of the below files, added missing availability attributes for declarations that have not appeared yet in any GM SDK, and fixed availability attributes for declarations that have already appeared in the macOS 10.12.3 and iOS 10.3 SDKs. * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/API/Cocoa/WKPreferences.h: Also fixed capitalization in a comment. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Also removed unnecessary conditionals. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _draggableElementAtPosition:]): Prepended an underscore to this private method’s name. (-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Ditto. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Also updated for renames. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/_WKWebViewPrintFormatter.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: 2017-06-16 Youenn Fablet [WebRTC] CrashTracer: Regression : com.apple.WebKit.Networking at WebKit: WebKit::LibWebRTCSocketClient::sendTo https://bugs.webkit.org/show_bug.cgi?id=173501 Reviewed by Eric Carlson. When a libwebrtc socket fails to be created in the network process, the network process sends back a close message, but it keeps it in a map. If the web process sends a message dedicated to this socket, we will try processing it and calling the socket which is null, hence the cache. This patch makes it so that if the socket is null, it is not added to the map. * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient): * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createSocket): (WebKit::NetworkRTCProvider::createUDPSocket): (WebKit::NetworkRTCProvider::createServerTCPSocket): (WebKit::NetworkRTCProvider::createClientTCPSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: 2017-06-16 Antoine Quint Add a WebKit2 setting to control whether media documents should automatically enter fullscreen https://bugs.webkit.org/show_bug.cgi?id=173503 Reviewed by Tim Horton. New WebKit2 setting to specify whether a media document should automatically enter fullscreen. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]): (-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-16 Sam Weinig [WebIDL] Remove custom bindings for HTMLDocument https://bugs.webkit.org/show_bug.cgi?id=173444 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp: (webkit_dom_html_document_get_link_color): (webkit_dom_html_document_set_link_color): Update for rename of linkColor to linkColorForBindings. 2017-06-16 Daniel Bates Cleanup: WebContextMenuClient::searchWithGoogle() should parse URL using URL { URL { }, ... } instead of URL { ParsedURLString, ... } https://bugs.webkit.org/show_bug.cgi?id=173495 Reviewed by Alex Christensen. URL(ParsedURLString, ...) should only be used with a string that was the result of URL::string(). Otherwise, it will cause an assertion failure if the canonicalized URL differs from the string. Although it is unlikely that the hardcoded string in WebContextMenuClient::searchWithGoogle() would differ from the canonicalized URL it is best practice to use URL(URL(), ...) to parse an arbitrary string that looks like a URL. Also modernize the code using C++14 idioms. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::searchWithGoogle): 2017-06-16 Wenson Hsieh [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit https://bugs.webkit.org/show_bug.cgi?id=173366 Reviewed by Tim Horton. Move pieces of iOS WebKit2 drag and drop implementation into OpenSource. No change in behavior. * Configurations/FeatureDefines.xcconfig: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::setDragImage): (WebKit::WebPageProxy::setPromisedDataForImage): (WebKit::WebPageProxy::setPromisedDataForAttachment): (WebKit::WebPageProxy::setDragCaretRect): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (longPressActionDelayAfterLift): (-[WKContentView webViewUIDelegate]): (-[WKContentView setupDataInteractionDelegates]): (-[WKContentView teardownDataInteractionDelegates]): (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]): (-[WKContentView _didHandleStartDataInteractionRequest:]): (uiImageForImage): (shouldUseTextIndicatorToCreatePreviewForDragAction): (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]): (-[WKContentView dragPreviewForCurrentDataInteractionState]): (-[WKContentView performDeferredActionAtDragOrigin]): (-[WKContentView cancelDeferredActionAtDragOrigin]): (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]): (dropOperationForWebCoreDragOperation): (-[WKContentView dragDataForDropSession:dragDestinationAction:]): (-[WKContentView cleanUpDragSourceSessionState]): (extractItemProvidersFromDragItems): (extractItemProvidersFromDropSession): (-[WKContentView _didConcludeEditDataInteraction:]): (-[WKContentView _didPerformDataInteractionControllerOperation:]): (-[WKContentView _transitionDragPreviewToImageIfNecessary:]): (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): (-[WKContentView _dragDestinationActionForDropSession:]): (positionInformationMayStartDataInteraction): (-[WKContentView currentDragOrDropSession]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView _api_dragInteraction:previewForLiftingItem:session:]): (-[WKContentView dragInteraction:sessionWillBegin:]): (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]): (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]): (-[WKContentView dropInteraction:canHandleSession:]): (-[WKContentView _api_dropInteraction:sessionDidEnter:]): (-[WKContentView _api_dropInteraction:sessionDidUpdate:]): (-[WKContentView dropInteraction:sessionDidExit:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]): (-[WKContentView dropInteraction:sessionDidEnd:]): (-[WKContentView _simulateDataInteractionEntered:]): (-[WKContentView _simulateDataInteractionUpdated:]): (-[WKContentView _simulateDataInteractionEnded:]): (-[WKContentView _simulateDataInteractionPerformOperation:]): (-[WKContentView _simulateDataInteractionSessionDidEnd:]): (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): (-[WKContentView _simulatedItemsForSession:]): (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertCGImageToBitmap): (WebKit::WebDragClient::startDrag): (WebKit::WebDragClient::declareAndWriteDragImage): (WebKit::WebDragClient::didConcludeEditDrag): (WebKit::WebDragClient::declareAndWriteAttachment): 2017-06-16 Youenn Fablet WebRTC sockets should be closed at destruction time if not closed explicitly https://bugs.webkit.org/show_bug.cgi?id=173479 Reviewed by Eric Carlson. * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::~LibWebRTCSocket): (WebKit::LibWebRTCSocket::Close): 2017-06-16 Chris Dumez [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies https://bugs.webkit.org/show_bug.cgi?id=173472 Reviewed by Brady Eidson. Add WKProcessPool SPI to efficiently reset all plugin load client policies: [WKProcessPool _resetPluginLoadClientPolicies]. This new SPI clears all existing policies and then sets all of them with new values, with a minimal amount of IPC. To achieve this, clients would previously have to call 1. WKContextClearPluginClientPolicies() which would cause a broadcast IPC to every WebContent process. 2. WKContextSetPluginLoadClientPolicy() repeatedly to add each policy one by one. Each call to WKContextSetPluginLoadClientPolicy() would cause a broadcast IPC to every WebContent process. The new SPI does the same job with a single broadcast IPC to every WebContent process. * UIProcess/API/Cocoa/WKProcessPool.mm: (isPluginLoadClientPolicyAcceptable): (toPluginLoadClientPoliciesHashMap): (policiesHashMapToDictionary): (-[WKProcessPool _resetPluginLoadClientPolicies:]): (-[WKProcessPool _pluginLoadClientPolicies]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setPluginLoadClientPolicy): (WebKit::WebProcessPool::resetPluginLoadClientPolicies): * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::resetPluginLoadClientPolicies): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-06-16 Brent Fulgham [WK2][macOS] Expand sandbox to better support video playback on mac mini https://bugs.webkit.org/show_bug.cgi?id=173492 Reviewed by Alex Christensen. Hardware differences in Mac Mini's require some different IOKit preferences to be accessible. * WebProcess/com.apple.WebProcess.sb.in: 2017-06-16 Brent Fulgham [WK2][iOS][macOS] Extend the sandbox to allow reading of AVFoundation's VideoPerformanceHUD preference https://bugs.webkit.org/show_bug.cgi?id=173476 Reviewed by Alex Christensen. Update the sandbox to permit WebContent process to read the AVFoundation preferences for the performance HUD. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2017-06-16 Daniel Bates Use the term icon instead of favicon https://bugs.webkit.org/show_bug.cgi?id=173400 Reviewed by Alex Christensen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): 2017-06-16 Carlos Garcia Campos [GTK][WPE] Remove WKCookieManagerSoup https://bugs.webkit.org/show_bug.cgi?id=173467 Reviewed by Michael Catanzaro. It's unused. * PlatformGTK.cmake: * PlatformWPE.cmake: * UIProcess/API/C/soup/WKCookieManagerSoup.cpp: Removed. * UIProcess/API/C/soup/WKCookieManagerSoup.h: Removed. 2017-06-16 Carlos Garcia Campos Unreviewed. Remove wrong headers check from some GTK+ API files. Remove the __WEBKIT_WEB_EXTENSION_H_INSIDE__ check since these are not actually shared. * UIProcess/API/gtk/WebKitEditorState.h: * UIProcess/API/gtk/WebKitOptionMenu.h: * UIProcess/API/gtk/WebKitPrintCustomWidget.h: 2017-06-15 Carlos Garcia Campos REGRESSION(r218325): [GTK] Runtime critical warnings running layout tests that show a popup menu https://bugs.webkit.org/show_bug.cgi?id=173421 Reviewed by Carlos Alberto Lopez Perez. In r218325 I forgot to create a WebKitPopupMenu or WebPopupMenuProxyGtk depending on whether the view is a WebKitWebView or not. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createPopupMenuProxy): 2017-06-15 Tim Horton Null deref under ViewGestureController::endSwipeGesture (navigationGestureDidEnd) https://bugs.webkit.org/show_bug.cgi?id=173441 Reviewed by Simon Fraser. This is a speculative fix for a crash that we don't have repro steps for. In a few places, ViewGestureController looks itself up by pageID (in cases where we're in an asynchronous callback), and then calls some function on it (endSwipeGesture, or something that will get there). However, if in the meantime an API client has turned the swipe gesture on and off, the page's ViewGestureController will be a different one than the one that originally started this process, with fresh state, and nullptrs in all sorts of places, ripe for dereferencing. To fix this, instead of just looking ViewGestureController up by pageID, also keep track of the current gestureID, process-wide (previously the gestureID was per-ViewGestureController), and only return the ViewGestureController if it's currently processing the same gesture that started the asynchronous task. * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::controllerForGesture): (WebKit::ViewGestureController::takeNextGestureID): (WebKit::ViewGestureController::willBeginGesture): (WebKit::ViewGestureController::didEndGesture): (WebKit::ViewGestureController::gestureControllerForPage): Deleted. * UIProcess/Cocoa/ViewGestureController.h: Add helpers that set and reset activeGestureType and currentGestureID together. Make gesture IDs process global, to avoid two ViewGestureControllers using the same IDs. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::didCollectGeometryForMagnificationGesture): (WebKit::ViewGestureController::handleMagnificationGestureEvent): (WebKit::ViewGestureController::endMagnificationGesture): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::forceRepaintIfNeeded): (WebKit::ViewGestureController::removeSwipeSnapshot): Adopt willBeginGesture/didEndGesture and controllerForGesture. 2017-06-15 Simon Fraser [iOS WK2] YouTube videos flash at the wrong place at the end of rotation https://bugs.webkit.org/show_bug.cgi?id=173445 rdar://problem/31584852 Reviewed by Tim Horton. In MobileSafari where WKWebView rotation uses _dynamicViewportUpdateModes, we could do a visibleContentRect update at the end of rotation which computed a bad layoutViewportRect, because it used a m_baseLayoutViewportSize from the old orientation. We have actually sent a new m_baseLayoutViewportSize to the UI process by this point in a layer tree commit, but _didCommitLayerTree: ignored it because we had a _dynamicViewportUpdateMode. Fix is to always update the layout viewport data from the web process, since during dynamic viewport updates, we still need these data to compute rectangles sent back to the web process via visible content rect updates. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect): (WebKit::WebPageProxy::updateLayoutViewportParameters): Cleanup. 2017-06-15 Wenson Hsieh Using -[WebItemProviderPasteboard setItemProviders:] to swap out item providers before a drop breaks item provider loading https://bugs.webkit.org/show_bug.cgi?id=173338 Reviewed by Tim Horton. Rename updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers. Also, introduce _webView:willPerformDropWithSession: as SPI on WKUIDelegate. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers): (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers): Deleted. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers): (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-06-15 Carlos Garcia Campos [GTK] Cleanup headers includes in GTK+ API files https://bugs.webkit.org/show_bug.cgi?id=173415 Reviewed by Michael Catanzaro. - Remove WTFGType.h from WebKitPrivate.h and include it in all other files instead of WebKitPrivate if needed. - Stop including WebKitPrivate.h in all other private headers. - Remove all C API includes. * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp: * UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h: * UIProcess/API/gtk/WebKitAutomationSession.cpp: * UIProcess/API/gtk/WebKitBackForwardList.cpp: * UIProcess/API/gtk/WebKitBackForwardListItem.cpp: * UIProcess/API/gtk/WebKitColorChooser.h: * UIProcess/API/gtk/WebKitColorChooserRequest.cpp: * UIProcess/API/gtk/WebKitContextMenu.cpp: * UIProcess/API/gtk/WebKitContextMenuItem.cpp: * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h: * UIProcess/API/gtk/WebKitContextMenuPrivate.h: * UIProcess/API/gtk/WebKitCookieManager.cpp: * UIProcess/API/gtk/WebKitCookieManagerPrivate.h: * UIProcess/API/gtk/WebKitCredentialPrivate.h: * UIProcess/API/gtk/WebKitDownload.cpp: * UIProcess/API/gtk/WebKitDownloadClient.cpp: * UIProcess/API/gtk/WebKitDownloadPrivate.h: * UIProcess/API/gtk/WebKitEditorState.cpp: * UIProcess/API/gtk/WebKitEditorStatePrivate.h: * UIProcess/API/gtk/WebKitError.cpp: * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: * UIProcess/API/gtk/WebKitFileChooserRequest.cpp: * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h: * UIProcess/API/gtk/WebKitFindController.cpp: * UIProcess/API/gtk/WebKitFormClient.cpp: * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp: * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h: * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp: * UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h: * UIProcess/API/gtk/WebKitHitTestResult.cpp: * UIProcess/API/gtk/WebKitHitTestResultPrivate.h: * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: * UIProcess/API/gtk/WebKitJavascriptResult.cpp: * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h: * UIProcess/API/gtk/WebKitMimeInfoPrivate.h: * UIProcess/API/gtk/WebKitNavigationActionPrivate.h: * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp: * UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h: * UIProcess/API/gtk/WebKitNetworkProxySettings.cpp: * UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h: * UIProcess/API/gtk/WebKitNotification.cpp: * UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp: * UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h: * UIProcess/API/gtk/WebKitNotificationPrivate.h: * UIProcess/API/gtk/WebKitOptionMenu.cpp: * UIProcess/API/gtk/WebKitPlugin.cpp: * UIProcess/API/gtk/WebKitPluginPrivate.h: * UIProcess/API/gtk/WebKitPolicyDecision.cpp: * UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h: * UIProcess/API/gtk/WebKitPrintCustomWidget.cpp: * UIProcess/API/gtk/WebKitPrintCustomWidgetPrivate.h: * UIProcess/API/gtk/WebKitPrintOperation.cpp: * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp: * UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h: * UIProcess/API/gtk/WebKitSecurityManager.cpp: * UIProcess/API/gtk/WebKitSecurityOrigin.cpp: * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h: * UIProcess/API/gtk/WebKitSettings.cpp: * UIProcess/API/gtk/WebKitUIClient.cpp: * UIProcess/API/gtk/WebKitURIRequest.cpp: * UIProcess/API/gtk/WebKitURIResponse.cpp: * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h: * UIProcess/API/gtk/WebKitUserContent.cpp: * UIProcess/API/gtk/WebKitUserContentManager.cpp: * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp: * UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h: * UIProcess/API/gtk/WebKitWebContext.cpp: * UIProcess/API/gtk/WebKitWebContextPrivate.h: * UIProcess/API/gtk/WebKitWebInspector.cpp: * UIProcess/API/gtk/WebKitWebInspectorPrivate.h: * UIProcess/API/gtk/WebKitWebResource.cpp: * UIProcess/API/gtk/WebKitWebResourcePrivate.h: * UIProcess/API/gtk/WebKitWebView.cpp: * UIProcess/API/gtk/WebKitWebViewBase.cpp: * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp: * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: * UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h: * UIProcess/API/gtk/WebKitWebsiteDataPrivate.h: * UIProcess/API/gtk/WebKitWindowProperties.cpp: * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h: * WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: 2017-06-15 Carlos Garcia Campos [GTK] Do not use the C API in WebGtkExtensionManager https://bugs.webkit.org/show_bug.cgi?id=173408 Reviewed by Michael Catanzaro. Use the C++ API instead. * WebProcess/gtk/WebGtkExtensionManager.cpp: (WebKit::parseUserData): (WebKit::WebGtkExtensionManager::initialize): * WebProcess/gtk/WebGtkExtensionManager.h: * WebProcess/gtk/WebGtkInjectedBundleMain.cpp: (WKBundleInitialize): 2017-06-15 Adrian Perez de Castro [GTK] Stop using GtkAction in WebPopupMenuProxyGtk https://bugs.webkit.org/show_bug.cgi?id=173417 Reviewed by Carlos Garcia Campos. This gets rid of GtkAction in WebPopupMenuProxyGtk, which was deprecated in GTK+ 3.10 and will not be available in GTK+ 4.0. Using GtkMenuItem directly makes populating long menus slightly faster, which can be noticeable in lower-end machines. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::populatePopupMenu): (WebKit::WebPopupMenuProxyGtk::menuItemActivated): (WebKit::WebPopupMenuProxyGtk::createGtkActionForMenuItem): Deleted. * UIProcess/gtk/WebPopupMenuProxyGtk.h: (WebKit::WebPopupMenuProxyGtk::setCurrentlySelectedMenuItem): Instantiate GtkMenuItem objects directly when populating the menu. 2017-06-15 Carlos Garcia Campos Unreviewed. Fix copy-paste error in GTK+ WEBKIT_JAVASCRIPT_ERROR definition. The print one was copied there. * UIProcess/API/gtk/WebKitError.h: 2017-06-15 Carlos Garcia Campos [GTK] Add API to allow overriding popup menus https://bugs.webkit.org/show_bug.cgi?id=172905 Reviewed by Michael Catanzaro. The GTK+ API uses GTK+ for the default implementation of several UI elements like the file chooser, print dialog, color picker, context menu, etc. but in all those cases it allows to override the default implementation. It's not possible to override the popup menu used for select elements. This patch adds WebKitOptionMenu to represent a select dropdown menu. It's passed as an argument of the new signal WebKitWebView::show-option-menu, and contains WebKitOptionMenuItem elements representing the items to be displayed. * PlatformGTK.cmake: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createPopupMenuProxy): Create a WebKitPopupMenu. * UIProcess/API/gtk/WebKitOptionMenu.cpp: Added. (webkitOptionMenuCreate): (webkit_option_menu_get_n_items): (webkit_option_menu_get_item): (webkit_option_menu_select_item): (webkit_option_menu_activate_item): (webkit_option_menu_close): * UIProcess/API/gtk/WebKitOptionMenu.h: Added. * UIProcess/API/gtk/WebKitOptionMenuItem.cpp: Added. (webkit_option_menu_item_copy): (webkit_option_menu_item_free): (webkit_option_menu_item_get_label): (webkit_option_menu_item_get_tooltip): (webkit_option_menu_item_is_group_label): (webkit_option_menu_item_is_group_child): (webkit_option_menu_item_is_enabled): (webkit_option_menu_item_is_selected): * UIProcess/API/gtk/WebKitOptionMenuItem.h: Added. * UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h: Added. (_WebKitOptionMenuItem::_WebKitOptionMenuItem): * UIProcess/API/gtk/WebKitOptionMenuPrivate.h: Added. * UIProcess/API/gtk/WebKitPopupMenu.cpp: Added. (WebKit::WebKitPopupMenu::WebKitPopupMenu): (WebKit::menuCloseCallback): (WebKit::WebKitPopupMenu::showPopupMenu): Call webkitWebViewShowOptionMenu() falling back to default implementation if the user didn't handle the signal. (WebKit::WebKitPopupMenu::hidePopupMenu): (WebKit::WebKitPopupMenu::cancelTracking): (WebKit::WebKitPopupMenu::selectItem): (WebKit::WebKitPopupMenu::activateItem): * UIProcess/API/gtk/WebKitPopupMenu.h: Added. * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewShowOptionMenu): Emit WebKitWebView::show-option-menu. * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols. * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add new get_type functions. * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new sections. * UIProcess/API/gtk/webkit2.h: Add new public headers. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk): Do not create the GtkMenu in constructor. (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Create the GtkMenu and connect to the signals here. (WebKit::WebPopupMenuProxyGtk::hidePopupMenu): Return early if the Gtk hasn't been shown. * UIProcess/gtk/WebPopupMenuProxyGtk.h: Make constructor and webview protected. 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage https://bugs.webkit.org/show_bug.cgi?id=173364 Reviewed by Michael Catanzaro. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkitWebPageCreate): (didInitiateLoadForResource): Deleted. (willSendRequestForFrame): Deleted. (didReceiveResponseForResource): Deleted. (didReceiveContentLengthForResource): Deleted. (didFinishLoadForResource): Deleted. (didFailLoadForResource): Deleted. 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::Client in WebKitWebExtension https://bugs.webkit.org/show_bug.cgi?id=173358 Reviewed by Michael Catanzaro. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (webkitWebExtensionCreate): (webkitWebExtensionPageCreated): Deleted. (webkitWebExtensionPageDestroy): Deleted. (webkitWebExtensionDidReceiveMessage): Deleted. (didCreatePage): Deleted. (willDestroyPage): Deleted. (didReceiveMessage): Deleted. (didReceiveMessageToPage): Deleted. 2017-06-15 Carlos Garcia Campos [GTK] Use API::NotificationProvider https://bugs.webkit.org/show_bug.cgi?id=173312 Reviewed by Žan Doberšek. Also cleanup a bit the WebKitNotificationProvider implementation, it doesn't need to be refcounted. * UIProcess/API/gtk/WebKitNotificationProvider.cpp: (WebKitNotificationProvider::WebKitNotificationProvider): (WebKitNotificationProvider::~WebKitNotificationProvider): (WebKitNotificationProvider::show): (WebKitNotificationProvider::clearNotifications): (WebKitNotificationProvider::notificationPermissions): (WebKitNotificationProvider::setNotificationPermissions): * UIProcess/API/gtk/WebKitNotificationProvider.h: * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (addOriginToMap): (webkit_web_context_initialize_notification_permissions): 2017-06-14 Carlos Garcia Campos Add API::InjectedBundle::ResourceLoadClient https://bugs.webkit.org/show_bug.cgi?id=173362 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h. (API::InjectedBundle::ResourceLoadClient::didInitiateLoadForResource): (API::InjectedBundle::ResourceLoadClient::willSendRequestForFrame): (API::InjectedBundle::ResourceLoadClient::didReceiveResponseForResource): (API::InjectedBundle::ResourceLoadClient::didReceiveContentLengthForResource): (API::InjectedBundle::ResourceLoadClient::didFinishLoadForResource): (API::InjectedBundle::ResourceLoadClient::didFailLoadForResource): (API::InjectedBundle::ResourceLoadClient::shouldCacheResponse): (API::InjectedBundle::ResourceLoadClient::shouldUseCredentialStorage): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetResourceLoadClient): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (setUpResourceLoadClient): (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp: (WebKit::InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient): (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame): (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource): (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource): (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::shouldCacheResponse): (WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage): * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebKit::WebFrameLoaderClient::dispatchWillSendRequest): (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse): (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): (WebKit::WebFrameLoaderClient::willCacheResponse): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInjectedBundleResourceLoadClient): (WebKit::WebPage::close): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::injectedBundleResourceLoadClient): 2017-06-14 Carlos Garcia Campos Add API::InjectedBundle::Client https://bugs.webkit.org/show_bug.cgi?id=173357 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h. (API::InjectedBundle::Client::didCreatePage): (API::InjectedBundle::Client::willDestroyPage): (API::InjectedBundle::Client::didInitializePageGroup): (API::InjectedBundle::Client::didReceiveMessage): (API::InjectedBundle::Client::didReceiveMessageToPage): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetClient): * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (webkitWebExtensionPageCreated): Deleted. (webkitWebExtensionPageDestroy): Deleted. (webkitWebExtensionDidReceiveMessage): Deleted. (didCreatePage): Deleted. (willDestroyPage): Deleted. (didReceiveMessage): Deleted. (didReceiveMessageToPage): Deleted. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setClient): (WebKit::InjectedBundle::didCreatePage): (WebKit::InjectedBundle::willDestroyPage): (WebKit::InjectedBundle::didInitializePageGroup): (WebKit::InjectedBundle::didReceiveMessage): (WebKit::InjectedBundle::didReceiveMessageToPage): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/InjectedBundle/InjectedBundleClient.cpp: (WebKit::InjectedBundleClient::InjectedBundleClient): (WebKit::InjectedBundleClient::didCreatePage): (WebKit::InjectedBundleClient::willDestroyPage): (WebKit::InjectedBundleClient::didInitializePageGroup): (WebKit::InjectedBundleClient::didReceiveMessage): (WebKit::InjectedBundleClient::didReceiveMessageToPage): * WebProcess/InjectedBundle/InjectedBundleClient.h: 2017-06-14 Carlos Garcia Campos WKErrorGetErrorCode should not return the API::Error enum values directly https://bugs.webkit.org/show_bug.cgi?id=173367 Reviewed by Alex Christensen. Even if the values are the same, we should use a switch to ensure we return the C API values, and not all API::Error enum values are exposed in the C API. * Shared/API/c/WKErrorRef.cpp: (WKErrorGetErrorCode): 2017-06-14 Commit Queue Unreviewed, rolling out r218285. https://bugs.webkit.org/show_bug.cgi?id=173391 API test fails on iOS (Requested by alexchristensen on #webkit). Reverted changeset: "Add SPI for immediate injection of user scripts" https://bugs.webkit.org/show_bug.cgi?id=173342 http://trac.webkit.org/changeset/218285 2017-06-14 Commit Queue Unreviewed, rolling out r218267. https://bugs.webkit.org/show_bug.cgi?id=173390 "The previous rollout of r218263, r218265, and r218266 by mlewis13 on bug 173383 missed r218267 and broke the GTK+ build" (Requested by clopez_ on #webkit). Reverted changeset: "[GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage" https://bugs.webkit.org/show_bug.cgi?id=173364 http://trac.webkit.org/changeset/218267 2017-06-14 Chris Dumez WebKit falsely reports that a web process is unresponsive if you close a page shortly after stopping a load https://bugs.webkit.org/show_bug.cgi?id=173384 Reviewed by Dan Bernstein. WebKit falsely reports that a web process is unresponsive if you close a page shortly after stopping a load. This is because WebPageProxy::stopLoad() starts the responsiveness timer and expects a StopResponsinessTimer IPC from the WebProcess to stop the timer so we don't report the process as unresponsive. However, if WebPageProxy::close() is called before the StopResponsinessTimer IPC has been received, the page will remove itself from the message receiver map and we would no longer be able to receive the StopResponsinessTimer IPC and stop the timer, even if the WebProcess sent it to the UIProcess. To address the issue, we now send the IPC Message to the WebProcessProxy instead of the WebPageProxy, so we can stop the responsiveness timer, even after the WebPageProxy has been called. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::stopResponsivenessTimer): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::SendStopResponsivenessTimer::~SendStopResponsivenessTimer): (WebKit::WebPage::tryClose): (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::stopLoading): (WebKit::WebPage::reload): (WebKit::WebPage::goForward): (WebKit::WebPage::goBack): (WebKit::WebPage::goToBackForwardItem): 2017-06-14 Commit Queue Unreviewed, rolling out r218263, r218265, and r218266. https://bugs.webkit.org/show_bug.cgi?id=173383 "These revisions caused multiple API test to Time out on macOS" (Requested by mlewis13 on #webkit). Reverted changesets: "Add API::InjectedBundle::Client" https://bugs.webkit.org/show_bug.cgi?id=173357 http://trac.webkit.org/changeset/218263 "[GTK] Use API::InjectedBundle::Client in WebKitWebExtension" https://bugs.webkit.org/show_bug.cgi?id=173358 http://trac.webkit.org/changeset/218265 "Add API::InjectedBundle::ResourceLoadClient" https://bugs.webkit.org/show_bug.cgi?id=173362 http://trac.webkit.org/changeset/218266 2017-06-14 Brent Fulgham [WK2][iOS] Remove dead-code "import "removed-dev-nodes.sb” from sandboxes (173378) https://bugs.webkit.org/show_bug.cgi?id=173378 Reviewed by Alexey Proskuryakov. Clean up the sandboxes to remove a couple of dead functions (and imports): 1. Remove the import "removed-dev-nodes.sb" from the sandbox, since this file is now empty. 2. Also remove the call to "instruments-support" as this is a no-op function in modern iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-06-14 Alex Christensen Add SPI for immediate injection of user scripts https://bugs.webkit.org/show_bug.cgi?id=173342 Reviewed by Brady Eidson. * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupAddUserScript): * UIProcess/API/C/WKUserContentControllerRef.cpp: (WKUserContentControllerAddUserScript): * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addUserScript:]): (-[WKUserContentController _addUserScriptImmediately:]): * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addUserScript): * UIProcess/UserContent/WebUserContentControllerProxy.h: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addUserScripts): (WebKit::WebUserContentController::addUserScriptInternal): If we are to inject the script internally, inject it into the appropriate pages. If we're injecting into the top frame only, there's no need to traverse the frame tree. (WebKit::WebUserContentController::addUserScript): * WebProcess/UserContent/WebUserContentController.h: * WebProcess/UserContent/WebUserContentController.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2017-06-14 Jonathan Bedard Configure screen scale for running layout tests on plus devices https://bugs.webkit.org/show_bug.cgi?id=173319 Reviewed by Tim Horton. * Platform/spi/ios/UIKitSPI.h: Both this and UIKitTestSPI.h define UIKeyboard. Use a define guard to prevent re-definition. 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage https://bugs.webkit.org/show_bug.cgi?id=173364 Reviewed by Michael Catanzaro. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkitWebPageCreate): (didInitiateLoadForResource): Deleted. (willSendRequestForFrame): Deleted. (didReceiveResponseForResource): Deleted. (didReceiveContentLengthForResource): Deleted. (didFinishLoadForResource): Deleted. (didFailLoadForResource): Deleted. 2017-06-14 Carlos Garcia Campos Add API::InjectedBundle::ResourceLoadClient https://bugs.webkit.org/show_bug.cgi?id=173362 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h. (API::InjectedBundle::ResourceLoadClient::didInitiateLoadForResource): (API::InjectedBundle::ResourceLoadClient::willSendRequestForFrame): (API::InjectedBundle::ResourceLoadClient::didReceiveResponseForResource): (API::InjectedBundle::ResourceLoadClient::didReceiveContentLengthForResource): (API::InjectedBundle::ResourceLoadClient::didFinishLoadForResource): (API::InjectedBundle::ResourceLoadClient::didFailLoadForResource): (API::InjectedBundle::ResourceLoadClient::shouldCacheResponse): (API::InjectedBundle::ResourceLoadClient::shouldUseCredentialStorage): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetResourceLoadClient): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (setUpResourceLoadClient): (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp: (WebKit::InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient): (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame): (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource): (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource): (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::shouldCacheResponse): (WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage): * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebKit::WebFrameLoaderClient::dispatchWillSendRequest): (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse): (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): (WebKit::WebFrameLoaderClient::willCacheResponse): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInjectedBundleResourceLoadClient): (WebKit::WebPage::close): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::injectedBundleResourceLoadClient): 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::Client in WebKitWebExtension https://bugs.webkit.org/show_bug.cgi?id=173358 Reviewed by Michael Catanzaro. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (webkitWebExtensionCreate): (webkitWebExtensionPageCreated): Deleted. (webkitWebExtensionPageDestroy): Deleted. (webkitWebExtensionDidReceiveMessage): Deleted. (didCreatePage): Deleted. (willDestroyPage): Deleted. (didReceiveMessage): Deleted. (didReceiveMessageToPage): Deleted. 2017-06-14 Carlos Garcia Campos Add API::InjectedBundle::Client https://bugs.webkit.org/show_bug.cgi?id=173357 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h. (API::InjectedBundle::Client::didCreatePage): (API::InjectedBundle::Client::willDestroyPage): (API::InjectedBundle::Client::didInitializePageGroup): (API::InjectedBundle::Client::didReceiveMessage): (API::InjectedBundle::Client::didReceiveMessageToPage): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetClient): * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (webkitWebExtensionPageCreated): Deleted. (webkitWebExtensionPageDestroy): Deleted. (webkitWebExtensionDidReceiveMessage): Deleted. (didCreatePage): Deleted. (willDestroyPage): Deleted. (didReceiveMessage): Deleted. (didReceiveMessageToPage): Deleted. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setClient): (WebKit::InjectedBundle::didCreatePage): (WebKit::InjectedBundle::willDestroyPage): (WebKit::InjectedBundle::didInitializePageGroup): (WebKit::InjectedBundle::didReceiveMessage): (WebKit::InjectedBundle::didReceiveMessageToPage): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/InjectedBundle/InjectedBundleClient.cpp: (WebKit::InjectedBundleClient::InjectedBundleClient): (WebKit::InjectedBundleClient::didCreatePage): (WebKit::InjectedBundleClient::willDestroyPage): (WebKit::InjectedBundleClient::didInitializePageGroup): (WebKit::InjectedBundleClient::didReceiveMessage): (WebKit::InjectedBundleClient::didReceiveMessageToPage): * WebProcess/InjectedBundle/InjectedBundleClient.h: 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundleClient in WebKitInjectedBundleClient https://bugs.webkit.org/show_bug.cgi?id=173351 Reviewed by Michael Catanzaro. Instead of the C API. * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp: (attachInjectedBundleClientToContext): (didReceiveWebViewMessageFromInjectedBundle): Deleted. (didReceiveMessageFromInjectedBundle): Deleted. (getInjectedBundleInitializationUserData): Deleted. 2017-06-14 Carlos Garcia Campos Add API::InjectedBundleClient https://bugs.webkit.org/show_bug.cgi?id=173350 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * UIProcess/API/APIInjectedBundleClient.h: Copied from Source/WebKit2/UIProcess/WebContextInjectedBundleClient.h. (API::InjectedBundleClient::didReceiveMessageFromInjectedBundle): (API::InjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle): (API::InjectedBundleClient::getInjectedBundleInitializationUserData): * UIProcess/API/C/WKContext.cpp: (WKContextSetInjectedBundleClient): * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextDispose): * UIProcess/WebContextInjectedBundleClient.cpp: (WebKit::WebContextInjectedBundleClient::WebContextInjectedBundleClient): (WebKit::WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle): (WebKit::WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle): (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData): * UIProcess/WebContextInjectedBundleClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::setInjectedBundleClient): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::handleMessage): (WebKit::WebProcessPool::handleSynchronousMessage): * UIProcess/WebProcessPool.h: * WebKit2.xcodeproj/project.pbxproj: 2017-06-14 Carlos Garcia Campos Add API::NotificationProvider https://bugs.webkit.org/show_bug.cgi?id=173309 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * UIProcess/API/APINotificationProvider.h: Copied from Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.h. (API::NotificationProvider::show): (API::NotificationProvider::cancel): (API::NotificationProvider::didDestroyNotification): (API::NotificationProvider::clearNotifications): (API::NotificationProvider::addNotificationManager): (API::NotificationProvider::removeNotificationManager): (API::NotificationProvider::notificationPermissions): * UIProcess/API/C/WKNotificationManager.cpp: (WKNotificationManagerSetProvider): * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy): (WebKit::WebNotificationManagerProxy::setProvider): (WebKit::WebNotificationManagerProxy::processPoolDestroyed): (WebKit::WebNotificationManagerProxy::notificationPermissions): (WebKit::WebNotificationManagerProxy::show): (WebKit::WebNotificationManagerProxy::cancel): (WebKit::WebNotificationManagerProxy::didDestroyNotification): (WebKit::WebNotificationManagerProxy::clearNotifications): * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/Notifications/WebNotificationProvider.cpp: (WebKit::WebNotificationProvider::WebNotificationProvider): (WebKit::WebNotificationProvider::show): (WebKit::WebNotificationProvider::cancel): (WebKit::WebNotificationProvider::didDestroyNotification): (WebKit::WebNotificationProvider::addNotificationManager): (WebKit::WebNotificationProvider::removeNotificationManager): (WebKit::WebNotificationProvider::notificationPermissions): * UIProcess/Notifications/WebNotificationProvider.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * WebKit2.xcodeproj/project.pbxproj: 2017-06-14 Carlos Garcia Campos API clients should not be passed by value to the setters https://bugs.webkit.org/show_bug.cgi?id=173266 Reviewed by Alex Christensen. By using a rvalue reference we make it more explicit that the ownership is transferred and we avoid the parameter construction. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setClient): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::setProvider): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::setClient): * UIProcess/WebIconDatabase.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::setHistoryClient): (WebKit::WebPageProxy::setNavigationClient): (WebKit::WebPageProxy::setLoaderClient): (WebKit::WebPageProxy::setPolicyClient): (WebKit::WebPageProxy::setFormClient): (WebKit::WebPageProxy::setUIClient): (WebKit::WebPageProxy::setIconLoadingClient): (WebKit::WebPageProxy::setFindClient): (WebKit::WebPageProxy::setFindMatchesClient): (WebKit::WebPageProxy::setDiagnosticLoggingClient): (WebKit::WebPageProxy::setContextMenuClient): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::setFullscreenClient): (WebKit::WebPageProxy::getLoadDecisionForIcon): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setHistoryClient): (WebKit::WebProcessPool::setDownloadClient): (WebKit::WebProcessPool::setAutomationClient): * UIProcess/WebProcessPool.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInjectedBundleContextMenuClient): (WebKit::WebPage::setInjectedBundleEditorClient): (WebKit::WebPage::setInjectedBundleFormClient): (WebKit::WebPage::setInjectedBundlePageLoaderClient): (WebKit::WebPage::setInjectedBundleUIClient): * WebProcess/WebPage/WebPage.h: 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::EditorClient in WebKitWebEditor https://bugs.webkit.org/show_bug.cgi?id=173355 Reviewed by Žan Doberšek. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: (webkitWebEditorCreate): (didChangeSelection): Deleted. 2017-06-14 Carlos Garcia Campos Unreviewed. Fix GTK+ build with GCC 4.9 after r218244. It seems that GCC 4.9 gets confused by enum named General and value of Print enum named General too. This renames the Print enum value as Generic. * Shared/API/APIError.h: * Shared/gtk/WebErrorsGtk.cpp: (WebKit::printError): * UIProcess/API/gtk/WebKitPrivate.cpp: (toWebKitError): (toWebCoreError): 2017-06-13 Carlos Garcia Campos Do not mix C and C++ API error constants https://bugs.webkit.org/show_bug.cgi?id=173311 Reviewed by Alex Christensen. In r214934 I added error constants to API::Error, but not for all errors exposed in the C API. Because of this we are mixing both constants in WebErrors and in GTk+ WebKitPrivate. * Shared/API/APIError.h: * Shared/WebErrors.cpp: (WebKit::blockedError): (WebKit::blockedByContentBlockerError): (WebKit::cannotShowURLError): (WebKit::interruptedForPolicyChangeError): (WebKit::blockedByContentFilterError): (WebKit::cannotShowMIMETypeError): (WebKit::pluginWillHandleLoadError): (WebKit::internalError): * UIProcess/API/gtk/WebKitPrivate.cpp: (toWebKitError): (toWebCoreError): 2017-06-13 Matt Rajca WebsitePolicies: let clients select specific autoplay quirks https://bugs.webkit.org/show_bug.cgi?id=173343 Reviewed by Alex Christensen. Replace the 'allowsAutoplayQuirks' bool with an OptionSet so clients can selectively pick auto-play quirks. * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::encode): (WebKit::WebsitePolicies::decode): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): (WKWebsitePoliciesGetAllowedAutoplayQuirks): (WKWebsitePoliciesSetAllowsAutoplayQuirks): Deleted. (WKWebsitePoliciesGetAllowsAutoplayQuirks): Deleted. * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): (-[_WKWebsitePolicies allowedAutoplayQuirks]): (-[_WKWebsitePolicies setAllowsAutoplayQuirks:]): Deleted. (-[_WKWebsitePolicies allowsAutoplayQuirks]): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateWebsitePolicies): 2017-06-13 Wenson Hsieh Add missing availability declarations to SPI in WKUIDelegatePrivate.h https://bugs.webkit.org/show_bug.cgi?id=173336 Reviewed by Tim Horton. Add missing availability macros to two recently-introduced SPI delegate methods. No change in behavior. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-06-13 Chris Dumez Add API::InjectedBundle::PageLoaderClient https://bugs.webkit.org/show_bug.cgi?id=173265 Reviewed by Alex Christensen. Add missing null check that is causing crashes on iOS. * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::userAgentForURL): 2017-06-13 Brent Fulgham [WK2][macOS] Allow AppleEvents in Citrix View Plugin https://bugs.webkit.org/show_bug.cgi?id=173280 Reviewed by Alexey Proskuryakov. A slightly better fix: Allow AppleEvents for non-sandboxed plugins. This should avoid inadvertently breaking custom plugins, etc. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): Switch check from a specific Citrix test, to just allowing non-sandboxed plugins to use AppleEvents. 2017-06-13 Chris Dumez Include PID in some UIProcess-side release logging that relates to a particular WebProcess https://bugs.webkit.org/show_bug.cgi?id=173299 Reviewed by Ryosuke Niwa. * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::setResponsive): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedCPULimit): 2017-06-13 Daniel Bates Implement W3C Secure Contexts Draft Specification https://bugs.webkit.org/show_bug.cgi?id=158121 Reviewed by Brent Fulgham. Part 4 Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetIsSecureContextAttributeEnabled): (WKPreferencesGetIsSecureContextAttributeEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-13 Brent Fulgham [WK2][macOS] Allow AppleEvents in Citrix View Plugin https://bugs.webkit.org/show_bug.cgi?id=173280 Reviewed by Alexey Proskuryakov. Allow the Citrix Viewer plugin to issue Apple Events. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): Allow AppleEvents for the Citrix Viewer plugin. 2017-06-13 Carlos Garcia Campos [GTK] Blob download doesn't work https://bugs.webkit.org/show_bug.cgi?id=172442 Reviewed by Carlos Alberto Lopez Perez. GTK+ API uses URIs for download destination paths, and passes that URIs to the WebKit internals. But WebKit expects download destination location to be a local path. This is not a problem for normal downloads, because the soup backend handles the cases of download destination being a URI and a path. For blob downloads NetworkDataTaskBlob is used, and it always expects the download destination to be a local path, failing in FileSystem::openFile() when a URI is passed. We need to keep using local files internally and convert to URIs only when exposing those paths to the API. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::download): Stop handling URIs here, we should always expect local files. * UIProcess/API/gtk/WebKitDownload.cpp: (webkitDownloadDecideDestinationWithSuggestedFilename): Convert destination URI to filanme before pasing it to DownloadClient. (webkitDownloadDestinationCreated): Convert the destination path to a URI before passing it to WebKitDownload::created-destionation signal. * UIProcess/API/gtk/WebKitDownloadClient.cpp: * UIProcess/API/gtk/WebKitDownloadPrivate.h: 2017-06-13 Wenson Hsieh Unable to paste text that was copied from a page into the universal search field https://bugs.webkit.org/show_bug.cgi?id=173293 Reviewed by Ryosuke Niwa. Add boilerplate SPI on WKPreferences to enable JavaScript access to copy and paste. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setJavaScriptCanAccessClipboard:]): (-[WKPreferences _javaScriptCanAccessClipboard]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-06-13 Sam Weinig Rename JSDOMWindowShell to JSDOMWindowProxy to match the HTML5 spec. https://bugs.webkit.org/show_bug.cgi?id=80733 Reviewed by Chris Dumez. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::windowScriptNPObject): 2017-06-13 Carlos Garcia Campos Unreviewed. Remove unused code from GTK+ WebKitPrivate. * UIProcess/API/gtk/WebKitPrivate.cpp: (wkEventModifiersToGdkModifiers): Deleted. (wkEventMouseButtonToWebKitMouseButton): Deleted. * UIProcess/API/gtk/WebKitPrivate.h: 2017-06-13 Carlos Garcia Campos Unreviewed. Fix return value of PageLoaderClient::shouldGoToBackForwardListItem after r218164. It should return true as InjectedBundlePageLoaderClient does. This caused several timeouts in GTK+ unit tests after r218171. * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: (API::InjectedBundle::PageLoaderClient::shouldGoToBackForwardListItem): 2017-06-13 Carlos Garcia Campos [GTK] Use API::GeolocationProvider in WebKitGeolocationProvider https://bugs.webkit.org/show_bug.cgi?id=173151 Reviewed by Žan Doberšek. Also cleanup a bit the WebKitGeolocationProvider implementation, it doesn't need to be refcounted. * UIProcess/API/gtk/WebKitGeolocationProvider.cpp: (WebKit::GeolocationProvider::GeolocationProvider): (WebKit::WebKitGeolocationProvider::~WebKitGeolocationProvider): (WebKit::WebKitGeolocationProvider::WebKitGeolocationProvider): (toGeolocationProvider): Deleted. (startUpdatingCallback): Deleted. (stopUpdatingCallback): Deleted. (WebKitGeolocationProvider::~WebKitGeolocationProvider): Deleted. (WebKitGeolocationProvider::create): Deleted. (WebKitGeolocationProvider::WebKitGeolocationProvider): Deleted. (WebKitGeolocationProvider::startUpdating): Deleted. (WebKitGeolocationProvider::stopUpdating): Deleted. (WebKitGeolocationProvider::notifyPositionChanged): Deleted. (WebKitGeolocationProvider::notifyErrorOccurred): Deleted. * UIProcess/API/gtk/WebKitGeolocationProvider.h: * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): 2017-06-13 Carlos Garcia Campos [GTK] Use API::IconDatabaseClient in WebKitFaviconDatabase https://bugs.webkit.org/show_bug.cgi?id=173146 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate): (webkitFaviconDatabaseCreate): (didChangeIconForPageURLCallback): Deleted. (iconDataReadyForPageURLCallback): Deleted. 2017-06-13 Carlos Garcia Campos [GTK] Use API::InjectedBundle::PageLoaderClient in WebKitWebPage https://bugs.webkit.org/show_bug.cgi?id=173304 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkitWebPageCreate): (getDocumentLoaderURL): Deleted. (didStartProvisionalLoadForFrame): Deleted. (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted. (didSameDocumentNavigationForFrame): Deleted. (didCommitLoadForFrame): Deleted. (didFinishDocumentLoadForFrame): Deleted. (didClearWindowObjectForFrame): Deleted. 2017-06-13 Gwang Yoon Hwang [GStreamerGL] Release GstVideoFrame when there is a flush event from the pipeline https://bugs.webkit.org/show_bug.cgi?id=172427 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::texmapGL): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: Provides current texmapGL to platform layer proxies to create and copy bitmap textures. 2017-06-13 Youenn Fablet Switch off Legacy WebRTC API flag by default https://bugs.webkit.org/show_bug.cgi?id=173241 Reviewed by Sam Weinig. * Shared/WebPreferencesDefinitions.h: 2017-06-12 Carlos Garcia Campos Add API::GeolocationProvider https://bugs.webkit.org/show_bug.cgi?id=173150 Reviewed by Alex Christensen. It will be used by GTK+ port instead of the C API. * UIProcess/API/APIGeolocationProvider.h: Added. (API::GeolocationProvider::~GeolocationProvider): (API::GeolocationProvider::startUpdating): (API::GeolocationProvider::stopUpdating): (API::GeolocationProvider::setEnableHighAccuracy): * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerSetProvider): * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy): (WebKit::WebGeolocationManagerProxy::setProvider): (WebKit::WebGeolocationManagerProxy::processPoolDestroyed): (WebKit::WebGeolocationManagerProxy::startUpdating): (WebKit::WebGeolocationManagerProxy::removeRequester): (WebKit::WebGeolocationManagerProxy::setEnableHighAccuracy): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebGeolocationProvider.cpp: (WebKit::WebGeolocationProvider::WebGeolocationProvider): (WebKit::WebGeolocationProvider::startUpdating): (WebKit::WebGeolocationProvider::stopUpdating): (WebKit::WebGeolocationProvider::setEnableHighAccuracy): * UIProcess/WebGeolocationProvider.h: * WebKit2.xcodeproj/project.pbxproj: 2017-06-12 Carlos Garcia Campos Add API::InjectedBundle::PageLoaderClient https://bugs.webkit.org/show_bug.cgi?id=173265 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: Added. (API::InjectedBundle::PageLoaderClient::willLoadURLRequest): (API::InjectedBundle::PageLoaderClient::willLoadDataRequest): (API::InjectedBundle::PageLoaderClient::shouldGoToBackForwardListItem): (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame): (API::InjectedBundle::PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): (API::InjectedBundle::PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): (API::InjectedBundle::PageLoaderClient::didCommitLoadForFrame): (API::InjectedBundle::PageLoaderClient::didFinishDocumentLoadForFrame): (API::InjectedBundle::PageLoaderClient::didFinishLoadForFrame): (API::InjectedBundle::PageLoaderClient::didFinishProgress): (API::InjectedBundle::PageLoaderClient::didFailLoadWithErrorForFrame): (API::InjectedBundle::PageLoaderClient::didSameDocumentNavigationForFrame): (API::InjectedBundle::PageLoaderClient::didReceiveTitleForFrame): (API::InjectedBundle::PageLoaderClient::didRemoveFrameFromHierarchy): (API::InjectedBundle::PageLoaderClient::didDisplayInsecureContentForFrame): (API::InjectedBundle::PageLoaderClient::didRunInsecureContentForFrame): (API::InjectedBundle::PageLoaderClient::didDetectXSSForFrame): (API::InjectedBundle::PageLoaderClient::didFirstLayoutForFrame): (API::InjectedBundle::PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): (API::InjectedBundle::PageLoaderClient::didLayoutForFrame): (API::InjectedBundle::PageLoaderClient::didReachLayoutMilestone): (API::InjectedBundle::PageLoaderClient::didClearWindowObjectForFrame): (API::InjectedBundle::PageLoaderClient::didCancelClientRedirectForFrame): (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame): (API::InjectedBundle::PageLoaderClient::didHandleOnloadEventsForFrame): (API::InjectedBundle::PageLoaderClient::globalObjectIsAvailableForFrame): (API::InjectedBundle::PageLoaderClient::willDisconnectDOMWindowExtensionFromGlobalObject): (API::InjectedBundle::PageLoaderClient::didReconnectDOMWindowExtensionToGlobalObject): (API::InjectedBundle::PageLoaderClient::willDestroyGlobalObjectForDOMWindowExtension): (API::InjectedBundle::PageLoaderClient::shouldForceUniversalAccessFromLocalURL): (API::InjectedBundle::PageLoaderClient::featuresUsedInPage): (API::InjectedBundle::PageLoaderClient::willDestroyFrame): (API::InjectedBundle::PageLoaderClient::userAgentForURL): (API::InjectedBundle::PageLoaderClient::layoutMilestones): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetPageLoaderClient): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::InjectedBundlePageLoaderClient): (WebKit::InjectedBundlePageLoaderClient::willLoadURLRequest): (WebKit::InjectedBundlePageLoaderClient::willLoadDataRequest): (WebKit::InjectedBundlePageLoaderClient::shouldGoToBackForwardListItem): (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didFailProvisionalLoadWithErrorForFrame): (WebKit::InjectedBundlePageLoaderClient::didCommitLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didFinishLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didFinishProgress): (WebKit::InjectedBundlePageLoaderClient::didFailLoadWithErrorForFrame): (WebKit::InjectedBundlePageLoaderClient::didSameDocumentNavigationForFrame): (WebKit::InjectedBundlePageLoaderClient::didReceiveTitleForFrame): (WebKit::InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy): (WebKit::InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame): (WebKit::InjectedBundlePageLoaderClient::didRunInsecureContentForFrame): (WebKit::InjectedBundlePageLoaderClient::didDetectXSSForFrame): (WebKit::InjectedBundlePageLoaderClient::didFirstLayoutForFrame): (WebKit::InjectedBundlePageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): (WebKit::InjectedBundlePageLoaderClient::didLayoutForFrame): (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone): (WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame): (WebKit::InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame): (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame): (WebKit::InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame): (WebKit::InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame): (WebKit::InjectedBundlePageLoaderClient::willDisconnectDOMWindowExtensionFromGlobalObject): (WebKit::InjectedBundlePageLoaderClient::didReconnectDOMWindowExtensionToGlobalObject): (WebKit::InjectedBundlePageLoaderClient::willDestroyGlobalObjectForDOMWindowExtension): (WebKit::InjectedBundlePageLoaderClient::shouldForceUniversalAccessFromLocalURL): (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage): (WebKit::InjectedBundlePageLoaderClient::userAgentForURL): (WebKit::InjectedBundlePageLoaderClient::layoutMilestones): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::detachedFromParent2): (WebKit::WebFrameLoaderClient::dispatchDidDispatchOnloadEvents): (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailLoad): (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad): (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone): (WebKit::WebFrameLoaderClient::dispatchDidLayout): (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem): (WebKit::WebFrameLoaderClient::didDisplayInsecureContent): (WebKit::WebFrameLoaderClient::didRunInsecureContent): (WebKit::WebFrameLoaderClient::didDetectXSS): (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld): (WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable): (WebKit::WebFrameLoaderClient::dispatchWillDisconnectDOMWindowExtensionFromGlobalObject): (WebKit::WebFrameLoaderClient::dispatchDidReconnectDOMWindowExtensionToGlobalObject): (WebKit::WebFrameLoaderClient::dispatchWillDestroyGlobalObjectForDOMWindowExtension): (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL): * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: (WebKit::WebProgressTrackerClient::progressFinished): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInjectedBundlePageLoaderClient): (WebKit::WebPage::close): (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::userAgent): (WebKit::WebPage::reportUsedFeatures): (WebKit::WebPage::dispatchDidReachLayoutMilestone): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::injectedBundleLoaderClient): 2017-06-12 Simon Fraser [iOS WK2] Peeking on an image could result in a preview at the wrong size https://bugs.webkit.org/show_bug.cgi?id=173274 rdar://problem/30404627 Reviewed by Tim Horton. There were a couple of issues with the way the page scale is communicated between the web process and the UI process. Generally, the page scale is computed by the web process, and sent to the UI process via layer tree commits. UI-side scale is them communicated back to the web process via visibleContentRect updates. When receiving a new scale, WebPage has a "scale was set by the UI process" flag to handle the case where user interaction overrides the viewport-computed page scale. However, this flag would get set erroneously in a couple of situations. First, during page loading, layer flushing is suspended temporarily, so web process scale changes never make it to the UI process. In that scenario, the UI process could send an old scale back to the web process, setting the "scale was set by the UI process" when it really wasn't. Secondly, web -> UI layer commit messages, and UI -> web updateVisibleContentRect messages can be in flight at the same time, again causing a stale scale to reach the web process. Fix this by only setting the "scale was set by the UI process" when we know the UI scale should be in sync, by comparing commit IDs of sent and received scales. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::scaleFromUIProcess): (WebKit::WebPage::updateVisibleContentRects): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: (WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID): 2017-06-12 Alex Christensen Modernize UserScript.h https://bugs.webkit.org/show_bug.cgi?id=173273 Reviewed by Tim Horton. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupAddUserScript): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::addUserScript): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addUserScript): * WebProcess/WebPage/WebPage.h: 2017-06-12 Tim Horton [iOS] Cmd-C doesn't copy text from WKWebView https://bugs.webkit.org/show_bug.cgi?id=173277 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _lookupForWebView:]): (-[WKContentView _shareForWebView:]): (-[WKContentView _addShortcutForWebView:]): (-[WKContentView _promptForReplaceForWebView:]): (-[WKContentView _transliterateChineseForWebView:]): (-[WKContentView _reanalyzeForWebView:]): (-[WKContentView replaceForWebView:]): (-[WKContentView canPerformAction:withSender:]): (-[WKContentView copyForWebView:]): (-[WKContentView cutForWebView:]): (-[WKContentView pasteForWebView:]): (-[WKContentView selectForWebView:]): (-[WKContentView selectAllForWebView:]): (-[WKContentView toggleBoldfaceForWebView:]): (-[WKContentView toggleItalicsForWebView:]): (-[WKContentView toggleUnderlineForWebView:]): (-[WKContentView _showTextStyleOptionsForWebView:]): (-[WKContentView _defineForWebView:]): (-[WKContentView _arrowKeyForWebView:]): (-[WKContentView _lookup:]): Deleted. (-[WKContentView _share:]): Deleted. (-[WKContentView _addShortcut:]): Deleted. (-[WKContentView _promptForReplace:]): Deleted. (-[WKContentView _transliterateChinese:]): Deleted. (-[WKContentView _reanalyze:]): Deleted. (-[WKContentView replace:]): Deleted. (-[WKContentView copy:]): Deleted. (-[WKContentView cut:]): Deleted. (-[WKContentView paste:]): Deleted. (-[WKContentView select:]): Deleted. (-[WKContentView selectAll:]): Deleted. (-[WKContentView toggleBoldface:]): Deleted. (-[WKContentView toggleItalics:]): Deleted. (-[WKContentView toggleUnderline:]): Deleted. (-[WKContentView _showTextStyleOptions:]): Deleted. (-[WKContentView _define:]): Deleted. (-[WKContentView _arrowKey:]): Deleted. Similar to what r211897 did for canPerformAction, and other patches have done for other selectors, forward methods for standard editing commands from WKContentView up to WKWebView, and back down to WKContentView. This is necessary because these are not treated as normal responder-chain-respecting methods, so they do not bubble up the view tree. In 211897, WKContentView (who is usually first responder and thus receives the actions) stopped claiming to be able to perform these actions, depending on this non-existent bubbling behavior to keep them working. 2017-06-12 Chris Dumez Null dereference under WebProcessPool::pageRemovedFromProcess() https://bugs.webkit.org/show_bug.cgi?id=173271 Reviewed by Ryosuke Niwa. Null-check networkProcess() before dereferencing it in WebProcessPool::pageRemovedFromProcess(). This is the only place in this class where we failed to null check before dereferencing networkProcess(). To my knowledge, there is no guarantee there is a network process. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageRemovedFromProcess): 2017-06-12 Jiewen Tan [WebCrypto] Remove experimental feature flag of SubtleCrypto https://bugs.webkit.org/show_bug.cgi?id=173197 Reviewed by Brent Fulgham. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubtleCryptoEnabled): Deleted. (WKPreferencesGetSubtleCryptoEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-12 Wenson Hsieh [iOS DnD] Allow the injected bundle to add client data when writing an image to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=173238 Reviewed by Ryosuke Niwa and Tim Horton. Send PasteboardImage.clientTypes and PasteboardImage.clientData over IPC. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeClientTypesAndData): (IPC::decodeClientTypesAndData): Factor out common logic used to encode and decode client types and data into static helpers. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-06-12 Wenson Hsieh [iOS DnD] Introduce hooks to override targeted drag previews when lifting and cancelling https://bugs.webkit.org/show_bug.cgi?id=173240 Reviewed by Ryosuke Niwa and Tim Horton. Adds two new delegate hooks: _webView:previewForLiftingItem:session: and _webView:previewForCancellingItem:withDefault:. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-06-12 Chris Dumez Regression(r217867): Legacy SessionHistoryEntryData format should not change https://bugs.webkit.org/show_bug.cgi?id=173267 Reviewed by Simon Fraser. Revert changes to Legacy SessionHistoryEntryData format that were made in r217867, as this apparently breaks compatiblity. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeFrameStateNode): (WebKit::decodeBackForwardTreeNode): 2017-06-12 Brent Fulgham [WK2][macOS] Alow iokit-get-properties for additional media features https://bugs.webkit.org/show_bug.cgi?id=173082 Reviewed by Alex Christensen. * WebProcess/com.apple.WebProcess.sb.in: 2017-06-12 Carlos Garcia Campos Add API::IconDatabaseClient https://bugs.webkit.org/show_bug.cgi?id=173145 Reviewed by Alex Christensen. It will be used by GTK+ port instead of the C API. * UIProcess/API/APIIconDatabaseClient.h: (API::IconDatabaseClient::~IconDatabaseClient): (API::IconDatabaseClient::didChangeIconForPageURL): (API::IconDatabaseClient::didRemoveAllIcons): (API::IconDatabaseClient::iconDataReadyForPageURL): * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseSetIconDatabaseClient): * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::WebIconDatabase): (WebKit::WebIconDatabase::setClient): (WebKit::WebIconDatabase::didChangeIconForPageURL): (WebKit::WebIconDatabase::didRemoveAllIcons): (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL): * UIProcess/WebIconDatabase.h: * UIProcess/WebIconDatabaseClient.cpp: (WebKit::WebIconDatabaseClient::WebIconDatabaseClient): (WebKit::WebIconDatabaseClient::didChangeIconForPageURL): (WebKit::WebIconDatabaseClient::didRemoveAllIcons): (WebKit::WebIconDatabaseClient::iconDataReadyForPageURL): * UIProcess/WebIconDatabaseClient.h: * WebKit2.xcodeproj/project.pbxproj: 2017-06-12 Carlos Garcia Campos [GTK] Stop dismissing menus attached to the web view for every injected event https://bugs.webkit.org/show_bug.cgi?id=172708 Reviewed by Alex Christensen. To actually simulate a right-click event we should also send the button release after the press, and let the page handle the events in addition to sending the event to the context menu controller, like we do with normal events. So, this is mostly the same as a real right-click event but without actually showing the menu. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::contextMenuAtPointInWindow): 2017-06-12 Daewoong Jang [CoordinatedGraphics] Behavior change of DrawingAreaImpl after r217779 https://bugs.webkit.org/show_bug.cgi?id=173153 Reviewed by Carlos Garcia Campos. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): 2017-06-12 Carlos Garcia Campos [GTK] Prefer to use private WebKitWebView API over WebKitWebViewBase https://bugs.webkit.org/show_bug.cgi?id=173254 Reviewed by Žan Doberšek. WebKitWebViewBase is specific to the GTK+ API, but WebKitWebView should be present in any glib-based API. Add webkitWebViewCreatePage() and webkitWebViewGetPage() and use them when possible instead of the WebKitWebViewBase ones. * UIProcess/API/gtk/WebKitAutomationSession.cpp: * UIProcess/API/gtk/WebKitContextMenuClient.cpp: (attachContextMenuClientToView): * UIProcess/API/gtk/WebKitFindController.cpp: (getPage): (webkitFindControllerDispose): (webkitFindControllerConstructed): (webKitFindControllerPerform): (webkit_find_controller_search_finish): * UIProcess/API/gtk/WebKitFormClient.cpp: (attachFormClientToView): * UIProcess/API/gtk/WebKitLoaderClient.cpp: (attachLoaderClientToView): * UIProcess/API/gtk/WebKitPolicyClient.cpp: (attachPolicyClientToView): * UIProcess/API/gtk/WebKitPrintOperation.cpp: (drawPagesForPrintingCompleted): (webkitPrintOperationPrintPagesForFrame): (webkit_print_operation_run_dialog): (webkit_print_operation_print): * UIProcess/API/gtk/WebKitUIClient.cpp: (attachUIClientToView): * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextCreatePageForWebView): (webkitWebContextWebViewDestroyed): * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewCreatePage): (webkitWebViewGetPage): * UIProcess/API/gtk/WebKitWebViewPrivate.h: 2017-06-12 Carlos Garcia Campos [GTK] getPage() in WebKitWebView should return a reference instead of a pointer https://bugs.webkit.org/show_bug.cgi?id=173251 Reviewed by Žan Doberšek. The WebPageProxy is created on WebKitWebView construction, so getPage() can only return nullptr if it's called during construction. And that can only happen when construct properties are set. It's better to check that the view has been constructed only in these particular cases and make getPage() return a reference. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewCreateJavaScriptDialog): (allowModalDialogsChanged): Settings signals are only connected after the page has been created, so we don't need to check page is available here. (zoomTextOnlyChanged): (userAgentChanged): (webkitWebViewIsConstructed): Helper method to check if the view has been constructed. (webkitWebViewUpdateSettings): Return early if view hasn't been constructed. (webkitWebViewDisconnectSettingsSignalHandlers): Ditto. (webkitWebViewConstructed): (webkitWebViewDispose): (webkitWebViewCreateNewPage): (webkitWebViewSelectionDidChange): (webkit_web_view_try_close): (webkit_web_view_load_uri): (webkit_web_view_load_html): (webkit_web_view_load_alternate_html): (webkit_web_view_load_plain_text): (webkit_web_view_load_bytes): (webkit_web_view_load_request): (webkit_web_view_get_page_id): (webkit_web_view_reload): (webkit_web_view_reload_bypass_cache): (webkit_web_view_stop_loading): (webkit_web_view_is_playing_audio): (webkit_web_view_go_back): (webkit_web_view_can_go_back): (webkit_web_view_go_forward): (webkit_web_view_can_go_forward): (webkit_web_view_get_custom_charset): (webkit_web_view_set_custom_charset): (webkit_web_view_get_estimated_load_progress): (webkit_web_view_go_to_back_forward_list_item): (webkit_web_view_set_zoom_level): (webkit_web_view_get_zoom_level): (webkit_web_view_can_execute_editing_command): (webkit_web_view_execute_editing_command): (webkit_web_view_execute_editing_command_with_argument): (webkit_web_view_run_javascript): (resourcesStreamReadCallback): (webkit_web_view_get_inspector): (webkit_web_view_can_show_mime_type): (webkit_web_view_save): (webkit_web_view_save_to_file): (webkit_web_view_download_uri): (webkit_web_view_get_tls_info): (webkit_web_view_get_snapshot): (webkit_web_view_set_background_color): (webkit_web_view_get_background_color): (webkit_web_view_is_editable): (webkit_web_view_set_editable): (webkit_web_view_get_editor_state): (webkit_web_view_get_session_state): (webkit_web_view_restore_session_state): 2017-06-12 Carlos Garcia Campos [GTK] Move WebKit GType macros to WTF https://bugs.webkit.org/show_bug.cgi?id=173249 Reviewed by Žan Doberšek. Moving to a common place where they could be shared by all ports using a glib-based API. * UIProcess/API/gtk/WebKitPrivate.h: 2017-06-11 Carlos Garcia Campos [GTK] Remove WKInspectorClientGtk https://bugs.webkit.org/show_bug.cgi?id=173142 Reviewed by Michael Catanzaro. It's only used internally in GTk+ API, we can simplify it by using a C++ client instead. * PlatformGTK.cmake: * UIProcess/API/C/gtk/WKInspectorClientGtk.cpp: Removed. * UIProcess/API/C/gtk/WKInspectorClientGtk.h: Removed. * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/API/gtk/WebKitWebInspector.cpp: (_WebKitWebInspectorPrivate::~_WebKitWebInspectorPrivate): (webkitWebInspectorCreate): * UIProcess/WebInspectorProxy.cpp: * UIProcess/WebInspectorProxy.h: * UIProcess/gtk/WebInspectorClientGtk.cpp: Removed. * UIProcess/gtk/WebInspectorProxyClient.h: Renamed from Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.h. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::setClient): (WebKit::WebInspectorProxy::createInspectorWindow): (WebKit::WebInspectorProxy::platformDidClose): (WebKit::WebInspectorProxy::platformBringToFront): (WebKit::WebInspectorProxy::platformInspectedURLChanged): (WebKit::WebInspectorProxy::platformAttach): (WebKit::WebInspectorProxy::platformDetach): (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight): (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth): (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): 2017-06-11 Tim Horton REGRESSION (r217870): Null deref under PageOverlayController::uninstallPageOverlay using find in page https://bugs.webkit.org/show_bug.cgi?id=173196 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::updateFindIndicator): The reason this caused a crash instead of just a missing indicator is that FindControllerIOS would early return after uninstalling the old overlay, before installing a new one, and leave m_isShowingFindIndicator set to true. Instead, reset it (and m_findIndicatorOverlay, which we would never re-use but might as well be freed immediately). This likely already crashed in other less reproducible cases where a TextIndicator was not created for a find match, so clean it up. 2017-06-10 Carlos Garcia Campos [GTK] Remove WKFullScreenClientGtk https://bugs.webkit.org/show_bug.cgi?id=173140 Reviewed by Michael Catanzaro. It's only used internally in the GTK+ API. Implementation is a lot simpler without using it, we can simply use either WebKitWebView or WebKitWebViewBase from PageClient directly. * PlatformGTK.cmake: * UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp: Removed. * UIProcess/API/C/gtk/WKFullScreenClientGtk.h: Removed. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::isFullScreen): (WebKit::PageClientImpl::enterFullScreen): (WebKit::PageClientImpl::exitFullScreen): * UIProcess/API/gtk/WebKitFullscreenClient.cpp: Removed. * UIProcess/API/gtk/WebKitFullscreenClient.h: Removed. * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewEnterFullScreen): (webkitWebViewExitFullScreen): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseEnterFullScreen): (webkitWebViewBaseExitFullScreen): (webkitWebViewBaseIsFullScreen): * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: * UIProcess/gtk/WebFullScreenClientGtk.cpp: Removed. * UIProcess/gtk/WebFullScreenClientGtk.h: Removed. 2017-06-10 Carlos Garcia Campos [GTK] Handle page download request in WebKitWebView directly https://bugs.webkit.org/show_bug.cgi?id=173137 Reviewed by Žan Doberšek. We don't need to pass through WebKitWebViewBase, since the base doesn't have an implementation. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::handleDownloadRequest): * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewHandleDownloadRequest): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseSetDownloadRequestHandler): Deleted. (webkitWebViewBaseHandleDownloadRequest): Deleted. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: 2017-06-10 Carlos Garcia Campos [GTK] Use a lambda in webkit_cookie_manager_get_accept_policy instead of toGenericCallbackFunction https://bugs.webkit.org/show_bug.cgi?id=173134 Reviewed by Žan Doberšek. It's simpler and easier to read. * UIProcess/API/gtk/WebKitCookieManager.cpp: (webkit_cookie_manager_get_accept_policy): (webkitCookieManagerGetAcceptPolicyCallback): Deleted. 2017-06-10 Dan Bernstein Reverted r218056 because it made the IDE reindex constantly. * Configurations/DebugRelease.xcconfig: 2017-06-10 Dan Bernstein [Xcode] With Xcode 9 developer beta, everything rebuilds when switching between command-line and IDE https://bugs.webkit.org/show_bug.cgi?id=173223 Reviewed by Sam Weinig. The rebuilds were happening due to a difference in the compiler options that the IDE and xcodebuild were specifying. Only the IDE was passing the -index-store-path option. To make xcodebuild pass that option, too, set CLANG_INDEX_STORE_ENABLE to YES if it is unset, and specify an appropriate path in CLANG_INDEX_STORE_PATH. * Configurations/DebugRelease.xcconfig: 2017-06-09 Ryosuke Niwa Crash inside WebKit::PluginView::getAuthenticationInfo https://bugs.webkit.org/show_bug.cgi?id=173083 Address Darin's review comment. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getAuthenticationInfo): 2017-06-09 Chris Dumez Use WTF::Function instead of std::function in NetworkProcess code https://bugs.webkit.org/show_bug.cgi?id=173182 Reviewed by Alex Christensen. Use WTF::Function instead of std::function in NetworkProcess code to avoid unnecessary copying. * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/NetworkCacheIOChannel.h: * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::readSyncInThread): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cache/NetworkCacheStatistics.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::clearNSURLCache): (WebKit::NetworkProcess::clearDiskCache): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::clearDiskCache): 2017-06-09 Tim Horton REGRESSION (r213584): WeChat app can not switch to next text field https://bugs.webkit.org/show_bug.cgi?id=173183 Reviewed by Wenson Hsieh. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/InputViewUpdateDeferrer.mm: (WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer): It turns out that _endIgnoringReloadInputViews doesn't actually perform the update if there was one ignored. It does, however, return whether there was a change ignored, and we can force an update. This remains untestable without sizable additional API test infrastructure for the same reasons as the original patch. 2017-06-09 Chris Dumez Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver() https://bugs.webkit.org/show_bug.cgi?id=173174 Reviewed by Darin Adler. Follow-up fix to r218006, which caused a crash on the bots. We cannot WTFMove() protectedThis here because the callback gets called several times. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): 2017-06-09 Jer Noble Crash in -[WKWebView _initializeWithConfiguration:] https://bugs.webkit.org/show_bug.cgi?id=173126 Reviewed by Darin Adler. Follow up to previous fix; when setting NSString properties, store a copy of the string rather than the NSString itself. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _overrideContentSecurityPolicy]): (-[WKWebViewConfiguration _setOverrideContentSecurityPolicy:]): (-[WKWebViewConfiguration _setMediaContentTypesRequiringHardwareSupport:]): 2017-06-09 Chris Dumez Use WTF::Function instead of std::function in StorageManager https://bugs.webkit.org/show_bug.cgi?id=173177 Reviewed by Brady Eidson. Use WTF::Function instead of std::function in StorageManager. This eliminates some potential implicit copying of captured variables, which is important here because we pass those lambdas to other threads. * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::getSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::getLocalStorageOriginDetails): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): * UIProcess/Storage/StorageManager.h: 2017-06-09 Daniel Bates CSP: Apply img-src directive to favicon loads https://bugs.webkit.org/show_bug.cgi?id=172733 Reviewed by Brady Eidson. Return 0 seconds for the maximum buffering time for favicons (no change in behavior). * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): 2017-06-09 Wenson Hsieh [iOS DnD] Add a hook to perform two-step drops in editable content https://bugs.webkit.org/show_bug.cgi?id=172992 Reviewed by Tim Horton. Add plumbing to support an injected bundle hook for overriding two-step drops. See WebCore ChangeLog. * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: (API::InjectedBundle::EditorClient::performTwoStepDrop): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::performTwoStepDrop): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::performTwoStepDrop): * WebProcess/WebCoreSupport/WebEditorClient.h: 2017-06-09 Brent Fulgham Use Function rather than std::function for thread safety in WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=173172 Reviewed by Chris Dumez. Remove a few more instances of std::function in the WebsiteDataStore, and WTFMove completion handler to avoid unnecessary copies. * Shared/WebsiteData/WebsiteDataType.h: Remove redundant WebsiteDataType from name. * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): Update for revised name. (WebKit::toWKWebsiteDataTypes): Ditto. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): ASSERT that this function, as well as its completion handler, are getting called from the main thread. (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): Ditto. (WebKit::WebProcessProxy::fetchWebsiteData): Move the completionHandler. (WebKit::WebProcessProxy::deleteWebsiteData): Ditto. (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): Ditto. * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): Switch to Function, and move completion handler. (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Ditto. (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Ditto. (WebKit::WebsiteDataStore::removeData): Ditto. (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Ditto. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-06-09 Chris Dumez Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver() https://bugs.webkit.org/show_bug.cgi?id=173174 Reviewed by Darin Adler. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): 2017-06-09 Chris Dumez Avoid some ref counting churn in WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=173168 Reviewed by Brent Fulgham. Move the protectedThis around instead of ref'ing it every time we capture it in a lambda. Also add a missing protectedThis in WebResourceLoadStatisticsStore::removeDataRecords() which likely fixes crashes. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): 2017-06-09 Sam Weinig Add SubresourceIntegrity as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=173164 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add SubresourceIntegrity to the list of experimental features. Also, sort the experimental features as requested by the comment above it. 2017-06-09 Chris Dumez Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData() https://bugs.webkit.org/show_bug.cgi?id=173163 Reviewed by Brent Fulgham. Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData() or it may end up getting destroyed before the lambda executing and crash when calling m_statisticsQueue->dispatch(). * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): 2017-06-09 Daewoong Jang [CoordinatedGraphics] Remove unneeded interfaces in PageClient https://bugs.webkit.org/show_bug.cgi?id=173149 Reviewed by Michael Catanzaro. * UIProcess/PageClient.h: 2017-06-09 Chris Dumez Use WTF::Function instead of std::function in SpeculativeLoadManager::ExpiringEntry https://bugs.webkit.org/show_bug.cgi?id=173125 Reviewed by Antti Koivisto. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::ExpiringEntry::ExpiringEntry): (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry): 2017-06-09 Daewoong Jang Use WTF::getCurrentProcessID() instead of getpid() https://bugs.webkit.org/show_bug.cgi?id=173130 Reviewed by Tim Horton. * UIProcess/API/APIProcessPoolConfiguration.h: 2017-06-09 Claudio Saavedra struct does not accept initializer-form if member has initializers in GCC 4.9 Unreviewed speculative build fix. Remove the default initializers for DeniedRequest struct, since it's only initialized in one place, to keep gcc 4.9 happy. * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2017-06-09 Adrien Plazas [GTK] Add kinetic scrolling https://bugs.webkit.org/show_bug.cgi?id=155750 Reviewed by Carlos Garcia Campos. Patch by Adrien Plazas and Yusuke Suzuki. Add the notion of phase and momentum phase to WebWheelEvent. Make WebWheelEvent manage the 'is_stop' attribute of GdkEventScroll to create the corresponding WebWheelEvent with the correct phases and deltas. Make GestureController manage swipes to create the corresponding WebWheelEvent with the correct phases and deltas. * Shared/NativeWebWheelEvent.h: * Shared/WebEvent.h: * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): (WebKit::WebWheelEvent::encode): (WebKit::WebWheelEvent::decode): * Shared/gtk/NativeWebWheelEventGtk.cpp: (WebKit::NativeWebWheelEvent::NativeWebWheelEvent): * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebWheelEvent): * Shared/gtk/WebEventFactory.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleWheelEvent): (WebKit::WebPageProxy::shouldProcessWheelEventNow): * UIProcess/WebPageProxy.h: * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::GestureController): (WebKit::GestureController::handleEvent): (WebKit::GestureController::isProcessingGestures): (WebKit::createScrollEvent): (WebKit::GestureController::DragGesture::startDrag): (WebKit::GestureController::DragGesture::handleDrag): (WebKit::GestureController::DragGesture::begin): (WebKit::GestureController::DragGesture::end): (WebKit::GestureController::SwipeGesture::startMomentumScroll): (WebKit::GestureController::SwipeGesture::swipe): (WebKit::GestureController::SwipeGesture::SwipeGesture): * UIProcess/gtk/GestureController.h: 2017-06-09 Jer Noble Crash in -[WKWebView _initializeWithConfiguration:] https://bugs.webkit.org/show_bug.cgi?id=173126 Reviewed by Antti Koivisto. Crash occurs when passing an autoreleased NSString into _setMediaContentTypesRequiringHardwareSupport. The ivar should be a RetainPtr rather than a bare NSString *. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _mediaContentTypesRequiringHardwareSupport]): 2017-06-08 Carlos Garcia Campos [GTK] Use API::FormClient instead of the C API in WebKitFormClient https://bugs.webkit.org/show_bug.cgi?id=173098 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitFormClient.cpp: (attachFormClientToView): (willSubmitForm): Deleted. * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp: (webkitFormSubmissionRequestCreate): (webkit_form_submission_request_get_text_fields): * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkitWebPageCreate): 2017-06-08 Carlos Garcia Campos [GTK] Use API::Findclient instead of the C API in WebKitFindController https://bugs.webkit.org/show_bug.cgi?id=173095 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitFindController.cpp: (getPage): (webkitFindControllerDispose): (webkitFindControllerConstructed): (webkit_find_controller_class_init): 2017-06-08 Carlos Garcia Campos [GTK] Get rid of custom marshallers of signals https://bugs.webkit.org/show_bug.cgi?id=173094 Reviewed by Žan Doberšek. Use g_cclosure_marshal_generic instead. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitBackForwardList.cpp: * UIProcess/API/gtk/WebKitDownload.cpp: (webkit_download_class_init): * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: (webkit_favicon_database_class_init): * UIProcess/API/gtk/WebKitWebInspector.cpp: (webkit_web_inspector_class_init): * UIProcess/API/gtk/WebKitWebResource.cpp: (webkit_web_resource_class_init): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_class_init): * UIProcess/API/gtk/webkit2marshal.list: Removed. * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkit_web_page_class_init): 2017-06-08 Simon Fraser Crash under -[WKWebView _updateVisibleContentRects] https://bugs.webkit.org/show_bug.cgi?id=173123 rdar://problem/32650112 Reviewed by Tim Horton. Make sure the WKWebView is valid in places where we dispatch_async or use a pre-commit handler. Speculative fix for a rare crasher. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isValid]): (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 2017-06-07 Simon Fraser Use initializers in WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=173073 Reviewed by Tim Horton. Initialize the member variables the modern way. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: 2017-06-08 Jeremy Jones Implement additional AVPlayerController interfaces for minTime and maxTime. https://bugs.webkit.org/show_bug.cgi?id=172396 rdar://problem/30737452 Reviewed by Jer Noble. Add support for new HLS UI in AVKit. Plumb seekableTimeRangesLastModifiedTime and liveUpdateInterval across process boundaries. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setSeekableRanges): (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::seekableRangesChanged): (WebKit::WebPlaybackSessionManager::seekableRangesChanged): 2017-06-08 Chris Dumez Use WTF::Function more in SpeculativeLoadManager https://bugs.webkit.org/show_bug.cgi?id=173109 Reviewed by Antti Koivisto. Use WTF::Function more in SpeculativeLoadManager. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::create): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad): (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: 2017-06-08 Youenn Fablet getUserMedia should not be prompted again if user denied access https://bugs.webkit.org/show_bug.cgi?id=173104 Reviewed by Geoff Garen. Store denied requests to be able to replay them. If mic is denied, user might be prompted for camera, not for mic and camera. Same principle applies to the case of denied camera. Clearing the stored denied requests when reloading/navigating away. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): (WebKit::UserMediaPermissionRequestManagerProxy::isRequestDenied): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2017-06-08 Jer Noble Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly. https://bugs.webkit.org/show_bug.cgi?id=173091 Reviewed by Eric Carlson. Rather than add yet a third way of setting this preference, centralize everything by moving the definition of the default value into WebCore. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-08 Jer Noble [WK2] mediaContentTypesRequiringHardwareSupport setting not being propogated https://bugs.webkit.org/show_bug.cgi?id=173090 Reviewed by Eric Carlson. Passing a NSString* into the WebPreferencesStore::Value constructor would rather cast the NSString* into a bool than a const String&. So explicitly cast the NSString* into a String before passing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2017-06-08 Youenn Fablet getUserMedia request should not be allowed for background tabs unless the tab is already capturing https://bugs.webkit.org/show_bug.cgi?id=172989 Reviewed by Eric Carlson. Covered by updated test and manual testing. In case a getUserMedia can be granted, we check for visbility of the view. If the view is visible, the getUserMedia request is allowed and promise is resolved. Otherwise we store the pregranted request and will allow it when the view gets visible. Pregranted requests will be cleared if the document of the view is changed. Pregranted requests will not be used when capture page is muted. In that case, a prompt will appear. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess): (WebKit::allowRequest): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::processPregrantedRequests): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::viewIsBecomingVisible): * UIProcess/WebPageProxy.h: 2017-06-07 Carlos Garcia Campos [WPE] Enable resource usage https://bugs.webkit.org/show_bug.cgi?id=173054 Reviewed by Žan Doberšek. Enable/disable the resources overlay with CTRL + Shift + G. * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_compositingManagerProxy): 2017-06-07 Carlos Garcia Campos Remove legacy INSPECTOR_SERVER implementation https://bugs.webkit.org/show_bug.cgi?id=172966 Reviewed by Žan Doberšek. * CMakeLists.txt: * Platform/Logging.h: * PlatformWPE.cmake: * UIProcess/InspectorServer/HTTPRequest.cpp: Removed. * UIProcess/InspectorServer/HTTPRequest.h: Removed. * UIProcess/InspectorServer/WebInspectorServer.cpp: Removed. * UIProcess/InspectorServer/WebInspectorServer.h: Removed. * UIProcess/InspectorServer/WebSocketServer.cpp: Removed. * UIProcess/InspectorServer/WebSocketServer.h: Removed. * UIProcess/InspectorServer/WebSocketServerClient.h: Removed. * UIProcess/InspectorServer/WebSocketServerConnection.cpp: Removed. * UIProcess/InspectorServer/WebSocketServerConnection.h: Removed. * UIProcess/InspectorServer/front-end/inspectorPageIndex.html: Removed. * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp: Removed. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::invalidate): * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.messages.in: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::preferencesDidChange): * UIProcess/wpe/WebProcessPoolWPE.cpp: * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::sendMessageToFrontend): * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebInspector.messages.in: 2017-06-07 Dan Bernstein [Cocoa] additionalReadAccessAllowedURLs doesn’t preserve non-Latin-1 paths https://bugs.webkit.org/show_bug.cgi?id=173086 Reviewed by Andy Estes. We were incorrectly passing the fileSystemRepresentation of an NSURL into the WTF::String constructor that expects a Latin-1 string. However, in general, fileSystemRepresentation is not Latin-1. * UIProcess/API/APIProcessPoolConfiguration.h: Changed m_additionalReadAccessAllowedPaths from a Vector into a Vector. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): Updated for the change. (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): Ditto. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Ditto. 2017-06-07 Ryosuke Niwa Crash inside WebKit::PluginView::getAuthenticationInfo https://bugs.webkit.org/show_bug.cgi?id=173083 Reviewed by Chris Dumez. Added a null pointer check. The content document may have went away by the time we get there from IPC. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getAuthenticationInfo): 2017-06-07 Youenn Fablet getUserMedia is prompting too often https://bugs.webkit.org/show_bug.cgi?id=172859 Reviewed by Eric Carlson. Introduce a storage of granted requests to skip prompting when needed. This is a partial implementation as granted requests should not happen for background tabs. This will be covered in a follow-up patch. Covered by manual tests. A granted request keeps its mainFrameID. Whenever the document of the main frame changes, the granted requests for that mainFrameID will be removed. This handles the case of navigating, reloading... while still supporting the case of granting getUserMedia after in page navigation. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess): (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest): (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::mainFrameID): (WebKit::UserMediaPermissionRequestProxy::frameID): (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeMainDocument): (WebKit::WebPageProxy::backForwardGoToItem): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidChangeMainDocument): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-06-07 Dan Bernstein [Cocoa] additionalReadAccessAllowedURLs should be consumed before loading the injected bundle https://bugs.webkit.org/show_bug.cgi?id=173078 Reviewed by Anders Carlsson. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Changed the order. 2017-06-07 Per Arne Vollan Support removal of authentication data through the Website data store API. https://bugs.webkit.org/show_bug.cgi?id=171217 Reviewed by Brady Eidson. Add support to remove and fetch credential data through the Website data store API. Credential data is removed and fetched from both the network process and web process. Authentication data stored in the keychain will not be cleared. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::encode): (WebKit::WebsiteData::decode): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore allWebsiteDataTypes]): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): 2017-06-06 Dan Bernstein Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): 2017-06-06 Brent Fulgham [WK2][Cocoa] Allow network process to bind addresses without webrtc extension https://bugs.webkit.org/show_bug.cgi?id=173032 Reviewed by Youenn Fablet. Remove the unnecessary WebRTC sandbox extension handle and conditional sandbox rules, since we've decided that all WebKit clients should be able to use the WebRTC protocol. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): Remove unused sandbox extension from serialization. (WebKit::NetworkProcessCreationParameters::decode): Ditto. * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): We no longer send the sandbox extension, so don't attempt to consume it. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Remove check for 'com.apple.webkit.webrtc' extension. Make rules conditional on building with WEB_RTC feature enabled. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Remove check for 'com.apple.webkit.webrtc' * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): Do not create unnecessary sandbox extension handle. 2017-06-06 Tim Horton Crash trying to drag the entire text of a long book out of Mail compose view https://bugs.webkit.org/show_bug.cgi?id=173042 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/FindControllerIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::didConcludeEditDataInteraction): Adapt to the new name. 2017-06-06 Chris Dumez RELEASE_ASSERT(static_cast(enumerationValue) < WTF_ARRAY_LENGTH(values)) hit in convertEnumerationToJS() https://bugs.webkit.org/show_bug.cgi?id=173033 Reviewed by Simon Fraser. * Shared/SessionState.h: Make sure FrameState::shouldRestoreScrollPosition and other struct members are always intialized. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeFrameStateNode): (WebKit::decodeBackForwardTreeNode): Make sure FrameState::shouldRestoreScrollPosition is properly encoded / decoded. 2017-06-06 Andy Estes REGRESSION (r199558): WKWebView upload file which name contains Chinese character results in garbled code https://bugs.webkit.org/show_bug.cgi?id=172849 Reviewed by Darin Adler. This is the Mac equivalent of what was fixed in r208295. This time we use -[NSURL path] to construct a WTF::String instead of calling String::fromUTF8() on -[NSURL fileSystemRepresentation]. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::runOpenPanel): 2017-06-06 Yoav Weiss [preload] Conditional support for media preloading and align media `as` values. https://bugs.webkit.org/show_bug.cgi?id=172501 Reviewed by Dean Jackson. Add media preloading preference and hook it up to runtime enabled features. * Shared/WebPreferencesDefinitions.h: Added a macro defining media preloading preference. * UIProcess/API/C/WKPreferences.cpp: (WebKit2::WKPreferences::WKPreferencesSetMediaPreloadingEnabled): (WebKit2::WKPreferences::WKPreferencesGetMediaPreloadingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: Set runtime enabled feature based on preference. 2017-06-06 Don Olmstead [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports https://bugs.webkit.org/show_bug.cgi?id=172780 Reviewed by Alex Christensen. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::scheduleAnimation): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::syncDisplayState): 2017-06-06 Beth Dakin Netflix seeking quirk should also apply to Now Playing, and should always use the livestream UI https://bugs.webkit.org/show_bug.cgi?id=173030 -and corresponding- rdar://problem/32228660 Reviewed by Darin Adler. See WebCore ChangeLog for more details. We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking(). * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing): Deleted. * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged): Deleted. (WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged): Deleted. 2017-06-06 Jer Noble [Cocoa] Set defaults for mediaContentTypesRequiringHardwareSupport setting https://bugs.webkit.org/show_bug.cgi?id=173008 Reviewed by Eric Carlson. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): 2017-06-06 Joseph Pecoraro Move Resource Timing / User Timing from experimental features into main preferences https://bugs.webkit.org/show_bug.cgi?id=172950 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: Move Resource Timing and User Timing out of the Experimental Features section. 2017-06-06 Youenn Fablet Add an option to disable getUserMedia prompt in case of mock capture sources https://bugs.webkit.org/show_bug.cgi?id=172981 Reviewed by Eric Carlson. Adding mockCaptureDevicesPromptEnabled option. Allowing any getUserMedia request if mock is on and prompt is off. Renaming UserMediaProcessManager::willEnableMediaStreamInPage to muteCaptureMediaStreamsExceptIn. This eases reading the code. Making sure that a page for which a new getUserMedia MediaStream will be created is capture-unmuted. * Shared/WebPreferencesDefinitions.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn): (WebKit::UserMediaProcessManager::willCreateMediaStream): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMuted): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): 2017-06-06 Carlos Garcia Campos [WPE] Enable remote inspector https://bugs.webkit.org/show_bug.cgi?id=172971 Reviewed by Žan Doberšek. Initialize the remote inpector if needed. * UIProcess/wpe/WebProcessPoolWPE.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): 2017-06-06 Carlos Garcia Campos [GLIB] Make remote inspector DBus protocol common to all glib based ports https://bugs.webkit.org/show_bug.cgi?id=172970 Reviewed by Žan Doberšek. Use webkit instead of webkitgtk and reomve platform idfeds. * UIProcess/glib/RemoteInspectorClient.cpp: 2017-06-06 Zan Dobersek [WPE] Don't disable Web security preference by default https://bugs.webkit.org/show_bug.cgi?id=172964 Reviewed by Carlos Garcia Campos. * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::View): Don't disable Web security by default. 2017-06-05 Chris Dumez ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128 https://bugs.webkit.org/show_bug.cgi?id=172943 Reviewed by Alexey Proskuryakov. In Connection::sendMessage(), make sure we only ever transform asynchronous messages into synchronous ones if sendMessage() is called on the main thread. This is necessary because we no longer support sending synchronous messages from a background thread since r205125. * Platform/IPC/Connection.cpp: (IPC::Connection::sendMessage): (IPC::Connection::sendSyncMessage): 2017-06-05 Joseph Pecoraro Revert r217405, this headerpad increase is no longer needed. Rubber-stamped by Dan Bernstein. * Configurations/BaseXPCService.xcconfig: 2017-06-05 Dan Bernstein Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::mediaPlaybackControlsView): 2017-06-05 Jer Noble Allow clients to specify a list of codecs which should require hardware decode support. https://bugs.webkit.org/show_bug.cgi?id=172787 Reviewed by Alex Christensen. Add a WKWebPageConfiguration (and associated WebPreferences and WKPreferencesRef) properties allowing clients to require specified codecs have hardware decode support. Also open up the sandbox on Cocoa ports to services required to check for hardware decode availability. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaCodecsRequiringHardwareSupport): (WKPreferencesCopyMediaCodecsRequiringHardwareSupport): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _mediaCodecsRequiringHardwareSupport]): (-[WKWebViewConfiguration _setMediaCodecsRequiringHardwareSupport:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/com.apple.WebProcess.sb.in: 2017-06-05 Beth Dakin Modify Netflix controlsManager quirk to prevent only scrubbing https://bugs.webkit.org/show_bug.cgi?id=172881 -and corresponding- rdar://problem/32228660 Reviewed by Andy Estes. Plumbing for allowsTouchBarScrubbing. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing): (WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged): (WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged): 2017-06-05 Carlos Garcia Campos Unreviewed. Fix GTK+ build with OpenGL disabled after r217779. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): 2017-06-05 Carlos Garcia Campos [WPE] Use AcceleratedDrawingArea instead of its fork https://bugs.webkit.org/show_bug.cgi?id=172496 Reviewed by Žan Doberšek. WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead. * PlatformWPE.cmake: * Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type. * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed. * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually belongs here. * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port. * WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here. * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed. * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed. 2017-06-03 Simon Fraser Sort the project file. * WebKit2.xcodeproj/project.pbxproj: 2017-06-02 Chris Dumez ResourceLoadStatistics are not using unique paths during test runs https://bugs.webkit.org/show_bug.cgi?id=172861 Reviewed by Darin Adler. Add WKContextConfigurationSetResourceLoadStatisticsDirectory() C API to allow WKTR to use a custom directory. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyResourceLoadStatisticsDirectory): (WKContextConfigurationSetResourceLoadStatisticsDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): 2017-06-02 Brady Eidson Prevent scheme handlers from handling all built-in URL schemes. and https://bugs.webkit.org/show_bug.cgi?id=172869 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKWebView.mm: (+[WKWebView handlesURLScheme:]): Check against WebCore's new master list of URL schemes. 2017-06-02 Simon Fraser All scroll peformance logging should happen in the UI process https://bugs.webkit.org/show_bug.cgi?id=172874 rdar://problem/24474830 Reviewed by Tim Horton. Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds, so we have to log from the UI process. Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to WebPageProxy, which prints them with the same format they had before. Some plumbing through PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers through to something that can get to Page. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::logScrollingEvent): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added. (WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient): (WebKit::WebPerformanceLoggingClient::logScrollingEvent): * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2017-06-02 Chris Dumez REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255 https://bugs.webkit.org/show_bug.cgi?id=172846 Reviewed by Mark Lam. Follow-up to r217695 to deal with exceptions potentially thrown by NPRuntimeObjectMap::convertJSValueToNPVariant() as well. * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::invoke): 2017-06-02 Jeremy Jones Add abilility to specify presentingApplicationPID for a WebProcessPool. https://bugs.webkit.org/show_bug.cgi?id=172839 rdar://problem/32247170 Reviewed by Tim Horton. Expose presentingApplicationPID through WebProcessPoolConfiguration. This allows rehosted WebViews to specify the hosting application. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setPresentingApplicationPID:]): (-[_WKProcessPoolConfiguration presentingApplicationPID]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::createNewWebProcess): 2017-06-02 Frederic Wang [Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true https://bugs.webkit.org/show_bug.cgi?id=172851 Reviewed by Simon Fraser. When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require special composited layer. This commit enables that on mac but only when ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged. * WebProcess/WebCoreSupport/WebChromeClient.h: Make scrollable inner frame trigger compositing on Mac by default. This is ignored on mac when ScrollingTreeIncludesFrames=false. Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger. 2017-06-02 Zalan Bujtas Allow clients to override viewport size for CSS viewport units. https://bugs.webkit.org/show_bug.cgi?id=172838 Reviewed by Tim Horton. This enables auto-sizing clients to ensure that styles relative to the viewport are resolved to a set value (presumably the size of the container) as opposed to the preferred document size (which is set as the FrameView size). * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _viewportSizeForCSSViewportUnits]): (-[WKWebView _setViewportSizeForCSSViewportUnits:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::viewportSizeForCSSViewportUnits): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): (WebKit::WebPage::setViewportSizeForCSSViewportUnits): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::viewportSizeForCSSViewportUnits): * WebProcess/WebPage/WebPage.messages.in: 2017-06-02 Simon Fraser Get out of StdLibExtras.h https://bugs.webkit.org/show_bug.cgi?id=172744 Reviewed by Zalan Bujtas. Only bring in and namespace std::literals::chrono_literals when necessary. * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::computeRecordWorth): * Shared/mac/RemoteLayerBackingStoreCollection.mm: * WebProcess/Cookies/WebCookieManager.h: 2017-06-02 Andy Estes [Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest https://bugs.webkit.org/show_bug.cgi?id=172832 Reviewed by Alex Christensen. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSSet): (WebKit::toPKPaymentRequest): 2017-06-02 Dan Bernstein [Xcode] Header postprocessing should be based on the target OS version rather than the builder OS version https://bugs.webkit.org/show_bug.cgi?id=172860 Reviewed by Anders Carlsson. * Configurations/WebKit.xcconfig: Use TARGET_MAC_OS_X_VERSION_MAJOR 2017-06-02 Gwang Yoon Hwang REGRESSION(r217214): [Coordinated Graphics] UpdateAtlas didn't released while resetting testrunner https://bugs.webkit.org/show_bug.cgi?id=172746 Reviewed by Žan Doberšek. After clearing update atlases in CompositingCoordinator, we should release update atlases at the compositing thread, too. We cannot remove update atlases from the CoordinatedGraphicsScene without regard to update scheduling, since previously committed scene states can try to use already released update atlases. To prevent this timing problem, releasing update atlases should be done with a update scheduler. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::syncRemoteContent): (WebKit::CoordinatedGraphicsScene::appendUpdate): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: Use WTF::Function instead of std::function * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::releaseUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::ThreadedCompositor::flushPendingLayerChanges): Release UpdateAtlases at the end of compositing states update, too. (WebKit::CompositingCoordinator::clearUpdateAtlases): 2017-06-01 Andreas Kling [Mac] Remove backing store for layers that are outside the viewport https://bugs.webkit.org/show_bug.cgi?id=170082 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 2017-06-01 Chris Dumez REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255 https://bugs.webkit.org/show_bug.cgi?id=172846 Reviewed by Andreas Kling. In NPJSObject::invoke(), return early if there was an exception when calling JSC::call(). Using the value returned by JSC::call() when an exception occurred is unsafe. * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::invoke): 2017-06-01 Jon Lee Rename an experimental feature item https://bugs.webkit.org/show_bug.cgi?id=172830 Reviewed by Joseph Pecoraro. * Shared/WebPreferencesDefinitions.h: 2017-06-01 Andy Estes REGRESSION (r217626): ENABLE_APPLE_PAY_SESSION_V3 was disabled by mistake https://bugs.webkit.org/show_bug.cgi?id=172828 Reviewed by Beth Dakin. * Configurations/FeatureDefines.xcconfig: 2017-06-01 Chris Dumez [WK2] Update plugin process sandbox profile for flash plugin on HBONow https://bugs.webkit.org/show_bug.cgi?id=172820 Reviewed by Brent Fulgham. Relax the IOKit whitelist to silence sandbox violations by Flash plugin on HBONow. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-06-01 Andy Estes [Cocoa] Upstream support for JCB as a supported payment network https://bugs.webkit.org/show_bug.cgi?id=172819 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toSupportedNetwork): (WebKit::toAdditionalSupportedNetwork): Deleted. 2017-05-31 Andy Estes [Cocoa] "administrativeArea" contact field maps to the wrong CNPostalAddress key when creating NSErrors https://bugs.webkit.org/show_bug.cgi?id=172784 Reviewed by Beth Dakin. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): Used CNPostalAddressStateKey instead of CNPostalAddressCityKey. 2017-05-31 Andy Estes Rename ENABLE_APPLE_PAY_DELEGATE to ENABLE_APPLE_PAY_SESSION_V3 and bump the supported version number https://bugs.webkit.org/show_bug.cgi?id=172366 Reviewed by Daniel Bates. * Configurations/FeatureDefines.xcconfig: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::supportsVersion): 2017-05-31 Chris Dumez [WK2] Fix bad assertion in BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck() https://bugs.webkit.org/show_bug.cgi?id=172763 Reviewed by Zalan Bujtas. Fix bad assertion in BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck(). It gets hit when a process becomes unresponsive. The reason is that RunLoop::Timer::isActive() still returns true while the timerFired() callback is called. * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck): 2017-05-31 Youenn Fablet Make WebRTC legacy API switch an experimental feature https://bugs.webkit.org/show_bug.cgi?id=172760 Reviewed by Eric Carlson. This patch adds an experimental feature to disable WebRTC legacy API. We keep the runtime flag as "enable WebRTC legacy API" to minimize the changes and as it is clearer in the code. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebRTCLegacyAPIEnabled): (WKPreferencesGetWebRTCLegacyAPIEnabled): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _webRTCLegacyAPIEnabled]): (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-31 Matt Lewis Unreviewed, rolling out r217603. This patch broke the internal builds. Reverted changeset: "Get out of StdLibExtras.h" https://bugs.webkit.org/show_bug.cgi?id=172744 http://trac.webkit.org/changeset/217603 2017-05-31 Brent Fulgham Make ResourceLoadStatistics testing more reliable https://bugs.webkit.org/show_bug.cgi?id=172730 Reviewed by Andy Estes. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed): Add a convenience method to notify the WebProcess when the UIProcess has finished processing the load statistics data. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Notify clients (if they requested) when statistics have been processed. 2017-05-31 Simon Fraser Get out of StdLibExtras.h https://bugs.webkit.org/show_bug.cgi?id=172744 Reviewed by Saam Barati. Only bring in and namespace std::literals::chrono_literals when necessary. * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::computeRecordWorth): * Shared/mac/RemoteLayerBackingStoreCollection.mm: * WebProcess/Cookies/WebCookieManager.h: 2017-05-31 Zan Dobersek CoordinatedLayerTreeHost: properly support async force repaints https://bugs.webkit.org/show_bug.cgi?id=172444 Reviewed by Carlos Garcia Campos. Before these changes the force-repaint callbacks were executed once the next layer flush was performed. This is not appropriate since with the threaded compositor this was done even before the flushed state was handled on the rendering thread. Instead, the callback should be invoked once the first following flushed state is rendered through the compositor and the update finish is reported back to CoordinatedLayerTreeHost through invoking the renderNextFrame() method. If the force-repaint callback is registered while a state update is already being processed by the renderer (i.e. the threaded compositor), the callback is invoked only after the following flush, which is executed when renderNextFrame() is called for the current state update. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Add the forceFrameSync() method that forces the following state flush to produce a state update that will be handled by the compositor. This ensures that the compositor informs the CoordinatedLayerTreeHost once this state update is done, invoking renderNextFrame() which would handle the force-repaint callback. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): (WebKit::CoordinatedLayerTreeHost::renderNextFrame): (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: Remove the forceRepaintAsync() override that returned false. 2017-05-31 Carlos Garcia Campos Unreviewed. Fix copy-paste error added in r217209. It seems I pasted twice. * UIProcess/API/gtk/WebKitContextMenuItem.h: 2017-05-30 Tim Horton Keyboard autocorrections do not apply with an active selection (but keyboard acts like they did) https://bugs.webkit.org/show_bug.cgi?id=172735 Reviewed by Enrica Casucci. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Expose applyAutocorrection on the WKTesting category for use from UIScriptController. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::syncApplyAutocorrection): If there is a range selection and it precisely matches the autocorrection's "before" string, allow the autocorrection to take place. 2017-05-30 Joseph Pecoraro Web Inspector: images dragged from Inspector to Desktop are named "Unknown.png" https://bugs.webkit.org/show_bug.cgi?id=141515 Reviewed by Wenson Hsieh. In Web Inspector these images are with data: or blob: content. In these cases we have the image data but the URL does not provide a useful name. In fact the name "Unknown.png" comes from -[NSURLResponse suggestedFilename] for this URL / content. To start, improve this situation for drags in Web Inspector pages. If the image element being dragged has a filename attribute use that as the suggested filename for the drag. * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): 2017-05-30 Ryosuke Niwa Only include DataDetectorsUI headers in iOS https://bugs.webkit.org/show_bug.cgi?id=172633 Reviewed by David Kilzer. Enable data detectors only on iOS and not other variants of iOS. * Platform/spi/ios/ManagedConfigurationSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _dataDetectionResults]): * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showDataDetectorsSheet]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView _didNotHandleTapAsClick:]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleTap): (WebKit::WebPage::handleTwoFingerTapAtPoint): (WebKit::WebPage::commitPotentialTap): 2017-05-30 Chris Dumez REGRESSION(r215946): Can't reference a table cell in Google spreadsheet https://bugs.webkit.org/show_bug.cgi?id=172703 Reviewed by Ryosuke Niwa. Fix GObject bindings accordingly. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapDOMRectList): (webkit_dom_client_rect_list_constructed): (webkit_dom_client_rect_list_item): (webkit_dom_client_rect_list_get_length): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_get_client_rects): 2017-05-30 Daniel Bates [WK2] Add runBeforeUnloadConfirmPanel WKUIDelegate SPI; support onbeforeunload confirm panel in MiniBrowser https://bugs.webkit.org/show_bug.cgi?id=172603 Reviewed by Brady Eidson. A page loaded in MiniBrowser using WebKit2 cannot show a beforeunload confirm panel (by registering an onbeforeunload event handler) when it is unloaded. The same page loaded in MiniBrowser using WebKit1 can show such a confirm panel. We need to add WKUIDelegate SPI so that an embedding client, such as MiniBrowser, can register to receive a callback to show a beforeunload confirm panel. * UIProcess/API/APIUIClient.h: (API::UIClient::runBeforeUnloadConfirmPanel): Modified to take a SecurityOriginData object. This makes the API consistent with the existing JavaScript dialog callbacks. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add SPI -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setUIDelegate:]): Set the delegate of WebKit::UIDelegate to the specified WKUIDelegate before we set the UI client on the page so as to ensure that API::UIClient callbacks that depend -respondsToSelector: checks (e.g. API::UIClient::canRunBeforeUnloadConfirmPanel()) return the correct result. To elaborate further, a API::UIClient client must override both canRunBeforeUnloadConfirmPanel() and runBeforeUnloadConfirmPanel() to support running a beforeunload confirm dialog. When mapping the Cocoa SPI, WKUIDelegatePrivate, to API::UIClient we implement API::UIClient::canRunBeforeUnloadConfirmPanel() in terms of whether the Cocoa delegate responds at runtime to the selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:. We need to do such runtime checks before we pass the API::UIClient to the page. Otherwise, querying API::UIClient::canRunBeforeUnloadConfirmPanel() will return the wrong result. * UIProcess/API/gtk/WebKitUIClient.cpp: Modified runBeforeUnloadConfirmPanel() to take a SecurityOriginData object. * UIProcess/Cocoa/UIDelegate.h: Add declarations for API::UIClient overrides: canRunBeforeUnloadConfirmPanel() and runBeforeUnloadConfirmPanel(). Add a bit to m_delegateMethods as to whether the Cocoa delegate responds to selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Set the above m_delegateMethods bit if the Cocoa delegate responds to selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:. (WebKit::UIDelegate::UIClient::canRunBeforeUnloadConfirmPanel): Return whether the above m_delegateMethods bit was set. (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): Turn around and call -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler: (if applicable). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Modified to take a SecurityOriginData object and pass it to API::UIClient::runBeforeUnloadConfirmPanel(). * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add SecurityOriginData argument to message RunBeforeUnloadConfirmPanel. Also pass the message for the panel as the last argument so as to make the order of arguments to message RunBeforeUnloadConfirmPanel more closely match the order of arguments passed to other JavaScript dialog messages (e.g. RunJavaScriptAlert) for consistency. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Include the SecurityOriginData object for the frame in message RunBeforeUnloadConfirmPanel. 2017-05-30 Alex Christensen Update libwebrtc configuration https://bugs.webkit.org/show_bug.cgi?id=172727 Reviewed by Geoffrey Garen. * Configurations/FeatureDefines.xcconfig: 2017-05-30 Tim Horton Dictionary lookup disappears after a few seconds on observer.com https://bugs.webkit.org/show_bug.cgi?id=172725 Reviewed by Beth Dakin. Only dismiss content-relative child windows on main frame loads, not all subframes. This was causing e.g. dictionary popovers relative to main-frame content to be dismissed when subframe ads finished loading, which is likely the cause of most incidents of this problem. If the popover is relative to subframe content and the subframe navigates out from under the popover, the popover will persist until dismissed by the user (or one of the other automatic dismissal mechanisms), but that seems preferable to the old behavior. * UIProcess/Cocoa/WebViewImpl.h: Remove an unimplemented and unused declaration. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::processDidExit): Move dismissContentRelativeChildWindows call here from WebPageProxy. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::resetStateAfterProcessExited): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didCommitLoadForMainFrame): (WebKit::PageClientImpl::navigationGestureDidBegin): (WebKit::PageClientImpl::dismissContentRelativeChildWindows): Remove dismissContentRelativeChildWindows from PageClient(Impl), call it from inside PageClientImpl and other Mac-specific places instead of inside ifdefs in WebPageProxy. 2017-05-30 Konstantin Tokarev Don't use designated initializers in WebBackForwardListProxy.cpp https://bugs.webkit.org/show_bug.cgi?id=172667 Reviewed by Alex Christensen. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): (WebKit::WebBackForwardListProxy::addItem): 2017-05-30 Antti Koivisto REGRESSION(r191402?): Safari, Mail crash at com.apple.WebKit: WebKit::WebContextMenuListenerProxy::invalidate + 4 https://bugs.webkit.org/show_bug.cgi?id=172704 Reviewed by Andreas Kling. r191402 made WebContextMenuProxy non-refcounted. However there are several potential ways for WebContextMenuProxyMac::show() to re-enter WebPageProxy and delete itself. This patch partially reverts r191402 bringing refcounting back and protects WebContextMenuProxy during show(). Speculative fix. No test, can't repro the crash. * UIProcess/PageClient.h: * UIProcess/WebContextMenuProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::internalShowContextMenu): Protect WebContextMenuProxy during show(). * UIProcess/WebPageProxy.h: * UIProcess/gtk/WebContextMenuProxyGtk.h: (WebKit::WebContextMenuProxyGtk::create): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::createContextMenuProxy): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::createContextMenuProxy): * UIProcess/mac/WebContextMenuProxyMac.h: (WebKit::WebContextMenuProxyMac::create): 2017-05-30 Zan Dobersek Invalidate the LayerTreeHost when destroying the DrawingAreaWPE object. Rubber-stamped by Carlos Garcia Campos. * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: (WebKit::DrawingAreaWPE::~DrawingAreaWPE): Invalidate the LayerTreeHost object, properly deconstructing the graphics pipeline. 2017-05-29 Claudio Saavedra [GTK] Remove unneeded forward declaration Rubber-stamped by Zan Dobersek. * UIProcess/API/C/gtk/WKAPICastGtk.h: Remove WebGrammarDetail as its header is included in the same file. 2017-05-29 Claudio Saavedra [WPE] Build fix after r217531 Unreviewed. * UIProcess/API/C/wpe/WKAPICastWPE.h: (WebKit::toAPI): Add missing WebGrammarDetail API cast. 2017-05-28 Dan Bernstein [Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES https://bugs.webkit.org/show_bug.cgi?id=172691 Reviewed by Tim Horton. * Configurations/Base.xcconfig: Set ALWAYS_SEARCH_USER_PATHS to NO. * UIProcess/API/C/WKAPICast.h: Moved GTK-only definitions that used WebGrammarDetail.h to WKAPICastGtk.h. This had the effect of no longer including APIArray.h from this header. * UIProcess/API/C/gtk/WKAPICastGtk.h: Moved GTK-only definitions to here. (WebKit::toAPI): * UIProcess/WebGrammarDetail.h: Replaced include of APIArray.h with a forward declaration. * Shared/API/c/WKRenderLayer.cpp: * Shared/API/c/WKRenderObject.cpp: * UIProcess/API/C/WKApplicationCacheManager.cpp: * UIProcess/API/C/WKContext.cpp: * UIProcess/API/C/WKContextConfigurationRef.cpp: * UIProcess/API/C/WKCookieManager.cpp: * UIProcess/API/C/WKKeyValueStorageManager.cpp: * UIProcess/API/C/WKNotificationManager.cpp: * UIProcess/API/C/WKOpenPanelResultListener.cpp: * UIProcess/API/C/WKPageGroup.cpp: * UIProcess/API/C/WKResourceCacheManager.cpp: * UIProcess/API/C/WKUserContentControllerRef.cpp: * UIProcess/API/gtk/WebKitBackForwardList.cpp: * UIProcess/WebContextMenuListenerProxy.cpp: Added #include "APIArray.h" to these files now that WKAPICast.h does not include it. 2017-05-26 Joseph Pecoraro Simply some NSNumber usage https://bugs.webkit.org/show_bug.cgi?id=172677 Reviewed by Sam Weinig. * PluginProcess/mac/PluginControllerProxyMac.mm: (WebKit::PluginControllerProxy::platformGeometryDidChange): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::registerUserDefaultsIfNeeded): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]): 2017-05-26 Brent Fulgham [WK2] Address thread safety issues with ResourceLoadStatistics https://bugs.webkit.org/show_bug.cgi?id=172519 Reviewed by Chris Dumez. Address some thread safety issues with the ResourceLoadStatistics architecture. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Assert that this is never called on the main thread. Also ensure that coreStore is only accessed on the statistics queue, not the main thread. (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Dispatch coreStore-accessing code on the statistics queue. (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Assert we do not hit this method on the main thread. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Assert that this is being called on the main thread. Also ensure that coreStore is only accessed on the statistics queue, not the main thread. (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Dispatch coreStore-accessing code on the statistics queue. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Lock data before operating on it. (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Assert we do not hit this method on the main thread. (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Ditto. * UIProcess/WebResourceLoadStatisticsStore.h: * WebProcess/WebProcess.cpp: Add a queue for the local WebProcess ResourceLoadStatisticsStore to use while processing data. (WebKit::m_statisticsQueue): Added. * WebProcess/WebProcess.h: 2017-05-26 Joseph Pecoraro [Cocoa] Simplify some WebViewImpl pasteboard code https://bugs.webkit.org/show_bug.cgi?id=172668 Reviewed by Tim Horton. * Shared/mac/PasteboardTypes.mm: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setFileAndURLTypes): (WebKit::WebViewImpl::setPromisedDataForAttachment): 2017-05-26 Joseph Pecoraro JSContext Inspector: Improve the reliability of automatically pausing in auto-attach https://bugs.webkit.org/show_bug.cgi?id=172664 Reviewed by Matt Baker. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::connect): * UIProcess/Automation/WebAutomationSession.h: Special connection options are ignored in automation sessions. 2017-05-26 Commit Queue Unreviewed, rolling out r217479. https://bugs.webkit.org/show_bug.cgi?id=172642 Exposes an underlying bug in WPEBackend-mesa that we have to resolve separately (Requested by zdobersek on #webkit). Reverted changeset: "[WPE] Use AcceleratedDrawingArea instead of its fork" https://bugs.webkit.org/show_bug.cgi?id=172496 http://trac.webkit.org/changeset/217479 2017-05-26 Csaba Osztrogonác Unreviewed Mac cmake buildfix after r217137, just for fun. https://bugs.webkit.org/show_bug.cgi?id=172362 * PlatformMac.cmake: 2017-05-26 Carlos Garcia Campos [WPE] Use AcceleratedDrawingArea instead of its fork https://bugs.webkit.org/show_bug.cgi?id=172496 Reviewed by Žan Doberšek. WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead. * PlatformWPE.cmake: * Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type. * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed. * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually belongs here. * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port. * WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here. * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed. * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed. 2017-05-25 Said Abou-Hallawa [iOS] Disbale async image decoding when synchronously painting a newly parented WebView https://bugs.webkit.org/show_bug.cgi?id=172626 Reviewed by Simon Fraser. Large images have to be synchronously decoded when bringing a WebView to the foreground because the whole page will be painted when we unblock the UI process. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): Get nextFlushIsForImmediatePaint from RemoteLayerTreeContext and pass the correct GraphicsLayerPaintFlags to drawLayerContents(). * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: (WebKit::RemoteLayerTreeContext::setNextFlushIsForImmediatePaint): (WebKit::RemoteLayerTreeContext::nextFlushIsForImmediatePaint): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): Pass m_nextFlushIsForImmediatePaint to RemoteLayerTreeContext and then reset it. (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange): Set m_nextFlushIsForImmediatePaint to true to say that in the next flush, large images have to be synchronously decoded. 2017-05-25 Joseph Pecoraro _WKUserStyleSheet and WKUserScript leak string data https://bugs.webkit.org/show_bug.cgi?id=172583 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKUserScript.mm: (-[WKUserScript dealloc]): * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: (-[_WKUserStyleSheet dealloc]): Follow the pattern of destructing the internal API object. * UIProcess/API/Cocoa/WKUserScriptInternal.h: * UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h: Remove unnecessary includes. 2017-05-25 Chris Dumez ASSERT(m_websiteDataStore->websiteDataStore().sessionID() == m_sessionID) in PageConfiguration::sessionID() https://bugs.webkit.org/show_bug.cgi?id=172615 Reviewed by Brady Eidson. Fix assertion added in r215923 to take into account the fact that the PageConfiguration's sessionID is SessionID::legacyPrivateSessionID() when private browsing is enabled, instead of being the WebsiteDataStore's sessionID. See code in WebProcessPool::createWebPage(): """ pageConfiguration->setSessionID(pageConfiguration->preferences()->privateBrowsingEnabled() ? SessionID::legacyPrivateSessionID() : m_websiteDataStore->websiteDataStore().sessionID()); """ * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::sessionID): 2017-05-25 Brent Fulgham [WK2][iOS] Add a mach-lookup exception for 'com.apple.lsd.mapdb' to Network sandbox https://bugs.webkit.org/show_bug.cgi?id=172465 Reviewed by Alex Christensen. Expand sandbox to allow lookup of the mapdb that contains UTI information used by the Network process. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2017-05-25 Youenn Fablet com.apple.coremedia.videoencoder XPC service should be allowed by WebProcess sandbox https://bugs.webkit.org/show_bug.cgi?id=172599 Reviewed by Alex Christensen. * WebProcess/com.apple.WebProcess.sb.in: 2017-05-25 Simon Fraser [iOS WK2] Avoid setting contentsScale and rasterizationScale on CATransformLayers https://bugs.webkit.org/show_bug.cgi?id=172569 Reviewed by Dean Jackson. Setting contentsScale and rasterizationScale on CATransformLayers is a waste of CPU time, and triggers unwanted logging, so don't do it. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::PlatformCALayerRemote): 2017-05-25 Matt Lewis Unreviewed, rolling out r217409. The revision caused api failures Reverted changeset: "_WKUserStyleSheet leaks string data" https://bugs.webkit.org/show_bug.cgi?id=172583 http://trac.webkit.org/changeset/217409 2017-05-25 Joseph Pecoraro _WKUserStyleSheet leaks string data https://bugs.webkit.org/show_bug.cgi?id=172583 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: (-[_WKUserStyleSheet dealloc]): 2017-05-24 Joseph Pecoraro Increase the headerpad for WebKit XPC Services https://bugs.webkit.org/show_bug.cgi?id=172571 Reviewed by Dan Bernstein. * Configurations/BaseXPCService.xcconfig: Increase the headerpad to make room for additional dyld commands. 2017-05-24 David Keijser [GTK] Provide details on javascript exception https://bugs.webkit.org/show_bug.cgi?id=161187 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewRunJavaScriptCallback): (webkit_web_view_run_javascript): (resourcesStreamReadCallback): 2017-05-24 Ryan Haddad Unreviewed, suppress deprecation warnings to fix the build. * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::decode): 2017-05-24 Wenson Hsieh Plumb additional image metadata to item providers when beginning data interaction on an image https://bugs.webkit.org/show_bug.cgi?id=172536 Reviewed by Beth Dakin. Boilerplate plumbing to send suggestedName over IPC. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-05-24 Wenson Hsieh [WK2] Remove workaround to disable zooming to the focus rect while performing a data interaction https://bugs.webkit.org/show_bug.cgi?id=172546 Reviewed by Beth Dakin. Removes a now-unnecessary workaround to prevent scrolling when performing a data interaction operation in editable content. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _displayFormNodeInputView]): 2017-05-24 John Wilander Resource Load Statistics: Change grandfathering default to one hour https://bugs.webkit.org/show_bug.cgi?id=172524 Reviewed by Brent Fulgham. * Shared/WebPreferencesDefinitions.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): 2017-05-24 Jer Noble Rename DisplaySleepDisabler -> SleepDisabler https://bugs.webkit.org/show_bug.cgi?id=172478 Reviewed by Sam Weinig. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: 2017-05-23 John Wilander Resource Load Statistics: Don't include HSTS cache data in website data removal https://bugs.webkit.org/show_bug.cgi?id=172525 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::initializeDataTypesToRemove): 2017-05-15 Matt Rajca Replace autoplay events that fire at navigation with a DidAutoplayMediaPastThreshold event. https://bugs.webkit.org/show_bug.cgi?id=172138 Reviewed by Alex Christensen. Updated auto-play event types. * Shared/WebCoreArgumentCoders.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: 2017-05-23 Chris Dumez ASSERT(!m_timeoutTimer.isActive()) hit in BackgroundProcessResponsivenessTimer::responsivenessCheckTimerFired() https://bugs.webkit.org/show_bug.cgi?id=172509 Reviewed by Geoffrey Garen. In the BackgroundProcessResponsivenessTimer class, we have 2 timers: - m_responsivenessCheckTimer that causes us to do an IPC handshake with the WebProcess. - m_timeoutTimer that is started when we send the IPC message to the WebProcess and which is stopped when we get the response from the WebProcess. If we do not get the response by the time m_timeoutTimer fires, then we mark the process as unresponsive. As a result, of the behavior above, whenever the BackgroundProcessResponsivenessTimer is considered "active", there should be one of the 2 timers above that is active, and only one. The assertion hit showed that we decided to start the m_responsivenessCheckTimer timer even though the m_timeoutTimer timer is still active (we are still waiting for an IPC message from the WebProcess and the process is not considered unresponsive yet), which is wrong. The reason was that in BackgroundProcessResponsivenessTimer::updateState(), if we should be active, we would start the m_responsivenessCheckTimer if m_responsivenessCheckTimer is not already active, without checking if m_timeoutTimer is active. So if updateState() was called while the IPC handshake was in process, we would have both timers running at the same time. * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::updateState): (WebKit::BackgroundProcessResponsivenessTimer::isActive): * UIProcess/BackgroundProcessResponsivenessTimer.h: 2017-05-22 Simon Fraser Snapshotting via -renderInContext: should do synchronous image decodes https://bugs.webkit.org/show_bug.cgi?id=172485 rdar://problem/32276146 Reviewed by Tim Horton. Pass the PaintBehaviorSnapshotting flag in functions that do snapshotting. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): 2017-05-23 Myles C. Maxfield Remove dead ENABLE(FONT_LOAD_EVENTS) code https://bugs.webkit.org/show_bug.cgi?id=172517 Rubber-stamped by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-05-23 Tim Horton Zoom in/out is slow in Safari with large PDFs https://bugs.webkit.org/show_bug.cgi?id=172495 Reviewed by Simon Fraser. No tests; just a performance improvement. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::computePageBoxes): Use PDFKit instead of CGPDF to compute the first page box, so we can take advantage of PDFKit optimizations. PDFKit also handles box fallback, so we don't need to do that ourselves. Stop fetching all the boxes, as we only seem to use the first one. 2017-05-23 Tim Horton REGRESSION: API test WebKit2.WKObject is failing https://bugs.webkit.org/show_bug.cgi?id=172497 Reviewed by Geoff Garen. * Shared/Cocoa/WKNSString.mm: (-[WKNSString superclass]): (-[WKNSString class]): Pretend to be NSString instead of the more specific subclass (__NSCFString) that we actually are. There is code underneath us that assumes that if -class returns __NSCFString, that the object is a CFStringRef, which is not true in our case. 2017-05-23 Brent Fulgham [WK2][iOS] Add a mach-lookup exception for 'com.apple.analyticsd' https://bugs.webkit.org/show_bug.cgi?id=172462 Reviewed by Alexey Proskuryakov. * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-05-22 Brent Fulgham [WK2][iOS] Adopt a whitelist for XPC services https://bugs.webkit.org/show_bug.cgi?id=172182 Reviewed by Sam Weinig. Tell the Sandbox to block all XPC connections that are not explicitly allowed by the sandbox profile. The default behavior is to allow everything by default. If the restriction is set before including the standard iOS sandbox profiles, there does not seem to be a need to white list any other services. General web browsing on multiple devices indicate that these sandbox profiles work properly with media, accessibility, webgl, and general web content. * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-05-23 Emilio Cobos Álvarez Add a RuntimeEnabledFeature for display: contents, defaulted to false. https://bugs.webkit.org/show_bug.cgi?id=171984 Reviewed by Antti Koivisto. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDisplayContentsEnabled): (WKPreferencesGetDisplayContentsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-20 Alex Christensen REGRESSION(r215686): O(n^2) algorithm in CachedRawResource::addDataBuffer https://bugs.webkit.org/show_bug.cgi?id=172406 Reviewed by Brady Eidson. * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::redeliverManualStream): 2017-05-22 Yongjun Zhang Need a way to allow WKWebView to load request with ShouldOpenExternalURLsPolicy::ShouldAllow. https://bugs.webkit.org/show_bug.cgi?id=172460 Add an new method [WKWebView _loadRequest:shouldOpenExternalURLs:] to WKWebView; a WebKit client can use this to load request that allows opening external URLs. Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): When calling WebPageProxy::loadRequest, also set ShouldOpenExternalURLsPolicy based on the value of shouldOpenExternalURLs. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add [WKWebView _loadRequest:shouldOpenExternalURLs:]. 2017-05-22 Youenn Fablet Remove AVAudioCaptureSource https://bugs.webkit.org/show_bug.cgi?id=172360 Reviewed by Sam Weinig. Removing the handling of AVAudio/CoreAudio capture source dynamic switch. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetUseAVFoundationAudioCapture): Deleted. (WKPreferencesGetUseAVFoundationAudioCapture): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-22 Brian Burg Web Automation: characters produced with shift modifier on QWERTY keyboard should be delivered as shift-down, char-down, char-up, shift-up events https://bugs.webkit.org/show_bug.cgi?id=172299 Reviewed by Joseph Pecoraro. WebDriver tests expect some ASCII characters to be produced using the shift key, regardless of the actual keyboard layout. Emit extra events when simulating these keystrokes if the shift key is not already pressed. * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::characterIsProducedUsingShift): (WebKit::WebAutomationSession::platformSimulateKeySequence): 2017-05-22 Sam Weinig [WebIDL] Support callbacks with arbitrary return types https://bugs.webkit.org/show_bug.cgi?id=172407 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.h: Update to match new interface of NodeFilterCondition. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp: Update to account for new WebCore implementation return types. 2017-05-22 Michael Catanzaro -Wreturn-type warning triggered by WKPage.cpp:2277 https://bugs.webkit.org/show_bug.cgi?id=171866 Reviewed by Žan Doberšek. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): 2017-05-22 Michael Catanzaro -Wreturn-type warning triggered by WebAutomationSession.cpp:851 https://bugs.webkit.org/show_bug.cgi?id=171867 Reviewed by Žan Doberšek. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::protocolModifierToWebEventModifier): 2017-05-22 Wenson Hsieh Remove unused documentIsHandlingNonDefaultDrag plumbing for WebKit2 https://bugs.webkit.org/show_bug.cgi?id=172453 Reviewed by Tim Horton. Removes unused plumbing that was originally added to support file uploads. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformDragControllerAction): (WebKit::WebPageProxy::resetCurrentDragInformation): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::currentDragCaretRect): (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag): Deleted. * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-05-22 Michael Catanzaro Add even more input validation in Connection::processMessage() https://bugs.webkit.org/show_bug.cgi?id=171682 Reviewed by Carlos Garcia Campos. Verify that the size of the out-of-line message body matches the size of the AttachmentInfo that is containing it. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): 2017-05-22 Tomas Popela Remove some of the EFL port leftovers https://bugs.webkit.org/show_bug.cgi?id=172440 Reviewed by Carlos Garcia Campos. * Scripts/generate-forwarding-headers.pl: 2017-05-22 Gwang Yoon Hwang [CoordinatedGraphics] Clear UpdateAtlases for each tests https://bugs.webkit.org/show_bug.cgi?id=172119 Reviewed by Carlos Garcia Campos. In Coordinated Graphics, we reuses at least one update atlas to render root compositing layer for several tests. So if one of the test cases breaks the internal states of Cairo's states, other followed test cases runs on same instance of WebKitTestRunner will be effected by broken states of Cairo. Because it increases test flaknesses, we should drop update atlases after each tests. * WebProcess/WebCoreSupport/WebChromeClient.cpp: Remove a redundant include statement for Coordinated graphics (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Added. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Added. * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::clearUpdateAtlases): Added. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Added. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/LayerTreeHost.h: * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: (WebKit::DrawingAreaWPE::resetUpdateAtlasForTesting): * WebProcess/WebPage/wpe/DrawingAreaWPE.h: 2017-05-22 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.3 release. * gtk/NEWS: Add release notes for 2.17.3. 2017-05-22 Carlos Garcia Campos [GTK] Add webkit_context_menu_item_new_from_gaction https://bugs.webkit.org/show_bug.cgi?id=159631 Reviewed by Michael Catanzaro. Add new API to create a WebKitContextMenuItem from a GAction and also to get the associated GAction. * Shared/gtk/WebContextMenuItemGtk.cpp: (WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk): Add constructor that receives a GAction. (WebKit::isGActionChecked): Helper to check if a stateful GAction is checked or not. (WebKit::WebContextMenuItemGtk::createActionIfNeeded): When creating a GAction from a GtkAtion, use the GtkAction name instead of adding a new one. Do not create the GAction if we already have one. * Shared/gtk/WebContextMenuItemGtk.h: (WebKit::WebContextMenuItemGtk::gAction): (WebKit::WebContextMenuItemGtk::gActionTarget): * UIProcess/API/gtk/WebKitContextMenuItem.cpp: (webkit_context_menu_item_new_from_gaction): (webkit_context_menu_item_get_gaction): * UIProcess/API/gtk/WebKitContextMenuItem.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols. * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::contextMenuItemActivatedCallback): Update the state of the internal GAction in case of toggle menu items. (WebKit::WebContextMenuProxyGtk::append): Pass the GAction target to g_menu_item_set_action_and_target_value. Do not connect to activate signal of actions provided by the user. 2017-05-21 Carlos Garcia Campos Add more input validation in Connection::readBytesFromSocket() https://bugs.webkit.org/show_bug.cgi?id=171871 Reviewed by Michael Catanzaro. Check the control message length is in the limits. Credit to Nathan Crandall for reporting this issue and submitting an equivalent fix. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::readBytesFromSocket): 2017-05-20 Michael Catanzaro -Wreturn-type warning triggered by WKNotification.cpp:77 https://bugs.webkit.org/show_bug.cgi?id=172414 Reviewed by Sam Weinig. * UIProcess/API/C/WKNotification.cpp: (WKNotificationCopyDir): 2017-05-19 John Wilander Resource Load Statistics: Use WebProcessPool::allProcessPools() when sending message to network process about partitioning https://bugs.webkit.org/show_bug.cgi?id=172370 Reviewed by Alex Christensen. The existing test case http/tests/loading/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html is currently failing and should start passing again with this patch. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): 2017-05-19 Chris Dumez [WK2] Notify client when a process exceeds background CPU limit while in the foreground https://bugs.webkit.org/show_bug.cgi?id=172246 Reviewed by Geoffrey Garen. When there is a background CPU limit set by the client, we now monitor the CPU usages of all WebContent processes, not just the non-visible ones. This way, we are now able to notify the client a process has exceeded the background CPU limit while in the foreground, via the UIClient's didExceedBackgroundResourceLimitWhileInForeground function, passing kWKResourceLimitCPU. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy): * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::cpuLimit): (API::PageConfiguration::setCPULimit): * UIProcess/API/C/WKPageConfigurationRef.cpp: (WKPageConfigurationSetBackgroundCPULimit): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateThrottleState): (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive): (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedCPULimit): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::cpuLimit): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::createWebPage): (WebKit::WebProcess::removeWebPage): (WebKit::WebProcess::updateCPULimit): (WebKit::WebProcess::updateCPUMonitorState): (WebKit::WebProcess::pageActivityStateDidChange): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateCPULimit): (WebKit::WebProcess::updateCPUMonitorState): 2017-05-19 Jeremy Jones Remove defunct WebVideoFullscreenInterface https://bugs.webkit.org/show_bug.cgi?id=172254 Reviewed by Jon Lee. Remove reference to WebVideoFullscreenInterface. It has long since been replaced by WebVideoFullscreenModelClient. * WebProcess/cocoa/WebVideoFullscreenManager.h: 2017-05-19 Jeremy Jones [WebRTC] Remove PiP support for video elements that are showing camera capture https://bugs.webkit.org/show_bug.cgi?id=172336 Reviewed by Eric Carlson. Ask video element if it supports picture-in-picture instead of asking the mediaSession directly. This allows the video element to give a more robust answer. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): 2017-05-19 Chris Dumez Make sure implementation of InitializeWebKit2() always run on the main thread https://bugs.webkit.org/show_bug.cgi?id=172362 Reviewed by Geoffrey Garen. Add logic in InitializeWebKit2() for Cocoa ports to always run the initialization code is only called once, and on the main thread. If we are called from a non-main thread, we will dispatch synchronously to the main thread to run the initialization code. This is needed because WebKit2Initialize() is called from the API::Object constructor. API::Object is thread-safe RefCounted and those objects are sometimes initialized on non-main thread. If the first of such objects happened to be initialized on a non-main thread, then we would run the initialization code for the first time on a non-main thread. This would lead to hard to debug issues because code such as RunLoop::initializeMainRunLoop() is only safe to call on the main thread because it stores a pointer to the current thread's RunLoop in a static variable for later use (i.e. for RunLoop::main()). * Shared/Cocoa/WebKit2InitializeCocoa.mm: Copied from Source/WebKit2/Shared/WebKit2Initialize.cpp. (WebKit::runInitializationCode): (WebKit::InitializeWebKit2): * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): * WebKit2.xcodeproj/project.pbxproj: 2017-05-19 Carlos Garcia Campos REGRESSION(r216977): [GTK] Ephemeral sessions broken after r216977 https://bugs.webkit.org/show_bug.cgi?id=172345 Reviewed by Michael Catanzaro. Since r216977, WebProcessPool sends the page session ID to the web process, but the WebsiteDataStoreParameters session ID to the network process. WebsiteDataStoreParameters is only implemented for Cocoa, so we are sending 0 session ID to the network process, while using the right session ID everywhere else. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageAddedToProcess): Add an ASSERT to ensure we are sending the same session ID to Web and Network processes. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): Add minimal implementation for non-Cocoa ports to at least set the session ID. 2017-05-19 Carlos Garcia Campos Add more input validation in Connection::processMessage() https://bugs.webkit.org/show_bug.cgi?id=171682 Reviewed by Michael Catanzaro. Check limits of attachments and message size. Credit to Nathan Crandall for reporting this issue and submitting an equivalent fix. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): 2017-05-19 Carlos Garcia Campos [Threaded Compositor] Remove platform ifdefs from threaded compositor implementation https://bugs.webkit.org/show_bug.cgi?id=172265 Reviewed by Žan Doberšek. Add AcceleratedSurfaceWPE implementation that is equivalent to the PlatformDisplayWPE::EGLTarget. Since WPE needs the surface to be initialized/finalized in the compositing thread, two new virtual methods has been added to AcceleratedSurface initialize/finalize that are only implemented by WPE. The threaded compositor no longer receives a native surface handle as contructor parameter, it now asks the client for it from the compositing thread, right after it's created. * PlatformWPE.cmake: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::create): Remove ativeSurfaceHandle parameter. (WebKit::ThreadedCompositor::ThreadedCompositor): Initialize m_nativeSurfaceHandle from the compositing thread asking the client for it. (WebKit::ThreadedCompositor::createGLContext): Remove the WPE implementation. (WebKit::ThreadedCompositor::invalidate): Notify the client that the GL context has been destroyed. (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Remove GTK ifdefs. (WebKit::ThreadedCompositor::setViewportSize): Remove WPE implementation. (WebKit::ThreadedCompositor::renderLayerTree): Notify the client the frame will be rendered, and when it has been rendered. (WebKit::ThreadedCompositor::frameComplete): Remove WPE ifdefs. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/AcceleratedSurface.cpp: (WebKit::AcceleratedSurface::create): Add client parameter. (WebKit::AcceleratedSurface::AcceleratedSurface): Create a AcceleratedSurfaceWPE if display is WPE. * WebProcess/WebPage/AcceleratedSurface.h: (WebKit::AcceleratedSurface::surfaceID): (WebKit::AcceleratedSurface::initialize): (WebKit::AcceleratedSurface::finalize): (WebKit::AcceleratedSurface::willRenderFrame): (WebKit::AcceleratedSurface::didRenderFrame): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Pass this as client of AcceleratedSurface. (WebKit::ThreadedCoordinatedLayerTreeHost::frameComplete): Notify the compositor. (WebKit::ThreadedCoordinatedLayerTreeHost::nativeSurfaceHandleForCompositing): Initialize the surface and return the window handler. (WebKit::ThreadedCoordinatedLayerTreeHost::didDestroyGLContext): Finalize the surface. (WebKit::ThreadedCoordinatedLayerTreeHost::willRenderFrame): Notify the surface. (WebKit::ThreadedCoordinatedLayerTreeHost::didRenderFrame): Ditto. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp: (WebKit::AcceleratedSurfaceWayland::create): Add client parameter. (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): Ditto. (WebKit::AcceleratedSurfaceWayland::didRenderFrame): Call Client::frameComplete(). * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h: * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp: (WebKit::AcceleratedSurfaceX11::create): Add client parameter. (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Ditto. (WebKit::AcceleratedSurfaceX11::didRenderFrame): Call Client::frameComplete(). * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h: * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: Added. (WebKit::AcceleratedSurfaceWPE::create): (WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE): (WebKit::AcceleratedSurfaceWPE::~AcceleratedSurfaceWPE): (WebKit::AcceleratedSurfaceWPE::initialize): (WebKit::AcceleratedSurfaceWPE::finalize): (WebKit::AcceleratedSurfaceWPE::window): (WebKit::AcceleratedSurfaceWPE::surfaceID): (WebKit::AcceleratedSurfaceWPE::resize): (WebKit::AcceleratedSurfaceWPE::willRenderFrame): (WebKit::AcceleratedSurfaceWPE::didRenderFrame): * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h: Copied from Source/WebKit2/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h. 2017-05-19 Yusuke Suzuki [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass https://bugs.webkit.org/show_bug.cgi?id=172098 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: * WebProcess/Plugins/Netscape/JSNPObject.cpp: 2017-05-18 Andreas Kling [WK2] Notify WebPageProxy client when an active process goes over the inactive memory limit https://bugs.webkit.org/show_bug.cgi?id=172244 Reviewed by Geoffrey Garen. Add a WKPageUIClient callback that is invoked when an active process exceeds the inactive memory limit. With the current state of the implementation, this means that a UI client can learn that backgrounding a non-audible, non-capturing tab may cause it to get killed once the active/inactive hysteresis time is over (8 minutes.) The callback can be invoked multiple times if we exceed the limit, and then go under, and exceed again. This is the callback: didExceedBackgroundResourceLimitWhileInForeground(WKPageRef, WKResourceLimit) Where WKResourceLimit is one of { kWKResourceLimitMemory, kWKResourceLimitCPU } The CPU enum value is a placeholder pending implementation soon. * UIProcess/API/APIUIClient.h: (API::UIClient::didExceedBackgroundResourceLimitWhileInForeground): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedInactiveMemoryLimitWhileActive): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-05-18 Eric Carlson [MediaStream] do not cache gUM permissions https://bugs.webkit.org/show_bug.cgi?id=172245 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): (WebKit::FrameAuthorizationState::FrameAuthorizationState): Deleted. (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice): Deleted. (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice): Deleted. (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: (WebKit::FrameAuthorizationState::setDeviceIdentifierHashSalt): Deleted. (WebKit::FrameAuthorizationState::deviceIdentifierHashSalt): Deleted. * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt): 2017-05-18 Tim Horton Data interaction conclusion snapshot has too much margin https://bugs.webkit.org/show_bug.cgi?id=172323 Reviewed by Beth Dakin. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::didConcludeEditDataInteraction): Disable the default TextIndicator margin. 2017-05-18 Andy Estes ENABLE(APPLE_PAY_DELEGATE) should be NO on macOS Sierra and earlier https://bugs.webkit.org/show_bug.cgi?id=172305 Reviewed by Anders Carlsson. * Configurations/FeatureDefines.xcconfig: 2017-05-18 John Wilander Resource Load Statistics: Grandfather domains for existing data records https://bugs.webkit.org/show_bug.cgi?id=172155 Reviewed by Alex Christensen. When WebResourceLoadStatisticsStore starts fresh it needs to scan existing website data records and 'grandfather' them to allow ample time to capture user interaction. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetGrandfathered): (WKResourceLoadStatisticsManagerIsGrandfathered): (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetGrandfatheringTime): Functions for testing and configuration. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): Added grandfathering configuration. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): New function to get all top privately controlled domains that have website data. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Functions for testing and configuration. WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval() changed as a result of WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval() moving to WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval(). * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::initializeDataTypesToRemove): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Moved handling of pending removal into WebCore::ResourceLoadStatisticsStore since that's where grandfathering happens. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Moved registration of write persistent store callback and reading of Cocoa defaults to WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver without parameters so they are called for platforms without CFNETWORK_STORAGE_PARTITIONING. Now includes registering WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData() as handler for grandfathering since it involves reading of the website data store. (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval): Deleted. Now happens in WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval(). * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain): New function to ask a WebsiteDataRecord for its top privately controlled domain. * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): New function to get all top privately controlled domains that have website data. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-05-18 Andy Estes Add "countryCode" to ApplePayErrorContactField https://bugs.webkit.org/show_bug.cgi?id=172264 Reviewed by Anders Carlsson. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-05-18 Commit Queue Unreviewed, rolling out r217031, r217032, and r217037. https://bugs.webkit.org/show_bug.cgi?id=172293 cause linking errors in Windows (Requested by yusukesuzuki on #webkit). Reverted changesets: "[JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass" https://bugs.webkit.org/show_bug.cgi?id=172098 http://trac.webkit.org/changeset/217031 "Unreviewed, rebaseline for newly added ClassInfo" https://bugs.webkit.org/show_bug.cgi?id=172098 http://trac.webkit.org/changeset/217032 "Unreviewed, fix debug and non-JIT build" https://bugs.webkit.org/show_bug.cgi?id=172098 http://trac.webkit.org/changeset/217037 2017-05-18 Claudio Saavedra [WPE] Unreviewed build fix Add missing header after r217041. * UIProcess/API/wpe/WPEView.cpp: 2017-05-18 Tim Horton More WebKit2 header cleanup https://bugs.webkit.org/show_bug.cgi?id=172214 Reviewed by Simon Fraser. * Shared/WebFindOptions.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setCompositionAsync): * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImpl.mm: * UIProcess/mac/ViewGestureControllerMac.mm: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: * WebProcess/Automation/WebAutomationSessionProxy.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h: * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h: * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h: * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: * WebProcess/Notifications/WebNotificationManager.cpp: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp: * WebProcess/WebCoreSupport/WebEditorClient.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp: * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::setDeviceScaleFactor): (WebKit::WebPage::centerSelectionInVisibleArea): (WebKit::WebPage::findString): (WebKit::WebPage::findStringMatches): (WebKit::WebPage::getImageForFindMatch): (WebKit::WebPage::selectFindMatch): (WebKit::WebPage::hideFindUI): (WebKit::WebPage::countStringMatches): (WebKit::WebPage::didReceiveGeolocationPermissionDecision): (WebKit::WebPage::mainFrameDidLayout): (WebKit::WebPage::setCompositionAsync): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::findController): (WebKit::WebPage::geolocationPermissionRequestManager): * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Many small changes added up to a few percent. Removing UserMediaRequest from UserMediaPermissionRequestProxy, which is included into WebPageProxy.h, was worth another ~10% because it got VM.h out of WebPageProxy.h (like the previous patch did with WebPage.h). In total, in my measurement (WebKit2 clean debug build) this is a ~15% speedup. We really should figure out how to make DOMPromise.h not bring in all of JavaScriptCore (or how to use promises without including DOMPromise.h in headers). 2017-05-17 Chris Dumez Fix unsafe lambda capture in ContentRuleListStore::lookupContentRuleList() https://bugs.webkit.org/show_bug.cgi?id=172258 Reviewed by Brady Eidson. Fix unsafe lambda capture in ContentRuleListStore::lookupContentRuleList(). The String was moved instead of calling isolatedCopy(), even though we're passing the String to another thread. * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::lookupContentRuleList): 2017-05-16 Yusuke Suzuki [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass https://bugs.webkit.org/show_bug.cgi?id=172098 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: * WebProcess/Plugins/Netscape/JSNPObject.cpp: 2017-05-17 Ryan Haddad Unreviewed, rolling out r217014. This change caused mac-wk2 LayoutTests to exit early due to crashes. Reverted changeset: "Resource Load Statistics: Grandfather domains for existing data records" https://bugs.webkit.org/show_bug.cgi?id=172155 http://trac.webkit.org/changeset/217014 2017-05-17 John Wilander Resource Load Statistics: Grandfather domains for existing data records https://bugs.webkit.org/show_bug.cgi?id=172155 Reviewed by Alex Christensen. When WebResourceLoadStatisticsStore starts fresh it needs to scan existing website data records and 'grandfather' them to allow ample time to capture user interaction. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetGrandfathered): (WKResourceLoadStatisticsManagerIsGrandfathered): (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetGrandfatheringTime): Functions for testing and configuration. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): Added grandfathering configuration. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): New function to get all top privately controlled domains that have website data. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Functions for testing and configuration. WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval() changed as a result of WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval() moving to WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval(). * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::initializeDataTypesToRemove): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Moved handling of pending removal into WebCore::ResourceLoadStatisticsStore since that's where grandfathering happens. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Moved registration of write persistent store callback and reading of Cocoa defaults to WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver without parameters so they are called for platforms without CFNETWORK_STORAGE_PARTITIONING. Now includes registering WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData() as handler for grandfathering since it involves reading of the website data store. (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval): Deleted. Now happens in WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval(). * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain): New function to ask a WebsiteDataRecord for its top privately controlled domain. * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): New function to get all top privately controlled domains that have website data. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-05-17 Brent Fulgham [WK2][iOS] Allow access to additional IOHID user class https://bugs.webkit.org/show_bug.cgi?id=172198 Reviewed by Alex Christensen. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-05-17 Chris Dumez Add more assertions in BackgroundProcessResponsivenessTimer https://bugs.webkit.org/show_bug.cgi?id=172239 Reviewed by Andreas Kling. Add more assertions in BackgroundProcessResponsivenessTimer to help figure out the source of . * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::updateState): (WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck): 2017-05-17 Youenn Fablet No need to copy origin references in UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo https://bugs.webkit.org/show_bug.cgi?id=172242 Reviewed by Eric Carlson. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): 2017-05-17 Youenn Fablet Move-related refactoring on UserMediaPermissionRequestProxy https://bugs.webkit.org/show_bug.cgi?id=172195 Reviewed by Alex Christensen. Moving vectors of strings instead of passing as const ref so that we do not copy them. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): 2017-05-17 Andy Estes REGRESSION (r215480): PKPaymentAuthorizationStatusFailure sent to PassKit in completeShippingContactSelection() even when there are no errors https://bugs.webkit.org/show_bug.cgi?id=172227 Reviewed by Alexey Proskuryakov. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentAuthorizationStatus): If there is an update with no errors, we should return PKPaymentAuthorizationStatusSuccess instead of PKPaymentAuthorizationStatusFailure. 2017-05-17 Matt Lewis Unreviewed, rolling out r216974. Revision caused consistent timeouts on all platforms. Reverted changeset: "Add a RuntimeEnabledFeature for display: contents, defaulted to false." https://bugs.webkit.org/show_bug.cgi?id=171984 http://trac.webkit.org/changeset/216974 2017-05-17 Alex Christensen Interacting with WKHTTPCookieStores before creating WKWebViews and WKProcessPools should affect cookies used https://bugs.webkit.org/show_bug.cgi?id=171987 Reviewed by Brady Eidson. When putting cookies in a WKHTTPCookieStore that hasn't been associated with a WKProcessPool yet, there is no NetworkProcess into which to put the cookies. In such a case, we should store these cookies in the WebsiteDataStore until there is a NetworkProcess. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::ensurePrivateBrowsingSession): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::~WebsiteDataStoreParameters): (WebKit::WebsiteDataStoreParameters::encode): (WebKit::WebsiteDataStoreParameters::decode): (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters): Deleted. * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookie): (API::HTTPCookieStore::deleteCookie): * UIProcess/API/APIHTTPCookieStore.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::pendingCookies): (WebKit::WebsiteDataStore::addPendingCookie): (WebKit::WebsiteDataStore::removePendingCookie): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-05-17 Emilio Cobos Álvarez Add a RuntimeEnabledFeature for display: contents, defaulted to false. https://bugs.webkit.org/show_bug.cgi?id=171984 Reviewed by Antti Koivisto. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDisplayContentsEnabled): (WKPreferencesGetDisplayContentsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-17 Carlos Garcia Campos Unreviewed. Fix the build with MEDIA_STREAM disabled after r216952. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): 2017-05-17 Carlos Garcia Campos [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted https://bugs.webkit.org/show_bug.cgi?id=172167 Reviewed by Michael Catanzaro. This is still happening, even after r216182, less often but still happens. There are two conditions in which this can happen: - Again in force repaint. r216182 fixed the case of force repaint called when update state is completed, but it can also crash if update state is inProgress or PendingAfterCompletion when m_coordinateUpdateCompletionWithClient is true. - When the threaded compositor is invalidated right after renderLayerTree() starts, but before it finishes. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::invalidate): Invalidate the refresh monitor right after stopping updates in the compositing run loop to ensure no more updates are scheduled. (WebKit::ThreadedCompositor::renderLayerTree): Check the scene is still active before calling sceneUpdateFinished(). (WebKit::ThreadedCompositor::updateSceneState): Do not update m_coordinateUpdateCompletionWithClient when in force repaint. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): Return early if the monitor has been invalidated. 2017-05-16 Sam Weinig Bring Notification.idl up to spec https://bugs.webkit.org/show_bug.cgi?id=172156 Reviewed by Chris Dumez. * Shared/WebCoreArgumentCoders.h: * UIProcess/API/C/WKNotification.cpp: (WKNotificationCopyDir): * UIProcess/Notifications/WebNotification.cpp: (WebKit::WebNotification::WebNotification): * UIProcess/Notifications/WebNotification.h: (WebKit::WebNotification::create): (WebKit::WebNotification::dir): * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::show): * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showNotification): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: (WebKit::NotificationPermissionRequestManager::startRequest): (WebKit::NotificationPermissionRequestManager::permissionLevel): (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::policyForOrigin): (WebKit::WebNotificationManager::show): * WebProcess/WebCoreSupport/WebNotificationClient.cpp: (WebKit::WebNotificationClient::checkPermission): * WebProcess/WebCoreSupport/WebNotificationClient.h: Update for enum vs String usage. 2017-05-16 Youenn Fablet Modernize WebKit2 getUserMedia passing of parameters https://bugs.webkit.org/show_bug.cgi?id=172161 Reviewed by Eric Carlson. Passing SecurityOrigin as SecurityOriginData through IPC instead of Strings. Making more use of Ref<> instead of RefPtr<>. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): * UIProcess/UserMediaPermissionCheckProxy.h: (WebKit::UserMediaPermissionCheckProxy::create): (WebKit::UserMediaPermissionCheckProxy::userMediaDocumentSecurityOrigin): (WebKit::UserMediaPermissionCheckProxy::topLevelDocumentSecurityOrigin): (WebKit::UserMediaPermissionCheckProxy::completionHandler): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): (WebKit::WebPageProxy::requestNotificationPermission): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): 2017-05-16 David Kilzer Unused lambdas in UserMediaPermissionRequestManagerProxy.cpp Reviewed by Eric Carlson. Fixes unused lambda warnings found with newer clang: Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:309:46: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture] auto validateConstraintsHandler = [this, userMediaID, validHandler = WTFMove(validHandler), invalidHandler = WTFMove(invalidHandler), audioConstraints = WebCore::MediaConstraints(audioConstraints), videoConstraints = WebCore::MediaConstraints(videoConstraints)](String&& deviceIdentifierHashSalt) mutable { ^ Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:41: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture] auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable { ^ Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:54: error: lambda capture 'frameID' is not used [-Werror,-Wunused-lambda-capture] auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable { ^ Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:362:37: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture] auto completionHandler = [this, userMediaID](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) { ^ * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): - Remove unused lambdas. 2017-05-16 Brent Fulgham [WK2][macOS] Support Flash Player DRM features https://bugs.webkit.org/show_bug.cgi?id=172157 Reviewed by Dean Jackson. Relax the IOKit whitelist to support DRM features needed by some websites. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-05-16 Brent Fulgham [WK2][macOS] Adopt a whitelist for XPC services https://bugs.webkit.org/show_bug.cgi?id=172151 Reviewed by Alex Christensen. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-05-16 Timothy Horton Make it possible to adjust which edges are affected by safe area insets https://bugs.webkit.org/show_bug.cgi?id=172149 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _computedContentInset]): (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add SPI to adjust which edges are taken into account, and adjust the default. 2017-05-16 Zan Dobersek [GLib] Use RunLoopSourcePriority::RunLoopDispatcher as the GSocketMonitor's GSource priority https://bugs.webkit.org/show_bug.cgi?id=172160 Reviewed by Carlos Garcia Campos. * Platform/IPC/glib/GSocketMonitor.cpp: (IPC::GSocketMonitor::start): Explicitly set the priority for the GSocketMonitor's GSource object to RunLoopSourcePriority::RunLoopDispatcher, equating it to the priority that's used in RunLoop for dispatches of the queued functions. 2017-05-16 Zan Dobersek [GLib] Name more GSource-based RunLoop::Timers https://bugs.webkit.org/show_bug.cgi?id=172158 Reviewed by Carlos Garcia Campos. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): Specify 'CompositingRunLoop' as the name of this GSource-based RunLoop::Timer. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): Specify 'ThreadedDisplayRefreshMonitor' as the name of this GSource-based RunLoop::Timer. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): Specify 'CoordinatedLayerTreeHost' as the name of this GSource-based RunLoop::Timer. 2017-05-16 Carlos Garcia Campos Unreviewed. Revert change committed by mistakle in r216922. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::forceRepaint): 2017-05-16 Youenn Fablet Remove MediaConstraintsData and MediaConstraintsImpl https://bugs.webkit.org/show_bug.cgi?id=172132 Reviewed by Eric Carlson. Removing MediaConstraintsData and MediaConstraintsImpl allows simplifying the code. Further simplified the code by making MediaConstraints no longer ref counted and now a struct. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::applyConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::applyConstraints): 2017-05-16 Michael Catanzaro [SOUP] Remove LATEST_RECORD_VERSION from GnuTLS priority string https://bugs.webkit.org/show_bug.cgi?id=172153 Based on discussion with Nikos in https://bugzilla.gnome.org/show_bug.cgi?id=782218, we should remove LATEST_RECORD_VERSION from our GnuTLS priority string. This causes GnuTLS to use the latest TLS record version (the record format is separate from the TLS protocol version), which we needed a couple years ago (after dropping SSLv3) for maximum compatibility with broken web servers. But it's not needed anymore, and is causing new compatibility problems with other broken web servers, so let's get rid of it. Reviewed by Carlos Garcia Campos. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: (main): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2017-05-15 Andy Estes Make the application PID available to WebCore https://bugs.webkit.org/show_bug.cgi?id=172133 Reviewed by Andreas Kling. Added uiProcessPID to Web and Networking process creation parameters. The UI process initializes these to getpid(), and the child processes call WebCore::setPresentingApplicationPID() at initialization time. This replaces presenterApplicationPid. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::createNewWebProcess): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformInitialize): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::presenterApplicationPid): Deleted. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2017-05-15 Said Abou-Hallawa Do not delete asynchronously decoded frames for large images if their clients are in the viewport https://bugs.webkit.org/show_bug.cgi?id=170640 Reviewed by Simon Fraser. Enable the async decoding for large images. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-15 Youenn Fablet Simplify RealtimeMediaSource data production and state https://bugs.webkit.org/show_bug.cgi?id=171999 Reviewed by Eric Carlson. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::startProducingData): (WebKit::UserMediaCaptureManagerProxy::stopProducingData): * WebProcess/cocoa/UserMediaCaptureManager.cpp: 2017-05-15 Brent Fulgham Correct typo (part of r216790). * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: The check-in missed part of a regular expression needed to fix the audio playback. 2017-05-15 Jer Noble Add experimental setting to allow document gesture interaction to fulfill media playback gesture requirement https://bugs.webkit.org/show_bug.cgi?id=172131 Reviewed by Eric Carlson. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaUserGestureInheritsFromDocument): (WKPreferencesGetMediaUserGestureInheritsFromDocument): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-15 Brent Fulgham [WK2][macOS][iOS] Allow Network process to access nsurlstoraged's top level domain data cache https://bugs.webkit.org/show_bug.cgi?id=172128 Reviewed by Alex Christensen. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2017-05-15 David Kilzer Update json.hpp to v2.1.1 Reviewed by Alex Christensen. * NetworkProcess/capture/NetworkCaptureEvent.cpp: - Define JSON_NOEXCEPTION as 1 to disable exceptions in json.hpp. (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::encode): - Build std::string passing in length to avoid the need for a custom basic_json() constructor, and for efficiency. * NetworkProcess/capture/json.hpp: - Update to v2.1.1 and remove customizations. 2017-05-15 Brent Fulgham Unreviewed build fix. Debugging code was accidentally left in the Plugin sandbox profile. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-05-15 Gwang Yoon Hwang [WPE] Unreviewed debug build fix https://bugs.webkit.org/show_bug.cgi?id=172118 Unreviewed, remove a dead code accidentally committed in r215259. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: Remove deprecated CompositingRunLoop::isCurrent. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::frameComplete): 2017-05-14 Daewoong Jang [CoordinatedGraphics] Remove unused files and lines https://bugs.webkit.org/show_bug.cgi?id=172080 Reviewed by Darin Adler. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: Removed. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h: Removed. * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Removed. * Shared/CoordinatedGraphics/WebCoordinatedSurface.h: Removed. * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: Removed. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in: Removed. 2017-05-14 Andreas Kling Always reset the assisted node when the main frame commits a new load. https://bugs.webkit.org/show_bug.cgi?id=172088 Reviewed by Antti Koivisto. WebPage::m_assistedNode could extend the lifetime of the document it pointed into if the main frame was navigated while the assisted node was in one of its subframes. The life-supported document wouldn't be reachable from JavaScript but nevertheless would consume memory and other resources. This patch fixes the issue by always clearing WebPage::m_assistedNode when the main frame commits a new load. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::resetAssistedNodeForFrame): 2017-05-14 Csaba Osztrogonác Unreviewed Mac cmake buildfix after r216690, just for fun. * PlatformMac.cmake: 2017-05-14 David Kilzer Fix unused lambdas in WebKit2 Reviewed by Chris Dumez. Fixes unused lambda warnings found with newer clang. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::retrieve): * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::initialize): - Use UNUSED_PARAM() to silence unused lambda warning since 'startTime' is used in Debug builds. * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): - Remove unused 'this' from lambda capture. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): - Use UNUSED_PARAM() to silence unused lambda warning since 'taskIdentifier' is used in Debug builds. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): - Remove unused 'this' from lambda captures. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): - Remove unused 'fetchOptions' from lambda capture. (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): - Remove unused 'this' from lambda capture. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::forceRepaintIfNeeded): - Remove unused 'this' from lambda capture. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::didExitFullscreen): - Remove unused 'this' from nested lambda captures. 2017-05-13 Eric Carlson [MediaStream] deviceId constraint doesn't work with getUserMedia https://bugs.webkit.org/show_bug.cgi?id=171877 Reviewed by Jer Noble. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode deviceIDHashSalt. (IPC::ArgumentCoder::decode): Decode deviceIDHashSalt. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize completion handler, frame ID, and security origins. (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling completion handler because we now sometimes request access info before calling gUM. (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler. * UIProcess/UserMediaPermissionCheckProxy.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy. (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt when origins don't match. (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto. Don't set state for empty UIDs. Pass hash salt to web process. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): The device ID hash salt is now required to validate constraints, so get it first. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper method used to get the device ID hash salt. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure to use getUserMediaPermissionInfo. (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID hash salt parameter. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): Ditto. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData constructor. 2017-05-13 Chris Dumez Stop using RefPtr::release() https://bugs.webkit.org/show_bug.cgi?id=172074 Reviewed by Geoffrey Garen. * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::create): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createImageBacking): * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::createCairoSurface): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp: (WebKit::core): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getContentsAsMHTMLData): 2017-05-12 Chris Dumez Drop remaining uses of PassRefPtr in WebKit2/WebProcess https://bugs.webkit.org/show_bug.cgi?id=172055 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm: (+[WKWebProcessPlugInScriptWorld normalWorld]): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (contextMenuItems): * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: (WKBundleScriptWorldNormalWorld): * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp: (webkitScriptWorldCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp: (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h: * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): (WebKit::InjectedBundleRangeHandle::create): (WebKit::InjectedBundleRangeHandle::coreRange): (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::create): (WebKit::InjectedBundle::createWebDataFromUint8Array): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp: (WebKit::InjectedBundleBackForwardList::itemAtIndex): * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h: (WebKit::InjectedBundleBackForwardList::detach): * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h: (WebKit::InjectedBundleBackForwardListItem::create): (WebKit::InjectedBundleBackForwardListItem::InjectedBundleBackForwardListItem): * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::nodeHandle): (WebKit::InjectedBundleHitTestResult::urlElementHandle): * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp: (WebKit::InjectedBundleNavigationAction::create): (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction): * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::getOrCreate): (WebKit::InjectedBundleScriptWorld::normalWorld): * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::create): (WebKit::NetscapePlugin::NetscapePlugin): (WebKit::NetscapePlugin::supportsSnapshotting): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/PDF/PDFPluginAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::create): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginPasswordField.h: * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: (WebKit::PDFPluginPasswordField::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::createAnnotationElement): * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::worldMap): (WebKit::WebUserMessageHandlerDescriptorProxy::create): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addUserScript): (WebKit::WebPage::addUserStyleSheet): * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: (WebKit::WebPrintOperationGtk::create): * WebProcess/WebPage/gtk/WebPrintOperationGtk.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::rangeForPosition): (WebKit::rangeAtWordBoundaryForPosition): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: 2017-05-12 Alex Christensen Rename WKContentExtension to WKContentRuleList https://bugs.webkit.org/show_bug.cgi?id=172053 Reviewed by Geoffrey Garen. * Shared/API/APIObject.h: * Shared/API/Cocoa/WebKit.h: * Shared/API/c/WKDeprecatedFunctions.cpp: (WKPageGroupAddUserContentFilter): (WKPageGroupRemoveUserContentFilter): * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/WebCompiledContentExtension.cpp: Removed. * Shared/WebCompiledContentExtension.h: Removed. * Shared/WebCompiledContentExtensionData.cpp: Removed. * Shared/WebCompiledContentExtensionData.h: Removed. * Shared/WebCompiledContentRuleList.cpp: Copied from Source/WebKit2/Shared/WebCompiledContentExtension.cpp. (WebKit::WebCompiledContentRuleList::create): (WebKit::WebCompiledContentRuleList::WebCompiledContentRuleList): (WebKit::WebCompiledContentRuleList::~WebCompiledContentRuleList): (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain): (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode): (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecodeLength): (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode): (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecodeLength): (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode): (WebKit::WebCompiledContentRuleList::topURLFiltersBytecodeLength): (WebKit::WebCompiledContentRuleList::actions): (WebKit::WebCompiledContentRuleList::actionsLength): (WebKit::WebCompiledContentExtension::create): Deleted. (WebKit::WebCompiledContentExtension::WebCompiledContentExtension): Deleted. (WebKit::WebCompiledContentExtension::~WebCompiledContentExtension): Deleted. (WebKit::WebCompiledContentExtension::conditionsApplyOnlyToDomain): Deleted. (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecode): Deleted. (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecodeLength): Deleted. (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecode): Deleted. (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecodeLength): Deleted. (WebKit::WebCompiledContentExtension::topURLFiltersBytecode): Deleted. (WebKit::WebCompiledContentExtension::topURLFiltersBytecodeLength): Deleted. (WebKit::WebCompiledContentExtension::actions): Deleted. (WebKit::WebCompiledContentExtension::actionsLength): Deleted. * Shared/WebCompiledContentRuleList.h: Copied from Source/WebKit2/Shared/WebCompiledContentExtension.h. * Shared/WebCompiledContentRuleListData.cpp: Copied from Source/WebKit2/Shared/WebCompiledContentExtensionData.cpp. (WebKit::WebCompiledContentRuleListData::encode): (WebKit::WebCompiledContentRuleListData::decode): (WebKit::WebCompiledContentExtensionData::encode): Deleted. (WebKit::WebCompiledContentExtensionData::decode): Deleted. * Shared/WebCompiledContentRuleListData.h: Copied from Source/WebKit2/Shared/WebCompiledContentExtensionData.h. (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData): (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData): Deleted. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APIContentExtension.cpp: Removed. * UIProcess/API/APIContentExtension.h: Removed. * UIProcess/API/APIContentExtensionStore.cpp: Removed. * UIProcess/API/APIContentExtensionStore.h: Removed. * UIProcess/API/APIContentRuleList.cpp: Copied from Source/WebKit2/UIProcess/API/APIContentExtension.cpp. (API::ContentRuleList::ContentRuleList): (API::ContentRuleList::~ContentRuleList): (API::ContentExtension::ContentExtension): Deleted. (API::ContentExtension::~ContentExtension): Deleted. * UIProcess/API/APIContentRuleList.h: Copied from Source/WebKit2/UIProcess/API/APIContentExtension.h. * UIProcess/API/APIContentRuleListStore.cpp: Copied from Source/WebKit2/UIProcess/API/APIContentExtensionStore.cpp. (API::ContentRuleListStore::legacyDefaultStore): (API::ContentRuleListStore::nonLegacyDdefaultStore): (API::ContentRuleListStore::defaultStore): (API::ContentRuleListStore::storeWithPath): (API::ContentRuleListStore::ContentRuleListStore): (API::ContentRuleListStore::~ContentRuleListStore): (API::constructedPathPrefix): (API::ContentRuleListMetaData::fileSize): (API::encodeContentRuleListMetaData): (API::decodeContentRuleListMetaData): (API::openAndMapContentRuleList): (API::compiledToFile): (API::createExtension): (API::ContentRuleListStore::lookupContentRuleList): (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers): (API::ContentRuleListStore::compileContentRuleList): (API::ContentRuleListStore::removeContentRuleList): (API::ContentRuleListStore::synchronousRemoveAllContentRuleLists): (API::ContentRuleListStore::invalidateContentRuleListVersion): (API::ContentRuleListStore::getContentRuleListSource): (API::contentRuleListStoreErrorCategory): (API::ContentExtensionStore::defaultStore): Deleted. (API::ContentExtensionStore::storeWithPath): Deleted. (API::ContentExtensionStore::ContentExtensionStore): Deleted. (API::ContentExtensionStore::~ContentExtensionStore): Deleted. (API::ContentExtensionMetaData::fileSize): Deleted. (API::encodeContentExtensionMetaData): Deleted. (API::decodeContentExtensionMetaData): Deleted. (API::openAndMapContentExtension): Deleted. (API::ContentExtensionStore::lookupContentExtension): Deleted. (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): Deleted. (API::ContentExtensionStore::compileContentExtension): Deleted. (API::ContentExtensionStore::removeContentExtension): Deleted. (API::ContentExtensionStore::synchronousRemoveAllContentExtensions): Deleted. (API::ContentExtensionStore::invalidateContentExtensionVersion): Deleted. (API::ContentExtensionStore::getContentExtensionSource): Deleted. (API::contentExtensionStoreErrorCategory): Deleted. * UIProcess/API/APIContentRuleListStore.h: Copied from Source/WebKit2/UIProcess/API/APIContentExtensionStore.h. (API::make_error_code): * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKPageGroup.cpp: * UIProcess/API/C/WKUserContentControllerRef.cpp: (WKUserContentControllerAddUserContentFilter): (WKUserContentControllerRemoveAllUserContentFilters): * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: (WKUserContentExtensionStoreGetTypeID): * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: (API::ContentRuleListStore::defaultStorePath): (API::ContentExtensionStore::defaultStorePath): Deleted. * UIProcess/API/Cocoa/WKContentExtension.h: Removed. * UIProcess/API/Cocoa/WKContentExtension.mm: Removed. * UIProcess/API/Cocoa/WKContentExtensionInternal.h: Removed. * UIProcess/API/Cocoa/WKContentExtensionStore.h: Removed. * UIProcess/API/Cocoa/WKContentExtensionStore.mm: Removed. * UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h: Removed. * UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h: Removed. * UIProcess/API/Cocoa/WKContentRuleList.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtension.h. * UIProcess/API/Cocoa/WKContentRuleList.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtension.mm. (-[WKContentRuleList dealloc]): (-[WKContentRuleList _apiObject]): (-[WKContentRuleList identifier]): (-[WKContentExtension dealloc]): Deleted. (-[WKContentExtension _apiObject]): Deleted. (-[WKContentExtension identifier]): Deleted. * UIProcess/API/Cocoa/WKContentRuleListInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionInternal.h. (WebKit::wrapper): * UIProcess/API/Cocoa/WKContentRuleListStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStore.h. * UIProcess/API/Cocoa/WKContentRuleListStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStore.mm. (toWKErrorCode): (-[WKContentRuleListStore dealloc]): (+[WKContentRuleListStore defaultStore]): (+[WKContentRuleListStore storeWithURL:]): (-[WKContentRuleListStore compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]): (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:releasesArgument:]): (-[WKContentRuleListStore lookUpContentRuleListForIdentifier:completionHandler:]): (-[WKContentRuleListStore getAvailableContentRuleListIdentifiers:]): (-[WKContentRuleListStore removeContentRuleListForIdentifier:completionHandler:]): (-[WKContentRuleListStore _apiObject]): (-[WKContentRuleListStore _removeAllContentRuleLists]): (-[WKContentRuleListStore _invalidateContentRuleListVersionForIdentifier:]): (-[WKContentRuleListStore _getContentRuleListSourceForIdentifier:completionHandler:]): (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]): (-[WKContentExtensionStore dealloc]): Deleted. (+[WKContentExtensionStore defaultStore]): Deleted. (+[WKContentExtensionStore storeWithURL:]): Deleted. (-[WKContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted. (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]): Deleted. (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]): Deleted. (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]): Deleted. (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): Deleted. (-[WKContentExtensionStore _apiObject]): Deleted. (-[WKContentExtensionStore _removeAllContentExtensions]): Deleted. (-[WKContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): Deleted. (-[WKContentExtensionStore _getContentExtensionSourceForIdentifier:completionHandler:]): Deleted. (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h. (WebKit::wrapper): * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h. * UIProcess/API/Cocoa/WKError.h: * UIProcess/API/Cocoa/WKError.mm: (localizedDescriptionForErrorCode): * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addContentRuleList:]): (-[WKUserContentController removeContentRuleList:]): (-[WKUserContentController removeAllContentRuleLists]): (-[WKUserContentController _addUserContentFilter:]): (-[WKUserContentController _removeUserContentFilter:]): (-[WKUserContentController _removeAllUserContentFilters]): (-[WKUserContentController addContentExtension:]): Deleted. (-[WKUserContentController removeContentExtension:]): Deleted. (-[WKUserContentController removeAllContentExtensions]): Deleted. * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: (toUserContentRuleListStoreError): (+[_WKUserContentExtensionStore defaultStore]): (+[_WKUserContentExtensionStore storeWithURL:]): (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore _apiObject]): (-[_WKUserContentExtensionStore _removeAllContentExtensions]): (-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): (-[_WKUserContentExtensionStore _initWithWKContentRuleListStore:]): (toUserContentExtensionStoreError): Deleted. (-[_WKUserContentExtensionStore _initWithWKContentExtensionStore:]): Deleted. * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: * UIProcess/API/Cocoa/_WKUserContentFilter.mm: (-[_WKUserContentFilter _apiObject]): (-[_WKUserContentFilter _initWithWKContentRuleList:]): (-[_WKUserContentFilter _initWithWKContentExtension:]): Deleted. * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h: * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::addContentRuleList): (WebKit::WebUserContentControllerProxy::removeContentRuleList): (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists): (WebKit::WebUserContentControllerProxy::addContentExtension): Deleted. (WebKit::WebUserContentControllerProxy::removeContentExtension): Deleted. (WebKit::WebUserContentControllerProxy::removeAllContentExtensions): Deleted. * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/WebPageGroup.cpp: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addContentRuleLists): (WebKit::WebUserContentController::removeContentRuleList): (WebKit::WebUserContentController::removeAllContentRuleLists): (WebKit::WebUserContentController::addContentExtensions): Deleted. (WebKit::WebUserContentController::removeContentExtension): Deleted. (WebKit::WebUserContentController::removeAllContentExtensions): Deleted. * WebProcess/UserContent/WebUserContentController.h: * WebProcess/UserContent/WebUserContentController.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_backgroundCPULimit): 2017-05-12 Jeremy Jones Add objc version of WK2 UIPageClient setHasVideoInPictureInPicture and rename it to hasVideoInPictureInPictureDidChange. https://bugs.webkit.org/show_bug.cgi?id=172048 rdar://problem/32163054 Reviewed by Simon Fraser. Rename UIPageClient setHasVideoInPictureInPicture to hasVideoInPictureInPictureDidChange. Add missing _allowsPictureInPictureMediaPlayback property to WKPreferences. Add -hasVideoInPictureInPictureDidChange to UIDelegate. * UIProcess/API/APIUIClient.h: (API::UIClient::hasVideoInPictureInPictureDidChange): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _allowsPictureInPictureMediaPlayback]): (-[WKPreferences _setAllowsPictureInPictureMediaPlayback:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange): * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): 2017-05-12 David Quesada Add SPI for overriding WKWebView's clipping behavior for _visibleContentRect https://bugs.webkit.org/show_bug.cgi?id=172000 rdar://problem/32144756 Reviewed by Simon Fraser. Extract -[WKWebView _visibleContentRect]'s use of -_scroller to a new property _enclosingViewForExposedRectComputation, which is declared in the private header for subclasses to implement custom logic for determining the view to clip rendering to. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _enclosingViewForExposedRectComputation]): (-[WKWebView _visibleRectInEnclosingView:]): (-[WKWebView _visibleContentRect]): (-[WKWebView _visibleRectInEnclosingScrollView:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-05-12 Chris Dumez Stop using PassRefPtr under WebKit2/UIProcess https://bugs.webkit.org/show_bug.cgi?id=172029 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::registerEditCommand): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: (getIconSurfaceSynchronously): * UIProcess/API/gtk/WebKitWebContext.cpp: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::registerEditCommand): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::registerEditCommand): * UIProcess/DefaultUndoController.cpp: (WebKit::DefaultUndoController::registerEditCommand): * UIProcess/DefaultUndoController.h: * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::create): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::createRequest): * UIProcess/GeolocationPermissionRequestManagerProxy.h: * UIProcess/InspectorServer/HTTPRequest.cpp: (WebKit::HTTPRequest::parseHTTPRequestFromBuffer): * UIProcess/InspectorServer/HTTPRequest.h: * UIProcess/InspectorServer/WebInspectorServer.cpp: (WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest): (WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest): (WebKit::WebInspectorServer::didEstablishWebSocketConnection): * UIProcess/InspectorServer/WebInspectorServer.h: * UIProcess/InspectorServer/WebSocketServerClient.h: (WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest): (WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest): (WebKit::WebSocketServerClient::didEstablishWebSocketConnection): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::readHTTPMessage): (WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection): * UIProcess/InspectorServer/WebSocketServerConnection.h: * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::createRequest): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h: * UIProcess/Notifications/WebNotificationProvider.cpp: (WebKit::WebNotificationProvider::notificationPermissions): * UIProcess/Notifications/WebNotificationProvider.h: * UIProcess/PageClient.h: * UIProcess/Storage/LocalStorageDatabase.cpp: * UIProcess/WebContextMenuListenerProxy.h: * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::unapply): (WebKit::WebEditCommandProxy::reapply): * UIProcess/WebEditCommandProxy.h: * UIProcess/WebGrammarDetail.cpp: (WebKit::WebGrammarDetail::create): * UIProcess/WebGrammarDetail.h: * UIProcess/WebPageProxy.cpp: (WebKit::ExceededDatabaseQuotaRecords::createRecord): (WebKit::WebPageProxy::registerEditCommand): (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy): (WebKit::WebPageProxy::exceededDatabaseQuota): (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota): (WebKit::WebPageProxy::takeViewSnapshot): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::plugInAutoStartOriginHashes): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (-[WKEditCommandObjC initWithWebEditCommandProxy:]): (WebKit::PageClientImpl::registerEditCommand): (WebKit::PageClientImpl::saveImageToLibrary): (WebKit::PageClientImpl::setDragImage): (WebKit::PageClientImpl::takeViewSnapshot): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::saveImageToLibrary): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::registerEditCommand): (WebKit::PageClientImpl::setDragImage): (WebKit::PageClientImpl::setPromisedDataForImage): (WebKit::PageClientImpl::takeViewSnapshot): * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _webHitTestResult]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setDragImage): (WebKit::WebPageProxy::setPromisedDataForImage): * WebProcess/IconDatabase/WebIconDatabaseProxy.h: 2017-05-12 Jeremy Jones Add UIClient callback for when picture-in-picture is activated. https://bugs.webkit.org/show_bug.cgi?id=172023 Reviewed by Simon Fraser. Add WKUIPageClientV10 with setHasVideoInPictureInPicture. * UIProcess/API/APIUIClient.h: (API::UIClient::setHasVideoInPictureInPicture): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): 2017-05-12 Brent Fulgham REGRESSION(r213564): Flash audio playback failures https://bugs.webkit.org/show_bug.cgi?id=171876 Reviewed by Alexey Proskuryakov. The IOKit property filters added in r213564 need to be expanded to support some Flash features. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-05-12 Brent Fulgham [WK2][macOS] Add a mach-lookup exception for 'com.apple.analyticsd' https://bugs.webkit.org/show_bug.cgi?id=172040 Reviewed by Alexey Proskuryakov. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-05-12 Simon Fraser Add some logging for layer tree commits, and resize and orientation change events https://bugs.webkit.org/show_bug.cgi?id=172041 Reviewed by Tim Horton. Add some logging that's useful during rotation investigations. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLayerTree:]): 2017-05-12 Andy Estes [Cocoa] Stop setting a status on PKPaymentRequestShippingContactUpdate when there are errors https://bugs.webkit.org/show_bug.cgi?id=172036 Reviewed by Anders Carlsson. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): 2017-05-12 Chris Dumez Stop using PassRefPtr under WebKit2/Shared https://bugs.webkit.org/show_bug.cgi?id=172017 Reviewed by Antti Koivisto. * Shared/API/APIDictionary.cpp: (API::Dictionary::add): (API::Dictionary::set): * Shared/API/APIDictionary.h: * Shared/API/APISecurityOrigin.h: (API::SecurityOrigin::createFromString): (API::SecurityOrigin::create): (API::SecurityOrigin::securityOrigin): (API::SecurityOrigin::SecurityOrigin): * Shared/API/APISerializedScriptValue.h: (API::SerializedScriptValue::create): (API::SerializedScriptValue::SerializedScriptValue): * Shared/API/c/WKSharedAPICast.h: (WebKit::ProxyingRefPtr::ProxyingRefPtr): * Shared/APIWebArchiveResource.h: * Shared/APIWebArchiveResource.mm: (API::WebArchiveResource::create): (API::WebArchiveResource::WebArchiveResource): * Shared/AsyncRequest.h: (WebKit::AsyncRequestMap::add): * Shared/BlobDataFileReferenceWithSandboxExtension.cpp: (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension): * Shared/BlobDataFileReferenceWithSandboxExtension.h: * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::setBackBuffer): (WebKit::CoordinatedBackingStore::updateTile): * Shared/CoordinatedGraphics/CoordinatedBackingStore.h: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): (WebKit::CoordinatedGraphicsScene::updateImageBacking): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::getOrCreate): * Shared/Plugins/Netscape/NetscapePluginModule.h: * Shared/VisitedLinkTable.cpp: (WebKit::VisitedLinkTable::setSharedMemory): * Shared/VisitedLinkTable.h: * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::setSnapshot): * Shared/WebContextMenuItem.cpp: (WebKit::WebContextMenuItem::create): * Shared/WebContextMenuItem.h: * Shared/WebGeolocationPosition.h: * Shared/WebRenderLayer.cpp: (WebKit::WebRenderLayer::create): (WebKit::WebRenderLayer::createArrayFromLayerList): (WebKit::WebRenderLayer::WebRenderLayer): * Shared/WebRenderLayer.h: * Shared/WebRenderObject.cpp: (WebKit::WebRenderObject::create): (WebKit::WebRenderObject::WebRenderObject): * Shared/WebRenderObject.h: * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::resizeTable): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::setVisitedLinkTable): 2017-05-11 Brady Eidson [WKWebsiteDataStore removeDataOfTypes:...] doesn't work for IndexedDB if the data store has a custom IDB path. and https://bugs.webkit.org/show_bug.cgi?id=171994 Reviewed by Andy Estes. Informal review by Maureen Daum. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::deleteWebsiteData): Instead of accessing the m_idbServers set directly, make the method call that creates the server on demand. (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): Ditto. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Not only create the DatabaseProcess if necessary, but also notify it about the passed-in WebsiteDataStore. (WebKit::WebProcessPool::getDatabaseProcessConnection): (WebKit::WebProcessPool::ensureDatabaseProcess): Deleted. * UIProcess/WebProcessPool.h: (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::databaseProcessParameters): 2017-05-11 Dean Jackson Modern Media Controls shouldn't be an experimental feature https://bugs.webkit.org/show_bug.cgi?id=172004 Reviewed by Simon Fraser. This is either always on or always off, so shouldn't show up in an Experimental Features menu. * Shared/WebPreferencesDefinitions.h: Move ModernMediaControlsEnabled to a normal preference. 2017-05-11 Tim Horton Mail spins launching spell checker when typing https://bugs.webkit.org/show_bug.cgi?id=171986 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setEditable:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::didBecomeEditable): (WebKit::WebViewImpl::startObservingFontPanel): Deleted. Asynchronously pre-warm the spell checker when a WKWebView becomes editable. 2017-05-11 Chris Dumez Stop using PassRefPtr in platform/graphics https://bugs.webkit.org/show_bug.cgi?id=171977 Reviewed by Alex Christensen. Build fix. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded): (WebKit::CoordinatedGraphicsScene::removeBackingStoreIfNeeded): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::createImageBackingIfNeeded): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp: (WebKit::GraphicsLayerCARemote::createPlatformCALayer): (WebKit::GraphicsLayerCARemote::createPlatformCAAnimation): * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::copy): 2017-05-11 Tim Horton Data loss when saving a PDF form where only radio buttons/checkboxes were modified https://bugs.webkit.org/show_bug.cgi?id=171991 Reviewed by Andy Estes. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (-[WKPDFLayerControllerDelegate didChangeAnnotationState]): Mark the PDF as dirty (so we re-encode it when asked to save) if annotations that only PDFKit knows about change. 2017-05-11 Joseph Pecoraro Remove Vibration API https://bugs.webkit.org/show_bug.cgi?id=171766 Rubber-stamped by Alexey Proskuryakov. * CMakeLists.txt: * Shared/API/APIObject.h: * Shared/API/c/WKBase.h: * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKPage.cpp: (WKPageGetVibration): Deleted. * UIProcess/API/C/WKPage.h: * UIProcess/API/C/WKVibration.cpp: Removed. * UIProcess/API/C/WKVibration.h: Removed. * UIProcess/WebPageProxy.cpp: (WebKit::m_weakPtrFactory): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::vibration): Deleted. * UIProcess/WebVibrationProvider.cpp: Removed. * UIProcess/WebVibrationProvider.h: Removed. * UIProcess/WebVibrationProxy.cpp: Removed. * UIProcess/WebVibrationProxy.h: Removed. * UIProcess/WebVibrationProxy.messages.in: Removed. * WebProcess/WebCoreSupport/WebVibrationClient.cpp: Removed. * WebProcess/WebCoreSupport/WebVibrationClient.h: Removed. * WebProcess/WebPage/WebPage.cpp: 2017-05-11 Andy Estes Fix a spelling mistake in ApplePayErrorCode https://bugs.webkit.org/show_bug.cgi?id=171981 Reviewed by Beth Dakin. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentErrorCode): (WebKit::toPKPaymentAuthorizationStatus): 2017-05-11 John Wilander Resource Load Statistics: Enable configuration through preferences https://bugs.webkit.org/show_bug.cgi?id=171949 Reviewed by Alex Christensen. * Shared/WebPreferencesDefinitions.h: Added ResourceLoadStatisticsTimeToLiveUserInteraction, ResourceLoadStatisticsTimeToLiveCookiePartitionFree, and ResourceLoadStatisticsReducedTimestampResolution. * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Added. (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Now calls WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded(). * WebKit2.xcodeproj/project.pbxproj: 2017-05-11 Claudio Saavedra [GTK] Remove notifications guards from GTK API layer https://bugs.webkit.org/show_bug.cgi?id=170014 Reviewed by Michael Catanzaro. ENABLE_NOTIFICATIONS in the GTK port is a private option and disabling it is unsupported, hence remove its guards from the GTK API layer. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): 2017-05-11 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.2 release. * gtk/NEWS: Add release notes for 2.17.2. 2017-05-11 Claudio Saavedra [GTK] JavaScript prompt uses title of page to be loaded rather than title of current page https://bugs.webkit.org/show_bug.cgi?id=152690 Reviewed by Michael Catanzaro. webkit_web_view_get_uri() returns the page to be loaded, use internal api for this. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewCreateJavaScriptDialog): 2017-05-10 Tim Horton Null deref in WebPage::dictionaryPopupInfoForRange https://bugs.webkit.org/show_bug.cgi?id=171959 Reviewed by Beth Dakin. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::dictionaryPopupInfoForRange): Speculative fix for non-reproducible crash when the startContainer of the range is in an anonymous node. 2017-05-09 Sam Weinig Remove support for legacy Notifications https://bugs.webkit.org/show_bug.cgi?id=171487 Reviewed by Jon Lee. * Configurations/FeatureDefines.xcconfig: * Shared/WebProcessCreationParameters.cpp: * Shared/WebProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: * WebProcess/Notifications/NotificationPermissionRequestManager.h: * WebProcess/Notifications/WebNotificationManager.cpp: * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/WebCoreSupport/WebNotificationClient.cpp: * WebProcess/WebCoreSupport/WebNotificationClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebProcess.cpp: Remove legacy notification specific code. 2017-05-10 Tim Horton Add an experimental feature flag for viewport-fit https://bugs.webkit.org/show_bug.cgi?id=171948 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add an experimental feature flag. 2017-05-10 Alex Christensen Include headers in WebKit.h https://bugs.webkit.org/show_bug.cgi?id=171943 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WebKit.h: 2017-05-10 Timothy Horton Disable block selection for dynamic selection granularity https://bugs.webkit.org/show_bug.cgi?id=171908 Reviewed by Enrica Casucci. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _allowsBlockSelection]): (-[WKWebViewConfiguration _setAllowsBlockSelection:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Add a private configuration parameter to re-enable block selection. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _allowsBlockSelection]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/VersionChecks.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::allowsBlockSelection): * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: Plumb allowsBlockSelection through from WKWebViewConfiguration to WebPage. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView useSelectionAssistantWithGranularity:]): (-[WKContentView _startAssistingKeyboard]): (-[WKContentView _stopAssistingKeyboard]): (toUIWebSelectionMode): Deleted. (-[WKContentView useSelectionAssistantWithMode:]): Deleted. Stop needlessly converting to UIWebSelectionMode. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::shouldSwitchToBlockModeForHandle): Don't switch to block selection unless allowsBlockSelection is set. 2017-05-10 Tim Horton Add an experimental feature flag for constant properties https://bugs.webkit.org/show_bug.cgi?id=171913 Reviewed by Ryosuke Niwa. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add an experimental feature flag. 2017-05-09 Dean Jackson Disable WebGL2 by default https://bugs.webkit.org/show_bug.cgi?id=171894 Reviewed by Tim Horton. Some WASM and WebGL2 content is failing because it detects our WebGL2RenderingContext, but doesn't realise that we don't implement enough of it to be useful. * Shared/WebPreferencesDefinitions.h: 2017-05-10 Matt Lewis Unreviewed, rolling out r216563. Revision caused 2 api failures Reverted changeset: "[MediaStream] deviceId constraint doesn't work with getUserMedia" https://bugs.webkit.org/show_bug.cgi?id=171877 http://trac.webkit.org/changeset/216563 2017-05-10 Claudio Saavedra [GTK] HTTP authentication dialog should focus on first input field https://bugs.webkit.org/show_bug.cgi?id=151349 Reviewed by Michael Catanzaro. Setting focus on a widget before it's mapped does nothing. Move the call to the right place. * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: (webkitAuthenticationDialogInitialize): (webkitAuthenticationDialogMap): 2017-05-10 Michael Catanzaro [GTK] -Wmissing-field-initializers triggered by RemoteInspectorServer.cpp:128 https://bugs.webkit.org/show_bug.cgi?id=171273 Reviewed by Carlos Garcia Campos. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): 2017-05-09 Eric Carlson [MediaStream] deviceId constraint doesn't work with getUserMedia https://bugs.webkit.org/show_bug.cgi?id=171877 Reviewed by Jer Noble. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode deviceIDHashSalt. (IPC::ArgumentCoder::decode): Decode deviceIDHashSalt. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize completion handler, frame ID, and security origins. (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling completion handler because we now sometimes request access info before calling gUM. (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler. * UIProcess/UserMediaPermissionCheckProxy.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy. (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt when origins don't match. (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto. Don't set state for empty UIDs. Pass hash salt to web process. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): The device ID hash salt is now required to validate constraints, so get it first. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper method used to get the device ID hash salt. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure to use getUserMediaPermissionInfo. (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID hash salt parameter. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): Ditto. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData constructor. 2017-05-09 Alex Christensen Buffer media in NetworkProcess to reduce IPC overhead https://bugs.webkit.org/show_bug.cgi?id=171834 Reviewed by Jer Noble. I have measured a significant CPU usage reduction when buffering media data in the NetworkProcess, especially on arm64 processors. Buffering data in the NetworkProcess introduces no additional data copies after r215686, and it reduces the number of messages sent from the NetworkProcess to the WebProcess, each of which must also be forwarded to mediaserverd by AVFoundation. This reduces the number of messages from thousands per second to a maximum of 20 per second. This adds 1/20 second additional latency in media loading, which will probably not be noticed by most users. This also adds the possibility of large allocations when decoding IPC messages in the WebProcess, and if that becomes the source of crashes we can add a maximum buffered amount in addition to a maximum buffered time, but we are likely not to receive so much data in 1/20 second to have problems allocating the buffer. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): Buffer data in the NetworkProcess for up to 50ms before sending it to the WebProcess in one message. This value is used in NetworkResourceLoader::didReceiveBuffer to append to m_bufferedData instead of sending the small chunks immediately. 2017-05-09 Commit Queue Unreviewed, rolling out r216545. https://bugs.webkit.org/show_bug.cgi?id=171889 Caused a test failure (Requested by eric_carlson on #webkit). Reverted changeset: "[MediaStream] deviceId constraint doesn't work with getUserMedia" https://bugs.webkit.org/show_bug.cgi?id=171877 http://trac.webkit.org/changeset/216545 2017-05-09 Eric Carlson [MediaStream] deviceId constraint doesn't work with getUserMedia https://bugs.webkit.org/show_bug.cgi?id=171877 Reviewed by Jer Noble. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode deviceIDHashSalt. (IPC::ArgumentCoder::decode): Decode deviceIDHashSalt. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize completion handler, frame ID, and security origins. (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling completion handler because we now sometimes request access info before calling gUM. (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler. * UIProcess/UserMediaPermissionCheckProxy.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy. (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt when origins don't match. (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto. Don't set state for empty UIDs. Pass hash salt to web process. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): The device ID hash salt is now required to validate constraints, so get it first. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper method used to get the device ID hash salt. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure to use getUserMediaPermissionInfo. (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID hash salt parameter. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): Ditto. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData constructor. 2017-05-10 Dean Jackson Restrict SVG filters to accessible security origins https://bugs.webkit.org/show_bug.cgi?id=118689 Reviewed by Brent Fulgham. Update parameter lists. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::paint): * WebProcess/Plugins/PluginView.h: 2017-05-09 Yoshiaki Jitsukawa [Coordinated Graphics] Debug Visuals don't hide https://bugs.webkit.org/show_bug.cgi?id=162704 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): The encoder and decoder for DebugVisuals have been added. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::setLayerState): Update the debug visuals of a layer according to the DebugVisuals information if the debugVisualsChanged flag is set to true. 2017-05-09 Zan Dobersek Upstream the WPE port https://bugs.webkit.org/show_bug.cgi?id=171110 Reviewed by Alex Christensen. webkit-dev thread: https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html Existing files changed to properly use PLATFORM(WPE) build guards or other WPE-specific additions (e.g. pasteboard support). In-file changes removed from this ChangeLog entry for brevity. * Platform/IPC/glib/GSocketMonitor.cpp: * PlatformWPE.cmake: Added. * Scripts/generate-forwarding-headers.pl: * Shared/API/c/WKBase.h: * Shared/API/c/wpe/WKBaseWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/API/c/wpe/WebKit.h: Added. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Shared/DrawingAreaInfo.h: * Shared/NativeWebKeyboardEvent.h: * Shared/NativeWebMouseEvent.h: * Shared/NativeWebTouchEvent.h: * Shared/NativeWebWheelEvent.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * Shared/WebPreferencesDefinitions.h: * Shared/wpe/NativeWebKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/wpe/NativeWebMouseEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/wpe/NativeWebTouchEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/wpe/NativeWebWheelEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/wpe/ProcessExecutablePathWPE.cpp: Added. * Shared/wpe/WebEventFactory.cpp: Added. * Shared/wpe/WebEventFactory.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/wpe/WKAPICastWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/C/wpe/WKView.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/C/wpe/WKView.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h. * UIProcess/API/wpe/CompositingManagerProxy.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/CompositingManagerProxy.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Added. * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Added. * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h. * UIProcess/API/wpe/PageClientImpl.cpp: Added. * UIProcess/API/wpe/PageClientImpl.h: Added. * UIProcess/API/wpe/ScrollGestureController.cpp: Added. * UIProcess/API/wpe/ScrollGestureController.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/WPEView.cpp: Added. * UIProcess/API/wpe/WPEView.h: Added. * UIProcess/API/wpe/WPEViewClient.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/WPEViewClient.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml: Added. * UIProcess/ChildProcessProxy.cpp: * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Added. * UIProcess/WebInspectorProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/WebProcessPool.cpp: * UIProcess/wpe/TextCheckerWPE.cpp: Added. * UIProcess/wpe/WebInspectorProxyWPE.cpp: Added. * UIProcess/wpe/WebPageProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/wpe/WebPasteboardProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/wpe/WebPreferencesWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h. * UIProcess/wpe/WebProcessPoolWPE.cpp: Added. * WebKit2.xcodeproj/project.pbxproj: * WebKit2Prefix.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/wpe/WebContextMenuClientWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: Added. * WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/DrawingArea.cpp: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/wpe/CompositingManager.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/wpe/CompositingManager.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Added. * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Added. * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/wpe/WebPageWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h. * WebProcess/wpe/WebProcessMainWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * wpe/wpe-webkit.pc.in: Added. 2017-05-09 Carlos Garcia Campos [GTK] Building Webkit2Gtk without OpenGL fails. https://bugs.webkit.org/show_bug.cgi?id=170959 Reviewed by Žan Doberšek. * UIProcess/gtk/HardwareAccelerationManager.cpp: (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): 2017-05-08 Youenn Fablet Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing https://bugs.webkit.org/show_bug.cgi?id=171824 Reviewed by Alex Christensen. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): 2017-05-08 Brent Fulgham REGRESSION(r213564): Flash video playback failures https://bugs.webkit.org/show_bug.cgi?id=171840 Reviewed by Alexey Proskuryakov. The sandbox restrictions added in r213564 to prevent access to unused iokit properties blocked some items needed for Flash video playback. This change relaxes the sandbox to allow this software to run properly. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-05-08 Alex Christensen Reduce PassRefPtr use in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=171831 Reviewed by Chris Dumez. * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupCreateWithIdentifier): * UIProcess/GenericCallback.h: (WebKit::GenericCallback::create): (WebKit::CallbackMap::put): * UIProcess/StatisticsRequest.cpp: (WebKit::StatisticsRequest::StatisticsRequest): * UIProcess/StatisticsRequest.h: (WebKit::StatisticsRequest::create): * UIProcess/TextChecker.h: * UIProcess/TextCheckerCompletion.cpp: (WebKit::TextCheckerCompletion::create): * UIProcess/TextCheckerCompletion.h: * UIProcess/WebColorPicker.h: (WebKit::WebColorPicker::create): * UIProcess/WebConnectionToWebProcess.cpp: (WebKit::WebConnectionToWebProcess::create): * UIProcess/WebConnectionToWebProcess.h: * UIProcess/WebContextInjectedBundleClient.cpp: (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData): * UIProcess/WebContextInjectedBundleClient.h: * UIProcess/WebContextMenuListenerProxy.h: (WebKit::WebContextMenuListenerProxy::create): * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::create): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebEditCommandProxy.h: (WebKit::WebEditCommandProxy::create): * UIProcess/WebFormSubmissionListenerProxy.h: (WebKit::WebFormSubmissionListenerProxy::create): * UIProcess/WebFrameListenerProxy.h: * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::create): * UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::create): * UIProcess/WebFullScreenManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::create): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::create): (WebKit::WebIconDatabase::iconDataForPageURL): * UIProcess/WebIconDatabase.h: * UIProcess/WebMediaSessionFocusManager.cpp: (WebKit::WebMediaSessionFocusManager::create): * UIProcess/WebMediaSessionFocusManager.h: * UIProcess/WebOpenPanelResultListenerProxy.h: (WebKit::WebOpenPanelResultListenerProxy::create): * UIProcess/WebPageGroup.cpp: (WebKit::WebPageGroup::create): * UIProcess/WebPageGroup.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::computePagesForPrinting): (WebKit::WebPageProxy::drawRectToImage): (WebKit::WebPageProxy::drawPagesToPDF): (WebKit::WebPageProxy::drawPagesForPrinting): (WebKit::WebPageProxy::callAfterNextPresentationUpdate): * UIProcess/WebPageProxy.h: * UIProcess/ios/TextCheckerIOS.mm: (WebKit::TextChecker::requestCheckingOfString): * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::requestCheckingOfString): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): (-[WKPrintingView _drawPreview:]): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::loadURL): (WebKit::NetscapePlugin::manualStreamDidReceiveResponse): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: (WebKit::NetscapePluginStream::create): * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toFormData): 2017-05-08 Youenn Fablet Add support for reading and writing settings from UIProcess audio capture https://bugs.webkit.org/show_bug.cgi?id=171633 Reviewed by Eric Carlson. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::applyConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setSettings): (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded): (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed): (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::sourceSettingsChanged): (WebKit::UserMediaCaptureManager::applyConstraints): (WebKit::UserMediaCaptureManager::applyConstraintsSucceeded): (WebKit::UserMediaCaptureManager::applyConstraintsFailed): (WebKit::UserMediaCaptureManager::Source::setMuted): Deleted. (WebKit::UserMediaCaptureManager::Source::setEnabled): Deleted. * WebProcess/cocoa/UserMediaCaptureManager.h: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: 2017-05-08 Alex Christensen Reduce PassRefPtr use https://bugs.webkit.org/show_bug.cgi?id=171809 Reviewed by Chris Dumez. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::setInitializationReply): * PluginProcess/PluginControllerProxy.h: * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::destroyPlugin): (WebKit::WebProcessConnection::createPlugin): * PluginProcess/WebProcessConnection.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runOpenPanel): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::registerUndoStep): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::getOrCreate): * WebProcess/WebPage/VisitedLinkTableController.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::hitTest): (WebKit::WebFrame::createSelectionSnapshot): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebOpenPanelResultListener.cpp: (WebKit::WebOpenPanelResultListener::create): (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener): * WebProcess/WebPage/WebOpenPanelResultListener.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::unapplyEditCommand): (WebKit::WebPage::reapplyEditCommand): * WebProcess/WebPage/WebPageGroupProxy.cpp: (WebKit::WebPageGroupProxy::create): * WebProcess/WebPage/WebPageGroupProxy.h: * WebProcess/WebPage/WebUndoStep.cpp: (WebKit::WebUndoStep::create): * WebProcess/WebPage/WebUndoStep.h: (WebKit::WebUndoStep::step): (WebKit::WebUndoStep::WebUndoStep): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::create): (WebKit::PlatformCALayerRemote::clone): (WebKit::PlatformCALayerRemote::animationForKey): (WebKit::PlatformCALayerRemote::createCompatibleLayer): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::create): (WebKit::PlatformCALayerRemoteCustom::clone): 2017-05-08 Jer Noble [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set. https://bugs.webkit.org/show_bug.cgi?id=171710 Reviewed by Eric Carlson. RealtimeMediaSourceCenterMac's setUseAVFoundationAudioCapture() is now accessed via a singleton. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): 2017-05-08 Andy Estes [macOS] com.macromedia.Flash Player ESR.plugin.sb is installed outside of PlugInSandboxProfiles https://bugs.webkit.org/show_bug.cgi?id=171774 Reviewed by Dan Bernstein. * WebKit2.xcodeproj/project.pbxproj: 2017-05-08 Youenn Fablet Clean UserMediaCaptureManager::capabilities return value https://bugs.webkit.org/show_bug.cgi?id=171808 Reviewed by Eric Carlson. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::capabilities): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-05-08 Chris Dumez Move 'style' from Element to HTMLElement / SVGElement and make it settable https://bugs.webkit.org/show_bug.cgi?id=171795 Reviewed by Alex Christensen. Build fix. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::shouldApplyStyle): 2017-05-07 Simon Fraser [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange https://bugs.webkit.org/show_bug.cgi?id=171140 rdar://problem/31765167 Reviewed by Sam Weinig. WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport from the UI process, but in this case we need to compute one in the web process. So factor code into FrameView to do the computation, called from both places. * UIProcess/WebPageProxy.h: * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect): * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2017-05-07 Youenn Fablet [MediaStream] r216197 caused some webrtc tests to fail https://bugs.webkit.org/show_bug.cgi?id=171728 Reviewed by Eric Carlson. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Removing muting streams of the page requesting additional capture streams. This is now done in the WebProcess. 2017-05-07 Tim Horton Clean up some WebProcessProxy, WebPage, and message handler includes https://bugs.webkit.org/show_bug.cgi?id=171791 Reviewed by Sam Weinig. This is worth another ~10% off WebKit2 clean build time on Mac. This time, the most impactful change is the removal of UserMediaPermissionRequestManager.h from WebPage.h, which completely eradicates JSC's VM.h (which is enormous) from WebPage.h (at least on Mac). * Scripts/webkit/messages.py: (headers_for_type): Stop specializing CompositionUnderline now that it has its own file. * Shared/API/c/WKDeprecatedFunctions.cpp: * Shared/WebCoreArgumentCoders.cpp: * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm: * UIProcess/Gamepad/UIGamepadProvider.cpp: * UIProcess/HiddenPageThrottlingAutoIncreasesCounter.h: Added. * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: * UIProcess/Network/NetworkProcessProxy.cpp: * UIProcess/PerActivityStateCPUUsageSampler.cpp: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::toWebCore): * UIProcess/VisibleWebPageCounter.h: Added. * UIProcess/VisitedLinkStore.h: * UIProcess/WebPageGroup.h: * UIProcess/WebPageProxy.h: * UIProcess/WebProcessLifetimeTracker.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: Remove WebPageProxy and forward-declare a whole bunch of things. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): (WebKit::WebPage::userMediaAccessWasDenied): (WebKit::WebPage::didCompleteMediaDeviceEnumeration): (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::userMediaPermissionRequestManager): * WebProcess/WebPage/ios/FindControllerIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: (WebKit::RemoteLayerTreeContext::deviceScaleFactor): Deleted. (WebKit::RemoteLayerTreeContext::layerHostingMode): Deleted. * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::deviceScaleFactor): (WebKit::RemoteLayerTreeContext::layerHostingMode): 2017-05-06 Chris Dumez Align our IDL files with the latest DOM specification https://bugs.webkit.org/show_bug.cgi?id=171777 Reviewed by Sam Weinig. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_get_ready_state): 2017-05-06 Tim Horton Reduce the number of includes in WebPage.h and WebProcess.h https://bugs.webkit.org/show_bug.cgi?id=171779 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: * WebProcess/Network/NetworkProcessConnection.cpp: * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: * WebProcess/Network/webrtc/LibWebRTCResolver.cpp: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: * WebProcess/WebPage/FindController.cpp: * WebProcess/WebPage/WebFrame.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): Deleted. (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): Deleted. * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h: * WebProcess/WebProcess.cpp: * WebProcess/WebProcess.h: In my measurement, this improves WebKit2 debug clean build time by ~10% for Mac and ~5% for iOS. The most valuable change is the one to remove LibWebRTC headers.. 2017-05-06 Alexey Proskuryakov REGRESSION (r216294): The new test fails on WebKit1 https://bugs.webkit.org/show_bug.cgi?id=171780 Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296, https://trac.webkit.org/216299, https://trac.webkit.org/216330 * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::paint): * WebProcess/Plugins/PluginView.h: 2017-05-06 Simon Fraser [iOS WK2] Make rotation tests more reliable https://bugs.webkit.org/show_bug.cgi?id=171778 Reviewed by Tim Horton. Switching between "safari-style" rotation and normal rotation left state on the WKWebView that would cause later viewport-sensitive tests to fail. The WKWebView would be left with override layout parameters, and an override orientation, and these caused viewport size to leak into later tests, and WebCore orientation to not get reset correctly. Also, WKWebView was unregistering for UIWindowDidRotateNotification notifications when an override orientation was set, and would never re-register, causing lost orientationchanged events. Fix by exposing WKWebView SPI to clear the various bits of overide state. Also don't unregister from the UIWindowDidRotateNotification notification; it's already ignored anyway if it fires. Also wait for a visible content rect update after resizing the WKWebVeiw between tests, to make sure the WebProcess is caught up before proceeding with the test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _clearInterfaceOrientationOverride]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _clearOverrideLayoutParameters]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-05-06 Konstantin Tokarev Remove unused lambda capture https://bugs.webkit.org/show_bug.cgi?id=171772 Reviewed by Yusuke Suzuki. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): 2017-05-06 David Kilzer messages_unittest.py should support a [-r|--reset-results] switch Reviewed by Daniel Bates. This change adds support for a [-r|--reset-results] switch when running messages_unittest.py to make it easy to update the expected file results. This also cleans up a lot of duplicate code in messages_unittest.py by extracting common code into new methods and by pushing code down into methods where it's actually used. * Scripts/webkit/LegacyMessageReceiver-expected.cpp: * Scripts/webkit/LegacyMessages-expected.h: * Scripts/webkit/MessageReceiver-expected.cpp: * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: * Scripts/webkit/Messages-expected.h: * Scripts/webkit/MessagesSuperclass-expected.h: - Update expected files using the new --reset-results switch. * Scripts/webkit/messages_unittest.py: - Remove what appears to be a debugging print statement. - Replace the code that reads in expected files with variables that contain the expected file names. The code to read in the contents moved into GeneratedFileContentsTest.assertGeneratedFileContentsEqual(). (ParsingTest.check_message): - Drive-by fix to change "!= None" to "is not None". (GeneratedFileContentsTest.assertGeneratedFileContentsEqual): - Add support for [-r|--reset-results] switch here. This will write out updated expected file contents when the switch is used. - Push down most of the global code that reads in file contents into this method. - Change use of split('\n') into splitlines(False). (GeneratedFileContentsTest.assertHeaderEqual): Add. - Extracts common code from test_receiver_headers(). (GeneratedFileContentsTest.assertImplementationEqual): Add. - Extracts common code from test_receiver_implementations(). (HeaderTest): (HeaderTest.test_receiver_headers): - Rename from HeaderTest.test_header(). - Simplify by calling assertHeaderEqual(). (ReceiverImplementationTest): (ReceiverImplementationTest.test_receiver_implementations): - Rename from ReceiverImplementationTest.test_receiver_implementation(). - Simplify by calling assertImplementationEqual(). (add_reset_results_to_unittest_help): Add. - Inserts help text for [-r|--reset-results] switch. (parse_sys_argv): Add. - Parses [-r|--reset-results] switch, and then removes it from sys.argv. We do this instead of using argparse so that the original help for the unittest module is still shown when using --help. 2017-05-05 Timothy Horton [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging) https://bugs.webkit.org/show_bug.cgi?id=171764 Reviewed by Simon Fraser. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::dragImageForView): Always use the last mouse down event to originate the drag; this was a 2004 hack to work around a seemingly-fixed macOS bug that somehow propagated into WebKit2. With WebKit2, this would cause trouble because currentEvent could move on during the bounce to the Web Content process and back, causing the delta between clientPoint and the mouse point to be dependent on timing, and thus causing the link to sit at timing-dependent distance from the cursor, instead of exactly where dragOffsetForLinkDragImage placed it. 2017-05-05 Brady Eidson API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator. and https://bugs.webkit.org/show_bug.cgi?id=171513 Reviewed by Andy Estes. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): 2017-05-05 Dean Jackson Restrict SVG filters to accessible security origins https://bugs.webkit.org/show_bug.cgi?id=118689 Reviewed by Brent Fulgham. Update parameter lists. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::paint): * WebProcess/Plugins/PluginView.h: 2017-05-05 Beth Dakin Ensure NSColorPickerTouchBarItem only uses sRGB colors https://bugs.webkit.org/show_bug.cgi?id=171758 -and corresponding- rdar://problem/28314183 Reviewed by Tim Horton. * UIProcess/Cocoa/WebViewImpl.mm: (-[WKTextTouchBarItemController itemForIdentifier:]): 2017-05-05 Brent Fulgham [WK2][iOS][macOS] Expand sandbox to access vm.footprint_suspend https://bugs.webkit.org/show_bug.cgi?id=171749 Reviewed by Geoffrey Garen. The 'sysctl' whitelist needs to be extended to support an additional VM-related feature. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2017-05-05 John Wilander Resource Load Statistics: Don't cover in-memory and disk caches during website data removal https://bugs.webkit.org/show_bug.cgi?id=171741 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): No longer removes WebsiteDataType::DiskCache or WebsiteDataType::MemoryCache. 2017-05-05 Brian Burg CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57 https://bugs.webkit.org/show_bug.cgi?id=171669 Reviewed by Mark Lam. safaridriver's AutomaticInspection capability causes us to call WebInspectorProxy::connect() underneath the Automation.inspectBrowsingContext command. This fires a NeedDebuggerBreak interrupt for the web content's VM, but this is racy because the web content process may not yet be fully initialized when this interrupt is handled. To work around this, just don't deliver any interrupts if the VM singleton is still null. This is a reliable signal that the web content process is not fully initialized yet. Not delivering is harmless; the interrupt only exists to break out of infinite loops in JS code, but there could not be any such infinite loop yet if the web content process is not fully initialized. * WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp: (WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak): 2017-05-05 Brian Burg Web Automation: cookie-related commands don't work correctly https://bugs.webkit.org/show_bug.cgi?id=171713 Reviewed by Alexey Proskuryakov. Commands that use WebCookieManager directly should complete when the manager's completion handler is called. Otherwise, this will race with subsequent accesses to cookies via the web process (document.cookie). Also, these commands need to use the active browsing context's session ID. They currently use the process pool's storage session, which is wrong since we specially configure automation instances with an ephemeral store. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::addSingleCookie): (WebKit::WebAutomationSession::deleteAllCookies): 2017-05-05 Chris Dumez Rename webProcessDidCrashWithReason callback to webProcessDidTerminate and stop calling webProcessDidCrash for client terminations https://bugs.webkit.org/show_bug.cgi?id=171624 Reviewed by Dan Bernstein. Follow-up fixes after r216129 based on feedback I have received: - Rename webProcessDidCrashWithReason callback function to webProcessDidTerminate given that this is called for non-crashes (e.g. terminations requested by the client). - Rename WKProcessCrashReason / ProcessCrashReason to WKProcessTerminationReason / ProcessTerminationReason for consistency with the new naming. - Stop calling processDidCrash / webProcessDidCrash for terminations requested by the client, to maintain pre-r216129 behavior. Those are not crashes (The client used an API such as WKPageTerminateProcess()). webProcessDidTerminate will still be called though. - Fix a bug where - for terminations due to resource limits - WebPageProxy::processDidCrash() was getting called twice: First by WebProcessProxy::requestTermination() with reason "RequestedByClient" then a second time by WebProcessProxy::terminateProcessDueToResourceLimits() with the proper reason. * Shared/ProcessTerminationReason.h: Renamed from Source/WebKit2/Shared/ProcessCrashReason.h. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::processDidTerminate): * UIProcess/API/C/WKAPICast.h: (WebKit::toAPI): * UIProcess/API/C/WKPage.cpp: (WKPageTerminate): (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/C/WKProcessTerminationReason.h: Renamed from Source/WebKit2/UIProcess/API/C/WKProcessCrashReason.h. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _killWebContentProcessAndResetState]): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::processDidTerminate): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidTerminate): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::requestTermination): (WebKit::WebProcessProxy::logDiagnosticMessageForResourceLimitTermination): (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: 2017-05-05 Derek Schuff Mac cmake buildfix after r216037 https://bugs.webkit.org/show_bug.cgi?id=171558 Reviewed by JF Bastien. * PlatformMac.cmake: 2017-05-05 Carlos Alberto Lopez Perez [GTK] Enable runtime flag for MediaDevices with enable-media-stream property. https://bugs.webkit.org/show_bug.cgi?id=171730 Reviewed by Michael Catanzaro. After r215939 the MediaDevices runtime setting has to be enabled also to use MediaStream / WebRTC. Enable it as part of the enable-media-stream property of the WebKitGTK+ API. * UIProcess/API/gtk/WebKitSettings.cpp: (webkit_settings_set_enable_media_stream): 2017-05-05 Carlos Garcia Campos [GTK] Assertion failure in Inspector::RemoteInspector::setRemoteInspectorClient when disposing WebKitWebContext https://bugs.webkit.org/show_bug.cgi?id=171644 Reviewed by Michael Catanzaro. Ensure that it's not possible to enable automation in more than one WebKitWebContext at the same time. Instead of creating the AutomationClient unconditionally when the context is constructed, it's now created only when automation is enabled, and deleted if it's disabled. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_is_automation_allowed): (webkit_web_context_set_automation_allowed): * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::AutomationClient): (WebKit::AutomationClient::~AutomationClient): 2017-05-04 Commit Queue Unreviewed, rolling out r216206. https://bugs.webkit.org/show_bug.cgi?id=171714 Multiple LayoutTests crashing in Document::page() (Requested by ap on #webkit). Reverted changeset: "Remove support for legacy Notifications" https://bugs.webkit.org/show_bug.cgi?id=171487 http://trac.webkit.org/changeset/216206 2017-05-04 Mark Lam NeverDestroyed(ASCIILiteral(...)) is not thread safe. https://bugs.webkit.org/show_bug.cgi?id=171586 Reviewed by Yusuke Suzuki. * Shared/API/APIError.cpp: (API::Error::webKitErrorDomain): (API::Error::webKitNetworkErrorDomain): (API::Error::webKitPolicyErrorDomain): (API::Error::webKitPluginErrorDomain): (API::Error::webKitDownloadErrorDomain): (API::Error::webKitPrintErrorDomain): * Shared/WebPreferencesKeys.cpp: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::executeEditCommand): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didBeginEditing): (WebKit::WebEditorClient::respondToChangedContents): (WebKit::WebEditorClient::respondToChangedSelection): (WebKit::WebEditorClient::didEndEditing): 2017-05-04 Jeremy Jones Add mute to WebPlaybackSessionModel. https://bugs.webkit.org/show_bug.cgi?id=171592 rdar://problem/31814074 Reviewed by Jer Noble. Plumb through muted. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::toggleMuted): (WebKit::WebPlaybackSessionModelContext::setMuted): (WebKit::WebPlaybackSessionManagerProxy::setMuted): (WebKit::WebPlaybackSessionManagerProxy::toggleMuted): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::mutedChanged): (WebKit::WebPlaybackSessionManager::mutedChanged): (WebKit::WebPlaybackSessionManager::toggleMuted): 2017-05-04 Wenson Hsieh [WK2] Image action sheets sometimes do not dismiss when beginning data interaction https://bugs.webkit.org/show_bug.cgi?id=171687 Reviewed by Beth Dakin. When presenting an image sheet using WKActionSheetAssistant, we may present the popover asynchronously. In this case, even if -cleanupSheet is invoked after -showImageSheet, the popover will still be presented. To fix this, add a flag, _hasPendingActionSheet, that is set to true when an image action sheet will be presented in the future. In cleanupSheet, we revert this flag to NO, and in the sheet presentation block, we first check to see if there is a pending action sheet. If there is not, then simply do not invoke the image sheet presentation block. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant cleanupSheet]): 2017-05-04 Wenson Hsieh [WK2] Add support for keeping the selection in a focused editable element when dragging begins https://bugs.webkit.org/show_bug.cgi?id=171585 Reviewed by Beth Dakin and Zalan Bujtas. Minor adjustments and refactoring in WebKit2. See WebCore ChangeLog for more details. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::didStartDrag): Factor out code in WebPageProxy that sends a WebPage::DidStartDrag message to the web process into a separate helper, and tweak the places where we directly send this IPC message to the web process to instead call this helper. * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setDragImage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didStartDrag): (WebKit::WebPage::dragCancelled): Clear out state in the web process and call out to the EventHandler to handle drag cancellation and the drag start response from the UI process. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::didStartDrag): Deleted. (WebKit::WebPage::dragCancelled): Deleted. 2017-05-04 Sam Weinig Remove support for legacy Notifications https://bugs.webkit.org/show_bug.cgi?id=171487 Reviewed by Jon Lee. * Configurations/FeatureDefines.xcconfig: * Shared/WebProcessCreationParameters.cpp: * Shared/WebProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: * WebProcess/Notifications/NotificationPermissionRequestManager.h: * WebProcess/Notifications/WebNotificationManager.cpp: * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/WebCoreSupport/WebNotificationClient.cpp: * WebProcess/WebCoreSupport/WebNotificationClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebProcess.cpp: Remove legacy notification specific code. 2017-05-04 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. * UIProcess/API/C/WKPage.cpp: (WKPageSetMediaCaptureEnabled): New. (WKPageGetMediaCaptureEnabled): New. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMediaCaptureEnabled:]): New. (-[WKWebView _mediaCaptureEnabled]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS and iOS. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the rejection timer. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): Call invalidatePendingRequests. (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all pending requests. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and schedule the timer if there are any others pending. (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't prompt the user if capture is disabled. (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current page on iOS. (WebKit::UserMediaProcessManager::setCaptureEnabled): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaCaptureEnabled): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::mediaCaptureEnabled): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending requests. (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request. (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopMediaCapture): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-05-04 Konstantin Tokarev Fix compilation with ICU 59.1 https://bugs.webkit.org/show_bug.cgi?id=171612 Reviewed by Mark Lam. ICU 59.1 has broken source compatibility. Now it defines UChar as char16_t, which does not allow automatic type conversion from unsigned short in C++ code. * Shared/API/c/WKString.cpp: (WKStringGetCharacters): 2017-05-04 Dan Bernstein [Cocoa] -[WKWebsiteDataStore httpCookieStore] is declared in the main @interface but implemented in a category https://bugs.webkit.org/show_bug.cgi?id=171657 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore httpCookieStore]): Moved from the WKPrivate category into the main @implementation block. 2017-05-04 Andy Estes [Cocoa] Add an optional width parameter to -[WKWebProcessPlugInNodeHandle renderedImageWithOptions:] https://bugs.webkit.org/show_bug.cgi?id=171646 Reviewed by Tim Horton. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Called -renderedImageWithOptions:width: with a nil width. (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:width:]): Passed an optional width to InjectedBundleNodeHandle::renderedImage(). * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): If a width is specified, create an image graphics context at that width, preserving the aspect ratio of paintingRect. (WebKit::InjectedBundleNodeHandle::renderedImage): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: 2017-05-04 Commit Queue Unreviewed, rolling out r216172. https://bugs.webkit.org/show_bug.cgi?id=171654 FTBFS for iOS due to missing WebPageProxy::stopMediaCapture() implementation. (Requested by ddkilzer on #webkit). Reverted changeset: "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216172 2017-05-04 Carlos Garcia Campos [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted https://bugs.webkit.org/show_bug.cgi?id=171336 Reviewed by Michael Catanzaro. We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update, but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call CompositingRunLoop::updateCompleted(). * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::forceRepaint): (WebKit::ThreadedCompositor::sceneUpdateFinished): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2017-05-04 David Kilzer check-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit/ directory: KeyError: 'st' Reviewed by Daniel Bates. The problem was that 'import parser' was ambiguous since there is a built-in parser module that comes with Python. Changing 'import parser' to 'from webkit import parser' fixed the error in check-webkit-style (and pylint) by forcing it to load the local 'parser' module, but then running messages_unittest.py directly would fail because .../Source/WebKit2/Scripts was not in the module search path by default. This is fixed by using sys.path.append() to add .../Source/WebKit2/Scripts to the module search path based on the path to messages_unittest.py. As an added bonus, this patch also fixes all webkit-style issues in Source/WebKit2/Scripts/webkit/*.py files. * Scripts/webkit/messages.py: - Separate local module imports from built-in modules for consistency. - Fix whitespace issues for check-webkit-style, and remove stray semi-colon. * Scripts/webkit/messages_unittest.py: - Update sys.path to find the 'webkit' module based on the path to messages_unittest.py. This makes 'from webkit import ...' statements work when running messages_unittest.py directly. - Change 'messages' and 'parser' modules to use 'from webkit import ...' format for consistency. - Fix whitespace issues for check-webkit-style. * Scripts/webkit/model.py: - Fix whitespace issue for check-webkit-style. * Scripts/webkit/parser.py: - Fix whitespace issue for check-webkit-style. 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. * UIProcess/API/C/WKPage.cpp: (WKPageSetMediaCaptureEnabled): New. (WKPageGetMediaCaptureEnabled): New. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMediaCaptureEnabled:]): New. (-[WKWebView _mediaCaptureEnabled]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS and iOS. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the rejection timer. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): Call invalidatePendingRequests. (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all pending requests. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and schedule the timer if there are any others pending. (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't prompt the user if capture is disabled. (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current page on iOS. (WebKit::UserMediaProcessManager::setCaptureEnabled): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaCaptureEnabled): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::mediaCaptureEnabled): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending requests. (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request. (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopMediaCapture): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-05-03 John Wilander Resource Load Statistics: Remove all statistics for modifiedSince website data removals https://bugs.webkit.org/show_bug.cgi?id=171584 Reviewed by Brent Fulgham. These are all test infrastructure changes. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours): * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours): * UIProcess/WebResourceLoadStatisticsManager.h: 2017-05-03 Timothy Horton Maintain interaction information imageURL as a URL, not a string https://bugs.webkit.org/show_bug.cgi?id=171639 Reviewed by Sam Weinig. * Shared/ios/InteractionInformationAtPosition.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dataForPreviewItemController:atPosition:type:]): (-[WKContentView _previewItemController:commitPreview:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2017-05-03 Commit Queue Unreviewed, rolling out r216160 and r216161. https://bugs.webkit.org/show_bug.cgi?id=171640 These changes broke the iOS build. (Requested by mlewis13 on #webkit). Reverted changesets: "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216160 "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216161 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Unreviewed build fix. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::clearUserMediaState): * UIProcess/WebPageProxy.h: 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. * UIProcess/API/C/WKPage.cpp: (WKPageSetMediaCaptureEnabled): New. (WKPageGetMediaCaptureEnabled): New. (WKPageClearUserMediaState): Deleted, unused. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMediaCaptureEnabled:]): New. (-[WKWebView _mediaCaptureEnabled]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS and iOS. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the rejection timer. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): Call invalidatePendingRequests. (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all pending requests. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and schedule the timer if there are any others pending. (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't prompt the user if capture is disabled. (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current page on iOS. (WebKit::UserMediaProcessManager::setCaptureEnabled): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaCaptureEnabled): (WebKit::WebPageProxy::clearUserMediaState): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::mediaCaptureEnabled): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending requests. (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request. (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopMediaCapture): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-05-03 Tim Horton Maintain interaction information URL as a URL, not a string https://bugs.webkit.org/show_bug.cgi?id=171623 Reviewed by Simon Fraser. * Shared/ios/InteractionInformationAtPosition.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showAttachmentSheet]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _dataForPreviewItemController:atPosition:type:]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]): (-[WKPDFView actionSheetAssistant:performAction:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2017-05-03 Simon Fraser Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying https://bugs.webkit.org/show_bug.cgi?id=171619 Also fixes webkit.org/b/170153 and webkit.org/b/170195 Reviewed by Tim Horton. In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that the handler would always run, since we couldn't reliably test the phase of the current transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to checking the transaction phase on newer iOS versions. If we're too late for the current transaction we still need to dispatch_async() to get into the next one. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 2017-05-03 Chris Dumez REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated https://bugs.webkit.org/show_bug.cgi?id=171616 Reviewed by Brady Eidson. Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called after r216129. WebPageProxy::processDidCrash() already takes care of calling resetStateAfterProcessExited(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::terminateProcess): 2017-05-03 Brady Eidson Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge. https://bugs.webkit.org/show_bug.cgi?id=171607 Reviewed by Andy Estes. To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now. * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead. 2017-05-03 Chris Dumez [WK2] Extend processDidCrash delegate to let the client know the reason for the crash https://bugs.webkit.org/show_bug.cgi?id=171565 Reviewed by Sam Weinig. Extend processDidCrash delegate to let the client know the reason for the crash. This is needed by some clients to distinguish actual crashes from terminations due to resource limits. * Shared/ProcessCrashReason.h: Added. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::processDidCrash): * UIProcess/API/C/WKAPICast.h: (WebKit::toAPI): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/C/WKProcessCrashReason.h: Added. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::processDidCrash): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::requestTermination): (WebKit::diagnosticLoggingKeyForTerminationReason): (WebKit::toProcessCrashReason): (WebKit::WebProcessProxy::terminateProcessDueToResourceLimits): (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: 2017-05-03 Carlos Garcia Campos [GTK] Add GTK+ implementation of WebAutomationSession https://bugs.webkit.org/show_bug.cgi?id=171431 Reviewed by Michael Catanzaro. Add platform dependent methods for GTK+ to synthesize events. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added. (WebKit::modifiersToEventState): (WebKit::mouseButtonToGdkButton): (WebKit::doMouseEvent): (WebKit::doMotionEvent): (WebKit::WebAutomationSession::platformSimulateMouseInteraction): (WebKit::doKeyStrokeEvent): (WebKit::keyCodeForVirtualKey): (WebKit::WebAutomationSession::platformSimulateKeyStroke): (WebKit::WebAutomationSession::platformSimulateKeySequence): (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): 2017-05-03 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release. * gtk/NEWS: Add release notes for 2.17.1. 2017-05-03 Carlos Garcia Campos [Soup] Add request headers to network load metrics https://bugs.webkit.org/show_bug.cgi?id=171545 Reviewed by Sergio Villar Senin. This will make the headers to appear in the web inspector. Fixes: http/tests/inspector/network/resource-request-headers.html * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didGetHeaders): 2017-05-02 Simon Fraser Dynamically added position:fixed element is in the wrong place https://bugs.webkit.org/show_bug.cgi?id=170280 rdar://problem/31374008 Reviewed by Tim Horton. Layers for position:fixed elements have their positions reconciled after scrolls via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(), which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer. This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position, but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change, but there was no signal to the UI process to restore the layer's pre-scrolled position. Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA geometry updates in the web process always send new positions to the UI process. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::setPosition): 2017-05-02 Gwang Yoon Hwang [GTK] Drop coordinated surfaces from the compositing thread as soon as possible https://bugs.webkit.org/show_bug.cgi?id=171544 Reviewed by Žan Doberšek. Released coordinated surface from the main thread didn't be freed until next commit message because the deletion of coordinated surfaces is considered as a part of scene state. We need to release corresponding surfaces whenever the compositing coordinator drops update atlases to reduce memory usages. No new tests, only an optimization. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: Remove atlasesToRemove from the GraphicsState. it is not a commit state anymore. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of released update atlases to the compositing thread right after cleaning up deactivated update atlases. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::clearPendingStateChanges): (WebKit::CompositingCoordinator::removeUpdateAtlas): (WebKit::CompositingCoordinator::releaseAtlases): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 2017-05-02 Timothy Horton Inform clients when viewport-fit state changes, so they can recompute insets https://bugs.webkit.org/show_bug.cgi?id=171573 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didChangeAvoidsUnsafeArea]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets themselves, we need to let them know when the current state of viewport-fit changes so that they can recompute the insets. 2017-05-02 Gwang Yoon Hwang [GTK] Recycle textures while handling tiles https://bugs.webkit.org/show_bug.cgi?id=171541 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::swapBuffers): Whenever we create new tiles or delete tiles, CoordGfx creates and deletes textures accordingly. We should avoid this kind of heavy operations whenever possible. This patch modifies to use the texture pool to reduce texture allocations. Also this patch reduces number of resetting textures, which is also expensive operation. * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: (WebKit::WebCoordinatedSurface::copyToTexture): Modified to pass BitmapTexture as a reference. * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: (WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto. 2017-05-02 David Kilzer Stop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm Reviewed by Chris Dumez. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::registerWithStateDumper): Switch from strcpy() to strlcpy(), removing comment in the process. 2017-05-02 Andrew Gold MediaDevices is not enabled for MobileSafari https://bugs.webkit.org/show_bug.cgi?id=171433 Reviewed by Youenn Fablet. Added the Cocoa API for toggling this feature and removed API for toggling MediaStreamEnabled since it will always be on. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _mediaDevicesEnabled]): (-[WKPreferences _setMediaDevicesEnabled:]): (-[WKPreferences _mediaStreamEnabled]): Deleted. (-[WKPreferences _setMediaStreamEnabled:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-05-02 Andy Estes REGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a touch event arrives after a WebPageProxy has been invalidated https://bugs.webkit.org/show_bug.cgi?id=171539 Reviewed by Tim Horton. Prior to r213036, the layer tree transaction at last touch start was tracked by WebPageProxy::handleTouchEventSynchronously(), which would ask the drawing area proxy for its most recent transaction ID after ensuring that the WebPageProxy was valid. r213036 moved the tracking up to -[WKContentView _webTouchEventsRecognized:], but failed to check if _page was valid before asking for its drawing area proxy's last transaction ID; the drawing area proxy is set to null on WebPageProxy invalidation. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _webTouchEventsRecognized:]): Added an early return if _page isn't valid. 2017-05-02 Carlos Garcia Campos Web Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContext for all platforms https://bugs.webkit.org/show_bug.cgi?id=171107 Reviewed by Brian Burg. The implementation is actually cross-platform, so it could be moved from WebAutomationSessionMac.mm to WebAutomationSession.cpp and simply return a NotImplemented error for iOS. This will allow to use these methods in other platforms. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted. (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted. 2017-05-01 Chris Dumez Use RELEASE_LOG_ERROR() to do process termination logging https://bugs.webkit.org/show_bug.cgi?id=171521 Reviewed by Andreas Kling. Use RELEASE_LOG_ERROR() to do process termination logging instead of RELEASE_LOG(). This makes the issue more visible in Console. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): 2017-05-01 Brady Eidson Only try to get sandbox extension handle for IndexedDB directory if it is set. rdar://problem/31925828 and https://bugs.webkit.org/show_bug.cgi?id=171522 Reviewed by Andy Estes. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): 2017-05-01 Timothy Horton Expose viewport-fit instead of clip-to-safe-area https://bugs.webkit.org/show_bug.cgi?id=171503 Reviewed by Simon Fraser. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::unobscuredSafeAreaInsets): (WebKit::operator==): Plumb the safe area insets down from the UI process to the Web Content process inside the visible content rect update, alongside the obscured insets. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::avoidsUnsafeArea): (WebKit::RemoteLayerTreeTransaction::setAvoidsUnsafeArea): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): (WebKit::RemoteLayerTreeTransaction::description): * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): (WebKit::PageClientImpl::didChangeClipToSafeArea): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): * UIProcess/mac/PageClientImpl.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didChangeClipToSafeArea): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateVisibleContentRects): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::setAvoidsUnsafeArea): (WebKit::WebPageProxy::setClipToSafeArea): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::avoidsUnsafeArea): (WebKit::WebPageProxy::clipToSafeArea): Deleted. * UIProcess/WebPageProxy.messages.in: Plumb the effective value of viewport-fit (whether or not to avoid the safe area for layout purposes) from the Web Content process to the UI process inside the layer tree transaction. Also, remove clip-to-safe-area plumbing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _computedContentInset]): (-[WKWebView _computedUnobscuredSafeAreaInset]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _contentMayDrawInObscuredInsets]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Make use of the effective value of viewport-fit to decide whether to take the safe area into account when computing the obscured insets, and expose this to clients (in the case that they need to know because they push their own obscured insets down). Also expose a safe area inset setter for that case as well. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView updateFixedClippingView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Remove a piece of the clip-to-safe-area implementation, and plumb safe area insets into the visible content rect update info. * UIProcess/ios/WKScrollView.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollView initWithFrame:]): (-[WKScrollView _contentInsetAdjustmentBehaviorWasExternallyOverridden]): (-[WKScrollView _setContentInsetAdjustmentBehavior:]): (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]): Keep track of whether the client has ever touched the content inset adjustment behavior; if they have, we won't manage it ourselves. 2017-05-01 Brady Eidson Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs. and https://bugs.webkit.org/show_bug.cgi?id=171508 Reviewed by Andy Estes. This patch: - Renames WKURLSchemeHandlerTask to WKURLSchemeTask - Renames the method "startTask" to "startURLSchemeTask" - Renames the method "stopTask" to "stopURLSchemeTask" To those effects it's basically a global replace. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp. (API::URLSchemeTask::create): (API::URLSchemeTask::URLSchemeTask): * UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h. * UIProcess/API/Cocoa/WKURLSchemeHandler.h: * UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h. * UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm. (raiseExceptionIfNecessary): (-[WKURLSchemeTaskImpl request]): (-[WKURLSchemeTaskImpl didReceiveResponse:]): (-[WKURLSchemeTaskImpl didReceiveData:]): (-[WKURLSchemeTaskImpl didFinish]): (-[WKURLSchemeTaskImpl didFailWithError:]): (-[WKURLSchemeTaskImpl _apiObject]): * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h. (WebKit::wrapper): * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h: * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: (WebKit::WebURLSchemeHandlerCocoa::platformStartTask): (WebKit::WebURLSchemeHandlerCocoa::platformStopTask): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::stopURLSchemeTask): (WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted. (WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp. (WebKit::WebURLSchemeTask::create): (WebKit::WebURLSchemeTask::WebURLSchemeTask): (WebKit::WebURLSchemeTask::didReceiveResponse): (WebKit::WebURLSchemeTask::didReceiveData): (WebKit::WebURLSchemeTask::didComplete): (WebKit::WebURLSchemeTask::pageDestroyed): (WebKit::WebURLSchemeTask::stop): * UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h. (WebKit::WebURLSchemeTask::identifier): (WebKit::WebURLSchemeTask::request): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::addURLSchemeTaskProxy): (WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy): (WebKit::WebLoaderStrategy::remove): (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted. (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted. * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::urlSchemeTaskDidReceiveResponse): (WebKit::WebPage::urlSchemeTaskDidReceiveData): (WebKit::WebPage::urlSchemeTaskDidComplete): (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted. (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted. (WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::startNewTask): (WebKit::WebURLSchemeHandlerProxy::taskDidComplete): (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp. (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy): (WebKit::WebURLSchemeTaskProxy::startLoading): (WebKit::WebURLSchemeTaskProxy::stopLoading): (WebKit::WebURLSchemeTaskProxy::didReceiveResponse): (WebKit::WebURLSchemeTaskProxy::didReceiveData): (WebKit::WebURLSchemeTaskProxy::didComplete): (WebKit::WebURLSchemeTaskProxy::hasLoader): * WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h. (WebKit::WebURLSchemeTaskProxy::request): (WebKit::WebURLSchemeTaskProxy::identifier): 2017-05-01 Chris Dumez Tweak how long we allow a process to go over its background CPU limit https://bugs.webkit.org/show_bug.cgi?id=170460 Reviewed by Geoffrey Garen. Tweak how long we allow a process to go over its background CPU limit. We now use 8 minutes intervals (instead of previously 15). This is less conservative and aligned with our memory kills. * WebProcess/cocoa/WebProcessCocoa.mm: 2017-05-01 Beth Dakin On-screen panel for candidate bar is in the wrong place when the caret is at the start of a paragraph https://bugs.webkit.org/show_bug.cgi?id=171453 -and corresponding- rdar://problem/29779764 Reviewed by Tim Horton. This bug only happens when the caret is at the beginning of the paragraph, and it is because Range::absoluteTextQuads() returns no quads in this case. I think it might be correct that absoluteTextQuads() returns no quads in this case, so this patch fixes the bug at the call site by using absoluteCaretBounds() in this case. SPI for testing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _candidateRect]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Bug fix. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformEditorState): 2017-05-01 Carlos Garcia Campos [GTK] Add automation session API https://bugs.webkit.org/show_bug.cgi?id=171428 Reviewed by Carlos Alberto Lopez Perez. Add new API to allow WebKitGTK+ to be controlled by automation. By default it's disabled, applications have to explicitly call webkit_web_context_set_automation_allowed() to enabled it. When a new automation session is requested, the signal WebKitWebContext::automation-started is emitted with a newly created WebKitAutomationSession, similar to how WebKitWebContext::download-started works. The user should connect to it have access to the WebKitAutomationSession and connect it its signals. When a new web view is requested to be created in a WebKitAutomationSession, the signal WebKitAutomationSession::create-web-view is emitted. The user should connect to it and return a WebKitWebView. The web views used for automation are special ones and need to be created with the new WebKitWebView:is-controlled-by-automation construct property enabled, otherwise we will refuse to create the requested browsing context. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitAutomationSession.cpp: Added. (webkitAutomationSessionSetProperty): (webkitAutomationSessionConstructed): (webkit_automation_session_class_init): (webkitAutomationSessionCreate): (webkitAutomationSessionGetSession): (webkit_automation_session_get_id): * UIProcess/API/gtk/WebKitAutomationSession.h: Added. * UIProcess/API/gtk/WebKitAutomationSessionPrivate.h: Added. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_class_init): (webkit_web_context_is_automation_allowed): (webkit_web_context_set_automation_allowed): (webkitWebContextCreatePageForWebView): * UIProcess/API/gtk/WebKitWebContext.h: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkit_web_view_class_init): (webkit_web_view_is_controlled_by_automation): * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: 2017-05-01 Carlos Garcia Campos Unreviewed. Fix GTK+ debug build after r216002. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (WebKit::wrapClientRectList): 2017-04-30 Chris Dumez Drop support for legacy ClientRect / ClientRectList https://bugs.webkit.org/show_bug.cgi?id=171418 Reviewed by Sam Weinig. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapClientRect): (webkit_dom_client_rect_constructed): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (ClientRectList::create): (ClientRectList::items): (ClientRectList::ClientRectList): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_get_bounding_client_rect): (webkit_dom_element_get_client_rects): 2017-04-30 Brady Eidson More fixing after r215991 https://bugs.webkit.org/show_bug.cgi?id=171483 * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): 2017-04-30 Brady Eidson Fix r215991 https://bugs.webkit.org/show_bug.cgi?id=171483 Unreviewed. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): 2017-04-30 Dan Bernstein [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance() https://bugs.webkit.org/show_bug.cgi?id=171485 Reviewed by Geoffrey Garen. * Platform/mac/MenuUtilities.mm: (WebKit::menuItemForTelephoneNumber): (WebKit::menuForTelephoneNumber): 2017-04-30 Brady Eidson Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI. and https://bugs.webkit.org/show_bug.cgi?id=171483 Reviewed by Geoff Garen (and kind of Andy Estes). Updates include: -Taking a file path as the config argument instead of a directory. -Proper sandbox extension handling. -Proper and thorough API test. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::syncAllCookies): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _syncNetworkProcessCookies]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _cookieStoragePath]): (-[_WKWebsiteDataStoreConfiguration _setCookieStoragePath:]): (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): Deleted. (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::syncNetworkProcessCookies): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedCookieStoragePath): (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): Deleted. 2017-04-30 Brady Eidson Regression (r215941) Unexpected logging causes perf tests to fail. and https://bugs.webkit.org/show_bug.cgi?id=171482 Reviewed by Alexey Proskuryakov. * Shared/mac/SandboxExtensionMac.mm: (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::networkingCachesDirectory): (WebKit::WebProcessPool::webContentCachesDirectory): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Only resolve the cookie storage directory if a custom one has been set. 2017-04-29 Youenn Fablet Readd assertion removed accidentally in r215955 https://bugs.webkit.org/show_bug.cgi?id=171466 Reviewed by Eric Carlson. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): 2017-04-29 Andy Estes [macOS] Picture-in-picture should be disabled in WebPlaybackControlsManager during external media playback https://bugs.webkit.org/show_bug.cgi?id=171468 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): Set canTogglePictureInPicture to YES by default on WebPlaybackControlsManager. 2017-04-29 Yusuke Suzuki Move WebCore CPUTime to WTF and implement it in all the platforms https://bugs.webkit.org/show_bug.cgi?id=171477 Reviewed by Chris Dumez. We now hold Seconds in CPUTime instead of int64_t. It finally sends Seconds through WebKit2 IPC. We do not need to specialize ArgumentCoder for Seconds since Seconds just holds double. * UIProcess/PerActivityStateCPUUsageSampler.cpp: (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler): (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime): (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired): * UIProcess/PerActivityStateCPUUsageSampler.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::reportWebContentCPUTime): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessPool.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::reportProcessCPUTime): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-04-28 Brady Eidson Teach the DatabaseProcess to be fully SessionID aware https://bugs.webkit.org/show_bug.cgi?id=171451 Reviewed by Geoffrey Garen. SessionIDs were already at the periphery of IDB and the DatabaseProcess. Getting a separate IDBServer per SessionID is a pretty straightforward improvement. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::idbServer): (WebKit::DatabaseProcess::initializeWebsiteDataStore): (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): (WebKit::DatabaseProcess::indexedDatabaseOrigins): (WebKit::DatabaseProcess::initializeDatabaseProcess): Deleted. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Deleted. (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Deleted. * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::indexedDatabaseDirectory): Deleted. * DatabaseProcess/DatabaseProcess.messages.in: * DatabaseProcess/DatabaseToWebProcessConnection.cpp: (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer): * DatabaseProcess/DatabaseToWebProcessConnection.h: * DatabaseProcess/DatabaseToWebProcessConnection.messages.in: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::create): (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): (WebKit::WebIDBConnectionToClient::deleteDatabase): (WebKit::WebIDBConnectionToClient::openDatabase): (WebKit::WebIDBConnectionToClient::abortTransaction): (WebKit::WebIDBConnectionToClient::commitTransaction): (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBConnectionToClient::createObjectStore): (WebKit::WebIDBConnectionToClient::deleteObjectStore): (WebKit::WebIDBConnectionToClient::renameObjectStore): (WebKit::WebIDBConnectionToClient::clearObjectStore): (WebKit::WebIDBConnectionToClient::createIndex): (WebKit::WebIDBConnectionToClient::deleteIndex): (WebKit::WebIDBConnectionToClient::renameIndex): (WebKit::WebIDBConnectionToClient::putOrAdd): (WebKit::WebIDBConnectionToClient::getRecord): (WebKit::WebIDBConnectionToClient::getAllRecords): (WebKit::WebIDBConnectionToClient::getCount): (WebKit::WebIDBConnectionToClient::deleteRecord): (WebKit::WebIDBConnectionToClient::openCursor): (WebKit::WebIDBConnectionToClient::iterateCursor): (WebKit::WebIDBConnectionToClient::establishTransaction): (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose): (WebKit::WebIDBConnectionToClient::databaseConnectionClosed): (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded): (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent): (WebKit::WebIDBConnectionToClient::openDBRequestCancelled): (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer): (WebKit::WebIDBConnectionToClient::getAllDatabaseNames): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * Shared/Databases/DatabaseProcessCreationParameters.cpp: (WebKit::DatabaseProcessCreationParameters::encode): (WebKit::DatabaseProcessCreationParameters::decode): * Shared/Databases/DatabaseProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureDatabaseProcess): (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::databaseProcessParameters): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::create): (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): 2017-04-28 Youenn Fablet getUserMedia video streams should follow device orientation https://bugs.webkit.org/show_bug.cgi?id=171284 Reviewed by Eric Carlson. Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory. Refactoring to return a CaptureSourceOrError instead of passing an out parameter in addition to returning a RefPtr. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): Deleted. * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-28 Chris Dumez [iOS] We should not take a background assertion for the UIProcess when app is MobileMail https://bugs.webkit.org/show_bug.cgi?id=171435 Reviewed by Geoffrey Garen. Add SPI to disable taking on background process assertions in the UIProcess. This is useful for MobileMail. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration shouldTakeUIBackgroundAssertion]): (-[_WKProcessPoolConfiguration setShouldTakeUIBackgroundAssertion:]): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::setClient): * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::ProcessThrottler): (WebKit::m_shouldTakeUIBackgroundAssertion): (WebKit::ProcessThrottler::didConnectToProcess): * UIProcess/ProcessThrottler.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): 2017-04-28 Chris Dumez Unreviewed attempt to fix iOS build after r215943. * Configurations/Base.xcconfig: 2017-04-28 Andy Estes [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes https://bugs.webkit.org/show_bug.cgi?id=171434 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Set m_audioMediaSelectedIndex and notified clients. (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Ditto for m_legibleMediaSelectedIndex. (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Called WebPlaybackSessionModelContext::setAudioMediaSelectionIndex(). (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Called WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex(). * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionIndexChanged): Called WebPlaybackSessionManager:: audioMediaSelectionIndexChanged(). (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionIndexChanged): Called WebPlaybackSessionManager::legibleMediaSelectionIndexChanged(). (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged): Sent WebPlaybackSessionManagerProxy::SetAudioMediaSelectionIndex(). (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged): Sent WebPlaybackSessionManagerProxy::SetLegibleMediaSelectionIndex(). 2017-04-28 Brady Eidson Start of support for multiple WebsiteDataStore/SessionIDs per process https://bugs.webkit.org/show_bug.cgi?id=171422 Reviewed by Geoffrey Garen. * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::destroyPrivateBrowsingSession): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h. (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters): (WebKit::WebsiteDataStoreParameters::encode): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h. * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::defaultDataStore): (API::WebsiteDataStore::createLegacy): (API::WebsiteDataStore::WebsiteDataStore): (API::WebsiteDataStore::create): Deleted. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerCreate): (webkitWebsiteDataManagerGetDataStore): * UIProcess/WebPageProxy.cpp: (WebKit::m_weakPtrFactory): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::pageRemovedFromProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::create): (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::WebFrameNetworkingContext::storageSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::addWebsiteDataStore): (WebKit::WebProcess::destroySession): (WebKit::WebProcess::destroyPrivateBrowsingSession): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-04-28 Youenn Fablet Adding a runtime flag specific to MediaDevices https://bugs.webkit.org/show_bug.cgi?id=171433 Reviewed by Geoffrey Garen. Adding a preference for MediaDevices. Setting media devices runtime flag to false by default. Setting peer connection and media stream flags to true by default. Sending microphone sandbox extension based on media devices and not media stream flag. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaDevicesEnabled): (WKPreferencesGetMediaDevicesEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-28 Brady Eidson Teach WebProcessPool to track a map of SessionIDs to WebPageProxys to manage their lifetime https://bugs.webkit.org/show_bug.cgi?id=171408 Reviewed by Alex Christensen. * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::sessionID): * UIProcess/API/APIPageConfiguration.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::close): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::pageRemovedFromProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createWebPage): (WebKit::WebProcessProxy::addExistingWebPage): (WebKit::WebProcessProxy::removeWebPage): * UIProcess/WebProcessProxy.h: 2017-04-27 Carlos Garcia Campos Move UUID from WebCore/platform to WTF https://bugs.webkit.org/show_bug.cgi?id=171372 Reviewed by Michael Catanzaro. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::handleForWebPageProxy): (WebKit::WebAutomationSession::handleForWebFrameID): * UIProcess/gtk/WaylandCompositor.cpp: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::createUUID): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::openWithNativeApplication): 2017-04-27 Chris Dumez Align colspan/rowspan limits with the latest HTML specification https://bugs.webkit.org/show_bug.cgi?id=171322 Reviewed by Darin Adler. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp: (webkit_dom_html_table_cell_element_get_col_span): (webkit_dom_html_table_cell_element_set_col_span): 2017-04-27 Wenson Hsieh WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction https://bugs.webkit.org/show_bug.cgi?id=171386 Reviewed by Beth Dakin. Add a new WKUIDelegate hook, _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-04-27 Brady Eidson Refactor SessionID to support multiple non-ephemeral (persistent) sessions. https://bugs.webkit.org/show_bug.cgi?id=171367 Reviewed by Andy Estes. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): Child processes should never be generating new SessionIDs, so enable generation protection. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::createNonPersistent): (WebKit::generateNonPersistentSessionID): Deleted. 2017-04-27 Said Abou-Hallawa REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument https://bugs.webkit.org/show_bug.cgi?id=170333 Reviewed by Simon Fraser. Disbale the async decoding for large images for now. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-27 Brent Fulgham [WK2][macOS] Allow multi-touch related iokit-get-properties https://bugs.webkit.org/show_bug.cgi?id=171355 Reviewed by Alexey Proskuryakov. During testing I've noticed Sandbox Violations being generated during some 'Force Touch' track pad use. The sandbox should allow these IOKit properties to be accessed. * WebProcess/com.apple.WebProcess.sb.in: 2017-04-27 Alex Christensen Add stub SPI for setting cookie storage path on _WKWebsiteDataStoreConfiguration https://bugs.webkit.org/show_bug.cgi?id=171399 Reviewed by Brady Eidson. This SPI isn't hooked up yet, but it has a test that will need to be updated once it works. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): 2017-04-27 Chris Dumez Element.getBoundingClientRect() / getClientRects() should return a DOMRect types https://bugs.webkit.org/show_bug.cgi?id=171226 Reviewed by Simon Fraser. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (toClientRect): (webkit_dom_element_get_bounding_client_rect): (webkit_dom_element_get_client_rects): 2017-04-27 Brady Eidson Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages. https://bugs.webkit.org/show_bug.cgi?id=171365 Reviewed by Andy Estes. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 2017-04-27 Alex Christensen Modernize Frame.h https://bugs.webkit.org/show_bug.cgi?id=171357 Reviewed by Andy Estes. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::handleContextMenuEvent): (WebKit::WebPage::isSelectTrailingWhitespaceEnabled): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::selectPositionAtPoint): (WebKit::WebPage::selectPositionAtBoundaryWithDirection): (WebKit::WebPage::rangeForGranularityAtPoint): (WebKit::WebPage::selectTextWithGranularityAtPoint): (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPage::updateSelectionWithExtentPoint): 2017-04-27 Carlos Garcia Campos [GTK] Remote inspector should support inspecting targets with previous version of backend commands https://bugs.webkit.org/show_bug.cgi?id=171267 Reviewed by Michael Catanzaro. There's a FIXME for this in the code. The remote inspector proxy allows to pass a backend commands URL when inspecting a target. That URL, if not empty, is used as Protocol/InspectorBackendCommands.js in the inspector code instead of the local copy. We are currently assuming that both ends use the same version of that file. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorProxy::load): Pass RemoteInspectorClient::backendCommandsURL() to load(). (WebKit::RemoteInspectorClient::setupConnection): Get the local backend commands hash and pass it to SetupInspectorClient method. Extract the server backend commands from the result and call setBackendCommands(). (WebKit::RemoteInspectorClient::setBackendCommands): Create a data URL for the server backend commands file conents if needed. * UIProcess/glib/RemoteInspectorClient.h: (WebKit::RemoteInspectorClient::backendCommandsURL): 2017-04-26 Wenson Hsieh WebItemProviderPasteboard should not synchronously load provided data https://bugs.webkit.org/show_bug.cgi?id=171341 Reviewed by Tim Horton. Adds plumbing for updatePreferredTypeIdentifiers through the WebPasteboardProxy. This allows the web process to signal to the UI process what UTIs the current drop target should accept and load. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-26 Youenn Fablet Unauthenticated CORS preflight requests should not use client certificates https://bugs.webkit.org/show_bug.cgi?id=171298 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ensuring that session dedicated to requests that do not want to use credentials do not look for client credentials. 2017-04-26 Eric Carlson The current page is given a muted state when starting a media stream on iOS. https://bugs.webkit.org/show_bug.cgi?id=171290 Reviewed by Jer Noble. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Don't mute the current page on iOS either, that will prevent the new media stream from playing. 2017-04-26 Alex Christensen Make user script injection more robust https://bugs.webkit.org/show_bug.cgi?id=171339 Reviewed by Geoffrey Garen. * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::forEachUserScript): (WebKit::WebUserContentController::forEachUserStyleSheet): (WebKit::WebUserContentController::forEachUserMessageHandler): * WebProcess/UserContent/WebUserContentController.h: 2017-04-26 Zalan Bujtas RTL: recent searches popover is displayed in incorrect location https://bugs.webkit.org/show_bug.cgi?id=171338 Reviewed by Dean Jackson. Add RTL support for the pop-under branch. * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): 2017-04-26 Antti Koivisto Enable expired-only reload policy on Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=171264 Reviewed by Andreas Kling. Enable the reload policy where only expired subresources are revalidated on Mac and iOS. The behavor is enabled in Safari and for other clients based on SDK version check. * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-26 Andy Estes [macOS] Add picture-in-picture support to WebPlaybackControlsManager https://bugs.webkit.org/show_bug.cgi?id=171328 Reviewed by Jer Noble. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::togglePictureInPicture): Added. Calls WebPlaybackSessionManagerProxy::togglePictureAndPicture(). (WebKit::WebPlaybackSessionManagerProxy::togglePictureInPicture): Added. Sends TogglePictureInPicture to WebPlaybackSessionManager. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): Called -[WebPlaybackControlsManager setAllowsPictureInPicturePlayback:YES] if WebPreferences::allowsPictureInPictureMediaPlayback() is true. * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::togglePictureInPicture): Added. Sets a UserGestureIndicator and calls WebPlaybackSessionModel::togglePictureInPicture(). 2017-04-26 Tim Horton WebKit calls AppKit NSCell API from a background queue https://bugs.webkit.org/show_bug.cgi?id=171318 Reviewed by Anders Carlsson. * UIProcess/mac/ServicesController.mm: (WebKit::ServicesController::refreshExistingServices): Synchronously bounce to the main thread to do non-thread-safe NSCell related work. 2017-04-25 Alex Christensen Encoded filename should be decoded for WKContentExtension.identifier https://bugs.webkit.org/show_bug.cgi?id=171316 Reviewed by Andy Estes. * UIProcess/API/APIContentExtensionStore.cpp: (API::createExtension): (API::ContentExtensionStore::lookupContentExtension): (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): 2017-04-26 Andrew Gold Move mediaCaptureEnabled from WKWebViewConfiguration to WKPreferences https://bugs.webkit.org/show_bug.cgi?id=171294 Reviewed by Eric Carlson. Since we now want the ability to toggle this setting dynamically, I have moved it from WKWebViewConfiguration to WKPreferences. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _mediaStreamEnabled]): (-[WKPreferences _setMediaStreamEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): No longer set mediaStream enabled from the configuration. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _mediaStreamEnabled]): Deleted. (-[WKWebViewConfiguration _setMediaStreamEnabled:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-04-25 Alex Christensen REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set https://bugs.webkit.org/show_bug.cgi?id=171297 Reviewed by Geoffrey Garen. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): 2017-04-25 Wenson Hsieh Unreviewed, speculative build fix * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: For the time being, remove all references to UIItemProviders from this private header. This should be fixed to use unavailability macros in a followup. See . 2017-04-25 Brent Fulgham Limit allowed size of document.title to avoid locking WebKit clients https://bugs.webkit.org/show_bug.cgi?id=165113 Reviewed by Darin Adler. When a web application attempts to set an extremely long title, truncate the title to a more reasonable size. We do this at at the presentation layer, rather than in the DOM, so that we do not affect script function. Instead, we merely limit display to a level that is reasonable for normal GUI widgets. Anything else needs to be truncated in the UI layer, so it is a waste of effort to send across IPC. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-04-25 John Wilander Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting https://bugs.webkit.org/show_bug.cgi?id=171295 Reviewed by Brent Fulgham. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain): Changes and additions to test infrastructure. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Changes and additions to test infrastructure. * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): No longer sends a boolean parameter to WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler(). 2017-04-25 Simon Fraser REGRESSION (r213719): WebGL content on cubeslam.com is 1/4 expected size https://bugs.webkit.org/show_bug.cgi?id=171300 rdar://problem/31051538 Reviewed by Dean Jackson. Propagating the contentsScale to the UI process for canvas content layers causes scaling issues, so don't do it for contents-provided layers. No test because WebGL can't be tested in the iOS simulator. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::PlatformCALayerRemote): 2017-04-25 Brady Eidson Update WebProcess(Pool) to assume there's always a WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=171299 Reviewed by Alex Christensen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::warmInitialProcess): (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::create): (WebKit::WebProcessProxy::WebProcessProxy): (WebKit::m_userMediaCaptureManagerProxy): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::websiteDataStore): 2017-04-25 Ryan Haddad Unreviewed, rolling out r215730. The LayoutTest for this change is a flaky timeout on mac-wk1 debug. Reverted changeset: "Enable expired-only reload policy on Mac and iOS" https://bugs.webkit.org/show_bug.cgi?id=171264 http://trac.webkit.org/changeset/215730 2017-04-24 Matt Rajca Indicate presence of audio when handling autoplay events. https://bugs.webkit.org/show_bug.cgi?id=171227 Reviewed by Alex Christensen. * UIProcess/API/APIUIClient.h: (API::UIClient::handleAutoplayEvent): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleAutoplayEvent): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleAutoplayEvent): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-04-25 Daniel Bates [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header https://bugs.webkit.org/show_bug.cgi?id=136452 Reviewed by Brent Fulgham. Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms. * Configurations/FeatureDefines.xcconfig: 2017-04-25 John Wilander Resource Load Statistics: Clear network process cache when clearing store https://bugs.webkit.org/show_bug.cgi?id=171256 Reviewed by Brent Fulgham. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst to WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts(). * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now takes the boolean parameter clearFirst. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst to Messages::NetworkProcess::ShouldPartitionCookiesForTopPrivatelyOwnedDomains. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now takes the boolean parameter clearFirst. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): Now uses the boolean parameter clearFirst when calling WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler(). (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): No longer uses the deleted store getter. (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): No longer uses the deleted store getter. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): No sends the boolean parameter clearFirst to ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler(). (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Now expects a handler with the boolean parameter clearFirst. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): * UIProcess/WebResourceLoadStatisticsStore.h: Now uses the new WebCore::ResourceLoadObserver::clearInMemoryStore(). * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst in its message to the network process. (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): Now expects a handler with the boolean parameter clearFirst. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-04-25 Chris Dumez Content-Disposition header filename is ignored when 'download' attribute is specified in HTML https://bugs.webkit.org/show_bug.cgi?id=171239 Reviewed by Alex Christensen. Content-Disposition header filename is ignored when 'download' attribute is specified in HTML. This is not as per HTML specification: - https://html.spec.whatwg.org/#as-a-download (Step 2) Content-Disposition header filename is supposed to override the value of the download attribute. Firefox and Chrome follow the specification. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::findPendingDownloadLocation): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::didReceiveResponse): 2017-04-25 Carlos Garcia Campos [GTK] Add WebKitInspectorWindow to create inspector windows from local and remote inspector https://bugs.webkit.org/show_bug.cgi?id=171261 Reviewed by Michael Catanzaro. The code is currently duplicated in WebInspectorProxyGtk.cpp and RemoteWebInspectorProxyGtk.cpp. We can simplify it by using a common widget in both places. This patch also fixes the build when using GTK+ < 3.16. * PlatformGTK.cmake: * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: (WebKit::RemoteWebInspectorProxy::updateWindowTitle): (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::createInspectorWindow): (WebKit::WebInspectorProxy::updateInspectorWindowTitle): * UIProcess/gtk/WebKitInspectorWindow.cpp: Added. (webkit_inspector_window_class_init): (webkit_inspector_window_init): (webkitInspectorWindowNew): (webkitInspectorWindowSetSubtitle): * UIProcess/gtk/WebKitInspectorWindow.h: Added. 2017-04-25 Antti Koivisto Enable expired-only reload policy on Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=171264 Reviewed by Andreas Kling. Enable the reload policy where only expired subresources are revalidated on Mac and iOS. The behavor is enabled in Safari and for other clients based on SDK version check. * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-25 Wenson Hsieh Support reading NSURL titles from the pasteboard when performing data interaction https://bugs.webkit.org/show_bug.cgi?id=171156 Reviewed by Tim Horton. Adjust for interface changes in WebCore to support plumbing the title of an NSURL from the platform pasteboard back to WebCore. Additionally, implement WebEditorClient::hasRichlyEditableSelection (which previously returned false) to check whether the current selection is richly editable, or the drop caret is in richly editable content. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::readURLFromPasteboard): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::readURLFromPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::hasRichlyEditableSelection): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::hasRichlyEditableSelection): * WebProcess/WebPage/WebPage.h: 2017-04-24 Wenson Hsieh Respect fidelity order when reading web content from item providers https://bugs.webkit.org/show_bug.cgi?id=171155 Reviewed by Tim Horton. Adjusts for changes in WebCore by adding plumbing to support Pasteboard::getTypesByFidelityForItemAtIndex. See WebCore/ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-24 Brady Eidson WebProcessPools should always have a WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=171252 Reviewed by Alex Christensen. * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/C/WKContext.cpp: (WKContextGetWebsiteDataStore): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::isAssociatedProcessPool): 2017-04-24 Youenn Fablet Set defaults video getUserMedia constraints https://bugs.webkit.org/show_bug.cgi?id=171127 Reviewed by Eric Carlson. Updated to cope with MediaStreamConstraintsImpl refactoring. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): 2017-04-24 Chris Dumez Allow tabs with capturing audio or video to exceed background CPU limit https://bugs.webkit.org/show_bug.cgi?id=171249 Reviewed by Geoffrey Garen. Allow tabs with capturing audio or video to exceed background CPU limit as this is a legit case of potentially high background CPU use. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): 2017-04-24 Andy Estes Try to fix the 32-bit macOS build. * UIProcess/Cocoa/WebViewImpl.mm: 2017-04-24 Andy Estes [macOS] Enable media selection button on AVTouchBarScrubber https://bugs.webkit.org/show_bug.cgi?id=171149 Reviewed by Beth Dakin. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-24 Alex Christensen Reduce copies and allocations in SharedBuffer::append https://bugs.webkit.org/show_bug.cgi?id=170956 Reviewed by Andreas Kling. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm: (-[WKURLSchemeHandlerTaskImpl didReceiveData:]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::addArchiveResource): (WebKit::PDFPlugin::liveResourceData): (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::redeliverManualStream): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::cachedResponseDataForURL): 2017-04-24 Carlos Garcia Campos [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector https://bugs.webkit.org/show_bug.cgi?id=166680 Reviewed by Michael Catanzaro. Remove INSPECTOR_SERVER code and add new classes to implement REMOTE_INSPECTOR. The WebKitWebContext registers a custom protocol "inspector" that loads a page with the list of debuggable targets. * PlatformGTK.cmake: Add new files to compilation and remove the old ones. * UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Removed. * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: Added. (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler): (WebKit::RemoteInspectorProtocolHandler::~RemoteInspectorProtocolHandler): (WebKit::RemoteInspectorProtocolHandler::webViewDestroyed): (WebKit::RemoteInspectorProtocolHandler::userContentManagerDestroyed): (WebKit::RemoteInspectorProtocolHandler::handleRequest): (WebKit::RemoteInspectorProtocolHandler::inspect): (WebKit::RemoteInspectorProtocolHandler::targetListChanged): (WebKit::RemoteInspectorProtocolHandler::connectionClosed): * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: Added. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): * UIProcess/InspectorServer/HTTPRequest.cpp: Add missing ENABLE(INSPECTOR_SERVER) ifdefs. * UIProcess/InspectorServer/HTTPRequest.h: * UIProcess/InspectorServer/WebInspectorServer.h: * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: Removed. * UIProcess/RemoteWebInspectorProxy.cpp: * UIProcess/RemoteWebInspectorProxy.h: * UIProcess/WebProcessPool.cpp: * UIProcess/glib/RemoteInspectorClient.cpp: Added. (WebKit::RemoteInspectorClient::RemoteInspectorClient): (WebKit::RemoteInspectorClient::~RemoteInspectorClient): (WebKit::dbusConnectionCallAsyncReadyCallback): (WebKit::RemoteInspectorClient::connectionClosedCallback): (WebKit::RemoteInspectorClient::setupConnection): (WebKit::RemoteInspectorClient::connectionClosed): (WebKit::RemoteInspectorClient::inspect): (WebKit::RemoteInspectorClient::sendMessageToBackend): (WebKit::RemoteInspectorClient::closeFromFrontend): (WebKit::RemoteInspectorClient::setTargetList): (WebKit::RemoteInspectorClient::sendMessageToFrontend): * UIProcess/glib/RemoteInspectorClient.h: Added. (WebKit::RemoteInspectorObserver::~RemoteInspectorObserver): (WebKit::RemoteInspectorClient::targets): (WebKit::RemoteInspectorClient::hostAndPort): * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: Added. (WebKit::RemoteWebInspectorProxy::updateWindowTitle): (WebKit::inspectorViewDestroyed): (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::RemoteWebInspectorProxy::platformBringToFront): (WebKit::RemoteWebInspectorProxy::platformSave): (WebKit::RemoteWebInspectorProxy::platformAppend): (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab): * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (didReceiveMessageToPage): Updated after the GRefPtr hash traitds changes. * config.h: 2017-04-23 Dan Bernstein [macOS] WKWebInspectorProxyObjCAdapter has a public ivar https://bugs.webkit.org/show_bug.cgi?id=171200 Reviewed by Geoffrey Garen. * UIProcess/API/C/mac/WKInspectorPrivateMac.h: Made ivar private. 2017-04-23 Commit Queue Unreviewed, rolling out r215657 and r215676. https://bugs.webkit.org/show_bug.cgi?id=171201 Broke the build (Requested by ap on #webkit). Reverted changesets: "[macOS] Enable media selection button on AVTouchBarScrubber" https://bugs.webkit.org/show_bug.cgi?id=171149 http://trac.webkit.org/changeset/215657 "Build fix after r215657." http://trac.webkit.org/changeset/215676 2017-04-23 Alexey Proskuryakov Build fix after r215657. * UIProcess/Cocoa/WebViewImpl.mm: 2017-04-23 Andy Estes [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type https://bugs.webkit.org/show_bug.cgi?id=171192 Reviewed by Wenson Hsieh. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged): 2017-04-21 Wenson Hsieh Support writing link titles to the pasteboard when beginning data interaction on a link https://bugs.webkit.org/show_bug.cgi?id=171154 Reviewed by Andy Estes. Adds support for setting the _title attribute of NSURLs written to the pasteboard. See WebCore ChangeLog for more details. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: Teach PasteboardURL to be serialized in IPC. For now, we just send across the absolute string of the link and its title. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::writeURLToPasteboard): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: Add IPC plumbing for writing PasteboarURLs to the pasteboard. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::writeToPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-21 Michael Catanzaro Unreviewed, rolling out r215608. Hundreds of test failures on GTK bot Reverted changeset: "Reduce copies and allocations in SharedBuffer::append" https://bugs.webkit.org/show_bug.cgi?id=170956 http://trac.webkit.org/changeset/215608 2017-04-21 Andy Estes [macOS] Enable media selection button on AVTouchBarScrubber https://bugs.webkit.org/show_bug.cgi?id=171149 Reviewed by Beth Dakin. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-21 Wenson Hsieh [WK2] Add delegate hooks for overriding unhanded data interaction operations https://bugs.webkit.org/show_bug.cgi?id=171005 Reviewed by Tim Horton. Adds support for overriding data interaction operations through two new delegate methods: _webView:willUpdateDataInteractionOperationToOperation:forSession:, and _webView:dataInteractionOperationWasHandled:forSession:. The former may be overridden to return a different operation type than what WebKit would originally have returned, and the latter may be overridden to run custom logic after the web process has handled a data interaction operation. Additionally, includes some minor cleanup around WKContentViewInteraction. With the new _webView:dataInteractionOperationWasHandled:forSession: delegate method, the last method on _WKTestingDelegate may be removed. This means _WKTestingDelegate is no longer needed, so this patch removes its header entirely. Also, relocates some state variables formerly on WKContentView to WKContentView's WKDataInteractionState struct instead, so that all state associated with data interaction may be cleaned up at the same time. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _testingDelegate]): Deleted. (-[WKWebView _setTestingDelegate:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKTestingDelegate.h: Removed. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add a new "handled" IPC argument to DidPerformDataInteractionControllerOperation. This lets the UI process know whether or not the data interaction operation was handled by the web process, and is eventually plumbed through to the UI delegate via the new SPI. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _displayFormNodeInputView]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-04-21 Anders Carlsson Stop using deprecated APIs, part 5 https://bugs.webkit.org/show_bug.cgi?id=171134 rdar://problem/31589635 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentAuthorizationStatus): Remove this and add a new version that doesn't use any deprecated values. (WebKit::toPKPaymentAuthorizationStatus): New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes. (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Use the new toPKPaymentAuthorizationStatus versions. (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Ditto. (WebKit::status): Deleted. 2017-04-21 David Kilzer Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make Reviewed by Brent Fulgham. * DerivedSources.make: Switch to -std=gnu++14 for preprocessing headers to check for build settings. 2017-04-21 Jer Noble [WK2][MediaCapture] Pass muted and enabled state across process boundary when capturing in UIProcess https://bugs.webkit.org/show_bug.cgi?id=170846 Reviewed by Jon Lee. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::setMuted): (WebKit::UserMediaCaptureManagerProxy::setEnabled): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setMuted): (WebKit::UserMediaCaptureManager::Source::setEnabled): (WebKit::UserMediaCaptureManager::setMuted): (WebKit::UserMediaCaptureManager::setEnabled): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-21 Jer Noble [WK2][MediaCapture] Remove now-unused WKWebViewConfiguration property for shouldCaptureAudioInUIProcess https://bugs.webkit.org/show_bug.cgi?id=170847 Reviewed by Jon Lee. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): Deleted. (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): Deleted. 2017-04-21 Anders Carlsson Stop using deprecated APIs, part 4 https://bugs.webkit.org/show_bug.cgi?id=171125 rdar://problem/31589635 Reviewed by Tim Horton. It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point so just remove the status parameter. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): 2017-04-21 Andrew Gold -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] decision handler should only have one parameter. https://bugs.webkit.org/show_bug.cgi?id=171081 Reviewed by Tim Horton. Because user media authorization is all or nothing, we should not have separate booleans to indicate authorization. Additionally, rather than passing two separate booleans to the UIDelegate, we now pass an NS_OPTIONS parameter. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS. * UIProcess/Cocoa/UIDelegate.mm: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method. (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto. 2017-04-21 Konstantin Tokarev Unreviewed, added missing file to PlatformMac.cmake * PlatformMac.cmake: 2017-04-21 Konstantin Tokarev Unreviewed follow-up for r215609 * UIProcess/API/Cocoa/WKWebView.mm: Move internal header include too. 2017-04-21 Konstantin Tokarev Include iOS-specific headers inside preprocessor guard https://bugs.webkit.org/show_bug.cgi?id=171104 Reviewed by Michael Catanzaro. This patch should fix Mac cmake build. * UIProcess/API/Cocoa/WKWebView.mm: 2017-04-21 Alex Christensen Reduce copies and allocations in SharedBuffer::append https://bugs.webkit.org/show_bug.cgi?id=170956 Reviewed by Andreas Kling. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm: (-[WKURLSchemeHandlerTaskImpl didReceiveData:]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::addArchiveResource): (WebKit::PDFPlugin::liveResourceData): (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::redeliverManualStream): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::cachedResponseDataForURL): 2017-04-20 Konstantin Tokarev [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere https://bugs.webkit.org/show_bug.cgi?id=171071 Reviewed by Michael Catanzaro. "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should be available for all ports. * CMakeLists.txt: * PlatformMac.cmake: 2017-04-20 Brady Eidson WebContent process becomes unresponsive after returning nil from async version of -webView:createWebViewWithConfiguration:... and https://bugs.webkit.org/show_bug.cgi?id=171090 Reviewed by Andy Estes. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): Handle the perfectly valid "nil webView" case correctly. 2017-04-20 Dan Bernstein Disable header postprocessing when building for Sierra Absolutely rubber-stamped by Anders Carlsson. * Configurations/WebKit.xcconfig: 2017-04-20 Matt Rajca Cocoa: add private API for suppressing first responder changes https://bugs.webkit.org/show_bug.cgi?id=171069 Reviewed by Tim Horton. Some clients may not want the web view to be programmatically made the first responder and invoking -makeFirstResponder: unconditionally posts 'first responder did change' notifications. Added API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setShouldSuppressFirstResponderChanges:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges): * UIProcess/PageClient.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::makeFirstResponder): 2017-04-20 Eric Carlson [MediaStream iOS] Hold process assertion while media capture is active https://bugs.webkit.org/show_bug.cgi?id=171017 Reviewed by Dean Jackson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary. (WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active. (WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted, so pass IsCapturingMedia to activityStateDidChange. (WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture is active. 2017-04-20 Anders Carlsson Fix build. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): 2017-04-20 Brady Eidson Add CompletionHandlerCallChecker to SPI added in r215545. https://bugs.webkit.org/show_bug.cgi?id=171067 Reviewed by Dan Bernstein. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): 2017-04-20 Anders Carlsson Replace isFinalStateStatus with isFinalStateResult https://bugs.webkit.org/show_bug.cgi?id=171072 rdar://problem/31589635 Reviewed by Tim Horton. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completePaymentSession): 2017-04-20 Wenson Hsieh [WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy https://bugs.webkit.org/show_bug.cgi?id=170922 Reviewed by Tim Horton. Refactors part of the asynchronous position information mechanism introduced in , and introduces infrastructure for unit testing UI-side position information requests. _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is a helper method on WKContentView responsible for invoking queued position information handlers after receiving a position information response from the web process. Previously, this method would iterate over the list of pending callbacks and invoke all callbacks whose requests are satisfied by the incoming position information update, saving the indices of these handled callbacks in the process. At the end, it would then remove callbacks at these indices from the array of pending callbacks. This is problematic when a synchronous position update (via ensurePositionInformationIsUpToDate:) is triggered from within one of these callbacks, since _invokeAndRemovePendingHandlersValidForCurrentPositionInformation will be called from within itself, and then we will attempt to remove a callback at the same index twice. To fix this, we change the array of pending position information handlers to be an array of optionals instead. When invoking and removing pending handlers after a position information response arrives, we now mark callbacks as handled by setting them to std::nullopt. Then, when the top-level invocation to _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is finished, we remove all marked handlers from the pending vector. Covered by 6 new unit tests: - PositionInformationTests.FindDraggableLinkAtPosition - PositionInformationTests.RequestDraggableLinkAtPosition - PositionInformationTests.FindDraggableLinkAtDifferentPositionWithinRequestBlock - PositionInformationTests.FindDraggableLinkAtSamePositionWithinRequestBlock - PositionInformationTests.RequestDraggableLinkAtSamePositionWithinRequestBlock - PositionInformationTests.RequestDraggableLinkAtDifferentPositionWithinRequestBlock * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView draggableElementAtPosition:]): (-[WKWebView requestDraggableElementAtPosition:completionBlock:]): Uses WKContentView's position information request helpers to search for draggable elements on the page. There are both synchronous and asynchronous versions of this, both of which retrieve a _WKDraggableElementInfo. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Added. * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Added. Exposes what elements are draggable at a given position as SPI (only for use in testing code, at the moment). (-[_WKDraggableElementInfo initWithInteractionInformationAtPosition:]): (-[_WKDraggableElementInfo copyWithZone:]): * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Added. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView currentPositionInformation]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]): * WebKit2.xcodeproj/project.pbxproj: 2017-04-20 Anders Carlsson Fix a PassKit function declaration typo https://bugs.webkit.org/show_bug.cgi?id=171068 rdar://problem/31635008 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-04-20 Jer Noble [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess. https://bugs.webkit.org/show_bug.cgi?id=171021 Reviewed by Eric Carlson. Pass a deviceID rather than a CaptureDevice across the process boundary. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-20 Alex Christensen Fix assertions in webProcessProxyFromConnection https://bugs.webkit.org/show_bug.cgi?id=171025 Reviewed by Brady Eidson. * UIProcess/WebProcessPool.cpp: (WebKit::webProcessProxyFromConnection): If we have a Connection, then we have a valid process attached to that connection, unless it's a Connection to a different type of child process. Calling ChildProcessProxy::connection on other web processes that are in State::Launching, then we get an assertion. Luckily, ChildProcessProxy::hasConnection was introduced in r210861 for this reason. 2017-04-20 Brent Fulgham [WK2][macOS] Allow iokit-get-properties for IOAudioControlValue https://bugs.webkit.org/show_bug.cgi?id=171020 Reviewed by Alexey Proskuryakov. * WebProcess/com.apple.WebProcess.sb.in: Add missing property name. 2017-04-19 Joseph Pecoraro Remove WebKitTestRunner code for enabling features that are already enabled by default https://bugs.webkit.org/show_bug.cgi?id=171033 Reviewed by Ryosuke Niwa. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-04-19 Youenn Fablet [Mac] Allow customizing H264 encoder https://bugs.webkit.org/show_bug.cgi?id=170829 Reviewed by Alex Christensen. * Configurations/FeatureDefines.xcconfig: * WebKit2.xcodeproj/project.pbxproj: 2017-04-19 Brady Eidson Add asynchronous equivalent of -[ webView:createWebViewWithConfiguration:...]. and https://bugs.webkit.org/show_bug.cgi?id=171018 Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPageAsync): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageAsync): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: 2017-04-19 Anders Carlsson Stop using deprecated APIs, part 3 https://bugs.webkit.org/show_bug.cgi?id=171003 rdar://problem/31589635 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Don't encode/decode status. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession): Hide the UI and report back. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Add new member. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Add new message. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): Always pass success in the old code path. Stop using the deprecated method. * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::cancelPaymentSession): Send a message to the UI process. * WebProcess/ApplePay/WebPaymentCoordinator.h: Add new member. 2017-04-19 Eric Carlson [MediaStream] Limit capture to one tab at a time https://bugs.webkit.org/show_bug.cgi?id=171009 Reviewed by Jon Lee. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): Deleted, not used. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Mute media streams on other pages. (WebKit::UserMediaProcessManager::willCreateMediaStream): Call willEnableMediaStreamInPage. * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMuted): If media streams in the page will be unmuted, call willEnableMediaStreamInPage so streams in other pages are muted first. 2017-04-19 Brady Eidson REGRESSION (r213168): An extra Web Content process is spun up on launch and is never closed. and https://bugs.webkit.org/show_bug.cgi?id=171002 Reviewed by Alex Christensen. The original change unnecessarily avoided using the initial warmed process if an explicit data store was set on the new WKWebView. Fixing that fixes the regression. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): 2017-04-19 Anders Carlsson Rename cancelPayment to cancelPaymentSession https://bugs.webkit.org/show_bug.cgi?id=171007 Reviewed by Tim Horton. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): (WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::didCancelPaymentSession): (WebKit::WebPaymentCoordinator::didCancelPayment): Deleted. * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: 2017-04-19 David Kilzer Stop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString() Reviewed by Brent Fulgham. * Platform/unix/EnvironmentUtilities.cpp: (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Switch from using strcpy() to strlcpy(). Also switch from using strstr() to strnstr(). * Platform/unix/EnvironmentUtilities.h: Switch to #pragma once. (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Export function for testing. * WebKit2.xcodeproj/project.pbxproj: (EnvironmentUtilitiesTest.h): Make header private for testing. 2017-04-19 Eric Carlson Provide a way for clients to unmute a media stream. https://bugs.webkit.org/show_bug.cgi?id=170855 Unreviewed, fix a typo missed in the review of r215420. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setPageMuted:]): 2017-04-19 Adrian Perez de Castro [GTK] WebKitAutocleanups.h regression in v2.16.1 release https://bugs.webkit.org/show_bug.cgi?id=170987 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitAutocleanups.h: Remove stray semicolon. 2017-04-18 Per Arne Vollan Dragging a few items over MiniBrowser has 0 in the red indicator. https://bugs.webkit.org/show_bug.cgi?id=170874 Reviewed by Tim Horton. When WebKit does not accept the drag items, the drag count badge should not be updated. Also, if WebKit changes the drag count badge, it should be restored to its original value when the drag exits. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::draggingEntered): (WebKit::WebViewImpl::draggingUpdated): (WebKit::WebViewImpl::draggingExited): 2017-04-18 Wenson Hsieh [WK2] Add infrastructure and unit tests for file uploads using data interaction https://bugs.webkit.org/show_bug.cgi?id=170903 Reviewed by Tim Horton. See Tools/ChangeLog for more details. Makes a small adjustment to _simulateDataInteractionUpdated: to return a BOOL indicating whether or not to allow the operation to proceed. This is necessary for testing scenarios where multiple files are being "data interacted" onto an element. See for more details about the change this patch is testing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateDataInteractionUpdated:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: 2017-04-18 Wenson Hsieh [WK2] Support DataTransfer::files() when performing a DHTML data interaction https://bugs.webkit.org/show_bug.cgi?id=170880 Reviewed by Tim Horton. See the WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformDragControllerAction): (WebKit::WebPageProxy::resetCurrentDragInformation): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag): * UIProcess/WebPageProxy.messages.in: Adds an IPC argument to DidPerformDragControllerAction specifying whether the page prevented the default behavior. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: Adds IPC plumbing for the new filenamesForDataInteraction Pasteboard codepath. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-04-18 John Wilander Resource Load Statistics: Check both origins and cookieHostNames for domain matches in data removal https://bugs.webkit.org/show_bug.cgi?id=170763 Reviewed by Alex Christensen. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Move semantics for topPrivatelyControlledDomains vector. (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Move semantics for prevalentResourceDomains vector. * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::hostIsInDomain): Static convenience function. (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain): Checks for matching cookieHostNames if types contains WebsiteDataType::Cookies. Also checks origins. * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Now makes use of the new function WebKit::WebsiteDataRecord::validForTopPrivatelyControlledDomain(). (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Move semantics for topPrivatelyControlledDomains vector. (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-04-18 Brent Fulgham [iOS][WK2] Prevent ephemeral files from being backed up https://bugs.webkit.org/show_bug.cgi?id=170963 Reviewed by Brady Eidson. Tell the OS to skip temporary data files when performing backups. * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: Added. (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Added. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Add stub for non-iOS platforms. * UIProcess/WebResourceLoadStatisticsStore.h: * WebKit2.xcodeproj/project.pbxproj: Add new file. 2017-04-18 Wenson Hsieh [WK2] Cannot select text on nytimes.com when the selection granularity is WKSelectionGranularityCharacter https://bugs.webkit.org/show_bug.cgi?id=170968 Reviewed by Dan Bernstein. Makes a small adjustment to textInteractionGesture:shouldBeginAtPoint:. When determining whether to allow the text interaction assistant to recognize at a given point, instead of depending on whether or not the hit node is the same as the assisted node, only enforce this restriction when editing an assisted node. Otherwise, default to allowing the selection gesture. Note that character granularity selection was working on most pages before, due to the fact that nodeAtPositionIsAssistedNode was true in many cases when there is no assisted node at all. This is because, in WebPage.mm, we compute the hit-tested node responding to click events to be null, and then set nodeAtPositionIsAssistedNode to be equal to hitNode == m_assistedNode, which ends up being true because both of these values are null. This allowed text selection to work in the simple case when selection granularity character is used, but not when the node containing the selected point actually does respond to click events, since the comparison returns false. New layout test: LayoutTests/editing/selection/character-granularity-select-text-with-click-handler.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): 2017-04-18 Keith Rollin Add additional information when logging URL disposition in WebLoaderStrategy::scheduleLoad https://bugs.webkit.org/show_bug.cgi?id=170813 Reviewed by Alex Christensen. There are a few logging statements in WebLoaderStrategy::scheduleLoad that report, for example, "URL will be loaded as data". These statements also log the address of the frame doing the loading and the identifier of the resource. For consistency with other logging and to make scripted analysis of the logs more robust, also include the pageID and frameID in the logging. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): 2017-04-18 Anders Carlsson Stop using deprecated APIs, part 2 https://bugs.webkit.org/show_bug.cgi?id=170965 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Remove the status member variable. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::status): New function to be used by older OSes. This will recreate a PKPaymentAuthorizationStatus given a ShippingContactUpdate. (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Stop using the deprecated API. 2017-04-18 Timothy Horton Force scroll view insets to be respected regardless of rubber-banding state https://bugs.webkit.org/show_bug.cgi?id=170937 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2017-04-18 Carlos Garcia Campos [GLIB] Define priorities also for async network IO tasks https://bugs.webkit.org/show_bug.cgi?id=170905 Reviewed by Žan Doberšek. * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::inputStreamReadReadyCallback): (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::outputStreamWriteReadyCallback): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection): (WebKit::NetworkDataTaskSoup::read): (WebKit::NetworkDataTaskSoup::requestNextPart): (WebKit::NetworkDataTaskSoup::writeDownload): (WebKit::NetworkDataTaskSoup::didFinishDownload): * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: (webkitURISchemeRequestReadCallback): (webkit_uri_scheme_request_finish): 2017-04-17 Timothy Horton Plumb all four obscured insets to WebCore, instead of just top/left https://bugs.webkit.org/show_bug.cgi?id=170913 Reviewed by Wenson Hsieh. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::obscuredInsets): (WebKit::operator==): (WebKit::VisibleContentRectUpdateInfo::obscuredInset): Deleted. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): (-[WKWebView _updateVisibleContentRects]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::restorePageState): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::restorePageState): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::restorePageState): (WebKit::WebPage::updateVisibleContentRects): Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization). 2017-04-17 Joseph Pecoraro Web Inspector: Doesn't show size of compressed content correctly https://bugs.webkit.org/show_bug.cgi?id=155112 Reviewed by Alex Christensen and Timothy Hatcher. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::sendResultForCacheEntry): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Include size information in network load metrics. 2017-04-17 Youenn Fablet com.apple.WebKit.Networking.Development crashed in com.apple.WebKit: WebKit::NetworkRTCProvider::resolvedName https://bugs.webkit.org/show_bug.cgi?id=170889 Reviewed by Alex Christensen. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::Resolver::~Resolver): Unschedule the host resolution in addition to cancelling it. Providing a test would need to stop the resolver between the time the resolver is created and gets data in the network process. Or we would need to change Resolver to be instantiated/tested on its own. * NetworkProcess/webrtc/NetworkRTCProvider.h: 2017-04-17 Brady Eidson Make WKHTTPCookieStore public. and https://bugs.webkit.org/show_bug.cgi?id=170920 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: (-[WKHTTPCookieStore getAllCookies:]): (-[WKHTTPCookieStore allCookies:]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore httpCookieStore]): (-[WKWebsiteDataStore _httpCookieStore]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * WebKit2.xcodeproj/project.pbxproj: 2017-04-17 Eric Carlson [MediaStream] Fix typo in UIDelegate::mediaCaptureStateDidChange https://bugs.webkit.org/show_bug.cgi?id=170911 Reviewed by Youenn Fablet. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): Fix typo. 2017-04-17 Keith Rollin Move and update WebLoaderStrategy logging statement https://bugs.webkit.org/show_bug.cgi?id=170140 Reviewed by Alex Christensen. WebLoaderStrategy::scheduleLoad has a logging statement that says, in part: "Resource has been queued for scheduling with the NetworkProcess". This statement is emitted after the ScheduleResourceLoad message has been successfully sent to the NetworkProcess. The logging statement was added at this location to indicate that the resource-load had been successfully handed off; it pairs a similar logging statement that is emitted if the sending of the ScheduleResourceLoad message fails. I think it would be better to move this logging statement before the ScheduleResourceLoad message is sent to the NetworkProcess (and change its wording to "Resource is being scheduled with the NetworkProcess"). The reason for this change is to help make sure that the sequence of logging statements is more deterministic. In the current form, the message "Resource has been queued for scheduling with the NetworkProcess" normally appears before any NetworkProcess logging statements that indicate that the resource-loading is continuing there, but in rare occasions the logging statements can be reversed. This change in the ordering of the statements has caused a problem in a script I've written that examines the resource-loading process and looks for errors. By ensuring that the WebLoaderStrategy statement always appears before the NetworkResourceLoader statement, the flow makes better sense and the script can be more robust. In making this change, we are probably not giving up any assurance that the ScheduleResourceLoad message has been sent to the NetworkResourceLoader. If the message is successfully sent, we'll see logging in the NetworkProcess. If the message has not been sent, we'll see WebLoaderStrategy logging an error. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): 2017-04-17 Anders Carlsson Stop using deprecated APIs, part 1 https://bugs.webkit.org/show_bug.cgi?id=170915 rdar://problem/31589635 Reviewed by Tim Horton. Stop using the PKPaymentRequestPaymentMethodUpdate initializer that takes a status, it's been deprecated and we always passed PKPaymentAuthorizationStatusSuccess anyway. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): 2017-04-17 Youenn Fablet Disable outdated WritableStream API https://bugs.webkit.org/show_bug.cgi?id=170749 Reviewed by Alex Christensen. Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by: - A STREAMS_API compilation flag. - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT. * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-04-17 Tim Horton Provide a viewport parameter to disable clipping to the safe area https://bugs.webkit.org/show_bug.cgi?id=170766 Reviewed by Beth Dakin. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::setClipToSafeArea): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::clipToSafeArea): * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didChangeClipToSafeArea): * WebProcess/WebCoreSupport/WebChromeClient.h: * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeClipToSafeArea): * UIProcess/mac/PageClientImpl.h: Forward clip-to-safe-area changes from ChromeClient to WKWebView. Update visible content rects when it changes, which will result in a call to updateFixedClippingView, as below. Keep track of the current state in the UI process. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _contentMayDrawInObscuredInsets]): Expose the current state of the clip-to-safe-area bit as SPI. * UIProcess/ios/WKContentView.mm: (-[WKContentView updateFixedClippingView:]): Disable fixed clipping when clip-to-safe-area is disabled. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): Push the viewport's clip-to-safe-area bit onto the main frame's FrameView. 2017-04-17 Dan Bernstein [Cocoa] Move isNullFunctionPointer down into WTF https://bugs.webkit.org/show_bug.cgi?id=170892 Reviewed by Sam Weinig. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Changed to use WTF::isNullFunctionPointer. (WebKit::isNullFunctionPointer): Deleted. 2017-04-17 Wenson Hsieh [WK2] Respect a new internal setting for defaulting to character selection granularity https://bugs.webkit.org/show_bug.cgi?id=170904 Reviewed by Dan Bernstein. Respect a new WebKitDebugDefaultSelectionGranularityCharacter user default by initializing WKWebViewConfiguration with WKSelectionGranularityCharacter, but only when linked on or after the first iOS to use WKSelectionGranularityCharacter by default. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-17 Eric Carlson Provide a way for clients to unmute a media stream. https://bugs.webkit.org/show_bug.cgi?id=170855 Reviewed by Jon Lee. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setPageMuted:]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-17 Jeremy Jones Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video. https://bugs.webkit.org/show_bug.cgi?id=170778 Reviewed by Tim Horton. setUseAVFoundationAudioCapture is moved from AVCaptureDeviceManager to RealtimeMediaSourceCenterMac. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): 2017-04-15 Keith Rollin Include resource size in some existing logging https://bugs.webkit.org/show_bug.cgi?id=170866 Reviewed by Alex Christensen. In order to correlate resource load times with resource size, we log when the resource is starting to be loaded and when the resource is finished loading. In NetworkResourceLoader::didReceiveResponse, we also log the expected resource length. However, we can only log the length if it is provided in Content-Length, which is not always the case. If it's not provided, we end up logging "length = -1". To make up for this, change NetworkResourceLoader::didFinishLoading and WebResourceLoader:: didFinishLoading to log the length once we know it. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): * NetworkProcess/NetworkResourceLoader.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveData): (WebKit::WebResourceLoader::didFinishResourceLoad): * WebProcess/Network/WebResourceLoader.h: 2017-04-15 Wenson Hsieh [WK2] Support data interaction of files into file inputs https://bugs.webkit.org/show_bug.cgi?id=170803 Reviewed by Tim Horton. Implements remaining support for performing data interaction onto file inputs. There are two main changes at this layer: plumbing the number of files in the pasteboard to the web process, and pulling the implementation of createSandboxExtensionsIfNeeded out of Mac-specific WebViewImpl::createSandboxExtensionsIfNeeded and into WebPageProxy::createSandboxExtensionsIfNeeded. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Relax special-casing of encoding and decoding filenames to be PLATFORM(COCOA) rather than PLATFORM(MAC). * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getNumberOfFiles): More boilerplate plumbing to deliver the number of files in the pasteboard to the web process. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded): Deleted. Move the logic in WebViewImpl::createSandboxExtensionsIfNeeded over to WebPageProxy::createSandboxExtensionsIfNeeded. * UIProcess/WebPageProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getNumberOfFiles): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-14 Mark Lam Update architectures in xcconfig files. https://bugs.webkit.org/show_bug.cgi?id=170867 Reviewed by Joseph Pecoraro. * Configurations/FeatureDefines.xcconfig: 2017-04-14 Wenson Hsieh [WK2] Support Icon creation from file URLs on iOS https://bugs.webkit.org/show_bug.cgi?id=170809 Reviewed by Tim Horton. Refactors file icon generation logic to support showing an Icon representing the content at a list of file paths on iOS. Pulls out logic in WKFileUploadPanel responsible for generating the thumbnail image for a file input into separate helpers in WebIconUtilities, and then uses these utilities in both WKFileUploadPanel and WebChromeClientIOS. * Shared/ios/WebIconUtilities.h: Added. * Shared/ios/WebIconUtilities.mm: Added. (WebKit::squareCropRectForSize): (WebKit::squareImage): (WebKit::thumbnailSizedImageForImage): (WebKit::fallbackIconForFile): (WebKit::iconForImageFile): (WebKit::iconForVideoFile): (WebKit::iconForFile): Add logic for generating thumbnail icons, moved from WKFileUploadPanel.mm. * UIProcess/ios/forms/WKFileUploadPanel.mm: (squareCropRectForSize): Deleted. (squareImage): Deleted. (thumbnailSizedImageForImage): Deleted. (fallbackIconForFile): Deleted. (iconForImageFile): Deleted. (iconForVideoFile): Deleted. (iconForFile): Deleted. Remove logic for generating thumbnail icons. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::loadIconForFiles): (WebKit::WebChromeClient::createIconForFiles): Rather than call Icon::createIconForFiles directly, loadIconForFiles now consults ChromeClient::createIconForFiles instead. On other platforms, this just turns around and calls Icon::createIconForFiles, but on iOS, we use the utilities introduced in WebIconUtilities to generate a file icon. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::createIconForFiles): 2017-04-14 Brady Eidson Fix basic WKURLSchemeHandler bugs. and https://bugs.webkit.org/show_bug.cgi?id=170862 Reviewed by Andy Estes. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/WebURLSchemeHandlerTask.cpp: (WebKit::WebURLSchemeHandlerTask::didReceiveResponse): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): (WebKit::WebLoaderStrategy::remove): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::startNewTask): (WebKit::WebURLSchemeHandlerProxy::taskDidComplete): (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp: (WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy): (WebKit::WebURLSchemeHandlerTaskProxy::stopLoading): (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse): (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData): (WebKit::WebURLSchemeHandlerTaskProxy::didComplete): (WebKit::WebURLSchemeHandlerTaskProxy::hasLoader): * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h: (WebKit::WebURLSchemeHandlerTaskProxy::identifier): 2017-04-14 Jer Noble [MediaSource] Push capabilities across process boundary during UIProcess capture. https://bugs.webkit.org/show_bug.cgi?id=170814 Reviewed by Eric Carlson. Make a new synchronous getter for capabilities(), moderated by only requesting the capabilities() cross-process the first time called. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::capabilities): (WebKit::UserMediaCaptureManagerProxy::supportedConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setCapabilities): (WebKit::UserMediaCaptureManager::capabilities): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-13 Dan Bernstein [Cocoa] Allow clients to specify in _WKProcessPoolConfiguration additional directory sandbox extensions https://bugs.webkit.org/show_bug.cgi?id=170387 Reviewed by Sam Weinig. Test: TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm Added an additionalReadAccessAllowedURLs property to _WKProcessPoolConfiguration. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Encode the new additionalSandboxExtensionHandles member. (WebKit::WebProcessCreationParameters::decode): Decode it. * Shared/WebProcessCreationParameters.h: Added additionalSandboxExtensionHandles member. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): Copy new m_additionalReadAccessAllowedPaths member. * UIProcess/API/APIProcessPoolConfiguration.h: Added m_additionalReadAccessAllowedPaths member and accessor functions. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declared new additionalReadAccessAllowedURLs property whose value is an array of URLs to which the Web Content process will be given read access. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): New getter that returns an array of file URLs from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths(). (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): New setter that checks that the given URLs are file URLs and populates the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths with their paths. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Populate the new m_resolvedPaths.additionalWebProcessSandboxExtensionPaths with resolved paths from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths. (WebKit::WebProcessPool::createNewWebProcess): Populate the WebProcessCreationParameters’s additionalSandboxExtensionHandles member with read-only sandbox extensions created from the resolved paths. * UIProcess/WebProcessPool.h: Added additionalWebProcessSandboxExtensionPaths member to the Paths struct. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Consume the additional sandbox extensions. 2017-04-13 Alex Christensen Fix CMake build https://bugs.webkit.org/show_bug.cgi?id=170815 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): 2017-04-12 Dan Bernstein [Mac] Future-proof .xcconfig files https://bugs.webkit.org/show_bug.cgi?id=170802 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: * Configurations/Version.xcconfig: 2017-04-12 Brady Eidson QuotaExceededError when saving to localStorage in private mode. https://bugs.webkit.org/show_bug.cgi?id=157010 Reviewed by Alex Christensen. * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::~StorageAreaMap): * WebProcess/Storage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace): (WebKit::StorageNamespaceImpl::storageArea): (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): (WebKit::StorageNamespaceImpl::copy): * WebProcess/Storage/StorageNamespaceImpl.h: * WebProcess/Storage/WebStorageNamespaceProvider.cpp: (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): * WebProcess/Storage/WebStorageNamespaceProvider.h: 2017-04-12 Yusuke Suzuki Unreviewed, fix build failure on Ubuntu LTS GTK bot https://bugs.webkit.org/show_bug.cgi?id=170781 * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): 2017-04-12 Eric Carlson [MediaStream] rename -[WKWebView _stopMediaCapture] https://bugs.webkit.org/show_bug.cgi?id=170791 Reviewed by Youenn Fablet. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _muteMediaCapture]): (-[WKWebView _stopMediaCapture]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-12 Ryan Haddad Unreviewed build fix. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): 2017-04-12 Jer Noble [WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options. https://bugs.webkit.org/show_bug.cgi?id=170790 Reviewed by Alex Christensen. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCreate): (WKContextConfigurationCreateWithLegacyOptions): * UIProcess/API/C/WKContextConfigurationRef.h: 2017-04-12 Jer Noble [WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happening in UIProcess. https://bugs.webkit.org/show_bug.cgi?id=170781 Reviewed by Alex Christensen. Simultaneously, allow clients to configure whether capturing will occur in the UIProcess through _WKProcessPoolConfiguration. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationShouldCaptureAudioInUIProcess): (WKContextConfigurationSetShouldCaptureAudioInUIProcess): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration shouldCaptureAudioInUIProcess]): (-[_WKProcessPoolConfiguration setShouldCaptureAudioInUIProcess:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): 2017-04-12 Keith Rollin Add some missing NetworkResourceLoader logging https://bugs.webkit.org/show_bug.cgi?id=170139 Reviewed by Alex Christensen. Once execution enters the lambda in NetworkResourceLoader::retrieveCacheEntry, there is little indication of which exit point was taken. If flow enters into startNetworkLoad, we'll get some logging from that function, but not from the others. Add some logging so that we know what the result was from looking up the resource in the cache. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): 2017-04-12 Anders Carlsson Tweak WebCore::setMetadataURL function https://bugs.webkit.org/show_bug.cgi?id=170786 Reviewed by Beth Dakin. Update for WebCore changes. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): 2017-04-12 Brent Fulgham [WK2][Mac] Stop allowing access to disk arbitration process https://bugs.webkit.org/show_bug.cgi?id=170517 Reviewed by Alex Christensen. * WebProcess/com.apple.WebProcess.sb.in: 2017-04-12 Beth Dakin 32-bit build fix. * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): 2017-04-12 Beth Dakin More 32-bit build fix. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): (-[WKView _addMediaPlaybackControlsView:]): 2017-04-12 Beth Dakin Another 32 bit build fix. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::mediaPlaybackControlsView): 2017-04-12 Alex Christensen Stop using didReceiveDataArray callback on El Capitan https://bugs.webkit.org/show_bug.cgi?id=170780 Reviewed by Brady Eidson. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::supportsDataArray): Deleted. (WebKit::NetworkLoad::didReceiveDataArray): Deleted. * NetworkProcess/NetworkLoad.h: 2017-04-12 Beth Dakin Speculative build fix. * UIProcess/API/Cocoa/WKViewPrivate.h: 2017-04-12 Beth Dakin Attempted build fix. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-12 Beth Dakin Adopt AVKit name change from AVFunctionBar* to AVTouchBar* https://bugs.webkit.org/show_bug.cgi?id=170693 -and corresponding- rdar://problem/31230018 Reviewed by Sam Weinig. Since the new names only apply to some versions of macOS, this patch uses typedefs for the older OS’s. SO: AVFunctionBarScrubber is now AVTouchBarScrubber AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption And the protocol AVFunctionBarPlaybackControlsControlling is now AVTouchBarPlaybackControlsControlling Use the new name. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): (-[WKView _addMediaPlaybackControlsView:]): * UIProcess/Cocoa/WebViewImpl.h: Soft links and allocations cannot use the typedefs. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::mediaPlaybackControlsView): (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-12 Eric Carlson [MediaStream] Audio source in UI process not identified as capture source https://bugs.webkit.org/show_bug.cgi?id=170776 Reviewed by Youenn Fablet. * WebProcess/cocoa/UserMediaCaptureManager.cpp: Override isCaptureSource. 2017-04-12 Andrew Gold Allow iOS to toggle webRTCAPI legacy flag. https://bugs.webkit.org/show_bug.cgi?id=170735 Reviewed by Eric Carlson. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _webRTCLegacyAPIEnabled]): (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-04-12 Yusuke Suzuki Unreviewed, build fix for GTK port after r215262 https://bugs.webkit.org/show_bug.cgi?id=170758 * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didRead): 2017-04-12 Yusuke Suzuki [WTF] Introduce Thread class and use RefPtr and align Windows Threading implementation semantics to Pthread one https://bugs.webkit.org/show_bug.cgi?id=170502 Reviewed by Mark Lam. Mechanical change. Use Thread:: APIs. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::readSyncInThread): * Platform/IPC/Connection.cpp: (IPC::Connection::processIncomingMessage): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): * UIProcess/linux/MemoryPressureMonitor.cpp: (WebKit::MemoryPressureMonitor::MemoryPressureMonitor): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-04-10 Antti Koivisto Cache small media resources in disk cache https://bugs.webkit.org/show_bug.cgi?id=170676 Reviewed by Andreas Kling. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeRetrieveDecision): Allow retrieving media resources. (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange): (WebKit::NetworkCache::expectedTotalResourceSize): (WebKit::NetworkCache::makeStoreDecision): Store media resource if we can figure out its total size and it is less than 5MB (and it is cacheable by the usual rules). 2017-04-12 Alex Christensen Modernize vector adoption https://bugs.webkit.org/show_bug.cgi?id=170758 Reviewed by Geoffrey Garen. * NetworkProcess/capture/NetworkCaptureEvent.cpp: (WebKit::NetworkCapture::JSONCoder::decode): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::bufferForType): 2017-04-12 Zan Dobersek Unreviewed GTK+ debug build fix. Drop an unused debug-only member variable in the CompositingRunLoop class. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: 2017-04-11 Zan Dobersek [GTK] Use the DisplayRefreshMonitor facilities https://bugs.webkit.org/show_bug.cgi?id=170599 Reviewed by Carlos Garcia Campos. ThreadedCompositor gains a DisplayRefreshMonitor member that it can use to better coordinate display refresh callbacks on the main thread. Still, because currently the GTK+ port doesn't have a reliable way of notifying the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used in order to keep the updates at a reasonable rate. When the timer is fired, the ThreadedCompositor decides how to proceed based on state changes that might have occurred during composition or whether there's any display refresh callbacks that require handling on the main thread. CompositingRunLoop now stores its state in an atomic variable that's then inspected whenever a new update is scheduled or completed. When scheduled, if there's no update in progress, a new update is requested through the timer. If there's already an update in progress, a new update is marked as pending after the current one completes. In that case, when the update is completed, a new update is requested through the timer. ThreadedDisplayRefreshMonitor is used to coordinate updates between the main and the composition thread whenever the CoordinatedGraphics state demands it, or whenever there are clients registered to that monitor that require an update (e.g. a requestAnimationFrame() callback). After the update on the composition thread is finished, and the DisplayRefreshMonitor object requires an update, a callback at the same priority as the layer flush timer is scheduled on the main thread. In that callback we handle any clients registered for this DisplayRefreshMonitor before proceeding to handle any changes to the CoordinatedGraphics scene. In case the DisplayRefreshMonitor clients or the layer flushes already queued up any changes to the state, we immediately ask the ThreadedCompositor for an update. * PlatformGTK.cmake: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::updateViewport): (WebKit::CoordinatedGraphicsScene::commitSceneState): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): (WebKit::CompositingRunLoop::isActive): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::updateCompleted): (WebKit::CompositingRunLoop::updateTimerFired): (WebKit::CompositingRunLoop::isCurrent): (WebKit::CompositingRunLoop::startUpdateTimer): Deleted. (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: (): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::invalidate): (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): (WebKit::ThreadedCompositor::updateViewport): (WebKit::ThreadedCompositor::scheduleDisplayImmediately): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::displayRefreshMonitor): (WebKit::ThreadedCompositor::renderNextFrameIfNeeded): (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): (WebKit::ThreadedCompositor::performFrameCompletion): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added. (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::invalidate): (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor): * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/LayerTreeHost.h: (WebKit::LayerTreeHost::createDisplayRefreshMonitor): 2017-04-11 Alex Christensen Modernize and clean up code https://bugs.webkit.org/show_bug.cgi?id=170752 Reviewed by Sam Weinig. * NetworkProcess/NetworkResourceLoader.h: * Shared/WebPreferencesStore.h: * UIProcess/API/APIHitTestResult.cpp: (API::HitTestResult::create): * UIProcess/API/APIHitTestResult.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesCreate): (WKPreferencesCreateWithIdentifier): (WKPreferencesCreateCopy): * UIProcess/Authentication/AuthenticationChallengeProxy.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults): (WebKit::WebPreferences::copy): * UIProcess/WebPreferences.h: * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::requestCheckingOfString): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addTextCheckingRequest): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::rangeForBlockAtPoint): (WebKit::WebPage::expandedRangeFromHandle): (WebKit::WebPage::contractedRangeFromHandle): (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): (WebKit::WebPage::changeBlockSelection): (WebKit::WebPage::rangeForGranularityAtPoint): (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): 2017-04-11 Dean Jackson Disable outdated WritableStream API https://bugs.webkit.org/show_bug.cgi?id=170749 Reviewed by Tim Horton. The API we implement is no longer accurate. Disable it until we are compatible with the new specification * Configurations/FeatureDefines.xcconfig: 2017-04-11 Dan Bernstein [Cocoa] WebKit unnecessarily soft-links CorePrediction https://bugs.webkit.org/show_bug.cgi?id=170644 Reviewed by Sam Weinig. * Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES. * Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where available. On macOS, use weak linking, because CorePrediction is not available in the Base System. * Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with #if HAVE(CORE_PREDICTION). (WebKit::isNullFunctionPointer): Added this helper. (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced dlopen()-based runtime check with a null check. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if HAVE(CORE_PREDICTION). * Platform/spi/Cocoa/CorePredictionSPI.h: Added. * UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION). * WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition. 2017-04-11 David Quesada Add SPI for handling geolocation authorization requests https://bugs.webkit.org/show_bug.cgi?id=170362 rdar://problem/17508627 Reviewed by Alex Christensen. Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page requests geolocation access. To support testing this change, make it possible to override the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable object on the process pool that implements a protocol for providing location updates for web views in the process pool. If the client doesn't provide this object, WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1 WebGeolocationCoreLocationProvider and conforms to the new protocol. * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/WebGeolocationPosition.h: (WebKit::WebGeolocationPosition::create): * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate_b): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _coreLocationProvider]): (-[WKProcessPool _setCoreLocationProvider:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. * UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added. (WebKit::if): (-[_WKGeolocationPosition dealloc]): (-[_WKGeolocationPosition _apiObject]): * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. (WebKit::wrapper): * UIProcess/ios/WKGeolocationProviderIOS.mm: (kit): (-[WKGeolocationProviderIOS initWithProcessPool:]): (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): (-[WKGeolocationProviderIOS positionChanged:]): (-[WKLegacyCoreLocationProvider setListener:]): (-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]): (-[WKLegacyCoreLocationProvider start]): (-[WKLegacyCoreLocationProvider stop]): (-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]): (-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]): (-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]): (-[WKLegacyCoreLocationProvider positionChanged:]): (-[WKLegacyCoreLocationProvider errorOccurred:]): (-[WKLegacyCoreLocationProvider resetGeolocation]): Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS expects. * WebKit2.xcodeproj/project.pbxproj: 2017-04-11 Eric Carlson [MediaStream] Set correct audio session category when capturing audio https://bugs.webkit.org/show_bug.cgi?id=170736 Reviewed by Jer Noble. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): 2017-04-11 Youenn Fablet Activate WebRTC data channel tests for WK1 https://bugs.webkit.org/show_bug.cgi?id=170710 Reviewed by Eric Carlson. * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure networking is not done in the Web process. 2017-04-11 Chris Fleizach AX: PDF plugin needs to support PDF-DOM Mode https://bugs.webkit.org/show_bug.cgi?id=170589 Reviewed by Tim Horton. Provide access to DOM objects with PDF document. This mean: 1) Support a different set of attributes for WKPDFPluginAccessibilityObject. WKPDFPluginAccessibilityObject is now a group instead of forwarding attribute calls to the pdf layer. 2) Connect the focused UI element to the active annotation if possible. 3) Mark the PDF associated nodes with an attribute so they can be identified later so their correct parent can be found. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (-[WKPDFPluginAccessibilityObject pdfLayerController]): (-[WKPDFPluginAccessibilityObject setPdfLayerController:]): (-[WKPDFPluginAccessibilityObject convertRectToScreenSpace:]): (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]): (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]): (-[WKPDFPluginAccessibilityObject accessibilityActionNames]): (-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]): (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]): (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]): (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]): (WebKit::PDFPlugin::convertFromRootViewToPDFView): (WebKit::PDFPlugin::convertFromPDFViewToScreen): (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest): (WebKit::PDFPlugin::axObjectCache): (WebKit::PDFPlugin::accessibilityShadowPluginParentForElement): * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::attach): * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::accessibilityShadowPluginParentForElement): (WebKit::Plugin::pluginHandlesContentOffsetForAccessibilityHitTest): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::accessibilityShadowPluginParentForElement): * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2017-04-11 Adrian Perez de Castro [GTK] Attach popup menu to web view widget https://bugs.webkit.org/show_bug.cgi?id=145866 Use gtk_menu_attach_to_widget() to let GTK+ know that popup menus belong to a certain web view. This improves the positioning choices that the toolkit can do, and solves a long-standing issue that caused long popup menus to hang outside of the available display area under Wayland. Based on a patch by Jonas Ådahl . Reviewed by Carlos Garcia Campos. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): 2017-04-10 Alex Christensen Revert r215217 https://bugs.webkit.org/show_bug.cgi?id=170703 * Configurations/FeatureDefines.xcconfig: 2017-04-10 Alex Christensen Continue enabling WebRTC https://bugs.webkit.org/show_bug.cgi?id=170703 Reviewed by Youenn Fablet. * Configurations/FeatureDefines.xcconfig: 2017-04-10 Alex Christensen REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions https://bugs.webkit.org/show_bug.cgi?id=170707 Reviewed by Tim Horton. We fix this by sending the UserContentController with the WebPageCreationParameters instead of in a IPC message immediately following creation. By the time the WebPage receives its second message, it has already started loading the first main resource. I also changed all instances of calling ChildProcessProxy::connection() to send a message in favor of calling ChildProcessProxy::send, which does the same thing except if a child process has not started, it will put the message in a queue and send it when the process is finished launching. This was necessary because the UserContentController is now connected to the process sooner, so there were some API tests that would try to send messages between initiating a process launch and finishing a process launch, and this change preserves the existing behavior in those cases. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection): (WebKit::DatabaseProcessProxy::didFinishLaunching): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::cancel): (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): (WebKit::DownloadProxy::willSendRequest): (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::addUserContentWorldUse): (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses): (WebKit::WebUserContentControllerProxy::addUserScript): (WebKit::WebUserContentControllerProxy::removeUserScript): (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::addUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers): (WebKit::WebUserContentControllerProxy::addContentExtension): (WebKit::WebUserContentControllerProxy::removeContentExtension): (WebKit::WebUserContentControllerProxy::removeAllContentExtensions): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired): (WebKit::VisitedLinkStore::sendTable): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): (WebKit::WebPageProxy::creationParameters): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addWebUserContentControllerProxy): * UIProcess/WebProcessProxy.h: * WebProcess/UserContent/WebUserContentController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_backgroundCPULimit): 2017-04-10 Alex Christensen Add API to get available content extension identifiers in a WKContentExtensionStore https://bugs.webkit.org/show_bug.cgi?id=170093 Reviewed by Geoffrey Garen. * UIProcess/API/APIContentExtensionStore.cpp: (API::constructedPathPrefix): (API::constructedPathFilter): (API::constructedPath): (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): * UIProcess/API/APIContentExtensionStore.h: * UIProcess/API/Cocoa/WKContentExtensionStore.h: * UIProcess/API/Cocoa/WKContentExtensionStore.mm: (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]): (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]): (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]): (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): 2017-04-10 Jeremy Jones Add CoreAudioCaptureSource. https://bugs.webkit.org/show_bug.cgi?id=170112 rdar://problem/30293338 Reviewed by Tim Horton. Add UseAVFoundationAudioCapture preference to switch back from the new default of CoreAudio. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetUseAVFoundationAudioCapture): (WKPreferencesGetUseAVFoundationAudioCapture): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-10 Brent Fulgham [WK2][macOS] Block access to Apple Events before launch. https://bugs.webkit.org/show_bug.cgi?id=170626 Reviewed by Alexey Proskuryakov. Clear the environment of the AppleEvent server name before initializing AppKit so we never bother connecting. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (main): 2017-04-10 Adrian Perez de Castro [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup() https://bugs.webkit.org/show_bug.cgi?id=170553 Reviewed by Michael Catanzaro. Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when building with GTK+ 3.22 or newer. This allows the Wayland GTK+ backend to properly position popup menus, and also avoids using functions which were deprecated starting at that GTK+ release. * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::WebContextMenuProxyGtk::show): Use gtk_menu_popup_at_pointer() as there is always a pointer event that can be passed to it. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_popup_at_rect(), using the coordinates of the control passed as reference rectangle. Some conditional code is needed because with newer GTK+ versions a relative offset instead of an absolute position is needed. 2017-04-10 Adrian Perez de Castro [GTK] Opening a popup menu does not pre-select the active item https://bugs.webkit.org/show_bug.cgi?id=170680 Reviewed by Michael Catanzaro. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_shell_select_item() to ensure that the active item appears selected right after popping up the menu. 2017-04-10 Carlos Garcia Campos [GTK] Enable DOM timer throttling and CSS animations suspension https://bugs.webkit.org/show_bug.cgi?id=170669 Reviewed by Žan Doberšek. * Shared/WebPreferencesDefinitions.h: 2017-04-10 Chris Dumez Drop Timer::startOneShot() overload taking a double https://bugs.webkit.org/show_bug.cgi?id=170659 Reviewed by Yusuke Suzuki. Drop Timer::startOneShot() overload taking a double as people should use Seconds type now. * NetworkProcess/PingLoad.h: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::startTimeout): * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog): (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): (IPC::Connection::terminateSoon): * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::setMinimumLifetime): * PluginProcess/PluginProcess.h: * Shared/ChildProcess.cpp: (WebKit::ChildProcess::ChildProcess): * Shared/ChildProcess.h: (WebKit::ChildProcess::setTerminationTimeout): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::startUpdateTimer): * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::initializeTimers): * Shared/WebProcessCreationParameters.h: * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm: (API::SharedJSContext::ensureContext): * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::shutDownProcess): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didChangeIsLoading): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog): * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw): * UIProcess/Gamepad/UIGamepadProvider.cpp: * UIProcess/Plugins/PluginProcessProxy.cpp: * UIProcess/ProcessThrottler.cpp: * UIProcess/ResponsivenessTimer.cpp: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::DragGesture::begin): * UIProcess/mac/WebInspectorProxyMac.mm: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::scheduleAnimation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): * WebProcess/WebProcess.cpp: 2017-04-09 Wenson Hsieh [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes https://bugs.webkit.org/show_bug.cgi?id=170658 Reviewed by Tim Horton. Introduces doAfterPositionInformationUpdate:forRequest:, which WKContentView can use internally to perform an action requiring InteractionInformationAtPosition asynchronously. See below for additional details. New API unit test: DataInteractionTests.UnresponsivePageDoesNotHangUI. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView _actionForLongPress]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): If current position information satisfies the request, then perform the given block immediately; otherwise, we save the block and request as a pair in a list of pending position information handlers, and then make a new request to the web process for position information if the currently outgoing request does not already satisfy the given request. (-[WKContentView ensurePositionInformationIsUpToDate:]): Fire all asynchronous position information handlers that are satisfied by the incoming position information. (-[WKContentView requestAsynchronousPositionInformationUpdate:]): (-[WKContentView _currentPositionInformationIsValidForRequest:]): (-[WKContentView _hasValidOutstandingPositionInformationRequest:]): Pulled out common logic for managing InteractionInformationRequests into separate helper methods. (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]): (-[WKContentView gestureRecognizerShouldBegin:]): Refactored to use ensurePositionInformationIsUpToDate:. There is no behavior change here, but it makes sure that this particular request will also any valid pending position information handlers. (-[WKContentView _positionInformationDidChange:]): Fire all asynchronous position information handlers that are satisfied by the incoming position information. (-[WKContentView pointIsInDataInteractionContent:]): Deleted. We should no longer use this method, since it makes a synchronous request to the web process -- see positionInformationMayStartDataInteraction. 2017-04-09 Chris Dumez Drop Timer::startRepeating() overload taking a double https://bugs.webkit.org/show_bug.cgi?id=170656 Reviewed by Yusuke Suzuki. Drop Timer::startRepeating() overload taking a double as people should use Seconds type now. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::initializeTimers): * UIProcess/Cocoa/ViewGestureController.cpp: * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: * UIProcess/PerActivityStateCPUUsageSampler.cpp: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::Timer::start): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): 2017-04-09 Jon Lee [WK2][iOS] Add CoreMedia entitlement for WebProcess https://bugs.webkit.org/show_bug.cgi?id=170623 rdar://problem/30020073 Reviewed by Youenn Fablet. * Configurations/WebContent-iOS.entitlements: Update entitlement to an array of strings instead of bool. 2017-04-09 Chris Dumez Start dropping Timer API dealing with double https://bugs.webkit.org/show_bug.cgi?id=170649 Reviewed by Yusuke Suzuki. Start dropping Timer API dealing with double as people should use Seconds now. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::scheduleFailure): * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::resume): * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::destroy): (WebKit::PluginControllerProxy::startPaintTimer): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseScheduleUpdateActivityState): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::setViewExposedRect): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::addVisitedLinkHash): * UIProcess/WebProcessPool.cpp: (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter): * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::ZoomGesture::scaleChanged): * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::menuUnmappedCallback): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::addToInvalidationQueue): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::deliverDataToPlugin): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pendingURLRequestsTimerFired): (WebKit::PluginView::loadURL): * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::scheduleDisplay): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateIsInWindow): (WebKit::WebPage::addPluginView): (WebKit::WebPage::setMayStartMediaWhenInWindow): (WebKit::WebPage::didFinishLoad): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): 2017-04-08 Chris Dumez Drop std::chrono support from Timer class https://bugs.webkit.org/show_bug.cgi?id=170645 Reviewed by Sam Weinig. Drop std::chrono support from Timer class now that we prefer using Seconds type. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::Throttle::Throttle): (WebKit::NetworkLoad::didReceiveResponseNetworkSession): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::loadThrottleLatency): * NetworkProcess/NetworkProcessCreationParameters.cpp: * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: * NetworkProcess/cache/NetworkCacheStatistics.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::store): * Shared/CacheModel.cpp: (WebKit::calculateMemoryCacheSizes): * Shared/CacheModel.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): * WebProcess/Plugins/PluginView.cpp: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately): (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): * WebProcess/WebProcess.cpp: (WebKit::m_resourceLoadStatisticsStore): (WebKit::WebProcess::setCacheModel): 2017-04-08 Chris Dumez Unreviewed attempt to fix GTK build after r215138. * UIProcess/API/gtk/WebKitUIClient.cpp: 2017-04-08 Youenn Fablet WebRTC tests gardening https://bugs.webkit.org/show_bug.cgi?id=170508 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2017-04-08 Chris Dumez Timer's nextFireInterval() / repeatInterval() should return Seconds https://bugs.webkit.org/show_bug.cgi?id=170639 Reviewed by Simon Fraser. Timer's nextFireInterval() / repeatInterval() should return Seconds, not double. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::layerVolatilityTimerFired): (WebKit::WebPage::markLayersVolatile): 2017-04-07 Alex Christensen Modernize WebPage.h https://bugs.webkit.org/show_bug.cgi?id=170633 Reviewed by Joseph Pecoraro. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): * UIProcess/API/C/WKPage.cpp: (WebKit::RunBeforeUnloadConfirmPanelResultListener::create): (WebKit::RunJavaScriptAlertResultListener::create): (WebKit::RunJavaScriptConfirmResultListener::create): (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener): (WebKit::RunJavaScriptPromptResultListener::create): (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener): (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::loadStringImpl): (WebKit::WebPage::loadData): (WebKit::WebPage::scaledSnapshotWithOptions): (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction): (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension): * WebProcess/WebPage/WebPage.h: 2017-04-07 Alex Christensen Use audit_token_t instead of pid_t for checking sandbox of other processes https://bugs.webkit.org/show_bug.cgi?id=170616 Reviewed by Daniel Bates. pid's can be reused, so it's theoretically unsafe to use the pid of another process to check whether it's sandboxed. Use an audit_token_t instead to be more sure that we are not mistakenly checking a new process that has reused the old process's pid. For the current process, though, we have no xpc_connection_t to the process because we are the process. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeSandbox): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::isClientSandboxed): * Shared/mac/SandboxUtilities.h: * Shared/mac/SandboxUtilities.mm: (WebKit::currentProcessIsSandboxed): (WebKit::connectedProcessIsSandboxed): (WebKit::processIsSandboxed): Deleted. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::platformIsBeingDebugged): * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::shouldUsePlugin): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformGetLaunchOptions): 2017-04-07 Brent Fulgham [WK2][iOS] Add CoreMedia entitlement for WebProcess https://bugs.webkit.org/show_bug.cgi?id=170623 Reviewed by Youenn Fablet. Add new "com.apple.tcc.delegated-services" entitlement to allow CoreMedia to work properly in WebRTC. * Configurations/WebContent-iOS.entitlements: 2017-04-07 Alex Christensen Private browsing sessions should not look in keychain for client certificates https://bugs.webkit.org/show_bug.cgi?id=170618 Reviewed by Dan Bernstein. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::configurationForSessionID): 2017-04-07 Chris Dumez We should log how much CPU a background process was using when killing it due to CPU limiting https://bugs.webkit.org/show_bug.cgi?id=170619 Reviewed by Andreas Kling. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateBackgroundCPUMonitorState): 2017-04-07 Wenson Hsieh Missing conversion from window to content coordinates when adjusting unobscured content rects for input view https://bugs.webkit.org/show_bug.cgi?id=170603 Reviewed by Simon Fraser. Refactors -[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:] to convert the input view bounds into content coordinates instead of using the zoom scale to adjust the height of inputViewBounds. Covered by the existing LayoutTest, fixed-element-on-bottom-with-keyboard.html. * UIProcess/ios/WKContentView.mm: (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]): 2017-04-07 Michael Catanzaro [GTK] Various build errors when plugin support is disabled https://bugs.webkit.org/show_bug.cgi?id=170015 Reviewed by Carlos Garcia Campos. * PluginProcess/unix/PluginControllerProxyUnix.cpp: * UIProcess/API/gtk/WebKitWebsiteData.cpp: (recordContainsSupportedDataTypes): (toWebKitWebsiteDataTypes): * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: (toWebsiteDataTypes): 2017-04-07 John Wilander WebSocket streams should have network usage attributed to correct process https://bugs.webkit.org/show_bug.cgi?id=170322 Reviewed by Alex Christensen. Changes here are due to the added WebCore::SourceApplicationAuditToken parameter in WebCore::SocketStreamHandleImpl::create(). WebKit::NetworkSocketStream takes it and passes it on. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createSocketStream): * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): * NetworkProcess/NetworkSocketStream.h: 2017-04-07 Michael Catanzaro Unreviewed, fix missing return value warning * UIProcess/WebProcessProxy.cpp: (WebKit::diagnosticLoggingKeyForSimulatedCrashReason): 2017-04-07 Carlos Garcia Campos [GTK] Update the priorities used in glib main loop sources https://bugs.webkit.org/show_bug.cgi?id=170457 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor): * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::createWaylandLoopSource): * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::DrawingAreaImpl): 2017-04-06 Alex Christensen Add WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h https://bugs.webkit.org/show_bug.cgi?id=170533 Reviewed by Daniel Bates. * Shared/API/Cocoa/WebKit.h: In r213696 I added two public headers. All public headers in WebKit are included with #import 2017-04-06 Joseph Pecoraro Web Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics https://bugs.webkit.org/show_bug.cgi?id=170575 Rubber-stamped by Brian Burg. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): Deleted. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: m_networkLoad is a wrapper around `this` as the client, so we would infinite loop here. 2017-04-06 Commit Queue Unreviewed, rolling out r214973. https://bugs.webkit.org/show_bug.cgi?id=170578 Causes issues in Safari (Requested by bradee-oh on #webkit). Reverted changeset: "Refactor so WebsiteDataStores always have a StorageManager." https://bugs.webkit.org/show_bug.cgi?id=170521 http://trac.webkit.org/changeset/214973 2017-04-06 Ryan Haddad Unreviewed, rolling out r215046. This change broke internal builds. Reverted changeset: "WebRTC tests gardening" https://bugs.webkit.org/show_bug.cgi?id=170508 http://trac.webkit.org/changeset/215046 2017-04-06 Joseph Pecoraro Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend https://bugs.webkit.org/show_bug.cgi?id=170525 Reviewed by Youenn Fablet. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Only collect extra metrics if the WebProcess this load is for has enabled collecting extra metrics. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled): * WebProcess/Network/WebLoaderStrategy.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: New bool state toggled through the loader policy. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: (WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Default handling for network loads is to not include extra data. Thread client messages back from the NetworkLoads / SpeculativeLoads to check the NetworkConnectionToWebProcess state on whether or not we should collect extra metrics. 2017-04-06 Joseph Pecoraro Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar https://bugs.webkit.org/show_bug.cgi?id=16531 Reviewed by Timothy Hatcher. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Include a complete list of the request headers sent for this load. There may be headers that WebCore did not know about and developer tools should be informed of. 2017-04-06 Anders Carlsson OptionSet options need to be powers of two https://bugs.webkit.org/show_bug.cgi?id=170565 Reviewed by Chris Dumez. Change Cache::Option to be powers of two. * NetworkProcess/cache/NetworkCache.h: 2017-04-06 Youenn Fablet WebRTC tests gardening https://bugs.webkit.org/show_bug.cgi?id=170508 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2017-04-06 Antti Koivisto Implement testing mode for disk cache https://bugs.webkit.org/show_bug.cgi?id=170547 Reviewed by Andreas Kling. Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness. Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk. This is enabled by the existing WKContextUseTestingNetworkSession SPI. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::initialize): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::shrinkIfNeeded): * NetworkProcess/cache/NetworkCacheStorage.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): 2017-04-06 Chris Dumez [WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting https://bugs.webkit.org/show_bug.cgi?id=170524 Reviewed by Eric Carlson. Add C private API to toggle invisibleAutoplayNotPermitted setting. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInvisibleMediaAutoplayPermitted): (WKPreferencesGetInvisibleMediaAutoplayPermitted): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2017-04-06 Adrian Perez de Castro [GTK] Fix build with MEDIA_CAPTURE enabled https://bugs.webkit.org/show_bug.cgi?id=170539 Reviewed by Carlos Garcia Campos. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp: (webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone. 2017-04-05 Brent Fulgham [WK2][iOS] Remove access to features not present on iOS https://bugs.webkit.org/show_bug.cgi?id=170531 Reviewed by Alexey Proskuryakov. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-04-05 Eric Carlson [MediaStream] Host application should be able to mute and unmute media streams https://bugs.webkit.org/show_bug.cgi?id=170519 Reviewed by Youenn Fablet. * UIProcess/API/C/WKPage.cpp: (WKPageGetMediaState): Support new media stream state flags. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Ditto. * UIProcess/Cocoa/UIDelegate.mm: Ditto. 2017-04-05 Brady Eidson Refactor so WebsiteDataStores always have a StorageManager. https://bugs.webkit.org/show_bug.cgi?id=170521 Reviewed by Geoff Garen. This basically involves teaching StorageManager how to work without a LocalStorageDatabaseTracker, since there will never be ephemeral bits on disk to track. * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded): (WebKit::StorageManager::createEphemeral): (WebKit::StorageManager::StorageManager): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::getLocalStorageOriginDetails): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): * UIProcess/Storage/StorageManager.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): 2017-04-05 Brent Fulgham [WK2][iOS] Add entitlements to enable audio/video capture in WebProcess https://bugs.webkit.org/show_bug.cgi?id=170507 Reviewed by Youenn Fablet. Add two entitlements that are required to access audio/video capture on iOS. * Configurations/WebContent-iOS.entitlements: 2017-04-05 Carlos Garcia Campos Show a log message when an invalid message is received in non cocoa ports https://bugs.webkit.org/show_bug.cgi?id=170506 Reviewed by Michael Catanzaro. We just crash, but without knowing the details about the message it's impossible to debug. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::didReceiveInvalidMessage): 2017-04-04 Carlos Garcia Campos Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore https://bugs.webkit.org/show_bug.cgi?id=156974 Reviewed by Sam Weinig. WebErrors are not only used by the frame loader client in the web process, but also by the network process. So, move them to Shared make most of the implementation cross-platform. * CMakeLists.txt: Add new files to compilation. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::download): Use WebErrors directly instead of platform methods that are no longer needed. (WebKit::NetworkDataTaskSoup::writeDownloadCallback): Ditto. (WebKit::NetworkDataTaskSoup::didFinishDownload): Ditto. (WebKit::NetworkDataTaskSoup::didFail): Ditto. * PlatformGTK.cmake: Add new files to compilation and remove DownloadSoupErrorsGtk.cpp * PlatformMac.cmake: * Shared/API/APIError.cpp: Add error domains used by glib based ports. (API::Error::webKitNetworkErrorDomain): (API::Error::webKitPolicyErrorDomain): (API::Error::webKitPluginErrorDomain): (API::Error::webKitDownloadErrorDomain): (API::Error::webKitPrintErrorDomain): * Shared/API/APIError.h: * Shared/Cocoa/WebErrorsCocoa.mm: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h. (WebKit::createNSError): (WebKit::cancelledError): (WebKit::fileDoesNotExistError): * Shared/WebErrors.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp. (WebKit::blockedError): (WebKit::blockedByContentBlockerError): (WebKit::cannotShowURLError): (WebKit::interruptedForPolicyChangeError): (WebKit::blockedByContentFilterError): (WebKit::cannotShowMIMETypeError): (WebKit::pluginWillHandleLoadError): (WebKit::internalError): * Shared/WebErrors.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h. * Shared/glib/WebErrorsGlib.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp. (WebKit::cancelledError): (WebKit::fileDoesNotExistError): * Shared/gtk/WebErrorsGtk.cpp: Copied from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp. (WebKit::printError): (WebKit::printerNotFoundError): (WebKit::invalidPageRangeToPrint): * Shared/soup/WebErrorsSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp. (WebKit::downloadNetworkError): (WebKit::downloadCancelledByUserError): (WebKit::downloadDestinationError): * UIProcess/API/gtk/WebKitDownload.cpp: * UIProcess/API/gtk/WebKitError.cpp: (webkit_network_error_quark): (webkit_policy_error_quark): (webkit_plugin_error_quark): (webkit_download_error_quark): (webkit_print_error_quark): * UIProcess/API/gtk/WebKitPrivate.cpp: (toWebKitError): (toWebCoreError): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Removed. * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: 2017-04-04 Youenn Fablet [Mac] Add back web audio support for getUserMedia MediaStreamTrack https://bugs.webkit.org/show_bug.cgi?id=170482 Reviewed by Eric Carlson. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setStorage): 2017-04-04 Tim Horton [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps https://bugs.webkit.org/show_bug.cgi?id=165801 Reviewed by Wenson Hsieh. Previously, when doing an incremental find that wrapped, we would say that it did not, leading NSTextFinder to not provide its usual wrapping UI, and other clients of the NSTextFinderClient protocol to get confused by the lack of wrapping. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFindString): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/API/APIFindClient.h: (API::FindClient::didFindString): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageFindClient): * UIProcess/Cocoa/FindClient.h: * UIProcess/Cocoa/FindClient.mm: (WebKit::FindClient::didFindString): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::findString): * WebProcess/WebPage/FindController.h: Plumb DidWrap from FindController's call to findString back through the DidFindString message. * UIProcess/mac/WKTextFinderClient.mm: (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]): (-[WKTextFinderClient didFindStringMatchesWithRects:]): Deleted. Make use of the new DidWrap information to stop lying to NSTextFinder about whether a wrap actually occurred. 2017-04-03 Wenson Hsieh Data interaction should register type identifiers in order of priority https://bugs.webkit.org/show_bug.cgi?id=170428 Reviewed by Tim Horton. Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/API/Cocoa/WKWebView.mm: 2017-04-03 Joseph Pecoraro Remove no longer needed forward declarations https://bugs.webkit.org/show_bug.cgi?id=170415 Reviewed by Dan Bernstein. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 2017-04-03 Anders Carlsson Tweak ApplePaySession API https://bugs.webkit.org/show_bug.cgi?id=170409 rdar://problem/31405459 Reviewed by Tim Horton. Update for WebCore changes. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-04-03 Carlos Garcia Campos [SOUP] URI Fragment is lost after redirect https://bugs.webkit.org/show_bug.cgi?id=170058 Reviewed by Michael Catanzaro. In case of redirection check if the current request has a fragment identifier and apply it to the redirection only when it doesn't have a fragment identifier yet. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::createRequest): (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): * NetworkProcess/soup/NetworkDataTaskSoup.h: 2017-04-03 Antti Koivisto Mutex may be freed too late in NetworkCache::Storage::traverse https://bugs.webkit.org/show_bug.cgi?id=170400 Reviewed by Carlos Garcia Campos and Andreas Kling. Fix a race. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::traverse): Ensure the mutex is not accessed after we dispatch to the main thread. The main thread call deletes the owning TraverseOperation. 2017-04-01 Dan Bernstein [iOS] label should be specified using plural rules https://bugs.webkit.org/show_bug.cgi?id=170388 Reviewed by Alexey Proskuryakov. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]): Instead of calling -_displayStringForPhotos:videos:, use +[NSString localizedStringWithFormat:] with the new format string "%lu photo(s) and %lu video(s)" for which there are plural rules. (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted. 2017-04-01 Dan Bernstein [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid https://bugs.webkit.org/show_bug.cgi?id=170385 Reviewed by Tim Horton. * Configurations/WebKit.xcconfig: When WebKit is relocatable, tell the linker that it’s not going to be in the shared cache, even if its install name implies that it might be. 2017-03-31 Simon Fraser Remove a logging statement left in by mistake. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::restoreViewState): 2017-03-31 Wenson Hsieh Address post-review feedback after r214692 https://bugs.webkit.org/show_bug.cgi?id=170328 Reviewed by Dan Bernstein. Clearing the selection when UIKit calls into WKContentView to set its selected text range to nil is a rule that should be applied when using a text interaction assistant, not just when using character granularity for selecting text. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setSelectedTextRange:]): 2017-03-31 Wenson Hsieh [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity https://bugs.webkit.org/show_bug.cgi?id=170328 Reviewed by Tim Horton. When UIKit clears the selection while in text interaction mode, it notifies its document view (i.e., the WKContentView) by setting its selected text range to nil. When character granularity selection is enabled, use this as a cue to notify the web process that the selection is being cleared out. -setSelectedTextRange: is a noop in the general case because the web process acts as the source of truth for what the selection currently consists of, and notifies the UI process and UIKit via WKTextPosition and WKTextRange. However, in the case of character granularity selections, tapping away to clear the selection is handled by UIKit's text gesture recognizer cluster, which then informs the document (via -setSelectedTextRange:) that the selection should be cleared out. Adds a new Layout test: editing/selection/character-granularity-selected-range-after-dismissing-selection.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setSelectedTextRange:]): 2017-03-31 Wenson Hsieh [WK2] Tapping editable text inside of a range selection no longer changes the selection to a caret https://bugs.webkit.org/show_bug.cgi?id=170327 Reviewed by Tim Horton. Currently, we're forcing all text interaction gestures to duck in lieu of data interaction gestures when we should only be doing so for gestures that begin a loupe. This prevents other gestures, such as single taps, from changing the selection when they should be allowed to. Hooks into new UIKit SPI to make this tweak. Introduces a new LayoutTest: editing/selection/caret-after-tap-in-editable-selection.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView pointIsInAssistedNode:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): 2017-03-31 Tim Horton Mail can get stuck underneath FindController::findStringMatches after searching in a long message https://bugs.webkit.org/show_bug.cgi?id=170326 Reviewed by Simon Fraser. * UIProcess/mac/WKTextFinderClient.mm: (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]): Cap the number of find matches at 1000, the same maximum that Safari uses. 2017-03-31 Brady Eidson Clean up the "StorageType" enum. https://bugs.webkit.org/show_bug.cgi?id=170349 Reviewed by Tim Horton. * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::dispatchStorageEvent): (WebKit::StorageAreaMap::dispatchSessionStorageEvent): (WebKit::StorageAreaMap::dispatchLocalStorageEvent): * WebProcess/Storage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::createSessionStorageNamespace): (WebKit::StorageNamespaceImpl::createLocalStorageNamespace): (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace): 2017-03-31 Tim Horton Remove bundle checks for attachmentElementEnabled https://bugs.webkit.org/show_bug.cgi?id=170329 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): Remove bundle checks. 2017-03-29 Anders Carlsson Adopt PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication https://bugs.webkit.org/show_bug.cgi?id=170257 rdar://problem/31289764 Reviewed by Beth Dakin. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-03-31 Csaba Osztrogonác Mac cmake buildfix after r214403 https://bugs.webkit.org/show_bug.cgi?id=170346 Unreviewed speculative buildfix. * UIProcess/API/Cocoa/WKWebView.mm: 2017-03-31 Brady Eidson Remove erroneously committed changes from r214078 Unreviewed. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): Whoops! 2017-03-31 Carlos Garcia Campos Modern media controls should never be enabled in non cocoa ports https://bugs.webkit.org/show_bug.cgi?id=170338 Reviewed by Michael Catanzaro. It's currently enabled, because it uses the default value for all other runtime features, but modern media controls are not a cross-platform feature. I think this is why media/video-click-dblckick-standalone.html started to fail in GTK+ port after r214426. I can't reprouduce the failure locally, so I can't confirm it, though. * Shared/WebPreferencesDefinitions.h: 2017-03-30 Zan Dobersek Unreviewed GTK+ build fix. List WebCore before JavaScriptCore as the two WebKit2 dependency libraries to avoid WTF directiories being listed for inclusion before WebCore directories at compile-time. * CMakeLists.txt: 2017-03-30 Megan Gardner Allow for extended color in snapshots https://bugs.webkit.org/show_bug.cgi?id=170314 WKImageCreateCGImage should support WideGamut in WebKit2 on macOS Reviewed by Simon Fraser. Piping options through snapshots to allow for wide gamut support. * Shared/API/c/WKImage.h: * Shared/API/c/WKSharedAPICast.h: (WebKit::snapshotOptionsFromImageOptions): * Shared/ImageOptions.h: (WebKit::snapshotOptionsToImageOptions): * Shared/WebImage.cpp: (WebKit::WebImage::create): 2017-03-30 Sam Weinig Expose the WKView SPI, _prepareForMoveToWindow:withCompletionHandler as WKWebView SPI https://bugs.webkit.org/show_bug.cgi?id=170315 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _prepareForMoveToWindow:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Copy SPI to WKWebView. Remove 'with' prefix to match conventions. 2017-03-30 Wenson Hsieh [WK2] Touches should not cancel when showing a custom action sheet while data interaction is active https://bugs.webkit.org/show_bug.cgi?id=170291 Reviewed by Tim Horton. Currently, when presenting a custom popover, we will cancel all touches in the application. This makes data interaction when a custom popover is shown impossible -- to address this, we should only cancel touches when the view is not an active data interaction source. New API test: DataInteractionTests.CustomActionSheetPopover. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]): 2017-03-30 Youenn Fablet NetworkConnectionToWebProcess should stop web sockets when being destroyed https://bugs.webkit.org/show_bug.cgi?id=170286 Reviewed by Brady Eidson. * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already. * NetworkProcess/NetworkSocketStream.h: 2017-03-29 Tim Horton Remove unused PageClient::removeNavigationGestureSnapshot https://bugs.webkit.org/show_bug.cgi?id=170249 Reviewed by Beth Dakin. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted. 2017-03-29 Antti Koivisto Increment the last stable network cache version on Mac https://bugs.webkit.org/show_bug.cgi?id=170248 Reviewed by Chris Dumez. Bump to the latest release. * NetworkProcess/cache/NetworkCacheStorage.h: 2017-03-28 Timothy Horton Stop overriding scroll view inset defaults https://bugs.webkit.org/show_bug.cgi?id=170221 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): The default behavior is sufficient for us. 2017-03-28 Timothy Horton Safari crashes when attempting to close tab that is displaying PDF https://bugs.webkit.org/show_bug.cgi?id=170201 Reviewed by Wenson Hsieh. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _doAfterNextStablePresentationUpdate:]): Adopt BlockPtr to fix a leak. (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): dispatch_async in the doAfterNextPresentationUpdate callback; since this recursively calls itself, in cases where doAfterNextPresentationUpdate returns synchronously (e.g. if the Web Process is missing), we would recurse infinitely. 2017-03-27 Youenn Fablet Remove WebPage::m_shouldDoICECandidateFiltering https://bugs.webkit.org/show_bug.cgi?id=170150 Reviewed by Sam Weinig. It is redundant with RTCController::m_shouldFilterICECandidates. Manually tested on webrtc test samples. This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt. Additional testing will be added as a follow-up patch. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::disableICECandidateFiltering): (WebKit::WebPage::enableICECandidateFiltering): * WebProcess/WebPage/WebPage.h: 2017-03-27 Wenson Hsieh [WK2] UIKit assertion when rotating device after dismissing popover https://bugs.webkit.org/show_bug.cgi?id=170159 Reviewed by Tim Horton. Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center. * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet dealloc]): (-[WKActionSheet _cleanup]): (-[WKActionSheet doneWithSheet:]): 2017-03-27 Andy Estes [iOS] Suppress page count recalc when setting a snapshot paper rect https://bugs.webkit.org/show_bug.cgi?id=170156 Reviewed by Tim Horton. When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper rect, which triggers UIKit to ask for the page count again while we're in the middle of printing, putting us in a bad state. Suppress page count recalc while setting the new paper rect, since we know this will not cause it to change. * UIProcess/_WKWebViewPrintFormatter.mm: (-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set _suppressPageCountRecalc to YES before updating the paper rect. (-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if _suppressPageCountRecalc is NO. * UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc. 2017-03-26 Wenson Hsieh [WK2] Callout Bar should be dismissed during data interaction https://bugs.webkit.org/show_bug.cgi?id=170109 Reviewed by Tim Horton. Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2. * Platform/spi/ios/UIKitSPI.h: 2017-03-27 Keith Rollin Update NetworkResourceLoader logging statement https://bugs.webkit.org/show_bug.cgi?id=170126 Reviewed by Alex Christensen. NetworkResourceLoader contains a logging statement that prints, in part: "start: Retrieving resource from cache". This is misleading, since it's not necessarily the case that the resource will be loaded from the cache. What is actually happening at the point where that is logged is that the cache is being checked for the resource. It still remains to be seen if the resource will be found in it. To address this, change the logging to say "start: Checking cache for resource". * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): 2017-03-27 Joseph Pecoraro Web Inspector: Saving files should not suggest the top level directory https://bugs.webkit.org/show_bug.cgi?id=170085 Reviewed by Matt Baker. * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (WebKit::RemoteWebInspectorProxy::platformSave): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformSave): Don't set panel.directoryURL unless we have a good suggestion. 2017-03-27 Yongjun Zhang Add delegate method to let an WebKit client provide a custom image preview controller. https://bugs.webkit.org/show_bug.cgi?id=170076 rdar://problem/31153051 Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image has alternated URL or custom image info. Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided preview view controller. Otherwise, use the default WKImagePreviewViewController. 2017-03-27 Anders Carlsson Fix uses of deprecated API https://bugs.webkit.org/show_bug.cgi?id=170138 rdar://problem/28882449 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKContactFields): (WebKit::toPKAddressField): (WebKit::toPKPaymentRequest): Don't use deprecated APIs. (WebKit::toNSError): Don't try to insert nil in a dictionary. 2017-03-27 Alex Christensen Make WebSockets work in network process https://bugs.webkit.org/show_bug.cgi?id=169930 Reviewed by Youenn Fablet. This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous messages to a NetworkSocketStream in the NetworkProcess. WebKit1 uses a SocketStreamHandleImpl still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back to the WebProcess. WebSocketStream's implementation of SocketStreamHandle::platformSend is special because it stores the completion handler in a map and asynchronously reports to the caller whether it succeeded or not. If the network processes crashes before the completion handlers are called, then they are called indicating failure and an error is reported, but that never happens, right? * CMakeLists.txt: * DerivedSources.make: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::createSocketStream): (WebKit::NetworkConnectionToWebProcess::destroySocketStream): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSocketStream.cpp: Added. (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): (WebKit::NetworkSocketStream::sendData): (WebKit::NetworkSocketStream::close): (WebKit::NetworkSocketStream::didOpenSocketStream): (WebKit::NetworkSocketStream::didCloseSocketStream): (WebKit::NetworkSocketStream::didReceiveSocketStreamData): (WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData): (WebKit::NetworkSocketStream::didUpdateBufferedAmount): (WebKit::NetworkSocketStream::didFailSocketStream): (WebKit::NetworkSocketStream::messageSenderConnection): (WebKit::NetworkSocketStream::messageSenderDestinationID): * NetworkProcess/NetworkSocketStream.h: Added. * NetworkProcess/NetworkSocketStream.messages.in: Added. * UIProcess/API/C/WKContext.cpp: (WKContextSetAllowsAnySSLCertificateForWebSocketTesting): (WKContextTerminateNetworkProcess): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::sendSyncToNetworkingProcess): (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket): (WebKit::WebProcessPool::terminateNetworkProcess): * UIProcess/WebProcessPool.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/Network/WebSocketProvider.cpp: (WebKit::WebSocketProvider::createSocketStreamHandle): * WebProcess/Network/WebSocketStream.cpp: Added. (WebKit::globalWebSocketStreamMap): (WebKit::WebSocketStream::streamWithIdentifier): (WebKit::WebSocketStream::networkProcessCrashed): (WebKit::WebSocketStream::create): (WebKit::WebSocketStream::WebSocketStream): (WebKit::WebSocketStream::~WebSocketStream): (WebKit::WebSocketStream::messageSenderConnection): (WebKit::WebSocketStream::messageSenderDestinationID): (WebKit::WebSocketStream::platformSend): (WebKit::WebSocketStream::didSendData): (WebKit::WebSocketStream::platformClose): (WebKit::WebSocketStream::bufferedAmount): (WebKit::WebSocketStream::didOpenSocketStream): (WebKit::WebSocketStream::didCloseSocketStream): (WebKit::WebSocketStream::didReceiveSocketStreamData): (WebKit::WebSocketStream::didFailToReceiveSocketStreamData): (WebKit::WebSocketStream::didUpdateBufferedAmount): (WebKit::WebSocketStream::didFailSocketStream): * WebProcess/Network/WebSocketStream.h: Added. * WebProcess/Network/WebSocketStream.messages.in: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): 2017-03-27 Adrian Perez de Castro [GTK] NetscapePluginX11::m_windowID is unused/unneeded https://bugs.webkit.org/show_bug.cgi?id=170115 Reviewed by Michael Catanzaro. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::NetscapePluginX11::NetscapePluginX11): Remove the unneeded NetscapePluginX11::m_windowID member. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h: Remove the unneeded NetscapePluginX11::m_windowID member. 2017-03-25 Andy Estes [iOS] Use snapshotting instead of printing to draw single-page PDFs https://bugs.webkit.org/show_bug.cgi?id=170103 Reviewed by Tim Horton. * WebProcess/WebPage/WebPage.cpp: (WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here. (WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the WebImage's graphics context. (WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to paintSnapshotAtSize(), and returned the context's data. * WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize(). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page, returned a page count of 1 and created a PDF using pdfSnapshotAtSize(). 2017-03-25 John Wilander Re-enable the web process' keychain access to fix client certificate authentication https://bugs.webkit.org/show_bug.cgi?id=170074 Reviewed by Brent Fulgham. This is a follow-up patch to https://trac.webkit.org/changeset/214389/webkit since according to Alexey Proskuryakov, resource loading has always required identical sandbox rules in WebContent and Networking processes. * WebProcess/com.apple.WebProcess.sb.in: Reverted remaining change from https://trac.webkit.org/changeset/208702/webkit and https://trac.webkit.org/changeset/208707/webkit. 2017-03-24 Wenson Hsieh [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop https://bugs.webkit.org/show_bug.cgi?id=169168 Reviewed by Tim Horton. Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the DragData sent over to the web process, where they update DragController's view of the allowed destination actions. Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad, though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate any compatibility risk. * Shared/API/Cocoa/WKDragDestinationAction.h: Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Serialize DragData's destination actions when sending DragData over IPC. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate). * UIProcess/API/mac/WKView.mm: (-[WKView _web_dragDestinationActionForDraggingInfo:]): For WKView, allow all types of drag destination actions. * UIProcess/Cocoa/VersionChecks.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::draggingEntered): (WebKit::WebViewImpl::draggingUpdated): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::actionMaskForDrag): * WebProcess/WebCoreSupport/WebDragClient.h: 2017-03-24 Simon Fraser [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates https://bugs.webkit.org/show_bug.cgi?id=170091 rdar://problem/30682584 Reviewed by Tim Horton. [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this. So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known- good time. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 2017-03-24 John Wilander Re-enable the network process' keychain access to fix client certificate authentication https://bugs.webkit.org/show_bug.cgi?id=170074 Reviewed by Brent Fulgham. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Reverted remaining change from https://trac.webkit.org/changeset/208702/webkit and https://trac.webkit.org/changeset/208707/webkit. 2017-03-24 Eric Carlson [MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score https://bugs.webkit.org/show_bug.cgi?id=170056 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): When short-circuiting the user prompt because the page is already authorized, return the first audio and/or video device because so the page gets the one with the best fitness distance. 2017-03-24 Simon Fraser Make UI-side compositing on macOS a bit more usable https://bugs.webkit.org/show_bug.cgi?id=170073 Reviewed by Tim Horton. Mach port as layer contents doesn't work on macOS, so don't use it there. Also remove two assertions that hit with UI-side compositing in MiniBrowser. * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::createFence): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::requestScroll): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): 2017-03-24 Alex Christensen Fix assertions after r214358. https://bugs.webkit.org/show_bug.cgi?id=169167 * UIProcess/API/APIContentExtensionStore.cpp: (API::ContentExtensionStore::compileContentExtension): AtomicString::init must be called for the first time from the main thread. We were calling it for the first time from a non-main thread sometimes. Call it from the main thread before initiating compiling on another thread. == Rolled over to ChangeLog-2017-03-23 ==