2017-08-11 Jason Marcell Cherry-pick r220571. rdar://problem/33829962 2017-08-10 John Wilander Resource Load Statistics: Increase grandfathering time to 7 days https://bugs.webkit.org/show_bug.cgi?id=175414 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-08-10 Jason Marcell Cherry-pick r220505. rdar://problem/33829962 2017-08-09 John Wilander Resource Load Statistics: Increase grandfathering time to 3 days https://bugs.webkit.org/show_bug.cgi?id=175414 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-08-09 Jason Marcell Cherry-pick r220459. rdar://problem/33820786 2017-08-09 Daniel Bates REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication https://bugs.webkit.org/show_bug.cgi?id=175247 Reviewed by Brady Eidson. Add SPI WKNavigationAction._isRedirect to query whether the navigation was in response to receiving a redirect response. The majority of the WebKit change is plumbing this knowledge through to connect it with the SPI. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): (WebKit::NavigationActionData::decode): Encode and decode the boolean NavigationActionData::isRedirect. * Shared/NavigationActionData.h: * UIProcess/API/APINavigationAction.h: * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction _isRedirect]): Added. * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Set NavigationActionData::isRedirect depending on whether the navigation is in response to receiving a redirect response. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-08-07 Jason Marcell Cherry-pick r220273. rdar://problem/33732754 2017-08-04 Andreas Kling NetworkLoad should always invoke its redirect completion handler https://bugs.webkit.org/show_bug.cgi?id=175179 Reviewed by Chris Dumez. Make sure the redirect completion handler is always invoked, just like we already did for the response completion handler. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::~NetworkLoad): 2017-08-04 Jason Marcell Revert r219896. rdar://problem/33711000 2017-08-03 Jason Marcell Cherry-pick r220185. rdar://problem/33713528 2017-08-02 Chris Dumez NetworkResourceLoader::setDefersLoading() may cause start() to be called multiple times https://bugs.webkit.org/show_bug.cgi?id=175109 Reviewed by Brady Eidson. If NetworkResourceLoader::setDefersLoading(false) is called by the client while m_networkLoad is null then we call NetworkResourceLoader::start() to start the load. This is needed in the case where a NetworkResourceLoader is constructed in deferred mode so that the load can later be started via setDefersLoading(). However, it is possible for setDefersLoading(false) to be called when start() has already been called, which causes start() to be called multiple times and leads to an assertion hit in debug. Normally, setDefersLoading(false) returns without calling start() if m_networkLoad is not null. It relies on m_networkLoad being non-null to determine if start() should be called. This is bad because start() checks the disk cache asynchronously *before* calling startNetworkLoad() and initializing m_networkLoad. Therefore, if setDefersLoading(false) is called *while* we are checking the cache, then we will call incorrectly call start() again. In the case of the radar, this happens when we: 1. Call start() and check the disk cache 2. Retrieve a cached redirect from the cache, which causes a WillSendRequest IPC to be sent to the WebProcess 3. The WebProcess calls setDefersLoading(true), sends the ContinueWillSendRequest IPC back and then calls setDefersLoading(false) The call to continueWillSendRequest() causes us to retrieve the redirected entry from the cache, asynchronously, which will return no entry and start a load. The later call to setDefersLoading(false) causes us to call start() again and we end up back to step 1. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::setDefersLoading): * NetworkProcess/NetworkResourceLoader.h: 2017-08-03 Jason Marcell Cherry-pick r219896. rdar://problem/33711000 2017-07-25 Andy Estes [Apple Pay] Add "carteBancaire" as a supported payment network https://bugs.webkit.org/show_bug.cgi?id=174841 Reviewed by Alex Christensen. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toSupportedNetwork): 2017-07-31 Jason Marcell Cherry-pick r220033. rdar://problem/33619596 2017-07-28 Brady Eidson API tests that use URLSchemeHandler are failing. https://bugs.webkit.org/show_bug.cgi?id=174950 Reviewed by Alex Christensen. Make sure that in all cases where we remove the last task from the page->task map... ...We also remove the map itself. * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::stopTask): (WebKit::WebURLSchemeHandler::taskCompleted): (WebKit::WebURLSchemeHandler::removeTaskFromPageMap): * UIProcess/WebURLSchemeHandler.h: 2017-07-31 Jason Marcell Cherry-pick r220011. rdar://problem/33619596 2017-07-28 Brady Eidson WKURLSchemeTaskImpl instances are being abandoned (except if the task is stopped). and https://bugs.webkit.org/show_bug.cgi?id=174895 Reviewed by Alex Christensen. There was a lot going on here: - There was an unbroken cycle between URLSchemeHandlers and URLSchemeTasks - WKURLSchemeTasks were not destroying their API::URLSchemeTask implementation object - When a WKWebView was dealloc'ed, it was not cleaning up the related UIProcess tasks - If the NetworkingProcess crashed, WebProcesses were not cleaning up their tasks (and therefore the UIProcess tasks were also not getting cleaned up) - If a WebProcess crashed, the UIProcess was not cleaning up the related tasks * UIProcess/API/Cocoa/WKURLSchemeTask.mm: (-[WKURLSchemeTaskImpl dealloc]): Call API::~URLSchemeTask * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h: * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: (WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Clear out the API wrapper map so the wrapper and implementation object can both be destroyed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): Call stopAllURLSchemeTasks. (WebKit::WebPageProxy::processDidTerminate): Call stopAllURLSchemeTasks. (WebKit::WebPageProxy::stopAllURLSchemeTasks): * UIProcess/WebPageProxy.h: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): (WebKit::WebURLSchemeHandler::stopAllTasksForPage): (WebKit::WebURLSchemeHandler::stopTask): (WebKit::WebURLSchemeHandler::taskCompleted): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::WebURLSchemeTask): * UIProcess/WebURLSchemeTask.h: (WebKit::WebURLSchemeTask::pageID): Store separate from the WebPage so messaging is possible even after the WebPage* has been cleared. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopAllURLSchemeTasks): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::stopAllTasks): (WebKit::WebURLSchemeHandlerProxy::taskDidComplete): (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading): (WebKit::WebURLSchemeHandlerProxy::removeTask): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): Call stopAllURLSchemeTasks for each WebPage. 2017-07-28 Jason Marcell Cherry-pick r219904. rdar://problem/33595576 2017-07-25 Brady Eidson ResourceLoadStatistics grandfathering happens much too often. and https://bugs.webkit.org/show_bug.cgi?id=174825 Reviewed by Chris Dumez. The ResourceLoadStatistics grandfathering procedure happens too often. - With an empty memory store, even though an empty memory store is a perfectly valid state. - On each launch, even if grandfathering happened on the last launch - because grandfathering data would not automatically be saved to disk. - After clearing all website data, at which point no grandfathering can possibly be relevant because there is no data to grandfather. This patch fixes those cases and adds API tests to verify they remain fixed. * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): allWebsiteDataTypes, but even with the private ones. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): If the types being cleared cover all of the types that ResourceLoadStatistics care about, don't grandfather afterwards. (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Ditto. (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): Don't grandfather if the store read from disk is empty (as being empty is perfectly fine), and also log the event of "populated without grandfathering". * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes): (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Schedule a write right away so we don't re-grandfather on next launch, and also log the grandfathering event. (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Takes a ShouldGrandfather flag to tell whether or not data should be re-grandfathered after the store is cleared. (WebKit::WebResourceLoadStatisticsStore::logTestingEvent): Log the event to the testing client. (WebKit::dataTypesToRemove): Deleted. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Handles enabling ResourceLoadStatistics both with and without a testing callback. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-07-28 Jason Marcell Cherry-pick r219987. rdar://problem/33595619 2017-07-27 Nan Wang AX: A11Y: Zoom no longer follows keyboard insertion point in safari https://bugs.webkit.org/show_bug.cgi?id=174869 Reviewed by David Kilzer. There was a recent change by denying XPC services access by default. In UAZoomChangeFocus we need to send message to HIServices, so let's allow the connection to XPC services for that. * WebProcess/com.apple.WebProcess.sb.in: 2017-07-28 Jason Marcell Cherry-pick r219973. rdar://problem/33595608 2017-07-26 Tim Horton REGRESSION (r211160): Can't pinch to zoom unlocked encrypted PDFs in WKWebView https://bugs.webkit.org/show_bug.cgi?id=174881 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _hidePasswordView]): WKPasswordView saves and restores a bunch of scroll view properties, including those relating to zoom limits. The restoration happens in -[WKPasswordView hide], which is never called. Instead, the code added in r211160 just calls removeFromSuperview after unlocking, never restoring the old zoom limits, causing the then fully unlocked PDF to not be zoomable. Fix this by calling -hide instead of -removeFromSuperview (which -hide also calls). 2017-07-28 Jason Marcell Cherry-pick r219855. rdar://problem/33595427 2017-07-24 Chris Dumez [WK2][Cocoa] Allow overriding the ITP data removal internal using a default https://bugs.webkit.org/show_bug.cgi?id=174802 Reviewed by Sam Weinig. Allow overriding the ITP data removal internal using a default to facilitate testing. Can be used like so: defaults write -g ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval 60 Will cause us to write every 60 seconds instead of 3600. * Shared/WebPreferencesDefinitions.h: * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded): 2017-07-26 Jason Marcell Cherry-pick r219876. rdar://problem/33523847 2017-07-25 Said Abou-Hallawa Async image decoding for large images should be disabled after the first time a tile is painted https://bugs.webkit.org/show_bug.cgi?id=174451 Reviewed by Simon Fraser. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::paintContents): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-07-26 Jason Marcell Cherry-pick r219620. rdar://problem/33523847 2017-07-18 Matt Lewis Unreviewed, rolling out r219610. This caused an api failure on all platforms for the test SnapshotImageLargeAsyncDecoding Reverted changeset: "Async image decoding for large images should be disabled after the first time a tile is painted" https://bugs.webkit.org/show_bug.cgi?id=174451 http://trac.webkit.org/changeset/219610 2017-07-26 Jason Marcell Cherry-pick r219764. rdar://problem/33523878 2017-07-22 Chris Dumez REGRESSION(r204565): WKObject is broken https://bugs.webkit.org/show_bug.cgi?id=174736 Reviewed by Dan Bernstein. Revert r204565 as making WKObject a root class caused unexpected crashes. Instead, we now have WKObject inherit from NSProxy (instead of previously NSObject) and we forward calls to the target. We also need to provide an implementation for private methods such as isNSString__ to address the issue with NSStrings that r204565 was trying to fix. * Shared/Cocoa/APIObject.mm: (API::Object::unwrap): * Shared/Cocoa/WKObject.h: * Shared/Cocoa/WKObject.mm: (-[WKObject dealloc]): (-[WKObject hash]): (-[WKObject isKindOfClass:]): (-[WKObject isMemberOfClass:]): (-[WKObject respondsToSelector:]): (-[WKObject conformsToProtocol:]): (-[WKObject forwardingTargetForSelector:]): (-[WKObject description]): (-[WKObject debugDescription]): (-[WKObject classForCoder]): (-[WKObject classForKeyedArchiver]): (-[WKObject _web_createTarget]): (-[WKObject forwardInvocation:]): (-[WKObject methodSignatureForSelector:]): (-[WKObject isNSObject__]): (-[WKObject isNSArray__]): (-[WKObject isNSCFConstantString__]): (-[WKObject isNSData__]): (-[WKObject isNSDate__]): (-[WKObject isNSDictionary__]): (-[WKObject isNSNumber__]): (-[WKObject isNSOrderedSet__]): (-[WKObject isNSSet__]): (-[WKObject isNSString__]): (-[WKObject isNSTimeZone__]): (-[WKObject isNSValue__]): 2017-07-26 Jason Marcell Cherry-pick r219739. rdar://problem/33523884 2017-07-21 Chris Dumez WebResourceLoadStatisticsStore::m_operatingDates is unsafely modified from several threads https://bugs.webkit.org/show_bug.cgi?id=174721 Reviewed by Brent Fulgham. WebResourceLoadStatisticsStore::m_operatingDates is supposed to only be modified on the background thread. However, WebResourceLoadStatisticsStore::performDailyTasks() was mistakenly calling includeTodayAsOperatingDateIfNecessary() on the main thread, which would modify m_operatingDates. This could lead to crashes such as the one in , as the main thread may modify m_operatingDates while we are interating over it on the background thread to save it to disk. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::performDailyTasks): (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): 2017-07-26 Jason Marcell Cherry-pick r219594. rdar://problem/33523357 2017-07-17 Timothy Horton Page using safe area constant properties jumps to correct layout after resize https://bugs.webkit.org/show_bug.cgi?id=174598 Reviewed by Simon Fraser. Test: fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): Plumb unobscured safe area insets through in the dynamicViewportSizeUpdate, like we do in VisibleContentRectUpdate (once again sad that these aren't more similar), so that it will be correct in the during-rotation snapshot, instead of only becoming correct in the first visible content rect update post-rotation. 2017-07-26 Jason Marcell Cherry-pick r219845. rdar://problem/33523884 2017-07-24 Chris Dumez Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore() https://bugs.webkit.org/show_bug.cgi?id=174790 Reviewed by Brady Eidson. Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore(). WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to |this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can get executed after the store is gone. To address the issue, we now use a RunLoop::Timer to schedule the write, instead of a WorkQueue::dispatchAfter() call. This way, we are guaranteed that the callback will not get called after the store has been destroyed. * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired): (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): (WebKit::ResourceLoadStatisticsPersistentStorage::ref): (WebKit::ResourceLoadStatisticsPersistentStorage::deref): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: 2017-07-26 Jason Marcell Cherry-pick r219765. rdar://problem/33523818 2017-07-22 Wenson Hsieh [Mac WK2] Fix null dereference in asynchronous NSTextInputClient methods when deallocating a WKWebView https://bugs.webkit.org/show_bug.cgi?id=174751 Reviewed by Darin Adler. Tweaks -[WKWebView dealloc] to close the WebPageProxy at an earlier time, prior to destroying the WebViewImpl. This fixes a NSTextInputClient crash in WKWebView when exercising the following scenario: (1) Suppose that NSTextInputContext invokes an asynchronous text input query on WKWebView immediately before WKWebView is deallocated, such that WebPageProxy's CallbackMap contains an NSTextInputContext callback at the time that -[WKWebView dealloc] is called. Additionally, suppose that this callback from NSTextInputContext invokes additional NSTextInputClient methods on the WKWebView that involve plumbing through to the WebViewImpl (which is stored as _impl on the WKWebView). (2) Observe that when calling [super dealloc] in [WKWebView dealloc], we will destroy the WebViewImpl as a result of setting our unique pointer to _impl to be null. In ~WebViewImpl, we invoke WebPageProxy::close, which in turn invokes WebPageProxy::resetState. (3) WebPageProxy::resetState then calls m_callbacks.invalidate(error), which triggers all pending callbacks. This invokes the block described in (1), which causes us to try and call back into WKWebView, invoking NSTextInputClient methods. Without the fix in this patch, these methods currently assume that _impl is nonnull, even though we've already cleared out the pointer in (2), so we segfault with a null dereference. After this patch, we close the _page at an earlier time, such that the state is reset before the WebViewImpl (and corresponding _impl unique_ptr in WKWebView) is torn down. This ensures that _impl will not be null for callbacks invoked after beginning to deallocate the WKWebView. Forcing this scenario in a custom AppKit root that triggers async NSTextInputClient methods immediately when a WKWebView is being deallocated produces a crash with the same stack trace as what we observe in the radar, but there are no known steps to actually reproduce this crash in shipping software. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): 2017-07-26 Jason Marcell Cherry-pick r219754. rdar://problem/33523873 2017-07-21 Brady Eidson Crash in many WebKit apps marking a connection invalid under Messages::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace. and https://bugs.webkit.org/show_bug.cgi?id=174729 Reviewed by Tim Horton. Previously, when a NetworkLoad generated a "CanAuthenticateAgainstProtectionSpace" event, the message went from Network process -> Web process -> UI process. In that case, MESSAGE_CHECKing the validity of the frame in WebPageProxy made sense. In r202511 we cut the WebProcess out of this and had Networking go straight to UI process. As a result, the message check became invalid. The Networking process cannot possible know the validity of particular WebPage or WebFrame identifiers. We simply need to validate the input in NetworkProcessProxy. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Validate both the page and frame ids before passing the call along to the WebPageProxy. Also, if either of those validations fail, respond to the network process. 2017-07-26 Jason Marcell Cherry-pick r219750. rdar://problem/33523870 2017-07-21 Andy Estes [iOS] Adopt UIImagePickerControllerImageURL for photo uploads https://bugs.webkit.org/show_bug.cgi?id=174723 Reviewed by Joseph Pecoraro. In iOS 11, use the URL provided by UIImagePickerControllerImageURL, if available, as the file URL for photo uploads. Since we use the UIImagePickerController imageExportPreset of UIImagePickerControllerImageURLExportPresetCompatible, UIKit will take care of converting HEIF images to JPEG for us. For other types (GIF, JPEG, and PNG), it will preserve the original format. Since UIImagePickerController now provides GIF and PNG representations, we no longer need to use PHImageManager to access the original assets. This patch removes the PHAsset/PHImageManager code added in r185241. * Platform/spi/ios/PhotosSPI.h: Removed. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]): (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]): Deleted. * WebKit.xcodeproj/project.pbxproj: 2017-07-26 Jason Marcell Cherry-pick r219610. rdar://problem/33523847 2017-07-18 Said Abou-Hallawa Async image decoding for large images should be disabled after the first time a tile is painted https://bugs.webkit.org/show_bug.cgi?id=174451 Reviewed by Simon Fraser. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::paintContents): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-07-24 Jason Marcell Cherry-pick r219852. rdar://problem/33503476 2017-07-24 Simon Fraser [iOS WK2] Crash under PageOverlayController::uninstallPageOverlay when doing multiple finds https://bugs.webkit.org/show_bug.cgi?id=174806 rdar://problem/33501664 Reviewed by Tim Horton. Calling TextIndicator::createWithSelectionInFrame can trigger layout via VisibleSelection code, which can re-enter FindController::updateFindIndicator which has by now removed m_findIndicatorOverlay from pageOverlayController's map, but not deleted it. The second call to uninstallPageOverlay() thus crashes at m_overlayGraphicsLayers.take(&overlay)->removeFromParent(). Fix by nulling out m_findIndicatorOverlay as soon as we uninstall it. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::updateFindIndicator): 2017-07-22 Jason Marcell Cherry-pick r219709. rdar://problem/33462692 2017-07-20 David Quesada Add SPI to notify WKNavigationDelegate about client redirects https://bugs.webkit.org/show_bug.cgi?id=174680 rdar://problem/33184886 Reviewed by Brady Eidson. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didPerformClientRedirectForNavigation): Add a new virtual method for navigation clients to implement if they want to be informed when the page is initiating a navigation that is a client redirect. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declare the new WKNavigationDelegate method -_webView:didPerformClientRedirectForNavigation: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::didPerformClientRedirectForNavigation): Add a new method to NavigationState method to tell the WKNavigationDelegate when a client redirect happens. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformClientRedirectForLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Allow the WebPageProxy to receive a message from the web process when a client redirect happens. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidPerformClientRedirect): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Send this new message to the UI process on client redirects. 2017-07-22 Jason Marcell Cherry-pick r219703. rdar://problem/33462696 2017-07-20 Chris Dumez Regression(ITP): May get frequently logged out of wsj.com https://bugs.webkit.org/show_bug.cgi?id=174661 Reviewed by Geoffrey Garen. Bump statistics file version to blow away old statistics on disk since those do not take into account associated domains. * UIProcess/WebResourceLoadStatisticsStore.cpp: 2017-07-22 Jason Marcell Cherry-pick r219701. rdar://problem/33465715 2017-07-20 Chris Dumez Regression(ITP): Can no longer log in on abc.go.com https://bugs.webkit.org/show_bug.cgi?id=174533 Reviewed by Geoffrey Garen. Bump statistics database version to blow away any existing statistics. Without this, SSO providers for which we added a quirk may already be in the database and identified as trackers. The quirk merely prevents the specified SSO providers from being identified as trackers. * UIProcess/WebResourceLoadStatisticsStore.cpp: 2017-07-22 Jason Marcell Cherry-pick r219668. rdar://problem/33462676 2017-07-19 Simon Fraser getBoundingClientRects not updated for programmatic scrolls https://bugs.webkit.org/show_bug.cgi?id=174538 rdar://problem/33049012 Reviewed by Tim Horton. Feed ViewportRectStability and ScrollingLayerPositionAction into reconcileScrollingState(). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2017-07-22 Jason Marcell Cherry-pick r219664. rdar://problem/33464115 2017-07-19 Brady Eidson iBooks sometimes crashes when closing a book. and https://bugs.webkit.org/show_bug.cgi?id=174658 Reviewed by Oliver Hunt. - LegacyCustomProtocolManagerProxy should not reference a WebProcessPool directly. - LegacyCustomProtocolManagerProxy should invalidate in its destructor. * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp: (WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy): (WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy): (WebKit::LegacyCustomProtocolManagerProxy::startLoading): (WebKit::LegacyCustomProtocolManagerProxy::stopLoading): (WebKit::LegacyCustomProtocolManagerProxy::invalidate): (WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest): (WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse): (WebKit::LegacyCustomProtocolManagerProxy::didLoadData): (WebKit::LegacyCustomProtocolManagerProxy::didFailWithError): (WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading): (WebKit::LegacyCustomProtocolManagerProxy::processDidClose): Deleted. * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): (WebKit::NetworkProcessProxy::didClose): * UIProcess/Network/NetworkProcessProxy.h: (WebKit::NetworkProcessProxy::processPool): 2017-07-22 Jason Marcell Cherry-pick r219588. rdar://problem/33464447 2017-07-17 Chris Dumez UserMediaPermissionRequestManagerProxy should not use WebCore::Timer https://bugs.webkit.org/show_bug.cgi?id=174599 Reviewed by Tim Horton. UserMediaPermissionRequestManagerProxy should not use WebCore::Timer since it runs in the UIProcess. Switch to using RunLoop::Timer instead. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2017-07-22 Jason Marcell Cherry-pick r219585. rdar://problem/33465177 2017-07-17 Wenson Hsieh [iOS DnD] Web process uses too much memory when beginning a drag on a very large image https://bugs.webkit.org/show_bug.cgi?id=174585 Reviewed by Tim Horton. Add IPC support for serializing/deserializing the size of an image written to the pasteboard. See WebCore ChangeLogs for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-07-17 Jason Marcell Cherry-pick r219413. rdar://problem/33337335 2017-06-29 Dean Jackson Disable some features on this release branch. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: 2017-07-17 Konstantin Tokarev [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called https://bugs.webkit.org/show_bug.cgi?id=174557 Reviewed by Michael Catanzaro. * CMakeLists.txt: 2017-07-17 Carlos Garcia Campos Web Automation: link and partial link queries don't work if the link contains formatting tags https://bugs.webkit.org/show_bug.cgi?id=174498 Reviewed by Brian Burg. So, for example, if we find links with text "Foo" and there's a link like Foo we fail with no such element error. This causes test test_Link_With_Formatting_Tags to fail. * UIProcess/Automation/atoms/FindNodes.js: (switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions. 2017-07-16 Carlos Garcia Campos Web Automation: FindNodes should throw an error in case of invalid strategy https://bugs.webkit.org/show_bug.cgi?id=174497 Reviewed by Brian Burg. We are currently returning null or empty list. According to the spec in 12.2 Find Element and 12.3 Find Elements, step 4: "If location strategy is not present as a keyword in the table of location strategies, return error with error code invalid argument.". https://www.w3.org/TR/webdriver/#find-element. This is causing test test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements to fail. * UIProcess/Automation/atoms/FindNodes.js: (switch): Throw an error in case of unknown strategy. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidParameter exceptions. 2017-07-16 Brady Eidson Crash when a WKHTTPCookieStore outlives its owning WKWebsiteDataStore. and https://bugs.webkit.org/show_bug.cgi?id=174574 Reviewed by Tim Horton. Instead of holding a weak reference to its owning API::WebsiteDataStore, API::HTTPCookieStore can hold a strong reference to the owner's implementation WebKit::WebsiteDataStore. * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::HTTPCookieStore): (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookie): (API::HTTPCookieStore::deleteCookie): (API::HTTPCookieStore::registerObserver): (API::HTTPCookieStore::unregisterObserver): (API::HTTPCookieStore::cookieManagerDestroyed): (API::HTTPCookieStore::registerForNewProcessPoolNotifications): * UIProcess/API/APIHTTPCookieStore.h: 2017-07-15 Brady Eidson Make sure all CFHTTPCookieStorageRefs we create are scheduled. and https://bugs.webkit.org/show_bug.cgi?id=174513 Reviewed by Tim Horton. Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled. We need to schedule it on the appropriate RunLoop. This patch also cleans up the creation of the identifying data itself. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/cf/CookieStorageUtilsCF.h: Added. * Shared/cf/CookieStorageUtilsCF.mm: Added. (WebKit::cookieStorageFromIdentifyingData): (WebKit::identifyingDataFromCookieStorage): * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::setSharedHTTPCookieStorage): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): 2017-07-15 Wenson Hsieh [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating https://bugs.webkit.org/show_bug.cgi?id=174539 Reviewed by Darin Adler. Small tweak to avoid presenting at the element rect or text rect if the interaction information failed to capture valid bounds for the element. We instead fall back to presenting at the touch location. This addresses problems when presenting the action sheet popover on image maps on iPad, where GetPositionInformation fails to capture correct data about for the . * UIProcess/ios/WKActionSheetAssistant.mm: (presentationStyleForView): 2017-07-14 Jonathan Bedard Add iOS 11 SPI https://bugs.webkit.org/show_bug.cgi?id=174430 Reviewed by Tim Horton. * Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11. * UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h. 2017-07-14 Jeff Miller -[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey https://bugs.webkit.org/show_bug.cgi?id=174524 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm: (-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:]): Pass the dictionary key and value in the correct order. 2017-07-14 Brent Fulgham Monitor directory for new statistics files after a delete operation https://bugs.webkit.org/show_bug.cgi?id=174521 Reviewed by Chris Dumez. Create a FileMonitor to watch the data directory when the statistics file is deleted by an external process. If it sees the file get created externally, merge those data into the in-memory store. * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): Added. (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: 2017-07-14 Matt Lewis Unreviewed, rolling out r219516. This caused an API failure on macOS. Reverted changeset: "Make sure all CFHTTPCookieStorageRefs we create are scheduled." https://bugs.webkit.org/show_bug.cgi?id=174513 http://trac.webkit.org/changeset/219516 2017-07-14 Daniel Bates REGRESSION (r219013): Compute source frame info for frameless document https://bugs.webkit.org/show_bug.cgi?id=174385 Reviewed by Brady Eidson. Fixes an issue where we would crash in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() when computing the frame info for a now-frameless document. One way this can happen is when the frame that contains the document that initiated the navigation is removed from the page. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check that we have a valid page ID before looking up the WebPage object corresponding to it. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Compute a FrameInfoData object from the source document directly as opposed to using WebFrame::info() as the latter requires that we have a valid WebCore frame and the source document may not have a frame. 2017-07-14 Jer Noble Allow clients to override their own hardware media requirements where no fallback media exists. https://bugs.webkit.org/show_bug.cgi?id=174426 Reviewed by Eric Carlson. Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both to control WebCore's new allowMediaContentTypesRequiringHardwareSupportAsFallback setting. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetAllowMediaContentTypesRequiringHardwareSupportAsFallback): (WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _setAllowMediaContentTypesRequiringHardwareSupportAsFallback:]): (-[WKWebViewConfiguration _allowMediaContentTypesRequiringHardwareSupportAsFallback]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-07-14 Chris Dumez Possible crash under NetworkSocketStream::didFailSocketStream() https://bugs.webkit.org/show_bug.cgi?id=174526 Reviewed by Brent Fulgham. For robustness, initialize the SocketStreamHandleImpl after the other data members. We are passing |this| to the SocketStreamHandleImpl when constructing it so it is unsafe to have uninitialized data members at this point. * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::NetworkSocketStream): * NetworkProcess/NetworkSocketStream.h: 2017-07-14 Michael Catanzaro [CMake] Unclear distinction between WebKitHelpers and WebKitMacros https://bugs.webkit.org/show_bug.cgi?id=153189 Reviewed by Antonio Gomes. New location for macros that are exclusively needed here. * CMakeLists.txt: 2017-07-14 Brady Eidson Make sure all CFHTTPCookieStorageRefs we create are scheduled. and https://bugs.webkit.org/show_bug.cgi?id=174513 Reviewed by Tim Horton. Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled. We need to schedule it on a RunLoop. This patch also cleans up the creation of the identifying data itself. * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/cf/CookieStorageUtilsCF.cpp: Added. (WebKit::cookieStorageFromIdentifyingData): (WebKit::identifyingDataFromCookieStorage): * Shared/cf/CookieStorageUtilsCF.h: Added. * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::setSharedHTTPCookieStorage): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): 2017-07-14 Chris Dumez Potential null-dereference under NetworkRTCProvider::resolvedName() https://bugs.webkit.org/show_bug.cgi?id=174507 Reviewed by Youenn Fablet. NetworkRTCProvider::resolvedName() could do a null dereference of m_connection because m_connection is nullified in NetworkRTCProvider::close() but resolvers were only closed later on in the NetworkRTCProvider destructor. To address the issue, we now stop DNS resolvers earlier, in NetworkRTCProvider::close(). Also fix unsafe modification of m_resolvers HashMap when iterating over it. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::~NetworkRTCProvider): (WebKit::NetworkRTCProvider::close): (WebKit::NetworkRTCProvider::Resolver::~Resolver): (WebKit::NetworkRTCProvider::stopResolver): 2017-07-14 Youenn Fablet Report CoreAudioCaptureSource failure in case shared unit stops working properly https://bugs.webkit.org/show_bug.cgi?id=174494 Reviewed by Eric Carlson. In case of capture failure, send a CaptureFailure message so that the correct behavior happens in the Web process. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::captureFailed): * WebProcess/cocoa/UserMediaCaptureManager.h: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: 2017-07-13 Chris Dumez Better deal with changes to the ResourceLoadStatisticsStore file on disk https://bugs.webkit.org/show_bug.cgi?id=174487 Reviewed by Brent Fulgham. Rename WebResourceLoadStatisticsStore's resetDataFromDecoder() to mergeWithDataFromDecoder() and update it so that it actual merges the data from the disk with the one we have in memory, instead of replacing it. This avoid data loss. We leverage the existing WebResourceLoadStatisticsStore::mergeStatistics() to merge the statistics. To faciliate merging the operating dates, they are now represented as OperatingDate objects instead of WallTime objects. OperatingDate only include date precision, no time information. As a result, the merge 2 vectors of OperatingDate objects, we can: 1. Merge the 2 sorted vectors (using std::merge()) 2. Get rid of duplicates (easy because of date-level precision) 3. Drop old dates until the vector has at most 30 items. * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::OperatingDate::fromWallTime): (WebKit::OperatingDate::today): (WebKit::OperatingDate::secondsSinceEpoch): (WebKit::OperatingDate::operator==): (WebKit::OperatingDate::operator<): (WebKit::OperatingDate::operator<=): (WebKit::OperatingDate::OperatingDate): (WebKit::mergeOperatingDates): (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData): (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder): (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-13 Dan Bernstein Removed empty project directories left behind after the rename * WebKit2.xcodeproj: Removed. 2017-07-13 Matthew Hanson Fix the cMake builds (GTK and WPE.) https://bugs.webkit.org/show_bug.cgi?id=174164 rdar://problem/33137595 Reviewed by Dan Bernstein. * Scripts/generate-forwarding-headers.pl: (collectFrameworkHeaderPaths): (createForwardingHeadersForFramework): 2017-07-13 Matthew Hanson Rename WebKit2.xcodeproj to WebKit.xcodeproj. https://bugs.webkit.org/show_bug.cgi?id=174164 rdar://problem/33137595 Reviewed by Dan Bernstein. * WebKit.xcodeproj/project.pbxproj: Renamed from Source/WebKit/WebKit2.xcodeproj/project.pbxproj. 2017-07-13 Matthew Hanson Update tools and configurations after renaming Source/WebKit2 to Source/WebKit. https://bugs.webkit.org/show_bug.cgi?id=174164 rdar://problem/33137595 Reviewed by Dan Bernstein. * PlatformGTK.cmake: * Shared/API/c/wpe/WebKit.h: 2017-07-13 Michael Catanzaro Fix compiler warnings when building with GCC 7 https://bugs.webkit.org/show_bug.cgi?id=174463 Reviewed by Darin Adler. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::sendOutputMessage): 2017-07-13 Chris Dumez Moved filesystem code out of WebResourceLoadStatisticsStore class https://bugs.webkit.org/show_bug.cgi?id=174435 Reviewed by Brent Fulgham. Moved filesystem code out of WebResourceLoadStatisticsStore class and into a new ResourceLoadStatisticsPersistentStorage class to decrease complexity. * CMakeLists.txt: * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added. (WebKit::hasFileChangedSince): (WebKit::createDecoderForFile): (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath): (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath): (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): (WebKit::ResourceLoadStatisticsPersistentStorage::clear): (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added. * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added. (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder): * UIProcess/WebResourceLoadStatisticsStore.h: * WebKit2.xcodeproj/project.pbxproj: 2017-07-13 Chris Dumez Unreviewed, rolling out r219453. Seems to cause some crashes on the bots Reverted changeset: "Moved filesystem code out of WebResourceLoadStatisticsStore class" https://bugs.webkit.org/show_bug.cgi?id=174435 http://trac.webkit.org/changeset/219453 2017-07-13 Jeremy Jones Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers. https://bugs.webkit.org/show_bug.cgi?id=174448 Reviewed by Eric Carlson. No behavior change. * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: * WebProcess/cocoa/WebVideoFullscreenManager.h: 2017-07-13 Jeremy Jones Style fix. Replace strongThis with protectedThis. https://bugs.webkit.org/show_bug.cgi?id=174444 Reviewed by Eric Carlson. Rename, no behavior change. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::didSetupFullscreen): (WebKit::WebVideoFullscreenManager::didEnterFullscreen): (WebKit::WebVideoFullscreenManager::didExitFullscreen): (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): 2017-07-13 Chris Dumez Moved filesystem code out of WebResourceLoadStatisticsStore class https://bugs.webkit.org/show_bug.cgi?id=174435 Reviewed by Brent Fulgham. Moved filesystem code out of WebResourceLoadStatisticsStore class and into a new ResourceLoadStatisticsPersistentStorage class to decrease complexity. * CMakeLists.txt: * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added. (WebKit::hasFileChangedSince): (WebKit::createDecoderForFile): (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath): (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath): (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): (WebKit::ResourceLoadStatisticsPersistentStorage::clear): (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup): * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added. * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added. (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder): * UIProcess/WebResourceLoadStatisticsStore.h: * WebKit2.xcodeproj/project.pbxproj: 2017-07-12 Carlos Garcia Campos Web Automation: evaluateJavaScriptFunction should start the callback timeout after the function is applied https://bugs.webkit.org/show_bug.cgi?id=174421 Reviewed by Brian Burg. This is causing selenium test testShouldNotTimeoutIfScriptCallsbackInsideAZeroTimeout to fail, because JavaScriptTimeout error is generated unexpectedly. When no script timeout is specified, 0 is used by default, which means we do a setTimeout with 0 and then the script does another setTimeout with 0, but ours is dispatched before and reportTimeoutError is called. We should start our timeout after applying the function, and only if the result hasn't been reported yet. * WebProcess/Automation/WebAutomationSessionProxy.js: (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): 2017-07-12 Wenson Hsieh [iOS DnD] [WK2] Add SPI to enable, disable, or follow default behavior for DnD on a WKWebView https://bugs.webkit.org/show_bug.cgi?id=174440 Reviewed by Beth Dakin. Adds a new _dragInteractionPolicy property to WKWebView, which an internal client may use to always allow dragging out of the web view (_WKDragInteractionPolicyAlwaysEnable), never allow (_WKDragInteractionPolicyAlwaysDisable) or just use the default device-dependent behavior (_WKDragInteractionPolicyDefault). Also removes an extraneous class from WKContentViewInteraction.mm that is no longer used anywhere. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): Set _dragInteractionPolicy to _WKDragInteractionPolicyDefault upon initialization. (-[WKWebView _dragInteractionPolicy]): (-[WKWebView _setDragInteractionPolicy:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (shouldEnableDragInteractionForPolicy): (-[WKContentView _didChangeDragInteractionPolicy]): Called by the WKWebView when its _dragInteractionPolicy changes. The content view updates its UIDragInteraction's -enabled property here in response. (-[WKContentView setupDataInteractionDelegates]): 2017-07-12 Said Abou-Hallawa Async image decoding for large images should be disabled by default https://bugs.webkit.org/show_bug.cgi?id=174432 Reviewed by Simon Fraser. -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None by AllowAsyncImageDecoding. -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir by resetting the bit PaintBehaviorAllowAsyncImageDecoding. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): 2017-07-12 Eric Carlson [MediaStream] a capture source failure should end the MediaStreamTrack https://bugs.webkit.org/show_bug.cgi?id=174375 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Consolidate start/end. (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): Call captureStateChanged if the capture state changes. Consider interrupted flags. 2017-07-12 Daniel Bates NavigationAction should track whether the navigation was initiated by the main frame https://bugs.webkit.org/show_bug.cgi?id=174386 Reviewed by Brady Eidson. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): Pass whether the load was initiated by the main frame when instantiating the NavigationAction. 2017-07-12 Daniel Bates Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame https://bugs.webkit.org/show_bug.cgi?id=174427 Rubber-stamped by Brady Eidson. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): 2017-07-12 Matt Lewis Unreviewed, rolling out r219401. This revision rolled out the previous patch, but after talking with reviewer, a rebaseline is what was needed.Rolling back in before rebaseline. Reverted changeset: "Unreviewed, rolling out r219379." https://bugs.webkit.org/show_bug.cgi?id=174400 http://trac.webkit.org/changeset/219401 2017-07-12 Daniel Bates Update description of Secure Contexts experimental flag https://bugs.webkit.org/show_bug.cgi?id=174401 Reviewed by Simon Fraser. Change the description of the Secure Contexts experimental flag from "isSecureContext attribute" to "Secure Contexts API". * Shared/WebPreferencesDefinitions.h: 2017-07-12 Matt Lewis Unreviewed, rolling out r219379. This revision caused a consistent failure in the test fast/dom/Window/property-access-on-cached-window-after-frame- removed.html. Reverted changeset: "Remove NAVIGATOR_HWCONCURRENCY" https://bugs.webkit.org/show_bug.cgi?id=174400 http://trac.webkit.org/changeset/219379 2017-07-12 Zan Dobersek [WPE] Use libepoxy https://bugs.webkit.org/show_bug.cgi?id=172104 Reviewed by Michael Catanzaro. * PlatformWPE.cmake: Drop the EGL_INCLUDE_DIRS compilation flags. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: Include when compiling with libepoxy usage enabled. 2017-07-12 Carlos Garcia Campos Web Automation: upstream safaridriver's JavaScript atom implementations https://bugs.webkit.org/show_bug.cgi?id=172060 Reviewed by Brian Burg. * UIProcess/Automation/atoms/ElementAttribute.js: Added. * UIProcess/Automation/atoms/ElementDisplayed.js: Added. * UIProcess/Automation/atoms/FindNodes.js: Added. * UIProcess/Automation/atoms/FormElementClear.js: Added. * UIProcess/Automation/atoms/FormSubmit.js: Added. 2017-07-11 Dean Jackson Remove NAVIGATOR_HWCONCURRENCY https://bugs.webkit.org/show_bug.cgi?id=174400 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: 2017-07-11 Ansh Shukla WKWindowFeatures needs to expose scrollbar, fullscreen, and dialog configuration properties https://bugs.webkit.org/show_bug.cgi?id=174239 Reviewed by Brady Eidson. Add a new private header to expose getters for window feature properties already available in the TFB APIWindowFeatures class. These properties are necessary for Safari to adopt more modern API. * UIProcess/API/Cocoa/WKWindowFeatures.mm: (-[WKWindowFeatures _locationBarVisibility]): (-[WKWindowFeatures _scrollbarsVisibility]): (-[WKWindowFeatures _fullscreenDisplay]): (-[WKWindowFeatures _dialogDisplay]): * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: Expose some window features as read-only properties. * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h: * WebKit2.xcodeproj/project.pbxproj: 2017-07-11 Chris Dumez Avoid duplicating default parameter values in [WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState] https://bugs.webkit.org/show_bug.cgi?id=174402 Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::performDailyTasks): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies): (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired): (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries): (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo): (WebKit::WebResourceLoadStatisticsStore::pruneStatisticsIfNeeded): (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-11 Dean Jackson Rolling out r219372. * Configurations/FeatureDefines.xcconfig: 2017-07-11 Dean Jackson Remove NAVIGATOR_HWCONCURRENCY https://bugs.webkit.org/show_bug.cgi?id=174400 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: 2017-07-11 Dean Jackson Viewport fit experimental feature should be always on by default https://bugs.webkit.org/show_bug.cgi?id=174398 Reviewed by Simon Fraser. Even though this is experimental, it should be enabled by default, and not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. * Shared/WebPreferencesDefinitions.h: 2017-07-11 Adrian Perez de Castro Fix typo: ContentRuleListStore::nonLegacyDdefaultStore() https://bugs.webkit.org/show_bug.cgi?id=174387 Reviewed by Michael Catanzaro. Rename nonLegacyDdefaultStore() to nonLegacyDefaultStore(). * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::nonLegacyDefaultStore): (API::ContentRuleListStore::defaultStore): * UIProcess/API/APIContentRuleListStore.h: 2017-07-11 Chris Dumez Simplify primary domain lambda captures in WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174381 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::isolatedPrimaryDomain): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setLastSeen): (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): (WebKit::primaryDomain): Deleted. 2017-07-11 Timothy Hatcher Fix a build failure in WebDragClient when !PLATFORM(COCOA) && !PLATFORM(GTK). https://bugs.webkit.org/show_bug.cgi?id=174372 Reviewed by Beth Dakin. * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::didConcludeEditDrag): Added empty method. 2017-07-11 Brent Fulgham Reset cookie partitioning state after network process crashes https://bugs.webkit.org/show_bug.cgi?id=174306 Reviewed by Chris Dumez. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Move cookie partioning state code to helper function. (WebKit::ResourceLoadStatisticsStore::resetPartitionCookiesState): Added. * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Inform the statistics store that the network process crashed. (WebKit::WebProcessPool::terminateNetworkProcess): Mark network process as crashed. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::networkProcessDidCrash): Reset the cookie partitioning state after a crash. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::notifyResourceLoadStatisticsNetworkProcessDidCrash): Relay information to the statistics store. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-07-11 Timothy Hatcher Fix broken build when !ENABLE(INDEXED_DATABASE) https://bugs.webkit.org/show_bug.cgi?id=174370 Reviewed by Alex Christensen. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageAddedToProcess): 2017-07-11 Youenn Fablet Changing the web page muted state for playing audio should not disable other tabs capture https://bugs.webkit.org/show_bug.cgi?id=174349 Unreviewed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Fixes non MEDIA_STREAM builds. 2017-07-11 Wenson Hsieh Address post-review feedback after http://trac.webkit.org/r219310 https://bugs.webkit.org/show_bug.cgi?id=174300 Reviewed by Simon Fraser. Removes plumbing introduced in r219310 for telling WKContentView when the user has finished panning or zooming. This was previously used to reset allowing asynchronous touch event after preventing the web touch events gesture recognizer from firing. However, a far simpler (and much less fragile) solution is to just set _canSendTouchEventsAsynchronously to NO at the beginning of the gesture, before the first `touchstart` event is dispatched. This way, we always ensure that _canSendTouchEventsAsynchronously is NO when beginning to process a touch event. This approach is correct because the only place where we query _canSendTouchEventsAsynchronously is in -_webTouchEventsRecognized:, where (when we are beginning a new gesture) we are guaranteed that -gestureRecognizer:shouldIgnoreWebTouchWithEvent: has already been called and _canSendTouchEventsAsynchronously is NO. Confirmed that the LayoutTests added in r219310 still pass. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): * UIProcess/PageClient.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted. * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): Deleted. * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]): (-[WKContentView scrollViewDidEndPanOrPinchGesture]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): Deleted. 2017-07-11 Brent Fulgham Unreviewed clean-up after r219323 Simplify algorithm slightly based on a suggestion Chris Dumez made in the review. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::pruneResources): Don't create a second variable to track the pruning operation. 2017-07-11 Alex Christensen SharedBuffer::size should return a size_t https://bugs.webkit.org/show_bug.cgi?id=174328 Reviewed by Andreas Kling. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): 2017-07-11 Youenn Fablet We should do ICE candidate filtering at the Document level https://bugs.webkit.org/show_bug.cgi?id=173861 Reviewed by Eric Carlson. Removing ICE candidate filtering handling at UIProcess level. ICE candidate filtering is now disabled at UserMediaRequest level. WebPage forwards the ICE candidate filtering option to the page so as to set the default option correctly for every document of the page. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willCreateMediaStream): (WebKit::UserMediaProcessManager::endedCaptureSession): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::disableICECandidateFiltering): (WebKit::WebPage::enableICECandidateFiltering): 2017-07-11 Youenn Fablet Changing the web page muted state for playing audio should not disable other tabs capture https://bugs.webkit.org/show_bug.cgi?id=174349 rdar://problem/33223988 Reviewed by Eric Carlson. Make sure to mute capturing streams of any other tab if the current tab will start capturing or will unmute existing capturing streams. Manually tested by having a tab doing capture and another tab playing a video. Muting or unmuting the tab playing video should not change the capture tab. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): (WebKit::WebPageProxy::setMuted): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): 2017-07-11 Youenn Fablet NetworkProcess should close listening WebRTC sockets when being suspended https://bugs.webkit.org/show_bug.cgi?id=174270 rdar://problem/33139844 Reviewed by Chris Dumez. To prevent potential spinning of the NetworkProcess, NetworkProcess will now close listening sockets when being notified that it will be suspended. When the network process is being suspended, it will stop creating listening sockets, until it resumes. Future additional efforts might be to improve select/cancel so that we can stop listening sockets at resume time, or to reimplement part of the stack using CFStream. Tested through manual testing by going to a website doing WebRTC, homing out so that the network process is suspended and reopening Safari. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension): Proxying call to clean for suspension to rtc provider so that it will close listening sockets. (WebKit::NetworkConnectionToWebProcess::resumeFromSuspension): Authorizing back listening sockets. * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension): Clean-up is done asynchronously as it can happen in background threads. Hence why passing a callback as parameter. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::notifyProcessReadyToSuspend): Helper routine to notify UI process that network process clean up is done. (WebKit::TaskCounter::TaskCounter): Helper class to call notifyProcessReadyToSuspend when sded. (WebKit::TaskCounter::~TaskCounter): (WebKit::NetworkProcess::actualPrepareToSuspend): Doing the clean-up for each connection that needs it. Making sure to notify UI process of clean-up being completed once all connections are cleaned. (WebKit::NetworkProcess::processWillSuspendImminently): (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::processDidResume): Reenable listening sockets. * NetworkProcess/NetworkProcess.h: * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient): * NetworkProcess/webrtc/LibWebRTCSocketClient.h: Adding type getter and making close public. Used by NetworkRTCProvider to identifiy listening sockets and close them. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::closeListeningSockets): We close the webrtc socket and we also notify the Web Process that the socket is closed so that it can take actions to recreate some if needed. (WebKit::NetworkRTCProvider::finishClosingListeningSockets): * NetworkProcess/webrtc/NetworkRTCProvider.h: (WebKit::NetworkRTCProvider::authorizeListeningSockets): Authorize creation of listening sockets. 2017-07-10 Brent Fulgham Resource Load Statistics: Prune statistics in orders of importance https://bugs.webkit.org/show_bug.cgi?id=174215 Unreviewed test correction. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::pruneResources): The revised algorithm did not update the remaining count to be pruned, causing a test failure. 2017-07-10 John Wilander Resource Load Statistics: Prune statistics in orders of importance https://bugs.webkit.org/show_bug.cgi?id=174215 Reviewed by Chris Dumez. New functionality. Prunes statistics in this order: 1. Non-prevalent resources without user interaction. 2. Prevalent resources without user interaction. 3. Non-prevalent resources with user interaction. 4. Prevalent resources with user interaction. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Added timestamp field lastSeen. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]): (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): Test infrastructure. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries): Test infrastructure. (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo): Test infrastructure. (WebKit::sortAndPrune): Convenience function. (WebKit::ResourceLoadStatisticsStore::pruneStatisticsIfNeeded): The new pruning function. * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Now calls ResourceLoadStatisticsStore::pruneStatisticsIfNeeded(). (WebKit::WebResourceLoadStatisticsStore::setLastSeen): Test infrastructure. (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries): Test infrastructure. (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo): Test infrastructure. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-10 Dean Jackson const() experimental feature should always be on by default https://bugs.webkit.org/show_bug.cgi?id=174341 Reviewed by Simon Fraser. Even though this is experimental, it should be enabled by default, and not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. * Shared/WebPreferencesDefinitions.h: 2017-07-10 Chris Dumez [iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily https://bugs.webkit.org/show_bug.cgi?id=174326 Reviewed by Simon Fraser. Only call [scrollView setZoomScale] if the new zoom scale is actually different to avoid doing unnecessary work in UIKit. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): 2017-07-10 Chris Dumez Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174203 Reviewed by Brent Fulgham. Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore. The 2 classes have a similar purpose and there is no clean separation between the 2. It makes more sense to have a single store class for resource load statistics. If we want to simplify the WebResourceLoadStatisticsStore class, I think it'd make more sense to split the file system I/O code out. This code adds quite a bit of complexity. * CMakeLists.txt: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Removed. * UIProcess/Storage/ResourceLoadStatisticsStore.h: Removed. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): (WebKit::WebResourceLoadStatisticsStore::performDailyTasks): (WebKit::WebResourceLoadStatisticsStore::submitTelemetry): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData): (WebKit::WebResourceLoadStatisticsStore::populateFromDecoder): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::WebResourceLoadStatisticsStore::processStatistics): (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction): (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary): (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::sortedPrevalentResourceTelemetry): (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): * UIProcess/WebResourceLoadStatisticsTelemetry.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): * WebKit2.xcodeproj/project.pbxproj: 2017-07-10 Wenson Hsieh [WK2] Ignore touch events that interrupt platform-driven momentum scrolling https://bugs.webkit.org/show_bug.cgi?id=174300 Reviewed by Simon Fraser. Adds support for immediately failing WKContentView's UIWebTouchEventsGestureRecognizer if any touch interrupts scroll view deceleration. Covered by 3 new LayoutTests (see Source/WebCore/ChangeLog). * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): * UIProcess/PageClient.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Adds plumbing in the UI process to alert the WKContentView when scroll view dragging has ended in an overflow momentum scrolling region (tracked by an overflow scrolling tree node). This parallels UI process plumbing for ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture. * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView scrollViewDidEndPanOrPinchGesture]): When the dragging phase of a scroll gesture ends, ensure that _canSendTouchEventsAsynchronously is reset to NO. When touches are not being prevented, this flag is set to YES in -scrollViewWillStartPanOrPinchGesture: and normally reset to NO in -_webTouchEventsRecognized: after all touch points have been released. However, in the case where we've prematurely failed the web touch events gesture recognizer after -touchesBegan:, -_webTouchEventsRecognized: will not be called again in a state where all touches have been released. Thus, we also need to bookend the place where we begin allowing async touch event dispatch in -scrollViewWillStartPanOrPinchGesture by disallowing async touch event dispatch in -scrollViewDidEndPanOrPinchGesture. This has no impact in the normal case where the user scrolls without momentum, since -scrollViewDidEndPanOrPinchGesture will fire after async touch events have already been disallowed in -_webTouchEventsRecognized:, and in the case where the page prevents default on touches, scrolling doesn't happen anyways, so neither scrollViewWillStartPanOrPinchGesture nor scrollViewDidEndPanOrPinchGesture will be invoked. (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]): Implements a new SPI hook in UIKit. This serves an identical purpose as -shouldIgnoreWebTouch, but additionally passes the triggering UIEvent, as well as the gesture recognizer itself (following standard convention for Objective C delegate methods). Here, we return YES in the case where one or more of the touches recognized by the gesture is currently interrupting scroll deceleration. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): 2017-07-10 Brent Fulgham [WK2][macOS] Allow access to com.apple.cfnetwork.cfnetworkagent in the Network Process https://bugs.webkit.org/show_bug.cgi?id=174320 Reviewed by Geoffrey Garen. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: 2017-07-10 Megan Gardner Add location to NavigationActionData https://bugs.webkit.org/show_bug.cgi?id=174233 Reviewed by Simon Fraser. Add the root view location of a tap to a NavigationAction to vend to Safari. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: * UIProcess/API/APINavigationAction.h: * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction description]): (-[WKNavigationAction _clickLocationInRootViewCoordinates]): * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp: (WebKit::clickLocationInRootViewCoordinatesForMouseEvent): (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction): (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction): * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h: (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinates): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2017-07-03 Brian Burg Web Replay: remove some unused code https://bugs.webkit.org/show_bug.cgi?id=173903 Rubber-stamped by Joseph Pecoraro. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::tryClose): (WebKit::WebPage::loadRequest): (WebKit::WebPage::stopLoadingFrame): (WebKit::WebPage::stopLoading): (WebKit::WebPage::reload): (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::handleContextMenuEvent): (WebKit::handleMouseEvent): (WebKit::handleWheelEvent): (WebKit::handleKeyEvent): (WebKit::WebPage::scroll): (WebKit::WebPage::logicalScroll): 2017-07-10 Chris Dumez Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up https://bugs.webkit.org/show_bug.cgi?id=174301 Reviewed by Brent Fulgham. General clean up and various simplifications / optimizations to WebResourceLoadStatisticsStore and ResourceLoadStatisticsStore classes. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::create): (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore): (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): (WebKit::ResourceLoadStatisticsStore::populateFromDecoder): (WebKit::ResourceLoadStatisticsStore::clearInMemory): (WebKit::ResourceLoadStatisticsStore::mergeStatistics): (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::ResourceLoadStatisticsStore::processStatistics): (WebKit::ResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction): (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath): (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::scheduleOrWriteStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): (WebKit::WebResourceLoadStatisticsStore::performDailyTasks): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::WebResourceLoadStatisticsStore::setDataRecordsBeingRemoved): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::sortedPrevalentResourceTelemetry): (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-07-10 Michael Catanzaro [SOUP] Remove WebKitSoupCookieJarSqlite https://bugs.webkit.org/show_bug.cgi?id=174310 Reviewed by Carlos Garcia Campos. It seems WebKitSoupCookieJarSqlite uses exactly the same database format as the upstream SoupCookieJarDb class. WebKitSoupCookieJarSqlite is a copy of SoupCookieJarSqlite that uses WebCore's SQLite wrapper and WTF stuff. WebKitSoupCookieJarSqlite exists only because SoupCookieJarDb is relatively new, and the older SoupCookieJarSqlite class existed only in libsoup-gnome rather than libsoup proper. The advantage of continuing to use our WebKitSoupCookieJarSqlite class, besides that we already know it works, is that it utilizes the same SQLiteDatabase class that is used elsewhere in WebKit. But that's not really any reason to keep the class around, when SoupCookieJarDb does exactly the same thing. It was introduced in libsoup 2.42 and that is already our minimum required version, so we can switch now. This passes a quick sanity-check of Epiphany's cookies dialog and also TestCookieManager. * PlatformGTK.cmake: * PlatformWPE.cmake: * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: (WebKit::WebCookieManager::setCookiePersistentStorage): * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp: Removed. * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.h: Removed. 2017-07-10 Myles C. Maxfield REGRESSION(r213590): UI process updates the visible content rects more often than it did in iOS 10 https://bugs.webkit.org/show_bug.cgi?id=174282 Reviewed by Simon Fraser. In r213590, we accidentally refactored -[WKWebView _didCommitLayerTree:] to call _scheduleVisibleContentRectUpdate more often. Instead, this should be triggered from inside the "if" statements. No tests because there is no behavior change. Performance change is tested in MotionMark. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isShowingVideoPictureInPicture]): (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView goBack]): (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): (-[WKWebView scrollViewDidScroll:]): (-[WKWebView _visibleContentRect]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _navigationGestureDidBegin]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _reloadExpiredOnly]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): (-[WKWebView _clearOverrideLayoutParameters]): (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): (-[WKWebView _propertiesOfLayerWithID:]): 2017-07-10 Carlos Garcia Campos [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around) https://bugs.webkit.org/show_bug.cgi?id=166029 Reviewed by Michael Catanzaro. Clear the SoupNetworkSession and cookie storage after the main loop quits. * NetworkProcess/soup/NetworkProcessMainSoup.cpp: (WebKit::NetworkProcessMainUnix): 2017-07-10 Wenson Hsieh [WK2] Action sheets for links fail to present in WebKit2 PDF view https://bugs.webkit.org/show_bug.cgi?id=174307 Reviewed by Tim Horton. Currently, presenting an action sheet for a link always uses the WKActionSheetPresentAtClosestIndicatorRect codepath, which requires text indicator data for the link. However, when showing an action sheet for a link via WKPDFView, a text indicator for the link is not included, so the popover rect ends up being an empty rect at the origin, which causes us to bail from presenting the popover. To address this, we tweak our heuristic for determining which action sheet presentation style to use, so that we only use the closest indicator rect for a link if the text indicator data is also present (otherwise, we fall back to using the element rect). All other behavior is the same. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showImageSheet]): (presentationStyleForView): Refactor _shouldPresentAtTouchLocationForElementRect into presentationStyleForView, a static function that returns a WKActionSheetPresentationStyle. (-[WKActionSheetAssistant showLinkSheet]): (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]): Deleted. 2017-07-09 Brady Eidson Remove some obsolete WebKitVersionChecks. https://bugs.webkit.org/show_bug.cgi?id=174294 Reviewed by Dan Bernstein. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-07-08 Chris Dumez Simplify WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174290 Reviewed by Brent Fulgham. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]): (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Rename a couple of functions in the Cocoa SPI for clarity and to match the name of their internal implementation. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::create): (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): Stylistic changes. (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): Make const. (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): Use HashMap::add() instead of HashMap::set(). There is not supposed to have any duplicate keys so add() is sufficient and more efficient. (WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Removed. clearInMemoryAndPersistent() was only called from WebResourceLoadStatisticsStore and the m_deletePersistentStoreHandler / m_grandfatherExistingWebsiteDataHandler were both set by the WebResourceLoadStatisticsStore as well. Therefore, we don't really need this function, WebResourceLoadStatisticsStore now calls ResourceLoadStatisticsStore::clearInMemory() instead and takes care of doing what the m_deletePersistentStoreHandler / m_grandfatherExistingWebsiteDataHandler handlers were doing on its side. (WebKit::ResourceLoadStatisticsStore::mergeStatistics): Pass Vector as rvalue reference, as a preparation for a future optimization. Added FIXME comment about the optimization. (WebKit::ResourceLoadStatisticsStore::setNotificationCallback): Removed. (WebKit::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback): Removed. (WebKit::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Removed. (WebKit::ResourceLoadStatisticsStore::setFireTelemetryCallback): Removed. Drop those callback setters. WebResourceLoadStatisticsStore is the only client of ResourceLoadStatisticsStore and those callbacks were always called as a result of an operation requested by the WebResourceLoadStatisticsStore. Therefore, those are not needed. WebResourceLoadStatisticsStore can take care of doing what those callbacks were doing on its side. (WebKit::ResourceLoadStatisticsStore::processStatistics): Pass parameter by const reference since we clearly do not intend to transfer ownership of it. (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords): (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): Stylistic changes. (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): Removed. (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): Removed. (WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved): Removed. Those were moved to WebResourceLoadStatisticsStore since they do not require any access to the statistics, and are only used by WebResourceLoadStatisticsStore. * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Store registering most callbacks on the coreStore. Instead, the logic of those callbacks is now inlined in the few methods in WebResourceLoadStatisticsStore that were causing these callbacks to be called. (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Access some methods on WebResourceLoadStatisticsStore instead of the coreStore since those were moved. (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Drop unnecessary mutable for lambda. (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Pass parameter as rvalue reference as a preparation for a future optimization. (WebKit::WebResourceLoadStatisticsStore::hasStatisticsFileChangedSinceLastSync): Make const. (WebKit::WebResourceLoadStatisticsStore::submitTelemetry): Add assertion to make sure this is called on the main thread. (WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler): Removed. This was dispatching to a background queue to call fireDataModificationHandler() on the ResourceLoadStatisticsStore. The coreStore would then dispatch back on the main thread to call the WebResourceLoadStatisticsStore's modification handler. This modification handler was merely calling processStatisticsAndDataRecords(). Therefore, callers of WebResourceLoadStatisticsStore::fireDataModificationHandler() can call WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() directly instead. (WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler): Removed. This was calling ResourceLoadStatisticsStore::fireTelemetryHandler(), which was calling back WebResourceLoadStatisticsStore's fireTelemetryHandler. The handler in question was merely calling submitTelemetry(). Therefore, callers of WebResourceLoadStatisticsStore::fireTelemetryHandler() can call WebResourceLoadStatisticsStore::submitTelemetry() directly instead. (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent): Call ResourceLoadStatisticsStore::clearInMemory() instead of clearInMemoryAndPersistent(), which was removed. ResourceLoadStatisticsStore::clearInMemoryAndPersistent() was calling clearInMemory() and then 2 of WebResourceLoadStatisticsStore's handlers. Instead, we now call the functions that those handlers were calling directly, thus eliminating the need for those handlers. (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval): Set m_minimumTimeBetweenDataRecordsRemoval directly as it is now store on this class instead of the coreStore. (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::WebResourceLoadStatisticsStore::dataRecordsBeingRemoved): (WebKit::WebResourceLoadStatisticsStore::dataRecordsWereRemoved): Those were merely moved from the ResourceLoadStatisticsStore. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): Check for sortedPrevalentResources.isEmpty() instead of checking if the size if less than minimumPrevalentResourcesForTelemetry. ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry() either returns an empty vector or a vector with more than minimumPrevalentResourcesForTelemetry items. Therefore, there is no need to expose minimumPrevalentResourcesForTelemetry. 2017-07-08 Yusuke Suzuki Drop NOSNIFF compile flag https://bugs.webkit.org/show_bug.cgi?id=174289 Reviewed by Michael Catanzaro. * Configurations/FeatureDefines.xcconfig: 2017-07-07 Chris Dumez [WK2] Use a rolling 30-day uptime for processing statistics https://bugs.webkit.org/show_bug.cgi?id=174235 Reviewed by Brent Fulgham. Follow-up fix for r219274 because it caused this test to time out: http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html The test sets TimeToLiveUserInteraction to 0 so our implementation cannot use 0 as magic value to see if it was set. Instead, use std::optional. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired): * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-07 Brent Fulgham [WK2] Use a rolling 30-day uptime for processing statistics https://bugs.webkit.org/show_bug.cgi?id=174235 Reviewed by Chris Dumez. * UIProcess/API/Cocoa/WKWebsiteDataStore.cpp: (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsResetToConsistentState): Initialize time-to-live to zero by default. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): Write out vector of operating dates. (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): Read in vector of operating dates. (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): Check new convenience method. (WebKit::ResourceLoadStatisticsStore::markTodayAsOperatingDate): Added. (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired): Added. * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): When reading a new data file, update the current operating date (if needed). (WebKit::WebResourceLoadStatisticsStore::handleDailyTasks): Roll uptime dates as needed, then handle telemetry. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-07 Wenson Hsieh [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging https://bugs.webkit.org/show_bug.cgi?id=174219 Reviewed by Ryosuke Niwa. Tweak some testing SPI to return a drop operation flag instead of whether or not the drop operation was not UIDropOperationCancel. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateDataInteractionUpdated:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _simulateDataInteractionUpdated:]): 2017-07-07 Commit Queue Unreviewed, rolling out r219238, r219239, and r219241. https://bugs.webkit.org/show_bug.cgi?id=174265 "fast/workers/dedicated-worker-lifecycle.html is flaky" (Requested by yusukesuzuki on #webkit). Reverted changesets: "[WTF] Implement WTF::ThreadGroup" https://bugs.webkit.org/show_bug.cgi?id=174081 http://trac.webkit.org/changeset/219238 "Unreviewed, build fix after r219238" https://bugs.webkit.org/show_bug.cgi?id=174081 http://trac.webkit.org/changeset/219239 "Unreviewed, CLoop build fix after r219238" https://bugs.webkit.org/show_bug.cgi?id=174081 http://trac.webkit.org/changeset/219241 2017-07-07 Antti Koivisto WKWebSiteDataStore.removeDataOfTypes should wait until disk cache files are actually removed before invoking completion handler https://bugs.webkit.org/show_bug.cgi?id=174224 Reviewed by Sam Weinig. Currently we dispatch file deletion operations to a background queue and call the completion handler without waiting for the I/O to complete. * NetworkProcess/NetworkProcess.cpp: (WebKit::clearDiskCacheEntries): Call a new version of NetworkCache::remove() for bulk deletion. Note that it is fine to call this with an empty vector. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::remove): Bulk deletion with a completion handler. (WebKit::NetworkCache::Cache::deleteFiles): Added. Factor to a helper function. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::remove): Remove files for all the provided keys in a queue and invoke the completion handler in the main thread when done. * NetworkProcess/cache/NetworkCacheStorage.h: 2017-07-06 Chris Dumez Fix bad usage of static variables in ResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174237 Reviewed by Brent Fulgham. Fix bad usage of static variables in ResourceLoadStatisticsStore. Those can be set via member functions on ResourceLoadStatisticsStore so they should be data members. The API to set them is associated to a particular store and there can in theory be several stores. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::shouldPartitionCookies): (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval): (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime): (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::shouldPartitionCookies): Deleted. * UIProcess/Storage/ResourceLoadStatisticsStore.h: 2017-07-05 Yusuke Suzuki [WTF] Implement WTF::ThreadGroup https://bugs.webkit.org/show_bug.cgi?id=174081 Reviewed by Mark Lam. * Shared/AsyncRequest.h: * UIProcess/Storage/ResourceLoadStatisticsStore.h: 2017-07-06 Chris Dumez Drop unused ResourceLoadStatistics members https://bugs.webkit.org/show_bug.cgi?id=174226 Reviewed by Brent Fulgham. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): 2017-07-06 Wenson Hsieh Unreviewed, fix the internal iOS 11 build It turns out, our internal bots are still on an older version of the iOS 11 SDK that's missing _UIDataOwner in . To ensure that we can build on both current and slightly older versions of the iOS 11 SDK, fall back to using NSInteger instead of _UIDataOwner. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:dataOwnerForSession:]): (-[WKContentView _dropInteraction:dataOwnerForSession:]): 2017-07-06 Wenson Hsieh [iOS DnD] [WK2] Add delegate hooks for specifying the data owner for a drag or drop session https://bugs.webkit.org/show_bug.cgi?id=174139 Reviewed by Beth Dakin. Add hooks to query the UI delegate for a _UIDataOwner on both drag and drop sides. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:dataOwnerForSession:]): (-[WKContentView _dropInteraction:dataOwnerForSession:]): 2017-07-06 Brent Fulgham [WK2] ResourceLoadStatistics should batch its writes https://bugs.webkit.org/show_bug.cgi?id=174111 Reviewed by Chris Dumez. Revise the data writing operation to only write on a specific interval (currently set to 5 minutes). Also make 'writeStoreToDisk' simpler to use by moving the deleting (before write) and creating (after write) of the FileMonitor into the method, rather than requiring this knowledge in multiple places. Make sure that we write our statistics file out before exiting so that we do not lose any data if we exit before the five-minute window has elapsed. * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Deleted. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Remove the stop and start monitoring into 'writeStoreToDisk'. Also check if enough time has elapsed since the last write to commit to disk. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Remove the stop and start monitoring into 'writeStoreToDisk'. (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Add the stop and start monitoring commands here, so callers don't have to know to do so. 2017-07-06 Chris Dumez FileMonitor should not be ref counted https://bugs.webkit.org/show_bug.cgi?id=174166 Reviewed by Brent Fulgham. Update code using FileMonitor to reflect API change. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-06 Matt Rajca Fix build with VIDEO support disabled. https://bugs.webkit.org/show_bug.cgi?id=174217 Unreviewed build fix. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateWebsitePolicies): 2017-07-06 Chris Dumez Crash under WebResourceLoadStatisticsStore::persistentStoragePath(WTF::String const&) https://bugs.webkit.org/show_bug.cgi?id=174205 Reviewed by Brent Fulgham. Make sure we isolateCopy() m_statisticsStoragePath before using it from the background thread. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath): (WebKit::WebResourceLoadStatisticsStore::statisticsFilePath): (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): (WebKit::WebResourceLoadStatisticsStore::deleteStoreFromDisk): (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Deleted. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-06 Alex Christensen Fix CFURLRequestRef serialization after r207330 https://bugs.webkit.org/show_bug.cgi?id=163332 * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): The CFURLConnection code was not updated. We did not catch this because nobody uses the WebKit2 CFURLConnection code, but I need to use it to debug something. 2017-07-06 Chris Dumez Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver https://bugs.webkit.org/show_bug.cgi?id=174194 Reviewed by Brent Fulgham. Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver. This makes more sense and decreases the complexity of the WebProcess class. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::statisticsChangedTimerFired): Deleted. * WebProcess/WebProcess.h: 2017-07-06 Chris Dumez WebResourceLoadStatisticsStore should only be constructed when the feature is enabled https://bugs.webkit.org/show_bug.cgi?id=174189 Reviewed by Brent Fulgham. Delay the construction of the WebResourceLoadStatisticsStore until the feature gets enabled via WebsiteDataStore::setResourceLoadStatisticsEnabled(). Previously, we would always construct a store and then have a boolean on the store to indicate if it is enabled or not. Also simplify the initialization process of the WebResourceLoadStatisticsStore, we used to have: 1. WebResourceLoadStatisticsStore constructor 2. WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver() 3. WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled(true) All 3 steps are now taken care of by the WebResourceLoadStatisticsStore constructor. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformInitialize): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled): (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resourceLoadStatistics): * UIProcess/wpe/WebProcessPoolWPE.cpp: (WebKit::WebProcessPool::platformInitialize): 2017-07-06 Claudio Saavedra [GTK] It should process MouseMoved events when the parent window is not active https://bugs.webkit.org/show_bug.cgi?id=116691 Reviewed by Michael Catanzaro. From reading the comments in the related code, only in Safari it is desired that MouseMoved events are not processed when the parent window is not active. In other ports, in particular those targeting Linux, these events should be processed for consistency with other browsers. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setCursor): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setCursor): * WebProcess/WebPage/WebPage.cpp: (WebKit::handleMouseEvent): (WebKit::WebPage::mouseEvent): No need to always pass a boolean parameter that is only checked for one type of event. Do the check internally in handleMouseEvent() only when needed and only in Cocoa. 2017-07-05 Don Olmstead [WTF] Move SoftLinking.h into WTF https://bugs.webkit.org/show_bug.cgi?id=174000 Reviewed by Alex Christensen. * Platform/mac/StringUtilities.mm: * Platform/spi/ios/ManagedConfigurationSPI.h: * Shared/Cocoa/DataDetectionResult.mm: * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: * Shared/ios/InteractionInformationAtPosition.mm: * Shared/ios/WebIconUtilities.mm: * Shared/mac/CookieStorageShim.mm: * Shared/mac/WebCoreArgumentCodersMac.mm: * UIProcess/API/Cocoa/_WKElementAction.mm: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: * UIProcess/Cocoa/UIDelegate.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: * UIProcess/ios/WKActionSheetAssistant.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: * UIProcess/ios/forms/WKFileUploadPanel.mm: * UIProcess/mac/WKImmediateActionController.mm: * UIProcess/mac/WebInspectorProxyMac.mm: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: * WebProcess/WebPage/mac/WebInspectorUIMac.mm: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-07-05 Brady Eidson Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow". and https://bugs.webkit.org/show_bug.cgi?id=174178 Reviewed by Alex Christensen. Adopt to the new constructor for FrameLoadRequest. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): 2017-07-05 Ryosuke Niwa Remove unnecessary forward declartions now that we include Foundation.h * UIProcess/API/Cocoa/WKContentRuleListStore.h: 2017-07-05 Ryosuke Niwa Make WebKit's public headers on Mac and iOS C++ module safe https://bugs.webkit.org/show_bug.cgi?id=174175 Reviewed by Alex Christensen. Fixed the header files. * UIProcess/API/Cocoa/WKContentRuleList.h: * UIProcess/API/Cocoa/WKContentRuleListStore.h: * UIProcess/API/Cocoa/WKUIDelegate.h: 2017-07-05 Chris Dumez [WK2] WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with https://bugs.webkit.org/show_bug.cgi?id=174174 Reviewed by Brent Fulgham. WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with. Fix this by iterating over WebsiteDataStore::processPools() instead of WebProcessPool::allProcessPools(). Also rename shouldPartitionCookiesForTopPrivatelyOwnedDomains methods / IPC messages to updateCookiePartitioningForTopPrivatelyOwnedDomains since this is a setter, not a getter. Finally, drop ShouldPartitionCookiesForTopPrivatelyOwnedDomains IPC message to the NetworkProcessProxy as well as corresponding methods as those appear to be unused. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled): (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-07-05 Tim Horton Async Image Decoding: Image flashes away briefly when tapping on tab in iPad tab picker https://bugs.webkit.org/show_bug.cgi?id=174173 Reviewed by Geoffrey Garen. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID): When a client uses e.g. doAfterNextPresentationUpdate (or internally, dispatchAfterEnsuringDrawing), they're doing so in the hopes that the callback is called after the page is well-painted -- for example, to remove a snapshot (in the tab picker case, as well as for navigation gestures), or to *take* a snapshot. In all of these cases, it is preferable to do a synchronous decode, to ensure that the image does not flash away temporarily. Use the existing mechanism that was implemented for the synchronous activity state change flush to also force synchronous image decoding any time there is a post-commit transaction callback. 2017-07-05 Wenson Hsieh [iOS DnD] [WK2] 3D touch fails to recognize when UIDragInteraction is enabled on phone https://bugs.webkit.org/show_bug.cgi?id=174171 Reviewed by Tim Horton. By default, UIKit defers all competing long press gesture recognizers if dragging is enabled. However, this would cause 3D touch to be prevented, due to UIKit asking us whether or not we can proceed with the 3D touch gesture in -_interactionShouldBeginFromPreviewItemController:forPosition:, while the highlight long press gesture recognizer is being deferred. To address this, we use SPI on UIDragInteraction to allow the highlight long press gesture recognizer to recognize alongside the drag lift gesture. We then (already) manually cancel the highlight long press gesture in _dragInteraction:prepareForSession:completion:. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:shouldDelayCompetingGestureRecognizer:]): 2017-07-03 Myles C. Maxfield Remove copy of ICU headers from WebKit https://bugs.webkit.org/show_bug.cgi?id=116407 Reviewed by Alex Christensen. * Configurations/BaseTarget.xcconfig: 2017-07-05 Chris Dumez Regression(r218821): Bad cast to WebKit::DiagnosticLoggingClient in WKWebView's _setDiagnosticLoggingDelegate https://bugs.webkit.org/show_bug.cgi?id=174163 Reviewed by Alex Christensen. After r218821, WebPageProxy::setDiagnosticLoggingClient() would no longer set the client in private session. This is an issue because there is code in WKWebView which expects the DiagnosticLoggingClient to be set and of a specific type. This would lead to bad casts in WKWebView's _diagnosticLoggingDelegate / _setDiagnosticLoggingDelegate. To avoid the issue, we now unconditionally update the client in WebPageProxy::setDiagnosticLoggingClient(). Instead, we implement the logic for disabling logging in private session in the logging methods themselves, via the WebPageProxy::effectiveDiagnosticLoggingClient() helper instead. I also added null checks in WKWebView's _diagnosticLoggingDelegate / _setDiagnosticLoggingDelegate. Even though the WKWebView sets itself as the diagnostic logging client, WebPageProxy::diagnosticLoggingClient() can still return null after calling WebPageProxy::close(). Previously, we would have done a bad cast if the WKWebView's client would have used this API after calling 'close' as well. * UIProcess/API/APIDiagnosticLoggingClient.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _diagnosticLoggingDelegate]): (-[WKWebView _setDiagnosticLoggingDelegate:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::setDiagnosticLoggingClient): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::effectiveDiagnosticLoggingClient): (WebKit::WebPageProxy::logDiagnosticMessage): (WebKit::WebPageProxy::logDiagnosticMessageWithResult): (WebKit::WebPageProxy::logDiagnosticMessageWithValue): (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::diagnosticLoggingClient): 2017-07-05 Daniel Bates Do not pass API::FrameInfo for source frame or clear out page of target frame on API navigation https://bugs.webkit.org/show_bug.cgi?id=174170 Reviewed by Brady Eidson. As a step towards making it straightforward for an embedding client to determine whether a WebPageProxy::decidePolicyForNavigationAction() callback was initiated from API we should not pass frame info for the source frame and should not nullify the page pointer in the target frame info. Currently we always pass frame info for the source frame and nullify the page pointer in both the source frame info and target frame info if the navigation was initiated from API. This seems subtle and error prone. Instead we should not pass frame info for the source frame and not nullify the page pointer in the target frame info as a step towards making using this API less error-prone. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): 2017-07-05 Chris Dumez Add a few more WebKit2 owners https://bugs.webkit.org/show_bug.cgi?id=174169 Reviewed by Brady Eidson. * Owners: 2017-07-05 Brent Fulgham [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events https://bugs.webkit.org/show_bug.cgi?id=174062\ Reviewed by Chris Dumez. ResourceLoadStatistics was triggering periods of high CPU use due to a cascade of read/write operations: (1) The 'makeRefPtr' call in FileMonitor::startMonitoring was capturing a reference to itself, preventing the FileMonitor from being destroyed. This caused the file modification handler to fire in response to our own write events, creating a ridiculous read/write cycle. This problem was addressed in the short term by stopping the file monitor in WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage, rather than relying on the destructor to shut things down. This will be improved in a subsequent patch. (2) 'syncWithExistingStatisticsStorageIfNeeded' was creating a FileMonitor during the write operation, which exacerbated the chain of read/writes already present due to the self-reference described above. (3) Because VNODE dispatch sources are low level, they do not offer a means of filtering out operations triggered by the current process. To avoid this, I added code to track the file modification time, so that we don't bother reading a file that holds data that is older than the in-memory data, even though we receive a file modification dispatch. Writes seem to trigger a chain of notification events in rapid succession. Once we've responded to the first of these events, we don't need to to further reads until the data on disk changes again. We also shouldn't allow the ResourceLoadStatistics worker thread to consume high CPU resources. Run it as utility QoS, avoiding using the CPU when other work is going on. Drive-by fix: The closure in setWritePersistentStoreCallback() should stop monitoring before writing data, and should start monitoring after the write completes. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Run our worker queue as a utility-level process. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Stop checking for updates before writing, and begin checking again once the write is complete. (WebKit::WebResourceLoadStatisticsStore::statisticsFileModificationTime): Added. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Avoid reading the file if it was last modified on (or before) the time we last read the file. (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): Ditto. (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): Explicitly stop file monitoring so that the active file modification handler will terminate. (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): Do not begin monitoring the file after syncing, since this is only used as part of an ongoing write operation. 2017-07-05 Jonathan Bedard Add WebKitPrivateFrameworkStubs for iOS 11 https://bugs.webkit.org/show_bug.cgi?id=173988 Reviewed by David Kilzer. * Configurations/BaseTarget.xcconfig: iphoneos and iphonesimulator should use the same directory for private framework stubs. 2017-07-05 Andy Estes [iOS] WKActionSheetAssistants can outlive their host views https://bugs.webkit.org/show_bug.cgi?id=174160 Reviewed by Tim Horton. WKActionSheetAssistant keeps a raw pointer to its host UIView, and nothing clears it when the host view is deallocated. If the assistant outlives the view, we can end up accessing a pointer to a deallocated UIView and crashing. I don't know how to reproduce such a crash, but this patch guards against it by doing the following: 1. Make _view a WeakObjCPtr in WKActionSheetAssistant to ensure it gets set to nil when the UIView is deallocated. 2. Call -[WKActionSheetAssistant cleanupSheet] when a WKContentView or WKPDFView is deallocated, or when the Web process crashes. This will ensure the action sheet is dismissed and prevent the user from tapping on an action that's no longer valid. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant superviewForSheet]): (-[WKActionSheetAssistant _presentationRectForSheetGivenPoint:inHostView:]): (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]): (-[WKActionSheetAssistant presentationRectForIndicatedElement]): (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView dealloc]): 2017-07-05 Frederic Wang Move ScrolledContentsLayer property to ScrollingStateScrollingNode https://bugs.webkit.org/show_bug.cgi?id=174134 Reviewed by Simon Fraser. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): Add encoding for scrolled contents layer. (ArgumentCoder::encode): Remove encoding for scrolled contents layer. (ArgumentCoder::encode): Ditto. (ArgumentCoder::decode): Add decoding for scrolled contents layer. (ArgumentCoder::decode): Remove decoding for scrolled contents layer. (ArgumentCoder::decode): Ditto. (WebKit::dump): Move dumping of scrolled contents layer from overflow/frame nodes to scrolling node. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Adjust enum value to use ScrollingStateScrollingNode::ScrolledContentsLayer. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto. * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Ditto. 2017-07-05 Ada Chan Fix crash in UIKit: +[UIViewController _viewControllerForFullScreenPresentationFromView:] https://bugs.webkit.org/show_bug.cgi?id=174143 Reviewed by Wenson Hsieh. In -[WKActionSheet willRotate], we can't guarantee that the action sheet belongs in a window, and passing nil to +[UIViewController _viewControllerForFullScreenPresentationFromView:] throws an exception. To fix this, bail early if the result from -hostViewForSheet is nil. * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet willRotate]): 2017-07-05 Eric Carlson [MediaStream] Protect request and web view during gUM client callback https://bugs.webkit.org/show_bug.cgi?id=174096 Reviewed by Youenn Fablet. Retain the message and WebView during asynchronous calls so they won't be released if a navigation happens during a call to the UA for getUserMedia or enumerateMediaDevices. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::requestUserMediaAuthorizationForDevices): (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): 2017-07-05 Matt Lewis Unreviewed, rolling out r219128. Spoke with engineer who originally submitted, Patch for APi test to follow. Reverted changeset: "Unreviewed, rolling out r219070." https://bugs.webkit.org/show_bug.cgi?id=174082 http://trac.webkit.org/changeset/219128 2017-07-05 Matt Lewis Unreviewed, rolling out r219070. This revision caused consistent failures of the API test UIPasteboardTests.DoNotPastePlainTextAsURL on iOS. Reverted changeset: "Pasting single words copied to UIPasteboard inserts URLs in editable areas" https://bugs.webkit.org/show_bug.cgi?id=174082 http://trac.webkit.org/changeset/219070 2017-07-05 Zan Dobersek [GLib] Incorrect include in WebKitWebsiteData https://bugs.webkit.org/show_bug.cgi?id=174093 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitWebsiteData.cpp: Include rather than , since the former has to be included in a library while the latter should only be included in a standalone application. 2017-07-04 Joseph Pecoraro Cleanup some StringBuilder use https://bugs.webkit.org/show_bug.cgi?id=174118 Reviewed by Andreas Kling. * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::hashToPath): * UIProcess/WebPageProxy.cpp: 2017-07-03 Wenson Hsieh [iOS DnD] [WK2] Callout bar should reappear after dragging ends for a text selection https://bugs.webkit.org/show_bug.cgi?id=174116 Reviewed by Ryosuke Niwa. -willStartScrollingOverflow -didEndScrollingOverflow are helper methods on both the UIWKTextInteractionAssistant and UIWebSelectionAssistant that handle hiding selection and callout bar UI during overflow scrolling and making it reappear after scrolling ends. However, these hooks do not contain logic specific to scrolling, and simply tell the inner UIWebSelectionView to either show or hide and are safe to invoke outside of the context of scrolling. This patch invokes these hooks when beginning a drag on a selection, and when a dragging ends, if it called -willStartScrollingOverflow to begin with. We should rename these in the future to be something along the lines of -hideSelectionViewAndControls and -showSelectionViewAndControls, respectively, and adopt these new names in WebKit. We also move logic to hide the callout out of -itemsForBeginningSession: and into -willAnimateLiftWithAnimator:, when the lift actually begins. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanUpDragSourceSessionState]): (-[WKContentView _restoreCalloutBarIfNeeded]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): 2017-07-03 Matt Rajca Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called https://bugs.webkit.org/show_bug.cgi?id=174103 Reviewed by Alex Christensen. Currently, when -[WKWebView evaluateJavaScript:completionHandler:] is invoked, we end up simulating a user gesture unconditionally. This is not desireable for some tests, so I added a private variant of this method that takes a boolean that is ultimately passed to `executeScript` for the `forceUserGesture` parameter (instead of unconditionally passing `true`). * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView evaluateJavaScript:completionHandler:]): (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptInMainFrame): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScriptInMainFrame): (WebKit::WebPage::updateWebsitePolicies): Update behavior restrictions on any existing media elements. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-07-03 Matt Lewis Unreviewed, rolling out r219103. Caused multiple build failures. Reverted changeset: "Remove copy of ICU headers from WebKit" https://bugs.webkit.org/show_bug.cgi?id=116407 http://trac.webkit.org/changeset/219103 2017-07-03 Myles C. Maxfield Remove copy of ICU headers from WebKit https://bugs.webkit.org/show_bug.cgi?id=116407 Reviewed by Alex Christensen. Use WTF's copy of ICU headers. * Configurations/BaseTarget.xcconfig: 2017-07-03 Brady Eidson Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism. https://bugs.webkit.org/show_bug.cgi?id=174073 Reviewed by Andy Estes. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::getLoadDecisionForIcons): (WebKit::WebFrameLoaderClient::dispatchDidReceiveIcon): Deleted. (WebKit::WebFrameLoaderClient::registerForIconNotification): Deleted. (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-07-03 Sam Weinig [WebIDL] Remove more unnecessary uses of the preprocessor in idl files https://bugs.webkit.org/show_bug.cgi?id=174083 Reviewed by Alex Christensen. * Configurations/FeatureDefines.xcconfig: Add ENABLE_NAVIGATOR_STANDALONE. 2017-07-03 Matt Lewis Unreviewed, rolling out r219083. The revision caused an API failure on all testing platforms. Reverted changeset: "[MediaStream] Protect request and web view during gUM client callback" https://bugs.webkit.org/show_bug.cgi?id=174096 http://trac.webkit.org/changeset/219083 2017-07-03 Ryosuke Niwa WebContent processes crash when the network process crashes with pending connection requests https://bugs.webkit.org/show_bug.cgi?id=174065 Reviewed by Tim Horton. The bug was caused by the UI process clearing away pending network connection requests whenever the existing network process crashed. This resulted in WebContent process killing itself inside ensureNetworkProcessConnection. Fixed the bug by re-launching a new network process when this happens. We don't try to re-launch a new process if the previous attempt to launch a network process had failed. This patch splits NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch into networkProcessFailedToLaunch and networkProcessCrashed to differentiate those two cases, and invoke the respective callbacks in WebProcessPool. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _networkProcessIdentifier]): Added. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::networkProcessCrashed): Added. (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch): Split into the two following functions. (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch): Extracted from networkProcessCrashedOrFailedToLaunch. (WebKit::NetworkProcessProxy::clearCallbackStates): Extracted from networkProcessCrashedOrFailedToLaunch (WebKit::NetworkProcessProxy::didClose): Call networkProcessCrashed. (WebKit::NetworkProcessProxy::didFinishLaunching): Call networkProcessFailedToLaunch. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::networkProcessCrashed): Start a new network process when there are pending connection requests the crached network failed to fullfil. (WebKit::WebProcessPool::networkProcessFailedToLaunch): * UIProcess/WebProcessPool.h: 2017-07-03 Eric Carlson [MediaStream] Protect request and web view during gUM client callback https://bugs.webkit.org/show_bug.cgi?id=174096 Reviewed by Youenn Fablet. Retain the message and WebView during asynchronous calls so they won't be released if a navigation happens during a call to the UA for getUserMedia or enumerateMediaDevices. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::requestUserMediaAuthorizationForDevices): (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): 2017-07-03 Andy Estes [Xcode] Add an experimental setting to build with ccache https://bugs.webkit.org/show_bug.cgi?id=173875 Reviewed by Tim Horton. * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig. 2017-07-03 Chris Dumez Drop ResourceLoadStatisticsStore's statisticsLock https://bugs.webkit.org/show_bug.cgi?id=174080 Reviewed by Brent Fulgham. Drop ResourceLoadStatisticsStore's statisticsLock. It added complexity and was only needed do that the SPI exposed to WebKitTestRunner would query the store synchronously from the main thread. Instead, I made the SPI asynchronous and make sure we always access the store from the same background thread. As a result, there is no longer any need for locking. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]): (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]): (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::isPrevalentResource): (WebKit::ResourceLoadStatisticsStore::isGrandFathered): (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): (WebKit::ResourceLoadStatisticsStore::clearInMemory): (WebKit::ResourceLoadStatisticsStore::mergeStatistics): (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): (WebKit::ResourceLoadStatisticsStore::processStatistics): (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): (WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry): (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords): (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): * UIProcess/Storage/ResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): (WebKit::WebResourceLoadStatisticsStore::clearInMemoryData): (WebKit::WebResourceLoadStatisticsStore::submitTelemetry): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): * UIProcess/WebResourceLoadStatisticsStore.h: 2017-07-03 Wenson Hsieh Pasting single words copied to UIPasteboard inserts URLs in editable areas https://bugs.webkit.org/show_bug.cgi?id=174082 Reviewed by Tim Horton. Add a hook to WKPreferences to allow programatic pasting. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setDOMPasteAllowed:]): (-[WKPreferences _domPasteAllowed]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-07-03 Zan Dobersek Unreviewed GTK+ and WPE build fix when building with GCC 4.9. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::renderNextFrame): Don't use brace-list initialization to override the m_forceRepaintAsync struct. Instead, manually assign the OptionalCallbackID() value to the m_forceRepaintAsync.callbackID member variable, and override the m_forceRepaintAsync.needsFreshFlush member variable with `false`. 2017-07-03 Zan Dobersek [ThreadedCompositor] Update and retrieve scene attributes under a Lock https://bugs.webkit.org/show_bug.cgi?id=173762 Reviewed by Carlos Garcia Campos. Instead of dispatching separate tasks on the composition run loop, update various scene attributes by locking a common lock object and updating the appropriate attribute. In ThreadedCompositor::renderLayerTree(), where these attributes are used in scene composition, the lock is again obtained and the attributes copied into local variables, releasing the lock afterwards. The attribute values in local copies are then used for that renderLayerTree() invocation. This approach is more efficient than dispatching separate tasks that can race against renderLayerTree() dispatches. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::ThreadedCompositor): (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::setScaleFactor): (WebKit::ThreadedCompositor::setScrollPosition): (WebKit::ThreadedCompositor::setViewportSize): (WebKit::ThreadedCompositor::setDrawsBackground): (WebKit::ThreadedCompositor::renderLayerTree): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2017-07-01 Dan Bernstein [iOS] Remove code only needed when building for iOS 9.x https://bugs.webkit.org/show_bug.cgi?id=174068 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: * Configurations/WebKit.xcconfig: * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession setSuggestions:]): (-[WKFormInputSession invalidate]): (-[WKContentView insertTextSuggestion:]): (contentTypeFromFieldName): (-[WKContentView textInputTraits]): (-[WKContentView _dataForPreviewItemController:atPosition:type:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): * config.h: 2017-07-01 Brady Eidson When setting a custom cookie storage location on a WKWebsiteDataStore, cookies aren't actually removed. and https://bugs.webkit.org/show_bug.cgi?id=174035 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateNetworkProcess]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Take an optional WebsiteDataStore. If one is passed in, send it to either the existing or new network process. * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): Resolve paths first. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): 2017-07-01 Ryosuke Niwa Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h https://bugs.webkit.org/show_bug.cgi?id=174004 Reviewed by Simon Fraser. * WebProcess/Plugins/WebPluginInfoProvider.cpp: * WebProcess/WebPage/WebInspector.cpp: 2017-07-01 Dan Bernstein [macOS] Remove code only needed when building for OS X Yosemite https://bugs.webkit.org/show_bug.cgi?id=174067 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Configurations/BaseTarget.xcconfig: * Configurations/BaseXPCService.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: * Configurations/NetworkService.xcconfig: * Configurations/PluginService.32.xcconfig: * Configurations/PluginService.64.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebContentService.xcconfig: * Configurations/WebKit.xcconfig: * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Removed. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): (IPC::Connection::platformInitialize): (IPC::Connection::open): (IPC::Connection::exceptionSourceEventHandler): Deleted. (IPC::Connection::setShouldCloseConnectionOnMachExceptions): Deleted. * Platform/mac/LayerHostingContext.h: * Platform/mac/LayerHostingContext.mm: (WebKit::LayerHostingContext::createFencePort): * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Removed. * PluginProcess/mac/PluginControllerProxyMac.mm: (WebKit::PluginControllerProxy::updateLayerHostingContext): * PluginProcess/mac/PluginProcessShim.mm: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * Shared/ChildProcess.h: * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::getPluginInfoFromPropertyLists): (WebKit::NetscapePluginModule::getPluginInfo): (WebKit::contentsOfPropertyListAtURL): Deleted. (WebKit::getMIMETypesFromPluginBundle): Deleted. * Shared/Plugins/PluginProcessCreationParameters.cpp: (WebKit::PluginProcessCreationParameters::encode): (WebKit::PluginProcessCreationParameters::decode): * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::setSharedHTTPCookieStorage): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): (fixUpBotchedPageUIClient): Deleted. * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::didFinishLaunching): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateLayer): (WebKit::WebViewImpl::startWindowDrag): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted. * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::didFinishLaunching): * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformInitializePluginProcess): (WebKit::PluginProcessProxy::createPropertyListFile): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setTopContentInset): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::rootViewToWindow): (WebKit::PageClientImpl::startWindowDrag): * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createFrontendWindow): (WebKit::WebInspectorProxy::platformStartWindowDrag): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Removed. * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::addAnimationToLayer): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): (WebKit::TiledCoreAnimationDrawingArea::updateGeometry): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/com.apple.WebProcess.sb.in: 2017-07-01 Chris Dumez Replace ResourceLoadStatisticsStore C API with Cocoa SPI https://bugs.webkit.org/show_bug.cgi?id=174060 Reviewed by Brent Fulgham. Replace ResourceLoadStatisticsStore C API by Cocoa SPI. The new Cocoa SPI is on WKWebsiteDataStore, which allows us to get rid of the WebResourceLoadStatisticsManager singleton as the SPI can now interact directly with the WebResourceLoadStatisticsStore. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Removed. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: Removed. Drop old C API. * UIProcess/WebResourceLoadStatisticsManager.cpp: Removed. * UIProcess/WebResourceLoadStatisticsManager.h: Removed. Drop WebResourceLoadStatisticsManager singleton which was only required by the C API. This is because the C API was global, rather than working on a specific store. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Add new Cocoa SPI on WKWebsiteDataStore. This is only used for testing. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Stop registering the store with the WebResourceLoadStatisticsManager singleton, as this singleton is gone. * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resourceLoadStatistics): Add new getter to retrieve the WebResourceLoadStatisticsStore from the WebsiteDataStore. This is needed by the new Cocoa SPI. * WebKit2.xcodeproj/project.pbxproj: Drop some files. 2017-06-30 Megan Gardner Unreviewed mac build fix. * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: 2017-06-30 Megan Gardner Add API to get WKActivatedElementInfo https://bugs.webkit.org/show_bug.cgi?id=174001 Adding a way to get a WKActivatedElementInfo for a point on a WKWebView. Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView requestActivatedElementAtPosition:completionBlock:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: (+[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]): (-[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]): * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: 2017-06-30 Tim Horton Use API instead of SPI for content inset adjustment behavior https://bugs.webkit.org/show_bug.cgi?id=174050 Reviewed by Sam Weinig. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollView initWithFrame:]): (-[WKScrollView setContentInsetAdjustmentBehavior:]): (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]): (-[WKScrollView _setContentInsetAdjustmentBehavior:]): Deleted. Switch over to the API. The old SPI calls the API internally, so our override will now cover all callers. 2017-06-30 Chris Dumez Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174038 Reviewed by Brent Fulgham. Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore. WebResourceLoadStatisticsManager is now essentially a proxy to the WebResourceLoadStatisticsStore to support the current C API. In a follow-up, I plan to to replace the C API with a Cocoa SPI which works on a WebResourceLoadStatisticsStore directly instead of requiring a WebResourceLoadStatisticsManager singleton. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetMinimumTimeBetweenDataRecordsRemoval): (WKResourceLoadStatisticsManagerResetToConsistentState): * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Removed. * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded): * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::WebResourceLoadStatisticsManager): (WebKit::WebResourceLoadStatisticsManager::~WebResourceLoadStatisticsManager): (WebKit::WebResourceLoadStatisticsManager::setStatisticsStore): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): (WebKit::WebResourceLoadStatisticsManager::logUserInteraction): (WebKit::WebResourceLoadStatisticsManager::clearUserInteraction): (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::primaryDomain): (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler): (WebKit::WebResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler): (WebKit::WebResourceLoadStatisticsStore::clearInMemory): (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): * WebKit2.xcodeproj/project.pbxproj: 2017-06-30 John Wilander [WK2] Resource load statistics code is spamming the WebProcess with a test-only message https://bugs.webkit.org/show_bug.cgi?id=174048 Reviewed by Brent Fulgham. Fix the telemetry data message send so that it is not generated during normal operations. This is only meant to be used by WebKitTestRunner. * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): 2017-06-30 Daniel Bates Attempt to fix the WPE build following (https://bugs.webkit.org/show_bug.cgi?id=165160) Update the prototype of UIClient::createNewPage() to take a API::FrameInfo& instead of a WebFrameProxy* and a const WebCore::SecurityOriginData&. * UIProcess/API/glib/WebKitUIClient.cpp: 2017-06-30 Alex Christensen Stop soft linking with CFNetwork https://bugs.webkit.org/show_bug.cgi?id=174029 Reviewed by Jer Noble. * Shared/mac/CookieStorageShim.mm: 2017-06-30 Daniel Bates API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo https://bugs.webkit.org/show_bug.cgi?id=165160 Reviewed by Brady Eidson. Expose a property on WKFrameInfo to retrieve the WKWebView of the web page that contains the frame. This will allow an embedding client to know the web view that initiated the navigation request as well as differentiate between a navigation initiated by web content from one initiated via API. The majority of this change is passing the document D that initiated the targeted navigation or called window.open() through the loading machinery to the FrameLoaderClient. The changes to pass this information to the FrameLoaderClient when creating a new window are straightforward. For targeted navigation, the WebKit2 FrameLoaderClient implementation now computes the info for the originating frame regardless of the navigation type (NavigationAction::type()). (Currently we only compute the originating frame for hyperlink activated navigations, form submissions, and form resubmissions). The WebProcess computes the page ID of the page that contains the originating frame and sends that to the UIProcess so that it can create an API::FrameInfo for the originating frame and associate the page that contains the frame, if the navigation was triggered by web content. If the navigation was triggered by API (e.g. -[WKWebView goBack]) then the created API::FrameInfo does not have an associated page so that an embedding client can distinguish between a navigation initiated by web content from a navigation that it initiated via API depending on whether API::FrameInfo::page() is nullptr. We expose property webView on the Mac and iOS API class WKFrameInfo to return the WKWebView corresponding to API::FrameInfo::page(). A small change that this patch makes is to have the WebProcess compute the originating frame info (call WebFrame::info()) and send it over to the UIProcess as opposed to sending the frame ID of the originating frame and having the UIProcess compute the frame info from it. We do this because the UIProcess may not be able to compute the frame info for the originating frame if the window that it was contained in was closed between the time the WebProcess sent the frame ID to the UIProcess and the UIProcess received it. * UIProcess/API/APIFrameInfo.cpp: (API::FrameInfo::create): (API::FrameInfo::FrameInfo): (API::FrameInfo::clearPage): * UIProcess/API/APIFrameInfo.h: * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): (API::UIClient::createNewPageAsync): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKFrameInfo.mm: (-[WKFrameInfo description]): (-[WKFrameInfo webView]): * UIProcess/API/Cocoa/WKUserContentController.mm: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageAsync): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): 2017-06-29 Jer Noble Make Legacy EME API controlled by RuntimeEnabled setting. https://bugs.webkit.org/show_bug.cgi?id=173994 Reviewed by Sam Weinig. Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both able to control WebCore's new RuntimeEnabledFeature setting for the Legacy EME API. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetLegacyEncryptedMediaAPIEnabled): (WKPreferencesSetLegacyEncryptedMediaAPIEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _setLegacyEncryptedMediaAPIEnabled:]): (-[WKWebViewConfiguration _legacyEncryptedMediaAPIEnabled]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-30 Jer Noble REGRESSION (r218757): Touch Bar's media scrubber timeline runs from 00:00 to 00:00 and has no playhead https://bugs.webkit.org/show_bug.cgi?id=174032 Reviewed by Eric Carlson. Fix a copypasta error where durationChange notifications were changing the value of muted. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionManagerProxy::durationChanged): 2017-06-30 Chris Dumez Move ResourceLoadStatisticsStore to WebKit2/UIProcess https://bugs.webkit.org/show_bug.cgi?id=174033 Reviewed by Brent Fulgham. Move ResourceLoadStatisticsStore to WebKit2/UIProcess since it is only used in the WebKit2 UIProcess. * CMakeLists.txt: * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Renamed from Source/WebCore/loader/ResourceLoadStatisticsStore.cpp. (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): (WebKit::ResourceLoadStatisticsStore::clearInMemory): (WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): (WebKit::ResourceLoadStatisticsStore::mergeStatistics): (WebKit::ResourceLoadStatisticsStore::fireDataModificationHandler): (WebKit::ResourceLoadStatisticsStore::fireTelemetryHandler): (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): (WebKit::ResourceLoadStatisticsStore::processStatistics): (WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry): (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): (WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved): (WebKit::ResourceLoadStatisticsStore::statisticsLock): * UIProcess/Storage/ResourceLoadStatisticsStore.h: Renamed from Source/WebCore/loader/ResourceLoadStatisticsStore.h. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::primaryDomain): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: * UIProcess/WebResourceLoadStatisticsTelemetry.h: * WebKit2.xcodeproj/project.pbxproj: 2017-06-30 Ryosuke Niwa Ran sort-Xcode-project-file. * WebKit2.xcodeproj/project.pbxproj: 2017-06-30 Chris Dumez ResourceLoadObserver does not need a ResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=174013 Reviewed by Brent Fulgham. ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs. ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess in a follow-up. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::statisticsChangedTimerFired): * WebProcess/WebProcess.h: 2017-06-30 Brent Fulgham [WK2][iOS][macOS] Update XPC services process launch dictionary https://bugs.webkit.org/show_bug.cgi?id=173995 Reviewed by Alex Christensen. Update the WebProcess and Plugin Process XPC launch dictionaries to activate improved ALSR features when launching. * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: 2017-06-30 Chris Dumez Merge WebResourceLoadStatisticsManager and WebResourceLoadObserver https://bugs.webkit.org/show_bug.cgi?id=174008 Reviewed by Brent Fulgham. Merge WebResourceLoadStatisticsManager and WebResourceLoadObserver. One was basically a proxy to the other. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetPrevalentResource): (WKResourceLoadStatisticsManagerIsPrevalentResource): (WKResourceLoadStatisticsManagerSetHasHadUserInteraction): (WKResourceLoadStatisticsManagerIsHasHadUserInteraction): (WKResourceLoadStatisticsManagerSetGrandfathered): (WKResourceLoadStatisticsManagerIsGrandfathered): (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin): (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin): (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo): (WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction): (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree): (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetGrandfatheringTime): (WKResourceLoadStatisticsManagerFireDataModificationHandler): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain): (WKResourceLoadStatisticsManagerFireTelemetryHandler): (WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned): (WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetNotifyPagesWhenTelemetryWasCaptured): (WKResourceLoadStatisticsManagerSetShouldSubmitTelemetry): (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore): (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours): (WKResourceLoadStatisticsManagerResetToConsistentState): * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): * UIProcess/WebResourceLoadObserver.cpp: Removed. * UIProcess/WebResourceLoadObserver.h: Removed. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::primaryDomain): (WebKit::WebResourceLoadStatisticsManager::shared): (WebKit::WebResourceLoadStatisticsManager::setStatisticsStore): (WebKit::WebResourceLoadStatisticsManager::setStatisticsQueue): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): (WebKit::WebResourceLoadStatisticsManager::logUserInteraction): (WebKit::WebResourceLoadStatisticsManager::clearUserInteraction): (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): * WebKit2.xcodeproj/project.pbxproj: 2017-06-30 Wenson Hsieh [iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes https://bugs.webkit.org/show_bug.cgi?id=174017 Reviewed by Simon Fraser. Send the drag caret rect in root view coordinates over to the UI process. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _dragCaretRect]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add basic test plumbing to fetch the current drag caret rect. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-06-30 Youenn Fablet Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration https://bugs.webkit.org/show_bug.cgi?id=169389 Reviewed by Alex Christensen. * fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt: 2017-06-29 Ryosuke Niwa Assert that callback ID is not 0 or -1 during encoding and decoding https://bugs.webkit.org/show_bug.cgi?id=173803 Reviewed by Brady Eidson. To diagnosing the hang inside Safari (), add assertions for the callback ID to be not 0 or -1 during encoding and decoding of IPC messages since the latest analysis seems to indicate the hang is caused by the hash map getting corrupted by the insertion of 0 (empty value). Wrapped the uint64_t in CallbackID and OptionalCallbackID to add assertions. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): * Shared/CallbackID.h: Added. (WebKit::CallbackID::CallbackID): (WebKit::CallbackID::operator==): (WebKit::CallbackID::toInteger): (WebKit::CallbackID::isValid): (WebKit::CallbackID::isValidCallbackID): A callback ID is valid when it's neither 0 nor -1. (WebKit::CallbackID::fromInteger): Create a CallbackID object from potentially unsafe value. (WebKit::CallbackID::generateID): Generates the next callback ID. Moved from CallbackBase. (WebKit::CallbackID::encode): Added. Assert that it's neither 0 nor -1. (WebKit::CallbackID::decode): Ditto. (WTF::CallbackIDHash::hash): (WTF::CallbackIDHash::equal): (WTF::HashTraits::emptyValue): (WTF::HashTraits::constructDeletedValue): (WTF::HashTraits::isDeletedValue): * Shared/OptionalCallbackID.h: Added. Unlike CallbackID, callback ID here can be 0. (WebKit::OptionalCallbackID::OptionalCallbackID): (WebKit::OptionalCallbackID::toInteger): (WebKit::OptionalCallbackID::callbackID): Returns a valid CallbackID object. The caller of this function must have verified that the ID is neither 0 or -1 before calling this function. (WebKit::OptionalCallbackID::operator bool): (WebKit::OptionalCallbackID::isValid): (WebKit::OptionalCallbackID::isValidCallbackID): (WebKit::OptionalCallbackID::encode): Since OptionalCallbackID can be 0, only assert that it's not -1. (WebKit::OptionalCallbackID::decode): Ditto. * Shared/mac/RemoteLayerTreeTransaction.h: * Shared/mac/RemoteLayerTreeTransaction.h: * UIProcess/GenericCallback.h: (WebKit::CallbackBase::callbackID): Returns a CallbackID object instead of uint64_t. (WebKit::CallbackBase::CallbackBase): (WebKit::CallbackBase::generateCallbackID): Deleted. (WebKit::CallbackMap::put): Returns a callback ID. Also added a version that doesn't take activity token as used in WebCookieManagerProxy (WebKit::CallbackMap::take): Takes a callback ID. * UIProcess/WebCookieManagerProxy.cpp: Updated the code as callback maps are merged. (WebKit::WebCookieManagerProxy::processPoolDestroyed): (WebKit::WebCookieManagerProxy::processDidClose): (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): (WebKit::WebCookieManagerProxy::deleteCookie): (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): (WebKit::WebCookieManagerProxy::setCookie): (WebKit::WebCookieManagerProxy::setCookies): (WebKit::WebCookieManagerProxy::getAllCookies): (WebKit::WebCookieManagerProxy::getCookies): (WebKit::WebCookieManagerProxy::didSetCookies): (WebKit::WebCookieManagerProxy::didGetCookies): (WebKit::WebCookieManagerProxy::didDeleteCookies): (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebCookieManagerProxy.messages.in: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setInitialFocus): (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getSamplingProfilerOutput): (WebKit::WebPageProxy::getContentsAsMHTMLData): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::getSelectionAsWebArchiveData): (WebKit::WebPageProxy::getMainResourceDataOfFrame): (WebKit::WebPageProxy::getResourceDataFromFrame): (WebKit::WebPageProxy::getWebArchiveOfFrame): (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::clearLoadDependentCallbacks): (WebKit::WebPageProxy::voidCallback): (WebKit::WebPageProxy::dataCallback): (WebKit::WebPageProxy::imageCallback): (WebKit::WebPageProxy::stringCallback): (WebKit::WebPageProxy::invalidateStringCallback): (WebKit::WebPageProxy::scriptValueCallback): (WebKit::WebPageProxy::computedPagesCallback): (WebKit::WebPageProxy::validateCommandCallback): (WebKit::WebPageProxy::unsignedCallback): (WebKit::WebPageProxy::editingRangeCallback): (WebKit::WebPageProxy::machSendRightCallback): (WebKit::WebPageProxy::rectForCharacterRangeCallback): (WebKit::WebPageProxy::printFinishedCallback): (WebKit::WebPageProxy::computePagesForPrinting): (WebKit::WebPageProxy::drawRectToImage): (WebKit::WebPageProxy::drawPagesToPDF): (WebKit::WebPageProxy::drawPagesForPrinting): (WebKit::WebPageProxy::getMarkedRangeAsync): (WebKit::WebPageProxy::getSelectedRangeAsync): (WebKit::WebPageProxy::characterIndexForPointAsync): (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): (WebKit::WebPageProxy::takeSnapshot): (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler): (WebKit::WebPageProxy::getLoadDecisionForIcon): (WebKit::WebPageProxy::finishedLoadingIcon): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::gestureCallback): (WebKit::WebPageProxy::touchesCallback): (WebKit::WebPageProxy::autocorrectionDataCallback): (WebKit::WebPageProxy::selectionContextCallback): (WebKit::WebPageProxy::autocorrectionContextCallback): (WebKit::WebPageProxy::selectionRectsCallback): (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::updateSelectionWithTouches): (WebKit::WebPageProxy::requestAutocorrectionData): (WebKit::WebPageProxy::applyAutocorrection): (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::selectTextWithGranularityAtPoint): (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection): (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection): (WebKit::WebPageProxy::selectPositionAtPoint): (WebKit::WebPageProxy::beginSelectionInDirection): (WebKit::WebPageProxy::updateSelectionWithExtentPoint): (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPageProxy::requestDictationContext): (WebKit::WebPageProxy::requestAutocorrectionContext): (WebKit::WebPageProxy::getSelectionContext): (WebKit::WebPageProxy::selectWithTwoTouches): (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset): (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText): (WebKit::WebPageProxy::moveSelectionByOffset): (WebKit::WebPageProxy::focusNextAssistedNode): (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF): (WebKit::WebPageProxy::drawToPDFCallback): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): (-[WKPrintingView _askPageToComputePageRects]): (-[WKPrintingView _drawPreview:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): (WebKit::WebPageProxy::attributedStringForCharacterRangeCallback): (WebKit::WebPageProxy::fontAtSelection): (WebKit::WebPageProxy::fontAtSelectionCallback): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::getHostnamesWithCookies): (WebKit::WebCookieManager::deleteCookie): (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): (WebKit::WebCookieManager::getAllCookies): (WebKit::WebCookieManager::getCookies): (WebKit::WebCookieManager::setCookie): (WebKit::WebCookieManager::setCookies): (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Cookies/WebCookieManager.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): (WebKit::WebFrameLoaderClient::finishedLoadingIcon): * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::forceRepaintAsync): (WebKit::AcceleratedDrawingArea::activityStateDidChange): * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): (WebKit::CoordinatedLayerTreeHost::renderNextFrame): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::forceRepaintAsync): (WebKit::DrawingArea::activityStateDidChange): (WebKit::DrawingArea::addTransactionCallbackID): * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/LayerTreeHost.h: (WebKit::LayerTreeHost::forceRepaintAsync): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::takeSnapshot): (WebKit::WebPage::validateCommand): (WebKit::WebPage::setInitialFocus): (WebKit::WebPage::setActivityState): (WebKit::WebPage::runJavaScriptInMainFrame): (WebKit::WebPage::getContentsAsString): (WebKit::WebPage::getContentsAsMHTMLData): (WebKit::WebPage::getRenderTreeExternalRepresentation): (WebKit::WebPage::getSelectionAsWebArchiveData): (WebKit::WebPage::getSelectionOrContentsAsString): (WebKit::WebPage::getSourceForFrame): (WebKit::WebPage::getMainResourceDataOfFrame): (WebKit::WebPage::getResourceDataFromFrame): (WebKit::WebPage::getWebArchiveOfFrame): (WebKit::WebPage::forceRepaint): (WebKit::WebPage::computePagesForPrinting): (WebKit::WebPage::drawRectToImage): (WebKit::WebPage::drawPagesToPDF): (WebKit::WebPage::drawPagesForPrinting): (WebKit::WebPage::didFinishPrintOperation): (WebKit::WebPage::getMarkedRangeAsync): (WebKit::WebPage::getSelectedRangeAsync): (WebKit::WebPage::characterIndexForPointAsync): (WebKit::WebPage::firstRectForCharacterRangeAsync): (WebKit::WebPage::getBytecodeProfile): (WebKit::WebPage::getSamplingProfilerOutput): (WebKit::WebPage::didGetLoadDecisionForIcon): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: (WebKit::WebPrintOperationGtk::WebPrintOperationGtk): * WebProcess/WebPage/gtk/WebPrintOperationGtk.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getSelectionContext): (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::updateSelectionWithTouches): (WebKit::WebPage::selectWithTwoTouches): (WebKit::WebPage::moveSelectionByOffset): (WebKit::WebPage::getRectsForGranularityWithSelectionOffset): (WebKit::WebPage::getRectsAtSelectionOffsetWithText): (WebKit::WebPage::selectPositionAtPoint): (WebKit::WebPage::selectPositionAtBoundaryWithDirection): (WebKit::WebPage::moveSelectionAtBoundaryWithDirection): (WebKit::WebPage::selectTextWithGranularityAtPoint): (WebKit::WebPage::beginSelectionInDirection): (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPage::updateSelectionWithExtentPoint): (WebKit::WebPage::requestDictationContext): (WebKit::WebPage::requestAutocorrectionData): (WebKit::WebPage::applyAutocorrection): (WebKit::WebPage::executeEditCommandWithCallback): (WebKit::WebPage::requestAutocorrectionContext): (WebKit::WebPage::focusNextAssistedNode): (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange): (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync): (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::attributedSubstringForCharacterRangeAsync): (WebKit::WebPage::fontAtSelection): 2017-06-29 Andy Estes [iOS] Don't confuse coordinate spaces when computing the size of PDF snapshots https://bugs.webkit.org/show_bug.cgi?id=173996 Reviewed by Tim Horton. When computing the printing rect for PDF snapshots, we were getting the width the WKContentView's bounds and the height from the WKScrollView's contentSize. These sizes are in different coordinate spaces, leading to incorrect clipping on sites that have a non-1 scale factor. Fix this by using the WKContentView's bounds for both width and height. * UIProcess/ios/WKContentView.mm: (-[WKContentView _wk_pageCountForPrintFormatter:]): 2017-06-29 Matt Lewis Unreviewed, rolling out r218903. This patch and its fix cause immediate flakiness on all WK2 testers Reverted changeset: "Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration" https://bugs.webkit.org/show_bug.cgi?id=169389 http://trac.webkit.org/changeset/218903 2017-06-29 Chris Dumez Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess https://bugs.webkit.org/show_bug.cgi?id=173990 Reviewed by Brent Fulgham. Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess. They really have different API and there is therefore close to no code duplication. * CMakeLists.txt: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): * UIProcess/WebResourceLoadObserver.cpp: Added. (WebKit::primaryDomain): (WebKit::WebResourceLoadObserver::sharedObserver): (WebKit::WebResourceLoadObserver::setStatisticsStore): (WebKit::WebResourceLoadObserver::setStatisticsQueue): (WebKit::WebResourceLoadObserver::clearInMemoryStore): (WebKit::WebResourceLoadObserver::clearInMemoryAndPersistentStore): (WebKit::WebResourceLoadObserver::logUserInteraction): (WebKit::WebResourceLoadObserver::clearUserInteraction): (WebKit::WebResourceLoadObserver::hasHadUserInteraction): (WebKit::WebResourceLoadObserver::setPrevalentResource): (WebKit::WebResourceLoadObserver::isPrevalentResource): (WebKit::WebResourceLoadObserver::clearPrevalentResource): (WebKit::WebResourceLoadObserver::setGrandfathered): (WebKit::WebResourceLoadObserver::isGrandfathered): (WebKit::WebResourceLoadObserver::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadObserver::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadObserver::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadObserver::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadObserver::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadObserver::setGrandfatheringTime): (WebKit::WebResourceLoadObserver::fireDataModificationHandler): (WebKit::WebResourceLoadObserver::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadObserver::fireTelemetryHandler): * UIProcess/WebResourceLoadObserver.h: Added. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource): (WebKit::WebResourceLoadStatisticsManager::setHasHadUserInteraction): (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin): (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain): (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): * WebKit2.xcodeproj/project.pbxproj: 2017-06-29 Sam Weinig [WebIDL] Remove custom binding for UserMessageHandlersNamespace https://bugs.webkit.org/show_bug.cgi?id=173956 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp: (webkit_dom_dom_window_webkit_message_handlers_post_message): Update for name change. 2017-06-29 John Wilander Fix for intermittent Layout Test fail http/tests/loading/resourceLoadStatistics/telemetry-generation.html https://bugs.webkit.org/show_bug.cgi?id=173940 Reviewed by Brent Fulgham. This change allows the TestController to turn off regular resource load statistics telemetry submission and to manually control when telemetry is calculated and submitted. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetShouldSubmitTelemetry): New test infrastructure. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setShouldSubmitTelemetry): New test infrastructure. * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry): New test infrastructure. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): The test function now calls WebResourceLoadStatisticsStore::submitTelemetry() directly instead of firing the timer. (WebKit::WebResourceLoadStatisticsStore::telemetryTimerFired): Now checks whether it should submit telemetry or not. (WebKit::WebResourceLoadStatisticsStore::submitTelemetry): Split out so that the test code doesn't have to fire the timer. * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): Now doesn't submit if it's executed by test code. 2017-06-29 Chris Dumez Slight clean up of WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=173976 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::dataTypesToRemove): (WebKit::WebResourceLoadStatisticsStore::classifyResource): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): (WebKit::initializeDataTypesToRemove): Deleted. * UIProcess/WebResourceLoadStatisticsStore.h: (WebKit::WebResourceLoadStatisticsStore::coreStore): Deleted. 2017-06-29 Alex Christensen WKContentRuleLists with if-top-url or unless-top-url should run regex against entire top URL https://bugs.webkit.org/show_bug.cgi?id=173980 Reviewed by Tim Horton. if-top-url and unless-top-url were broken inside WebKit2 apps. This fixes them and adds a test. ContentExtension::populateConditionCacheIfNeeded was calling WebCompiledContentRuleList::conditionsApplyOnlyToDomain but m_data.conditionsApplyOnlyToDomainOffset was always 0 instead of ConditionsApplyOnlyToDomainOffset because it wasn't being encoded and decoded when telling the WebProcess about the content rule list. This was causing us to use whatever was at offset 0 in the file instead of the correct value stored in the file to determine whether to run regular expressions against the entire top URL for if-top-url or unless-top-url or against just the domain for if-top-domain or unless-top-domain. Luckily, offset 0 in the file is always ContentRuleListStore::CurrentContentRuleListFileVersion, so it was deterministic and easy to debug. I should have added a LayoutTest with r213669 to verify correct behavior in an actual WKWebView, but I didn't because it wouldn't have caught regressions since the contentextension tests are marked as flaky since r206914, but once that is fixed the new test http/tests/contentextensions/top-url.html will verify that this feature is behaving correctly. It failed before this change and passes after. * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::encode): (WebKit::WebCompiledContentRuleListData::decode): 2017-06-29 Chris Dumez statistics.mostRecentUserInteraction should be of type WallTime https://bugs.webkit.org/show_bug.cgi?id=173974 Reviewed by Brent Fulgham. statistics.mostRecentUserInteraction should be of type WallTime for clarity. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-06-29 Wenson Hsieh Replace staging-prefixed UIKit drag and drop delegate methods with their public SDK versions https://bugs.webkit.org/show_bug.cgi?id=173959 Reviewed by Sam Weinig. Remove references to _api_-prefixed UIDragInteractionDelegate and UIDropInteractionDelegate methods, and replace them with their counterparts in the public SDK. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dragInteraction:previewForLiftingItem:session:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]): (-[WKContentView dropInteraction:sessionDidEnter:]): (-[WKContentView dropInteraction:sessionDidUpdate:]): (-[WKContentView _simulateDataInteractionEntered:]): (-[WKContentView _simulateDataInteractionUpdated:]): (-[WKContentView _simulateDataInteractionSessionDidEnd:]): (-[WKContentView _api_dragInteraction:previewForLiftingItem:session:]): Deleted. (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): Deleted. (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]): Deleted. (-[WKContentView _api_dropInteraction:sessionDidEnter:]): Deleted. (-[WKContentView _api_dropInteraction:sessionDidUpdate:]): Deleted. 2017-06-29 Carlos Garcia Campos Unreviewed. Fix GTK+ unit tests crashing after r218922. We need to check if icon database exists and is open now on dispose and API entry points. * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (webkitFaviconDatabaseDispose): (webkit_favicon_database_get_favicon_uri): (webkit_favicon_database_clear): 2017-06-29 Carlos Garcia Campos [GTK][WPE] Implement API::IconLoadingClient and rework WebKitFaviconDatabase to use IconDatabase directly https://bugs.webkit.org/show_bug.cgi?id=173877 Reviewed by Brady Eidson. This way IconDatabase and its related classes can be removed from WebCore, as well as the WebKit2 implementation and C API. For now I've copied IconDatabase from WebCore to WebKit2 under the glib API directory, adding the related classes as private inside IconDatabase, and removing some methods that are not used by the GLib API. * PlatformGTK.cmake: * UIProcess/API/glib/IconDatabase.cpp: Added. (WebKit::urlForLogging): (WebKit::defaultClient): (WebKit::IconDatabase::IconRecord::IconRecord): (WebKit::IconDatabase::IconRecord::~IconRecord): (WebKit::IconDatabase::IconRecord::image): (WebKit::IconDatabase::IconRecord::setImageData): (WebKit::IconDatabase::IconRecord::loadImageFromResource): (WebKit::IconDatabase::IconRecord::imageDataStatus): (WebKit::IconDatabase::IconRecord::snapshot): (WebKit::IconDatabase::PageURLRecord::PageURLRecord): (WebKit::IconDatabase::PageURLRecord::~PageURLRecord): (WebKit::IconDatabase::PageURLRecord::setIconRecord): (WebKit::IconDatabase::PageURLRecord::snapshot): (WebKit::IconDatabase::setClient): (WebKit::IconDatabase::open): (WebKit::IconDatabase::close): (WebKit::IconDatabase::removeAllIcons): (WebKit::documentCanHaveIcon): (WebKit::IconDatabase::synchronousIconForPageURL): (WebKit::IconDatabase::synchronousIconURLForPageURL): (WebKit::IconDatabase::retainIconForPageURL): (WebKit::IconDatabase::performRetainIconForPageURL): (WebKit::IconDatabase::releaseIconForPageURL): (WebKit::IconDatabase::performReleaseIconForPageURL): (WebKit::IconDatabase::setIconDataForIconURL): (WebKit::IconDatabase::setIconURLForPageURL): (WebKit::IconDatabase::synchronousLoadDecisionForIconURL): (WebKit::IconDatabase::synchronousIconDataKnownForIconURL): (WebKit::IconDatabase::setEnabled): (WebKit::IconDatabase::isEnabled): (WebKit::IconDatabase::setPrivateBrowsingEnabled): (WebKit::IconDatabase::isPrivateBrowsingEnabled): (WebKit::IconDatabase::delayDatabaseCleanup): (WebKit::IconDatabase::allowDatabaseCleanup): (WebKit::IconDatabase::checkIntegrityBeforeOpening): (WebKit::IconDatabase::IconDatabase): (WebKit::IconDatabase::~IconDatabase): (WebKit::IconDatabase::wakeSyncThread): (WebKit::IconDatabase::scheduleOrDeferSyncTimer): (WebKit::IconDatabase::syncTimerFired): (WebKit::IconDatabase::isOpen): (WebKit::IconDatabase::isOpenBesidesMainThreadCallbacks): (WebKit::IconDatabase::databasePath): (WebKit::IconDatabase::defaultDatabaseFilename): (WebKit::IconDatabase::getOrCreateIconRecord): (WebKit::IconDatabase::getOrCreatePageURLRecord): (WebKit::IconDatabase::shouldStopThreadActivity): (WebKit::IconDatabase::iconDatabaseSyncThread): (WebKit::databaseVersionNumber): (WebKit::isValidDatabase): (WebKit::createDatabaseTables): (WebKit::IconDatabase::performOpenInitialization): (WebKit::IconDatabase::checkIntegrity): (WebKit::IconDatabase::performURLImport): (WebKit::IconDatabase::syncThreadMainLoop): (WebKit::IconDatabase::performPendingRetainAndReleaseOperations): (WebKit::IconDatabase::readFromDatabase): (WebKit::IconDatabase::writeToDatabase): (WebKit::IconDatabase::pruneUnretainedIcons): (WebKit::IconDatabase::checkForDanglingPageURLs): (WebKit::IconDatabase::removeAllIconsOnThread): (WebKit::IconDatabase::deleteAllPreparedStatements): (WebKit::IconDatabase::cleanupSyncThread): (WebKit::readySQLiteStatement): (WebKit::IconDatabase::setIconURLForPageURLInSQLDatabase): (WebKit::IconDatabase::setIconIDForPageURLInSQLDatabase): (WebKit::IconDatabase::removePageURLFromSQLDatabase): (WebKit::IconDatabase::getIconIDForIconURLFromSQLDatabase): (WebKit::IconDatabase::addIconURLToSQLDatabase): (WebKit::IconDatabase::getImageDataForIconURLFromSQLDatabase): (WebKit::IconDatabase::removeIconFromSQLDatabase): (WebKit::IconDatabase::writeIconSnapshotToSQLDatabase): (WebKit::IconDatabase::checkClosedAfterMainThreadCallback): (WebKit::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread): (WebKit::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread): (WebKit::IconDatabase::dispatchDidRemoveAllIconsOnMainThread): (WebKit::IconDatabase::dispatchDidFinishURLImportOnMainThread): * UIProcess/API/glib/IconDatabase.h: Added. (WebKit::IconDatabaseClient::didImportIconURLForPageURL): (WebKit::IconDatabaseClient::didImportIconDataForPageURL): (WebKit::IconDatabaseClient::didChangeIconForPageURL): (WebKit::IconDatabaseClient::didRemoveAllIcons): (WebKit::IconDatabaseClient::didFinishURLImport): (WebKit::IconDatabaseClient::didClose): (WebKit::IconDatabase::IconSnapshot::IconSnapshot): (WebKit::IconDatabase::IconSnapshot::iconURL): (WebKit::IconDatabase::IconSnapshot::timestamp): (WebKit::IconDatabase::IconSnapshot::data): (WebKit::IconDatabase::IconRecord::create): (WebKit::IconDatabase::IconRecord::getTimestamp): (WebKit::IconDatabase::IconRecord::setTimestamp): (WebKit::IconDatabase::IconRecord::iconURL): (WebKit::IconDatabase::IconRecord::retainingPageURLs): (WebKit::IconDatabase::PageURLSnapshot::PageURLSnapshot): (WebKit::IconDatabase::PageURLSnapshot::pageURL): (WebKit::IconDatabase::PageURLSnapshot::iconURL): (WebKit::IconDatabase::PageURLRecord::url): (WebKit::IconDatabase::PageURLRecord::iconRecord): (WebKit::IconDatabase::PageURLRecord::retain): (WebKit::IconDatabase::PageURLRecord::release): (WebKit::IconDatabase::PageURLRecord::retainCount): * UIProcess/API/glib/WebKitFaviconDatabase.cpp: (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate): (getIconSurfaceSynchronously): (webkitFaviconDatabaseSetIconURLForPageURL): (webkitFaviconDatabaseCreate): (webkitFaviconDatabaseOpen): (webkitFaviconDatabaseIsOpen): (webkitFaviconDatabaseSetPrivateBrowsingEnabled): (webkitFaviconDatabaseGetLoadDecisionForIcon): (webkitFaviconDatabaseSetIconForPageURL): (webkit_favicon_database_get_favicon): (webkit_favicon_database_get_favicon_uri): * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: * UIProcess/API/glib/WebKitIconLoadingClient.cpp: Added. (IconLoadingClient::IconLoadingClient): (attachIconLoadingClientToView): * UIProcess/API/glib/WebKitIconLoadingClient.h: Copied from Source/WebKit2/UIProcess/API/glib/WebKitFaviconDatabasePrivate.h. * UIProcess/API/glib/WebKitWebContext.cpp: (ensureFaviconDatabase): (webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded): (webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded): (webkit_web_context_set_favicon_database_directory): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewGetLoadDecisionForIcon): (webkitWebViewSetIcon): * UIProcess/API/glib/WebKitWebViewPrivate.h: 2017-06-28 Tim Horton MobileSafari was constantly using 10-15% CPU viewing a PDF https://bugs.webkit.org/show_bug.cgi?id=173944 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _doAfterNextStablePresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): Bail early and just dispatch_async the completion block if we are using a custom content view; these methods are very specific to the implementation of WKContentView and don't make sense with custom content views. doAfterNextStablePresentationUpdate is particularly egregious because, since we will never call the stable update callbacks (because we bail from didCommitLayerTree if we aren't using WKContentView), it will keep calling doAfterNextPresentationUpdate over and over again. 2017-06-28 Brent Fulgham [WK2][macOS][iOS] Don't request microphone access for clients that don't need it. https://bugs.webkit.org/show_bug.cgi?id=173948 Reviewed by Eric Carlson. Don't bother requesting a sandbox extension to access the microphone for any clients on the Cocoa platform that are not Safari. Other clients don't have the necessary system entitlements, and always fail leading to annoying SandboxViolation reports. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): 2017-06-29 Zalan Bujtas Move RenderEmbeddedObject::isReplacementObscured to HTMLPlugInElement https://bugs.webkit.org/show_bug.cgi?id=173802 Reviewed by Simon Fraser. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): 2017-06-28 Ryosuke Niwa REGRESSION (r218842): com.apple.WebKit crash in WebKit::ProcessLauncher::launchProcess https://bugs.webkit.org/show_bug.cgi?id=173950 Reviewed by Chris Dumez. Added a null check as m_xpcConnection could be nullptr here in the case platformInvalidate had been called. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): 2017-06-28 Youenn Fablet Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration https://bugs.webkit.org/show_bug.cgi?id=169389 Reviewed by Alex Christensen. Updating according new WebCore LIbWebRTCProvider API. * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::LibWebRTCProvider::createPeerConnection): * WebProcess/Network/webrtc/LibWebRTCProvider.h: 2017-06-28 Chris Dumez [iOS] Allow WKWebView clients to play audio in the background https://bugs.webkit.org/show_bug.cgi?id=173932 Reviewed by Ryosuke Niwa. Allow WKWebView clients (such as MobileSafari) to play audio in the background by taking a process assertion whenever a WebPage is audible. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateThrottleState): 2017-06-28 Brent Fulgham Teach ResourceLoadStatistics to recognize changes in the file system https://bugs.webkit.org/show_bug.cgi?id=173800 Reviewed by Chris Dumez. We want to support the case where multiple UI processes choose to share the same statistics file. To support this, update the ResourceLoadStatistics logic to be aware that the statistics data file might change underneath it, and to take appropriate action when it does. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): When we enable the statistics, read in the data and then watch for changes. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Add a 'delete data' handler to remove the file on disk, not just write an empty store. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Use ASCIILiteral. (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): Convenience function. (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Sync with any on-disk storage before writing out. (WebKit::openAndLockFile): Convenience function. (WebKit::closeAndUnlockFile): Ditto. (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Revise to lock file (on platforms that support it) before writing to disk. (WebKit::WebResourceLoadStatisticsStore::deleteStoreFromDisk): Added convenience function. (WebKit::WebResourceLoadStatisticsStore::clearInMemoryData): Ditto. (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): Create a file system monitor to watch for file changes. (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): Added convenience function. (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): Revise to read data directly so we can control file locking. * UIProcess/WebResourceLoadStatisticsStore.h: 2017-06-28 Wenson Hsieh Followup to r218885: adjust for further UIKit SPI changes https://bugs.webkit.org/show_bug.cgi?id=173927 Reviewed by Tim Horton. On ToT, UIKit now invokes -_dragInteraction:item:shouldDelaySetDownAnimationWithCompletion: before the completion block of -dragInteraction:willAnimateLiftWithAnimator:session: is called. This means we now need to store the completion block in -shouldDelaySetDownAnimationWithCompletion: and wait until the UIDragAnimating completion block in -willAnimateCancelWithAnimator: before invoking it. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanUpDragSourceSessionState]): Ensure that the set-down completion block is invoked when a drag session ends (e.g., if the web content process crashes). (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]): (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]): 2017-06-28 Wenson Hsieh dropInteraction:sessionDidEnd: invokes dragEnded with a UIDragOperation rather than a WebCore::DragOperation https://bugs.webkit.org/show_bug.cgi?id=173935 Reviewed by Tim Horton. Replaces a use of UIDragOperationNone with DragOperationNone. Currently, there is no change in behavior since these are currently the same value (0). * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dropInteraction:sessionDidEnd:]): 2017-06-28 Alex Christensen WebsitePolicies given with navigation policy for redirects should apply to the provisional document https://bugs.webkit.org/show_bug.cgi?id=173886 Reviewed by Andy Estes. If, for example, we deny video autoplay for the initial request but allow it for the redirect destination location, the document should allow video autoplay. We were putting these settings onto the wrong DocumentLoader. When a navigation policy is given to a response of a redirect location, we currently have the DocumentLoader for the loading document in the FrameLoader's provisionalDocumentLoader, not the documentLoader. Covered by a new API test. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2017-06-28 Konstantin Tokarev [cmake] Improve configuration tests for librt and libatomic https://bugs.webkit.org/show_bug.cgi?id=173921 Reviewed by Michael Catanzaro. 1. Both tests are converted to use specialized CMake modules 2. Both libraries are now linked only if they are really needed and usable by compiler 3. librt is no more required to be detected by find_library(), which may fail in case of cross-compilation 4. libatomic test moved to port-independent CMakeLists.txt * CMakeLists.txt: * PlatformGTK.cmake: 2017-06-28 Alex Christensen Fix CMake build. * PlatformMac.cmake: 2017-06-28 Wenson Hsieh [iOS DnD] [WK2] Dragged content flashes after the preview sets down when cancelling a drag https://bugs.webkit.org/show_bug.cgi?id=173927 Reviewed by Tim Horton. When a drag is cancelled, UIKit normally animates fly-back and set-down animations back-to-back. However, for WebKit2, we need to call out to the web process in order to trigger a repaint of the dragged content at normal opacity when the drag cancel animation completes. Thus, we can hook into UIKit SPI to split the cancellation animation into two discrete phases: the fly-back and the set-down (the latter of which may be deferred using a completion block). To do this, we implement a new SPI hook, _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:, to indicate that the set-down should be deferred, and call the completion block after the next layer tree commit. Since -shouldDelaySetDownAnimationWithCompletion: is invoked after the UIDragAnimating completion block in -willAnimateCancelWithAnimator:, this layer tree commit is guaranteed to come after we've told the web process to repaint at full opacity. This patch also accounts for additional changes in UIKit. Once -shouldDelaySetDownAnimationWithCompletion: becomes available, -sessionDidEnd: will no longer be invoked after a cancelled drag lift if the user did not begin moving. This means that our cleanup logic in -sessionDidEnd: will no longer be executed in this case, leaving the view with an inconsistent dragging state. To fix this, we need to implement -dragInteraction:willAnimateLiftWithAnimator:session: to perform drag session cleanup following a cancelled drag lift, for which the drag animator's final position will be UIViewAnimatingPositionStart. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]): 2017-06-28 Chris Dumez Avoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() https://bugs.webkit.org/show_bug.cgi?id=173904 Reviewed by Brent Fulgham. Avoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). It calls fetchData() which dispatches to the main queue, then fetchDataForTopPrivatelyControlledDomains() dispatches to the background queue. It should be possible to get fetchData() to dispatch directly on the right queue. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-06-27 Chris Dumez [ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute https://bugs.webkit.org/show_bug.cgi?id=173895 Reviewed by Brent Fulgham. Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute to save battery. Also port code to modern time types. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction): (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree): (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetGrandfatheringTime): * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction): (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.h: 2017-06-27 Chris Dumez Port HysteresisActivity to Seconds type https://bugs.webkit.org/show_bug.cgi?id=173902 Reviewed by Simon Fraser. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_pageScrolledHysteresis): 2017-06-27 Chris Dumez Move WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() https://bugs.webkit.org/show_bug.cgi?id=173882 Reviewed by Darin Adler. Move WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() as we have data showing it is slow and hangs the UIProcess' main thread. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): 2017-06-27 Brent Fulgham [WK2][macOS] Expand sandbox to allow access to the CoreMedia volume control endpoint https://bugs.webkit.org/show_bug.cgi?id=173898 Reviewed by Ryosuke Niwa. * WebProcess/com.apple.WebProcess.sb.in: 2017-06-27 Wenson Hsieh [iOS DnD] Support dragging out of contenteditable areas without a prior selection https://bugs.webkit.org/show_bug.cgi?id=173854 Reviewed by Ryosuke Niwa and Tim Horton. Instead of allowing a drag to occur only if a position information request discovers a clickable node, remove the position information request entirely and just call into WebCore to try and begin the drag. Currently, the position information request serves two purposes: 1. To adjust the hit-test location to account for nearby clickable nodes. 2. To obtain information about the content being dragged. The first requirement is fulfilled by performing the drag location adjustment in WebCore instead (see ChangeLogs for more detail). The second requirement is fulfilled by refactoring in https://bugs.webkit.org/show_bug.cgi?id=173832 to fold all information relevant to starting a drag into the DragItem struct, and then propagating the DragItem struct. The relevant information from the position information update is now populated when the UI process receives the drag start response. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDrag:item:]): (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView _api_dropInteraction:sessionDidEnter:]): (-[WKContentView _api_dropInteraction:sessionDidUpdate:]): (positionInformationMayStartDataInteraction): Deleted. 2017-06-27 Chris Dumez [iOS] Avoid taking / releasing process assertions too quickly due to database activity https://bugs.webkit.org/show_bug.cgi?id=173879 Reviewed by Antti Koivisto. Specify an activity name when taking the process assertion to facilitate debugging in the future. It took me a while to figure out this assertion was the one that was too aggressive because it was anonymous. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setUpSQLiteDatabaseTrackerClient]): 2017-06-27 Don Olmstead [PAL] Add symbol export macros for PAL https://bugs.webkit.org/show_bug.cgi?id=171519 Reviewed by Konstantin Tokarev. * config.h: 2017-06-27 Ryosuke Niwa ProcessLauncherMac could leak a xpc connection when the process had failed to launch https://bugs.webkit.org/show_bug.cgi?id=173865 Reviewed by Antti Koivisto. Explicitly cancel the XPC connection even When the process launch had failed to avoid a leak. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): 2017-06-27 John Wilander Resource Load Statistics: Add telemetry https://bugs.webkit.org/show_bug.cgi?id=173499 Reviewed by Brent Fulgham. * PlatformGTK.cmake: Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp * PlatformMac.cmake: Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp * PlatformWPE.cmake: Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerFireTelemetryHandler): (WKResourceLoadStatisticsManagerSetNotifyPagesWhenTelemetryWasCaptured): Test infrastructure. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::notifyPageStatisticsTelemetryFinished): Test infrastructure. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler): (WebKit::WebResourceLoadStatisticsManager::setNotifyPagesWhenTelemetryWasCaptured): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Test infrastructure. * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Configures a timer for telemetry capture. Fires 5 seconds after launch and then every 24 hours. (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned. (WebKit::WebResourceLoadStatisticsStore::telemetryTimerFired): Calls WebResourceLoadStatisticsTelemetry::calculateAndSubmit(). * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: Added. (WebKit::numberOfResourcesWithUserInteraction): (WebKit::median): (WebKit::nonEphemeralWebPageProxy): (WebKit::submitTopList): (WebKit::submitTopLists): (WebKit::notifyPages): (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): (WebKit::WebResourceLoadStatisticsTelemetry::setNotifyPagesWhenTelemetryWasCaptured): * UIProcess/WebResourceLoadStatisticsTelemetry.h: Added. * WebKit2.xcodeproj/project.pbxproj: 2017-06-27 Ting-Wei Lan Add missing includes to fix compilation error on FreeBSD https://bugs.webkit.org/show_bug.cgi?id=172919 Reviewed by Mark Lam. * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/C/WKPagePrivate.h: * UIProcess/ProcessAssertion.h: 2017-06-27 Wenson Hsieh Refactor drag start codepaths to plumb a DragItem to client layers https://bugs.webkit.org/show_bug.cgi?id=173832 Work towards Reviewed by Ryosuke Niwa and Tim Horton. Add support for serializing a DragItem over IPC. This encodes and decodes all members of DragItem except for the PasteboardWriterData and the DragImage's image. The DragItem is sent over to the UI process in WebDragClient::startDrag via the WebPageProxy::startDrag IPC message (renamed from WebPageProxy::setDragImage) which now takes a DragItem. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::setDragImage): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Rename SetDragImage to StartDrag and refactor to receive only a DragItem and shareable bitmap handle. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startDrag): (WebKit::PageClientImpl::startDataInteractionWithImage): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDrag:item:]): (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]): Deleted. Rename startDataInteractionWithImage to startDrag. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::setDragImage): Deleted. * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::startDrag): * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::WebDragClient::startDrag): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::startDrag): 2017-06-27 Wenson Hsieh [iOS DnD] [WK2] WKWebView does not handle drag sessions that exit and re-enter https://bugs.webkit.org/show_bug.cgi?id=173856 Reviewed by Ryosuke Niwa. Upon exiting a WKContentView, the dropSession tracked by _dataInteractionState is not cleared out. If the drag session re-enters the WKWebView, a _different_ UIDropSession is sent to the drop delegate, causing us to bail from handling the session altogether in -dropInteraction:canHandleSession:. To fix this, we need to clear out the dropSession when the drag session exits the view. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dropInteraction:sessionDidExit:]): 2017-06-26 Chris Dumez WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient https://bugs.webkit.org/show_bug.cgi?id=173850 Reviewed by Ryosuke Niwa. Update WebsiteDataRecord::matchesTopPrivatelyControlledDomain() to rely on SecurityOriginData::host rather than SecurityOriginData::securityOrigin()->host(). SecurityOriginData::securityOrigin() is expensive and it seems unnecessary to call it here since we already have the host. Also update WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() to return domains as a HashSet rather than a Vector to avoid having duplicate domains. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-06-26 Jeremy Jones Invalidate WebVideoFullscreenManager when WebPage is destroyed. https://bugs.webkit.org/show_bug.cgi?id=173835 rdar://problem/32969161 Reviewed by Jer Noble. WebVideoFullscreenManager has a pointer to WebPage, and even null checks it in a few places, but the only place it is nulled out is in the destructor. This allows a dangling reference. This changes invalidates that reference when WebPage is destructed and adds nullchecks or asserts throughout WebVideoFullscreenManager as appropriate. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::~WebPage): * WebProcess/cocoa/WebVideoFullscreenManager.h: (WebKit::WebVideoFullscreenManager::invalidate): * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): (WebKit::WebVideoFullscreenManager::hasVideoChanged): (WebKit::WebVideoFullscreenManager::videoDimensionsChanged): (WebKit::WebVideoFullscreenManager::didSetupFullscreen): (WebKit::WebVideoFullscreenManager::didEnterFullscreen): (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline): 2017-06-26 Chris Dumez Disable diagnostic logging in ephemeral sessions https://bugs.webkit.org/show_bug.cgi?id=173849 Reviewed by Geoffrey Garen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setDiagnosticLoggingClient): Construct a dummy logging client if the page's session is ephemeral. (WebKit::WebPageProxy::logDiagnosticMessage): (WebKit::WebPageProxy::logDiagnosticMessageWithResult): (WebKit::WebPageProxy::logDiagnosticMessageWithValue): (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy): Slight cleanup to make the code look a bit safer. 2017-06-26 Zan Dobersek [GCrypt] Properly initialize libgcrypt before using it https://bugs.webkit.org/show_bug.cgi?id=173589 Reviewed by Michael Catanzaro. Initialize libgcrypt in the Unix-specific main() entrypoint. This is early enough to ensure no other libgcrypt API function is invoked and to also ensure this is done in a thread-safe manner. Initialization is initiated through the gcry_check_version() call. 16 kilobytes of secure memory is pre-allocated before we mark the initialization as complete, as recommended by the libgcrypt documentation. * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2017-06-26 Jeremy Jones When Mission Control closes fullscreen window, allow media element to update its state. https://bugs.webkit.org/show_bug.cgi?id=173671 rdar://problem/32892671 Reviewed by Eric Carlson. When Mission Control closes element fullscreen without an animation, we need to notify the media element that fullscreen has exited. Without this change, the page still behaves like the element is in fullscreen. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): 2017-06-26 Wenson Hsieh [iOS DnD] [WK2] Beginning a drag session should prevent clicking via long press https://bugs.webkit.org/show_bug.cgi?id=173838 Reviewed by Tim Horton. After r218579, WebKit no longer attempts to replace out-of-the-box UIKit long-press/drag lift disambiguation by firing events immediately. However, this means that dragging will defer the highlight long press gesture recognizer until dragging ends rather than cancel it immediately, which causes WKContentView to dispatch a synthetic click immediately upon lift. To fix this, we should bail out of the highlight long press gesture when beginning a drag. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dragInteraction:prepareForSession:completion:]): 2017-06-26 Konstantin Tokarev Unreviewed, add missing header icncludes * WebProcess/soup/WebKitSoupRequestInputStream.cpp: 2017-06-26 Konstantin Tokarev [GTK] Unreviewed, added missing includes to fix debug build * NetworkProcess/NetworkSession.cpp: 2017-06-25 Konstantin Tokarev Remove excessive headers from WebCore/platform https://bugs.webkit.org/show_bug.cgi?id=173822 Reviewed by Tim Horton. * WebProcess/WebCoreSupport/SessionStateConversion.cpp: 2017-06-25 Michael Catanzaro Unreviewed, rolling out r215190. Broke product select element on GNOME Bugzilla Reverted changeset: "[GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup()" https://bugs.webkit.org/show_bug.cgi?id=170553 http://trac.webkit.org/changeset/215190 2017-06-25 Michael Catanzaro [GTK][WPE] Unreviewed, fix typo in translatable string Thanks to Yuri Chornoivan for reporting this typo. * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): 2017-06-25 Konstantin Tokarev Remove excessive headers from JavaScriptCore https://bugs.webkit.org/show_bug.cgi?id=173812 Reviewed by Darin Adler. * WebProcess/Plugins/Netscape/NPJSObject.cpp: 2017-06-24 Chris Dumez [WK2] Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly https://bugs.webkit.org/show_bug.cgi?id=173813 Reviewed by Ryosuke Niwa. Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly. The previous IPC encoder code would assume types and data vector have the same length. It would first encode the length of data using |data.size()| but then would encode types.size() values from the data vector. While there are debug assertions to ensure both vectors have the same size, this seems unnecessarily fragile in release builds. If both vectors happen to have different sizes, this will lead to weird IPC bugs. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeClientTypesAndData): (IPC::decodeClientTypesAndData): 2017-06-24 Michael Catanzaro [GTK] Introspection: webkit_web_view_new_with_related_view needs to be marked as a constructor https://bugs.webkit.org/show_bug.cgi?id=173765 Reviewed by Carlos Garcia Campos. Because the first parameter to this WebKitWebView constructor is itself a WebKitWebView, the gi-scanner's heuristics decide that it's probably an object method rather than a constructor, resulting in improper introspection generation. Annotate it with (constructor) to override this behavior. * UIProcess/API/gtk/WebKitWebViewGtk.cpp: * UIProcess/API/wpe/WebKitWebViewWPE.cpp: 2017-06-24 Commit Queue Unreviewed, rolling out r218785. https://bugs.webkit.org/show_bug.cgi?id=173808 This change broke the macOS Sierra build (Requested by annulen|home on #webkit). Reverted changeset: "Removed unused lambda captures from WebKit2" https://bugs.webkit.org/show_bug.cgi?id=173555 http://trac.webkit.org/changeset/218785 2017-06-24 Konstantin Tokarev Removed unused lambda captures from WebKit2 https://bugs.webkit.org/show_bug.cgi?id=173555 Reviewed by Alex Christensen. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): 2017-06-23 Chris Dumez Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon() https://bugs.webkit.org/show_bug.cgi?id=173792 Reviewed by Ryosuke Niwa. Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon() as this could cause HashTable corruption on WebPageProxy side. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::finishedLoadingIcon): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-06-23 Chris Dumez Stop passing Vector by value in WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores() https://bugs.webkit.org/show_bug.cgi?id=173782 Reviewed by Brent Fulgham. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): 2017-06-23 Chris Dumez Avoid copying HashSet to Vector in WebPageProxy::clearLoadDependentCallbacks() https://bugs.webkit.org/show_bug.cgi?id=173786 Reviewed by Geoffrey Garen. Avoid copying HashSet to Vector in WebPageProxy::clearLoadDependentCallbacks(). Instead, just move the HashSet and iterate on that. This is OK since we were clearing the HashSet right after copying it to the vector anyway. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::clearLoadDependentCallbacks): 2017-06-23 Chris Dumez Unreviewed, fix Debug build after r218763 * NetworkProcess/NetworkDataTask.cpp: 2017-06-23 Chris Dumez Add more release logging for process assertions https://bugs.webkit.org/show_bug.cgi?id=173624 Reviewed by Geoffrey Garen. Add more release logging for process assertions to help debug issues such as . * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::didConnectToProcess): * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::~ProcessAssertion): (WebKit::ProcessAssertion::setState): 2017-06-23 Chris Dumez Consistently use RunLoop::isMain() in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=173745 Reviewed by Brent Fulgham. Consistently use RunLoop:isMain() on WebKit2 instead of WTF::isMainThread(). WTF::isMainThread() returns true for the WebThread instead of the UIThread in WebKit1. Therefore WTF::isMainThread() is unsafe to use in the UIProcess as the application may be using WebKit1 as well and have a WebThread. Technically, we only *need* to move from WTF::isMainThread() to RunLoop::isMain() in the UIProcess code but I ported all of WebKit2 for consistency. RunLoop::isMain() is always safe in WebKit2. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::NetworkDataTask): (WebKit::NetworkDataTask::~NetworkDataTask): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::getSizeForNext): (WebKit::NetworkDataTaskBlob::didGetSize): (WebKit::NetworkDataTaskBlob::seek): (WebKit::NetworkDataTaskBlob::read): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponseNetworkSession): (WebKit::NetworkLoad::notifyDidReceiveResponse): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::defaultSession): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::resourceType): (WebKit::NetworkCache::Cache::initialize): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::readSyncInThread): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (WebKit::NetworkSessionCocoa::defaultSession): (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): (WebKit::CoordinatedGraphicsScene::syncRemoteContent): (WebKit::CoordinatedGraphicsScene::detach): (WebKit::CoordinatedGraphicsScene::appendUpdate): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::WorkQueuePool::singleton): (WebKit::WorkQueuePool::dispatch): (WebKit::CompositingRunLoop::~CompositingRunLoop): (WebKit::CompositingRunLoop::performTask): (WebKit::CompositingRunLoop::performTaskSync): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::createGLContext): (WebKit::ThreadedCompositor::renderNextFrame): (WebKit::ThreadedCompositor::commitScrollOffset): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::releaseUpdateAtlases): (WebKit::ThreadedCompositor::frameComplete): * Shared/Plugins/NPObjectProxy.cpp: (WebKit::NPObjectProxy::NP_Deallocate): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]): * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): * WebProcess/soup/WebKitSoupRequestInputStream.cpp: (webkitSoupRequestInputStreamReadAsync): 2017-06-23 David Kilzer v3: REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies] Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKProcessPool.mm: (policiesHashMapToDictionary): Use adoptNS().get() to avoid dumping objects into autoreleasepools unnecessarily. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: (-[WKProcessPool _pluginLoadClientPolicies]): Add back 'copy' attribute to document that we're returning a new object on each invocation. I shouldn't have removed it in the v2 patch. 2017-06-23 Youenn Fablet LibWebRTCSocketClient should not destroy its socket within signalClose callback https://bugs.webkit.org/show_bug.cgi?id=173739 Reviewed by Brent Fulgham. * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: (WebKit::LibWebRTCSocketClient::signalClose): Destroy 'this' asynchronously to make the caller of signalClose valid until it is not used. 2017-06-23 Chris Dumez Fix typo in WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData() naming https://bugs.webkit.org/show_bug.cgi?id=173781 Reviewed by Brent Fulgham. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): 2017-06-23 Jer Noble [WK2] Support -[WebAVPlayerController setMuted:] https://bugs.webkit.org/show_bug.cgi?id=173777 Reviewed by Eric Carlson. Add a SetMuted message to WebPlaybackSessionManager. Drive-by refactoring: Because the new setMuted() method conflicts with the existing setMuted() notification, do a giant rename of the notificiation methods from set(Value) -> (value)Changed. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setMuted): (WebKit::WebPlaybackSessionModelContext::playbackStartedTimeChanged): (WebKit::WebPlaybackSessionModelContext::durationChanged): (WebKit::WebPlaybackSessionModelContext::currentTimeChanged): (WebKit::WebPlaybackSessionModelContext::bufferedTimeChanged): (WebKit::WebPlaybackSessionModelContext::rateChanged): (WebKit::WebPlaybackSessionModelContext::seekableRangesChanged): (WebKit::WebPlaybackSessionModelContext::canPlayFastReverseChanged): (WebKit::WebPlaybackSessionModelContext::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionModelContext::audioMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionModelContext::externalPlaybackChanged): (WebKit::WebPlaybackSessionModelContext::wirelessVideoPlaybackDisabledChanged): (WebKit::WebPlaybackSessionModelContext::mutedChanged): (WebKit::WebPlaybackSessionManagerProxy::currentTimeChanged): (WebKit::WebPlaybackSessionManagerProxy::bufferedTimeChanged): (WebKit::WebPlaybackSessionManagerProxy::seekableRangesVectorChanged): (WebKit::WebPlaybackSessionManagerProxy::canPlayFastReverseChanged): (WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionManagerProxy::externalPlaybackPropertiesChanged): (WebKit::WebPlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged): (WebKit::WebPlaybackSessionManagerProxy::mutedChanged): (WebKit::WebPlaybackSessionManagerProxy::durationChanged): (WebKit::WebPlaybackSessionManagerProxy::playbackStartedTimeChanged): (WebKit::WebPlaybackSessionManagerProxy::rateChanged): (WebKit::WebPlaybackSessionManagerProxy::setMuted): (WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface): (WebKit::WebPlaybackSessionModelContext::setPlaybackStartedTime): Deleted. (WebKit::WebPlaybackSessionModelContext::setDuration): Deleted. (WebKit::WebPlaybackSessionModelContext::setCurrentTime): Deleted. (WebKit::WebPlaybackSessionModelContext::setBufferedTime): Deleted. (WebKit::WebPlaybackSessionModelContext::setRate): Deleted. (WebKit::WebPlaybackSessionModelContext::setSeekableRanges): Deleted. (WebKit::WebPlaybackSessionModelContext::setCanPlayFastReverse): Deleted. (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Deleted. (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Deleted. (WebKit::WebPlaybackSessionModelContext::setExternalPlayback): Deleted. (WebKit::WebPlaybackSessionModelContext::setWirelessVideoPlaybackDisabled): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setDuration): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setPlaybackStartedTime): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setRate): Deleted. * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::durationChanged): (WebKit::WebPlaybackSessionManager::currentTimeChanged): (WebKit::WebPlaybackSessionManager::bufferedTimeChanged): (WebKit::WebPlaybackSessionManager::playbackStartedTimeChanged): (WebKit::WebPlaybackSessionManager::rateChanged): (WebKit::WebPlaybackSessionManager::seekableRangesChanged): (WebKit::WebPlaybackSessionManager::canPlayFastReverseChanged): (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::externalPlaybackChanged): (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged): (WebKit::WebPlaybackSessionManager::wirelessVideoPlaybackDisabledChanged): (WebKit::WebPlaybackSessionManager::mutedChanged): (WebKit::WebPlaybackSessionManager::setMuted): 2017-06-23 Frederic Wang Use window.internals instead of overridePreference to set WebCore settings in tests https://bugs.webkit.org/show_bug.cgi?id=173714 Reviewed by Simon Fraser. This commit remove preference to settings mapping in overrideBoolPreferenceForTestRunner that are no longer necessary after the changes done in LayoutTests. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove mapping for preferences that no longer require testRunner.overridePreference calls in tests. 2017-06-23 Brent Fulgham Avoid moving the same vector multiple times https://bugs.webkit.org/show_bug.cgi?id=173748 Reviewed by Chris Dumez. We discovered that a Vector was being moved inside a loop, causing it to be moved more than once. We should never do this! * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Do not perform a move at each step of the iteration. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Receive vector of top privately controlled domains as a const reference. Copy this vector into the completion handler. Do not move origins out of the vector in the inner loop. (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Receive vector of top privately controlled domains as a const reference. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-06-23 Alex Christensen Add SPI to WKURLSchemeTask for redirection https://bugs.webkit.org/show_bug.cgi?id=173730 Reviewed by Brady Eidson. This is needed for testing an upcoming fix for redirect callbacks, and it might be necessary for loading with custom schemes in general. Right now just responding with an HTTP 301/302/307/308 response code doesn't work because there is nothing that synthesizes an NSURLRequest from the Location header like we do in SynchronousResourceHandleCFURLConnectionDelegate::willSendRequest et al. for HSTS, and that would require using an NSHTTPURLResponse for non-HTTP responses, which is conceptually wrong. Instead of waiting for a completion handler in the API, we are following the pattern of WKNavigationDelegate.didReceiveServerRedirectForProvisionalNavigation and allowing the SPI to indicate that a redirect has happened to update the state of WebKit, but not allowing the SPI to wait for a processed request and slow down loading. This adds WKURLSchemeTaskPrivate._didPerformRedirection which is covered by new API tests. * UIProcess/API/Cocoa/WKURLSchemeTask.mm: (raiseExceptionIfNecessary): (-[WKURLSchemeTaskImpl _didPerformRedirection:newRequest:completionHandler:]): * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::stopURLSchemeTask): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): (WebKit::WebURLSchemeHandler::stopTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didReceiveResponse): Deleted. (WebKit::WebURLSchemeTask::didReceiveData): Deleted. (WebKit::WebURLSchemeTask::didComplete): Deleted. * UIProcess/WebURLSchemeTask.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::urlSchemeTaskDidPerformRedirection): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::taskDidPerformRedirection): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::didPerformRedirection): * WebProcess/WebPage/WebURLSchemeTaskProxy.h: 2017-06-23 Brent Fulgham [WK2][macOS] Support Mac Mini Flash Player Features https://bugs.webkit.org/show_bug.cgi?id=173581 Reviewed by Dean Jackson. Revise the sandboxes for additional IOKit properties identified during Flash video player testing. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-06-23 Zan Dobersek [CoordinatedGraphics] Clean up type aliases in CoordinatedGraphicsScene https://bugs.webkit.org/show_bug.cgi?id=173764 Reviewed by Carlos Garcia Campos. Drop the various type aliases created in the CoordinatedGraphicsScene class. We can leave without these by leveraging `auto` where necessary. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded): (WebKit::CoordinatedGraphicsScene::updateImageBacking): (WebKit::CoordinatedGraphicsScene::clearImageBackingContents): (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: 2017-06-23 Carlos Garcia Campos [WPE] Crash in wpe_view_backend_get_renderer_host_fd https://bugs.webkit.org/show_bug.cgi?id=173760 Reviewed by Žan Doberšek. This can happen if views are created and destroyed quickly. The problem is that CompositingManagerProxy adds a message receiver but never removes it, so it's possible that the message arrives right after the view has been destroyed. This is happening most of the times running /wpe/WebKitAutomationSession/request-session that creates 3 web views in a row that are deleted when the test finishes. Fixes /wpe/WebKitAutomationSession/request-session. * UIProcess/API/wpe/CompositingManagerProxy.cpp: (WebKit::CompositingManagerProxy::finalize): Remove the message handler. * UIProcess/API/wpe/CompositingManagerProxy.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::~View): Call CompositingManagerProxy::finalize(). 2017-06-23 Carlos Garcia Campos [WPE] User script messages don't work https://bugs.webkit.org/show_bug.cgi?id=173712 Reviewed by Žan Doberšek. When a user script message is received we need to create a WebKitJavascriptResult to deserialize the script value. WebKitJavascriptResult is created with a WebKitWebView for two reasons: to get its JavaScript global context and to take a reference that ensures the JavaScript context will be alive while the results is alive. However, we could create the WebKitJavascriptResult with the JavaScript global context and take a reference of the context itself. This way we don't need to access the WebKitWebView from the WebScriptMessageHandler client. But we still need access to the JavaScript context, so I've added a javascriptGlobalContext() method to WebPageProxy for GTK+ and WPE that is implemented from the page client. Fixes /wpe/WebKitUserContentManager/script-message-received. * UIProcess/API/glib/WebKitJavascriptResult.cpp: (_WebKitJavascriptResult::_WebKitJavascriptResult): Create the WebKitJavascriptResult with a JSGlobalContextRef instead of a WEbKitWebView. (webkitJavascriptResultCreate): Pass the js context to the constructor. (webkit_javascript_result_get_global_context): Return the js context. * UIProcess/API/glib/WebKitJavascriptResultPrivate.h: * UIProcess/API/glib/WebKitUserContentManager.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (_WebKitWebViewPrivate::~_WebKitWebViewPrivate): Use JSRetainPtr (webkit_web_view_get_javascript_global_context): (webkitWebViewRunJavaScriptCallback): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::javascriptGlobalContext): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/wpe/APIViewClient.h: (API::ViewClient::javascriptGlobalContext): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::javascriptGlobalContext): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::javascriptGlobalContext): * UIProcess/API/wpe/WPEView.h: * UIProcess/PageClient.h: (WebKit::PageClient::javascriptGlobalContext): * UIProcess/WebPageProxy.h: * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::javascriptGlobalContext): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::javascriptGlobalContext): 2017-06-22 Wenson Hsieh [iOS DnD] [WK2] Enable in-app dragging from WKWebView on the phone https://bugs.webkit.org/show_bug.cgi?id=173736 Reviewed by Tim Horton. Flip the drag interaction enabled switch on when initializing WKContentView's UIDragInteraction. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupDataInteractionDelegates]): 2017-06-22 Chris Dumez isMainThread() assertions in CallbackMap are incorrectly failing on some iOS apps https://bugs.webkit.org/show_bug.cgi?id=173738 Reviewed by Brady Eidson. The assertions hit on certain iOS apps even though the crash traces clearly show them on the main thread. We have verified locally that RunLoop::isMain() propertly return true in this case (while WTF::isMainThread() returns false). Update the assertions to use RunLoop::isMain() instead. * UIProcess/GenericCallback.h: (WebKit::CallbackMap::put): (WebKit::CallbackMap::take): (WebKit::CallbackMap::invalidate): 2017-06-22 Daniel Bates Make FrameLoadRequest a move-only type https://bugs.webkit.org/show_bug.cgi?id=173682 Reviewed by Alex Christensen and Darin Adler. A FrameLoadRequest groups together the information to perform a load into a single object that is more manageable to pass around than its constituent parts. Code that receives a FrameLoadRequest is expected to extract out the information it needs to complete its task. And it does not make sense to re-use the same FrameLoadRequest object for more than one load. Therefore, it is sufficient to make FrameLoadRequest a move-only type. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::URLRequest::create): (WebKit::PluginView::URLRequest::URLRequest): (WebKit::PluginView::performFrameLoadURLRequest): (WebKit::PluginView::loadURL): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2017-06-22 Chris Dumez Add release assertion in CallbackMap::invalidate() https://bugs.webkit.org/show_bug.cgi?id=173722 Reviewed by Brady Eidson. Add release assertion in CallbackMap::invalidate() to make sure it is called on the main thread. * UIProcess/GenericCallback.h: (WebKit::CallbackMap::invalidate): 2017-06-22 Brady Eidson Add some thread safety guards to GenericCallback. https://bugs.webkit.org/show_bug.cgi?id=173693 Reviewed by Sam Weinig. A callback should be created, performed, invalidated, and/or destroyed all on the same thread. Let's write code to notify us if that doesn't happen. * UIProcess/GenericCallback.h: (WebKit::GenericCallback::~GenericCallback): (WebKit::GenericCallback::performCallbackWithReturnValue): (WebKit::GenericCallback::invalidate): 2017-06-22 David Kilzer v2: REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies] Reviewed by Chris Dumez. * UIProcess/API/Cocoa/WKProcessPool.mm: (policiesHashMapToDictionary): Use -dictionaryWithCapacity: instead of -new since the former returns an autoreleased object while the latter does not. This has the added benefit of tuning the size of each NSMutableDictionary. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: (-[WKProcessPool _pluginLoadClientPolicies]): Remove 'copy' attribute from @property declaration since it is read-only. 2017-06-22 Carlos Garcia Campos [WPE] Downloads never have a web view associated in WPE https://bugs.webkit.org/show_bug.cgi?id=173709 Reviewed by Žan Doberšek. Convert the WPE view client into an API client and add handleDownloadRequest(). WebKitWebView now uses it to associate itself to the download like the GTK+ port does. * PlatformWPE.cmake: * UIProcess/API/C/wpe/WKView.cpp: (WKViewSetViewClient): Add C API client implementation here. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): Set the view client in WPE. * UIProcess/API/wpe/APIViewClient.h: Renamed from Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h. (API::ViewClient::frameDisplayed): (API::ViewClient::handleDownloadRequest): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::handleDownloadRequest): Call WKWPE::View::handleDownloadRequest(). * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::View): Initialize the view client. (WKWPE::View::setClient): Set or reset the client. (WKWPE::View::handleDownloadRequest): Notify the client. * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WPEViewClient.cpp: Removed. 2017-06-22 Carlos Garcia Campos [WPE] Page should be closed on WebKitWebView dispose https://bugs.webkit.org/show_bug.cgi?id=173707 Reviewed by Žan Doberšek. In the GTK+ port it's done in the WebKitWebViewBase dispose implementation. It fixes TestMultiprocess. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewDispose): Call WKWPE::View::close(). * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::close): Close the WebPageProxy. * UIProcess/API/wpe/WPEView.h: 2017-06-22 Carlos Garcia Campos Remove unused coordinated graphics C API https://bugs.webkit.org/show_bug.cgi?id=173706 Reviewed by Žan Doberšek. * UIProcess/API/C/CoordinatedGraphics/WKView.cpp: Removed. * UIProcess/API/C/CoordinatedGraphics/WKView.h: Removed. * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp: Removed. * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h: Removed. 2017-06-22 Carlos Garcia Campos [WPE] Add initial web extensions API https://bugs.webkit.org/show_bug.cgi?id=173640 Reviewed by Žan Doberšek. Build the glib web extensions API files and the builtin injected bundle library for WPE. * PlatformWPE.cmake: * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): Use a different injected bundle filename in WPE and GTK+. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkit_web_page_class_init): Do not expose DOM bindings in WPE. (webkitWebPageCreate): Ditto. * WebProcess/InjectedBundle/API/wpe/WebKitConsoleMessage.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitScriptWorld.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitWebEditor.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h: Added. * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Added. * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Added. 2017-06-21 David Kilzer REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies] Reviewed by Chris Dumez. Caught by the clang static analyzer. * UIProcess/API/Cocoa/WKProcessPool.mm: (policiesHashMapToDictionary): Switch from using [[NSMutableDictionary alloc] init] which returns a +1 retained object in MRR to [NSMutableDictionary new] which returns an autoreleased object under MRR. This bug caused 3 leaks when calling -[WKProcessPool _pluginLoadClientPolicies], which should return an autoreleased object based on its signature. 2017-06-21 Ryosuke Niwa Add release assertions help diagnose a hang in CallbackMap https://bugs.webkit.org/show_bug.cgi?id=173680 Reviewed by Chris Dumez. Assert that these functions are only called in the main thread and the empty value is never used as a key. * UIProcess/GenericCallback.h: (WebKit::CallbackMap::put): (WebKit::CallbackMap::take): 2017-06-21 Wenson Hsieh [iOS DnD] [WK2] Cancelling a drag interaction using the ObjC SPI causes subsequent dragging to fail https://bugs.webkit.org/show_bug.cgi?id=173659 Reviewed by Tim Horton. Currently, a drag session that failed to begin is cleaned up either when the web process responds in -[WKContentView _didHandleStartDataInteractionRequest:] with started = NO, or if started is YES, in -dragInteraction:session:didEndWithOperation: instead. However, it is possible that even when the pasteboard has items and the drag has started in the web process, something in the UI process may then cause the drag to be cancelled (for instance, an SPI client returning empty arrays for all adjusted item providers, or UIKit not even calling into -dragInteraction:itemsForBeginningSession: when we invoke their completion block). In any case, if the drag session is drag-item-less after calling the drag start completion block, clean up and cancel the drag. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didHandleStartDataInteractionRequest:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): 2017-06-21 Tim Horton REGRESSION (r218606): 3D Touch action menu for links is missing items https://bugs.webkit.org/show_bug.cgi?id=173669 Reviewed by Wenson Hsieh. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant defaultActionsForLinkSheet:]): defaultActionsForLinkSheet is used outside the usual action sheet flow, by 3D Touch code. Therefore, we're not guaranteed to have a _positionInformation. We don't need one, though -- we can get the URL from the passed-in _WKActivatedElementInfo, exactly like defaultActionsForImageSheet already did. (-[WKActionSheetAssistant defaultActionsForImageSheet:]): Remove the delegate null check, which isn't used after r218606. 2017-06-21 Daniel Bates Cleanup FrameLoadRequest https://bugs.webkit.org/show_bug.cgi?id=173564 Reviewed by Brent Fulgham. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): Explicitly pass the null-string for the target frame name as we do not have one. Use C++11 brace initialization syntax. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchCreatePage): Ditto. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::openInNewTab): It is no longer necessary to pass ReplaceDocumentIfJavaScriptURL when instantiating the FrameLoadRequest as it defaults to this policy. Use C++11 brace initialization syntax. 2017-06-21 Wenson Hsieh [iOS DnD] [WK2] Add drag-and-drop release logging around WKContentView https://bugs.webkit.org/show_bug.cgi?id=173636 Reviewed by Tim Horton. Add logging at key points in the drag-and-drop lifecycle in the UI process, so that sysdiagnoses will contain sufficient information to debug sparse failures. * Platform/Logging.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didHandleStartDataInteractionRequest:]): (-[WKContentView cleanUpDragSourceSessionState]): (-[WKContentView _didPerformDataInteractionControllerOperation:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView dragInteraction:sessionWillBegin:]): (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): (-[WKContentView dropInteraction:canHandleSession:]): (-[WKContentView _api_dropInteraction:sessionDidEnter:]): (-[WKContentView dropInteraction:sessionDidExit:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dropInteraction:sessionDidEnd:]): 2017-06-21 Jeremy Jones Don't clear audio mute when muting capture. https://bugs.webkit.org/show_bug.cgi?id=173639 rdar://problem/32749737 Reviewed by Eric Carlson. Setting capture mute was clearing audio mute. Added setMediaStreamCaptureMuted to set just the capture mute bit. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _muteMediaCapture]): * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaStreamCaptureMuted): * UIProcess/WebPageProxy.h: 2017-06-21 Miguel Gomez [GTK][WAYLAND] Create WaylandCompositorDisplay unconditionally when initializing the WebProcess https://bugs.webkit.org/show_bug.cgi?id=173598 Reviewed by Carlos Garcia Campos. Move WaylandCompositorDisplay code to its own files so it can be used from other classes. Then, instead of storing the waylandCompositorDisplayName in the WebProcess, keep a WaylandCompositorDisplay instance that is created during the initialization. This way the appropriate sharedDisplayForCompositing will be set since the creation of the WebProcess. * PlatformGTK.cmake: * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp: (WebKit::AcceleratedSurfaceWayland::create): (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::waylandCompositorDisplay): * WebProcess/gtk/WaylandCompositorDisplay.cpp: Added. (WebKit::WaylandCompositorDisplay::create): (WebKit::WaylandCompositorDisplay::bindSurfaceToPage): (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay): (WebKit::WaylandCompositorDisplay::registryGlobal): * WebProcess/gtk/WaylandCompositorDisplay.h: Added. * WebProcess/soup/WebProcessSoup.cpp: (WebKit::WebProcess::platformInitializeWebProcess): 2017-06-21 Carlos Garcia Campos [GTK] Move WebGtkExtensionManager and WebGtkInjectedBundleMain to glib API dir https://bugs.webkit.org/show_bug.cgi?id=173606 Reviewed by Žan Doberšek. And rename them to use WebKit prefix instead of WebGtk. * PlatformGTK.cmake: * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.cpp. (WebKit::WebKitExtensionManager::singleton): (WebKit::WebKitExtensionManager::WebKitExtensionManager): (WebKit::WebKitExtensionManager::scanModules): (WebKit::WebKitExtensionManager::initializeWebExtension): (WebKit::WebKitExtensionManager::initialize): * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h. * WebProcess/InjectedBundle/API/glib/WebKitInjectedBundleMain.cpp: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp. (WKBundleInitialize): 2017-06-20 Frederic Wang Pass the argument of DrawingArea::shouldUseTiledBackingForFrameView by reference https://bugs.webkit.org/show_bug.cgi?id=173605 DrawingArea::shouldUseTiledBackingForFrameView is only called from WebChromeClient::shouldUseTiledBackingForFrameView where the frame view is already available as a reference. This patch makes the argument of DrawingArea::shouldUseTiledBackingForFrameView a reference, so it does not need to be converted to a pointer or to perform nullchecks. Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Just pass the reference. * WebProcess/WebPage/DrawingArea.h: Make the parameter a reference. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Ditto. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Use the reference to frame view and remove the nullcheck. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto. 2017-06-20 Myles C. Maxfield Disable font variations on macOS Sierra and iOS 10 https://bugs.webkit.org/show_bug.cgi?id=173618 Reviewed by Jon Lee. * Configurations/FeatureDefines.xcconfig: 2017-06-20 Daniel Bates Have FrameLoadRequest takes a Frame& instead of a Frame* https://bugs.webkit.org/show_bug.cgi?id=173614 Reviewed by Brent Fulgham. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performFrameLoadURLRequest): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadURLInFrame): (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadDataImpl): 2017-06-20 Tim Horton Occasional deadlocks under ensurePositionInformationIsUpToDate (incoming sync message with waitForAndDispatchImmediately) https://bugs.webkit.org/show_bug.cgi?id=173570 Reviewed by Wenson Hsieh. * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::getPositionInformation): Deleted. Get rid of getPositionInformation; it only has one caller, and it's easier to reason about the code if it's all in one place. Also, we shouldn't add more callers... * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView ensurePositionInformationIsUpToDate:]): Add a return value to ensurePositionInformationIsUpToDate that indicates whether we succeeded in that effort. Add the flag to our waitForAndDispatchImmediately that causes the wait to be interrupted if a sync message arrives. (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView positionInformationForActionSheetAssistant:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): If anything happens to interrupt our position information update, fail in the most graceful possible way at each callsite (generally by bailing from doing whatever action required position information). * UIProcess/ios/WKPDFView.mm: (-[WKPDFView positionInformationForActionSheetAssistant:]): * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant synchronouslyRetrievePositionInformation]): (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]): (-[WKActionSheetAssistant presentationRectForIndicatedElement]): (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]): (-[WKActionSheetAssistant presentationRectInHostViewForSheet]): (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant defaultActionsForLinkSheet:]): (-[WKActionSheetAssistant showLinkSheet]): (-[WKActionSheetAssistant showDataDetectorsSheet]): (-[WKActionSheetAssistant cleanupSheet]): Instead of constantly re-querying the position information, save it aside when presenting an action sheet, and use it to respond to all of the subsequent questions. Also, bail from presenting the action sheet if we fail to retrieve correct position information. 2017-06-20 Matt Lewis Unreviewed, rolling out r218530. This revision caused multiple media stream test crashes on Debug builds. Reverted changeset: "Merge MediaDevicesRequest and MediaDevicesEnumerationRequest to tighten up code and object lifetime" https://bugs.webkit.org/show_bug.cgi?id=173527 http://trac.webkit.org/changeset/218530 2017-06-20 Wenson Hsieh [iOS DnD] [WK2] Remove custom logic for disambiguating long press action sheet gestures and drag lift https://bugs.webkit.org/show_bug.cgi?id=173578 Reviewed by Tim Horton. Custom logic to cancel the long press action gesture recognizer in WebKit2 was added months ago to achieve spec'ed behavior when initiating a drag on an element with an action sheet to show on long press. Now that UIKit defers firing long-press gesture recognizers while a drag lift is recognizing, no extra work in WebKit is needed to achieve expected behavior. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateLongPressActionAtLocation:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add testing SPI for showing an action sheet popover at a given location in content view coordinates. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]): (-[WKContentView _didHandleStartDataInteractionRequest:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:sessionWillBegin:]): (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): (-[WKContentView _simulateLongPressActionAtLocation:]): (longPressActionDelayAfterLift): Deleted. (-[WKContentView performDeferredActionAtDragOrigin]): Deleted. (-[WKContentView cancelDeferredActionAtDragOrigin]): Deleted. 2017-06-20 Carlos Garcia Campos [WPE] Add initial implementation of glib API https://bugs.webkit.org/show_bug.cgi?id=173546 Reviewed by Žan Doberšek. Make current API files under glib directories build in WPE, and add the minimum implementation to make it work. For now it doesn't have web extensions API, and there are a few FIXMEs that will be fixed in follow up commits. It doesn't include install rules yet, since it's still not ready to be installed. * PlatformGTK.cmake: * PlatformWPE.cmake: * Shared/API/glib/WebKitContextMenuActions.cpp: (webkitContextMenuActionGetActionTag): (webkitContextMenuActionGetForContextMenuItem): (webkitContextMenuActionGetLabel): * Shared/API/glib/WebKitContextMenuItem.cpp: * UIProcess/API/glib/WebKitEditorState.cpp: (webkitEditorStateChanged): * UIProcess/API/glib/WebKitError.cpp: * UIProcess/API/glib/WebKitFileChooserRequest.cpp: (webkitFileChooserRequestGetProperty): (webkit_file_chooser_request_class_init): * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: (createGstInstallPluginsContext): (webkitInstallMissingMediaPluginsPermissionRequestAllow): * UIProcess/API/glib/WebKitNavigationAction.cpp: * UIProcess/API/glib/WebKitNavigationActionPrivate.h: (_WebKitNavigationAction::_WebKitNavigationAction): * UIProcess/API/glib/WebKitNotificationPrivate.h: * UIProcess/API/glib/WebKitNotificationProvider.cpp: (WebKitNotificationProvider::show): * UIProcess/API/glib/WebKitPrivate.cpp: (toPlatformModifiers): (toWebKitError): (toWebCoreError): * UIProcess/API/glib/WebKitPrivate.h: * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): (webKitSettingsGetProperty): (webkit_settings_class_init): (webkit_settings_set_user_agent): (webkit_settings_set_user_agent_with_application_details): * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/API/glib/WebKitURISchemeRequest.cpp: (webkit_uri_scheme_request_get_web_view): * UIProcess/API/glib/WebKitUserContentManager.cpp: * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewCreate): (webkit_web_view_class_init): (webkitWebViewCreatePage): (webkitWebViewRunAsModal): (webkitWebViewMouseTargetChanged): (webkitWebViewEnterFullScreen): (webkitWebViewExitFullScreen): (webkitWebViewPopulateContextMenu): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/glib/WebKitWindowProperties.cpp: (webkitWindowPropertiesGetProperty): (webkitWindowPropertiesSetProperty): (webkit_window_properties_class_init): (webkitWindowPropertiesUpdateFromWebWindowFeatures): * UIProcess/API/glib/WebKitWindowPropertiesPrivate.h: * UIProcess/API/gtk/WebKitWebViewGtk.cpp: Added. (webkitWebViewAuthenticate): (webkitWebViewCreateJavaScriptDialog): (webkitWebViewScriptDialog): (fileChooserDialogResponseCallback): (webkitWebViewRunFileChooser): (webkit_web_view_new): (webkit_web_view_new_with_context): (webkit_web_view_new_with_related_view): (webkit_web_view_new_with_settings): (webkit_web_view_new_with_user_content_manager): * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WebKitAuthenticationRequest.h: Added. * UIProcess/API/wpe/WebKitAutomationSession.h: Added. * UIProcess/API/wpe/WebKitBackForwardList.h: Added. * UIProcess/API/wpe/WebKitBackForwardListItem.h: Added. * UIProcess/API/wpe/WebKitContextMenu.h: Added. * UIProcess/API/wpe/WebKitContextMenuActions.h: Added. * UIProcess/API/wpe/WebKitContextMenuItem.h: Added. * UIProcess/API/wpe/WebKitCookieManager.h: Added. * UIProcess/API/wpe/WebKitCredential.h: Added. * UIProcess/API/wpe/WebKitDefines.h: Copied from Source/WebKit2/UIProcess/API/glib/WebKitPrivate.h. * UIProcess/API/wpe/WebKitDownload.h: Added. * UIProcess/API/wpe/WebKitEditingCommands.h: Added. * UIProcess/API/wpe/WebKitEditorState.h: Added. * UIProcess/API/wpe/WebKitEnumTypes.cpp.template: Added. * UIProcess/API/wpe/WebKitEnumTypes.h.template: Copied from Source/WebKit2/UIProcess/API/glib/WebKitNotificationPrivate.h. * UIProcess/API/wpe/WebKitError.h: Added. * UIProcess/API/wpe/WebKitFaviconDatabase.h: Added. * UIProcess/API/wpe/WebKitFileChooserRequest.h: Added. * UIProcess/API/wpe/WebKitFindController.h: Added. * UIProcess/API/wpe/WebKitFormSubmissionRequest.h: Added. * UIProcess/API/wpe/WebKitGeolocationPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitHitTestResult.h: Added. * UIProcess/API/wpe/WebKitInstallMissingMediaPluginsPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitJavascriptResult.h: Added. * UIProcess/API/wpe/WebKitMimeInfo.h: Added. * UIProcess/API/wpe/WebKitNavigationAction.h: Added. * UIProcess/API/wpe/WebKitNavigationPolicyDecision.h: Added. * UIProcess/API/wpe/WebKitNetworkProxySettings.h: Added. * UIProcess/API/wpe/WebKitNotification.h: Added. * UIProcess/API/wpe/WebKitNotificationPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitPlugin.h: Added. * UIProcess/API/wpe/WebKitPolicyDecision.h: Added. * UIProcess/API/wpe/WebKitResponsePolicyDecision.h: Added. * UIProcess/API/wpe/WebKitScriptDialog.h: Added. * UIProcess/API/wpe/WebKitSecurityManager.h: Added. * UIProcess/API/wpe/WebKitSecurityOrigin.h: Added. * UIProcess/API/wpe/WebKitSettings.h: Added. * UIProcess/API/wpe/WebKitURIRequest.h: Added. * UIProcess/API/wpe/WebKitURIResponse.h: Added. * UIProcess/API/wpe/WebKitURISchemeRequest.h: Added. * UIProcess/API/wpe/WebKitUserContent.h: Added. * UIProcess/API/wpe/WebKitUserContentManager.h: Added. * UIProcess/API/wpe/WebKitUserMediaPermissionRequest.h: Added. * UIProcess/API/wpe/WebKitWebContext.h: Added. * UIProcess/API/wpe/WebKitWebResource.h: Added. * UIProcess/API/wpe/WebKitWebView.h: Added. * UIProcess/API/wpe/WebKitWebViewSessionState.h: Added. * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Added. (webkitWebViewAuthenticate): (webkitWebViewScriptDialog): (webkitWebViewRunFileChooser): (webkit_web_view_new): (webkit_web_view_new_with_context): (webkit_web_view_new_with_related_view): (webkit_web_view_new_with_settings): (webkit_web_view_new_with_user_content_manager): * UIProcess/API/wpe/WebKitWebsiteData.h: Added. * UIProcess/API/wpe/WebKitWebsiteDataManager.h: Added. * UIProcess/API/wpe/WebKitWindowProperties.h: Added. * UIProcess/API/wpe/webkit.h: Added. 2017-06-19 Frederic Wang [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled https://bugs.webkit.org/show_bug.cgi?id=173405 Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/WebChromeClient.h: Set the ScrollableNonMainFrameTrigger bit by default on iOS too. RenderLayerCompositor::requiresCompositingForScrollableFrame will ignore this change when async frame scrolling is disabled. 2017-06-19 Frederic Wang [Mac] Add an experimental feature setting for async frame scrolling https://bugs.webkit.org/show_bug.cgi?id=173359 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: Add experimental feature "async frame scrolling". * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetAsyncFrameScrollingEnabled): Add setter for async frame scrolling. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Declare setter. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setAsyncFrameScrollingEnabled): Add setter for async frame scrolling. * WebProcess/InjectedBundle/InjectedBundle.h: Declare setter. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Take into account preference update for async frame scrolling. 2017-06-19 Darin Adler Merge MediaDevicesRequest and MediaDevicesEnumerationRequest to tighten up code and object lifetime https://bugs.webkit.org/show_bug.cgi?id=173527 Reviewed by Sam Weinig. * UIProcess/API/C/WKUserMediaPermissionCheck.h: Fixed incorrect file name in comment. * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Use the new frame function from MediaDevicesEnumerationRequest rather than finding the frame with our own code. * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: Removed unneeded include of UserMediaController.h. 2017-06-19 Chris Dumez Regression(r217570): com.apple.WebKit.Networking crash at com.apple.WebKit: WebKit::ChildProcess::didReceiveInvalidMessage (Breaks 32-bit apps) https://bugs.webkit.org/show_bug.cgi?id=173576 Reviewed by Tim Horton. The IPC encoding / decoding code cannot be architecture-specific because a 32bit UIProcess talks to a 64bit NetworkProcess. The WEB_RTC build time flag is enabled on 64bit only. Therefore, we should not use #if ENABLE(WEB_RTC) in IPC encoding / decoding code. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: 2017-06-19 Chris Dumez Unreviewed, partial rollout of r218501 to address crashes on iOS. * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryAppLink): 2017-06-19 Darin Adler [Cocoa] implement URLSession:task:needNewBodyStream: delegate method https://bugs.webkit.org/show_bug.cgi?id=173551 rdar://problem/32250512 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate existingTask:]): Added helper method. (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]): Updated to use existingTask: method. (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]): Added. (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): Updated to use existingTask: method. (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Ditto. (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): Ditto. (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): Ditto. (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Ditto. (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): Ditto. (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): Ditto. (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): Ditto. (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Ditto. (WebKit::globalAllowsCellularAccess): Deleted. Just use a normal global. (WebKit::globalLegacyCustomProtocolManager): Deleted. Just use a normal global. (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Updated for normal global. (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Ditto. (WebKit::NetworkSessionCocoa::defaultSession): Ditto. (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto. 2017-06-19 Ryan Haddad Unreviewed, rolling out r218503. This change broke the macOS Sierra build. Reverted changeset: "Removed unused lambda captures from WebKit2" https://bugs.webkit.org/show_bug.cgi?id=173555 http://trac.webkit.org/changeset/218503 2017-06-19 Wenson Hsieh [iOS DnD] [WK2] Add an internal hook to change the drag lift delay https://bugs.webkit.org/show_bug.cgi?id=173523 Reviewed by Tim Horton. Add a new private property on WKWebViewConfiguration, _dragLiftDelay, for changing the UIDragInteraction's lift delay to one of three values: short, medium or long. The short setting simply uses UIKit's default drag lift delay (at the time of writing, this is 325ms); medium and long are 500ms and 650ms, respectively. In combination with an internal switch to toggle between lift delays, the purpose of this change is to make it easier to choose a drag lift delay for web content that doesn't easily cause unintended dragging while panning. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (toDragLiftDelay): Converts an integer (e.g. retrieved from user defaults) to a drag lift delay type. (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _dragLiftDelay]): Add boilerplate plumbing for the _dragLiftDelay setting. (-[WKWebViewConfiguration _setDragLiftDelay:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Add _dragLiftDelay to as a private property of WKWebViewConiguration. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dragLiftDelay]): Convert the web view configuration's _WKDragLiftDelay to an actual time interval. (-[WKContentView setupDataInteractionDelegates]): 2017-06-19 Konstantin Tokarev Removed unused lambda captures from WebKit2 https://bugs.webkit.org/show_bug.cgi?id=173555 Reviewed by Alex Christensen. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): 2017-06-19 Chris Dumez Use WTF::Function instead of std::function in more places in WebCore/ https://bugs.webkit.org/show_bug.cgi?id=173535 Reviewed by Antti Koivisto. Use WTF::Function instead of std::function in more places in WebCore/ to avoid copying. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpPolicyListener): (WebKit::WebFrame::invalidatePolicyListener): * WebProcess/WebPage/WebFrame.h: 2017-06-19 Chris Dumez [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies https://bugs.webkit.org/show_bug.cgi?id=173472 Reviewed by Antti Koivisto. Follow-up to r218419 to avoid copying the HashMap unnecessarily. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::resetPluginLoadClientPolicies): * UIProcess/WebProcessPool.h: 2017-06-19 Youenn Fablet A cloned MediaStreamTrack should mute independently other tracks using the same source https://bugs.webkit.org/show_bug.cgi?id=172831 Reviewed by Eric Carlson. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setStorage): 2017-06-19 Carlos Garcia Campos [GTK] Move GTK+ API files that could be shared to glib dirs https://bugs.webkit.org/show_bug.cgi?id=173545 Reviewed by Žan Doberšek. Most of the files don't use GTK+ at all, or only for a few things that could be ifdefed. Public headers can never be shared, so move only private headers and cpp files. This patch moves the files without any modification to make everything easier, in follow up commits we will add the required ifdefs and refactorings to ensure the code can actually be shared. * PlatformGTK.cmake: * Shared/API/glib/WebKitContextMenu.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp. * Shared/API/glib/WebKitContextMenuActions.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp. * Shared/API/glib/WebKitContextMenuActionsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h. * Shared/API/glib/WebKitContextMenuItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp. * Shared/API/glib/WebKitContextMenuItemPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h. * Shared/API/glib/WebKitContextMenuPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h. * Shared/API/glib/WebKitHitTestResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp. * Shared/API/glib/WebKitHitTestResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h. * Shared/API/glib/WebKitURIRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp. * Shared/API/glib/WebKitURIRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequestPrivate.h. * Shared/API/glib/WebKitURIResponse.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp. * Shared/API/glib/WebKitURIResponsePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h. * UIProcess/API/glib/WebKitAuthenticationRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequest.cpp. * UIProcess/API/glib/WebKitAuthenticationRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h. * UIProcess/API/glib/WebKitAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSession.cpp. * UIProcess/API/glib/WebKitAutomationSessionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSessionPrivate.h. * UIProcess/API/glib/WebKitBackForwardList.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp. * UIProcess/API/glib/WebKitBackForwardListItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp. * UIProcess/API/glib/WebKitBackForwardListPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h. * UIProcess/API/glib/WebKitContextMenuClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.cpp. * UIProcess/API/glib/WebKitContextMenuClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.h. * UIProcess/API/glib/WebKitCookieManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp. * UIProcess/API/glib/WebKitCookieManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h. * UIProcess/API/glib/WebKitCredential.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredential.cpp. * UIProcess/API/glib/WebKitCredentialPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredentialPrivate.h. * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp. * UIProcess/API/glib/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h. * UIProcess/API/glib/WebKitDownload.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp. * UIProcess/API/glib/WebKitDownloadClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp. * UIProcess/API/glib/WebKitDownloadClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.h. * UIProcess/API/glib/WebKitDownloadPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h. * UIProcess/API/glib/WebKitEditorState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.cpp. * UIProcess/API/glib/WebKitEditorStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorStatePrivate.h. * UIProcess/API/glib/WebKitError.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp. * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp. * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h. * UIProcess/API/glib/WebKitFileChooserRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp. * UIProcess/API/glib/WebKitFileChooserRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h. * UIProcess/API/glib/WebKitFindController.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp. * UIProcess/API/glib/WebKitFormClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp. * UIProcess/API/glib/WebKitFormClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.h. * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp. * UIProcess/API/glib/WebKitFormSubmissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h. * UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp. * UIProcess/API/glib/WebKitGeolocationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h. * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp. * UIProcess/API/glib/WebKitGeolocationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h. * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.cpp. * UIProcess/API/glib/WebKitInjectedBundleClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.h. * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp. * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h. * UIProcess/API/glib/WebKitJavascriptResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp. * UIProcess/API/glib/WebKitJavascriptResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h. * UIProcess/API/glib/WebKitLoaderClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp. * UIProcess/API/glib/WebKitLoaderClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.h. * UIProcess/API/glib/WebKitMimeInfo.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfo.cpp. * UIProcess/API/glib/WebKitMimeInfoPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfoPrivate.h. * UIProcess/API/glib/WebKitNavigationAction.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp. * UIProcess/API/glib/WebKitNavigationActionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h. * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp. * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h. * UIProcess/API/glib/WebKitNetworkProxySettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettings.cpp. * UIProcess/API/glib/WebKitNetworkProxySettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h. * UIProcess/API/glib/WebKitNotification.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp. * UIProcess/API/glib/WebKitNotificationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp. * UIProcess/API/glib/WebKitNotificationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h. * UIProcess/API/glib/WebKitNotificationPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h. * UIProcess/API/glib/WebKitNotificationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp. * UIProcess/API/glib/WebKitNotificationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h. * UIProcess/API/glib/WebKitPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPermissionRequest.cpp. * UIProcess/API/glib/WebKitPlugin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPlugin.cpp. * UIProcess/API/glib/WebKitPluginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPluginPrivate.h. * UIProcess/API/glib/WebKitPolicyClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp. * UIProcess/API/glib/WebKitPolicyClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h. * UIProcess/API/glib/WebKitPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp. * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h. * UIProcess/API/glib/WebKitPrivate.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp. * UIProcess/API/glib/WebKitPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h. * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp. * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h. * UIProcess/API/glib/WebKitScriptDialog.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.cpp. * UIProcess/API/glib/WebKitScriptDialogPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h. * UIProcess/API/glib/WebKitSecurityManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp. * UIProcess/API/glib/WebKitSecurityManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h. * UIProcess/API/glib/WebKitSecurityOrigin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOrigin.cpp. * UIProcess/API/glib/WebKitSecurityOriginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOriginPrivate.h. * UIProcess/API/glib/WebKitSettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp. * UIProcess/API/glib/WebKitSettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h. * UIProcess/API/glib/WebKitUIClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp. * UIProcess/API/glib/WebKitUIClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.h. * UIProcess/API/glib/WebKitURISchemeRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp. * UIProcess/API/glib/WebKitURISchemeRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h. * UIProcess/API/glib/WebKitUserContent.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContent.cpp. * UIProcess/API/glib/WebKitUserContentManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManager.cpp. * UIProcess/API/glib/WebKitUserContentManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManagerPrivate.h. * UIProcess/API/glib/WebKitUserContentPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentPrivate.h. * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp. * UIProcess/API/glib/WebKitUserMediaPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h. * UIProcess/API/glib/WebKitWebContext.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp. * UIProcess/API/glib/WebKitWebContextPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h. * UIProcess/API/glib/WebKitWebResource.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp. * UIProcess/API/glib/WebKitWebResourcePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h. * UIProcess/API/glib/WebKitWebView.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp. * UIProcess/API/glib/WebKitWebViewPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h. * UIProcess/API/glib/WebKitWebViewSessionState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionState.cpp. * UIProcess/API/glib/WebKitWebViewSessionStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionStatePrivate.h. * UIProcess/API/glib/WebKitWebsiteData.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp. * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp. * UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h. * UIProcess/API/glib/WebKitWebsiteDataPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataPrivate.h. * UIProcess/API/glib/WebKitWindowProperties.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp. * UIProcess/API/glib/WebKitWindowPropertiesPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp. * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp. * WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFramePrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp. * WebProcess/InjectedBundle/API/glib/WebKitScriptWorldPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorldPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp. * WebProcess/InjectedBundle/API/glib/WebKitWebEditorPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp. * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResult.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp. * WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResultPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp. * WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h. 2017-05-14 Frederic Wang Add heuristic to avoid flattening "fullscreen" iframes https://bugs.webkit.org/show_bug.cgi?id=171914 Reviewed by Simon Fraser. This commit ajusts the preference API to internally treat frame flattening as an enum. However, the "partial frame flattening" value is not exposed to GTK, C or InjectedBundle APIs yet. * Shared/WebPreferencesDefinitions.h: Define frame flattening as an enum. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetFrameFlatteningEnabled): Treat frame flattening as an enum. (WKPreferencesGetFrameFlatteningEnabled): Ditto. * UIProcess/API/gtk/WebKitSettings.cpp: (webkit_settings_get_enable_frame_flattening): Ditto. (webkit_settings_set_enable_frame_flattening): Ditto. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Do not handle frame flattening since it is an enum. For now, this breaks one test checking preference overriding because of bug 128594. (WebKit::InjectedBundle::setFrameFlatteningEnabled): Treat frame flattening as an enum. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged): Use enum value. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Ditto. 2017-06-18 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.4 release. * gtk/NEWS: Add release notes for 2.17.4. 2017-06-18 Chris Dumez Drop redundant IPC in WebPage::tryClose() https://bugs.webkit.org/show_bug.cgi?id=173533 Reviewed by Sam Weinig. Drop redundant IPC to stop the responsiveness timer in WebPage::tryClose(). The destructor for the SendStopResponsivenessTimer already takes care of sending the IPC. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::tryClose): 2017-06-18 Chris Dumez Drop unused UserMediaPermissionRequestManager::cancelPendingRequests() https://bugs.webkit.org/show_bug.cgi?id=173529 Reviewed by Sam Weinig. Drop UserMediaPermissionRequestManager::cancelPendingRequests() as it is unused and its implementation is wrong (modifies the hash maps it is iterating on). * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): Deleted. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: 2017-06-17 Chris Dumez Unreviewed, follow-up build fix after r218457. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-06-17 Chris Dumez Unreviewed, follow-up build fix after r218457. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-06-17 Chris Dumez Use WTF::Function instead of std::function in WebKit2/ https://bugs.webkit.org/show_bug.cgi?id=173504 Reviewed by Darin Adler. Use WTF::Function instead of std::function in WebKit2/ to avoid unnecessary copying. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): * DatabaseProcess/DatabaseProcess.h: * NetworkProcess/cache/NetworkCacheData.h: * NetworkProcess/cache/NetworkCacheFileSystem.h: * Platform/IPC/Connection.cpp: (IPC::Connection::installIncomingSyncMessageCallback): * Platform/IPC/Connection.h: * Platform/IPC/glib/GSocketMonitor.h: * Platform/Logging.h: * Shared/API/APIObject.h: * Shared/AsyncRequest.cpp: (WebKit::AsyncRequest::AsyncRequest): (WebKit::AsyncRequest::setAbortHandler): * Shared/AsyncRequest.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/WebContextMenuItemData.h: * UIProcess/API/APIDownloadClient.h: (API::DownloadClient::willSendRequest): * UIProcess/API/APIIconLoadingClient.h: (API::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPageAsync): * UIProcess/API/C/WKPage.cpp: (toGenericCallbackFunction): * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/mac/WKView.mm: (-[WKView maybeInstallIconLoadingClient]): * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/AcceleratedDrawingAreaProxy.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Cocoa/IconLoadingDelegate.h: * UIProcess/Cocoa/IconLoadingDelegate.mm: (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryAppLink): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::createNewPageAsync): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::start): * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::prepareForMoveToWindow): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): (WebKit::DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing): * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/GenericCallback.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/PageClient.h: * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::fetchWebsiteData): (WebKit::PluginProcessManager::deleteWebsiteData): (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames): * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::fetchWebsiteData): (WebKit::PluginProcessProxy::deleteWebsiteData): (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames): * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/ProcessAssertion.h: * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::backForwardListState): * UIProcess/WebBackForwardList.h: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::setCookieObserverCallback): (WebKit::WebCookieManagerProxy::cookiesDidChange): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setInitialFocus): (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::sessionState): (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getSamplingProfilerOutput): (WebKit::WebPageProxy::isWebProcessResponsive): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::createNewPage): (WebKit::WebPageProxy::getMarkedRangeAsync): (WebKit::WebPageProxy::getSelectedRangeAsync): (WebKit::WebPageProxy::characterIndexForPointAsync): (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): (WebKit::WebPageProxy::takeSnapshot): (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler): (WebKit::WebPageProxy::callAfterNextPresentationUpdate): (WebKit::WebPageProxy::getLoadDecisionForIcon): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::isResponsive): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.h: * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::XDamageNotifier::add): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::requestPasswordForQuickLookDocument): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::updateSelectionWithTouches): (WebKit::WebPageProxy::requestAutocorrectionData): (WebKit::WebPageProxy::applyAutocorrection): (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::selectTextWithGranularityAtPoint): (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection): (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection): (WebKit::WebPageProxy::selectPositionAtPoint): (WebKit::WebPageProxy::beginSelectionInDirection): (WebKit::WebPageProxy::updateSelectionWithExtentPoint): (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPageProxy::requestDictationContext): (WebKit::WebPageProxy::requestAutocorrectionContext): (WebKit::WebPageProxy::getSelectionContext): (WebKit::WebPageProxy::selectWithTwoTouches): (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset): (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText): (WebKit::WebPageProxy::moveSelectionByOffset): (WebKit::WebPageProxy::focusNextAssistedNode): (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/mac/WKTextFinderClient.mm: * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKSelectionHandlerWrapper initWithSelectionHandler:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): (WebKit::WebPageProxy::fontAtSelection): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard): (WebKit::WebPaymentCoordinator::openPaymentSetup): * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::willSendRequest): * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::dispatchAfterEnsuringUpdatedScrollPosition): * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::markLayersVolatile): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::markLayersVolatile): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::markAllLayersVolatile): * WebProcess/WebProcess.h: 2017-06-17 Alex Christensen Fix CMake build * CMakeLists.txt: * NetworkProcess/capture/NetworkCaptureEvent.cpp: * PlatformGTK.cmake: * PlatformWPE.cmake: 2017-06-17 Dan Bernstein Tried to fix non-iOS builds. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-06-17 Carlos Garcia Campos [GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib https://bugs.webkit.org/show_bug.cgi?id=173469 Reviewed by Michael Catanzaro. Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port. * PlatformGTK.cmake: * Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp. (WebKit::gtkStockIDFromContextMenuAction): (WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib): (WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib): (WebKit::WebContextMenuItemGlib::buildActionName): (WebKit::WebContextMenuItemGlib::createActionIfNeeded): * Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h. * UIProcess/API/gtk/WebKitContextMenu.cpp: (webkitContextMenuPopulate): * UIProcess/API/gtk/WebKitContextMenuActions.cpp: (webkitContextMenuActionGetForContextMenuItem): * UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h: * UIProcess/API/gtk/WebKitContextMenuItem.cpp: (webkitContextMenuItemCreate): (webkitContextMenuItemToWebContextMenuItemGlib): (webkit_context_menu_item_new): (webkit_context_menu_item_new_from_gaction): (webkit_context_menu_item_new_from_stock_action): (webkit_context_menu_item_new_from_stock_action_with_label): (webkit_context_menu_item_new_with_submenu): (webkit_context_menu_item_new_separator): * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h: * UIProcess/API/gtk/WebKitContextMenuPrivate.h: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewPopulateContextMenu): * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::WebContextMenuProxyGtk::append): (WebKit::WebContextMenuProxyGtk::buildMenu): (WebKit::WebContextMenuProxyGtk::populate): * UIProcess/gtk/WebContextMenuProxyGtk.h: 2017-06-16 Dan Bernstein [Cocoa] Some declarations have missing or incorrect availability attributes https://bugs.webkit.org/show_bug.cgi?id=173508 Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Removed a redundant attribute. In all of the below files, added missing availability attributes for declarations that have not appeared yet in any GM SDK, and fixed availability attributes for declarations that have already appeared in the macOS 10.12.3 and iOS 10.3 SDKs. * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/API/Cocoa/WKPreferences.h: Also fixed capitalization in a comment. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Also removed unnecessary conditionals. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _draggableElementAtPosition:]): Prepended an underscore to this private method’s name. (-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Ditto. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Also updated for renames. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h: * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/_WKWebViewPrintFormatter.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: 2017-06-16 Youenn Fablet [WebRTC] CrashTracer: Regression : com.apple.WebKit.Networking at WebKit: WebKit::LibWebRTCSocketClient::sendTo https://bugs.webkit.org/show_bug.cgi?id=173501 Reviewed by Eric Carlson. When a libwebrtc socket fails to be created in the network process, the network process sends back a close message, but it keeps it in a map. If the web process sends a message dedicated to this socket, we will try processing it and calling the socket which is null, hence the cache. This patch makes it so that if the socket is null, it is not added to the map. * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient): * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createSocket): (WebKit::NetworkRTCProvider::createUDPSocket): (WebKit::NetworkRTCProvider::createServerTCPSocket): (WebKit::NetworkRTCProvider::createClientTCPSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: 2017-06-16 Antoine Quint Add a WebKit2 setting to control whether media documents should automatically enter fullscreen https://bugs.webkit.org/show_bug.cgi?id=173503 Reviewed by Tim Horton. New WebKit2 setting to specify whether a media document should automatically enter fullscreen. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]): (-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-16 Sam Weinig [WebIDL] Remove custom bindings for HTMLDocument https://bugs.webkit.org/show_bug.cgi?id=173444 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp: (webkit_dom_html_document_get_link_color): (webkit_dom_html_document_set_link_color): Update for rename of linkColor to linkColorForBindings. 2017-06-16 Daniel Bates Cleanup: WebContextMenuClient::searchWithGoogle() should parse URL using URL { URL { }, ... } instead of URL { ParsedURLString, ... } https://bugs.webkit.org/show_bug.cgi?id=173495 Reviewed by Alex Christensen. URL(ParsedURLString, ...) should only be used with a string that was the result of URL::string(). Otherwise, it will cause an assertion failure if the canonicalized URL differs from the string. Although it is unlikely that the hardcoded string in WebContextMenuClient::searchWithGoogle() would differ from the canonicalized URL it is best practice to use URL(URL(), ...) to parse an arbitrary string that looks like a URL. Also modernize the code using C++14 idioms. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::searchWithGoogle): 2017-06-16 Wenson Hsieh [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit https://bugs.webkit.org/show_bug.cgi?id=173366 Reviewed by Tim Horton. Move pieces of iOS WebKit2 drag and drop implementation into OpenSource. No change in behavior. * Configurations/FeatureDefines.xcconfig: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::setDragImage): (WebKit::WebPageProxy::setPromisedDataForImage): (WebKit::WebPageProxy::setPromisedDataForAttachment): (WebKit::WebPageProxy::setDragCaretRect): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (longPressActionDelayAfterLift): (-[WKContentView webViewUIDelegate]): (-[WKContentView setupDataInteractionDelegates]): (-[WKContentView teardownDataInteractionDelegates]): (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]): (-[WKContentView _didHandleStartDataInteractionRequest:]): (uiImageForImage): (shouldUseTextIndicatorToCreatePreviewForDragAction): (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]): (-[WKContentView dragPreviewForCurrentDataInteractionState]): (-[WKContentView performDeferredActionAtDragOrigin]): (-[WKContentView cancelDeferredActionAtDragOrigin]): (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]): (dropOperationForWebCoreDragOperation): (-[WKContentView dragDataForDropSession:dragDestinationAction:]): (-[WKContentView cleanUpDragSourceSessionState]): (extractItemProvidersFromDragItems): (extractItemProvidersFromDropSession): (-[WKContentView _didConcludeEditDataInteraction:]): (-[WKContentView _didPerformDataInteractionControllerOperation:]): (-[WKContentView _transitionDragPreviewToImageIfNecessary:]): (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): (-[WKContentView _dragDestinationActionForDropSession:]): (positionInformationMayStartDataInteraction): (-[WKContentView currentDragOrDropSession]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView _api_dragInteraction:previewForLiftingItem:session:]): (-[WKContentView dragInteraction:sessionWillBegin:]): (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]): (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]): (-[WKContentView dropInteraction:canHandleSession:]): (-[WKContentView _api_dropInteraction:sessionDidEnter:]): (-[WKContentView _api_dropInteraction:sessionDidUpdate:]): (-[WKContentView dropInteraction:sessionDidExit:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]): (-[WKContentView dropInteraction:sessionDidEnd:]): (-[WKContentView _simulateDataInteractionEntered:]): (-[WKContentView _simulateDataInteractionUpdated:]): (-[WKContentView _simulateDataInteractionEnded:]): (-[WKContentView _simulateDataInteractionPerformOperation:]): (-[WKContentView _simulateDataInteractionSessionDidEnd:]): (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): (-[WKContentView _simulatedItemsForSession:]): (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertCGImageToBitmap): (WebKit::WebDragClient::startDrag): (WebKit::WebDragClient::declareAndWriteDragImage): (WebKit::WebDragClient::didConcludeEditDrag): (WebKit::WebDragClient::declareAndWriteAttachment): 2017-06-16 Youenn Fablet WebRTC sockets should be closed at destruction time if not closed explicitly https://bugs.webkit.org/show_bug.cgi?id=173479 Reviewed by Eric Carlson. * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::~LibWebRTCSocket): (WebKit::LibWebRTCSocket::Close): 2017-06-16 Chris Dumez [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies https://bugs.webkit.org/show_bug.cgi?id=173472 Reviewed by Brady Eidson. Add WKProcessPool SPI to efficiently reset all plugin load client policies: [WKProcessPool _resetPluginLoadClientPolicies]. This new SPI clears all existing policies and then sets all of them with new values, with a minimal amount of IPC. To achieve this, clients would previously have to call 1. WKContextClearPluginClientPolicies() which would cause a broadcast IPC to every WebContent process. 2. WKContextSetPluginLoadClientPolicy() repeatedly to add each policy one by one. Each call to WKContextSetPluginLoadClientPolicy() would cause a broadcast IPC to every WebContent process. The new SPI does the same job with a single broadcast IPC to every WebContent process. * UIProcess/API/Cocoa/WKProcessPool.mm: (isPluginLoadClientPolicyAcceptable): (toPluginLoadClientPoliciesHashMap): (policiesHashMapToDictionary): (-[WKProcessPool _resetPluginLoadClientPolicies:]): (-[WKProcessPool _pluginLoadClientPolicies]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setPluginLoadClientPolicy): (WebKit::WebProcessPool::resetPluginLoadClientPolicies): * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::resetPluginLoadClientPolicies): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2017-06-16 Brent Fulgham [WK2][macOS] Expand sandbox to better support video playback on mac mini https://bugs.webkit.org/show_bug.cgi?id=173492 Reviewed by Alex Christensen. Hardware differences in Mac Mini's require some different IOKit preferences to be accessible. * WebProcess/com.apple.WebProcess.sb.in: 2017-06-16 Brent Fulgham [WK2][iOS][macOS] Extend the sandbox to allow reading of AVFoundation's VideoPerformanceHUD preference https://bugs.webkit.org/show_bug.cgi?id=173476 Reviewed by Alex Christensen. Update the sandbox to permit WebContent process to read the AVFoundation preferences for the performance HUD. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2017-06-16 Daniel Bates Use the term icon instead of favicon https://bugs.webkit.org/show_bug.cgi?id=173400 Reviewed by Alex Christensen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): 2017-06-16 Carlos Garcia Campos [GTK][WPE] Remove WKCookieManagerSoup https://bugs.webkit.org/show_bug.cgi?id=173467 Reviewed by Michael Catanzaro. It's unused. * PlatformGTK.cmake: * PlatformWPE.cmake: * UIProcess/API/C/soup/WKCookieManagerSoup.cpp: Removed. * UIProcess/API/C/soup/WKCookieManagerSoup.h: Removed. 2017-06-16 Carlos Garcia Campos Unreviewed. Remove wrong headers check from some GTK+ API files. Remove the __WEBKIT_WEB_EXTENSION_H_INSIDE__ check since these are not actually shared. * UIProcess/API/gtk/WebKitEditorState.h: * UIProcess/API/gtk/WebKitOptionMenu.h: * UIProcess/API/gtk/WebKitPrintCustomWidget.h: 2017-06-15 Carlos Garcia Campos REGRESSION(r218325): [GTK] Runtime critical warnings running layout tests that show a popup menu https://bugs.webkit.org/show_bug.cgi?id=173421 Reviewed by Carlos Alberto Lopez Perez. In r218325 I forgot to create a WebKitPopupMenu or WebPopupMenuProxyGtk depending on whether the view is a WebKitWebView or not. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createPopupMenuProxy): 2017-06-15 Tim Horton Null deref under ViewGestureController::endSwipeGesture (navigationGestureDidEnd) https://bugs.webkit.org/show_bug.cgi?id=173441 Reviewed by Simon Fraser. This is a speculative fix for a crash that we don't have repro steps for. In a few places, ViewGestureController looks itself up by pageID (in cases where we're in an asynchronous callback), and then calls some function on it (endSwipeGesture, or something that will get there). However, if in the meantime an API client has turned the swipe gesture on and off, the page's ViewGestureController will be a different one than the one that originally started this process, with fresh state, and nullptrs in all sorts of places, ripe for dereferencing. To fix this, instead of just looking ViewGestureController up by pageID, also keep track of the current gestureID, process-wide (previously the gestureID was per-ViewGestureController), and only return the ViewGestureController if it's currently processing the same gesture that started the asynchronous task. * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::controllerForGesture): (WebKit::ViewGestureController::takeNextGestureID): (WebKit::ViewGestureController::willBeginGesture): (WebKit::ViewGestureController::didEndGesture): (WebKit::ViewGestureController::gestureControllerForPage): Deleted. * UIProcess/Cocoa/ViewGestureController.h: Add helpers that set and reset activeGestureType and currentGestureID together. Make gesture IDs process global, to avoid two ViewGestureControllers using the same IDs. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::didCollectGeometryForMagnificationGesture): (WebKit::ViewGestureController::handleMagnificationGestureEvent): (WebKit::ViewGestureController::endMagnificationGesture): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::forceRepaintIfNeeded): (WebKit::ViewGestureController::removeSwipeSnapshot): Adopt willBeginGesture/didEndGesture and controllerForGesture. 2017-06-15 Simon Fraser [iOS WK2] YouTube videos flash at the wrong place at the end of rotation https://bugs.webkit.org/show_bug.cgi?id=173445 rdar://problem/31584852 Reviewed by Tim Horton. In MobileSafari where WKWebView rotation uses _dynamicViewportUpdateModes, we could do a visibleContentRect update at the end of rotation which computed a bad layoutViewportRect, because it used a m_baseLayoutViewportSize from the old orientation. We have actually sent a new m_baseLayoutViewportSize to the UI process by this point in a layer tree commit, but _didCommitLayerTree: ignored it because we had a _dynamicViewportUpdateMode. Fix is to always update the layout viewport data from the web process, since during dynamic viewport updates, we still need these data to compute rectangles sent back to the web process via visible content rect updates. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect): (WebKit::WebPageProxy::updateLayoutViewportParameters): Cleanup. 2017-06-15 Wenson Hsieh Using -[WebItemProviderPasteboard setItemProviders:] to swap out item providers before a drop breaks item provider loading https://bugs.webkit.org/show_bug.cgi?id=173338 Reviewed by Tim Horton. Rename updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers. Also, introduce _webView:willPerformDropWithSession: as SPI on WKUIDelegate. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers): (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers): Deleted. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers): (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-06-15 Carlos Garcia Campos [GTK] Cleanup headers includes in GTK+ API files https://bugs.webkit.org/show_bug.cgi?id=173415 Reviewed by Michael Catanzaro. - Remove WTFGType.h from WebKitPrivate.h and include it in all other files instead of WebKitPrivate if needed. - Stop including WebKitPrivate.h in all other private headers. - Remove all C API includes. * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp: * UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h: * UIProcess/API/gtk/WebKitAutomationSession.cpp: * UIProcess/API/gtk/WebKitBackForwardList.cpp: * UIProcess/API/gtk/WebKitBackForwardListItem.cpp: * UIProcess/API/gtk/WebKitColorChooser.h: * UIProcess/API/gtk/WebKitColorChooserRequest.cpp: * UIProcess/API/gtk/WebKitContextMenu.cpp: * UIProcess/API/gtk/WebKitContextMenuItem.cpp: * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h: * UIProcess/API/gtk/WebKitContextMenuPrivate.h: * UIProcess/API/gtk/WebKitCookieManager.cpp: * UIProcess/API/gtk/WebKitCookieManagerPrivate.h: * UIProcess/API/gtk/WebKitCredentialPrivate.h: * UIProcess/API/gtk/WebKitDownload.cpp: * UIProcess/API/gtk/WebKitDownloadClient.cpp: * UIProcess/API/gtk/WebKitDownloadPrivate.h: * UIProcess/API/gtk/WebKitEditorState.cpp: * UIProcess/API/gtk/WebKitEditorStatePrivate.h: * UIProcess/API/gtk/WebKitError.cpp: * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: * UIProcess/API/gtk/WebKitFileChooserRequest.cpp: * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h: * UIProcess/API/gtk/WebKitFindController.cpp: * UIProcess/API/gtk/WebKitFormClient.cpp: * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp: * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h: * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp: * UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h: * UIProcess/API/gtk/WebKitHitTestResult.cpp: * UIProcess/API/gtk/WebKitHitTestResultPrivate.h: * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: * UIProcess/API/gtk/WebKitJavascriptResult.cpp: * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h: * UIProcess/API/gtk/WebKitMimeInfoPrivate.h: * UIProcess/API/gtk/WebKitNavigationActionPrivate.h: * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp: * UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h: * UIProcess/API/gtk/WebKitNetworkProxySettings.cpp: * UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h: * UIProcess/API/gtk/WebKitNotification.cpp: * UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp: * UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h: * UIProcess/API/gtk/WebKitNotificationPrivate.h: * UIProcess/API/gtk/WebKitOptionMenu.cpp: * UIProcess/API/gtk/WebKitPlugin.cpp: * UIProcess/API/gtk/WebKitPluginPrivate.h: * UIProcess/API/gtk/WebKitPolicyDecision.cpp: * UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h: * UIProcess/API/gtk/WebKitPrintCustomWidget.cpp: * UIProcess/API/gtk/WebKitPrintCustomWidgetPrivate.h: * UIProcess/API/gtk/WebKitPrintOperation.cpp: * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp: * UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h: * UIProcess/API/gtk/WebKitSecurityManager.cpp: * UIProcess/API/gtk/WebKitSecurityOrigin.cpp: * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h: * UIProcess/API/gtk/WebKitSettings.cpp: * UIProcess/API/gtk/WebKitUIClient.cpp: * UIProcess/API/gtk/WebKitURIRequest.cpp: * UIProcess/API/gtk/WebKitURIResponse.cpp: * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h: * UIProcess/API/gtk/WebKitUserContent.cpp: * UIProcess/API/gtk/WebKitUserContentManager.cpp: * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp: * UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h: * UIProcess/API/gtk/WebKitWebContext.cpp: * UIProcess/API/gtk/WebKitWebContextPrivate.h: * UIProcess/API/gtk/WebKitWebInspector.cpp: * UIProcess/API/gtk/WebKitWebInspectorPrivate.h: * UIProcess/API/gtk/WebKitWebResource.cpp: * UIProcess/API/gtk/WebKitWebResourcePrivate.h: * UIProcess/API/gtk/WebKitWebView.cpp: * UIProcess/API/gtk/WebKitWebViewBase.cpp: * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp: * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: * UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h: * UIProcess/API/gtk/WebKitWebsiteDataPrivate.h: * UIProcess/API/gtk/WebKitWindowProperties.cpp: * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h: * WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: 2017-06-15 Carlos Garcia Campos [GTK] Do not use the C API in WebGtkExtensionManager https://bugs.webkit.org/show_bug.cgi?id=173408 Reviewed by Michael Catanzaro. Use the C++ API instead. * WebProcess/gtk/WebGtkExtensionManager.cpp: (WebKit::parseUserData): (WebKit::WebGtkExtensionManager::initialize): * WebProcess/gtk/WebGtkExtensionManager.h: * WebProcess/gtk/WebGtkInjectedBundleMain.cpp: (WKBundleInitialize): 2017-06-15 Adrian Perez de Castro [GTK] Stop using GtkAction in WebPopupMenuProxyGtk https://bugs.webkit.org/show_bug.cgi?id=173417 Reviewed by Carlos Garcia Campos. This gets rid of GtkAction in WebPopupMenuProxyGtk, which was deprecated in GTK+ 3.10 and will not be available in GTK+ 4.0. Using GtkMenuItem directly makes populating long menus slightly faster, which can be noticeable in lower-end machines. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::populatePopupMenu): (WebKit::WebPopupMenuProxyGtk::menuItemActivated): (WebKit::WebPopupMenuProxyGtk::createGtkActionForMenuItem): Deleted. * UIProcess/gtk/WebPopupMenuProxyGtk.h: (WebKit::WebPopupMenuProxyGtk::setCurrentlySelectedMenuItem): Instantiate GtkMenuItem objects directly when populating the menu. 2017-06-15 Carlos Garcia Campos Unreviewed. Fix copy-paste error in GTK+ WEBKIT_JAVASCRIPT_ERROR definition. The print one was copied there. * UIProcess/API/gtk/WebKitError.h: 2017-06-15 Carlos Garcia Campos [GTK] Add API to allow overriding popup menus https://bugs.webkit.org/show_bug.cgi?id=172905 Reviewed by Michael Catanzaro. The GTK+ API uses GTK+ for the default implementation of several UI elements like the file chooser, print dialog, color picker, context menu, etc. but in all those cases it allows to override the default implementation. It's not possible to override the popup menu used for select elements. This patch adds WebKitOptionMenu to represent a select dropdown menu. It's passed as an argument of the new signal WebKitWebView::show-option-menu, and contains WebKitOptionMenuItem elements representing the items to be displayed. * PlatformGTK.cmake: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createPopupMenuProxy): Create a WebKitPopupMenu. * UIProcess/API/gtk/WebKitOptionMenu.cpp: Added. (webkitOptionMenuCreate): (webkit_option_menu_get_n_items): (webkit_option_menu_get_item): (webkit_option_menu_select_item): (webkit_option_menu_activate_item): (webkit_option_menu_close): * UIProcess/API/gtk/WebKitOptionMenu.h: Added. * UIProcess/API/gtk/WebKitOptionMenuItem.cpp: Added. (webkit_option_menu_item_copy): (webkit_option_menu_item_free): (webkit_option_menu_item_get_label): (webkit_option_menu_item_get_tooltip): (webkit_option_menu_item_is_group_label): (webkit_option_menu_item_is_group_child): (webkit_option_menu_item_is_enabled): (webkit_option_menu_item_is_selected): * UIProcess/API/gtk/WebKitOptionMenuItem.h: Added. * UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h: Added. (_WebKitOptionMenuItem::_WebKitOptionMenuItem): * UIProcess/API/gtk/WebKitOptionMenuPrivate.h: Added. * UIProcess/API/gtk/WebKitPopupMenu.cpp: Added. (WebKit::WebKitPopupMenu::WebKitPopupMenu): (WebKit::menuCloseCallback): (WebKit::WebKitPopupMenu::showPopupMenu): Call webkitWebViewShowOptionMenu() falling back to default implementation if the user didn't handle the signal. (WebKit::WebKitPopupMenu::hidePopupMenu): (WebKit::WebKitPopupMenu::cancelTracking): (WebKit::WebKitPopupMenu::selectItem): (WebKit::WebKitPopupMenu::activateItem): * UIProcess/API/gtk/WebKitPopupMenu.h: Added. * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewShowOptionMenu): Emit WebKitWebView::show-option-menu. * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols. * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add new get_type functions. * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new sections. * UIProcess/API/gtk/webkit2.h: Add new public headers. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk): Do not create the GtkMenu in constructor. (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Create the GtkMenu and connect to the signals here. (WebKit::WebPopupMenuProxyGtk::hidePopupMenu): Return early if the Gtk hasn't been shown. * UIProcess/gtk/WebPopupMenuProxyGtk.h: Make constructor and webview protected. 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage https://bugs.webkit.org/show_bug.cgi?id=173364 Reviewed by Michael Catanzaro. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkitWebPageCreate): (didInitiateLoadForResource): Deleted. (willSendRequestForFrame): Deleted. (didReceiveResponseForResource): Deleted. (didReceiveContentLengthForResource): Deleted. (didFinishLoadForResource): Deleted. (didFailLoadForResource): Deleted. 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::Client in WebKitWebExtension https://bugs.webkit.org/show_bug.cgi?id=173358 Reviewed by Michael Catanzaro. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (webkitWebExtensionCreate): (webkitWebExtensionPageCreated): Deleted. (webkitWebExtensionPageDestroy): Deleted. (webkitWebExtensionDidReceiveMessage): Deleted. (didCreatePage): Deleted. (willDestroyPage): Deleted. (didReceiveMessage): Deleted. (didReceiveMessageToPage): Deleted. 2017-06-15 Carlos Garcia Campos [GTK] Use API::NotificationProvider https://bugs.webkit.org/show_bug.cgi?id=173312 Reviewed by Žan Doberšek. Also cleanup a bit the WebKitNotificationProvider implementation, it doesn't need to be refcounted. * UIProcess/API/gtk/WebKitNotificationProvider.cpp: (WebKitNotificationProvider::WebKitNotificationProvider): (WebKitNotificationProvider::~WebKitNotificationProvider): (WebKitNotificationProvider::show): (WebKitNotificationProvider::clearNotifications): (WebKitNotificationProvider::notificationPermissions): (WebKitNotificationProvider::setNotificationPermissions): * UIProcess/API/gtk/WebKitNotificationProvider.h: * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (addOriginToMap): (webkit_web_context_initialize_notification_permissions): 2017-06-14 Carlos Garcia Campos Add API::InjectedBundle::ResourceLoadClient https://bugs.webkit.org/show_bug.cgi?id=173362 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h. (API::InjectedBundle::ResourceLoadClient::didInitiateLoadForResource): (API::InjectedBundle::ResourceLoadClient::willSendRequestForFrame): (API::InjectedBundle::ResourceLoadClient::didReceiveResponseForResource): (API::InjectedBundle::ResourceLoadClient::didReceiveContentLengthForResource): (API::InjectedBundle::ResourceLoadClient::didFinishLoadForResource): (API::InjectedBundle::ResourceLoadClient::didFailLoadForResource): (API::InjectedBundle::ResourceLoadClient::shouldCacheResponse): (API::InjectedBundle::ResourceLoadClient::shouldUseCredentialStorage): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetResourceLoadClient): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (setUpResourceLoadClient): (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp: (WebKit::InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient): (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame): (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource): (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource): (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::shouldCacheResponse): (WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage): * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebKit::WebFrameLoaderClient::dispatchWillSendRequest): (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse): (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): (WebKit::WebFrameLoaderClient::willCacheResponse): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInjectedBundleResourceLoadClient): (WebKit::WebPage::close): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::injectedBundleResourceLoadClient): 2017-06-14 Carlos Garcia Campos Add API::InjectedBundle::Client https://bugs.webkit.org/show_bug.cgi?id=173357 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h. (API::InjectedBundle::Client::didCreatePage): (API::InjectedBundle::Client::willDestroyPage): (API::InjectedBundle::Client::didInitializePageGroup): (API::InjectedBundle::Client::didReceiveMessage): (API::InjectedBundle::Client::didReceiveMessageToPage): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetClient): * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (webkitWebExtensionPageCreated): Deleted. (webkitWebExtensionPageDestroy): Deleted. (webkitWebExtensionDidReceiveMessage): Deleted. (didCreatePage): Deleted. (willDestroyPage): Deleted. (didReceiveMessage): Deleted. (didReceiveMessageToPage): Deleted. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setClient): (WebKit::InjectedBundle::didCreatePage): (WebKit::InjectedBundle::willDestroyPage): (WebKit::InjectedBundle::didInitializePageGroup): (WebKit::InjectedBundle::didReceiveMessage): (WebKit::InjectedBundle::didReceiveMessageToPage): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/InjectedBundle/InjectedBundleClient.cpp: (WebKit::InjectedBundleClient::InjectedBundleClient): (WebKit::InjectedBundleClient::didCreatePage): (WebKit::InjectedBundleClient::willDestroyPage): (WebKit::InjectedBundleClient::didInitializePageGroup): (WebKit::InjectedBundleClient::didReceiveMessage): (WebKit::InjectedBundleClient::didReceiveMessageToPage): * WebProcess/InjectedBundle/InjectedBundleClient.h: 2017-06-14 Carlos Garcia Campos WKErrorGetErrorCode should not return the API::Error enum values directly https://bugs.webkit.org/show_bug.cgi?id=173367 Reviewed by Alex Christensen. Even if the values are the same, we should use a switch to ensure we return the C API values, and not all API::Error enum values are exposed in the C API. * Shared/API/c/WKErrorRef.cpp: (WKErrorGetErrorCode): 2017-06-14 Commit Queue Unreviewed, rolling out r218285. https://bugs.webkit.org/show_bug.cgi?id=173391 API test fails on iOS (Requested by alexchristensen on #webkit). Reverted changeset: "Add SPI for immediate injection of user scripts" https://bugs.webkit.org/show_bug.cgi?id=173342 http://trac.webkit.org/changeset/218285 2017-06-14 Commit Queue Unreviewed, rolling out r218267. https://bugs.webkit.org/show_bug.cgi?id=173390 "The previous rollout of r218263, r218265, and r218266 by mlewis13 on bug 173383 missed r218267 and broke the GTK+ build" (Requested by clopez_ on #webkit). Reverted changeset: "[GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage" https://bugs.webkit.org/show_bug.cgi?id=173364 http://trac.webkit.org/changeset/218267 2017-06-14 Chris Dumez WebKit falsely reports that a web process is unresponsive if you close a page shortly after stopping a load https://bugs.webkit.org/show_bug.cgi?id=173384 Reviewed by Dan Bernstein. WebKit falsely reports that a web process is unresponsive if you close a page shortly after stopping a load. This is because WebPageProxy::stopLoad() starts the responsiveness timer and expects a StopResponsinessTimer IPC from the WebProcess to stop the timer so we don't report the process as unresponsive. However, if WebPageProxy::close() is called before the StopResponsinessTimer IPC has been received, the page will remove itself from the message receiver map and we would no longer be able to receive the StopResponsinessTimer IPC and stop the timer, even if the WebProcess sent it to the UIProcess. To address the issue, we now send the IPC Message to the WebProcessProxy instead of the WebPageProxy, so we can stop the responsiveness timer, even after the WebPageProxy has been called. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::stopResponsivenessTimer): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::SendStopResponsivenessTimer::~SendStopResponsivenessTimer): (WebKit::WebPage::tryClose): (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::stopLoading): (WebKit::WebPage::reload): (WebKit::WebPage::goForward): (WebKit::WebPage::goBack): (WebKit::WebPage::goToBackForwardItem): 2017-06-14 Commit Queue Unreviewed, rolling out r218263, r218265, and r218266. https://bugs.webkit.org/show_bug.cgi?id=173383 "These revisions caused multiple API test to Time out on macOS" (Requested by mlewis13 on #webkit). Reverted changesets: "Add API::InjectedBundle::Client" https://bugs.webkit.org/show_bug.cgi?id=173357 http://trac.webkit.org/changeset/218263 "[GTK] Use API::InjectedBundle::Client in WebKitWebExtension" https://bugs.webkit.org/show_bug.cgi?id=173358 http://trac.webkit.org/changeset/218265 "Add API::InjectedBundle::ResourceLoadClient" https://bugs.webkit.org/show_bug.cgi?id=173362 http://trac.webkit.org/changeset/218266 2017-06-14 Brent Fulgham [WK2][iOS] Remove dead-code "import "removed-dev-nodes.sb” from sandboxes (173378) https://bugs.webkit.org/show_bug.cgi?id=173378 Reviewed by Alexey Proskuryakov. Clean up the sandboxes to remove a couple of dead functions (and imports): 1. Remove the import "removed-dev-nodes.sb" from the sandbox, since this file is now empty. 2. Also remove the call to "instruments-support" as this is a no-op function in modern iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-06-14 Alex Christensen Add SPI for immediate injection of user scripts https://bugs.webkit.org/show_bug.cgi?id=173342 Reviewed by Brady Eidson. * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupAddUserScript): * UIProcess/API/C/WKUserContentControllerRef.cpp: (WKUserContentControllerAddUserScript): * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addUserScript:]): (-[WKUserContentController _addUserScriptImmediately:]): * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addUserScript): * UIProcess/UserContent/WebUserContentControllerProxy.h: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addUserScripts): (WebKit::WebUserContentController::addUserScriptInternal): If we are to inject the script internally, inject it into the appropriate pages. If we're injecting into the top frame only, there's no need to traverse the frame tree. (WebKit::WebUserContentController::addUserScript): * WebProcess/UserContent/WebUserContentController.h: * WebProcess/UserContent/WebUserContentController.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2017-06-14 Jonathan Bedard Configure screen scale for running layout tests on plus devices https://bugs.webkit.org/show_bug.cgi?id=173319 Reviewed by Tim Horton. * Platform/spi/ios/UIKitSPI.h: Both this and UIKitTestSPI.h define UIKeyboard. Use a define guard to prevent re-definition. 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage https://bugs.webkit.org/show_bug.cgi?id=173364 Reviewed by Michael Catanzaro. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkitWebPageCreate): (didInitiateLoadForResource): Deleted. (willSendRequestForFrame): Deleted. (didReceiveResponseForResource): Deleted. (didReceiveContentLengthForResource): Deleted. (didFinishLoadForResource): Deleted. (didFailLoadForResource): Deleted. 2017-06-14 Carlos Garcia Campos Add API::InjectedBundle::ResourceLoadClient https://bugs.webkit.org/show_bug.cgi?id=173362 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h. (API::InjectedBundle::ResourceLoadClient::didInitiateLoadForResource): (API::InjectedBundle::ResourceLoadClient::willSendRequestForFrame): (API::InjectedBundle::ResourceLoadClient::didReceiveResponseForResource): (API::InjectedBundle::ResourceLoadClient::didReceiveContentLengthForResource): (API::InjectedBundle::ResourceLoadClient::didFinishLoadForResource): (API::InjectedBundle::ResourceLoadClient::didFailLoadForResource): (API::InjectedBundle::ResourceLoadClient::shouldCacheResponse): (API::InjectedBundle::ResourceLoadClient::shouldUseCredentialStorage): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetResourceLoadClient): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (setUpResourceLoadClient): (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp: (WebKit::InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient): (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame): (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource): (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource): (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource): (WebKit::InjectedBundlePageResourceLoadClient::shouldCacheResponse): (WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage): * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebKit::WebFrameLoaderClient::dispatchWillSendRequest): (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage): (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse): (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): (WebKit::WebFrameLoaderClient::willCacheResponse): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInjectedBundleResourceLoadClient): (WebKit::WebPage::close): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::injectedBundleResourceLoadClient): 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::Client in WebKitWebExtension https://bugs.webkit.org/show_bug.cgi?id=173358 Reviewed by Michael Catanzaro. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (webkitWebExtensionCreate): (webkitWebExtensionPageCreated): Deleted. (webkitWebExtensionPageDestroy): Deleted. (webkitWebExtensionDidReceiveMessage): Deleted. (didCreatePage): Deleted. (willDestroyPage): Deleted. (didReceiveMessage): Deleted. (didReceiveMessageToPage): Deleted. 2017-06-14 Carlos Garcia Campos Add API::InjectedBundle::Client https://bugs.webkit.org/show_bug.cgi?id=173357 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h. (API::InjectedBundle::Client::didCreatePage): (API::InjectedBundle::Client::willDestroyPage): (API::InjectedBundle::Client::didInitializePageGroup): (API::InjectedBundle::Client::didReceiveMessage): (API::InjectedBundle::Client::didReceiveMessageToPage): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetClient): * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (webkitWebExtensionPageCreated): Deleted. (webkitWebExtensionPageDestroy): Deleted. (webkitWebExtensionDidReceiveMessage): Deleted. (didCreatePage): Deleted. (willDestroyPage): Deleted. (didReceiveMessage): Deleted. (didReceiveMessageToPage): Deleted. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setClient): (WebKit::InjectedBundle::didCreatePage): (WebKit::InjectedBundle::willDestroyPage): (WebKit::InjectedBundle::didInitializePageGroup): (WebKit::InjectedBundle::didReceiveMessage): (WebKit::InjectedBundle::didReceiveMessageToPage): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/InjectedBundle/InjectedBundleClient.cpp: (WebKit::InjectedBundleClient::InjectedBundleClient): (WebKit::InjectedBundleClient::didCreatePage): (WebKit::InjectedBundleClient::willDestroyPage): (WebKit::InjectedBundleClient::didInitializePageGroup): (WebKit::InjectedBundleClient::didReceiveMessage): (WebKit::InjectedBundleClient::didReceiveMessageToPage): * WebProcess/InjectedBundle/InjectedBundleClient.h: 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundleClient in WebKitInjectedBundleClient https://bugs.webkit.org/show_bug.cgi?id=173351 Reviewed by Michael Catanzaro. Instead of the C API. * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp: (attachInjectedBundleClientToContext): (didReceiveWebViewMessageFromInjectedBundle): Deleted. (didReceiveMessageFromInjectedBundle): Deleted. (getInjectedBundleInitializationUserData): Deleted. 2017-06-14 Carlos Garcia Campos Add API::InjectedBundleClient https://bugs.webkit.org/show_bug.cgi?id=173350 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * UIProcess/API/APIInjectedBundleClient.h: Copied from Source/WebKit2/UIProcess/WebContextInjectedBundleClient.h. (API::InjectedBundleClient::didReceiveMessageFromInjectedBundle): (API::InjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle): (API::InjectedBundleClient::getInjectedBundleInitializationUserData): * UIProcess/API/C/WKContext.cpp: (WKContextSetInjectedBundleClient): * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextDispose): * UIProcess/WebContextInjectedBundleClient.cpp: (WebKit::WebContextInjectedBundleClient::WebContextInjectedBundleClient): (WebKit::WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle): (WebKit::WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle): (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData): * UIProcess/WebContextInjectedBundleClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::setInjectedBundleClient): (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::handleMessage): (WebKit::WebProcessPool::handleSynchronousMessage): * UIProcess/WebProcessPool.h: * WebKit2.xcodeproj/project.pbxproj: 2017-06-14 Carlos Garcia Campos Add API::NotificationProvider https://bugs.webkit.org/show_bug.cgi?id=173309 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * UIProcess/API/APINotificationProvider.h: Copied from Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.h. (API::NotificationProvider::show): (API::NotificationProvider::cancel): (API::NotificationProvider::didDestroyNotification): (API::NotificationProvider::clearNotifications): (API::NotificationProvider::addNotificationManager): (API::NotificationProvider::removeNotificationManager): (API::NotificationProvider::notificationPermissions): * UIProcess/API/C/WKNotificationManager.cpp: (WKNotificationManagerSetProvider): * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy): (WebKit::WebNotificationManagerProxy::setProvider): (WebKit::WebNotificationManagerProxy::processPoolDestroyed): (WebKit::WebNotificationManagerProxy::notificationPermissions): (WebKit::WebNotificationManagerProxy::show): (WebKit::WebNotificationManagerProxy::cancel): (WebKit::WebNotificationManagerProxy::didDestroyNotification): (WebKit::WebNotificationManagerProxy::clearNotifications): * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/Notifications/WebNotificationProvider.cpp: (WebKit::WebNotificationProvider::WebNotificationProvider): (WebKit::WebNotificationProvider::show): (WebKit::WebNotificationProvider::cancel): (WebKit::WebNotificationProvider::didDestroyNotification): (WebKit::WebNotificationProvider::addNotificationManager): (WebKit::WebNotificationProvider::removeNotificationManager): (WebKit::WebNotificationProvider::notificationPermissions): * UIProcess/Notifications/WebNotificationProvider.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * WebKit2.xcodeproj/project.pbxproj: 2017-06-14 Carlos Garcia Campos API clients should not be passed by value to the setters https://bugs.webkit.org/show_bug.cgi?id=173266 Reviewed by Alex Christensen. By using a rvalue reference we make it more explicit that the ownership is transferred and we avoid the parameter construction. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setClient): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::setProvider): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::setClient): * UIProcess/WebIconDatabase.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::setHistoryClient): (WebKit::WebPageProxy::setNavigationClient): (WebKit::WebPageProxy::setLoaderClient): (WebKit::WebPageProxy::setPolicyClient): (WebKit::WebPageProxy::setFormClient): (WebKit::WebPageProxy::setUIClient): (WebKit::WebPageProxy::setIconLoadingClient): (WebKit::WebPageProxy::setFindClient): (WebKit::WebPageProxy::setFindMatchesClient): (WebKit::WebPageProxy::setDiagnosticLoggingClient): (WebKit::WebPageProxy::setContextMenuClient): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::setFullscreenClient): (WebKit::WebPageProxy::getLoadDecisionForIcon): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setHistoryClient): (WebKit::WebProcessPool::setDownloadClient): (WebKit::WebProcessPool::setAutomationClient): * UIProcess/WebProcessPool.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInjectedBundleContextMenuClient): (WebKit::WebPage::setInjectedBundleEditorClient): (WebKit::WebPage::setInjectedBundleFormClient): (WebKit::WebPage::setInjectedBundlePageLoaderClient): (WebKit::WebPage::setInjectedBundleUIClient): * WebProcess/WebPage/WebPage.h: 2017-06-14 Carlos Garcia Campos [GTK] Use API::InjectedBundle::EditorClient in WebKitWebEditor https://bugs.webkit.org/show_bug.cgi?id=173355 Reviewed by Žan Doberšek. Instead of the C API. * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: (webkitWebEditorCreate): (didChangeSelection): Deleted. 2017-06-14 Carlos Garcia Campos Unreviewed. Fix GTK+ build with GCC 4.9 after r218244. It seems that GCC 4.9 gets confused by enum named General and value of Print enum named General too. This renames the Print enum value as Generic. * Shared/API/APIError.h: * Shared/gtk/WebErrorsGtk.cpp: (WebKit::printError): * UIProcess/API/gtk/WebKitPrivate.cpp: (toWebKitError): (toWebCoreError): 2017-06-13 Carlos Garcia Campos Do not mix C and C++ API error constants https://bugs.webkit.org/show_bug.cgi?id=173311 Reviewed by Alex Christensen. In r214934 I added error constants to API::Error, but not for all errors exposed in the C API. Because of this we are mixing both constants in WebErrors and in GTk+ WebKitPrivate. * Shared/API/APIError.h: * Shared/WebErrors.cpp: (WebKit::blockedError): (WebKit::blockedByContentBlockerError): (WebKit::cannotShowURLError): (WebKit::interruptedForPolicyChangeError): (WebKit::blockedByContentFilterError): (WebKit::cannotShowMIMETypeError): (WebKit::pluginWillHandleLoadError): (WebKit::internalError): * UIProcess/API/gtk/WebKitPrivate.cpp: (toWebKitError): (toWebCoreError): 2017-06-13 Matt Rajca WebsitePolicies: let clients select specific autoplay quirks https://bugs.webkit.org/show_bug.cgi?id=173343 Reviewed by Alex Christensen. Replace the 'allowsAutoplayQuirks' bool with an OptionSet so clients can selectively pick auto-play quirks. * Shared/WebsitePolicies.h: (WebKit::WebsitePolicies::encode): (WebKit::WebsitePolicies::decode): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): (WKWebsitePoliciesGetAllowedAutoplayQuirks): (WKWebsitePoliciesSetAllowsAutoplayQuirks): Deleted. (WKWebsitePoliciesGetAllowsAutoplayQuirks): Deleted. * UIProcess/API/C/WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): (-[_WKWebsitePolicies allowedAutoplayQuirks]): (-[_WKWebsitePolicies setAllowsAutoplayQuirks:]): Deleted. (-[_WKWebsitePolicies allowsAutoplayQuirks]): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateWebsitePolicies): 2017-06-13 Wenson Hsieh Add missing availability declarations to SPI in WKUIDelegatePrivate.h https://bugs.webkit.org/show_bug.cgi?id=173336 Reviewed by Tim Horton. Add missing availability macros to two recently-introduced SPI delegate methods. No change in behavior. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-06-13 Chris Dumez Add API::InjectedBundle::PageLoaderClient https://bugs.webkit.org/show_bug.cgi?id=173265 Reviewed by Alex Christensen. Add missing null check that is causing crashes on iOS. * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::userAgentForURL): 2017-06-13 Brent Fulgham [WK2][macOS] Allow AppleEvents in Citrix View Plugin https://bugs.webkit.org/show_bug.cgi?id=173280 Reviewed by Alexey Proskuryakov. A slightly better fix: Allow AppleEvents for non-sandboxed plugins. This should avoid inadvertently breaking custom plugins, etc. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): Switch check from a specific Citrix test, to just allowing non-sandboxed plugins to use AppleEvents. 2017-06-13 Chris Dumez Include PID in some UIProcess-side release logging that relates to a particular WebProcess https://bugs.webkit.org/show_bug.cgi?id=173299 Reviewed by Ryosuke Niwa. * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::setResponsive): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedCPULimit): 2017-06-13 Daniel Bates Implement W3C Secure Contexts Draft Specification https://bugs.webkit.org/show_bug.cgi?id=158121 Reviewed by Brent Fulgham. Part 4 Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetIsSecureContextAttributeEnabled): (WKPreferencesGetIsSecureContextAttributeEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-13 Brent Fulgham [WK2][macOS] Allow AppleEvents in Citrix View Plugin https://bugs.webkit.org/show_bug.cgi?id=173280 Reviewed by Alexey Proskuryakov. Allow the Citrix Viewer plugin to issue Apple Events. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): Allow AppleEvents for the Citrix Viewer plugin. 2017-06-13 Carlos Garcia Campos [GTK] Blob download doesn't work https://bugs.webkit.org/show_bug.cgi?id=172442 Reviewed by Carlos Alberto Lopez Perez. GTK+ API uses URIs for download destination paths, and passes that URIs to the WebKit internals. But WebKit expects download destination location to be a local path. This is not a problem for normal downloads, because the soup backend handles the cases of download destination being a URI and a path. For blob downloads NetworkDataTaskBlob is used, and it always expects the download destination to be a local path, failing in FileSystem::openFile() when a URI is passed. We need to keep using local files internally and convert to URIs only when exposing those paths to the API. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::download): Stop handling URIs here, we should always expect local files. * UIProcess/API/gtk/WebKitDownload.cpp: (webkitDownloadDecideDestinationWithSuggestedFilename): Convert destination URI to filanme before pasing it to DownloadClient. (webkitDownloadDestinationCreated): Convert the destination path to a URI before passing it to WebKitDownload::created-destionation signal. * UIProcess/API/gtk/WebKitDownloadClient.cpp: * UIProcess/API/gtk/WebKitDownloadPrivate.h: 2017-06-13 Wenson Hsieh Unable to paste text that was copied from a page into the universal search field https://bugs.webkit.org/show_bug.cgi?id=173293 Reviewed by Ryosuke Niwa. Add boilerplate SPI on WKPreferences to enable JavaScript access to copy and paste. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setJavaScriptCanAccessClipboard:]): (-[WKPreferences _javaScriptCanAccessClipboard]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-06-13 Sam Weinig Rename JSDOMWindowShell to JSDOMWindowProxy to match the HTML5 spec. https://bugs.webkit.org/show_bug.cgi?id=80733 Reviewed by Chris Dumez. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::windowScriptNPObject): 2017-06-13 Carlos Garcia Campos Unreviewed. Remove unused code from GTK+ WebKitPrivate. * UIProcess/API/gtk/WebKitPrivate.cpp: (wkEventModifiersToGdkModifiers): Deleted. (wkEventMouseButtonToWebKitMouseButton): Deleted. * UIProcess/API/gtk/WebKitPrivate.h: 2017-06-13 Carlos Garcia Campos Unreviewed. Fix return value of PageLoaderClient::shouldGoToBackForwardListItem after r218164. It should return true as InjectedBundlePageLoaderClient does. This caused several timeouts in GTK+ unit tests after r218171. * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: (API::InjectedBundle::PageLoaderClient::shouldGoToBackForwardListItem): 2017-06-13 Carlos Garcia Campos [GTK] Use API::GeolocationProvider in WebKitGeolocationProvider https://bugs.webkit.org/show_bug.cgi?id=173151 Reviewed by Žan Doberšek. Also cleanup a bit the WebKitGeolocationProvider implementation, it doesn't need to be refcounted. * UIProcess/API/gtk/WebKitGeolocationProvider.cpp: (WebKit::GeolocationProvider::GeolocationProvider): (WebKit::WebKitGeolocationProvider::~WebKitGeolocationProvider): (WebKit::WebKitGeolocationProvider::WebKitGeolocationProvider): (toGeolocationProvider): Deleted. (startUpdatingCallback): Deleted. (stopUpdatingCallback): Deleted. (WebKitGeolocationProvider::~WebKitGeolocationProvider): Deleted. (WebKitGeolocationProvider::create): Deleted. (WebKitGeolocationProvider::WebKitGeolocationProvider): Deleted. (WebKitGeolocationProvider::startUpdating): Deleted. (WebKitGeolocationProvider::stopUpdating): Deleted. (WebKitGeolocationProvider::notifyPositionChanged): Deleted. (WebKitGeolocationProvider::notifyErrorOccurred): Deleted. * UIProcess/API/gtk/WebKitGeolocationProvider.h: * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): 2017-06-13 Carlos Garcia Campos [GTK] Use API::IconDatabaseClient in WebKitFaviconDatabase https://bugs.webkit.org/show_bug.cgi?id=173146 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate): (webkitFaviconDatabaseCreate): (didChangeIconForPageURLCallback): Deleted. (iconDataReadyForPageURLCallback): Deleted. 2017-06-13 Carlos Garcia Campos [GTK] Use API::InjectedBundle::PageLoaderClient in WebKitWebPage https://bugs.webkit.org/show_bug.cgi?id=173304 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkitWebPageCreate): (getDocumentLoaderURL): Deleted. (didStartProvisionalLoadForFrame): Deleted. (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted. (didSameDocumentNavigationForFrame): Deleted. (didCommitLoadForFrame): Deleted. (didFinishDocumentLoadForFrame): Deleted. (didClearWindowObjectForFrame): Deleted. 2017-06-13 Gwang Yoon Hwang [GStreamerGL] Release GstVideoFrame when there is a flush event from the pipeline https://bugs.webkit.org/show_bug.cgi?id=172427 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::texmapGL): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: Provides current texmapGL to platform layer proxies to create and copy bitmap textures. 2017-06-13 Youenn Fablet Switch off Legacy WebRTC API flag by default https://bugs.webkit.org/show_bug.cgi?id=173241 Reviewed by Sam Weinig. * Shared/WebPreferencesDefinitions.h: 2017-06-12 Carlos Garcia Campos Add API::GeolocationProvider https://bugs.webkit.org/show_bug.cgi?id=173150 Reviewed by Alex Christensen. It will be used by GTK+ port instead of the C API. * UIProcess/API/APIGeolocationProvider.h: Added. (API::GeolocationProvider::~GeolocationProvider): (API::GeolocationProvider::startUpdating): (API::GeolocationProvider::stopUpdating): (API::GeolocationProvider::setEnableHighAccuracy): * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerSetProvider): * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy): (WebKit::WebGeolocationManagerProxy::setProvider): (WebKit::WebGeolocationManagerProxy::processPoolDestroyed): (WebKit::WebGeolocationManagerProxy::startUpdating): (WebKit::WebGeolocationManagerProxy::removeRequester): (WebKit::WebGeolocationManagerProxy::setEnableHighAccuracy): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebGeolocationProvider.cpp: (WebKit::WebGeolocationProvider::WebGeolocationProvider): (WebKit::WebGeolocationProvider::startUpdating): (WebKit::WebGeolocationProvider::stopUpdating): (WebKit::WebGeolocationProvider::setEnableHighAccuracy): * UIProcess/WebGeolocationProvider.h: * WebKit2.xcodeproj/project.pbxproj: 2017-06-12 Carlos Garcia Campos Add API::InjectedBundle::PageLoaderClient https://bugs.webkit.org/show_bug.cgi?id=173265 Reviewed by Alex Christensen. It will be used by the GTK+ port instead of the C API. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: Added. (API::InjectedBundle::PageLoaderClient::willLoadURLRequest): (API::InjectedBundle::PageLoaderClient::willLoadDataRequest): (API::InjectedBundle::PageLoaderClient::shouldGoToBackForwardListItem): (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame): (API::InjectedBundle::PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): (API::InjectedBundle::PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): (API::InjectedBundle::PageLoaderClient::didCommitLoadForFrame): (API::InjectedBundle::PageLoaderClient::didFinishDocumentLoadForFrame): (API::InjectedBundle::PageLoaderClient::didFinishLoadForFrame): (API::InjectedBundle::PageLoaderClient::didFinishProgress): (API::InjectedBundle::PageLoaderClient::didFailLoadWithErrorForFrame): (API::InjectedBundle::PageLoaderClient::didSameDocumentNavigationForFrame): (API::InjectedBundle::PageLoaderClient::didReceiveTitleForFrame): (API::InjectedBundle::PageLoaderClient::didRemoveFrameFromHierarchy): (API::InjectedBundle::PageLoaderClient::didDisplayInsecureContentForFrame): (API::InjectedBundle::PageLoaderClient::didRunInsecureContentForFrame): (API::InjectedBundle::PageLoaderClient::didDetectXSSForFrame): (API::InjectedBundle::PageLoaderClient::didFirstLayoutForFrame): (API::InjectedBundle::PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): (API::InjectedBundle::PageLoaderClient::didLayoutForFrame): (API::InjectedBundle::PageLoaderClient::didReachLayoutMilestone): (API::InjectedBundle::PageLoaderClient::didClearWindowObjectForFrame): (API::InjectedBundle::PageLoaderClient::didCancelClientRedirectForFrame): (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame): (API::InjectedBundle::PageLoaderClient::didHandleOnloadEventsForFrame): (API::InjectedBundle::PageLoaderClient::globalObjectIsAvailableForFrame): (API::InjectedBundle::PageLoaderClient::willDisconnectDOMWindowExtensionFromGlobalObject): (API::InjectedBundle::PageLoaderClient::didReconnectDOMWindowExtensionToGlobalObject): (API::InjectedBundle::PageLoaderClient::willDestroyGlobalObjectForDOMWindowExtension): (API::InjectedBundle::PageLoaderClient::shouldForceUniversalAccessFromLocalURL): (API::InjectedBundle::PageLoaderClient::featuresUsedInPage): (API::InjectedBundle::PageLoaderClient::willDestroyFrame): (API::InjectedBundle::PageLoaderClient::userAgentForURL): (API::InjectedBundle::PageLoaderClient::layoutMilestones): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetPageLoaderClient): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::InjectedBundlePageLoaderClient): (WebKit::InjectedBundlePageLoaderClient::willLoadURLRequest): (WebKit::InjectedBundlePageLoaderClient::willLoadDataRequest): (WebKit::InjectedBundlePageLoaderClient::shouldGoToBackForwardListItem): (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didFailProvisionalLoadWithErrorForFrame): (WebKit::InjectedBundlePageLoaderClient::didCommitLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didFinishLoadForFrame): (WebKit::InjectedBundlePageLoaderClient::didFinishProgress): (WebKit::InjectedBundlePageLoaderClient::didFailLoadWithErrorForFrame): (WebKit::InjectedBundlePageLoaderClient::didSameDocumentNavigationForFrame): (WebKit::InjectedBundlePageLoaderClient::didReceiveTitleForFrame): (WebKit::InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy): (WebKit::InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame): (WebKit::InjectedBundlePageLoaderClient::didRunInsecureContentForFrame): (WebKit::InjectedBundlePageLoaderClient::didDetectXSSForFrame): (WebKit::InjectedBundlePageLoaderClient::didFirstLayoutForFrame): (WebKit::InjectedBundlePageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): (WebKit::InjectedBundlePageLoaderClient::didLayoutForFrame): (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone): (WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame): (WebKit::InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame): (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame): (WebKit::InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame): (WebKit::InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame): (WebKit::InjectedBundlePageLoaderClient::willDisconnectDOMWindowExtensionFromGlobalObject): (WebKit::InjectedBundlePageLoaderClient::didReconnectDOMWindowExtensionToGlobalObject): (WebKit::InjectedBundlePageLoaderClient::willDestroyGlobalObjectForDOMWindowExtension): (WebKit::InjectedBundlePageLoaderClient::shouldForceUniversalAccessFromLocalURL): (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage): (WebKit::InjectedBundlePageLoaderClient::userAgentForURL): (WebKit::InjectedBundlePageLoaderClient::layoutMilestones): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::detachedFromParent2): (WebKit::WebFrameLoaderClient::dispatchDidDispatchOnloadEvents): (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailLoad): (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad): (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone): (WebKit::WebFrameLoaderClient::dispatchDidLayout): (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem): (WebKit::WebFrameLoaderClient::didDisplayInsecureContent): (WebKit::WebFrameLoaderClient::didRunInsecureContent): (WebKit::WebFrameLoaderClient::didDetectXSS): (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld): (WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable): (WebKit::WebFrameLoaderClient::dispatchWillDisconnectDOMWindowExtensionFromGlobalObject): (WebKit::WebFrameLoaderClient::dispatchDidReconnectDOMWindowExtensionToGlobalObject): (WebKit::WebFrameLoaderClient::dispatchWillDestroyGlobalObjectForDOMWindowExtension): (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL): * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: (WebKit::WebProgressTrackerClient::progressFinished): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInjectedBundlePageLoaderClient): (WebKit::WebPage::close): (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::userAgent): (WebKit::WebPage::reportUsedFeatures): (WebKit::WebPage::dispatchDidReachLayoutMilestone): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::injectedBundleLoaderClient): 2017-06-12 Simon Fraser [iOS WK2] Peeking on an image could result in a preview at the wrong size https://bugs.webkit.org/show_bug.cgi?id=173274 rdar://problem/30404627 Reviewed by Tim Horton. There were a couple of issues with the way the page scale is communicated between the web process and the UI process. Generally, the page scale is computed by the web process, and sent to the UI process via layer tree commits. UI-side scale is them communicated back to the web process via visibleContentRect updates. When receiving a new scale, WebPage has a "scale was set by the UI process" flag to handle the case where user interaction overrides the viewport-computed page scale. However, this flag would get set erroneously in a couple of situations. First, during page loading, layer flushing is suspended temporarily, so web process scale changes never make it to the UI process. In that scenario, the UI process could send an old scale back to the web process, setting the "scale was set by the UI process" when it really wasn't. Secondly, web -> UI layer commit messages, and UI -> web updateVisibleContentRect messages can be in flight at the same time, again causing a stale scale to reach the web process. Fix this by only setting the "scale was set by the UI process" when we know the UI scale should be in sync, by comparing commit IDs of sent and received scales. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::scaleFromUIProcess): (WebKit::WebPage::updateVisibleContentRects): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: (WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID): 2017-06-12 Alex Christensen Modernize UserScript.h https://bugs.webkit.org/show_bug.cgi?id=173273 Reviewed by Tim Horton. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupAddUserScript): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::addUserScript): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addUserScript): * WebProcess/WebPage/WebPage.h: 2017-06-12 Tim Horton [iOS] Cmd-C doesn't copy text from WKWebView https://bugs.webkit.org/show_bug.cgi?id=173277 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _lookupForWebView:]): (-[WKContentView _shareForWebView:]): (-[WKContentView _addShortcutForWebView:]): (-[WKContentView _promptForReplaceForWebView:]): (-[WKContentView _transliterateChineseForWebView:]): (-[WKContentView _reanalyzeForWebView:]): (-[WKContentView replaceForWebView:]): (-[WKContentView canPerformAction:withSender:]): (-[WKContentView copyForWebView:]): (-[WKContentView cutForWebView:]): (-[WKContentView pasteForWebView:]): (-[WKContentView selectForWebView:]): (-[WKContentView selectAllForWebView:]): (-[WKContentView toggleBoldfaceForWebView:]): (-[WKContentView toggleItalicsForWebView:]): (-[WKContentView toggleUnderlineForWebView:]): (-[WKContentView _showTextStyleOptionsForWebView:]): (-[WKContentView _defineForWebView:]): (-[WKContentView _arrowKeyForWebView:]): (-[WKContentView _lookup:]): Deleted. (-[WKContentView _share:]): Deleted. (-[WKContentView _addShortcut:]): Deleted. (-[WKContentView _promptForReplace:]): Deleted. (-[WKContentView _transliterateChinese:]): Deleted. (-[WKContentView _reanalyze:]): Deleted. (-[WKContentView replace:]): Deleted. (-[WKContentView copy:]): Deleted. (-[WKContentView cut:]): Deleted. (-[WKContentView paste:]): Deleted. (-[WKContentView select:]): Deleted. (-[WKContentView selectAll:]): Deleted. (-[WKContentView toggleBoldface:]): Deleted. (-[WKContentView toggleItalics:]): Deleted. (-[WKContentView toggleUnderline:]): Deleted. (-[WKContentView _showTextStyleOptions:]): Deleted. (-[WKContentView _define:]): Deleted. (-[WKContentView _arrowKey:]): Deleted. Similar to what r211897 did for canPerformAction, and other patches have done for other selectors, forward methods for standard editing commands from WKContentView up to WKWebView, and back down to WKContentView. This is necessary because these are not treated as normal responder-chain-respecting methods, so they do not bubble up the view tree. In 211897, WKContentView (who is usually first responder and thus receives the actions) stopped claiming to be able to perform these actions, depending on this non-existent bubbling behavior to keep them working. 2017-06-12 Chris Dumez Null dereference under WebProcessPool::pageRemovedFromProcess() https://bugs.webkit.org/show_bug.cgi?id=173271 Reviewed by Ryosuke Niwa. Null-check networkProcess() before dereferencing it in WebProcessPool::pageRemovedFromProcess(). This is the only place in this class where we failed to null check before dereferencing networkProcess(). To my knowledge, there is no guarantee there is a network process. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageRemovedFromProcess): 2017-06-12 Jiewen Tan [WebCrypto] Remove experimental feature flag of SubtleCrypto https://bugs.webkit.org/show_bug.cgi?id=173197 Reviewed by Brent Fulgham. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubtleCryptoEnabled): Deleted. (WKPreferencesGetSubtleCryptoEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-12 Wenson Hsieh [iOS DnD] Allow the injected bundle to add client data when writing an image to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=173238 Reviewed by Ryosuke Niwa and Tim Horton. Send PasteboardImage.clientTypes and PasteboardImage.clientData over IPC. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeClientTypesAndData): (IPC::decodeClientTypesAndData): Factor out common logic used to encode and decode client types and data into static helpers. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-06-12 Wenson Hsieh [iOS DnD] Introduce hooks to override targeted drag previews when lifting and cancelling https://bugs.webkit.org/show_bug.cgi?id=173240 Reviewed by Ryosuke Niwa and Tim Horton. Adds two new delegate hooks: _webView:previewForLiftingItem:session: and _webView:previewForCancellingItem:withDefault:. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-06-12 Chris Dumez Regression(r217867): Legacy SessionHistoryEntryData format should not change https://bugs.webkit.org/show_bug.cgi?id=173267 Reviewed by Simon Fraser. Revert changes to Legacy SessionHistoryEntryData format that were made in r217867, as this apparently breaks compatiblity. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeFrameStateNode): (WebKit::decodeBackForwardTreeNode): 2017-06-12 Brent Fulgham [WK2][macOS] Alow iokit-get-properties for additional media features https://bugs.webkit.org/show_bug.cgi?id=173082 Reviewed by Alex Christensen. * WebProcess/com.apple.WebProcess.sb.in: 2017-06-12 Carlos Garcia Campos Add API::IconDatabaseClient https://bugs.webkit.org/show_bug.cgi?id=173145 Reviewed by Alex Christensen. It will be used by GTK+ port instead of the C API. * UIProcess/API/APIIconDatabaseClient.h: (API::IconDatabaseClient::~IconDatabaseClient): (API::IconDatabaseClient::didChangeIconForPageURL): (API::IconDatabaseClient::didRemoveAllIcons): (API::IconDatabaseClient::iconDataReadyForPageURL): * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseSetIconDatabaseClient): * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::WebIconDatabase): (WebKit::WebIconDatabase::setClient): (WebKit::WebIconDatabase::didChangeIconForPageURL): (WebKit::WebIconDatabase::didRemoveAllIcons): (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL): * UIProcess/WebIconDatabase.h: * UIProcess/WebIconDatabaseClient.cpp: (WebKit::WebIconDatabaseClient::WebIconDatabaseClient): (WebKit::WebIconDatabaseClient::didChangeIconForPageURL): (WebKit::WebIconDatabaseClient::didRemoveAllIcons): (WebKit::WebIconDatabaseClient::iconDataReadyForPageURL): * UIProcess/WebIconDatabaseClient.h: * WebKit2.xcodeproj/project.pbxproj: 2017-06-12 Carlos Garcia Campos [GTK] Stop dismissing menus attached to the web view for every injected event https://bugs.webkit.org/show_bug.cgi?id=172708 Reviewed by Alex Christensen. To actually simulate a right-click event we should also send the button release after the press, and let the page handle the events in addition to sending the event to the context menu controller, like we do with normal events. So, this is mostly the same as a real right-click event but without actually showing the menu. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::contextMenuAtPointInWindow): 2017-06-12 Daewoong Jang [CoordinatedGraphics] Behavior change of DrawingAreaImpl after r217779 https://bugs.webkit.org/show_bug.cgi?id=173153 Reviewed by Carlos Garcia Campos. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): 2017-06-12 Carlos Garcia Campos [GTK] Prefer to use private WebKitWebView API over WebKitWebViewBase https://bugs.webkit.org/show_bug.cgi?id=173254 Reviewed by Žan Doberšek. WebKitWebViewBase is specific to the GTK+ API, but WebKitWebView should be present in any glib-based API. Add webkitWebViewCreatePage() and webkitWebViewGetPage() and use them when possible instead of the WebKitWebViewBase ones. * UIProcess/API/gtk/WebKitAutomationSession.cpp: * UIProcess/API/gtk/WebKitContextMenuClient.cpp: (attachContextMenuClientToView): * UIProcess/API/gtk/WebKitFindController.cpp: (getPage): (webkitFindControllerDispose): (webkitFindControllerConstructed): (webKitFindControllerPerform): (webkit_find_controller_search_finish): * UIProcess/API/gtk/WebKitFormClient.cpp: (attachFormClientToView): * UIProcess/API/gtk/WebKitLoaderClient.cpp: (attachLoaderClientToView): * UIProcess/API/gtk/WebKitPolicyClient.cpp: (attachPolicyClientToView): * UIProcess/API/gtk/WebKitPrintOperation.cpp: (drawPagesForPrintingCompleted): (webkitPrintOperationPrintPagesForFrame): (webkit_print_operation_run_dialog): (webkit_print_operation_print): * UIProcess/API/gtk/WebKitUIClient.cpp: (attachUIClientToView): * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextCreatePageForWebView): (webkitWebContextWebViewDestroyed): * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewCreatePage): (webkitWebViewGetPage): * UIProcess/API/gtk/WebKitWebViewPrivate.h: 2017-06-12 Carlos Garcia Campos [GTK] getPage() in WebKitWebView should return a reference instead of a pointer https://bugs.webkit.org/show_bug.cgi?id=173251 Reviewed by Žan Doberšek. The WebPageProxy is created on WebKitWebView construction, so getPage() can only return nullptr if it's called during construction. And that can only happen when construct properties are set. It's better to check that the view has been constructed only in these particular cases and make getPage() return a reference. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewCreateJavaScriptDialog): (allowModalDialogsChanged): Settings signals are only connected after the page has been created, so we don't need to check page is available here. (zoomTextOnlyChanged): (userAgentChanged): (webkitWebViewIsConstructed): Helper method to check if the view has been constructed. (webkitWebViewUpdateSettings): Return early if view hasn't been constructed. (webkitWebViewDisconnectSettingsSignalHandlers): Ditto. (webkitWebViewConstructed): (webkitWebViewDispose): (webkitWebViewCreateNewPage): (webkitWebViewSelectionDidChange): (webkit_web_view_try_close): (webkit_web_view_load_uri): (webkit_web_view_load_html): (webkit_web_view_load_alternate_html): (webkit_web_view_load_plain_text): (webkit_web_view_load_bytes): (webkit_web_view_load_request): (webkit_web_view_get_page_id): (webkit_web_view_reload): (webkit_web_view_reload_bypass_cache): (webkit_web_view_stop_loading): (webkit_web_view_is_playing_audio): (webkit_web_view_go_back): (webkit_web_view_can_go_back): (webkit_web_view_go_forward): (webkit_web_view_can_go_forward): (webkit_web_view_get_custom_charset): (webkit_web_view_set_custom_charset): (webkit_web_view_get_estimated_load_progress): (webkit_web_view_go_to_back_forward_list_item): (webkit_web_view_set_zoom_level): (webkit_web_view_get_zoom_level): (webkit_web_view_can_execute_editing_command): (webkit_web_view_execute_editing_command): (webkit_web_view_execute_editing_command_with_argument): (webkit_web_view_run_javascript): (resourcesStreamReadCallback): (webkit_web_view_get_inspector): (webkit_web_view_can_show_mime_type): (webkit_web_view_save): (webkit_web_view_save_to_file): (webkit_web_view_download_uri): (webkit_web_view_get_tls_info): (webkit_web_view_get_snapshot): (webkit_web_view_set_background_color): (webkit_web_view_get_background_color): (webkit_web_view_is_editable): (webkit_web_view_set_editable): (webkit_web_view_get_editor_state): (webkit_web_view_get_session_state): (webkit_web_view_restore_session_state): 2017-06-12 Carlos Garcia Campos [GTK] Move WebKit GType macros to WTF https://bugs.webkit.org/show_bug.cgi?id=173249 Reviewed by Žan Doberšek. Moving to a common place where they could be shared by all ports using a glib-based API. * UIProcess/API/gtk/WebKitPrivate.h: 2017-06-11 Carlos Garcia Campos [GTK] Remove WKInspectorClientGtk https://bugs.webkit.org/show_bug.cgi?id=173142 Reviewed by Michael Catanzaro. It's only used internally in GTk+ API, we can simplify it by using a C++ client instead. * PlatformGTK.cmake: * UIProcess/API/C/gtk/WKInspectorClientGtk.cpp: Removed. * UIProcess/API/C/gtk/WKInspectorClientGtk.h: Removed. * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/API/gtk/WebKitWebInspector.cpp: (_WebKitWebInspectorPrivate::~_WebKitWebInspectorPrivate): (webkitWebInspectorCreate): * UIProcess/WebInspectorProxy.cpp: * UIProcess/WebInspectorProxy.h: * UIProcess/gtk/WebInspectorClientGtk.cpp: Removed. * UIProcess/gtk/WebInspectorProxyClient.h: Renamed from Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.h. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::setClient): (WebKit::WebInspectorProxy::createInspectorWindow): (WebKit::WebInspectorProxy::platformDidClose): (WebKit::WebInspectorProxy::platformBringToFront): (WebKit::WebInspectorProxy::platformInspectedURLChanged): (WebKit::WebInspectorProxy::platformAttach): (WebKit::WebInspectorProxy::platformDetach): (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight): (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth): (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): 2017-06-11 Tim Horton REGRESSION (r217870): Null deref under PageOverlayController::uninstallPageOverlay using find in page https://bugs.webkit.org/show_bug.cgi?id=173196 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::updateFindIndicator): The reason this caused a crash instead of just a missing indicator is that FindControllerIOS would early return after uninstalling the old overlay, before installing a new one, and leave m_isShowingFindIndicator set to true. Instead, reset it (and m_findIndicatorOverlay, which we would never re-use but might as well be freed immediately). This likely already crashed in other less reproducible cases where a TextIndicator was not created for a find match, so clean it up. 2017-06-10 Carlos Garcia Campos [GTK] Remove WKFullScreenClientGtk https://bugs.webkit.org/show_bug.cgi?id=173140 Reviewed by Michael Catanzaro. It's only used internally in the GTK+ API. Implementation is a lot simpler without using it, we can simply use either WebKitWebView or WebKitWebViewBase from PageClient directly. * PlatformGTK.cmake: * UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp: Removed. * UIProcess/API/C/gtk/WKFullScreenClientGtk.h: Removed. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::isFullScreen): (WebKit::PageClientImpl::enterFullScreen): (WebKit::PageClientImpl::exitFullScreen): * UIProcess/API/gtk/WebKitFullscreenClient.cpp: Removed. * UIProcess/API/gtk/WebKitFullscreenClient.h: Removed. * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewEnterFullScreen): (webkitWebViewExitFullScreen): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseEnterFullScreen): (webkitWebViewBaseExitFullScreen): (webkitWebViewBaseIsFullScreen): * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: * UIProcess/gtk/WebFullScreenClientGtk.cpp: Removed. * UIProcess/gtk/WebFullScreenClientGtk.h: Removed. 2017-06-10 Carlos Garcia Campos [GTK] Handle page download request in WebKitWebView directly https://bugs.webkit.org/show_bug.cgi?id=173137 Reviewed by Žan Doberšek. We don't need to pass through WebKitWebViewBase, since the base doesn't have an implementation. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::handleDownloadRequest): * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewHandleDownloadRequest): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseSetDownloadRequestHandler): Deleted. (webkitWebViewBaseHandleDownloadRequest): Deleted. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: 2017-06-10 Carlos Garcia Campos [GTK] Use a lambda in webkit_cookie_manager_get_accept_policy instead of toGenericCallbackFunction https://bugs.webkit.org/show_bug.cgi?id=173134 Reviewed by Žan Doberšek. It's simpler and easier to read. * UIProcess/API/gtk/WebKitCookieManager.cpp: (webkit_cookie_manager_get_accept_policy): (webkitCookieManagerGetAcceptPolicyCallback): Deleted. 2017-06-10 Dan Bernstein Reverted r218056 because it made the IDE reindex constantly. * Configurations/DebugRelease.xcconfig: 2017-06-10 Dan Bernstein [Xcode] With Xcode 9 developer beta, everything rebuilds when switching between command-line and IDE https://bugs.webkit.org/show_bug.cgi?id=173223 Reviewed by Sam Weinig. The rebuilds were happening due to a difference in the compiler options that the IDE and xcodebuild were specifying. Only the IDE was passing the -index-store-path option. To make xcodebuild pass that option, too, set CLANG_INDEX_STORE_ENABLE to YES if it is unset, and specify an appropriate path in CLANG_INDEX_STORE_PATH. * Configurations/DebugRelease.xcconfig: 2017-06-09 Ryosuke Niwa Crash inside WebKit::PluginView::getAuthenticationInfo https://bugs.webkit.org/show_bug.cgi?id=173083 Address Darin's review comment. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getAuthenticationInfo): 2017-06-09 Chris Dumez Use WTF::Function instead of std::function in NetworkProcess code https://bugs.webkit.org/show_bug.cgi?id=173182 Reviewed by Alex Christensen. Use WTF::Function instead of std::function in NetworkProcess code to avoid unnecessary copying. * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/NetworkCacheIOChannel.h: * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::readSyncInThread): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cache/NetworkCacheStatistics.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::clearNSURLCache): (WebKit::NetworkProcess::clearDiskCache): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::clearDiskCache): 2017-06-09 Tim Horton REGRESSION (r213584): WeChat app can not switch to next text field https://bugs.webkit.org/show_bug.cgi?id=173183 Reviewed by Wenson Hsieh. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/InputViewUpdateDeferrer.mm: (WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer): It turns out that _endIgnoringReloadInputViews doesn't actually perform the update if there was one ignored. It does, however, return whether there was a change ignored, and we can force an update. This remains untestable without sizable additional API test infrastructure for the same reasons as the original patch. 2017-06-09 Chris Dumez Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver() https://bugs.webkit.org/show_bug.cgi?id=173174 Reviewed by Darin Adler. Follow-up fix to r218006, which caused a crash on the bots. We cannot WTFMove() protectedThis here because the callback gets called several times. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): 2017-06-09 Jer Noble Crash in -[WKWebView _initializeWithConfiguration:] https://bugs.webkit.org/show_bug.cgi?id=173126 Reviewed by Darin Adler. Follow up to previous fix; when setting NSString properties, store a copy of the string rather than the NSString itself. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _overrideContentSecurityPolicy]): (-[WKWebViewConfiguration _setOverrideContentSecurityPolicy:]): (-[WKWebViewConfiguration _setMediaContentTypesRequiringHardwareSupport:]): 2017-06-09 Chris Dumez Use WTF::Function instead of std::function in StorageManager https://bugs.webkit.org/show_bug.cgi?id=173177 Reviewed by Brady Eidson. Use WTF::Function instead of std::function in StorageManager. This eliminates some potential implicit copying of captured variables, which is important here because we pass those lambdas to other threads. * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::getSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::getLocalStorageOriginDetails): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): * UIProcess/Storage/StorageManager.h: 2017-06-09 Daniel Bates CSP: Apply img-src directive to favicon loads https://bugs.webkit.org/show_bug.cgi?id=172733 Reviewed by Brady Eidson. Return 0 seconds for the maximum buffering time for favicons (no change in behavior). * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): 2017-06-09 Wenson Hsieh [iOS DnD] Add a hook to perform two-step drops in editable content https://bugs.webkit.org/show_bug.cgi?id=172992 Reviewed by Tim Horton. Add plumbing to support an injected bundle hook for overriding two-step drops. See WebCore ChangeLog. * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: (API::InjectedBundle::EditorClient::performTwoStepDrop): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::performTwoStepDrop): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::performTwoStepDrop): * WebProcess/WebCoreSupport/WebEditorClient.h: 2017-06-09 Brent Fulgham Use Function rather than std::function for thread safety in WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=173172 Reviewed by Chris Dumez. Remove a few more instances of std::function in the WebsiteDataStore, and WTFMove completion handler to avoid unnecessary copies. * Shared/WebsiteData/WebsiteDataType.h: Remove redundant WebsiteDataType from name. * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): Update for revised name. (WebKit::toWKWebsiteDataTypes): Ditto. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): ASSERT that this function, as well as its completion handler, are getting called from the main thread. (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): Ditto. (WebKit::WebProcessProxy::fetchWebsiteData): Move the completionHandler. (WebKit::WebProcessProxy::deleteWebsiteData): Ditto. (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): Ditto. * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): Switch to Function, and move completion handler. (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Ditto. (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Ditto. (WebKit::WebsiteDataStore::removeData): Ditto. (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Ditto. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-06-09 Chris Dumez Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver() https://bugs.webkit.org/show_bug.cgi?id=173174 Reviewed by Darin Adler. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): 2017-06-09 Chris Dumez Avoid some ref counting churn in WebResourceLoadStatisticsStore https://bugs.webkit.org/show_bug.cgi?id=173168 Reviewed by Brent Fulgham. Move the protectedThis around instead of ref'ing it every time we capture it in a lambda. Also add a missing protectedThis in WebResourceLoadStatisticsStore::removeDataRecords() which likely fixes crashes. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): 2017-06-09 Sam Weinig Add SubresourceIntegrity as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=173164 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add SubresourceIntegrity to the list of experimental features. Also, sort the experimental features as requested by the comment above it. 2017-06-09 Chris Dumez Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData() https://bugs.webkit.org/show_bug.cgi?id=173163 Reviewed by Brent Fulgham. Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData() or it may end up getting destroyed before the lambda executing and crash when calling m_statisticsQueue->dispatch(). * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): 2017-06-09 Daewoong Jang [CoordinatedGraphics] Remove unneeded interfaces in PageClient https://bugs.webkit.org/show_bug.cgi?id=173149 Reviewed by Michael Catanzaro. * UIProcess/PageClient.h: 2017-06-09 Chris Dumez Use WTF::Function instead of std::function in SpeculativeLoadManager::ExpiringEntry https://bugs.webkit.org/show_bug.cgi?id=173125 Reviewed by Antti Koivisto. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::ExpiringEntry::ExpiringEntry): (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry): 2017-06-09 Daewoong Jang Use WTF::getCurrentProcessID() instead of getpid() https://bugs.webkit.org/show_bug.cgi?id=173130 Reviewed by Tim Horton. * UIProcess/API/APIProcessPoolConfiguration.h: 2017-06-09 Claudio Saavedra struct does not accept initializer-form if member has initializers in GCC 4.9 Unreviewed speculative build fix. Remove the default initializers for DeniedRequest struct, since it's only initialized in one place, to keep gcc 4.9 happy. * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2017-06-09 Adrien Plazas [GTK] Add kinetic scrolling https://bugs.webkit.org/show_bug.cgi?id=155750 Reviewed by Carlos Garcia Campos. Patch by Adrien Plazas and Yusuke Suzuki. Add the notion of phase and momentum phase to WebWheelEvent. Make WebWheelEvent manage the 'is_stop' attribute of GdkEventScroll to create the corresponding WebWheelEvent with the correct phases and deltas. Make GestureController manage swipes to create the corresponding WebWheelEvent with the correct phases and deltas. * Shared/NativeWebWheelEvent.h: * Shared/WebEvent.h: * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): (WebKit::WebWheelEvent::encode): (WebKit::WebWheelEvent::decode): * Shared/gtk/NativeWebWheelEventGtk.cpp: (WebKit::NativeWebWheelEvent::NativeWebWheelEvent): * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebWheelEvent): * Shared/gtk/WebEventFactory.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleWheelEvent): (WebKit::WebPageProxy::shouldProcessWheelEventNow): * UIProcess/WebPageProxy.h: * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::GestureController): (WebKit::GestureController::handleEvent): (WebKit::GestureController::isProcessingGestures): (WebKit::createScrollEvent): (WebKit::GestureController::DragGesture::startDrag): (WebKit::GestureController::DragGesture::handleDrag): (WebKit::GestureController::DragGesture::begin): (WebKit::GestureController::DragGesture::end): (WebKit::GestureController::SwipeGesture::startMomentumScroll): (WebKit::GestureController::SwipeGesture::swipe): (WebKit::GestureController::SwipeGesture::SwipeGesture): * UIProcess/gtk/GestureController.h: 2017-06-09 Jer Noble Crash in -[WKWebView _initializeWithConfiguration:] https://bugs.webkit.org/show_bug.cgi?id=173126 Reviewed by Antti Koivisto. Crash occurs when passing an autoreleased NSString into _setMediaContentTypesRequiringHardwareSupport. The ivar should be a RetainPtr rather than a bare NSString *. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _mediaContentTypesRequiringHardwareSupport]): 2017-06-08 Carlos Garcia Campos [GTK] Use API::FormClient instead of the C API in WebKitFormClient https://bugs.webkit.org/show_bug.cgi?id=173098 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitFormClient.cpp: (attachFormClientToView): (willSubmitForm): Deleted. * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp: (webkitFormSubmissionRequestCreate): (webkit_form_submission_request_get_text_fields): * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkitWebPageCreate): 2017-06-08 Carlos Garcia Campos [GTK] Use API::Findclient instead of the C API in WebKitFindController https://bugs.webkit.org/show_bug.cgi?id=173095 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitFindController.cpp: (getPage): (webkitFindControllerDispose): (webkitFindControllerConstructed): (webkit_find_controller_class_init): 2017-06-08 Carlos Garcia Campos [GTK] Get rid of custom marshallers of signals https://bugs.webkit.org/show_bug.cgi?id=173094 Reviewed by Žan Doberšek. Use g_cclosure_marshal_generic instead. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitBackForwardList.cpp: * UIProcess/API/gtk/WebKitDownload.cpp: (webkit_download_class_init): * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: (webkit_favicon_database_class_init): * UIProcess/API/gtk/WebKitWebInspector.cpp: (webkit_web_inspector_class_init): * UIProcess/API/gtk/WebKitWebResource.cpp: (webkit_web_resource_class_init): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_class_init): * UIProcess/API/gtk/webkit2marshal.list: Removed. * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp: * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (webkit_web_page_class_init): 2017-06-08 Simon Fraser Crash under -[WKWebView _updateVisibleContentRects] https://bugs.webkit.org/show_bug.cgi?id=173123 rdar://problem/32650112 Reviewed by Tim Horton. Make sure the WKWebView is valid in places where we dispatch_async or use a pre-commit handler. Speculative fix for a rare crasher. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isValid]): (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 2017-06-07 Simon Fraser Use initializers in WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=173073 Reviewed by Tim Horton. Initialize the member variables the modern way. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: 2017-06-08 Jeremy Jones Implement additional AVPlayerController interfaces for minTime and maxTime. https://bugs.webkit.org/show_bug.cgi?id=172396 rdar://problem/30737452 Reviewed by Jer Noble. Add support for new HLS UI in AVKit. Plumb seekableTimeRangesLastModifiedTime and liveUpdateInterval across process boundaries. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setSeekableRanges): (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::seekableRangesChanged): (WebKit::WebPlaybackSessionManager::seekableRangesChanged): 2017-06-08 Chris Dumez Use WTF::Function more in SpeculativeLoadManager https://bugs.webkit.org/show_bug.cgi?id=173109 Reviewed by Antti Koivisto. Use WTF::Function more in SpeculativeLoadManager. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::create): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad): (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: 2017-06-08 Youenn Fablet getUserMedia should not be prompted again if user denied access https://bugs.webkit.org/show_bug.cgi?id=173104 Reviewed by Geoff Garen. Store denied requests to be able to replay them. If mic is denied, user might be prompted for camera, not for mic and camera. Same principle applies to the case of denied camera. Clearing the stored denied requests when reloading/navigating away. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): (WebKit::UserMediaPermissionRequestManagerProxy::isRequestDenied): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2017-06-08 Jer Noble Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly. https://bugs.webkit.org/show_bug.cgi?id=173091 Reviewed by Eric Carlson. Rather than add yet a third way of setting this preference, centralize everything by moving the definition of the default value into WebCore. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-06-08 Jer Noble [WK2] mediaContentTypesRequiringHardwareSupport setting not being propogated https://bugs.webkit.org/show_bug.cgi?id=173090 Reviewed by Eric Carlson. Passing a NSString* into the WebPreferencesStore::Value constructor would rather cast the NSString* into a bool than a const String&. So explicitly cast the NSString* into a String before passing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2017-06-08 Youenn Fablet getUserMedia request should not be allowed for background tabs unless the tab is already capturing https://bugs.webkit.org/show_bug.cgi?id=172989 Reviewed by Eric Carlson. Covered by updated test and manual testing. In case a getUserMedia can be granted, we check for visbility of the view. If the view is visible, the getUserMedia request is allowed and promise is resolved. Otherwise we store the pregranted request and will allow it when the view gets visible. Pregranted requests will be cleared if the document of the view is changed. Pregranted requests will not be used when capture page is muted. In that case, a prompt will appear. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess): (WebKit::allowRequest): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::processPregrantedRequests): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::viewIsBecomingVisible): * UIProcess/WebPageProxy.h: 2017-06-07 Carlos Garcia Campos [WPE] Enable resource usage https://bugs.webkit.org/show_bug.cgi?id=173054 Reviewed by Žan Doberšek. Enable/disable the resources overlay with CTRL + Shift + G. * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_compositingManagerProxy): 2017-06-07 Carlos Garcia Campos Remove legacy INSPECTOR_SERVER implementation https://bugs.webkit.org/show_bug.cgi?id=172966 Reviewed by Žan Doberšek. * CMakeLists.txt: * Platform/Logging.h: * PlatformWPE.cmake: * UIProcess/InspectorServer/HTTPRequest.cpp: Removed. * UIProcess/InspectorServer/HTTPRequest.h: Removed. * UIProcess/InspectorServer/WebInspectorServer.cpp: Removed. * UIProcess/InspectorServer/WebInspectorServer.h: Removed. * UIProcess/InspectorServer/WebSocketServer.cpp: Removed. * UIProcess/InspectorServer/WebSocketServer.h: Removed. * UIProcess/InspectorServer/WebSocketServerClient.h: Removed. * UIProcess/InspectorServer/WebSocketServerConnection.cpp: Removed. * UIProcess/InspectorServer/WebSocketServerConnection.h: Removed. * UIProcess/InspectorServer/front-end/inspectorPageIndex.html: Removed. * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp: Removed. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::invalidate): * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.messages.in: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::preferencesDidChange): * UIProcess/wpe/WebProcessPoolWPE.cpp: * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::sendMessageToFrontend): * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebInspector.messages.in: 2017-06-07 Dan Bernstein [Cocoa] additionalReadAccessAllowedURLs doesn’t preserve non-Latin-1 paths https://bugs.webkit.org/show_bug.cgi?id=173086 Reviewed by Andy Estes. We were incorrectly passing the fileSystemRepresentation of an NSURL into the WTF::String constructor that expects a Latin-1 string. However, in general, fileSystemRepresentation is not Latin-1. * UIProcess/API/APIProcessPoolConfiguration.h: Changed m_additionalReadAccessAllowedPaths from a Vector into a Vector. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): Updated for the change. (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): Ditto. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Ditto. 2017-06-07 Ryosuke Niwa Crash inside WebKit::PluginView::getAuthenticationInfo https://bugs.webkit.org/show_bug.cgi?id=173083 Reviewed by Chris Dumez. Added a null pointer check. The content document may have went away by the time we get there from IPC. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::getAuthenticationInfo): 2017-06-07 Youenn Fablet getUserMedia is prompting too often https://bugs.webkit.org/show_bug.cgi?id=172859 Reviewed by Eric Carlson. Introduce a storage of granted requests to skip prompting when needed. This is a partial implementation as granted requests should not happen for background tabs. This will be covered in a follow-up patch. Covered by manual tests. A granted request keeps its mainFrameID. Whenever the document of the main frame changes, the granted requests for that mainFrameID will be removed. This handles the case of navigating, reloading... while still supporting the case of granting getUserMedia after in page navigation. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess): (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest): (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::mainFrameID): (WebKit::UserMediaPermissionRequestProxy::frameID): (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeMainDocument): (WebKit::WebPageProxy::backForwardGoToItem): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidChangeMainDocument): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-06-07 Dan Bernstein [Cocoa] additionalReadAccessAllowedURLs should be consumed before loading the injected bundle https://bugs.webkit.org/show_bug.cgi?id=173078 Reviewed by Anders Carlsson. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Changed the order. 2017-06-07 Per Arne Vollan Support removal of authentication data through the Website data store API. https://bugs.webkit.org/show_bug.cgi?id=171217 Reviewed by Brady Eidson. Add support to remove and fetch credential data through the Website data store API. Credential data is removed and fetched from both the network process and web process. Authentication data stored in the keychain will not be cleared. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::encode): (WebKit::WebsiteData::decode): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: (dataTypesToString): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataType): (WebKit::toWKWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore allWebsiteDataTypes]): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): 2017-06-06 Dan Bernstein Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): 2017-06-06 Brent Fulgham [WK2][Cocoa] Allow network process to bind addresses without webrtc extension https://bugs.webkit.org/show_bug.cgi?id=173032 Reviewed by Youenn Fablet. Remove the unnecessary WebRTC sandbox extension handle and conditional sandbox rules, since we've decided that all WebKit clients should be able to use the WebRTC protocol. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): Remove unused sandbox extension from serialization. (WebKit::NetworkProcessCreationParameters::decode): Ditto. * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): We no longer send the sandbox extension, so don't attempt to consume it. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Remove check for 'com.apple.webkit.webrtc' extension. Make rules conditional on building with WEB_RTC feature enabled. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Remove check for 'com.apple.webkit.webrtc' * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): Do not create unnecessary sandbox extension handle. 2017-06-06 Tim Horton Crash trying to drag the entire text of a long book out of Mail compose view https://bugs.webkit.org/show_bug.cgi?id=173042 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/FindControllerIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::didConcludeEditDataInteraction): Adapt to the new name. 2017-06-06 Chris Dumez RELEASE_ASSERT(static_cast(enumerationValue) < WTF_ARRAY_LENGTH(values)) hit in convertEnumerationToJS() https://bugs.webkit.org/show_bug.cgi?id=173033 Reviewed by Simon Fraser. * Shared/SessionState.h: Make sure FrameState::shouldRestoreScrollPosition and other struct members are always intialized. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeFrameStateNode): (WebKit::decodeBackForwardTreeNode): Make sure FrameState::shouldRestoreScrollPosition is properly encoded / decoded. 2017-06-06 Andy Estes REGRESSION (r199558): WKWebView upload file which name contains Chinese character results in garbled code https://bugs.webkit.org/show_bug.cgi?id=172849 Reviewed by Darin Adler. This is the Mac equivalent of what was fixed in r208295. This time we use -[NSURL path] to construct a WTF::String instead of calling String::fromUTF8() on -[NSURL fileSystemRepresentation]. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::runOpenPanel): 2017-06-06 Yoav Weiss [preload] Conditional support for media preloading and align media `as` values. https://bugs.webkit.org/show_bug.cgi?id=172501 Reviewed by Dean Jackson. Add media preloading preference and hook it up to runtime enabled features. * Shared/WebPreferencesDefinitions.h: Added a macro defining media preloading preference. * UIProcess/API/C/WKPreferences.cpp: (WebKit2::WKPreferences::WKPreferencesSetMediaPreloadingEnabled): (WebKit2::WKPreferences::WKPreferencesGetMediaPreloadingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: Set runtime enabled feature based on preference. 2017-06-06 Don Olmstead [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports https://bugs.webkit.org/show_bug.cgi?id=172780 Reviewed by Alex Christensen. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::scheduleAnimation): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::syncDisplayState): 2017-06-06 Beth Dakin Netflix seeking quirk should also apply to Now Playing, and should always use the livestream UI https://bugs.webkit.org/show_bug.cgi?id=173030 -and corresponding- rdar://problem/32228660 Reviewed by Darin Adler. See WebCore ChangeLog for more details. We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking(). * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing): Deleted. (WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing): Deleted. * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged): Deleted. (WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged): Deleted. 2017-06-06 Jer Noble [Cocoa] Set defaults for mediaContentTypesRequiringHardwareSupport setting https://bugs.webkit.org/show_bug.cgi?id=173008 Reviewed by Eric Carlson. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): 2017-06-06 Joseph Pecoraro Move Resource Timing / User Timing from experimental features into main preferences https://bugs.webkit.org/show_bug.cgi?id=172950 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: Move Resource Timing and User Timing out of the Experimental Features section. 2017-06-06 Youenn Fablet Add an option to disable getUserMedia prompt in case of mock capture sources https://bugs.webkit.org/show_bug.cgi?id=172981 Reviewed by Eric Carlson. Adding mockCaptureDevicesPromptEnabled option. Allowing any getUserMedia request if mock is on and prompt is off. Renaming UserMediaProcessManager::willEnableMediaStreamInPage to muteCaptureMediaStreamsExceptIn. This eases reading the code. Making sure that a page for which a new getUserMedia MediaStream will be created is capture-unmuted. * Shared/WebPreferencesDefinitions.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn): (WebKit::UserMediaProcessManager::willCreateMediaStream): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMuted): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): 2017-06-06 Carlos Garcia Campos [WPE] Enable remote inspector https://bugs.webkit.org/show_bug.cgi?id=172971 Reviewed by Žan Doberšek. Initialize the remote inpector if needed. * UIProcess/wpe/WebProcessPoolWPE.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): 2017-06-06 Carlos Garcia Campos [GLIB] Make remote inspector DBus protocol common to all glib based ports https://bugs.webkit.org/show_bug.cgi?id=172970 Reviewed by Žan Doberšek. Use webkit instead of webkitgtk and reomve platform idfeds. * UIProcess/glib/RemoteInspectorClient.cpp: 2017-06-06 Zan Dobersek [WPE] Don't disable Web security preference by default https://bugs.webkit.org/show_bug.cgi?id=172964 Reviewed by Carlos Garcia Campos. * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::View): Don't disable Web security by default. 2017-06-05 Chris Dumez ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128 https://bugs.webkit.org/show_bug.cgi?id=172943 Reviewed by Alexey Proskuryakov. In Connection::sendMessage(), make sure we only ever transform asynchronous messages into synchronous ones if sendMessage() is called on the main thread. This is necessary because we no longer support sending synchronous messages from a background thread since r205125. * Platform/IPC/Connection.cpp: (IPC::Connection::sendMessage): (IPC::Connection::sendSyncMessage): 2017-06-05 Joseph Pecoraro Revert r217405, this headerpad increase is no longer needed. Rubber-stamped by Dan Bernstein. * Configurations/BaseXPCService.xcconfig: 2017-06-05 Dan Bernstein Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::mediaPlaybackControlsView): 2017-06-05 Jer Noble Allow clients to specify a list of codecs which should require hardware decode support. https://bugs.webkit.org/show_bug.cgi?id=172787 Reviewed by Alex Christensen. Add a WKWebPageConfiguration (and associated WebPreferences and WKPreferencesRef) properties allowing clients to require specified codecs have hardware decode support. Also open up the sandbox on Cocoa ports to services required to check for hardware decode availability. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaCodecsRequiringHardwareSupport): (WKPreferencesCopyMediaCodecsRequiringHardwareSupport): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _mediaCodecsRequiringHardwareSupport]): (-[WKWebViewConfiguration _setMediaCodecsRequiringHardwareSupport:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebProcess/com.apple.WebProcess.sb.in: 2017-06-05 Beth Dakin Modify Netflix controlsManager quirk to prevent only scrubbing https://bugs.webkit.org/show_bug.cgi?id=172881 -and corresponding- rdar://problem/32228660 Reviewed by Andy Estes. Plumbing for allowsTouchBarScrubbing. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing): (WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged): (WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged): 2017-06-05 Carlos Garcia Campos Unreviewed. Fix GTK+ build with OpenGL disabled after r217779. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): 2017-06-05 Carlos Garcia Campos [WPE] Use AcceleratedDrawingArea instead of its fork https://bugs.webkit.org/show_bug.cgi?id=172496 Reviewed by Žan Doberšek. WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead. * PlatformWPE.cmake: * Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type. * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed. * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually belongs here. * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port. * WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here. * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed. * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed. 2017-06-03 Simon Fraser Sort the project file. * WebKit2.xcodeproj/project.pbxproj: 2017-06-02 Chris Dumez ResourceLoadStatistics are not using unique paths during test runs https://bugs.webkit.org/show_bug.cgi?id=172861 Reviewed by Darin Adler. Add WKContextConfigurationSetResourceLoadStatisticsDirectory() C API to allow WKTR to use a custom directory. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyResourceLoadStatisticsDirectory): (WKContextConfigurationSetResourceLoadStatisticsDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): 2017-06-02 Brady Eidson Prevent scheme handlers from handling all built-in URL schemes. and https://bugs.webkit.org/show_bug.cgi?id=172869 Reviewed by Andy Estes. * UIProcess/API/Cocoa/WKWebView.mm: (+[WKWebView handlesURLScheme:]): Check against WebCore's new master list of URL schemes. 2017-06-02 Simon Fraser All scroll peformance logging should happen in the UI process https://bugs.webkit.org/show_bug.cgi?id=172874 rdar://problem/24474830 Reviewed by Tim Horton. Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds, so we have to log from the UI process. Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to WebPageProxy, which prints them with the same format they had before. Some plumbing through PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers through to something that can get to Page. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::logScrollingEvent): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added. (WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient): (WebKit::WebPerformanceLoggingClient::logScrollingEvent): * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): 2017-06-02 Chris Dumez REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255 https://bugs.webkit.org/show_bug.cgi?id=172846 Reviewed by Mark Lam. Follow-up to r217695 to deal with exceptions potentially thrown by NPRuntimeObjectMap::convertJSValueToNPVariant() as well. * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::invoke): 2017-06-02 Jeremy Jones Add abilility to specify presentingApplicationPID for a WebProcessPool. https://bugs.webkit.org/show_bug.cgi?id=172839 rdar://problem/32247170 Reviewed by Tim Horton. Expose presentingApplicationPID through WebProcessPoolConfiguration. This allows rehosted WebViews to specify the hosting application. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setPresentingApplicationPID:]): (-[_WKProcessPoolConfiguration presentingApplicationPID]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::createNewWebProcess): 2017-06-02 Frederic Wang [Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true https://bugs.webkit.org/show_bug.cgi?id=172851 Reviewed by Simon Fraser. When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require special composited layer. This commit enables that on mac but only when ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged. * WebProcess/WebCoreSupport/WebChromeClient.h: Make scrollable inner frame trigger compositing on Mac by default. This is ignored on mac when ScrollingTreeIncludesFrames=false. Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger. 2017-06-02 Zalan Bujtas Allow clients to override viewport size for CSS viewport units. https://bugs.webkit.org/show_bug.cgi?id=172838 Reviewed by Tim Horton. This enables auto-sizing clients to ensure that styles relative to the viewport are resolved to a set value (presumably the size of the container) as opposed to the preferred document size (which is set as the FrameView size). * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _viewportSizeForCSSViewportUnits]): (-[WKWebView _setViewportSizeForCSSViewportUnits:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::viewportSizeForCSSViewportUnits): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): (WebKit::WebPage::setViewportSizeForCSSViewportUnits): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::viewportSizeForCSSViewportUnits): * WebProcess/WebPage/WebPage.messages.in: 2017-06-02 Simon Fraser Get out of StdLibExtras.h https://bugs.webkit.org/show_bug.cgi?id=172744 Reviewed by Zalan Bujtas. Only bring in and namespace std::literals::chrono_literals when necessary. * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::computeRecordWorth): * Shared/mac/RemoteLayerBackingStoreCollection.mm: * WebProcess/Cookies/WebCookieManager.h: 2017-06-02 Andy Estes [Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest https://bugs.webkit.org/show_bug.cgi?id=172832 Reviewed by Alex Christensen. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSSet): (WebKit::toPKPaymentRequest): 2017-06-02 Dan Bernstein [Xcode] Header postprocessing should be based on the target OS version rather than the builder OS version https://bugs.webkit.org/show_bug.cgi?id=172860 Reviewed by Anders Carlsson. * Configurations/WebKit.xcconfig: Use TARGET_MAC_OS_X_VERSION_MAJOR 2017-06-02 Gwang Yoon Hwang REGRESSION(r217214): [Coordinated Graphics] UpdateAtlas didn't released while resetting testrunner https://bugs.webkit.org/show_bug.cgi?id=172746 Reviewed by Žan Doberšek. After clearing update atlases in CompositingCoordinator, we should release update atlases at the compositing thread, too. We cannot remove update atlases from the CoordinatedGraphicsScene without regard to update scheduling, since previously committed scene states can try to use already released update atlases. To prevent this timing problem, releasing update atlases should be done with a update scheduler. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::syncRemoteContent): (WebKit::CoordinatedGraphicsScene::appendUpdate): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: Use WTF::Function instead of std::function * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::releaseUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::ThreadedCompositor::flushPendingLayerChanges): Release UpdateAtlases at the end of compositing states update, too. (WebKit::CompositingCoordinator::clearUpdateAtlases): 2017-06-01 Andreas Kling [Mac] Remove backing store for layers that are outside the viewport https://bugs.webkit.org/show_bug.cgi?id=170082 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 2017-06-01 Chris Dumez REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255 https://bugs.webkit.org/show_bug.cgi?id=172846 Reviewed by Andreas Kling. In NPJSObject::invoke(), return early if there was an exception when calling JSC::call(). Using the value returned by JSC::call() when an exception occurred is unsafe. * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::NPJSObject::invoke): 2017-06-01 Jon Lee Rename an experimental feature item https://bugs.webkit.org/show_bug.cgi?id=172830 Reviewed by Joseph Pecoraro. * Shared/WebPreferencesDefinitions.h: 2017-06-01 Andy Estes REGRESSION (r217626): ENABLE_APPLE_PAY_SESSION_V3 was disabled by mistake https://bugs.webkit.org/show_bug.cgi?id=172828 Reviewed by Beth Dakin. * Configurations/FeatureDefines.xcconfig: 2017-06-01 Chris Dumez [WK2] Update plugin process sandbox profile for flash plugin on HBONow https://bugs.webkit.org/show_bug.cgi?id=172820 Reviewed by Brent Fulgham. Relax the IOKit whitelist to silence sandbox violations by Flash plugin on HBONow. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-06-01 Andy Estes [Cocoa] Upstream support for JCB as a supported payment network https://bugs.webkit.org/show_bug.cgi?id=172819 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toSupportedNetwork): (WebKit::toAdditionalSupportedNetwork): Deleted. 2017-05-31 Andy Estes [Cocoa] "administrativeArea" contact field maps to the wrong CNPostalAddress key when creating NSErrors https://bugs.webkit.org/show_bug.cgi?id=172784 Reviewed by Beth Dakin. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): Used CNPostalAddressStateKey instead of CNPostalAddressCityKey. 2017-05-31 Andy Estes Rename ENABLE_APPLE_PAY_DELEGATE to ENABLE_APPLE_PAY_SESSION_V3 and bump the supported version number https://bugs.webkit.org/show_bug.cgi?id=172366 Reviewed by Daniel Bates. * Configurations/FeatureDefines.xcconfig: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::supportsVersion): 2017-05-31 Chris Dumez [WK2] Fix bad assertion in BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck() https://bugs.webkit.org/show_bug.cgi?id=172763 Reviewed by Zalan Bujtas. Fix bad assertion in BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck(). It gets hit when a process becomes unresponsive. The reason is that RunLoop::Timer::isActive() still returns true while the timerFired() callback is called. * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck): 2017-05-31 Youenn Fablet Make WebRTC legacy API switch an experimental feature https://bugs.webkit.org/show_bug.cgi?id=172760 Reviewed by Eric Carlson. This patch adds an experimental feature to disable WebRTC legacy API. We keep the runtime flag as "enable WebRTC legacy API" to minimize the changes and as it is clearer in the code. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebRTCLegacyAPIEnabled): (WKPreferencesGetWebRTCLegacyAPIEnabled): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _webRTCLegacyAPIEnabled]): (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-31 Matt Lewis Unreviewed, rolling out r217603. This patch broke the internal builds. Reverted changeset: "Get out of StdLibExtras.h" https://bugs.webkit.org/show_bug.cgi?id=172744 http://trac.webkit.org/changeset/217603 2017-05-31 Brent Fulgham Make ResourceLoadStatistics testing more reliable https://bugs.webkit.org/show_bug.cgi?id=172730 Reviewed by Andy Estes. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed): Add a convenience method to notify the WebProcess when the UIProcess has finished processing the load statistics data. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Notify clients (if they requested) when statistics have been processed. 2017-05-31 Simon Fraser Get out of StdLibExtras.h https://bugs.webkit.org/show_bug.cgi?id=172744 Reviewed by Saam Barati. Only bring in and namespace std::literals::chrono_literals when necessary. * NetworkProcess/cache/NetworkCache.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::computeRecordWorth): * Shared/mac/RemoteLayerBackingStoreCollection.mm: * WebProcess/Cookies/WebCookieManager.h: 2017-05-31 Zan Dobersek CoordinatedLayerTreeHost: properly support async force repaints https://bugs.webkit.org/show_bug.cgi?id=172444 Reviewed by Carlos Garcia Campos. Before these changes the force-repaint callbacks were executed once the next layer flush was performed. This is not appropriate since with the threaded compositor this was done even before the flushed state was handled on the rendering thread. Instead, the callback should be invoked once the first following flushed state is rendered through the compositor and the update finish is reported back to CoordinatedLayerTreeHost through invoking the renderNextFrame() method. If the force-repaint callback is registered while a state update is already being processed by the renderer (i.e. the threaded compositor), the callback is invoked only after the following flush, which is executed when renderNextFrame() is called for the current state update. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Add the forceFrameSync() method that forces the following state flush to produce a state update that will be handled by the compositor. This ensures that the compositor informs the CoordinatedLayerTreeHost once this state update is done, invoking renderNextFrame() which would handle the force-repaint callback. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): (WebKit::CoordinatedLayerTreeHost::renderNextFrame): (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: Remove the forceRepaintAsync() override that returned false. 2017-05-31 Carlos Garcia Campos Unreviewed. Fix copy-paste error added in r217209. It seems I pasted twice. * UIProcess/API/gtk/WebKitContextMenuItem.h: 2017-05-30 Tim Horton Keyboard autocorrections do not apply with an active selection (but keyboard acts like they did) https://bugs.webkit.org/show_bug.cgi?id=172735 Reviewed by Enrica Casucci. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Expose applyAutocorrection on the WKTesting category for use from UIScriptController. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::syncApplyAutocorrection): If there is a range selection and it precisely matches the autocorrection's "before" string, allow the autocorrection to take place. 2017-05-30 Joseph Pecoraro Web Inspector: images dragged from Inspector to Desktop are named "Unknown.png" https://bugs.webkit.org/show_bug.cgi?id=141515 Reviewed by Wenson Hsieh. In Web Inspector these images are with data: or blob: content. In these cases we have the image data but the URL does not provide a useful name. In fact the name "Unknown.png" comes from -[NSURLResponse suggestedFilename] for this URL / content. To start, improve this situation for drags in Web Inspector pages. If the image element being dragged has a filename attribute use that as the suggested filename for the drag. * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): 2017-05-30 Ryosuke Niwa Only include DataDetectorsUI headers in iOS https://bugs.webkit.org/show_bug.cgi?id=172633 Reviewed by David Kilzer. Enable data detectors only on iOS and not other variants of iOS. * Platform/spi/ios/ManagedConfigurationSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _dataDetectionResults]): * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showDataDetectorsSheet]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView _didNotHandleTapAsClick:]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleTap): (WebKit::WebPage::handleTwoFingerTapAtPoint): (WebKit::WebPage::commitPotentialTap): 2017-05-30 Chris Dumez REGRESSION(r215946): Can't reference a table cell in Google spreadsheet https://bugs.webkit.org/show_bug.cgi?id=172703 Reviewed by Ryosuke Niwa. Fix GObject bindings accordingly. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapDOMRectList): (webkit_dom_client_rect_list_constructed): (webkit_dom_client_rect_list_item): (webkit_dom_client_rect_list_get_length): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_get_client_rects): 2017-05-30 Daniel Bates [WK2] Add runBeforeUnloadConfirmPanel WKUIDelegate SPI; support onbeforeunload confirm panel in MiniBrowser https://bugs.webkit.org/show_bug.cgi?id=172603 Reviewed by Brady Eidson. A page loaded in MiniBrowser using WebKit2 cannot show a beforeunload confirm panel (by registering an onbeforeunload event handler) when it is unloaded. The same page loaded in MiniBrowser using WebKit1 can show such a confirm panel. We need to add WKUIDelegate SPI so that an embedding client, such as MiniBrowser, can register to receive a callback to show a beforeunload confirm panel. * UIProcess/API/APIUIClient.h: (API::UIClient::runBeforeUnloadConfirmPanel): Modified to take a SecurityOriginData object. This makes the API consistent with the existing JavaScript dialog callbacks. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add SPI -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setUIDelegate:]): Set the delegate of WebKit::UIDelegate to the specified WKUIDelegate before we set the UI client on the page so as to ensure that API::UIClient callbacks that depend -respondsToSelector: checks (e.g. API::UIClient::canRunBeforeUnloadConfirmPanel()) return the correct result. To elaborate further, a API::UIClient client must override both canRunBeforeUnloadConfirmPanel() and runBeforeUnloadConfirmPanel() to support running a beforeunload confirm dialog. When mapping the Cocoa SPI, WKUIDelegatePrivate, to API::UIClient we implement API::UIClient::canRunBeforeUnloadConfirmPanel() in terms of whether the Cocoa delegate responds at runtime to the selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:. We need to do such runtime checks before we pass the API::UIClient to the page. Otherwise, querying API::UIClient::canRunBeforeUnloadConfirmPanel() will return the wrong result. * UIProcess/API/gtk/WebKitUIClient.cpp: Modified runBeforeUnloadConfirmPanel() to take a SecurityOriginData object. * UIProcess/Cocoa/UIDelegate.h: Add declarations for API::UIClient overrides: canRunBeforeUnloadConfirmPanel() and runBeforeUnloadConfirmPanel(). Add a bit to m_delegateMethods as to whether the Cocoa delegate responds to selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Set the above m_delegateMethods bit if the Cocoa delegate responds to selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:. (WebKit::UIDelegate::UIClient::canRunBeforeUnloadConfirmPanel): Return whether the above m_delegateMethods bit was set. (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): Turn around and call -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler: (if applicable). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Modified to take a SecurityOriginData object and pass it to API::UIClient::runBeforeUnloadConfirmPanel(). * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add SecurityOriginData argument to message RunBeforeUnloadConfirmPanel. Also pass the message for the panel as the last argument so as to make the order of arguments to message RunBeforeUnloadConfirmPanel more closely match the order of arguments passed to other JavaScript dialog messages (e.g. RunJavaScriptAlert) for consistency. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Include the SecurityOriginData object for the frame in message RunBeforeUnloadConfirmPanel. 2017-05-30 Alex Christensen Update libwebrtc configuration https://bugs.webkit.org/show_bug.cgi?id=172727 Reviewed by Geoffrey Garen. * Configurations/FeatureDefines.xcconfig: 2017-05-30 Tim Horton Dictionary lookup disappears after a few seconds on observer.com https://bugs.webkit.org/show_bug.cgi?id=172725 Reviewed by Beth Dakin. Only dismiss content-relative child windows on main frame loads, not all subframes. This was causing e.g. dictionary popovers relative to main-frame content to be dismissed when subframe ads finished loading, which is likely the cause of most incidents of this problem. If the popover is relative to subframe content and the subframe navigates out from under the popover, the popover will persist until dismissed by the user (or one of the other automatic dismissal mechanisms), but that seems preferable to the old behavior. * UIProcess/Cocoa/WebViewImpl.h: Remove an unimplemented and unused declaration. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::processDidExit): Move dismissContentRelativeChildWindows call here from WebPageProxy. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::resetStateAfterProcessExited): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didCommitLoadForMainFrame): (WebKit::PageClientImpl::navigationGestureDidBegin): (WebKit::PageClientImpl::dismissContentRelativeChildWindows): Remove dismissContentRelativeChildWindows from PageClient(Impl), call it from inside PageClientImpl and other Mac-specific places instead of inside ifdefs in WebPageProxy. 2017-05-30 Konstantin Tokarev Don't use designated initializers in WebBackForwardListProxy.cpp https://bugs.webkit.org/show_bug.cgi?id=172667 Reviewed by Alex Christensen. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): (WebKit::WebBackForwardListProxy::addItem): 2017-05-30 Antti Koivisto REGRESSION(r191402?): Safari, Mail crash at com.apple.WebKit: WebKit::WebContextMenuListenerProxy::invalidate + 4 https://bugs.webkit.org/show_bug.cgi?id=172704 Reviewed by Andreas Kling. r191402 made WebContextMenuProxy non-refcounted. However there are several potential ways for WebContextMenuProxyMac::show() to re-enter WebPageProxy and delete itself. This patch partially reverts r191402 bringing refcounting back and protects WebContextMenuProxy during show(). Speculative fix. No test, can't repro the crash. * UIProcess/PageClient.h: * UIProcess/WebContextMenuProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::internalShowContextMenu): Protect WebContextMenuProxy during show(). * UIProcess/WebPageProxy.h: * UIProcess/gtk/WebContextMenuProxyGtk.h: (WebKit::WebContextMenuProxyGtk::create): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::createContextMenuProxy): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::createContextMenuProxy): * UIProcess/mac/WebContextMenuProxyMac.h: (WebKit::WebContextMenuProxyMac::create): 2017-05-30 Zan Dobersek Invalidate the LayerTreeHost when destroying the DrawingAreaWPE object. Rubber-stamped by Carlos Garcia Campos. * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: (WebKit::DrawingAreaWPE::~DrawingAreaWPE): Invalidate the LayerTreeHost object, properly deconstructing the graphics pipeline. 2017-05-29 Claudio Saavedra [GTK] Remove unneeded forward declaration Rubber-stamped by Zan Dobersek. * UIProcess/API/C/gtk/WKAPICastGtk.h: Remove WebGrammarDetail as its header is included in the same file. 2017-05-29 Claudio Saavedra [WPE] Build fix after r217531 Unreviewed. * UIProcess/API/C/wpe/WKAPICastWPE.h: (WebKit::toAPI): Add missing WebGrammarDetail API cast. 2017-05-28 Dan Bernstein [Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES https://bugs.webkit.org/show_bug.cgi?id=172691 Reviewed by Tim Horton. * Configurations/Base.xcconfig: Set ALWAYS_SEARCH_USER_PATHS to NO. * UIProcess/API/C/WKAPICast.h: Moved GTK-only definitions that used WebGrammarDetail.h to WKAPICastGtk.h. This had the effect of no longer including APIArray.h from this header. * UIProcess/API/C/gtk/WKAPICastGtk.h: Moved GTK-only definitions to here. (WebKit::toAPI): * UIProcess/WebGrammarDetail.h: Replaced include of APIArray.h with a forward declaration. * Shared/API/c/WKRenderLayer.cpp: * Shared/API/c/WKRenderObject.cpp: * UIProcess/API/C/WKApplicationCacheManager.cpp: * UIProcess/API/C/WKContext.cpp: * UIProcess/API/C/WKContextConfigurationRef.cpp: * UIProcess/API/C/WKCookieManager.cpp: * UIProcess/API/C/WKKeyValueStorageManager.cpp: * UIProcess/API/C/WKNotificationManager.cpp: * UIProcess/API/C/WKOpenPanelResultListener.cpp: * UIProcess/API/C/WKPageGroup.cpp: * UIProcess/API/C/WKResourceCacheManager.cpp: * UIProcess/API/C/WKUserContentControllerRef.cpp: * UIProcess/API/gtk/WebKitBackForwardList.cpp: * UIProcess/WebContextMenuListenerProxy.cpp: Added #include "APIArray.h" to these files now that WKAPICast.h does not include it. 2017-05-26 Joseph Pecoraro Simply some NSNumber usage https://bugs.webkit.org/show_bug.cgi?id=172677 Reviewed by Sam Weinig. * PluginProcess/mac/PluginControllerProxyMac.mm: (WebKit::PluginControllerProxy::platformGeometryDidChange): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::registerUserDefaultsIfNeeded): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]): 2017-05-26 Brent Fulgham [WK2] Address thread safety issues with ResourceLoadStatistics https://bugs.webkit.org/show_bug.cgi?id=172519 Reviewed by Chris Dumez. Address some thread safety issues with the ResourceLoadStatistics architecture. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Assert that this is never called on the main thread. Also ensure that coreStore is only accessed on the statistics queue, not the main thread. (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Dispatch coreStore-accessing code on the statistics queue. (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Assert we do not hit this method on the main thread. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Assert that this is being called on the main thread. Also ensure that coreStore is only accessed on the statistics queue, not the main thread. (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Dispatch coreStore-accessing code on the statistics queue. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Lock data before operating on it. (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Assert we do not hit this method on the main thread. (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Ditto. * UIProcess/WebResourceLoadStatisticsStore.h: * WebProcess/WebProcess.cpp: Add a queue for the local WebProcess ResourceLoadStatisticsStore to use while processing data. (WebKit::m_statisticsQueue): Added. * WebProcess/WebProcess.h: 2017-05-26 Joseph Pecoraro [Cocoa] Simplify some WebViewImpl pasteboard code https://bugs.webkit.org/show_bug.cgi?id=172668 Reviewed by Tim Horton. * Shared/mac/PasteboardTypes.mm: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setFileAndURLTypes): (WebKit::WebViewImpl::setPromisedDataForAttachment): 2017-05-26 Joseph Pecoraro JSContext Inspector: Improve the reliability of automatically pausing in auto-attach https://bugs.webkit.org/show_bug.cgi?id=172664 Reviewed by Matt Baker. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::connect): * UIProcess/Automation/WebAutomationSession.h: Special connection options are ignored in automation sessions. 2017-05-26 Commit Queue Unreviewed, rolling out r217479. https://bugs.webkit.org/show_bug.cgi?id=172642 Exposes an underlying bug in WPEBackend-mesa that we have to resolve separately (Requested by zdobersek on #webkit). Reverted changeset: "[WPE] Use AcceleratedDrawingArea instead of its fork" https://bugs.webkit.org/show_bug.cgi?id=172496 http://trac.webkit.org/changeset/217479 2017-05-26 Csaba Osztrogonác Unreviewed Mac cmake buildfix after r217137, just for fun. https://bugs.webkit.org/show_bug.cgi?id=172362 * PlatformMac.cmake: 2017-05-26 Carlos Garcia Campos [WPE] Use AcceleratedDrawingArea instead of its fork https://bugs.webkit.org/show_bug.cgi?id=172496 Reviewed by Žan Doberšek. WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead. * PlatformWPE.cmake: * Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type. * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed. * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually belongs here. * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port. * WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here. * WebProcess/WebPage/DrawingAreaImpl.h: * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed. * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed. 2017-05-25 Said Abou-Hallawa [iOS] Disbale async image decoding when synchronously painting a newly parented WebView https://bugs.webkit.org/show_bug.cgi?id=172626 Reviewed by Simon Fraser. Large images have to be synchronously decoded when bringing a WebView to the foreground because the whole page will be painted when we unblock the UI process. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): Get nextFlushIsForImmediatePaint from RemoteLayerTreeContext and pass the correct GraphicsLayerPaintFlags to drawLayerContents(). * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: (WebKit::RemoteLayerTreeContext::setNextFlushIsForImmediatePaint): (WebKit::RemoteLayerTreeContext::nextFlushIsForImmediatePaint): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): Pass m_nextFlushIsForImmediatePaint to RemoteLayerTreeContext and then reset it. (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange): Set m_nextFlushIsForImmediatePaint to true to say that in the next flush, large images have to be synchronously decoded. 2017-05-25 Joseph Pecoraro _WKUserStyleSheet and WKUserScript leak string data https://bugs.webkit.org/show_bug.cgi?id=172583 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKUserScript.mm: (-[WKUserScript dealloc]): * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: (-[_WKUserStyleSheet dealloc]): Follow the pattern of destructing the internal API object. * UIProcess/API/Cocoa/WKUserScriptInternal.h: * UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h: Remove unnecessary includes. 2017-05-25 Chris Dumez ASSERT(m_websiteDataStore->websiteDataStore().sessionID() == m_sessionID) in PageConfiguration::sessionID() https://bugs.webkit.org/show_bug.cgi?id=172615 Reviewed by Brady Eidson. Fix assertion added in r215923 to take into account the fact that the PageConfiguration's sessionID is SessionID::legacyPrivateSessionID() when private browsing is enabled, instead of being the WebsiteDataStore's sessionID. See code in WebProcessPool::createWebPage(): """ pageConfiguration->setSessionID(pageConfiguration->preferences()->privateBrowsingEnabled() ? SessionID::legacyPrivateSessionID() : m_websiteDataStore->websiteDataStore().sessionID()); """ * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::sessionID): 2017-05-25 Brent Fulgham [WK2][iOS] Add a mach-lookup exception for 'com.apple.lsd.mapdb' to Network sandbox https://bugs.webkit.org/show_bug.cgi?id=172465 Reviewed by Alex Christensen. Expand sandbox to allow lookup of the mapdb that contains UTI information used by the Network process. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2017-05-25 Youenn Fablet com.apple.coremedia.videoencoder XPC service should be allowed by WebProcess sandbox https://bugs.webkit.org/show_bug.cgi?id=172599 Reviewed by Alex Christensen. * WebProcess/com.apple.WebProcess.sb.in: 2017-05-25 Simon Fraser [iOS WK2] Avoid setting contentsScale and rasterizationScale on CATransformLayers https://bugs.webkit.org/show_bug.cgi?id=172569 Reviewed by Dean Jackson. Setting contentsScale and rasterizationScale on CATransformLayers is a waste of CPU time, and triggers unwanted logging, so don't do it. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::PlatformCALayerRemote): 2017-05-25 Matt Lewis Unreviewed, rolling out r217409. The revision caused api failures Reverted changeset: "_WKUserStyleSheet leaks string data" https://bugs.webkit.org/show_bug.cgi?id=172583 http://trac.webkit.org/changeset/217409 2017-05-25 Joseph Pecoraro _WKUserStyleSheet leaks string data https://bugs.webkit.org/show_bug.cgi?id=172583 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: (-[_WKUserStyleSheet dealloc]): 2017-05-24 Joseph Pecoraro Increase the headerpad for WebKit XPC Services https://bugs.webkit.org/show_bug.cgi?id=172571 Reviewed by Dan Bernstein. * Configurations/BaseXPCService.xcconfig: Increase the headerpad to make room for additional dyld commands. 2017-05-24 David Keijser [GTK] Provide details on javascript exception https://bugs.webkit.org/show_bug.cgi?id=161187 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewRunJavaScriptCallback): (webkit_web_view_run_javascript): (resourcesStreamReadCallback): 2017-05-24 Ryan Haddad Unreviewed, suppress deprecation warnings to fix the build. * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::decode): 2017-05-24 Wenson Hsieh Plumb additional image metadata to item providers when beginning data interaction on an image https://bugs.webkit.org/show_bug.cgi?id=172536 Reviewed by Beth Dakin. Boilerplate plumbing to send suggestedName over IPC. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2017-05-24 Wenson Hsieh [WK2] Remove workaround to disable zooming to the focus rect while performing a data interaction https://bugs.webkit.org/show_bug.cgi?id=172546 Reviewed by Beth Dakin. Removes a now-unnecessary workaround to prevent scrolling when performing a data interaction operation in editable content. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _displayFormNodeInputView]): 2017-05-24 John Wilander Resource Load Statistics: Change grandfathering default to one hour https://bugs.webkit.org/show_bug.cgi?id=172524 Reviewed by Brent Fulgham. * Shared/WebPreferencesDefinitions.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): 2017-05-24 Jer Noble Rename DisplaySleepDisabler -> SleepDisabler https://bugs.webkit.org/show_bug.cgi?id=172478 Reviewed by Sam Weinig. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: 2017-05-23 John Wilander Resource Load Statistics: Don't include HSTS cache data in website data removal https://bugs.webkit.org/show_bug.cgi?id=172525 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::initializeDataTypesToRemove): 2017-05-15 Matt Rajca Replace autoplay events that fire at navigation with a DidAutoplayMediaPastThreshold event. https://bugs.webkit.org/show_bug.cgi?id=172138 Reviewed by Alex Christensen. Updated auto-play event types. * Shared/WebCoreArgumentCoders.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: 2017-05-23 Chris Dumez ASSERT(!m_timeoutTimer.isActive()) hit in BackgroundProcessResponsivenessTimer::responsivenessCheckTimerFired() https://bugs.webkit.org/show_bug.cgi?id=172509 Reviewed by Geoffrey Garen. In the BackgroundProcessResponsivenessTimer class, we have 2 timers: - m_responsivenessCheckTimer that causes us to do an IPC handshake with the WebProcess. - m_timeoutTimer that is started when we send the IPC message to the WebProcess and which is stopped when we get the response from the WebProcess. If we do not get the response by the time m_timeoutTimer fires, then we mark the process as unresponsive. As a result, of the behavior above, whenever the BackgroundProcessResponsivenessTimer is considered "active", there should be one of the 2 timers above that is active, and only one. The assertion hit showed that we decided to start the m_responsivenessCheckTimer timer even though the m_timeoutTimer timer is still active (we are still waiting for an IPC message from the WebProcess and the process is not considered unresponsive yet), which is wrong. The reason was that in BackgroundProcessResponsivenessTimer::updateState(), if we should be active, we would start the m_responsivenessCheckTimer if m_responsivenessCheckTimer is not already active, without checking if m_timeoutTimer is active. So if updateState() was called while the IPC handshake was in process, we would have both timers running at the same time. * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::updateState): (WebKit::BackgroundProcessResponsivenessTimer::isActive): * UIProcess/BackgroundProcessResponsivenessTimer.h: 2017-05-22 Simon Fraser Snapshotting via -renderInContext: should do synchronous image decodes https://bugs.webkit.org/show_bug.cgi?id=172485 rdar://problem/32276146 Reviewed by Tim Horton. Pass the PaintBehaviorSnapshotting flag in functions that do snapshotting. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): 2017-05-23 Myles C. Maxfield Remove dead ENABLE(FONT_LOAD_EVENTS) code https://bugs.webkit.org/show_bug.cgi?id=172517 Rubber-stamped by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2017-05-23 Tim Horton Zoom in/out is slow in Safari with large PDFs https://bugs.webkit.org/show_bug.cgi?id=172495 Reviewed by Simon Fraser. No tests; just a performance improvement. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::computePageBoxes): Use PDFKit instead of CGPDF to compute the first page box, so we can take advantage of PDFKit optimizations. PDFKit also handles box fallback, so we don't need to do that ourselves. Stop fetching all the boxes, as we only seem to use the first one. 2017-05-23 Tim Horton REGRESSION: API test WebKit2.WKObject is failing https://bugs.webkit.org/show_bug.cgi?id=172497 Reviewed by Geoff Garen. * Shared/Cocoa/WKNSString.mm: (-[WKNSString superclass]): (-[WKNSString class]): Pretend to be NSString instead of the more specific subclass (__NSCFString) that we actually are. There is code underneath us that assumes that if -class returns __NSCFString, that the object is a CFStringRef, which is not true in our case. 2017-05-23 Brent Fulgham [WK2][iOS] Add a mach-lookup exception for 'com.apple.analyticsd' https://bugs.webkit.org/show_bug.cgi?id=172462 Reviewed by Alexey Proskuryakov. * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-05-22 Brent Fulgham [WK2][iOS] Adopt a whitelist for XPC services https://bugs.webkit.org/show_bug.cgi?id=172182 Reviewed by Sam Weinig. Tell the Sandbox to block all XPC connections that are not explicitly allowed by the sandbox profile. The default behavior is to allow everything by default. If the restriction is set before including the standard iOS sandbox profiles, there does not seem to be a need to white list any other services. General web browsing on multiple devices indicate that these sandbox profiles work properly with media, accessibility, webgl, and general web content. * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-05-23 Emilio Cobos Álvarez Add a RuntimeEnabledFeature for display: contents, defaulted to false. https://bugs.webkit.org/show_bug.cgi?id=171984 Reviewed by Antti Koivisto. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDisplayContentsEnabled): (WKPreferencesGetDisplayContentsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-20 Alex Christensen REGRESSION(r215686): O(n^2) algorithm in CachedRawResource::addDataBuffer https://bugs.webkit.org/show_bug.cgi?id=172406 Reviewed by Brady Eidson. * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::redeliverManualStream): 2017-05-22 Yongjun Zhang Need a way to allow WKWebView to load request with ShouldOpenExternalURLsPolicy::ShouldAllow. https://bugs.webkit.org/show_bug.cgi?id=172460 Add an new method [WKWebView _loadRequest:shouldOpenExternalURLs:] to WKWebView; a WebKit client can use this to load request that allows opening external URLs. Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): When calling WebPageProxy::loadRequest, also set ShouldOpenExternalURLsPolicy based on the value of shouldOpenExternalURLs. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add [WKWebView _loadRequest:shouldOpenExternalURLs:]. 2017-05-22 Youenn Fablet Remove AVAudioCaptureSource https://bugs.webkit.org/show_bug.cgi?id=172360 Reviewed by Sam Weinig. Removing the handling of AVAudio/CoreAudio capture source dynamic switch. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetUseAVFoundationAudioCapture): Deleted. (WKPreferencesGetUseAVFoundationAudioCapture): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-22 Brian Burg Web Automation: characters produced with shift modifier on QWERTY keyboard should be delivered as shift-down, char-down, char-up, shift-up events https://bugs.webkit.org/show_bug.cgi?id=172299 Reviewed by Joseph Pecoraro. WebDriver tests expect some ASCII characters to be produced using the shift key, regardless of the actual keyboard layout. Emit extra events when simulating these keystrokes if the shift key is not already pressed. * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::characterIsProducedUsingShift): (WebKit::WebAutomationSession::platformSimulateKeySequence): 2017-05-22 Sam Weinig [WebIDL] Support callbacks with arbitrary return types https://bugs.webkit.org/show_bug.cgi?id=172407 Reviewed by Chris Dumez. * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.h: Update to match new interface of NodeFilterCondition. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp: Update to account for new WebCore implementation return types. 2017-05-22 Michael Catanzaro -Wreturn-type warning triggered by WKPage.cpp:2277 https://bugs.webkit.org/show_bug.cgi?id=171866 Reviewed by Žan Doberšek. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): 2017-05-22 Michael Catanzaro -Wreturn-type warning triggered by WebAutomationSession.cpp:851 https://bugs.webkit.org/show_bug.cgi?id=171867 Reviewed by Žan Doberšek. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::protocolModifierToWebEventModifier): 2017-05-22 Wenson Hsieh Remove unused documentIsHandlingNonDefaultDrag plumbing for WebKit2 https://bugs.webkit.org/show_bug.cgi?id=172453 Reviewed by Tim Horton. Removes unused plumbing that was originally added to support file uploads. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformDragControllerAction): (WebKit::WebPageProxy::resetCurrentDragInformation): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::currentDragCaretRect): (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag): Deleted. * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-05-22 Michael Catanzaro Add even more input validation in Connection::processMessage() https://bugs.webkit.org/show_bug.cgi?id=171682 Reviewed by Carlos Garcia Campos. Verify that the size of the out-of-line message body matches the size of the AttachmentInfo that is containing it. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): 2017-05-22 Tomas Popela Remove some of the EFL port leftovers https://bugs.webkit.org/show_bug.cgi?id=172440 Reviewed by Carlos Garcia Campos. * Scripts/generate-forwarding-headers.pl: 2017-05-22 Gwang Yoon Hwang [CoordinatedGraphics] Clear UpdateAtlases for each tests https://bugs.webkit.org/show_bug.cgi?id=172119 Reviewed by Carlos Garcia Campos. In Coordinated Graphics, we reuses at least one update atlas to render root compositing layer for several tests. So if one of the test cases breaks the internal states of Cairo's states, other followed test cases runs on same instance of WebKitTestRunner will be effected by broken states of Cairo. Because it increases test flaknesses, we should drop update atlases after each tests. * WebProcess/WebCoreSupport/WebChromeClient.cpp: Remove a redundant include statement for Coordinated graphics (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Added. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Added. * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::clearUpdateAtlases): Added. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Added. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/LayerTreeHost.h: * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: (WebKit::DrawingAreaWPE::resetUpdateAtlasForTesting): * WebProcess/WebPage/wpe/DrawingAreaWPE.h: 2017-05-22 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.3 release. * gtk/NEWS: Add release notes for 2.17.3. 2017-05-22 Carlos Garcia Campos [GTK] Add webkit_context_menu_item_new_from_gaction https://bugs.webkit.org/show_bug.cgi?id=159631 Reviewed by Michael Catanzaro. Add new API to create a WebKitContextMenuItem from a GAction and also to get the associated GAction. * Shared/gtk/WebContextMenuItemGtk.cpp: (WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk): Add constructor that receives a GAction. (WebKit::isGActionChecked): Helper to check if a stateful GAction is checked or not. (WebKit::WebContextMenuItemGtk::createActionIfNeeded): When creating a GAction from a GtkAtion, use the GtkAction name instead of adding a new one. Do not create the GAction if we already have one. * Shared/gtk/WebContextMenuItemGtk.h: (WebKit::WebContextMenuItemGtk::gAction): (WebKit::WebContextMenuItemGtk::gActionTarget): * UIProcess/API/gtk/WebKitContextMenuItem.cpp: (webkit_context_menu_item_new_from_gaction): (webkit_context_menu_item_get_gaction): * UIProcess/API/gtk/WebKitContextMenuItem.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols. * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::contextMenuItemActivatedCallback): Update the state of the internal GAction in case of toggle menu items. (WebKit::WebContextMenuProxyGtk::append): Pass the GAction target to g_menu_item_set_action_and_target_value. Do not connect to activate signal of actions provided by the user. 2017-05-21 Carlos Garcia Campos Add more input validation in Connection::readBytesFromSocket() https://bugs.webkit.org/show_bug.cgi?id=171871 Reviewed by Michael Catanzaro. Check the control message length is in the limits. Credit to Nathan Crandall for reporting this issue and submitting an equivalent fix. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::readBytesFromSocket): 2017-05-20 Michael Catanzaro -Wreturn-type warning triggered by WKNotification.cpp:77 https://bugs.webkit.org/show_bug.cgi?id=172414 Reviewed by Sam Weinig. * UIProcess/API/C/WKNotification.cpp: (WKNotificationCopyDir): 2017-05-19 John Wilander Resource Load Statistics: Use WebProcessPool::allProcessPools() when sending message to network process about partitioning https://bugs.webkit.org/show_bug.cgi?id=172370 Reviewed by Alex Christensen. The existing test case http/tests/loading/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html is currently failing and should start passing again with this patch. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): 2017-05-19 Chris Dumez [WK2] Notify client when a process exceeds background CPU limit while in the foreground https://bugs.webkit.org/show_bug.cgi?id=172246 Reviewed by Geoffrey Garen. When there is a background CPU limit set by the client, we now monitor the CPU usages of all WebContent processes, not just the non-visible ones. This way, we are now able to notify the client a process has exceeded the background CPU limit while in the foreground, via the UIClient's didExceedBackgroundResourceLimitWhileInForeground function, passing kWKResourceLimitCPU. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy): * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::cpuLimit): (API::PageConfiguration::setCPULimit): * UIProcess/API/C/WKPageConfigurationRef.cpp: (WKPageConfigurationSetBackgroundCPULimit): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateThrottleState): (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive): (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedCPULimit): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_cpuLimit): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::cpuLimit): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::createWebPage): (WebKit::WebProcess::removeWebPage): (WebKit::WebProcess::updateCPULimit): (WebKit::WebProcess::updateCPUMonitorState): (WebKit::WebProcess::pageActivityStateDidChange): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateCPULimit): (WebKit::WebProcess::updateCPUMonitorState): 2017-05-19 Jeremy Jones Remove defunct WebVideoFullscreenInterface https://bugs.webkit.org/show_bug.cgi?id=172254 Reviewed by Jon Lee. Remove reference to WebVideoFullscreenInterface. It has long since been replaced by WebVideoFullscreenModelClient. * WebProcess/cocoa/WebVideoFullscreenManager.h: 2017-05-19 Jeremy Jones [WebRTC] Remove PiP support for video elements that are showing camera capture https://bugs.webkit.org/show_bug.cgi?id=172336 Reviewed by Eric Carlson. Ask video element if it supports picture-in-picture instead of asking the mediaSession directly. This allows the video element to give a more robust answer. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): 2017-05-19 Chris Dumez Make sure implementation of InitializeWebKit2() always run on the main thread https://bugs.webkit.org/show_bug.cgi?id=172362 Reviewed by Geoffrey Garen. Add logic in InitializeWebKit2() for Cocoa ports to always run the initialization code is only called once, and on the main thread. If we are called from a non-main thread, we will dispatch synchronously to the main thread to run the initialization code. This is needed because WebKit2Initialize() is called from the API::Object constructor. API::Object is thread-safe RefCounted and those objects are sometimes initialized on non-main thread. If the first of such objects happened to be initialized on a non-main thread, then we would run the initialization code for the first time on a non-main thread. This would lead to hard to debug issues because code such as RunLoop::initializeMainRunLoop() is only safe to call on the main thread because it stores a pointer to the current thread's RunLoop in a static variable for later use (i.e. for RunLoop::main()). * Shared/Cocoa/WebKit2InitializeCocoa.mm: Copied from Source/WebKit2/Shared/WebKit2Initialize.cpp. (WebKit::runInitializationCode): (WebKit::InitializeWebKit2): * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): * WebKit2.xcodeproj/project.pbxproj: 2017-05-19 Carlos Garcia Campos REGRESSION(r216977): [GTK] Ephemeral sessions broken after r216977 https://bugs.webkit.org/show_bug.cgi?id=172345 Reviewed by Michael Catanzaro. Since r216977, WebProcessPool sends the page session ID to the web process, but the WebsiteDataStoreParameters session ID to the network process. WebsiteDataStoreParameters is only implemented for Cocoa, so we are sending 0 session ID to the network process, while using the right session ID everywhere else. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageAddedToProcess): Add an ASSERT to ensure we are sending the same session ID to Web and Network processes. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): Add minimal implementation for non-Cocoa ports to at least set the session ID. 2017-05-19 Carlos Garcia Campos Add more input validation in Connection::processMessage() https://bugs.webkit.org/show_bug.cgi?id=171682 Reviewed by Michael Catanzaro. Check limits of attachments and message size. Credit to Nathan Crandall for reporting this issue and submitting an equivalent fix. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): 2017-05-19 Carlos Garcia Campos [Threaded Compositor] Remove platform ifdefs from threaded compositor implementation https://bugs.webkit.org/show_bug.cgi?id=172265 Reviewed by Žan Doberšek. Add AcceleratedSurfaceWPE implementation that is equivalent to the PlatformDisplayWPE::EGLTarget. Since WPE needs the surface to be initialized/finalized in the compositing thread, two new virtual methods has been added to AcceleratedSurface initialize/finalize that are only implemented by WPE. The threaded compositor no longer receives a native surface handle as contructor parameter, it now asks the client for it from the compositing thread, right after it's created. * PlatformWPE.cmake: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::create): Remove ativeSurfaceHandle parameter. (WebKit::ThreadedCompositor::ThreadedCompositor): Initialize m_nativeSurfaceHandle from the compositing thread asking the client for it. (WebKit::ThreadedCompositor::createGLContext): Remove the WPE implementation. (WebKit::ThreadedCompositor::invalidate): Notify the client that the GL context has been destroyed. (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Remove GTK ifdefs. (WebKit::ThreadedCompositor::setViewportSize): Remove WPE implementation. (WebKit::ThreadedCompositor::renderLayerTree): Notify the client the frame will be rendered, and when it has been rendered. (WebKit::ThreadedCompositor::frameComplete): Remove WPE ifdefs. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/AcceleratedSurface.cpp: (WebKit::AcceleratedSurface::create): Add client parameter. (WebKit::AcceleratedSurface::AcceleratedSurface): Create a AcceleratedSurfaceWPE if display is WPE. * WebProcess/WebPage/AcceleratedSurface.h: (WebKit::AcceleratedSurface::surfaceID): (WebKit::AcceleratedSurface::initialize): (WebKit::AcceleratedSurface::finalize): (WebKit::AcceleratedSurface::willRenderFrame): (WebKit::AcceleratedSurface::didRenderFrame): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Pass this as client of AcceleratedSurface. (WebKit::ThreadedCoordinatedLayerTreeHost::frameComplete): Notify the compositor. (WebKit::ThreadedCoordinatedLayerTreeHost::nativeSurfaceHandleForCompositing): Initialize the surface and return the window handler. (WebKit::ThreadedCoordinatedLayerTreeHost::didDestroyGLContext): Finalize the surface. (WebKit::ThreadedCoordinatedLayerTreeHost::willRenderFrame): Notify the surface. (WebKit::ThreadedCoordinatedLayerTreeHost::didRenderFrame): Ditto. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp: (WebKit::AcceleratedSurfaceWayland::create): Add client parameter. (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): Ditto. (WebKit::AcceleratedSurfaceWayland::didRenderFrame): Call Client::frameComplete(). * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h: * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp: (WebKit::AcceleratedSurfaceX11::create): Add client parameter. (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Ditto. (WebKit::AcceleratedSurfaceX11::didRenderFrame): Call Client::frameComplete(). * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h: * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: Added. (WebKit::AcceleratedSurfaceWPE::create): (WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE): (WebKit::AcceleratedSurfaceWPE::~AcceleratedSurfaceWPE): (WebKit::AcceleratedSurfaceWPE::initialize): (WebKit::AcceleratedSurfaceWPE::finalize): (WebKit::AcceleratedSurfaceWPE::window): (WebKit::AcceleratedSurfaceWPE::surfaceID): (WebKit::AcceleratedSurfaceWPE::resize): (WebKit::AcceleratedSurfaceWPE::willRenderFrame): (WebKit::AcceleratedSurfaceWPE::didRenderFrame): * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h: Copied from Source/WebKit2/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h. 2017-05-19 Yusuke Suzuki [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass https://bugs.webkit.org/show_bug.cgi?id=172098 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: * WebProcess/Plugins/Netscape/JSNPObject.cpp: 2017-05-18 Andreas Kling [WK2] Notify WebPageProxy client when an active process goes over the inactive memory limit https://bugs.webkit.org/show_bug.cgi?id=172244 Reviewed by Geoffrey Garen. Add a WKPageUIClient callback that is invoked when an active process exceeds the inactive memory limit. With the current state of the implementation, this means that a UI client can learn that backgrounding a non-audible, non-capturing tab may cause it to get killed once the active/inactive hysteresis time is over (8 minutes.) The callback can be invoked multiple times if we exceed the limit, and then go under, and exceed again. This is the callback: didExceedBackgroundResourceLimitWhileInForeground(WKPageRef, WKResourceLimit) Where WKResourceLimit is one of { kWKResourceLimitMemory, kWKResourceLimitCPU } The CPU enum value is a placeholder pending implementation soon. * UIProcess/API/APIUIClient.h: (API::UIClient::didExceedBackgroundResourceLimitWhileInForeground): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedInactiveMemoryLimitWhileActive): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-05-18 Eric Carlson [MediaStream] do not cache gUM permissions https://bugs.webkit.org/show_bug.cgi?id=172245 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): (WebKit::FrameAuthorizationState::FrameAuthorizationState): Deleted. (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice): Deleted. (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice): Deleted. (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: (WebKit::FrameAuthorizationState::setDeviceIdentifierHashSalt): Deleted. (WebKit::FrameAuthorizationState::deviceIdentifierHashSalt): Deleted. * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt): 2017-05-18 Tim Horton Data interaction conclusion snapshot has too much margin https://bugs.webkit.org/show_bug.cgi?id=172323 Reviewed by Beth Dakin. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::didConcludeEditDataInteraction): Disable the default TextIndicator margin. 2017-05-18 Andy Estes ENABLE(APPLE_PAY_DELEGATE) should be NO on macOS Sierra and earlier https://bugs.webkit.org/show_bug.cgi?id=172305 Reviewed by Anders Carlsson. * Configurations/FeatureDefines.xcconfig: 2017-05-18 John Wilander Resource Load Statistics: Grandfather domains for existing data records https://bugs.webkit.org/show_bug.cgi?id=172155 Reviewed by Alex Christensen. When WebResourceLoadStatisticsStore starts fresh it needs to scan existing website data records and 'grandfather' them to allow ample time to capture user interaction. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetGrandfathered): (WKResourceLoadStatisticsManagerIsGrandfathered): (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetGrandfatheringTime): Functions for testing and configuration. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): Added grandfathering configuration. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): New function to get all top privately controlled domains that have website data. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Functions for testing and configuration. WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval() changed as a result of WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval() moving to WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval(). * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::initializeDataTypesToRemove): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Moved handling of pending removal into WebCore::ResourceLoadStatisticsStore since that's where grandfathering happens. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Moved registration of write persistent store callback and reading of Cocoa defaults to WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver without parameters so they are called for platforms without CFNETWORK_STORAGE_PARTITIONING. Now includes registering WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData() as handler for grandfathering since it involves reading of the website data store. (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval): Deleted. Now happens in WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval(). * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain): New function to ask a WebsiteDataRecord for its top privately controlled domain. * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): New function to get all top privately controlled domains that have website data. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-05-18 Andy Estes Add "countryCode" to ApplePayErrorContactField https://bugs.webkit.org/show_bug.cgi?id=172264 Reviewed by Anders Carlsson. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-05-18 Commit Queue Unreviewed, rolling out r217031, r217032, and r217037. https://bugs.webkit.org/show_bug.cgi?id=172293 cause linking errors in Windows (Requested by yusukesuzuki on #webkit). Reverted changesets: "[JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass" https://bugs.webkit.org/show_bug.cgi?id=172098 http://trac.webkit.org/changeset/217031 "Unreviewed, rebaseline for newly added ClassInfo" https://bugs.webkit.org/show_bug.cgi?id=172098 http://trac.webkit.org/changeset/217032 "Unreviewed, fix debug and non-JIT build" https://bugs.webkit.org/show_bug.cgi?id=172098 http://trac.webkit.org/changeset/217037 2017-05-18 Claudio Saavedra [WPE] Unreviewed build fix Add missing header after r217041. * UIProcess/API/wpe/WPEView.cpp: 2017-05-18 Tim Horton More WebKit2 header cleanup https://bugs.webkit.org/show_bug.cgi?id=172214 Reviewed by Simon Fraser. * Shared/WebFindOptions.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setCompositionAsync): * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImpl.mm: * UIProcess/mac/ViewGestureControllerMac.mm: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: * WebProcess/Automation/WebAutomationSessionProxy.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h: * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h: * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h: * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: * WebProcess/Notifications/WebNotificationManager.cpp: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp: * WebProcess/WebCoreSupport/WebEditorClient.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp: * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::setDeviceScaleFactor): (WebKit::WebPage::centerSelectionInVisibleArea): (WebKit::WebPage::findString): (WebKit::WebPage::findStringMatches): (WebKit::WebPage::getImageForFindMatch): (WebKit::WebPage::selectFindMatch): (WebKit::WebPage::hideFindUI): (WebKit::WebPage::countStringMatches): (WebKit::WebPage::didReceiveGeolocationPermissionDecision): (WebKit::WebPage::mainFrameDidLayout): (WebKit::WebPage::setCompositionAsync): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::findController): (WebKit::WebPage::geolocationPermissionRequestManager): * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Many small changes added up to a few percent. Removing UserMediaRequest from UserMediaPermissionRequestProxy, which is included into WebPageProxy.h, was worth another ~10% because it got VM.h out of WebPageProxy.h (like the previous patch did with WebPage.h). In total, in my measurement (WebKit2 clean debug build) this is a ~15% speedup. We really should figure out how to make DOMPromise.h not bring in all of JavaScriptCore (or how to use promises without including DOMPromise.h in headers). 2017-05-17 Chris Dumez Fix unsafe lambda capture in ContentRuleListStore::lookupContentRuleList() https://bugs.webkit.org/show_bug.cgi?id=172258 Reviewed by Brady Eidson. Fix unsafe lambda capture in ContentRuleListStore::lookupContentRuleList(). The String was moved instead of calling isolatedCopy(), even though we're passing the String to another thread. * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::lookupContentRuleList): 2017-05-16 Yusuke Suzuki [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass https://bugs.webkit.org/show_bug.cgi?id=172098 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: * WebProcess/Plugins/Netscape/JSNPObject.cpp: 2017-05-17 Ryan Haddad Unreviewed, rolling out r217014. This change caused mac-wk2 LayoutTests to exit early due to crashes. Reverted changeset: "Resource Load Statistics: Grandfather domains for existing data records" https://bugs.webkit.org/show_bug.cgi?id=172155 http://trac.webkit.org/changeset/217014 2017-05-17 John Wilander Resource Load Statistics: Grandfather domains for existing data records https://bugs.webkit.org/show_bug.cgi?id=172155 Reviewed by Alex Christensen. When WebResourceLoadStatisticsStore starts fresh it needs to scan existing website data records and 'grandfather' them to allow ample time to capture user interaction. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetGrandfathered): (WKResourceLoadStatisticsManagerIsGrandfathered): (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval): (WKResourceLoadStatisticsManagerSetGrandfatheringTime): Functions for testing and configuration. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): Added grandfathering configuration. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): New function to get all top privately controlled domains that have website data. * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setGrandfathered): (WebKit::WebResourceLoadStatisticsManager::isGrandfathered): (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval): (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Functions for testing and configuration. WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval() changed as a result of WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval() moving to WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval(). * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::initializeDataTypesToRemove): (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Moved handling of pending removal into WebCore::ResourceLoadStatisticsStore since that's where grandfathering happens. (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Moved registration of write persistent store callback and reading of Cocoa defaults to WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver without parameters so they are called for platforms without CFNETWORK_STORAGE_PARTITIONING. Now includes registering WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData() as handler for grandfathering since it involves reading of the website data store. (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval): Deleted. Now happens in WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval(). * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain): New function to ask a WebsiteDataRecord for its top privately controlled domain. * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): New function to get all top privately controlled domains that have website data. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-05-17 Brent Fulgham [WK2][iOS] Allow access to additional IOHID user class https://bugs.webkit.org/show_bug.cgi?id=172198 Reviewed by Alex Christensen. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-05-17 Chris Dumez Add more assertions in BackgroundProcessResponsivenessTimer https://bugs.webkit.org/show_bug.cgi?id=172239 Reviewed by Andreas Kling. Add more assertions in BackgroundProcessResponsivenessTimer to help figure out the source of . * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::updateState): (WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck): 2017-05-17 Youenn Fablet No need to copy origin references in UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo https://bugs.webkit.org/show_bug.cgi?id=172242 Reviewed by Eric Carlson. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): 2017-05-17 Youenn Fablet Move-related refactoring on UserMediaPermissionRequestProxy https://bugs.webkit.org/show_bug.cgi?id=172195 Reviewed by Alex Christensen. Moving vectors of strings instead of passing as const ref so that we do not copy them. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): 2017-05-17 Andy Estes REGRESSION (r215480): PKPaymentAuthorizationStatusFailure sent to PassKit in completeShippingContactSelection() even when there are no errors https://bugs.webkit.org/show_bug.cgi?id=172227 Reviewed by Alexey Proskuryakov. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentAuthorizationStatus): If there is an update with no errors, we should return PKPaymentAuthorizationStatusSuccess instead of PKPaymentAuthorizationStatusFailure. 2017-05-17 Matt Lewis Unreviewed, rolling out r216974. Revision caused consistent timeouts on all platforms. Reverted changeset: "Add a RuntimeEnabledFeature for display: contents, defaulted to false." https://bugs.webkit.org/show_bug.cgi?id=171984 http://trac.webkit.org/changeset/216974 2017-05-17 Alex Christensen Interacting with WKHTTPCookieStores before creating WKWebViews and WKProcessPools should affect cookies used https://bugs.webkit.org/show_bug.cgi?id=171987 Reviewed by Brady Eidson. When putting cookies in a WKHTTPCookieStore that hasn't been associated with a WKProcessPool yet, there is no NetworkProcess into which to put the cookies. In such a case, we should store these cookies in the WebsiteDataStore until there is a NetworkProcess. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::ensurePrivateBrowsingSession): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::~WebsiteDataStoreParameters): (WebKit::WebsiteDataStoreParameters::encode): (WebKit::WebsiteDataStoreParameters::decode): (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters): Deleted. * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookie): (API::HTTPCookieStore::deleteCookie): * UIProcess/API/APIHTTPCookieStore.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::pendingCookies): (WebKit::WebsiteDataStore::addPendingCookie): (WebKit::WebsiteDataStore::removePendingCookie): * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-05-17 Emilio Cobos Álvarez Add a RuntimeEnabledFeature for display: contents, defaulted to false. https://bugs.webkit.org/show_bug.cgi?id=171984 Reviewed by Antti Koivisto. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDisplayContentsEnabled): (WKPreferencesGetDisplayContentsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-17 Carlos Garcia Campos Unreviewed. Fix the build with MEDIA_STREAM disabled after r216952. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): 2017-05-17 Carlos Garcia Campos [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted https://bugs.webkit.org/show_bug.cgi?id=172167 Reviewed by Michael Catanzaro. This is still happening, even after r216182, less often but still happens. There are two conditions in which this can happen: - Again in force repaint. r216182 fixed the case of force repaint called when update state is completed, but it can also crash if update state is inProgress or PendingAfterCompletion when m_coordinateUpdateCompletionWithClient is true. - When the threaded compositor is invalidated right after renderLayerTree() starts, but before it finishes. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::invalidate): Invalidate the refresh monitor right after stopping updates in the compositing run loop to ensure no more updates are scheduled. (WebKit::ThreadedCompositor::renderLayerTree): Check the scene is still active before calling sceneUpdateFinished(). (WebKit::ThreadedCompositor::updateSceneState): Do not update m_coordinateUpdateCompletionWithClient when in force repaint. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): Return early if the monitor has been invalidated. 2017-05-16 Sam Weinig Bring Notification.idl up to spec https://bugs.webkit.org/show_bug.cgi?id=172156 Reviewed by Chris Dumez. * Shared/WebCoreArgumentCoders.h: * UIProcess/API/C/WKNotification.cpp: (WKNotificationCopyDir): * UIProcess/Notifications/WebNotification.cpp: (WebKit::WebNotification::WebNotification): * UIProcess/Notifications/WebNotification.h: (WebKit::WebNotification::create): (WebKit::WebNotification::dir): * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::show): * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showNotification): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: (WebKit::NotificationPermissionRequestManager::startRequest): (WebKit::NotificationPermissionRequestManager::permissionLevel): (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision): * WebProcess/Notifications/WebNotificationManager.cpp: (WebKit::WebNotificationManager::policyForOrigin): (WebKit::WebNotificationManager::show): * WebProcess/WebCoreSupport/WebNotificationClient.cpp: (WebKit::WebNotificationClient::checkPermission): * WebProcess/WebCoreSupport/WebNotificationClient.h: Update for enum vs String usage. 2017-05-16 Youenn Fablet Modernize WebKit2 getUserMedia passing of parameters https://bugs.webkit.org/show_bug.cgi?id=172161 Reviewed by Eric Carlson. Passing SecurityOrigin as SecurityOriginData through IPC instead of Strings. Making more use of Ref<> instead of RefPtr<>. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): * UIProcess/UserMediaPermissionCheckProxy.h: (WebKit::UserMediaPermissionCheckProxy::create): (WebKit::UserMediaPermissionCheckProxy::userMediaDocumentSecurityOrigin): (WebKit::UserMediaPermissionCheckProxy::topLevelDocumentSecurityOrigin): (WebKit::UserMediaPermissionCheckProxy::completionHandler): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): (WebKit::WebPageProxy::requestNotificationPermission): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): 2017-05-16 David Kilzer Unused lambdas in UserMediaPermissionRequestManagerProxy.cpp Reviewed by Eric Carlson. Fixes unused lambda warnings found with newer clang: Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:309:46: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture] auto validateConstraintsHandler = [this, userMediaID, validHandler = WTFMove(validHandler), invalidHandler = WTFMove(invalidHandler), audioConstraints = WebCore::MediaConstraints(audioConstraints), videoConstraints = WebCore::MediaConstraints(videoConstraints)](String&& deviceIdentifierHashSalt) mutable { ^ Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:41: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture] auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable { ^ Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:54: error: lambda capture 'frameID' is not used [-Werror,-Wunused-lambda-capture] auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable { ^ Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:362:37: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture] auto completionHandler = [this, userMediaID](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) { ^ * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): - Remove unused lambdas. 2017-05-16 Brent Fulgham [WK2][macOS] Support Flash Player DRM features https://bugs.webkit.org/show_bug.cgi?id=172157 Reviewed by Dean Jackson. Relax the IOKit whitelist to support DRM features needed by some websites. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-05-16 Brent Fulgham [WK2][macOS] Adopt a whitelist for XPC services https://bugs.webkit.org/show_bug.cgi?id=172151 Reviewed by Alex Christensen. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-05-16 Timothy Horton Make it possible to adjust which edges are affected by safe area insets https://bugs.webkit.org/show_bug.cgi?id=172149 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _computedContentInset]): (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add SPI to adjust which edges are taken into account, and adjust the default. 2017-05-16 Zan Dobersek [GLib] Use RunLoopSourcePriority::RunLoopDispatcher as the GSocketMonitor's GSource priority https://bugs.webkit.org/show_bug.cgi?id=172160 Reviewed by Carlos Garcia Campos. * Platform/IPC/glib/GSocketMonitor.cpp: (IPC::GSocketMonitor::start): Explicitly set the priority for the GSocketMonitor's GSource object to RunLoopSourcePriority::RunLoopDispatcher, equating it to the priority that's used in RunLoop for dispatches of the queued functions. 2017-05-16 Zan Dobersek [GLib] Name more GSource-based RunLoop::Timers https://bugs.webkit.org/show_bug.cgi?id=172158 Reviewed by Carlos Garcia Campos. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): Specify 'CompositingRunLoop' as the name of this GSource-based RunLoop::Timer. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): Specify 'ThreadedDisplayRefreshMonitor' as the name of this GSource-based RunLoop::Timer. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): Specify 'CoordinatedLayerTreeHost' as the name of this GSource-based RunLoop::Timer. 2017-05-16 Carlos Garcia Campos Unreviewed. Revert change committed by mistakle in r216922. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::forceRepaint): 2017-05-16 Youenn Fablet Remove MediaConstraintsData and MediaConstraintsImpl https://bugs.webkit.org/show_bug.cgi?id=172132 Reviewed by Eric Carlson. Removing MediaConstraintsData and MediaConstraintsImpl allows simplifying the code. Further simplified the code by making MediaConstraints no longer ref counted and now a struct. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::applyConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::applyConstraints): 2017-05-16 Michael Catanzaro [SOUP] Remove LATEST_RECORD_VERSION from GnuTLS priority string https://bugs.webkit.org/show_bug.cgi?id=172153 Based on discussion with Nikos in https://bugzilla.gnome.org/show_bug.cgi?id=782218, we should remove LATEST_RECORD_VERSION from our GnuTLS priority string. This causes GnuTLS to use the latest TLS record version (the record format is separate from the TLS protocol version), which we needed a couple years ago (after dropping SSLv3) for maximum compatibility with broken web servers. But it's not needed anymore, and is causing new compatibility problems with other broken web servers, so let's get rid of it. Reviewed by Carlos Garcia Campos. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: (main): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2017-05-15 Andy Estes Make the application PID available to WebCore https://bugs.webkit.org/show_bug.cgi?id=172133 Reviewed by Andreas Kling. Added uiProcessPID to Web and Networking process creation parameters. The UI process initializes these to getpid(), and the child processes call WebCore::setPresentingApplicationPID() at initialization time. This replaces presenterApplicationPid. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::createNewWebProcess): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformInitialize): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::presenterApplicationPid): Deleted. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2017-05-15 Said Abou-Hallawa Do not delete asynchronously decoded frames for large images if their clients are in the viewport https://bugs.webkit.org/show_bug.cgi?id=170640 Reviewed by Simon Fraser. Enable the async decoding for large images. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-15 Youenn Fablet Simplify RealtimeMediaSource data production and state https://bugs.webkit.org/show_bug.cgi?id=171999 Reviewed by Eric Carlson. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::startProducingData): (WebKit::UserMediaCaptureManagerProxy::stopProducingData): * WebProcess/cocoa/UserMediaCaptureManager.cpp: 2017-05-15 Brent Fulgham Correct typo (part of r216790). * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: The check-in missed part of a regular expression needed to fix the audio playback. 2017-05-15 Jer Noble Add experimental setting to allow document gesture interaction to fulfill media playback gesture requirement https://bugs.webkit.org/show_bug.cgi?id=172131 Reviewed by Eric Carlson. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaUserGestureInheritsFromDocument): (WKPreferencesGetMediaUserGestureInheritsFromDocument): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-05-15 Brent Fulgham [WK2][macOS][iOS] Allow Network process to access nsurlstoraged's top level domain data cache https://bugs.webkit.org/show_bug.cgi?id=172128 Reviewed by Alex Christensen. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2017-05-15 David Kilzer Update json.hpp to v2.1.1 Reviewed by Alex Christensen. * NetworkProcess/capture/NetworkCaptureEvent.cpp: - Define JSON_NOEXCEPTION as 1 to disable exceptions in json.hpp. (WebKit::NetworkCapture::JSONCoder::encode): (WebKit::NetworkCapture::JSONCoder::encode): - Build std::string passing in length to avoid the need for a custom basic_json() constructor, and for efficiency. * NetworkProcess/capture/json.hpp: - Update to v2.1.1 and remove customizations. 2017-05-15 Brent Fulgham Unreviewed build fix. Debugging code was accidentally left in the Plugin sandbox profile. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-05-15 Gwang Yoon Hwang [WPE] Unreviewed debug build fix https://bugs.webkit.org/show_bug.cgi?id=172118 Unreviewed, remove a dead code accidentally committed in r215259. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: Remove deprecated CompositingRunLoop::isCurrent. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::frameComplete): 2017-05-14 Daewoong Jang [CoordinatedGraphics] Remove unused files and lines https://bugs.webkit.org/show_bug.cgi?id=172080 Reviewed by Darin Adler. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: Removed. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h: Removed. * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Removed. * Shared/CoordinatedGraphics/WebCoordinatedSurface.h: Removed. * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: Removed. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in: Removed. 2017-05-14 Andreas Kling Always reset the assisted node when the main frame commits a new load. https://bugs.webkit.org/show_bug.cgi?id=172088 Reviewed by Antti Koivisto. WebPage::m_assistedNode could extend the lifetime of the document it pointed into if the main frame was navigated while the assisted node was in one of its subframes. The life-supported document wouldn't be reachable from JavaScript but nevertheless would consume memory and other resources. This patch fixes the issue by always clearing WebPage::m_assistedNode when the main frame commits a new load. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::resetAssistedNodeForFrame): 2017-05-14 Csaba Osztrogonác Unreviewed Mac cmake buildfix after r216690, just for fun. * PlatformMac.cmake: 2017-05-14 David Kilzer Fix unused lambdas in WebKit2 Reviewed by Chris Dumez. Fixes unused lambda warnings found with newer clang. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::retrieve): * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::initialize): - Use UNUSED_PARAM() to silence unused lambda warning since 'startTime' is used in Debug builds. * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): - Remove unused 'this' from lambda capture. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): - Use UNUSED_PARAM() to silence unused lambda warning since 'taskIdentifier' is used in Debug builds. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate): - Remove unused 'this' from lambda captures. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): - Remove unused 'fetchOptions' from lambda capture. (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): - Remove unused 'this' from lambda capture. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::forceRepaintIfNeeded): - Remove unused 'this' from lambda capture. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::didExitFullscreen): - Remove unused 'this' from nested lambda captures. 2017-05-13 Eric Carlson [MediaStream] deviceId constraint doesn't work with getUserMedia https://bugs.webkit.org/show_bug.cgi?id=171877 Reviewed by Jer Noble. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode deviceIDHashSalt. (IPC::ArgumentCoder::decode): Decode deviceIDHashSalt. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize completion handler, frame ID, and security origins. (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling completion handler because we now sometimes request access info before calling gUM. (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler. * UIProcess/UserMediaPermissionCheckProxy.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy. (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt when origins don't match. (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto. Don't set state for empty UIDs. Pass hash salt to web process. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): The device ID hash salt is now required to validate constraints, so get it first. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper method used to get the device ID hash salt. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure to use getUserMediaPermissionInfo. (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID hash salt parameter. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): Ditto. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData constructor. 2017-05-13 Chris Dumez Stop using RefPtr::release() https://bugs.webkit.org/show_bug.cgi?id=172074 Reviewed by Geoffrey Garen. * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::create): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createImageBacking): * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::createCairoSurface): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp: (WebKit::core): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getContentsAsMHTMLData): 2017-05-12 Chris Dumez Drop remaining uses of PassRefPtr in WebKit2/WebProcess https://bugs.webkit.org/show_bug.cgi?id=172055 Reviewed by Alex Christensen. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm: (+[WKWebProcessPlugInScriptWorld normalWorld]): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (contextMenuItems): * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: (WKBundleScriptWorldNormalWorld): * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp: (webkitScriptWorldCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp: (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h: * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): (WebKit::InjectedBundleRangeHandle::create): (WebKit::InjectedBundleRangeHandle::coreRange): (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::create): (WebKit::InjectedBundle::createWebDataFromUint8Array): * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp: (WebKit::InjectedBundleBackForwardList::itemAtIndex): * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h: (WebKit::InjectedBundleBackForwardList::detach): * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h: (WebKit::InjectedBundleBackForwardListItem::create): (WebKit::InjectedBundleBackForwardListItem::InjectedBundleBackForwardListItem): * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::nodeHandle): (WebKit::InjectedBundleHitTestResult::urlElementHandle): * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp: (WebKit::InjectedBundleNavigationAction::create): (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction): * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::getOrCreate): (WebKit::InjectedBundleScriptWorld::normalWorld): * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::create): (WebKit::NetscapePlugin::NetscapePlugin): (WebKit::NetscapePlugin::supportsSnapshotting): * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/PDF/PDFPluginAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::create): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginPasswordField.h: * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: (WebKit::PDFPluginPasswordField::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::createAnnotationElement): * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::worldMap): (WebKit::WebUserMessageHandlerDescriptorProxy::create): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addUserScript): (WebKit::WebPage::addUserStyleSheet): * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: (WebKit::WebPrintOperationGtk::create): * WebProcess/WebPage/gtk/WebPrintOperationGtk.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::rangeForPosition): (WebKit::rangeAtWordBoundaryForPosition): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: 2017-05-12 Alex Christensen Rename WKContentExtension to WKContentRuleList https://bugs.webkit.org/show_bug.cgi?id=172053 Reviewed by Geoffrey Garen. * Shared/API/APIObject.h: * Shared/API/Cocoa/WebKit.h: * Shared/API/c/WKDeprecatedFunctions.cpp: (WKPageGroupAddUserContentFilter): (WKPageGroupRemoveUserContentFilter): * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/WebCompiledContentExtension.cpp: Removed. * Shared/WebCompiledContentExtension.h: Removed. * Shared/WebCompiledContentExtensionData.cpp: Removed. * Shared/WebCompiledContentExtensionData.h: Removed. * Shared/WebCompiledContentRuleList.cpp: Copied from Source/WebKit2/Shared/WebCompiledContentExtension.cpp. (WebKit::WebCompiledContentRuleList::create): (WebKit::WebCompiledContentRuleList::WebCompiledContentRuleList): (WebKit::WebCompiledContentRuleList::~WebCompiledContentRuleList): (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain): (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode): (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecodeLength): (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode): (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecodeLength): (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode): (WebKit::WebCompiledContentRuleList::topURLFiltersBytecodeLength): (WebKit::WebCompiledContentRuleList::actions): (WebKit::WebCompiledContentRuleList::actionsLength): (WebKit::WebCompiledContentExtension::create): Deleted. (WebKit::WebCompiledContentExtension::WebCompiledContentExtension): Deleted. (WebKit::WebCompiledContentExtension::~WebCompiledContentExtension): Deleted. (WebKit::WebCompiledContentExtension::conditionsApplyOnlyToDomain): Deleted. (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecode): Deleted. (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecodeLength): Deleted. (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecode): Deleted. (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecodeLength): Deleted. (WebKit::WebCompiledContentExtension::topURLFiltersBytecode): Deleted. (WebKit::WebCompiledContentExtension::topURLFiltersBytecodeLength): Deleted. (WebKit::WebCompiledContentExtension::actions): Deleted. (WebKit::WebCompiledContentExtension::actionsLength): Deleted. * Shared/WebCompiledContentRuleList.h: Copied from Source/WebKit2/Shared/WebCompiledContentExtension.h. * Shared/WebCompiledContentRuleListData.cpp: Copied from Source/WebKit2/Shared/WebCompiledContentExtensionData.cpp. (WebKit::WebCompiledContentRuleListData::encode): (WebKit::WebCompiledContentRuleListData::decode): (WebKit::WebCompiledContentExtensionData::encode): Deleted. (WebKit::WebCompiledContentExtensionData::decode): Deleted. * Shared/WebCompiledContentRuleListData.h: Copied from Source/WebKit2/Shared/WebCompiledContentExtensionData.h. (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData): (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData): Deleted. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APIContentExtension.cpp: Removed. * UIProcess/API/APIContentExtension.h: Removed. * UIProcess/API/APIContentExtensionStore.cpp: Removed. * UIProcess/API/APIContentExtensionStore.h: Removed. * UIProcess/API/APIContentRuleList.cpp: Copied from Source/WebKit2/UIProcess/API/APIContentExtension.cpp. (API::ContentRuleList::ContentRuleList): (API::ContentRuleList::~ContentRuleList): (API::ContentExtension::ContentExtension): Deleted. (API::ContentExtension::~ContentExtension): Deleted. * UIProcess/API/APIContentRuleList.h: Copied from Source/WebKit2/UIProcess/API/APIContentExtension.h. * UIProcess/API/APIContentRuleListStore.cpp: Copied from Source/WebKit2/UIProcess/API/APIContentExtensionStore.cpp. (API::ContentRuleListStore::legacyDefaultStore): (API::ContentRuleListStore::nonLegacyDdefaultStore): (API::ContentRuleListStore::defaultStore): (API::ContentRuleListStore::storeWithPath): (API::ContentRuleListStore::ContentRuleListStore): (API::ContentRuleListStore::~ContentRuleListStore): (API::constructedPathPrefix): (API::ContentRuleListMetaData::fileSize): (API::encodeContentRuleListMetaData): (API::decodeContentRuleListMetaData): (API::openAndMapContentRuleList): (API::compiledToFile): (API::createExtension): (API::ContentRuleListStore::lookupContentRuleList): (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers): (API::ContentRuleListStore::compileContentRuleList): (API::ContentRuleListStore::removeContentRuleList): (API::ContentRuleListStore::synchronousRemoveAllContentRuleLists): (API::ContentRuleListStore::invalidateContentRuleListVersion): (API::ContentRuleListStore::getContentRuleListSource): (API::contentRuleListStoreErrorCategory): (API::ContentExtensionStore::defaultStore): Deleted. (API::ContentExtensionStore::storeWithPath): Deleted. (API::ContentExtensionStore::ContentExtensionStore): Deleted. (API::ContentExtensionStore::~ContentExtensionStore): Deleted. (API::ContentExtensionMetaData::fileSize): Deleted. (API::encodeContentExtensionMetaData): Deleted. (API::decodeContentExtensionMetaData): Deleted. (API::openAndMapContentExtension): Deleted. (API::ContentExtensionStore::lookupContentExtension): Deleted. (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): Deleted. (API::ContentExtensionStore::compileContentExtension): Deleted. (API::ContentExtensionStore::removeContentExtension): Deleted. (API::ContentExtensionStore::synchronousRemoveAllContentExtensions): Deleted. (API::ContentExtensionStore::invalidateContentExtensionVersion): Deleted. (API::ContentExtensionStore::getContentExtensionSource): Deleted. (API::contentExtensionStoreErrorCategory): Deleted. * UIProcess/API/APIContentRuleListStore.h: Copied from Source/WebKit2/UIProcess/API/APIContentExtensionStore.h. (API::make_error_code): * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKPageGroup.cpp: * UIProcess/API/C/WKUserContentControllerRef.cpp: (WKUserContentControllerAddUserContentFilter): (WKUserContentControllerRemoveAllUserContentFilters): * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: (WKUserContentExtensionStoreGetTypeID): * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm: (API::ContentRuleListStore::defaultStorePath): (API::ContentExtensionStore::defaultStorePath): Deleted. * UIProcess/API/Cocoa/WKContentExtension.h: Removed. * UIProcess/API/Cocoa/WKContentExtension.mm: Removed. * UIProcess/API/Cocoa/WKContentExtensionInternal.h: Removed. * UIProcess/API/Cocoa/WKContentExtensionStore.h: Removed. * UIProcess/API/Cocoa/WKContentExtensionStore.mm: Removed. * UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h: Removed. * UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h: Removed. * UIProcess/API/Cocoa/WKContentRuleList.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtension.h. * UIProcess/API/Cocoa/WKContentRuleList.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtension.mm. (-[WKContentRuleList dealloc]): (-[WKContentRuleList _apiObject]): (-[WKContentRuleList identifier]): (-[WKContentExtension dealloc]): Deleted. (-[WKContentExtension _apiObject]): Deleted. (-[WKContentExtension identifier]): Deleted. * UIProcess/API/Cocoa/WKContentRuleListInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionInternal.h. (WebKit::wrapper): * UIProcess/API/Cocoa/WKContentRuleListStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStore.h. * UIProcess/API/Cocoa/WKContentRuleListStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStore.mm. (toWKErrorCode): (-[WKContentRuleListStore dealloc]): (+[WKContentRuleListStore defaultStore]): (+[WKContentRuleListStore storeWithURL:]): (-[WKContentRuleListStore compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]): (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:releasesArgument:]): (-[WKContentRuleListStore lookUpContentRuleListForIdentifier:completionHandler:]): (-[WKContentRuleListStore getAvailableContentRuleListIdentifiers:]): (-[WKContentRuleListStore removeContentRuleListForIdentifier:completionHandler:]): (-[WKContentRuleListStore _apiObject]): (-[WKContentRuleListStore _removeAllContentRuleLists]): (-[WKContentRuleListStore _invalidateContentRuleListVersionForIdentifier:]): (-[WKContentRuleListStore _getContentRuleListSourceForIdentifier:completionHandler:]): (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]): (-[WKContentExtensionStore dealloc]): Deleted. (+[WKContentExtensionStore defaultStore]): Deleted. (+[WKContentExtensionStore storeWithURL:]): Deleted. (-[WKContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted. (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]): Deleted. (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]): Deleted. (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]): Deleted. (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): Deleted. (-[WKContentExtensionStore _apiObject]): Deleted. (-[WKContentExtensionStore _removeAllContentExtensions]): Deleted. (-[WKContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): Deleted. (-[WKContentExtensionStore _getContentExtensionSourceForIdentifier:completionHandler:]): Deleted. (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h. (WebKit::wrapper): * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h. * UIProcess/API/Cocoa/WKError.h: * UIProcess/API/Cocoa/WKError.mm: (localizedDescriptionForErrorCode): * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addContentRuleList:]): (-[WKUserContentController removeContentRuleList:]): (-[WKUserContentController removeAllContentRuleLists]): (-[WKUserContentController _addUserContentFilter:]): (-[WKUserContentController _removeUserContentFilter:]): (-[WKUserContentController _removeAllUserContentFilters]): (-[WKUserContentController addContentExtension:]): Deleted. (-[WKUserContentController removeContentExtension:]): Deleted. (-[WKUserContentController removeAllContentExtensions]): Deleted. * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: (toUserContentRuleListStoreError): (+[_WKUserContentExtensionStore defaultStore]): (+[_WKUserContentExtensionStore storeWithURL:]): (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore _apiObject]): (-[_WKUserContentExtensionStore _removeAllContentExtensions]): (-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): (-[_WKUserContentExtensionStore _initWithWKContentRuleListStore:]): (toUserContentExtensionStoreError): Deleted. (-[_WKUserContentExtensionStore _initWithWKContentExtensionStore:]): Deleted. * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: * UIProcess/API/Cocoa/_WKUserContentFilter.mm: (-[_WKUserContentFilter _apiObject]): (-[_WKUserContentFilter _initWithWKContentRuleList:]): (-[_WKUserContentFilter _initWithWKContentExtension:]): Deleted. * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h: * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::addContentRuleList): (WebKit::WebUserContentControllerProxy::removeContentRuleList): (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists): (WebKit::WebUserContentControllerProxy::addContentExtension): Deleted. (WebKit::WebUserContentControllerProxy::removeContentExtension): Deleted. (WebKit::WebUserContentControllerProxy::removeAllContentExtensions): Deleted. * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/WebPageGroup.cpp: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addContentRuleLists): (WebKit::WebUserContentController::removeContentRuleList): (WebKit::WebUserContentController::removeAllContentRuleLists): (WebKit::WebUserContentController::addContentExtensions): Deleted. (WebKit::WebUserContentController::removeContentExtension): Deleted. (WebKit::WebUserContentController::removeAllContentExtensions): Deleted. * WebProcess/UserContent/WebUserContentController.h: * WebProcess/UserContent/WebUserContentController.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_backgroundCPULimit): 2017-05-12 Jeremy Jones Add objc version of WK2 UIPageClient setHasVideoInPictureInPicture and rename it to hasVideoInPictureInPictureDidChange. https://bugs.webkit.org/show_bug.cgi?id=172048 rdar://problem/32163054 Reviewed by Simon Fraser. Rename UIPageClient setHasVideoInPictureInPicture to hasVideoInPictureInPictureDidChange. Add missing _allowsPictureInPictureMediaPlayback property to WKPreferences. Add -hasVideoInPictureInPictureDidChange to UIDelegate. * UIProcess/API/APIUIClient.h: (API::UIClient::hasVideoInPictureInPictureDidChange): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _allowsPictureInPictureMediaPlayback]): (-[WKPreferences _setAllowsPictureInPictureMediaPlayback:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange): * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): 2017-05-12 David Quesada Add SPI for overriding WKWebView's clipping behavior for _visibleContentRect https://bugs.webkit.org/show_bug.cgi?id=172000 rdar://problem/32144756 Reviewed by Simon Fraser. Extract -[WKWebView _visibleContentRect]'s use of -_scroller to a new property _enclosingViewForExposedRectComputation, which is declared in the private header for subclasses to implement custom logic for determining the view to clip rendering to. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _enclosingViewForExposedRectComputation]): (-[WKWebView _visibleRectInEnclosingView:]): (-[WKWebView _visibleContentRect]): (-[WKWebView _visibleRectInEnclosingScrollView:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-05-12 Chris Dumez Stop using PassRefPtr under WebKit2/UIProcess https://bugs.webkit.org/show_bug.cgi?id=172029 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::registerEditCommand): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: (getIconSurfaceSynchronously): * UIProcess/API/gtk/WebKitWebContext.cpp: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::registerEditCommand): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::registerEditCommand): * UIProcess/DefaultUndoController.cpp: (WebKit::DefaultUndoController::registerEditCommand): * UIProcess/DefaultUndoController.h: * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::create): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::createRequest): * UIProcess/GeolocationPermissionRequestManagerProxy.h: * UIProcess/InspectorServer/HTTPRequest.cpp: (WebKit::HTTPRequest::parseHTTPRequestFromBuffer): * UIProcess/InspectorServer/HTTPRequest.h: * UIProcess/InspectorServer/WebInspectorServer.cpp: (WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest): (WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest): (WebKit::WebInspectorServer::didEstablishWebSocketConnection): * UIProcess/InspectorServer/WebInspectorServer.h: * UIProcess/InspectorServer/WebSocketServerClient.h: (WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest): (WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest): (WebKit::WebSocketServerClient::didEstablishWebSocketConnection): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::readHTTPMessage): (WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection): * UIProcess/InspectorServer/WebSocketServerConnection.h: * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp: (WebKit::NotificationPermissionRequestManagerProxy::createRequest): * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h: * UIProcess/Notifications/WebNotificationProvider.cpp: (WebKit::WebNotificationProvider::notificationPermissions): * UIProcess/Notifications/WebNotificationProvider.h: * UIProcess/PageClient.h: * UIProcess/Storage/LocalStorageDatabase.cpp: * UIProcess/WebContextMenuListenerProxy.h: * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::unapply): (WebKit::WebEditCommandProxy::reapply): * UIProcess/WebEditCommandProxy.h: * UIProcess/WebGrammarDetail.cpp: (WebKit::WebGrammarDetail::create): * UIProcess/WebGrammarDetail.h: * UIProcess/WebPageProxy.cpp: (WebKit::ExceededDatabaseQuotaRecords::createRecord): (WebKit::WebPageProxy::registerEditCommand): (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy): (WebKit::WebPageProxy::exceededDatabaseQuota): (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota): (WebKit::WebPageProxy::takeViewSnapshot): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::plugInAutoStartOriginHashes): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (-[WKEditCommandObjC initWithWebEditCommandProxy:]): (WebKit::PageClientImpl::registerEditCommand): (WebKit::PageClientImpl::saveImageToLibrary): (WebKit::PageClientImpl::setDragImage): (WebKit::PageClientImpl::takeViewSnapshot): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::saveImageToLibrary): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::registerEditCommand): (WebKit::PageClientImpl::setDragImage): (WebKit::PageClientImpl::setPromisedDataForImage): (WebKit::PageClientImpl::takeViewSnapshot): * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _webHitTestResult]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setDragImage): (WebKit::WebPageProxy::setPromisedDataForImage): * WebProcess/IconDatabase/WebIconDatabaseProxy.h: 2017-05-12 Jeremy Jones Add UIClient callback for when picture-in-picture is activated. https://bugs.webkit.org/show_bug.cgi?id=172023 Reviewed by Simon Fraser. Add WKUIPageClientV10 with setHasVideoInPictureInPicture. * UIProcess/API/APIUIClient.h: (API::UIClient::setHasVideoInPictureInPicture): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): 2017-05-12 Brent Fulgham REGRESSION(r213564): Flash audio playback failures https://bugs.webkit.org/show_bug.cgi?id=171876 Reviewed by Alexey Proskuryakov. The IOKit property filters added in r213564 need to be expanded to support some Flash features. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-05-12 Brent Fulgham [WK2][macOS] Add a mach-lookup exception for 'com.apple.analyticsd' https://bugs.webkit.org/show_bug.cgi?id=172040 Reviewed by Alexey Proskuryakov. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2017-05-12 Simon Fraser Add some logging for layer tree commits, and resize and orientation change events https://bugs.webkit.org/show_bug.cgi?id=172041 Reviewed by Tim Horton. Add some logging that's useful during rotation investigations. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLayerTree:]): 2017-05-12 Andy Estes [Cocoa] Stop setting a status on PKPaymentRequestShippingContactUpdate when there are errors https://bugs.webkit.org/show_bug.cgi?id=172036 Reviewed by Anders Carlsson. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): 2017-05-12 Chris Dumez Stop using PassRefPtr under WebKit2/Shared https://bugs.webkit.org/show_bug.cgi?id=172017 Reviewed by Antti Koivisto. * Shared/API/APIDictionary.cpp: (API::Dictionary::add): (API::Dictionary::set): * Shared/API/APIDictionary.h: * Shared/API/APISecurityOrigin.h: (API::SecurityOrigin::createFromString): (API::SecurityOrigin::create): (API::SecurityOrigin::securityOrigin): (API::SecurityOrigin::SecurityOrigin): * Shared/API/APISerializedScriptValue.h: (API::SerializedScriptValue::create): (API::SerializedScriptValue::SerializedScriptValue): * Shared/API/c/WKSharedAPICast.h: (WebKit::ProxyingRefPtr::ProxyingRefPtr): * Shared/APIWebArchiveResource.h: * Shared/APIWebArchiveResource.mm: (API::WebArchiveResource::create): (API::WebArchiveResource::WebArchiveResource): * Shared/AsyncRequest.h: (WebKit::AsyncRequestMap::add): * Shared/BlobDataFileReferenceWithSandboxExtension.cpp: (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension): * Shared/BlobDataFileReferenceWithSandboxExtension.h: * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::setBackBuffer): (WebKit::CoordinatedBackingStore::updateTile): * Shared/CoordinatedGraphics/CoordinatedBackingStore.h: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): (WebKit::CoordinatedGraphicsScene::updateImageBacking): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::getOrCreate): * Shared/Plugins/Netscape/NetscapePluginModule.h: * Shared/VisitedLinkTable.cpp: (WebKit::VisitedLinkTable::setSharedMemory): * Shared/VisitedLinkTable.h: * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::setSnapshot): * Shared/WebContextMenuItem.cpp: (WebKit::WebContextMenuItem::create): * Shared/WebContextMenuItem.h: * Shared/WebGeolocationPosition.h: * Shared/WebRenderLayer.cpp: (WebKit::WebRenderLayer::create): (WebKit::WebRenderLayer::createArrayFromLayerList): (WebKit::WebRenderLayer::WebRenderLayer): * Shared/WebRenderLayer.h: * Shared/WebRenderObject.cpp: (WebKit::WebRenderObject::create): (WebKit::WebRenderObject::WebRenderObject): * Shared/WebRenderObject.h: * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::resizeTable): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::setVisitedLinkTable): 2017-05-11 Brady Eidson [WKWebsiteDataStore removeDataOfTypes:...] doesn't work for IndexedDB if the data store has a custom IDB path. and https://bugs.webkit.org/show_bug.cgi?id=171994 Reviewed by Andy Estes. Informal review by Maureen Daum. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::deleteWebsiteData): Instead of accessing the m_idbServers set directly, make the method call that creates the server on demand. (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): Ditto. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Not only create the DatabaseProcess if necessary, but also notify it about the passed-in WebsiteDataStore. (WebKit::WebProcessPool::getDatabaseProcessConnection): (WebKit::WebProcessPool::ensureDatabaseProcess): Deleted. * UIProcess/WebProcessPool.h: (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::databaseProcessParameters): 2017-05-11 Dean Jackson Modern Media Controls shouldn't be an experimental feature https://bugs.webkit.org/show_bug.cgi?id=172004 Reviewed by Simon Fraser. This is either always on or always off, so shouldn't show up in an Experimental Features menu. * Shared/WebPreferencesDefinitions.h: Move ModernMediaControlsEnabled to a normal preference. 2017-05-11 Tim Horton Mail spins launching spell checker when typing https://bugs.webkit.org/show_bug.cgi?id=171986 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setEditable:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::didBecomeEditable): (WebKit::WebViewImpl::startObservingFontPanel): Deleted. Asynchronously pre-warm the spell checker when a WKWebView becomes editable. 2017-05-11 Chris Dumez Stop using PassRefPtr in platform/graphics https://bugs.webkit.org/show_bug.cgi?id=171977 Reviewed by Alex Christensen. Build fix. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded): (WebKit::CoordinatedGraphicsScene::removeBackingStoreIfNeeded): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::createImageBackingIfNeeded): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp: (WebKit::GraphicsLayerCARemote::createPlatformCALayer): (WebKit::GraphicsLayerCARemote::createPlatformCAAnimation): * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::copy): 2017-05-11 Tim Horton Data loss when saving a PDF form where only radio buttons/checkboxes were modified https://bugs.webkit.org/show_bug.cgi?id=171991 Reviewed by Andy Estes. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (-[WKPDFLayerControllerDelegate didChangeAnnotationState]): Mark the PDF as dirty (so we re-encode it when asked to save) if annotations that only PDFKit knows about change. 2017-05-11 Joseph Pecoraro Remove Vibration API https://bugs.webkit.org/show_bug.cgi?id=171766 Rubber-stamped by Alexey Proskuryakov. * CMakeLists.txt: * Shared/API/APIObject.h: * Shared/API/c/WKBase.h: * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKPage.cpp: (WKPageGetVibration): Deleted. * UIProcess/API/C/WKPage.h: * UIProcess/API/C/WKVibration.cpp: Removed. * UIProcess/API/C/WKVibration.h: Removed. * UIProcess/WebPageProxy.cpp: (WebKit::m_weakPtrFactory): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::vibration): Deleted. * UIProcess/WebVibrationProvider.cpp: Removed. * UIProcess/WebVibrationProvider.h: Removed. * UIProcess/WebVibrationProxy.cpp: Removed. * UIProcess/WebVibrationProxy.h: Removed. * UIProcess/WebVibrationProxy.messages.in: Removed. * WebProcess/WebCoreSupport/WebVibrationClient.cpp: Removed. * WebProcess/WebCoreSupport/WebVibrationClient.h: Removed. * WebProcess/WebPage/WebPage.cpp: 2017-05-11 Andy Estes Fix a spelling mistake in ApplePayErrorCode https://bugs.webkit.org/show_bug.cgi?id=171981 Reviewed by Beth Dakin. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentErrorCode): (WebKit::toPKPaymentAuthorizationStatus): 2017-05-11 John Wilander Resource Load Statistics: Enable configuration through preferences https://bugs.webkit.org/show_bug.cgi?id=171949 Reviewed by Alex Christensen. * Shared/WebPreferencesDefinitions.h: Added ResourceLoadStatisticsTimeToLiveUserInteraction, ResourceLoadStatisticsTimeToLiveCookiePartitionFree, and ResourceLoadStatisticsReducedTimestampResolution. * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Added. (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded): * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Now calls WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded(). * WebKit2.xcodeproj/project.pbxproj: 2017-05-11 Claudio Saavedra [GTK] Remove notifications guards from GTK API layer https://bugs.webkit.org/show_bug.cgi?id=170014 Reviewed by Michael Catanzaro. ENABLE_NOTIFICATIONS in the GTK port is a private option and disabling it is unsupported, hence remove its guards from the GTK API layer. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): 2017-05-11 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.2 release. * gtk/NEWS: Add release notes for 2.17.2. 2017-05-11 Claudio Saavedra [GTK] JavaScript prompt uses title of page to be loaded rather than title of current page https://bugs.webkit.org/show_bug.cgi?id=152690 Reviewed by Michael Catanzaro. webkit_web_view_get_uri() returns the page to be loaded, use internal api for this. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewCreateJavaScriptDialog): 2017-05-10 Tim Horton Null deref in WebPage::dictionaryPopupInfoForRange https://bugs.webkit.org/show_bug.cgi?id=171959 Reviewed by Beth Dakin. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::dictionaryPopupInfoForRange): Speculative fix for non-reproducible crash when the startContainer of the range is in an anonymous node. 2017-05-09 Sam Weinig Remove support for legacy Notifications https://bugs.webkit.org/show_bug.cgi?id=171487 Reviewed by Jon Lee. * Configurations/FeatureDefines.xcconfig: * Shared/WebProcessCreationParameters.cpp: * Shared/WebProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: * WebProcess/Notifications/NotificationPermissionRequestManager.h: * WebProcess/Notifications/WebNotificationManager.cpp: * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/WebCoreSupport/WebNotificationClient.cpp: * WebProcess/WebCoreSupport/WebNotificationClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebProcess.cpp: Remove legacy notification specific code. 2017-05-10 Tim Horton Add an experimental feature flag for viewport-fit https://bugs.webkit.org/show_bug.cgi?id=171948 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add an experimental feature flag. 2017-05-10 Alex Christensen Include headers in WebKit.h https://bugs.webkit.org/show_bug.cgi?id=171943 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WebKit.h: 2017-05-10 Timothy Horton Disable block selection for dynamic selection granularity https://bugs.webkit.org/show_bug.cgi?id=171908 Reviewed by Enrica Casucci. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _allowsBlockSelection]): (-[WKWebViewConfiguration _setAllowsBlockSelection:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Add a private configuration parameter to re-enable block selection. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _allowsBlockSelection]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/VersionChecks.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::allowsBlockSelection): * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: Plumb allowsBlockSelection through from WKWebViewConfiguration to WebPage. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView useSelectionAssistantWithGranularity:]): (-[WKContentView _startAssistingKeyboard]): (-[WKContentView _stopAssistingKeyboard]): (toUIWebSelectionMode): Deleted. (-[WKContentView useSelectionAssistantWithMode:]): Deleted. Stop needlessly converting to UIWebSelectionMode. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::shouldSwitchToBlockModeForHandle): Don't switch to block selection unless allowsBlockSelection is set. 2017-05-10 Tim Horton Add an experimental feature flag for constant properties https://bugs.webkit.org/show_bug.cgi?id=171913 Reviewed by Ryosuke Niwa. * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Add an experimental feature flag. 2017-05-09 Dean Jackson Disable WebGL2 by default https://bugs.webkit.org/show_bug.cgi?id=171894 Reviewed by Tim Horton. Some WASM and WebGL2 content is failing because it detects our WebGL2RenderingContext, but doesn't realise that we don't implement enough of it to be useful. * Shared/WebPreferencesDefinitions.h: 2017-05-10 Matt Lewis Unreviewed, rolling out r216563. Revision caused 2 api failures Reverted changeset: "[MediaStream] deviceId constraint doesn't work with getUserMedia" https://bugs.webkit.org/show_bug.cgi?id=171877 http://trac.webkit.org/changeset/216563 2017-05-10 Claudio Saavedra [GTK] HTTP authentication dialog should focus on first input field https://bugs.webkit.org/show_bug.cgi?id=151349 Reviewed by Michael Catanzaro. Setting focus on a widget before it's mapped does nothing. Move the call to the right place. * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: (webkitAuthenticationDialogInitialize): (webkitAuthenticationDialogMap): 2017-05-10 Michael Catanzaro [GTK] -Wmissing-field-initializers triggered by RemoteInspectorServer.cpp:128 https://bugs.webkit.org/show_bug.cgi?id=171273 Reviewed by Carlos Garcia Campos. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): 2017-05-09 Eric Carlson [MediaStream] deviceId constraint doesn't work with getUserMedia https://bugs.webkit.org/show_bug.cgi?id=171877 Reviewed by Jer Noble. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode deviceIDHashSalt. (IPC::ArgumentCoder::decode): Decode deviceIDHashSalt. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize completion handler, frame ID, and security origins. (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling completion handler because we now sometimes request access info before calling gUM. (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler. * UIProcess/UserMediaPermissionCheckProxy.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy. (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt when origins don't match. (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto. Don't set state for empty UIDs. Pass hash salt to web process. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): The device ID hash salt is now required to validate constraints, so get it first. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper method used to get the device ID hash salt. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure to use getUserMediaPermissionInfo. (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID hash salt parameter. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): Ditto. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData constructor. 2017-05-09 Alex Christensen Buffer media in NetworkProcess to reduce IPC overhead https://bugs.webkit.org/show_bug.cgi?id=171834 Reviewed by Jer Noble. I have measured a significant CPU usage reduction when buffering media data in the NetworkProcess, especially on arm64 processors. Buffering data in the NetworkProcess introduces no additional data copies after r215686, and it reduces the number of messages sent from the NetworkProcess to the WebProcess, each of which must also be forwarded to mediaserverd by AVFoundation. This reduces the number of messages from thousands per second to a maximum of 20 per second. This adds 1/20 second additional latency in media loading, which will probably not be noticed by most users. This also adds the possibility of large allocations when decoding IPC messages in the WebProcess, and if that becomes the source of crashes we can add a maximum buffered amount in addition to a maximum buffered time, but we are likely not to receive so much data in 1/20 second to have problems allocating the buffer. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): Buffer data in the NetworkProcess for up to 50ms before sending it to the WebProcess in one message. This value is used in NetworkResourceLoader::didReceiveBuffer to append to m_bufferedData instead of sending the small chunks immediately. 2017-05-09 Commit Queue Unreviewed, rolling out r216545. https://bugs.webkit.org/show_bug.cgi?id=171889 Caused a test failure (Requested by eric_carlson on #webkit). Reverted changeset: "[MediaStream] deviceId constraint doesn't work with getUserMedia" https://bugs.webkit.org/show_bug.cgi?id=171877 http://trac.webkit.org/changeset/216545 2017-05-09 Eric Carlson [MediaStream] deviceId constraint doesn't work with getUserMedia https://bugs.webkit.org/show_bug.cgi?id=171877 Reviewed by Jer Noble. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode deviceIDHashSalt. (IPC::ArgumentCoder::decode): Decode deviceIDHashSalt. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize completion handler, frame ID, and security origins. (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling completion handler because we now sometimes request access info before calling gUM. (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler. * UIProcess/UserMediaPermissionCheckProxy.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy. (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt when origins don't match. (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto. Don't set state for empty UIDs. Pass hash salt to web process. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): The device ID hash salt is now required to validate constraints, so get it first. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper method used to get the device ID hash salt. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure to use getUserMediaPermissionInfo. (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID hash salt parameter. * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): Ditto. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData constructor. 2017-05-10 Dean Jackson Restrict SVG filters to accessible security origins https://bugs.webkit.org/show_bug.cgi?id=118689 Reviewed by Brent Fulgham. Update parameter lists. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::paint): * WebProcess/Plugins/PluginView.h: 2017-05-09 Yoshiaki Jitsukawa [Coordinated Graphics] Debug Visuals don't hide https://bugs.webkit.org/show_bug.cgi?id=162704 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): The encoder and decoder for DebugVisuals have been added. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::setLayerState): Update the debug visuals of a layer according to the DebugVisuals information if the debugVisualsChanged flag is set to true. 2017-05-09 Zan Dobersek Upstream the WPE port https://bugs.webkit.org/show_bug.cgi?id=171110 Reviewed by Alex Christensen. webkit-dev thread: https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html Existing files changed to properly use PLATFORM(WPE) build guards or other WPE-specific additions (e.g. pasteboard support). In-file changes removed from this ChangeLog entry for brevity. * Platform/IPC/glib/GSocketMonitor.cpp: * PlatformWPE.cmake: Added. * Scripts/generate-forwarding-headers.pl: * Shared/API/c/WKBase.h: * Shared/API/c/wpe/WKBaseWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/API/c/wpe/WebKit.h: Added. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Shared/DrawingAreaInfo.h: * Shared/NativeWebKeyboardEvent.h: * Shared/NativeWebMouseEvent.h: * Shared/NativeWebTouchEvent.h: * Shared/NativeWebWheelEvent.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * Shared/WebPreferencesDefinitions.h: * Shared/wpe/NativeWebKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/wpe/NativeWebMouseEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/wpe/NativeWebTouchEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/wpe/NativeWebWheelEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * Shared/wpe/ProcessExecutablePathWPE.cpp: Added. * Shared/wpe/WebEventFactory.cpp: Added. * Shared/wpe/WebEventFactory.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/wpe/WKAPICastWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/C/wpe/WKView.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/C/wpe/WKView.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h. * UIProcess/API/wpe/CompositingManagerProxy.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/CompositingManagerProxy.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Added. * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Added. * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h. * UIProcess/API/wpe/PageClientImpl.cpp: Added. * UIProcess/API/wpe/PageClientImpl.h: Added. * UIProcess/API/wpe/ScrollGestureController.cpp: Added. * UIProcess/API/wpe/ScrollGestureController.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/WPEView.cpp: Added. * UIProcess/API/wpe/WPEView.h: Added. * UIProcess/API/wpe/WPEViewClient.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/WPEViewClient.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml: Added. * UIProcess/ChildProcessProxy.cpp: * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Added. * UIProcess/WebInspectorProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/WebProcessPool.cpp: * UIProcess/wpe/TextCheckerWPE.cpp: Added. * UIProcess/wpe/WebInspectorProxyWPE.cpp: Added. * UIProcess/wpe/WebPageProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/wpe/WebPasteboardProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * UIProcess/wpe/WebPreferencesWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h. * UIProcess/wpe/WebProcessPoolWPE.cpp: Added. * WebKit2.xcodeproj/project.pbxproj: * WebKit2Prefix.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/wpe/WebContextMenuClientWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: Added. * WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/DrawingArea.cpp: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/wpe/CompositingManager.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/wpe/CompositingManager.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Added. * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Added. * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * WebProcess/WebPage/wpe/WebPageWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h. * WebProcess/wpe/WebProcessMainWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h. * wpe/wpe-webkit.pc.in: Added. 2017-05-09 Carlos Garcia Campos [GTK] Building Webkit2Gtk without OpenGL fails. https://bugs.webkit.org/show_bug.cgi?id=170959 Reviewed by Žan Doberšek. * UIProcess/gtk/HardwareAccelerationManager.cpp: (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): 2017-05-08 Youenn Fablet Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing https://bugs.webkit.org/show_bug.cgi?id=171824 Reviewed by Alex Christensen. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): 2017-05-08 Brent Fulgham REGRESSION(r213564): Flash video playback failures https://bugs.webkit.org/show_bug.cgi?id=171840 Reviewed by Alexey Proskuryakov. The sandbox restrictions added in r213564 to prevent access to unused iokit properties blocked some items needed for Flash video playback. This change relaxes the sandbox to allow this software to run properly. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2017-05-08 Alex Christensen Reduce PassRefPtr use in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=171831 Reviewed by Chris Dumez. * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupCreateWithIdentifier): * UIProcess/GenericCallback.h: (WebKit::GenericCallback::create): (WebKit::CallbackMap::put): * UIProcess/StatisticsRequest.cpp: (WebKit::StatisticsRequest::StatisticsRequest): * UIProcess/StatisticsRequest.h: (WebKit::StatisticsRequest::create): * UIProcess/TextChecker.h: * UIProcess/TextCheckerCompletion.cpp: (WebKit::TextCheckerCompletion::create): * UIProcess/TextCheckerCompletion.h: * UIProcess/WebColorPicker.h: (WebKit::WebColorPicker::create): * UIProcess/WebConnectionToWebProcess.cpp: (WebKit::WebConnectionToWebProcess::create): * UIProcess/WebConnectionToWebProcess.h: * UIProcess/WebContextInjectedBundleClient.cpp: (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData): * UIProcess/WebContextInjectedBundleClient.h: * UIProcess/WebContextMenuListenerProxy.h: (WebKit::WebContextMenuListenerProxy::create): * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::create): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebEditCommandProxy.h: (WebKit::WebEditCommandProxy::create): * UIProcess/WebFormSubmissionListenerProxy.h: (WebKit::WebFormSubmissionListenerProxy::create): * UIProcess/WebFrameListenerProxy.h: * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::create): * UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::create): * UIProcess/WebFullScreenManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::create): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::create): (WebKit::WebIconDatabase::iconDataForPageURL): * UIProcess/WebIconDatabase.h: * UIProcess/WebMediaSessionFocusManager.cpp: (WebKit::WebMediaSessionFocusManager::create): * UIProcess/WebMediaSessionFocusManager.h: * UIProcess/WebOpenPanelResultListenerProxy.h: (WebKit::WebOpenPanelResultListenerProxy::create): * UIProcess/WebPageGroup.cpp: (WebKit::WebPageGroup::create): * UIProcess/WebPageGroup.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::computePagesForPrinting): (WebKit::WebPageProxy::drawRectToImage): (WebKit::WebPageProxy::drawPagesToPDF): (WebKit::WebPageProxy::drawPagesForPrinting): (WebKit::WebPageProxy::callAfterNextPresentationUpdate): * UIProcess/WebPageProxy.h: * UIProcess/ios/TextCheckerIOS.mm: (WebKit::TextChecker::requestCheckingOfString): * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::requestCheckingOfString): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): (-[WKPrintingView _drawPreview:]): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::loadURL): (WebKit::NetscapePlugin::manualStreamDidReceiveResponse): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: (WebKit::NetscapePluginStream::create): * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toFormData): 2017-05-08 Youenn Fablet Add support for reading and writing settings from UIProcess audio capture https://bugs.webkit.org/show_bug.cgi?id=171633 Reviewed by Eric Carlson. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::applyConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setSettings): (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded): (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed): (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::sourceSettingsChanged): (WebKit::UserMediaCaptureManager::applyConstraints): (WebKit::UserMediaCaptureManager::applyConstraintsSucceeded): (WebKit::UserMediaCaptureManager::applyConstraintsFailed): (WebKit::UserMediaCaptureManager::Source::setMuted): Deleted. (WebKit::UserMediaCaptureManager::Source::setEnabled): Deleted. * WebProcess/cocoa/UserMediaCaptureManager.h: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: 2017-05-08 Alex Christensen Reduce PassRefPtr use https://bugs.webkit.org/show_bug.cgi?id=171809 Reviewed by Chris Dumez. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::setInitializationReply): * PluginProcess/PluginControllerProxy.h: * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::destroyPlugin): (WebKit::WebProcessConnection::createPlugin): * PluginProcess/WebProcessConnection.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runOpenPanel): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::registerUndoStep): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::getOrCreate): * WebProcess/WebPage/VisitedLinkTableController.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::hitTest): (WebKit::WebFrame::createSelectionSnapshot): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebOpenPanelResultListener.cpp: (WebKit::WebOpenPanelResultListener::create): (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener): * WebProcess/WebPage/WebOpenPanelResultListener.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::unapplyEditCommand): (WebKit::WebPage::reapplyEditCommand): * WebProcess/WebPage/WebPageGroupProxy.cpp: (WebKit::WebPageGroupProxy::create): * WebProcess/WebPage/WebPageGroupProxy.h: * WebProcess/WebPage/WebUndoStep.cpp: (WebKit::WebUndoStep::create): * WebProcess/WebPage/WebUndoStep.h: (WebKit::WebUndoStep::step): (WebKit::WebUndoStep::WebUndoStep): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::create): (WebKit::PlatformCALayerRemote::clone): (WebKit::PlatformCALayerRemote::animationForKey): (WebKit::PlatformCALayerRemote::createCompatibleLayer): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::create): (WebKit::PlatformCALayerRemoteCustom::clone): 2017-05-08 Jer Noble [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set. https://bugs.webkit.org/show_bug.cgi?id=171710 Reviewed by Eric Carlson. RealtimeMediaSourceCenterMac's setUseAVFoundationAudioCapture() is now accessed via a singleton. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): 2017-05-08 Andy Estes [macOS] com.macromedia.Flash Player ESR.plugin.sb is installed outside of PlugInSandboxProfiles https://bugs.webkit.org/show_bug.cgi?id=171774 Reviewed by Dan Bernstein. * WebKit2.xcodeproj/project.pbxproj: 2017-05-08 Youenn Fablet Clean UserMediaCaptureManager::capabilities return value https://bugs.webkit.org/show_bug.cgi?id=171808 Reviewed by Eric Carlson. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::capabilities): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-05-08 Chris Dumez Move 'style' from Element to HTMLElement / SVGElement and make it settable https://bugs.webkit.org/show_bug.cgi?id=171795 Reviewed by Alex Christensen. Build fix. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::shouldApplyStyle): 2017-05-07 Simon Fraser [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange https://bugs.webkit.org/show_bug.cgi?id=171140 rdar://problem/31765167 Reviewed by Sam Weinig. WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport from the UI process, but in this case we need to compute one in the web process. So factor code into FrameView to do the computation, called from both places. * UIProcess/WebPageProxy.h: * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect): * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2017-05-07 Youenn Fablet [MediaStream] r216197 caused some webrtc tests to fail https://bugs.webkit.org/show_bug.cgi?id=171728 Reviewed by Eric Carlson. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Removing muting streams of the page requesting additional capture streams. This is now done in the WebProcess. 2017-05-07 Tim Horton Clean up some WebProcessProxy, WebPage, and message handler includes https://bugs.webkit.org/show_bug.cgi?id=171791 Reviewed by Sam Weinig. This is worth another ~10% off WebKit2 clean build time on Mac. This time, the most impactful change is the removal of UserMediaPermissionRequestManager.h from WebPage.h, which completely eradicates JSC's VM.h (which is enormous) from WebPage.h (at least on Mac). * Scripts/webkit/messages.py: (headers_for_type): Stop specializing CompositionUnderline now that it has its own file. * Shared/API/c/WKDeprecatedFunctions.cpp: * Shared/WebCoreArgumentCoders.cpp: * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm: * UIProcess/Gamepad/UIGamepadProvider.cpp: * UIProcess/HiddenPageThrottlingAutoIncreasesCounter.h: Added. * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: * UIProcess/Network/NetworkProcessProxy.cpp: * UIProcess/PerActivityStateCPUUsageSampler.cpp: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::toWebCore): * UIProcess/VisibleWebPageCounter.h: Added. * UIProcess/VisitedLinkStore.h: * UIProcess/WebPageGroup.h: * UIProcess/WebPageProxy.h: * UIProcess/WebProcessLifetimeTracker.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: Remove WebPageProxy and forward-declare a whole bunch of things. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): (WebKit::WebPage::userMediaAccessWasDenied): (WebKit::WebPage::didCompleteMediaDeviceEnumeration): (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::userMediaPermissionRequestManager): * WebProcess/WebPage/ios/FindControllerIOS.mm: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: (WebKit::RemoteLayerTreeContext::deviceScaleFactor): Deleted. (WebKit::RemoteLayerTreeContext::layerHostingMode): Deleted. * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::deviceScaleFactor): (WebKit::RemoteLayerTreeContext::layerHostingMode): 2017-05-06 Chris Dumez Align our IDL files with the latest DOM specification https://bugs.webkit.org/show_bug.cgi?id=171777 Reviewed by Sam Weinig. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp: (webkit_dom_document_get_ready_state): 2017-05-06 Tim Horton Reduce the number of includes in WebPage.h and WebProcess.h https://bugs.webkit.org/show_bug.cgi?id=171779 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: * WebProcess/Network/NetworkProcessConnection.cpp: * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: * WebProcess/Network/webrtc/LibWebRTCResolver.cpp: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: * WebProcess/WebPage/FindController.cpp: * WebProcess/WebPage/WebFrame.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): Deleted. (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): Deleted. * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h: * WebProcess/WebProcess.cpp: * WebProcess/WebProcess.h: In my measurement, this improves WebKit2 debug clean build time by ~10% for Mac and ~5% for iOS. The most valuable change is the one to remove LibWebRTC headers.. 2017-05-06 Alexey Proskuryakov REGRESSION (r216294): The new test fails on WebKit1 https://bugs.webkit.org/show_bug.cgi?id=171780 Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296, https://trac.webkit.org/216299, https://trac.webkit.org/216330 * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::paint): * WebProcess/Plugins/PluginView.h: 2017-05-06 Simon Fraser [iOS WK2] Make rotation tests more reliable https://bugs.webkit.org/show_bug.cgi?id=171778 Reviewed by Tim Horton. Switching between "safari-style" rotation and normal rotation left state on the WKWebView that would cause later viewport-sensitive tests to fail. The WKWebView would be left with override layout parameters, and an override orientation, and these caused viewport size to leak into later tests, and WebCore orientation to not get reset correctly. Also, WKWebView was unregistering for UIWindowDidRotateNotification notifications when an override orientation was set, and would never re-register, causing lost orientationchanged events. Fix by exposing WKWebView SPI to clear the various bits of overide state. Also don't unregister from the UIWindowDidRotateNotification notification; it's already ignored anyway if it fires. Also wait for a visible content rect update after resizing the WKWebVeiw between tests, to make sure the WebProcess is caught up before proceeding with the test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _clearInterfaceOrientationOverride]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _clearOverrideLayoutParameters]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-05-06 Konstantin Tokarev Remove unused lambda capture https://bugs.webkit.org/show_bug.cgi?id=171772 Reviewed by Yusuke Suzuki. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): 2017-05-06 David Kilzer messages_unittest.py should support a [-r|--reset-results] switch Reviewed by Daniel Bates. This change adds support for a [-r|--reset-results] switch when running messages_unittest.py to make it easy to update the expected file results. This also cleans up a lot of duplicate code in messages_unittest.py by extracting common code into new methods and by pushing code down into methods where it's actually used. * Scripts/webkit/LegacyMessageReceiver-expected.cpp: * Scripts/webkit/LegacyMessages-expected.h: * Scripts/webkit/MessageReceiver-expected.cpp: * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: * Scripts/webkit/Messages-expected.h: * Scripts/webkit/MessagesSuperclass-expected.h: - Update expected files using the new --reset-results switch. * Scripts/webkit/messages_unittest.py: - Remove what appears to be a debugging print statement. - Replace the code that reads in expected files with variables that contain the expected file names. The code to read in the contents moved into GeneratedFileContentsTest.assertGeneratedFileContentsEqual(). (ParsingTest.check_message): - Drive-by fix to change "!= None" to "is not None". (GeneratedFileContentsTest.assertGeneratedFileContentsEqual): - Add support for [-r|--reset-results] switch here. This will write out updated expected file contents when the switch is used. - Push down most of the global code that reads in file contents into this method. - Change use of split('\n') into splitlines(False). (GeneratedFileContentsTest.assertHeaderEqual): Add. - Extracts common code from test_receiver_headers(). (GeneratedFileContentsTest.assertImplementationEqual): Add. - Extracts common code from test_receiver_implementations(). (HeaderTest): (HeaderTest.test_receiver_headers): - Rename from HeaderTest.test_header(). - Simplify by calling assertHeaderEqual(). (ReceiverImplementationTest): (ReceiverImplementationTest.test_receiver_implementations): - Rename from ReceiverImplementationTest.test_receiver_implementation(). - Simplify by calling assertImplementationEqual(). (add_reset_results_to_unittest_help): Add. - Inserts help text for [-r|--reset-results] switch. (parse_sys_argv): Add. - Parses [-r|--reset-results] switch, and then removes it from sys.argv. We do this instead of using argparse so that the original help for the unittest module is still shown when using --help. 2017-05-05 Timothy Horton [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging) https://bugs.webkit.org/show_bug.cgi?id=171764 Reviewed by Simon Fraser. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::dragImageForView): Always use the last mouse down event to originate the drag; this was a 2004 hack to work around a seemingly-fixed macOS bug that somehow propagated into WebKit2. With WebKit2, this would cause trouble because currentEvent could move on during the bounce to the Web Content process and back, causing the delta between clientPoint and the mouse point to be dependent on timing, and thus causing the link to sit at timing-dependent distance from the cursor, instead of exactly where dragOffsetForLinkDragImage placed it. 2017-05-05 Brady Eidson API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator. and https://bugs.webkit.org/show_bug.cgi?id=171513 Reviewed by Andy Estes. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): 2017-05-05 Dean Jackson Restrict SVG filters to accessible security origins https://bugs.webkit.org/show_bug.cgi?id=118689 Reviewed by Brent Fulgham. Update parameter lists. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::paint): * WebProcess/Plugins/PluginView.h: 2017-05-05 Beth Dakin Ensure NSColorPickerTouchBarItem only uses sRGB colors https://bugs.webkit.org/show_bug.cgi?id=171758 -and corresponding- rdar://problem/28314183 Reviewed by Tim Horton. * UIProcess/Cocoa/WebViewImpl.mm: (-[WKTextTouchBarItemController itemForIdentifier:]): 2017-05-05 Brent Fulgham [WK2][iOS][macOS] Expand sandbox to access vm.footprint_suspend https://bugs.webkit.org/show_bug.cgi?id=171749 Reviewed by Geoffrey Garen. The 'sysctl' whitelist needs to be extended to support an additional VM-related feature. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2017-05-05 John Wilander Resource Load Statistics: Don't cover in-memory and disk caches during website data removal https://bugs.webkit.org/show_bug.cgi?id=171741 Reviewed by Brent Fulgham. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): No longer removes WebsiteDataType::DiskCache or WebsiteDataType::MemoryCache. 2017-05-05 Brian Burg CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57 https://bugs.webkit.org/show_bug.cgi?id=171669 Reviewed by Mark Lam. safaridriver's AutomaticInspection capability causes us to call WebInspectorProxy::connect() underneath the Automation.inspectBrowsingContext command. This fires a NeedDebuggerBreak interrupt for the web content's VM, but this is racy because the web content process may not yet be fully initialized when this interrupt is handled. To work around this, just don't deliver any interrupts if the VM singleton is still null. This is a reliable signal that the web content process is not fully initialized yet. Not delivering is harmless; the interrupt only exists to break out of infinite loops in JS code, but there could not be any such infinite loop yet if the web content process is not fully initialized. * WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp: (WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak): 2017-05-05 Brian Burg Web Automation: cookie-related commands don't work correctly https://bugs.webkit.org/show_bug.cgi?id=171713 Reviewed by Alexey Proskuryakov. Commands that use WebCookieManager directly should complete when the manager's completion handler is called. Otherwise, this will race with subsequent accesses to cookies via the web process (document.cookie). Also, these commands need to use the active browsing context's session ID. They currently use the process pool's storage session, which is wrong since we specially configure automation instances with an ephemeral store. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::addSingleCookie): (WebKit::WebAutomationSession::deleteAllCookies): 2017-05-05 Chris Dumez Rename webProcessDidCrashWithReason callback to webProcessDidTerminate and stop calling webProcessDidCrash for client terminations https://bugs.webkit.org/show_bug.cgi?id=171624 Reviewed by Dan Bernstein. Follow-up fixes after r216129 based on feedback I have received: - Rename webProcessDidCrashWithReason callback function to webProcessDidTerminate given that this is called for non-crashes (e.g. terminations requested by the client). - Rename WKProcessCrashReason / ProcessCrashReason to WKProcessTerminationReason / ProcessTerminationReason for consistency with the new naming. - Stop calling processDidCrash / webProcessDidCrash for terminations requested by the client, to maintain pre-r216129 behavior. Those are not crashes (The client used an API such as WKPageTerminateProcess()). webProcessDidTerminate will still be called though. - Fix a bug where - for terminations due to resource limits - WebPageProxy::processDidCrash() was getting called twice: First by WebProcessProxy::requestTermination() with reason "RequestedByClient" then a second time by WebProcessProxy::terminateProcessDueToResourceLimits() with the proper reason. * Shared/ProcessTerminationReason.h: Renamed from Source/WebKit2/Shared/ProcessCrashReason.h. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::processDidTerminate): * UIProcess/API/C/WKAPICast.h: (WebKit::toAPI): * UIProcess/API/C/WKPage.cpp: (WKPageTerminate): (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/C/WKProcessTerminationReason.h: Renamed from Source/WebKit2/UIProcess/API/C/WKProcessCrashReason.h. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _killWebContentProcessAndResetState]): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::processDidTerminate): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidTerminate): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::requestTermination): (WebKit::WebProcessProxy::logDiagnosticMessageForResourceLimitTermination): (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: 2017-05-05 Derek Schuff Mac cmake buildfix after r216037 https://bugs.webkit.org/show_bug.cgi?id=171558 Reviewed by JF Bastien. * PlatformMac.cmake: 2017-05-05 Carlos Alberto Lopez Perez [GTK] Enable runtime flag for MediaDevices with enable-media-stream property. https://bugs.webkit.org/show_bug.cgi?id=171730 Reviewed by Michael Catanzaro. After r215939 the MediaDevices runtime setting has to be enabled also to use MediaStream / WebRTC. Enable it as part of the enable-media-stream property of the WebKitGTK+ API. * UIProcess/API/gtk/WebKitSettings.cpp: (webkit_settings_set_enable_media_stream): 2017-05-05 Carlos Garcia Campos [GTK] Assertion failure in Inspector::RemoteInspector::setRemoteInspectorClient when disposing WebKitWebContext https://bugs.webkit.org/show_bug.cgi?id=171644 Reviewed by Michael Catanzaro. Ensure that it's not possible to enable automation in more than one WebKitWebContext at the same time. Instead of creating the AutomationClient unconditionally when the context is constructed, it's now created only when automation is enabled, and deleted if it's disabled. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_is_automation_allowed): (webkit_web_context_set_automation_allowed): * UIProcess/Cocoa/AutomationClient.mm: (WebKit::AutomationClient::AutomationClient): (WebKit::AutomationClient::~AutomationClient): 2017-05-04 Commit Queue Unreviewed, rolling out r216206. https://bugs.webkit.org/show_bug.cgi?id=171714 Multiple LayoutTests crashing in Document::page() (Requested by ap on #webkit). Reverted changeset: "Remove support for legacy Notifications" https://bugs.webkit.org/show_bug.cgi?id=171487 http://trac.webkit.org/changeset/216206 2017-05-04 Mark Lam NeverDestroyed(ASCIILiteral(...)) is not thread safe. https://bugs.webkit.org/show_bug.cgi?id=171586 Reviewed by Yusuke Suzuki. * Shared/API/APIError.cpp: (API::Error::webKitErrorDomain): (API::Error::webKitNetworkErrorDomain): (API::Error::webKitPolicyErrorDomain): (API::Error::webKitPluginErrorDomain): (API::Error::webKitDownloadErrorDomain): (API::Error::webKitPrintErrorDomain): * Shared/WebPreferencesKeys.cpp: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::executeEditCommand): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::didBeginEditing): (WebKit::WebEditorClient::respondToChangedContents): (WebKit::WebEditorClient::respondToChangedSelection): (WebKit::WebEditorClient::didEndEditing): 2017-05-04 Jeremy Jones Add mute to WebPlaybackSessionModel. https://bugs.webkit.org/show_bug.cgi?id=171592 rdar://problem/31814074 Reviewed by Jer Noble. Plumb through muted. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::toggleMuted): (WebKit::WebPlaybackSessionModelContext::setMuted): (WebKit::WebPlaybackSessionManagerProxy::setMuted): (WebKit::WebPlaybackSessionManagerProxy::toggleMuted): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::mutedChanged): (WebKit::WebPlaybackSessionManager::mutedChanged): (WebKit::WebPlaybackSessionManager::toggleMuted): 2017-05-04 Wenson Hsieh [WK2] Image action sheets sometimes do not dismiss when beginning data interaction https://bugs.webkit.org/show_bug.cgi?id=171687 Reviewed by Beth Dakin. When presenting an image sheet using WKActionSheetAssistant, we may present the popover asynchronously. In this case, even if -cleanupSheet is invoked after -showImageSheet, the popover will still be presented. To fix this, add a flag, _hasPendingActionSheet, that is set to true when an image action sheet will be presented in the future. In cleanupSheet, we revert this flag to NO, and in the sheet presentation block, we first check to see if there is a pending action sheet. If there is not, then simply do not invoke the image sheet presentation block. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant cleanupSheet]): 2017-05-04 Wenson Hsieh [WK2] Add support for keeping the selection in a focused editable element when dragging begins https://bugs.webkit.org/show_bug.cgi?id=171585 Reviewed by Beth Dakin and Zalan Bujtas. Minor adjustments and refactoring in WebKit2. See WebCore ChangeLog for more details. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::didStartDrag): Factor out code in WebPageProxy that sends a WebPage::DidStartDrag message to the web process into a separate helper, and tweak the places where we directly send this IPC message to the web process to instead call this helper. * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setDragImage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didStartDrag): (WebKit::WebPage::dragCancelled): Clear out state in the web process and call out to the EventHandler to handle drag cancellation and the drag start response from the UI process. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::didStartDrag): Deleted. (WebKit::WebPage::dragCancelled): Deleted. 2017-05-04 Sam Weinig Remove support for legacy Notifications https://bugs.webkit.org/show_bug.cgi?id=171487 Reviewed by Jon Lee. * Configurations/FeatureDefines.xcconfig: * Shared/WebProcessCreationParameters.cpp: * Shared/WebProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/Notifications/NotificationPermissionRequestManager.cpp: * WebProcess/Notifications/NotificationPermissionRequestManager.h: * WebProcess/Notifications/WebNotificationManager.cpp: * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/WebCoreSupport/WebNotificationClient.cpp: * WebProcess/WebCoreSupport/WebNotificationClient.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebProcess.cpp: Remove legacy notification specific code. 2017-05-04 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. * UIProcess/API/C/WKPage.cpp: (WKPageSetMediaCaptureEnabled): New. (WKPageGetMediaCaptureEnabled): New. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMediaCaptureEnabled:]): New. (-[WKWebView _mediaCaptureEnabled]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS and iOS. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the rejection timer. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): Call invalidatePendingRequests. (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all pending requests. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and schedule the timer if there are any others pending. (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't prompt the user if capture is disabled. (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current page on iOS. (WebKit::UserMediaProcessManager::setCaptureEnabled): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaCaptureEnabled): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::mediaCaptureEnabled): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending requests. (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request. (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopMediaCapture): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-05-04 Konstantin Tokarev Fix compilation with ICU 59.1 https://bugs.webkit.org/show_bug.cgi?id=171612 Reviewed by Mark Lam. ICU 59.1 has broken source compatibility. Now it defines UChar as char16_t, which does not allow automatic type conversion from unsigned short in C++ code. * Shared/API/c/WKString.cpp: (WKStringGetCharacters): 2017-05-04 Dan Bernstein [Cocoa] -[WKWebsiteDataStore httpCookieStore] is declared in the main @interface but implemented in a category https://bugs.webkit.org/show_bug.cgi?id=171657 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore httpCookieStore]): Moved from the WKPrivate category into the main @implementation block. 2017-05-04 Andy Estes [Cocoa] Add an optional width parameter to -[WKWebProcessPlugInNodeHandle renderedImageWithOptions:] https://bugs.webkit.org/show_bug.cgi?id=171646 Reviewed by Tim Horton. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm: (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Called -renderedImageWithOptions:width: with a nil width. (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:width:]): Passed an optional width to InjectedBundleNodeHandle::renderedImage(). * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): If a width is specified, create an image graphics context at that width, preserving the aspect ratio of paintingRect. (WebKit::InjectedBundleNodeHandle::renderedImage): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: 2017-05-04 Commit Queue Unreviewed, rolling out r216172. https://bugs.webkit.org/show_bug.cgi?id=171654 FTBFS for iOS due to missing WebPageProxy::stopMediaCapture() implementation. (Requested by ddkilzer on #webkit). Reverted changeset: "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216172 2017-05-04 Carlos Garcia Campos [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted https://bugs.webkit.org/show_bug.cgi?id=171336 Reviewed by Michael Catanzaro. We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update, but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call CompositingRunLoop::updateCompleted(). * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::forceRepaint): (WebKit::ThreadedCompositor::sceneUpdateFinished): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2017-05-04 David Kilzer check-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit/ directory: KeyError: 'st' Reviewed by Daniel Bates. The problem was that 'import parser' was ambiguous since there is a built-in parser module that comes with Python. Changing 'import parser' to 'from webkit import parser' fixed the error in check-webkit-style (and pylint) by forcing it to load the local 'parser' module, but then running messages_unittest.py directly would fail because .../Source/WebKit2/Scripts was not in the module search path by default. This is fixed by using sys.path.append() to add .../Source/WebKit2/Scripts to the module search path based on the path to messages_unittest.py. As an added bonus, this patch also fixes all webkit-style issues in Source/WebKit2/Scripts/webkit/*.py files. * Scripts/webkit/messages.py: - Separate local module imports from built-in modules for consistency. - Fix whitespace issues for check-webkit-style, and remove stray semi-colon. * Scripts/webkit/messages_unittest.py: - Update sys.path to find the 'webkit' module based on the path to messages_unittest.py. This makes 'from webkit import ...' statements work when running messages_unittest.py directly. - Change 'messages' and 'parser' modules to use 'from webkit import ...' format for consistency. - Fix whitespace issues for check-webkit-style. * Scripts/webkit/model.py: - Fix whitespace issue for check-webkit-style. * Scripts/webkit/parser.py: - Fix whitespace issue for check-webkit-style. 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. * UIProcess/API/C/WKPage.cpp: (WKPageSetMediaCaptureEnabled): New. (WKPageGetMediaCaptureEnabled): New. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMediaCaptureEnabled:]): New. (-[WKWebView _mediaCaptureEnabled]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS and iOS. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the rejection timer. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): Call invalidatePendingRequests. (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all pending requests. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and schedule the timer if there are any others pending. (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't prompt the user if capture is disabled. (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current page on iOS. (WebKit::UserMediaProcessManager::setCaptureEnabled): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaCaptureEnabled): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::mediaCaptureEnabled): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending requests. (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request. (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopMediaCapture): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-05-03 John Wilander Resource Load Statistics: Remove all statistics for modifiedSince website data removals https://bugs.webkit.org/show_bug.cgi?id=171584 Reviewed by Brent Fulgham. These are all test infrastructure changes. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours): * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours): * UIProcess/WebResourceLoadStatisticsManager.h: 2017-05-03 Timothy Horton Maintain interaction information imageURL as a URL, not a string https://bugs.webkit.org/show_bug.cgi?id=171639 Reviewed by Sam Weinig. * Shared/ios/InteractionInformationAtPosition.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _dataForPreviewItemController:atPosition:type:]): (-[WKContentView _previewItemController:commitPreview:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2017-05-03 Commit Queue Unreviewed, rolling out r216160 and r216161. https://bugs.webkit.org/show_bug.cgi?id=171640 These changes broke the iOS build. (Requested by mlewis13 on #webkit). Reverted changesets: "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216160 "[MediaStream] Allow host application to enable/disable media capture" https://bugs.webkit.org/show_bug.cgi?id=171292 http://trac.webkit.org/changeset/216161 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Unreviewed build fix. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::clearUserMediaState): * UIProcess/WebPageProxy.h: 2017-05-03 Eric Carlson [MediaStream] Allow host application to enable/disable media capture https://bugs.webkit.org/show_bug.cgi?id=171292 Reviewed by Jer Noble. * UIProcess/API/C/WKPage.cpp: (WKPageSetMediaCaptureEnabled): New. (WKPageGetMediaCaptureEnabled): New. (WKPageClearUserMediaState): Deleted, unused. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMediaCaptureEnabled:]): New. (-[WKWebView _mediaCaptureEnabled]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS and iOS. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize the rejection timer. (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): Call invalidatePendingRequests. (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all pending requests. (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New. (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and schedule the timer if there are any others pending. (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't prompt the user if capture is disabled. (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted. (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current page on iOS. (WebKit::UserMediaProcessManager::setCaptureEnabled): * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMediaCaptureEnabled): (WebKit::WebPageProxy::clearUserMediaState): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::mediaCaptureEnabled): * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending requests. (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request. (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::stopMediaCapture): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2017-05-03 Tim Horton Maintain interaction information URL as a URL, not a string https://bugs.webkit.org/show_bug.cgi?id=171623 Reviewed by Simon Fraser. * Shared/ios/InteractionInformationAtPosition.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showAttachmentSheet]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _dataForPreviewItemController:atPosition:type:]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]): (-[WKPDFView actionSheetAssistant:performAction:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2017-05-03 Simon Fraser Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying https://bugs.webkit.org/show_bug.cgi?id=171619 Also fixes webkit.org/b/170153 and webkit.org/b/170195 Reviewed by Tim Horton. In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that the handler would always run, since we couldn't reliably test the phase of the current transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to checking the transaction phase on newer iOS versions. If we're too late for the current transaction we still need to dispatch_async() to get into the next one. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 2017-05-03 Chris Dumez REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated https://bugs.webkit.org/show_bug.cgi?id=171616 Reviewed by Brady Eidson. Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called after r216129. WebPageProxy::processDidCrash() already takes care of calling resetStateAfterProcessExited(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::terminateProcess): 2017-05-03 Brady Eidson Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge. https://bugs.webkit.org/show_bug.cgi?id=171607 Reviewed by Andy Estes. To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now. * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead. 2017-05-03 Chris Dumez [WK2] Extend processDidCrash delegate to let the client know the reason for the crash https://bugs.webkit.org/show_bug.cgi?id=171565 Reviewed by Sam Weinig. Extend processDidCrash delegate to let the client know the reason for the crash. This is needed by some clients to distinguish actual crashes from terminations due to resource limits. * Shared/ProcessCrashReason.h: Added. * UIProcess/API/APINavigationClient.h: (API::NavigationClient::processDidCrash): * UIProcess/API/C/WKAPICast.h: (WebKit::toAPI): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageNavigationClient.h: * UIProcess/API/C/WKProcessCrashReason.h: Added. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::processDidCrash): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didClose): (WebKit::WebProcessProxy::requestTermination): (WebKit::diagnosticLoggingKeyForTerminationReason): (WebKit::toProcessCrashReason): (WebKit::WebProcessProxy::terminateProcessDueToResourceLimits): (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: 2017-05-03 Carlos Garcia Campos [GTK] Add GTK+ implementation of WebAutomationSession https://bugs.webkit.org/show_bug.cgi?id=171431 Reviewed by Michael Catanzaro. Add platform dependent methods for GTK+ to synthesize events. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): (WebKit::WebAutomationSession::performMouseInteraction): (WebKit::WebAutomationSession::performKeyboardInteractions): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added. (WebKit::modifiersToEventState): (WebKit::mouseButtonToGdkButton): (WebKit::doMouseEvent): (WebKit::doMotionEvent): (WebKit::WebAutomationSession::platformSimulateMouseInteraction): (WebKit::doKeyStrokeEvent): (WebKit::keyCodeForVirtualKey): (WebKit::WebAutomationSession::platformSimulateKeyStroke): (WebKit::WebAutomationSession::platformSimulateKeySequence): (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): 2017-05-03 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release. * gtk/NEWS: Add release notes for 2.17.1. 2017-05-03 Carlos Garcia Campos [Soup] Add request headers to network load metrics https://bugs.webkit.org/show_bug.cgi?id=171545 Reviewed by Sergio Villar Senin. This will make the headers to appear in the web inspector. Fixes: http/tests/inspector/network/resource-request-headers.html * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didGetHeaders): 2017-05-02 Simon Fraser Dynamically added position:fixed element is in the wrong place https://bugs.webkit.org/show_bug.cgi?id=170280 rdar://problem/31374008 Reviewed by Tim Horton. Layers for position:fixed elements have their positions reconciled after scrolls via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(), which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer. This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position, but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change, but there was no signal to the UI process to restore the layer's pre-scrolled position. Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA geometry updates in the web process always send new positions to the UI process. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::setPosition): 2017-05-02 Gwang Yoon Hwang [GTK] Drop coordinated surfaces from the compositing thread as soon as possible https://bugs.webkit.org/show_bug.cgi?id=171544 Reviewed by Žan Doberšek. Released coordinated surface from the main thread didn't be freed until next commit message because the deletion of coordinated surfaces is considered as a part of scene state. We need to release corresponding surfaces whenever the compositing coordinator drops update atlases to reduce memory usages. No new tests, only an optimization. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: Remove atlasesToRemove from the GraphicsState. it is not a commit state anymore. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of released update atlases to the compositing thread right after cleaning up deactivated update atlases. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::clearPendingStateChanges): (WebKit::CompositingCoordinator::removeUpdateAtlas): (WebKit::CompositingCoordinator::releaseAtlases): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 2017-05-02 Timothy Horton Inform clients when viewport-fit state changes, so they can recompute insets https://bugs.webkit.org/show_bug.cgi?id=171573 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didChangeAvoidsUnsafeArea]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets themselves, we need to let them know when the current state of viewport-fit changes so that they can recompute the insets. 2017-05-02 Gwang Yoon Hwang [GTK] Recycle textures while handling tiles https://bugs.webkit.org/show_bug.cgi?id=171541 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::swapBuffers): Whenever we create new tiles or delete tiles, CoordGfx creates and deletes textures accordingly. We should avoid this kind of heavy operations whenever possible. This patch modifies to use the texture pool to reduce texture allocations. Also this patch reduces number of resetting textures, which is also expensive operation. * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: (WebKit::WebCoordinatedSurface::copyToTexture): Modified to pass BitmapTexture as a reference. * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: (WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto. 2017-05-02 David Kilzer Stop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm Reviewed by Chris Dumez. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::registerWithStateDumper): Switch from strcpy() to strlcpy(), removing comment in the process. 2017-05-02 Andrew Gold MediaDevices is not enabled for MobileSafari https://bugs.webkit.org/show_bug.cgi?id=171433 Reviewed by Youenn Fablet. Added the Cocoa API for toggling this feature and removed API for toggling MediaStreamEnabled since it will always be on. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _mediaDevicesEnabled]): (-[WKPreferences _setMediaDevicesEnabled:]): (-[WKPreferences _mediaStreamEnabled]): Deleted. (-[WKPreferences _setMediaStreamEnabled:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-05-02 Andy Estes REGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a touch event arrives after a WebPageProxy has been invalidated https://bugs.webkit.org/show_bug.cgi?id=171539 Reviewed by Tim Horton. Prior to r213036, the layer tree transaction at last touch start was tracked by WebPageProxy::handleTouchEventSynchronously(), which would ask the drawing area proxy for its most recent transaction ID after ensuring that the WebPageProxy was valid. r213036 moved the tracking up to -[WKContentView _webTouchEventsRecognized:], but failed to check if _page was valid before asking for its drawing area proxy's last transaction ID; the drawing area proxy is set to null on WebPageProxy invalidation. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _webTouchEventsRecognized:]): Added an early return if _page isn't valid. 2017-05-02 Carlos Garcia Campos Web Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContext for all platforms https://bugs.webkit.org/show_bug.cgi?id=171107 Reviewed by Brian Burg. The implementation is actually cross-platform, so it could be moved from WebAutomationSessionMac.mm to WebAutomationSession.cpp and simply return a NotImplemented error for iOS. This will allow to use these methods in other platforms. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted. (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted. 2017-05-01 Chris Dumez Use RELEASE_LOG_ERROR() to do process termination logging https://bugs.webkit.org/show_bug.cgi?id=171521 Reviewed by Andreas Kling. Use RELEASE_LOG_ERROR() to do process termination logging instead of RELEASE_LOG(). This makes the issue more visible in Console. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedActiveMemoryLimit): (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit): (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): 2017-05-01 Brady Eidson Only try to get sandbox extension handle for IndexedDB directory if it is set. rdar://problem/31925828 and https://bugs.webkit.org/show_bug.cgi?id=171522 Reviewed by Andy Estes. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): 2017-05-01 Timothy Horton Expose viewport-fit instead of clip-to-safe-area https://bugs.webkit.org/show_bug.cgi?id=171503 Reviewed by Simon Fraser. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::unobscuredSafeAreaInsets): (WebKit::operator==): Plumb the safe area insets down from the UI process to the Web Content process inside the visible content rect update, alongside the obscured insets. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::avoidsUnsafeArea): (WebKit::RemoteLayerTreeTransaction::setAvoidsUnsafeArea): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): (WebKit::RemoteLayerTreeTransaction::description): * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): (WebKit::PageClientImpl::didChangeClipToSafeArea): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): * UIProcess/mac/PageClientImpl.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didChangeClipToSafeArea): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateVisibleContentRects): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::setAvoidsUnsafeArea): (WebKit::WebPageProxy::setClipToSafeArea): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::avoidsUnsafeArea): (WebKit::WebPageProxy::clipToSafeArea): Deleted. * UIProcess/WebPageProxy.messages.in: Plumb the effective value of viewport-fit (whether or not to avoid the safe area for layout purposes) from the Web Content process to the UI process inside the layer tree transaction. Also, remove clip-to-safe-area plumbing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _computedContentInset]): (-[WKWebView _computedUnobscuredSafeAreaInset]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _contentMayDrawInObscuredInsets]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Make use of the effective value of viewport-fit to decide whether to take the safe area into account when computing the obscured insets, and expose this to clients (in the case that they need to know because they push their own obscured insets down). Also expose a safe area inset setter for that case as well. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView updateFixedClippingView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Remove a piece of the clip-to-safe-area implementation, and plumb safe area insets into the visible content rect update info. * UIProcess/ios/WKScrollView.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollView initWithFrame:]): (-[WKScrollView _contentInsetAdjustmentBehaviorWasExternallyOverridden]): (-[WKScrollView _setContentInsetAdjustmentBehavior:]): (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]): Keep track of whether the client has ever touched the content inset adjustment behavior; if they have, we won't manage it ourselves. 2017-05-01 Brady Eidson Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs. and https://bugs.webkit.org/show_bug.cgi?id=171508 Reviewed by Andy Estes. This patch: - Renames WKURLSchemeHandlerTask to WKURLSchemeTask - Renames the method "startTask" to "startURLSchemeTask" - Renames the method "stopTask" to "stopURLSchemeTask" To those effects it's basically a global replace. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp. (API::URLSchemeTask::create): (API::URLSchemeTask::URLSchemeTask): * UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h. * UIProcess/API/Cocoa/WKURLSchemeHandler.h: * UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h. * UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm. (raiseExceptionIfNecessary): (-[WKURLSchemeTaskImpl request]): (-[WKURLSchemeTaskImpl didReceiveResponse:]): (-[WKURLSchemeTaskImpl didReceiveData:]): (-[WKURLSchemeTaskImpl didFinish]): (-[WKURLSchemeTaskImpl didFailWithError:]): (-[WKURLSchemeTaskImpl _apiObject]): * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h. (WebKit::wrapper): * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h: * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: (WebKit::WebURLSchemeHandlerCocoa::platformStartTask): (WebKit::WebURLSchemeHandlerCocoa::platformStopTask): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::stopURLSchemeTask): (WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted. (WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp. (WebKit::WebURLSchemeTask::create): (WebKit::WebURLSchemeTask::WebURLSchemeTask): (WebKit::WebURLSchemeTask::didReceiveResponse): (WebKit::WebURLSchemeTask::didReceiveData): (WebKit::WebURLSchemeTask::didComplete): (WebKit::WebURLSchemeTask::pageDestroyed): (WebKit::WebURLSchemeTask::stop): * UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h. (WebKit::WebURLSchemeTask::identifier): (WebKit::WebURLSchemeTask::request): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::addURLSchemeTaskProxy): (WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy): (WebKit::WebLoaderStrategy::remove): (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted. (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted. * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::urlSchemeTaskDidReceiveResponse): (WebKit::WebPage::urlSchemeTaskDidReceiveData): (WebKit::WebPage::urlSchemeTaskDidComplete): (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted. (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted. (WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::startNewTask): (WebKit::WebURLSchemeHandlerProxy::taskDidComplete): (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp. (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy): (WebKit::WebURLSchemeTaskProxy::startLoading): (WebKit::WebURLSchemeTaskProxy::stopLoading): (WebKit::WebURLSchemeTaskProxy::didReceiveResponse): (WebKit::WebURLSchemeTaskProxy::didReceiveData): (WebKit::WebURLSchemeTaskProxy::didComplete): (WebKit::WebURLSchemeTaskProxy::hasLoader): * WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h. (WebKit::WebURLSchemeTaskProxy::request): (WebKit::WebURLSchemeTaskProxy::identifier): 2017-05-01 Chris Dumez Tweak how long we allow a process to go over its background CPU limit https://bugs.webkit.org/show_bug.cgi?id=170460 Reviewed by Geoffrey Garen. Tweak how long we allow a process to go over its background CPU limit. We now use 8 minutes intervals (instead of previously 15). This is less conservative and aligned with our memory kills. * WebProcess/cocoa/WebProcessCocoa.mm: 2017-05-01 Beth Dakin On-screen panel for candidate bar is in the wrong place when the caret is at the start of a paragraph https://bugs.webkit.org/show_bug.cgi?id=171453 -and corresponding- rdar://problem/29779764 Reviewed by Tim Horton. This bug only happens when the caret is at the beginning of the paragraph, and it is because Range::absoluteTextQuads() returns no quads in this case. I think it might be correct that absoluteTextQuads() returns no quads in this case, so this patch fixes the bug at the call site by using absoluteCaretBounds() in this case. SPI for testing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _candidateRect]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Bug fix. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformEditorState): 2017-05-01 Carlos Garcia Campos [GTK] Add automation session API https://bugs.webkit.org/show_bug.cgi?id=171428 Reviewed by Carlos Alberto Lopez Perez. Add new API to allow WebKitGTK+ to be controlled by automation. By default it's disabled, applications have to explicitly call webkit_web_context_set_automation_allowed() to enabled it. When a new automation session is requested, the signal WebKitWebContext::automation-started is emitted with a newly created WebKitAutomationSession, similar to how WebKitWebContext::download-started works. The user should connect to it have access to the WebKitAutomationSession and connect it its signals. When a new web view is requested to be created in a WebKitAutomationSession, the signal WebKitAutomationSession::create-web-view is emitted. The user should connect to it and return a WebKitWebView. The web views used for automation are special ones and need to be created with the new WebKitWebView:is-controlled-by-automation construct property enabled, otherwise we will refuse to create the requested browsing context. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitAutomationSession.cpp: Added. (webkitAutomationSessionSetProperty): (webkitAutomationSessionConstructed): (webkit_automation_session_class_init): (webkitAutomationSessionCreate): (webkitAutomationSessionGetSession): (webkit_automation_session_get_id): * UIProcess/API/gtk/WebKitAutomationSession.h: Added. * UIProcess/API/gtk/WebKitAutomationSessionPrivate.h: Added. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_class_init): (webkit_web_context_is_automation_allowed): (webkit_web_context_set_automation_allowed): (webkitWebContextCreatePageForWebView): * UIProcess/API/gtk/WebKitWebContext.h: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkit_web_view_class_init): (webkit_web_view_is_controlled_by_automation): * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: 2017-05-01 Carlos Garcia Campos Unreviewed. Fix GTK+ debug build after r216002. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (WebKit::wrapClientRectList): 2017-04-30 Chris Dumez Drop support for legacy ClientRect / ClientRectList https://bugs.webkit.org/show_bug.cgi?id=171418 Reviewed by Sam Weinig. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp: (WebKit::kit): (WebKit::core): (WebKit::wrapClientRect): (webkit_dom_client_rect_constructed): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: (ClientRectList::create): (ClientRectList::items): (ClientRectList::ClientRectList): * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (webkit_dom_element_get_bounding_client_rect): (webkit_dom_element_get_client_rects): 2017-04-30 Brady Eidson More fixing after r215991 https://bugs.webkit.org/show_bug.cgi?id=171483 * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): 2017-04-30 Brady Eidson Fix r215991 https://bugs.webkit.org/show_bug.cgi?id=171483 Unreviewed. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): 2017-04-30 Dan Bernstein [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance() https://bugs.webkit.org/show_bug.cgi?id=171485 Reviewed by Geoffrey Garen. * Platform/mac/MenuUtilities.mm: (WebKit::menuItemForTelephoneNumber): (WebKit::menuForTelephoneNumber): 2017-04-30 Brady Eidson Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI. and https://bugs.webkit.org/show_bug.cgi?id=171483 Reviewed by Geoff Garen (and kind of Andy Estes). Updates include: -Taking a file path as the config argument instead of a directory. -Proper sandbox extension handling. -Proper and thorough API test. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::syncAllCookies): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::syncAllCookies): * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _syncNetworkProcessCookies]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _cookieStoragePath]): (-[_WKWebsiteDataStoreConfiguration _setCookieStoragePath:]): (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): Deleted. (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::syncNetworkProcessCookies): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedCookieStoragePath): (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): Deleted. 2017-04-30 Brady Eidson Regression (r215941) Unexpected logging causes perf tests to fail. and https://bugs.webkit.org/show_bug.cgi?id=171482 Reviewed by Alexey Proskuryakov. * Shared/mac/SandboxExtensionMac.mm: (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::networkingCachesDirectory): (WebKit::WebProcessPool::webContentCachesDirectory): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Only resolve the cookie storage directory if a custom one has been set. 2017-04-29 Youenn Fablet Readd assertion removed accidentally in r215955 https://bugs.webkit.org/show_bug.cgi?id=171466 Reviewed by Eric Carlson. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): 2017-04-29 Andy Estes [macOS] Picture-in-picture should be disabled in WebPlaybackControlsManager during external media playback https://bugs.webkit.org/show_bug.cgi?id=171468 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): Set canTogglePictureInPicture to YES by default on WebPlaybackControlsManager. 2017-04-29 Yusuke Suzuki Move WebCore CPUTime to WTF and implement it in all the platforms https://bugs.webkit.org/show_bug.cgi?id=171477 Reviewed by Chris Dumez. We now hold Seconds in CPUTime instead of int64_t. It finally sends Seconds through WebKit2 IPC. We do not need to specialize ArgumentCoder for Seconds since Seconds just holds double. * UIProcess/PerActivityStateCPUUsageSampler.cpp: (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler): (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime): (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired): * UIProcess/PerActivityStateCPUUsageSampler.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::reportWebContentCPUTime): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessPool.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::reportProcessCPUTime): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-04-28 Brady Eidson Teach the DatabaseProcess to be fully SessionID aware https://bugs.webkit.org/show_bug.cgi?id=171451 Reviewed by Geoffrey Garen. SessionIDs were already at the periphery of IDB and the DatabaseProcess. Getting a separate IDBServer per SessionID is a pretty straightforward improvement. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::idbServer): (WebKit::DatabaseProcess::initializeWebsiteDataStore): (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): (WebKit::DatabaseProcess::indexedDatabaseOrigins): (WebKit::DatabaseProcess::initializeDatabaseProcess): Deleted. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Deleted. (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Deleted. * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::indexedDatabaseDirectory): Deleted. * DatabaseProcess/DatabaseProcess.messages.in: * DatabaseProcess/DatabaseToWebProcessConnection.cpp: (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer): * DatabaseProcess/DatabaseToWebProcessConnection.h: * DatabaseProcess/DatabaseToWebProcessConnection.messages.in: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::create): (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): (WebKit::WebIDBConnectionToClient::deleteDatabase): (WebKit::WebIDBConnectionToClient::openDatabase): (WebKit::WebIDBConnectionToClient::abortTransaction): (WebKit::WebIDBConnectionToClient::commitTransaction): (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBConnectionToClient::createObjectStore): (WebKit::WebIDBConnectionToClient::deleteObjectStore): (WebKit::WebIDBConnectionToClient::renameObjectStore): (WebKit::WebIDBConnectionToClient::clearObjectStore): (WebKit::WebIDBConnectionToClient::createIndex): (WebKit::WebIDBConnectionToClient::deleteIndex): (WebKit::WebIDBConnectionToClient::renameIndex): (WebKit::WebIDBConnectionToClient::putOrAdd): (WebKit::WebIDBConnectionToClient::getRecord): (WebKit::WebIDBConnectionToClient::getAllRecords): (WebKit::WebIDBConnectionToClient::getCount): (WebKit::WebIDBConnectionToClient::deleteRecord): (WebKit::WebIDBConnectionToClient::openCursor): (WebKit::WebIDBConnectionToClient::iterateCursor): (WebKit::WebIDBConnectionToClient::establishTransaction): (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose): (WebKit::WebIDBConnectionToClient::databaseConnectionClosed): (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded): (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent): (WebKit::WebIDBConnectionToClient::openDBRequestCancelled): (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer): (WebKit::WebIDBConnectionToClient::getAllDatabaseNames): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * Shared/Databases/DatabaseProcessCreationParameters.cpp: (WebKit::DatabaseProcessCreationParameters::encode): (WebKit::DatabaseProcessCreationParameters::decode): * Shared/Databases/DatabaseProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureDatabaseProcess): (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): (WebKit::WebProcessPool::pageAddedToProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::databaseProcessParameters): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::create): (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): 2017-04-28 Youenn Fablet getUserMedia video streams should follow device orientation https://bugs.webkit.org/show_bug.cgi?id=171284 Reviewed by Eric Carlson. Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory. Refactoring to return a CaptureSourceOrError instead of passing an out parameter in addition to returning a RefPtr. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): Deleted. * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-28 Chris Dumez [iOS] We should not take a background assertion for the UIProcess when app is MobileMail https://bugs.webkit.org/show_bug.cgi?id=171435 Reviewed by Geoffrey Garen. Add SPI to disable taking on background process assertions in the UIProcess. This is useful for MobileMail. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration shouldTakeUIBackgroundAssertion]): (-[_WKProcessPoolConfiguration setShouldTakeUIBackgroundAssertion:]): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::setClient): * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::ProcessThrottler): (WebKit::m_shouldTakeUIBackgroundAssertion): (WebKit::ProcessThrottler::didConnectToProcess): * UIProcess/ProcessThrottler.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): 2017-04-28 Chris Dumez Unreviewed attempt to fix iOS build after r215943. * Configurations/Base.xcconfig: 2017-04-28 Andy Estes [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes https://bugs.webkit.org/show_bug.cgi?id=171434 Reviewed by Eric Carlson. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Set m_audioMediaSelectedIndex and notified clients. (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Ditto for m_legibleMediaSelectedIndex. (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Called WebPlaybackSessionModelContext::setAudioMediaSelectionIndex(). (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Called WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex(). * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionIndexChanged): Called WebPlaybackSessionManager:: audioMediaSelectionIndexChanged(). (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionIndexChanged): Called WebPlaybackSessionManager::legibleMediaSelectionIndexChanged(). (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged): Sent WebPlaybackSessionManagerProxy::SetAudioMediaSelectionIndex(). (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged): Sent WebPlaybackSessionManagerProxy::SetLegibleMediaSelectionIndex(). 2017-04-28 Brady Eidson Start of support for multiple WebsiteDataStore/SessionIDs per process https://bugs.webkit.org/show_bug.cgi?id=171422 Reviewed by Geoffrey Garen. * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::destroyPrivateBrowsingSession): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): * Shared/WebsiteDataStoreParameters.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h. (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters): (WebKit::WebsiteDataStoreParameters::encode): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h. * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::defaultDataStore): (API::WebsiteDataStore::createLegacy): (API::WebsiteDataStore::WebsiteDataStore): (API::WebsiteDataStore::create): Deleted. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerCreate): (webkitWebsiteDataManagerGetDataStore): * UIProcess/WebPageProxy.cpp: (WebKit::m_weakPtrFactory): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::pageRemovedFromProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::create): (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::~WebsiteDataStore): (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): (WebKit::WebFrameNetworkingContext::storageSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::addWebsiteDataStore): (WebKit::WebProcess::destroySession): (WebKit::WebProcess::destroyPrivateBrowsingSession): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: 2017-04-28 Youenn Fablet Adding a runtime flag specific to MediaDevices https://bugs.webkit.org/show_bug.cgi?id=171433 Reviewed by Geoffrey Garen. Adding a preference for MediaDevices. Setting media devices runtime flag to false by default. Setting peer connection and media stream flags to true by default. Sending microphone sandbox extension based on media devices and not media stream flag. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMediaDevicesEnabled): (WKPreferencesGetMediaDevicesEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-28 Brady Eidson Teach WebProcessPool to track a map of SessionIDs to WebPageProxys to manage their lifetime https://bugs.webkit.org/show_bug.cgi?id=171408 Reviewed by Alex Christensen. * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::sessionID): * UIProcess/API/APIPageConfiguration.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::close): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageAddedToProcess): (WebKit::WebProcessPool::pageRemovedFromProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createWebPage): (WebKit::WebProcessProxy::addExistingWebPage): (WebKit::WebProcessProxy::removeWebPage): * UIProcess/WebProcessProxy.h: 2017-04-27 Carlos Garcia Campos Move UUID from WebCore/platform to WTF https://bugs.webkit.org/show_bug.cgi?id=171372 Reviewed by Michael Catanzaro. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::handleForWebPageProxy): (WebKit::WebAutomationSession::handleForWebFrameID): * UIProcess/gtk/WaylandCompositor.cpp: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::createUUID): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::openWithNativeApplication): 2017-04-27 Chris Dumez Align colspan/rowspan limits with the latest HTML specification https://bugs.webkit.org/show_bug.cgi?id=171322 Reviewed by Darin Adler. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp: (webkit_dom_html_table_cell_element_get_col_span): (webkit_dom_html_table_cell_element_set_col_span): 2017-04-27 Wenson Hsieh WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction https://bugs.webkit.org/show_bug.cgi?id=171386 Reviewed by Beth Dakin. Add a new WKUIDelegate hook, _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 2017-04-27 Brady Eidson Refactor SessionID to support multiple non-ephemeral (persistent) sessions. https://bugs.webkit.org/show_bug.cgi?id=171367 Reviewed by Andy Estes. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): Child processes should never be generating new SessionIDs, so enable generation protection. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::createNonPersistent): (WebKit::generateNonPersistentSessionID): Deleted. 2017-04-27 Said Abou-Hallawa REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument https://bugs.webkit.org/show_bug.cgi?id=170333 Reviewed by Simon Fraser. Disbale the async decoding for large images for now. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-27 Brent Fulgham [WK2][macOS] Allow multi-touch related iokit-get-properties https://bugs.webkit.org/show_bug.cgi?id=171355 Reviewed by Alexey Proskuryakov. During testing I've noticed Sandbox Violations being generated during some 'Force Touch' track pad use. The sandbox should allow these IOKit properties to be accessed. * WebProcess/com.apple.WebProcess.sb.in: 2017-04-27 Alex Christensen Add stub SPI for setting cookie storage path on _WKWebsiteDataStoreConfiguration https://bugs.webkit.org/show_bug.cgi?id=171399 Reviewed by Brady Eidson. This SPI isn't hooked up yet, but it has a test that will need to be updated once it works. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): 2017-04-27 Chris Dumez Element.getBoundingClientRect() / getClientRects() should return a DOMRect types https://bugs.webkit.org/show_bug.cgi?id=171226 Reviewed by Simon Fraser. GTK build fix. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: (toClientRect): (webkit_dom_element_get_bounding_client_rect): (webkit_dom_element_get_client_rects): 2017-04-27 Brady Eidson Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages. https://bugs.webkit.org/show_bug.cgi?id=171365 Reviewed by Andy Estes. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 2017-04-27 Alex Christensen Modernize Frame.h https://bugs.webkit.org/show_bug.cgi?id=171357 Reviewed by Andy Estes. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::contextMenuAtPointInWindow): (WebKit::handleContextMenuEvent): (WebKit::WebPage::isSelectTrailingWhitespaceEnabled): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::selectPositionAtPoint): (WebKit::WebPage::selectPositionAtBoundaryWithDirection): (WebKit::WebPage::rangeForGranularityAtPoint): (WebKit::WebPage::selectTextWithGranularityAtPoint): (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPage::updateSelectionWithExtentPoint): 2017-04-27 Carlos Garcia Campos [GTK] Remote inspector should support inspecting targets with previous version of backend commands https://bugs.webkit.org/show_bug.cgi?id=171267 Reviewed by Michael Catanzaro. There's a FIXME for this in the code. The remote inspector proxy allows to pass a backend commands URL when inspecting a target. That URL, if not empty, is used as Protocol/InspectorBackendCommands.js in the inspector code instead of the local copy. We are currently assuming that both ends use the same version of that file. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorProxy::load): Pass RemoteInspectorClient::backendCommandsURL() to load(). (WebKit::RemoteInspectorClient::setupConnection): Get the local backend commands hash and pass it to SetupInspectorClient method. Extract the server backend commands from the result and call setBackendCommands(). (WebKit::RemoteInspectorClient::setBackendCommands): Create a data URL for the server backend commands file conents if needed. * UIProcess/glib/RemoteInspectorClient.h: (WebKit::RemoteInspectorClient::backendCommandsURL): 2017-04-26 Wenson Hsieh WebItemProviderPasteboard should not synchronously load provided data https://bugs.webkit.org/show_bug.cgi?id=171341 Reviewed by Tim Horton. Adds plumbing for updatePreferredTypeIdentifiers through the WebPasteboardProxy. This allows the web process to signal to the UI process what UTIs the current drop target should accept and load. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-26 Youenn Fablet Unauthenticated CORS preflight requests should not use client certificates https://bugs.webkit.org/show_bug.cgi?id=171298 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ensuring that session dedicated to requests that do not want to use credentials do not look for client credentials. 2017-04-26 Eric Carlson The current page is given a muted state when starting a media stream on iOS. https://bugs.webkit.org/show_bug.cgi?id=171290 Reviewed by Jer Noble. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Don't mute the current page on iOS either, that will prevent the new media stream from playing. 2017-04-26 Alex Christensen Make user script injection more robust https://bugs.webkit.org/show_bug.cgi?id=171339 Reviewed by Geoffrey Garen. * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::forEachUserScript): (WebKit::WebUserContentController::forEachUserStyleSheet): (WebKit::WebUserContentController::forEachUserMessageHandler): * WebProcess/UserContent/WebUserContentController.h: 2017-04-26 Zalan Bujtas RTL: recent searches popover is displayed in incorrect location https://bugs.webkit.org/show_bug.cgi?id=171338 Reviewed by Dean Jackson. Add RTL support for the pop-under branch. * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): 2017-04-26 Antti Koivisto Enable expired-only reload policy on Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=171264 Reviewed by Andreas Kling. Enable the reload policy where only expired subresources are revalidated on Mac and iOS. The behavor is enabled in Safari and for other clients based on SDK version check. * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-26 Andy Estes [macOS] Add picture-in-picture support to WebPlaybackControlsManager https://bugs.webkit.org/show_bug.cgi?id=171328 Reviewed by Jer Noble. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::togglePictureInPicture): Added. Calls WebPlaybackSessionManagerProxy::togglePictureAndPicture(). (WebKit::WebPlaybackSessionManagerProxy::togglePictureInPicture): Added. Sends TogglePictureInPicture to WebPlaybackSessionManager. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): Called -[WebPlaybackControlsManager setAllowsPictureInPicturePlayback:YES] if WebPreferences::allowsPictureInPictureMediaPlayback() is true. * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionManager::togglePictureInPicture): Added. Sets a UserGestureIndicator and calls WebPlaybackSessionModel::togglePictureInPicture(). 2017-04-26 Tim Horton WebKit calls AppKit NSCell API from a background queue https://bugs.webkit.org/show_bug.cgi?id=171318 Reviewed by Anders Carlsson. * UIProcess/mac/ServicesController.mm: (WebKit::ServicesController::refreshExistingServices): Synchronously bounce to the main thread to do non-thread-safe NSCell related work. 2017-04-25 Alex Christensen Encoded filename should be decoded for WKContentExtension.identifier https://bugs.webkit.org/show_bug.cgi?id=171316 Reviewed by Andy Estes. * UIProcess/API/APIContentExtensionStore.cpp: (API::createExtension): (API::ContentExtensionStore::lookupContentExtension): (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): 2017-04-26 Andrew Gold Move mediaCaptureEnabled from WKWebViewConfiguration to WKPreferences https://bugs.webkit.org/show_bug.cgi?id=171294 Reviewed by Eric Carlson. Since we now want the ability to toggle this setting dynamically, I have moved it from WKWebViewConfiguration to WKPreferences. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _mediaStreamEnabled]): (-[WKPreferences _setMediaStreamEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): No longer set mediaStream enabled from the configuration. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _mediaStreamEnabled]): Deleted. (-[WKWebViewConfiguration _setMediaStreamEnabled:]): Deleted. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2017-04-25 Alex Christensen REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set https://bugs.webkit.org/show_bug.cgi?id=171297 Reviewed by Geoffrey Garen. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): 2017-04-25 Wenson Hsieh Unreviewed, speculative build fix * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: For the time being, remove all references to UIItemProviders from this private header. This should be fixed to use unavailability macros in a followup. See . 2017-04-25 Brent Fulgham Limit allowed size of document.title to avoid locking WebKit clients https://bugs.webkit.org/show_bug.cgi?id=165113 Reviewed by Darin Adler. When a web application attempts to set an extremely long title, truncate the title to a more reasonable size. We do this at at the presentation layer, rather than in the DOM, so that we do not affect script function. Instead, we merely limit display to a level that is reasonable for normal GUI widgets. Anything else needs to be truncated in the UI layer, so it is a waste of effort to send across IPC. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2017-04-25 John Wilander Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting https://bugs.webkit.org/show_bug.cgi?id=171295 Reviewed by Brent Fulgham. * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler): (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain): Changes and additions to test infrastructure. * UIProcess/API/C/WKResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain): (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): Changes and additions to test infrastructure. * UIProcess/WebResourceLoadStatisticsManager.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): No longer sends a boolean parameter to WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler(). 2017-04-25 Simon Fraser REGRESSION (r213719): WebGL content on cubeslam.com is 1/4 expected size https://bugs.webkit.org/show_bug.cgi?id=171300 rdar://problem/31051538 Reviewed by Dean Jackson. Propagating the contentsScale to the UI process for canvas content layers causes scaling issues, so don't do it for contents-provided layers. No test because WebGL can't be tested in the iOS simulator. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::PlatformCALayerRemote): 2017-04-25 Brady Eidson Update WebProcess(Pool) to assume there's always a WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=171299 Reviewed by Alex Christensen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): (WebKit::WebProcessPool::warmInitialProcess): (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::create): (WebKit::WebProcessProxy::WebProcessProxy): (WebKit::m_userMediaCaptureManagerProxy): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::websiteDataStore): 2017-04-25 Ryan Haddad Unreviewed, rolling out r215730. The LayoutTest for this change is a flaky timeout on mac-wk1 debug. Reverted changeset: "Enable expired-only reload policy on Mac and iOS" https://bugs.webkit.org/show_bug.cgi?id=171264 http://trac.webkit.org/changeset/215730 2017-04-24 Matt Rajca Indicate presence of audio when handling autoplay events. https://bugs.webkit.org/show_bug.cgi?id=171227 Reviewed by Alex Christensen. * UIProcess/API/APIUIClient.h: (API::UIClient::handleAutoplayEvent): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleAutoplayEvent): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleAutoplayEvent): * WebProcess/WebCoreSupport/WebChromeClient.h: 2017-04-25 Daniel Bates [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header https://bugs.webkit.org/show_bug.cgi?id=136452 Reviewed by Brent Fulgham. Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms. * Configurations/FeatureDefines.xcconfig: 2017-04-25 John Wilander Resource Load Statistics: Clear network process cache when clearing store https://bugs.webkit.org/show_bug.cgi?id=171256 Reviewed by Brent Fulgham. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst to WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts(). * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now takes the boolean parameter clearFirst. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst to Messages::NetworkProcess::ShouldPartitionCookiesForTopPrivatelyOwnedDomains. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now takes the boolean parameter clearFirst. * UIProcess/WebResourceLoadStatisticsManager.cpp: (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler): Now uses the boolean parameter clearFirst when calling WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler(). (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore): No longer uses the deleted store getter. (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState): No longer uses the deleted store getter. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): No sends the boolean parameter clearFirst to ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler(). (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Now expects a handler with the boolean parameter clearFirst. (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): * UIProcess/WebResourceLoadStatisticsStore.h: Now uses the new WebCore::ResourceLoadObserver::clearInMemoryStore(). * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Now takes and passes on the boolean parameter clearFirst in its message to the network process. (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): Now expects a handler with the boolean parameter clearFirst. * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-04-25 Chris Dumez Content-Disposition header filename is ignored when 'download' attribute is specified in HTML https://bugs.webkit.org/show_bug.cgi?id=171239 Reviewed by Alex Christensen. Content-Disposition header filename is ignored when 'download' attribute is specified in HTML. This is not as per HTML specification: - https://html.spec.whatwg.org/#as-a-download (Step 2) Content-Disposition header filename is supposed to override the value of the download attribute. Firefox and Chrome follow the specification. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::findPendingDownloadLocation): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::didReceiveResponse): 2017-04-25 Carlos Garcia Campos [GTK] Add WebKitInspectorWindow to create inspector windows from local and remote inspector https://bugs.webkit.org/show_bug.cgi?id=171261 Reviewed by Michael Catanzaro. The code is currently duplicated in WebInspectorProxyGtk.cpp and RemoteWebInspectorProxyGtk.cpp. We can simplify it by using a common widget in both places. This patch also fixes the build when using GTK+ < 3.16. * PlatformGTK.cmake: * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: (WebKit::RemoteWebInspectorProxy::updateWindowTitle): (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::createInspectorWindow): (WebKit::WebInspectorProxy::updateInspectorWindowTitle): * UIProcess/gtk/WebKitInspectorWindow.cpp: Added. (webkit_inspector_window_class_init): (webkit_inspector_window_init): (webkitInspectorWindowNew): (webkitInspectorWindowSetSubtitle): * UIProcess/gtk/WebKitInspectorWindow.h: Added. 2017-04-25 Antti Koivisto Enable expired-only reload policy on Mac and iOS https://bugs.webkit.org/show_bug.cgi?id=171264 Reviewed by Andreas Kling. Enable the reload policy where only expired subresources are revalidated on Mac and iOS. The behavor is enabled in Safari and for other clients based on SDK version check. * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-25 Wenson Hsieh Support reading NSURL titles from the pasteboard when performing data interaction https://bugs.webkit.org/show_bug.cgi?id=171156 Reviewed by Tim Horton. Adjust for interface changes in WebCore to support plumbing the title of an NSURL from the platform pasteboard back to WebCore. Additionally, implement WebEditorClient::hasRichlyEditableSelection (which previously returned false) to check whether the current selection is richly editable, or the drop caret is in richly editable content. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::readURLFromPasteboard): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::readURLFromPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::hasRichlyEditableSelection): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::hasRichlyEditableSelection): * WebProcess/WebPage/WebPage.h: 2017-04-24 Wenson Hsieh Respect fidelity order when reading web content from item providers https://bugs.webkit.org/show_bug.cgi?id=171155 Reviewed by Tim Horton. Adjusts for changes in WebCore by adding plumbing to support Pasteboard::getTypesByFidelityForItemAtIndex. See WebCore/ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-24 Brady Eidson WebProcessPools should always have a WebsiteDataStore https://bugs.webkit.org/show_bug.cgi?id=171252 Reviewed by Alex Christensen. * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted. * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/C/WKContext.cpp: (WKContextGetWebsiteDataStore): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::WebProcessPool): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::isAssociatedProcessPool): 2017-04-24 Youenn Fablet Set defaults video getUserMedia constraints https://bugs.webkit.org/show_bug.cgi?id=171127 Reviewed by Eric Carlson. Updated to cope with MediaStreamConstraintsImpl refactoring. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): 2017-04-24 Chris Dumez Allow tabs with capturing audio or video to exceed background CPU limit https://bugs.webkit.org/show_bug.cgi?id=171249 Reviewed by Geoffrey Garen. Allow tabs with capturing audio or video to exceed background CPU limit as this is a legit case of potentially high background CPU use. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didExceedBackgroundCPULimit): 2017-04-24 Andy Estes Try to fix the 32-bit macOS build. * UIProcess/Cocoa/WebViewImpl.mm: 2017-04-24 Andy Estes [macOS] Enable media selection button on AVTouchBarScrubber https://bugs.webkit.org/show_bug.cgi?id=171149 Reviewed by Beth Dakin. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-24 Alex Christensen Reduce copies and allocations in SharedBuffer::append https://bugs.webkit.org/show_bug.cgi?id=170956 Reviewed by Andreas Kling. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm: (-[WKURLSchemeHandlerTaskImpl didReceiveData:]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::addArchiveResource): (WebKit::PDFPlugin::liveResourceData): (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::redeliverManualStream): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::cachedResponseDataForURL): 2017-04-24 Carlos Garcia Campos [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector https://bugs.webkit.org/show_bug.cgi?id=166680 Reviewed by Michael Catanzaro. Remove INSPECTOR_SERVER code and add new classes to implement REMOTE_INSPECTOR. The WebKitWebContext registers a custom protocol "inspector" that loads a page with the list of debuggable targets. * PlatformGTK.cmake: Add new files to compilation and remove the old ones. * UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Removed. * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: Added. (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler): (WebKit::RemoteInspectorProtocolHandler::~RemoteInspectorProtocolHandler): (WebKit::RemoteInspectorProtocolHandler::webViewDestroyed): (WebKit::RemoteInspectorProtocolHandler::userContentManagerDestroyed): (WebKit::RemoteInspectorProtocolHandler::handleRequest): (WebKit::RemoteInspectorProtocolHandler::inspect): (WebKit::RemoteInspectorProtocolHandler::targetListChanged): (WebKit::RemoteInspectorProtocolHandler::connectionClosed): * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: Added. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): * UIProcess/InspectorServer/HTTPRequest.cpp: Add missing ENABLE(INSPECTOR_SERVER) ifdefs. * UIProcess/InspectorServer/HTTPRequest.h: * UIProcess/InspectorServer/WebInspectorServer.h: * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: Removed. * UIProcess/RemoteWebInspectorProxy.cpp: * UIProcess/RemoteWebInspectorProxy.h: * UIProcess/WebProcessPool.cpp: * UIProcess/glib/RemoteInspectorClient.cpp: Added. (WebKit::RemoteInspectorClient::RemoteInspectorClient): (WebKit::RemoteInspectorClient::~RemoteInspectorClient): (WebKit::dbusConnectionCallAsyncReadyCallback): (WebKit::RemoteInspectorClient::connectionClosedCallback): (WebKit::RemoteInspectorClient::setupConnection): (WebKit::RemoteInspectorClient::connectionClosed): (WebKit::RemoteInspectorClient::inspect): (WebKit::RemoteInspectorClient::sendMessageToBackend): (WebKit::RemoteInspectorClient::closeFromFrontend): (WebKit::RemoteInspectorClient::setTargetList): (WebKit::RemoteInspectorClient::sendMessageToFrontend): * UIProcess/glib/RemoteInspectorClient.h: Added. (WebKit::RemoteInspectorObserver::~RemoteInspectorObserver): (WebKit::RemoteInspectorClient::targets): (WebKit::RemoteInspectorClient::hostAndPort): * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: Added. (WebKit::RemoteWebInspectorProxy::updateWindowTitle): (WebKit::inspectorViewDestroyed): (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow): (WebKit::RemoteWebInspectorProxy::platformBringToFront): (WebKit::RemoteWebInspectorProxy::platformSave): (WebKit::RemoteWebInspectorProxy::platformAppend): (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab): * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: (didReceiveMessageToPage): Updated after the GRefPtr hash traitds changes. * config.h: 2017-04-23 Dan Bernstein [macOS] WKWebInspectorProxyObjCAdapter has a public ivar https://bugs.webkit.org/show_bug.cgi?id=171200 Reviewed by Geoffrey Garen. * UIProcess/API/C/mac/WKInspectorPrivateMac.h: Made ivar private. 2017-04-23 Commit Queue Unreviewed, rolling out r215657 and r215676. https://bugs.webkit.org/show_bug.cgi?id=171201 Broke the build (Requested by ap on #webkit). Reverted changesets: "[macOS] Enable media selection button on AVTouchBarScrubber" https://bugs.webkit.org/show_bug.cgi?id=171149 http://trac.webkit.org/changeset/215657 "Build fix after r215657." http://trac.webkit.org/changeset/215676 2017-04-23 Alexey Proskuryakov Build fix after r215657. * UIProcess/Cocoa/WebViewImpl.mm: 2017-04-23 Andy Estes [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type https://bugs.webkit.org/show_bug.cgi?id=171192 Reviewed by Wenson Hsieh. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebPlaybackSessionManager.mm: (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged): (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged): 2017-04-21 Wenson Hsieh Support writing link titles to the pasteboard when beginning data interaction on a link https://bugs.webkit.org/show_bug.cgi?id=171154 Reviewed by Andy Estes. Adds support for setting the _title attribute of NSURLs written to the pasteboard. See WebCore ChangeLog for more details. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: Teach PasteboardURL to be serialized in IPC. For now, we just send across the absolute string of the link and its title. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::writeURLToPasteboard): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: Add IPC plumbing for writing PasteboarURLs to the pasteboard. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::writeToPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-21 Michael Catanzaro Unreviewed, rolling out r215608. Hundreds of test failures on GTK bot Reverted changeset: "Reduce copies and allocations in SharedBuffer::append" https://bugs.webkit.org/show_bug.cgi?id=170956 http://trac.webkit.org/changeset/215608 2017-04-21 Andy Estes [macOS] Enable media selection button on AVTouchBarScrubber https://bugs.webkit.org/show_bug.cgi?id=171149 Reviewed by Beth Dakin. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-21 Wenson Hsieh [WK2] Add delegate hooks for overriding unhanded data interaction operations https://bugs.webkit.org/show_bug.cgi?id=171005 Reviewed by Tim Horton. Adds support for overriding data interaction operations through two new delegate methods: _webView:willUpdateDataInteractionOperationToOperation:forSession:, and _webView:dataInteractionOperationWasHandled:forSession:. The former may be overridden to return a different operation type than what WebKit would originally have returned, and the latter may be overridden to run custom logic after the web process has handled a data interaction operation. Additionally, includes some minor cleanup around WKContentViewInteraction. With the new _webView:dataInteractionOperationWasHandled:forSession: delegate method, the last method on _WKTestingDelegate may be removed. This means _WKTestingDelegate is no longer needed, so this patch removes its header entirely. Also, relocates some state variables formerly on WKContentView to WKContentView's WKDataInteractionState struct instead, so that all state associated with data interaction may be cleaned up at the same time. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _testingDelegate]): Deleted. (-[WKWebView _setTestingDelegate:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKTestingDelegate.h: Removed. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add a new "handled" IPC argument to DidPerformDataInteractionControllerOperation. This lets the UI process know whether or not the data interaction operation was handled by the web process, and is eventually plumbed through to the UI delegate via the new SPI. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _displayFormNodeInputView]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-04-21 Anders Carlsson Stop using deprecated APIs, part 5 https://bugs.webkit.org/show_bug.cgi?id=171134 rdar://problem/31589635 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentAuthorizationStatus): Remove this and add a new version that doesn't use any deprecated values. (WebKit::toPKPaymentAuthorizationStatus): New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes. (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Use the new toPKPaymentAuthorizationStatus versions. (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Ditto. (WebKit::status): Deleted. 2017-04-21 David Kilzer Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make Reviewed by Brent Fulgham. * DerivedSources.make: Switch to -std=gnu++14 for preprocessing headers to check for build settings. 2017-04-21 Jer Noble [WK2][MediaCapture] Pass muted and enabled state across process boundary when capturing in UIProcess https://bugs.webkit.org/show_bug.cgi?id=170846 Reviewed by Jon Lee. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::setMuted): (WebKit::UserMediaCaptureManagerProxy::setEnabled): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setMuted): (WebKit::UserMediaCaptureManager::Source::setEnabled): (WebKit::UserMediaCaptureManager::setMuted): (WebKit::UserMediaCaptureManager::setEnabled): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-21 Jer Noble [WK2][MediaCapture] Remove now-unused WKWebViewConfiguration property for shouldCaptureAudioInUIProcess https://bugs.webkit.org/show_bug.cgi?id=170847 Reviewed by Jon Lee. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): Deleted. (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): Deleted. 2017-04-21 Anders Carlsson Stop using deprecated APIs, part 4 https://bugs.webkit.org/show_bug.cgi?id=171125 rdar://problem/31589635 Reviewed by Tim Horton. It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point so just remove the status parameter. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): 2017-04-21 Andrew Gold -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] decision handler should only have one parameter. https://bugs.webkit.org/show_bug.cgi?id=171081 Reviewed by Tim Horton. Because user media authorization is all or nothing, we should not have separate booleans to indicate authorization. Additionally, rather than passing two separate booleans to the UIDelegate, we now pass an NS_OPTIONS parameter. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS. * UIProcess/Cocoa/UIDelegate.mm: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method. (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto. 2017-04-21 Konstantin Tokarev Unreviewed, added missing file to PlatformMac.cmake * PlatformMac.cmake: 2017-04-21 Konstantin Tokarev Unreviewed follow-up for r215609 * UIProcess/API/Cocoa/WKWebView.mm: Move internal header include too. 2017-04-21 Konstantin Tokarev Include iOS-specific headers inside preprocessor guard https://bugs.webkit.org/show_bug.cgi?id=171104 Reviewed by Michael Catanzaro. This patch should fix Mac cmake build. * UIProcess/API/Cocoa/WKWebView.mm: 2017-04-21 Alex Christensen Reduce copies and allocations in SharedBuffer::append https://bugs.webkit.org/show_bug.cgi?id=170956 Reviewed by Andreas Kling. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm: (-[WKURLSchemeHandlerTaskImpl didReceiveData:]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::addArchiveResource): (WebKit::PDFPlugin::liveResourceData): (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::redeliverManualStream): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::cachedResponseDataForURL): 2017-04-20 Konstantin Tokarev [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere https://bugs.webkit.org/show_bug.cgi?id=171071 Reviewed by Michael Catanzaro. "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should be available for all ports. * CMakeLists.txt: * PlatformMac.cmake: 2017-04-20 Brady Eidson WebContent process becomes unresponsive after returning nil from async version of -webView:createWebViewWithConfiguration:... and https://bugs.webkit.org/show_bug.cgi?id=171090 Reviewed by Andy Estes. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): Handle the perfectly valid "nil webView" case correctly. 2017-04-20 Dan Bernstein Disable header postprocessing when building for Sierra Absolutely rubber-stamped by Anders Carlsson. * Configurations/WebKit.xcconfig: 2017-04-20 Matt Rajca Cocoa: add private API for suppressing first responder changes https://bugs.webkit.org/show_bug.cgi?id=171069 Reviewed by Tim Horton. Some clients may not want the web view to be programmatically made the first responder and invoking -makeFirstResponder: unconditionally posts 'first responder did change' notifications. Added API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setShouldSuppressFirstResponderChanges:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges): * UIProcess/PageClient.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::makeFirstResponder): 2017-04-20 Eric Carlson [MediaStream iOS] Hold process assertion while media capture is active https://bugs.webkit.org/show_bug.cgi?id=171017 Reviewed by Dean Jackson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary. (WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active. (WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted, so pass IsCapturingMedia to activityStateDidChange. (WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture is active. 2017-04-20 Anders Carlsson Fix build. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): 2017-04-20 Brady Eidson Add CompletionHandlerCallChecker to SPI added in r215545. https://bugs.webkit.org/show_bug.cgi?id=171067 Reviewed by Dan Bernstein. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPageCommon): 2017-04-20 Anders Carlsson Replace isFinalStateStatus with isFinalStateResult https://bugs.webkit.org/show_bug.cgi?id=171072 rdar://problem/31589635 Reviewed by Tim Horton. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completePaymentSession): 2017-04-20 Wenson Hsieh [WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy https://bugs.webkit.org/show_bug.cgi?id=170922 Reviewed by Tim Horton. Refactors part of the asynchronous position information mechanism introduced in , and introduces infrastructure for unit testing UI-side position information requests. _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is a helper method on WKContentView responsible for invoking queued position information handlers after receiving a position information response from the web process. Previously, this method would iterate over the list of pending callbacks and invoke all callbacks whose requests are satisfied by the incoming position information update, saving the indices of these handled callbacks in the process. At the end, it would then remove callbacks at these indices from the array of pending callbacks. This is problematic when a synchronous position update (via ensurePositionInformationIsUpToDate:) is triggered from within one of these callbacks, since _invokeAndRemovePendingHandlersValidForCurrentPositionInformation will be called from within itself, and then we will attempt to remove a callback at the same index twice. To fix this, we change the array of pending position information handlers to be an array of optionals instead. When invoking and removing pending handlers after a position information response arrives, we now mark callbacks as handled by setting them to std::nullopt. Then, when the top-level invocation to _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is finished, we remove all marked handlers from the pending vector. Covered by 6 new unit tests: - PositionInformationTests.FindDraggableLinkAtPosition - PositionInformationTests.RequestDraggableLinkAtPosition - PositionInformationTests.FindDraggableLinkAtDifferentPositionWithinRequestBlock - PositionInformationTests.FindDraggableLinkAtSamePositionWithinRequestBlock - PositionInformationTests.RequestDraggableLinkAtSamePositionWithinRequestBlock - PositionInformationTests.RequestDraggableLinkAtDifferentPositionWithinRequestBlock * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView draggableElementAtPosition:]): (-[WKWebView requestDraggableElementAtPosition:completionBlock:]): Uses WKContentView's position information request helpers to search for draggable elements on the page. There are both synchronous and asynchronous versions of this, both of which retrieve a _WKDraggableElementInfo. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Added. * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Added. Exposes what elements are draggable at a given position as SPI (only for use in testing code, at the moment). (-[_WKDraggableElementInfo initWithInteractionInformationAtPosition:]): (-[_WKDraggableElementInfo copyWithZone:]): * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Added. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView currentPositionInformation]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]): * WebKit2.xcodeproj/project.pbxproj: 2017-04-20 Anders Carlsson Fix a PassKit function declaration typo https://bugs.webkit.org/show_bug.cgi?id=171068 rdar://problem/31635008 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-04-20 Jer Noble [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess. https://bugs.webkit.org/show_bug.cgi?id=171021 Reviewed by Eric Carlson. Pass a deviceID rather than a CaptureDevice across the process boundary. * Shared/WebCoreArgumentCoders.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-20 Alex Christensen Fix assertions in webProcessProxyFromConnection https://bugs.webkit.org/show_bug.cgi?id=171025 Reviewed by Brady Eidson. * UIProcess/WebProcessPool.cpp: (WebKit::webProcessProxyFromConnection): If we have a Connection, then we have a valid process attached to that connection, unless it's a Connection to a different type of child process. Calling ChildProcessProxy::connection on other web processes that are in State::Launching, then we get an assertion. Luckily, ChildProcessProxy::hasConnection was introduced in r210861 for this reason. 2017-04-20 Brent Fulgham [WK2][macOS] Allow iokit-get-properties for IOAudioControlValue https://bugs.webkit.org/show_bug.cgi?id=171020 Reviewed by Alexey Proskuryakov. * WebProcess/com.apple.WebProcess.sb.in: Add missing property name. 2017-04-19 Joseph Pecoraro Remove WebKitTestRunner code for enabling features that are already enabled by default https://bugs.webkit.org/show_bug.cgi?id=171033 Reviewed by Ryosuke Niwa. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-04-19 Youenn Fablet [Mac] Allow customizing H264 encoder https://bugs.webkit.org/show_bug.cgi?id=170829 Reviewed by Alex Christensen. * Configurations/FeatureDefines.xcconfig: * WebKit2.xcodeproj/project.pbxproj: 2017-04-19 Brady Eidson Add asynchronous equivalent of -[ webView:createWebViewWithConfiguration:...]. and https://bugs.webkit.org/show_bug.cgi?id=171018 Reviewed by Tim Horton. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPageAsync): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::createNewPageCommon): (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::createNewPageAsync): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createNewPage): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: 2017-04-19 Anders Carlsson Stop using deprecated APIs, part 3 https://bugs.webkit.org/show_bug.cgi?id=171003 rdar://problem/31589635 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Don't encode/decode status. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession): Hide the UI and report back. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Add new member. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Add new message. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): Always pass success in the old code path. Stop using the deprecated method. * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::cancelPaymentSession): Send a message to the UI process. * WebProcess/ApplePay/WebPaymentCoordinator.h: Add new member. 2017-04-19 Eric Carlson [MediaStream] Limit capture to one tab at a time https://bugs.webkit.org/show_bug.cgi?id=171009 Reviewed by Jon Lee. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): Deleted, not used. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Mute media streams on other pages. (WebKit::UserMediaProcessManager::willCreateMediaStream): Call willEnableMediaStreamInPage. * UIProcess/UserMediaProcessManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMuted): If media streams in the page will be unmuted, call willEnableMediaStreamInPage so streams in other pages are muted first. 2017-04-19 Brady Eidson REGRESSION (r213168): An extra Web Content process is spun up on launch and is never closed. and https://bugs.webkit.org/show_bug.cgi?id=171002 Reviewed by Alex Christensen. The original change unnecessarily avoided using the initial warmed process if an explicit data store was set on the new WKWebView. Fixing that fixes the regression. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): 2017-04-19 Anders Carlsson Rename cancelPayment to cancelPaymentSession https://bugs.webkit.org/show_bug.cgi?id=171007 Reviewed by Tim Horton. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): (WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::didCancelPaymentSession): (WebKit::WebPaymentCoordinator::didCancelPayment): Deleted. * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: 2017-04-19 David Kilzer Stop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString() Reviewed by Brent Fulgham. * Platform/unix/EnvironmentUtilities.cpp: (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Switch from using strcpy() to strlcpy(). Also switch from using strstr() to strnstr(). * Platform/unix/EnvironmentUtilities.h: Switch to #pragma once. (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Export function for testing. * WebKit2.xcodeproj/project.pbxproj: (EnvironmentUtilitiesTest.h): Make header private for testing. 2017-04-19 Eric Carlson Provide a way for clients to unmute a media stream. https://bugs.webkit.org/show_bug.cgi?id=170855 Unreviewed, fix a typo missed in the review of r215420. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setPageMuted:]): 2017-04-19 Adrian Perez de Castro [GTK] WebKitAutocleanups.h regression in v2.16.1 release https://bugs.webkit.org/show_bug.cgi?id=170987 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitAutocleanups.h: Remove stray semicolon. 2017-04-18 Per Arne Vollan Dragging a few items over MiniBrowser has 0 in the red indicator. https://bugs.webkit.org/show_bug.cgi?id=170874 Reviewed by Tim Horton. When WebKit does not accept the drag items, the drag count badge should not be updated. Also, if WebKit changes the drag count badge, it should be restored to its original value when the drag exits. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::draggingEntered): (WebKit::WebViewImpl::draggingUpdated): (WebKit::WebViewImpl::draggingExited): 2017-04-18 Wenson Hsieh [WK2] Add infrastructure and unit tests for file uploads using data interaction https://bugs.webkit.org/show_bug.cgi?id=170903 Reviewed by Tim Horton. See Tools/ChangeLog for more details. Makes a small adjustment to _simulateDataInteractionUpdated: to return a BOOL indicating whether or not to allow the operation to proceed. This is necessary for testing scenarios where multiple files are being "data interacted" onto an element. See for more details about the change this patch is testing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _simulateDataInteractionUpdated:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: 2017-04-18 Wenson Hsieh [WK2] Support DataTransfer::files() when performing a DHTML data interaction https://bugs.webkit.org/show_bug.cgi?id=170880 Reviewed by Tim Horton. See the WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformDragControllerAction): (WebKit::WebPageProxy::resetCurrentDragInformation): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag): * UIProcess/WebPageProxy.messages.in: Adds an IPC argument to DidPerformDragControllerAction specifying whether the page prevented the default behavior. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: Adds IPC plumbing for the new filenamesForDataInteraction Pasteboard codepath. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): 2017-04-18 John Wilander Resource Load Statistics: Check both origins and cookieHostNames for domain matches in data removal https://bugs.webkit.org/show_bug.cgi?id=170763 Reviewed by Alex Christensen. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Move semantics for topPrivatelyControlledDomains vector. (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Move semantics for prevalentResourceDomains vector. * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::hostIsInDomain): Static convenience function. (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain): Checks for matching cookieHostNames if types contains WebsiteDataType::Cookies. Also checks origins. * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Now makes use of the new function WebKit::WebsiteDataRecord::validForTopPrivatelyControlledDomain(). (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Move semantics for topPrivatelyControlledDomains vector. (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains): Deleted. Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.' * UIProcess/WebsiteData/WebsiteDataStore.h: 2017-04-18 Brent Fulgham [iOS][WK2] Prevent ephemeral files from being backed up https://bugs.webkit.org/show_bug.cgi?id=170963 Reviewed by Brady Eidson. Tell the OS to skip temporary data files when performing backups. * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: Added. (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Added. * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Add stub for non-iOS platforms. * UIProcess/WebResourceLoadStatisticsStore.h: * WebKit2.xcodeproj/project.pbxproj: Add new file. 2017-04-18 Wenson Hsieh [WK2] Cannot select text on nytimes.com when the selection granularity is WKSelectionGranularityCharacter https://bugs.webkit.org/show_bug.cgi?id=170968 Reviewed by Dan Bernstein. Makes a small adjustment to textInteractionGesture:shouldBeginAtPoint:. When determining whether to allow the text interaction assistant to recognize at a given point, instead of depending on whether or not the hit node is the same as the assisted node, only enforce this restriction when editing an assisted node. Otherwise, default to allowing the selection gesture. Note that character granularity selection was working on most pages before, due to the fact that nodeAtPositionIsAssistedNode was true in many cases when there is no assisted node at all. This is because, in WebPage.mm, we compute the hit-tested node responding to click events to be null, and then set nodeAtPositionIsAssistedNode to be equal to hitNode == m_assistedNode, which ends up being true because both of these values are null. This allowed text selection to work in the simple case when selection granularity character is used, but not when the node containing the selected point actually does respond to click events, since the comparison returns false. New layout test: LayoutTests/editing/selection/character-granularity-select-text-with-click-handler.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): 2017-04-18 Keith Rollin Add additional information when logging URL disposition in WebLoaderStrategy::scheduleLoad https://bugs.webkit.org/show_bug.cgi?id=170813 Reviewed by Alex Christensen. There are a few logging statements in WebLoaderStrategy::scheduleLoad that report, for example, "URL will be loaded as data". These statements also log the address of the frame doing the loading and the identifier of the resource. For consistency with other logging and to make scripted analysis of the logs more robust, also include the pageID and frameID in the logging. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): 2017-04-18 Anders Carlsson Stop using deprecated APIs, part 2 https://bugs.webkit.org/show_bug.cgi?id=170965 Reviewed by Tim Horton. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Remove the status member variable. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::status): New function to be used by older OSes. This will recreate a PKPaymentAuthorizationStatus given a ShippingContactUpdate. (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Stop using the deprecated API. 2017-04-18 Timothy Horton Force scroll view insets to be respected regardless of rubber-banding state https://bugs.webkit.org/show_bug.cgi?id=170937 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2017-04-18 Carlos Garcia Campos [GLIB] Define priorities also for async network IO tasks https://bugs.webkit.org/show_bug.cgi?id=170905 Reviewed by Žan Doberšek. * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::inputStreamReadReadyCallback): (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::outputStreamWriteReadyCallback): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection): (WebKit::NetworkDataTaskSoup::read): (WebKit::NetworkDataTaskSoup::requestNextPart): (WebKit::NetworkDataTaskSoup::writeDownload): (WebKit::NetworkDataTaskSoup::didFinishDownload): * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: (webkitURISchemeRequestReadCallback): (webkit_uri_scheme_request_finish): 2017-04-17 Timothy Horton Plumb all four obscured insets to WebCore, instead of just top/left https://bugs.webkit.org/show_bug.cgi?id=170913 Reviewed by Wenson Hsieh. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::obscuredInsets): (WebKit::operator==): (WebKit::VisibleContentRectUpdateInfo::obscuredInset): Deleted. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): (-[WKWebView _updateVisibleContentRects]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::restorePageState): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::restorePageState): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::restorePageState): (WebKit::WebPage::updateVisibleContentRects): Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization). 2017-04-17 Joseph Pecoraro Web Inspector: Doesn't show size of compressed content correctly https://bugs.webkit.org/show_bug.cgi?id=155112 Reviewed by Alex Christensen and Timothy Hatcher. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::sendResultForCacheEntry): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Include size information in network load metrics. 2017-04-17 Youenn Fablet com.apple.WebKit.Networking.Development crashed in com.apple.WebKit: WebKit::NetworkRTCProvider::resolvedName https://bugs.webkit.org/show_bug.cgi?id=170889 Reviewed by Alex Christensen. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::Resolver::~Resolver): Unschedule the host resolution in addition to cancelling it. Providing a test would need to stop the resolver between the time the resolver is created and gets data in the network process. Or we would need to change Resolver to be instantiated/tested on its own. * NetworkProcess/webrtc/NetworkRTCProvider.h: 2017-04-17 Brady Eidson Make WKHTTPCookieStore public. and https://bugs.webkit.org/show_bug.cgi?id=170920 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKHTTPCookieStore.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: (-[WKHTTPCookieStore getAllCookies:]): (-[WKHTTPCookieStore allCookies:]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore httpCookieStore]): (-[WKWebsiteDataStore _httpCookieStore]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * WebKit2.xcodeproj/project.pbxproj: 2017-04-17 Eric Carlson [MediaStream] Fix typo in UIDelegate::mediaCaptureStateDidChange https://bugs.webkit.org/show_bug.cgi?id=170911 Reviewed by Youenn Fablet. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): Fix typo. 2017-04-17 Keith Rollin Move and update WebLoaderStrategy logging statement https://bugs.webkit.org/show_bug.cgi?id=170140 Reviewed by Alex Christensen. WebLoaderStrategy::scheduleLoad has a logging statement that says, in part: "Resource has been queued for scheduling with the NetworkProcess". This statement is emitted after the ScheduleResourceLoad message has been successfully sent to the NetworkProcess. The logging statement was added at this location to indicate that the resource-load had been successfully handed off; it pairs a similar logging statement that is emitted if the sending of the ScheduleResourceLoad message fails. I think it would be better to move this logging statement before the ScheduleResourceLoad message is sent to the NetworkProcess (and change its wording to "Resource is being scheduled with the NetworkProcess"). The reason for this change is to help make sure that the sequence of logging statements is more deterministic. In the current form, the message "Resource has been queued for scheduling with the NetworkProcess" normally appears before any NetworkProcess logging statements that indicate that the resource-loading is continuing there, but in rare occasions the logging statements can be reversed. This change in the ordering of the statements has caused a problem in a script I've written that examines the resource-loading process and looks for errors. By ensuring that the WebLoaderStrategy statement always appears before the NetworkResourceLoader statement, the flow makes better sense and the script can be more robust. In making this change, we are probably not giving up any assurance that the ScheduleResourceLoad message has been sent to the NetworkResourceLoader. If the message is successfully sent, we'll see logging in the NetworkProcess. If the message has not been sent, we'll see WebLoaderStrategy logging an error. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): 2017-04-17 Anders Carlsson Stop using deprecated APIs, part 1 https://bugs.webkit.org/show_bug.cgi?id=170915 rdar://problem/31589635 Reviewed by Tim Horton. Stop using the PKPaymentRequestPaymentMethodUpdate initializer that takes a status, it's been deprecated and we always passed PKPaymentAuthorizationStatusSuccess anyway. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): 2017-04-17 Youenn Fablet Disable outdated WritableStream API https://bugs.webkit.org/show_bug.cgi?id=170749 Reviewed by Alex Christensen. Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by: - A STREAMS_API compilation flag. - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT. * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2017-04-17 Tim Horton Provide a viewport parameter to disable clipping to the safe area https://bugs.webkit.org/show_bug.cgi?id=170766 Reviewed by Beth Dakin. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::setClipToSafeArea): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::clipToSafeArea): * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didChangeClipToSafeArea): * WebProcess/WebCoreSupport/WebChromeClient.h: * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeClipToSafeArea): * UIProcess/mac/PageClientImpl.h: Forward clip-to-safe-area changes from ChromeClient to WKWebView. Update visible content rects when it changes, which will result in a call to updateFixedClippingView, as below. Keep track of the current state in the UI process. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _contentMayDrawInObscuredInsets]): Expose the current state of the clip-to-safe-area bit as SPI. * UIProcess/ios/WKContentView.mm: (-[WKContentView updateFixedClippingView:]): Disable fixed clipping when clip-to-safe-area is disabled. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): Push the viewport's clip-to-safe-area bit onto the main frame's FrameView. 2017-04-17 Dan Bernstein [Cocoa] Move isNullFunctionPointer down into WTF https://bugs.webkit.org/show_bug.cgi?id=170892 Reviewed by Sam Weinig. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Changed to use WTF::isNullFunctionPointer. (WebKit::isNullFunctionPointer): Deleted. 2017-04-17 Wenson Hsieh [WK2] Respect a new internal setting for defaulting to character selection granularity https://bugs.webkit.org/show_bug.cgi?id=170904 Reviewed by Dan Bernstein. Respect a new WebKitDebugDefaultSelectionGranularityCharacter user default by initializing WKWebViewConfiguration with WKSelectionGranularityCharacter, but only when linked on or after the first iOS to use WKSelectionGranularityCharacter by default. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * UIProcess/Cocoa/VersionChecks.h: 2017-04-17 Eric Carlson Provide a way for clients to unmute a media stream. https://bugs.webkit.org/show_bug.cgi?id=170855 Reviewed by Jon Lee. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setPageMuted:]): New. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-17 Jeremy Jones Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video. https://bugs.webkit.org/show_bug.cgi?id=170778 Reviewed by Tim Horton. setUseAVFoundationAudioCapture is moved from AVCaptureDeviceManager to RealtimeMediaSourceCenterMac. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): 2017-04-15 Keith Rollin Include resource size in some existing logging https://bugs.webkit.org/show_bug.cgi?id=170866 Reviewed by Alex Christensen. In order to correlate resource load times with resource size, we log when the resource is starting to be loaded and when the resource is finished loading. In NetworkResourceLoader::didReceiveResponse, we also log the expected resource length. However, we can only log the length if it is provided in Content-Length, which is not always the case. If it's not provided, we end up logging "length = -1". To make up for this, change NetworkResourceLoader::didFinishLoading and WebResourceLoader:: didFinishLoading to log the length once we know it. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): * NetworkProcess/NetworkResourceLoader.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveData): (WebKit::WebResourceLoader::didFinishResourceLoad): * WebProcess/Network/WebResourceLoader.h: 2017-04-15 Wenson Hsieh [WK2] Support data interaction of files into file inputs https://bugs.webkit.org/show_bug.cgi?id=170803 Reviewed by Tim Horton. Implements remaining support for performing data interaction onto file inputs. There are two main changes at this layer: plumbing the number of files in the pasteboard to the web process, and pulling the implementation of createSandboxExtensionsIfNeeded out of Mac-specific WebViewImpl::createSandboxExtensionsIfNeeded and into WebPageProxy::createSandboxExtensionsIfNeeded. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Relax special-casing of encoding and decoding filenames to be PLATFORM(COCOA) rather than PLATFORM(MAC). * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getNumberOfFiles): More boilerplate plumbing to deliver the number of files in the pasteboard to the web process. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded): Deleted. Move the logic in WebViewImpl::createSandboxExtensionsIfNeeded over to WebPageProxy::createSandboxExtensionsIfNeeded. * UIProcess/WebPageProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getNumberOfFiles): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2017-04-14 Mark Lam Update architectures in xcconfig files. https://bugs.webkit.org/show_bug.cgi?id=170867 Reviewed by Joseph Pecoraro. * Configurations/FeatureDefines.xcconfig: 2017-04-14 Wenson Hsieh [WK2] Support Icon creation from file URLs on iOS https://bugs.webkit.org/show_bug.cgi?id=170809 Reviewed by Tim Horton. Refactors file icon generation logic to support showing an Icon representing the content at a list of file paths on iOS. Pulls out logic in WKFileUploadPanel responsible for generating the thumbnail image for a file input into separate helpers in WebIconUtilities, and then uses these utilities in both WKFileUploadPanel and WebChromeClientIOS. * Shared/ios/WebIconUtilities.h: Added. * Shared/ios/WebIconUtilities.mm: Added. (WebKit::squareCropRectForSize): (WebKit::squareImage): (WebKit::thumbnailSizedImageForImage): (WebKit::fallbackIconForFile): (WebKit::iconForImageFile): (WebKit::iconForVideoFile): (WebKit::iconForFile): Add logic for generating thumbnail icons, moved from WKFileUploadPanel.mm. * UIProcess/ios/forms/WKFileUploadPanel.mm: (squareCropRectForSize): Deleted. (squareImage): Deleted. (thumbnailSizedImageForImage): Deleted. (fallbackIconForFile): Deleted. (iconForImageFile): Deleted. (iconForVideoFile): Deleted. (iconForFile): Deleted. Remove logic for generating thumbnail icons. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::loadIconForFiles): (WebKit::WebChromeClient::createIconForFiles): Rather than call Icon::createIconForFiles directly, loadIconForFiles now consults ChromeClient::createIconForFiles instead. On other platforms, this just turns around and calls Icon::createIconForFiles, but on iOS, we use the utilities introduced in WebIconUtilities to generate a file icon. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::createIconForFiles): 2017-04-14 Brady Eidson Fix basic WKURLSchemeHandler bugs. and https://bugs.webkit.org/show_bug.cgi?id=170862 Reviewed by Andy Estes. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/WebURLSchemeHandlerTask.cpp: (WebKit::WebURLSchemeHandlerTask::didReceiveResponse): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): (WebKit::WebLoaderStrategy::remove): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::startNewTask): (WebKit::WebURLSchemeHandlerProxy::taskDidComplete): (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp: (WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy): (WebKit::WebURLSchemeHandlerTaskProxy::stopLoading): (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse): (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData): (WebKit::WebURLSchemeHandlerTaskProxy::didComplete): (WebKit::WebURLSchemeHandlerTaskProxy::hasLoader): * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h: (WebKit::WebURLSchemeHandlerTaskProxy::identifier): 2017-04-14 Jer Noble [MediaSource] Push capabilities across process boundary during UIProcess capture. https://bugs.webkit.org/show_bug.cgi?id=170814 Reviewed by Eric Carlson. Make a new synchronous getter for capabilities(), moderated by only requesting the capabilities() cross-process the first time called. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::capabilities): (WebKit::UserMediaCaptureManagerProxy::supportedConstraints): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setCapabilities): (WebKit::UserMediaCaptureManager::capabilities): * WebProcess/cocoa/UserMediaCaptureManager.h: 2017-04-13 Dan Bernstein [Cocoa] Allow clients to specify in _WKProcessPoolConfiguration additional directory sandbox extensions https://bugs.webkit.org/show_bug.cgi?id=170387 Reviewed by Sam Weinig. Test: TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm Added an additionalReadAccessAllowedURLs property to _WKProcessPoolConfiguration. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Encode the new additionalSandboxExtensionHandles member. (WebKit::WebProcessCreationParameters::decode): Decode it. * Shared/WebProcessCreationParameters.h: Added additionalSandboxExtensionHandles member. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): Copy new m_additionalReadAccessAllowedPaths member. * UIProcess/API/APIProcessPoolConfiguration.h: Added m_additionalReadAccessAllowedPaths member and accessor functions. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declared new additionalReadAccessAllowedURLs property whose value is an array of URLs to which the Web Content process will be given read access. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): New getter that returns an array of file URLs from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths(). (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): New setter that checks that the given URLs are file URLs and populates the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths with their paths. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Populate the new m_resolvedPaths.additionalWebProcessSandboxExtensionPaths with resolved paths from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths. (WebKit::WebProcessPool::createNewWebProcess): Populate the WebProcessCreationParameters’s additionalSandboxExtensionHandles member with read-only sandbox extensions created from the resolved paths. * UIProcess/WebProcessPool.h: Added additionalWebProcessSandboxExtensionPaths member to the Paths struct. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Consume the additional sandbox extensions. 2017-04-13 Alex Christensen Fix CMake build https://bugs.webkit.org/show_bug.cgi?id=170815 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): 2017-04-12 Dan Bernstein [Mac] Future-proof .xcconfig files https://bugs.webkit.org/show_bug.cgi?id=170802 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: * Configurations/Version.xcconfig: 2017-04-12 Brady Eidson QuotaExceededError when saving to localStorage in private mode. https://bugs.webkit.org/show_bug.cgi?id=157010 Reviewed by Alex Christensen. * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::~StorageAreaMap): * WebProcess/Storage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace): (WebKit::StorageNamespaceImpl::storageArea): (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): (WebKit::StorageNamespaceImpl::copy): * WebProcess/Storage/StorageNamespaceImpl.h: * WebProcess/Storage/WebStorageNamespaceProvider.cpp: (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): * WebProcess/Storage/WebStorageNamespaceProvider.h: 2017-04-12 Yusuke Suzuki Unreviewed, fix build failure on Ubuntu LTS GTK bot https://bugs.webkit.org/show_bug.cgi?id=170781 * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): 2017-04-12 Eric Carlson [MediaStream] rename -[WKWebView _stopMediaCapture] https://bugs.webkit.org/show_bug.cgi?id=170791 Reviewed by Youenn Fablet. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _muteMediaCapture]): (-[WKWebView _stopMediaCapture]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-12 Ryan Haddad Unreviewed build fix. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): 2017-04-12 Jer Noble [WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options. https://bugs.webkit.org/show_bug.cgi?id=170790 Reviewed by Alex Christensen. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCreate): (WKContextConfigurationCreateWithLegacyOptions): * UIProcess/API/C/WKContextConfigurationRef.h: 2017-04-12 Jer Noble [WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happening in UIProcess. https://bugs.webkit.org/show_bug.cgi?id=170781 Reviewed by Alex Christensen. Simultaneously, allow clients to configure whether capturing will occur in the UIProcess through _WKProcessPoolConfiguration. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationShouldCaptureAudioInUIProcess): (WKContextConfigurationSetShouldCaptureAudioInUIProcess): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration shouldCaptureAudioInUIProcess]): (-[_WKProcessPoolConfiguration setShouldCaptureAudioInUIProcess:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): 2017-04-12 Keith Rollin Add some missing NetworkResourceLoader logging https://bugs.webkit.org/show_bug.cgi?id=170139 Reviewed by Alex Christensen. Once execution enters the lambda in NetworkResourceLoader::retrieveCacheEntry, there is little indication of which exit point was taken. If flow enters into startNetworkLoad, we'll get some logging from that function, but not from the others. Add some logging so that we know what the result was from looking up the resource in the cache. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): 2017-04-12 Anders Carlsson Tweak WebCore::setMetadataURL function https://bugs.webkit.org/show_bug.cgi?id=170786 Reviewed by Beth Dakin. Update for WebCore changes. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): 2017-04-12 Brent Fulgham [WK2][Mac] Stop allowing access to disk arbitration process https://bugs.webkit.org/show_bug.cgi?id=170517 Reviewed by Alex Christensen. * WebProcess/com.apple.WebProcess.sb.in: 2017-04-12 Beth Dakin 32-bit build fix. * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): 2017-04-12 Beth Dakin More 32-bit build fix. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): (-[WKView _addMediaPlaybackControlsView:]): 2017-04-12 Beth Dakin Another 32 bit build fix. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::mediaPlaybackControlsView): 2017-04-12 Alex Christensen Stop using didReceiveDataArray callback on El Capitan https://bugs.webkit.org/show_bug.cgi?id=170780 Reviewed by Brady Eidson. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::supportsDataArray): Deleted. (WebKit::NetworkLoad::didReceiveDataArray): Deleted. * NetworkProcess/NetworkLoad.h: 2017-04-12 Beth Dakin Speculative build fix. * UIProcess/API/Cocoa/WKViewPrivate.h: 2017-04-12 Beth Dakin Attempted build fix. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2017-04-12 Beth Dakin Adopt AVKit name change from AVFunctionBar* to AVTouchBar* https://bugs.webkit.org/show_bug.cgi?id=170693 -and corresponding- rdar://problem/31230018 Reviewed by Sam Weinig. Since the new names only apply to some versions of macOS, this patch uses typedefs for the older OS’s. SO: AVFunctionBarScrubber is now AVTouchBarScrubber AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption And the protocol AVFunctionBarPlaybackControlsControlling is now AVTouchBarPlaybackControlsControlling Use the new name. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _mediaPlaybackControlsView]): (-[WKView _addMediaPlaybackControlsView:]): * UIProcess/Cocoa/WebViewImpl.h: Soft links and allocations cannot use the typedefs. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::mediaPlaybackControlsView): (WebKit::WebViewImpl::updateMediaTouchBar): 2017-04-12 Eric Carlson [MediaStream] Audio source in UI process not identified as capture source https://bugs.webkit.org/show_bug.cgi?id=170776 Reviewed by Youenn Fablet. * WebProcess/cocoa/UserMediaCaptureManager.cpp: Override isCaptureSource. 2017-04-12 Andrew Gold Allow iOS to toggle webRTCAPI legacy flag. https://bugs.webkit.org/show_bug.cgi?id=170735 Reviewed by Eric Carlson. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _webRTCLegacyAPIEnabled]): (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2017-04-12 Yusuke Suzuki Unreviewed, build fix for GTK port after r215262 https://bugs.webkit.org/show_bug.cgi?id=170758 * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didRead): 2017-04-12 Yusuke Suzuki [WTF] Introduce Thread class and use RefPtr and align Windows Threading implementation semantics to Pthread one https://bugs.webkit.org/show_bug.cgi?id=170502 Reviewed by Mark Lam. Mechanical change. Use Thread:: APIs. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::readSyncInThread): * Platform/IPC/Connection.cpp: (IPC::Connection::processIncomingMessage): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): * UIProcess/linux/MemoryPressureMonitor.cpp: (WebKit::MemoryPressureMonitor::MemoryPressureMonitor): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2017-04-10 Antti Koivisto Cache small media resources in disk cache https://bugs.webkit.org/show_bug.cgi?id=170676 Reviewed by Andreas Kling. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeRetrieveDecision): Allow retrieving media resources. (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange): (WebKit::NetworkCache::expectedTotalResourceSize): (WebKit::NetworkCache::makeStoreDecision): Store media resource if we can figure out its total size and it is less than 5MB (and it is cacheable by the usual rules). 2017-04-12 Alex Christensen Modernize vector adoption https://bugs.webkit.org/show_bug.cgi?id=170758 Reviewed by Geoffrey Garen. * NetworkProcess/capture/NetworkCaptureEvent.cpp: (WebKit::NetworkCapture::JSONCoder::decode): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::bufferForType): 2017-04-12 Zan Dobersek Unreviewed GTK+ debug build fix. Drop an unused debug-only member variable in the CompositingRunLoop class. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: 2017-04-11 Zan Dobersek [GTK] Use the DisplayRefreshMonitor facilities https://bugs.webkit.org/show_bug.cgi?id=170599 Reviewed by Carlos Garcia Campos. ThreadedCompositor gains a DisplayRefreshMonitor member that it can use to better coordinate display refresh callbacks on the main thread. Still, because currently the GTK+ port doesn't have a reliable way of notifying the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used in order to keep the updates at a reasonable rate. When the timer is fired, the ThreadedCompositor decides how to proceed based on state changes that might have occurred during composition or whether there's any display refresh callbacks that require handling on the main thread. CompositingRunLoop now stores its state in an atomic variable that's then inspected whenever a new update is scheduled or completed. When scheduled, if there's no update in progress, a new update is requested through the timer. If there's already an update in progress, a new update is marked as pending after the current one completes. In that case, when the update is completed, a new update is requested through the timer. ThreadedDisplayRefreshMonitor is used to coordinate updates between the main and the composition thread whenever the CoordinatedGraphics state demands it, or whenever there are clients registered to that monitor that require an update (e.g. a requestAnimationFrame() callback). After the update on the composition thread is finished, and the DisplayRefreshMonitor object requires an update, a callback at the same priority as the layer flush timer is scheduled on the main thread. In that callback we handle any clients registered for this DisplayRefreshMonitor before proceeding to handle any changes to the CoordinatedGraphics scene. In case the DisplayRefreshMonitor clients or the layer flushes already queued up any changes to the state, we immediately ask the ThreadedCompositor for an update. * PlatformGTK.cmake: * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::updateViewport): (WebKit::CoordinatedGraphicsScene::commitSceneState): * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): (WebKit::CompositingRunLoop::isActive): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::updateCompleted): (WebKit::CompositingRunLoop::updateTimerFired): (WebKit::CompositingRunLoop::isCurrent): (WebKit::CompositingRunLoop::startUpdateTimer): Deleted. (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: (): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::invalidate): (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): (WebKit::ThreadedCompositor::updateViewport): (WebKit::ThreadedCompositor::scheduleDisplayImmediately): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::displayRefreshMonitor): (WebKit::ThreadedCompositor::renderNextFrameIfNeeded): (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): (WebKit::ThreadedCompositor::performFrameCompletion): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added. (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): (WebKit::ThreadedDisplayRefreshMonitor::invalidate): (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor): * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/LayerTreeHost.h: (WebKit::LayerTreeHost::createDisplayRefreshMonitor): 2017-04-11 Alex Christensen Modernize and clean up code https://bugs.webkit.org/show_bug.cgi?id=170752 Reviewed by Sam Weinig. * NetworkProcess/NetworkResourceLoader.h: * Shared/WebPreferencesStore.h: * UIProcess/API/APIHitTestResult.cpp: (API::HitTestResult::create): * UIProcess/API/APIHitTestResult.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesCreate): (WKPreferencesCreateWithIdentifier): (WKPreferencesCreateCopy): * UIProcess/Authentication/AuthenticationChallengeProxy.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults): (WebKit::WebPreferences::copy): * UIProcess/WebPreferences.h: * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::requestCheckingOfString): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addTextCheckingRequest): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::rangeForBlockAtPoint): (WebKit::WebPage::expandedRangeFromHandle): (WebKit::WebPage::contractedRangeFromHandle): (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): (WebKit::WebPage::changeBlockSelection): (WebKit::WebPage::rangeForGranularityAtPoint): (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): 2017-04-11 Dean Jackson Disable outdated WritableStream API https://bugs.webkit.org/show_bug.cgi?id=170749 Reviewed by Tim Horton. The API we implement is no longer accurate. Disable it until we are compatible with the new specification * Configurations/FeatureDefines.xcconfig: 2017-04-11 Dan Bernstein [Cocoa] WebKit unnecessarily soft-links CorePrediction https://bugs.webkit.org/show_bug.cgi?id=170644 Reviewed by Sam Weinig. * Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES. * Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where available. On macOS, use weak linking, because CorePrediction is not available in the Base System. * Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with #if HAVE(CORE_PREDICTION). (WebKit::isNullFunctionPointer): Added this helper. (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced dlopen()-based runtime check with a null check. * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if HAVE(CORE_PREDICTION). * Platform/spi/Cocoa/CorePredictionSPI.h: Added. * UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION). * WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition. 2017-04-11 David Quesada Add SPI for handling geolocation authorization requests https://bugs.webkit.org/show_bug.cgi?id=170362 rdar://problem/17508627 Reviewed by Alex Christensen. Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page requests geolocation access. To support testing this change, make it possible to override the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable object on the process pool that implements a protocol for providing location updates for web views in the process pool. If the client doesn't provide this object, WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1 WebGeolocationCoreLocationProvider and conforms to the new protocol. * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/WebGeolocationPosition.h: (WebKit::WebGeolocationPosition::create): * UIProcess/API/C/WKGeolocationPosition.cpp: (WKGeolocationPositionCreate_b): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _coreLocationProvider]): (-[WKProcessPool _setCoreLocationProvider:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. * UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added. (WebKit::if): (-[_WKGeolocationPosition dealloc]): (-[_WKGeolocationPosition _apiObject]): * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. (WebKit::wrapper): * UIProcess/ios/WKGeolocationProviderIOS.mm: (kit): (-[WKGeolocationProviderIOS initWithProcessPool:]): (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): (-[WKGeolocationProviderIOS positionChanged:]): (-[WKLegacyCoreLocationProvider setListener:]): (-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]): (-[WKLegacyCoreLocationProvider start]): (-[WKLegacyCoreLocationProvider stop]): (-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]): (-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]): (-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]): (-[WKLegacyCoreLocationProvider positionChanged:]): (-[WKLegacyCoreLocationProvider errorOccurred:]): (-[WKLegacyCoreLocationProvider resetGeolocation]): Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS expects. * WebKit2.xcodeproj/project.pbxproj: 2017-04-11 Eric Carlson [MediaStream] Set correct audio session category when capturing audio https://bugs.webkit.org/show_bug.cgi?id=170736 Reviewed by Jer Noble. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingMediaDidChange): 2017-04-11 Youenn Fablet Activate WebRTC data channel tests for WK1 https://bugs.webkit.org/show_bug.cgi?id=170710 Reviewed by Eric Carlson. * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure networking is not done in the Web process. 2017-04-11 Chris Fleizach AX: PDF plugin needs to support PDF-DOM Mode https://bugs.webkit.org/show_bug.cgi?id=170589 Reviewed by Tim Horton. Provide access to DOM objects with PDF document. This mean: 1) Support a different set of attributes for WKPDFPluginAccessibilityObject. WKPDFPluginAccessibilityObject is now a group instead of forwarding attribute calls to the pdf layer. 2) Connect the focused UI element to the active annotation if possible. 3) Mark the PDF associated nodes with an attribute so they can be identified later so their correct parent can be found. * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (-[WKPDFPluginAccessibilityObject pdfLayerController]): (-[WKPDFPluginAccessibilityObject setPdfLayerController:]): (-[WKPDFPluginAccessibilityObject convertRectToScreenSpace:]): (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]): (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]): (-[WKPDFPluginAccessibilityObject accessibilityActionNames]): (-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]): (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]): (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]): (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]): (WebKit::PDFPlugin::convertFromRootViewToPDFView): (WebKit::PDFPlugin::convertFromPDFViewToScreen): (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest): (WebKit::PDFPlugin::axObjectCache): (WebKit::PDFPlugin::accessibilityShadowPluginParentForElement): * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::attach): * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::accessibilityShadowPluginParentForElement): (WebKit::Plugin::pluginHandlesContentOffsetForAccessibilityHitTest): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::accessibilityShadowPluginParentForElement): * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2017-04-11 Adrian Perez de Castro [GTK] Attach popup menu to web view widget https://bugs.webkit.org/show_bug.cgi?id=145866 Use gtk_menu_attach_to_widget() to let GTK+ know that popup menus belong to a certain web view. This improves the positioning choices that the toolkit can do, and solves a long-standing issue that caused long popup menus to hang outside of the available display area under Wayland. Based on a patch by Jonas Ådahl . Reviewed by Carlos Garcia Campos. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): 2017-04-10 Alex Christensen Revert r215217 https://bugs.webkit.org/show_bug.cgi?id=170703 * Configurations/FeatureDefines.xcconfig: 2017-04-10 Alex Christensen Continue enabling WebRTC https://bugs.webkit.org/show_bug.cgi?id=170703 Reviewed by Youenn Fablet. * Configurations/FeatureDefines.xcconfig: 2017-04-10 Alex Christensen REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions https://bugs.webkit.org/show_bug.cgi?id=170707 Reviewed by Tim Horton. We fix this by sending the UserContentController with the WebPageCreationParameters instead of in a IPC message immediately following creation. By the time the WebPage receives its second message, it has already started loading the first main resource. I also changed all instances of calling ChildProcessProxy::connection() to send a message in favor of calling ChildProcessProxy::send, which does the same thing except if a child process has not started, it will put the message in a queue and send it when the process is finished launching. This was necessary because the UserContentController is now connected to the process sooner, so there were some API tests that would try to send messages between initiating a process launch and finishing a process launch, and this change preserves the existing behavior in those cases. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection): (WebKit::DatabaseProcessProxy::didFinishLaunching): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::cancel): (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): (WebKit::DownloadProxy::willSendRequest): (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::addUserContentWorldUse): (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses): (WebKit::WebUserContentControllerProxy::addUserScript): (WebKit::WebUserContentControllerProxy::removeUserScript): (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::addUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers): (WebKit::WebUserContentControllerProxy::addContentExtension): (WebKit::WebUserContentControllerProxy::removeContentExtension): (WebKit::WebUserContentControllerProxy::removeAllContentExtensions): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired): (WebKit::VisitedLinkStore::sendTable): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): (WebKit::WebPageProxy::creationParameters): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addWebUserContentControllerProxy): * UIProcess/WebProcessProxy.h: * WebProcess/UserContent/WebUserContentController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_backgroundCPULimit): 2017-04-10 Alex Christensen Add API to get available content extension identifiers in a WKContentExtensionStore https://bugs.webkit.org/show_bug.cgi?id=170093 Reviewed by Geoffrey Garen. * UIProcess/API/APIContentExtensionStore.cpp: (API::constructedPathPrefix): (API::constructedPathFilter): (API::constructedPath): (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): * UIProcess/API/APIContentExtensionStore.h: * UIProcess/API/Cocoa/WKContentExtensionStore.h: * UIProcess/API/Cocoa/WKContentExtensionStore.mm: (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]): (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]): (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]): (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): 2017-04-10 Jeremy Jones Add CoreAudioCaptureSource. https://bugs.webkit.org/show_bug.cgi?id=170112 rdar://problem/30293338 Reviewed by Tim Horton. Add UseAVFoundationAudioCapture preference to switch back from the new default of CoreAudio. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetUseAVFoundationAudioCapture): (WKPreferencesGetUseAVFoundationAudioCapture): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-04-10 Brent Fulgham [WK2][macOS] Block access to Apple Events before launch. https://bugs.webkit.org/show_bug.cgi?id=170626 Reviewed by Alexey Proskuryakov. Clear the environment of the AppleEvent server name before initializing AppKit so we never bother connecting. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (main): 2017-04-10 Adrian Perez de Castro [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup() https://bugs.webkit.org/show_bug.cgi?id=170553 Reviewed by Michael Catanzaro. Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when building with GTK+ 3.22 or newer. This allows the Wayland GTK+ backend to properly position popup menus, and also avoids using functions which were deprecated starting at that GTK+ release. * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::WebContextMenuProxyGtk::show): Use gtk_menu_popup_at_pointer() as there is always a pointer event that can be passed to it. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_popup_at_rect(), using the coordinates of the control passed as reference rectangle. Some conditional code is needed because with newer GTK+ versions a relative offset instead of an absolute position is needed. 2017-04-10 Adrian Perez de Castro [GTK] Opening a popup menu does not pre-select the active item https://bugs.webkit.org/show_bug.cgi?id=170680 Reviewed by Michael Catanzaro. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_shell_select_item() to ensure that the active item appears selected right after popping up the menu. 2017-04-10 Carlos Garcia Campos [GTK] Enable DOM timer throttling and CSS animations suspension https://bugs.webkit.org/show_bug.cgi?id=170669 Reviewed by Žan Doberšek. * Shared/WebPreferencesDefinitions.h: 2017-04-10 Chris Dumez Drop Timer::startOneShot() overload taking a double https://bugs.webkit.org/show_bug.cgi?id=170659 Reviewed by Yusuke Suzuki. Drop Timer::startOneShot() overload taking a double as people should use Seconds type now. * NetworkProcess/PingLoad.h: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::startTimeout): * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog): (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): (IPC::Connection::terminateSoon): * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::setMinimumLifetime): * PluginProcess/PluginProcess.h: * Shared/ChildProcess.cpp: (WebKit::ChildProcess::ChildProcess): * Shared/ChildProcess.h: (WebKit::ChildProcess::setTerminationTimeout): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::startUpdateTimer): * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::initializeTimers): * Shared/WebProcessCreationParameters.h: * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm: (API::SharedJSContext::ensureContext): * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::shutDownProcess): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didChangeIsLoading): * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog): * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw): * UIProcess/Gamepad/UIGamepadProvider.cpp: * UIProcess/Plugins/PluginProcessProxy.cpp: * UIProcess/ProcessThrottler.cpp: * UIProcess/ResponsivenessTimer.cpp: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::DragGesture::begin): * UIProcess/mac/WebInspectorProxyMac.mm: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::scheduleAnimation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): * WebProcess/WebProcess.cpp: 2017-04-09 Wenson Hsieh [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes https://bugs.webkit.org/show_bug.cgi?id=170658 Reviewed by Tim Horton. Introduces doAfterPositionInformationUpdate:forRequest:, which WKContentView can use internally to perform an action requiring InteractionInformationAtPosition asynchronously. See below for additional details. New API unit test: DataInteractionTests.UnresponsivePageDoesNotHangUI. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView _actionForLongPress]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): If current position information satisfies the request, then perform the given block immediately; otherwise, we save the block and request as a pair in a list of pending position information handlers, and then make a new request to the web process for position information if the currently outgoing request does not already satisfy the given request. (-[WKContentView ensurePositionInformationIsUpToDate:]): Fire all asynchronous position information handlers that are satisfied by the incoming position information. (-[WKContentView requestAsynchronousPositionInformationUpdate:]): (-[WKContentView _currentPositionInformationIsValidForRequest:]): (-[WKContentView _hasValidOutstandingPositionInformationRequest:]): Pulled out common logic for managing InteractionInformationRequests into separate helper methods. (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]): (-[WKContentView gestureRecognizerShouldBegin:]): Refactored to use ensurePositionInformationIsUpToDate:. There is no behavior change here, but it makes sure that this particular request will also any valid pending position information handlers. (-[WKContentView _positionInformationDidChange:]): Fire all asynchronous position information handlers that are satisfied by the incoming position information. (-[WKContentView pointIsInDataInteractionContent:]): Deleted. We should no longer use this method, since it makes a synchronous request to the web process -- see positionInformationMayStartDataInteraction. 2017-04-09 Chris Dumez Drop Timer::startRepeating() overload taking a double https://bugs.webkit.org/show_bug.cgi?id=170656 Reviewed by Yusuke Suzuki. Drop Timer::startRepeating() overload taking a double as people should use Seconds type now. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::initializeTimers): * UIProcess/Cocoa/ViewGestureController.cpp: * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: * UIProcess/PerActivityStateCPUUsageSampler.cpp: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::Timer::start): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): 2017-04-09 Jon Lee [WK2][iOS] Add CoreMedia entitlement for WebProcess https://bugs.webkit.org/show_bug.cgi?id=170623 rdar://problem/30020073 Reviewed by Youenn Fablet. * Configurations/WebContent-iOS.entitlements: Update entitlement to an array of strings instead of bool. 2017-04-09 Chris Dumez Start dropping Timer API dealing with double https://bugs.webkit.org/show_bug.cgi?id=170649 Reviewed by Yusuke Suzuki. Start dropping Timer API dealing with double as people should use Seconds now. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::scheduleFailure): * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::resume): * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::destroy): (WebKit::PluginControllerProxy::startPaintTimer): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseScheduleUpdateActivityState): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::setViewExposedRect): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::addVisitedLinkHash): * UIProcess/WebProcessPool.cpp: (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter): * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::ZoomGesture::scaleChanged): * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::menuUnmappedCallback): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::addToInvalidationQueue): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::deliverDataToPlugin): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pendingURLRequestsTimerFired): (WebKit::PluginView::loadURL): * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::scheduleDisplay): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateIsInWindow): (WebKit::WebPage::addPluginView): (WebKit::WebPage::setMayStartMediaWhenInWindow): (WebKit::WebPage::didFinishLoad): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): 2017-04-08 Chris Dumez Drop std::chrono support from Timer class https://bugs.webkit.org/show_bug.cgi?id=170645 Reviewed by Sam Weinig. Drop std::chrono support from Timer class now that we prefer using Seconds type. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::Throttle::Throttle): (WebKit::NetworkLoad::didReceiveResponseNetworkSession): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::loadThrottleLatency): * NetworkProcess/NetworkProcessCreationParameters.cpp: * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: * NetworkProcess/cache/NetworkCacheStatistics.cpp: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::store): * Shared/CacheModel.cpp: (WebKit::calculateMemoryCacheSizes): * Shared/CacheModel.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): * WebProcess/Plugins/PluginView.cpp: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately): (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): * WebProcess/WebProcess.cpp: (WebKit::m_resourceLoadStatisticsStore): (WebKit::WebProcess::setCacheModel): 2017-04-08 Chris Dumez Unreviewed attempt to fix GTK build after r215138. * UIProcess/API/gtk/WebKitUIClient.cpp: 2017-04-08 Youenn Fablet WebRTC tests gardening https://bugs.webkit.org/show_bug.cgi?id=170508 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2017-04-08 Chris Dumez Timer's nextFireInterval() / repeatInterval() should return Seconds https://bugs.webkit.org/show_bug.cgi?id=170639 Reviewed by Simon Fraser. Timer's nextFireInterval() / repeatInterval() should return Seconds, not double. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::layerVolatilityTimerFired): (WebKit::WebPage::markLayersVolatile): 2017-04-07 Alex Christensen Modernize WebPage.h https://bugs.webkit.org/show_bug.cgi?id=170633 Reviewed by Joseph Pecoraro. * UIProcess/API/APIUIClient.h: (API::UIClient::createNewPage): * UIProcess/API/C/WKPage.cpp: (WebKit::RunBeforeUnloadConfirmPanelResultListener::create): (WebKit::RunJavaScriptAlertResultListener::create): (WebKit::RunJavaScriptConfirmResultListener::create): (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener): (WebKit::RunJavaScriptPromptResultListener::create): (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener): (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::loadStringImpl): (WebKit::WebPage::loadData): (WebKit::WebPage::scaledSnapshotWithOptions): (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction): (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension): * WebProcess/WebPage/WebPage.h: 2017-04-07 Alex Christensen Use audit_token_t instead of pid_t for checking sandbox of other processes https://bugs.webkit.org/show_bug.cgi?id=170616 Reviewed by Daniel Bates. pid's can be reused, so it's theoretically unsafe to use the pid of another process to check whether it's sandboxed. Use an audit_token_t instead to be more sure that we are not mistakenly checking a new process that has reused the old process's pid. For the current process, though, we have no xpc_connection_t to the process because we are the process. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeSandbox): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::isClientSandboxed): * Shared/mac/SandboxUtilities.h: * Shared/mac/SandboxUtilities.mm: (WebKit::currentProcessIsSandboxed): (WebKit::connectedProcessIsSandboxed): (WebKit::processIsSandboxed): Deleted. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::platformIsBeingDebugged): * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::shouldUsePlugin): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformGetLaunchOptions): 2017-04-07 Brent Fulgham [WK2][iOS] Add CoreMedia entitlement for WebProcess https://bugs.webkit.org/show_bug.cgi?id=170623 Reviewed by Youenn Fablet. Add new "com.apple.tcc.delegated-services" entitlement to allow CoreMedia to work properly in WebRTC. * Configurations/WebContent-iOS.entitlements: 2017-04-07 Alex Christensen Private browsing sessions should not look in keychain for client certificates https://bugs.webkit.org/show_bug.cgi?id=170618 Reviewed by Dan Bernstein. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::configurationForSessionID): 2017-04-07 Chris Dumez We should log how much CPU a background process was using when killing it due to CPU limiting https://bugs.webkit.org/show_bug.cgi?id=170619 Reviewed by Andreas Kling. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateBackgroundCPUMonitorState): 2017-04-07 Wenson Hsieh Missing conversion from window to content coordinates when adjusting unobscured content rects for input view https://bugs.webkit.org/show_bug.cgi?id=170603 Reviewed by Simon Fraser. Refactors -[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:] to convert the input view bounds into content coordinates instead of using the zoom scale to adjust the height of inputViewBounds. Covered by the existing LayoutTest, fixed-element-on-bottom-with-keyboard.html. * UIProcess/ios/WKContentView.mm: (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]): 2017-04-07 Michael Catanzaro [GTK] Various build errors when plugin support is disabled https://bugs.webkit.org/show_bug.cgi?id=170015 Reviewed by Carlos Garcia Campos. * PluginProcess/unix/PluginControllerProxyUnix.cpp: * UIProcess/API/gtk/WebKitWebsiteData.cpp: (recordContainsSupportedDataTypes): (toWebKitWebsiteDataTypes): * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: (toWebsiteDataTypes): 2017-04-07 John Wilander WebSocket streams should have network usage attributed to correct process https://bugs.webkit.org/show_bug.cgi?id=170322 Reviewed by Alex Christensen. Changes here are due to the added WebCore::SourceApplicationAuditToken parameter in WebCore::SocketStreamHandleImpl::create(). WebKit::NetworkSocketStream takes it and passes it on. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::createSocketStream): * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): * NetworkProcess/NetworkSocketStream.h: 2017-04-07 Michael Catanzaro Unreviewed, fix missing return value warning * UIProcess/WebProcessProxy.cpp: (WebKit::diagnosticLoggingKeyForSimulatedCrashReason): 2017-04-07 Carlos Garcia Campos [GTK] Update the priorities used in glib main loop sources https://bugs.webkit.org/show_bug.cgi?id=170457 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor): * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::createWaylandLoopSource): * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::DrawingAreaImpl): 2017-04-06 Alex Christensen Add WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h https://bugs.webkit.org/show_bug.cgi?id=170533 Reviewed by Daniel Bates. * Shared/API/Cocoa/WebKit.h: In r213696 I added two public headers. All public headers in WebKit are included with #import 2017-04-06 Joseph Pecoraro Web Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics https://bugs.webkit.org/show_bug.cgi?id=170575 Rubber-stamped by Brian Burg. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): Deleted. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: m_networkLoad is a wrapper around `this` as the client, so we would infinite loop here. 2017-04-06 Commit Queue Unreviewed, rolling out r214973. https://bugs.webkit.org/show_bug.cgi?id=170578 Causes issues in Safari (Requested by bradee-oh on #webkit). Reverted changeset: "Refactor so WebsiteDataStores always have a StorageManager." https://bugs.webkit.org/show_bug.cgi?id=170521 http://trac.webkit.org/changeset/214973 2017-04-06 Ryan Haddad Unreviewed, rolling out r215046. This change broke internal builds. Reverted changeset: "WebRTC tests gardening" https://bugs.webkit.org/show_bug.cgi?id=170508 http://trac.webkit.org/changeset/215046 2017-04-06 Joseph Pecoraro Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend https://bugs.webkit.org/show_bug.cgi?id=170525 Reviewed by Youenn Fablet. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Only collect extra metrics if the WebProcess this load is for has enabled collecting extra metrics. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled): * WebProcess/Network/WebLoaderStrategy.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled): * NetworkProcess/NetworkConnectionToWebProcess.h: (WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled): * NetworkProcess/NetworkConnectionToWebProcess.messages.in: New bool state toggled through the loader policy. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: (WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Default handling for network loads is to not include extra data. Thread client messages back from the NetworkLoads / SpeculativeLoads to check the NetworkConnectionToWebProcess state on whether or not we should collect extra metrics. 2017-04-06 Joseph Pecoraro Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar https://bugs.webkit.org/show_bug.cgi?id=16531 Reviewed by Timothy Hatcher. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Include a complete list of the request headers sent for this load. There may be headers that WebCore did not know about and developer tools should be informed of. 2017-04-06 Anders Carlsson OptionSet options need to be powers of two https://bugs.webkit.org/show_bug.cgi?id=170565 Reviewed by Chris Dumez. Change Cache::Option to be powers of two. * NetworkProcess/cache/NetworkCache.h: 2017-04-06 Youenn Fablet WebRTC tests gardening https://bugs.webkit.org/show_bug.cgi?id=170508 Reviewed by Eric Carlson. * Configurations/FeatureDefines.xcconfig: 2017-04-06 Antti Koivisto Implement testing mode for disk cache https://bugs.webkit.org/show_bug.cgi?id=170547 Reviewed by Andreas Kling. Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness. Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk. This is enabled by the existing WKContextUseTestingNetworkSession SPI. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::initialize): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::shrinkIfNeeded): * NetworkProcess/cache/NetworkCacheStorage.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): 2017-04-06 Chris Dumez [WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting https://bugs.webkit.org/show_bug.cgi?id=170524 Reviewed by Eric Carlson. Add C private API to toggle invisibleAutoplayNotPermitted setting. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetInvisibleMediaAutoplayPermitted): (WKPreferencesGetInvisibleMediaAutoplayPermitted): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2017-04-06 Adrian Perez de Castro [GTK] Fix build with MEDIA_CAPTURE enabled https://bugs.webkit.org/show_bug.cgi?id=170539 Reviewed by Carlos Garcia Campos. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp: (webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone. 2017-04-05 Brent Fulgham [WK2][iOS] Remove access to features not present on iOS https://bugs.webkit.org/show_bug.cgi?id=170531 Reviewed by Alexey Proskuryakov. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2017-04-05 Eric Carlson [MediaStream] Host application should be able to mute and unmute media streams https://bugs.webkit.org/show_bug.cgi?id=170519 Reviewed by Youenn Fablet. * UIProcess/API/C/WKPage.cpp: (WKPageGetMediaState): Support new media stream state flags. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Ditto. * UIProcess/Cocoa/UIDelegate.mm: Ditto. 2017-04-05 Brady Eidson Refactor so WebsiteDataStores always have a StorageManager. https://bugs.webkit.org/show_bug.cgi?id=170521 Reviewed by Geoff Garen. This basically involves teaching StorageManager how to work without a LocalStorageDatabaseTracker, since there will never be ephemeral bits on disk to track. * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded): (WebKit::StorageManager::createEphemeral): (WebKit::StorageManager::StorageManager): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::getLocalStorageOriginDetails): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): * UIProcess/Storage/StorageManager.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): 2017-04-05 Brent Fulgham [WK2][iOS] Add entitlements to enable audio/video capture in WebProcess https://bugs.webkit.org/show_bug.cgi?id=170507 Reviewed by Youenn Fablet. Add two entitlements that are required to access audio/video capture on iOS. * Configurations/WebContent-iOS.entitlements: 2017-04-05 Carlos Garcia Campos Show a log message when an invalid message is received in non cocoa ports https://bugs.webkit.org/show_bug.cgi?id=170506 Reviewed by Michael Catanzaro. We just crash, but without knowing the details about the message it's impossible to debug. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::didReceiveInvalidMessage): 2017-04-04 Carlos Garcia Campos Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore https://bugs.webkit.org/show_bug.cgi?id=156974 Reviewed by Sam Weinig. WebErrors are not only used by the frame loader client in the web process, but also by the network process. So, move them to Shared make most of the implementation cross-platform. * CMakeLists.txt: Add new files to compilation. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::download): Use WebErrors directly instead of platform methods that are no longer needed. (WebKit::NetworkDataTaskSoup::writeDownloadCallback): Ditto. (WebKit::NetworkDataTaskSoup::didFinishDownload): Ditto. (WebKit::NetworkDataTaskSoup::didFail): Ditto. * PlatformGTK.cmake: Add new files to compilation and remove DownloadSoupErrorsGtk.cpp * PlatformMac.cmake: * Shared/API/APIError.cpp: Add error domains used by glib based ports. (API::Error::webKitNetworkErrorDomain): (API::Error::webKitPolicyErrorDomain): (API::Error::webKitPluginErrorDomain): (API::Error::webKitDownloadErrorDomain): (API::Error::webKitPrintErrorDomain): * Shared/API/APIError.h: * Shared/Cocoa/WebErrorsCocoa.mm: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h. (WebKit::createNSError): (WebKit::cancelledError): (WebKit::fileDoesNotExistError): * Shared/WebErrors.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp. (WebKit::blockedError): (WebKit::blockedByContentBlockerError): (WebKit::cannotShowURLError): (WebKit::interruptedForPolicyChangeError): (WebKit::blockedByContentFilterError): (WebKit::cannotShowMIMETypeError): (WebKit::pluginWillHandleLoadError): (WebKit::internalError): * Shared/WebErrors.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h. * Shared/glib/WebErrorsGlib.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp. (WebKit::cancelledError): (WebKit::fileDoesNotExistError): * Shared/gtk/WebErrorsGtk.cpp: Copied from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp. (WebKit::printError): (WebKit::printerNotFoundError): (WebKit::invalidPageRangeToPrint): * Shared/soup/WebErrorsSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp. (WebKit::downloadNetworkError): (WebKit::downloadCancelledByUserError): (WebKit::downloadDestinationError): * UIProcess/API/gtk/WebKitDownload.cpp: * UIProcess/API/gtk/WebKitError.cpp: (webkit_network_error_quark): (webkit_policy_error_quark): (webkit_plugin_error_quark): (webkit_download_error_quark): (webkit_print_error_quark): * UIProcess/API/gtk/WebKitPrivate.cpp: (toWebKitError): (toWebCoreError): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Removed. * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: 2017-04-04 Youenn Fablet [Mac] Add back web audio support for getUserMedia MediaStreamTrack https://bugs.webkit.org/show_bug.cgi?id=170482 Reviewed by Eric Carlson. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setStorage): 2017-04-04 Tim Horton [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps https://bugs.webkit.org/show_bug.cgi?id=165801 Reviewed by Wenson Hsieh. Previously, when doing an incremental find that wrapped, we would say that it did not, leading NSTextFinder to not provide its usual wrapping UI, and other clients of the NSTextFinderClient protocol to get confused by the lack of wrapping. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFindString): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/API/APIFindClient.h: (API::FindClient::didFindString): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageFindClient): * UIProcess/Cocoa/FindClient.h: * UIProcess/Cocoa/FindClient.mm: (WebKit::FindClient::didFindString): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::findString): * WebProcess/WebPage/FindController.h: Plumb DidWrap from FindController's call to findString back through the DidFindString message. * UIProcess/mac/WKTextFinderClient.mm: (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]): (-[WKTextFinderClient didFindStringMatchesWithRects:]): Deleted. Make use of the new DidWrap information to stop lying to NSTextFinder about whether a wrap actually occurred. 2017-04-03 Wenson Hsieh Data interaction should register type identifiers in order of priority https://bugs.webkit.org/show_bug.cgi?id=170428 Reviewed by Tim Horton. Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/API/Cocoa/WKWebView.mm: 2017-04-03 Joseph Pecoraro Remove no longer needed forward declarations https://bugs.webkit.org/show_bug.cgi?id=170415 Reviewed by Dan Bernstein. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 2017-04-03 Anders Carlsson Tweak ApplePaySession API https://bugs.webkit.org/show_bug.cgi?id=170409 rdar://problem/31405459 Reviewed by Tim Horton. Update for WebCore changes. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSError): 2017-04-03 Carlos Garcia Campos [SOUP] URI Fragment is lost after redirect https://bugs.webkit.org/show_bug.cgi?id=170058 Reviewed by Michael Catanzaro. In case of redirection check if the current request has a fragment identifier and apply it to the redirection only when it doesn't have a fragment identifier yet. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): (WebKit::NetworkDataTaskSoup::createRequest): (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): * NetworkProcess/soup/NetworkDataTaskSoup.h: 2017-04-03 Antti Koivisto Mutex may be freed too late in NetworkCache::Storage::traverse https://bugs.webkit.org/show_bug.cgi?id=170400 Reviewed by Carlos Garcia Campos and Andreas Kling. Fix a race. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::traverse): Ensure the mutex is not accessed after we dispatch to the main thread. The main thread call deletes the owning TraverseOperation. 2017-04-01 Dan Bernstein [iOS] label should be specified using plural rules https://bugs.webkit.org/show_bug.cgi?id=170388 Reviewed by Alexey Proskuryakov. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]): Instead of calling -_displayStringForPhotos:videos:, use +[NSString localizedStringWithFormat:] with the new format string "%lu photo(s) and %lu video(s)" for which there are plural rules. (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted. 2017-04-01 Dan Bernstein [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid https://bugs.webkit.org/show_bug.cgi?id=170385 Reviewed by Tim Horton. * Configurations/WebKit.xcconfig: When WebKit is relocatable, tell the linker that it’s not going to be in the shared cache, even if its install name implies that it might be. 2017-03-31 Simon Fraser Remove a logging statement left in by mistake. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::restoreViewState): 2017-03-31 Wenson Hsieh Address post-review feedback after r214692 https://bugs.webkit.org/show_bug.cgi?id=170328 Reviewed by Dan Bernstein. Clearing the selection when UIKit calls into WKContentView to set its selected text range to nil is a rule that should be applied when using a text interaction assistant, not just when using character granularity for selecting text. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setSelectedTextRange:]): 2017-03-31 Wenson Hsieh [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity https://bugs.webkit.org/show_bug.cgi?id=170328 Reviewed by Tim Horton. When UIKit clears the selection while in text interaction mode, it notifies its document view (i.e., the WKContentView) by setting its selected text range to nil. When character granularity selection is enabled, use this as a cue to notify the web process that the selection is being cleared out. -setSelectedTextRange: is a noop in the general case because the web process acts as the source of truth for what the selection currently consists of, and notifies the UI process and UIKit via WKTextPosition and WKTextRange. However, in the case of character granularity selections, tapping away to clear the selection is handled by UIKit's text gesture recognizer cluster, which then informs the document (via -setSelectedTextRange:) that the selection should be cleared out. Adds a new Layout test: editing/selection/character-granularity-selected-range-after-dismissing-selection.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setSelectedTextRange:]): 2017-03-31 Wenson Hsieh [WK2] Tapping editable text inside of a range selection no longer changes the selection to a caret https://bugs.webkit.org/show_bug.cgi?id=170327 Reviewed by Tim Horton. Currently, we're forcing all text interaction gestures to duck in lieu of data interaction gestures when we should only be doing so for gestures that begin a loupe. This prevents other gestures, such as single taps, from changing the selection when they should be allowed to. Hooks into new UIKit SPI to make this tweak. Introduces a new LayoutTest: editing/selection/caret-after-tap-in-editable-selection.html. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView pointIsInAssistedNode:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): 2017-03-31 Tim Horton Mail can get stuck underneath FindController::findStringMatches after searching in a long message https://bugs.webkit.org/show_bug.cgi?id=170326 Reviewed by Simon Fraser. * UIProcess/mac/WKTextFinderClient.mm: (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]): Cap the number of find matches at 1000, the same maximum that Safari uses. 2017-03-31 Brady Eidson Clean up the "StorageType" enum. https://bugs.webkit.org/show_bug.cgi?id=170349 Reviewed by Tim Horton. * WebProcess/Storage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::dispatchStorageEvent): (WebKit::StorageAreaMap::dispatchSessionStorageEvent): (WebKit::StorageAreaMap::dispatchLocalStorageEvent): * WebProcess/Storage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::createSessionStorageNamespace): (WebKit::StorageNamespaceImpl::createLocalStorageNamespace): (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace): 2017-03-31 Tim Horton Remove bundle checks for attachmentElementEnabled https://bugs.webkit.org/show_bug.cgi?id=170329 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): Remove bundle checks. 2017-03-29 Anders Carlsson Adopt PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication https://bugs.webkit.org/show_bug.cgi?id=170257 rdar://problem/31289764 Reviewed by Beth Dakin. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): 2017-03-31 Csaba Osztrogonác Mac cmake buildfix after r214403 https://bugs.webkit.org/show_bug.cgi?id=170346 Unreviewed speculative buildfix. * UIProcess/API/Cocoa/WKWebView.mm: 2017-03-31 Brady Eidson Remove erroneously committed changes from r214078 Unreviewed. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): Whoops! 2017-03-31 Carlos Garcia Campos Modern media controls should never be enabled in non cocoa ports https://bugs.webkit.org/show_bug.cgi?id=170338 Reviewed by Michael Catanzaro. It's currently enabled, because it uses the default value for all other runtime features, but modern media controls are not a cross-platform feature. I think this is why media/video-click-dblckick-standalone.html started to fail in GTK+ port after r214426. I can't reprouduce the failure locally, so I can't confirm it, though. * Shared/WebPreferencesDefinitions.h: 2017-03-30 Zan Dobersek Unreviewed GTK+ build fix. List WebCore before JavaScriptCore as the two WebKit2 dependency libraries to avoid WTF directiories being listed for inclusion before WebCore directories at compile-time. * CMakeLists.txt: 2017-03-30 Megan Gardner Allow for extended color in snapshots https://bugs.webkit.org/show_bug.cgi?id=170314 WKImageCreateCGImage should support WideGamut in WebKit2 on macOS Reviewed by Simon Fraser. Piping options through snapshots to allow for wide gamut support. * Shared/API/c/WKImage.h: * Shared/API/c/WKSharedAPICast.h: (WebKit::snapshotOptionsFromImageOptions): * Shared/ImageOptions.h: (WebKit::snapshotOptionsToImageOptions): * Shared/WebImage.cpp: (WebKit::WebImage::create): 2017-03-30 Sam Weinig Expose the WKView SPI, _prepareForMoveToWindow:withCompletionHandler as WKWebView SPI https://bugs.webkit.org/show_bug.cgi?id=170315 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _prepareForMoveToWindow:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Copy SPI to WKWebView. Remove 'with' prefix to match conventions. 2017-03-30 Wenson Hsieh [WK2] Touches should not cancel when showing a custom action sheet while data interaction is active https://bugs.webkit.org/show_bug.cgi?id=170291 Reviewed by Tim Horton. Currently, when presenting a custom popover, we will cancel all touches in the application. This makes data interaction when a custom popover is shown impossible -- to address this, we should only cancel touches when the view is not an active data interaction source. New API test: DataInteractionTests.CustomActionSheetPopover. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]): 2017-03-30 Youenn Fablet NetworkConnectionToWebProcess should stop web sockets when being destroyed https://bugs.webkit.org/show_bug.cgi?id=170286 Reviewed by Brady Eidson. * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already. * NetworkProcess/NetworkSocketStream.h: 2017-03-29 Tim Horton Remove unused PageClient::removeNavigationGestureSnapshot https://bugs.webkit.org/show_bug.cgi?id=170249 Reviewed by Beth Dakin. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted. 2017-03-29 Antti Koivisto Increment the last stable network cache version on Mac https://bugs.webkit.org/show_bug.cgi?id=170248 Reviewed by Chris Dumez. Bump to the latest release. * NetworkProcess/cache/NetworkCacheStorage.h: 2017-03-28 Timothy Horton Stop overriding scroll view inset defaults https://bugs.webkit.org/show_bug.cgi?id=170221 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): The default behavior is sufficient for us. 2017-03-28 Timothy Horton Safari crashes when attempting to close tab that is displaying PDF https://bugs.webkit.org/show_bug.cgi?id=170201 Reviewed by Wenson Hsieh. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _doAfterNextStablePresentationUpdate:]): Adopt BlockPtr to fix a leak. (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): dispatch_async in the doAfterNextPresentationUpdate callback; since this recursively calls itself, in cases where doAfterNextPresentationUpdate returns synchronously (e.g. if the Web Process is missing), we would recurse infinitely. 2017-03-27 Youenn Fablet Remove WebPage::m_shouldDoICECandidateFiltering https://bugs.webkit.org/show_bug.cgi?id=170150 Reviewed by Sam Weinig. It is redundant with RTCController::m_shouldFilterICECandidates. Manually tested on webrtc test samples. This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt. Additional testing will be added as a follow-up patch. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::disableICECandidateFiltering): (WebKit::WebPage::enableICECandidateFiltering): * WebProcess/WebPage/WebPage.h: 2017-03-27 Wenson Hsieh [WK2] UIKit assertion when rotating device after dismissing popover https://bugs.webkit.org/show_bug.cgi?id=170159 Reviewed by Tim Horton. Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center. * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet dealloc]): (-[WKActionSheet _cleanup]): (-[WKActionSheet doneWithSheet:]): 2017-03-27 Andy Estes [iOS] Suppress page count recalc when setting a snapshot paper rect https://bugs.webkit.org/show_bug.cgi?id=170156 Reviewed by Tim Horton. When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper rect, which triggers UIKit to ask for the page count again while we're in the middle of printing, putting us in a bad state. Suppress page count recalc while setting the new paper rect, since we know this will not cause it to change. * UIProcess/_WKWebViewPrintFormatter.mm: (-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set _suppressPageCountRecalc to YES before updating the paper rect. (-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if _suppressPageCountRecalc is NO. * UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc. 2017-03-26 Wenson Hsieh [WK2] Callout Bar should be dismissed during data interaction https://bugs.webkit.org/show_bug.cgi?id=170109 Reviewed by Tim Horton. Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2. * Platform/spi/ios/UIKitSPI.h: 2017-03-27 Keith Rollin Update NetworkResourceLoader logging statement https://bugs.webkit.org/show_bug.cgi?id=170126 Reviewed by Alex Christensen. NetworkResourceLoader contains a logging statement that prints, in part: "start: Retrieving resource from cache". This is misleading, since it's not necessarily the case that the resource will be loaded from the cache. What is actually happening at the point where that is logged is that the cache is being checked for the resource. It still remains to be seen if the resource will be found in it. To address this, change the logging to say "start: Checking cache for resource". * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): 2017-03-27 Joseph Pecoraro Web Inspector: Saving files should not suggest the top level directory https://bugs.webkit.org/show_bug.cgi?id=170085 Reviewed by Matt Baker. * UIProcess/mac/RemoteWebInspectorProxyMac.mm: (WebKit::RemoteWebInspectorProxy::platformSave): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformSave): Don't set panel.directoryURL unless we have a good suggestion. 2017-03-27 Yongjun Zhang Add delegate method to let an WebKit client provide a custom image preview controller. https://bugs.webkit.org/show_bug.cgi?id=170076 rdar://problem/31153051 Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image has alternated URL or custom image info. Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided preview view controller. Otherwise, use the default WKImagePreviewViewController. 2017-03-27 Anders Carlsson Fix uses of deprecated API https://bugs.webkit.org/show_bug.cgi?id=170138 rdar://problem/28882449 Reviewed by Tim Horton. * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKContactFields): (WebKit::toPKAddressField): (WebKit::toPKPaymentRequest): Don't use deprecated APIs. (WebKit::toNSError): Don't try to insert nil in a dictionary. 2017-03-27 Alex Christensen Make WebSockets work in network process https://bugs.webkit.org/show_bug.cgi?id=169930 Reviewed by Youenn Fablet. This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous messages to a NetworkSocketStream in the NetworkProcess. WebKit1 uses a SocketStreamHandleImpl still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back to the WebProcess. WebSocketStream's implementation of SocketStreamHandle::platformSend is special because it stores the completion handler in a map and asynchronously reports to the caller whether it succeeded or not. If the network processes crashes before the completion handlers are called, then they are called indicating failure and an error is reported, but that never happens, right? * CMakeLists.txt: * DerivedSources.make: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::createSocketStream): (WebKit::NetworkConnectionToWebProcess::destroySocketStream): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSocketStream.cpp: Added. (WebKit::NetworkSocketStream::create): (WebKit::NetworkSocketStream::NetworkSocketStream): (WebKit::NetworkSocketStream::sendData): (WebKit::NetworkSocketStream::close): (WebKit::NetworkSocketStream::didOpenSocketStream): (WebKit::NetworkSocketStream::didCloseSocketStream): (WebKit::NetworkSocketStream::didReceiveSocketStreamData): (WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData): (WebKit::NetworkSocketStream::didUpdateBufferedAmount): (WebKit::NetworkSocketStream::didFailSocketStream): (WebKit::NetworkSocketStream::messageSenderConnection): (WebKit::NetworkSocketStream::messageSenderDestinationID): * NetworkProcess/NetworkSocketStream.h: Added. * NetworkProcess/NetworkSocketStream.messages.in: Added. * UIProcess/API/C/WKContext.cpp: (WKContextSetAllowsAnySSLCertificateForWebSocketTesting): (WKContextTerminateNetworkProcess): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::sendSyncToNetworkingProcess): (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket): (WebKit::WebProcessPool::terminateNetworkProcess): * UIProcess/WebProcessPool.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/Network/WebSocketProvider.cpp: (WebKit::WebSocketProvider::createSocketStreamHandle): * WebProcess/Network/WebSocketStream.cpp: Added. (WebKit::globalWebSocketStreamMap): (WebKit::WebSocketStream::streamWithIdentifier): (WebKit::WebSocketStream::networkProcessCrashed): (WebKit::WebSocketStream::create): (WebKit::WebSocketStream::WebSocketStream): (WebKit::WebSocketStream::~WebSocketStream): (WebKit::WebSocketStream::messageSenderConnection): (WebKit::WebSocketStream::messageSenderDestinationID): (WebKit::WebSocketStream::platformSend): (WebKit::WebSocketStream::didSendData): (WebKit::WebSocketStream::platformClose): (WebKit::WebSocketStream::bufferedAmount): (WebKit::WebSocketStream::didOpenSocketStream): (WebKit::WebSocketStream::didCloseSocketStream): (WebKit::WebSocketStream::didReceiveSocketStreamData): (WebKit::WebSocketStream::didFailToReceiveSocketStreamData): (WebKit::WebSocketStream::didUpdateBufferedAmount): (WebKit::WebSocketStream::didFailSocketStream): * WebProcess/Network/WebSocketStream.h: Added. * WebProcess/Network/WebSocketStream.messages.in: Added. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): 2017-03-27 Adrian Perez de Castro [GTK] NetscapePluginX11::m_windowID is unused/unneeded https://bugs.webkit.org/show_bug.cgi?id=170115 Reviewed by Michael Catanzaro. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::NetscapePluginX11::NetscapePluginX11): Remove the unneeded NetscapePluginX11::m_windowID member. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h: Remove the unneeded NetscapePluginX11::m_windowID member. 2017-03-25 Andy Estes [iOS] Use snapshotting instead of printing to draw single-page PDFs https://bugs.webkit.org/show_bug.cgi?id=170103 Reviewed by Tim Horton. * WebProcess/WebPage/WebPage.cpp: (WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here. (WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the WebImage's graphics context. (WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to paintSnapshotAtSize(), and returned the context's data. * WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize(). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page, returned a page count of 1 and created a PDF using pdfSnapshotAtSize(). 2017-03-25 John Wilander Re-enable the web process' keychain access to fix client certificate authentication https://bugs.webkit.org/show_bug.cgi?id=170074 Reviewed by Brent Fulgham. This is a follow-up patch to https://trac.webkit.org/changeset/214389/webkit since according to Alexey Proskuryakov, resource loading has always required identical sandbox rules in WebContent and Networking processes. * WebProcess/com.apple.WebProcess.sb.in: Reverted remaining change from https://trac.webkit.org/changeset/208702/webkit and https://trac.webkit.org/changeset/208707/webkit. 2017-03-24 Wenson Hsieh [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop https://bugs.webkit.org/show_bug.cgi?id=169168 Reviewed by Tim Horton. Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the DragData sent over to the web process, where they update DragController's view of the allowed destination actions. Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad, though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate any compatibility risk. * Shared/API/Cocoa/WKDragDestinationAction.h: Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Serialize DragData's destination actions when sending DragData over IPC. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate). * UIProcess/API/mac/WKView.mm: (-[WKView _web_dragDestinationActionForDraggingInfo:]): For WKView, allow all types of drag destination actions. * UIProcess/Cocoa/VersionChecks.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::draggingEntered): (WebKit::WebViewImpl::draggingUpdated): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::actionMaskForDrag): * WebProcess/WebCoreSupport/WebDragClient.h: 2017-03-24 Simon Fraser [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates https://bugs.webkit.org/show_bug.cgi?id=170091 rdar://problem/30682584 Reviewed by Tim Horton. [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this. So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known- good time. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 2017-03-24 John Wilander Re-enable the network process' keychain access to fix client certificate authentication https://bugs.webkit.org/show_bug.cgi?id=170074 Reviewed by Brent Fulgham. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Reverted remaining change from https://trac.webkit.org/changeset/208702/webkit and https://trac.webkit.org/changeset/208707/webkit. 2017-03-24 Eric Carlson [MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score https://bugs.webkit.org/show_bug.cgi?id=170056 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): When short-circuiting the user prompt because the page is already authorized, return the first audio and/or video device because so the page gets the one with the best fitness distance. 2017-03-24 Simon Fraser Make UI-side compositing on macOS a bit more usable https://bugs.webkit.org/show_bug.cgi?id=170073 Reviewed by Tim Horton. Mach port as layer contents doesn't work on macOS, so don't use it there. Also remove two assertions that hit with UI-side compositing in MiniBrowser. * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::createFence): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::requestScroll): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): 2017-03-24 Alex Christensen Fix assertions after r214358. https://bugs.webkit.org/show_bug.cgi?id=169167 * UIProcess/API/APIContentExtensionStore.cpp: (API::ContentExtensionStore::compileContentExtension): AtomicString::init must be called for the first time from the main thread. We were calling it for the first time from a non-main thread sometimes. Call it from the main thread before initiating compiling on another thread. == Rolled over to ChangeLog-2017-03-23 ==