2017-05-03 John Wilander Resource Load Statistics: Remove all statistics for modifiedSince website data removals https://bugs.webkit.org/show_bug.cgi?id=171584 Reviewed by Brent Fulgham. These are all test infrastructure changes. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours): * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours): * UIProcess/WebResourceLoadStatisticsManager.h: 2017-05-03 Timothy Horton Maintain interaction information imageURL as a URL, not a string https://bugs.webkit.org/show_bug.cgi?id=171639 Reviewed by Sam Weinig. * Shared/ios/InteractionInformationAtPosition.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dataForPreviewItemController:atPosition:type:]): (-[WKContentView _previewItemController:commitPreview:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2017-05-03 Commit Queue Unreviewed, rolling out r216160 and r216161. https://bugs.webkit.org/show_bug.cgi?id=171640 These changes broke the iOS build. (Requested by mlewis13 on #webkit). Reverted changesets: "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216160 "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216161 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Unreviewed build fix. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::clearUserMediaState): * UIProcess/WebPageProxy.h: 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. * UIProcess/API/C/WKPage.cpp: (WKPageSetMediaCaptureEnabled): New. (WKPageGetMediaCaptureEnabled): New. (WKPageClearUserMediaState): Deleted, unused. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMediaCaptureEnabled:]): New. (-[WKWebView _mediaCaptureEnabled]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS and iOS. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the rejection timer. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): Call invalidatePendingRequests. (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all pending requests. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and schedule the timer if there are any others pending. (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't prompt the user if capture is disabled. (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current page on iOS. (WebKit::UserMediaProcessManager::setCaptureEnabled): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaCaptureEnabled): (WebKit::WebPageProxy::clearUserMediaState): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::mediaCaptureEnabled): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending requests. (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request. (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopMediaCapture): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-05-03 Tim Horton Maintain interaction information URL as a URL, not a string https://bugs.webkit.org/show_bug.cgi?id=171623 Reviewed by Simon Fraser. * Shared/ios/InteractionInformationAtPosition.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showAttachmentSheet]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _dataForPreviewItemController:atPosition:type:]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]): (-[WKPDFView actionSheetAssistant:performAction:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2017-05-03 Simon Fraser Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying https://bugs.webkit.org/show_bug.cgi?id=171619 Also fixes webkit.org/b/170153 and webkit.org/b/170195 Reviewed by Tim Horton. In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that the handler would always run, since we couldn't reliably test the phase of the current transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to checking the transaction phase on newer iOS versions. If we're too late for the current transaction we still need to dispatch_async() to get into the next one. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 2017-05-03 Chris Dumez REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated https://bugs.webkit.org/show_bug.cgi?id=171616 Reviewed by Brady Eidson. Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called after r216129. WebPageProxy::processDidCrash() already takes care of calling resetStateAfterProcessExited(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::terminateProcess): 2017-05-03 Brady Eidson Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge. https://bugs.webkit.org/show_bug.cgi?id=171607 Reviewed by Andy Estes. To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now. * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead. 2017-05-03 Chris Dumez [WK2] Extend processDidCrash delegate to let the client know the reason for the crash https://bugs.webkit.org/show_bug.cgi?id=171565 Reviewed by Sam Weinig. Extend processDidCrash delegate to let the client know the reason for the crash. This is needed by some clients to distinguish actual crashes from terminations due to resource limits. * Shared/ProcessCrashReason.h: Added. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::processDidCrash): * UIProcess/API/C/WKAPICast.h: (WebKit::toAPI): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/C/WKProcessCrashReason.h: Added. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::processDidCrash): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::requestTermination): (WebKit::diagnosticLoggingKeyForTerminationReason): (WebKit::toProcessCrashReason): (WebKit::WebProcessProxy::terminateProcessDueToResourceLimits): (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: 2017-05-03 Carlos Garcia Campos [GTK] Add GTK+ implementation of WebAutomationSession https://bugs.webkit.org/show_bug.cgi?id=171431 Reviewed by Michael Catanzaro. Add platform dependent methods for GTK+ to synthesize events. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added. (WebKit::modifiersToEventState): (WebKit::mouseButtonToGdkButton): (WebKit::doMouseEvent): (WebKit::doMotionEvent): (WebKit::WebAutomationSession::platformSimulateMouseInteraction): (WebKit::doKeyStrokeEvent): (WebKit::keyCodeForVirtualKey): (WebKit::WebAutomationSession::platformSimulateKeyStroke): (WebKit::WebAutomationSession::platformSimulateKeySequence): (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): 2017-05-03 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release. * gtk/NEWS: Add release notes for 2.17.1. 2017-05-03 Carlos Garcia Campos [Soup] Add request headers to network load metrics https://bugs.webkit.org/show_bug.cgi?id=171545 Reviewed by Sergio Villar Senin. This will make the headers to appear in the web inspector. Fixes: http/tests/inspector/network/resource-request-headers.html * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didGetHeaders): 2017-05-02 Simon Fraser Dynamically added position:fixed element is in the wrong place https://bugs.webkit.org/show_bug.cgi?id=170280 rdar://problem/31374008 Reviewed by Tim Horton. Layers for position:fixed elements have their positions reconciled after scrolls via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(), which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer. This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position, but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change, but there was no signal to the UI process to restore the layer's pre-scrolled position. Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA geometry updates in the web process always send new positions to the UI process. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::setPosition): 2017-05-02 Gwang Yoon Hwang [GTK] Drop coordinated surfaces from the compositing thread as soon as possible https://bugs.webkit.org/show_bug.cgi?id=171544 Reviewed by Žan Doberšek. Released coordinated surface from the main thread didn't be freed until next commit message because the deletion of coordinated surfaces is considered as a part of scene state. We need to release corresponding surfaces whenever the compositing coordinator drops update atlases to reduce memory usages. No new tests, only an optimization. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: Remove atlasesToRemove from the GraphicsState. it is not a commit state anymore. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of released update atlases to the compositing thread right after cleaning up deactivated update atlases. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::clearPendingStateChanges): (WebKit::CompositingCoordinator::removeUpdateAtlas): (WebKit::CompositingCoordinator::releaseAtlases): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 2017-05-02 Timothy Horton Inform clients when viewport-fit state changes, so they can recompute insets https://bugs.webkit.org/show_bug.cgi?id=171573 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didChangeAvoidsUnsafeArea]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets themselves, we need to let them know when the current state of viewport-fit changes so that they can recompute the insets. 2017-05-02 Gwang Yoon Hwang [GTK] Recycle textures while handling tiles https://bugs.webkit.org/show_bug.cgi?id=171541 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::swapBuffers): Whenever we create new tiles or delete tiles, CoordGfx creates and deletes textures accordingly. We should avoid this kind of heavy operations whenever possible. This patch modifies to use the texture pool to reduce texture allocations. Also this patch reduces number of resetting textures, which is also expensive operation. * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: (WebKit::WebCoordinatedSurface::copyToTexture): Modified to pass BitmapTexture as a reference. * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: (WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto. 2017-05-02 David Kilzer Stop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm Reviewed by Chris Dumez. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::registerWithStateDumper): Switch from strcpy() to strlcpy(), removing comment in the process. 2017-05-02 Andrew Gold MediaDevices is not enabled for MobileSafari https://bugs.webkit.org/show_bug.cgi?id=171433 Reviewed by Youenn Fablet. Added the Cocoa API for toggling this feature and removed API for toggling MediaStreamEnabled since it will always be on. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _mediaDevicesEnabled]): (-[WKPreferences _setMediaDevicesEnabled:]): (-[WKPreferences _mediaStreamEnabled]): Deleted. (-[WKPreferences _setMediaStreamEnabled:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-05-02 Andy Estes REGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a touch event arrives after a WebPageProxy has been invalidated https://bugs.webkit.org/show_bug.cgi?id=171539 Reviewed by Tim Horton. Prior to r213036, the layer tree transaction at last touch start was tracked by WebPageProxy::handleTouchEventSynchronously(), which would ask the drawing area proxy for its most recent transaction ID after ensuring that the WebPageProxy was valid. r213036 moved the tracking up to -[WKContentView _webTouchEventsRecognized:], but failed to check if _page was valid before asking for its drawing area proxy's last transaction ID; the drawing area proxy is set to null on WebPageProxy invalidation. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _webTouchEventsRecognized:]): Added an early return if _page isn't valid. 2017-05-02 Carlos Garcia Campos Web Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContext for all platforms https://bugs.webkit.org/show_bug.cgi?id=171107 Reviewed by Brian Burg. The implementation is actually cross-platform, so it could be moved from WebAutomationSessionMac.mm to WebAutomationSession.cpp and simply return a NotImplemented error for iOS. This will allow to use these methods in other platforms. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted. (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted. 2017-05-01 Chris Dumez Use RELEASE_LOG_ERROR() to do process termination logging https://bugs.webkit.org/show_bug.cgi?id=171521 Reviewed by Andreas Kling. Use RELEASE_LOG_ERROR() to do process termination logging instead of RELEASE_LOG(). This makes the issue more visible in Console. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): 2017-05-01 Brady Eidson Only try to get sandbox extension handle for IndexedDB directory if it is set. rdar://problem/31925828 and https://bugs.webkit.org/show_bug.cgi?id=171522 Reviewed by Andy Estes. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): 2017-05-01 Timothy Horton Expose viewport-fit instead of clip-to-safe-area https://bugs.webkit.org/show_bug.cgi?id=171503 Reviewed by Simon Fraser. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::unobscuredSafeAreaInsets): (WebKit::operator==): Plumb the safe area insets down from the UI process to the Web Content process inside the visible content rect update, alongside the obscured insets. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::avoidsUnsafeArea): (WebKit::RemoteLayerTreeTransaction::setAvoidsUnsafeArea): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): (WebKit::RemoteLayerTreeTransaction::description): * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): (WebKit::PageClientImpl::didChangeClipToSafeArea): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): * UIProcess/mac/PageClientImpl.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didChangeClipToSafeArea): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateVisibleContentRects): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::setAvoidsUnsafeArea): (WebKit::WebPageProxy::setClipToSafeArea): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::avoidsUnsafeArea): (WebKit::WebPageProxy::clipToSafeArea): Deleted. * UIProcess/WebPageProxy.messages.in: Plumb the effective value of viewport-fit (whether or not to avoid the safe area for layout purposes) from the Web Content process to the UI process inside the layer tree transaction. Also, remove clip-to-safe-area plumbing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _computedContentInset]): (-[WKWebView _computedUnobscuredSafeAreaInset]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _contentMayDrawInObscuredInsets]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Make use of the effective value of viewport-fit to decide whether to take the safe area into account when computing the obscured insets, and expose this to clients (in the case that they need to know because they push their own obscured insets down). Also expose a safe area inset setter for that case as well. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView updateFixedClippingView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Remove a piece of the clip-to-safe-area implementation, and plumb safe area insets into the visible content rect update info. * UIProcess/ios/WKScrollView.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollView initWithFrame:]): (-[WKScrollView _contentInsetAdjustmentBehaviorWasExternallyOverridden]): (-[WKScrollView _setContentInsetAdjustmentBehavior:]): (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]): Keep track of whether the client has ever touched the content inset adjustment behavior; if they have, we won't manage it ourselves. 2017-05-01 Brady Eidson Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs. and https://bugs.webkit.org/show_bug.cgi?id=171508 Reviewed by Andy Estes. This patch: - Renames WKURLSchemeHandlerTask to WKURLSchemeTask - Renames the method "startTask" to "startURLSchemeTask" - Renames the method "stopTask" to "stopURLSchemeTask" To those effects it's basically a global replace. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp. (API::URLSchemeTask::create): (API::URLSchemeTask::URLSchemeTask): * UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h. * UIProcess/API/Cocoa/WKURLSchemeHandler.h: * UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h. * UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm. (raiseExceptionIfNecessary): (-[WKURLSchemeTaskImpl request]): (-[WKURLSchemeTaskImpl didReceiveResponse:]): (-[WKURLSchemeTaskImpl didReceiveData:]): (-[WKURLSchemeTaskImpl didFinish]): (-[WKURLSchemeTaskImpl didFailWithError:]): (-[WKURLSchemeTaskImpl _apiObject]): * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h. (WebKit::wrapper): * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h: * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: (WebKit::WebURLSchemeHandlerCocoa::platformStartTask): (WebKit::WebURLSchemeHandlerCocoa::platformStopTask): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::stopURLSchemeTask): (WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted. (WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp. (WebKit::WebURLSchemeTask::create): (WebKit::WebURLSchemeTask::WebURLSchemeTask): (WebKit::WebURLSchemeTask::didReceiveResponse): (WebKit::WebURLSchemeTask::didReceiveData): (WebKit::WebURLSchemeTask::didComplete): (WebKit::WebURLSchemeTask::pageDestroyed): (WebKit::WebURLSchemeTask::stop): * UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h. (WebKit::WebURLSchemeTask::identifier): (WebKit::WebURLSchemeTask::request): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::addURLSchemeTaskProxy): (WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy): (WebKit::WebLoaderStrategy::remove): (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted. (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted. * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::urlSchemeTaskDidReceiveResponse): (WebKit::WebPage::urlSchemeTaskDidReceiveData): (WebKit::WebPage::urlSchemeTaskDidComplete): (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted. (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted. (WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::startNewTask): (WebKit::WebURLSchemeHandlerProxy::taskDidComplete): (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp. (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy): (WebKit::WebURLSchemeTaskProxy::startLoading): (WebKit::WebURLSchemeTaskProxy::stopLoading): (WebKit::WebURLSchemeTaskProxy::didReceiveResponse): (WebKit::WebURLSchemeTaskProxy::didReceiveData): (WebKit::WebURLSchemeTaskProxy::didComplete): (WebKit::WebURLSchemeTaskProxy::hasLoader): * WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h. (WebKit::WebURLSchemeTaskProxy::request): (WebKit::WebURLSchemeTaskProxy::identifier): 2017-05-01 Chris Dumez Tweak how long we allow a process to go over its background CPU limit https://bugs.webkit.org/show_bug.cgi?id=170460 Reviewed by Geoffrey Garen. Tweak how long we allow a process to go over its background CPU limit. We now use 8 minutes intervals (instead of previously 15). This is less conservative and aligned with our memory kills. * WebProcess/cocoa/WebProcessCocoa.mm: 2017-05-01 Beth Dakin On-screen panel for candidate bar is in the wrong place when the caret is at the start of a paragraph https://bugs.webkit.org/show_bug.cgi?id=171453 -and corresponding- rdar://problem/29779764 Reviewed by Tim Horton. This bug only happens when the caret is at the beginning of the paragraph, and it is because Range::absoluteTextQuads() returns no quads in this case. I think it might be correct that absoluteTextQuads() returns no quads in this case, so this patch fixes the bug at the call site by using absoluteCaretBounds() in this case. SPI for testing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _candidateRect]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Bug fix. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformEditorState): 2017-05-01 Carlos Garcia Campos [GTK] Add automation session API https://bugs.webkit.org/show_bug.cgi?id=171428 Reviewed by Carlos Alberto Lopez Perez. Add new API to allow WebKitGTK+ to be controlled by automation. By default it's disabled, applications have to explicitly call webkit_web_context_set_automation_allowed() to enabled it. When a new automation session is requested, the signal WebKitWebContext::automation-started is emitted with a newly created WebKitAutomationSession, similar to how WebKitWebContext::download-started works. The user should connect to it have access to the WebKitAutomationSession and connect it its signals. When a new web view is requested to be created in a WebKitAutomationSession, the signal WebKitAutomationSession::create-web-view is emitted. The user should connect to it and return a WebKitWebView. The web views used for automation are special ones and need to be created with the new WebKitWebView:is-controlled-by-automation construct property enabled, otherwise we will refuse to create the requested browsing context. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitAutomationSession.cpp: Added. (webkitAutomationSessionSetProperty): (webkitAutomationSessionConstructed): (webkit_automation_session_class_init): (webkitAutomationSessionCreate): (webkitAutomationSessionGetSession): (webkit_automation_session_get_id): * UIProcess/API/gtk/WebKitAutomationSession.h: Added. * UIProcess/API/gtk/WebKitAutomationSessionPrivate.h: Added. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_class_init): (webkit_web_context_is_automation_allowed): (webkit_web_context_set_automation_allowed): (webkitWebContextCreatePageForWebView): * UIProcess/API/gtk/WebKitWebContext.h: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkit_web_view_class_init): (webkit_web_view_is_controlled_by_automation): * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: 2017-05-01 Carlos Garcia Campos Unreviewed. Fix GTK+ debug build after r216002. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (WebKit::wrapClientRectList): 2017-04-30 Chris Dumez Drop support for legacy ClientRect / ClientRectList https://bugs.webkit.org/show_bug.cgi?id=171418 Reviewed by Sam Weinig. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapClientRect): (webkit_dom_client_rect_constructed): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (ClientRectList::create): (ClientRectList::items): (ClientRectList::ClientRectList): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_get_bounding_client_rect): (webkit_dom_element_get_client_rects): 2017-04-30 Brady Eidson More fixing after r215991 https://bugs.webkit.org/show_bug.cgi?id=171483 * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): 2017-04-30 Brady Eidson Fix r215991 https://bugs.webkit.org/show_bug.cgi?id=171483 Unreviewed. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): 2017-04-30 Dan Bernstein [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance() https://bugs.webkit.org/show_bug.cgi?id=171485 Reviewed by Geoffrey Garen. * Platform/mac/MenuUtilities.mm: (WebKit::menuItemForTelephoneNumber): (WebKit::menuForTelephoneNumber): 2017-04-30 Brady Eidson Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI. and https://bugs.webkit.org/show_bug.cgi?id=171483 Reviewed by Geoff Garen (and kind of Andy Estes). Updates include: -Taking a file path as the config argument instead of a directory. -Proper sandbox extension handling. -Proper and thorough API test. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::syncAllCookies): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _syncNetworkProcessCookies]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _cookieStoragePath]): (-[_WKWebsiteDataStoreConfiguration _setCookieStoragePath:]): (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): Deleted. (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::syncNetworkProcessCookies): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedCookieStoragePath): (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): Deleted. 2017-04-30 Brady Eidson Regression (r215941) Unexpected logging causes perf tests to fail. and https://bugs.webkit.org/show_bug.cgi?id=171482 Reviewed by Alexey Proskuryakov. * Shared/mac/SandboxExtensionMac.mm: (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::networkingCachesDirectory): (WebKit::WebProcessPool::webContentCachesDirectory): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Only resolve the cookie storage directory if a custom one has been set. 2017-04-29 Youenn Fablet Readd assertion removed accidentally in r215955 https://bugs.webkit.org/show_bug.cgi?id=171466 Reviewed by Eric Carlson. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): 2017-04-29 Andy Estes [macOS] Picture-in-picture should be disabled in WebPlaybackControlsManager during external media playback https://bugs.webkit.org/show_bug.cgi?id=171468 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): Set canTogglePictureInPicture to YES by default on WebPlaybackControlsManager. 2017-04-29 Yusuke Suzuki Move WebCore CPUTime to WTF and implement it in all the platforms https://bugs.webkit.org/show_bug.cgi?id=171477 Reviewed by Chris Dumez. We now hold Seconds in CPUTime instead of int64_t. It finally sends Seconds through WebKit2 IPC. We do not need to specialize ArgumentCoder for Seconds since Seconds just holds double. * UIProcess/PerActivityStateCPUUsageSampler.cpp: (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler): (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime): (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired): * UIProcess/PerActivityStateCPUUsageSampler.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::reportWebContentCPUTime): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessPool.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::reportProcessCPUTime): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-04-28 Brady Eidson Teach the DatabaseProcess to be fully SessionID aware https://bugs.webkit.org/show_bug.cgi?id=171451 Reviewed by Geoffrey Garen. SessionIDs were already at the periphery of IDB and the DatabaseProcess. Getting a separate IDBServer per SessionID is a pretty straightforward improvement. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::idbServer): (WebKit::DatabaseProcess::initializeWebsiteDataStore): (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): (WebKit::DatabaseProcess::indexedDatabaseOrigins): (WebKit::DatabaseProcess::initializeDatabaseProcess): Deleted. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Deleted. (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Deleted. * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::indexedDatabaseDirectory): Deleted. * DatabaseProcess/DatabaseProcess.messages.in: * DatabaseProcess/DatabaseToWebProcessConnection.cpp: (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer): * DatabaseProcess/DatabaseToWebProcessConnection.h: * DatabaseProcess/DatabaseToWebProcessConnection.messages.in: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::create): (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): (WebKit::WebIDBConnectionToClient::deleteDatabase): (WebKit::WebIDBConnectionToClient::openDatabase): (WebKit::WebIDBConnectionToClient::abortTransaction): (WebKit::WebIDBConnectionToClient::commitTransaction): (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBConnectionToClient::createObjectStore): (WebKit::WebIDBConnectionToClient::deleteObjectStore): (WebKit::WebIDBConnectionToClient::renameObjectStore): (WebKit::WebIDBConnectionToClient::clearObjectStore): (WebKit::WebIDBConnectionToClient::createIndex): (WebKit::WebIDBConnectionToClient::deleteIndex): (WebKit::WebIDBConnectionToClient::renameIndex): (WebKit::WebIDBConnectionToClient::putOrAdd): (WebKit::WebIDBConnectionToClient::getRecord): (WebKit::WebIDBConnectionToClient::getAllRecords): (WebKit::WebIDBConnectionToClient::getCount): (WebKit::WebIDBConnectionToClient::deleteRecord): (WebKit::WebIDBConnectionToClient::openCursor): (WebKit::WebIDBConnectionToClient::iterateCursor): (WebKit::WebIDBConnectionToClient::establishTransaction): (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose): (WebKit::WebIDBConnectionToClient::databaseConnectionClosed): (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded): (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent): (WebKit::WebIDBConnectionToClient::openDBRequestCancelled): (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer): (WebKit::WebIDBConnectionToClient::getAllDatabaseNames): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * Shared/Databases/DatabaseProcessCreationParameters.cpp: (WebKit::DatabaseProcessCreationParameters::encode): (WebKit::DatabaseProcessCreationParameters::decode): * Shared/Databases/DatabaseProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureDatabaseProcess): (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::databaseProcessParameters): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::create): (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): 2017-04-28 Youenn Fablet getUserMedia video streams should follow device orientation https://bugs.webkit.org/show_bug.cgi?id=171284 Reviewed by Eric Carlson. Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory. Refactoring to return a CaptureSourceOrError instead of passing an out parameter in addition to returning a RefPtr. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): Deleted. * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-28 Chris Dumez [iOS] We should not take a background assertion for the UIProcess when app is MobileMail https://bugs.webkit.org/show_bug.cgi?id=171435 Reviewed by Geoffrey Garen. Add SPI to disable taking on background process assertions in the UIProcess. This is useful for MobileMail. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration shouldTakeUIBackgroundAssertion]): (-[_WKProcessPoolConfiguration setShouldTakeUIBackgroundAssertion:]): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::setClient): * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::ProcessThrottler): (WebKit::m_shouldTakeUIBackgroundAssertion): (WebKit::ProcessThrottler::didConnectToProcess): * UIProcess/ProcessThrottler.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): 2017-04-28 Chris Dumez Unreviewed attempt to fix iOS build after r215943. * Configurations/Base.xcconfig: 2017-04-28 Andy Estes [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes https://bugs.webkit.org/show_bug.cgi?id=171434 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Set m_audioMediaSelectedIndex and notified clients. (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Ditto for m_legibleMediaSelectedIndex. (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Called WebPlaybackSessionModelContext::setAudioMediaSelectionIndex(). (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Called WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex(). * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionIndexChanged): Called WebPlaybackSessionManager:: audioMediaSelectionIndexChanged(). (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionIndexChanged): Called WebPlaybackSessionManager::legibleMediaSelectionIndexChanged(). (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged): Sent WebPlaybackSessionManagerProxy::SetAudioMediaSelectionIndex(). (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged): Sent WebPlaybackSessionManagerProxy::SetLegibleMediaSelectionIndex(). 2017-04-28 Brady Eidson Start of support for multiple WebsiteDataStore/SessionIDs per process https://bugs.webkit.org/show_bug.cgi?id=171422 Reviewed by Geoffrey Garen. * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::destroyPrivateBrowsingSession): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h. (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters): (WebKit::WebsiteDataStoreParameters::encode): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h. * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::defaultDataStore): (API::WebsiteDataStore::createLegacy): (API::WebsiteDataStore::WebsiteDataStore): (API::WebsiteDataStore::create): Deleted. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerCreate): (webkitWebsiteDataManagerGetDataStore): * UIProcess/WebPageProxy.cpp: (WebKit::m_weakPtrFactory): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::pageRemovedFromProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::create): (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::WebFrameNetworkingContext::storageSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::addWebsiteDataStore): (WebKit::WebProcess::destroySession): (WebKit::WebProcess::destroyPrivateBrowsingSession): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-04-28 Youenn Fablet Adding a runtime flag specific to MediaDevices https://bugs.webkit.org/show_bug.cgi?id=171433 Reviewed by Geoffrey Garen. Adding a preference for MediaDevices. Setting media devices runtime flag to false by default. Setting peer connection and media stream flags to true by default. Sending microphone sandbox extension based on media devices and not media stream flag. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaDevicesEnabled): (WKPreferencesGetMediaDevicesEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-28 Brady Eidson Teach WebProcessPool to track a map of SessionIDs to WebPageProxys to manage their lifetime https://bugs.webkit.org/show_bug.cgi?id=171408 Reviewed by Alex Christensen. * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::sessionID): * UIProcess/API/APIPageConfiguration.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::close): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::pageRemovedFromProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createWebPage): (WebKit::WebProcessProxy::addExistingWebPage): (WebKit::WebProcessProxy::removeWebPage): * UIProcess/WebProcessProxy.h: 2017-04-27 Carlos Garcia Campos Move UUID from WebCore/platform to WTF https://bugs.webkit.org/show_bug.cgi?id=171372 Reviewed by Michael Catanzaro. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::handleForWebPageProxy): (WebKit::WebAutomationSession::handleForWebFrameID): * UIProcess/gtk/WaylandCompositor.cpp: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::createUUID): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::openWithNativeApplication): 2017-04-27 Chris Dumez Align colspan/rowspan limits with the latest HTML specification https://bugs.webkit.org/show_bug.cgi?id=171322 Reviewed by Darin Adler. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp: (webkit_dom_html_table_cell_element_get_col_span): (webkit_dom_html_table_cell_element_set_col_span): 2017-04-27 Wenson Hsieh WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction https://bugs.webkit.org/show_bug.cgi?id=171386 Reviewed by Beth Dakin. Add a new WKUIDelegate hook, _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-04-27 Brady Eidson Refactor SessionID to support multiple non-ephemeral (persistent) sessions. https://bugs.webkit.org/show_bug.cgi?id=171367 Reviewed by Andy Estes. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): Child processes should never be generating new SessionIDs, so enable generation protection. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::createNonPersistent): (WebKit::generateNonPersistentSessionID): Deleted. 2017-04-27 Said Abou-Hallawa REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument https://bugs.webkit.org/show_bug.cgi?id=170333 Reviewed by Simon Fraser. Disbale the async decoding for large images for now. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-27 Brent Fulgham [WK2][macOS] Allow multi-touch related iokit-get-properties https://bugs.webkit.org/show_bug.cgi?id=171355 Reviewed by Alexey Proskuryakov. During testing I've noticed Sandbox Violations being generated during some 'Force Touch' track pad use. The sandbox should allow these IOKit properties to be accessed. * WebProcess/com.apple.WebProcess.sb.in: 2017-04-27 Alex Christensen Add stub SPI for setting cookie storage path on _WKWebsiteDataStoreConfiguration https://bugs.webkit.org/show_bug.cgi?id=171399 Reviewed by Brady Eidson. This SPI isn't hooked up yet, but it has a test that will need to be updated once it works. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): 2017-04-27 Chris Dumez Element.getBoundingClientRect() / getClientRects() should return a DOMRect types https://bugs.webkit.org/show_bug.cgi?id=171226 Reviewed by Simon Fraser. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (toClientRect): (webkit_dom_element_get_bounding_client_rect): (webkit_dom_element_get_client_rects): 2017-04-27 Brady Eidson Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages. https://bugs.webkit.org/show_bug.cgi?id=171365 Reviewed by Andy Estes. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 2017-04-27 Alex Christensen Modernize Frame.h https://bugs.webkit.org/show_bug.cgi?id=171357 Reviewed by Andy Estes. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::handleContextMenuEvent): (WebKit::WebPage::isSelectTrailingWhitespaceEnabled): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::selectPositionAtPoint): (WebKit::WebPage::selectPositionAtBoundaryWithDirection): (WebKit::WebPage::rangeForGranularityAtPoint): (WebKit::WebPage::selectTextWithGranularityAtPoint): (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPage::updateSelectionWithExtentPoint): 2017-04-27 Carlos Garcia Campos [GTK] Remote inspector should support inspecting targets with previous version of backend commands https://bugs.webkit.org/show_bug.cgi?id=171267 Reviewed by Michael Catanzaro. There's a FIXME for this in the code. The remote inspector proxy allows to pass a backend commands URL when inspecting a target. That URL, if not empty, is used as Protocol/InspectorBackendCommands.js in the inspector code instead of the local copy. We are currently assuming that both ends use the same version of that file. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorProxy::load): Pass RemoteInspectorClient::backendCommandsURL() to load(). (WebKit::RemoteInspectorClient::setupConnection): Get the local backend commands hash and pass it to SetupInspectorClient method. Extract the server backend commands from the result and call setBackendCommands(). (WebKit::RemoteInspectorClient::setBackendCommands): Create a data URL for the server backend commands file conents if needed. * UIProcess/glib/RemoteInspectorClient.h: (WebKit::RemoteInspectorClient::backendCommandsURL): 2017-04-26 Wenson Hsieh WebItemProviderPasteboard should not synchronously load provided data https://bugs.webkit.org/show_bug.cgi?id=171341 Reviewed by Tim Horton. Adds plumbing for updatePreferredTypeIdentifiers through the WebPasteboardProxy. This allows the web process to signal to the UI process what UTIs the current drop target should accept and load. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-26 Youenn Fablet Unauthenticated CORS preflight requests should not use client certificates https://bugs.webkit.org/show_bug.cgi?id=171298 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ensuring that session dedicated to requests that do not want to use credentials do not look for client credentials. 2017-04-26 Eric Carlson The current page is given a muted state when starting a media stream on iOS. https://bugs.webkit.org/show_bug.cgi?id=171290 Reviewed by Jer Noble. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Don't mute the current page on iOS either, that will prevent the new media stream from playing. 2017-04-26 Alex Christensen Make user script injection more robust https://bugs.webkit.org/show_bug.cgi?id=171339 Reviewed by Geoffrey Garen. * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::forEachUserScript): (WebKit::WebUserContentController::forEachUserStyleSheet): (WebKit::WebUserContentController::forEachUserMessageHandler): * WebProcess/UserContent/WebUserContentController.h: 2017-04-26 Zalan Bujtas RTL: recent searches popover is displayed in incorrect location https://bugs.webkit.org/show_bug.cgi?id=171338 Reviewed by Dean Jackson. Add RTL support for the pop-under branch. * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): 2017-04-26 Antti Koivisto Enable expired-only reload policy on Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=171264 Reviewed by Andreas Kling. Enable the reload policy where only expired subresources are revalidated on Mac and iOS. The behavor is enabled in Safari and for other clients based on SDK version check. * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-26 Andy Estes [macOS] Add picture-in-picture support to WebPlaybackControlsManager https://bugs.webkit.org/show_bug.cgi?id=171328 Reviewed by Jer Noble. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::togglePictureInPicture): Added. Calls WebPlaybackSessionManagerProxy::togglePictureAndPicture(). (WebKit::WebPlaybackSessionManagerProxy::togglePictureInPicture): Added. Sends TogglePictureInPicture to WebPlaybackSessionManager. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): Called -[WebPlaybackControlsManager setAllowsPictureInPicturePlayback:YES] if WebPreferences::allowsPictureInPictureMediaPlayback() is true. * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::togglePictureInPicture): Added. Sets a UserGestureIndicator and calls WebPlaybackSessionModel::togglePictureInPicture(). 2017-04-26 Tim Horton WebKit calls AppKit NSCell API from a background queue https://bugs.webkit.org/show_bug.cgi?id=171318 Reviewed by Anders Carlsson. * UIProcess/mac/ServicesController.mm: (WebKit::ServicesController::refreshExistingServices): Synchronously bounce to the main thread to do non-thread-safe NSCell related work. 2017-04-25 Alex Christensen Encoded filename should be decoded for WKContentExtension.identifier https://bugs.webkit.org/show_bug.cgi?id=171316 Reviewed by Andy Estes. * UIProcess/API/APIContentExtensionStore.cpp: (API::createExtension): (API::ContentExtensionStore::lookupContentExtension): (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): 2017-04-26 Andrew Gold Move mediaCaptureEnabled from WKWebViewConfiguration to WKPreferences https://bugs.webkit.org/show_bug.cgi?id=171294 Reviewed by Eric Carlson. Since we now want the ability to toggle this setting dynamically, I have moved it from WKWebViewConfiguration to WKPreferences. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _mediaStreamEnabled]): (-[WKPreferences _setMediaStreamEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): No longer set mediaStream enabled from the configuration. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _mediaStreamEnabled]): Deleted. (-[WKWebViewConfiguration _setMediaStreamEnabled:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-04-25 Alex Christensen REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set https://bugs.webkit.org/show_bug.cgi?id=171297 Reviewed by Geoffrey Garen. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): 2017-04-25 Wenson Hsieh Unreviewed, speculative build fix * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: For the time being, remove all references to UIItemProviders from this private header. This should be fixed to use unavailability macros in a followup. See . 2017-04-25 Brent Fulgham Limit allowed size of document.title to avoid locking WebKit clients https://bugs.webkit.org/show_bug.cgi?id=165113 Reviewed by Darin Adler. When a web application attempts to set an extremely long title, truncate the title to a more reasonable size. We do this at at the presentation layer, rather than in the DOM, so that we do not affect script function. Instead, we merely limit display to a level that is reasonable for normal GUI widgets. Anything else needs to be truncated in the UI layer, so it is a waste of effort to send across IPC. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-04-25 John Wilander Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting https://bugs.webkit.org/show_bug.cgi?id=171295 Reviewed by Brent Fulgham. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain): Changes and additions to test infrastructure. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Changes and additions to test infrastructure. * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): No longer sends a boolean parameter to WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler(). 2017-04-25 Simon Fraser REGRESSION (r213719): WebGL content on cubeslam.com is 1/4 expected size https://bugs.webkit.org/show_bug.cgi?id=171300 rdar://problem/31051538 Reviewed by Dean Jackson. Propagating the contentsScale to the UI process for canvas content layers causes scaling issues, so don't do it for contents-provided layers. No test because WebGL can't be tested in the iOS simulator. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::PlatformCALayerRemote): 2017-04-25 Brady Eidson Update WebProcess(Pool) to assume there's always a WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=171299 Reviewed by Alex Christensen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::warmInitialProcess): (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::create): (WebKit::WebProcessProxy::WebProcessProxy): (WebKit::m_userMediaCaptureManagerProxy): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::websiteDataStore): 2017-04-25 Ryan Haddad Unreviewed, rolling out r215730. The LayoutTest for this change is a flaky timeout on mac-wk1 debug. Reverted changeset: "Enable expired-only reload policy on Mac and iOS" https://bugs.webkit.org/show_bug.cgi?id=171264 http://trac.webkit.org/changeset/215730 2017-04-24 Matt Rajca Indicate presence of audio when handling autoplay events. https://bugs.webkit.org/show_bug.cgi?id=171227 Reviewed by Alex Christensen. * UIProcess/API/APIUIClient.h: (API::UIClient::handleAutoplayEvent): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleAutoplayEvent): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleAutoplayEvent): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-04-25 Daniel Bates [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header https://bugs.webkit.org/show_bug.cgi?id=136452 Reviewed by Brent Fulgham. Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms. * Configurations/FeatureDefines.xcconfig: 2017-04-25 John Wilander Resource Load Statistics: Clear network process cache when clearing store https://bugs.webkit.org/show_bug.cgi?id=171256 Reviewed by Brent Fulgham. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst to WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts(). * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now takes the boolean parameter clearFirst. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst to Messages::NetworkProcess::ShouldPartitionCookiesForTopPrivatelyOwnedDomains. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now takes the boolean parameter clearFirst. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): Now uses the boolean parameter clearFirst when calling WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler(). (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): No longer uses the deleted store getter. (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): No longer uses the deleted store getter. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): No sends the boolean parameter clearFirst to ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler(). (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Now expects a handler with the boolean parameter clearFirst. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): * UIProcess/WebResourceLoadStatisticsStore.h: Now uses the new WebCore::ResourceLoadObserver::clearInMemoryStore(). * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst in its message to the network process. (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): Now expects a handler with the boolean parameter clearFirst. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-04-25 Chris Dumez Content-Disposition header filename is ignored when 'download' attribute is specified in HTML https://bugs.webkit.org/show_bug.cgi?id=171239 Reviewed by Alex Christensen. Content-Disposition header filename is ignored when 'download' attribute is specified in HTML. This is not as per HTML specification: - https://html.spec.whatwg.org/#as-a-download (Step 2) Content-Disposition header filename is supposed to override the value of the download attribute. Firefox and Chrome follow the specification. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::findPendingDownloadLocation): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::didReceiveResponse): 2017-04-25 Carlos Garcia Campos [GTK] Add WebKitInspectorWindow to create inspector windows from local and remote inspector https://bugs.webkit.org/show_bug.cgi?id=171261 Reviewed by Michael Catanzaro. The code is currently duplicated in WebInspectorProxyGtk.cpp and RemoteWebInspectorProxyGtk.cpp. We can simplify it by using a common widget in both places. This patch also fixes the build when using GTK+ < 3.16. * PlatformGTK.cmake: * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: (WebKit::RemoteWebInspectorProxy::updateWindowTitle): (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::createInspectorWindow): (WebKit::WebInspectorProxy::updateInspectorWindowTitle): * UIProcess/gtk/WebKitInspectorWindow.cpp: Added. (webkit_inspector_window_class_init): (webkit_inspector_window_init): (webkitInspectorWindowNew): (webkitInspectorWindowSetSubtitle): * UIProcess/gtk/WebKitInspectorWindow.h: Added. 2017-04-25 Antti Koivisto Enable expired-only reload policy on Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=171264 Reviewed by Andreas Kling. Enable the reload policy where only expired subresources are revalidated on Mac and iOS. The behavor is enabled in Safari and for other clients based on SDK version check. * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-25 Wenson Hsieh Support reading NSURL titles from the pasteboard when performing data interaction https://bugs.webkit.org/show_bug.cgi?id=171156 Reviewed by Tim Horton. Adjust for interface changes in WebCore to support plumbing the title of an NSURL from the platform pasteboard back to WebCore. Additionally, implement WebEditorClient::hasRichlyEditableSelection (which previously returned false) to check whether the current selection is richly editable, or the drop caret is in richly editable content. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::readURLFromPasteboard): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::readURLFromPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::hasRichlyEditableSelection): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::hasRichlyEditableSelection): * WebProcess/WebPage/WebPage.h: 2017-04-24 Wenson Hsieh Respect fidelity order when reading web content from item providers https://bugs.webkit.org/show_bug.cgi?id=171155 Reviewed by Tim Horton. Adjusts for changes in WebCore by adding plumbing to support Pasteboard::getTypesByFidelityForItemAtIndex. See WebCore/ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-24 Brady Eidson WebProcessPools should always have a WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=171252 Reviewed by Alex Christensen. * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/C/WKContext.cpp: (WKContextGetWebsiteDataStore): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::isAssociatedProcessPool): 2017-04-24 Youenn Fablet Set defaults video getUserMedia constraints https://bugs.webkit.org/show_bug.cgi?id=171127 Reviewed by Eric Carlson. Updated to cope with MediaStreamConstraintsImpl refactoring. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): 2017-04-24 Chris Dumez Allow tabs with capturing audio or video to exceed background CPU limit https://bugs.webkit.org/show_bug.cgi?id=171249 Reviewed by Geoffrey Garen. Allow tabs with capturing audio or video to exceed background CPU limit as this is a legit case of potentially high background CPU use. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): 2017-04-24 Andy Estes Try to fix the 32-bit macOS build. * UIProcess/Cocoa/WebViewImpl.mm: 2017-04-24 Andy Estes [macOS] Enable media selection button on AVTouchBarScrubber https://bugs.webkit.org/show_bug.cgi?id=171149 Reviewed by Beth Dakin. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-24 Alex Christensen Reduce copies and allocations in SharedBuffer::append https://bugs.webkit.org/show_bug.cgi?id=170956 Reviewed by Andreas Kling. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm: (-[WKURLSchemeHandlerTaskImpl didReceiveData:]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::addArchiveResource): (WebKit::PDFPlugin::liveResourceData): (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::redeliverManualStream): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::cachedResponseDataForURL): 2017-04-24 Carlos Garcia Campos [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector https://bugs.webkit.org/show_bug.cgi?id=166680 Reviewed by Michael Catanzaro. Remove INSPECTOR_SERVER code and add new classes to implement REMOTE_INSPECTOR. The WebKitWebContext registers a custom protocol "inspector" that loads a page with the list of debuggable targets. * PlatformGTK.cmake: Add new files to compilation and remove the old ones. * UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Removed. * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: Added. (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler): (WebKit::RemoteInspectorProtocolHandler::~RemoteInspectorProtocolHandler): (WebKit::RemoteInspectorProtocolHandler::webViewDestroyed): (WebKit::RemoteInspectorProtocolHandler::userContentManagerDestroyed): (WebKit::RemoteInspectorProtocolHandler::handleRequest): (WebKit::RemoteInspectorProtocolHandler::inspect): (WebKit::RemoteInspectorProtocolHandler::targetListChanged): (WebKit::RemoteInspectorProtocolHandler::connectionClosed): * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: Added. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): * UIProcess/InspectorServer/HTTPRequest.cpp: Add missing ENABLE(INSPECTOR_SERVER) ifdefs. * UIProcess/InspectorServer/HTTPRequest.h: * UIProcess/InspectorServer/WebInspectorServer.h: * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: Removed. * UIProcess/RemoteWebInspectorProxy.cpp: * UIProcess/RemoteWebInspectorProxy.h: * UIProcess/WebProcessPool.cpp: * UIProcess/glib/RemoteInspectorClient.cpp: Added. (WebKit::RemoteInspectorClient::RemoteInspectorClient): (WebKit::RemoteInspectorClient::~RemoteInspectorClient): (WebKit::dbusConnectionCallAsyncReadyCallback): (WebKit::RemoteInspectorClient::connectionClosedCallback): (WebKit::RemoteInspectorClient::setupConnection): (WebKit::RemoteInspectorClient::connectionClosed): (WebKit::RemoteInspectorClient::inspect): (WebKit::RemoteInspectorClient::sendMessageToBackend): (WebKit::RemoteInspectorClient::closeFromFrontend): (WebKit::RemoteInspectorClient::setTargetList): (WebKit::RemoteInspectorClient::sendMessageToFrontend): * UIProcess/glib/RemoteInspectorClient.h: Added. (WebKit::RemoteInspectorObserver::~RemoteInspectorObserver): (WebKit::RemoteInspectorClient::targets): (WebKit::RemoteInspectorClient::hostAndPort): * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: Added. (WebKit::RemoteWebInspectorProxy::updateWindowTitle): (WebKit::inspectorViewDestroyed): (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::RemoteWebInspectorProxy::platformBringToFront): (WebKit::RemoteWebInspectorProxy::platformSave): (WebKit::RemoteWebInspectorProxy::platformAppend): (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab): * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (didReceiveMessageToPage): Updated after the GRefPtr hash traitds changes. * config.h: 2017-04-23 Dan Bernstein [macOS] WKWebInspectorProxyObjCAdapter has a public ivar https://bugs.webkit.org/show_bug.cgi?id=171200 Reviewed by Geoffrey Garen. * UIProcess/API/C/mac/WKInspectorPrivateMac.h: Made ivar private. 2017-04-23 Commit Queue Unreviewed, rolling out r215657 and r215676. https://bugs.webkit.org/show_bug.cgi?id=171201 Broke the build (Requested by ap on #webkit). Reverted changesets: "[macOS] Enable media selection button on AVTouchBarScrubber" https://bugs.webkit.org/show_bug.cgi?id=171149 http://trac.webkit.org/changeset/215657 "Build fix after r215657." http://trac.webkit.org/changeset/215676 2017-04-23 Alexey Proskuryakov Build fix after r215657. * UIProcess/Cocoa/WebViewImpl.mm: 2017-04-23 Andy Estes [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type https://bugs.webkit.org/show_bug.cgi?id=171192 Reviewed by Wenson Hsieh. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged): 2017-04-21 Wenson Hsieh Support writing link titles to the pasteboard when beginning data interaction on a link https://bugs.webkit.org/show_bug.cgi?id=171154 Reviewed by Andy Estes. Adds support for setting the _title attribute of NSURLs written to the pasteboard. See WebCore ChangeLog for more details. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: Teach PasteboardURL to be serialized in IPC. For now, we just send across the absolute string of the link and its title. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::writeURLToPasteboard): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: Add IPC plumbing for writing PasteboarURLs to the pasteboard. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::writeToPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-21 Michael Catanzaro Unreviewed, rolling out r215608. Hundreds of test failures on GTK bot Reverted changeset: "Reduce copies and allocations in SharedBuffer::append" https://bugs.webkit.org/show_bug.cgi?id=170956 http://trac.webkit.org/changeset/215608 2017-04-21 Andy Estes [macOS] Enable media selection button on AVTouchBarScrubber https://bugs.webkit.org/show_bug.cgi?id=171149 Reviewed by Beth Dakin. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-21 Wenson Hsieh [WK2] Add delegate hooks for overriding unhanded data interaction operations https://bugs.webkit.org/show_bug.cgi?id=171005 Reviewed by Tim Horton. Adds support for overriding data interaction operations through two new delegate methods: _webView:willUpdateDataInteractionOperationToOperation:forSession:, and _webView:dataInteractionOperationWasHandled:forSession:. The former may be overridden to return a different operation type than what WebKit would originally have returned, and the latter may be overridden to run custom logic after the web process has handled a data interaction operation. Additionally, includes some minor cleanup around WKContentViewInteraction. With the new _webView:dataInteractionOperationWasHandled:forSession: delegate method, the last method on _WKTestingDelegate may be removed. This means _WKTestingDelegate is no longer needed, so this patch removes its header entirely. Also, relocates some state variables formerly on WKContentView to WKContentView's WKDataInteractionState struct instead, so that all state associated with data interaction may be cleaned up at the same time. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _testingDelegate]): Deleted. (-[WKWebView _setTestingDelegate:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKTestingDelegate.h: Removed. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add a new "handled" IPC argument to DidPerformDataInteractionControllerOperation. This lets the UI process know whether or not the data interaction operation was handled by the web process, and is eventually plumbed through to the UI delegate via the new SPI. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _displayFormNodeInputView]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-04-21 Anders Carlsson Stop using deprecated APIs, part 5 https://bugs.webkit.org/show_bug.cgi?id=171134 rdar://problem/31589635 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentAuthorizationStatus): Remove this and add a new version that doesn't use any deprecated values. (WebKit::toPKPaymentAuthorizationStatus): New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes. (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Use the new toPKPaymentAuthorizationStatus versions. (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Ditto. (WebKit::status): Deleted. 2017-04-21 David Kilzer Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make Reviewed by Brent Fulgham. * DerivedSources.make: Switch to -std=gnu++14 for preprocessing headers to check for build settings. 2017-04-21 Jer Noble [WK2][MediaCapture] Pass muted and enabled state across process boundary when capturing in UIProcess https://bugs.webkit.org/show_bug.cgi?id=170846 Reviewed by Jon Lee. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::setMuted): (WebKit::UserMediaCaptureManagerProxy::setEnabled): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setMuted): (WebKit::UserMediaCaptureManager::Source::setEnabled): (WebKit::UserMediaCaptureManager::setMuted): (WebKit::UserMediaCaptureManager::setEnabled): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-21 Jer Noble [WK2][MediaCapture] Remove now-unused WKWebViewConfiguration property for shouldCaptureAudioInUIProcess https://bugs.webkit.org/show_bug.cgi?id=170847 Reviewed by Jon Lee. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): Deleted. (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): Deleted. 2017-04-21 Anders Carlsson Stop using deprecated APIs, part 4 https://bugs.webkit.org/show_bug.cgi?id=171125 rdar://problem/31589635 Reviewed by Tim Horton. It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point so just remove the status parameter. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): 2017-04-21 Andrew Gold -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] decision handler should only have one parameter. https://bugs.webkit.org/show_bug.cgi?id=171081 Reviewed by Tim Horton. Because user media authorization is all or nothing, we should not have separate booleans to indicate authorization. Additionally, rather than passing two separate booleans to the UIDelegate, we now pass an NS_OPTIONS parameter. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS. * UIProcess/Cocoa/UIDelegate.mm: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method. (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto. 2017-04-21 Konstantin Tokarev Unreviewed, added missing file to PlatformMac.cmake * PlatformMac.cmake: 2017-04-21 Konstantin Tokarev Unreviewed follow-up for r215609 * UIProcess/API/Cocoa/WKWebView.mm: Move internal header include too. 2017-04-21 Konstantin Tokarev Include iOS-specific headers inside preprocessor guard https://bugs.webkit.org/show_bug.cgi?id=171104 Reviewed by Michael Catanzaro. This patch should fix Mac cmake build. * UIProcess/API/Cocoa/WKWebView.mm: 2017-04-21 Alex Christensen Reduce copies and allocations in SharedBuffer::append https://bugs.webkit.org/show_bug.cgi?id=170956 Reviewed by Andreas Kling. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm: (-[WKURLSchemeHandlerTaskImpl didReceiveData:]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::addArchiveResource): (WebKit::PDFPlugin::liveResourceData): (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::redeliverManualStream): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::cachedResponseDataForURL): 2017-04-20 Konstantin Tokarev [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere https://bugs.webkit.org/show_bug.cgi?id=171071 Reviewed by Michael Catanzaro. "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should be available for all ports. * CMakeLists.txt: * PlatformMac.cmake: 2017-04-20 Brady Eidson WebContent process becomes unresponsive after returning nil from async version of -webView:createWebViewWithConfiguration:... and https://bugs.webkit.org/show_bug.cgi?id=171090 Reviewed by Andy Estes. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): Handle the perfectly valid "nil webView" case correctly. 2017-04-20 Dan Bernstein Disable header postprocessing when building for Sierra Absolutely rubber-stamped by Anders Carlsson. * Configurations/WebKit.xcconfig: 2017-04-20 Matt Rajca Cocoa: add private API for suppressing first responder changes https://bugs.webkit.org/show_bug.cgi?id=171069 Reviewed by Tim Horton. Some clients may not want the web view to be programmatically made the first responder and invoking -makeFirstResponder: unconditionally posts 'first responder did change' notifications. Added API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setShouldSuppressFirstResponderChanges:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges): * UIProcess/PageClient.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::makeFirstResponder): 2017-04-20 Eric Carlson [MediaStream iOS] Hold process assertion while media capture is active https://bugs.webkit.org/show_bug.cgi?id=171017 Reviewed by Dean Jackson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary. (WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active. (WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted, so pass IsCapturingMedia to activityStateDidChange. (WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture is active. 2017-04-20 Anders Carlsson Fix build. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): 2017-04-20 Brady Eidson Add CompletionHandlerCallChecker to SPI added in r215545. https://bugs.webkit.org/show_bug.cgi?id=171067 Reviewed by Dan Bernstein. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): 2017-04-20 Anders Carlsson Replace isFinalStateStatus with isFinalStateResult https://bugs.webkit.org/show_bug.cgi?id=171072 rdar://problem/31589635 Reviewed by Tim Horton. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completePaymentSession): 2017-04-20 Wenson Hsieh [WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy https://bugs.webkit.org/show_bug.cgi?id=170922 Reviewed by Tim Horton. Refactors part of the asynchronous position information mechanism introduced in , and introduces infrastructure for unit testing UI-side position information requests. _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is a helper method on WKContentView responsible for invoking queued position information handlers after receiving a position information response from the web process. Previously, this method would iterate over the list of pending callbacks and invoke all callbacks whose requests are satisfied by the incoming position information update, saving the indices of these handled callbacks in the process. At the end, it would then remove callbacks at these indices from the array of pending callbacks. This is problematic when a synchronous position update (via ensurePositionInformationIsUpToDate:) is triggered from within one of these callbacks, since _invokeAndRemovePendingHandlersValidForCurrentPositionInformation will be called from within itself, and then we will attempt to remove a callback at the same index twice. To fix this, we change the array of pending position information handlers to be an array of optionals instead. When invoking and removing pending handlers after a position information response arrives, we now mark callbacks as handled by setting them to std::nullopt. Then, when the top-level invocation to _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is finished, we remove all marked handlers from the pending vector. Covered by 6 new unit tests: - PositionInformationTests.FindDraggableLinkAtPosition - PositionInformationTests.RequestDraggableLinkAtPosition - PositionInformationTests.FindDraggableLinkAtDifferentPositionWithinRequestBlock - PositionInformationTests.FindDraggableLinkAtSamePositionWithinRequestBlock - PositionInformationTests.RequestDraggableLinkAtSamePositionWithinRequestBlock - PositionInformationTests.RequestDraggableLinkAtDifferentPositionWithinRequestBlock * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView draggableElementAtPosition:]): (-[WKWebView requestDraggableElementAtPosition:completionBlock:]): Uses WKContentView's position information request helpers to search for draggable elements on the page. There are both synchronous and asynchronous versions of this, both of which retrieve a _WKDraggableElementInfo. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Added. * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Added. Exposes what elements are draggable at a given position as SPI (only for use in testing code, at the moment). (-[_WKDraggableElementInfo initWithInteractionInformationAtPosition:]): (-[_WKDraggableElementInfo copyWithZone:]): * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Added. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView currentPositionInformation]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]): * WebKit2.xcodeproj/project.pbxproj: 2017-04-20 Anders Carlsson Fix a PassKit function declaration typo https://bugs.webkit.org/show_bug.cgi?id=171068 rdar://problem/31635008 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-04-20 Jer Noble [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess. https://bugs.webkit.org/show_bug.cgi?id=171021 Reviewed by Eric Carlson. Pass a deviceID rather than a CaptureDevice across the process boundary. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-20 Alex Christensen Fix assertions in webProcessProxyFromConnection https://bugs.webkit.org/show_bug.cgi?id=171025 Reviewed by Brady Eidson. * UIProcess/WebProcessPool.cpp: (WebKit::webProcessProxyFromConnection): If we have a Connection, then we have a valid process attached to that connection, unless it's a Connection to a different type of child process. Calling ChildProcessProxy::connection on other web processes that are in State::Launching, then we get an assertion. Luckily, ChildProcessProxy::hasConnection was introduced in r210861 for this reason. 2017-04-20 Brent Fulgham [WK2][macOS] Allow iokit-get-properties for IOAudioControlValue https://bugs.webkit.org/show_bug.cgi?id=171020 Reviewed by Alexey Proskuryakov. * WebProcess/com.apple.WebProcess.sb.in: Add missing property name. 2017-04-19 Joseph Pecoraro Remove WebKitTestRunner code for enabling features that are already enabled by default https://bugs.webkit.org/show_bug.cgi?id=171033 Reviewed by Ryosuke Niwa. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-04-19 Youenn Fablet [Mac] Allow customizing H264 encoder https://bugs.webkit.org/show_bug.cgi?id=170829 Reviewed by Alex Christensen. * Configurations/FeatureDefines.xcconfig: * WebKit2.xcodeproj/project.pbxproj: 2017-04-19 Brady Eidson Add asynchronous equivalent of -[ webView:createWebViewWithConfiguration:...]. and https://bugs.webkit.org/show_bug.cgi?id=171018 Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPageAsync): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageAsync): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: 2017-04-19 Anders Carlsson Stop using deprecated APIs, part 3 https://bugs.webkit.org/show_bug.cgi?id=171003 rdar://problem/31589635 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Don't encode/decode status. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession): Hide the UI and report back. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Add new member. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Add new message. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): Always pass success in the old code path. Stop using the deprecated method. * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::cancelPaymentSession): Send a message to the UI process. * WebProcess/ApplePay/WebPaymentCoordinator.h: Add new member. 2017-04-19 Eric Carlson [MediaStream] Limit capture to one tab at a time https://bugs.webkit.org/show_bug.cgi?id=171009 Reviewed by Jon Lee. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): Deleted, not used. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Mute media streams on other pages. (WebKit::UserMediaProcessManager::willCreateMediaStream): Call willEnableMediaStreamInPage. * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMuted): If media streams in the page will be unmuted, call willEnableMediaStreamInPage so streams in other pages are muted first. 2017-04-19 Brady Eidson REGRESSION (r213168): An extra Web Content process is spun up on launch and is never closed. and https://bugs.webkit.org/show_bug.cgi?id=171002 Reviewed by Alex Christensen. The original change unnecessarily avoided using the initial warmed process if an explicit data store was set on the new WKWebView. Fixing that fixes the regression. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): 2017-04-19 Anders Carlsson Rename cancelPayment to cancelPaymentSession https://bugs.webkit.org/show_bug.cgi?id=171007 Reviewed by Tim Horton. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): (WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::didCancelPaymentSession): (WebKit::WebPaymentCoordinator::didCancelPayment): Deleted. * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: 2017-04-19 David Kilzer Stop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString() Reviewed by Brent Fulgham. * Platform/unix/EnvironmentUtilities.cpp: (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Switch from using strcpy() to strlcpy(). Also switch from using strstr() to strnstr(). * Platform/unix/EnvironmentUtilities.h: Switch to #pragma once. (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Export function for testing. * WebKit2.xcodeproj/project.pbxproj: (EnvironmentUtilitiesTest.h): Make header private for testing. 2017-04-19 Eric Carlson Provide a way for clients to unmute a media stream. https://bugs.webkit.org/show_bug.cgi?id=170855 Unreviewed, fix a typo missed in the review of r215420. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setPageMuted:]): 2017-04-19 Adrian Perez de Castro [GTK] WebKitAutocleanups.h regression in v2.16.1 release https://bugs.webkit.org/show_bug.cgi?id=170987 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitAutocleanups.h: Remove stray semicolon. 2017-04-18 Per Arne Vollan Dragging a few items over MiniBrowser has 0 in the red indicator. https://bugs.webkit.org/show_bug.cgi?id=170874 Reviewed by Tim Horton. When WebKit does not accept the drag items, the drag count badge should not be updated. Also, if WebKit changes the drag count badge, it should be restored to its original value when the drag exits. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::draggingEntered): (WebKit::WebViewImpl::draggingUpdated): (WebKit::WebViewImpl::draggingExited): 2017-04-18 Wenson Hsieh [WK2] Add infrastructure and unit tests for file uploads using data interaction https://bugs.webkit.org/show_bug.cgi?id=170903 Reviewed by Tim Horton. See Tools/ChangeLog for more details. Makes a small adjustment to _simulateDataInteractionUpdated: to return a BOOL indicating whether or not to allow the operation to proceed. This is necessary for testing scenarios where multiple files are being "data interacted" onto an element. See for more details about the change this patch is testing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateDataInteractionUpdated:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: 2017-04-18 Wenson Hsieh [WK2] Support DataTransfer::files() when performing a DHTML data interaction https://bugs.webkit.org/show_bug.cgi?id=170880 Reviewed by Tim Horton. See the WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformDragControllerAction): (WebKit::WebPageProxy::resetCurrentDragInformation): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag): * UIProcess/WebPageProxy.messages.in: Adds an IPC argument to DidPerformDragControllerAction specifying whether the page prevented the default behavior. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: Adds IPC plumbing for the new filenamesForDataInteraction Pasteboard codepath. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-04-18 John Wilander Resource Load Statistics: Check both origins and cookieHostNames for domain matches in data removal https://bugs.webkit.org/show_bug.cgi?id=170763 Reviewed by Alex Christensen. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Move semantics for topPrivatelyControlledDomains vector. (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Move semantics for prevalentResourceDomains vector. * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::hostIsInDomain): Static convenience function. (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain): Checks for matching cookieHostNames if types contains WebsiteDataType::Cookies. Also checks origins. * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Now makes use of the new function WebKit::WebsiteDataRecord::validForTopPrivatelyControlledDomain(). (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Move semantics for topPrivatelyControlledDomains vector. (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-04-18 Brent Fulgham [iOS][WK2] Prevent ephemeral files from being backed up https://bugs.webkit.org/show_bug.cgi?id=170963 Reviewed by Brady Eidson. Tell the OS to skip temporary data files when performing backups. * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: Added. (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Added. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Add stub for non-iOS platforms. * UIProcess/WebResourceLoadStatisticsStore.h: * WebKit2.xcodeproj/project.pbxproj: Add new file. 2017-04-18 Wenson Hsieh [WK2] Cannot select text on nytimes.com when the selection granularity is WKSelectionGranularityCharacter https://bugs.webkit.org/show_bug.cgi?id=170968 Reviewed by Dan Bernstein. Makes a small adjustment to textInteractionGesture:shouldBeginAtPoint:. When determining whether to allow the text interaction assistant to recognize at a given point, instead of depending on whether or not the hit node is the same as the assisted node, only enforce this restriction when editing an assisted node. Otherwise, default to allowing the selection gesture. Note that character granularity selection was working on most pages before, due to the fact that nodeAtPositionIsAssistedNode was true in many cases when there is no assisted node at all. This is because, in WebPage.mm, we compute the hit-tested node responding to click events to be null, and then set nodeAtPositionIsAssistedNode to be equal to hitNode == m_assistedNode, which ends up being true because both of these values are null. This allowed text selection to work in the simple case when selection granularity character is used, but not when the node containing the selected point actually does respond to click events, since the comparison returns false. New layout test: LayoutTests/editing/selection/character-granularity-select-text-with-click-handler.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): 2017-04-18 Keith Rollin Add additional information when logging URL disposition in WebLoaderStrategy::scheduleLoad https://bugs.webkit.org/show_bug.cgi?id=170813 Reviewed by Alex Christensen. There are a few logging statements in WebLoaderStrategy::scheduleLoad that report, for example, "URL will be loaded as data". These statements also log the address of the frame doing the loading and the identifier of the resource. For consistency with other logging and to make scripted analysis of the logs more robust, also include the pageID and frameID in the logging. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): 2017-04-18 Anders Carlsson Stop using deprecated APIs, part 2 https://bugs.webkit.org/show_bug.cgi?id=170965 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Remove the status member variable. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::status): New function to be used by older OSes. This will recreate a PKPaymentAuthorizationStatus given a ShippingContactUpdate. (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Stop using the deprecated API. 2017-04-18 Timothy Horton Force scroll view insets to be respected regardless of rubber-banding state https://bugs.webkit.org/show_bug.cgi?id=170937 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2017-04-18 Carlos Garcia Campos [GLIB] Define priorities also for async network IO tasks https://bugs.webkit.org/show_bug.cgi?id=170905 Reviewed by Žan Doberšek. * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::inputStreamReadReadyCallback): (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::outputStreamWriteReadyCallback): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection): (WebKit::NetworkDataTaskSoup::read): (WebKit::NetworkDataTaskSoup::requestNextPart): (WebKit::NetworkDataTaskSoup::writeDownload): (WebKit::NetworkDataTaskSoup::didFinishDownload): * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: (webkitURISchemeRequestReadCallback): (webkit_uri_scheme_request_finish): 2017-04-17 Timothy Horton Plumb all four obscured insets to WebCore, instead of just top/left https://bugs.webkit.org/show_bug.cgi?id=170913 Reviewed by Wenson Hsieh. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::obscuredInsets): (WebKit::operator==): (WebKit::VisibleContentRectUpdateInfo::obscuredInset): Deleted. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): (-[WKWebView _updateVisibleContentRects]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::restorePageState): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::restorePageState): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::restorePageState): (WebKit::WebPage::updateVisibleContentRects): Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization). 2017-04-17 Joseph Pecoraro Web Inspector: Doesn't show size of compressed content correctly https://bugs.webkit.org/show_bug.cgi?id=155112 Reviewed by Alex Christensen and Timothy Hatcher. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::sendResultForCacheEntry): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Include size information in network load metrics. 2017-04-17 Youenn Fablet com.apple.WebKit.Networking.Development crashed in com.apple.WebKit: WebKit::NetworkRTCProvider::resolvedName https://bugs.webkit.org/show_bug.cgi?id=170889 Reviewed by Alex Christensen. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::Resolver::~Resolver): Unschedule the host resolution in addition to cancelling it. Providing a test would need to stop the resolver between the time the resolver is created and gets data in the network process. Or we would need to change Resolver to be instantiated/tested on its own. * NetworkProcess/webrtc/NetworkRTCProvider.h: 2017-04-17 Brady Eidson Make WKHTTPCookieStore public. and https://bugs.webkit.org/show_bug.cgi?id=170920 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: (-[WKHTTPCookieStore getAllCookies:]): (-[WKHTTPCookieStore allCookies:]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore httpCookieStore]): (-[WKWebsiteDataStore _httpCookieStore]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * WebKit2.xcodeproj/project.pbxproj: 2017-04-17 Eric Carlson [MediaStream] Fix typo in UIDelegate::mediaCaptureStateDidChange https://bugs.webkit.org/show_bug.cgi?id=170911 Reviewed by Youenn Fablet. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): Fix typo. 2017-04-17 Keith Rollin Move and update WebLoaderStrategy logging statement https://bugs.webkit.org/show_bug.cgi?id=170140 Reviewed by Alex Christensen. WebLoaderStrategy::scheduleLoad has a logging statement that says, in part: "Resource has been queued for scheduling with the NetworkProcess". This statement is emitted after the ScheduleResourceLoad message has been successfully sent to the NetworkProcess. The logging statement was added at this location to indicate that the resource-load had been successfully handed off; it pairs a similar logging statement that is emitted if the sending of the ScheduleResourceLoad message fails. I think it would be better to move this logging statement before the ScheduleResourceLoad message is sent to the NetworkProcess (and change its wording to "Resource is being scheduled with the NetworkProcess"). The reason for this change is to help make sure that the sequence of logging statements is more deterministic. In the current form, the message "Resource has been queued for scheduling with the NetworkProcess" normally appears before any NetworkProcess logging statements that indicate that the resource-loading is continuing there, but in rare occasions the logging statements can be reversed. This change in the ordering of the statements has caused a problem in a script I've written that examines the resource-loading process and looks for errors. By ensuring that the WebLoaderStrategy statement always appears before the NetworkResourceLoader statement, the flow makes better sense and the script can be more robust. In making this change, we are probably not giving up any assurance that the ScheduleResourceLoad message has been sent to the NetworkResourceLoader. If the message is successfully sent, we'll see logging in the NetworkProcess. If the message has not been sent, we'll see WebLoaderStrategy logging an error. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): 2017-04-17 Anders Carlsson Stop using deprecated APIs, part 1 https://bugs.webkit.org/show_bug.cgi?id=170915 rdar://problem/31589635 Reviewed by Tim Horton. Stop using the PKPaymentRequestPaymentMethodUpdate initializer that takes a status, it's been deprecated and we always passed PKPaymentAuthorizationStatusSuccess anyway. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): 2017-04-17 Youenn Fablet Disable outdated WritableStream API https://bugs.webkit.org/show_bug.cgi?id=170749 Reviewed by Alex Christensen. Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by: - A STREAMS_API compilation flag. - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT. * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-04-17 Tim Horton Provide a viewport parameter to disable clipping to the safe area https://bugs.webkit.org/show_bug.cgi?id=170766 Reviewed by Beth Dakin. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::setClipToSafeArea): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::clipToSafeArea): * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didChangeClipToSafeArea): * WebProcess/WebCoreSupport/WebChromeClient.h: * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeClipToSafeArea): * UIProcess/mac/PageClientImpl.h: Forward clip-to-safe-area changes from ChromeClient to WKWebView. Update visible content rects when it changes, which will result in a call to updateFixedClippingView, as below. Keep track of the current state in the UI process. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _contentMayDrawInObscuredInsets]): Expose the current state of the clip-to-safe-area bit as SPI. * UIProcess/ios/WKContentView.mm: (-[WKContentView updateFixedClippingView:]): Disable fixed clipping when clip-to-safe-area is disabled. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): Push the viewport's clip-to-safe-area bit onto the main frame's FrameView. 2017-04-17 Dan Bernstein [Cocoa] Move isNullFunctionPointer down into WTF https://bugs.webkit.org/show_bug.cgi?id=170892 Reviewed by Sam Weinig. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Changed to use WTF::isNullFunctionPointer. (WebKit::isNullFunctionPointer): Deleted. 2017-04-17 Wenson Hsieh [WK2] Respect a new internal setting for defaulting to character selection granularity https://bugs.webkit.org/show_bug.cgi?id=170904 Reviewed by Dan Bernstein. Respect a new WebKitDebugDefaultSelectionGranularityCharacter user default by initializing WKWebViewConfiguration with WKSelectionGranularityCharacter, but only when linked on or after the first iOS to use WKSelectionGranularityCharacter by default. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-17 Eric Carlson Provide a way for clients to unmute a media stream. https://bugs.webkit.org/show_bug.cgi?id=170855 Reviewed by Jon Lee. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setPageMuted:]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-17 Jeremy Jones Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video. https://bugs.webkit.org/show_bug.cgi?id=170778 Reviewed by Tim Horton. setUseAVFoundationAudioCapture is moved from AVCaptureDeviceManager to RealtimeMediaSourceCenterMac. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): 2017-04-15 Keith Rollin Include resource size in some existing logging https://bugs.webkit.org/show_bug.cgi?id=170866 Reviewed by Alex Christensen. In order to correlate resource load times with resource size, we log when the resource is starting to be loaded and when the resource is finished loading. In NetworkResourceLoader::didReceiveResponse, we also log the expected resource length. However, we can only log the length if it is provided in Content-Length, which is not always the case. If it's not provided, we end up logging "length = -1". To make up for this, change NetworkResourceLoader::didFinishLoading and WebResourceLoader:: didFinishLoading to log the length once we know it. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): * NetworkProcess/NetworkResourceLoader.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveData): (WebKit::WebResourceLoader::didFinishResourceLoad): * WebProcess/Network/WebResourceLoader.h: 2017-04-15 Wenson Hsieh [WK2] Support data interaction of files into file inputs https://bugs.webkit.org/show_bug.cgi?id=170803 Reviewed by Tim Horton. Implements remaining support for performing data interaction onto file inputs. There are two main changes at this layer: plumbing the number of files in the pasteboard to the web process, and pulling the implementation of createSandboxExtensionsIfNeeded out of Mac-specific WebViewImpl::createSandboxExtensionsIfNeeded and into WebPageProxy::createSandboxExtensionsIfNeeded. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Relax special-casing of encoding and decoding filenames to be PLATFORM(COCOA) rather than PLATFORM(MAC). * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getNumberOfFiles): More boilerplate plumbing to deliver the number of files in the pasteboard to the web process. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded): Deleted. Move the logic in WebViewImpl::createSandboxExtensionsIfNeeded over to WebPageProxy::createSandboxExtensionsIfNeeded. * UIProcess/WebPageProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getNumberOfFiles): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-14 Mark Lam Update architectures in xcconfig files. https://bugs.webkit.org/show_bug.cgi?id=170867 Reviewed by Joseph Pecoraro. * Configurations/FeatureDefines.xcconfig: 2017-04-14 Wenson Hsieh [WK2] Support Icon creation from file URLs on iOS https://bugs.webkit.org/show_bug.cgi?id=170809 Reviewed by Tim Horton. Refactors file icon generation logic to support showing an Icon representing the content at a list of file paths on iOS. Pulls out logic in WKFileUploadPanel responsible for generating the thumbnail image for a file input into separate helpers in WebIconUtilities, and then uses these utilities in both WKFileUploadPanel and WebChromeClientIOS. * Shared/ios/WebIconUtilities.h: Added. * Shared/ios/WebIconUtilities.mm: Added. (WebKit::squareCropRectForSize): (WebKit::squareImage): (WebKit::thumbnailSizedImageForImage): (WebKit::fallbackIconForFile): (WebKit::iconForImageFile): (WebKit::iconForVideoFile): (WebKit::iconForFile): Add logic for generating thumbnail icons, moved from WKFileUploadPanel.mm. * UIProcess/ios/forms/WKFileUploadPanel.mm: (squareCropRectForSize): Deleted. (squareImage): Deleted. (thumbnailSizedImageForImage): Deleted. (fallbackIconForFile): Deleted. (iconForImageFile): Deleted. (iconForVideoFile): Deleted. (iconForFile): Deleted. Remove logic for generating thumbnail icons. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::loadIconForFiles): (WebKit::WebChromeClient::createIconForFiles): Rather than call Icon::createIconForFiles directly, loadIconForFiles now consults ChromeClient::createIconForFiles instead. On other platforms, this just turns around and calls Icon::createIconForFiles, but on iOS, we use the utilities introduced in WebIconUtilities to generate a file icon. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::createIconForFiles): 2017-04-14 Brady Eidson Fix basic WKURLSchemeHandler bugs. and https://bugs.webkit.org/show_bug.cgi?id=170862 Reviewed by Andy Estes. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/WebURLSchemeHandlerTask.cpp: (WebKit::WebURLSchemeHandlerTask::didReceiveResponse): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): (WebKit::WebLoaderStrategy::remove): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::startNewTask): (WebKit::WebURLSchemeHandlerProxy::taskDidComplete): (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp: (WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy): (WebKit::WebURLSchemeHandlerTaskProxy::stopLoading): (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse): (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData): (WebKit::WebURLSchemeHandlerTaskProxy::didComplete): (WebKit::WebURLSchemeHandlerTaskProxy::hasLoader): * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h: (WebKit::WebURLSchemeHandlerTaskProxy::identifier): 2017-04-14 Jer Noble [MediaSource] Push capabilities across process boundary during UIProcess capture. https://bugs.webkit.org/show_bug.cgi?id=170814 Reviewed by Eric Carlson. Make a new synchronous getter for capabilities(), moderated by only requesting the capabilities() cross-process the first time called. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::capabilities): (WebKit::UserMediaCaptureManagerProxy::supportedConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setCapabilities): (WebKit::UserMediaCaptureManager::capabilities): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-13 Dan Bernstein [Cocoa] Allow clients to specify in _WKProcessPoolConfiguration additional directory sandbox extensions https://bugs.webkit.org/show_bug.cgi?id=170387 Reviewed by Sam Weinig. Test: TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm Added an additionalReadAccessAllowedURLs property to _WKProcessPoolConfiguration. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Encode the new additionalSandboxExtensionHandles member. (WebKit::WebProcessCreationParameters::decode): Decode it. * Shared/WebProcessCreationParameters.h: Added additionalSandboxExtensionHandles member. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): Copy new m_additionalReadAccessAllowedPaths member. * UIProcess/API/APIProcessPoolConfiguration.h: Added m_additionalReadAccessAllowedPaths member and accessor functions. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declared new additionalReadAccessAllowedURLs property whose value is an array of URLs to which the Web Content process will be given read access. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): New getter that returns an array of file URLs from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths(). (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): New setter that checks that the given URLs are file URLs and populates the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths with their paths. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Populate the new m_resolvedPaths.additionalWebProcessSandboxExtensionPaths with resolved paths from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths. (WebKit::WebProcessPool::createNewWebProcess): Populate the WebProcessCreationParameters’s additionalSandboxExtensionHandles member with read-only sandbox extensions created from the resolved paths. * UIProcess/WebProcessPool.h: Added additionalWebProcessSandboxExtensionPaths member to the Paths struct. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Consume the additional sandbox extensions. 2017-04-13 Alex Christensen Fix CMake build https://bugs.webkit.org/show_bug.cgi?id=170815 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): 2017-04-12 Dan Bernstein [Mac] Future-proof .xcconfig files https://bugs.webkit.org/show_bug.cgi?id=170802 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: * Configurations/Version.xcconfig: 2017-04-12 Brady Eidson QuotaExceededError when saving to localStorage in private mode. https://bugs.webkit.org/show_bug.cgi?id=157010 Reviewed by Alex Christensen. * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::~StorageAreaMap): * WebProcess/Storage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace): (WebKit::StorageNamespaceImpl::storageArea): (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): (WebKit::StorageNamespaceImpl::copy): * WebProcess/Storage/StorageNamespaceImpl.h: * WebProcess/Storage/WebStorageNamespaceProvider.cpp: (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): * WebProcess/Storage/WebStorageNamespaceProvider.h: 2017-04-12 Yusuke Suzuki Unreviewed, fix build failure on Ubuntu LTS GTK bot https://bugs.webkit.org/show_bug.cgi?id=170781 * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): 2017-04-12 Eric Carlson [MediaStream] rename -[WKWebView _stopMediaCapture] https://bugs.webkit.org/show_bug.cgi?id=170791 Reviewed by Youenn Fablet. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _muteMediaCapture]): (-[WKWebView _stopMediaCapture]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-12 Ryan Haddad Unreviewed build fix. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): 2017-04-12 Jer Noble [WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options. https://bugs.webkit.org/show_bug.cgi?id=170790 Reviewed by Alex Christensen. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCreate): (WKContextConfigurationCreateWithLegacyOptions): * UIProcess/API/C/WKContextConfigurationRef.h: 2017-04-12 Jer Noble [WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happening in UIProcess. https://bugs.webkit.org/show_bug.cgi?id=170781 Reviewed by Alex Christensen. Simultaneously, allow clients to configure whether capturing will occur in the UIProcess through _WKProcessPoolConfiguration. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationShouldCaptureAudioInUIProcess): (WKContextConfigurationSetShouldCaptureAudioInUIProcess): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration shouldCaptureAudioInUIProcess]): (-[_WKProcessPoolConfiguration setShouldCaptureAudioInUIProcess:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): 2017-04-12 Keith Rollin Add some missing NetworkResourceLoader logging https://bugs.webkit.org/show_bug.cgi?id=170139 Reviewed by Alex Christensen. Once execution enters the lambda in NetworkResourceLoader::retrieveCacheEntry, there is little indication of which exit point was taken. If flow enters into startNetworkLoad, we'll get some logging from that function, but not from the others. Add some logging so that we know what the result was from looking up the resource in the cache. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): 2017-04-12 Anders Carlsson Tweak WebCore::setMetadataURL function https://bugs.webkit.org/show_bug.cgi?id=170786 Reviewed by Beth Dakin. Update for WebCore changes. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): 2017-04-12 Brent Fulgham [WK2][Mac] Stop allowing access to disk arbitration process https://bugs.webkit.org/show_bug.cgi?id=170517 Reviewed by Alex Christensen. * WebProcess/com.apple.WebProcess.sb.in: 2017-04-12 Beth Dakin 32-bit build fix. * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): 2017-04-12 Beth Dakin More 32-bit build fix. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): (-[WKView _addMediaPlaybackControlsView:]): 2017-04-12 Beth Dakin Another 32 bit build fix. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::mediaPlaybackControlsView): 2017-04-12 Alex Christensen Stop using didReceiveDataArray callback on El Capitan https://bugs.webkit.org/show_bug.cgi?id=170780 Reviewed by Brady Eidson. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::supportsDataArray): Deleted. (WebKit::NetworkLoad::didReceiveDataArray): Deleted. * NetworkProcess/NetworkLoad.h: 2017-04-12 Beth Dakin Speculative build fix. * UIProcess/API/Cocoa/WKViewPrivate.h: 2017-04-12 Beth Dakin Attempted build fix. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-12 Beth Dakin Adopt AVKit name change from AVFunctionBar* to AVTouchBar* https://bugs.webkit.org/show_bug.cgi?id=170693 -and corresponding- rdar://problem/31230018 Reviewed by Sam Weinig. Since the new names only apply to some versions of macOS, this patch uses typedefs for the older OS’s. SO: AVFunctionBarScrubber is now AVTouchBarScrubber AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption And the protocol AVFunctionBarPlaybackControlsControlling is now AVTouchBarPlaybackControlsControlling Use the new name. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): (-[WKView _addMediaPlaybackControlsView:]): * UIProcess/Cocoa/WebViewImpl.h: Soft links and allocations cannot use the typedefs. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::mediaPlaybackControlsView): (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-12 Eric Carlson [MediaStream] Audio source in UI process not identified as capture source https://bugs.webkit.org/show_bug.cgi?id=170776 Reviewed by Youenn Fablet. * WebProcess/cocoa/UserMediaCaptureManager.cpp: Override isCaptureSource. 2017-04-12 Andrew Gold Allow iOS to toggle webRTCAPI legacy flag. https://bugs.webkit.org/show_bug.cgi?id=170735 Reviewed by Eric Carlson. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _webRTCLegacyAPIEnabled]): (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-04-12 Yusuke Suzuki Unreviewed, build fix for GTK port after r215262 https://bugs.webkit.org/show_bug.cgi?id=170758 * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didRead): 2017-04-12 Yusuke Suzuki [WTF] Introduce Thread class and use RefPtr and align Windows Threading implementation semantics to Pthread one https://bugs.webkit.org/show_bug.cgi?id=170502 Reviewed by Mark Lam. Mechanical change. Use Thread:: APIs. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::readSyncInThread): * Platform/IPC/Connection.cpp: (IPC::Connection::processIncomingMessage): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): * UIProcess/linux/MemoryPressureMonitor.cpp: (WebKit::MemoryPressureMonitor::MemoryPressureMonitor): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-04-10 Antti Koivisto Cache small media resources in disk cache https://bugs.webkit.org/show_bug.cgi?id=170676 Reviewed by Andreas Kling. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeRetrieveDecision): Allow retrieving media resources. (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange): (WebKit::NetworkCache::expectedTotalResourceSize): (WebKit::NetworkCache::makeStoreDecision): Store media resource if we can figure out its total size and it is less than 5MB (and it is cacheable by the usual rules). 2017-04-12 Alex Christensen Modernize vector adoption https://bugs.webkit.org/show_bug.cgi?id=170758 Reviewed by Geoffrey Garen. * NetworkProcess/capture/NetworkCaptureEvent.cpp: (WebKit::NetworkCapture::JSONCoder::decode): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::bufferForType): 2017-04-12 Zan Dobersek Unreviewed GTK+ debug build fix. Drop an unused debug-only member variable in the CompositingRunLoop class. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: 2017-04-11 Zan Dobersek [GTK] Use the DisplayRefreshMonitor facilities https://bugs.webkit.org/show_bug.cgi?id=170599 Reviewed by Carlos Garcia Campos. ThreadedCompositor gains a DisplayRefreshMonitor member that it can use to better coordinate display refresh callbacks on the main thread. Still, because currently the GTK+ port doesn't have a reliable way of notifying the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used in order to keep the updates at a reasonable rate. When the timer is fired, the ThreadedCompositor decides how to proceed based on state changes that might have occurred during composition or whether there's any display refresh callbacks that require handling on the main thread. CompositingRunLoop now stores its state in an atomic variable that's then inspected whenever a new update is scheduled or completed. When scheduled, if there's no update in progress, a new update is requested through the timer. If there's already an update in progress, a new update is marked as pending after the current one completes. In that case, when the update is completed, a new update is requested through the timer. ThreadedDisplayRefreshMonitor is used to coordinate updates between the main and the composition thread whenever the CoordinatedGraphics state demands it, or whenever there are clients registered to that monitor that require an update (e.g. a requestAnimationFrame() callback). After the update on the composition thread is finished, and the DisplayRefreshMonitor object requires an update, a callback at the same priority as the layer flush timer is scheduled on the main thread. In that callback we handle any clients registered for this DisplayRefreshMonitor before proceeding to handle any changes to the CoordinatedGraphics scene. In case the DisplayRefreshMonitor clients or the layer flushes already queued up any changes to the state, we immediately ask the ThreadedCompositor for an update. * PlatformGTK.cmake: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::updateViewport): (WebKit::CoordinatedGraphicsScene::commitSceneState): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): (WebKit::CompositingRunLoop::isActive): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::updateCompleted): (WebKit::CompositingRunLoop::updateTimerFired): (WebKit::CompositingRunLoop::isCurrent): (WebKit::CompositingRunLoop::startUpdateTimer): Deleted. (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: (): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::invalidate): (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): (WebKit::ThreadedCompositor::updateViewport): (WebKit::ThreadedCompositor::scheduleDisplayImmediately): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::displayRefreshMonitor): (WebKit::ThreadedCompositor::renderNextFrameIfNeeded): (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): (WebKit::ThreadedCompositor::performFrameCompletion): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added. (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::invalidate): (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor): * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/LayerTreeHost.h: (WebKit::LayerTreeHost::createDisplayRefreshMonitor): 2017-04-11 Alex Christensen Modernize and clean up code https://bugs.webkit.org/show_bug.cgi?id=170752 Reviewed by Sam Weinig. * NetworkProcess/NetworkResourceLoader.h: * Shared/WebPreferencesStore.h: * UIProcess/API/APIHitTestResult.cpp: (API::HitTestResult::create): * UIProcess/API/APIHitTestResult.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesCreate): (WKPreferencesCreateWithIdentifier): (WKPreferencesCreateCopy): * UIProcess/Authentication/AuthenticationChallengeProxy.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults): (WebKit::WebPreferences::copy): * UIProcess/WebPreferences.h: * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::requestCheckingOfString): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addTextCheckingRequest): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::rangeForBlockAtPoint): (WebKit::WebPage::expandedRangeFromHandle): (WebKit::WebPage::contractedRangeFromHandle): (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): (WebKit::WebPage::changeBlockSelection): (WebKit::WebPage::rangeForGranularityAtPoint): (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): 2017-04-11 Dean Jackson Disable outdated WritableStream API https://bugs.webkit.org/show_bug.cgi?id=170749 Reviewed by Tim Horton. The API we implement is no longer accurate. Disable it until we are compatible with the new specification * Configurations/FeatureDefines.xcconfig: 2017-04-11 Dan Bernstein [Cocoa] WebKit unnecessarily soft-links CorePrediction https://bugs.webkit.org/show_bug.cgi?id=170644 Reviewed by Sam Weinig. * Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES. * Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where available. On macOS, use weak linking, because CorePrediction is not available in the Base System. * Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with #if HAVE(CORE_PREDICTION). (WebKit::isNullFunctionPointer): Added this helper. (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced dlopen()-based runtime check with a null check. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if HAVE(CORE_PREDICTION). * Platform/spi/Cocoa/CorePredictionSPI.h: Added. * UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION). * WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition. 2017-04-11 David Quesada Add SPI for handling geolocation authorization requests https://bugs.webkit.org/show_bug.cgi?id=170362 rdar://problem/17508627 Reviewed by Alex Christensen. Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page requests geolocation access. To support testing this change, make it possible to override the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable object on the process pool that implements a protocol for providing location updates for web views in the process pool. If the client doesn't provide this object, WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1 WebGeolocationCoreLocationProvider and conforms to the new protocol. * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/WebGeolocationPosition.h: (WebKit::WebGeolocationPosition::create): * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate_b): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _coreLocationProvider]): (-[WKProcessPool _setCoreLocationProvider:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. * UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added. (WebKit::if): (-[_WKGeolocationPosition dealloc]): (-[_WKGeolocationPosition _apiObject]): * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. (WebKit::wrapper): * UIProcess/ios/WKGeolocationProviderIOS.mm: (kit): (-[WKGeolocationProviderIOS initWithProcessPool:]): (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): (-[WKGeolocationProviderIOS positionChanged:]): (-[WKLegacyCoreLocationProvider setListener:]): (-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]): (-[WKLegacyCoreLocationProvider start]): (-[WKLegacyCoreLocationProvider stop]): (-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]): (-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]): (-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]): (-[WKLegacyCoreLocationProvider positionChanged:]): (-[WKLegacyCoreLocationProvider errorOccurred:]): (-[WKLegacyCoreLocationProvider resetGeolocation]): Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS expects. * WebKit2.xcodeproj/project.pbxproj: 2017-04-11 Eric Carlson [MediaStream] Set correct audio session category when capturing audio https://bugs.webkit.org/show_bug.cgi?id=170736 Reviewed by Jer Noble. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): 2017-04-11 Youenn Fablet Activate WebRTC data channel tests for WK1 https://bugs.webkit.org/show_bug.cgi?id=170710 Reviewed by Eric Carlson. * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure networking is not done in the Web process. 2017-04-11 Chris Fleizach AX: PDF plugin needs to support PDF-DOM Mode https://bugs.webkit.org/show_bug.cgi?id=170589 Reviewed by Tim Horton. Provide access to DOM objects with PDF document. This mean: 1) Support a different set of attributes for WKPDFPluginAccessibilityObject. WKPDFPluginAccessibilityObject is now a group instead of forwarding attribute calls to the pdf layer. 2) Connect the focused UI element to the active annotation if possible. 3) Mark the PDF associated nodes with an attribute so they can be identified later so their correct parent can be found. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (-[WKPDFPluginAccessibilityObject pdfLayerController]): (-[WKPDFPluginAccessibilityObject setPdfLayerController:]): (-[WKPDFPluginAccessibilityObject convertRectToScreenSpace:]): (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]): (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]): (-[WKPDFPluginAccessibilityObject accessibilityActionNames]): (-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]): (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]): (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]): (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]): (WebKit::PDFPlugin::convertFromRootViewToPDFView): (WebKit::PDFPlugin::convertFromPDFViewToScreen): (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest): (WebKit::PDFPlugin::axObjectCache): (WebKit::PDFPlugin::accessibilityShadowPluginParentForElement): * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::attach): * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::accessibilityShadowPluginParentForElement): (WebKit::Plugin::pluginHandlesContentOffsetForAccessibilityHitTest): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::accessibilityShadowPluginParentForElement): * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2017-04-11 Adrian Perez de Castro [GTK] Attach popup menu to web view widget https://bugs.webkit.org/show_bug.cgi?id=145866 Use gtk_menu_attach_to_widget() to let GTK+ know that popup menus belong to a certain web view. This improves the positioning choices that the toolkit can do, and solves a long-standing issue that caused long popup menus to hang outside of the available display area under Wayland. Based on a patch by Jonas Ådahl . Reviewed by Carlos Garcia Campos. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): 2017-04-10 Alex Christensen Revert r215217 https://bugs.webkit.org/show_bug.cgi?id=170703 * Configurations/FeatureDefines.xcconfig: 2017-04-10 Alex Christensen Continue enabling WebRTC https://bugs.webkit.org/show_bug.cgi?id=170703 Reviewed by Youenn Fablet. * Configurations/FeatureDefines.xcconfig: 2017-04-10 Alex Christensen REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions https://bugs.webkit.org/show_bug.cgi?id=170707 Reviewed by Tim Horton. We fix this by sending the UserContentController with the WebPageCreationParameters instead of in a IPC message immediately following creation. By the time the WebPage receives its second message, it has already started loading the first main resource. I also changed all instances of calling ChildProcessProxy::connection() to send a message in favor of calling ChildProcessProxy::send, which does the same thing except if a child process has not started, it will put the message in a queue and send it when the process is finished launching. This was necessary because the UserContentController is now connected to the process sooner, so there were some API tests that would try to send messages between initiating a process launch and finishing a process launch, and this change preserves the existing behavior in those cases. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection): (WebKit::DatabaseProcessProxy::didFinishLaunching): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::cancel): (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): (WebKit::DownloadProxy::willSendRequest): (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::addUserContentWorldUse): (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses): (WebKit::WebUserContentControllerProxy::addUserScript): (WebKit::WebUserContentControllerProxy::removeUserScript): (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::addUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers): (WebKit::WebUserContentControllerProxy::addContentExtension): (WebKit::WebUserContentControllerProxy::removeContentExtension): (WebKit::WebUserContentControllerProxy::removeAllContentExtensions): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired): (WebKit::VisitedLinkStore::sendTable): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): (WebKit::WebPageProxy::creationParameters): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addWebUserContentControllerProxy): * UIProcess/WebProcessProxy.h: * WebProcess/UserContent/WebUserContentController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_backgroundCPULimit): 2017-04-10 Alex Christensen Add API to get available content extension identifiers in a WKContentExtensionStore https://bugs.webkit.org/show_bug.cgi?id=170093 Reviewed by Geoffrey Garen. * UIProcess/API/APIContentExtensionStore.cpp: (API::constructedPathPrefix): (API::constructedPathFilter): (API::constructedPath): (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): * UIProcess/API/APIContentExtensionStore.h: * UIProcess/API/Cocoa/WKContentExtensionStore.h: * UIProcess/API/Cocoa/WKContentExtensionStore.mm: (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]): (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]): (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]): (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): 2017-04-10 Jeremy Jones Add CoreAudioCaptureSource. https://bugs.webkit.org/show_bug.cgi?id=170112 rdar://problem/30293338 Reviewed by Tim Horton. Add UseAVFoundationAudioCapture preference to switch back from the new default of CoreAudio. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetUseAVFoundationAudioCapture): (WKPreferencesGetUseAVFoundationAudioCapture): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-10 Brent Fulgham [WK2][macOS] Block access to Apple Events before launch. https://bugs.webkit.org/show_bug.cgi?id=170626 Reviewed by Alexey Proskuryakov. Clear the environment of the AppleEvent server name before initializing AppKit so we never bother connecting. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (main): 2017-04-10 Adrian Perez de Castro [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup() https://bugs.webkit.org/show_bug.cgi?id=170553 Reviewed by Michael Catanzaro. Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when building with GTK+ 3.22 or newer. This allows the Wayland GTK+ backend to properly position popup menus, and also avoids using functions which were deprecated starting at that GTK+ release. * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::WebContextMenuProxyGtk::show): Use gtk_menu_popup_at_pointer() as there is always a pointer event that can be passed to it. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_popup_at_rect(), using the coordinates of the control passed as reference rectangle. Some conditional code is needed because with newer GTK+ versions a relative offset instead of an absolute position is needed. 2017-04-10 Adrian Perez de Castro [GTK] Opening a popup menu does not pre-select the active item https://bugs.webkit.org/show_bug.cgi?id=170680 Reviewed by Michael Catanzaro. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_shell_select_item() to ensure that the active item appears selected right after popping up the menu. 2017-04-10 Carlos Garcia Campos [GTK] Enable DOM timer throttling and CSS animations suspension https://bugs.webkit.org/show_bug.cgi?id=170669 Reviewed by Žan Doberšek. * Shared/WebPreferencesDefinitions.h: 2017-04-10 Chris Dumez Drop Timer::startOneShot() overload taking a double https://bugs.webkit.org/show_bug.cgi?id=170659 Reviewed by Yusuke Suzuki. Drop Timer::startOneShot() overload taking a double as people should use Seconds type now. * NetworkProcess/PingLoad.h: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::startTimeout): * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog): (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): (IPC::Connection::terminateSoon): * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::setMinimumLifetime): * PluginProcess/PluginProcess.h: * Shared/ChildProcess.cpp: (WebKit::ChildProcess::ChildProcess): * Shared/ChildProcess.h: (WebKit::ChildProcess::setTerminationTimeout): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::startUpdateTimer): * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::initializeTimers): * Shared/WebProcessCreationParameters.h: * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm: (API::SharedJSContext::ensureContext): * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::shutDownProcess): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didChangeIsLoading): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog): * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw): * UIProcess/Gamepad/UIGamepadProvider.cpp: * UIProcess/Plugins/PluginProcessProxy.cpp: * UIProcess/ProcessThrottler.cpp: * UIProcess/ResponsivenessTimer.cpp: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::DragGesture::begin): * UIProcess/mac/WebInspectorProxyMac.mm: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::scheduleAnimation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): * WebProcess/WebProcess.cpp: 2017-04-09 Wenson Hsieh [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes https://bugs.webkit.org/show_bug.cgi?id=170658 Reviewed by Tim Horton. Introduces doAfterPositionInformationUpdate:forRequest:, which WKContentView can use internally to perform an action requiring InteractionInformationAtPosition asynchronously. See below for additional details. New API unit test: DataInteractionTests.UnresponsivePageDoesNotHangUI. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView _actionForLongPress]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): If current position information satisfies the request, then perform the given block immediately; otherwise, we save the block and request as a pair in a list of pending position information handlers, and then make a new request to the web process for position information if the currently outgoing request does not already satisfy the given request. (-[WKContentView ensurePositionInformationIsUpToDate:]): Fire all asynchronous position information handlers that are satisfied by the incoming position information. (-[WKContentView requestAsynchronousPositionInformationUpdate:]): (-[WKContentView _currentPositionInformationIsValidForRequest:]): (-[WKContentView _hasValidOutstandingPositionInformationRequest:]): Pulled out common logic for managing InteractionInformationRequests into separate helper methods. (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]): (-[WKContentView gestureRecognizerShouldBegin:]): Refactored to use ensurePositionInformationIsUpToDate:. There is no behavior change here, but it makes sure that this particular request will also any valid pending position information handlers. (-[WKContentView _positionInformationDidChange:]): Fire all asynchronous position information handlers that are satisfied by the incoming position information. (-[WKContentView pointIsInDataInteractionContent:]): Deleted. We should no longer use this method, since it makes a synchronous request to the web process -- see positionInformationMayStartDataInteraction. 2017-04-09 Chris Dumez Drop Timer::startRepeating() overload taking a double https://bugs.webkit.org/show_bug.cgi?id=170656 Reviewed by Yusuke Suzuki. Drop Timer::startRepeating() overload taking a double as people should use Seconds type now. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::initializeTimers): * UIProcess/Cocoa/ViewGestureController.cpp: * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: * UIProcess/PerActivityStateCPUUsageSampler.cpp: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::Timer::start): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): 2017-04-09 Jon Lee [WK2][iOS] Add CoreMedia entitlement for WebProcess https://bugs.webkit.org/show_bug.cgi?id=170623 rdar://problem/30020073 Reviewed by Youenn Fablet. * Configurations/WebContent-iOS.entitlements: Update entitlement to an array of strings instead of bool. 2017-04-09 Chris Dumez Start dropping Timer API dealing with double https://bugs.webkit.org/show_bug.cgi?id=170649 Reviewed by Yusuke Suzuki. Start dropping Timer API dealing with double as people should use Seconds now. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::scheduleFailure): * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::resume): * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::destroy): (WebKit::PluginControllerProxy::startPaintTimer): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseScheduleUpdateActivityState): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::setViewExposedRect): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::addVisitedLinkHash): * UIProcess/WebProcessPool.cpp: (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter): * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::ZoomGesture::scaleChanged): * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::menuUnmappedCallback): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::addToInvalidationQueue): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::deliverDataToPlugin): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pendingURLRequestsTimerFired): (WebKit::PluginView::loadURL): * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::scheduleDisplay): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateIsInWindow): (WebKit::WebPage::addPluginView): (WebKit::WebPage::setMayStartMediaWhenInWindow): (WebKit::WebPage::didFinishLoad): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): 2017-04-08 Chris Dumez Drop std::chrono support from Timer class https://bugs.webkit.org/show_bug.cgi?id=170645 Reviewed by Sam Weinig. Drop std::chrono support from Timer class now that we prefer using Seconds type. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::Throttle::Throttle): (WebKit::NetworkLoad::didReceiveResponseNetworkSession): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::loadThrottleLatency): * NetworkProcess/NetworkProcessCreationParameters.cpp: * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: * NetworkProcess/cache/NetworkCacheStatistics.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::store): * Shared/CacheModel.cpp: (WebKit::calculateMemoryCacheSizes): * Shared/CacheModel.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): * WebProcess/Plugins/PluginView.cpp: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately): (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): * WebProcess/WebProcess.cpp: (WebKit::m_resourceLoadStatisticsStore): (WebKit::WebProcess::setCacheModel): 2017-04-08 Chris Dumez Unreviewed attempt to fix GTK build after r215138. * UIProcess/API/gtk/WebKitUIClient.cpp: 2017-04-08 Youenn Fablet WebRTC tests gardening https://bugs.webkit.org/show_bug.cgi?id=170508 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2017-04-08 Chris Dumez Timer's nextFireInterval() / repeatInterval() should return Seconds https://bugs.webkit.org/show_bug.cgi?id=170639 Reviewed by Simon Fraser. Timer's nextFireInterval() / repeatInterval() should return Seconds, not double. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::layerVolatilityTimerFired): (WebKit::WebPage::markLayersVolatile): 2017-04-07 Alex Christensen Modernize WebPage.h https://bugs.webkit.org/show_bug.cgi?id=170633 Reviewed by Joseph Pecoraro. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): * UIProcess/API/C/WKPage.cpp: (WebKit::RunBeforeUnloadConfirmPanelResultListener::create): (WebKit::RunJavaScriptAlertResultListener::create): (WebKit::RunJavaScriptConfirmResultListener::create): (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener): (WebKit::RunJavaScriptPromptResultListener::create): (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener): (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::loadStringImpl): (WebKit::WebPage::loadData): (WebKit::WebPage::scaledSnapshotWithOptions): (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction): (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension): * WebProcess/WebPage/WebPage.h: 2017-04-07 Alex Christensen Use audit_token_t instead of pid_t for checking sandbox of other processes https://bugs.webkit.org/show_bug.cgi?id=170616 Reviewed by Daniel Bates. pid's can be reused, so it's theoretically unsafe to use the pid of another process to check whether it's sandboxed. Use an audit_token_t instead to be more sure that we are not mistakenly checking a new process that has reused the old process's pid. For the current process, though, we have no xpc_connection_t to the process because we are the process. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeSandbox): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::isClientSandboxed): * Shared/mac/SandboxUtilities.h: * Shared/mac/SandboxUtilities.mm: (WebKit::currentProcessIsSandboxed): (WebKit::connectedProcessIsSandboxed): (WebKit::processIsSandboxed): Deleted. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::platformIsBeingDebugged): * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::shouldUsePlugin): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformGetLaunchOptions): 2017-04-07 Brent Fulgham [WK2][iOS] Add CoreMedia entitlement for WebProcess https://bugs.webkit.org/show_bug.cgi?id=170623 Reviewed by Youenn Fablet. Add new "com.apple.tcc.delegated-services" entitlement to allow CoreMedia to work properly in WebRTC. * Configurations/WebContent-iOS.entitlements: 2017-04-07 Alex Christensen Private browsing sessions should not look in keychain for client certificates https://bugs.webkit.org/show_bug.cgi?id=170618 Reviewed by Dan Bernstein. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::configurationForSessionID): 2017-04-07 Chris Dumez We should log how much CPU a background process was using when killing it due to CPU limiting https://bugs.webkit.org/show_bug.cgi?id=170619 Reviewed by Andreas Kling. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateBackgroundCPUMonitorState): 2017-04-07 Wenson Hsieh Missing conversion from window to content coordinates when adjusting unobscured content rects for input view https://bugs.webkit.org/show_bug.cgi?id=170603 Reviewed by Simon Fraser. Refactors -[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:] to convert the input view bounds into content coordinates instead of using the zoom scale to adjust the height of inputViewBounds. Covered by the existing LayoutTest, fixed-element-on-bottom-with-keyboard.html. * UIProcess/ios/WKContentView.mm: (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]): 2017-04-07 Michael Catanzaro [GTK] Various build errors when plugin support is disabled https://bugs.webkit.org/show_bug.cgi?id=170015 Reviewed by Carlos Garcia Campos. * PluginProcess/unix/PluginControllerProxyUnix.cpp: * UIProcess/API/gtk/WebKitWebsiteData.cpp: (recordContainsSupportedDataTypes): (toWebKitWebsiteDataTypes): * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: (toWebsiteDataTypes): 2017-04-07 John Wilander WebSocket streams should have network usage attributed to correct process https://bugs.webkit.org/show_bug.cgi?id=170322 Reviewed by Alex Christensen. Changes here are due to the added WebCore::SourceApplicationAuditToken parameter in WebCore::SocketStreamHandleImpl::create(). WebKit::NetworkSocketStream takes it and passes it on. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createSocketStream): * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): * NetworkProcess/NetworkSocketStream.h: 2017-04-07 Michael Catanzaro Unreviewed, fix missing return value warning * UIProcess/WebProcessProxy.cpp: (WebKit::diagnosticLoggingKeyForSimulatedCrashReason): 2017-04-07 Carlos Garcia Campos [GTK] Update the priorities used in glib main loop sources https://bugs.webkit.org/show_bug.cgi?id=170457 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor): * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::createWaylandLoopSource): * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::DrawingAreaImpl): 2017-04-06 Alex Christensen Add WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h https://bugs.webkit.org/show_bug.cgi?id=170533 Reviewed by Daniel Bates. * Shared/API/Cocoa/WebKit.h: In r213696 I added two public headers. All public headers in WebKit are included with #import 2017-04-06 Joseph Pecoraro Web Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics https://bugs.webkit.org/show_bug.cgi?id=170575 Rubber-stamped by Brian Burg. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): Deleted. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: m_networkLoad is a wrapper around `this` as the client, so we would infinite loop here. 2017-04-06 Commit Queue Unreviewed, rolling out r214973. https://bugs.webkit.org/show_bug.cgi?id=170578 Causes issues in Safari (Requested by bradee-oh on #webkit). Reverted changeset: "Refactor so WebsiteDataStores always have a StorageManager." https://bugs.webkit.org/show_bug.cgi?id=170521 http://trac.webkit.org/changeset/214973 2017-04-06 Ryan Haddad Unreviewed, rolling out r215046. This change broke internal builds. Reverted changeset: "WebRTC tests gardening" https://bugs.webkit.org/show_bug.cgi?id=170508 http://trac.webkit.org/changeset/215046 2017-04-06 Joseph Pecoraro Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend https://bugs.webkit.org/show_bug.cgi?id=170525 Reviewed by Youenn Fablet. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Only collect extra metrics if the WebProcess this load is for has enabled collecting extra metrics. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled): * WebProcess/Network/WebLoaderStrategy.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: New bool state toggled through the loader policy. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: (WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Default handling for network loads is to not include extra data. Thread client messages back from the NetworkLoads / SpeculativeLoads to check the NetworkConnectionToWebProcess state on whether or not we should collect extra metrics. 2017-04-06 Joseph Pecoraro Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar https://bugs.webkit.org/show_bug.cgi?id=16531 Reviewed by Timothy Hatcher. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Include a complete list of the request headers sent for this load. There may be headers that WebCore did not know about and developer tools should be informed of. 2017-04-06 Anders Carlsson OptionSet options need to be powers of two https://bugs.webkit.org/show_bug.cgi?id=170565 Reviewed by Chris Dumez. Change Cache::Option to be powers of two. * NetworkProcess/cache/NetworkCache.h: 2017-04-06 Youenn Fablet WebRTC tests gardening https://bugs.webkit.org/show_bug.cgi?id=170508 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2017-04-06 Antti Koivisto Implement testing mode for disk cache https://bugs.webkit.org/show_bug.cgi?id=170547 Reviewed by Andreas Kling. Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness. Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk. This is enabled by the existing WKContextUseTestingNetworkSession SPI. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::initialize): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::shrinkIfNeeded): * NetworkProcess/cache/NetworkCacheStorage.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): 2017-04-06 Chris Dumez [WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting https://bugs.webkit.org/show_bug.cgi?id=170524 Reviewed by Eric Carlson. Add C private API to toggle invisibleAutoplayNotPermitted setting. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInvisibleMediaAutoplayPermitted): (WKPreferencesGetInvisibleMediaAutoplayPermitted): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2017-04-06 Adrian Perez de Castro [GTK] Fix build with MEDIA_CAPTURE enabled https://bugs.webkit.org/show_bug.cgi?id=170539 Reviewed by Carlos Garcia Campos. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp: (webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone. 2017-04-05 Brent Fulgham [WK2][iOS] Remove access to features not present on iOS https://bugs.webkit.org/show_bug.cgi?id=170531 Reviewed by Alexey Proskuryakov. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-04-05 Eric Carlson [MediaStream] Host application should be able to mute and unmute media streams https://bugs.webkit.org/show_bug.cgi?id=170519 Reviewed by Youenn Fablet. * UIProcess/API/C/WKPage.cpp: (WKPageGetMediaState): Support new media stream state flags. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Ditto. * UIProcess/Cocoa/UIDelegate.mm: Ditto. 2017-04-05 Brady Eidson Refactor so WebsiteDataStores always have a StorageManager. https://bugs.webkit.org/show_bug.cgi?id=170521 Reviewed by Geoff Garen. This basically involves teaching StorageManager how to work without a LocalStorageDatabaseTracker, since there will never be ephemeral bits on disk to track. * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded): (WebKit::StorageManager::createEphemeral): (WebKit::StorageManager::StorageManager): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::getLocalStorageOriginDetails): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): * UIProcess/Storage/StorageManager.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): 2017-04-05 Brent Fulgham [WK2][iOS] Add entitlements to enable audio/video capture in WebProcess https://bugs.webkit.org/show_bug.cgi?id=170507 Reviewed by Youenn Fablet. Add two entitlements that are required to access audio/video capture on iOS. * Configurations/WebContent-iOS.entitlements: 2017-04-05 Carlos Garcia Campos Show a log message when an invalid message is received in non cocoa ports https://bugs.webkit.org/show_bug.cgi?id=170506 Reviewed by Michael Catanzaro. We just crash, but without knowing the details about the message it's impossible to debug. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::didReceiveInvalidMessage): 2017-04-04 Carlos Garcia Campos Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore https://bugs.webkit.org/show_bug.cgi?id=156974 Reviewed by Sam Weinig. WebErrors are not only used by the frame loader client in the web process, but also by the network process. So, move them to Shared make most of the implementation cross-platform. * CMakeLists.txt: Add new files to compilation. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::download): Use WebErrors directly instead of platform methods that are no longer needed. (WebKit::NetworkDataTaskSoup::writeDownloadCallback): Ditto. (WebKit::NetworkDataTaskSoup::didFinishDownload): Ditto. (WebKit::NetworkDataTaskSoup::didFail): Ditto. * PlatformGTK.cmake: Add new files to compilation and remove DownloadSoupErrorsGtk.cpp * PlatformMac.cmake: * Shared/API/APIError.cpp: Add error domains used by glib based ports. (API::Error::webKitNetworkErrorDomain): (API::Error::webKitPolicyErrorDomain): (API::Error::webKitPluginErrorDomain): (API::Error::webKitDownloadErrorDomain): (API::Error::webKitPrintErrorDomain): * Shared/API/APIError.h: * Shared/Cocoa/WebErrorsCocoa.mm: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h. (WebKit::createNSError): (WebKit::cancelledError): (WebKit::fileDoesNotExistError): * Shared/WebErrors.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp. (WebKit::blockedError): (WebKit::blockedByContentBlockerError): (WebKit::cannotShowURLError): (WebKit::interruptedForPolicyChangeError): (WebKit::blockedByContentFilterError): (WebKit::cannotShowMIMETypeError): (WebKit::pluginWillHandleLoadError): (WebKit::internalError): * Shared/WebErrors.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h. * Shared/glib/WebErrorsGlib.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp. (WebKit::cancelledError): (WebKit::fileDoesNotExistError): * Shared/gtk/WebErrorsGtk.cpp: Copied from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp. (WebKit::printError): (WebKit::printerNotFoundError): (WebKit::invalidPageRangeToPrint): * Shared/soup/WebErrorsSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp. (WebKit::downloadNetworkError): (WebKit::downloadCancelledByUserError): (WebKit::downloadDestinationError): * UIProcess/API/gtk/WebKitDownload.cpp: * UIProcess/API/gtk/WebKitError.cpp: (webkit_network_error_quark): (webkit_policy_error_quark): (webkit_plugin_error_quark): (webkit_download_error_quark): (webkit_print_error_quark): * UIProcess/API/gtk/WebKitPrivate.cpp: (toWebKitError): (toWebCoreError): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Removed. * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: 2017-04-04 Youenn Fablet [Mac] Add back web audio support for getUserMedia MediaStreamTrack https://bugs.webkit.org/show_bug.cgi?id=170482 Reviewed by Eric Carlson. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setStorage): 2017-04-04 Tim Horton [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps https://bugs.webkit.org/show_bug.cgi?id=165801 Reviewed by Wenson Hsieh. Previously, when doing an incremental find that wrapped, we would say that it did not, leading NSTextFinder to not provide its usual wrapping UI, and other clients of the NSTextFinderClient protocol to get confused by the lack of wrapping. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFindString): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/API/APIFindClient.h: (API::FindClient::didFindString): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageFindClient): * UIProcess/Cocoa/FindClient.h: * UIProcess/Cocoa/FindClient.mm: (WebKit::FindClient::didFindString): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::findString): * WebProcess/WebPage/FindController.h: Plumb DidWrap from FindController's call to findString back through the DidFindString message. * UIProcess/mac/WKTextFinderClient.mm: (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]): (-[WKTextFinderClient didFindStringMatchesWithRects:]): Deleted. Make use of the new DidWrap information to stop lying to NSTextFinder about whether a wrap actually occurred. 2017-04-03 Wenson Hsieh Data interaction should register type identifiers in order of priority https://bugs.webkit.org/show_bug.cgi?id=170428 Reviewed by Tim Horton. Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/API/Cocoa/WKWebView.mm: 2017-04-03 Joseph Pecoraro Remove no longer needed forward declarations https://bugs.webkit.org/show_bug.cgi?id=170415 Reviewed by Dan Bernstein. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 2017-04-03 Anders Carlsson Tweak ApplePaySession API https://bugs.webkit.org/show_bug.cgi?id=170409 rdar://problem/31405459 Reviewed by Tim Horton. Update for WebCore changes. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-04-03 Carlos Garcia Campos [SOUP] URI Fragment is lost after redirect https://bugs.webkit.org/show_bug.cgi?id=170058 Reviewed by Michael Catanzaro. In case of redirection check if the current request has a fragment identifier and apply it to the redirection only when it doesn't have a fragment identifier yet. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::createRequest): (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): * NetworkProcess/soup/NetworkDataTaskSoup.h: 2017-04-03 Antti Koivisto Mutex may be freed too late in NetworkCache::Storage::traverse https://bugs.webkit.org/show_bug.cgi?id=170400 Reviewed by Carlos Garcia Campos and Andreas Kling. Fix a race. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::traverse): Ensure the mutex is not accessed after we dispatch to the main thread. The main thread call deletes the owning TraverseOperation. 2017-04-01 Dan Bernstein [iOS] label should be specified using plural rules https://bugs.webkit.org/show_bug.cgi?id=170388 Reviewed by Alexey Proskuryakov. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]): Instead of calling -_displayStringForPhotos:videos:, use +[NSString localizedStringWithFormat:] with the new format string "%lu photo(s) and %lu video(s)" for which there are plural rules. (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted. 2017-04-01 Dan Bernstein [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid https://bugs.webkit.org/show_bug.cgi?id=170385 Reviewed by Tim Horton. * Configurations/WebKit.xcconfig: When WebKit is relocatable, tell the linker that it’s not going to be in the shared cache, even if its install name implies that it might be. 2017-03-31 Simon Fraser Remove a logging statement left in by mistake. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::restoreViewState): 2017-03-31 Wenson Hsieh Address post-review feedback after r214692 https://bugs.webkit.org/show_bug.cgi?id=170328 Reviewed by Dan Bernstein. Clearing the selection when UIKit calls into WKContentView to set its selected text range to nil is a rule that should be applied when using a text interaction assistant, not just when using character granularity for selecting text. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setSelectedTextRange:]): 2017-03-31 Wenson Hsieh [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity https://bugs.webkit.org/show_bug.cgi?id=170328 Reviewed by Tim Horton. When UIKit clears the selection while in text interaction mode, it notifies its document view (i.e., the WKContentView) by setting its selected text range to nil. When character granularity selection is enabled, use this as a cue to notify the web process that the selection is being cleared out. -setSelectedTextRange: is a noop in the general case because the web process acts as the source of truth for what the selection currently consists of, and notifies the UI process and UIKit via WKTextPosition and WKTextRange. However, in the case of character granularity selections, tapping away to clear the selection is handled by UIKit's text gesture recognizer cluster, which then informs the document (via -setSelectedTextRange:) that the selection should be cleared out. Adds a new Layout test: editing/selection/character-granularity-selected-range-after-dismissing-selection.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setSelectedTextRange:]): 2017-03-31 Wenson Hsieh [WK2] Tapping editable text inside of a range selection no longer changes the selection to a caret https://bugs.webkit.org/show_bug.cgi?id=170327 Reviewed by Tim Horton. Currently, we're forcing all text interaction gestures to duck in lieu of data interaction gestures when we should only be doing so for gestures that begin a loupe. This prevents other gestures, such as single taps, from changing the selection when they should be allowed to. Hooks into new UIKit SPI to make this tweak. Introduces a new LayoutTest: editing/selection/caret-after-tap-in-editable-selection.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView pointIsInAssistedNode:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): 2017-03-31 Tim Horton Mail can get stuck underneath FindController::findStringMatches after searching in a long message https://bugs.webkit.org/show_bug.cgi?id=170326 Reviewed by Simon Fraser. * UIProcess/mac/WKTextFinderClient.mm: (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]): Cap the number of find matches at 1000, the same maximum that Safari uses. 2017-03-31 Brady Eidson Clean up the "StorageType" enum. https://bugs.webkit.org/show_bug.cgi?id=170349 Reviewed by Tim Horton. * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::dispatchStorageEvent): (WebKit::StorageAreaMap::dispatchSessionStorageEvent): (WebKit::StorageAreaMap::dispatchLocalStorageEvent): * WebProcess/Storage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::createSessionStorageNamespace): (WebKit::StorageNamespaceImpl::createLocalStorageNamespace): (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace): 2017-03-31 Tim Horton Remove bundle checks for attachmentElementEnabled https://bugs.webkit.org/show_bug.cgi?id=170329 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): Remove bundle checks. 2017-03-29 Anders Carlsson Adopt PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication https://bugs.webkit.org/show_bug.cgi?id=170257 rdar://problem/31289764 Reviewed by Beth Dakin. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-03-31 Csaba Osztrogonác Mac cmake buildfix after r214403 https://bugs.webkit.org/show_bug.cgi?id=170346 Unreviewed speculative buildfix. * UIProcess/API/Cocoa/WKWebView.mm: 2017-03-31 Brady Eidson Remove erroneously committed changes from r214078 Unreviewed. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): Whoops! 2017-03-31 Carlos Garcia Campos Modern media controls should never be enabled in non cocoa ports https://bugs.webkit.org/show_bug.cgi?id=170338 Reviewed by Michael Catanzaro. It's currently enabled, because it uses the default value for all other runtime features, but modern media controls are not a cross-platform feature. I think this is why media/video-click-dblckick-standalone.html started to fail in GTK+ port after r214426. I can't reprouduce the failure locally, so I can't confirm it, though. * Shared/WebPreferencesDefinitions.h: 2017-03-30 Zan Dobersek Unreviewed GTK+ build fix. List WebCore before JavaScriptCore as the two WebKit2 dependency libraries to avoid WTF directiories being listed for inclusion before WebCore directories at compile-time. * CMakeLists.txt: 2017-03-30 Megan Gardner Allow for extended color in snapshots https://bugs.webkit.org/show_bug.cgi?id=170314 WKImageCreateCGImage should support WideGamut in WebKit2 on macOS Reviewed by Simon Fraser. Piping options through snapshots to allow for wide gamut support. * Shared/API/c/WKImage.h: * Shared/API/c/WKSharedAPICast.h: (WebKit::snapshotOptionsFromImageOptions): * Shared/ImageOptions.h: (WebKit::snapshotOptionsToImageOptions): * Shared/WebImage.cpp: (WebKit::WebImage::create): 2017-03-30 Sam Weinig Expose the WKView SPI, _prepareForMoveToWindow:withCompletionHandler as WKWebView SPI https://bugs.webkit.org/show_bug.cgi?id=170315 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _prepareForMoveToWindow:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Copy SPI to WKWebView. Remove 'with' prefix to match conventions. 2017-03-30 Wenson Hsieh [WK2] Touches should not cancel when showing a custom action sheet while data interaction is active https://bugs.webkit.org/show_bug.cgi?id=170291 Reviewed by Tim Horton. Currently, when presenting a custom popover, we will cancel all touches in the application. This makes data interaction when a custom popover is shown impossible -- to address this, we should only cancel touches when the view is not an active data interaction source. New API test: DataInteractionTests.CustomActionSheetPopover. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]): 2017-03-30 Youenn Fablet NetworkConnectionToWebProcess should stop web sockets when being destroyed https://bugs.webkit.org/show_bug.cgi?id=170286 Reviewed by Brady Eidson. * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already. * NetworkProcess/NetworkSocketStream.h: 2017-03-29 Tim Horton Remove unused PageClient::removeNavigationGestureSnapshot https://bugs.webkit.org/show_bug.cgi?id=170249 Reviewed by Beth Dakin. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted. 2017-03-29 Antti Koivisto Increment the last stable network cache version on Mac https://bugs.webkit.org/show_bug.cgi?id=170248 Reviewed by Chris Dumez. Bump to the latest release. * NetworkProcess/cache/NetworkCacheStorage.h: 2017-03-28 Timothy Horton Stop overriding scroll view inset defaults https://bugs.webkit.org/show_bug.cgi?id=170221 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): The default behavior is sufficient for us. 2017-03-28 Timothy Horton Safari crashes when attempting to close tab that is displaying PDF https://bugs.webkit.org/show_bug.cgi?id=170201 Reviewed by Wenson Hsieh. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _doAfterNextStablePresentationUpdate:]): Adopt BlockPtr to fix a leak. (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): dispatch_async in the doAfterNextPresentationUpdate callback; since this recursively calls itself, in cases where doAfterNextPresentationUpdate returns synchronously (e.g. if the Web Process is missing), we would recurse infinitely. 2017-03-27 Youenn Fablet Remove WebPage::m_shouldDoICECandidateFiltering https://bugs.webkit.org/show_bug.cgi?id=170150 Reviewed by Sam Weinig. It is redundant with RTCController::m_shouldFilterICECandidates. Manually tested on webrtc test samples. This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt. Additional testing will be added as a follow-up patch. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::disableICECandidateFiltering): (WebKit::WebPage::enableICECandidateFiltering): * WebProcess/WebPage/WebPage.h: 2017-03-27 Wenson Hsieh [WK2] UIKit assertion when rotating device after dismissing popover https://bugs.webkit.org/show_bug.cgi?id=170159 Reviewed by Tim Horton. Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center. * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet dealloc]): (-[WKActionSheet _cleanup]): (-[WKActionSheet doneWithSheet:]): 2017-03-27 Andy Estes [iOS] Suppress page count recalc when setting a snapshot paper rect https://bugs.webkit.org/show_bug.cgi?id=170156 Reviewed by Tim Horton. When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper rect, which triggers UIKit to ask for the page count again while we're in the middle of printing, putting us in a bad state. Suppress page count recalc while setting the new paper rect, since we know this will not cause it to change. * UIProcess/_WKWebViewPrintFormatter.mm: (-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set _suppressPageCountRecalc to YES before updating the paper rect. (-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if _suppressPageCountRecalc is NO. * UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc. 2017-03-26 Wenson Hsieh [WK2] Callout Bar should be dismissed during data interaction https://bugs.webkit.org/show_bug.cgi?id=170109 Reviewed by Tim Horton. Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2. * Platform/spi/ios/UIKitSPI.h: 2017-03-27 Keith Rollin Update NetworkResourceLoader logging statement https://bugs.webkit.org/show_bug.cgi?id=170126 Reviewed by Alex Christensen. NetworkResourceLoader contains a logging statement that prints, in part: "start: Retrieving resource from cache". This is misleading, since it's not necessarily the case that the resource will be loaded from the cache. What is actually happening at the point where that is logged is that the cache is being checked for the resource. It still remains to be seen if the resource will be found in it. To address this, change the logging to say "start: Checking cache for resource". * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): 2017-03-27 Joseph Pecoraro Web Inspector: Saving files should not suggest the top level directory https://bugs.webkit.org/show_bug.cgi?id=170085 Reviewed by Matt Baker. * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (WebKit::RemoteWebInspectorProxy::platformSave): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformSave): Don't set panel.directoryURL unless we have a good suggestion. 2017-03-27 Yongjun Zhang Add delegate method to let an WebKit client provide a custom image preview controller. https://bugs.webkit.org/show_bug.cgi?id=170076 rdar://problem/31153051 Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image has alternated URL or custom image info. Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided preview view controller. Otherwise, use the default WKImagePreviewViewController. 2017-03-27 Anders Carlsson Fix uses of deprecated API https://bugs.webkit.org/show_bug.cgi?id=170138 rdar://problem/28882449 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKContactFields): (WebKit::toPKAddressField): (WebKit::toPKPaymentRequest): Don't use deprecated APIs. (WebKit::toNSError): Don't try to insert nil in a dictionary. 2017-03-27 Alex Christensen Make WebSockets work in network process https://bugs.webkit.org/show_bug.cgi?id=169930 Reviewed by Youenn Fablet. This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous messages to a NetworkSocketStream in the NetworkProcess. WebKit1 uses a SocketStreamHandleImpl still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back to the WebProcess. WebSocketStream's implementation of SocketStreamHandle::platformSend is special because it stores the completion handler in a map and asynchronously reports to the caller whether it succeeded or not. If the network processes crashes before the completion handlers are called, then they are called indicating failure and an error is reported, but that never happens, right? * CMakeLists.txt: * DerivedSources.make: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::createSocketStream): (WebKit::NetworkConnectionToWebProcess::destroySocketStream): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSocketStream.cpp: Added. (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): (WebKit::NetworkSocketStream::sendData): (WebKit::NetworkSocketStream::close): (WebKit::NetworkSocketStream::didOpenSocketStream): (WebKit::NetworkSocketStream::didCloseSocketStream): (WebKit::NetworkSocketStream::didReceiveSocketStreamData): (WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData): (WebKit::NetworkSocketStream::didUpdateBufferedAmount): (WebKit::NetworkSocketStream::didFailSocketStream): (WebKit::NetworkSocketStream::messageSenderConnection): (WebKit::NetworkSocketStream::messageSenderDestinationID): * NetworkProcess/NetworkSocketStream.h: Added. * NetworkProcess/NetworkSocketStream.messages.in: Added. * UIProcess/API/C/WKContext.cpp: (WKContextSetAllowsAnySSLCertificateForWebSocketTesting): (WKContextTerminateNetworkProcess): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::sendSyncToNetworkingProcess): (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket): (WebKit::WebProcessPool::terminateNetworkProcess): * UIProcess/WebProcessPool.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/Network/WebSocketProvider.cpp: (WebKit::WebSocketProvider::createSocketStreamHandle): * WebProcess/Network/WebSocketStream.cpp: Added. (WebKit::globalWebSocketStreamMap): (WebKit::WebSocketStream::streamWithIdentifier): (WebKit::WebSocketStream::networkProcessCrashed): (WebKit::WebSocketStream::create): (WebKit::WebSocketStream::WebSocketStream): (WebKit::WebSocketStream::~WebSocketStream): (WebKit::WebSocketStream::messageSenderConnection): (WebKit::WebSocketStream::messageSenderDestinationID): (WebKit::WebSocketStream::platformSend): (WebKit::WebSocketStream::didSendData): (WebKit::WebSocketStream::platformClose): (WebKit::WebSocketStream::bufferedAmount): (WebKit::WebSocketStream::didOpenSocketStream): (WebKit::WebSocketStream::didCloseSocketStream): (WebKit::WebSocketStream::didReceiveSocketStreamData): (WebKit::WebSocketStream::didFailToReceiveSocketStreamData): (WebKit::WebSocketStream::didUpdateBufferedAmount): (WebKit::WebSocketStream::didFailSocketStream): * WebProcess/Network/WebSocketStream.h: Added. * WebProcess/Network/WebSocketStream.messages.in: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): 2017-03-27 Adrian Perez de Castro [GTK] NetscapePluginX11::m_windowID is unused/unneeded https://bugs.webkit.org/show_bug.cgi?id=170115 Reviewed by Michael Catanzaro. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::NetscapePluginX11::NetscapePluginX11): Remove the unneeded NetscapePluginX11::m_windowID member. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h: Remove the unneeded NetscapePluginX11::m_windowID member. 2017-03-25 Andy Estes [iOS] Use snapshotting instead of printing to draw single-page PDFs https://bugs.webkit.org/show_bug.cgi?id=170103 Reviewed by Tim Horton. * WebProcess/WebPage/WebPage.cpp: (WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here. (WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the WebImage's graphics context. (WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to paintSnapshotAtSize(), and returned the context's data. * WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize(). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page, returned a page count of 1 and created a PDF using pdfSnapshotAtSize(). 2017-03-25 John Wilander Re-enable the web process' keychain access to fix client certificate authentication https://bugs.webkit.org/show_bug.cgi?id=170074 Reviewed by Brent Fulgham. This is a follow-up patch to https://trac.webkit.org/changeset/214389/webkit since according to Alexey Proskuryakov, resource loading has always required identical sandbox rules in WebContent and Networking processes. * WebProcess/com.apple.WebProcess.sb.in: Reverted remaining change from https://trac.webkit.org/changeset/208702/webkit and https://trac.webkit.org/changeset/208707/webkit. 2017-03-24 Wenson Hsieh [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop https://bugs.webkit.org/show_bug.cgi?id=169168 Reviewed by Tim Horton. Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the DragData sent over to the web process, where they update DragController's view of the allowed destination actions. Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad, though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate any compatibility risk. * Shared/API/Cocoa/WKDragDestinationAction.h: Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Serialize DragData's destination actions when sending DragData over IPC. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate). * UIProcess/API/mac/WKView.mm: (-[WKView _web_dragDestinationActionForDraggingInfo:]): For WKView, allow all types of drag destination actions. * UIProcess/Cocoa/VersionChecks.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::draggingEntered): (WebKit::WebViewImpl::draggingUpdated): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::actionMaskForDrag): * WebProcess/WebCoreSupport/WebDragClient.h: 2017-03-24 Simon Fraser [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates https://bugs.webkit.org/show_bug.cgi?id=170091 rdar://problem/30682584 Reviewed by Tim Horton. [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this. So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known- good time. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 2017-03-24 John Wilander Re-enable the network process' keychain access to fix client certificate authentication https://bugs.webkit.org/show_bug.cgi?id=170074 Reviewed by Brent Fulgham. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Reverted remaining change from https://trac.webkit.org/changeset/208702/webkit and https://trac.webkit.org/changeset/208707/webkit. 2017-03-24 Eric Carlson [MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score https://bugs.webkit.org/show_bug.cgi?id=170056 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): When short-circuiting the user prompt because the page is already authorized, return the first audio and/or video device because so the page gets the one with the best fitness distance. 2017-03-24 Simon Fraser Make UI-side compositing on macOS a bit more usable https://bugs.webkit.org/show_bug.cgi?id=170073 Reviewed by Tim Horton. Mach port as layer contents doesn't work on macOS, so don't use it there. Also remove two assertions that hit with UI-side compositing in MiniBrowser. * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::createFence): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::requestScroll): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): 2017-03-24 Alex Christensen Fix assertions after r214358. https://bugs.webkit.org/show_bug.cgi?id=169167 * UIProcess/API/APIContentExtensionStore.cpp: (API::ContentExtensionStore::compileContentExtension): AtomicString::init must be called for the first time from the main thread. We were calling it for the first time from a non-main thread sometimes. Call it from the main thread before initiating compiling on another thread. == Rolled over to ChangeLog-2017-03-23 ==