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