Move URL from WebCore to WTF
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-11-30  Alex Christensen  <achristensen@webkit.org>
2
3         Move URL from WebCore to WTF
4         https://bugs.webkit.org/show_bug.cgi?id=190234
5
6         Reviewed by Keith Miller.
7
8         * NetworkProcess/Cookies/WebCookieManager.cpp:
9         * NetworkProcess/Cookies/WebCookieManager.h:
10         * NetworkProcess/Cookies/WebCookieManager.messages.in:
11         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
12         * NetworkProcess/Downloads/Download.h:
13         * NetworkProcess/Downloads/DownloadManager.cpp:
14         (WebKit::DownloadManager::publishDownloadProgress):
15         * NetworkProcess/Downloads/DownloadManager.h:
16         * NetworkProcess/Downloads/PendingDownload.cpp:
17         (WebKit::PendingDownload::publishProgress):
18         * NetworkProcess/Downloads/PendingDownload.h:
19         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
20         (WebKit::Download::publishProgress):
21         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
22         (WebKit::NetworkBlobRegistry::registerBlobURL):
23         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
24         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
25         (WebKit::NetworkBlobRegistry::blobSize):
26         (WebKit::NetworkBlobRegistry::filesInBlob):
27         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
28         * NetworkProcess/NetworkConnectionToWebProcess.h:
29         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
30         * NetworkProcess/NetworkDataTask.cpp:
31         (WebKit::NetworkDataTask::didReceiveResponse):
32         * NetworkProcess/NetworkDataTaskBlob.cpp:
33         * NetworkProcess/NetworkLoadChecker.h:
34         (WebKit::NetworkLoadChecker::setContentExtensionController):
35         (WebKit::NetworkLoadChecker::url const):
36         * NetworkProcess/NetworkProcess.cpp:
37         (WebKit::NetworkProcess::writeBlobToFilePath):
38         (WebKit::NetworkProcess::publishDownloadProgress):
39         (WebKit::NetworkProcess::preconnectTo):
40         * NetworkProcess/NetworkProcess.h:
41         * NetworkProcess/NetworkProcess.messages.in:
42         * NetworkProcess/NetworkResourceLoadParameters.h:
43         * NetworkProcess/NetworkResourceLoader.cpp:
44         (WebKit::logBlockedCookieInformation):
45         (WebKit::logCookieInformationInternal):
46         * NetworkProcess/NetworkResourceLoader.h:
47         * NetworkProcess/NetworkSocketStream.cpp:
48         (WebKit::NetworkSocketStream::create):
49         * NetworkProcess/NetworkSocketStream.h:
50         * NetworkProcess/PingLoad.h:
51         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
52         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
53         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
54         * NetworkProcess/cache/CacheStorageEngine.cpp:
55         (WebKit::CacheStorage::Engine::retrieveRecords):
56         * NetworkProcess/cache/CacheStorageEngine.h:
57         * NetworkProcess/cache/CacheStorageEngineCache.h:
58         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
59         (WebKit::CacheStorageEngineConnection::retrieveRecords):
60         * NetworkProcess/cache/CacheStorageEngineConnection.h:
61         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
62         * NetworkProcess/cache/NetworkCache.h:
63         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
64         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
65         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
66         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
67         (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies const):
68         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
69         (WebKit::NetworkCapture::Request::operator WebCore::ResourceRequest const):
70         (WebKit::NetworkCapture::Response::operator WebCore::ResourceResponse const):
71         (WebKit::NetworkCapture::Error::operator WebCore::ResourceError const):
72         * NetworkProcess/capture/NetworkCaptureManager.cpp:
73         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
74         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
75         (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
76         * NetworkProcess/capture/NetworkCaptureManager.h:
77         * NetworkProcess/capture/NetworkCaptureResource.cpp:
78         (WebKit::NetworkCapture::Resource::url):
79         (WebKit::NetworkCapture::Resource::queryParameters):
80         * NetworkProcess/capture/NetworkCaptureResource.h:
81         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
82         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
83         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
84         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
85         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
86         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
87         * PluginProcess/mac/PluginProcessMac.mm:
88         (WebKit::openCFURLRef):
89         (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
90         * Shared/API/APIURL.h:
91         (API::URL::create):
92         (API::URL::equals):
93         (API::URL::URL):
94         (API::URL::url const):
95         (API::URL::parseURLIfNecessary const):
96         * Shared/API/APIUserContentURLPattern.h:
97         (API::UserContentURLPattern::matchesURL const):
98         * Shared/API/c/WKURLRequest.cpp:
99         * Shared/API/c/WKURLResponse.cpp:
100         * Shared/API/c/cf/WKURLCF.mm:
101         (WKURLCreateWithCFURL):
102         (WKURLCopyCFURL):
103         * Shared/API/glib/WebKitURIRequest.cpp:
104         * Shared/API/glib/WebKitURIResponse.cpp:
105         * Shared/APIWebArchiveResource.mm:
106         (API::WebArchiveResource::WebArchiveResource):
107         * Shared/AssistedNodeInformation.h:
108         * Shared/Cocoa/WKNSURLExtras.mm:
109         (-[NSURL _web_originalDataAsWTFString]):
110         (): Deleted.
111         * Shared/SessionState.h:
112         * Shared/WebBackForwardListItem.cpp:
113         (WebKit::WebBackForwardListItem::itemIsInSameDocument const):
114         * Shared/WebCoreArgumentCoders.cpp:
115         * Shared/WebCoreArgumentCoders.h:
116         * Shared/WebErrors.h:
117         * Shared/WebHitTestResultData.cpp:
118         * Shared/cf/ArgumentCodersCF.cpp:
119         (IPC::encode):
120         (IPC::decode):
121         * Shared/gtk/WebErrorsGtk.cpp:
122         * Shared/ios/InteractionInformationAtPosition.h:
123         * UIProcess/API/APIHTTPCookieStore.h:
124         * UIProcess/API/APINavigation.cpp:
125         (API::Navigation::appendRedirectionURL):
126         * UIProcess/API/APINavigation.h:
127         (API::Navigation::takeRedirectChain):
128         * UIProcess/API/APINavigationAction.h:
129         * UIProcess/API/APINavigationClient.h:
130         (API::NavigationClient::signedPublicKeyAndChallengeString):
131         (API::NavigationClient::contentRuleListNotification):
132         (API::NavigationClient::webGLLoadPolicy const):
133         (API::NavigationClient::resolveWebGLLoadPolicy const):
134         * UIProcess/API/APIUIClient.h:
135         (API::UIClient::saveDataToFileInDownloadsFolder):
136         * UIProcess/API/APIUserScript.cpp:
137         (API::UserScript::generateUniqueURL):
138         * UIProcess/API/APIUserScript.h:
139         * UIProcess/API/APIUserStyleSheet.cpp:
140         (API::UserStyleSheet::generateUniqueURL):
141         * UIProcess/API/APIUserStyleSheet.h:
142         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
143         (filePathsFromFileURLs):
144         * UIProcess/API/C/WKPage.cpp:
145         (WKPageLoadPlainTextStringWithUserData):
146         (WKPageSetPageUIClient):
147         (WKPageSetPageNavigationClient):
148         * UIProcess/API/C/WKPageGroup.cpp:
149         (WKPageGroupAddUserStyleSheet):
150         (WKPageGroupAddUserScript):
151         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
152         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
153         (WKWebsiteDataStoreSetStatisticsLastSeen):
154         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
155         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
156         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
157         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
158         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
159         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
160         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
161         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
162         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
163         (WKWebsiteDataStoreSetStatisticsGrandfathered):
164         (WKWebsiteDataStoreIsStatisticsGrandfathered):
165         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
166         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
167         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
168         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
169         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
170         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
171         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
172         * UIProcess/API/Cocoa/WKUserScript.mm:
173         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
174         * UIProcess/API/Cocoa/WKWebView.mm:
175         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
176         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
177         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
178         (-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
179         (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
180         * UIProcess/API/Cocoa/WKWebViewInternal.h:
181         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
182         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
183         (-[_WKApplicationManifest initWithCoder:]):
184         (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
185         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
186         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
187         * UIProcess/API/glib/IconDatabase.cpp:
188         * UIProcess/API/glib/WebKitCookieManager.cpp:
189         (webkit_cookie_manager_get_cookies):
190         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
191         * UIProcess/API/glib/WebKitSecurityOrigin.cpp:
192         (webkit_security_origin_new_for_uri):
193         * UIProcess/API/glib/WebKitUIClient.cpp:
194         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
195         * UIProcess/API/glib/WebKitWebView.cpp:
196         (webkit_web_view_load_plain_text):
197         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
198         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
199         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
200         (WebKit::WebPaymentCoordinatorProxy::validateMerchant):
201         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
202         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
203         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
204         (WebKit::toPKPaymentRequest):
205         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
206         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
207         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
208         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
209         * UIProcess/Automation/WebAutomationSession.cpp:
210         (WebKit::WebAutomationSession::navigateBrowsingContext):
211         (WebKit::domainByAddingDotPrefixIfNeeded):
212         (WebKit::WebAutomationSession::addSingleCookie):
213         (WebKit::WebAutomationSession::deleteAllCookies):
214         * UIProcess/Cocoa/DownloadClient.mm:
215         (WebKit::DownloadClient::didFinish):
216         * UIProcess/Cocoa/NavigationState.h:
217         * UIProcess/Cocoa/NavigationState.mm:
218         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
219         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
220         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
221         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
222         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
223         (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
224         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Copied from Source/WebKit/WebProcess/Network/WebSocketProvider.h.
225         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
226         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
227         (WebKit::reportAnErrorURL):
228         (WebKit::malwareDetailsURL):
229         (WebKit::safeBrowsingDetailsText):
230         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
231         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
232         (-[_WKPreviewControllerDataSource finish:]):
233         (WebKit::SystemPreviewController::finish):
234         * UIProcess/Cocoa/UIDelegate.h:
235         * UIProcess/Cocoa/UIDelegate.mm:
236         (WebKit::UIDelegate::UIClient::createNewPage):
237         (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder):
238         (WebKit::requestUserMediaAuthorizationForDevices):
239         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
240         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
241         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
242         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
243         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
244         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
245         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
246         * UIProcess/Cocoa/WebViewImpl.h:
247         * UIProcess/Cocoa/WebViewImpl.mm:
248         (WebKit::WebViewImpl::showSafeBrowsingWarning):
249         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
250         * UIProcess/Downloads/DownloadProxy.cpp:
251         (WebKit::DownloadProxy::publishProgress):
252         * UIProcess/Downloads/DownloadProxy.h:
253         (WebKit::DownloadProxy::setRedirectChain):
254         (WebKit::DownloadProxy::redirectChain const):
255         * UIProcess/FrameLoadState.cpp:
256         (WebKit::FrameLoadState::didStartProvisionalLoad):
257         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
258         (WebKit::FrameLoadState::didSameDocumentNotification):
259         (WebKit::FrameLoadState::setUnreachableURL):
260         * UIProcess/FrameLoadState.h:
261         (WebKit::FrameLoadState::url const):
262         (WebKit::FrameLoadState::setURL):
263         (WebKit::FrameLoadState::provisionalURL const):
264         (WebKit::FrameLoadState::unreachableURL const):
265         * UIProcess/Network/NetworkProcessProxy.cpp:
266         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
267         * UIProcess/Network/NetworkProcessProxy.h:
268         * UIProcess/PageClient.h:
269         (WebKit::PageClient::showSafeBrowsingWarning):
270         * UIProcess/PageLoadState.cpp:
271         (WebKit::PageLoadState::hasOnlySecureContent):
272         * UIProcess/Plugins/PluginInfoStore.cpp:
273         * UIProcess/Plugins/PluginInfoStore.h:
274         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
275         * UIProcess/SafeBrowsingResult.h: Copied from Source/WebKit/UIProcess/SystemPreviewController.h.
276         (WebKit::SafeBrowsingResult::create):
277         (WebKit::SafeBrowsingResult::url const):
278         (WebKit::SafeBrowsingResult::provider const):
279         (WebKit::SafeBrowsingResult::isPhishing const):
280         (WebKit::SafeBrowsingResult::isMalware const):
281         (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
282         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
283         * UIProcess/SafeBrowsingWarning.h:
284         (WebKit::SafeBrowsingWarning::create):
285         * UIProcess/SuspendedPageProxy.cpp:
286         * UIProcess/SystemPreviewController.h:
287         * UIProcess/WebCookieManagerProxy.h:
288         * UIProcess/WebFrameProxy.h:
289         (WebKit::WebFrameProxy::url const):
290         (WebKit::WebFrameProxy::provisionalURL const):
291         (WebKit::WebFrameProxy::unreachableURL const):
292         * UIProcess/WebInspectorProxy.h:
293         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
294         * UIProcess/WebPageProxy.cpp:
295         (WebKit::WebPageProxy::loadDataWithNavigation):
296         (WebKit::WebPageProxy::loadAlternateHTML):
297         (WebKit::WebPageProxy::loadWebArchiveData):
298         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
299         (WebKit::WebPageProxy::continueNavigationInNewProcess):
300         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
301         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
302         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
303         (WebKit::WebPageProxy::contentRuleListNotification):
304         (WebKit::WebPageProxy::processDidTerminate):
305         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
306         (WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
307         * UIProcess/WebPageProxy.h:
308         * UIProcess/WebPageProxy.messages.in:
309         * UIProcess/WebProcessPool.cpp:
310         (WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
311         * UIProcess/WebProcessPool.h:
312         * UIProcess/WebProcessProxy.cpp:
313         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
314         * UIProcess/WebProcessProxy.h:
315         * UIProcess/WebResourceLoadStatisticsStore.cpp:
316         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
317         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
318         * UIProcess/WebResourceLoadStatisticsStore.h:
319         * UIProcess/ios/DragDropInteractionState.h:
320         * UIProcess/ios/PageClientImplIOS.h:
321         * UIProcess/ios/PageClientImplIOS.mm:
322         (WebKit::PageClientImpl::showSafeBrowsingWarning):
323         * UIProcess/ios/WKActionSheetAssistant.mm:
324         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
325         * UIProcess/ios/WKContentViewInteraction.mm:
326         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
327         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
328         * UIProcess/ios/WKGeolocationProviderIOS.mm:
329         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
330         * UIProcess/ios/WKLegacyPDFView.mm:
331         (-[WKLegacyPDFView actionSheetAssistant:shareElementWithURL:rect:]):
332         * UIProcess/ios/WKPDFView.mm:
333         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
334         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
335         (-[WKFullScreenWindowController _updateLocationInfo]):
336         * UIProcess/mac/LegacySessionStateCoding.cpp:
337         (WebKit::decodeLegacySessionState):
338         * UIProcess/mac/PageClientImplMac.h:
339         * UIProcess/mac/PageClientImplMac.mm:
340         (WebKit::PageClientImpl::showSafeBrowsingWarning):
341         * UIProcess/mac/WKImmediateActionController.mm:
342         (-[WKImmediateActionController _defaultAnimationController]):
343         * UIProcess/win/WebInspectorProxyWin.cpp:
344         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
345         (WebKit::WebPaymentCoordinator::showPaymentUI):
346         (WebKit::WebPaymentCoordinator::validateMerchant):
347         * WebProcess/ApplePay/WebPaymentCoordinator.h:
348         * WebProcess/Cache/WebCacheStorageConnection.cpp:
349         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
350         * WebProcess/Cache/WebCacheStorageConnection.h:
351         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
352         (WebKit::BlobRegistryProxy::registerFileBlobURL):
353         * WebProcess/FileAPI/BlobRegistryProxy.h:
354         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
355         (API::InjectedBundle::PageLoaderClient::willLoadDataRequest):
356         (API::InjectedBundle::PageLoaderClient::userAgentForURL const):
357         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
358         (WKBundleFrameAllowsFollowingLink):
359         (WKBundleFrameCopySuggestedFilenameForResourceWithURL):
360         (WKBundleFrameCopyMIMETypeForResourceWithURL):
361         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
362         (WKBundlePageHasLocalDataForURL):
363         * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp:
364         (convertToUTF8String):
365         * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h:
366         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
367         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
368         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
369         * WebProcess/Network/WebLoaderStrategy.cpp:
370         (WebKit::WebLoaderStrategy::preconnectTo):
371         * WebProcess/Network/WebLoaderStrategy.h:
372         * WebProcess/Network/WebSocketProvider.h:
373         * WebProcess/Network/WebSocketStream.cpp:
374         (WebKit::WebSocketStream::WebSocketStream):
375         * WebProcess/Network/WebSocketStream.h:
376         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
377         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
378         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
379         * WebProcess/Plugins/PDF/PDFPlugin.h:
380         * WebProcess/Plugins/PDF/PDFPlugin.mm:
381         (WebKit::PDFPlugin::clickedLink):
382         * WebProcess/Plugins/Plugin.h:
383         * WebProcess/Plugins/PluginController.h:
384         * WebProcess/Plugins/PluginProxy.h:
385         * WebProcess/Plugins/PluginView.cpp:
386         (WebKit::PluginView::performURLRequest):
387         (WebKit::PluginView::performJavaScriptURLRequest):
388         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
389         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
390         * WebProcess/Plugins/WebPluginInfoProvider.h:
391         * WebProcess/Storage/WebSWClientConnection.h:
392         * WebProcess/Storage/WebSWContextManagerConnection.h:
393         * WebProcess/UserContent/WebUserContentController.h:
394         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
395         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
396         * WebProcess/WebCoreSupport/WebChromeClient.h:
397         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
398         * WebProcess/WebCoreSupport/WebDragClient.h:
399         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
400         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
401         (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL):
402         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
403         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
404         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
405         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
406         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
407         (WebKit::WebDragClient::declareAndWriteDragImage):
408         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
409         * WebProcess/WebPage/VisitedLinkTableController.h:
410         * WebProcess/WebPage/WebFrame.cpp:
411         (WebKit::WebFrame::allowsFollowingLink const):
412         * WebProcess/WebPage/WebFrame.h:
413         * WebProcess/WebPage/WebPage.cpp:
414         (WebKit::WebPage::loadURLInFrame):
415         (WebKit::WebPage::loadData):
416         (WebKit::WebPage::loadAlternateHTML):
417         (WebKit::WebPage::dumpHistoryForTesting):
418         (WebKit::WebPage::sendCSPViolationReport):
419         (WebKit::WebPage::addUserScript):
420         (WebKit::WebPage::addUserStyleSheet):
421         * WebProcess/WebPage/WebPage.h:
422         * WebProcess/WebPage/WebPage.messages.in:
423         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
424         (WebKit::WebPrintOperationGtk::frameURL const):
425         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
426         * WebProcess/WebProcess.cpp:
427         (WebKit::WebProcess::sendPrewarmInformation):
428         * WebProcess/WebProcess.h:
429         * WebProcess/cocoa/WebProcessCocoa.mm:
430         (WebKit::activePagesOrigins):
431
432 2018-11-30  Per Arne Vollan  <pvollan@apple.com>
433
434         [macOS] Add more logging of sandbox call entries.
435         https://bugs.webkit.org/show_bug.cgi?id=192261
436         rdar://problem/45772445
437
438         Reviewed by Dean Jackson.
439
440         * WebProcess/com.apple.WebProcess.sb.in:
441
442 2018-11-30  Tim Horton  <timothy_horton@apple.com>
443
444         Editable images should always return some data, even if the canvas doesn't have a size yet
445         https://bugs.webkit.org/show_bug.cgi?id=192265
446         <rdar://problem/46385911>
447
448         Reviewed by Wenson Hsieh.
449
450         * UIProcess/ios/WKDrawingView.mm:
451         (-[WKDrawingView layoutSubviews]):
452         (emptyImage):
453         (-[WKDrawingView renderedDrawing]):
454         (-[WKDrawingView PNGRepresentation]):
455         Some clients strongly depend on there being some data in an image, even if
456         it's not of a usable size yet. We'll invalidate the attachment when the
457         canvas size changes, so it will eventually settle at a usable size (after
458         the first layer tree commit that includes the editable image).
459
460 2018-11-30  Don Olmstead  <don.olmstead@sony.com>
461
462         Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
463         https://bugs.webkit.org/show_bug.cgi?id=192197
464
465         Reviewed by Jiewen Tan.
466
467         * Configurations/FeatureDefines.xcconfig:
468         * UIProcess/API/C/WKPage.cpp:
469         (WKPageSetPageNavigationClient):
470         * UIProcess/WebPageProxy.cpp:
471         * UIProcess/WebPageProxy.h:
472         * UIProcess/WebPageProxy.messages.in:
473         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
474         * WebProcess/WebCoreSupport/WebChromeClient.h:
475
476 2018-11-30  Alexey Proskuryakov  <ap@apple.com>
477
478         Move USE_CFNETWORK_IGNORE_HSTS to its proper place
479         https://bugs.webkit.org/show_bug.cgi?id=192173
480
481         Reviewed by Tim Horton.
482
483         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
484         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
485         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
486         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
487
488 2018-11-30  Alex Christensen  <achristensen@webkit.org>
489
490         Remove unused WebProcessCreationParameters.uiProcessCookieStorageIdentifier
491         https://bugs.webkit.org/show_bug.cgi?id=192157
492
493         Reviewed by Chris Dumez.
494
495         * Shared/WebProcessCreationParameters.cpp:
496         (WebKit::WebProcessCreationParameters::encode const):
497         (WebKit::WebProcessCreationParameters::decode):
498         * Shared/WebProcessCreationParameters.h:
499         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
500         (WebKit::WebProcessPool::platformInitializeWebProcess):
501
502 2018-11-30  Alex Christensen  <achristensen@webkit.org>
503
504         Remove privateBrowsingEnabled from NetworkProcessCreationParameters
505         https://bugs.webkit.org/show_bug.cgi?id=192156
506
507         Reviewed by Chris Dumez.
508
509         * NetworkProcess/NetworkProcess.cpp:
510         (WebKit::NetworkProcess::initializeNetworkProcess):
511         * NetworkProcess/NetworkProcessCreationParameters.cpp:
512         (WebKit::NetworkProcessCreationParameters::encode const):
513         (WebKit::NetworkProcessCreationParameters::decode):
514         * NetworkProcess/NetworkProcessCreationParameters.h:
515         * UIProcess/WebProcessPool.cpp:
516         (WebKit::WebProcessPool::ensureNetworkProcess):
517
518 2018-11-30  Basuke Suzuki  <basuke.suzuki@sony.com>
519
520         [Curl] Add API for ProtectionSpace.
521         https://bugs.webkit.org/show_bug.cgi?id=191648
522
523         Reviewed by Alex Christensen.
524
525         Added API to get certificate information from protection space.
526
527         * PlatformWin.cmake:
528         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
529         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
530         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
531         * UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp: Added.
532         (WKProtectionSpaceCopyCertificateInfo):
533         * UIProcess/API/C/curl/WKProtectionSpaceCurl.h: Added.
534
535 2018-11-30  David Quesada  <david_quesada@apple.com>
536
537         -[WKProcessPool _downloadURLRequest:] should allow specifying the initiating web view
538         https://bugs.webkit.org/show_bug.cgi?id=192212
539         rdar://problem/46363706
540
541         Reviewed by Alex Christensen.
542
543         * UIProcess/API/Cocoa/WKProcessPool.mm:
544         (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
545         (-[WKProcessPool _downloadURLRequest:]): Deleted.
546         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
547
548 2018-11-30  Per Arne Vollan  <pvollan@apple.com>
549
550         Remove invalid character in sandbox introduced in r238703.
551
552         Unreviewed sandbox fix.
553
554         * WebProcess/com.apple.WebProcess.sb.in:
555
556 2018-11-30  Andy Estes  <aestes@apple.com>
557
558         [Cocoa] Add some WKA extension points
559         https://bugs.webkit.org/show_bug.cgi?id=192131
560         <rdar://problem/46330293>
561
562         Reviewed by Tim Horton.
563
564         * DerivedSources.make: Added an extension point for WebPreferences.yaml.
565         * Platform/IPC/MessageSender.h:
566         (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
567         * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
568         * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
569         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
570         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
571         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
572         WebPaymentCoordinatorProxy.
573         * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
574         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
575         WebPaymentCoordinator.
576
577 2018-11-30  Frederic Wang  <fwang@igalia.com>
578
579         [WebAuthN] Support CTAP HID authenticators on macOS
580         https://bugs.webkit.org/show_bug.cgi?id=188623
581
582         Unreviewed build fix.
583
584         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Add missing header.
585
586 2018-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
587
588         REGRESSION (r238635): Dragging a text selection within WKWebView causes the selection highlight to get into a bad state
589         https://bugs.webkit.org/show_bug.cgi?id=192165
590         <rdar://problem/46346682>
591
592         Reviewed by Daniel Bates.
593
594         Fixes a bug in PageClientImpl::isViewFocused. Consider the following scenario:
595         1. WKWebView is hosted within the view hierarchy
596         2. First responder is *not* WKContentView
597         3. The active focus retain count is nonzero
598
599         Before r238635, we would return true, due to condition (3). However, after r238635, we only consider whether the
600         first responder is WKContentView, since the web view is in the view hierarchy. This breaks scenarios where
601         WebKit or UIKit attempts to retain focus and later restore the content view to be the first responder (an
602         example of this is dragging a text selection between editable elements in the same web view).
603
604         To fix this, simply bail early and return true if focus is being retained.
605
606         * UIProcess/ios/PageClientImplIOS.mm:
607         (WebKit::PageClientImpl::isViewFocused):
608
609 2018-11-29  Tim Horton  <timothy_horton@apple.com>
610
611         Inform clients when editable image attachment backing data changes
612         https://bugs.webkit.org/show_bug.cgi?id=192206
613         <rdar://problem/46350277>
614
615         Reviewed by Wenson Hsieh.
616
617         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
618         (API::Attachment::invalidateGeneratedFileWrapper):
619         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
620         * UIProcess/API/Cocoa/WKWebView.mm:
621         (-[WKWebView _didInvalidateDataForAttachment:]):
622         * UIProcess/API/Cocoa/WKWebViewInternal.h:
623         * UIProcess/Cocoa/PageClientImplCocoa.h:
624         * UIProcess/Cocoa/PageClientImplCocoa.mm:
625         (WebKit::PageClientImplCocoa::didInvalidateDataForAttachment):
626         * UIProcess/PageClient.h:
627         (WebKit::PageClient::didInvalidateDataForAttachment):
628         * UIProcess/WebPageProxy.cpp:
629         (WebKit::WebPageProxy::didInvalidateDataForAttachment):
630         * UIProcess/WebPageProxy.h:
631         Plumb file-wrapper-invalidation through from APIAttachment to WKUIDelegate.
632
633 2018-11-29  Eric Carlson  <eric.carlson@apple.com>
634
635         [MediaStream] DeviceIdHashSaltStorage should use iframe and top level documents
636         https://bugs.webkit.org/show_bug.cgi?id=192182
637
638         Reviewed by Youenn Fablet.
639
640         * UIProcess/DeviceIdHashSaltStorage.cpp:
641         (WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Key off of request and top 
642         level documents.
643         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins): Ditto.
644         * UIProcess/DeviceIdHashSaltStorage.h:
645         (WebKit::DeviceIdHashSaltStorage::HashSaltForOrigin::HashSaltForOrigin):
646
647         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
648         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Pass both documents.
649         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
650         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
651
652 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
653
654         Unreviewed, rolling out r238713.
655
656         Breaks internal builds.
657
658         Reverted changeset:
659
660         "[Cocoa] Add some WKA extension points"
661         https://bugs.webkit.org/show_bug.cgi?id=192131
662         https://trac.webkit.org/changeset/238713
663
664 2018-11-29  Simon Fraser  <simon.fraser@apple.com>
665
666         Add an internal feature flag to enable async overflow scrolling
667         https://bugs.webkit.org/show_bug.cgi?id=192184
668
669         Reviewed by Tim Horton.
670
671         Add a new internal feature flag that will enable async overflow-scrolling for
672         most overflow:scroll elements. Defaults to off.
673
674         * Shared/WebPreferences.yaml:
675
676 2018-11-29  Andy Estes  <aestes@apple.com>
677
678         [Cocoa] Add some WKA extension points
679         https://bugs.webkit.org/show_bug.cgi?id=192131
680         <rdar://problem/46330293>
681
682         Reviewed by Tim Horton.
683
684         * DerivedSources.make: Added an extension point for WebPreferences.yaml.
685         * Platform/IPC/MessageSender.h:
686         (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
687         * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
688         * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
689         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
690         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
691         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
692         WebPaymentCoordinatorProxy.
693         * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
694         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
695         WebPaymentCoordinator.
696
697 2018-11-29  Tim Horton  <timothy_horton@apple.com>
698
699         Try to fix the build.
700
701         * Platform/spi/ios/PencilKitSPI.h:
702
703 2018-11-29  David Quesada  <david_quesada@apple.com>
704
705         Add SPI to publish NSProgress on active downloads
706         https://bugs.webkit.org/show_bug.cgi?id=192021
707         rdar://problem/44405661
708
709         Reviewed by Alex Christensen.
710
711         Make it possible for clients to allow other processes to monitor the state of active
712         downloads. On Cocoa platforms, this can be done by creating an NSProgress, publishing
713         it on an appropriate file URL (potentially a different file URL than where the download
714         data is being written), updating properties on it as the download makes progress, and
715         wiring up a cancellation handler that allows it to be remotely canceled. Interested
716         clients can then subscribe to progress on that URL and receive a proxy to the progress
717         that WebKit publishes.
718
719         * NetworkProcess/Downloads/Download.cpp:
720         (WebKit::Download::~Download):
721         (WebKit::Download::platformDestroyDownload):
722             Add a platform-customizable hook for destructing the Download. DownloadCocoa.mm
723             will interact with its Objective-C NSProgress instance at this point.
724
725         * NetworkProcess/Downloads/Download.h:
726         * NetworkProcess/Downloads/DownloadManager.cpp:
727         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
728             See comments for publishDownloadProgress().
729         (WebKit::DownloadManager::publishDownloadProgress):
730             If the provided downloadID corresponds to a non-Pending Download, hand the URL
731             and a matching sandbox extension to the Download so it can create its progress.
732             Otherwise, store the URL and sandbox extension on the PendingDownload to be used
733             later when the full Download is created. When this happens, dataTaskBecameDownloadTask()
734             will tell the PendingDownload about the Download it has become. The PendingDownload
735             will then relay the progress URL and sandbox extension to the Download.
736
737         * NetworkProcess/Downloads/DownloadManager.h:
738         * NetworkProcess/Downloads/PendingDownload.cpp:
739         (WebKit::PendingDownload::publishProgress):
740             Store the progress info for later use, when the proper Download is created.
741         (WebKit::PendingDownload::didBecomeDownload):
742             If there was a progress URL provided earlier, tell the Download corresponding to this
743             PendingDownload to publish its progress using that URL.
744
745         * NetworkProcess/Downloads/PendingDownload.h:
746         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
747         (WebKit::Download::platformDestroyDownload):
748             When the Download is destroyed (i.e. when the download succeeds, fails, or is canceled),
749             unpublish the progress, since there is no longer any activity to report.
750         (WebKit::Download::publishProgress):
751             Resolve the sandbox extension, create a progress configured to reflect the progress of
752             this Download's NSURLSessionDownloadTask, and publish it at the given file URL.
753
754         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownload.h.
755         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Added.
756         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
757             Configure this progress, start observing properties on the download task that this
758             progress will reflect, and connect the cancellation handler of the progress to cancel
759             the corresponding Download.
760         (-[WKDownloadProgress publish]):
761         (-[WKDownloadProgress unpublish]):
762             Override these methods to consume and revoke the sandbox extension to make sure the
763             process has access to the progress file while the progress will be published.
764         (-[WKDownloadProgress dealloc]):
765         (-[WKDownloadProgress observeValueForKeyPath:ofObject:change:context:]):
766             When either byte count (number received, or number expected to receive) of the download
767             task changes, update this progress to reflect that.
768
769         * NetworkProcess/NetworkProcess.cpp:
770         (WebKit::NetworkProcess::publishDownloadProgress):
771         * NetworkProcess/NetworkProcess.h:
772         * NetworkProcess/NetworkProcess.messages.in:
773
774         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
775         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
776             Allow looking up the services that manages published NSProgresses.
777
778         * UIProcess/API/Cocoa/_WKDownload.h:
779         * UIProcess/API/Cocoa/_WKDownload.mm:
780         (-[_WKDownload publishProgressAtURL:]):
781         * UIProcess/Downloads/DownloadProxy.cpp:
782         (WebKit::DownloadProxy::publishProgress):
783         * UIProcess/Downloads/DownloadProxy.h:
784         * WebKit.xcodeproj/project.pbxproj:
785
786 2018-11-29  Tim Horton  <timothy_horton@apple.com>
787
788         Make drawing tools available when an editable image is focused
789         https://bugs.webkit.org/show_bug.cgi?id=192172
790         <rdar://problem/30337960>
791
792         Reviewed by Dean Jackson.
793
794         * Platform/spi/ios/PencilKitSPI.h:
795         Add some more SPI.
796
797         * Shared/AssistedNodeInformation.cpp:
798         (WebKit::AssistedNodeInformation::encode const):
799         (WebKit::AssistedNodeInformation::decode):
800         * Shared/AssistedNodeInformation.h:
801         * WebProcess/WebPage/ios/WebPageIOS.mm:
802         (WebKit::WebPage::handleStylusSingleTapAtPoint):
803         (WebKit::isAssistableElement):
804         (WebKit::WebPage::getAssistedNodeInformation):
805         Plumb the assisted node's embedded view ID, if available.
806         Also add a new input type for drawings, and use it when appropriate.
807
808         * SourcesCocoa.txt:
809         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
810         Add WKInputTypeDrawing.
811
812         * UIProcess/ios/PencilKitSoftLink.h: Added.
813         * UIProcess/ios/PencilKitSoftLink.mm: Added.
814         Pull soft-linking out into its own file, to fix unified sources.
815
816         * UIProcess/ios/WKContentViewInteraction.mm:
817         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
818         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
819         (-[WKContentView requiresAccessoryView]):
820         Install a keyboard when a drawing is focused.
821         Also, deduplicate one "curretUserInterfaceIdiomIsPad"; just fall through.
822
823         (-[WKContentView inputView]):
824         Make a WKInkPickerControl when a drawing is focused.
825
826         (-[WKContentView textInputTraits]):
827         (isAssistableInputType):
828         * UIProcess/ios/WKDrawingView.h:
829         * UIProcess/ios/WKDrawingView.mm:
830         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
831         (-[WKDrawingView PNGRepresentation]):
832         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
833         Adopt PencilKitSoftLink.
834
835         (-[WKDrawingView canvasView]):
836         Expose the internal canvas view for use by WKInkPickerControl.
837
838         * UIProcess/ios/WKInkPickerControl.h: Copied from Source/WebKit/Platform/spi/ios/PencilKitSPI.h.
839         * UIProcess/ios/WKInkPickerControl.mm: Added.
840         (-[WKInkPickerView initWithFrame:drawingView:]):
841         (-[WKInkPickerView didPickInk]):
842         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
843         (-[WKInkPickerView inlineInkPicker:didSelectTool:]):
844         (-[WKInkPickerView inlineInkPicker:didSelectColor:]):
845         (-[WKInkPickerView inkPickerSize]):
846         (-[WKInkPickerView layoutSubviews]):
847         (-[WKInkPickerView sizeThatFits:]):
848         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
849         (-[WKInkPickerControl initWithDrawingView:]):
850         (-[WKInkPickerControl beginEditing]):
851         (-[WKInkPickerControl endEditing]):
852         (-[WKInkPickerControl assistantView]):
853         Install and hook up a PKInlineInkPicker.
854         Center it in the keyboard.
855         Plumb changes through to the canvas view.
856
857         * WebKit.xcodeproj/project.pbxproj:
858
859 2018-11-29  Per Arne Vollan  <pvollan@apple.com>
860
861         [macOS] Add logging for some sandbox entries.
862         https://bugs.webkit.org/show_bug.cgi?id=192126
863
864         Reviewed by Brent Fulgham.
865
866         Add logging for sandbox entries which are possibly not needed.
867
868         * WebProcess/com.apple.WebProcess.sb.in:
869
870 2018-11-29  Alex Christensen  <achristensen@webkit.org>
871
872         Fix _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier SPI introduced in r235127
873         https://bugs.webkit.org/show_bug.cgi?id=192191
874
875         Reviewed by Andy Estes.
876
877         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
878         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
879         When trying to adopt the new SPI and verify it worked, I found that the strings are not copied in one place where they should be.
880
881 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
882
883         Move Lookup Code for better cross platform usage
884         https://bugs.webkit.org/show_bug.cgi?id=191732
885
886         Reviewed by Alex Christensen.
887
888         Lookup is being replaced by Reveal. This framework should work on all platforms.
889         The patch moves the code that we expect will be needed for all platforms to the more
890         general cocoa area. This patch changes no funcationality, and should not change
891         anything currently. This work will be build on later when Reveal is ready to support
892         multiple platforms.
893
894         * Platform/spi/ios/UIKitSPI.h:
895         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
896         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
897         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
898         * UIProcess/ios/WKContentViewInteraction.h:
899         * UIProcess/ios/WKContentViewInteraction.mm:
900         (-[WKContentView setupInteraction]):
901         (-[WKContentView cleanupInteraction]):
902         (-[WKContentView _removeDefaultGestureRecognizers]):
903         (-[WKContentView _addDefaultGestureRecognizers]):
904         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
905         (-[WKContentView _lookupGestureRecognized:]):
906         * UIProcess/ios/WebPageProxyIOS.mm:
907         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
908         * UIProcess/mac/WebPageProxyMac.mm:
909         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
910         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
911         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
912         (WebKit::WebPage::performDictionaryLookupAtLocation):
913         (WebKit::WebPage::performDictionaryLookupForSelection):
914         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
915         (WebKit::WebPage::performDictionaryLookupForRange):
916         (WebKit::WebPage::dictionaryPopupInfoForRange):
917         * WebProcess/WebPage/WebPage.messages.in:
918         * WebProcess/WebPage/ios/WebPageIOS.mm:
919         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
920         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
921         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
922         * WebProcess/WebPage/mac/WebPageMac.mm:
923         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
924         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
925         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
926         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
927         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
928
929 2018-11-29  Zalan Bujtas  <zalan@apple.com>
930
931         [ContentObservation] Decouple content change and DOM timer scheduling observation
932         https://bugs.webkit.org/show_bug.cgi?id=192170
933
934         Reviewed by Simon Fraser.
935
936         * WebProcess/WebPage/ios/WebPageIOS.mm:
937         (WebKit::WebPage::handleSyntheticClick):
938
939 2018-11-29  Eric Carlson  <eric.carlson@apple.com>
940
941         [iOS] Tell AirPlay picker when a file has video
942         https://bugs.webkit.org/show_bug.cgi?id=192155
943         <rdar://problem/43843865>
944
945         Reviewed by Jer Noble.
946
947         * UIProcess/ios/WKContentViewInteraction.mm:
948         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
949         Add hasVideo parameter.
950
951         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
952         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
953         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]): Add
954         hasVideo parameter, pass info to MPMediaControlsViewController.
955         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Deleted.
956
957 2018-11-29  Alexey Proskuryakov  <ap@apple.com>
958
959         Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
960         https://bugs.webkit.org/show_bug.cgi?id=192041
961
962         Reviewed by Tim Horton.
963
964         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
965         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
966
967 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
968
969         Unreviewed, rolling out r238678.
970
971         Breaks internal builds.
972
973         Reverted changeset:
974
975         "Move Lookup Code for better cross platform usage"
976         https://bugs.webkit.org/show_bug.cgi?id=191732
977         https://trac.webkit.org/changeset/238678
978
979 2018-11-29  Suresh Koppisetty  <skoppisetty@apple.com>
980
981         Addressed a FIXME by removing an unnecessary call to [NSApplication sharedApplication].
982         https://bugs.webkit.org/show_bug.cgi?id=192099
983
984         Reviewed by Geoffrey Garen.
985
986         [NSApplication sharedApplication] call is no longer needed in platformInitializeWebProcess as [NSApplication _accessibilityInitialize] calls [NSApplication sharedApplication].
987
988         * WebProcess/cocoa/WebProcessCocoa.mm:
989         (WebKit::WebProcess::platformInitializeWebProcess):
990
991 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
992
993         Move Lookup Code for better cross platform usage
994         https://bugs.webkit.org/show_bug.cgi?id=191732
995
996         Reviewed by Alex Christensen.
997
998         Lookup is being replaced by Reveal. This framework should work on all platforms.
999         The patch moves the code that we expect will be needed for all platforms to the more
1000         general cocoa area. This patch changes no funcationality, and should not change
1001         anything currently. This work will be build on later when Reveal is ready to support
1002         multiple platforms.
1003
1004         * Platform/spi/ios/UIKitSPI.h:
1005         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1006         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
1007         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
1008         * UIProcess/ios/WKContentViewInteraction.h:
1009         * UIProcess/ios/WKContentViewInteraction.mm:
1010         (-[WKContentView setupInteraction]):
1011         (-[WKContentView cleanupInteraction]):
1012         (-[WKContentView _removeDefaultGestureRecognizers]):
1013         (-[WKContentView _addDefaultGestureRecognizers]):
1014         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1015         (-[WKContentView _lookupGestureRecognized:]):
1016         * UIProcess/ios/WebPageProxyIOS.mm:
1017         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
1018         * UIProcess/mac/WebPageProxyMac.mm:
1019         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
1020         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
1021         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1022         (WebKit::WebPage::performDictionaryLookupAtLocation):
1023         (WebKit::WebPage::performDictionaryLookupForSelection):
1024         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
1025         (WebKit::WebPage::performDictionaryLookupForRange):
1026         (WebKit::WebPage::dictionaryPopupInfoForRange):
1027         * WebProcess/WebPage/WebPage.messages.in:
1028         * WebProcess/WebPage/ios/WebPageIOS.mm:
1029         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
1030         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
1031         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
1032         * WebProcess/WebPage/mac/WebPageMac.mm:
1033         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
1034         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
1035         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
1036         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
1037         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
1038
1039 2018-11-29  Conrad Shultz  <conrad_shultz@apple.com>
1040
1041         Factor out configuration of the file upload image picker
1042         https://bugs.webkit.org/show_bug.cgi?id=192138
1043         <rdar://problem/46334871>
1044
1045         Reviewed by Tim Horton.
1046
1047         By factoring configuration of the picker into its own method, it makes it easier
1048         to apply custom configuration in subclasses in the future.
1049
1050         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1051         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
1052         (-[WKFileUploadPanel _configureImagePicker:]):
1053
1054 2018-11-29  Tomas Popela  <tpopela@redhat.com>
1055
1056         [GTK][WPE] Fix BubblewrapLauncher clang warnings
1057         https://bugs.webkit.org/show_bug.cgi?id=192086
1058
1059         Reviewed by Michael Catanzaro.
1060
1061         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1062         (WebKit::bindPathVar): Initialize the i variable to 0.
1063         (WebKit::setupSeccomp): Initialize the optional datum_b member.
1064
1065 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
1066
1067         Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
1068         https://bugs.webkit.org/show_bug.cgi?id=192016
1069         <rdar://problem/46284417>
1070
1071         Reviewed by Devin Rousso.
1072
1073         Previously calling the Page's inspectorController.show()
1074         would create a frontend connection on the WebProcess side.
1075         However now the frontend connection is handed to the WebProcess
1076         once the UIProcess creates it. So queue actions that take place
1077         immediately after showing the inspector until we have a frontend
1078         to send the actions to.
1079
1080         * WebProcess/WebPage/WebInspector.h:
1081         * WebProcess/WebPage/WebInspector.cpp:
1082         (WebKit::WebInspector::setFrontendConnection):
1083         (WebKit::WebInspector::closeFrontendConnection):
1084         (WebKit::WebInspector::whenFrontendConnectionEstablished):
1085         (WebKit::WebInspector::showConsole):
1086         (WebKit::WebInspector::showResources):
1087         (WebKit::WebInspector::showTimelines):
1088         (WebKit::WebInspector::showMainResourceForFrame):
1089         (WebKit::WebInspector::startPageProfiling):
1090         (WebKit::WebInspector::stopPageProfiling):
1091         (WebKit::WebInspector::startElementSelection):
1092         (WebKit::WebInspector::stopElementSelection):
1093
1094 2018-11-28  Vivek Seth  <v_seth@apple.com>
1095
1096         Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
1097         https://bugs.webkit.org/show_bug.cgi?id=192094
1098         <rdar://problem/45851103> HTTPS Upgrade: Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
1099
1100         Reviewed by Chris Dumez.
1101
1102         For main page loads upgrade HTTP requests to HTTPS if the hostname belongs to a set of upgradable hostnames.
1103
1104         * NetworkProcess/NetworkLoadChecker.cpp:
1105         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded):
1106         (WebKit::NetworkLoadChecker::checkRequest):
1107         * NetworkProcess/NetworkLoadChecker.h:
1108         * NetworkProcess/NetworkResourceLoader.cpp:
1109         (WebKit::NetworkResourceLoader::start):
1110
1111 2018-11-28  Simon Fraser  <simon.fraser@apple.com>
1112
1113         REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
1114         https://bugs.webkit.org/show_bug.cgi?id=192127
1115         rdar://problem/44194179
1116
1117         Reviewed by Tim Horton.
1118         
1119         _restorePageStateToUnobscuredCenter: could receive an Optional<FloatRect> from the
1120         web process, and unconditionally called .value() even though it may not be engaged.
1121         
1122         No repro steps known, so no testcase.
1123
1124         * UIProcess/API/Cocoa/WKWebView.mm:
1125         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
1126
1127 2018-11-28  Commit Queue  <commit-queue@webkit.org>
1128
1129         Unreviewed, rolling out r238653 and r238656.
1130         https://bugs.webkit.org/show_bug.cgi?id=192130
1131
1132         Breaks iOS build (Requested by smfr on #webkit).
1133
1134         Reverted changesets:
1135
1136         "Move Lookup Code for better cross platform usage"
1137         https://bugs.webkit.org/show_bug.cgi?id=191732
1138         https://trac.webkit.org/changeset/238653
1139
1140         "Attempt to fix the iOS build by only including RevealSPI.h
1141         when it's needed."
1142         https://trac.webkit.org/changeset/238656
1143
1144 2018-11-28  Alex Christensen  <achristensen@webkit.org>
1145
1146         Modernize BlobRegistry::writeBlobsToTemporaryFiles
1147         https://bugs.webkit.org/show_bug.cgi?id=192117
1148
1149         Reviewed by Dean Jackson.
1150
1151         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1152         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
1153         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
1154         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1155         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1156         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1157         * NetworkProcess/NetworkConnectionToWebProcess.h:
1158         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1159         * NetworkProcess/NetworkProcess.cpp:
1160         (WebKit::NetworkProcess::writeBlobToFilePath):
1161         * NetworkProcess/NetworkProcess.h:
1162         * NetworkProcess/NetworkProcess.messages.in:
1163         * UIProcess/ChildProcessProxy.h:
1164         (WebKit::ChildProcessProxy::sendWithAsyncReply):
1165         * UIProcess/Network/NetworkProcessProxy.cpp:
1166         (WebKit::NetworkProcessProxy::didClose):
1167         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
1168         (WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted.
1169         * UIProcess/Network/NetworkProcessProxy.h:
1170         * UIProcess/Network/NetworkProcessProxy.messages.in:
1171         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1172         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
1173         * WebProcess/FileAPI/BlobRegistryProxy.h:
1174         * WebProcess/Network/NetworkProcessConnection.cpp:
1175         (WebKit::NetworkProcessConnection::didClose):
1176         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
1177         (WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted.
1178         * WebProcess/Network/NetworkProcessConnection.h:
1179         * WebProcess/Network/NetworkProcessConnection.messages.in:
1180
1181 2018-11-28  Alex Christensen  <achristensen@webkit.org>
1182
1183         Move loadThrottleLatency from NetworkProcessCreationParameters to NetworkSessionCreationParameters
1184         https://bugs.webkit.org/show_bug.cgi?id=192122
1185
1186         Reviewed by Dean Jackson.
1187
1188         This is part of an effort to reduce global variables in the NetworkProcess.
1189
1190         * NetworkProcess/NetworkLoad.cpp:
1191         (WebKit::NetworkLoad::NetworkLoad):
1192         (WebKit::NetworkLoad::didReceiveResponse):
1193         * NetworkProcess/NetworkLoad.h:
1194         * NetworkProcess/NetworkProcess.cpp:
1195         (WebKit::NetworkProcess::initializeNetworkProcess):
1196         * NetworkProcess/NetworkProcess.h:
1197         (WebKit::NetworkProcess::loadThrottleLatency const): Deleted.
1198         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1199         (WebKit::NetworkProcessCreationParameters::encode const):
1200         (WebKit::NetworkProcessCreationParameters::decode):
1201         * NetworkProcess/NetworkSession.h:
1202         (WebKit::NetworkSession::loadThrottleLatency const):
1203         * NetworkProcess/NetworkSessionCreationParameters.cpp: Added.
1204         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
1205         (WebKit::NetworkSessionCreationParameters::encode const):
1206         (WebKit::NetworkSessionCreationParameters::decode):
1207         * NetworkProcess/NetworkSessionCreationParameters.h:
1208         (WebKit::NetworkSessionCreationParameters::encode const): Deleted.
1209         (WebKit::NetworkSessionCreationParameters::decode): Deleted.
1210         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1211         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1212         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1213         * Shared/WebsiteDataStoreParameters.cpp:
1214         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1215         * Sources.txt:
1216         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1217         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1218         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1219         (WebKit::WebsiteDataStore::parameters):
1220         * WebKit.xcodeproj/project.pbxproj:
1221
1222 2018-11-15  Megan Gardner  <megan_gardner@apple.com>
1223
1224         Move Lookup Code for better cross platform usage
1225         https://bugs.webkit.org/show_bug.cgi?id=191732
1226
1227         Reviewed by Alex Christensen.
1228
1229         Lookup is being replaced by Reveal. This framework should work on all platforms.
1230         The patch moves the code that we expect will be needed for all platforms to the more
1231         general cocoa area. This patch changes no funcationality, and should not change
1232         anything currently. This work will be build on later when Reveal is ready to support
1233         multiple platforms.
1234
1235         * Platform/spi/ios/UIKitSPI.h:
1236         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1237         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
1238         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
1239         * UIProcess/ios/WKContentViewInteraction.h:
1240         * UIProcess/ios/WKContentViewInteraction.mm:
1241         (-[WKContentView setupInteraction]):
1242         (-[WKContentView cleanupInteraction]):
1243         (-[WKContentView _removeDefaultGestureRecognizers]):
1244         (-[WKContentView _addDefaultGestureRecognizers]):
1245         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1246         (-[WKContentView _lookupGestureRecognized:]):
1247         * UIProcess/ios/WebPageProxyIOS.mm:
1248         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
1249         * UIProcess/mac/WebPageProxyMac.mm:
1250         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
1251         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
1252         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1253         (WebKit::WebPage::performDictionaryLookupAtLocation):
1254         (WebKit::WebPage::performDictionaryLookupForSelection):
1255         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
1256         (WebKit::WebPage::performDictionaryLookupForRange):
1257         (WebKit::WebPage::dictionaryPopupInfoForRange):
1258         * WebProcess/WebPage/WebPage.messages.in:
1259         * WebProcess/WebPage/ios/WebPageIOS.mm:
1260         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
1261         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
1262         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
1263         * WebProcess/WebPage/mac/WebPageMac.mm:
1264         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
1265         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
1266         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
1267         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
1268         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
1269
1270 2018-11-28  Keith Rollin  <krollin@apple.com>
1271
1272         Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
1273         https://bugs.webkit.org/show_bug.cgi?id=192031
1274         <rdar://problem/46286816>
1275
1276         Reviewed by Alex Christensen.
1277
1278         The Generate Derived Sources and Generate Unified Sources build phases
1279         in Xcode need to have their inputs and outputs specified. This
1280         specification will come in the form of .xcfilelist files that will be
1281         attached to these build phases. There is one .xcfilelist file that
1282         lists the input file and one that lists the output files. As part of
1283         this work, the various generate-{derived,unified}-sources scripts that
1284         are executed in these Generate build phases are modified to help in
1285         the creation of these .xcfilelist files. In particular, they can now
1286         be invoked with command-line parameters. These parameters are then
1287         used to alter the normal execution of these scripts, causing them to
1288         produce the .xcfilelist files as opposed to actually generating the
1289         files that are listed in those files.
1290
1291         * Scripts/generate-derived-sources.sh:
1292         * Scripts/generate-unified-sources.sh:
1293
1294 2018-11-28  Keith Rollin  <krollin@apple.com>
1295
1296         Revert print_all_generated_files work in r238008; tighten up target specifications
1297         https://bugs.webkit.org/show_bug.cgi?id=192025
1298         <rdar://problem/46284301>
1299
1300         Reviewed by Alex Christensen.
1301
1302         In r238008, I added a facility for DerivedSources.make makefiles to
1303         print out the list of files that they generate. This output was used
1304         in the generation of .xcfilelist files used to specify the output of
1305         the associated Generate Derived Sources build phases in Xcode. This
1306         approach worked, but it meant that people would need to follow a
1307         specific convention to keep this mechanism working.
1308
1309         Instead of continuing this approach, I'm going to implement a new
1310         facility based on the output of `make` when passed the -d flag (which
1311         prints dependency information). This new mechanism is completely
1312         automatic and doesn't need maintainers to follow a convention. To that
1313         end, remove most of the work performed in r238008 that supports the
1314         print_all_generated_files target.
1315
1316         At the same time, it's important for the sets of targets and their
1317         dependencies to be complete and correct. Therefore, also include
1318         changes to bring those up-to-date. As part of that, you'll see
1319         prevalent use of a particular technique. Here's an example:
1320
1321             BYTECODE_FILES = \
1322                 Bytecodes.h \
1323                 BytecodeIndices.h \
1324                 BytecodeStructs.h \
1325                 InitBytecodes.asm \
1326             #
1327             BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))
1328
1329             all : $(BYTECODE_FILES)
1330
1331             $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
1332                 ...
1333
1334         These lines indicate a set of generated files (those specified in
1335         BYTECODE_FILES). These files are generated by the BytecodeList.rb
1336         tool. But, as opposed to the normal rule where a single foo.output is
1337         generated by foo.input plus some additional dependencies, this rule
1338         produces multiple output files from a tool whose connection to the
1339         output files is not immediately clear. A special approach is needed
1340         where a single rule produces multiple output files. The normal way to
1341         implement this is to use an .INTERMEDIATE target. However, we used
1342         this approach in the past and ran into a problem with it, addressing
1343         it with an alternate approach in r210507. The above example shows this
1344         approach. The .'s in the list of target files are replaced with %'s,
1345         and the result is used as the left side of the dependency rule.
1346
1347         * DerivedSources.make:
1348
1349 2018-11-28  Daniel Bates  <dabates@apple.com>
1350
1351         [iOS] Page not defocused when Find-in-page becomes first responder
1352         https://bugs.webkit.org/show_bug.cgi?id=192084
1353         <rdar://problem/46146777>
1354
1355         Reviewed by Tim Horton.
1356
1357         When -becomeFirstResponder and -resignFirstResponder is called the page should become focused
1358         and defocused, respectively. WebKit adjusts it behavior depending on whether it knows it has
1359         focus. This includes decisions about whether to allow an element to be focused. We need to
1360         ensure that WebKit knows whether the web view is focused for it to make good decisions.
1361
1362         * UIProcess/ios/PageClientImplIOS.mm:
1363         (WebKit::PageClientImpl::isViewFocused): Check if the content view is the first responder and
1364         hence is accepting keyboard input. Note that picture-in-picture views do not accept keyboard
1365         input.
1366         * UIProcess/ios/WKContentViewInteraction.mm:
1367         (-[WKContentView becomeFirstResponderForWebView]): Update activity state when the view
1368         becomes focused.
1369         (-[WKContentView resignFirstResponderForWebView]): Update activity state when the view
1370         becomes defocused.
1371
1372 2018-11-28  Alex Christensen  <achristensen@webkit.org>
1373
1374         Remove dead code from an earlier attempt at implementing safe browsing
1375         https://bugs.webkit.org/show_bug.cgi?id=192067
1376
1377         Reviewed by Chris Dumez.
1378
1379         * Shared/LoadParameters.cpp:
1380         (WebKit::LoadParameters::encode const):
1381         (WebKit::LoadParameters::decode):
1382         * Shared/LoadParameters.h:
1383         * UIProcess/WebPageProxy.cpp:
1384         (WebKit::WebPageProxy::loadAlternateHTML):
1385         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
1386         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1387         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1388         * UIProcess/WebPageProxy.h:
1389         * UIProcess/WebPageProxy.messages.in:
1390         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1391         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1392         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1393
1394 2018-11-28  Alex Christensen  <achristensen@webkit.org>
1395
1396         Move logCookieInformation bool from NetworkProcess to NetworkSession
1397         https://bugs.webkit.org/show_bug.cgi?id=192049
1398
1399         Reviewed by Chris Dumez.
1400
1401         Part of an effort to remove globals in the NetworkProcess.
1402
1403         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1404         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1405         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
1406         * NetworkProcess/NetworkProcess.cpp:
1407         (WebKit::NetworkProcess::initializeNetworkProcess):
1408         * NetworkProcess/NetworkProcess.h:
1409         (WebKit::NetworkProcess::shouldLogCookieInformation const): Deleted.
1410         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1411         (WebKit::NetworkProcessCreationParameters::encode const):
1412         (WebKit::NetworkProcessCreationParameters::decode):
1413         * NetworkProcess/NetworkProcessCreationParameters.h:
1414         * NetworkProcess/NetworkResourceLoader.cpp:
1415         (WebKit::NetworkResourceLoader::didFinishLoading):
1416         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1417         (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
1418         (WebKit::NetworkResourceLoader::logCookieInformation const):
1419         (WebKit::logBlockedCookieInformation):
1420         (WebKit::logCookieInformationInternal):
1421         (WebKit::NetworkResourceLoader::logCookieInformation):
1422         * NetworkProcess/NetworkResourceLoader.h:
1423         * NetworkProcess/NetworkSession.h:
1424         (WebKit::NetworkSession::logCookieInformation const):
1425         * NetworkProcess/NetworkSessionCreationParameters.h:
1426         (WebKit::NetworkSessionCreationParameters::encode const):
1427         (WebKit::NetworkSessionCreationParameters::decode):
1428         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1429         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1430         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1431         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1432         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1433         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1434         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1435         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1436         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1437         (WebKit::WebsiteDataStore::parameters):
1438
1439 2018-11-28  Ryan Haddad  <ryanhaddad@apple.com>
1440
1441         Unreviewed, rolling out r238620.
1442
1443         Broke internal builds again.
1444
1445         Reverted changeset:
1446
1447         "Remove @no-unify of InjectedBundleRangeHandle.cpp and
1448         InjectedBundleNodeHandle.cpp"
1449         https://bugs.webkit.org/show_bug.cgi?id=191853
1450         https://trac.webkit.org/changeset/238620
1451
1452 2018-11-28  Yongjun Zhang  <yongjun_zhang@apple.com>
1453
1454         Allow WebKit clients to specify a minimum effective width for layout.
1455         https://bugs.webkit.org/show_bug.cgi?id=191499
1456         <rdar://problem/45362678>
1457
1458         Reviewed by Wenson Hsieh.
1459
1460         If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
1461         width. For clients that wish to lay out the content with a different width value, we would need to add a way
1462         to specify the effective width for layout.
1463
1464         * UIProcess/API/Cocoa/WKWebView.mm: Add an iVar _minimumEffectiveDeviceWidth.
1465         (-[WKWebView _dispatchSetViewLayoutSize:]): Call the new setViewportConfigurationViewLayoutSize method.
1466         (-[WKWebView _setViewScale:]): Ditto.
1467         (-[WKWebView _setMinimumEffectiveWidth:]): The setter for _minimumEffectiveDeviceWidth.
1468         (-[WKWebView _minimumEffectiveWidth]): Getter for _minimumEffectiveDeviceWidth
1469         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add a property _minimumEffectiveDeviceWidth to WKWebView.
1470         * UIProcess/WebPageProxy.h: Change setViewportConfigurationViewLayoutSize to take another argument minimumEffectiveDeviceWidth.
1471         * UIProcess/ios/WebPageProxyIOS.mm:
1472         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Also send effectiveWidth to WebContent process.
1473         * WebProcess/WebPage/WebPage.cpp:
1474         (WebKit::WebPage::WebPage): Set the initial effective width to 0 when creating a web page, this tells ViewportConfiguration
1475              to ignore the minimum effective width value.
1476         * WebProcess/WebPage/WebPage.h: Change setViewportConfigurationViewLayoutSize to take another argument effectiveWidth.
1477         * WebProcess/WebPage/WebPage.messages.in:
1478         * WebProcess/WebPage/ios/WebPageIOS.mm:
1479         (WebKit::WebPage::setViewportConfigurationViewLayoutSize): Also pass effectiveWidth value to ViewportConfiguration.
1480
1481 2018-11-28  Fujii Hironori  <Hironori.Fujii@sony.com>
1482
1483         Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
1484         https://bugs.webkit.org/show_bug.cgi?id=191853
1485
1486         Reviewed by Michael Catanzaro.
1487
1488         In r235845, I excluded InjectedBundleRangeHandle.cpp and
1489         InjectedBundleNodeHandle.cpp from unify source builds in order to
1490         work around a MSVC bug.
1491
1492         Then, I commited a different workaround for the MSVC bug in
1493         r238386. Now, we can include InjectedBundleRangeHandle.cpp and
1494         InjectedBundleNodeHandle.cpp in unified source builds. Revert
1495         r235845.
1496
1497         * Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp
1498         and InjectedBundleNodeHandle.cpp
1499         * WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership
1500         not to be compiled by XCode.
1501
1502 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
1503
1504         Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change doesn't re-show WebInspector
1505         https://bugs.webkit.org/show_bug.cgi?id=191971
1506
1507         Reviewed by Matt Baker.
1508
1509         * WebProcess/WebPage/WebInspector.cpp:
1510         (WebKit::WebInspector::reopen): Deleted.
1511         * WebProcess/WebPage/WebInspector.h:
1512         * WebProcess/WebPage/WebInspector.messages.in:
1513         Move reopen out of the WebProcess...
1514
1515         * UIProcess/WebInspectorProxy.cpp:
1516         (WebKit::WebInspectorProxy::reopen):
1517         * UIProcess/WebInspectorProxy.h:
1518         * UIProcess/WebInspectorProxy.messages.in:
1519         And into the UIProcess where the order of messages won't
1520         be as problematic.
1521
1522         * WebProcess/WebPage/WebInspectorUI.cpp:
1523         (WebKit::WebInspectorUI::reopen):
1524         Send a message to the WebInspectorProxy instead.
1525
1526 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
1527
1528         Remove another OS version check from NetworkDataTaskCocoa.mm
1529         https://bugs.webkit.org/show_bug.cgi?id=192046
1530
1531         Reviewed by Alex Christensen.
1532
1533         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1534         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
1535
1536 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
1537
1538         Modernize version checks for same site cookie support
1539         https://bugs.webkit.org/show_bug.cgi?id=192054
1540
1541         Reviewed by Tim Horton.
1542
1543         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
1544         Also removed runtime checks, which are no longer relevant.
1545
1546 2018-11-27  Mark Lam  <mark.lam@apple.com>
1547
1548         ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
1549         https://bugs.webkit.org/show_bug.cgi?id=192055
1550         <rdar://problem/46288783>
1551
1552         Reviewed by Saam Barati.
1553
1554         * Configurations/FeatureDefines.xcconfig:
1555
1556 2018-11-27  Alex Christensen  <achristensen@webkit.org>
1557
1558         Make synchronous IPC introduced in r237267 asynchronous
1559         https://bugs.webkit.org/show_bug.cgi?id=190757
1560
1561         Reviewed by Chris Dumez.
1562
1563         * UIProcess/API/Cocoa/WKProcessPool.mm:
1564         (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:completionHandler:]):
1565         (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:]): Deleted.
1566         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1567         * UIProcess/WebProcessPool.cpp:
1568         (WebKit::WebProcessPool::activePagesOriginsInWebProcessForTesting):
1569         * UIProcess/WebProcessPool.h:
1570         * UIProcess/WebProcessProxy.cpp:
1571         (WebKit::WebProcessProxy::activePagesDomainsForTesting):
1572         * UIProcess/WebProcessProxy.h:
1573         * WebProcess/WebProcess.cpp:
1574         (WebKit::WebProcess::getActivePagesOriginsForTesting):
1575         * WebProcess/WebProcess.messages.in:
1576         * WebProcess/cocoa/WebProcessCocoa.mm:
1577         (WebKit::WebProcess::getActivePagesOriginsForTesting):
1578
1579 2018-11-27  Alex Christensen  <achristensen@webkit.org>
1580
1581         Safe browsing warning text needs to be visible on High Sierra
1582         https://bugs.webkit.org/show_bug.cgi?id=192022
1583
1584         Reviewed by Tim Horton.
1585
1586         Something about AppKit, autolayout, view insertion order, and NSTextView makes the text lay
1587         out with initial size of {0, 0} on High Sierra. Using an NSTextField instead makes the details visible.
1588
1589         Covered by an API test.
1590
1591         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
1592         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1593         (makeLabel):
1594         (-[WKSafeBrowsingWarning addContent]):
1595         (-[WKSafeBrowsingWarning showDetailsClicked]):
1596         (-[WKSafeBrowsingWarning layoutText]):
1597         (makeTitleLabel): Deleted.
1598
1599 2018-11-27  Tim Horton  <timothy_horton@apple.com>
1600
1601         WKNavigation.AutomaticViewReloadAfterWebProcessCrash asserts after r238538
1602         https://bugs.webkit.org/show_bug.cgi?id=192038
1603         <rdar://problem/46288457>
1604
1605         Reviewed by Wenson Hsieh.
1606
1607         * UIProcess/WebPageProxy.cpp:
1608         (WebKit::m_resetRecentCrashCountTimer):
1609         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1610         (WebKit::WebPageProxy::resetState):
1611         (WebKit::m_editableImageController): Deleted.
1612         Properly invalidate m_editableImageController when resetting WebPageProxy.
1613         Otherwise, the MessageReceiverMaps get invalidated, then later when
1614         EditableImageController goes away we assert trying to remove the receiver.
1615
1616 2018-11-27  Jiewen Tan  <jiewen_tan@apple.com>
1617
1618         (r238246) [ MacOS Debug ] Layout Test http/wpt/webauthn/ctap-hid-failure.https.html is Crashing
1619         https://bugs.webkit.org/show_bug.cgi?id=191757
1620
1621         Reviewed by Chris Dumez.
1622
1623         Wrong nonce error causes retransmission, which then trigger wrong nonce error. This is expected
1624         behavior for mock testing. However, the main thread could time out when MockHidConnection::send
1625         is excuting the block on another thread. The block will then return without invoking the callback,
1626         which triggers this WTFCrash. The solution is always invoking the callback before return in the
1627         block.
1628
1629         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
1630         (WebKit::MockHidConnection::send):
1631
1632 2018-11-27  Keith Rollin  <krollin@apple.com>
1633
1634         Better parsing of comments in generate-message*.py
1635         https://bugs.webkit.org/show_bug.cgi?id=191866
1636         <rdar://problem/46189563>
1637
1638         Reviewed by Chris Dumez.
1639
1640         The script parsing the *.messages.in files would treat a line starting
1641         with '#' as a comment, but not a line starting with '<whitespace>#'.
1642         This means that jamming a '#' right in front of the first character of
1643         a message definition (as opposed to the beginning of a line) will have
1644         no effect and the line will get treated just the same as a
1645         non-commented line. Fix this by trimming all white space from the
1646         beginning and ending of the line before processing it.
1647
1648         * Scripts/webkit/parser.py:
1649         (parse):
1650         * Scripts/webkit/test-messages.in:
1651
1652 2018-11-27  Thibault Saunier  <tsaunier@igalia.com>
1653
1654         [GTK|WPE] Allow disabling WebRTC unified plan SDP through an env var
1655         https://bugs.webkit.org/show_bug.cgi?id=192024
1656
1657         Reviewed by Michael Catanzaro.
1658
1659         * UIProcess/API/glib/WebKitSettings.cpp:
1660         (webKitSettingsConstructed):
1661
1662 2018-11-27  Alexey Proskuryakov  <ap@apple.com>
1663
1664         Modernize the check for async _saveCookies existence
1665         https://bugs.webkit.org/show_bug.cgi?id=191987
1666
1667         Reviewed by Dean Jackson.
1668
1669         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1670         (WebKit::NetworkProcess::platformSyncAllCookies):
1671
1672 2018-11-27  Tim Horton  <timothy_horton@apple.com>
1673
1674         Serialize and deserialize editable image strokes
1675         https://bugs.webkit.org/show_bug.cgi?id=192002
1676         <rdar://problem/30900149>
1677
1678         Reviewed by Dean Jackson.
1679
1680         * UIProcess/API/APIAttachment.cpp:
1681         (API::Attachment::updateAttributes):
1682         * UIProcess/WebPageProxy.cpp:
1683         (WebKit::WebPageProxy::willUpdateAttachmentAttributes):
1684         * UIProcess/WebPageProxy.h:
1685         When an attachment would update its DOM attributes, plumb a notification
1686         to EditableImageController, and allow it to block the update (because
1687         we don't really want to set src for editable image attachments,
1688         we just want the UI process to fully own the data).
1689
1690         * Platform/spi/ios/PencilKitSPI.h:
1691         Add some SPI.
1692
1693         * UIProcess/ios/EditableImageController.h:
1694         * UIProcess/ios/EditableImageController.mm:
1695         (WebKit::EditableImageController::loadStrokesFromAttachment):
1696         Add a helper to load strokes from an attachment.
1697
1698         (WebKit::EditableImageController::associateWithAttachment):
1699         Try to load strokes from the attachment when initially associated.
1700         Don't create a file wrapper around a null image, so it will be regenerated later.
1701
1702         (WebKit::EditableImageController::willUpdateAttachmentAttributes):
1703         The aforementioned plumbing at update time.
1704
1705         * UIProcess/ios/WKDrawingView.h:
1706         * UIProcess/ios/WKDrawingView.mm:
1707         (-[WKDrawingView layoutSubviews]):
1708         Invalidate the attachment (so it will be regenerated upon request) if the
1709         canvas size changes.
1710
1711         (-[WKDrawingView PNGRepresentation]):
1712         Serialize strokes into the EXIF User Comment field.
1713         We will find a different field to use (ideally a custom vendor-specific
1714         field that nobody else will use for anything), but this works for now.
1715
1716         Don't try to render an image if we don't have a size or scale;
1717         PKImageRenderer will just fail anyway, so bail early.
1718
1719         In the iOS Simulator, PKImageRenderer currently returns an unusable image.
1720         Instead, so that we have a image on which to serialize the strokes,
1721         create a transparent 1x1 image. This makes it possible to serialize strokes
1722         even though we don't have a usable rendered image, so that we can still test
1723         this change (and future changes).
1724
1725         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
1726         If available, deserialize strokes from the EXIF User Comment field.
1727
1728         (-[WKDrawingView drawingDidChange:]):
1729         (-[WKDrawingView invalidateAttachment]):
1730         Factor invalidateAttachment out of drawingDidChange so we can call
1731         it from layoutSubviews too!
1732
1733 2018-11-27  Chris Dumez  <cdumez@apple.com>
1734
1735         Regression(PSON) crash under WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame()
1736         https://bugs.webkit.org/show_bug.cgi?id=191983
1737         <rdar://problem/46246863>
1738
1739         Reviewed by Geoffrey Garen.
1740
1741         * UIProcess/WebPageProxy.cpp:
1742         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1743         Make sure the navigation still exists in m_mainFrameCreationHandler and return early if it
1744         does not.
1745
1746         (WebKit::WebPageProxy::resetState):
1747         Clear out m_mainFrameCreationHandler / m_mainFrameWindowCreationHandler if we resetting the state
1748         after a crash. At this point, there is no chance the WebProcess will send us the IPC that will
1749         cause these to get called and we do not want old state to remain for future navigations.
1750
1751 2018-11-16  Jiewen Tan  <jiewen_tan@apple.com>
1752
1753         Disallow loading webarchives as iframes
1754         https://bugs.webkit.org/show_bug.cgi?id=191728
1755         <rdar://problem/45524528>
1756
1757         Reviewed by Youenn Fablet.
1758
1759         * UIProcess/WebPageProxy.cpp:
1760         (WebKit::WebPageProxy::unableToImplementPolicy):
1761         Add a check to prevent null pointer dereference.
1762
1763 2018-11-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1764
1765         WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
1766         https://bugs.webkit.org/show_bug.cgi?id=191996
1767
1768         Reviewed by Tim Horton.
1769
1770         This assertion is hit because `decode(Decoder& decoder, NSArray<Class> *allowedClasses)` expects the decoded
1771         object (of class `_NSArrayM`) to be equal to `NSArray.class`.
1772
1773         We fix the crash by relaxing the debug assertion when decoding securely-codable objects over IPC. Instead of
1774         checking that the class of the decoded object is equal to one of the allowed classes, check that the object is a
1775         kind of any of the allowed classes.
1776
1777         * Shared/Cocoa/ArgumentCodersCocoa.h:
1778         (IPC::isObjectClassAllowed):
1779         (IPC::decode):
1780
1781 2018-11-27  Tomas Popela  <tpopela@redhat.com>
1782
1783         [GTK][WPE] Remove temporary workaround in Source/WebKit/Platform*.cmake
1784         https://bugs.webkit.org/show_bug.cgi?id=192008
1785
1786         Reviewed by Michael Catanzaro.
1787
1788         Looks like it's not needed anymore as the code compiles fine without
1789         it.
1790
1791         * PlatformGTK.cmake:
1792         * PlatformWPE.cmake:
1793
1794 2018-11-27  Antti Koivisto  <antti@apple.com>
1795
1796         Factor mask layer applying in RemoteLayerTreePropertyApplier into a shared function
1797         https://bugs.webkit.org/show_bug.cgi?id=192001
1798
1799         Reviewed by Tim Horton.
1800
1801         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
1802         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1803         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1804         (WebKit::RemoteLayerTreePropertyApplier::updateMask):
1805
1806         Shared function, with some special tricks for iOS backdrop layers.
1807
1808         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
1809
1810 2018-11-27  Antti Koivisto  <antti@apple.com>
1811
1812         Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree
1813         https://bugs.webkit.org/show_bug.cgi?id=192003
1814
1815         Reviewed by Tim Horton.
1816
1817         We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem
1818         to add anything except an extra hash lookup.
1819
1820         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
1821         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1822         (WebKit::RemoteLayerTreeHost::updateLayerTree):
1823
1824         Pass m_nodes directly.
1825         Some random cleanups.
1826
1827 2018-11-27  Antti Koivisto  <antti@apple.com>
1828
1829         Remote tile layers shouldn't be UIViews
1830         https://bugs.webkit.org/show_bug.cgi?id=191953
1831
1832         Reviewed by Tim Horton.
1833
1834         They don't need any UIView functionality, nor do they ever have UIView descendants.
1835         We can use lighter weight objects.
1836
1837         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
1838         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1839         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1840         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
1841
1842         Factor to a function shared between platforms.
1843         Support having both views and plain layers in the same tree.
1844         Assert that all siblings are of the same type and that we don't attempt to add views to layers.
1845
1846         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
1847         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1848         (WebKit::RemoteLayerTreeHost::makeNode):
1849
1850         Use new plain layer on Mac too.
1851
1852         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
1853         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
1854         (-[WKPlainRemoteLayer description]):
1855
1856         Add a CALayer subclass so we can have a description, similar to WKCompositingView and pals.
1857
1858         (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
1859         (WebKit::RemoteLayerTreeNode::detachFromParent):
1860
1861         Support having null view.
1862
1863         (WebKit::RemoteLayerTreeNode::appendLayerDescription):
1864
1865         Helper for layer descriptions.
1866
1867         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1868         (WebKit::RemoteLayerTreeHost::makeNode):
1869
1870         Construct plain layers for tiles.
1871
1872         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
1873         (-[WKCompositingView description]):
1874         (-[WKUIRemoteView description]):
1875         (-[WKBackdropView description]):
1876
1877 2018-11-27  Fujii Hironori  <Hironori.Fujii@sony.com>
1878
1879         Remove "using namespace WebCore" under Source/WebKit/WebProcess/InjectedBundle/API
1880         https://bugs.webkit.org/show_bug.cgi?id=191995
1881
1882         Reviewed by Alex Christensen.
1883
1884         The statement "using namespace WebCore" should be placed inside
1885         namespace WebKit for unified source builds. But, source files
1886         defining WebKit API can't be enclosed by namespace WebKit { }
1887         becuase they are defined in the global scope.
1888
1889         "using namespace WebCore" in global scope and unified source
1890         builds may cause build breaks (Bug 191853).
1891
1892         Remove "using namespace WebCore" in the global scope. Use
1893         "WebCore::" prefix instead.
1894
1895         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1896         (WKBundleClearAllDatabases):
1897         (WKBundleSetDatabaseQuota):
1898         (WKBundleClearResourceLoadStatistics):
1899         (WKBundleResourceLoadStatisticsNotifyObserver):
1900         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1901         (WKBundleFrameGetFrameLoadState):
1902         (WKBundleFrameClearOpener):
1903         (WKBundleFrameCallShouldCloseOnWebView):
1904         (WKBundleFrameCopySecurityOrigin):
1905         (WKBundleFrameFocus):
1906         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
1907         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1908
1909 2018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1910
1911         [Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
1912         https://bugs.webkit.org/show_bug.cgi?id=169212
1913         <rdar://problem/30899656>
1914
1915         Reviewed by Tim Horton.
1916
1917         Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the
1918         first responder. Intended for use by clients, such as Mail, that embed native text input views and other views
1919         that may become first responder within the view hierarchy of the WKWebView.
1920
1921         * UIProcess/API/Cocoa/WKWebView.mm:
1922         (-[WKWebView _contentViewIsFirstResponder]):
1923         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1924
1925 2018-11-26  Tim Horton  <timothy_horton@apple.com>
1926
1927         Insert <attachment> elements under editable images to make their backing data accessible
1928         https://bugs.webkit.org/show_bug.cgi?id=191844
1929         <rdar://problem/30900149>
1930
1931         Reviewed by Simon Fraser.
1932
1933         * DerivedSources.make:
1934         * SourcesCocoa.txt:
1935         * UIProcess/API/APIAttachment.h:
1936         fileWrapper() is no longer a trivial getter; it can now construct
1937         the file wrapper from a file wrapper generator if necessary.
1938
1939         Add setFileWrapperGenerator() and invalidateGeneratedFileWrapper().
1940
1941         Make m_fileWrapper mutable so it can be adjusted inside its own getter.
1942
1943         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
1944         (API::Attachment::fileWrapper const):
1945         If we have a fileWrapperGenerator and don't have a cached file wrapper,
1946         create one before returning it.
1947
1948         (API::Attachment::invalidateGeneratedFileWrapper):
1949         Invalidate the currently-cached file wrapper. The next time a client
1950         requests the file wrapper it will be regenerated.
1951
1952         (API::Attachment::fileName const):
1953         (API::Attachment::fileSizeForDisplay const):
1954         (API::Attachment::enclosingImageData const):
1955         (API::Attachment::isEmpty const):
1956         (API::Attachment::createSerializedRepresentation const):
1957         Make use of fileWrapper() instead of m_fileWrapper directly, to ensure
1958         that it is created lazily if necessary.
1959
1960         (API::Attachment::setFileWrapperGenerator):
1961         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1962         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
1963         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
1964         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
1965         (-[WKEmbeddedView initWithEmbeddedViewID:]):
1966         Defer to EditableImageController for creating WKDrawingViews for
1967         editable images. This is done primarily so we don't have to pollute
1968         Remote Layer Tree and DrawingArea interfaces with editable-image-specific messages.
1969
1970         * UIProcess/WebPageProxy.cpp:
1971         (WebKit::m_editableImageController):
1972         (WebKit::m_resetRecentCrashCountTimer): Deleted.
1973         * UIProcess/WebPageProxy.h:
1974         (WebKit::WebPageProxy::editableImageController):
1975         Keep an EditableImageController on the WebPageProxy.
1976
1977         * UIProcess/ios/EditableImageController.h: Added.
1978         * UIProcess/ios/EditableImageController.messages.in: Added.
1979         * UIProcess/ios/EditableImageController.mm: Added.
1980         (WebKit::EditableImageController::EditableImageController):
1981         (WebKit::EditableImageController::~EditableImageController):
1982         (WebKit::EditableImageController::ensureEditableImage):
1983         (WebKit::EditableImageController::editableImage):
1984         (WebKit::EditableImageController::didCreateEditableImage):
1985         (WebKit::EditableImageController::didDestroyEditableImage):
1986         (WebKit::EditableImageController::associateWithAttachment):
1987         (WebKit::EditableImageController::invalidateAttachmentForEditableImage):
1988         Add EditableImageController, which keeps track of EditableImages.
1989         It can be messaged directly to create or destroy the UI-side state
1990         of an editable image, and also to associate a WKDrawingView with
1991         a particular attachment.
1992
1993         * UIProcess/ios/WKDrawingView.h:
1994         * UIProcess/ios/WKDrawingView.mm:
1995         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
1996         Store the WebPageProxy (weakly) so that we can get to the EditableImageController.
1997
1998         (-[WKDrawingView layoutSubviews]):
1999         (-[WKDrawingView PNGRepresentation]):
2000         Synchronously render the PKCanvasView to PNG.
2001
2002         (-[WKDrawingView drawingDidChange:]):
2003         If the drawing changes, inform the APIAttachment that it needs
2004         to discard its NSFileWrapper; a new one will be generated lazily.
2005
2006         (-[WKDrawingView init]): Deleted.
2007         * WebKit.xcodeproj/project.pbxproj:
2008         * WebProcess/WebCoreSupport/WebChromeClient.h:
2009         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2010         (WebKit::WebChromeClient::associateEditableImageWithAttachment):
2011         (WebKit::WebChromeClient::didCreateEditableImage):
2012         (WebKit::WebChromeClient::didDestroyEditableImage):
2013
2014 2018-11-26  Jer Noble  <jer.noble@apple.com>
2015
2016         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
2017         https://bugs.webkit.org/show_bug.cgi?id=190951
2018         <rdar://problem/45213065>
2019
2020         Reviewed by Alex Christensen.
2021
2022         Add an asyncronous reply request to VideoFullscreenManager.
2023
2024         * Platform/IPC/MessageSender.h:
2025         (IPC::MessageSender::sendWithAsyncReply):
2026         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2027         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2028         (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
2029         * WebProcess/cocoa/VideoFullscreenManager.h:
2030         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
2031         * WebProcess/cocoa/VideoFullscreenManager.mm:
2032         (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
2033
2034 2018-11-26  Alex Christensen  <achristensen@webkit.org>
2035
2036         Rename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it for more than testing
2037         https://bugs.webkit.org/show_bug.cgi?id=191981
2038
2039         Reviewed by Tim Horton.
2040
2041         * UIProcess/API/Cocoa/WKWebView.mm:
2042         (-[WKWebView _safeBrowsingWarning]):
2043         (-[WKWebView _safeBrowsingWarningForTesting]): Deleted.
2044         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2045
2046 2018-11-26  Daniel Bates  <dabates@apple.com>
2047
2048         REGRESSION (r237738): Command Down Arrow doesn't scroll to the end of a page anymore
2049         https://bugs.webkit.org/show_bug.cgi?id=191967
2050         <rdar://problem/45976390>
2051
2052         Reviewed by Tim Horton.
2053
2054         Fixes an issue where pressing Command + Down Arrow does not scroll the view to the end of the page.
2055
2056         Following r237738 the value of the enumerations used to identify modifier keys (e.g. Shift) changed
2057         to match the values of the corresponding enumerations in GraphicsServices, which are the
2058         enumerations UIKit uses to computes the modifier flags bitmask when instantiating a WebEvent to
2059         pass to WebKit. Before r237738 WebKit was using enumerations whose values matched the values
2060         of the corresponding UIKit public API UIKeyModifier* enumerations. For non-content editable elements,
2061         WebKit intercepts UIKit events in -_handleKeyUIEvent, synthesizes and dispatches its own WebEvent.
2062         However it was creating WebEvents with a modifier flags bitmask built from the UIKeyModifier* enumerations,
2063         -_modifierFlags, as opposed to a bitmask from the GraphicsServices enumerations, -_gsModifierFlags.
2064         Instead WebKit should call -_gsModifierFlags to compute the GraphicsServices-compatible modifier
2065         flags bitmask when instantiating a WebEvent.
2066
2067         * Platform/spi/ios/UIKitSPI.h: Expose -_gsModifierFlags and remove -_modifierFlags.
2068         * UIProcess/ios/WKContentViewInteraction.mm:
2069         (-[WKContentView _handleKeyUIEvent:]): Remove unnecessary code to update the current modifier state.
2070         This will be done by the WebProcess when it receives the keyboard event.
2071         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Do not pass modifier flags changed events
2072         to the scrolling animator as it does not know how to handle these kinds of events and triggers an
2073         assertion failure when it tries to read the input string from the event (calls -charactersIgnoringModifiers).
2074         FlagsChanged WebEvents events do not have an input string just like a FlagsChanged NSEvent that
2075         they model on Mac.
2076         * UIProcess/ios/WKWebEvent.mm:
2077         (-[WKWebEvent initWithEvent:]): Pass the value of -_gsModifierFlags for the modifier flags bitmask
2078         instead of the value of -_modifierFlags.
2079
2080 2018-11-26  Chris Dumez  <cdumez@apple.com>
2081
2082         [PSON] process pre-warming should not be on for everyone
2083         https://bugs.webkit.org/show_bug.cgi?id=191966
2084         <rdar://problem/46138499>
2085
2086         Reviewed by Ryosuke Niwa.
2087
2088         If automatic process-prewarming is not explicitly turned on/off by the client, then we now only
2089         turn it on automatically after the first process swap. Previously, it was always enabled if
2090         process-swap on cross-site navigation was enabled (which is the case by default for all apps).
2091
2092         This is important because some apps do not actually browse (only display static content) or never
2093         browse cross-site, and thus would not benefit from process prewarming and yet pay a memory cost.
2094
2095         * UIProcess/API/APIProcessPoolConfiguration.h:
2096         Add m_clientWouldBenefitFromAutomaticProcessPrewarming flag which is false by default and is used
2097         as a fallback if the client did not call setIsAutomaticProcessWarmingEnabled().
2098
2099         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2100         (WKContextConfigurationPrewarmsProcessesAutomatically):
2101         (WKContextConfigurationSetPrewarmsProcessesAutomatically):
2102         Add C API to toggle automatic process prewarming. It is needed for Safari to turn on this feature
2103         by default for browsing. This way Safari does not have to wait for the first process swap to
2104         start prewarming.
2105
2106         * UIProcess/API/C/WKContextConfigurationRef.h:
2107         * UIProcess/WebProcessPool.cpp:
2108         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
2109         Only do automatic process prewarming if process-swap on cross-site navigation is also enabled.
2110         This is needed for clients like Safari that explicitly enable automatic process prewarming but
2111         only want to have it enabled if PSON is also enabled via experimental features.
2112
2113         (WebKit::WebProcessPool::processForNavigation):
2114         On first process swap, if the client did not explicitly turn on or off automatic process prewarming
2115         then we enable it then. This avoids paying the cost of process prewarming in apps that would not
2116         benefit from it.
2117
2118 2018-11-26  Andy Estes  <aestes@apple.com>
2119
2120         [Cocoa] Make it easier to encode NSObjects
2121         https://bugs.webkit.org/show_bug.cgi?id=191948
2122
2123         Reviewed by Dean Jackson.
2124
2125         It should be easier to encode objects that conform to NSSecureCoding for WebKit IPC. Right
2126         now, several argument coders duplicate the logic for encoding and decoding objects using
2127         NSKeyedArchiver and NSKeyedUnarchiver.
2128
2129         This patch adds encodeObject() and decodeObject() primitives for encoding and decoding using
2130         Foundation keyed archiving. It then partially specializes ArgumentCoder for raw pointers and
2131         RetainPtrs whose pointee conforms to NSSecureCoding to call these new primitives.
2132
2133         This allows us to use Encoder::operator<< to encode raw pointers or RetainPtrs and use
2134         Decoder::operator>> to decode to an optional RetainPtr. By default, IPC::decode infers the
2135         allowed class for decoding by calling `[T class]`. We can also specify the allowed classes
2136         explicitly for containers and classes that are loaded at runtime.
2137
2138         * Shared/Cocoa/ArgumentCodersCocoa.h: Added.
2139         * Shared/Cocoa/ArgumentCodersCocoa.mm: Added.
2140         * Shared/Cocoa/DataDetectionResult.mm:
2141         (WebKit::DataDetectionResult::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
2142         (WebKit::DataDetectionResult::decode): Ditto.
2143         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2144         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
2145         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
2146         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode): Ditto.
2147         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
2148         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
2149         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
2150         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
2151         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
2152         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
2153         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode): Ditto.
2154         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2155         (WebKit::RemoteLayerTreeTransaction::description const): Added some needed namespaces due to unified source shuffling.
2156         * Shared/WebCoreArgumentCoders.h: Modernized several decoders.
2157         * Shared/ios/InteractionInformationAtPosition.mm:
2158         (WebKit::InteractionInformationAtPosition::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
2159         (WebKit::InteractionInformationAtPosition::decode): Ditto.
2160         * Shared/mac/WebCoreArgumentCodersMac.mm:
2161         (IPC::ArgumentCoder<WebCore::ProtectionSpace>::encodePlatformData): Ditto.
2162         (IPC::ArgumentCoder<WebCore::ProtectionSpace>::decodePlatformData): Ditto.
2163         (IPC::ArgumentCoder<WebCore::Credential>::encodePlatformData): Ditto.
2164         (IPC::ArgumentCoder<WebCore::Credential>::decodePlatformData): Ditto.
2165         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData): Ditto.
2166         (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData): Ditto.
2167         (IPC::deviceContextKey): Deleted.
2168         * Shared/mac/WebHitTestResultData.mm:
2169         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
2170         (WebKit::WebHitTestResultData::platformDecode): Ditto.
2171         * SourcesCocoa.txt: Added ArgumentCodersCocoa.mm.
2172         * WebKit.xcodeproj/project.pbxproj: Ditto.
2173
2174 2018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2175
2176         CompletionHandler-based async IPC messages only work when the completion handler takes a single argument
2177         https://bugs.webkit.org/show_bug.cgi?id=191965
2178
2179         Reviewed by Tim Horton.
2180
2181         Teach `messages.py` to handle the case where an async IPC completion handler takes no arguments, or takes more
2182         than a single argument. Currently, the generated code attempts to wrap all arguments in a `WTFMove(*~)`, but
2183         this either results in `WTFMove(*)` in the case where there are no arguments, or `WTFMove(*foo, *bar, *baz)` in
2184         the case where there are several arguments. Both of these results fail to compile.
2185
2186         Instead, emit `completionHandler()` when there are no arguments, and
2187         `completionHandler(WTFMove(*foo), WTFMove(*bar), WTFMove(*baz))` when there are multiple arguments.
2188
2189         Tests:  TestAsyncMessageWithNoArguments
2190                 TestAsyncMessageWithMultipleArguments
2191
2192         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
2193         (Messages::WebPage::TestAsyncMessageWithNoArguments::callReply):
2194         (Messages::WebPage::TestAsyncMessageWithNoArguments::cancelReply):
2195         (Messages::WebPage::TestAsyncMessageWithNoArguments::send):
2196         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
2197         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
2198         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::send):
2199         (WebKit::WebPage::didReceiveMessage):
2200         * Scripts/webkit/MessagesSuperclass-expected.h:
2201         (Messages::WebPage::TestAsyncMessageWithNoArguments::receiverName):
2202         (Messages::WebPage::TestAsyncMessageWithNoArguments::name):
2203         (Messages::WebPage::TestAsyncMessageWithNoArguments::asyncMessageReplyName):
2204         (Messages::WebPage::TestAsyncMessageWithNoArguments::arguments const):
2205         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::receiverName):
2206         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::name):
2207         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::asyncMessageReplyName):
2208         (Messages::WebPage::TestAsyncMessageWithMultipleArguments::arguments const):
2209         * Scripts/webkit/messages.py:
2210         * Scripts/webkit/messages_unittest.py:
2211
2212         Add new `messages.py` unit tests to cover these cases.
2213
2214         * Scripts/webkit/test-superclass-messages.in:
2215
2216 2018-11-26  Jeremy Jones  <jeremyj@apple.com>
2217
2218         Use Full Screen consistently in localizable strings.
2219         https://bugs.webkit.org/show_bug.cgi?id=190363
2220         rdar://problem/43882333
2221
2222         Reviewed by Jon Lee.
2223
2224         Rename "Fullscreen" to "Full Screen" in localizable strings for consistency.
2225
2226         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2227         (-[WKFullScreenViewController _showPhishingAlert]):
2228
2229 2018-11-26  Daniel Bates  <dabates@apple.com>
2230
2231         Wire up ChromeClient::takeFocus() on iOS
2232         https://bugs.webkit.org/show_bug.cgi?id=191763
2233         <rdar://problem/18584508>
2234
2235         Reviewed by Dan Bernstein.
2236
2237         Expose existing Mac SPI for use on iOS. This will allow Safari to be notified when
2238         the engine has cycled through all the tab focusable elements on the page.
2239
2240         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2241         * UIProcess/Cocoa/UIDelegate.h:
2242         * UIProcess/Cocoa/UIDelegate.mm:
2243         (WebKit::UIDelegate::setDelegate):
2244
2245 2018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2246
2247         Unreviewed, fix the internal 32-bit macOS 10.13 build after r238471
2248
2249         r238471 added an `#include WebPageMessages.h` in `WebPage.h`, which causes the 32-bit macOS build using an
2250         internal macOS SDK ≤ 10.13 to fail. To address this, move the `#include` back under `PLATFORM(IOS_FAMILY)` by
2251         changing the parameters of `WebPage::removeDataDetectedLinks` and `WebPage::detectDataInAllFrames` to completion
2252         handlers rather than async IPC replies.
2253
2254         * WebProcess/WebPage/WebPage.cpp:
2255         (WebKit::WebPage::removeDataDetectedLinks):
2256         (WebKit::WebPage::detectDataInAllFrames):
2257         * WebProcess/WebPage/WebPage.h:
2258
2259 2018-11-26  Antti Koivisto  <antti@apple.com>
2260
2261         Clean up layer tree freezing logic in WebPage
2262         https://bugs.webkit.org/show_bug.cgi?id=191826
2263
2264         Reviewed by Dean Jackson.
2265
2266         Use OptionSet<LayerTreeFreezeReason> to track various reasons that can cause layer tree to get frozen.
2267
2268         * WebProcess/WebPage/WebPage.cpp:
2269         (WebKit::WebPage::reinitializeWebPage):
2270         (WebKit::WebPage::freezeLayerTree):
2271         (WebKit::WebPage::unfreezeLayerTree):
2272         (WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):
2273
2274         Layer tree is unfrozen when there there are no reasons to freeze it.
2275
2276         (WebKit::WebPage::didStartPageTransition):
2277         (WebKit::WebPage::didCompletePageTransition):
2278         (WebKit::WebPage::beginPrinting):
2279         (WebKit::WebPage::endPrinting):
2280         (WebKit::WebPage::setIsSuspended):
2281         (WebKit::WebPage::setLayerTreeStateIsFrozen): Deleted.
2282         * WebProcess/WebPage/WebPage.h:
2283         * WebProcess/WebPage/ios/WebPageIOS.mm:
2284         (WebKit::WebPage::applicationDidEnterBackground):
2285         (WebKit::WebPage::applicationWillEnterForeground):
2286         * WebProcess/WebProcess.cpp:
2287         (WebKit::WebProcess::actualPrepareToSuspend):
2288         (WebKit::WebProcess::cancelPrepareToSuspend):
2289         (WebKit::WebProcess::freezeAllLayerTrees):
2290         (WebKit::WebProcess::unfreezeAllLayerTrees):
2291         (WebKit::WebProcess::processDidResume):
2292         (WebKit::WebProcess::setAllLayerTreeStatesFrozen): Deleted.
2293         * WebProcess/WebProcess.h:
2294
2295 2018-11-25  Antti Koivisto  <antti@apple.com>
2296
2297         RemoteLayerTreeNode construction cleanups
2298         https://bugs.webkit.org/show_bug.cgi?id=191951
2299
2300         Reviewed by Tim Horton.
2301
2302         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
2303         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2304         (WebKit::RemoteLayerTreeHost::updateLayerTree):
2305
2306             Drop unused LayerProperties argument.
2307
2308         (WebKit::RemoteLayerTreeHost::createLayer):
2309
2310             Split the actual construction out to makeNode.
2311             Map updating is shared between platforms.
2312             Move setting of layerID and clearing default actions to RemoteLayerTreeNode.
2313
2314         (WebKit::RemoteLayerTreeHost::makeNode):
2315
2316             Returns RemoteLayerTreeNode.
2317
2318         (WebKit::RemoteLayerTreeHost::setLayerID): Deleted.
2319         (WebKit::RemoteLayerTreeHost::layerID): Deleted.
2320
2321             Move to RemoteLayerTreeNode.
2322
2323         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
2324         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
2325         (WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
2326         (WebKit::RemoteLayerTreeNode::setLayerID):
2327         (WebKit::RemoteLayerTreeNode::layerID):
2328         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2329         (WebKit::RemoteLayerTreeHost::makeNode):
2330         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
2331         (WebKit::RemoteLayerTreeHost::createLayer): Deleted.
2332         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2333         (-[WKCompositingView description]):
2334         (-[WKUIRemoteView description]):
2335         (-[WKBackdropView description]):
2336         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2337         (WebKit::addAnimationToLayer):
2338
2339 2018-11-25  Tim Horton  <timothy_horton@apple.com>
2340
2341         Make it possible to insert editable images with a gesture
2342         https://bugs.webkit.org/show_bug.cgi?id=191937
2343
2344         Reviewed by Wenson Hsieh.
2345
2346         * UIProcess/API/Cocoa/WKWebView.mm:
2347         (-[WKWebView _stylusTapGestureShouldCreateEditableImage]):
2348         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2349         Add a internal getter for a WKWebViewConfiguration property.
2350
2351         * UIProcess/WebEditCommandProxy.cpp:
2352         (WebKit::WebEditCommandProxy::nameForEditAction):
2353         Add a undo name.
2354
2355         * UIProcess/WebPageProxy.h:
2356         * UIProcess/ios/WKContentViewInteraction.h:
2357         * UIProcess/ios/WKContentViewInteraction.mm:
2358         (-[WKContentView setupInteraction]):
2359         (-[WKContentView cleanupInteraction]):
2360         (-[WKContentView _removeDefaultGestureRecognizers]):
2361         (-[WKContentView _addDefaultGestureRecognizers]):
2362         Add a single-stylus-tap gesture recognizer.
2363
2364         (-[WKContentView _stylusSingleTapRecognized:]):
2365         If allowed, request to insert an editable image when a stylus tap occurs.
2366
2367         * UIProcess/ios/WebPageProxyIOS.mm:
2368         (WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
2369         * WebProcess/WebPage/WebPage.h:
2370         * WebProcess/WebPage/WebPage.messages.in:
2371         * WebProcess/WebPage/ios/WebPageIOS.mm:
2372         (WebKit::WebPage::handleStylusSingleTapAtPoint):
2373         Do a hit test, select the hit position, insert an editable image, and
2374         then de-assist any assisted node (to make the keyboard go away).
2375         For now, we'll only insert if we hit non-replaced elements,
2376         though this heuristic will need to be enhanced significantly once we
2377         decide on a design.
2378
2379 2018-11-25  Tim Horton  <timothy_horton@apple.com>
2380
2381         Scrolling and drawing compete for incoming gestures
2382         https://bugs.webkit.org/show_bug.cgi?id=191940
2383
2384         Reviewed by Wenson Hsieh.
2385
2386         * Platform/spi/ios/PencilKitSPI.h:
2387         * UIProcess/API/Cocoa/WKWebView.mm:
2388         (-[WKWebView _initializeWithConfiguration:]):
2389         * UIProcess/ios/WKDrawingView.mm:
2390         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
2391         Make scrolling and drawing mutually exclusive if editable images
2392         are enabled.
2393
2394 2018-11-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2395
2396         [Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm
2397         https://bugs.webkit.org/show_bug.cgi?id=191945
2398
2399         Reviewed by Anders Carlsson.
2400
2401         Replace some a couple of command undo action name descriptions with "Undo action name", to match all other
2402         edit commands.
2403
2404         * UIProcess/WebEditCommandProxy.cpp:
2405         (WebKit::WebEditCommandProxy::nameForEditAction):
2406
2407 2018-11-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2408
2409         [Cocoa] Add WKWebView SPI to trigger and remove data detection
2410         https://bugs.webkit.org/show_bug.cgi?id=191918
2411         <rdar://problem/36185051>
2412
2413         Reviewed by Tim Horton.
2414
2415         Adds support for two new WKWebView SPI methods, `-_detectDataWithTypes:completionHandler:` and
2416         `-_removeAllDataDetectedLinks:`, to allow internal WebKit clients to run data detection and add links to data
2417         detected content, or remove all data detected links from the document.
2418
2419         Test: WebKit.AddAndRemoveDataDetectors
2420
2421         * Shared/Cocoa/DataDetectionResult.h:
2422         * Shared/Cocoa/DataDetectionResult.mm:
2423         (WebKit::DataDetectionResult::decode):
2424
2425         Modernize DataDetectionResult's IPC decoding, so that it can be used with reply-based async IPC.
2426
2427         * UIProcess/API/Cocoa/WKWebView.mm:
2428         (-[WKWebView _removeDataDetectedLinks:]):
2429         (-[WKWebView _detectDataWithTypes:completionHandler:]):
2430         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2431         * UIProcess/WebPageProxy.cpp:
2432         (WebKit::WebPageProxy::detectDataInAllFrames):
2433         (WebKit::WebPageProxy::removeDataDetectedLinks):
2434
2435         Add or remove data detected links from each frame in the page, and then propagate the new data detector
2436         results of the main frame to the UI process (this matches current behavior, where the results of -[WKWebView
2437         _dataDetectionResults] only reflects data detection results in the main frame of the page).
2438
2439         * UIProcess/WebPageProxy.h:
2440         * WebProcess/WebPage/WebPage.cpp:
2441         (WebKit::WebPage::removeDataDetectedLinks):
2442         (WebKit::WebPage::detectDataInAllFrames):
2443         * WebProcess/WebPage/WebPage.h:
2444         * WebProcess/WebPage/WebPage.messages.in:
2445
2446 2018-11-24  Andy Estes  <aestes@apple.com>
2447
2448         [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
2449         https://bugs.webkit.org/show_bug.cgi?id=191899
2450
2451         Reviewed by Dean Jackson.
2452
2453         * Shared/cocoa/WebCoreArgumentCodersCocoa.mm:
2454         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2455         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2456
2457 2018-11-23  Antti Koivisto  <antti@apple.com>
2458
2459         Replace LayerOrView typedef with a class
2460         https://bugs.webkit.org/show_bug.cgi?id=191927
2461
2462         Reviewed by Tim Horton.
2463
2464         This typedef restricts remote layer representation to be either a CA layer or a view. We might want
2465         have more flexibility, for example tiles don't really need to be UIViews. It will also make it easier
2466         to unify Mac and iOS code, and hopefully make it less confusing too.
2467
2468         This patch introduces RemoteLayerTreeNode class that replaces most uses of LayerOrView typedef
2469         (the rest are converted to pure CALayer). It also does a bunch of related cleanup.
2470
2471         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
2472         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
2473         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
2474         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
2475         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
2476         (WebKit::applyPropertiesToLayer): Deleted.
2477         * SourcesCocoa.txt:
2478         * UIProcess/API/Cocoa/WKWebView.mm:
2479         (-[WKWebView _propertiesOfLayerWithID:]):
2480         * UIProcess/Cocoa/LayerRepresentation.h: Removed.
2481         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2482         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
2483         * UIProcess/PageClient.h:
2484         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2485         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2486         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2487         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
2488         (WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting const):
2489         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
2490         (WebKit::RemoteLayerTreeHost::rootNode const):
2491         (WebKit::RemoteLayerTreeHost::rootLayer const): Deleted.
2492         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2493         (WebKit::RemoteLayerTreeHost::updateLayerTree):
2494         (WebKit::RemoteLayerTreeHost::nodeForID const):
2495         (WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
2496         (WebKit::RemoteLayerTreeHost::animationDidStart):
2497         (WebKit::RemoteLayerTreeHost::animationDidEnd):
2498         (WebKit::RemoteLayerTreeHost::clearLayers):
2499         (WebKit::RemoteLayerTreeHost::layerWithIDForTesting const):
2500         (WebKit::RemoteLayerTreeHost::layerForID const):
2501         (WebKit::RemoteLayerTreeHost::rootLayer const):
2502         (WebKit::RemoteLayerTreeHost::createLayer):
2503         (WebKit::RemoteLayerTreeHost::detachRootLayer):
2504         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
2505         (WebKit::RemoteLayerTreeHost::getLayer const): Deleted.
2506         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: Added.
2507         (WebKit::RemoteLayerTreeNode::layer const):
2508         (WebKit::RemoteLayerTreeNode::uiView const):
2509         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: Added.
2510         (WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
2511         (WebKit::RemoteLayerTreeNode::detachFromParent):
2512         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm:
2513         (WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount const):
2514         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2515         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2516         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2517         (WebKit::RemoteLayerTreeHost::createLayer):
2518         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2519         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2520         (WebKit::layerRepresentationFromLayerOrView): Deleted.
2521         * UIProcess/WebAuthentication/Cocoa/HidService.h:
2522         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2523         * UIProcess/WebPageProxy.h:
2524         * UIProcess/ios/LayerRepresentation.mm: Removed.
2525         * UIProcess/ios/PageClientImplIOS.h:
2526         * UIProcess/ios/PageClientImplIOS.mm:
2527         (WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
2528         (WebKit::PageClientImpl::acceleratedCompositingRootLayer const):
2529         (WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
2530         * UIProcess/ios/WebPageProxyIOS.mm:
2531         (WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
2532         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
2533         * UIProcess/mac/PageClientImplMac.h:
2534         * UIProcess/mac/PageClientImplMac.mm:
2535         (WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
2536         (WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
2537         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2538         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
2539         * UIProcess/mac/WebPageProxyMac.mm:
2540         (WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
2541         (WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
2542         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
2543         * WebKit.xcodeproj/project.pbxproj:
2544         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2545         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2546
2547 2018-11-23  Jiewen Tan  <jiewen_tan@apple.com>
2548
2549         [WebAuthN] Enable Web Authentication as an experimental feature for macOS
2550         https://bugs.webkit.org/show_bug.cgi?id=191932
2551         rdar://problem/46225210
2552
2553         Reviewed by Brent Fulgham.
2554
2555         * Shared/WebPreferences.yaml:
2556
2557 2018-11-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2558
2559         Enable drag and drop support for iOSMac
2560         https://bugs.webkit.org/show_bug.cgi?id=191818
2561         <rdar://problem/43907454>
2562
2563         Reviewed by Dean Jackson.
2564
2565         * Configurations/FeatureDefines.xcconfig:
2566         * Shared/WebPreferencesDefaultValues.cpp:
2567         (defaultCustomPasteboardDataEnabled):
2568
2569         Enable custom pasteboard data by default on iOSMac. While writing and reading custom pasteboard data is
2570         currently broken in iOSMac due to the lack of `teamData` and `preferredPresentationStyle`, opting into custom
2571         pasteboard data at least allows us to avoid writing unsanitized data types to the pasteboard.
2572
2573         * WebProcess/WebPage/ios/WebPageIOS.mm:
2574         (WebKit::WebPage::platformEditorState const):
2575
2576         Fix a regression from <https://trac.webkit.org/r236619> wherein the web process crashes when attempting to edit
2577         a text field. This happens because the call to `-[UIKeyboard isInHardwareKeyboardMode]` on the iOSMac platform
2578         attempts to initialize a `UHASWorkspace` from the web process, which then attempts to connect to the UIKit host
2579         application. Instead, we can skip this call altogether on iOSMac, where the platform never considers a hardware
2580         keyboard to be "connected", even when typing.
2581
2582 2018-11-23  Antti Koivisto  <antti@apple.com>
2583
2584         UI side compositing doesn't paint on Mac
2585         https://bugs.webkit.org/show_bug.cgi?id=191908
2586
2587         Reviewed by Tim Horton.
2588
2589         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2590         (WebKit::RemoteLayerBackingStore::bytesPerPixel const):
2591         (WebKit::RemoteLayerBackingStore::surfaceBufferFormat const):
2592
2593         These deep color formats are not supported on Mac.
2594
2595 2018-11-22  Chris Dumez  <cdumez@apple.com>
2596
2597         Regression(r238353) Load sometimes hangs when navigating back after a cross-site navigation
2598         https://bugs.webkit.org/show_bug.cgi?id=191914
2599
2600         Reviewed by Ryosuke Niwa.
2601
2602         When process-swapping on a cross-site server-side redirect, we end up doing a decidePolicyForNavigationResponse
2603         policy check for the about:blank suspension load. This policy decision is ignored by the UIProcess because
2604         SuspendedPageProxy does not handle this particular IPC message. To handle the issue, make sure the WebProcess
2605         never sends a DecidePolicyForNavigationResponse IPC to the UIProcess for about:blank suspension loads and let
2606         the load proceed.
2607
2608         The issue was already there before r238353 but it was made obvious by r238353 which caused a hang when trying
2609         to reuse a Suspended page which is hanging while trying to suspend.
2610
2611         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2612         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2613
2614 2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2615
2616         [Cocoa] clang emits a warning when building WebKit after r238293
2617         https://bugs.webkit.org/show_bug.cgi?id=191917
2618
2619         Reviewed by Dan Bernstein.
2620
2621         Move the implementations of -setSafeBrowsingEnabled: and -isSafeBrowsingEnabled to the main implementation of
2622         WKPreferences to fix the warning.
2623
2624         * UIProcess/API/Cocoa/WKPreferences.mm:
2625         (-[WKPreferences setSafeBrowsingEnabled:]):
2626         (-[WKPreferences isSafeBrowsingEnabled]):
2627
2628 2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2629
2630         Address post-review feedback after r238438
2631         https://bugs.webkit.org/show_bug.cgi?id=191913
2632
2633         Reviewed by Ryosuke Niwa.
2634
2635         Replace boolean arguments to setSelectedRange, replaceSelectionWithText and replaceSelectionWithFragment with
2636         enum flags, and tweak a couple of functions to take `const Vector&` instead of `Vector&&`.
2637
2638         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2639         (WKBundlePageReplaceStringMatches):
2640         * WebProcess/WebPage/FindController.cpp:
2641         (WebKit::FindController::replaceMatches):
2642         * WebProcess/WebPage/FindController.h:
2643         * WebProcess/WebPage/WebPage.cpp:
2644         (WebKit::WebPage::replaceStringMatchesFromInjectedBundle):
2645         (WebKit::WebPage::replaceMatches):
2646         (WebKit::WebPage::replaceSelectionWithText):
2647         * WebProcess/WebPage/WebPage.h:
2648         * WebProcess/WebPage/ios/WebPageIOS.mm:
2649         (WebKit::WebPage::selectWithGesture):
2650         (WebKit::WebPage::updateSelectionWithTouches):
2651         (WebKit::WebPage::selectWithTwoTouches):
2652         (WebKit::WebPage::extendSelection):
2653         (WebKit::WebPage::selectWordBackward):
2654         (WebKit::WebPage::moveSelectionByOffset):
2655         (WebKit::WebPage::selectPositionAtPoint):
2656         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
2657         (WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
2658         (WebKit::WebPage::selectTextWithGranularityAtPoint):
2659         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
2660         (WebKit::WebPage::updateSelectionWithExtentPoint):
2661         (WebKit::WebPage::replaceSelectedText):
2662         (WebKit::WebPage::replaceDictatedText):
2663         (WebKit::WebPage::syncApplyAutocorrection):
2664
2665 2018-11-22  Mark Lam  <mark.lam@apple.com>
2666
2667         Rollout r238432: Breaks internal Mac builds.
2668         https://bugs.webkit.org/show_bug.cgi?id=191909
2669         <rdar://problem/46214163>
2670
2671         Unreviewed. Rolling out r238432: Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
2672
2673         * Sources.txt:
2674         * WebKit.xcodeproj/project.pbxproj:
2675
2676 2018-11-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2677
2678         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.1 release.
2679
2680         * gtk/NEWS: Add release notes for 2.23.1.
2681
2682 2018-11-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2683
2684         [Cocoa] [WebKit2] Add support for replacing find-in-page text matches
2685         https://bugs.webkit.org/show_bug.cgi?id=191786
2686         <rdar://problem/45813871>
2687
2688         Reviewed by Ryosuke Niwa.
2689
2690         * UIProcess/API/Cocoa/WKWebView.mm:
2691         (-[WKWebView replaceMatches:withString:inSelectionOnly:resultCollector:]):
2692         * UIProcess/WebPageProxy.cpp:
2693         (WebKit::WebPageProxy::replaceMatches):
2694         * UIProcess/WebPageProxy.h:
2695         * UIProcess/mac/WKTextFinderClient.mm:
2696         (-[WKTextFinderClient replaceMatches:withString:inSelectionOnly:resultCollector:]):
2697
2698         Implement this method to opt in to "Replace…" UI on macOS in the find bar. In this API, we're given a list of
2699         matches to replace. We propagate the indices of each match to the web process, where FindController maps them to
2700         corresponding replacement ranges. Currently, the given list of matches is only ever a list containing the first
2701         match, or a list containing all matches.
2702
2703         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2704         (WKBundlePageFindStringMatches):
2705         (WKBundlePageReplaceStringMatches):
2706         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2707         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2708         * WebProcess/WebPage/FindController.cpp:
2709         (WebKit::FindController::replaceMatches):
2710
2711         Map match indices to Ranges, and then call into WebCore::Page to do the heavy lifting (see WebCore ChangeLog for
2712         more details). Additionally add a hard find-and-replace limit here to prevent the web process from spinning
2713         indefinitely if there are an enormous number of find matches.
2714
2715         * WebProcess/WebPage/FindController.h:
2716         * WebProcess/WebPage/WebPage.cpp:
2717         (WebKit::WebPage::findStringMatchesFromInjectedBundle):
2718         (WebKit::WebPage::replaceStringMatchesFromInjectedBundle):
2719
2720         Add helpers to exercise find and replace in WebKit2.
2721
2722         (WebKit::WebPage::replaceMatches):
2723         * WebProcess/WebPage/WebPage.h:
2724         * WebProcess/WebPage/WebPage.messages.in:
2725
2726 2018-11-21  Andy Estes  <aestes@apple.com>
2727
2728         [Cocoa] Create a soft-linking file for PassKit
2729         https://bugs.webkit.org/show_bug.cgi?id=191875
2730         <rdar://problem/46203215>
2731
2732         Reviewed by Myles Maxfield.
2733
2734         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
2735         * SourcesCocoa.txt: Removed @no-unify from WebPaymentCoordinatorProxyIOS.mm and WebPaymentCoordinatorProxyMac.mm.
2736         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
2737         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Ditto.
2738         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Ditto.
2739         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: Included NSAttributedStringSPI.h.
2740         * UIProcess/mac/WebProcessProxyMac.mm: Included ProcessPrivilege.h.
2741         * WebKit.xcodeproj/project.pbxproj: Removed WebPaymentCoordinatorProxyIOS.mm and WebPaymentCoordinatorProxyMac.mm from the WebKit target.
2742
2743 2018-11-21  Fujii Hironori  <Hironori.Fujii@sony.com>
2744
2745         Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
2746         https://bugs.webkit.org/show_bug.cgi?id=191853
2747
2748         Reviewed by Michael Catanzaro.
2749
2750         In r235845, I excluded InjectedBundleRangeHandle.cpp and
2751         InjectedBundleNodeHandle.cpp from unify source builds in order to
2752         work around a MSVC bug.
2753
2754         Then, I commited a different workaround for the MSVC bug in
2755         r238386. Now, we can include InjectedBundleRangeHandle.cpp and
2756         InjectedBundleNodeHandle.cpp in unified source builds. Revert
2757         r235845.
2758
2759         * Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp
2760         and InjectedBundleNodeHandle.cpp
2761         * WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership
2762         not to be compiled by XCode.
2763
2764 2018-11-20  Jeff Miller  <jeffm@apple.com>
2765
2766         Return nullptr immediately if the key doesn't exist in the HashMap.
2767         https://bugs.webkit.org/show_bug.cgi?id=191841
2768
2769         Reviewed by Chris Dumez.
2770
2771         * Shared/API/APIDictionary.h:
2772
2773 2018-11-20  Don Olmstead  <don.olmstead@sony.com>
2774
2775         WebPasteboard should USE(LIBWPE)
2776         https://bugs.webkit.org/show_bug.cgi?id=191846
2777
2778         Reviewed by Michael Catanzaro.
2779
2780         Add USE(LIBWPE) for Pasteboard related functionality within WebKit.
2781
2782         * UIProcess/WebPasteboardProxy.h:
2783         * UIProcess/WebPasteboardProxy.messages.in:
2784         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2785         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2786
2787 2018-11-20  Don Olmstead  <don.olmstead@sony.com>
2788
2789         [WPE] Fix some feature guards in WebKit
2790         https://bugs.webkit.org/show_bug.cgi?id=191847
2791
2792         Reviewed by Michael Catanzaro.
2793
2794         Some feature guards are not present in these files.
2795
2796         * UIProcess/API/wpe/PageClientImpl.cpp:
2797         * UIProcess/API/wpe/PageClientImpl.h:
2798         * UIProcess/wpe/WebProcessPoolWPE.cpp:
2799         (WebKit::WebProcessPool::platformInitializeWebProcess):
2800
2801 2018-11-20  Antti Koivisto  <antti@apple.com>
2802
2803         Avoid potential longer than expected layer flush delays
2804         https://bugs.webkit.org/show_bug.cgi?id=191833
2805
2806         Reviewed by Dean Jackson.
2807
2808         Layer flush throttling also stops style recalcs and layouts. Layouts schedule layer flushes. Especially
2809         on a slow network we can in principle end up in situation where layer flush timer fires but there is no
2810         flush scheduled and so nothing happens. However there is a pending style recalc or layout that would
2811         actually schedule a flush (in practice various things force style recalcs and this doesn't occur
2812         commonly).
2813
2814         To avoid this we should flush unconditionally when the flush timer fires. This performs any pending
2815         style recalc and layout too. If there is nothing to do the flush will be cheap.
2816
2817         PLT doesn't appear to hit cases affected by this patch and there shouldn't be any impact.
2818
2819         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2820
2821         Remove now unnecessary m_hasPendingFlush bit, simplifying the logic.
2822
2823         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2824         (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
2825
2826         Schedule unconditionally when unfreezing.
2827
2828         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
2829
2830         Remove branch that starts the flush timer. It is not needed as either it was already running
2831         or immediate flush is already scheduled and will start the timer anyway.
2832
2833         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2834         (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling):
2835         (WebKit::TiledCoreAnimationDrawingArea::layerFlushThrottlingTimerFired):
2836
2837         Flush unconditionally.
2838
2839 2018-11-19  Don Olmstead  <don.olmstead@sony.com>
2840
2841         Simplify platform check in WebEditorClient
2842         https://bugs.webkit.org/show_bug.cgi?id=191848
2843
2844         Reviewed by Fujii Hironori.
2845
2846         !PLATFORM(GTK) && !PLATFORM(COCOA) && !PLATFORM(WPE) can be better
2847         represented as PLATFORM(WIN).
2848
2849         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2850
2851 2018-11-19  Alex Christensen  <achristensen@webkit.org>
2852
2853         Add SPI to disable JIT in a WKWebView
2854         https://bugs.webkit.org/show_bug.cgi?id=191822
2855         <rdar://problem/28119360>
2856
2857         Reviewed by Geoffrey Garen.
2858
2859         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2860         (WebKit::XPCServiceInitializer):
2861         * UIProcess/API/APIProcessPoolConfiguration.h:
2862         * UIProcess/API/Cocoa/WKWebView.mm:
2863         (-[WKWebView _canUseJIT:]):
2864         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2865         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2866         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2867         (-[_WKProcessPoolConfiguration enableJIT]):
2868         (-[_WKProcessPoolConfiguration setEnableJIT:]):
2869         * UIProcess/Launcher/ProcessLauncher.h:
2870         (WebKit::ProcessLauncher::Client::enableJIT const):
2871         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2872         (WebKit::ProcessLauncher::launchProcess):
2873         * UIProcess/WebPageProxy.cpp:
2874         (WebKit::WebPageProxy::canUseJIT):
2875         * UIProcess/WebPageProxy.h:
2876         * UIProcess/WebProcessProxy.cpp:
2877         (WebKit::WebProcessProxy::enableJIT const):
2878         * UIProcess/WebProcessProxy.h:
2879         (WebKit::WebProcessProxy::processPool const):
2880         (WebKit::WebProcessProxy::processPool): Deleted.
2881         * WebProcess/WebProcess.cpp:
2882         (WebKit::WebProcess::canUseJIT):
2883         * WebProcess/WebProcess.h:
2884         * WebProcess/WebProcess.messages.in:
2885
2886 2018-11-19  Basuke Suzuki  <basuke.suzuki@sony.com>
2887
2888         [Curl] Add API for CertificateInfo.
2889         https://bugs.webkit.org/show_bug.cgi?id=191647
2890
2891         Reviewed by Alex Christensen.
2892
2893         Added API for CertificateInfo to create, fetch contents.
2894
2895         Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
2896
2897         * PlatformWin.cmake:
2898         * Shared/API/c/curl/WKCertificateInfoCurl.cpp: Added.
2899         (WKCertificateInfoCreateWithCertficateChain):
2900         (WKCertificateInfoGetVerificationError):
2901         (WKCertificateInfoGetCertificateChainSize):
2902         (WKCertificateInfoCopyCertificateAtIndex):
2903         * Shared/API/c/curl/WKCertificateInfoCurl.h: Copied from Source/WebCore/platform/network/curl/CertificateInfoCurl.cpp.
2904         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
2905         (IPC::ArgumentCoder<CertificateInfo>::encode):
2906         (IPC::ArgumentCoder<CertificateInfo>::decode):
2907
2908 2018-11-19  Don Olmstead  <don.olmstead@sony.com>
2909
2910         Add USE(LIBWPE) for WebKit events
2911         https://bugs.webkit.org/show_bug.cgi?id=191842
2912
2913         Reviewed by Michael Catanzaro.
2914
2915         Moves all WPE events to USE(LIBWPE) instead of PLATFORM(WPE). Updates
2916         filenames to LibWPE.
2917
2918         * PlatformWPE.cmake:
2919         * Shared/NativeWebKeyboardEvent.h:
2920         * Shared/NativeWebMouseEvent.h:
2921         * Shared/NativeWebTouchEvent.h:
2922         * Shared/NativeWebWheelEvent.h:
2923         * Shared/WebCoreArgumentCoders.cpp:
2924         * Shared/WebCoreArgumentCoders.h:
2925         * Shared/WebEvent.h:
2926         * Shared/WebKeyboardEvent.cpp:
2927         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2928         * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebKeyboardEventWPE.cpp.
2929         * Shared/libwpe/NativeWebMouseEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebMouseEventWPE.cpp.
2930         * Shared/libwpe/NativeWebTouchEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebTouchEventWPE.cpp.
2931         * Shared/libwpe/NativeWebWheelEventLibWPE.cpp: Renamed from Source/WebKit/Shared/wpe/NativeWebWheelEventWPE.cpp.
2932         * Shared/libwpe/WebEventFactory.cpp: Renamed from Source/WebKit/Shared/wpe/WebEventFactory.cpp.
2933         * Shared/libwpe/WebEventFactory.h: Renamed from Source/WebKit/Shared/wpe/WebEventFactory.h.
2934         * SourcesWPE.txt:
2935
2936 2018-11-19  David Quesada  <david_quesada@apple.com>
2937
2938         EXC_BAD_ACCESS when invoking a DownloadProxy's destination decision handler after the download has been canceled
2939         https://bugs.webkit.org/show_bug.cgi?id=191762
2940         rdar://problem/46151509
2941
2942         Reviewed by Dean Jackson.
2943
2944         When the DownloadClient calls the decision handler with a destination path, check if
2945         m_processPool is null before trying to access its network process. This can happen
2946         if a download is canceled before the client decides its destination.
2947
2948         * UIProcess/Downloads/DownloadProxy.cpp:
2949         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
2950
2951 2018-11-19  Tomoki Imai  <Tomoki.Imai@sony.com>
2952
2953         [cairo] BackingStore::incorporateUpdate should use CompositeCopy to support drawsBackground=false in general Cairo ports
2954         https://bugs.webkit.org/show_bug.cgi?id=191577
2955
2956         Reviewed by Carlos Garcia Campos.
2957
2958         We should use CompositeCopy operator to update bitmap to overwrite existing bitmap even if source contains
2959         transparent parts. It enables ports which uses Cairo to set drawsBackground to false.
2960         GTK ports has custom background extension, and in such case, we need to use CompositeSourceOver to retain
2961         custom background.
2962
2963         * UIProcess/cairo/BackingStoreCairo.cpp:
2964         (WebKit::BackingStore::incorporateUpdate): Use CompositeCopy operator to update bitmap.
2965
2966 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
2967
2968         Web Inspector: "Reload Web Inspector" button no longer partially works
2969         https://bugs.webkit.org/show_bug.cgi?id=191773
2970         <rdar://problem/46139932>
2971
2972         Reviewed by Devin Rousso.
2973
2974         * UIProcess/RemoteWebInspectorProxy.cpp:
2975         (WebKit::RemoteWebInspectorProxy::load):
2976         (WebKit::RemoteWebInspectorProxy::reopen):
2977         * UIProcess/RemoteWebInspectorProxy.h:
2978         * UIProcess/RemoteWebInspectorProxy.messages.in:
2979         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
2980         (WebKit::RemoteWebInspectorUI::reopen):
2981         * WebProcess/WebPage/RemoteWebInspectorUI.h:
2982         * WebProcess/WebPage/WebInspector.cpp:
2983         (WebKit::WebInspector::reopen):
2984         * WebProcess/WebPage/WebInspector.h:
2985         * WebProcess/WebPage/WebInspector.messages.in:
2986         * WebProcess/WebPage/WebInspectorUI.cpp:
2987         (WebKit::WebInspectorUI::reopen):
2988         * WebProcess/WebPage/WebInspectorUI.h:
2989
2990 2018-11-19  Alejandro G. Castro  <alex@igalia.com>
2991
2992         [GTK][WPE] Solve some issues in the enumerateDevices code
2993         https://bugs.webkit.org/show_bug.cgi?id=191832
2994
2995         Reviewed by Carlos Garcia Campos.
2996
2997         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp:
2998         Increase the version to 2.24.
2999         (webkitDeviceInfoPermissionRequestAllow):
3000         (webkitDeviceInfoPermissionRequestDeny):
3001         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:
3002         Replace the forward declaration with the include.
3003         * UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Typo.
3004         * UIProcess/API/gtk/WebKitWebsiteData.h:
3005         Increase the version to 2.24.
3006         * UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Typo.
3007         * UIProcess/API/wpe/WebKitWebsiteData.h:
3008         Increase the version to 2.24.
3009
3010 2018-11-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3011
3012         Unreviewed. Fix GTK+ build after r238318.
3013
3014         Add new symbols to API documentation files. They should have been added in r237031, but r238318 revealed it.
3015
3016         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3017         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
3018         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3019
3020 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
3021
3022         Regression(r238330): A lot of WebInspector tests are crashing on the bots
3023         https://bugs.webkit.org/show_bug.cgi?id=191814
3024
3025         Reviewed by Ryosuke Niwa.
3026
3027         Expose the expected connection type from the UIProcess into the WebProcess.
3028         When there is a local inspector connection to the UIProcess expose it as
3029         a local frontend channel to the inspector controllers in the Page.
3030
3031         * UIProcess/WebPageInspectorTargetAgent.h:
3032         * UIProcess/WebPageInspectorTargetAgent.cpp:
3033         (WebKit::WebPageInspectorTargetAgent::frontendChannel):
3034         An additional FrontendChannel class is not needed, just use self.
3035
3036         (WebKit::WebPageInspectorTargetAgent::WebPageInspectorTargetAgent):
3037         (WebKit::WebPageInspectorTargetAgent::connectionType const):
3038         (WebKit::WebPageInspectorTargetAgent::sendMessageToFrontend):
3039         Expose the channel to targets as local if there is a local frontend
3040         in the UIProcess.
3041
3042 2018-11-18  Joseph Pecoraro  <pecoraro@apple.com>
3043
3044         Regression(r238330) ProcessSwap.WebInspector API test is a flaky crash in debug
3045         https://bugs.webkit.org/show_bug.cgi?id=191812
3046
3047         Reviewed by Chris Dumez.
3048
3049         * WebProcess/WebPage/WebInspector.cpp:
3050         (WebKit::WebInspector::setFrontendConnection):
3051         It can be possible to receive a frontend connection multiple times
3052         if another WebProcess opened the inspector and this WebProcess got
3053         swapped in before the InspectorProcess notified the WebProcess of
3054         a connection to use. It is always best to use the latest connection
3055         we have received, since any others would have been invalidated.
3056
3057 2018-11-18  Chris Dumez  <cdumez@apple.com>
3058
3059         [PSON] Received an invalid message "WebPageProxy.DidPerformClientRedirect" from the web process
3060         https://bugs.webkit.org/show_bug.cgi?id=191828
3061
3062         Reviewed by Antti Koivisto.
3063
3064         WebPageProxy::didPerformClientRedirect() had a MESSAGE_CHECK_URL() for both the source
3065         and the destination URL. The macro calls WebProcessProxy::checkURLReceivedFromWebProcess()
3066         to make sure that both URLs were actually loaded by this WebContent process.
3067
3068         However, now that we're enabled process-swap on cross-site navigation, these checks are no
3069         longer fully valid. If the client-side redirect is cross-site, then the source and destination
3070         URLs get loaded by 2 different WebContent processes. Since didPerformClientRedirect() gets
3071         called after the redirect and gets set by the new WebContent process, only the destination URL
3072         is guaranteed to have been loaded by this process. The source URL may have been loaded in
3073         another process so this patch drops the message check for the source URL.
3074
3075         * UIProcess/WebPageProxy.cpp:
3076         (WebKit::WebPageProxy::didPerformClientRedirect):
3077
3078 2018-11-18  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3079
3080         Use Box<BinarySemaphore> instead of dispatch_semaphore_t
3081         https://bugs.webkit.org/show_bug.cgi?id=189691
3082
3083         Reviewed by Ryosuke Niwa.
3084
3085         Use Box<BinarySemaphore> instead, which utilizes our WTF::Lock mechanism.
3086
3087         * NetworkProcess/watchos/NetworkProximityManager.mm:
3088         (WebKit::NetworkProximityManager::updateRecommendation):
3089
3090 2018-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3091
3092         [iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
3093         https://bugs.webkit.org/show_bug.cgi?id=191819
3094
3095         Reviewed by Dan Bernstein.
3096
3097         Replace UIItemProvider (and related classes) with NSItemProvider.
3098
3099         * Platform/spi/ios/UIKitSPI.h:
3100         * UIProcess/ios/WKContentViewInteraction.mm:
3101         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
3102         (-[WKContentView dropInteraction:performDrop:]):
3103
3104 2018-11-17  Ross Kirsling  <ross.kirsling@sony.com>
3105
3106         Unreviewed WinCairo build fix for r238353.
3107
3108         * UIProcess/WebPageProxy.cpp:
3109         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3110
3111 2018-11-17  Chris Dumez  <cdumez@apple.com>
3112
3113         ASSERTION FAILED: m_messageReceivers.contains(...) under ViewGestureController removeMessageReceiver
3114         https://bugs.webkit.org/show_bug.cgi?id=191734
3115         <rdar://problem/46151497>
3116
3117         Reviewed by Ryosuke Niwa.
3118
3119         When a WebProcess crashes, we destroy the ViewGestureController and reconstruct it later
3120         after we've relaunched a new WebProcess. The ViewGestureController controller takes care
3121         of adding itself as an IPC message receiver to the WebProcessProxy, and the destructor
3122         takes care of removing itself as an IPC message receiver.
3123
3124         However, when process-swapping on navigation, we do not destroy the ViewGestureController
3125         because doing so would take down the swipe gesture snapshot on cross-site swipe navigation.
3126         This led to hitting this assertion later on because the ViewGestureController is still
3127         registered as an IPC message receiver with the old process after process swapping.
3128
3129         To address the issue, we now make sure the ViewGestureController unregisters itself from
3130         the old process and registers itself with the new process on process-swap.
3131
3132         * UIProcess/Cocoa/ViewGestureController.cpp:
3133         (WebKit::ViewGestureController::ViewGestureController):
3134         (WebKit::ViewGestureController::~ViewGestureController):
3135         (WebKit::ViewGestureController::disconnectFromProcess):
3136         (WebKit::ViewGestureController::connectToProcess):
3137         * UIProcess/Cocoa/ViewGestureController.h:
3138         * UIProcess/Cocoa/WebViewImpl.mm:
3139         (WebKit::WebViewImpl::processWillSwap):
3140         (WebKit::WebViewImpl::didRelaunchProcess):
3141
3142 2018-11-17  Chris Dumez  <cdumez@apple.com>
3143
3144         [PSON] ASSERTION FAILED: m_uncommittedState.state == State::Committed
3145         https://bugs.webkit.org/show_bug.cgi?id=191781
3146
3147         Reviewed by Ryosuke Niwa.
3148
3149         The crash was happening when switching to a suspended page that is not yet done
3150         suspending (e.g. in case of very fast back/forward navigation). The WebPageProxy
3151         would reattach to the suspended process and get load notifications that it did
3152         not expect since it did not schedule any load yet. Those notifications are for
3153         the about:blank load we do for page suspension.
3154
3155         To address the issue, make swapToWebProcess() asynchronous and take a completion
3156         handler. When we try to unsuspend a SuspendedPageProxy, we first make sure it
3157         is actually done suspending. If it is not done suspending, we wait until it is
3158         before telling in to unsuspend and proceeding with the new load.
3159
3160         * UIProcess/SuspendedPageProxy.cpp:
3161         (WebKit::SuspendedPageProxy::unsuspend):
3162         (WebKit::SuspendedPageProxy::didFinishLoad):
3163         * UIProcess/SuspendedPageProxy.h:
3164         * UIProcess/WebPageProxy.cpp:
3165         (WebKit::WebPageProxy::swapToWebProcess):
3166         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3167         * UIProcess/WebPageProxy.h:
3168
3169 2018-11-17  Chris Dumez  <cdumez@apple.com>
3170
3171         Unreviewed follow-up to r238343 to address debug assertions in 2 API tests.
3172
3173         * UIProcess/Network/NetworkProcessProxy.cpp:
3174         (WebKit::NetworkProcessProxy::networkProcessCrashed):
3175
3176 2018-11-17  Devin Rousso  <drousso@apple.com>
3177
3178         Web Inspector: Network: add button to show system certificate dialog
3179         https://bugs.webkit.org/show_bug.cgi?id=191458
3180         <rdar://problem/45977019>
3181
3182         Reviewed by Joseph Pecoraro.
3183
3184         * UIProcess/WebInspectorProxy.messages.in:
3185         * UIProcess/WebInspectorProxy.h:
3186         * UIProcess/WebInspectorProxy.cpp:
3187         (WebKit::WebInspectorProxy::showCertificate): Added.
3188         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
3189         * UIProcess/mac/WebInspectorProxyGtk.cpp:
3190         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
3191         * UIProcess/mac/WebInspectorProxyMac.mm:
3192         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
3193         * UIProcess/mac/WebInspectorProxyWPE.cpp:
3194         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
3195         * UIProcess/mac/WebInspectorProxyWin.cpp:
3196         (WebKit::WebInspectorProxy::platformShowCertificate): Added.
3197         * WebProcess/WebPage/WebInspectorUI.h:
3198         * WebProcess/WebPage/WebInspectorUI.cpp:
3199         (WebKit::WebInspectorUI::showCertificate): Added.
3200
3201         * UIProcess/RemoteWebInspectorProxy.messages.in:
3202         * UIProcess/RemoteWebInspectorProxy.h:
3203         * UIProcess/RemoteWebInspectorProxy.cpp:
3204         (WebKit::RemoteWebInspectorProxy::showCertificate): Added.
3205         (WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
3206         * UIProcess/mac/RemoteWebInspectorProxyGtk.cpp:
3207         (WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
3208         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3209         (WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
3210         * WebProcess/WebPage/RemoteWebInspectorUI.h:
3211         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
3212         (WebKit::RemoteWebInspectorUI::showCertificate): Added.
3213
3214         * NetworkProcess/cache/NetworkCacheCoders.h:
3215         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: Removed.
3216         * NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Removed.
3217         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp: Removed.
3218         Moved `WebCore::CertificateInfo` code for `WTF::Encoder` and `WTF::Decoder` into their
3219         respective platform's CertificateInfo.h file.
3220
3221         * UIProcess/Authentication/mac/WebCredentialMac.mm:
3222
3223         * Configurations/WebKit.xcconfig:
3224         * PlatformMac.cmake:
3225         * PlatformWin.cmake:
3226         * SourcesCocoa.txt:
3227         * SourcesGTK.txt:
3228         * SourcesWPE.txt:
3229         * WebKit.xcodeproj/project.pbxproj:
3230
3231 2018-11-16  Chris Dumez  <cdumez@apple.com>
3232
3233         Regression(ProcessPrewarming) Assertion hit in NetworkProcessProxy destructor
3234         https://bugs.webkit.org/show_bug.cgi?id=191800
3235
3236         Reviewed by Ryosuke Niwa.
3237
3238         Make sure the NetworkProcessProxy destructor calls its remaining m_pendingConnectionReplies
3239         completion handlers to avoid hitting an assertion in the CompletionHandler destructor.
3240
3241         Prewarmed WebProcess do not keep the ProcessPool alive and thus not the NetworkProcessProxy
3242         either. As a result, it is possible for NetworkProcessProxy to have pending connection
3243         requests from those prewarmed processes when it is destroyed. Similar story for the
3244         suspended page processes when they are destroyed.
3245
3246         * UIProcess/Network/NetworkProcessProxy.cpp:
3247         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
3248
3249 2018-11-16  Alex Christensen  <achristensen@webkit.org>
3250
3251         Tweak _showSafeBrowsingWarningWithTitle SPI
3252         https://bugs.webkit.org/show_bug.cgi?id=191799
3253
3254         Reviewed by Wenson Hsieh.
3255
3256         * UIProcess/API/Cocoa/WKWebView.mm:
3257         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
3258         (+[WKWebView _visitUnsafeWebsiteSentinel]):
3259         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3260         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
3261         (-[WKSafeBrowsingWarning clickedOnLink:]):
3262         I need to localize "Continue" and "Cancel" so they aren't always in English.
3263
3264 2018-11-16  Chris Dumez  <cdumez@apple.com>
3265
3266         WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView API test is crashing in debug
3267         https://bugs.webkit.org/show_bug.cgi?id=191797
3268
3269         Reviewed by Ryosuke Niwa.
3270
3271         We were hitting the assertion because the error handler was first getting called. It would
3272         deallocate the send right, cancel/null out the XPC connection and call
3273         didFinishLaunchingProcess(0, IPC::Connection::Identifier()).
3274
3275         Then the xpc_connection_send_message_with_reply() block would get called later and
3276         would try to deallocate the send right again, and call
3277         didFinishLaunchingProcess(0, IPC::Connection::Identifier()) again because the xpc
3278         connection is null.
3279
3280         Handle this case by having the xpc_connection_send_message_with_reply() block check
3281         that we're still launching (i.e. didFinishLaunchingProcess() has not been called
3282         yet).
3283
3284         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3285         (WebKit::ProcessLauncher::launchProcess):
3286
3287 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
3288
3289         Unreviewed follow-up to r238330.
3290
3291         * UIProcess/WebPageProxy.cpp:
3292         (WebKit::WebPageProxy::close):
3293         Don't clear the pointer after invalidating since the pointer is
3294         used later one. We don't mind it being used after invalidation
3295         it will do the right thing, we'd rather have the WebInspectorProxy
3296         lifetime match the WebPageProxy.
3297
3298 2018-11-16  Chris Dumez  <cdumez@apple.com>
3299
3300         ProcessSwap.NavigationWithLockedHistoryWithoutPSON API test is a flaky crash in debug
3301         https://bugs.webkit.org/show_bug.cgi?id=191795
3302
3303         Reviewed by Alex Christensen.
3304
3305         If the WebProcessPool is getting destroyed while there is a prewarmed WebContent process
3306         that is awaiting its connnection to the network process, then we'll hit the
3307         process->hasOneRef() assertion in the WebProcessPool destructor. This is because
3308         NetworkProcessProxy::m_pendingConnectionReplies keeps a RefPtr to the WebProcessProxy
3309         that is awaiting the connection. The NetworkProcessProxy does not really need to keep
3310         the WebProcessProxy alive in this case so this patch switches to using a WeakPtr instead.
3311
3312         * UIProcess/Network/NetworkProcessProxy.cpp:
3313         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
3314         (WebKit::NetworkProcessProxy::networkProcessCrashed):
3315         * UIProcess/Network/NetworkProcessProxy.h:
3316         * UIProcess/WebProcessProxy.h:
3317
3318 2018-11-16  Chris Dumez  <cdumez@apple.com>
3319
3320         [macOS] Label "prewarmed" WebContent processes in Activity Monitor
3321         https://bugs.webkit.org/show_bug.cgi?id=191765
3322         <rdar://problem/45953463>
3323
3324         Reviewed by Geoffrey Garen.
3325
3326         Label "prewarmed" WebContent processes in Activity Monitor to facilitate debugging.
3327
3328         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3329         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
3330         * UIProcess/WebProcessProxy.cpp:
3331         (WebKit::WebProcessProxy::getLaunchOptions):
3332         (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
3333         * WebProcess/WebProcess.cpp:
3334         (WebKit::WebProcess::markIsNoLongerPrewarmed):
3335         * WebProcess/WebProcess.h:
3336         * WebProcess/WebProcess.messages.in:
3337         * WebProcess/cocoa/WebProcessCocoa.mm:
3338         (WebKit::WebProcess::initializeProcessName):
3339         (WebKit::WebProcess::updateProcessName):
3340         (WebKit::WebProcess::platformInitializeProcess):
3341
3342 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
3343
3344         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local Inspector)
3345         https://bugs.webkit.org/show_bug.cgi?id=191740
3346         <rdar://problem/45470897>
3347
3348         Reviewed by Timothy Hatcher.
3349
3350         When a web page asks to open a local Web Inspector, that inspector
3351         will now connect in the UIProcess (WebPageProxy / WebPageInspectorController)
3352         instead of the WebContentProcess (WebKit::WebInspector / InspectorController).
3353
3354         Previously a WebInspectorProxy was re-created every time the WebPageProxy's
3355         WebPage / WebProcess was changed, effectively closing the Web Inspector
3356         frontend when the WebPage was swapped or crashed.
3357
3358         This change keeps the WebInspectorProxy alive as long as the WebPageProxy
3359         is alive. During process swaps, or process crashes, the WebInspectorProxy
3360         is reset when the page is reset and updated when the page's WebProcess
3361         changes. Since WebInspectorProxy owns the Web Inspector view / window
3362         the Web Inspector window can be kept alive across (and attached state)
3363         across WebPage / WebProcess changes.
3364
3365         Previously the WebContentProcess's WebKit::WebInspector was the Local
3366         FrontendChannel for the WebCore::InspectorController. This can't
3367         outlive the single WebContentProcess.
3368
3369         This change makes the UIProcesses' WebInspectorProxy the Local FrontendChannel
3370         for the WebKit::WebPageInspectorController. Given the WebInspectorProxy
3371         now stays alive alongside the WebPageProxy this will live across process changes.
3372         This means that the WebInspectorUI process must send its backend messages to
3373         the WebInspectorProxy -> WebPageInspectorController now instead of the
3374         old path WebInspector -> WebCore::InspectorController.
3375
3376         A direct IPC connection is still maintained between the WebContentProcess's
3377         WebKit::WebInspector and the InspectorProcess's WebInspectorUI. Previously
3378         this connection was established by WebKit::WebInspector vending an
3379         IPC::Attachment to the WebInspectorUI process. This patch inverts that
3380         relationship, because the WebInspectorUI process now lives across multiple
3381         WebContentProcess changes. The WebInspectorUI now vends the IPC::Attachment
3382         to the WebContentProcess each time the process changes. This way they can both
3383         still communicate through normal Messages::WebInspector/WebInspectorUI
3384         messages and everything behaves as previously expected.
3385
3386         * Scripts/webkit/messages.py:
3387         Header for Inspector::FrontendChannel::ConnectionType.
3388
3389         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3390         (WebKit::WebInspectorClient::openLocalFrontend):
3391         * WebProcess/WebPage/WebInspector.cpp:
3392         (WebKit::WebInspector::openLocalInspectorFrontend):
3393         (WebKit::WebInspector::setFrontendConnection):
3394         (WebKit::WebInspector::closeFrontendConnection):
3395         (WebKit::WebInspector::close):
3396         (WebKit::WebInspector::openFrontendConnection): Deleted.
3397         (WebKit::WebInspector::sendMessageToBackend): Deleted.
3398         (WebKit::WebInspector::sendMessageToFrontend): Deleted.
3399         On the WebProcess side we ask the UIProcess to open a local frontend and now
3400         receive instead of vend an IPC connection to the WebInspectorUI process.
3401
3402         * UIProcess/WebPageProxy.cpp:
3403         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3404         (WebKit::WebPageProxy::close):
3405         (WebKit::WebPageProxy::resetState):
3406         Keep the WebInspectorProxy alive alongside the WebPageProxy.
3407         Update it as processes / states change.
3408
3409         * UIProcess/WebInspectorProxy.h:
3410         * UIProcess/WebInspectorProxy.messages.in:
3411         * UIProcess/WebInspectorProxy.cpp:
3412         (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
3413         (WebKit::WebInspectorProxy::createInspectorPage): Deleted.
3414         (WebKit::WebInspectorProxy::sendMessageToFrontend):
3415         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
3416         Open and close a local frontend by being the FrontendChannel on the UIProcess side.
3417
3418         (WebKit::WebInspectorProxy::sendMessageToBackend):
3419        &nbs