2018-01-09 Jason Marcell Cherry-pick r226669. rdar://problem/36393011 2018-01-09 John Wilander Storage Access API: Turn feature on by default in WebPreferences.yaml https://bugs.webkit.org/show_bug.cgi?id=181458 Reviewed by Brent Fulgham. * Shared/WebPreferences.yaml: 2018-01-09 Jason Marcell Cherry-pick r226626. rdar://problem/36392359 2018-01-09 Youenn Fablet SWClientConnection should not keep references to service worker jobs https://bugs.webkit.org/show_bug.cgi?id=181381 Reviewed by Chris Dumez. Updated IPC handling based on WebCore refactoring. * Scripts/webkit/messages.py: (forward_declarations_and_headers): (headers_for_type): * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::rejectJobInClient): (WebKit::WebSWServerConnection::resolveRegistrationJobInClient): (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient): (WebKit::WebSWServerConnection::startScriptFetchInClient): * StorageProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2018-01-09 Jason Marcell Cherry-pick r226542. rdar://problem/36392364 2018-01-08 John Wilander Storage Access API: Remove access for all frames under a page when the page is closed https://bugs.webkit.org/show_bug.cgi?id=181398 Reviewed by Alex Christensen. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): 2018-01-09 Jason Marcell Cherry-pick r226528. rdar://problem/36392391 2018-01-08 Youenn Fablet Caches::writeCachesToDisk should assert that it is initialized https://bugs.webkit.org/show_bug.cgi?id=181383 Reviewed by Alex Christensen. Add assertion to ensure caches is initialized * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::writeCachesToDisk): 2018-01-09 Jason Marcell Cherry-pick r226519. rdar://problem/36392376 2018-01-08 Youenn Fablet WebProcessPool::terminateServiceWorkerProcess should protect itself in debug builds https://bugs.webkit.org/show_bug.cgi?id=181384 Reviewed by Chris Dumez. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::terminateServiceWorkerProcess): 2018-01-08 Frederic Wang Unreviewed build fix after r226211. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Use WK_IOS_TBA for iOS. 2018-01-08 Youenn Fablet navigator.onLine does not work inside service workers https://bugs.webkit.org/show_bug.cgi?id=181079 Reviewed by Darin Adler. Added support for a callback called for each service worker proxy creation. Callback is used by WTR to inject a self.internals object used for testing. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetServiceWorkerProxyCreationCallback): * WebProcess/InjectedBundle/API/c/WKBundle.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setServiceWorkerProxyCreationCallback): * WebProcess/InjectedBundle/InjectedBundle.h: 2018-01-07 David Kilzer Enable -Wcast-qual for WebInspectorUI, WebKitLegacy, WebKit projects Reviewed by Darin Adler. * Configurations/Base.xcconfig: (WARNING_CFLAGS): Add -Wcast-qual. * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: (WTF::Persistence::encodeCertificateChain): Include TypeCastsCF.h from WTF, and use checked_cf_cast() to fix warning. * Platform/cocoa/WKCrashReporter.mm: (WebKit::setCrashReportApplicationSpecificInformation): - Move `oldMessage` check above nullptr check to fix a leak when passing in nullptr after previously setting the crash string. - Change C-style cast to const_cast() to fix warning. * PluginProcess/mac/PluginProcessShim.mm: (WebKit::shim_shmat): Change C-style cast to const_cast() to fix warning. * Shared/Authentication/mac/AuthenticationManager.mac.mm: (WebKit::leafCertificate): Include TypeCastsCF.h from WTF, and use checked_cf_cast() to fix warning. * Shared/cf/ArgumentCodersCF.cpp: (IPC::encode): Use static_cast<>(const_cast() to fix warnings since the CFTypeID has already been checked. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::decodeNSError): Use an `auto` variable to hold the CFMutableDictionaryRef, then WTFMove() to assign it back to `userInfo`. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::takeWindowSnapshot): Include TypeCastsCF.h from WTF, and use checked_cf_cast() to fix warning. 2018-01-07 Konstantin Tokarev [cmake] Unset CMAKE_REQUIRED_LIBRARIES after check_function_exists test https://bugs.webkit.org/show_bug.cgi?id=181371 Reviewed by Michael Catanzaro. This variable is used by check_function_exists internally, its value should be never used for anything else. * CMakeLists.txt: 2018-01-05 Dan Bernstein REGRESSION (r226218): iOS-only assets are installed on macOS https://bugs.webkit.org/show_bug.cgi?id=181362 Reviewed by Anders Carlsson. * Configurations/WebKit.xcconfig: Exclude everything under Resources/ios when not targeting iOS. * Resources/ios: Added. * Resources/ios/iOS.xcassets: Moved from Source/WebKit/WebKit.xcassets. * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Set the svn:mime-type property. * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Ditto. * Resources/mac: Added. * Resources/mac/mediaIcon.pdf: Moved here… * Resources/mediaIcon.pdf: …from here. * WebKit.xcassets: Moved under Resources/ios. * WebKit.xcodeproj/project.pbxproj: Created an ios group under the Resources group, and cleaned up the mac group. Removed the Recovered References group. 2018-01-05 John Wilander Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page https://bugs.webkit.org/show_bug.cgi?id=181357 Reviewed by Alex Christensen. This change does the following: - Changes function and message names to reflect how this feature was eventually implemented, i.e. access per frame. - Makes it explicit that the UI process is only involved in granting storage access and not removing storage access. The latter is done directly by the web process. - Simplifies the network process' entry map since only needs to be able to give access to one domain in one frame at a time. Access goes away on frame navigation so there can only be one domain at a time per frame. Also, the map now uses pageIDs as main keys to prepare for efficient access removal for all frames under a page. - Fixes a bug in so that a cross-origin iframe with the same partition as the top frame correctly is handled as already having access. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame): (WebKit::NetworkConnectionToWebProcess::removeStorageAccess): Deleted. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::hasStorageAccessForFrame): (WebKit::NetworkProcess::grantStorageAccessForFrame): (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): Deleted. (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::hasStorageAccessForFrame): (WebKit::NetworkProcessProxy::grantStorageAccessForFrame): (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): Deleted. (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler): (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler): (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): Deleted. (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::detachedFromParent2): (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument): 2018-01-05 Youenn Fablet Implement Cache API partitioning based on ClientOrigin https://bugs.webkit.org/show_bug.cgi?id=181240 Reviewed by Alex Christensen. open and retrieveCaches now take a ClientOrigin instead of a String. Updated cache filesystem path computation to take both client origin and top origin. When clearing an origin, caches whose client origin or top origin matches the origin are cleared. Caches are added to the web site data of their client origin with their corresponding cache size. Caches are added to the web site data of their top origin with a size equal to 0. Updated memory representation dumping used for test to include both top and client origins. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::cachesRootPath): (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::removeCaches): (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::Engine::clearCachesForOrigin): (WebKit::CacheStorage::Engine::clearMemoryRepresentation): (WebKit::CacheStorage::Engine::representation): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::Cache): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::storeOrigin): (WebKit::CacheStorage::Caches::readOrigin): (WebKit::CacheStorage::Caches::open): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::origin const): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doOpen): (WebKit::WebCacheStorageConnection::doRetrieveCaches): (WebKit::WebCacheStorageConnection::clearMemoryRepresentation): * WebProcess/Cache/WebCacheStorageConnection.h: 2018-01-05 Megan Gardner Show Keyboard when re-launching WKWebView with a previously focused element https://bugs.webkit.org/show_bug.cgi?id=181353 Reviewed by Tim Horton. When relaunching an app with a WKWebView, restore the keyboard if there was a previously focused element that was being assisted. The element was already being tracked, we just needed to not bail on showing the keyboard for instances where it was a state change that caused the element to be refocused. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAutoscrollAtPosition): (WebKit::WebPageProxy::startAssistingNode): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setActivityState): (WebKit::WebPage::elementDidFocus): * WebProcess/WebPage/WebPage.h: 2018-01-05 Alex Christensen Restrict navigation-time WKWebsiteDataStore swapping to main frame navigations https://bugs.webkit.org/show_bug.cgi?id=181217 Reviewed by Tim Horton. If we swap during an iframe navigation, then we get a page in a strange state. The intent of the main frame navigation WKWebsiteDataStore swap is that that is a time when we can change storages without a page in an inconsistent state. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 2018-01-05 Alex Christensen Add WKBundleFrameCreateFrameHandle https://bugs.webkit.org/show_bug.cgi?id=181232 Reviewed by Tim Horton. InjectedBundle clients wanting to sent a _WKFrameHandle cannot without this function. Before, they would just send the WKBundleFrameRef which would be changed into a WKFrameRef in the UIProcess by WebProcessProxy::transformHandlesToObjects, but there is no ObjC equivalent of WKFrameRef, so we were just getting a WKObject when we wanted a _WKFrameHandle. We can't change WebProcessProxy::transformHandlesToObjects without being incompatible with the existing C API, so let's add a way for clients to say "I want a _WKFrameHandle". * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundleFrameCreateFrameHandle): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 2018-01-05 Wenson Hsieh [Attachment Support] Add a way to write blob data to a file URL from the UI process https://bugs.webkit.org/show_bug.cgi?id=181236 Reviewed by Brady Eidson. Add support for writing a blob to a designated file path. In WebKit, this is mainly plumbing writeBlobToFilePath through WebPageProxy to the network process. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::writeBlobToFilePath): Call out to the BlobRegistryImpl to write blobs to the file path. Additionally grant sandbox extensions for any file-backed blob parts corresponding to the given blob URL. (WebKit::NetworkBlobRegistry::filesInBlob): Introduce a version of filesInBlob that doesn't check against the NetworkConnectionToWebProcess. This is used when the UI process is the driver for writing a blob. * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::writeBlobToFilePath): Temporarily grant sandbox access to the given file path. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. Remove PromisedBlobData (see WebCore/ChangeLog for more information). * Shared/WebCoreArgumentCoders.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didClose): If the network process is terminated, flush any pending callbacks in m_writeBlobToFilePathCallbackMap, passing in a failure result (success := false) and clearing the callback map. (WebKit::NetworkProcessProxy::writeBlobToFilePath): (WebKit::NetworkProcessProxy::didWriteBlobToFilePath): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::writeBlobToFilePath): * UIProcess/WebPageProxy.h: 2018-01-05 Dan Bernstein Add injected bundle equivalents of DOMHTMLDocument (DOMHTMLDocumentExtensions) https://bugs.webkit.org/show_bug.cgi?id=181345 Reviewed by Tim Horton. * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Declared new methods. * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: (-[WKDOMDocument createDocumentFragmentWithMarkupString:baseURL:]): Added. Calls WebCore’s createFragmentFromMarkup. (-[WKDOMDocument createDocumentFragmentWithText:]): Added. Calls WebCore’s createFragmentFromText. 2018-01-05 Don Olmstead [Curl] Add implementation stubs for Network Cache https://bugs.webkit.org/show_bug.cgi?id=181343 Reviewed by Alex Christensen. * NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Added. (WTF::Persistence::Coder::encode): (WTF::Persistence::Coder::decode): * NetworkProcess/cache/NetworkCacheDataCurl.cpp: Added. (WebKit::NetworkCache::Data::Data): (WebKit::NetworkCache::Data::empty): (WebKit::NetworkCache::Data::data const): (WebKit::NetworkCache::Data::isNull const): (WebKit::NetworkCache::Data::apply const): (WebKit::NetworkCache::Data::subrange const): (WebKit::NetworkCache::concatenate): (WebKit::NetworkCache::Data::adoptMap): * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: Added. (WebKit::NetworkCache::IOChannel::IOChannel): (WebKit::NetworkCache::IOChannel::~IOChannel): (WebKit::NetworkCache::IOChannel::open): (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::write): * PlatformWin.cmake: 2018-01-05 Don Olmstead [Curl] Update method declarations in WebKit https://bugs.webkit.org/show_bug.cgi?id=181342 Reviewed by Alex Christensen. * NetworkProcess/Downloads/curl/DownloadCurl.cpp: (WebKit::Download::resume): * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp: (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted. (WebKit::RemoteNetworkingContext::blockedError const): Deleted. 2018-01-05 Don Olmstead WebFullScreenManager should compile when ENABLE(VIDEO) is off https://bugs.webkit.org/show_bug.cgi?id=181338 Reviewed by Alex Christensen. * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::didEnterFullScreen): (WebKit::WebFullScreenManager::willExitFullScreen): * WebProcess/FullScreen/WebFullScreenManager.h: 2018-01-05 Andy Estes [Apple Pay] Disable Apple Pay on platforms that don't have PassKit.framework https://bugs.webkit.org/show_bug.cgi?id=181335 Reviewed by Brady Eidson. When Safari is running in the macOS Base System, PassKit.framework is not available. If we fail to dlopen PassKit, we should disable Apple Pay. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetApplePayEnabled): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks): (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): 2018-01-05 Dan Bernstein Fixed the build following AppKit API deprecations in a recent SDKs * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): Suppressed deprecation warnings. (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto. (-[WKFullScreenWindowController exitFullScreen]): Ditto. (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto. (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Ditto. (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Ditto. (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto. * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _setAutodisplay:]): Ditto. 2018-01-05 Matt Lewis Unreviewed, rolling out r226401. This caused timeouts on multiple platforms. Reverted changeset: "Implement Cache API partitioning based on ClientOrigin" https://bugs.webkit.org/show_bug.cgi?id=181240 https://trac.webkit.org/changeset/226401 2018-01-05 Joseph Pecoraro ServiceWorkers: Enable UserTiming / ResourceTiming https://bugs.webkit.org/show_bug.cgi?id=181297 Reviewed by Youenn Fablet. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferencesStore): Enable Resource Timing / User Timing for the ServiceWorker process. 2018-01-04 Zan Dobersek Unreviewed GTK+ build fix. * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp: (webkit_user_media_permission_is_for_audio_device): Call UserMediaPermissionRequestProxy::requiresAudioCapture(). (webkit_user_media_permission_is_for_video_device): Call UserMediaPermissionRequestProxy::requiresVideoCapture(). 2018-01-04 Don Olmstead [Curl] Fix compilation error in WebFrameNetworkingContext https://bugs.webkit.org/show_bug.cgi?id=181312 Reviewed by Alex Christensen. * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): 2018-01-04 Tim Horton WKWebView loses minimum layout size overrides that happen while the process is terminated https://bugs.webkit.org/show_bug.cgi?id=181306 Reviewed by Dan Bernstein. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didRelaunchProcess]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didRelaunchProcess): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): (WebKit::WebPageProxy::setForceAlwaysUserScalable): (WebKit::WebPageProxy::setMaximumUnobscuredSize): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Pass the current viewport minimum layout size and maximum unobscured size in the WebPageCreationParameters instead of re-sending them in _didRelaunchProcess. The previous approach was problematic when _dispatchSetMinimumLayoutSize: was changed to not re-send identical updates, because if the client calls _overrideLayoutParametersWithMinimumLayoutSize before the Web Content process is re-launched (after terminating), we would cache the size, attempt to send it, fail silently (because the process is not launched), and then in _didRelaunchProcess we would choose not to re-send (after the process is successfully relaunched) because we think we already sent the new value. Add isValid() checks to our message sends. Ideally send() would assert if the process is not alive to avoid problems like this, but it doesn't (yet). Get rid of WKWebView's _didRelaunchProcess, because it does nothing now. 2018-01-04 Stephan Szabo NetworkProcess cache files use functions from unistd.h without explicitly including it https://bugs.webkit.org/show_bug.cgi?id=181261 Reviewed by Alex Christensen. * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: * NetworkProcess/cache/NetworkCacheData.cpp: 2018-01-04 Keith Rollin Add commas https://bugs.webkit.org/show_bug.cgi?id=181295 Reviewed by Brent Fulgham. Fix a problem introduced in r226226 where the emitted JSON didn't include some required commas. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::logCookieInformation const): 2018-01-04 Eric Carlson [MediaStream] Add Mock screen capture source https://bugs.webkit.org/show_bug.cgi?id=181291 Reviewed by Dean Jackson. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted, moved to CaptureDevice.h (IPC::ArgumentCoder::decode): Ditto. * Shared/WebCoreArgumentCoders.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _WKCaptureDeviceDisplay. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::requestUserMediaAuthorizationForDevices): Deal with display capture. (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): requiresAudio -> requiresAudioCapture. (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Never reuse a previously granted display capture request. * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::allow): Search the eligible devices instead of asking the source center to find devices. * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::requiresAudioCapture const): Renamed. (WebKit::UserMediaPermissionRequestProxy::requiresVideoCapture const): Ditto. (WebKit::UserMediaPermissionRequestProxy::requiresDisplayCapture const): New. (WebKit::UserMediaPermissionRequestProxy::requiresAudio const): Deleted. (WebKit::UserMediaPermissionRequestProxy::requiresVideo const): Deleted. 2018-01-04 Youenn Fablet FetchResponse should set its internal response text encoding name https://bugs.webkit.org/show_bug.cgi?id=181284 Reviewed by Alex Christensen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Set default encoding to UTF-8. 2018-01-04 Youenn Fablet Implement Cache API partitioning based on ClientOrigin https://bugs.webkit.org/show_bug.cgi?id=181240 Reviewed by Alex Christensen. open and retrieveCaches now take a ClientOrigin instead of a String. Updated cache filesystem path computation to take both client origin and top origin. When clearing an origin, caches whose client origin or top origin matches the origin are cleared. Caches are added to the web site data of their client origin with their corresponding cache size. Caches are added to the web site data of their top origin with a size equal to 0. Updated memory representation dumping used for test to include both top and client origins. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::cachesRootPath): (WebKit::CacheStorage::Engine::open): (WebKit::CacheStorage::Engine::remove): (WebKit::CacheStorage::Engine::retrieveCaches): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::removeCaches): (WebKit::CacheStorage::Engine::fetchEntries): (WebKit::CacheStorage::Engine::clearCachesForOrigin): (WebKit::CacheStorage::Engine::clearMemoryRepresentation): (WebKit::CacheStorage::Engine::representation): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::Cache): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::storeOrigin): (WebKit::CacheStorage::Caches::readOrigin): (WebKit::CacheStorage::Caches::open): * NetworkProcess/cache/CacheStorageEngineCaches.h: (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::origin const): * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::open): (WebKit::CacheStorageEngineConnection::caches): (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doOpen): (WebKit::WebCacheStorageConnection::doRetrieveCaches): (WebKit::WebCacheStorageConnection::clearMemoryRepresentation): * WebProcess/Cache/WebCacheStorageConnection.h: 2018-01-04 Youenn Fablet Service Worker should expose redirect mode for navigation loads as manual https://bugs.webkit.org/show_bug.cgi?id=181067 Reviewed by Alex Christensen. * WebProcess/Storage/ServiceWorkerClientFetch.cpp: (WebKit::ServiceWorkerClientFetch::didReceiveResponse): 2018-01-03 Wenson Hsieh [Attachment Support] Create attachment elements when dropping files on iOS https://bugs.webkit.org/show_bug.cgi?id=181192 Reviewed by Tim Horton. Make some minor adjustments for changes to the pasteboard in WebCore. See WebCore/ChangeLog for more detail. Teaches WebPasteboardProxy et. al. to plumb PasteboardItemInfo from the UI process to the web process via the new `InformationForItemAtIndex` codepath. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::informationForItemAtIndex): (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction): Deleted. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::informationForItemAtIndex): (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2018-01-03 Ting-Wei Lan Replace hard-coded paths in shebangs with #!/usr/bin/env https://bugs.webkit.org/show_bug.cgi?id=181040 Reviewed by Alex Christensen. * Scripts/generate-forwarding-headers.pl: 2018-01-03 Wenson Hsieh [Attachment Support] Add plumbing for starting a drag with promised blob data https://bugs.webkit.org/show_bug.cgi?id=181201 Reviewed by Tim Horton. Add boilerplate plumbing for PrepareToDragPromisedBlob, which delivers blob promises to the UI process when dragging, respectively. * Scripts/webkit/messages.py: (headers_for_type): * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeTypesAndData): (IPC::decodeTypesAndData): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Add IPC support PromisedBlobInfo's additionalTypes and additionalData. (IPC::encodeClientTypesAndData): Deleted. (IPC::decodeClientTypesAndData): Deleted. Rename these helper functions and move them to the top of the file. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::prepareToDragPromisedBlob): * UIProcess/PageClient.h: (WebKit::PageClient::prepareToDragPromisedBlob): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::prepareToDragPromisedBlob): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::prepareToDragPromisedBlob): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _prepareToDragPromisedBlob:]): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::prepareToDragPromisedBlob): * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::prepareToDragPromisedBlob): * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::prepareToDragPromisedBlob): * WebProcess/WebPage/WebPage.h: 2018-01-03 David Kilzer REGRESSION (r212929): WKSnapshotConfiguration may leak an NSNumber when deallocated Reviewed by Joseph Pecoraro. * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm: (-[WKSnapshotConfiguration dealloc]): Implement method and release _snapshotWidth. 2018-01-03 John Wilander Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process https://bugs.webkit.org/show_bug.cgi?id=181270 Reviewed by Alex Christensen. This change refactors how the web process tells the network process to remove storage access. Previously, this was done over the UI process just like requests for storage access. But since no further reasoning is needed, the message should go straight from the web process to the network process for performance reasons and to minimize the risk of a race. As a consequence, the XPC code for storage access removal in the UI process is deleted. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::removeStorageAccess): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::removeStorageAccess): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::removeStorageAccess): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestStorageAccess): (WebKit::WebPageProxy::removeStorageAccess): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::requestStorageAccess): (WebKit::WebsiteDataStore::removeStorageAccess): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::detachedFromParent2): (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument): 2018-01-03 David Kilzer com.apple.WebKit.Networking crash in com.apple.Foundation: -[__NSOperationInternal _start:] Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (downgradeRequest): Remove unnecessary -autorelease. 2018-01-03 Brent Fulgham [macOS] Constant frame dropping during Flash video playback https://bugs.webkit.org/show_bug.cgi?id=181249 Reviewed by Eric Carlson. Review of logs during jerky flash video playback shows a few IOKit properties are being blocked by the sandbox, which prevents some high-efficiency codecs from being used. Add 'AppleGVAKeyDoesNotExist', 'IODVDBundleName', and 'IOGVA*Encode' to the whitelist. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2018-01-03 Michael Catanzaro [GTK] Add web process API to detect when form is submitted via JavaScript https://bugs.webkit.org/show_bug.cgi?id=173915 Reviewed by Carlos Garcia Campos. Epiphany relies on the DOM submit event to detect when a form has been submitted. However, for historical reasons, the submit event is not emitted when a form is submitted by JavaScript. It is therefore not currently possible for a web browser to reliably detect form submission and not possible to implement a robust password storage feature. In order to avoid this problem, this patch adds a new WebKitWebPage signal, will-submit-form, that browsers can use in preference to a DOM event listener. Unfortunately, this signal is not available for WPE because it depends on the DOM API. There are two submission events, WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT and WEBKIT_FORM_SUBMISSION_WILL_COMPLETE. WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT occurs earlier than WEBKIT_FORM_SUBMISSION_WILL_COMPLETE and can be used to retrieve form values before websites receive the DOM submit event. This is useful as some websites like to delete form values right before a submit would normally happen in order to attempt to defeat browser password managers. There are two tricks to note: JavaScript can cancel form submission immediately after this event occurs (by returning false in an onsubmit handler), and, for historical reasons, this event will not occur at all when form submission is triggered by JavaScript. WEBKIT_FORM_SUBMISSION_WILL_COMPLETE occurs next, and is more straightforward: it is always emitted when a form is about to be submitted, when it is too late to cancel. The recommended way to reliably retrieve password form values would be to watch for both events, use the form value detected in WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT if that event is emitted, and use the value detected later in WEBKIT_FORM_SUBMISSION_WILL_COMPLETE otherwise. Since one of the signal arguments is an enum, we now have to run glib-mkenums for the web process API. And that has resulted in this patch also adding GType goo for WebKitConsoleMessageLevel and WebKitConsoleMessageSource that was previously missing. Any applications that for some unlikely reason want to use these enums in properties or signals will be happy. * PlatformGTK.cmake: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkit_web_page_class_init): * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.cpp.template: Added. * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.h.template: Added. 2018-01-03 Carlos Garcia Campos Unreviewed. Really fix plugin process after r226327. * PluginProcess/unix/PluginProcessMainUnix.cpp: 2018-01-02 Brent Fulgham [macOS, iOS] Adopt new secure coding APIs in WebKit https://bugs.webkit.org/show_bug.cgi?id=181085 Reviewed by Tim Horton. Update WebKit code to use NSSecureCoding when the underlying operating system supports it. Use new wrapper functions so the same code can be built on all supported OS releases, while enabling seure coding when possible. Note that NSView-based classes cannot be migrated at present due to AppKit not supporting NSSecureCoding in its class hierarchy. Tested by exising TestWebKitAPI tests for Coding and data transfer. * Platform/ios/AccessibilityIOS.mm: (WebKit::newAccessibilityRemoteToken): Encode using NSSecureCoding. * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKPreferences.mm: (+[WKPreferences supportsSecureCoding]): Added to enable NSSecureCoding. * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (+[WKProcessPool supportsSecureCoding]): Ditto. * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKUserContentController.mm: (+[WKUserContentController supportsSecureCoding]): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithCoder:]): Use coding initialization that supports secure coding if it is available in the supplied class. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (+[WKWebViewConfiguration supportsSecureCoding]): Added to enable NSSecureCoding. (-[WKWebViewConfiguration initWithCoder:]): Use secure coding when possible. * UIProcess/API/Cocoa/WKWebsiteDataStore.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (+[WKWebsiteDataStore supportsSecureCoding]): Added to enable NSSecureCoding. * UIProcess/API/Cocoa/_WKApplicationManifest.h: * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (+[_WKApplicationManifest supportsSecureCoding]): Added to enable NSSecureCoding. (-[_WKApplicationManifest initWithCoder:]): Use secure coding when possible. 2017-12-28 Yusuke Suzuki Remove std::chrono completely https://bugs.webkit.org/show_bug.cgi?id=181186 Reviewed by Alex Christensen. Use MonotonicTime, WallTime, and Seconds instead. Changes are mechanical ones. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteData): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::clear): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseHasExpired): (WebKit::NetworkCache::responseNeedsRevalidation): (WebKit::NetworkCache::makeStoreDecision): (WebKit::NetworkCache::Cache::clear): (WebKit::NetworkCache::Cache::storeData): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::Entry): (WebKit::NetworkCache::Entry::asJSON const): * NetworkProcess/cache/NetworkCacheEntry.h: (WebKit::NetworkCache::Entry::timeStamp const): * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::fileTimes): (WebKit::NetworkCache::updateFileModificationTimeIfNeeded): * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::IOChannel): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::responseNeedsRevalidation): (WebKit::NetworkCache::canRevalidate): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::readRecord): (WebKit::NetworkCache::Storage::clear): (WebKit::NetworkCache::computeRecordWorth): * NetworkProcess/cache/NetworkCacheStorage.h: Bump the cache version. We now change the data in persistent cache. * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo): (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: (WebKit::NetworkCache::SubresourceInfo::lastSeen const): (WebKit::NetworkCache::SubresourceInfo::firstSeen const): (WebKit::NetworkCache::SubresourcesEntry::timeStamp const): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::clearHSTSCache): (WebKit::clearNSURLCache): (WebKit::NetworkProcess::clearDiskCache): * NetworkProcess/curl/NetworkProcessCurl.cpp: (WebKit::NetworkProcess::clearDiskCache): * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::clearCacheForAllOrigins): * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::clearCacheForAllOrigins): (WebKit::NetworkProcess::clearDiskCache): * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Platform/IPC/ArgumentCoders.h: * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::deleteWebsiteData): * PluginProcess/PluginProcess.h: * PluginProcess/PluginProcess.messages.in: * Scripts/webkit/messages.py: (headers_for_type): * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: (WebKit::RemoteLayerBackingStore::lastDisplayTime const): * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore): (WebKit::RemoteLayerBackingStore::display): * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile): (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::deleteWebsiteData): * StorageProcess/StorageProcess.h: * StorageProcess/StorageProcess.messages.in: * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerDeleteAllCookiesModifiedAfterDate): * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (WKResourceCacheManagerClearCacheForAllOrigins): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours): (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval): (WKWebsiteDataStoreRemoveAllFetchCaches): (WKWebsiteDataStoreRemoveAllIndexedDatabases): (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (toSystemClockTime): (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_clear_cache): * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkit_website_data_manager_clear): * UIProcess/DrawingAreaProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::deleteWebsiteData): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::deleteWebsiteData): * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::deleteWebsiteData): * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::deleteWebsiteData): * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::deleteWebsiteData): * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): * UIProcess/WebStorage/LocalStorageDatabaseTracker.h: * UIProcess/WebStorage/StorageManager.cpp: (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): * UIProcess/WebStorage/StorageManager.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformRemoveRecentSearches): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::removeMediaKeys): * UIProcess/WebsiteData/WebsiteDataStore.h: * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebsiteDataStore::platformRemoveRecentSearches): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebsiteDataStore::platformRemoveRecentSearches): * WebProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Cookies/WebCookieManager.messages.in: * WebProcess/Plugins/PluginView.cpp: (WebKit::lastModifiedDateMS): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::deleteWebsiteData): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2018-01-02 Wenson Hsieh [Attachment Support] Introduce data structures and IPC support for writing promised blobs https://bugs.webkit.org/show_bug.cgi?id=181189 Reviewed by Tim Horton. Add IPC support for PromisedBlobInfo and PromisedBlobData. See WebCore/ChangeLog for more detail. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: 2018-01-02 Michael Catanzaro REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports https://bugs.webkit.org/show_bug.cgi?id=181231 Reviewed by Alex Christensen. Add new C API for use by WebKitTestRunner. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder): (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2018-01-02 Jiewen Tan Add a WebAuthentication runtime feature flag https://bugs.webkit.org/show_bug.cgi?id=181220 Reviewed by Brent Fulgham. Renames the CredentialManagement runtime feature flag into WebAuthentication. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebAuthenticationEnabled): (WKPreferencesGetWebAuthenticationEnabled): (WKPreferencesSetCredentialManagementEnabled): Deleted. (WKPreferencesGetCredentialManagementEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2018-01-02 Michael Catanzaro REGRESSION(r226327): [GTK] Plugin process is broken https://bugs.webkit.org/show_bug.cgi?id=181187 Unreviewed, fix PluginProcessMainUnix after r226327. * PluginProcess/unix/PluginProcessMainUnix.cpp: 2018-01-02 Tim Horton Fix the build on platforms where UICurrentUserInterfaceIdiomIsPad is defined to false https://bugs.webkit.org/show_bug.cgi?id=181218 Reviewed by Alex Christensen. * Platform/spi/ios/UIKitSPI.h: (currentUserInterfaceIdiomIsPad): * UIProcess/ios/SmartMagnificationController.mm: (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]): (-[WKContentView _requiresKeyboardWhenFirstResponder]): (-[WKContentView _displayFormNodeInputView]): (-[WKContentView requiresAccessoryView]): (-[WKContentView _updateAccessory]): * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker show:fromRect:]): * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]): (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]): * UIProcess/ios/forms/WKFormInputControl.mm: (-[WKDateTimePicker initWithView:datePickerMode:]): (-[WKFormInputControl initWithView:]): * UIProcess/ios/forms/WKFormSelectControl.mm: (-[WKFormSelectControl initWithView:]): On platforms where UICurrentUserInterfaceIdiomIsPad is defined to false, blocks that conditionally execute based on its value are unreachable. This causes the compiler to complain. Hide it away inside an inline function and make use of that everywhere we used to use the macro. 2018-01-02 Alex Christensen Remove SVN file accidentally added in r226160 https://bugs.webkit.org/show_bug.cgi?id=180934 * UIProcess/WebPageProxy.cpp.orig: Removed. 2018-01-02 Alex Christensen Use BlockPtrs and lambdas instead of new/delete to pass parameters to blocks in WebViewImpl::performDragOperation https://bugs.webkit.org/show_bug.cgi?id=180795 Reviewed by Brent Fulgham. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::performDragOperation): 2018-01-02 Michael Catanzaro [WPE][GTK] Implement the assignment of ProcessIdentifiers to child processes https://bugs.webkit.org/show_bug.cgi?id=181187 Reviewed by Brady Eidson. * Shared/ChildProcess.cpp: Make the ProcessIdentifier mandatory. (WebKit::ChildProcess::initialize): * Shared/unix/ChildProcessMain.cpp: Initialize ChildProcessInitializationParameters with the ProcessIdentifier. (WebKit::ChildProcessMainBase::parseCommandLine): * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Copy the ProcessIdentifier from LaunchOptions into argv. (WebKit::ProcessLauncher::launchProcess): * WebProcess/wpe/WebProcessMainWPE.cpp: Expect the WPE socket ID later in the command line. 2018-01-02 Alex Christensen Use new WebsiteDataStore passed in through decidePolicyForNavigation SPI https://bugs.webkit.org/show_bug.cgi?id=180897 Reviewed by Brent Fulgham. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::changeWebsiteDataStore): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore): (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore): (WebKit::WebProcessPool::pageAddedToProcess): Deleted. (WebKit::WebProcessPool::pageRemovedFromProcess): Deleted. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addExistingWebPage): (WebKit::WebProcessProxy::removeWebPage): * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): 2018-01-02 Alex Christensen Only use CookieStorageShim when we aren't using NetworkSession https://bugs.webkit.org/show_bug.cgi?id=180766 Reviewed by Brent Fulgham. * Shared/mac/CookieStorageShim.h: * Shared/mac/CookieStorageShim.mm: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2018-01-02 Alex Christensen Clean up context menu code https://bugs.webkit.org/show_bug.cgi?id=181074 Reviewed by Brent Fulgham. Use Ref instead of RefPtr where possible. Use move semantics instead of copying from const references when possible. Remove dead iOS code. Reduce allocations. Add stub for WPE. * UIProcess/API/APIContextMenuClient.h: (API::ContextMenuClient::getContextMenuFromProposedMenu): (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): (API::ContextMenuClient::showContextMenu): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createContextMenuProxy): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/PageClient.h: * UIProcess/WebContextMenuListenerProxy.cpp: (WebKit::WebContextMenuListenerProxy::useContextMenuItems): * UIProcess/WebContextMenuProxy.cpp: (WebKit::WebContextMenuProxy::WebContextMenuProxy): * UIProcess/WebContextMenuProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showContextMenu): (WebKit::WebPageProxy::internalShowContextMenu): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/gtk/WebContextMenuProxyGtk.cpp: (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems): (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk): * UIProcess/gtk/WebContextMenuProxyGtk.h: (WebKit::WebContextMenuProxyGtk::create): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::createContextMenuProxy): Deleted. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::createContextMenuProxy): * UIProcess/mac/WebContextMenuProxyMac.h: (WebKit::WebContextMenuProxyMac::create): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac): (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): (WebKit::WebContextMenuProxyMac::showContextMenu): == Rolled over to ChangeLog-2018-01-01 ==