2018-09-13 Keith Rollin WebPageProxy::reportPageLoadResult can crash on some code paths https://bugs.webkit.org/show_bug.cgi?id=189568 Reviewed by Chris Dumez. WebPageProxy::reportPageLoadResult (which is called from WebPageProxy::didFinishLoadForFrame) can sometimes crash when accessing m_pageLoadStart (a std::optional) in its unloaded state. Normally, m_pageLoadStart is initialized in WebPageProxy::didStartProvisionalLoadForFrame, which one would expect would be called before WebPageProxy::didFinishLoadForFrame. But that turns out to not always be the case. It's not apparent under what conditions didStartProvisionalLoadForFrame will not be called, but it's happening in the wild, leading to crashes now that std::optional asserts in release builds on bad accesses (see https://bugs.webkit.org/show_bug.cgi?id=189568). Fix this by checking m_pageLoadState on entry to reportPageLoadResult. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): (WebKit::WebPageProxy::reportPageLoadResult): 2018-09-13 Chris Dumez ProcessSwap.BackWithoutSuspendedPage API test hits assertion under WebPageProxy::didCreateMainFrame() https://bugs.webkit.org/show_bug.cgi?id=189599 Reviewed by Geoffrey Garen. The code in WebPageProxy::reattachToWebProcess() was re-initializing m_mainFrame unconditionally in case of a HistoryNavigation. The reason we need to initialize m_mainFrame in reattachToWebProcess() is if the process we're reattaching to already has a WebPage (with a main frame), in which case WebPageProxy::didCreateMainFrame() would not get called to initialize WebPageProxy::m_mainFrame. The process we're reattaching to can be in such a state only if it comes from a SuspendedPageProxy (we detached the WebProcessProxy from the WebPageProxy but kept the WebPage in the "suspended" WebProcess). It is true that we're only reattaching to a SuspendedPageProxy's process in the event of history navigations. However, it is not true that all history navigations will use a SuspendedPageProxy's process. For example, no SuspendedPageProxy may be available for the history navigation because the history was restored to a new view from disk, or because the WebBackForwardListItem no longer has a SuspendedPageProxy (we currently only keep a single SuspendedPageProxy for the last HistoryItem). Therefore, unconditionally initializating m_mainFrame in reattachToWebProcess() for history navigations is incorrect and we should instead check if we're reattaching to a SuspendedPage's process. Change is covered by ProcessSwap.BackWithoutSuspendedPage API test which is no longer crashes and existing Back/Forward PSON API tests which are still passing. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::continueNavigationInNewProcess): * UIProcess/WebPageProxy.h: 2018-09-13 Chris Dumez Add release logging to help debug PSON issues https://bugs.webkit.org/show_bug.cgi?id=189562 Reviewed by Ryosuke Niwa. Add release logging to help debug issues related to process swap on navigation. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): * UIProcess/WebProcessPool.h: 2018-09-13 Chris Dumez Add null check for drawing area in WebPage::didCompletePageTransition() after r235867 https://bugs.webkit.org/show_bug.cgi?id=189587 Reviewed by Geoffrey Garen. Add null check for drawing area in WebPage::didCompletePageTransition() after r235867 as this is causing crashes on the bots. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCompletePageTransition): 2018-09-13 Ryan Haddad Unreviewed, rolling out r235953. Caused layout test crashes under GuardMalloc. Reverted changeset: "Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings" https://bugs.webkit.org/show_bug.cgi?id=189521 https://trac.webkit.org/changeset/235953 2018-09-13 Carlos Garcia Campos [GTK][WPE] Allow to run script dialogs asynchronously in the UI process https://bugs.webkit.org/show_bug.cgi?id=189544 Reviewed by Michael Catanzaro. Script dialogs are sync in the WebProcess, but we don't need to block the UI process while they are running. Our current API doesn't allow it, because it always expects the dialog to be closed in the signal handler. API changes are backwards compatible. * UIProcess/API/glib/WebKitScriptDialog.cpp: (webkitScriptDialogCreate): Added to heap allocate a WebKitScriptDialog. (webkitScriptDialogIsRunning): Common implementation here, a script dialog is considered to be running if it has a competion handler pending. (webkit_script_dialog_ref): WebKitScriptDialog is now refcounted. (webkit_script_dialog_unref): Ditto. (webkit_script_dialog_close): New method to notify that we are done with the dialog. * UIProcess/API/glib/WebKitScriptDialogPrivate.h: (_WebKitScriptDialog::_WebKitScriptDialog): Use a single constructor and keep the completion handler. * UIProcess/API/glib/WebKitUIClient.cpp: Do not call the completion handler, pass it to the web view. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewDispose): Close the current script dialog if there's any. (webkit_web_view_class_init): Document how to handle dialogs asynchronously. (webkitWebViewRunJavaScriptAlert): Do not stack allocate the WebKitScriptDialog, create it with webkitScriptDialogCreate() passing the completion handler. (webkitWebViewRunJavaScriptConfirm): Ditto. (webkitWebViewRunJavaScriptPrompt): Ditto. (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto. * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitScriptDialog.h: * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp: (scriptDialogResponseCallback): Hnadle the response callback. (webkitScriptDialogRun): Do not use gtk_dialog_run(), connect to response signal and show the dialogs instead. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp: 2018-09-12 Dan Bernstein Update availability annotations to match the macOS and iOS SDKs in the Xcode 10 GM seed https://bugs.webkit.org/show_bug.cgi?id=189561 Reviewed by Tim Horton. Changed WK_MAC_TBA and WK_IOS_TBA to 10.14 and 12.0, respectively, in all declarations that appear in the GM seed SDKs. * Shared/API/Cocoa/_WKRenderingProgressEvents.h: * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKAttachment.h: * UIProcess/API/Cocoa/_WKAutomationDelegate.h: * UIProcess/API/Cocoa/_WKAutomationSession.h: * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: * UIProcess/API/Cocoa/_WKFormInputSession.h: * UIProcess/API/Cocoa/_WKInputDelegate.h: * UIProcess/API/Cocoa/_WKLinkIconParameters.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h: * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h: 2018-09-12 Dan Bernstein [Cocoa] Complete support for Paste as Quotation https://bugs.webkit.org/show_bug.cgi?id=189504 Reviewed by Wenson Hsieh. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView canPerformAction:withSender:]): Handle _pasteAsQuotation:. It’s not included in FOR_EACH_WKCONTENTVIEW_ACTION, because it’s declared and implemented in the WKPrivate category. If we add more actions in the category, it could make sense to fold them into a new FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION. (-[WKWebView targetForAction:withSender:]): Handle _pasteAsQuotation:. (-[WKWebView _pasteAsQuotation:]): Send to the WebViewImpl or the WKContentView. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared a new _pasteAsQuotation: action. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::selectorExceptionMap): Added a custom mapping from the new selector to the PasteAsQuotation command. * UIProcess/ios/WKContentViewInteraction.h: Declare methods for the new action. * UIProcess/ios/WKContentViewInteraction.mm: Forward _pasteAsQuotation: to the WKWebView so that clients get a chance to override its behavior. (-[WKContentView _pasteAsQuotationForWebView:]): Send the command to the page. 2018-09-12 Sihui Liu Move IndexedDB to Network Process https://bugs.webkit.org/show_bug.cgi?id=189415 Reviewed by Geoffrey Garen. We are going to eliminate storage process and move its functionality to network process. The reasons why we want to do this: 1. Lower resource usage of having an additional process for storage operations, especially memory. Single storage process takes about 5MB memory on macOS. 2. Reduce latency of Service Workers. After enabling Service Workers, we've seen regression in app launch. The launch time of storage process is partly attributed to this: Service Workers delay page loading until receiving response from storage process. 3. We choose network process because UI process may have broader access in file system that we don't want the storage operations to have. This patch is the first piece towards the goal. It mainly moves indexedDB from storage process to corresponding components of network process. Moving of Service Worker and stopping to launch storage process will be done in following patches. We expect to see the higher cpu and memory usage of network process as it is taking more work, but the overall gain in memory and latency after we completely remove storage process should be positive. * CMakeLists.txt: * DerivedSources.make: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp. (WebKit::WebIDBConnectionToClient::create): (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient): (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): (WebKit::WebIDBConnectionToClient::messageSenderConnection): (WebKit::WebIDBConnectionToClient::connectionToClient): (WebKit::WebIDBConnectionToClient::didDeleteDatabase): (WebKit::WebIDBConnectionToClient::didOpenDatabase): (WebKit::WebIDBConnectionToClient::didAbortTransaction): (WebKit::WebIDBConnectionToClient::didCommitTransaction): (WebKit::WebIDBConnectionToClient::didCreateObjectStore): (WebKit::WebIDBConnectionToClient::didDeleteObjectStore): (WebKit::WebIDBConnectionToClient::didRenameObjectStore): (WebKit::WebIDBConnectionToClient::didClearObjectStore): (WebKit::WebIDBConnectionToClient::didCreateIndex): (WebKit::WebIDBConnectionToClient::didDeleteIndex): (WebKit::WebIDBConnectionToClient::didRenameIndex): (WebKit::WebIDBConnectionToClient::didPutOrAdd): (WebKit::WebIDBConnectionToClient::handleGetResult): (WebKit::WebIDBConnectionToClient::didGetRecord): (WebKit::WebIDBConnectionToClient::didGetAllRecords): (WebKit::WebIDBConnectionToClient::didGetCount): (WebKit::WebIDBConnectionToClient::didDeleteRecord): (WebKit::WebIDBConnectionToClient::didOpenCursor): (WebKit::WebIDBConnectionToClient::didIterateCursor): (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent): (WebKit::WebIDBConnectionToClient::didStartTransaction): (WebKit::WebIDBConnectionToClient::didCloseFromServer): (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked): (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames): (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): * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): Code moved from StorageToWebProcessConnection::didReceiveMessage. (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): Network process receives and stores sandbox extension of temporary files for later indexedDB use. (WebKit::generateIDBConnectionToServerIdentifier): (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer): (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::idbServer): (WebKit::NetworkProcess::ensurePathExists): (WebKit::NetworkProcess::postStorageTask): (WebKit::NetworkProcess::performNextStorageTask): (WebKit::NetworkProcess::prepareForAccessToTemporaryFile): (WebKit::NetworkProcess::accessToTemporaryFileComplete): (WebKit::NetworkProcess::indexedDatabaseOrigins): (WebKit::NetworkProcess::addIndexedDatabaseSession): (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles): Instead of asking UI process to grant sandbox extension to storage process, now network process just asks for sandbox extension fot itself. (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles): (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions): (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted. (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::queue): * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * Shared/Storage/StorageProcessCreationParameters.cpp: (WebKit::StorageProcessCreationParameters::encode const): (WebKit::StorageProcessCreationParameters::decode): * Shared/Storage/StorageProcessCreationParameters.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): (WebKit::WebsiteDataStoreParameters::privateSessionParameters): * Shared/WebsiteDataStoreParameters.h: * Sources.txt: * StorageProcess/StorageProcess.cpp: (WebKit::StorageProcess::initializeWebsiteDataStore): (WebKit::StorageProcess::fetchWebsiteData): (WebKit::StorageProcess::deleteWebsiteData): (WebKit::StorageProcess::deleteWebsiteDataForOrigins): (WebKit::StorageProcess::idbServer): Deleted. (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted. (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted. (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted. (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted. (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted. (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted. * StorageProcess/StorageProcess.h: (WebKit::StorageProcess::queue): Deleted. * StorageProcess/StorageProcess.messages.in: * StorageProcess/StorageToWebProcessConnection.cpp: (WebKit::StorageToWebProcessConnection::didReceiveMessage): (WebKit::StorageToWebProcessConnection::didClose): (WebKit::generateIDBConnectionToServerIdentifier): Deleted. (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted. (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted. * StorageProcess/StorageToWebProcessConnection.h: * StorageProcess/StorageToWebProcessConnection.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles): (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/Storage/StorageProcessProxy.cpp: (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted. * UIProcess/Storage/StorageProcessProxy.h: * UIProcess/Storage/StorageProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore): (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::storageProcessParameters): (WebKit::WebsiteDataStore::parameters): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer): (WebKit::WebIDBConnectionToServer::messageSenderConnection): * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): (WebKit::NetworkProcessConnection::didClose): (WebKit::NetworkProcessConnection::idbConnectionToServerForSession): * WebProcess/Network/NetworkProcessConnection.h: (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier): * WebProcess/Storage/WebToStorageProcessConnection.cpp: (WebKit::WebToStorageProcessConnection::didReceiveMessage): Code moved from WebToStorageProcessConnection::didReceiveMessage. (WebKit::WebToStorageProcessConnection::didClose): (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted. * WebProcess/Storage/WebToStorageProcessConnection.h: (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): (WebKit::WebProcess::webToStorageProcessConnectionClosed): 2018-09-11 Simon Fraser Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings https://bugs.webkit.org/show_bug.cgi?id=189521 Reviewed by Tim Horton. Make GraphicsLayer be RefCounted. GraphicsLayers own their children, via a Vector>. RenderLayerBacking and other holders of GraphicsLayers use RefPtr. All the other changes are just to adapt to the new ownership patterns. I verified that no GraphicsLayers were leaked or abandoned after this change. * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::~WebInspectorClient): (WebKit::WebInspectorClient::showPaintRect): (WebKit::WebInspectorClient::animationEndedForLayer): * WebProcess/WebCoreSupport/WebInspectorClient.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::createGraphicsLayer): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers): (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 2018-09-12 Chris Dumez PSON: No process swap on back navigation after URL bar navigation https://bugs.webkit.org/show_bug.cgi?id=189557 Reviewed by Alex Christensen. Our logic in WebProcessPool::processForNavigationInternal() was wrongly using WebBackForwardList::currentItem() as source item of the navigation, instead of using Navigation::fromItem(). In case of back navigation, by the time processForNavigation() is called, the WebBackForwardList's currentItem has already been updated to be the target item, via a Sync IPC from the WebProcess. As a result, the source and target items would be the same in the following check: ` if (currentItem->itemID().processIdentifier == backForwardListItem->itemID().processIdentifier)` This would cause us to reuse the same process incorrectly. Our existing API test coverage did not catch this because our target HistoryItem usually has a SuspendedPage and we decide to use the SuspendedPage's process a few lines above in WebProcessPool::processForNavigationInternal(). * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): 2018-09-12 Alex Christensen Make IPC::SharedBufferDataReference a type that decodes into but does not inherit from IPC::DataReference https://bugs.webkit.org/show_bug.cgi?id=189519 Reviewed by Chris Dumez. * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::bufferingTimerFired): (WebKit::NetworkResourceLoader::sendBuffer): * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode const): Deleted. * Platform/IPC/DataReference.h: (IPC::SharedBufferDataReference::SharedBufferDataReference): Deleted. * Platform/IPC/HandleMessage.h: * Platform/IPC/SharedBufferDataReference.h: Added. (IPC::SharedBufferDataReference::SharedBufferDataReference): (IPC::SharedBufferDataReference::encode const): * Scripts/webkit/messages.py: * Shared/API/APIData.h: * StorageProcess/StorageProcess.messages.in: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didReceiveData): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::storeDerivedDataToCache): * WebProcess/Network/WebResourceLoader.messages.in: * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData): (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::registerAttachmentIdentifier): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getContentsAsMHTMLData): (WebKit::WebPage::getSelectionAsWebArchiveData): (WebKit::WebPage::getMainResourceDataOfFrame): (WebKit::WebPage::getResourceDataFromFrame): (WebKit::WebPage::getWebArchiveOfFrame): (WebKit::WebPage::drawPagesToPDF): * WebProcess/WebPage/WebPage.messages.in: 2018-09-11 Dean Jackson Header parsing for experimental and internal debug features https://bugs.webkit.org/show_bug.cgi?id=189486 Reviewed by Tim Horton. Provide key-based (string) access to experimental and internal features. * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetExperimentalFeatureForKey): (WKPreferencesResetAllInternalDebugFeatures): (WKPreferencesSetInternalDebugFeatureForKey): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/WebPreferences.h: 2018-09-10 Matt Rajca Expose a few WebPlaybackControlsManager-driven PIP APIs to clients https://bugs.webkit.org/show_bug.cgi?id=189478 Reviewed by Eric Carlson. This patch exposes APIs necessary to toggle PIP and query its status from clients of WKWebView. The existing PIP test has been updated to use the new APIs instead of simulating mouse clicks. I also increased the size of the video element in the test page so it gets picked up by the main content heuristics. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateMediaPlaybackControlsManager]): Create a media playback controls manager if necessary. (-[WKWebView _isPictureInPictureActive]): Return true if the "active" media element is in PIP. (-[WKWebView _togglePictureInPicture]): Toggle PIP on the "active" media element. (-[WKWebView _canTogglePictureInPicture]): Renamed from... (-[WKWebView _canTogglePictureInPictureForTesting]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::isPictureInPictureActive): Return true if the "active" media element is in PIP. (WebKit::WebViewImpl::togglePictureInPicture): Toggle PIP on the "active" media element. (WebKit::WebViewImpl::updateMediaPlaybackControlsManager): Let clients create a playback controls manager even when there is no Touch Bar present. (WebKit::WebViewImpl::updateMediaTouchBar): Extract some code into a helper method. (WebKit::WebViewImpl::canTogglePictureInPicture): Renamed from... (WebKit::WebViewImpl::canTogglePictureInPictureForTesting): 2018-09-12 Fujii Hironori [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT' https://bugs.webkit.org/show_bug.cgi?id=189542 Reviewed by Alex Christensen. * UIProcess/win/WebInspectorProxyWin.cpp: (WebKit::WebInspectorProxy::platformCreateFrontendPage): Narrowed initialWindowWidth and initialWindowHeight by using static_cast. 2018-09-12 Chris Dumez Clean up SuspendedPageProxy https://bugs.webkit.org/show_bug.cgi?id=189517 Reviewed by Alex Christensen. Clean up SuspendedPageProxy: 1. SuspendedPageProxy does not need to be RefCounted. It is even dangerous given that WebPageProxy owns the SuspendedPageProxy and SuspendedPageProxy has a WebPageProxy& data member. We definitely do not want it to outlive its WebPageProxy. 2. The SuspendedPageProxy destructor does not need to be virtual. 3. Have WebBackForwardListItem keep a WeakPtr instead of a SuspendedPageProxy*. This is safer and avoid having to explicitly clear the pointer. 4. m_finishedSuspending data member does not need a getter and is only needed if !LOG_DISABLED. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::setSuspendedPage): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::suspendedPage const): * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::webProcessDidClose): (WebKit::SuspendedPageProxy::didFinishLoad): * UIProcess/SuspendedPageProxy.h: (WebKit::SuspendedPageProxy::process const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeCreateSuspendedPage): (WebKit::WebPageProxy::reattachToWebProcess): * UIProcess/WebPageProxy.h: 2018-09-12 Guillaume Emont Add IGNORE_WARNING_.* macros https://bugs.webkit.org/show_bug.cgi?id=188996 Reviewed by Michael Catanzaro. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::statelessCookieStorage): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSyncAllCookies): * PluginProcess/mac/PluginProcessMac.mm: (WebKit::beginModal): * PluginProcess/mac/PluginProcessShim.mm: * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::tryLoad): * Shared/ios/ChildProcessIOS.mm: (WebKit::ChildProcess::initializeSandbox): * Shared/mac/ChildProcessMac.mm: (WebKit::compileAndApplySandboxSlowCase): * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::decode): * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtensionImpl::sandboxExtensionForType): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _web_superAccessibilityAttributeValue:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunAsModal): * UIProcess/API/mac/WKView.mm: (-[WKView _web_superAccessibilityAttributeValue:]): * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm: (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/Cocoa/WebViewImpl.mm: (-[WKTextListTouchBarViewController initWithWebViewImpl:]): (WebKit::WebViewImpl::updateWindowAndViewFrames): (WebKit::WebViewImpl::sendDragEndToPage): (WebKit::WebViewImpl::startDrag): (WebKit::WebViewImpl::characterIndexForPoint): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::getPluginProcessSerialNumber): (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess): (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess): (WebKit::PluginProcessProxy::exitFullscreen): * UIProcess/ios/SmartMagnificationController.mm: * UIProcess/ios/WKGeolocationProviderIOS.mm: * UIProcess/ios/WKLegacyPDFView.mm: * UIProcess/ios/WKPDFPageNumberIndicator.mm: (-[WKPDFPageNumberIndicator _makeRoundedCorners]): * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]): * UIProcess/ios/forms/WKFormColorControl.mm: (-[WKColorPopover initWithView:]): * UIProcess/ios/forms/WKFormInputControl.mm: (-[WKDateTimePopover initWithView:datePickerMode:]): * UIProcess/ios/forms/WKFormPopover.h: * UIProcess/ios/forms/WKFormPopover.mm: * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectPopover initWithView:hasGroups:]): * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::screenToRootView): (WebKit::PageClientImpl::rootViewToScreen): * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _setAutodisplay:]): (-[WKPrintingView _drawPDFDocument:page:atPoint:]): (-[WKPrintingView _drawPreview:]): (-[WKPrintingView drawRect:]): * UIProcess/mac/WKTextInputWindowController.mm: (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]): (-[WKTextInputPanel _hasMarkedText]): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::initializeEventRecord): (WebKit::NetscapePlugin::sendComplexTextInput): (WebKit::makeCGLPresentLayerOpaque): (WebKit::NetscapePlugin::nullEventTimerFired): * WebProcess/Plugins/PDF/PDFPlugin.mm: (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]): (-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]): (WebKit::PDFPlugin::handleEditingCommand): (WebKit::PDFPlugin::setActiveAnnotation): (WebKit:: const): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::createAnnotationElement): * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::drawPDFPage): 2018-09-11 Olivia Barnett Implement the Web Share API for mac https://bugs.webkit.org/show_bug.cgi?id=189443 Reviewed by Tim Horton. * Shared/WebPreferencesDefaultValues.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView shareSheetDidDismiss:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/mac/WKView.mm: (-[WKView shareSheetDidDismiss:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::showShareSheet): (WebKit::WebViewImpl::shareSheetDidDismiss): Implemented function for WKShareSheetDelegate. * UIProcess/Cocoa/WKShareSheet.h: * UIProcess/Cocoa/WKShareSheet.mm: (-[WKShareSheet initWithView:initWithView:]): (-[WKShareSheet presentWithParameters:completionHandler:]): (-[WKShareSheet sharingServicePicker:didChooseSharingService:]): (-[WKShareSheet _cancel]): (-[WKShareSheet dismiss]): (-[WKShareSheet _dismissDisplayAnimated:]): (-[WKShareSheet invokeShareSheetWithResolution:]): (-[WKShareSheet initWithView:]): Deleted. Added mac platform checks and share sheet functionality. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::showShareSheet): Allows macos to invoke the system share sheet. 2018-09-07 Dean Jackson Add and expose Internal features from WebKit https://bugs.webkit.org/show_bug.cgi?id=189442 Reviewed by Simon Fraser. Experimental features have become a mess. People are using them for anything that they want to be easily toggled from a host app (e.g. Safari), which means the user-facing menu has become large and confusing. Introduce the idea of Internal features, that will be exposed in a way that end-users are not expected to ever see (unless they really want to). * CMakeLists.txt: Add new files. * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * DerivedSources.make: Add new generated files. * Scripts/GeneratePreferences.rb: Generate the preferences stuff for Internal Debug features. * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb: Added. * Shared/API/APIObject.h: New API object for InternalDebugFeature. * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/WebPreferences.yaml: Change some of the existing experimental features to "internal". * UIProcess/API/APIInternalDebugFeature.cpp: New API type - just like APIExperimentalFeature. (API::InternalDebugFeature::create): (API::InternalDebugFeature::InternalDebugFeature): (API::InternalDebugFeature::~InternalDebugFeature): * UIProcess/API/APIInternalDebugFeature.h: * UIProcess/API/C/WKAPICast.h: * UIProcess/API/Cocoa/WKPreferences.mm: Change the naming of the experimental feature API so that it won't clash with internal debug features. We can remove the old API once Safari has adopted. (+[WKPreferences _internalDebugFeatures]): (-[WKPreferences _isEnabledForInternalDebugFeature:]): (-[WKPreferences _setEnabled:forInternalDebugFeature:]): (-[WKPreferences _isEnabledForFeature:]): (-[WKPreferences _setEnabled:forFeature:]): (-[WKPreferences _isEnabledForExperimentalFeature:]): (-[WKPreferences _setEnabled:forExperimentalFeature:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/_WKInternalDebugFeature.h: New object - same as _WKExperimentalFeature. * UIProcess/API/Cocoa/_WKInternalDebugFeature.mm: (-[_WKInternalDebugFeature dealloc]): (-[_WKInternalDebugFeature description]): (-[_WKInternalDebugFeature name]): (-[_WKInternalDebugFeature key]): (-[_WKInternalDebugFeature details]): (-[_WKInternalDebugFeature defaultValue]): (-[_WKInternalDebugFeature isHidden]): (-[_WKInternalDebugFeature _apiObject]): * UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h: * UIProcess/WebPreferences.cpp: Add support for Internal Debug features. (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey): (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey): * UIProcess/WebPreferences.h: * UIProcess/WebProcessPool.cpp: Change a comment now that it is an internal feature. (WebKit::WebProcessPool::createWebPage): 2018-09-11 Eric Carlson WebPage::close should clear UserMediaPermissionRequestManager https://bugs.webkit.org/show_bug.cgi?id=189369 Reviewed by Youenn Fablet. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): Clear m_userMediaPermissionRequestManager. 2018-09-11 Wenson Hsieh [macOS] [WK2] Support changing foreground colors via color panel https://bugs.webkit.org/show_bug.cgi?id=189382 Reviewed by Ryosuke Niwa. Adds support for changing font color in a richly editable element in WebKit2 via NSColorPanel. See below for more detail, as well as the WebCore ChangeLog. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView changeColor:]): Implement this selector; AppKit calls into this when changing font color using NSColorPanel. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::changeFontColorFromSender): Creates and populates new FontAttributeChanges, with only the foreground color determined by asking the sender object for its -color. * WebProcess/WebPage/mac/WebPageMac.mm: Use the relevant EditAction for the incoming FontAttributeChanges, instead of always specifying EditAction::ChangeAttributes. (WebKit::WebPage::changeFontAttributes): 2018-09-11 Myles C. Maxfield Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts https://bugs.webkit.org/show_bug.cgi?id=188008 Reviewed by Alex Christensen. This patch is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=180307. Variable fonts have CFDictionaries with non-string keys. We need to support that in our IPC code. * Shared/cf/ArgumentCodersCF.cpp: (IPC::encode): (IPC::decode): 2018-09-11 Adrian Perez de Castro [WPE][GTK] API documentation is unclear about how to modify requests before sending them https://bugs.webkit.org/show_bug.cgi?id=189505 Reviewed by Michael Catanzaro. Add notes to the API documentation to make explicit where modification of WebKitURIRequest instances affects the request data sent over the network. * UIProcess/API/glib/WebKitNavigationAction.cpp: Clarify that modifications to the associated WebKitURIRequest do not affect the actual request. Point to WebKitPage::send-request instead. * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Ditto. * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): Ditto for the description of the WebKitWebView::decide-policy signal. Also fix the syntax of example. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkit_web_page_class_init): Indicate that modifications to the WebKitURIRequest will change the actual network request data. 2018-09-11 Michael Catanzaro Unreviewed, attempt to fix Apple builds after r235903 https://bugs.webkit.org/show_bug.cgi?id=188872 If it really needs to be inlined, it will need to move to the header.... * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::pageClient const): 2018-09-11 Michael Catanzaro Unreviewed, fix build after r235903 https://bugs.webkit.org/show_bug.cgi?id=188872 This broke all ports except GTK. Need to add a missing header. * UIProcess/PageClient.h: 2018-09-11 Pablo Saavedra Add missing #if ENABLE(VIDEO) WebProcess/FullScreen/WebFullScreenManager.cpp https://bugs.webkit.org/show_bug.cgi?id=189506 Reviewed by Tim Horton. m_pipStandbyElement is only defined in WebKit/WebProcess/FullScreen/WebFullScreenManager.h only when ENABLE(VIDEO) (see https://bugs.webkit.org/show_bug.cgi?id=181338) * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::setPIPStandbyElement): 2018-09-11 Michael Catanzaro WebPageProxy should hold a WeakPtr to its PageClient https://bugs.webkit.org/show_bug.cgi?id=188872 Reviewed by Ryosuke Niwa. This ensures the PageClient reference is always valid when used. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::setDragCaretRect): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::PageClientProtector::PageClientProtector): (WebKit::PageClientProtector::~PageClientProtector): (WebKit::WebPageProxy::WebPageProxy): (WebKit::m_resetRecentCrashCountTimer): (WebKit::WebPageProxy::pageClient const): (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::didChangeBackForwardList): (WebKit::WebPageProxy::willGoToBackForwardListItem): (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): (WebKit::WebPageProxy::setViewNeedsDisplay): (WebKit::WebPageProxy::requestScroll): (WebKit::WebPageProxy::viewScrollPosition const): (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::viewDidEnterWindow): (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::layerHostingModeDidChange): (WebKit::WebPageProxy::viewSize const): (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::didPerformDragOperation): (WebKit::WebPageProxy::processNextQueuedMouseEvent): (WebKit::WebPageProxy::findPlugin): (WebKit::WebPageProxy::handleTouchEventSynchronously): (WebKit::WebPageProxy::handleTouchEvent): (WebKit::WebPageProxy::preferencesDidChange): (WebKit::WebPageProxy::didCreateMainFrame): (WebKit::WebPageProxy::didCreateSubframe): (WebKit::WebPageProxy::didStartProgress): (WebKit::WebPageProxy::didChangeProgress): (WebKit::WebPageProxy::didFinishProgress): (WebKit::WebPageProxy::didDestroyNavigation): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::willPerformClientRedirectForFrame): (WebKit::WebPageProxy::didCancelClientRedirectForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): (WebKit::WebPageProxy::didReceiveTitleForFrame): (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame): (WebKit::WebPageProxy::didReachLayoutMilestone): (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): (WebKit::WebPageProxy::didRunInsecureContentForFrame): (WebKit::WebPageProxy::frameDidBecomeFrameSet): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponse): (WebKit::WebPageProxy::unableToImplementPolicy): (WebKit::WebPageProxy::didNavigateWithNavigationData): (WebKit::WebPageProxy::didPerformClientRedirect): (WebKit::WebPageProxy::didPerformServerRedirect): (WebKit::WebPageProxy::didUpdateHistoryTitle): (WebKit::WebPageProxy::closePage): (WebKit::WebPageProxy::setWindowFrame): (WebKit::WebPageProxy::getWindowFrame): (WebKit::WebPageProxy::getWindowFrameWithCallback): (WebKit::WebPageProxy::screenToRootView): (WebKit::WebPageProxy::rootViewToScreen): (WebKit::WebPageProxy::syncRootViewToScreen): (WebKit::WebPageProxy::accessibilityScreenToRootView): (WebKit::WebPageProxy::rootViewToAccessibilityScreen): (WebKit::WebPageProxy::didChangeViewportProperties): (WebKit::WebPageProxy::runOpenPanel): (WebKit::WebPageProxy::showShareSheet): (WebKit::WebPageProxy::handleDownloadRequest): (WebKit::WebPageProxy::didChangeContentSize): (WebKit::WebPageProxy::showColorPicker): (WebKit::WebPageProxy::showDataListSuggestions): (WebKit::WebPageProxy::compositionWasCanceled): (WebKit::WebPageProxy::registerInsertionUndoGrouping): (WebKit::WebPageProxy::canUndoRedo): (WebKit::WebPageProxy::executeUndoRedo): (WebKit::WebPageProxy::clearAllEditCommands): (WebKit::WebPageProxy::setTextIndicator): (WebKit::WebPageProxy::clearTextIndicator): (WebKit::WebPageProxy::setTextIndicatorAnimationProgress): (WebKit::WebPageProxy::showPopupMenu): (WebKit::WebPageProxy::showContextMenu): (WebKit::WebPageProxy::registerEditCommand): (WebKit::WebPageProxy::canUndo): (WebKit::WebPageProxy::canRedo): (WebKit::WebPageProxy::setToolTip): (WebKit::WebPageProxy::setCursor): (WebKit::WebPageProxy::setCursorHiddenUntilMouseMoves): (WebKit::WebPageProxy::didReceiveEvent): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::resetStateAfterProcessExited): (WebKit::WebPageProxy::creationParameters): (WebKit::WebPageProxy::enterAcceleratedCompositingMode): (WebKit::WebPageProxy::exitAcceleratedCompositingMode): (WebKit::WebPageProxy::updateAcceleratedCompositingMode): (WebKit::WebPageProxy::requestGeolocationPermissionForFrame): (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange): (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame): (WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider): (WebKit::WebPageProxy::updateBackingStoreDiscardableState): (WebKit::WebPageProxy::showCorrectionPanel): (WebKit::WebPageProxy::dismissCorrectionPanel): (WebKit::WebPageProxy::dismissCorrectionPanelSoon): (WebKit::WebPageProxy::recordAutocorrectionResponse): (WebKit::WebPageProxy::useDarkAppearance const): (WebKit::WebPageProxy::showDictationAlternativeUI): (WebKit::WebPageProxy::removeDictationAlternatives): (WebKit::WebPageProxy::dictationAlternatives): (WebKit::WebPageProxy::setEditableElementIsFocused): (WebKit::WebPageProxy::takeViewSnapshot): (WebKit::WebPageProxy::wrapCryptoKey): (WebKit::WebPageProxy::unwrapCryptoKey): (WebKit::WebPageProxy::signedPublicKeyAndChallengeString): (WebKit::WebPageProxy::navigationGestureDidBegin): (WebKit::WebPageProxy::navigationGestureWillEnd): (WebKit::WebPageProxy::navigationGestureDidEnd): (WebKit::WebPageProxy::willRecordNavigationSnapshot): (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): (WebKit::WebPageProxy::isPlayingMediaDidChange): (WebKit::WebPageProxy::videoControlsManagerDidChange): (WebKit::WebPageProxy::handleControlledElementIDResponse const): (WebKit::WebPageProxy::didPerformImmediateActionHitTest): (WebKit::WebPageProxy::immediateActionAnimationControllerForHitTestResult): (WebKit::WebPageProxy::didHandleAcceptedCandidate): (WebKit::WebPageProxy::addPlaybackTargetPickerClient): (WebKit::WebPageProxy::removePlaybackTargetPickerClient): (WebKit::WebPageProxy::showPlaybackTargetPicker): (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange): (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerEnabled): (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState): (WebKit::WebPageProxy::didChangeBackgroundColor): (WebKit::WebPageProxy::didRestoreScrollPosition): (WebKit::WebPageProxy::userInterfaceLayoutDirection): (WebKit::WebPageProxy::didInsertAttachment): (WebKit::WebPageProxy::didRemoveAttachment): * UIProcess/WebPageProxy.h: * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::viewWidget): (WebKit::WebPageProxy::editorStateChanged): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect const): (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture): (WebKit::WebPageProxy::overflowScrollViewDidScroll): (WebKit::WebPageProxy::overflowScrollWillStartScroll): (WebKit::WebPageProxy::overflowScrollDidEndScroll): (WebKit::WebPageProxy::didCommitLayerTree): (WebKit::WebPageProxy::layerTreeCommitComplete): (WebKit::WebPageProxy::didReceivePositionInformation): (WebKit::WebPageProxy::saveImageToLibrary): (WebKit::WebPageProxy::interpretKeyEvent): (WebKit::WebPageProxy::registerWebProcessAccessibilityToken): (WebKit::WebPageProxy::couldNotRestorePageState): (WebKit::WebPageProxy::restorePageState): (WebKit::WebPageProxy::restorePageCenterAndScale): (WebKit::WebPageProxy::didGetTapHighlightGeometries): (WebKit::WebPageProxy::startAssistingNode): (WebKit::WebPageProxy::stopAssistingNode): (WebKit::WebPageProxy::showInspectorHighlight): (WebKit::WebPageProxy::hideInspectorHighlight): (WebKit::WebPageProxy::showInspectorIndication): (WebKit::WebPageProxy::hideInspectorIndication): (WebKit::WebPageProxy::enableInspectorNodeSearch): (WebKit::WebPageProxy::disableInspectorNodeSearch): (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): (WebKit::WebPageProxy::showPlaybackTargetPicker): (WebKit::WebPageProxy::commitPotentialTapFailed): (WebKit::WebPageProxy::didNotHandleTapAsClick): (WebKit::WebPageProxy::didCompleteSyntheticClick): (WebKit::WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary): (WebKit::WebPageProxy::editorStateChanged): (WebKit::WebPageProxy::showValidationMessage): (WebKit::WebPageProxy::didHandleStartDataInteractionRequest): (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest): (WebKit::WebPageProxy::didConcludeEditDataInteraction): (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::windowAndViewFramesChanged): (WebKit::WebPageProxy::insertDictatedTextAsync): (WebKit::WebPageProxy::setPromisedDataForImage): (WebKit::WebPageProxy::didPerformDictionaryLookup): (WebKit::WebPageProxy::registerWebProcessAccessibilityToken): (WebKit::WebPageProxy::makeFirstResponder): (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder): (WebKit::WebPageProxy::colorSpace): (WebKit::WebPageProxy::pluginFocusOrWindowFocusChanged): (WebKit::WebPageProxy::setPluginComplexTextInputState): (WebKit::WebPageProxy::executeSavedCommandBySelector): (WebKit::WebPageProxy::intrinsicContentSizeDidChange): (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): (WebKit::WebPageProxy::acceleratedCompositingRootLayer const): (WebKit::WebPageProxy::showPDFContextMenu): (WebKit::WebPageProxy::showTelephoneNumberMenu): (WebKit::WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates const): (WebKit::WebPageProxy::editorStateChanged): (WebKit::WebPageProxy::startWindowDrag): (WebKit::WebPageProxy::platformWindow): (WebKit::WebPageProxy::rootViewToWindow): (WebKit::WebPageProxy::showValidationMessage): (WebKit::WebPageProxy::inspectorAttachmentView): (WebKit::WebPageProxy::remoteObjectRegistry): * UIProcess/win/WebPageProxyWin.cpp: (WebKit::WebPageProxy::viewWidget): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::viewBackend): 2018-09-11 Chris Dumez Regression(PSON): "Swipe back" snapshot is missing when navigating back cross-process https://bugs.webkit.org/show_bug.cgi?id=189482 Reviewed by Geoffrey Garen. The issue was that when we swap process on navigation, we: 1. Call processDidTerminate() which calls resetState() and clears the displayed content 2. Reattach the WebPageProxy to a new WebProcess 3. Trigger the navigation 4. Take the navigation snapshot When the navigation snapshot occurs at step 4, the view is already blank in the case of process swap. To avoid the issue, we take the navigation snapshot earlier, before calling processDidTerminate() and we suppress the next navigation snapshot as it would be blank. At some point, we will likely want to display the previous' WebProcess content longer, until the new WebProcess has something interesting to display. Once this is implemented, we'll likely be able to drop the early snapshotting logic. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::restoreFromSessionState): (WebKit::WebPageProxy::didCommitLoadForFrame): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::suppressNextAutomaticNavigationSnapshot): 2018-09-11 Woodrow Wang Add Web API Statistics Collection https://bugs.webkit.org/show_bug.cgi?id=187773 Reviewed by Brent Fulgham. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * UIProcess/ResourceLoadStatisticsMemoryStore.cpp: == Rolled over to ChangeLog-2018-09-11 ==