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/InjectedB