REGRESSION(r249275): [GTK][WPE] wrong page ID returned by webkit_web_view_get_page_id()
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         REGRESSION(r249275): [GTK][WPE] wrong page ID returned by webkit_web_view_get_page_id()
4         https://bugs.webkit.org/show_bug.cgi?id=201504
5
6         Reviewed by Michael Catanzaro.
7
8         We want to return the page identifier not the web page proxy id.
9
10         * UIProcess/API/glib/WebKitWebView.cpp:
11         (webkit_web_view_get_page_id):
12
13 2019-09-05  Pablo Saavedra  <psaavedra@igalia.com>
14
15         Build failure after r249501 for ports with SERVICE_WORKER set OFF
16         https://bugs.webkit.org/show_bug.cgi?id=201503
17
18         Reviewed by Youenn Fablet.
19
20         * WebProcess/Network/WebLoaderStrategy.cpp:
21         (WebKit::WebLoaderStrategy::scheduleLoad):
22
23 2019-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
24
25         MobileSafari may crash when invoking the C++ lambda in -[WKContentView _shareForWebView:]
26         https://bugs.webkit.org/show_bug.cgi?id=201479
27         <rdar://problem/51511834>
28
29         Reviewed by Tim Horton.
30
31         Fix the crash by making -_shareForWebView: robust in the case where there are no selection rects
32         known in the UI process when -[WKContentView _share:] is invoked.
33
34         * UIProcess/ios/WKContentViewInteraction.mm:
35         (-[WKContentView _shareForWebView:]):
36
37 2019-09-04  Ryosuke Niwa  <rniwa@webkit.org>
38
39         Replace defaultCustomPasteboardDataEnabled by an equivalent macro
40         https://bugs.webkit.org/show_bug.cgi?id=201477
41
42         Reviewed by Wenson Hsieh.
43
44         r227282 introduced defaultCustomPasteboardDataEnabled() to disable the custom pasteboard data on
45         apps linked against old SDKs. However, this had a bug that the check inside WebContent process
46         would always return true because WebContent process is always linked against the latest SDKs.
47         Because WebPreferences values aren't propagated from UI process to WebContent process unless
48         there is a value change, it meant that custom pasteboard data is always enabled.
49
50         This patch replaces this function with a simple macro which always enables the custom pasteboard
51         data on iOS family and macOS as it has always been the case before and after r227282.
52
53         * Shared/WebPreferences.yaml:
54         * Shared/WebPreferencesDefaultValues.cpp:
55         (WebKit::defaultCustomPasteboardDataEnabled): Deleted.
56         * Shared/WebPreferencesDefaultValues.h:
57
58 2019-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
59
60         -[WKContentView selectedText] returns an empty string when selecting more than 200 characters
61         https://bugs.webkit.org/show_bug.cgi?id=201471
62         <rdar://problem/55039227>
63
64         Reviewed by Tim Horton.
65
66         The fix for <rdar://problem/54308019> is contingent on -[WKContentView selectedText] returning a non-empty
67         result in the case where text is selected. However, in WebKit, if more than 200 characters are selected,
68         -selectedText ends up returning nothing.
69
70         This is due to logic added in trac.webkit.org/r167624 that was intended to return the selected text in
71         PostLayoutData's wordAtSelection, up to a maximum of 200 characters, likely for performance and/or security
72         reasons. However, instead of truncating at 200 characters, the change simply drops wordAtSelection altogether.
73         This patch fixes this issue by taking the first 200 characters of the selected text.
74
75         Test: EditorStateTests.SelectedText
76
77         * WebProcess/WebPage/ios/WebPageIOS.mm:
78         (WebKit::WebPage::platformEditorState const):
79
80 2019-09-04  Joseph Pecoraro  <pecoraro@apple.com>
81
82         Web Inspector: Local Overrides - Provide substitution content for resource loads (URL based)
83         https://bugs.webkit.org/show_bug.cgi?id=201262
84         <rdar://problem/13108764>
85
86         Reviewed by Devin Rousso.
87
88         * Sources.txt:
89         * WebKit.xcodeproj/project.pbxproj:
90         New sources.
91
92         * WebProcess/Network/WebResourceLoader.h:
93         * WebProcess/Network/WebResourceLoader.cpp:
94         (WebKit::WebResourceLoader::didReceiveResponse):
95         (WebKit::WebResourceLoader::didReceiveData):
96         (WebKit::WebResourceLoader::didFinishResourceLoad):
97         (WebKit::WebResourceLoader::didFailResourceLoad):
98         On receiving a response, check with the inspector if an active
99         frontend will override the response content.
100
101         * WebProcess/Network/WebResourceInterceptController.h:
102         * WebProcess/Network/WebResourceInterceptController.cpp:
103         (WebKit::WebResourceInterceptController::isIntercepting const):
104         (WebKit::WebResourceInterceptController::beginInterceptingResponse):
105         (WebKit::WebResourceInterceptController::continueResponse):
106         (WebKit::WebResourceInterceptController::interceptedResponse):
107         (WebKit::WebResourceInterceptController::defer):
108         Buffer networking callbacks for an ongoing intercept.
109
110         * WebProcess/Network/WebLoaderStrategy.cpp:
111         (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
112         Handle new response source.
113
114 2019-09-04  Chris Dumez  <cdumez@apple.com>
115
116         Unreviewed minor follow-up fix after r249501 to address crashes in debug.
117
118         * NetworkProcess/cache/NetworkCache.h:
119         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::constructDeletedValue):
120         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::isDeletedValue):
121
122 2019-09-04  Chris Dumez  <cdumez@apple.com>
123
124         Expose WebPageProxy identifier to the Network Process
125         https://bugs.webkit.org/show_bug.cgi?id=201467
126
127         Reviewed by Geoffrey Garen.
128
129         Expose WebPageProxy identifier to the Network Process (similarly to WebPage / WebFrame identifiers)
130         so that it can use it whenever it IPCs the UIProcess. The IPCs from the network process were the
131         last one requiring the UIProcess to lookup a WebPageProxy object from a WebPageIdentifier (rather
132         than a WebPageProxyIdentifier).
133
134         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
135         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
136         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
137         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
138         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
139         * NetworkProcess/NetworkCORSPreflightChecker.h:
140         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
141         (WebKit::NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
142         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
143         * NetworkProcess/NetworkConnectionToWebProcess.h:
144         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
145         * NetworkProcess/NetworkLoad.cpp:
146         (WebKit::NetworkLoad::didReceiveChallenge):
147         * NetworkProcess/NetworkLoadChecker.cpp:
148         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
149         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
150         * NetworkProcess/NetworkLoadChecker.h:
151         * NetworkProcess/NetworkLoadParameters.h:
152         * NetworkProcess/NetworkProcess.cpp:
153         (WebKit::NetworkProcess::didCommitCrossSiteLoadWithDataTransfer):
154         (WebKit::NetworkProcess::logDiagnosticMessage):
155         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
156         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
157         * NetworkProcess/NetworkProcess.h:
158         * NetworkProcess/NetworkProcess.messages.in:
159         * NetworkProcess/NetworkResourceLoadParameters.cpp:
160         (WebKit::NetworkResourceLoadParameters::encode const):
161         (WebKit::NetworkResourceLoadParameters::decode):
162         * NetworkProcess/NetworkResourceLoader.cpp:
163         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
164         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
165         (WebKit::NetworkResourceLoader::startNetworkLoad):
166         (WebKit::NetworkResourceLoader::didReceiveResponse):
167         * NetworkProcess/NetworkResourceLoader.h:
168         * NetworkProcess/PingLoad.cpp:
169         (WebKit::PingLoad::PingLoad):
170         (WebKit::PingLoad::didReceiveChallenge):
171         * NetworkProcess/cache/NetworkCache.h:
172         (WebKit::NetworkCache::GlobalFrameID::hash const):
173         (WebKit::NetworkCache::operator==):
174         (WTF::GlobalFrameIDHash::hash):
175         (WTF::GlobalFrameIDHash::equal):
176         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::emptyValue):
177         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::constructDeletedValue):
178         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::isDeletedValue):
179         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
180         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
181         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
182         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
183         * Shared/Authentication/AuthenticationManager.cpp:
184         (WebKit::AuthenticationManager::shouldCoalesceChallenge const):
185         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
186         * Shared/Authentication/AuthenticationManager.h:
187         * UIProcess/Network/NetworkProcessProxy.cpp:
188         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
189         (WebKit::NetworkProcessProxy::logDiagnosticMessage):
190         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
191         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
192         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
193         (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransfer):
194         (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
195         (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
196         * UIProcess/Network/NetworkProcessProxy.h:
197         * UIProcess/Network/NetworkProcessProxy.messages.in:
198         * UIProcess/ServiceWorkerProcessProxy.cpp:
199         (WebKit::ServiceWorkerProcessProxy::start):
200         * UIProcess/ServiceWorkerProcessProxy.h:
201         * UIProcess/WebPageProxy.cpp:
202         (WebKit::WebPageProxy::didCommitLoadForFrame):
203         * UIProcess/WebProcessPool.cpp:
204         (WebKit::WebProcessPool::isServiceWorkerPageID const):
205         (WebKit::WebProcessPool::didCommitCrossSiteLoadWithDataTransfer):
206         * UIProcess/WebProcessPool.h:
207         * UIProcess/WebProcessProxy.cpp:
208         * UIProcess/WebProcessProxy.h:
209         * WebProcess/Network/WebLoaderStrategy.cpp:
210         (WebKit::WebLoaderStrategy::scheduleLoad):
211         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
212         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
213         (WebKit::WebLoaderStrategy::preconnectTo):
214         * WebProcess/Network/WebResourceLoader.h:
215         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
216         (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
217         (WebKit::ServiceWorkerFrameLoaderClient::createDocumentLoader):
218         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
219         (WebKit::WebSWContextManagerConnection::installServiceWorker):
220         * WebProcess/Storage/WebSWContextManagerConnection.h:
221         (isType):
222         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
223         (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
224         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
225         (WebKit::WebFrameLoaderClient::webPageProxyID const):
226         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
227         * WebProcess/WebPage/WebPage.cpp:
228         (WebKit::WebPage::requestStorageAccess):
229         * WebProcess/WebProcess.cpp:
230         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
231         * WebProcess/WebProcess.h:
232         * WebProcess/WebProcess.messages.in:
233
234 2019-09-04  Tim Horton  <timothy_horton@apple.com>
235
236         macCatalyst: Re-enable iOS WKWebView printing API
237         https://bugs.webkit.org/show_bug.cgi?id=201392
238         <rdar://problem/54690252>
239
240         Reviewed by Wenson Hsieh.
241
242         * UIProcess/API/Cocoa/WKWebView.mm:
243         (-[WKWebView _webViewPrintFormatter]):
244         * UIProcess/API/Cocoa/WKWebViewInternal.h:
245         * UIProcess/_WKWebViewPrintFormatter.mm:
246         * UIProcess/_WKWebViewPrintFormatterInternal.h:
247         * UIProcess/ios/WKContentView.mm:
248         _WKWwebViewPrintFormatter was disabled during bringup because requisite
249         UIKit bits were missing, but they are not anymore (and have not been for
250         quite some time), so remove these unnecessary platform ifdefs.
251
252 2019-09-04  Patrick Griffis  <pgriffis@igalia.com>
253
254         [WPE][GTK] Fix sandbox parsing DISPLAY on X11
255         https://bugs.webkit.org/show_bug.cgi?id=201462
256
257         Reviewed by Michael Catanzaro.
258
259         On some setups the DISPLAY env var was incorrectly parsed.
260
261         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
262         (WebKit::bindX11):
263
264 2019-09-04  Brian Burg  <bburg@apple.com>
265
266         Selenium test 'interactions_tests.py::testContextClick' is hanging
267         https://bugs.webkit.org/show_bug.cgi?id=201161
268         <rdar://problem/54728541>
269
270         Reviewed by Chris Dumez.
271
272         A web page should not show native context menus if user interactions are being simulated for WebDriver.
273         Showing a native context menu spawns a nested run loop. Since there's no way to interact
274         with native UI via WebDriver, the test will hang until the context menu is manually dismissed.
275
276         To fix this, pretend to show the context menu in UIProcess and dismiss it immediately.
277         This is necessary to trigger oncontextmenu events appropriately and resume handling mouse events.
278
279         * UIProcess/WebPageProxy.cpp:
280         (WebKit::WebPageProxy::showContextMenu): Hook into isControlledByAutomation here.
281         We could short circuit this on the WebProcess side, but the check would be more crude
282         and suppress context menus even if user interaction isn't being simulated. This would be
283         problematic for a user who wants to interrupt their test session and interact with it.
284         The main use case for this is right clicking on the test page and choose "Inspect".
285
286 2019-09-04  Youenn Fablet  <youenn@apple.com>
287
288         Abstract out WebSocketChannel message queue
289         https://bugs.webkit.org/show_bug.cgi?id=201359
290
291         Reviewed by Alex Christensen.
292
293         Make use of newly added NetworkSendQueue.
294
295         * WebProcess/Network/WebSocketChannel.cpp:
296         (WebKit::WebSocketChannel::createMessageQueue):
297         (WebKit::WebSocketChannel::WebSocketChannel):
298         (WebKit::WebSocketChannel::send):
299         (WebKit::WebSocketChannel::disconnect):
300         * WebProcess/Network/WebSocketChannel.h:
301
302 2019-09-04  Youenn Fablet  <youenn@apple.com>
303
304         Move MessageRegistry to NetworkProcess
305         https://bugs.webkit.org/show_bug.cgi?id=201299
306
307         Reviewed by Alex Christensen.
308
309         Move message registry to NetworkProcess.
310         Take benefit of this move to use async reply IPC as much as possible.
311         This also allows to remove the IPC message to UIProcess when doing postMessage with service workers.
312
313         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
314         (WebKit::NetworkConnectionToWebProcess::createNewMessagePortChannel):
315         (WebKit::NetworkConnectionToWebProcess::entangleLocalPortInThisProcessToRemote):
316         (WebKit::NetworkConnectionToWebProcess::messagePortDisentangled):
317         (WebKit::NetworkConnectionToWebProcess::messagePortClosed):
318         (WebKit::NetworkConnectionToWebProcess::nextMessageBatchIdentifier):
319         (WebKit::NetworkConnectionToWebProcess::takeAllMessagesForPort):
320         (WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages):
321         (WebKit::NetworkConnectionToWebProcess::postMessageToRemote):
322         (WebKit::NetworkConnectionToWebProcess::checkRemotePortForActivity):
323         (WebKit::NetworkConnectionToWebProcess::checkProcessLocalPortForActivity):
324         * NetworkProcess/NetworkConnectionToWebProcess.h:
325         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
326         * NetworkProcess/NetworkMessagePortChannelProvider.cpp: Added.
327         (WebKit::NetworkMessagePortChannelProvider::NetworkMessagePortChannelProvider):
328         (WebKit::NetworkMessagePortChannelProvider::createNewMessagePortChannel):
329         (WebKit::NetworkMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
330         (WebKit::NetworkMessagePortChannelProvider::messagePortDisentangled):
331         (WebKit::NetworkMessagePortChannelProvider::messagePortClosed):
332         (WebKit::NetworkMessagePortChannelProvider::takeAllMessagesForPort):
333         (WebKit::NetworkMessagePortChannelProvider::postMessageToRemote):
334         (WebKit::NetworkMessagePortChannelProvider::checkRemotePortForActivity):
335         (WebKit::NetworkMessagePortChannelProvider::checkProcessLocalPortForActivity):
336         * NetworkProcess/NetworkMessagePortChannelProvider.h: Added.
337         * NetworkProcess/NetworkProcess.cpp:
338         (WebKit::m_messagePortChannelProvider):
339         (WebKit::NetworkProcess::webProcessConnection const):
340         * NetworkProcess/NetworkProcess.h:
341         (WebKit::NetworkProcess::messagePortChannelRegistry):
342         * Sources.txt:
343         * UIProcess/Downloads/DownloadProxyMap.cpp:
344         * UIProcess/WebPageProxy.cpp:
345         * UIProcess/WebProcessPool.cpp:
346         * UIProcess/WebProcessPool.h:
347         * UIProcess/WebProcessPool.messages.in:
348         * UIProcess/WebProcessProxy.cpp:
349         (WebKit::WebProcessProxy::~WebProcessProxy):
350         (WebKit::WebProcessProxy::shutDown):
351         * UIProcess/WebProcessProxy.h:
352         * UIProcess/WebProcessProxy.messages.in:
353         * WebKit.xcodeproj/project.pbxproj:
354         * WebProcess/Network/NetworkProcessConnection.cpp:
355         (WebKit::NetworkProcessConnection::initializeSWClientConnection):
356         (WebKit::NetworkProcessConnection::messagesAvailableForPort):
357         (WebKit::NetworkProcessConnection::checkProcessLocalPortForActivity):
358         * WebProcess/Network/NetworkProcessConnection.h:
359         * WebProcess/Network/NetworkProcessConnection.messages.in:
360         * WebProcess/Storage/WebSWClientConnection.cpp:
361         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
362         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
363         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
364         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
365         (WebKit::networkProcessConnection):
366         (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
367         (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
368         (WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
369         (WebKit::WebMessagePortChannelProvider::messagePortClosed):
370         (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
371         (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
372         (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
373         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
374         * WebProcess/WebProcess.cpp:
375         * WebProcess/WebProcess.h:
376         * WebProcess/WebProcess.messages.in:
377
378 2019-09-03  Per Arne Vollan  <pvollan@apple.com>
379
380         [macOS] Unable to open local file from favorites bar
381         https://bugs.webkit.org/show_bug.cgi?id=201444
382
383         Reviewed by Brent Fulgham.
384
385         The sandbox extension handle should be created providing the pid of the receiving process.
386
387         * UIProcess/WebPageProxy.cpp:
388         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
389
390 2019-09-03  Chris Dumez  <cdumez@apple.com>
391
392         FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
393         https://bugs.webkit.org/show_bug.cgi?id=201431
394
395         Reviewed by Antti Koivisto.
396
397         * WebProcess/Network/WebLoaderStrategy.cpp:
398         (WebKit::WebLoaderStrategy::pageLoadCompleted):
399         * WebProcess/Network/WebLoaderStrategy.h:
400
401 2019-09-03  Tim Horton  <timothy_horton@apple.com>
402
403         Null deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler block
404         https://bugs.webkit.org/show_bug.cgi?id=201436
405         <rdar://problem/40640475>
406
407         Reviewed by Simon Fraser.
408
409         * UIProcess/API/Cocoa/WKWebView.mm:
410         (-[WKWebView dealloc]):
411         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
412         We crash sending a message to a deallocated WKWebView inside the handler block
413         passed to +[CATransaction addCommitHandler:]. This seems impossible, because
414         we carefully retain it, but it's possible that it could be the result of
415         the handler block being installed under -dealloc (in which case retaining
416         the WKWebView wouldn't actually extend its lifetime). -[WKWebView dealloc]
417         is fairly sizable, and it's hard to follow all paths from it, so instead
418         add a RELEASE_LOG_FAULT, so we'll get simulated crash logs, and bail,
419         so we'll stop actually crashing (if this is the cause).
420
421         This is just a speculative fix, but a hopeful one, since intentionally calling
422         -_addUpdateVisibleContentRectPreCommitHandler: from dealloc yields a similar-looking
423         crash under the handler block.
424
425 2019-09-03  Jiewen Tan  <jiewen_tan@apple.com>
426
427         [WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
428         https://bugs.webkit.org/show_bug.cgi?id=201369
429         <rdar://problem/54903724>
430
431         Reviewed by Brent Fulgham.
432
433         Communications to security keys require entitlements, which are not guaranteed to be present in third party
434         WKWebView clients. Therefore, only enable WebAuthn by default for MobileSafari and SafariViewService.
435
436         * Shared/WebPreferences.yaml:
437         * Shared/WebPreferencesDefaultValues.cpp:
438         (WebKit::defaultWebAuthenticationEnabled):
439         * Shared/WebPreferencesDefaultValues.h:
440
441 2019-09-03  Chris Dumez  <cdumez@apple.com>
442
443         Rename WebPage::pageID() to WebPage::identifier()
444         https://bugs.webkit.org/show_bug.cgi?id=201428
445
446         Reviewed by Antti Koivisto.
447
448         * Shared/API/Cocoa/WKBrowsingContextHandle.mm:
449         (-[WKBrowsingContextHandle _initWithPage:]):
450         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
451         (WebKit::WebPaymentCoordinator::WebPaymentCoordinator):
452         (WebKit::WebPaymentCoordinator::showPaymentUI):
453         (WebKit::WebPaymentCoordinator::messageSenderDestinationID const):
454         * WebProcess/Network/WebLoaderStrategy.cpp:
455         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
456         (WebKit::WebLoaderStrategy::preconnectTo):
457         * WebProcess/Notifications/WebNotificationManager.cpp:
458         (WebKit::WebNotificationManager::show):
459         (WebKit::WebNotificationManager::cancel):
460         (WebKit::WebNotificationManager::clearNotifications):
461         (WebKit::WebNotificationManager::didDestroyNotification):
462         * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
463         (WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator):
464         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
465         (WebKit::WebChromeClient::windowRect):
466         (WebKit::WebChromeClient::focusedFrameChanged):
467         (WebKit::WebChromeClient::createWindow):
468         (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
469         (WebKit::WebChromeClient::toolbarsVisible):
470         (WebKit::WebChromeClient::statusbarVisible):
471         (WebKit::WebChromeClient::menubarVisible):
472         (WebKit::WebChromeClient::wrapCryptoKey const):
473         (WebKit::WebChromeClient::unwrapCryptoKey const):
474         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
475         * WebProcess/WebCoreSupport/WebColorChooser.cpp:
476         (WebKit::WebColorChooser::WebColorChooser):
477         (WebKit::WebColorChooser::reattachColorChooser):
478         (WebKit::WebColorChooser::setSelectedColor):
479         (WebKit::WebColorChooser::endChooser):
480         * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
481         (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
482         (WebKit::WebDataListSuggestionPicker::close):
483         (WebKit::WebDataListSuggestionPicker::displayWithActivationType):
484         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
485         (WebKit::WebFrameLoaderClient::pageID const):
486         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
487         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
488         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
489         (WebKit::WebPopupMenu::show):
490         (WebKit::WebPopupMenu::hide):
491         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
492         (WebKit::WebSearchPopupMenu::saveRecentSearches):
493         (WebKit::WebSearchPopupMenu::loadRecentSearches):
494         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
495         (WebKit::WebFrameLoaderClient::createPreviewLoaderClient):
496         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
497         (WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
498         (WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
499         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
500         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
501         (WebKit::WebRemoteObjectRegistry::close):
502         * WebProcess/WebPage/EventDispatcher.cpp:
503         (WebKit::EventDispatcher::addScrollingTreeForPage):
504         (WebKit::EventDispatcher::removeScrollingTreeForPage):
505         (WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
506         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
507         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
508         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
509         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
510         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
511         (WebKit::RemoteScrollingCoordinator::RemoteScrollingCoordinator):
512         (WebKit::RemoteScrollingCoordinator::~RemoteScrollingCoordinator):
513         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
514         (WebKit::RemoteWebInspectorUI::sendMessageToBackend):
515         (WebKit::RemoteWebInspectorUI::changeSheetRect):
516         (WebKit::RemoteWebInspectorUI::startWindowDrag):
517         (WebKit::RemoteWebInspectorUI::bringToFront):
518         (WebKit::RemoteWebInspectorUI::closeWindow):
519         (WebKit::RemoteWebInspectorUI::reopen):
520         (WebKit::RemoteWebInspectorUI::resetState):
521         (WebKit::RemoteWebInspectorUI::openInNewTab):
522         (WebKit::RemoteWebInspectorUI::save):
523         (WebKit::RemoteWebInspectorUI::append):
524         (WebKit::RemoteWebInspectorUI::showCertificate):
525         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
526         (WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
527         (WebKit::ViewGestureGeometryCollector::~ViewGestureGeometryCollector):
528         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
529         (WebKit::WebBackForwardListProxy::itemAtIndex):
530         (WebKit::WebBackForwardListProxy::backListCount const):
531         (WebKit::WebBackForwardListProxy::forwardListCount const):
532         * WebProcess/WebPage/WebInspector.cpp:
533         (WebKit::WebInspector::openLocalInspectorFrontend):
534         (WebKit::WebInspector::closeFrontendConnection):
535         (WebKit::WebInspector::bringToFront):
536         (WebKit::WebInspector::elementSelectionChanged):
537         (WebKit::WebInspector::timelineRecordingChanged):
538         (WebKit::WebInspector::setMockCaptureDevicesEnabledOverride):
539         (WebKit::WebInspector::updateDockingAvailability):
540         * WebProcess/WebPage/WebPage.cpp:
541         (WebKit::WebPage::WebPage):
542         (WebKit::m_textAutoSizingAdjustmentTimer):
543         (WebKit::WebPage::messageSenderDestinationID const):
544         (WebKit::WebPage::close):
545         (WebKit::WebPage::goToBackForwardItem):
546         (WebKit::WebPage::setFixedLayoutSize):
547         (WebKit::WebPage::freezeLayerTree):
548         (WebKit::WebPage::unfreezeLayerTree):
549         (WebKit::WebPage::restoreSessionInternal):
550         (WebKit::WebPage::setCurrentHistoryItemForReattach):
551         (WebKit::WebPage::updateIsInWindow):
552         (WebKit::WebPage::setActivityState):
553         (WebKit::WebPage::mainFrameDidLayout):
554         (WebKit::WebPage::didCommitLoad):
555         (WebKit::WebPage::hasStorageAccess):
556         (WebKit::WebPage::requestStorageAccess):
557         (WebKit::WebPage::textInputContextsInRect):
558         (WebKit::WebPage::elementForTextInputContext):
559         * WebProcess/WebPage/WebPage.h:
560         (WebKit::WebPage::identifier const):
561         (WebKit::WebPage::pageID const): Deleted.
562         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
563         (WebKit::WebPageInspectorTarget::identifier const):
564         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
565         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
566         * WebProcess/WebPage/mac/WebPageMac.mm:
567         (WebKit::WebPage::executeKeypressCommandsInternal):
568         * WebProcess/WebProcess.cpp:
569         (WebKit::WebProcess::transformObjectsToHandles):
570         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
571         (WebKit::StorageNamespaceImpl::copy):
572         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
573         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
574         * WebProcess/cocoa/PlaybackSessionManager.mm:
575         (WebKit::PlaybackSessionManager::PlaybackSessionManager):
576         (WebKit::PlaybackSessionManager::~PlaybackSessionManager):
577         (WebKit::PlaybackSessionManager::invalidate):
578         * WebProcess/cocoa/VideoFullscreenManager.mm:
579         (WebKit::VideoFullscreenManager::VideoFullscreenManager):
580         (WebKit::VideoFullscreenManager::~VideoFullscreenManager):
581         (WebKit::VideoFullscreenManager::invalidate):
582
583 2019-09-03  Antoine Quint  <graouts@apple.com>
584
585         [iOS] Treat a two-finger single tap as if the user tapped with the Cmd key pressed
586         https://bugs.webkit.org/show_bug.cgi?id=201420
587         <rdar://problem/53207786>
588
589         Reviewed by Simon Fraser.
590
591         Set the metaKey modifier to true when generating a click event based on a two-finger single tap. This is important so that sites like Google and DuckDuckGo
592         correctly open links in their search results page in a new tab in Safari on iOS. This currently doesn't work because those sites will call preventDefault()
593         if the metaKey flag isn't set on a "click" event, and if it is set, they let the browser handle the navigation themselves.
594
595         * UIProcess/ios/WKContentViewInteraction.mm:
596         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
597
598 2019-08-28  Brent Fulgham  <bfulgham@apple.com>
599
600         [macOS] Correct sandbox violation in Flash plugin
601         https://bugs.webkit.org/show_bug.cgi?id=201228
602         <rdar://problem/54347503>
603
604         Reviewed by Alex Christensen.
605
606         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
607
608 2019-09-03  Carlos Garcia Campos  <cgarcia@igalia.com>
609
610         [WPE][GTK] Deprecate nonfunctional process limit APIs
611         https://bugs.webkit.org/show_bug.cgi?id=193749
612
613         Reviewed by Žan Doberšek.
614
615         * UIProcess/API/glib/WebKitWebContext.cpp:
616         (webkitWebContextConstructed):
617         (webkit_web_context_set_process_model):
618         (webkit_web_context_get_process_model):
619         (webkit_web_context_set_web_process_count_limit):
620         (webkit_web_context_get_web_process_count_limit):
621         * UIProcess/API/gtk/WebKitWebContext.h:
622         * UIProcess/API/wpe/WebKitWebContext.h:
623
624 2019-09-02  Youenn Fablet  <youenn@apple.com>
625
626         Make NetworkConnectionToWebProcess keyed by their WebProcess identifier
627         https://bugs.webkit.org/show_bug.cgi?id=201300
628
629         Reviewed by Alex Christensen.
630
631         Make sure to create each NetworkConnectionToWebProcess for a given WebProcess.
632         Pass the process identifier at creation time.
633         This will allow to have the message registry be moved to NetworkProcess
634         so as to check port activity between processes.
635         This identifier might also be used in the future for other connections like
636         service worker context/client/server identifiers.
637
638         No observable change of behavior.
639
640         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
641         (WebKit::NetworkConnectionToWebProcess::create):
642         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
643         * NetworkProcess/NetworkConnectionToWebProcess.h:
644         (WebKit::NetworkConnectionToWebProcess::webProcessIdentifier const):
645         * NetworkProcess/NetworkProcess.cpp:
646         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
647         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
648         (WebKit::NetworkProcess::actualPrepareToSuspend):
649         (WebKit::NetworkProcess::resume):
650         * NetworkProcess/NetworkProcess.h:
651         * NetworkProcess/NetworkProcess.messages.in:
652         * Platform/IPC/Connection.h:
653         (IPC::Connection::sendWithAsyncReply):
654         Allow to pass send options.
655         * UIProcess/Network/NetworkProcessProxy.cpp:
656         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
657         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
658         Make use of async reply to simplify the handling of lambdas.
659         (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
660         (WebKit::NetworkProcessProxy::didFinishLaunching):
661         * UIProcess/Network/NetworkProcessProxy.h:
662         * UIProcess/Network/NetworkProcessProxy.messages.in:
663
664 2019-09-02  Youenn Fablet  <youenn@apple.com>
665
666         Introduce WorkerMessagePortChannelRegistry
667         https://bugs.webkit.org/show_bug.cgi?id=201333
668
669         Reviewed by Alex Christensen.
670
671         By introducing WorkerMessagePortChannelRegistry, we are making
672         sure UIMessagePortChannelProvider is only called from the main thread.
673         This will help when moving the registry to network process.
674
675         * UIProcess/UIMessagePortChannelProvider.cpp:
676         (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
677         (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
678         * UIProcess/UIMessagePortChannelProvider.h:
679         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
680         (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
681         (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
682         (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
683         (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
684         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
685
686 2019-09-01  Youenn Fablet  <youenn@apple.com>
687
688         Abstract out LibWebRTCSocketClient so that rtc sockets can be implemented without libwebrtc sockets
689         https://bugs.webkit.org/show_bug.cgi?id=201302
690
691         Reviewed by Alex Christensen.
692
693         Introduce NetworkRTCProvider::Socket to be able to implement RTC socket support with non libwebrtc API
694
695         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
696         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
697         (WebKit::NetworkRTCProvider::createSocket):
698         (WebKit::NetworkRTCProvider::createUDPSocket):
699         (WebKit::NetworkRTCProvider::createServerTCPSocket):
700         (WebKit::NetworkRTCProvider::proxyInfoFromSession):
701         (WebKit::NetworkRTCProvider::createClientTCPSocket):
702         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
703         (WebKit::NetworkRTCProvider::addSocket):
704         (WebKit::NetworkRTCProvider::takeSocket):
705         (WebKit::NetworkRTCProvider::newConnection):
706         (WebKit::NetworkRTCProvider::closeListeningSockets):
707         (WebKit::NetworkRTCProvider::callSocket):
708         * NetworkProcess/webrtc/NetworkRTCProvider.h:
709         * NetworkProcess/webrtc/NetworkRTCProvider.mm:
710         (WebKit::NetworkRTCProvider::createClientTCPSocket):
711         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
712         (WebKit::NetworkRTCSocket::sendTo):
713         (WebKit::NetworkRTCSocket::close):
714         (WebKit::NetworkRTCSocket::setOption):
715
716 2019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>
717
718         [Cairo] out-of-bounds read in ShareableBitmap::paint if a fractional device scale factor is used
719         https://bugs.webkit.org/show_bug.cgi?id=196340
720
721         Reviewed by Brent Fulgham.
722
723         In ShareableBitmap::paint, srcRectScaled can be out-of-bounds of
724         the surface if a fractional device scale factor is used.
725
726         * Shared/cairo/ShareableBitmapCairo.cpp:
727         (WebKit::ShareableBitmap::paint): Use cairoSurfaceSetDeviceScale
728         to set a device scale factor to the surface instead of multiplying
729         srcRect with a device scale factor.
730
731 2019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>
732
733         Unreviewed, rolling out r249366.
734
735         WinCairo WebKit2 crashes in some websites and the device scale
736         factor is not correct in high DPI.
737
738         Reverted changeset:
739
740         "[WinCairo, FTW] Properly handle device scale factor"
741         https://bugs.webkit.org/show_bug.cgi?id=201361
742         https://trac.webkit.org/changeset/249366
743
744 2019-09-01  Wenson Hsieh  <wenson_hsieh@apple.com>
745
746         Long presses that interrupt accelerated scrolling dispatch clicks on apps linked against iOS 12 or earlier
747         https://bugs.webkit.org/show_bug.cgi?id=201346
748         <rdar://problem/54885784>
749
750         Reviewed by Dean Jackson.
751
752         For apps that are linked on or after iOS 13, we add a context menu interaction to the content view, which
753         requires us to disable (or avoid adding) the highlight long press gesture recognizer. However, for apps that are
754         linked on the iOS 12 SDK or prior, this gesture is still present, and fires when long pressing for (roughly) up
755         to 0.75 seconds if a tap gesture was not recognized instead. Firing this gesture sends a click event to the
756         page; this brings back some form of <rdar://problem/53889373>, but only when holding for slightly longer than a
757         normal tap, and also only in apps linked on iOS 12 or earlier. To fix this, we apply a similar solution as in
758         r248433 and detect whether a long press gesture interrupted scroll view deceleration in
759         -gestureRecognizerShouldBegin:. If so, we return NO to avoid clicking. See per-method comments below for more
760         details.
761
762         Testing this bug as-is was tricky, since there's no way in layout tests to simulate being linked on or before a
763         given SDK version. Luckily, recall that:
764         1. This bug occurs when the highlight gesture recognizer is enabled and added to the content view.
765         2. The highlight gesture recognizer only needs to be disabled or removed when context menu interaction is added.
766         As such, we should be able to restore the highlight gesture recognizer by suppressing the context menu
767         interaction in an app linked-on-or-after iOS 13, by setting allowsLinkPreview to NO. Unfortunately, this doesn't
768         quite work, since we currently always avoid adding the highlight gesture recognizer if the app is linked on
769         iOS 13 or later.
770
771         However, this means that the highlight gesture recognizer is absent from the content view in apps linked against
772         iOS 13 that disable link previews, even though its absence is not required. This means that long pressing a
773         clickable element in a web view that disables link previews does not show a tap highlight on iOS 13, whereas it
774         would on iOS 12; this is a regression, albeit a very subtle one. To fix this subtle issue and make it possible
775         to write a test for this bug, we refactor some logic for creating and configuring the highlight long press
776         gesture, such that we now unconditionally add the highlight gesture, but only enable it in apps linked on or
777         after iOS 13 if link previews (i.e. context menu interaction) are not allowed.
778
779         Test: fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow.html
780
781         * SourcesCocoa.txt:
782         * UIProcess/API/Cocoa/WKWebView.mm:
783         (-[WKWebView setAllowsLinkPreview:]):
784         * UIProcess/ios/WKContentViewInteraction.h:
785         * UIProcess/ios/WKContentViewInteraction.mm:
786         (-[WKContentView setupInteraction]):
787
788         Refactor our gesture setup logic to always create and add the long press and highlight long press gestures, but
789         conditionally disable them based on whether or not (1) the context menu is available, and (2) WKWebView's
790         allowsLinkPreview property.
791
792         (-[WKContentView _didChangeLinkPreviewAvailability]):
793         (-[WKContentView _updateLongPressAndHighlightLongPressGestures]):
794
795         Add a new helper to update the enabled state of the long press and highlight long press gestures, by consulting
796         -_shouldUseContextMenu and -allowsLinkPreview. This is called when setting up the gestures, as well as whenever
797         -allowsLinkPreview changes.
798
799         (-[WKContentView gestureRecognizerShouldBegin:]):
800
801         Factor out logic to ascend the view hierarchy in search of a UIScrollView that was interrupted while
802         decelerating into a local lambda function; use this for both the highlight gesture and the single tap gesture,
803         to determine whether they should begin.
804
805         * UIProcess/ios/WKHighlightLongPressGestureRecognizer.h: Added.
806         * UIProcess/ios/WKHighlightLongPressGestureRecognizer.mm: Added.
807
808         In order to remember the UIScrollView (if any) tracked by the highlight long press gesture, we subclass
809         _UIWebHighlightLongPressGestureRecognizer. While UILongPressGestureRecognizer does have SPI to ask for a list of
810         UITouches, by the time the gesture has been recognized and the gesture delegates are invoked, these UITouches
811         no longer correspond to UIViews. As such, the only time we have access to the list of UITouches with their
812         UIViews is during the touches* subclass hooks.
813
814         (-[WKHighlightLongPressGestureRecognizer reset]):
815
816         Clear out the tracked UIScrollView here, when the gesture is reset (i.e. after ending, or being canceled).
817
818         (-[WKHighlightLongPressGestureRecognizer touchesBegan:withEvent:]):
819
820         Remember the last touched UIScrollView here.
821
822         (-[WKHighlightLongPressGestureRecognizer lastTouchedScrollView]):
823         * WebKit.xcodeproj/project.pbxproj:
824
825 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
826
827         [WinCairo, FTW] Properly handle device scale factor
828         https://bugs.webkit.org/show_bug.cgi?id=201361
829
830         Reviewed by Don Olmstead.
831
832         Update the WebView and WebProcess to correctly handle
833         the device scale factor.
834
835         * UIProcess/win/WebView.cpp:
836         (WebKit::WebView::WebView): Tell the page the current device scale factor.
837         * WebProcess/win/WebProcessMainWin.cpp:
838         (WebKit::WebProcessMainWin): Tell the process to be aware of device scale.
839
840 2019-08-31  Chris Dumez  <cdumez@apple.com>
841
842         DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID
843         https://bugs.webkit.org/show_bug.cgi?id=201364
844
845         Reviewed by John Wilander.
846
847         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
848         (WebKit::WebChromeClient::hasStorageAccess):
849         (WebKit::WebChromeClient::requestStorageAccess):
850         * WebProcess/WebCoreSupport/WebChromeClient.h:
851         * WebProcess/WebPage/WebPage.cpp:
852         (WebKit::WebPage::hasStorageAccess):
853         (WebKit::WebPage::requestStorageAccess):
854         * WebProcess/WebPage/WebPage.h:
855
856 2019-08-30  Chris Dumez  <cdumez@apple.com>
857
858         WebPage::fromCorePage() to take and return a C++ reference
859         https://bugs.webkit.org/show_bug.cgi?id=201367
860
861         Reviewed by Antti Koivisto.
862
863         * WebProcess/InjectedBundle/InjectedBundle.cpp:
864         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
865         * WebProcess/WebPage/VisitedLinkTableController.cpp:
866         (WebKit::VisitedLinkTableController::addVisitedLink):
867         * WebProcess/WebPage/WebFrame.cpp:
868         (WebKit::WebFrame::page const):
869         * WebProcess/WebPage/WebPage.cpp:
870         (WebKit::WebPage::fromCorePage):
871         * WebProcess/WebPage/WebPage.h:
872         * WebProcess/WebPage/WebPageOverlay.cpp:
873         (WebKit::WebPageOverlay::willMoveToPage):
874         (WebKit::WebPageOverlay::didMoveToPage):
875         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
876         (WebKit::StorageNamespaceImpl::copy):
877         * WebProcess/WebStorage/StorageNamespaceImpl.h:
878         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
879         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
880
881 2019-08-30  Chris Dumez  <cdumez@apple.com>
882
883         [PSON] We no longer need to throw away suspended pages in a process before using it for a navigation
884         https://bugs.webkit.org/show_bug.cgi?id=201344
885
886         Reviewed by Antti Koivisto.
887
888         We no longer need to throw away suspended pages in a process before using it for a navigation, now that
889         Bug 201225 has been fixed. WebPage objects (suspended or live) in the process now have distinct
890         identifiers and can coexist.
891
892         * Shared/API/Cocoa/RemoteObjectRegistry.h:
893         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
894         (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
895         * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp:
896         (WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry):
897         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
898         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
899         (WebKit::WebRemoteObjectRegistry::close):
900
901 2019-08-30  Chris Dumez  <cdumez@apple.com>
902
903         Assertion hit when saving to PDF from printing dialog
904         https://bugs.webkit.org/show_bug.cgi?id=201351
905
906         Reviewed by Tim Horton.
907
908         [WKPrintingView knowsPageRange:] may get called from a background thread and ends up calling
909         WeakPtr::get() which asserts because it is generally unsafe to get the raw pointer from a
910         WeakPtr to an object owned by another thread. However, the methods here merely want to null
911         check it so add a thread-safe method (pageIsClosed()) to WebFrameProxy for it.
912
913         * UIProcess/WebFrameProxy.h:
914         (WebKit::WebFrameProxy::pageIsClosed const):
915         * UIProcess/mac/WKPrintingView.mm:
916         (-[WKPrintingView knowsPageRange:]):
917
918 2019-08-30  Alex Christensen  <achristensen@webkit.org>
919
920         Remove HAVE_CFNETWORK_WITH_AUTO_ADDED_HTTP_HEADER_SUPPRESSION_SUPPORT conditional
921         https://bugs.webkit.org/show_bug.cgi?id=201280
922
923         Reviewed by Youenn Fablet.
924
925         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
926         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
927
928 2019-08-30  Alex Christensen  <achristensen@webkit.org>
929
930         Remove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional
931         https://bugs.webkit.org/show_bug.cgi?id=201279
932
933         Reviewed by Darin Adler.
934
935         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
936         (ignoreHSTS):
937         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
938         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
939         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
940
941 2019-08-30  Alex Christensen  <achristensen@webkit.org>
942
943         Allow process cache to cache processes when using a non-default persistent WebsiteDataStore
944         https://bugs.webkit.org/show_bug.cgi?id=201329
945
946         Reviewed by Chris Dumez.
947
948         Treat all persistent sessions the same when deciding whether to clear all cached web processes using a particular website data store.
949         This removes a huge performance regression on warm plt when switching to using a non-default persistent session.
950         I also removed a call to removeSession which is redundant with the one in the WebsiteDataStore destructor, which is where it should be.
951
952         * UIProcess/WebProcessCache.cpp:
953         (WebKit::WebProcessCache::canCacheProcess const):
954         * UIProcess/WebProcessPool.cpp:
955         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
956         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
957
958 2019-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>
959
960         Caret does not appear in text field inside a transformed, overflow: hidden container
961         https://bugs.webkit.org/show_bug.cgi?id=201317
962         <rdar://problem/54859264>
963
964         Reviewed by Simon Fraser.
965
966         Adjust isTransparentOrFullyClipped to use the new methods in RenderLayer and RenderObject. See WebCore ChangeLog
967         for more details.
968
969         * WebProcess/WebPage/ios/WebPageIOS.mm:
970         (WebKit::WebPage::isTransparentOrFullyClipped const):
971
972 2019-08-30  Simon Fraser  <simon.fraser@apple.com>
973
974         Add system tracing points for compositing updates, and touch-event dispatching
975         https://bugs.webkit.org/show_bug.cgi?id=201327
976
977         Reviewed by Alex Christensen.
978         
979         TraceScope in EventDispatcher::dispatchTouchEvents().
980
981         * WebProcess/WebPage/EventDispatcher.cpp:
982         (WebKit::EventDispatcher::dispatchTouchEvents):
983
984 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
985
986         [FTW] Use DirectX SharedResource as basis for SharedBitmap
987         https://bugs.webkit.org/show_bug.cgi?id=201157
988
989         Reviewed by Alex Christensen.
990
991         Currently an ID2D1Bitmap is used as the backing store for the SharedBitmap that is the
992         base type for sharing data between the WebContent Process and the UIProcess. However, this
993         involves moving GPU memory to local memory, copying that memory into the SharedMemory member
994         of the SharedBitmap, then building a new GPU bitmap on the UIProcess side from that SharedMemory.
995
996         Profiling indicates that this is the single largest place FTW WebKit spends its time.
997
998         Instead, we should use Direct2D's ability to render to an IDXGISurface, which can be shared
999         between multiple processes. This should avoid the GPU->CPU copy, the Direct2D-allocated
1000         CPU->Shared Memory copy, and the shared memory to GPU copy.
1001
1002         Reviewed by Alex Christensen.
1003
1004         * Platform/SharedMemory.h:
1005         * Platform/win/SharedMemoryWin.cpp:
1006         (WebKit::SharedMemory::Handle::encodeHandle): Added.
1007         (WebKit::SharedMemory::Handle::encode const): Use new helper function.
1008         (WebKit::SharedMemory::Handle::decodeHandle): Added.
1009         (WebKit::SharedMemory::Handle::decode): Use new helper function.
1010         * PlatformFTW.cmake: Add D3X11 libraries.
1011         * Shared/ShareableBitmap.cpp:
1012         (WebKit::ShareableBitmap::Configuration::encode const): Encode shared resource handle for DX texture.
1013         (WebKit::ShareableBitmap::Configuration::decode): Ditto (but decode).
1014         (WebKit::ShareableBitmap::ShareableBitmap): Create SharedResource (if needed).
1015         (WebKit::ShareableBitmap::~ShareableBitmap): Add cleanup code for SharedResoure.
1016         (WebKit::ShareableBitmap::numBytesForSize): Only allocate a small memory store when using GPU textures.
1017         * Shared/ShareableBitmap.h:
1018         (WebKit::ShareableBitmap::dxSurface):
1019         * Shared/win/ShareableBitmapDirect2D.cpp:
1020         (WebKit::ShareableBitmap::createSharedResource): Added.
1021         (WebKit::ShareableBitmap::disposeSharedResource): Added.
1022         (WebKit::ShareableBitmap::leakSharedResource): Added.
1023         (WebKit::ShareableBitmap::createGraphicsContext): Update for new data types.
1024         (WebKit::ShareableBitmap::paint): Ditto.
1025         (WebKit::ShareableBitmap::createDirect2DSurface): Update for new data types.
1026         (WebKit::ShareableBitmap::createImage): Ditto.
1027         (WebKit::createSurfaceFromData): Deleted.
1028         (WebKit::ShareableBitmap::sync): Deleted.
1029         * UIProcess/BackingStore.cpp:
1030         * UIProcess/BackingStore.h:
1031         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
1032         * UIProcess/WebPageProxy.cpp:
1033         * UIProcess/WebPageProxy.h:
1034         * UIProcess/win/BackingStoreDirect2D.cpp:
1035         (WebKit::BackingStore::createBackend):
1036         (WebKit::BackingStore::paint):
1037         (WebKit::BackingStore::incorporateUpdate):
1038         * UIProcess/win/PageClientImpl.cpp:
1039         * UIProcess/win/WebPageProxyWin.cpp:
1040         (WebKit::WebPageProxy::device const):
1041         (WebKit::WebPageProxy::setDevice):
1042         * UIProcess/win/WebView.cpp:
1043         (WebKit::WebView::WebView): Initialize DirectX stuff.
1044         (WebKit::WebView::paint): Use new DiretX drawing logic.
1045         (WebKit::WebView::onSizeEvent): Update SwapChain's buffer sizes when resizing.
1046         (WebKit::WebView::setupSwapChain): Added.
1047         (WebKit::WebView::configureBackingStore): Added.
1048         * UIProcess/win/WebView.h:
1049         (WebKit::WebView::d3dDevice):
1050         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1051         (WebKit::DrawingAreaCoordinatedGraphics::display):
1052
1053 2019-08-30  Chris Dumez  <cdumez@apple.com>
1054
1055         [PSON] Bump the WebPage's identifier every time we process-swap
1056         https://bugs.webkit.org/show_bug.cgi?id=201225
1057
1058         Reviewed by Alex Christensen.
1059
1060         Every time we create a new WebPage object in a provisional process, we now assign it a new
1061         identifier, instead of using the identifier of the WebPage in the committed process. This
1062         will address issues with IPC when navigating back and forth between processes since we will
1063         no longer be confused as to which WebPage the IPC is coming from. Also, this will allow
1064         suspended WebPages to keep living in the process, even if we use the process for a new load
1065         (will be done in a follow-up patch) since we will no longer have an identifier conflict.
1066
1067         * Scripts/webkit/messages.py:
1068         * Shared/API/APIPageHandle.cpp:
1069         (API::PageHandle::create):
1070         (API::PageHandle::createAutoconverting):
1071         (API::PageHandle::PageHandle):
1072         (API::PageHandle::encode const):
1073         (API::PageHandle::decode):
1074         * Shared/API/APIPageHandle.h:
1075         (API::PageHandle::pageProxyID const):
1076         (API::PageHandle::webPageID const):
1077         * Shared/API/Cocoa/WKBrowsingContextHandle.mm:
1078         (-[WKBrowsingContextHandle _initWithPageProxy:]):
1079         (-[WKBrowsingContextHandle _initWithPage:]):
1080         (-[WKBrowsingContextHandle _initWithPageProxyID:andWebPageID:]):
1081         (-[WKBrowsingContextHandle hash]):
1082         (-[WKBrowsingContextHandle isEqual:]):
1083         (-[WKBrowsingContextHandle encodeWithCoder:]):
1084         (-[WKBrowsingContextHandle initWithCoder:]):
1085         * Shared/API/Cocoa/WKBrowsingContextHandleInternal.h:
1086         * Shared/WebPageCreationParameters.cpp:
1087         (WebKit::WebPageCreationParameters::encode const):
1088         (WebKit::WebPageCreationParameters::decode):
1089         * Shared/WebPageCreationParameters.h:
1090         * Shared/mac/ObjCObjectGraph.mm:
1091         (WebKit::ObjCObjectGraph::encode):
1092         (WebKit::ObjCObjectGraph::decode):
1093         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1094         (-[WKBrowsingContextController handle]):
1095         * UIProcess/API/Cocoa/WKWebView.mm:
1096         (-[WKWebView dealloc]):
1097         (-[WKWebView _remoteObjectRegistry]):
1098         (-[WKWebView _handle]):
1099         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
1100         (webkitURISchemeRequestCreate):
1101         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1102         (WebKit::WebProcessProxy::transformHandlesToObjects):
1103         * UIProcess/Cocoa/WebViewImpl.mm:
1104         (WebKit::WebViewImpl::~WebViewImpl):
1105         (WebKit::WebViewImpl::remoteObjectRegistry):
1106         * UIProcess/Network/NetworkProcessProxy.cpp:
1107         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1108         (WebKit::NetworkProcessProxy::logDiagnosticMessage):
1109         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
1110         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
1111         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
1112         (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
1113         (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
1114         * UIProcess/ProvisionalPageProxy.cpp:
1115         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1116         (WebKit::ProvisionalPageProxy::loadData):
1117         (WebKit::ProvisionalPageProxy::loadRequest):
1118         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
1119         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
1120         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
1121         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
1122         * UIProcess/ProvisionalPageProxy.h:
1123         (WebKit::ProvisionalPageProxy::webPageID const):
1124         * UIProcess/SuspendedPageProxy.h:
1125         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1126         (WebKit::WebUserContentControllerProxy::didPostMessage):
1127         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1128         * UIProcess/UserContent/WebUserContentControllerProxy.messages.in:
1129         * UIProcess/VisitedLinkStore.cpp:
1130         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
1131         * UIProcess/VisitedLinkStore.h:
1132         * UIProcess/VisitedLinkStore.messages.in:
1133         * UIProcess/WebInspectorProxy.cpp:
1134         (WebKit::WebInspectorProxy::createFrontendPage):
1135         (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
1136         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
1137         * UIProcess/WebPageProxy.cpp:
1138         (WebKit::WebPageProxy::swapToWebProcess):
1139         (WebKit::WebPageProxy::loadRequest):
1140         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
1141         (WebKit::WebPageProxy::loadData):
1142         (WebKit::WebPageProxy::loadDataWithNavigationShared):
1143         (WebKit::WebPageProxy::commitProvisionalPage):
1144         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1145         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
1146         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
1147         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1148         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1149         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
1150         (WebKit::WebPageProxy::decidePolicyForResponse):
1151         (WebKit::WebPageProxy::decidePolicyForResponseShared):
1152         (WebKit::WebPageProxy::createNewPage):
1153         (WebKit::WebPageProxy::creationParameters):
1154         (WebKit::WebPageProxy::startURLSchemeTask):
1155         (WebKit::WebPageProxy::startURLSchemeTaskShared):
1156         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
1157         * UIProcess/WebPageProxy.h:
1158         * UIProcess/WebPageProxy.messages.in:
1159         * UIProcess/WebProcessProxy.cpp:
1160         (WebKit::WebProcessProxy::webPageFromCorePageIdentifier):
1161         (WebKit::WebProcessProxy::didReceiveMessage):
1162         (WebKit::WebProcessProxy::transformHandlesToObjects):
1163         (WebKit::WebProcessProxy::transformObjectsToHandles):
1164         * UIProcess/WebProcessProxy.h:
1165         * UIProcess/WebURLSchemeHandler.cpp:
1166         (WebKit::WebURLSchemeHandler::startTask):
1167         (WebKit::WebURLSchemeHandler::taskCompleted):
1168         * UIProcess/WebURLSchemeHandler.h:
1169         * UIProcess/WebURLSchemeTask.cpp:
1170         (WebKit::WebURLSchemeTask::create):
1171         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
1172         (WebKit::WebURLSchemeTask::didPerformRedirection):
1173         (WebKit::WebURLSchemeTask::didReceiveResponse):
1174         (WebKit::WebURLSchemeTask::didReceiveData):
1175         (WebKit::WebURLSchemeTask::didComplete):
1176         (WebKit::WebURLSchemeTask::pageDestroyed):
1177         * UIProcess/WebURLSchemeTask.h:
1178         (WebKit::WebURLSchemeTask::pageProxyID const):
1179         (WebKit::WebURLSchemeTask::webPageID const):
1180         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1181         (-[WKWebProcessPlugInBrowserContextController handle]):
1182         (+[WKWebProcessPlugInBrowserContextController lookUpBrowsingContextFromHandle:]):
1183         * WebProcess/UserContent/WebUserContentController.cpp:
1184         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1185         (WebKit::WebChromeClient::createWindow):
1186         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1187         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1188         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
1189         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
1190         (WebKit::WebRemoteObjectRegistry::close):
1191         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1192         (WebKit::VisitedLinkTableController::addVisitedLink):
1193         * WebProcess/WebPage/WebInspectorUI.cpp:
1194         (WebKit::WebInspectorUI::establishConnection):
1195         * WebProcess/WebPage/WebInspectorUI.h:
1196         * WebProcess/WebPage/WebInspectorUI.messages.in:
1197         * WebProcess/WebPage/WebPage.cpp:
1198         * WebProcess/WebPage/WebPage.h:
1199         (WebKit::WebPage::sessionStorageNamespaceIdentifier const):
1200         (WebKit::WebPage::webPageProxyIdentifier const):
1201         * WebProcess/WebProcess.cpp:
1202         (WebKit::WebProcess::didReceiveMessage):
1203         (WebKit::WebProcess::transformHandlesToObjects):
1204         (WebKit::WebProcess::transformObjectsToHandles):
1205         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1206         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
1207         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
1208         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
1209         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
1210         (WebKit::StorageNamespaceImpl::copy):
1211         (WebKit::StorageNamespaceImpl::sessionStoragePageID const):
1212         * WebProcess/WebStorage/StorageNamespaceImpl.h:
1213         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
1214         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
1215         * WebProcess/cocoa/WebProcessCocoa.mm:
1216         (WebKit::WebProcess::transformHandlesToObjects):
1217
1218 2019-08-30  Keith Rollin  <krollin@apple.com>
1219
1220         Remove AppKitCompatibilityDeclarations.h
1221         https://bugs.webkit.org/show_bug.cgi?id=201283
1222         <rdar://problem/54822042>
1223
1224         Reviewed by Alexey Proskuryakov.
1225
1226         The two copies of these files -- on in WTF, one in MiniBrowser -- are
1227         empty and can be removed.
1228
1229         * WebKit2Prefix.h:
1230
1231 2019-08-30  Adrian Perez de Castro  <aperez@igalia.com>
1232
1233         [WPE][GTK] New API to remove a filter from an user content manager given its identifier
1234         https://bugs.webkit.org/show_bug.cgi?id=200479
1235
1236         Reviewed by Carlos Garcia Campos.
1237
1238         * UIProcess/API/glib/WebKitUserContentManager.cpp:
1239         (webkit_user_content_manager_remove_filter_by_id): Add new public API function.
1240         * UIProcess/API/gtk/WebKitUserContentManager.h: Add declaration for
1241         webkit_user_content_manager_remove_filter_by_id().
1242         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: List new function.
1243         * UIProcess/API/wpe/WebKitUserContentManager.h: Add declaration for
1244         webkit_user_content_manager_remove_filter_by_id().
1245         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: List new function.
1246
1247 2019-08-30  Pablo Saavedra  <psaavedra@igalia.com>
1248
1249         [GTK] Build failure in Debian Stable and Ubuntu LTS bots
1250         https://bugs.webkit.org/show_bug.cgi?id=201337
1251
1252         Reviewed by Carlos Garcia Campos.
1253
1254         * UIProcess/gtk/WaylandCompositor.cpp:
1255         (WebKit::WaylandCompositor::bindSurfaceToWebPage):
1256
1257 2019-08-30  Philippe Normand  <pnormand@igalia.com>
1258
1259         [WPE][Qt] loadingChanged signal parameter is unusable
1260         https://bugs.webkit.org/show_bug.cgi?id=201301
1261
1262         Reviewed by Carlos Garcia Campos.
1263
1264         * UIProcess/API/wpe/qt/WPEQtView.h: Explicitely name signal
1265         parameter. It is a runtime requirement for QML.
1266
1267 2019-08-29  Keith Rollin  <krollin@apple.com>
1268
1269         Remove HAVE_PASSKIT_GRANULAR_ERRORS conditional
1270         https://bugs.webkit.org/show_bug.cgi?id=201278
1271         <rdar://problem/54821052>
1272
1273         Reviewed by Alex Christensen.
1274
1275         HAVE_PASSKIT_GRANULAR_ERRORS is always True, so remove the conditional
1276         tests, keeping the True branches and removing the False branches.
1277
1278         * Platform/cocoa/PaymentAuthorizationPresenter.mm:
1279         (WebKit::PaymentAuthorizationPresenter::completePaymentSession):
1280         (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
1281         * Platform/cocoa/PaymentAuthorizationViewController.mm:
1282         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
1283         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
1284         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
1285         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
1286         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
1287         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
1288         (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
1289         (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]):
1290         (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
1291         (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
1292         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1293         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
1294         (WebKit::toPKContactFields):
1295         (WebKit::toNSSet):
1296         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
1297         (WebKit::toPKAddressField): Deleted.
1298
1299 2019-08-29  Chris Dumez  <cdumez@apple.com>
1300
1301         Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
1302         https://bugs.webkit.org/show_bug.cgi?id=201318
1303
1304         Reviewed by Alex Christensen.
1305
1306         Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.
1307
1308         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
1309         (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const):
1310         (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const):
1311         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
1312         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
1313         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1314         (WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const):
1315         (WebKit::NetworkCache::BlobStorage::synchronize):
1316         (WebKit::NetworkCache::BlobStorage::blobPathForHash const):
1317         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
1318         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1319         (WebKit::NetworkCache::Storage::basePathIsolatedCopy const):
1320         (WebKit::NetworkCache::Storage::versionPath const):
1321         (WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const):
1322         (WebKit::NetworkCache::Storage::synchronize):
1323         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey const):
1324         (WebKit::NetworkCache::Storage::traverse):
1325         (WebKit::NetworkCache::Storage::clear):
1326         (WebKit::NetworkCache::Storage::shrink):
1327         (WebKit::NetworkCache::Storage::deleteOldVersions):
1328         * NetworkProcess/cache/NetworkCacheStorage.h:
1329
1330 2019-08-29  Keith Rollin  <krollin@apple.com>
1331
1332         Update .xcconfig symbols to reflect the current set of past and future product versions.
1333         https://bugs.webkit.org/show_bug.cgi?id=200720
1334         <rdar://problem/54305032>
1335
1336         Reviewed by Alex Christensen.
1337
1338         Remove version symbols related to old OS's we no longer support,
1339         ensure that version symbols are defined for OS's we do support.
1340
1341         * Configurations/Base.xcconfig:
1342         * Configurations/DebugRelease.xcconfig:
1343         * Configurations/Version.xcconfig:
1344
1345 2019-08-29  Keith Rollin  <krollin@apple.com>
1346
1347         Invalid XPCServices symlinks are being created
1348         https://bugs.webkit.org/show_bug.cgi?id=201320
1349         <rdar://problem/54719612>
1350
1351         Reviewed by Dan Bernstein.
1352
1353         When performing incremental builds, errant XPCServices symlinks can be
1354         created. For example, in the following, the second symlink is the
1355         correct one. The first symlink gets created when the build process
1356         tries to create the symlink and it already exists. When it already
1357         exists, the command to create the symlink actually follows the
1358         existing symlink and creates the (second) symlink at the location
1359         where the first symlink points.
1360
1361             WebKit.framework/Versions/A/XPCServices/XPCServices@ -> Versions/Current/XPCServices
1362             WebKit.framework/XPCServices@ -> Versions/Current/XPCServices
1363
1364         Address this by specifying -h to the `ln` command, which will cause it
1365         to not follow symlinks if they already exist at the target.
1366
1367         Also, fix a benign issue where the Xcode build variable WRAPPER_NAME
1368         was being referenced in a context where it wasn't defined.
1369
1370         * WebKit.xcodeproj/project.pbxproj:
1371
1372 2019-08-29  Alex Christensen  <achristensen@webkit.org>
1373
1374         Speculative loads should use the NetworkSession owning their Cache
1375         https://bugs.webkit.org/show_bug.cgi?id=201314
1376
1377         Reviewed by Chris Dumez.
1378
1379         This provides a performance improvement when using non-default persistent WKWebsiteDataStores.
1380
1381         * NetworkProcess/NetworkSession.cpp:
1382         (WebKit::NetworkSession::NetworkSession):
1383         * NetworkProcess/cache/NetworkCache.cpp:
1384         (WebKit::NetworkCache::Cache::open):
1385         (WebKit::NetworkCache::Cache::Cache):
1386         * NetworkProcess/cache/NetworkCache.h:
1387         (WebKit::NetworkCache::Cache::sessionID const):
1388         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1389         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1390
1391 2019-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1392
1393         [iOS 13] Caret does not appear in text field if the body element is translated completely out of the viewport
1394         https://bugs.webkit.org/show_bug.cgi?id=201287
1395         <rdar://problem/54780864>
1396
1397         Reviewed by Tim Horton.
1398
1399         During EditorState computation, we use the hidden editable element heuristic to determine whether we should
1400         begin suppressing selection gestures and UI. Currently, we use the editable root of the selection range to
1401         determine where in the layer tree we should start our ascent, in search of a completely transparent or
1402         completely clipped container.
1403
1404         However, in the case where the selection is inside a focused text field, this causes us to walk up the layer
1405         tree starting at the RenderLayer corresponding to the text field's inner contenteditable div, which is different
1406         than the text field's enclosing RenderLayer in the case where the containing block is transformed, such that no
1407         part of it is within the visible viewport. This scenario is exercised by the below test case, in which the caret
1408         after transforming the body horizontally by -100vw is hidden due to a false positive in the hidden editable area
1409         heuristic.
1410
1411         Fix this by starting the layer tree ascent from the enclosing layer of the text form control if applicable,
1412         instead of the inner editable area under the shadow root of the form control.
1413
1414         Test: editing/selection/ios/show-selection-in-transformed-container.html
1415
1416         * WebProcess/WebPage/ios/WebPageIOS.mm:
1417         (WebKit::WebPage::platformEditorState const):
1418
1419 2019-08-29  Youenn Fablet  <youenn@apple.com>
1420
1421         Skip fetch event dispatching if no fetch event handler is added at script evaluation time
1422         https://bugs.webkit.org/show_bug.cgi?id=201174
1423
1424         Reviewed by Chris Dumez.
1425
1426         Store whether a fetch event handler is set at script evaluation time.
1427         If not, we skip the fetch event entirely so that the network load can start sooner.
1428         If fetch event is skipped, we trigger soft update, as defined in
1429         https://w3c.github.io/ServiceWorker/#handle-fetch step 16.
1430
1431         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1432         (WebKit::WebSWServerConnection::startFetch):
1433         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1434         (WebKit::WebSWServerToContextConnection::softUpdate):
1435         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
1436         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1437         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1438         (WebKit::WebSWContextManagerConnection::serviceWorkerStarted):
1439         (WebKit::WebSWContextManagerConnection::serviceWorkerFailedToStart):
1440         (WebKit::WebSWContextManagerConnection::softUpdate):
1441         * WebProcess/Storage/WebSWContextManagerConnection.h:
1442         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1443
1444 2019-08-29  Keith Rollin  <krollin@apple.com>
1445
1446         Remove support for macOS < 10.13 (part 3)
1447         https://bugs.webkit.org/show_bug.cgi?id=201224
1448         <rdar://problem/54795934>
1449
1450         Reviewed by Darin Adler.
1451
1452         Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
1453         10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
1454         like _MACOS_SINCE_1013.
1455
1456         * Configurations/WebKitTargetConditionals.xcconfig:
1457
1458 2019-08-29  Youenn Fablet  <youenn@apple.com>
1459
1460         Use WebPageProxy callbacks in case of authentication challenge received from Service Worker
1461         https://bugs.webkit.org/show_bug.cgi?id=201177
1462
1463         Reviewed by Alex Christensen.
1464
1465         Send topOrigin for every possible load to NetworkProcess.
1466         Send topOrigin as part of authentication challenge to UIProcess.
1467
1468         If there is no corresponding page for the pageID, try getting a page
1469         related to the service worker using the topOrigin and send the challenge to it.
1470
1471         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1472         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1473         * NetworkProcess/NetworkCORSPreflightChecker.h:
1474         * NetworkProcess/NetworkLoad.cpp:
1475         (WebKit::NetworkLoad::didReceiveChallenge):
1476         * NetworkProcess/NetworkLoadChecker.cpp:
1477         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1478         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1479         * NetworkProcess/NetworkLoadChecker.h:
1480         * NetworkProcess/NetworkLoadParameters.h:
1481         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1482         (WebKit::NetworkResourceLoadParameters::encode const):
1483         (WebKit::NetworkResourceLoadParameters::decode):
1484         * NetworkProcess/NetworkResourceLoadParameters.h:
1485         * NetworkProcess/NetworkResourceLoader.cpp:
1486         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
1487         * NetworkProcess/PingLoad.cpp:
1488         (WebKit::PingLoad::PingLoad):
1489         (WebKit::PingLoad::didReceiveChallenge):
1490         * Shared/Authentication/AuthenticationManager.cpp:
1491         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1492         * Shared/Authentication/AuthenticationManager.h:
1493         * UIProcess/Network/NetworkProcessProxy.cpp:
1494         (WebKit::NetworkProcessProxy::processAuthenticationChallenge):
1495         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1496         * UIProcess/Network/NetworkProcessProxy.h:
1497         * UIProcess/Network/NetworkProcessProxy.messages.in:
1498         * UIProcess/WebPageProxy.cpp:
1499         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
1500         * UIProcess/WebPageProxy.h:
1501         * WebProcess/Network/WebLoaderStrategy.cpp:
1502         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1503         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1504         (WebKit::WebLoaderStrategy::startPingLoad):
1505
1506 2019-08-29  Chris Dumez  <cdumez@apple.com>
1507
1508         Dissociate the WebPageProxy's identifier from the WebPage's
1509         https://bugs.webkit.org/show_bug.cgi?id=201233
1510
1511         Reviewed by Alex Christensen.
1512
1513         Dissociate the WebPageProxy's identifier from the WebPage's. This will allow bumping the
1514         WebPage's identifier everytime we create a WebPage in a new process in case of process
1515         swap on navigation (Bug 201225).
1516
1517         * Shared/WebBackForwardListItem.cpp:
1518         (WebKit::WebBackForwardListItem::create):
1519         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
1520         * Shared/WebBackForwardListItem.h:
1521         (WebKit::WebBackForwardListItem::pageID const):
1522         * UIProcess/API/C/WKPage.cpp:
1523         (WKPageSetPageLoaderClient):
1524         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1525         (-[WKBrowsingContextController handle]):
1526         * UIProcess/API/Cocoa/WKWebView.mm:
1527         (-[WKWebView dealloc]):
1528         (-[WKWebView _didCommitLayerTree:]):
1529         (-[WKWebView _dispatchSetViewLayoutSize:]):
1530         (-[WKWebView _cancelAnimatedResize]):
1531         (-[WKWebView _remoteObjectRegistry]):
1532         (-[WKWebView _handle]):
1533         (-[WKWebView _focusTextInputContext:completionHandler:]):
1534         (-[WKWebView _endAnimatedResize]):
1535         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
1536         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
1537         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1538         (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
1539         * UIProcess/API/glib/WebKitWebContext.cpp:
1540         (webkitWebContextGetWebViewForPage):
1541         * UIProcess/API/glib/WebKitWebView.cpp:
1542         (webkit_web_view_get_page_id):
1543         * UIProcess/Automation/WebAutomationSession.cpp:
1544         (WebKit::WebAutomationSession::handleForWebPageProxy):
1545         (WebKit::WebAutomationSession::switchToBrowsingContext):
1546         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
1547         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
1548         (WebKit::WebAutomationSession::navigationOccurredForFrame):
1549         (WebKit::WebAutomationSession::documentLoadedForFrame):
1550         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
1551         (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
1552         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
1553         (WebKit::WebAutomationSession::willClosePage):
1554         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1555         (WebKit::WebAutomationSession::resolveChildFrameHandle):
1556         (WebKit::WebAutomationSession::resolveParentFrameHandle):
1557         (WebKit::WebAutomationSession::computeElementLayout):
1558         (WebKit::WebAutomationSession::selectOptionElement):
1559         (WebKit::WebAutomationSession::getAllCookies):
1560         (WebKit::WebAutomationSession::deleteSingleCookie):
1561         (WebKit::WebAutomationSession::inputDispatcherForPage):
1562         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
1563         (WebKit::WebAutomationSession::simulateMouseInteraction):
1564         (WebKit::WebAutomationSession::simulateKeyboardInteraction):
1565         (WebKit::WebAutomationSession::performMouseInteraction):
1566         (WebKit::WebAutomationSession::performKeyboardInteractions):
1567         (WebKit::WebAutomationSession::takeScreenshot):
1568         * UIProcess/Automation/WebAutomationSession.h:
1569         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1570         (WebKit::WebAutomationSession::inspectBrowsingContext):
1571         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1572         (WebKit::PlaybackSessionManagerProxy::PlaybackSessionManagerProxy):
1573         (WebKit::PlaybackSessionManagerProxy::invalidate):
1574         * UIProcess/Cocoa/TextCheckingController.mm:
1575         (WebKit::TextCheckingController::replaceRelativeToSelection):
1576         (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
1577         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1578         (WebKit::VideoFullscreenManagerProxy::VideoFullscreenManagerProxy):
1579         (WebKit::VideoFullscreenManagerProxy::invalidate):
1580         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1581         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
1582         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
1583         (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver):
1584         (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver):
1585         (WebKit::WebPageProxy::speakingErrorOccurred):
1586         (WebKit::WebPageProxy::boundaryEventOccurred):
1587         (WebKit::WebPageProxy::voicesDidChange):
1588         * UIProcess/Cocoa/WebViewImpl.mm:
1589         (WebKit::WebViewImpl::~WebViewImpl):
1590         (WebKit::WebViewImpl::windowDidOrderOffScreen):
1591         (WebKit::WebViewImpl::windowDidOrderOnScreen):
1592         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
1593         (WebKit::WebViewImpl::viewDidHide):
1594         (WebKit::WebViewImpl::viewDidUnhide):
1595         (WebKit::WebViewImpl::activeSpaceDidChange):
1596         (WebKit::WebViewImpl::remoteObjectRegistry):
1597         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
1598         (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
1599         * UIProcess/InspectorTargetProxy.cpp:
1600         (WebKit::InspectorTargetProxy::connect):
1601         (WebKit::InspectorTargetProxy::disconnect):
1602         (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
1603         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
1604         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
1605         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
1606         (WebKit::WebNotificationManagerProxy::show):
1607         (WebKit::WebNotificationManagerProxy::cancel):
1608         (WebKit::WebNotificationManagerProxy::didDestroyNotification):
1609         (WebKit::pageIDsMatch):
1610         (WebKit::pageAndNotificationIDsMatch):
1611         (WebKit::WebNotificationManagerProxy::clearNotifications):
1612         (WebKit::WebNotificationManagerProxy::providerDidShowNotification):
1613         (WebKit::WebNotificationManagerProxy::providerDidClickNotification):
1614         * UIProcess/Notifications/WebNotificationManagerProxy.h:
1615         * UIProcess/ProvisionalPageProxy.cpp:
1616         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1617         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
1618         (WebKit::ProvisionalPageProxy::processDidTerminate):
1619         (WebKit::ProvisionalPageProxy::cancel):
1620         (WebKit::ProvisionalPageProxy::initializeWebPage):
1621         (WebKit::ProvisionalPageProxy::loadData):
1622         (WebKit::ProvisionalPageProxy::loadRequest):
1623         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
1624         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
1625         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
1626         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
1627         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
1628         * UIProcess/ProvisionalPageProxy.h:
1629         * UIProcess/RemoteWebInspectorProxy.cpp:
1630         (WebKit::RemoteWebInspectorProxy::load):
1631         (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
1632         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
1633         (WebKit::RemoteWebInspectorProxy::closeFrontendPageAndWindow):
1634         * UIProcess/SuspendedPageProxy.cpp:
1635         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1636         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1637         (WebKit::SuspendedPageProxy::unsuspend):
1638         (WebKit::SuspendedPageProxy::close):
1639         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
1640         (WebKit::SuspendedPageProxy::loggingString const):
1641         * UIProcess/SuspendedPageProxy.h:
1642         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1643         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
1644         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
1645         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
1646         * UIProcess/ViewGestureController.cpp:
1647         (WebKit::ViewGestureController::ViewGestureController):
1648         (WebKit::ViewGestureController::~ViewGestureController):
1649         (WebKit::ViewGestureController::disconnectFromProcess):
1650         (WebKit::ViewGestureController::connectToProcess):
1651         (WebKit::ViewGestureController::controllerForGesture):
1652         (WebKit::ViewGestureController::forceRepaintIfNeeded):
1653         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
1654         * UIProcess/ViewGestureController.h:
1655         * UIProcess/VisitedLinkStore.cpp:
1656         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
1657         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
1658         (WebKit::WebAuthenticatorCoordinatorProxy::WebAuthenticatorCoordinatorProxy):
1659         (WebKit::WebAuthenticatorCoordinatorProxy::~WebAuthenticatorCoordinatorProxy):
1660         * UIProcess/WebBackForwardList.cpp:
1661         (WebKit::WebBackForwardList::itemForID):
1662         (WebKit::WebBackForwardList::restoreFromState):
1663         * UIProcess/WebEditCommandProxy.cpp:
1664         (WebKit::WebEditCommandProxy::unapply):
1665         (WebKit::WebEditCommandProxy::reapply):
1666         * UIProcess/WebFrameProxy.cpp:
1667         (WebKit::WebFrameProxy::loadURL):
1668         (WebKit::WebFrameProxy::loadData):
1669         (WebKit::WebFrameProxy::stopLoading const):
1670         (WebKit::WebFrameProxy::collapseSelection):
1671         * UIProcess/WebFullScreenManagerProxy.cpp:
1672         (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
1673         (WebKit::WebFullScreenManagerProxy::~WebFullScreenManagerProxy):
1674         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
1675         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
1676         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
1677         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
1678         (WebKit::WebFullScreenManagerProxy::setAnimatingFullScreen):
1679         (WebKit::WebFullScreenManagerProxy::requestExitFullScreen):
1680         (WebKit::WebFullScreenManagerProxy::saveScrollPosition):
1681         (WebKit::WebFullScreenManagerProxy::restoreScrollPosition):
1682         (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
1683         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
1684         (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
1685         * UIProcess/WebInspectorProxy.cpp:
1686         (WebKit::WebInspectorProxy::WebInspectorProxy):
1687         (WebKit::WebInspectorProxy::invalidate):
1688         (WebKit::WebInspectorProxy::sendMessageToFrontend):
1689         (WebKit::WebInspectorProxy::connect):
1690         (WebKit::WebInspectorProxy::close):
1691         (WebKit::WebInspectorProxy::reset):
1692         (WebKit::WebInspectorProxy::updateForNewPageProcess):
1693         (WebKit::WebInspectorProxy::setFrontendConnection):
1694         (WebKit::WebInspectorProxy::showConsole):
1695         (WebKit::WebInspectorProxy::showResources):
1696         (WebKit::WebInspectorProxy::showMainResourceForFrame):
1697         (WebKit::WebInspectorProxy::attach):
1698         (WebKit::WebInspectorProxy::detach):
1699         (WebKit::WebInspectorProxy::togglePageProfiling):
1700         (WebKit::WebInspectorProxy::toggleElementSelection):
1701         (WebKit::WebInspectorProxy::createFrontendPage):
1702         (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
1703         (WebKit::WebInspectorProxy::open):
1704         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
1705         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
1706         * UIProcess/WebPageProxy.cpp:
1707         (WebKit::WebPageProxy::WebPageProxy):
1708         (WebKit::m_resetRecentCrashCountTimer):
1709         (WebKit::WebPageProxy::~WebPageProxy):
1710         (WebKit::WebPageProxy::setUIClient):
1711         (WebKit::WebPageProxy::setIconLoadingClient):
1712         (WebKit::WebPageProxy::launchProcess):
1713         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1714         (WebKit::WebPageProxy::swapToWebProcess):
1715         (WebKit::WebPageProxy::launchProcessForReload):
1716         (WebKit::WebPageProxy::launchProcessWithItem):
1717         (WebKit::WebPageProxy::initializeWebPage):
1718         (WebKit::WebPageProxy::close):
1719         (WebKit::WebPageProxy::tryClose):
1720         (WebKit::WebPageProxy::loadRequest):
1721         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
1722         (WebKit::WebPageProxy::loadFile):
1723         (WebKit::WebPageProxy::loadData):
1724         (WebKit::WebPageProxy::loadDataWithNavigationShared):
1725         (WebKit::WebPageProxy::loadAlternateHTML):
1726         (WebKit::WebPageProxy::loadWebArchiveData):
1727         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
1728         (WebKit::WebPageProxy::stopLoading):
1729         (WebKit::WebPageProxy::reload):
1730         (WebKit::WebPageProxy::goToBackForwardItem):
1731         (WebKit::WebPageProxy::tryRestoreScrollPosition):
1732         (WebKit::WebPageProxy::setControlledByAutomation):
1733         (WebKit::WebPageProxy::setIndicating):
1734         (WebKit::WebPageProxy::createInspectorTargets):
1735         (WebKit::WebPageProxy::setBackgroundColor):
1736         (WebKit::WebPageProxy::setTopContentInset):
1737         (WebKit::WebPageProxy::setUnderlayColor):
1738         (WebKit::WebPageProxy::viewWillStartLiveResize):
1739         (WebKit::WebPageProxy::viewWillEndLiveResize):
1740         (WebKit::WebPageProxy::activityStateDidChange):
1741         (WebKit::WebPageProxy::viewDidEnterWindow):
1742         (WebKit::WebPageProxy::dispatchActivityStateChange):
1743         (WebKit::WebPageProxy::layerHostingModeDidChange):
1744         (WebKit::WebPageProxy::setInitialFocus):
1745         (WebKit::WebPageProxy::clearSelection):
1746         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
1747         (WebKit::WebPageProxy::validateCommand):
1748         (WebKit::WebPageProxy::increaseListLevel):
1749         (WebKit::WebPageProxy::decreaseListLevel):
1750         (WebKit::WebPageProxy::changeListType):
1751         (WebKit::WebPageProxy::setBaseWritingDirection):
1752         (WebKit::WebPageProxy::setNeedsFontAttributes):
1753         (WebKit::WebPageProxy::scheduleFullEditorStateUpdate):
1754         (WebKit::WebPageProxy::selectAll):
1755         (WebKit::WebPageProxy::executeEditCommand):
1756         (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
1757         (WebKit::WebPageProxy::setEditable):
1758         (WebKit::WebPageProxy::performDragControllerAction):
1759         (WebKit::WebPageProxy::dragEnded):
1760         (WebKit::WebPageProxy::didStartDrag):
1761         (WebKit::WebPageProxy::dragCancelled):
1762         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
1763         (WebKit::WebPageProxy::sendWheelEvent):
1764         (WebKit::WebPageProxy::handleKeyboardEvent):
1765         (WebKit::WebPageProxy::handleGestureEvent):
1766         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1767         (WebKit::WebPageProxy::resetPotentialTapSecurityOrigin):
1768         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
1769         (WebKit::WebPageProxy::handleTouchEvent):
1770         (WebKit::WebPageProxy::cancelPointer):
1771         (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
1772         (WebKit::WebPageProxy::scrollBy):
1773         (WebKit::WebPageProxy::centerSelectionInVisibleArea):
1774         (WebKit::WebPageProxy::commitProvisionalPage):
1775         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1776         (WebKit::WebPageProxy::setUserAgent):
1777         (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
1778         (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
1779         (WebKit::WebPageProxy::setCustomTextEncodingName):
1780         (WebKit::WebPageProxy::restoreFromSessionState):
1781         (WebKit::WebPageProxy::setTextZoomFactor):
1782         (WebKit::WebPageProxy::setPageZoomFactor):
1783         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
1784         (WebKit::WebPageProxy::scalePage):
1785         (WebKit::WebPageProxy::scalePageInViewCoordinates):
1786         (WebKit::WebPageProxy::scaleView):
1787         (WebKit::WebPageProxy::windowScreenDidChange):
1788         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
1789         (WebKit::WebPageProxy::setUseFixedLayout):
1790         (WebKit::WebPageProxy::setFixedLayoutSize):
1791         (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
1792         (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
1793         (WebKit::WebPageProxy::listenForLayoutMilestones):
1794         (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
1795         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
1796         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
1797         (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
1798         (WebKit::WebPageProxy::setPaginationMode):
1799         (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
1800         (WebKit::WebPageProxy::setPageLength):
1801         (WebKit::WebPageProxy::setGapBetweenPages):
1802         (WebKit::WebPageProxy::setPaginationLineGridEnabled):
1803         (WebKit::WebPageProxy::findStringMatches):
1804         (WebKit::WebPageProxy::findString):
1805         (WebKit::WebPageProxy::getImageForFindMatch):
1806         (WebKit::WebPageProxy::selectFindMatch):
1807         (WebKit::WebPageProxy::indicateFindMatch):
1808         (WebKit::WebPageProxy::hideFindUI):
1809         (WebKit::WebPageProxy::countStringMatches):
1810         (WebKit::WebPageProxy::replaceMatches):
1811         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
1812         (WebKit::WebPageProxy::runJavaScriptInFrame):
1813         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
1814         (WebKit::WebPageProxy::getSourceForFrame):
1815         (WebKit::WebPageProxy::getContentsAsString):
1816         (WebKit::WebPageProxy::getContentsAsAttributedString):
1817         (WebKit::WebPageProxy::getBytecodeProfile):
1818         (WebKit::WebPageProxy::getSamplingProfilerOutput):
1819         (WebKit::WebPageProxy::getContentsAsMHTMLData):
1820         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
1821         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
1822         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
1823         (WebKit::WebPageProxy::getResourceDataFromFrame):
1824         (WebKit::WebPageProxy::getWebArchiveOfFrame):
1825         (WebKit::WebPageProxy::forceRepaint):
1826         (WebKit::WebPageProxy::preferencesDidChange):
1827         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
1828         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
1829         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
1830         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
1831         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
1832         (WebKit::WebPageProxy::didCommitLoadForFrame):
1833         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1834         (WebKit::WebPageProxy::didFinishLoadForFrame):
1835         (WebKit::WebPageProxy::didFailLoadForFrame):
1836         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1837         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
1838         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1839         (WebKit::WebPageProxy::decidePolicyForResponseShared):
1840         (WebKit::WebPageProxy::willSubmitForm):
1841         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
1842         (WebKit::WebPageProxy::didPerformClientRedirectShared):
1843         (WebKit::WebPageProxy::didPerformServerRedirectShared):
1844         (WebKit::trySOAuthorization):
1845         (WebKit::WebPageProxy::createNewPage):
1846         (WebKit::WebPageProxy::showShareSheet):
1847         (WebKit::WebPageProxy::setMediaVolume):
1848         (WebKit::WebPageProxy::setMuted):
1849         (WebKit::WebPageProxy::stopMediaCapture):
1850         (WebKit::WebPageProxy::stopAllMediaPlayback):
1851         (WebKit::WebPageProxy::suspendAllMediaPlayback):
1852         (WebKit::WebPageProxy::resumeAllMediaPlayback):
1853         (WebKit::WebPageProxy::handleMediaEvent):
1854         (WebKit::WebPageProxy::setVolumeOfMediaElement):
1855         (WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
1856         (WebKit::WebPageProxy::didChooseColor):
1857         (WebKit::WebPageProxy::didEndColorPicker):
1858         (WebKit::WebPageProxy::didCloseSuggestions):
1859         (WebKit::WebPageProxy::didSelectOption):
1860         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
1861         (WebKit::WebPageProxy::backForwardAddItem):
1862         (WebKit::WebPageProxy::messageSenderDestinationID const):
1863         (WebKit::WebPageProxy::valueChangedForPopupMenu):
1864         (WebKit::WebPageProxy::setTextFromItemForPopupMenu):
1865         (WebKit::WebPageProxy::postMessageToInjectedBundle):
1866         (WebKit::WebPageProxy::failedToShowPopupMenu):
1867         (WebKit::WebPageProxy::showContextMenu):
1868         (WebKit::WebPageProxy::contextMenuItemSelected):
1869         (WebKit::WebPageProxy::handleContextMenuKeyEvent):
1870         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
1871         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1872         (WebKit::WebPageProxy::didCancelForOpenPanel):
1873         (WebKit::WebPageProxy::advanceToNextMisspelling):
1874         (WebKit::WebPageProxy::changeSpellingToWord):
1875         (WebKit::WebPageProxy::removeEditCommand):
1876         (WebKit::WebPageProxy::didFinishCheckingText):
1877         (WebKit::WebPageProxy::didCancelCheckingText):
1878         (WebKit::WebPageProxy::didReceiveEvent):
1879         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
1880         (WebKit::WebPageProxy::processDidBecomeResponsive):
1881         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
1882         (WebKit::WebPageProxy::gamepadActivity):
1883         (WebKit::WebPageProxy::updateWebsitePolicies):
1884         (WebKit::WebPageProxy::backForwardRemovedItem):
1885         (WebKit::WebPageProxy::setCanRunModal):
1886         (WebKit::WebPageProxy::beginPrinting):
1887         (WebKit::WebPageProxy::endPrinting):
1888         (WebKit::WebPageProxy::computePagesForPrinting):
1889         (WebKit::WebPageProxy::drawRectToImage):
1890         (WebKit::WebPageProxy::drawPagesToPDF):
1891         (WebKit::WebPageProxy::drawPagesForPrinting):
1892         (WebKit::WebPageProxy::setMinimumSizeForAutoLayout):
1893         (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
1894         (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
1895         (WebKit::WebPageProxy::handleAlternativeTextUIResult):
1896         (WebKit::WebPageProxy::setComposition):
1897         (WebKit::WebPageProxy::confirmComposition):
1898         (WebKit::WebPageProxy::cancelComposition):
1899         (WebKit::WebPageProxy::setScrollPinningBehavior):
1900         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
1901         (WebKit::WebPageProxy::addMIMETypeWithCustomContentProvider):
1902         (WebKit::WebPageProxy::changeFontAttributes):
1903         (WebKit::WebPageProxy::changeFont):
1904         (WebKit::WebPageProxy::setTextAsync):
1905         (WebKit::WebPageProxy::insertTextAsync):
1906         (WebKit::WebPageProxy::hasMarkedText):
1907         (WebKit::WebPageProxy::getMarkedRangeAsync):
1908         (WebKit::WebPageProxy::getSelectedRangeAsync):
1909         (WebKit::WebPageProxy::characterIndexForPointAsync):
1910         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
1911         (WebKit::WebPageProxy::setCompositionAsync):
1912         (WebKit::WebPageProxy::confirmCompositionAsync):
1913         (WebKit::WebPageProxy::takeSnapshot):
1914         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
1915         (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
1916         (WebKit::WebPageProxy::immediateActionDidUpdate):
1917         (WebKit::WebPageProxy::immediateActionDidCancel):
1918         (WebKit::WebPageProxy::immediateActionDidComplete):
1919         (WebKit::WebPageProxy::handleAcceptedCandidate):
1920         (WebKit::WebPageProxy::setUseSystemAppearance):
1921         (WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
1922         (WebKit::WebPageProxy::setFooterBannerHeightForTesting):
1923         (WebKit::WebPageProxy::setShouldDispatchFakeMouseMoveEvents):
1924         (WebKit::WebPageProxy::setPlaybackTarget):
1925         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
1926         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
1927         (WebKit::WebPageProxy::clearWheelEventTestTrigger):
1928         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
1929         (WebKit::WebPageProxy::getLoadDecisionForIcon):
1930         (WebKit::WebPageProxy::setResourceCachingDisabled):
1931         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
1932         (WebKit::WebPageProxy::didAllowPointerLock):
1933         (WebKit::WebPageProxy::didDenyPointerLock):
1934         (WebKit::WebPageProxy::requestPointerUnlock):
1935         (WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
1936         (WebKit::WebPageProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
1937         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
1938         (WebKit::WebPageProxy::insertAttachment):
1939         (WebKit::WebPageProxy::updateAttachmentAttributes):
1940         (WebKit::WebPageProxy::getApplicationManifest):
1941         (WebKit::WebPageProxy::setDefersLoadingForTesting):
1942         (WebKit::WebPageProxy::updateCurrentModifierState):
1943         (WebKit::WebPageProxy::simulateDeviceOrientationChange):
1944         (WebKit::WebPageProxy::detectDataInAllFrames):
1945         (WebKit::WebPageProxy::removeDataDetectedLinks):
1946         (WebKit::WebPageProxy::textInputContextsInRect):
1947         (WebKit::WebPageProxy::focusTextInputContext):
1948         * UIProcess/WebPageProxy.h:
1949         (WebKit::WebPageProxy::identifier const):
1950         (WebKit::WebPageProxy::webPageID const):
1951         * UIProcess/WebPageProxyIdentifier.h: Added.
1952         * UIProcess/WebProcessPool.cpp:
1953         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1954         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
1955         * UIProcess/WebProcessPool.h:
1956         * UIProcess/WebProcessProxy.cpp:
1957         (WebKit::WebProcessProxy::webPage):
1958         (WebKit::WebProcessProxy::addExistingWebPage):
1959         (WebKit::WebProcessProxy::removeWebPage):
1960         (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
1961         (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
1962         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
1963         (WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
1964         (WebKit::WebProcessProxy::transformObjectsToHandles):
1965         * UIProcess/WebProcessProxy.h:
1966         * UIProcess/WebURLSchemeHandler.cpp:
1967         (WebKit::WebURLSchemeHandler::startTask):
1968         (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
1969         (WebKit::WebURLSchemeHandler::stopTask):
1970         (WebKit::WebURLSchemeHandler::removeTaskFromPageMap):
1971         * UIProcess/WebURLSchemeHandler.h:
1972         * UIProcess/WebURLSchemeTask.cpp:
1973         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
1974         (WebKit::WebURLSchemeTask::didPerformRedirection):
1975         (WebKit::WebURLSchemeTask::didReceiveResponse):
1976         (WebKit::WebURLSchemeTask::didReceiveData):
1977         (WebKit::WebURLSchemeTask::didComplete):
1978         * UIProcess/WebURLSchemeTask.h:
1979         (WebKit::WebURLSchemeTask::pageID const):
1980         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1981         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
1982         * UIProcess/WebsiteData/WebsiteDataStore.h:
1983         * UIProcess/gtk/WebPageProxyGtk.cpp:
1984         (WebKit::WebPageProxy::getCenterForZoomGesture):
1985         * UIProcess/ios/EditableImageController.mm:
1986         (WebKit::EditableImageController::EditableImageController):
1987         (WebKit::EditableImageController::~EditableImageController):
1988         * UIProcess/ios/SmartMagnificationController.mm:
1989         (WebKit::SmartMagnificationController::SmartMagnificationController):
1990         (WebKit::SmartMagnificationController::~SmartMagnificationController):
1991         (WebKit::SmartMagnificationController::handleSmartMagnificationGesture):
1992         * UIProcess/ios/ViewGestureControllerIOS.mm:
1993         (WebKit::ViewGestureController::beginSwipeGesture):
1994         (WebKit::ViewGestureController::endSwipeGesture):
1995         * UIProcess/ios/WKContentView.mm:
1996         (-[WKContentView _wk_printedDocument]):
1997         * UIProcess/ios/WKContentViewInteraction.mm:
1998         (-[WKContentView ensurePositionInformationIsUpToDate:]):
1999         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2000         * UIProcess/ios/WebPageProxyIOS.mm:
2001         (WebKit::WebPageProxy::requestFocusedElementInformation):
2002         (WebKit::WebPageProxy::updateVisibleContentRects):
2003         (WebKit::WebPageProxy::resendLastVisibleContentRects):
2004         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2005         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
2006         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
2007         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
2008         (WebKit::WebPageProxy::setDeviceOrientation):
2009         (WebKit::WebPageProxy::setOverrideViewportArguments):
2010         (WebKit::WebPageProxy::selectWithGesture):
2011         (WebKit::WebPageProxy::updateSelectionWithTouches):
2012         (WebKit::WebPageProxy::replaceDictatedText):
2013         (WebKit::WebPageProxy::replaceSelectedText):
2014         (WebKit::WebPageProxy::requestAutocorrectionData):
2015         (WebKit::WebPageProxy::applyAutocorrection):
2016         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
2017         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
2018         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
2019         (WebKit::WebPageProxy::selectPositionAtPoint):
2020         (WebKit::WebPageProxy::beginSelectionInDirection):
2021         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
2022         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
2023         (WebKit::WebPageProxy::requestDictationContext):
2024         (WebKit::WebPageProxy::requestAutocorrectionContext):
2025         (WebKit::WebPageProxy::getSelectionContext):
2026         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
2027         (WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
2028         (WebKit::WebPageProxy::selectWithTwoTouches):
2029         (WebKit::WebPageProxy::requestPositionInformation):
2030         (WebKit::WebPageProxy::startInteractionWithElementAtPosition):
2031         (WebKit::WebPageProxy::stopInteraction):
2032         (WebKit::WebPageProxy::performActionOnElement):
2033         (WebKit::WebPageProxy::applicationDidEnterBackground):
2034         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
2035         (WebKit::WebPageProxy::applicationWillEnterForeground):
2036         (WebKit::WebPageProxy::applicationWillResignActive):
2037         (WebKit::WebPageProxy::applicationDidBecomeActive):
2038         (WebKit::WebPageProxy::extendSelection):
2039         (WebKit::WebPageProxy::selectWordBackward):
2040         (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
2041         (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
2042         (WebKit::WebPageProxy::storeSelectionForAccessibility):
2043         (WebKit::WebPageProxy::startAutoscrollAtPosition):
2044         (WebKit::WebPageProxy::cancelAutoscroll):
2045         (WebKit::WebPageProxy::moveSelectionByOffset):
2046         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
2047         (WebKit::WebPageProxy::willStartUserTriggeredZooming):
2048         (WebKit::WebPageProxy::potentialTapAtPosition):
2049         (WebKit::WebPageProxy::commitPotentialTap):
2050         (WebKit::WebPageProxy::cancelPotentialTap):
2051         (WebKit::WebPageProxy::tapHighlightAtPosition):
2052         (WebKit::WebPageProxy::handleTap):
2053         (WebKit::WebPageProxy::didRecognizeLongPress):
2054         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
2055         (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
2056         (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
2057         (WebKit::WebPageProxy::blurFocusedElement):
2058         (WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
2059         (WebKit::WebPageProxy::autofillLoginCredentials):
2060         (WebKit::WebPageProxy::focusNextFocusedElement):
2061         (WebKit::WebPageProxy::setFocusedElementValue):
2062         (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
2063         (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
2064         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
2065         (WebKit::WebPageProxy::contentSizeCategoryDidChange):
2066         (WebKit::WebPageProxy::generateSyntheticEditingCommand):
2067         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
2068         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
2069         (WebKit::WebPageProxy::updateSelectionWithDelta):
2070         (WebKit::WebPageProxy::requestDocumentEditingContext):
2071         (WebKit::WebPageProxy::requestDragStart):
2072         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
2073         (WebKit::WebPageProxy::didConcludeDrop):
2074         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
2075         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
2076         (WebKit::RemoteWebInspectorProxy::platformSave):
2077         (WebKit::RemoteWebInspectorProxy::platformAppend):
2078         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2079         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2080         * UIProcess/mac/ViewGestureControllerMac.mm:
2081         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
2082         (WebKit::ViewGestureController::handleSmartMagnificationGesture):
2083         * UIProcess/mac/WKImmediateActionController.mm:
2084         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2085         * UIProcess/mac/WebInspectorProxyMac.mm:
2086         (WebKit::WebInspectorProxy::platformSave):
2087         (WebKit::WebInspectorProxy::platformAppend):
2088         * UIProcess/mac/WebPageProxyMac.mm:
2089         (WebKit::WebPageProxy::windowAndViewFramesChanged):
2090         (WebKit::WebPageProxy::setMainFrameIsScrollable):
2091         (WebKit::WebPageProxy::insertDictatedTextAsync):
2092         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
2093         (WebKit::WebPageProxy::fontAtSelection):
2094         (WebKit::WebPageProxy::stringSelectionForPasteboard):
2095         (WebKit::WebPageProxy::dataSelectionForPasteboard):
2096         (WebKit::WebPageProxy::readSelectionFromPasteboard):
2097         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
2098         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
2099         (WebKit::WebPageProxy::uppercaseWord):
2100         (WebKit::WebPageProxy::lowercaseWord):
2101         (WebKit::WebPageProxy::capitalizeWord):
2102         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
2103         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
2104         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
2105         (WebKit::WebPageProxy::acceptsFirstMouse):
2106         * WebKit.xcodeproj/project.pbxproj:
2107
2108 2019-08-29  Chris Dumez  <cdumez@apple.com>
2109
2110         Use inline data member initialization in ProcessLauncher
2111         https://bugs.webkit.org/show_bug.cgi?id=201247
2112
2113         Reviewed by Ryosuke Niwa.
2114
2115         * UIProcess/Launcher/ProcessLauncher.cpp:
2116         (WebKit::ProcessLauncher::ProcessLauncher):
2117         * UIProcess/Launcher/ProcessLauncher.h:
2118
2119 2019-08-28  Tim Horton  <timothy_horton@apple.com>
2120
2121         Reloading a web view with a fixed-width viewport and variable content width restores the previous page scale, shouldn't
2122         https://bugs.webkit.org/show_bug.cgi?id=201256
2123         <rdar://problem/54809509>
2124
2125         Reviewed by Simon Fraser.
2126
2127         * WebProcess/WebPage/ios/WebPageIOS.mm:
2128         (WebKit::WebPage::restorePageState):
2129         When restoring page state from a history item, if the saved scale was equal to the
2130         initial scale at the time it was saved, ignore the saved scale and use the current
2131         initial scale instead.
2132
2133         Normally this doesn't matter because a given page's initial scale doesn't usually change
2134         between loads, but it totally can! See the test for one example of a way an API client
2135         might cause this; you could also imagine something similar happening if the actual
2136         page content changed.
2137
2138 2019-08-28  Megan Gardner  <megan_gardner@apple.com>
2139
2140         Null check webFrame when creating a print preview to prevent a crash.
2141         https://bugs.webkit.org/show_bug.cgi?id=201237
2142         <rdar://problem/51618863>
2143
2144         Reviewed by Tim Horton.
2145
2146         Move and expend a null check to keep from crashing when making a print preview.
2147
2148         * UIProcess/mac/WKPrintingView.mm:
2149         (-[WKPrintingView _drawPreview:]):
2150         (-[WKPrintingView drawRect:]):
2151
2152 2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2153
2154         All image drawing functions should take an argument of type ImagePaintingOptions
2155         https://bugs.webkit.org/show_bug.cgi?id=201059
2156
2157         Reviewed by Simon Fraser.
2158
2159         GraphicsContext::drawImage() now takes an ImagePaintingOptions.
2160
2161         * WebProcess/WebPage/ios/WebPageIOS.mm:
2162         (WebKit::imagePositionInformation):
2163
2164 2019-08-28  Keith Rollin  <krollin@apple.com>
2165
2166         Remove support for macOS < 10.13 (part 2)
2167         https://bugs.webkit.org/show_bug.cgi?id=201197
2168         <rdar://problem/54759985>
2169
2170         Reviewed by Darin Adler.
2171
2172         Update conditionals that reference WK_MACOS_1013 and suffixes like
2173         _MACOS_SINCE_1013, assuming that we're always building on 10.13 or
2174         later and that these conditionals are always True or False.
2175
2176         See Bug 200694 for earlier changes in this area.
2177
2178         * Configurations/FeatureDefines.xcconfig:
2179         * Configurations/WebKit.xcconfig:
2180
2181 2019-08-28  Chris Dumez  <cdumez@apple.com>
2182
2183         Have WebPageProxy generate the page identifier by itself
2184         https://bugs.webkit.org/show_bug.cgi?id=201223
2185
2186         Reviewed by Ryosuke Niwa.
2187
2188         Have WebPageProxy generate the page identifier by itself instead of
2189         having the WebProcessProxy do it.
2190
2191         * UIProcess/ServiceWorkerProcessProxy.cpp:
2192         (WebKit::m_serviceWorkerPageID):
2193         * UIProcess/WebPageProxy.cpp:
2194         (WebKit::WebPageProxy::create):
2195         (WebKit::WebPageProxy::WebPageProxy):
2196         * UIProcess/WebPageProxy.h:
2197         * UIProcess/WebProcessProxy.cpp:
2198         (WebKit::WebProcessProxy::createWebPage):
2199         (WebKit::WebProcessProxy::generatePageID): Deleted.
2200         * UIProcess/WebProcessProxy.h:
2201
2202 2019-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2203
2204         REGRESSION(r243434): Wrong URL passed to WebKitWebView::load-failed when cancelling previous load
2205         https://bugs.webkit.org/show_bug.cgi?id=201176
2206
2207         Reviewed by Žan Doberšek.
2208
2209         Use the current provisional/committed url when faking an error event, instead of the current active URI that can
2210         be the pending api request of a new load.
2211
2212         * UIProcess/API/glib/WebKitWebView.cpp:
2213         (webkitWebViewWillStartLoad):
2214
2215 2019-08-28  Claudio Saavedra  <csaavedra@igalia.com>
2216
2217         [GTK][WPE] Implement HSTS for the soup network backend
2218         https://bugs.webkit.org/show_bug.cgi?id=192074
2219
2220         Reviewed by Carlos Garcia Campos.
2221
2222         libsoup 2.67.1 introduced HSTS support via a SoupSessionFeature.
2223         Add support to the soup network backend by adding the feature to
2224         SoupNetworkSession and handling HSTS protocol upgrades, by
2225         propagating the scheme change further to clients. This patch adds
2226         the HSTS feature unconditionally, but it still possible to add
2227         a boolean property to the web context class if desired.
2228
2229         Additionally, add API to the WebKitWebsiteDataManager to specify
2230         the directory where the HSTS database is saved. If the directory
2231         is not set or if the data manager is ephemeral, use a
2232         non-persistent, memory only HSTS enforcer.
2233
2234         Implement as well the methods needed to clean-up and delete HSTS
2235         policies from the storage and expose the feature in GTK+
2236         MiniBrowser's about:data.
2237
2238         * NetworkProcess/NetworkProcess.cpp:
2239         (WebKit::NetworkProcess::fetchWebsiteData):
2240         (WebKit::NetworkProcess::deleteWebsiteData):
2241         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2242         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2243         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2244         * NetworkProcess/NetworkProcess.h:
2245         (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
2246         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2247         (WebKit::NetworkDataTaskSoup::createRequest):
2248         (WebKit::NetworkDataTaskSoup::clearRequest):
2249         (WebKit::NetworkDataTaskSoup::shouldAllowHSTSPolicySetting const):
2250         (WebKit::NetworkDataTaskSoup::shouldAllowHSTSProtocolUpgrade const):
2251         (WebKit::NetworkDataTaskSoup::protocolUpgradedViaHSTS):
2252         (WebKit::NetworkDataTaskSoup::hstsEnforced):
2253         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2254         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2255         (WebKit::NetworkProcess::getHostNamesWithHSTSCache):
2256         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
2257         (WebKit::NetworkProcess::clearHSTSCache):
2258         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2259         * UIProcess/API/APIWebsiteDataStore.h:
2260         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2261         (API::WebsiteDataStore::defaultHSTSDirectory):
2262         * UIProcess/API/glib/WebKitWebContext.cpp:
2263         (webkitWebContextConstructed):
2264         * UIProcess/API/glib/WebKitWebsiteData.cpp:
2265         (recordContainsSupportedDataTypes):
2266         (toWebKitWebsiteDataTypes):
2267         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2268         (webkitWebsiteDataManagerGetProperty):
2269         (webkitWebsiteDataManagerSetProperty):
2270         (webkitWebsiteDataManagerConstructed):
2271         (webkit_website_data_manager_class_init):
2272         (webkitWebsiteDataManagerGetDataStore):
2273         (webkit_website_data_manager_get_hsts_cache_directory):
2274         (toWebsiteDataTypes):
2275         * UIProcess/API/gtk/WebKitWebsiteData.h:
2276         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
2277         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2278         * UIProcess/API/wpe/WebKitWebsiteData.h:
2279         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
2280         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
2281         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
2282         (WebKit::WebsiteDataStoreConfiguration::copy):
2283         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
2284         (WebKit::WebsiteDataStoreConfiguration::hstsStorageDirectory const):
2285         (WebKit::WebsiteDataStoreConfiguration::setHSTSStorageDirectory):
2286
2287 2019-08-27  Mark Lam  <mark.lam@apple.com>
2288
2289         Refactor to use VM& instead of VM* at as many places as possible.
2290         https://bugs.webkit.org/show_bug.cgi?id=201172
2291
2292         Reviewed by Yusuke Suzuki.
2293
2294         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp:
2295         (webkit_dom_node_for_js_value):
2296         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2297         (WebKit::InjectedBundleNodeHandle::getOrCreate):
2298         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2299         (WebKit::JSNPObject::getOwnPropertyNames):
2300         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2301         (WebKit::identifierFromIdentifierRep):
2302         (WebKit::NPJSObject::enumerate):
2303         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2304         (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
2305         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
2306         * WebProcess/WebPage/WebFrame.cpp:
2307         (WebKit::WebFrame::counterValue):
2308
2309 2019-08-27  James Savage  <james.savage@apple.com>
2310
2311         Populate alternate URL for _WKActivatedElementInfo in UIContextMenu SPI.
2312         https://bugs.webkit.org/show_bug.cgi?id=201165.
2313         rdar://problem/54729648.
2314
2315         Reviewed by Dean Jackson.
2316
2317         * UIProcess/API/APIContextMenuElementInfo.h:
2318         * UIProcess/API/APIContextMenuElementInfo.cpp:
2319         (API::ContextMenuElementInfo::ContextMenuElementInfo): Initialize new memeber.
2320
2321         * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm:
2322         (-[WKContextMenuElementInfo _activatedElementInfo]): Use new initializer.
2323
2324         * UIProcess/API/Cocoa/WKWebView.mm:
2325         (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): Ditto.
2326
2327         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
2328         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
2329         (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:userInfo:]):
2330             Ditto.
2331         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:userInfo:]): Set new ivar.
2332         (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:]): Deleted.
2333         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]): Deleted.
2334
2335         * UIProcess/ios/WKContentViewInteraction.mm:
2336         (-[WKContentView assignLegacyDataForContextMenuInteraction]): Use new initializer.
2337         (-[WKContentView continueContextMenuInteraction:]): If the context menu is being generated for
2338             an image, and we do not have a URL associated with the position information, try to
2339             generate one using existing SPI. This change also passes through the userInfo via a new
2340             property on _WKActivatedElementInfo. We only do this for the SPI version of this delegate
2341             method, because the API is not called for image previews.
2342         (-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]): Use new
2343             initializer.
2344
2345 2019-08-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2346
2347         [RemoteInspector][Socket] Restructuring the components of Socket implementation
2348         https://bugs.webkit.org/show_bug.cgi?id=201079
2349
2350         Reviewed by Ross Kirsling.
2351
2352         RemoteInspectorClient is now free from creation of SocketEndpoint. All communication
2353         to SocketEndpoint id now the duty of super class.
2354
2355         * UIProcess/socket/RemoteInspectorClient.cpp:
2356         (WebKit::RemoteInspectorClient::RemoteInspectorClient): Remove direct communication to Socket Endpoint.
2357         (WebKit::RemoteInspectorClient::sendWebInspectorEvent): Ditto.
2358         * UIProcess/socket/RemoteInspectorClient.h:
2359
2360 2019-08-27  Chris Dumez  <cdumez@apple.com>
2361
2362         Introduce subclasses to RemoteObjectRegistry for the UIProcess and the WebProcess
2363         https://bugs.webkit.org/show_bug.cgi?id=201153
2364
2365         Reviewed by Alex Christensen.
2366
2367         This better factoring improves code clarity.
2368
2369         * PlatformMac.cmake:
2370         * Shared/API/Cocoa/RemoteObjectRegistry.h:
2371         (WebKit::RemoteObjectRegistry::~RemoteObjectRegistry):
2372         (WebKit::RemoteObjectRegistry::takeBackgroundActivityToken):
2373         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
2374         (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
2375         (WebKit::RemoteObjectRegistry::sendInvocation):
2376         (WebKit::RemoteObjectRegistry::sendReplyBlock):
2377         (WebKit::RemoteObjectRegistry::sendUnusedReply):
2378         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
2379         (-[_WKRemoteObjectRegistry _initWithWebPage:]):
2380         (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
2381         * SourcesCocoa.txt:
2382         * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp: Added.
2383         (WebKit::UIRemoteObjectRegistry::takeBackgroundActivityToken):
2384         (WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry):
2385         (WebKit::UIRemoteObjectRegistry::sendInvocation):
2386         (WebKit::UIRemoteObjectRegistry::messageSender):
2387         * UIProcess/Cocoa/UIRemoteObjectRegistry.h: Added.
2388         * WebKit.xcodeproj/project.pbxproj:
2389         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2390         (WebKit::WebPage::setRemoteObjectRegistry):
2391         (WebKit::WebPage::remoteObjectRegistry):
2392         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp: Added.
2393         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
2394         (WebKit::WebRemoteObjectRegistry::~WebRemoteObjectRegistry):
2395         (WebKit::WebRemoteObjectRegistry::close):
2396         (WebKit::WebRemoteObjectRegistry::messageSender):
2397         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.h: Added.
2398         * WebProcess/WebPage/WebPage.cpp:
2399         (WebKit::WebPage::close):
2400         * WebProcess/WebPage/WebPage.h:
2401
2402 2019-08-26  Jer Noble  <jer.noble@apple.com>
2403
2404         Removing fullscreen element in rAF() callback after requestFullscreen() can leave fullscreen in inconsistent state.
2405         https://bugs.webkit.org/show_bug.cgi?id=201101
2406         <rdar://problem/54164587>
2407
2408         Reviewed by Eric Carlson.
2409
2410         Add more state to track in which direction the animation is flowing to allow in-process
2411         animations to be cancelled more gracefully.
2412
2413         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2414         (-[WKFullScreenWindowController enterFullScreen]):
2415         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2416         (-[WKFullScreenWindowController requestExitFullScreen]):
2417         (-[WKFullScreenWindowController exitFullScreen]):
2418         * WebProcess/cocoa/VideoFullscreenManager.h:
2419         (WebKit::VideoFullscreenInterfaceContext::animationState const):
2420         (WebKit::VideoFullscreenInterfaceContext::setAnimationState):
2421         (WebKit::VideoFullscreenInterfaceContext::isAnimating const): Deleted.
2422         (WebKit::VideoFullscreenInterfaceContext::setIsAnimating): Deleted.
2423         * WebProcess/cocoa/VideoFullscreenManager.mm:
2424         (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
2425         (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):
2426         (WebKit::VideoFullscreenManager::didEnterFullscreen):
2427         (WebKit::VideoFullscreenManager::didCleanupFullscreen):
2428
2429 2019-08-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2430
2431         Do not clear the pending api request when there's no navigation ID
2432         https://bugs.webkit.org/show_bug.cgi?id=201175
2433
2434         Reviewed by Chris Dumez.
2435
2436         After r247851, the pending API request URL is cleared for subresources in some cases.
2437
2438         * UIProcess/WebPageProxy.cpp:
2439         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2440         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2441
2442 2019-08-27  Zan Dobersek  <zdobersek@igalia.com>
2443
2444         [CoordGraphics] Delay LayerTreeHost creation in always-on AC until DrawingArea painting is enabled
2445         https://bugs.webkit.org/show_bug.cgi?id=201178
2446
2447         Reviewed by Carlos Garcia Campos.
2448
2449         When in always-on AC mode, the LayerTreeHost spawning should be delayed
2450         until the WebPage construction (which sets up the LayerTreeHost-owning
2451         DrawingArea implementation) is further done with initializing relevant
2452         state, and not immediately after the DrawingArea is done with preference
2453         updates.
2454
2455         This is necessary in order to enable the LayerTreeHost instance to take
2456         into account additional WebPage-creation attributes like the correct
2457         device scale factor. Until now, when the LayerTreeHost was spawned in
2458         always-on AC mode, the device scale factor was not yet updated in the
2459         WebPage construction to the appropriate value, leaving the LayerTreeHost
2460         with the default 1.0 value instead of the intended one.
2461
2462         DrawingArea::setPaintingEnabled() is repurposed into enablePainting()
2463         that is to be called once everything should be set for painting (i.e.
2464         when setPaintingEnabled(true) was being called until now). Inside the
2465         DrawingAreaProxyCoordinatedGraphics class (only one to provide an
2466         implementation for this method), the LayerTreeHost is now spawned if
2467         in always-on AC mode. At this point, all relevant state coming from
2468         the owning WebPage object should be readily available for the host
2469         to correctly set up initial graphics scene.
2470
2471         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
2472         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
2473         (WebKit::DrawingAreaCoordinatedGraphics::enablePainting):
2474         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
2475         * WebProcess/WebPage/DrawingArea.h:
2476         (WebKit::DrawingArea::enablePainting):
2477         (WebKit::DrawingArea::setPaintingEnabled): Deleted.
2478         * WebProcess/WebPage/WebPage.cpp:
2479         (WebKit::m_textAutoSizingAdjustmentTimer):
2480         (WebKit::WebPage::reinitializeWebPage):
2481
2482 2019-08-26  Devin Rousso  <drousso@apple.com>
2483
2484         Web Inspector: use more C++ keywords for defining agents
2485         https://bugs.webkit.org/show_bug.cgi?id=200959
2486
2487         Reviewed by Joseph Pecoraro.
2488
2489          - make constructors `protected` when the agent isn't meant to be constructed directly
2490          - add `virtual` destructors that are defined in the *.cpp so forward-declarations work
2491          - use `final` wherever possible
2492          - add comments to indicate where any virtual functions come from
2493
2494         * UIProcess/WebPageInspectorTargetAgent.h:
2495         * UIProcess/WebPageInspectorTargetAgent.cpp:
2496
2497 2019-08-26  Chris Dumez  <cdumez@apple.com>
2498
2499         Regression: ITP started doing a lot more IPC after its logic was moved to the network process
2500         https://bugs.webkit.org/show_bug.cgi?id=201155
2501
2502         Reviewed by John Wilander.
2503
2504         * WebProcess/WebProcess.cpp:
2505         (WebKit::WebProcess::initializeWebProcess):
2506
2507 2019-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2508
2509         REGRESSION (iOS 13): Tests that simulate multiple back-to-back single taps fail or time out
2510         https://bugs.webkit.org/show_bug.cgi?id=201129
2511         <rdar://problem/51857277>
2512
2513         Reviewed by Tim Horton.
2514
2515         Adds a new SPI hook in WebKit to let clients know when a synthetic tap gesture that has ended has been reset.
2516         See Tools/ChangeLog and LayoutTests/ChangeLog for more details.
2517
2518         * UIProcess/API/Cocoa/WKWebView.mm:
2519         (-[WKWebView _doAfterResettingSingleTapGesture:]):
2520         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2521         * UIProcess/ios/WKContentViewInteraction.h:
2522         * UIProcess/ios/WKContentViewInteraction.mm:
2523         (-[WKContentView _singleTapDidReset:]):
2524         (-[WKContentView _doAfterResettingSingleTapGesture:]):
2525
2526 2019-08-26  Brent Fulgham  <bfulgham@apple.com>
2527
2528         [FTW] Go back to ID2D1Bitmap as our NativeImage type
2529         https://bugs.webkit.org/show_bug.cgi?id=201122
2530
2531         Reviewed by Alex Christensen.
2532
2533         In Bug 200093 I switched the OS type of NativeImagePtr from ID2D1Bitmap to IWICBitmap.
2534         However, this was an ill-advised approach, because it dramatically harmed performance due
2535         to the heavy use of software rendering.
2536
2537         I originally made this change because I thought this was the only way to get to the backing
2538         bits of the bitmaps, but it turns out that a more recent Direct2D data type (ID2D1Bitmap1)
2539         has the ability to map its memory to CPU-accessible memory, allowing software filter effects.
2540
2541         This patch switches back to the ID2D1Bitap data type, and hooks up the ID2D1Bitmap1 data type
2542         to access the underlying memory of the bitmaps when software filter effects are used.
2543
2544         Reviewed by Alex Christensen.
2545
2546         * Shared/ShareableBitmap.h:
2547         * Shared/win/ShareableBitmapDirect2D.cpp:
2548         * UIProcess/win/BackingStoreDirect2D.cpp:
2549         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
2550
2551 2019-08-26  Jiewen Tan  <jiewen_tan@apple.com>
2552
2553         [WebAuthn] Support HID authenticators on iOS
2554         https://bugs.webkit.org/show_bug.cgi?id=201084
2555         <rdar://problem/51908390>
2556
2557         Reviewed by Youenn Fablet.
2558
2559         This patch makes the macOS HID implementation available in iOS as well.
2560         Mostly, it removes the PLATFORM(MAC) compile time flag.
2561
2562         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
2563         (WebKit::AuthenticatorManagerInternal::collectTransports):
2564         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
2565         (WebKit::AuthenticatorTransportService::create):
2566         (WebKit::AuthenticatorTransportService::createMock):
2567         * UIProcess/WebAuthentication/Cocoa/HidConnection.h:
2568         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
2569         * UIProcess/WebAuthentication/Cocoa/HidService.h:
2570         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2571         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
2572         (WebKit::NfcConnection::NfcConnection):
2573         A tentative solution before there is an official UI.
2574         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2575         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
2576         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
2577         * UIProcess/WebAuthentication/Mock/MockHidService.h:
2578         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
2579         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
2580
2581 2019-08-26  Russell Epstein  <repstein@apple.com>
2582
2583         Unreviewed, rolling out r248961.
2584
2585         Same patch was re-landed after being rolled out. Patch is
2586         causing Catalina/iOS 13 test failures. Rolling out.
2587
2588         Reverted changeset:
2589
2590         "Verify Prefetch and credential behavior"
2591         https://bugs.webkit.org/show_bug.cgi?id=200000
2592         https://trac.webkit.org/changeset/248961
2593
2594 2019-08-26  Youenn Fablet  <youenn@apple.com>
2595
2596         Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
2597         https://bugs.webkit.org/show_bug.cgi?id=196870
2598
2599         Reviewed by Alex Christensen.
2600
2601         Make NetworkProcess provide the session ID for any authentication challenge.
2602         In case there is no associated page for the authentication challenge or this is related to a service worker,
2603         ask the website data store to take a decision.
2604         Add website data store delegate to allow applications to make the decision.
2605         Restrict using the delegate to server trust evaluation only.
2606
2607         Make ping loads reuse the same mechanism.
2608
2609         Covered by service worker tests and updated beacon test.
2610
2611         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2612         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
2613         * NetworkProcess/NetworkDataTask.cpp:
2614         (WebKit::NetworkDataTask::sessionID const):
2615         * NetworkProcess/NetworkDataTask.h:
2616         * NetworkProcess/NetworkLoad.cpp:
2617         (WebKit::NetworkLoad::didReceiveChallenge):
2618         * NetworkProcess/NetworkLoadChecker.h:
2619         (WebKit::NetworkLoadChecker::networkProcess):
2620         * NetworkProcess/PingLoad.cpp:
2621         (WebKit::PingLoad::didReceiveChallenge):
2622         * Shared/Authentication/AuthenticationManager.cpp:
2623         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2624         * Shared/Authentication/AuthenticationManager.h:
2625         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
2626         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
2627         (WebKit::toAuthenticationChallengeDisposition):
2628         * SourcesCocoa.txt:
2629         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2630         (WebsiteDataStoreClient::WebsiteDataStoreClient):
2631         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
2632         * UIProcess/Cocoa/NavigationState.mm:
2633         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
2634         * UIProcess/Network/NetworkProcessProxy.cpp:
2635         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2636         * UIProcess/Network/NetworkProcessProxy.h:
2637         * UIProcess/Network/NetworkProcessProxy.messages.in:
2638         * UIProcess/ServiceWorkerProcessProxy.cpp:
2639         * UIProcess/ServiceWorkerProcessProxy.h:
2640         * UIProcess/WebPageProxy.cpp:
2641         * UIProcess/WebProcessPool.cpp:
2642         (WebKit::WebProcessPool::isServiceWorkerPageID const):
2643         * UIProcess/WebProcessPool.h:
2644         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
2645         (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
2646         * WebKit.xcodeproj/project.pbxproj:
2647
2648 2019-08-25  Simon Fraser  <simon.fraser@apple.com>
2649
2650         [iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs
2651         https://bugs.webkit.org/show_bug.cgi?id=199983
2652
2653         Reviewed by Dean Jackson.
2654         
2655         Add TransactionID which is a MonotonicObjectIdentifier<TransactionIDType>. This is modeled
2656         after ObjectIdentifier<>, but we can't use that because it doesn't have a guarantee of
2657         values always increasing by 1 (all derived classes share the same value source). Also, we
2658         need a per-RemoteLayerTreeDrawingArea set of values, but a static seed would cause values to
2659         be incremented by all RemoteLayerTreeDrawingAreas in a WebProcess.
2660
2661         Replace all the bare uint64_t with TransactionID, fixing message generation codegen.
2662
2663         * Scripts/webkit/messages.py:
2664         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2665         (WebKit::RemoteLayerTreeTransaction::transactionID const):
2666         (WebKit::RemoteLayerTreeTransaction::setTransactionID):
2667         * Shared/TransactionID.h: Added.
2668         (WebKit::MonotonicObjectIdentifier::MonotonicObjectIdentifier):
2669         (WebKit::MonotonicObjectIdentifier::isHashTableDeletedValue const):
2670         (WebKit::MonotonicObjectIdentifier::encode const):
2671         (WebKit::MonotonicObjectIdentifier::decode):
2672         (WebKit::MonotonicObjectIdentifier::operator== const):
2673         (WebKit::MonotonicObjectIdentifier::operator> const):
2674         (WebKit::MonotonicObjectIdentifier::operator>= const):
2675         (WebKit::MonotonicObjectIdentifier::operator< const):
2676         (WebKit::MonotonicObjectIdentifier::operator<= const):
2677         (WebKit::MonotonicObjectIdentifier::operator!= const):
2678         (WebKit::MonotonicObjectIdentifier::increment):
2679         (WebKit::MonotonicObjectIdentifier::next const):
2680         (WebKit::MonotonicObjectIdentifier::toUInt64 const):
2681         (WebKit::MonotonicObjectIdentifier::operator bool const):
2682         (WebKit::MonotonicObjectIdentifier::loggingString const):
2683         (WebKit::MonotonicObjectIdentifier::hashTableDeletedValue):
2684         (WebKit::MonotonicObjectIdentifier::isValidIdentifier):
2685         (WebKit::operator<<):
2686         * Shared/VisibleContentRectUpdateInfo.h:
2687         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2688         (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionID const):
2689         * UIProcess/API/Cocoa/WKWebView.mm:
2690         (-[WKWebView _processWillSwapOrDidExit]):
2691         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2692         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
2693         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2694         (WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
2695         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2696         * UIProcess/WebPageProxy.cpp:
2697         (WebKit::WebPageProxy::resetState):
2698         * UIProcess/WebPageProxy.h:
2699         * UIProcess/ios/WKContentViewInteraction.h:
2700         * UIProcess/ios/WKContentViewInteraction.mm:
2701         (-[WKContentView cleanupInteraction]):
2702         * UIProcess/ios/WebPageProxyIOS.mm:
2703         (WebKit::WebPageProxy::commitPotentialTap):
2704         (WebKit::WebPageProxy::handleTap):
2705         * WebKit.xcodeproj/project.pbxproj:
2706         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2707         (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID const):
2708         (WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID const):
2709         (WebKit::RemoteLayerTreeDrawingArea::takeNextTransactionID):
2710         * WebProcess/WebPage/WebFrame.h:
2711         (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad const):
2712         (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
2713         * WebProcess/WebPage/WebPage.h:
2714         * WebProcess/WebPage/WebPage.messages.in:
2715         * WebProcess/WebPage/ios/WebPageIOS.mm:
2716         (WebKit::WebPage::handleTap):
2717         (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
2718         (WebKit::WebPage::commitPotentialTap):
2719
2720 2019-08-24  Chris Dumez  <cdumez@apple.com>
2721
2722         Make CacheStorageEngineCaches's decodeCachesNames() more robust against bad input data
2723         https://bugs.webkit.org/show_bug.cgi?id=201102
2724
2725         Reviewed by Antti Koivisto.
2726
2727         Use Vector::tryReserveCapacity() instead of Vector::reserveInitialCapacity() in CacheStorage::decodeCachesNames()
2728         since the size is read from disk and thus cannot be trusted. If the size is too large, reserveInitialCapacity()
2729         would end up crashing the network process. Now, we merely discard the data if tryReserveCapacity() fails because
2730         the size is too large.
2731
2732         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2733         (WebKit::CacheStorage::decodeCachesNames):
2734
2735 2019-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2736
2737         [iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing
2738         https://bugs.webkit.org/show_bug.cgi?id=201085
2739         <rdar://problem/53056118>
2740
2741         Reviewed by Tim Horton.
2742
2743         Currently, logic in applyAutocorrectionInternal only selects the range to autocorrect if the text of the range
2744         matches the string to replace (delivered to us from UIKit). In the case of changing "I’" to "I’m", the string to
2745         replace is "I'" (with a straight quote rather than an apostrophe), even though the DOM contains an apostrophe.
2746
2747         This is because kbd believes that the document context contains straight quotes (rather than apostrophes). For
2748         native text views, this works out because UIKit uses relative UITextPositions to determine the replacement
2749         range rather than by checking against the contents of the document. However, WKWebView does not have the ability
2750         to synchronously compute and reason about arbitrary UITextPositions relative to the selection, so we instead
2751         search for the string near the current selection when applying autocorrections.
2752
2753         Of course, this doesn't work in this scenario because the replacement string contains a straight quote, yet the
2754         text node contains an apostrophe, so we bail and don't end up replacing any text. To address this, we repurpose
2755         TextIterator helpers currently used to allow find-in-page to match straight quotes against apostrophes; instead
2756         of matching the replacement string exactly, we instead match the quote-folded versions of these strings when
2757         finding the range to replace.
2758
2759         Test: fast/events/ios/autocorrect-with-apostrophe.html
2760
2761         * WebProcess/WebPage/ios/WebPageIOS.mm:
2762         (WebKit::WebPage::applyAutocorrectionInternal):
2763
2764 2019-08-23  Jiewen Tan  <jiewen_tan@apple.com>
2765
2766         Unreviewed, build fix after r249059
2767
2768         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
2769         (WebKit::NfcConnection::NfcConnection):
2770         Remove the HAVE() macro.
2771
2772 2019-08-23  Chris Dumez  <cdumez@apple.com>
2773
2774         [geolocation] Rename interfaces and remove [NoInterfaceObject]
2775         https://bugs.webkit.org/show_bug.cgi?id=200885
2776
2777         Reviewed by Alex Christensen.
2778
2779         * Shared/WebGeolocationPosition.cpp:
2780         (WebKit::WebGeolocationPosition::create):
2781         * Shared/WebGeolocationPosition.h:
2782         (WebKit::WebGeolocationPosition::corePosition const):
2783         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
2784         * UIProcess/API/C/WKGeolocationPosition.cpp:
2785         (WKGeolocationPositionCreate_c):
2786         * UIProcess/WebGeolocationManagerProxy.h:
2787         (WebKit::WebGeolocationManagerProxy::lastPosition const):
2788         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2789         (-[WKLegacyCoreLocationProvider positionChanged:]):
2790         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2791         (WebKit::WebGeolocationManager::didChangePosition):
2792         * WebProcess/Geolocation/WebGeolocationManager.h:
2793         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
2794         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2795         (WebKit::WebGeolocationClient::lastPosition):
2796         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
2797
2798 2019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
2799
2800         Unreviewed, rolling out r249001.
2801
2802         Caused one layout test to fail on all configurations and
2803         another to time out on Catalina / iOS 13.
2804
2805         Reverted changeset:
2806
2807         "Add a WebsiteDataStore delegate to handle
2808         AuthenticationChallenge that do not come from pages"
2809         https://bugs.webkit.org/show_bug.cgi?id=196870
2810         https://trac.webkit.org/changeset/249001
2811
2812 2019-08-23  Brian Burg  <bburg@apple.com>
2813
2814         REGRESSION(r248713): WebDriver commands which target the implicit main frame now hit an ASSERT
2815         https://bugs.webkit.org/show_bug.cgi?id=200793
2816         <rdar://problem/54516988>
2817
2818         Reviewed by Chris Dumez.
2819
2820         SimulatedInputDispatcher and its callers need to support Optional<FrameIdentifier>
2821         and WTF::nullopt as an encoding for the implicit main frame.
2822
2823         * UIProcess/Automation/SimulatedInputDispatcher.h:
2824         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2825         (WebKit::SimulatedInputDispatcher::resolveLocation):
2826         (WebKit::SimulatedInputDispatcher::run):
2827
2828         * UIProcess/Automation/WebAutomationSession.h:
2829         * UIProcess/Automation/WebAutomationSession.cpp:
2830         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
2831         (WebKit::WebAutomationSession::performInteractionSequence):
2832         (WebKit::WebAutomationSession::cancelInteractionSequence):
2833
2834 2019-08-20  Jiewen Tan  <jiewen_tan@apple.com>
2835
2836         [WebAuthn] Support NFC authenticators for iOS
2837         https://bugs.webkit.org/show_bug.cgi?id=188624
2838         <rdar://problem/43354214>
2839
2840         Reviewed by Chris Dumez.
2841
2842         This patch implements support for NFC authenticators including both FIDO2 and U2F ones. It utilizes a private
2843         framework called NearField instead of CoreNFC to be able to supply a custom UI later if necessary.
2844
2845         The patch follows almost the same flow as previous HID and Local authenticator support.
2846         1) Discovery is via NfcService which will invoke NFHardwareManager to start a generic NFC reader session.
2847         2) Once a reader session is established, a NfcConnection is created to start the polling and register the WKNFReaderSessionDelegate
2848         to wait for 'didDetectTags'.
2849         3) When tags are detected, NfcConnection will determine if it meets our requriements: { type, connectability, fido applet availability }.
2850         The first tag that meets all requirement will then be returned for WebAuthn operations.
2851         4) The first WebAuthn operation is to send authenticatorGetInfo command to determine the supported protocol, and then initialize corresponding
2852         authenticators. Noted, the sending/receiving of this command is now abstracted into FidoService which will be shared across HidService and NfcService.
2853         5) From then, the actual WebAuthn request, either makeCredential or getAssertion will be sent.
2854
2855         For testing, this patch follows the same flow as well.
2856         1) MockNfcService overrides NfcService to mock the behavior of NFC Tags discovery.
2857         2) The same class also swizzles methods from NFReaderSession to mock tag connection and communication.
2858
2859         * Platform/spi/Cocoa/NearFieldSPI.h: Added.
2860         * Sources.txt:
2861         * SourcesCocoa.txt:
2862         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2863         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
2864         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
2865         (WebKit::AuthenticatorManagerInternal::collectTransports):
2866         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
2867         (WebKit::AuthenticatorTransportService::create):
2868         (WebKit::AuthenticatorTransportService::createMock):
2869         * UIProcess/WebAuthentication/Cocoa/HidService.h:
2870         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2871         (WebKit::HidService::HidService):
2872         (WebKit::HidService::deviceAdded):
2873         (WebKit::HidService::continueAddDeviceAfterGetInfo): Deleted.
2874         * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2875         * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2876         * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2877         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: Added.
2878         (WebKit::fido::compareVersion):
2879         (WebKit::NfcConnection::NfcConnection):
2880         (WebKit::NfcConnection::~NfcConnection):
2881         (WebKit::NfcConnection::transact const):
2882         (WebKit::NfcConnection::didDetectTags const):
2883         * UIProcess/WebAuthentication/Cocoa/NfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2884         * UIProcess/WebAuthentication/Cocoa/NfcService.mm: Added.
2885         (WebKit::NfcService::NfcService):
2886         (WebKit::NfcService::~NfcService):
2887         (WebKit::NfcService::didConnectTag):
2888         (WebKit::NfcService::startDiscoveryInternal):
2889         (WebKit::NfcService::platformStartDiscovery):
2890         * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2891         * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2892         (-[WKNFReaderSessionDelegate initWithConnection:]):
2893         (-[WKNFReaderSessionDelegate readerSession:didDetectTags:]):
2894         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2895         (WebKit::MockHidConnection::send):
2896         (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
2897         (WebKit::MockHidConnection::parseRequest):
2898         (WebKit::MockHidConnection::feedReports):
2899         (WebKit::MockHidConnection::shouldContinueFeedReports):
2900         * UIProcess/WebAuthentication/Mock/MockNfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2901         * UIProcess/WebAuthentication/Mock/MockNfcService.mm: Added.
2902         (-[WKMockNFTag type]):
2903         (-[WKMockNFTag initWithNFTag:]):
2904         (-[WKMockNFTag description]):
2905         (-[WKMockNFTag isEqualToNFTag:]):
2906         (-[WKMockNFTag initWithType:]):
2907         (WebKit::MockNfcService::MockNfcService):
2908         (WebKit::MockNfcService::transceive):
2909         (WebKit::MockNfcService::platformStartDiscovery):
2910         (WebKit::MockNfcService::detectTags const):
2911         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
2912         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
2913         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
2914         * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: Added.
2915         (WebKit::CtapNfcDriver::CtapNfcDriver):
2916         (WebKit::CtapNfcDriver::transact):
2917         (WebKit::CtapNfcDriver::respondAsync const):
2918         * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2919         * UIProcess/WebAuthentication/fido/FidoService.cpp: Added.
2920         (WebKit::FidoService::FidoService):
2921         (WebKit::FidoService::getInfo):
2922         (WebKit::FidoService::continueAfterGetInfo):
2923         * UIProcess/WebAuthentication/fido/FidoService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2924         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
2925         * UIProcess/WebAuthentication/fido/U2fAuthenticator.h:
2926         * UIProcess/ios/WebPageProxyIOS.mm:
2927         * WebKit.xcodeproj/project.pbxproj:
2928
2929 2019-08-23  Kate Cheney  <katherine_cheney@apple.com>
2930
2931         Support ITP on a per-session basis (198923)
2932         https://bugs.webkit.org/show_bug.cgi?id=198923
2933
2934         Reviewed by Chris Dumez.
2935
2936         The original implementation of resourceLoadStatisticsUpdated
2937         did not allow for ITP on a per session basis due to the sessionID
2938         not being passed to the resourceLoadStatisticsUpdated function.
2939         This patch allows access of the correct networkSession by passing
2940         all resourceLoadStatistics in a new data structure of key-value
2941         pairs, where the sessionID is the key.
2942
2943         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2944         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
2945         * NetworkProcess/NetworkConnectionToWebProcess.h:
2946         * WebProcess/WebProcess.cpp:
2947
2948 2019-08-23  Russell Epstein  <repstein@apple.com>
2949
2950         Unreviewed, rolling out r249031.
2951
2952         Causes multiple test failures on iOS simulator
2953
2954         Reverted changeset:
2955
2956         "[iOS] Should show input view when became first responder if
2957         keyboard was showing when the view was resigned"
2958         https://bugs.webkit.org/show_bug.cgi?id=200902
2959         https://trac.webkit.org/changeset/249031
2960
2961 2019-08-22  Andy Estes  <aestes@apple.com>
2962
2963         [watchOS] Disable Content Filtering in the simulator build
2964         https://bugs.webkit.org/show_bug.cgi?id=201047
2965
2966         Reviewed by Tim Horton.
2967
2968         * Configurations/FeatureDefines.xcconfig:
2969
2970 2019-08-22  Daniel Bates  <dabates@apple.com>
2971
2972         [iOS] Should show input view when became first responder if keyboard was showing when the view was resigned
2973         https://bugs.webkit.org/show_bug.cgi?id=200902
2974         <rdar://problem/54231756>
2975
2976         Reviewed by Wenson Hsieh.
2977
2978         When resigning first responder save whether the peripheral host has an input view on screen,
2979         including the software keyboard, so that we show the input view(s) again when the WKWebView
2980         is made first responder. In Safari, this avoids the need for a person to explicitly focus an
2981         editable element again to bring up the keyboard when returning to a tab they were previously
2982         typing in. It also makes the behavior of switching tabs in Safari with a software keyboard
2983         match the behavior of doing the same thing when a hardware keyboard attached.
2984
2985         * UIProcess/PageClient.h:
2986         * UIProcess/WebPageProxy.h:
2987         * UIProcess/WebPageProxy.messages.in:
2988         * UIProcess/ios/PageClientImplIOS.h:
2989         * UIProcess/ios/PageClientImplIOS.mm:
2990         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
2991         Pass a diff of the activity state from the web process to the UI process so that we can
2992         differentiate between an inputmode change as a result of page deactivation vs a change
2993         caused by some other means. We need to differentiate these cases because we want to
2994         ignore a page that sets inputmode "none" (i.e. a request to hide the keyboard) from inside
2995         a focus event handler if the handler was called as part of the process of page activation
2996         (i.e. switching to the tab). Google Docs is one example of a web site that sets inputmode
2997         to "none" as a result of the page activation process.
2998
2999         * UIProcess/ios/WKContentViewInteraction.h:
3000         * UIProcess/ios/WKContentViewInteraction.mm:
3001         (-[WKContentView cleanupInteraction]): Clear out state.
3002         (-[WKContentView resignFirstResponderForWebView]): Save whether the peripheral host is on screen
3003         into a local before ending the editing session. We then copy the local into the ivar if we
3004         actually will resign. This ordering is explicitly done because:
3005                 1. Ending the editing session may dismiss the keyboard => we need to query the peripheral
3006                    host first.
3007                 2. If the view is being resigned as a result of a keyboard dismissal (i.e. a person pressed
3008                    the hide keyboard button on iPad) then the user has indicated that they are finished
3009                    with the keyboard and we do not want to show the keyboard on page re-activation => we
3010                    do not want to copy the local to the ivar.
3011                 3. If the view refuses to resign itself then it does not make sense to save the keyboard
3012                    state as responder status hasn't changed.
3013         (-[WKContentView shouldShowAutomaticKeyboardUI]): Ignore inputmode="none", if needed.
3014         (-[WKContentView _didCommitLoadForMainFrame]): Clear out state.
3015         (-[WKContentView isFirstResponderOrBecomingFirstResponder]): Added.
3016         (-[WKContentView shouldShowInputViewOnPageActivation:]): Added.
3017         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
3018         Update ivar if this element is being focused as a result of page activation.
3019         (-[WKContentView _didUpdateInputMode:activityStateChanges:]): Modified to take the activity state
3020         diff. If the input mode was changed as a result of page activation then we want to update our ivar
3021         so that when we call -reloadInputViews and UIKit calls us back in -shouldShowAutomaticKeyboardUI we
3022         will know to ignore inputmode set to "none" when determining whether to show the automatic keyboard UI.
3023         Note that we do not need to check/track whether an earlier -_elementDidFocus actually started an
3024         input session as part of updating the value of our ivar because if an input session was not started,
3025         say the embedding client disallowed it, then we would not have a focused element => we early return from
3026         this function. Also remove duplication and improve code readbility by making use of the convenience function
3027         hasFocusedElement() instead of duplicating what it does.
3028         (-[WKContentView _didUpdateInputMode:]): Deleted.
3029         * UIProcess/ios/WebPageProxyIOS.mm:
3030         (WebKit::WebPageProxy::focusedElementDidChangeInputMode): Modified to take the activity state diff
3031         and pass it through.
3032         (WebKit::WebPageProxy::didReleaseAllTouchPoints): Pass the empty set for the activity state diff to
3033         keep our current behavior.
3034         * WebProcess/WebPage/WebPage.cpp:
3035         (WebKit::WebPage::focusedElementDidChangeInputMode): Send the activity state diff to the UI process.
3036 2019-08-22  Keith Rollin  <krollin@apple.com>
3037
3038         Remove logging that contains a URL
3039         https://bugs.webkit.org/show_bug.cgi?id=201052
3040         <rdar://problem/54613204>
3041
3042         Reviewed by Chris Dumez.
3043
3044         checkURLReceivedFromWebProcess in WebProcessProxy.cpp contains an old
3045         logging line that logs a URL. We don't log URLs any more for privacy
3046         reasons, so remove this.
3047
3048         A search for WTFLogAlways.*url turns up other matches, but those are
3049         either false positives or cases where the URLs are logged only on
3050         demand by the developer as part of debugging.
3051         checkURLReceivedFromWebProcess is the only place where a URL is logged
3052         as a matter of course.
3053
3054         * UIProcess/WebProcessProxy.cpp:
3055         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
3056
3057 2019-08-22  Adrian Perez de Castro  <aperez@igalia.com>
3058
3059         [GTK][WPE] Fixes for non-unified builds after r248547
3060         https://bugs.webkit.org/show_bug.cgi?id=201044
3061
3062         Reviewed by Philippe Normand.
3063
3064         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Add missing inclusion of
3065         the wtf/CrossThreadCopier.h header.
3066         * WebProcess/WebStorage/StorageNamespaceImpl.h: Add missing inclusion of the
3067         WebCore/PageIdentifier.h header.
3068
3069 2019-08-22  Alex Christensen  <achristensen@webkit.org>
3070
3071         Disable legacy TLS versions and add a temporary default to re-enable it
3072         https://bugs.webkit.org/show_bug.cgi?id=200945
3073
3074         Reviewed by Brady Eidson.
3075
3076         * NetworkProcess/NetworkSessionCreationParameters.cpp:
3077         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
3078         (WebKit::NetworkSessionCreationParameters::encode const):
3079         (WebKit::NetworkSessionCreationParameters::decode):
3080         * NetworkProcess/NetworkSessionCreationParameters.h:
3081         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3082         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3083         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3084         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3085         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3086         (WebKit::WebsiteDataStore::parameters):
3087
3088 2019-08-17  Darin Adler  <darin@apple.com>
3089
3090         Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends
3091         https://bugs.webkit.org/show_bug.cgi?id=200862
3092
3093         Reviewed by Ryosuke Niwa.
3094
3095         * Shared/mac/AuxiliaryProcessMac.mm:
3096         (WebKit::setAndSerializeSandboxParameters): Use one append instead of multiple.
3097
3098 2019-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3099
3100         Typing Korean in title field after typing in the body inserts extraneous characters on blog.naver.com
3101         https://bugs.webkit.org/show_bug.cgi?id=201023
3102         <rdar://problem/54294794>
3103
3104         Reviewed by Ryosuke Niwa.
3105
3106         After r242833, we began to avoid sending redundant ElementDidFocus updates in the case where a focused element
3107         was blurred and refocused within the same runloop. This was done to prevent the input view from flickering due
3108         to input view reloading, as well as scrolling to reveal the focused element, when tapping to change selection on
3109         Microsoft Word online.
3110
3111         However, on blog.naver.com, these ElementDidFocus messages were necessary in order to ensure that the platform
3112         input context changes when moving between the title and body fields, or when tapping to change selection. This
3113         is because blog.naver.com uses a hidden contenteditable area under a subframe (see WebCore ChangeLog for more
3114         detail here). While text is never directly inserted into this hidden contenteditable, the events are observed
3115         and used to "play back" editing in the main visible content area.
3116
3117         Thus, when moving between the title and body fields (or when changing selection within either), the only hint we
3118         get is that the hidden editable element is blurred and immediately refocused. Since we no longer send
3119         ElementDidFocus updates in this scenario, UIKeyboardImpl and kbd are not aware that the page has effectively
3120         changed input contexts.
3121
3122         Combined with the fact that Korean IME on iOS may insert additional text given the document context (i.e. text
3123         that the input manager, kbd, thinks we've previously inserted), this means that when typing several characters
3124         into the body field on naver and then switching to edit the title, initial keystrokes may insert unexpected
3125         text in the title field.
3126
3127         To fix this, we add some hooks to notify the UI process when an element that was blurred has been immediately
3128         refocused. Upon receiving this message, the UI process then tells UIKeyboardImpl to re-retrieve its input
3129         context, which calls into -requestAutocorrectionContextWithCompletionHandler: in WKContentView. While notorious
3130         for being synchronous IPC, this is mitigated by (1) being limiting to only instances where we have a hidden
3131         editable area, and (2) being limited by a batching mechanism in the web process, such that if the focused
3132         element is blurred, refocused, re-blurred, and refocused many times in the same runloop, we'll only send a
3133         single UpdateInputContextAfterBlurringAndRefocusingElement message (as opposed to the many ElementDidFocus
3134         messages we would've sent in previous releases).
3135
3136         * Platform/spi/ios/UIKitSPI.h:
3137         * UIProcess/PageClient.h:
3138         * UIProcess/WebPageProxy.h:
3139         * UIProcess/WebPageProxy.messages.in:
3140
3141         Add a new mechanism to update the platform input context (on iOS, UIKeyboardImpl's document state) when focus
3142         moves away from and immediately returns to a hidden editable element.
3143
3144         * UIProcess/ios/PageClientImplIOS.h:
3145         * UIProcess/ios/PageClientImplIOS.mm:
3146         (WebKit::PageClientImpl::updateInputContextAfterBlurringAndRefocusingElement):
3147         * UIProcess/ios/WKContentViewInteraction.h:
3148         * UIProcess/ios/WKContentViewInteraction.mm:
3149         (-[WKContentView _updateInputContextAfterBlurringAndRefocusingElement]):
3150
3151         Tell the active UIKeyboardImpl to refetch document state from the WKContentView. While this does result in a new
3152         autocorrection context request (which, unfortunately, triggers synchronous IPC to the web process), this request
3153         would've still happened anyways in the case where we would previously have sent an ElementDidFocus message.
3154
3155         * UIProcess/ios/WebPageProxyIOS.mm:
3156         (WebKit::WebPageProxy::updateInputContextAfterBlurringAndRefocusingElement):
3157         * WebProcess/WebPage/WebPage.cpp:
3158         (WebKit::WebPage::elementDidFocus):
3159
3160         In the case where we avoid sending a full ElementDidFocus message to the UI process due to refocusing the same
3161         element, we should still notify the UI process so that it can synchronize state between the application process
3162         and kbd. See above for more details.
3163
3164         (WebKit::WebPage::elementDidBlur):
3165         (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
3166         * WebProcess/WebPage/WebPage.h:
3167         * WebProcess/WebPage/ios/WebPageIOS.mm:
3168         (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
3169
3170 2019-08-22  Youenn Fablet  <youenn@apple.com>
3171
3172         Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
3173         https://bugs.webkit.org/show_bug.cgi?id=196870
3174
3175         Reviewed by Alex Christensen.
3176
3177         Make NetworkProcess provide the session ID for any authentication challenge.
3178         In case there is no associated page for the authentication challenge or this is related to a service worker,
3179         ask the website data store to take a decision.
3180         Add website data store delegate to allow applications to make the decision.
3181         Restrict using the delegate to server trust evaluation only.
3182
3183         Make ping loads reuse the same mechanism.
3184
3185         Covered by service worker tests and updated beacon test.
3186
3187         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3188         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
3189         * NetworkProcess/NetworkDataTask.cpp:
3190         (WebKit::NetworkDataTask::sessionID const):
3191         * NetworkProcess/NetworkDataTask.h:
3192         * NetworkProcess/NetworkLoad.cpp:
3193         (WebKit::NetworkLoad::didReceiveChallenge):
3194         * NetworkProcess/NetworkLoadChecker.h:
3195         (WebKit::NetworkLoadChecker::networkProcess):
3196         * NetworkProcess/PingLoad.cpp:
3197         (WebKit::PingLoad::didReceiveChallenge):
3198         * Shared/Authentication/AuthenticationManager.cpp:
3199         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
3200         * Shared/Authentication/AuthenticationManager.h:
3201         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
3202         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
3203         (WebKit::toAuthenticationChallengeDisposition):
3204         * SourcesCocoa.txt:
3205         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3206         (WebsiteDataStoreClient::WebsiteDataStoreClient):
3207         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
3208         * UIProcess/Cocoa/NavigationState.mm:
3209         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
3210         * UIProcess/Network/NetworkProcessProxy.cpp:
3211         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
3212         * UIProcess/Network/NetworkProcessProxy.h:
3213         * UIProcess/Network/NetworkProcessProxy.messages.in:
3214         * UIProcess/ServiceWorkerProcessProxy.cpp:
3215         * UIProcess/ServiceWorkerProcessProxy.h:
3216         * UIProcess/WebPageProxy.cpp:
3217         * UIProcess/WebProcessPool.cpp:
3218         (WebKit::WebProcessPool::isServiceWorkerPageID const):
3219         * UIProcess/WebProcessPool.h:
3220         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
3221         (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
3222         * WebKit.xcodeproj/project.pbxproj:
3223
3224 2019-08-22  Claudio Saavedra  <csaavedra@igalia.com>
3225
3226         [SOUP] NetworkProcessSoup does not initialize CacheOptions correctly
3227         https://bugs.webkit.org/show_bug.cgi?id=200886
3228
3229         Reviewed by Philippe Normand.
3230
3231         r247567 wrongly initializes CacheOptions in a local variable that is never used
3232         instead of using NetworkProcess's member variable, that is later used by the
3233         NetworkSession to initialize the cache.
3234
3235         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3236         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
3237
3238 2019-08-21  Tim Horton  <timothy_horton@apple.com>
3239
3240         [Mail] Tapping top of message scrolls back to copied text instead of top of the message
3241         https://bugs.webkit.org/show_bug.cgi?id=200999
3242         <rdar://problem/54564878>
3243
3244         Reviewed by Wenson Hsieh.
3245
3246         In the case where you have a WebCore selection but are not first responder,
3247         when you tap the WKWebView to become first responder, EventHandler would
3248         bail from setting the selection, assuming UIKit was going to do it. This
3249         behavior was introduced in r233311.
3250
3251         However, since we are not first responder, UIKit does not change the
3252         selection, since it considers the view to not be editable.
3253
3254         Fix this by letting WebCore set the selection in this case, as it used to.
3255
3256         * WebProcess/WebCoreSupport/WebEditorClient.h:
3257         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3258         (WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const):
3259         * WebProcess/WebPage/WebPage.h:
3260         (WebKit::WebPage::isShowingInputViewForFocusedElement const):
3261         Copy the logic from EventHandler, with the added caveat (which fixes the
3262         aforementioned behavior) that we will allow EventHandler to change the
3263         selection if we don't have a focused node in the UIKit sense, because
3264         we know that the platform text interaction code will *not* change the
3265         selection if that is the case, so it's up to us.
3266
3267 2019-08-21  Chris Dumez  <cdumez@apple.com>
3268
3269         Crash under NetworkCache::Data::mapToFile()
3270         https://bugs.webkit.org/show_bug.cgi?id=200996
3271         <rdar://problem/54570421>
3272
3273         Reviewed by Geoffrey Garen.
3274
3275         Make sure NetworkCache::Data::mapToFile() calls makeSafeToUseMemoryMapForPath() between
3276         creating the file and calling mmap().
3277
3278         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3279         (WebKit::NetworkCache::BlobStorage::add):
3280         * NetworkProcess/cache/NetworkCacheData.cpp:
3281         (WebKit::NetworkCache::Data::mapToFile const):
3282
3283 2019-08-21  Chris Dumez  <cdumez@apple.com>
3284
3285         Have NetworkCache::store() null check its completion handler before calling it
3286         https://bugs.webkit.org/show_bug.cgi?id=200994
3287
3288         Reviewed by Geoffrey Garen.
3289
3290         * NetworkProcess/NetworkResourceLoader.cpp:
3291         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3292         Stop passing nullptr for the completion handler now that the parameter has a default value.
3293         Note that passing nullptr here was likely wrong since the NetworkCache::store() implementation
3294         did not null-check the completion handler before calling it.
3295
3296         * NetworkProcess/cache/NetworkCache.cpp:
3297         (WebKit::NetworkCache::Cache::store):
3298         Have NetworkCache::store() null check its completion handler before calling it as calling
3299         a null WTF::Function crashes.
3300
3301         * NetworkProcess/cache/NetworkCache.h:
3302         Use nullptr as default parameter value for the completion handler.
3303
3304 2019-08-21  Rob Buis  <rbuis@igalia.com>
3305
3306         Verify Prefetch and credential behavior
3307         https://bugs.webkit.org/show_bug.cgi?id=200000
3308
3309         Reviewed by Youenn Fablet.
3310
3311         Cancel cross-origin prefetches for Vary: Cookie.
3312
3313         Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html
3314
3315         * NetworkProcess/NetworkResourceLoader.cpp:
3316         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3317         (WebKit::NetworkResourceLoader::didReceiveResponse):
3318         * NetworkProcess/cache/PrefetchCache.cpp:
3319         (WebKit::PrefetchCache::take):
3320
3321 2019-08-21  Ryosuke Niwa  <rniwa@webkit.org>
3322
3323         Put keygen element behind a runtime flag and disable it by default
3324         https://bugs.webkit.org/show_bug.cgi?id=200850
3325
3326         Reviewed by Antti Koivisto.
3327
3328         * Shared/WebPreferences.yaml:
3329         * UIProcess/API/C/WKPreferences.cpp:
3330         (WKPreferencesSetKeygenElementEnabled):
3331         (WKPreferencesGetKeygenElementEnabled):
3332         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3333
3334 2019-08-21  Chris Dumez  <cdumez@apple.com>
3335
3336         Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains()
3337         https://bugs.webkit.org/show_bug.cgi?id=200986
3338         <rdar://problem/32850192>
3339
3340         Reviewed by Brent Fulgham.
3341
3342         Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied.
3343         The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor
3344         does not take care of this for you, despite its name (the createCrossThreadTask() function does though).
3345
3346         * NetworkProcess/NetworkProcess.cpp:
3347         (WebKit::NetworkProcess::fetchWebsiteData):
3348         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
3349         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
3350
3351 2019-08-21  Chris Dumez  <cdumez@apple.com>
3352
3353         Add internal setting to disable SecureContext checks
3354         https://bugs.webkit.org/show_bug.cgi?id=200980
3355         <rdar://problem/54438512>
3356
3357         Reviewed by Alex Christensen.
3358
3359         Add internal setting to disable SecureContext checks, in order to facilitate development