c5aa1ee897e384f4a5b60b29b42b231b9aeb0215
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-10-02  Dean Jackson  <dino@apple.com>
2
3         Provide originating website URL to AR QuickLook
4         https://bugs.webkit.org/show_bug.cgi?id=202451
5
6         Reviewed by Antoine Quint.
7
8         Declare the setAdditionalParameters method and
9         call it with the originating page URL if available.
10
11         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
12
13 2019-10-02  Keith Rollin  <krollin@apple.com>
14
15         Properly mark canceled resources in NetworkActivityTracker
16         https://bugs.webkit.org/show_bug.cgi?id=202440
17         <rdar://problem/55843651>
18
19         Reviewed by Brent Fulgham.
20
21         The nw_activity facility tracking resource loads did not originally
22         have support for reporting resources that were canceled. It now has
23         that support (since late MacOS 14-aligned SDKs), so add support for it
24         in NetworkActivityTracker and use it in places where we were
25         previously reporting the status of canceled resources as "None".
26
27         * NetworkProcess/NetworkActivityTracker.h:
28         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
29         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
30         (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
31         * NetworkProcess/NetworkResourceLoader.cpp:
32         (WebKit::NetworkResourceLoader::cleanup):
33         * NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm:
34         (WebKit::NetworkActivityTracker::complete):
35
36 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
37
38         Unreviewed build fix for non-Mac ports after r250600.
39
40         * UIProcess/WebProcessPool.cpp:
41         Make the CoreGraphicsSPI.h header include exclusive to the Mac port.
42
43 2019-10-02  Antoine Quint  <graouts@apple.com>
44
45         Unreviewed build fix for macOS, broken by r250595.
46
47         * UIProcess/WebProcessPool.cpp:
48
49 2019-10-02  youenn fablet  <youenn@apple.com>
50
51         Use strongly typed identifiers for webrtc sockets
52         https://bugs.webkit.org/show_bug.cgi?id=202400
53
54         Reviewed by Chris Dumez.
55
56         Refactoring to use LibWebRTCSocketIdentifier instead of uint64_t.
57
58         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
59         (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
60         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
61         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
62         (WebKit::NetworkRTCProvider::createSocket):
63         (WebKit::NetworkRTCProvider::createUDPSocket):
64         (WebKit::NetworkRTCProvider::createServerTCPSocket):
65         (WebKit::NetworkRTCProvider::createClientTCPSocket):
66         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
67         (WebKit::NetworkRTCProvider::addSocket):
68         (WebKit::NetworkRTCProvider::takeSocket):
69         (WebKit::NetworkRTCProvider::newConnection):
70         (WebKit::NetworkRTCProvider::didReceiveNetworkRTCSocketMessage):
71         (WebKit::NetworkRTCProvider::closeListeningSockets):
72         (WebKit::NetworkRTCProvider::callSocket):
73         * NetworkProcess/webrtc/NetworkRTCProvider.h:
74         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
75         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
76         (WebKit::NetworkRTCSocket::NetworkRTCSocket):
77         * NetworkProcess/webrtc/NetworkRTCSocket.h:
78         * Scripts/webkit/messages.py:
79         * WebProcess/Network/NetworkProcessConnection.cpp:
80         (WebKit::NetworkProcessConnection::didReceiveMessage):
81         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
82         (WebKit::LibWebRTCNetwork::socket):
83         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
84         (WebKit::LibWebRTCSocket::LibWebRTCSocket):
85         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
86         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
87         (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
88         (WebKit::LibWebRTCSocketFactory::createUdpSocket):
89         (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
90         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
91         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
92         (WebKit::LibWebRTCSocketFactory::socket):
93         (WebKit::LibWebRTCSocketFactory::resolver):
94         (WebKit::LibWebRTCSocketFactory::takeResolver):
95         (WebKit::LibWebRTCSocketFactory::disableNonLocalhostConnections):
96         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
97         (WebKit::WebRTCSocket::signalOnNetworkThread):
98         (WebKit::WebRTCSocket::WebRTCSocket):
99         (WebKit::WebRTCSocket::signalSentPacket):
100         (WebKit::WebRTCSocket::signalConnect):
101         (WebKit::WebRTCSocket::signalClose):
102         (WebKit::WebRTCSocket::signalNewConnection):
103         * WebProcess/Network/webrtc/WebRTCSocket.h:
104         * WebProcess/Network/webrtc/WebRTCSocket.messages.in:
105
106 2019-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
107
108         [GTK][WPE] Stop using legacy custom protocol implementation
109         https://bugs.webkit.org/show_bug.cgi?id=202407
110
111         Reviewed by Žan Doberšek.
112
113         Use the new approach, which is simpler and doesn't require to go to the network process to load custom
114         protocols.
115
116         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp: Removed.
117         * NetworkProcess/NetworkProcess.cpp:
118         (WebKit::m_messagePortChannelRegistry):
119         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Removed.
120         * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Removed.
121         * PlatformGTK.cmake:
122         * PlatformWPE.cmake:
123         * SourcesGTK.txt:
124         * SourcesWPE.txt:
125         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp: Removed.
126         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.h: Removed.
127         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
128         (webkitURISchemeRequestCreate):
129         (webkit_uri_scheme_request_get_scheme):
130         (webkit_uri_scheme_request_get_uri):
131         (webkit_uri_scheme_request_get_path):
132         (webkit_uri_scheme_request_get_web_view):
133         (webkitURISchemeRequestReadCallback):
134         (webkit_uri_scheme_request_finish_error):
135         * UIProcess/API/glib/WebKitURISchemeRequestPrivate.h:
136         * UIProcess/API/glib/WebKitWebContext.cpp:
137         (webkitWebContextConstructed):
138         (webkitWebContextDispose):
139         (webkit_web_context_register_uri_scheme):
140         (webkitWebContextCreatePageForWebView):
141         * UIProcess/API/glib/WebKitWebContextPrivate.h:
142         * UIProcess/WebURLSchemeTask.h:
143         (WebKit::WebURLSchemeTask::request const):
144         * UIProcess/soup/WebProcessPoolSoup.cpp:
145
146 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
147
148         [Nicosia] Enable async scrolling at build-time for Nicosia-using ports
149         https://bugs.webkit.org/show_bug.cgi?id=202397
150
151         Reviewed by Carlos Garcia Campos.
152
153         * Shared/WebEvent.h:
154         Enable WebWheelEvent phasing for WPE, as required by the
155         ASYNC_SCROLLING code.
156
157 2019-10-01  Tim Horton  <timothy_horton@apple.com>
158
159         Clean up some includes to make the build a bit faster
160         https://bugs.webkit.org/show_bug.cgi?id=202444
161
162         Reviewed by Geoff Garen.
163
164         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
165
166 2019-10-01  Alex Christensen  <achristensen@webkit.org>
167
168         Progress towards a functioning CMake build on Mac
169         https://bugs.webkit.org/show_bug.cgi?id=202443
170
171         Rubber-stamped by Tim Horton.
172
173         * CMakeLists.txt:
174         * PlatformMac.cmake:
175
176 2019-10-01  John Wilander  <wilander@apple.com>
177
178         Storage Access API: document.hasStorageAccess() should return true when the cookie policy allows access
179         https://bugs.webkit.org/show_bug.cgi?id=202435
180         <rdar://problem/55718526>
181
182         Reviewed by Brent Fulgham.
183
184         WebKit's Storage Access API implementation has so far only looked at whether ITP is
185         blocking cookie access or not. However, the default cookie policy is still in
186         effect underneath ITP. document.hasStorageAccess() should return true if the
187         third-party:
188         a) is not classified by ITP, and
189         b) has cookies which implies it can use cookies as third-party according to the
190         default cookie policy.
191
192         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
193         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
194         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
195         (WebKit::WebResourceLoadStatisticsStore::hasCookies):
196         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
197         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
198         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
199         * NetworkProcess/NetworkProcess.cpp:
200         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
201
202 2019-10-01  Antti Koivisto  <antti@apple.com>
203
204         [CSS Shadow Parts] Parse 'part' attribute
205         https://bugs.webkit.org/show_bug.cgi?id=202409
206
207         Reviewed by Ryosuke Niwa.
208
209         * Shared/WebPreferences.yaml:
210
211         Add experimental feature, default to disabled for now.
212
213 2019-10-01  Alex Christensen  <achristensen@webkit.org>
214
215         Progress towards successful CMake build on Mac
216         https://bugs.webkit.org/show_bug.cgi?id=202426
217
218         Rubber-stamped by Tim Horton.
219
220         * Platform/cocoa/PaymentAuthorizationPresenter.h:
221         * Platform/cocoa/PaymentAuthorizationPresenter.mm:
222         * Platform/cocoa/PaymentAuthorizationViewController.h:
223         * Platform/cocoa/PaymentAuthorizationViewController.mm:
224         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
225         * PlatformMac.cmake:
226         * Shared/SandboxExtension.h:
227         (WebKit::SandboxExtension::createHandleForReadByPid):
228         * SourcesCocoa.txt:
229         * UIProcess/API/Cocoa/WKWebView.mm:
230         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
231         (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
232         * UIProcess/API/mac/WKView.mm:
233         * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:
234         * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
235         * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
236         * UIProcess/Cocoa/WKShareSheet.mm:
237         (-[WKShareSheet delegate]):
238         (-[WKShareSheet setDelegate:]):
239         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
240         * UIProcess/Cocoa/WebViewImpl.h:
241         * WebKit.xcodeproj/project.pbxproj:
242         * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
243         * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h:
244         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
245
246 2019-10-01  Tim Horton  <timothy_horton@apple.com>
247
248         Clean up some includes to make the build a bit faster
249         https://bugs.webkit.org/show_bug.cgi?id=202417
250
251         Reviewed by Jer Noble.
252
253         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
254         * WebProcess/Plugins/Plugin.h:
255         Fix the build.
256
257 2019-10-01  Alex Christensen  <achristensen@webkit.org>
258
259         Fix GTK build after r250558
260         https://bugs.webkit.org/show_bug.cgi?id=202390
261
262         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
263         (webkit_dom_dom_window_confirm):
264
265 2019-10-01  Alex Christensen  <achristensen@webkit.org>
266
267         Fix an internal build.
268
269         Ignore some deprecation warnings.  We'll adopt new SPI soon.
270
271         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
272         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
273
274 2019-10-01  youenn fablet  <youenn@apple.com>
275
276         Remove races condition when validating capture sandbox extension revocation
277         https://bugs.webkit.org/show_bug.cgi?id=202133
278         <rdar://problem/55660905>
279
280         Reviewed by Eric Carlson.
281
282         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
283         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
284         Explicitly ask the page to stop capture.
285         This will make sure capture is stopped when revoking sandbox extensions.
286
287 2019-09-30  Alex Christensen  <achristensen@webkit.org>
288
289         Resurrect Mac CMake build
290         https://bugs.webkit.org/show_bug.cgi?id=202384
291
292         Rubber-stamped by Tim Horton.
293
294         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
295         * PlatformMac.cmake:
296         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
297         * UIProcess/API/Cocoa/WKWebView.mm:
298         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
299         * WebKit2Prefix.h:
300
301 2019-09-30  Christopher Reid  <chris.reid@sony.com>
302
303         [WinCairo] Move Remote Inspector Server initialization out of WebView
304         https://bugs.webkit.org/show_bug.cgi?id=202369
305
306         Reviewed by Ross Kirsling.
307         
308         Move Remote Inspector Server initialization to Windows WebProcessPool initialization.
309
310         * UIProcess/win/WebProcessPoolWin.cpp:
311         * UIProcess/win/WebView.cpp:
312
313 2019-09-30  Alex Christensen  <achristensen@webkit.org>
314
315         Move DownloadMonitor test speed multiplier from WebProcessPool to WebsiteDataStoreConfiguration
316         https://bugs.webkit.org/show_bug.cgi?id=202339
317
318         Reviewed by Youenn Fablet.
319
320         This was only used for some unit tests, which still are accelerated so they pass in the same amount of time as before.
321         I need this value to not be process-global in the NetworkProcess.
322
323         * NetworkProcess/Downloads/Download.cpp:
324         (WebKit::Download::Download):
325         * NetworkProcess/Downloads/Download.h:
326         (WebKit::Download::Download):
327         (WebKit::Download::testSpeedMultiplier const):
328         * NetworkProcess/Downloads/DownloadManager.cpp:
329         (WebKit::DownloadManager::resumeDownload):
330         * NetworkProcess/Downloads/DownloadManager.h:
331         * NetworkProcess/Downloads/DownloadMonitor.cpp:
332         (WebKit::DownloadMonitor::applicationDidEnterBackground):
333         (WebKit::DownloadMonitor::testSpeedMultiplier const):
334         (WebKit::DownloadMonitor::timerFired):
335         (WebKit::DownloadMonitor::speedMultiplier const): Deleted.
336         * NetworkProcess/Downloads/DownloadMonitor.h:
337         * NetworkProcess/NetworkDataTaskBlob.cpp:
338         (WebKit::NetworkDataTaskBlob::download):
339         * NetworkProcess/NetworkProcess.cpp:
340         (WebKit::NetworkProcess::initializeNetworkProcess):
341         * NetworkProcess/NetworkProcess.h:
342         * NetworkProcess/NetworkProcessCreationParameters.cpp:
343         (WebKit::NetworkProcessCreationParameters::encode const):
344         (WebKit::NetworkProcessCreationParameters::decode):
345         * NetworkProcess/NetworkProcessCreationParameters.h:
346         * NetworkProcess/NetworkSession.cpp:
347         (WebKit::NetworkSession::NetworkSession):
348         * NetworkProcess/NetworkSession.h:
349         (WebKit::NetworkSession::testSpeedMultiplier const):
350         * NetworkProcess/NetworkSessionCreationParameters.cpp:
351         (WebKit::NetworkSessionCreationParameters::encode const):
352         (WebKit::NetworkSessionCreationParameters::decode):
353         * NetworkProcess/NetworkSessionCreationParameters.h:
354         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
355         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
356         * UIProcess/API/APIProcessPoolConfiguration.cpp:
357         (API::ProcessPoolConfiguration::copy):
358         * UIProcess/API/APIProcessPoolConfiguration.h:
359         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
360         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
361         (-[_WKProcessPoolConfiguration downloadMonitorSpeedMultiplierForTesting]): Deleted.
362         (-[_WKProcessPoolConfiguration setDownloadMonitorSpeedMultiplierForTesting:]): Deleted.
363         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
364         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
365         (-[_WKWebsiteDataStoreConfiguration testSpeedMultiplier]):
366         (-[_WKWebsiteDataStoreConfiguration setTestSpeedMultiplier:]):
367         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
368         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
369         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
370         (WebKit::WebsiteDataStore::parameters):
371         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
372         (WebKit::WebsiteDataStoreConfiguration::copy):
373         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
374         (WebKit::WebsiteDataStoreConfiguration::testSpeedMultiplier const):
375         (WebKit::WebsiteDataStoreConfiguration::setTestSpeedMultiplier):
376
377 2019-09-30  Carlos Garcia Campos  <cgarcia@igalia.com>
378
379         [GTK] IconDatabase is not thread-safe
380         https://bugs.webkit.org/show_bug.cgi?id=201303
381
382         Reviewed by Žan Doberšek.
383
384         Rewrite the IconDatabase implementation. Now that we are the only users of this code, we can simply it a lot and
385         design it specifically for our API, which implementation has been simplified a lot too. There's no change in
386         the database schema nor in behavior from the API point of view.
387
388         * UIProcess/API/glib/IconDatabase.cpp:
389         (WebKit::IconDatabase::IconDatabase):
390         (WebKit::IconDatabase::~IconDatabase):
391         (WebKit::IconDatabase::createTablesIfNeeded):
392         (WebKit::IconDatabase::populatePageURLToIconURLMap):
393         (WebKit::IconDatabase::clearStatements):
394         (WebKit::IconDatabase::pruneTimerFired):
395         (WebKit::IconDatabase::startPruneTimer):
396         (WebKit::IconDatabase::clearLoadedIconsTimerFired):
397         (WebKit::IconDatabase::startClearLoadedIconsTimer):
398         (WebKit::IconDatabase::iconIDForIconURL):
399         (WebKit::IconDatabase::setIconIDForPageURL):
400         (WebKit::IconDatabase::iconData):
401         (WebKit::IconDatabase::addIcon):
402         (WebKit::IconDatabase::updateIconTimestamp):
403         (WebKit::IconDatabase::deleteIcon):
404         (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded):
405         (WebKit::IconDatabase::loadIconForPageURL):
406         (WebKit::IconDatabase::iconURLForPageURL):
407         (WebKit::IconDatabase::setIconForPageURL):
408         (WebKit::IconDatabase::clear):
409         * UIProcess/API/glib/IconDatabase.h:
410         (WebKit::IconDatabase::create):
411         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
412         (webkitFaviconDatabaseCreate):
413         (webkitFaviconDatabaseIsOpen):
414         (webkitFaviconDatabaseOpen):
415         (webkitFaviconDatabaseClose):
416         (webkitFaviconDatabaseGetLoadDecisionForIcon):
417         (webkitFaviconDatabaseSetIconForPageURL):
418         (webkitFaviconDatabaseGetFaviconInternal):
419         (webkit_favicon_database_get_favicon):
420         (webkit_favicon_database_get_favicon_finish):
421         (webkit_favicon_database_get_favicon_uri):
422         (webkit_favicon_database_clear):
423         * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
424         * UIProcess/API/glib/WebKitWebContext.cpp:
425         (webkitWebContextDispose):
426         (webkit_web_context_set_favicon_database_directory):
427         (webkitWebContextCreatePageForWebView):
428         (webkitWebContextWebViewDestroyed):
429         * UIProcess/API/glib/WebKitWebView.cpp:
430         (webkitWebViewRequestFavicon):
431         (webkitWebViewGetLoadDecisionForIcon):
432         (webkitWebViewSetIcon):
433
434 2019-09-30  Carlos Garcia Campos  <cgarcia@igalia.com>
435
436         [GTK][WPE] Add about:gpu
437         https://bugs.webkit.org/show_bug.cgi?id=202305
438
439         Reviewed by Žan Doberšek.
440
441         A builtin protocol handler to show information about hardware acceleration. This is useful information we need
442         from people reporting issues in accelerated compositing mode.
443
444         * SourcesGTK.txt:
445         * SourcesWPE.txt:
446         * UIProcess/API/glib/WebKitProtocolHandler.cpp: Added.
447         (WebKit::WebKitProtocolHandler::WebKitProtocolHandler):
448         (WebKit::WebKitProtocolHandler::handleRequest):
449         (WebKit::webkitPortName):
450         (WebKit::hardwareAccelerationPolicy):
451         (WebKit::webGLEnabled):
452         (WebKit::openGLAPI):
453         (WebKit::nativeInterface):
454         (WebKit::WebKitProtocolHandler::handleGPU):
455         * UIProcess/API/glib/WebKitProtocolHandler.h: Added.
456         * UIProcess/API/glib/WebKitWebContext.cpp:
457         (webkitWebContextConstructed):
458
459 2019-09-30  Commit Queue  <commit-queue@webkit.org>
460
461         Unreviewed, rolling out r250291.
462         https://bugs.webkit.org/show_bug.cgi?id=202359
463
464         it is failing
465         TestWebKitAPI.ProcessSwap.GetUserMediaCaptureState (Requested
466         by youenn on #webkit).
467
468         Reverted changeset:
469
470         "Delay capture sandbox extension revocation to after the page
471         close message is sent"
472         https://bugs.webkit.org/show_bug.cgi?id=202133
473         https://trac.webkit.org/changeset/250291
474
475 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
476
477         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
478         https://bugs.webkit.org/show_bug.cgi?id=202256
479         <rdar://problem/55772092>
480
481         Reviewed by Simon Fraser.
482
483         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
484         (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
485         Use static casts to retrieve the CALayer pointers from the
486         LayerRepresentation objects due to the explicit operators.
487
488 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
489
490         Tighten up LayerRepresentation operators
491         https://bugs.webkit.org/show_bug.cgi?id=202344
492
493         Reviewed by Simon Fraser.
494
495         With LayerRepresentation operators now being explicit, we require
496         to manually specify conversion to CALayer pointers or
497         GraphicsLayer::PlatformLayerID values.
498
499         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
500         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
501         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
502         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
503         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
504         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
505         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
506         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
507         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
508         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
509         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
510         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):
511
512 2019-09-27  Adrian Perez de Castro  <aperez@igalia.com>
513
514         [GTK][WPE] Fixes for non-unified builds after r249714
515         https://bugs.webkit.org/show_bug.cgi?id=202304
516
517         Reviewed by Youenn Fablet.
518
519         * NetworkProcess/NetworkLoadChecker.h: Add missing inclusion of the pal/SessionID.h header.
520         * NetworkProcess/NetworkResourceLoadMap.cpp: Add missing inclusion of the
521         NetworkResourceLoader.h header.
522         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
523         (WKWebsiteDataStoreConfigurationCreate): Add missing namespace to usage of the
524         WebKit::IsPersistent::Yes value.
525         * UIProcess/WebPageProxy.cpp: Add missing inclusion of the LegacyGlobalSettings.h header.
526
527 2019-09-27  Tim Horton  <timothy_horton@apple.com>
528
529         Adopt new UIWebGeolocationPolicyDecider SPI to pass a view instead of a window
530         https://bugs.webkit.org/show_bug.cgi?id=202329
531         <rdar://problem/25963823>
532
533         Reviewed by Wenson Hsieh.
534
535         * Platform/spi/ios/UIKitSPI.h:
536         * UIProcess/ios/WKGeolocationProviderIOS.mm:
537         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
538         * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
539         (WebKit::decidePolicyForGeolocationRequestFromOrigin):
540         Switch to newer SPI that takes a UIView instead of a UIWindow, so that
541         UIWebGeolocationPolicyDecider can find the correct presenting view controller.
542
543 2019-09-27  Zalan Bujtas  <zalan@apple.com>
544
545         [iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
546         https://bugs.webkit.org/show_bug.cgi?id=202331
547         <rdar://problem/55629493>
548
549         Reviewed by Tim Horton.
550
551         * WebProcess/WebPage/ios/WebPageIOS.mm:
552         (WebKit::WebPage::handleSyntheticClick):
553         (WebKit::nodeTriggersFastPath): Deleted.
554
555 2019-09-27  Alex Christensen  <achristensen@webkit.org>
556
557         Move shouldUseTestingNetworkSession from NetworkProcessCreationParameters to NetworkSessionCreationParameters
558         https://bugs.webkit.org/show_bug.cgi?id=202327
559
560         Reviewed by Tim Horton.
561
562         * NetworkProcess/NetworkProcess.cpp:
563         (WebKit::NetworkProcess::initializeNetworkProcess):
564         (WebKit::NetworkProcess::ensureSession):
565         * NetworkProcess/NetworkProcess.h:
566         * NetworkProcess/NetworkProcessCreationParameters.cpp:
567         (WebKit::NetworkProcessCreationParameters::encode const):
568         (WebKit::NetworkProcessCreationParameters::decode):
569         * NetworkProcess/NetworkProcessCreationParameters.h:
570         * NetworkProcess/NetworkSession.cpp:
571         (WebKit::NetworkSession::NetworkSession):
572         * NetworkProcess/NetworkSessionCreationParameters.cpp:
573         (WebKit::NetworkSessionCreationParameters::encode const):
574         (WebKit::NetworkSessionCreationParameters::decode):
575         * NetworkProcess/NetworkSessionCreationParameters.h:
576         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
577         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
578         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
579         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
580         * NetworkProcess/mac/RemoteNetworkingContext.mm:
581         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
582         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
583         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
584         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
585         (WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota):
586         (WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled):
587         (WKWebsiteDataStoreConfigurationGetTestingSessionEnabled):
588         (WKWebsiteDataStoreConfigurationSetTestingSessionEnabled):
589         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
590         * UIProcess/WebProcessPool.cpp:
591         (WebKit::WebProcessPool::ensureNetworkProcess):
592         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
593         (WebKit::WebsiteDataStore::parameters):
594         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
595         (WebKit::WebsiteDataStoreConfiguration::copy):
596         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
597         (WebKit::WebsiteDataStoreConfiguration::testingSessionEnabled const):
598         (WebKit::WebsiteDataStoreConfiguration::setTestingSessionEnabled):
599
600 2019-09-27  Alex Christensen  <achristensen@webkit.org>
601
602         Move legacy custom protocol registration from process pool to NetworkProcessProxy
603         https://bugs.webkit.org/show_bug.cgi?id=202315
604
605         Reviewed by Tim Horton.
606
607         Legacy custom protocol registration is a global thing, which is why it's legacy and we're trying to get rid of it.
608         In the meantime, we don't want it to be in the set of things the NetworkProcess depends on the WebProcessPool for, which should be an empty set.
609
610         * UIProcess/WebProcessPool.cpp:
611         (WebKit::WebProcessPool::ensureNetworkProcess):
612         (WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
613         (WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
614         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Deleted.
615         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Deleted.
616         * UIProcess/WebProcessPool.h:
617
618 2019-09-27  Alex Christensen  <achristensen@webkit.org>
619
620         Layout Test http/tests/cache-storage/cache-records-persistency.https.html is failing
621         https://bugs.webkit.org/show_bug.cgi?id=202323
622
623         Reviewed by Tim Horton.
624
625         This reverts most of r250351.
626         It turns out NetworkProcessProxy::addSession has some side effects in the UIProcess that are useful for NetworkProcess resumption after crashes.  Let's keep that.
627
628         * NetworkProcess/NetworkProcess.cpp:
629         (WebKit::NetworkProcess::initializeNetworkProcess):
630         * NetworkProcess/NetworkProcessCreationParameters.cpp:
631         (WebKit::NetworkProcessCreationParameters::encode const):
632         (WebKit::NetworkProcessCreationParameters::decode):
633         * NetworkProcess/NetworkProcessCreationParameters.h:
634         * UIProcess/WebProcessPool.cpp:
635         (WebKit::WebProcessPool::ensureNetworkProcess):
636
637 2019-09-27  Jer Noble  <jer.noble@apple.com>
638
639         Unreviewed build-fix: wrap the AssertionServicesSPI.h in an IOS_FAMILY check.
640
641         * WebProcess/cocoa/WebProcessCocoa.mm:
642
643 2019-09-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
644
645         [iOS]: When inserting a photo and then inserting auto-corrected text, the photo is removed
646         https://bugs.webkit.org/show_bug.cgi?id=202294
647
648         Reviewed by Wenson Hsieh.
649
650         WebPage::applyAutocorrectionInternal() calls wordRangeFromPosition() to
651         calculate the range of the word to be replaced with the auto-corrected
652         word. But if the text of the range does not match the original text,
653         applyAutocorrectionInternal() tries to correct the range by moving it
654         forward such that the length of the text range matches the length of the
655         original text.
656
657         Another case, which should correct the range also, is: the range does not
658         have a text but it is not collapsed. In this case, we should set the range
659         back to the selection range so non-text nodes is removed.
660
661         * WebProcess/WebPage/ios/WebPageIOS.mm:
662         (WebKit::WebPage::applyAutocorrectionInternal):
663
664 2019-09-27  John Wilander  <wilander@apple.com>
665
666         Storage Access API: document.hasStorageAccess() should return false by default
667         https://bugs.webkit.org/show_bug.cgi?id=202281
668         <rdar://problem/55718526>
669
670         Reviewed by Alex Christensen.
671
672         document.hasStorageAccess() should return false by default so that it only
673         returns true if the context has asked for and been granted storage access.
674
675         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
676         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
677         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
678         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
679
680 2019-09-27  Jer Noble  <jer.noble@apple.com>
681
682         [iOS] Lock screen controls can fail to play web content
683         https://bugs.webkit.org/show_bug.cgi?id=202279
684
685         Reviewed by Chris Dumez.
686
687         When playback is paused from the lock screen via Now Playing controls, the WebProcess,
688         UIProcess, and Network Process will all be suspended. MediaRemote will take an assertion
689         and wake up the WebProcess when a remote control command to "play" is sent via the Now
690         Playing controls. However, if a synchronous message to the (suspended) Network or UIProcess
691         is issued before the notification that the process was unexpectedly unsuspended can be
692         issued (which will subsequently unsuspend the UIProcess and Network process), we can get
693         into a deadlocked state where the main thread is blocked on the sync message to a suspended
694         process.
695
696         To work around this problem, move all the processing from ProcessTaskStateObserver to a
697         WorkQueue / background thread. This requires making the ProcessTaskStateObserver thread-safe,
698         though its only current client is a Singleton (the WebProcess class), and so the risk of
699         thread safety issues is currently minimal. Regardless, access to the Client pointer must be
700         guarded by a Lock, and the Client itself must become ref-counted, so that the
701         ProcessTaskStateObserver can ref its Client (the WebProcess) during callback processing.
702
703         Unfortunately, sendWithAsyncReply() is not thread safe, nor is ProcessAssertion, so instead
704         just use send() and set a 5-second timeout before expiring the assertion, and just use
705         BKSProcessStateAssertion directly.
706
707         * Shared/Cocoa/ProcessTaskStateObserver.h:
708         (WebKit::ProcessTaskStateObserver::Client::ref):
709         (WebKit::ProcessTaskStateObserver::Client::deref):
710         (WebKit::ProcessTaskStateObserver::setClient): Deleted.
711         (WebKit::ProcessTaskStateObserver::client): Deleted.
712         * Shared/Cocoa/ProcessTaskStateObserver.mm:
713         (-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
714         (WebKit::ProcessTaskStateObserver::create):
715         (WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
716         (WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
717         (WebKit::ProcessTaskStateObserver::invalidate):
718         (WebKit::ProcessTaskStateObserver::client):
719         (WebKit::ProcessTaskStateObserver::setTaskState):
720         * WebProcess/WebProcess.cpp:
721         (WebKit::m_taskStateObserver):
722         * WebProcess/WebProcess.h:
723         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
724         (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
725         * UIProcess/WebProcessProxy.h:
726         * UIProcess/WebProcessProxy.messages.in:
727         * WebProcess/cocoa/WebProcessCocoa.mm:
728         (WebKit::WebProcess::processTaskStateDidChange):
729
730 2019-09-27  Alex Christensen  <achristensen@webkit.org>
731
732         Move service worker process termination delay disabling from process pool to website data store
733         https://bugs.webkit.org/show_bug.cgi?id=202308
734
735         Reviewed by Chris Dumez.
736
737         It's only there for a test, which still works quickly.
738
739         * NetworkProcess/NetworkProcess.cpp:
740         (WebKit::NetworkProcess::initializeNetworkProcess):
741         (WebKit::NetworkProcess::addWebsiteDataStore):
742         (WebKit::NetworkProcess::destroySession):
743         (WebKit::NetworkProcess::fetchWebsiteData):
744         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
745         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
746         (WebKit::NetworkProcess::swServerForSession):
747         (WebKit::NetworkProcess::addServiceWorkerSession):
748         (WebKit::NetworkProcess::disableServiceWorkerProcessTerminationDelay): Deleted.
749         * NetworkProcess/NetworkProcess.h:
750         * NetworkProcess/NetworkProcess.messages.in:
751         * Shared/WebsiteDataStoreParameters.cpp:
752         (WebKit::WebsiteDataStoreParameters::encode const):
753         (WebKit::WebsiteDataStoreParameters::decode):
754         * Shared/WebsiteDataStoreParameters.h:
755         * UIProcess/API/Cocoa/WKProcessPool.mm:
756         (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]): Deleted.
757         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
758         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
759         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
760         (-[_WKWebsiteDataStoreConfiguration serviceWorkerProcessTerminationDelayEnabled]):
761         (-[_WKWebsiteDataStoreConfiguration setServiceWorkerProcessTerminationDelayEnabled:]):
762         * UIProcess/WebProcessPool.cpp:
763         (WebKit::WebProcessPool::ensureNetworkProcess):
764         (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay): Deleted.
765         * UIProcess/WebProcessPool.h:
766         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
767         (WebKit::WebsiteDataStore::parameters):
768         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
769         (WebKit::WebsiteDataStoreConfiguration::copy):
770         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
771         (WebKit::WebsiteDataStoreConfiguration::serviceWorkerProcessTerminationDelayEnabled const):
772         (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerProcessTerminationDelayEnabled):
773
774 2019-09-27  Alex Christensen  <achristensen@webkit.org>
775
776         Enable and disable ResourceLoadStatistics only by session
777         https://bugs.webkit.org/show_bug.cgi?id=202298
778
779         Reviewed by Chris Dumez.
780
781         This is needed to keep per-session things per-session and per-process-pool things per-process-pool.
782         This was a strange case where we would take the current session's value and apply it globally.
783         This has no change in behavior because it is globally enabled and disabled by API clients anyways.
784
785         * NetworkProcess/NetworkProcess.cpp:
786         (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
787         * NetworkProcess/NetworkProcess.h:
788         * NetworkProcess/NetworkProcess.messages.in:
789         * UIProcess/API/Cocoa/WKWebView.mm:
790         (-[WKWebView _initializeWithConfiguration:]):
791         * UIProcess/WebProcessPool.cpp:
792         (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled): Deleted.
793         * UIProcess/WebProcessPool.h:
794         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
795         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
796
797 2019-09-27  Alex Christensen  <achristensen@webkit.org>
798
799         Remove unused WebProcessPool::setCanHandleHTTPSServerTrustEvaluation
800         https://bugs.webkit.org/show_bug.cgi?id=202285
801
802         Reviewed by Youenn Fablet.
803
804         The SPI to set this was deprecated in r250377 with a replacement that was adopted in rdar://problem/55731135
805         I removed a layout test using the old SPI and replaced it with a more precise API test verifying the behavior of the new SPI
806         before and after the introduction of NSURLSession's _strictTrustEvaluate:queue:completionHandler:
807
808         * NetworkProcess/NetworkProcess.cpp:
809         (WebKit::NetworkProcess::initializeNetworkProcess):
810         (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation): Deleted.
811         * NetworkProcess/NetworkProcess.h:
812         (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation const): Deleted.
813         * NetworkProcess/NetworkProcess.messages.in:
814         * NetworkProcess/NetworkProcessCreationParameters.cpp:
815         (WebKit::NetworkProcessCreationParameters::encode const):
816         (WebKit::NetworkProcessCreationParameters::decode):
817         * NetworkProcess/NetworkProcessCreationParameters.h:
818         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
819         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
820         (canNSURLSessionTrustEvaluate): Deleted.
821         * UIProcess/API/C/WKContext.cpp:
822         (WKContextSetCanHandleHTTPSServerTrustEvaluation):
823         * UIProcess/API/Cocoa/WKProcessPool.mm:
824         (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
825         * UIProcess/WebProcessPool.cpp:
826         (WebKit::WebProcessPool::ensureNetworkProcess):
827         (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation): Deleted.
828         * UIProcess/WebProcessPool.h:
829
830 2019-09-27  Alex Christensen  <achristensen@webkit.org>
831
832         Remove unused APIProcessPoolConfiguration::diskCacheSpeculativeValidationEnabled
833         https://bugs.webkit.org/show_bug.cgi?id=202290
834
835         Reviewed by Carlos Garcia Campos.
836
837         The SPI to set this was deprecated in r250377 with a replacement that was adopted in rdar://problem/55731135
838
839         * NetworkProcess/NetworkProcessCreationParameters.cpp:
840         (WebKit::NetworkProcessCreationParameters::encode const):
841         (WebKit::NetworkProcessCreationParameters::decode):
842         * NetworkProcess/NetworkProcessCreationParameters.h:
843         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
844         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
845         * UIProcess/API/APIProcessPoolConfiguration.cpp:
846         (API::ProcessPoolConfiguration::copy):
847         * UIProcess/API/APIProcessPoolConfiguration.h:
848         * UIProcess/API/C/WKContext.cpp:
849         (WKContextSetDiskCacheSpeculativeValidationEnabled):
850         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
851         (WKWebsiteDataStoreConfigurationGetNetworkCacheSpeculativeValidationEnabled):
852         (WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled):
853         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
854         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
855         (-[_WKProcessPoolConfiguration diskCacheSpeculativeValidationEnabled]):
856         (-[_WKProcessPoolConfiguration setDiskCacheSpeculativeValidationEnabled:]):
857         * UIProcess/WebProcessPool.cpp:
858         (WebKit::WebProcessPool::ensureNetworkProcess):
859
860 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
861
862         [CoordinatedGraphics] support bounds origin
863         https://bugs.webkit.org/show_bug.cgi?id=198998
864
865         Reviewed by Carlos Garcia Campos.
866
867         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
868         (WebKit::CoordinatedGraphicsScene::updateSceneState):
869         Apply bounds origin value to the TextureMapperLayer object.
870
871 2019-09-27  Youenn Fablet  <youenn@apple.com>
872
873         Make IsNSURLSessionWebSocketEnabled an experimental flag
874         https://bugs.webkit.org/show_bug.cgi?id=202135
875         <rdar://problem/55694721>
876
877         Reviewed by Geoff Garen.
878
879         Add C API to switch off this feature in WTR.
880
881         * Shared/WebPreferences.yaml:
882         * UIProcess/API/C/WKPreferences.cpp:
883         (WKPreferencesSetIsNSURLSessionWebSocketEnabled):
884         (WKPreferencesGetIsNSURLSessionWebSocketEnabled):
885         * UIProcess/API/C/WKPreferencesRefPrivate.h:
886
887 2019-09-27  Jiewen Tan  <jiewen_tan@apple.com>
888
889         SubFrameSOAuthorizationSession should ensure messages are posted in the right order to the parent frame
890         https://bugs.webkit.org/show_bug.cgi?id=202061
891         <rdar://problem/55485666>
892
893         Reviewed by Youenn Fablet.
894
895         This patch ensures messages that signal the process of SOAuthorization interception are posted in
896         the right order to the parent frame. Before this patch, there are chances that SOAuthorizationDidCancel
897         could be posted to the parent before SOAuthorizationDidStart. There are few causes that lead to
898         this race condition:
899         1) SubFrameSOAuthorizationSession::beforeStart posts SOAuthorizationDidStart in the next runloop. So
900         extension could have the chance to invoke SubFrameSOAuthorizationSession::fallBackToWebPathInternal
901         before SOAuthorizationDidStart is posted.
902         2) Even if the order is right in the UI process, it is not guaranteed that Web process will strictly
903         follow the order as the loading process is async.
904
905         To fix the issue:
906         1) SubFrameSOAuthorizationSession::beforeStart now posts SOAuthorizationDidStart in the same runloop.
907         2) Observer is introduced in FrameLoadState such that SubFrameSOAuthorizationSession could know if
908         the loading is finished. With this new capacity, SubFrameSOAuthorizationSession can ensure it only
909         posts next message when the previous message has been posted.
910
911         Implementation wise, a deque to queue requests is provided to maintain order.
912         1) When new request is added to the deque, SubFrameSOAuthorizationSession will only load the request
913         if it is the only element in the deque. Otherwise, it does nothing.
914         2) When SubFrameSOAuthorizationSession receives didFinishLoad, it pops the head of the queue and loads
915         the next request in the queue if any.
916         The above design should guarantee all requests are loaded in sequence.
917
918         * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
919         * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
920         (WebKit::SubFrameSOAuthorizationSession::SubFrameSOAuthorizationSession):
921         (WebKit::SubFrameSOAuthorizationSession::~SubFrameSOAuthorizationSession):
922         (WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
923         (WebKit::SubFrameSOAuthorizationSession::completeInternal):
924         (WebKit::SubFrameSOAuthorizationSession::beforeStart):
925         (WebKit::SubFrameSOAuthorizationSession::didFinishLoad):
926         (WebKit::SubFrameSOAuthorizationSession::appendRequestToLoad):
927         (WebKit::SubFrameSOAuthorizationSession::loadRequestToFrame):
928         (WebKit::SubFrameSOAuthorizationSession::loadDataToFrame): Deleted.
929         (WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent): Deleted.
930         * UIProcess/FrameLoadState.cpp:
931         (WebKit::FrameLoadState::addObserver):
932         (WebKit::FrameLoadState::removeObserver):
933         (WebKit::FrameLoadState::didFinishLoad):
934         * UIProcess/FrameLoadState.h:
935
936 2019-09-26  Kate Cheney  <katherine_cheney@apple.com>
937
938         Resource Load Statistics: Downgrade all third-party referrer headers
939         https://bugs.webkit.org/show_bug.cgi?id=201353
940         <rdar://problem/54895650>
941         
942         Majority of this patch was written by John Wilander <wilander@apple.com>.
943
944         Reviewed by Brent Fulgham. 
945
946         When tracking protections are enabled, we should downgrade all third-party
947         referrers to their origins. Note that this downgrade will be specific to
948         Cocoa so other ports will have to adopt as they see fit.
949
950         Cocoa already does this downgrade in ephemeral sessions (shipping).
951
952         The majority of these changes are test infrastructure. The functional
953         change is in WebKit::NetworkDataTaskCocoa and WebKit::NetworkSession.
954
955         * NetworkProcess/NetworkProcess.cpp:
956         (WebKit::NetworkProcess::setShouldDowngradeReferrerForTesting):
957         * NetworkProcess/NetworkProcess.h:
958         * NetworkProcess/NetworkProcess.messages.in:
959         * NetworkProcess/NetworkSession.cpp:
960         (WebKit::NetworkSession::isResourceLoadStatisticsEnabled const):
961         (WebKit::NetworkSession::setShouldDowngradeReferrerForTesting):
962         (WebKit::NetworkSession::shouldDowngradeReferrer const):
963         * NetworkProcess/NetworkSession.h:
964         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
965         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
966         (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest const):
967         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
968         (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
969         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
970         (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest): Deleted.
971         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
972         (WKWebsiteDataStoreSetResourceLoadStatisticsShouldDowngradeReferrerForTesting):
973         (WKWebsiteDataStoreStatisticsResetToConsistentState):
974         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
975         * UIProcess/Network/NetworkProcessProxy.cpp:
976         (WebKit::NetworkProcessProxy::setShouldDowngradeReferrerForTesting):
977         * UIProcess/Network/NetworkProcessProxy.h:
978         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
979         (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldDowngradeReferrerForTesting):
980         * UIProcess/WebsiteData/WebsiteDataStore.h:
981
982 2019-09-26  Eric Carlson  <eric.carlson@apple.com>
983
984         REGRESSION (iOS 13): Trying to record just audio using HTML Media Capture crashes Safari
985         https://bugs.webkit.org/show_bug.cgi?id=202039
986         <rdar://problem/55566628>
987
988         Reviewed by Jer Noble.
989
990         * UIProcess/ios/forms/WKFileUploadPanel.mm:
991         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]): UIImagePickerController doesn't 
992         support audio-only recording, so show the video recorder for "audio/*".
993
994 2019-09-26  Tim Horton  <timothy_horton@apple.com>
995
996         Add some logging to help diagnose blank or stuck WKWebViews
997         https://bugs.webkit.org/show_bug.cgi?id=202297
998         <rdar://problem/55763610>
999
1000         Reviewed by Wenson Hsieh.
1001
1002         Our current logging is insufficient to rule out some of the potential
1003         causes of stuck/blank WKWebViews in <rdar://problem/53399054>. Add
1004         some new logging, and improve some existing logging, to aid in diagnosis.
1005
1006         * UIProcess/API/Cocoa/WKWebView.mm:
1007         (-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
1008         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
1009         Rename _delayUpdateVisibleContentRects to be more specific that it
1010         was due to us being underneath a UIScrollView delegate callback.
1011
1012         (-[WKWebView _processWillSwapOrDidExit]):
1013         (-[WKWebView _didCommitLayerTree:]):
1014         Add a log when we receive an incoming commit while visible content rect
1015         updates are being deferred. Also, include the current transaction ID
1016         and the transaction ID that _needsResetViewState... is waiting for, to
1017         help rule out a class of potential problems.
1018
1019         Add a log when we receive an incoming commit more than 5 seconds after
1020         a visible content rect update.
1021
1022         (-[WKWebView _updateVisibleContentRects]):
1023         Keep track of when we defer visual content rect updates for any reason,
1024         and log the first time we do an update after deferring them. This will make
1025         it MUCH easier at-a-glance to tell if one of the "bailing" messages
1026         represents a long-term state (a problem), or is expected.
1027
1028         Keep track of how long it's been since we sent a visible content rect update
1029         and didn't get a commit back from the Web Content process; if it's been
1030         more than 5 seconds, start logging.
1031
1032         (-[WKWebView _cancelAnimatedResize]):
1033         (-[WKWebView _didCompleteAnimatedResize]):
1034         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1035         (-[WKWebView _endAnimatedResize]):
1036         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
1037         Turn animated resize logging into release logging. It is a common culprit
1038         for many kinds of bugs, while also not being high volume, so this is well worth it.
1039         
1040         * WebProcess/WebPage/WebPage.cpp:
1041         (WebKit::WebPage::freezeLayerTree):
1042         (WebKit::WebPage::unfreezeLayerTree):
1043         Show the current value of m_layerTreeFreezeReasons in addition to the old value and delta,
1044         so you don't have to manually compute the current value when reading logs.
1045
1046 2019-09-26  Dean Jackson  <dino@apple.com>
1047
1048         ContextMenu on a link in an email no longer shows web preview
1049         https://bugs.webkit.org/show_bug.cgi?id=201120
1050         <rdar://54353617>
1051
1052         Reviewed by Wenson Hsieh.
1053
1054         Only go down the image path if we are not also a link.
1055
1056         * UIProcess/ios/WKContentViewInteraction.mm:
1057         (-[WKContentView continueContextMenuInteraction:]):
1058
1059 2019-09-26  Chris Dumez  <cdumez@apple.com>
1060
1061         Stop using testRunner.overridePreference() to turn on Page Cache
1062         https://bugs.webkit.org/show_bug.cgi?id=202274
1063
1064         Reviewed by Alex Christensen.
1065
1066         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1067         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1068
1069 2019-09-26  Andy Estes  <aestes@apple.com>
1070
1071         Crash under WebPage::beginPrinting when m_printContext becomes null due to synchronous layout
1072         https://bugs.webkit.org/show_bug.cgi?id=202171
1073         <rdar://problem/49731211>
1074
1075         Reviewed by Tim Horton.
1076
1077         Speculatively fix a null pointer dereference crash in WebPage::beginPrinting.
1078
1079         WebPage::beginPrinting creates a PrintContext, stores it in m_printContext, then calls
1080         PrintContext::begin which forces a synchronous, paginated layout. If a post-layout task
1081         executes script, that might result in the WebPage being closed and m_printContext being set
1082         to nullptr.
1083
1084         Guard against this in WebPage::beginPrinting by adding a null check before calling
1085         PrintContext::computePageRects.
1086
1087         * WebProcess/WebPage/WebPage.cpp:
1088         (WebKit::WebPage::beginPrinting):
1089
1090 2019-09-26  Kate Cheney  <katherine_cheney@apple.com>
1091
1092         Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
1093         https://bugs.webkit.org/show_bug.cgi?id=195420
1094         <rdar://problem/54213551>
1095
1096         Reviewed by Brent Fulgham.
1097
1098         Changed all RELEASE_LOG_ERROR() calls involving domain strings to
1099         RELEASE_LOG_ERROR_IF_ALLOWED() to prevent leaking information about
1100         the domain strings only if sessionID.isAlwaysOnLoggingAllowed().
1101
1102         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1103         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
1104         Added autovacuuming to the constructor to avoid manually calling
1105         runVacuumCommand(). Changed constructor to take in sessionID so it
1106         can use RELEASE_LOG_ERROR_IF_ALLOWED which requires the sessionID.
1107
1108         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
1109         Added 2 statements that were not being prepared.
1110
1111         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
1112         Corrected incorrect capitalization. Added check for nullopt in case
1113         domainID is for a domain not in the database yet.
1114
1115         (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
1116         Changed return value to Optional<unsigned>. Some tests were directly
1117         checking for subframes under top frame domains on domains that had
1118         not been inserted yet. Now, domainID() won't crash but will return
1119         a nullopt value which can be checked to know that the tests failed.
1120
1121         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
1122         Added a check to assure domainID exists and updated the domainID
1123         interactions to work as Optionals.
1124
1125         (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
1126         Moved the prepareStatements() call after the vacuum command in the case
1127         where the database is empty. Otherwise called it before returning.
1128
1129         (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
1130         Added a space to the SQL commands to correct the syntax.
1131
1132         (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
1133         Corrected a bug in the SQL command for querying
1134         subframeUnderTopFrameDomain. The old query was asking for subresource.
1135
1136         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
1137         Spelling fix.
1138
1139         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
1140         Changed string concatenation to binding.
1141
1142         (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
1143         The grandfathering.html test was failing because domains were being
1144         "set" to grandfathered in the database before being inserted. This fix
1145         ensures all domains before setting the grandfathering flag.
1146
1147         (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
1148         Multiple tests were failing because the query to insert the relationship
1149         for the source domain relies on the target domain being in the
1150         ObservedDomains table. This patch ensures all domains are added before
1151         performing the query.
1152
1153         (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
1154         Added a != SQLITE_OK check to make sure an error is logged if the
1155         statement fails to bind.
1156
1157         (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
1158         Changed string concatenation to binding.
1159
1160         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):   
1161         The SQL statement was being bound to a value and not being reset. This
1162         patch resets the statement after binding. Additionally, the step()
1163         function was being compared to SQLITE_DONE instead of SQLITE_ROW,
1164         causing an error if the query returned results. The
1165         ASSERT_NOT_REACHED() was causing null searches to crash instead of
1166         returning false (i.e. if a domain is not in the database it should
1167         return that it has no user interaction instead of crashing).
1168
1169         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource): 
1170         Updated domainID call to act as an Optional. 
1171         
1172         (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
1173         The SQL statement was being bound to a value and not being reset. This
1174         patch resets the statement after binding. SQLITE_DONE changed to
1175         SQLITE_ROW to return non-empty query results. ASSERT_NOT_REACHED()
1176         removed for the same reasons as above. 
1177
1178         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
1179         Fixed the release log statement which was logging the wrong function 
1180         name.
1181
1182         (WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents): 
1183         Clears the database and rebuilds the tables on a clear command to
1184         match the functionality in the Memory Store.
1185
1186         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):                   
1187         Call the clearDatabaseContents function to match the functionality 
1188         in the Memory Store. 
1189
1190         (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
1191         Updated domainID call to act as an Optional. 
1192
1193         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
1194         Tests were failing because shouldRemoveAllWebsiteDataFor() was not 
1195         checking for expired user interaction. Matched functionality in the
1196         Memory Store.
1197
1198         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
1199         Tests were failing because shouldRemoveAllWebsiteDataFor() was not 
1200         checking for expired user interaction. Matched functionality in the
1201         Memory Store. 
1202
1203         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
1204         Spelling fix. 
1205
1206         (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded): 
1207         Last seen should be sorted in ascending order because you want to 
1208         prune the older statistics first, which will have a lower lastSeen
1209         field (secondsSinceEpoch() will be lower for older values).
1210
1211         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const): Deleted.
1212         Deleted const specifier because the function needs to clear the
1213         database. 
1214
1215         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:      
1216         Declared new functions. Updated spelling error (registerable --> 
1217         registrable). Updated constructor to take sessionID. 
1218
1219         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: 
1220         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1221         ITP database flag now is stored in the NetworkProcess.
1222         * NetworkProcess/NetworkProcess.cpp: 
1223
1224         (WebKit::NetworkProcess::initializeNetworkProcess): 
1225         Set the ITP database flag which is now stored in the Network Process. 
1226
1227         (WebKit::NetworkProcess::setUseITPDatabase): 
1228         * NetworkProcess/NetworkProcess.h:
1229         (WebKit::NetworkProcess::isITPDatabaseEnabled const):
1230         * NetworkProcess/NetworkProcess.messages.in:
1231         Passed the setUseITPDatabase flag to the initialization function 
1232         of the statistics store to enable the database backend.
1233
1234         * NetworkProcess/NetworkSession.cpp:
1235         (WebKit::NetworkSession::NetworkSession):
1236         SandboxExtension::consumePermanently was not getting called on the 
1237         WebKitTestRunner resourceLoadStatistics path. This was preventing
1238         the database file from opening. 
1239
1240         (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
1241         Destroy old WebResourceLoadStatisticsStore and create a new one using
1242         the ITP database.
1243
1244         * NetworkProcess/NetworkSession.h:
1245         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1246         (WKWebsiteDataStoreSetUseITPDatabase):
1247         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1248         * UIProcess/Network/NetworkProcessProxy.cpp:
1249         (WebKit::NetworkProcessProxy::setUseITPDatabase):
1250         * UIProcess/Network/NetworkProcessProxy.h:
1251         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1252         (WebKit::WebsiteDataStore::setUseITPDatabase):
1253         * UIProcess/WebsiteData/WebsiteDataStore.h:
1254         Passed the setUseITPDatabase flag to the initialization function
1255         of the statistics store to enable the database backend. 
1256
1257 2019-09-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1258
1259         [iOS 13] Tapping on a non-editable text selection should toggle callout bar visibility instead of clearing selection
1260         https://bugs.webkit.org/show_bug.cgi?id=202254
1261         <rdar://problem/54410263>
1262
1263         Reviewed by Megan Gardner.
1264
1265         In iOS 13, tapping a text selection should toggle callout bar visibility (i.e. "selection commands" in UIKit).
1266         This currently does not work for non-editable text, since the synthetic click gesture simultaneously fires
1267         alongside the text interaction assistant's non-editable tap gesture, which dispatches a click to the page which
1268         then clears the selection.
1269
1270         To remedy this and match platform behavior, we avoid recognizing clicks that occur over the text selection, but
1271         only in the case where the bounding rect of the text selection doesn't cover a large portion of the visible
1272         content rect of the web view. This ensures that the user doesn't get stuck in a state where it's impossible to
1273         dismiss a very large text selection (e.g. after selecting all the content on the page).
1274
1275         Tests:  editing/selection/ios/clear-selection-after-tap-in-large-selected-non-editable-text.html
1276                 editing/selection/ios/toggle-callout-bar-after-tap-in-selected-non-editable-text.html
1277
1278         * UIProcess/ios/WKContentViewInteraction.mm:
1279         (-[WKContentView _shouldToggleSelectionCommandsAfterTapAt:]):
1280
1281         Check the last known selection rects (on _lastSelectionDrawingInfo) to see if the tapped point lies within at
1282         least one of the selection rects.
1283
1284         (-[WKContentView gestureRecognizerShouldBegin:]):
1285
1286 2019-09-26  Patrick Griffis  <pgriffis@igalia.com>
1287
1288         [GTK] Fix logic of dark theme detection
1289         https://bugs.webkit.org/show_bug.cgi?id=202276
1290
1291         - If GTK_THEME is set it has a higher priority to GtkSettings.
1292         - GTK_THEME may be a -dark theme or :dark variant, handle both.
1293
1294         Reviewed by Michael Catanzaro.
1295
1296         * UIProcess/API/gtk/PageClientImpl.cpp:
1297         (WebKit::PageClientImpl::effectiveAppearanceIsDark const):
1298
1299 2019-09-25  Alex Christensen  <achristensen@webkit.org>
1300
1301         Add replacement SPI on _WKWebsiteDataStoreConfiguration for enabling speculative cache validation and IPC-free server trust evaluation
1302         https://bugs.webkit.org/show_bug.cgi?id=202251
1303
1304         Reviewed by Tim Horton.
1305
1306         These are two performance optimizations that are currently per-ProcessPool that need to be per-WebsiteDataStore.
1307         This makes replacement SPI and deprecates the old SPI.  I'm going to adopt the new SPI then remove the old SPI.
1308
1309         * NetworkProcess/NetworkSession.cpp:
1310         (WebKit::NetworkSession::NetworkSession):
1311         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1312         (WebKit::NetworkSessionCreationParameters::encode const):
1313         (WebKit::NetworkSessionCreationParameters::decode):
1314         * NetworkProcess/NetworkSessionCreationParameters.h:
1315         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1316         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1317         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1318         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1319         * UIProcess/API/C/WKContextPrivate.h:
1320         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1321         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1322         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
1323         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
1324         (-[_WKWebsiteDataStoreConfiguration networkCacheSpeculativeValidationEnabled]):
1325         (-[_WKWebsiteDataStoreConfiguration setNetworkCacheSpeculativeValidationEnabled:]):
1326         (-[_WKWebsiteDataStoreConfiguration fastServerTrustEvaluationEnabled]):
1327         (-[_WKWebsiteDataStoreConfiguration setFastServerTrustEvaluationEnabled:]):
1328         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1329         (WebKit::WebsiteDataStore::parameters):
1330         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
1331         (WebKit::WebsiteDataStoreConfiguration::copy):
1332         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
1333         (WebKit::WebsiteDataStoreConfiguration::fastServerTrustEvaluationEnabled const):
1334         (WebKit::WebsiteDataStoreConfiguration::setFastServerTrustEvaluationEnabled):
1335         (WebKit::WebsiteDataStoreConfiguration::networkCacheSpeculativeValidationEnabled const):
1336         (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheSpeculativeValidationEnabled):
1337
1338 2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1339
1340         Fix failing layout tests after trac.webkit.org/r250183
1341         https://bugs.webkit.org/show_bug.cgi?id=202053
1342         <rdar://problem/54542190>
1343
1344         Reviewed by Tim Horton.
1345
1346         Followup to r250183: move the implementation of -gestureRecognizer:shouldReceiveTouch: out of
1347         ENABLE(TOUCH_EVENTS) and into ENABLE(POINTER_EVENTS) instead. This logic is necessary in order for scrolling
1348         via pan gestures to work on iOS, in the case where ENABLE(POINTER_EVENTS) is on but ENABLE(TOUCH_EVENTS) is off.
1349         This is because the new swipe gesture recognizers added in r250183 will otherwise always take priority over the
1350         scroll view's pan gestures.
1351
1352         Fixes the following layout tests:
1353         - fast/scrolling/ios/reconcile-layer-position-recursive.html
1354         - fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
1355         - fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-main-frame.html
1356
1357         * UIProcess/ios/WKContentViewInteraction.mm:
1358
1359 2019-09-25  Megan Gardner  <megan_gardner@apple.com>
1360
1361         Update selections after scrolling for iframes and hide selections while iframes and overflow scrolls are scrolling.
1362         https://bugs.webkit.org/show_bug.cgi?id=202125
1363
1364         Reviewed by Tim Horton.
1365
1366         Add additional calls into UIKit differentiate between main frame scrolling and overflow/iframe scrolling.
1367         Add piping for iframe specific scrolling.
1368
1369         * Platform/spi/ios/UIKitSPI.h:
1370         * UIProcess/ios/WKContentViewInteraction.mm:
1371         (-[WKContentView _willStartScrollingOrZooming]):
1372         (-[WKContentView _didEndScrollingOrZooming]):
1373         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1374         (WebKit::WebEditorClient::subFrameScrollPositionChanged):
1375         * WebProcess/WebCoreSupport/WebEditorClient.h:
1376         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
1377         (WebKit::WebEditorClient::subFrameScrollPositionChanged):
1378
1379 2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1380
1381         Page temporarily jumps to an excessively small viewport scale while loading usatoday.com
1382         https://bugs.webkit.org/show_bug.cgi?id=202224
1383         <rdar://problem/52906640>
1384
1385         Reviewed by Tim Horton.
1386
1387         Tweaks the content-aware shrink-to-fit algorithm to bail in the case where the content width is extremely large,
1388         such that it bails instead of attempting to fit the entire content of the page. See WebCore ChangeLog for more
1389         details.
1390
1391         * WebProcess/WebPage/ios/WebPageIOS.mm:
1392         (WebKit::WebPage::immediatelyShrinkToFitContent):
1393
1394 2019-09-25  Alex Christensen  <achristensen@webkit.org>
1395
1396         Don't fall back to default session if session can't be found for cookie operations
1397         https://bugs.webkit.org/show_bug.cgi?id=202222
1398
1399         Reviewed by Geoff Garen.
1400
1401         Apparently, during teardown of private browsing sessions, there is sometimes a race condition and cookies from a torn-down session are requested.
1402         In this case, just fail like we do all other operations in this file.  Otherwise, it's a breach of privacy.
1403
1404         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1405         (WebKit::NetworkConnectionToWebProcess::storageSession):
1406         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1407         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
1408         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1409         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
1410         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
1411         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
1412         * NetworkProcess/NetworkConnectionToWebProcess.h:
1413
1414 2019-09-25  Alex Christensen  <achristensen@webkit.org>
1415
1416         Remove duplicate WebsiteDataStoreConfiguration copying code
1417         https://bugs.webkit.org/show_bug.cgi?id=202215
1418
1419         Reviewed by Tim Horton.
1420
1421         WKWebsiteDataStore's _initWithConfiguration was duplicating the functionality of WebsiteDataStoreConfiguration::copy.
1422         The former should just call the latter.
1423         This move has the side effect of making _WKWebsiteDataStoreConfiguration's paths readable, which I think is desirable so I added a unit test verifying it is so.
1424
1425         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
1426         (WKWebsiteDataStoreConfigurationCreate):
1427         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1428         (-[WKWebsiteDataStore _initWithConfiguration:]):
1429         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
1430         (-[_WKWebsiteDataStoreConfiguration init]):
1431         (-[_WKWebsiteDataStoreConfiguration initNonPersistentConfiguration]):
1432         * UIProcess/WebProcessPool.cpp:
1433         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
1434         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1435         (WebKit::WebsiteDataStore::createNonPersistent):
1436         (WebKit::WebsiteDataStore::defaultDataStore):
1437         (WebKit::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
1438         * UIProcess/WebsiteData/WebsiteDataStore.h:
1439         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
1440         (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
1441         (WebKit::WebsiteDataStoreConfiguration::copy):
1442         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
1443         (WebKit::WebsiteDataStoreConfiguration::create):
1444         (WebKit::WebsiteDataStoreConfiguration::isPersistent const):
1445         (WebKit::WebsiteDataStoreConfiguration::setPersistent): Deleted.
1446
1447 2019-09-25  Alex Christensen  <achristensen@webkit.org>
1448
1449         Replace WebsiteDataStoreParameters::privateSessionParameters with re-initializing all sessions immediately upon NetworkProcess resumption
1450         https://bugs.webkit.org/show_bug.cgi?id=202211
1451
1452         Reviewed by Tim Horton.
1453
1454         Re-adding an ephemeral session after a NetworkProcess crash based on guessing that all its parameters are empty was added in r227590 with a test.
1455         That test passes even when that re-adding code is removed because we re-add all sessions with parameters from the UIProcess when we restart a NetworkProcess.
1456         I move the addition of non-default sessions to the initialization message instead of messages after the initialization message to remove race conditions that
1457         might cause loads to happen before the NetworkProcess has received its second message from the UIProcess.  I also add a unit test to verify that session
1458         resumption also works with non-default persistent WebsiteDataStores.
1459
1460         * NetworkProcess/NetworkProcess.cpp:
1461         (WebKit::NetworkProcess::initializeNetworkProcess):
1462         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1463         (WebKit::NetworkProcessCreationParameters::encode const):
1464         (WebKit::NetworkProcessCreationParameters::decode):
1465         * NetworkProcess/NetworkProcessCreationParameters.h:
1466         * NetworkProcess/NetworkResourceLoader.cpp:
1467         (WebKit::NetworkResourceLoader::startNetworkLoad):
1468         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1469         (WebKit::NetworkSessionCreationParameters::privateSessionParameters): Deleted.
1470         * NetworkProcess/NetworkSessionCreationParameters.h:
1471         * Shared/WebsiteDataStoreParameters.cpp:
1472         (WebKit::WebsiteDataStoreParameters::privateSessionParameters): Deleted.
1473         * Shared/WebsiteDataStoreParameters.h:
1474         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted.
1475         * UIProcess/WebProcessPool.cpp:
1476         (WebKit::WebProcessPool::ensureNetworkProcess):
1477
1478 2019-09-25  Alex Christensen  <achristensen@webkit.org>
1479
1480         Replace _WKProcessPoolConfiguration.CTDataConnectionServiceType with _WKWebsiteDataStoreConfiguration.dataConnectionServiceType
1481         https://bugs.webkit.org/show_bug.cgi?id=202174
1482
1483         Reviewed by Tim Horton.
1484
1485         _WKProcessPoolConfiguration.CTDataConnectionServiceType is used in one place and needs a replacement so we can
1486         start a NetworkProcess without a WKProcessPool.  Since this SPI only does something in the low-level networking code,
1487         I verified that the new SPI sets the String the way the old one does, and the old one keeps working in the interim.
1488
1489         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1490         (WebKit::NetworkSessionCreationParameters::encode const):
1491         (WebKit::NetworkSessionCreationParameters::decode):
1492         * NetworkProcess/NetworkSessionCreationParameters.h:
1493         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1494         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1495         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1496         (-[WKWebsiteDataStore _initWithConfiguration:]):
1497         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1498         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
1499         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
1500         (-[_WKWebsiteDataStoreConfiguration dataConnectionServiceType]):
1501         (-[_WKWebsiteDataStoreConfiguration setDataConnectionServiceType:]):
1502         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1503         (WebKit::WebsiteDataStore::parameters):
1504         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
1505         (WebKit::WebsiteDataStoreConfiguration::copy):
1506         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
1507         (WebKit::WebsiteDataStoreConfiguration::dataConnectionServiceType const):
1508         (WebKit::WebsiteDataStoreConfiguration::setDataConnectionServiceType):
1509
1510 2019-09-25  Commit Queue  <commit-queue@webkit.org>
1511
1512         Unreviewed, rolling out r250336.
1513         https://bugs.webkit.org/show_bug.cgi?id=202210
1514
1515         it is creating failures on iOS bots (Requested by youenn on
1516         #webkit).
1517
1518         Reverted changeset:
1519
1520         "Make IsNSURLSessionWebSocketEnabled an experimental flag"
1521         https://bugs.webkit.org/show_bug.cgi?id=202135
1522         https://trac.webkit.org/changeset/250336
1523
1524 2019-09-25  Youenn Fablet  <youenn@apple.com>
1525
1526         Creation of a service worker connection for a service worker job should be based on the job scope
1527         https://bugs.webkit.org/show_bug.cgi?id=202185
1528
1529         Reviewed by Alex Christensen.
1530
1531         * NetworkProcess/NetworkProcess.cpp:
1532         (WebKit::NetworkProcess::swServerForSession):
1533         Assert that registrable domain is not empty.
1534         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1535         (WebKit::WebSWServerConnection::scheduleJobInServer):
1536         Use the scope URL instead of the script URL which may be empty in case of an unregister job.
1537
1538 2019-09-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1539
1540         [iPadOS] [DataActivation] Focus moves away after focusing input fields on www.att.com
1541         https://bugs.webkit.org/show_bug.cgi?id=202167
1542         <rdar://problem/55185021>
1543
1544         Reviewed by Tim Horton.
1545
1546         When using the data activation page on www.att.com, one of the sections on the page contains several select
1547         elements; in the case where the user agent:
1548
1549         1. contains the string "iPad", and
1550         2. does not contain the string "Safari"
1551
1552         ...www.att.com's data activation page will opt into a mode where it adds blur event listeners to the select
1553         elements; in this blur event listener, www.att.com proceeds to programmatically focus a non-editable div element
1554         after a 1 second timeout. The reasons for this behavior remain unclear to me, though it's worth noting that the
1555         blur event handler name is "screenReaderFocus", which suggests that this is in place to ensure compatibility
1556         with screen readers.
1557
1558         In iOS 12, dismissing the popover would blur the focused select menu with an animation. Since the animation
1559         would take a slightly less than 1 second, www.att.com's logic would have the effect of moving focus to the div
1560         element shortly after dismissing the select menu. However, after r243808, we no longer attempt to blur the
1561         focused select element when dismissing the popover. This means that the select element is only blurred the next
1562         time the user activates another focused element, such as one of the input fields on the page, or a different
1563         select element. Consequently, the logic to move focus into a div element now occurs only after a different
1564         element has already been focused; this results in focus moving away from newly focused elements after 1 second
1565         in the case where a select element has previously focused.
1566
1567         To mitigate this, restore iOS 12 behavior behind a site- and app-specific quirk. See comments below for more
1568         details.
1569
1570         * Shared/FocusedElementInformation.cpp:
1571         (WebKit::FocusedElementInformation::encode const):
1572         (WebKit::FocusedElementInformation::decode):
1573         * Shared/FocusedElementInformation.h:
1574
1575         Add a new behavioral quirk flag to FocusedElementInformation to determine whether we should use "legacy" select
1576         popover dismissal behavior (i.e. blurring the focused select element when dismissing the select popover, as well
1577         as dismissing the popover with animation).
1578
1579         * Shared/WebPreferences.yaml:
1580
1581         Enable site-specific quirks by default in WKWebView. With regards to this bug, this change allows for
1582         site-specific hacks (namely, legacy select popover dismissal) in DataActivation. However, this also fixes
1583         various known bugs that are otherwise addressed in Safari only, via site-specific quirks.
1584
1585         * UIProcess/API/Cocoa/WKWebView.mm:
1586         (-[WKWebView _initializeWithConfiguration:]):
1587
1588         For apps linked on or before iOS 13 and macOS 10.15, revert the default of value of NeedsSiteSpecificQuirks to
1589         false. This is done here instead of in a default value function in WebPreferencesDefaultValues to prevent the
1590         default values of NeedsSiteSpecificQuirks in the web process and UI process from going out of sync, since the
1591         web process is not necessarily linked against the same SDK as the application.
1592
1593         * UIProcess/Cocoa/VersionChecks.h:
1594
1595         Add a new DYLD version check for the first version of iOS and macOS where site-specific quirks are enabled by
1596         default.
1597
1598         * UIProcess/ios/WKContentViewInteraction.h:
1599         * UIProcess/ios/WKContentViewInteraction.mm:
1600         (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
1601         (-[WKContentView _elementDidBlur]):
1602         (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):
1603
1604         We only use "legacy" select popover dismissal behavior in the case where the site-specific quirk flag is on, a
1605         select popover is used (i.e. the device is an iPad and a select element is focused), and the application bundle
1606         is "com.apple.DataActivation".
1607
1608         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1609         (-[WKSelectTableViewController shouldDismissWithAnimation]):
1610
1611         Keyed off of _shouldUseLegacySelectPopoverDismissalBehavior.
1612
1613         (-[WKSelectPopover controlEndEditing]):
1614         * WebProcess/WebPage/ios/WebPageIOS.mm:
1615         (WebKit::WebPage::getFocusedElementInformation):
1616
1617 2019-09-25  Jonathan Bedard  <jbedard@apple.com>
1618
1619         Unreviewed, rolling out r250324.
1620
1621         Broke many mac wk2 layout tests
1622
1623         Reverted changeset:
1624
1625         "Enable LayoutTests using ResourceLoadStatistics SQLite
1626         backend (195420)"
1627         https://bugs.webkit.org/show_bug.cgi?id=195420
1628         https://trac.webkit.org/changeset/250324
1629
1630 2019-09-25  Youenn Fablet  <youenn@apple.com>
1631
1632         Make IsNSURLSessionWebSocketEnabled an experimental flag
1633         https://bugs.webkit.org/show_bug.cgi?id=202135
1634
1635         Reviewed by Geoffrey Garen.
1636
1637         * Shared/WebPreferences.yaml:
1638
1639 2019-09-24  Chris Dumez  <cdumez@apple.com>
1640
1641         [iOS] Regression(r249703) frequent 'kill() returned unexpected error' log messages
1642         https://bugs.webkit.org/show_bug.cgi?id=202173
1643
1644         Reviewed by Geoffrey Garen.
1645
1646         The kill(pid, 0) command actually fails with an EPERM error when there is a process
1647         running with the given pid, and this is causing us to log a lot of errors. The good
1648         news is that we merely want to know that there is no process with the given PID and
1649         we correctly get a ESRCH error in this case. I renamed the function from
1650         isRunningProcessPID() to wasTerminated() and only check for ESRCH error now. I no
1651         longer log any error otherwise since this is expected.
1652
1653         Also, for performance reason, I no longer call kill(pid, 0) from inside
1654         AuxiliaryProcessProxy::state() as it gets called a lot. I instead only call it from
1655         AuxiliaryProcessProxy::wasTerminated() and call it from
1656         WebProcessPool::tryTakePrewarmedProcess().
1657
1658         * UIProcess/AuxiliaryProcessProxy.cpp:
1659         (WebKit::AuxiliaryProcessProxy::state const):
1660         (WebKit::AuxiliaryProcessProxy::wasTerminated const):
1661         (WebKit::AuxiliaryProcessProxy::isRunningProcessPID): Deleted.
1662         * UIProcess/AuxiliaryProcessProxy.h:
1663         * UIProcess/WebProcessPool.cpp:
1664         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1665
1666 2019-09-24  Christopher Reid  <chris.reid@sony.com>
1667
1668         [WinCairo] Start RemoteInspectorServer
1669         https://bugs.webkit.org/show_bug.cgi?id=199938
1670         <rdar://problem/53323048>
1671
1672         Reviewed by Fujii Hironori.
1673
1674         Enable the remote inspector client on WinCairo.
1675         The inspector server will run if the WEBKIT_INSPECTOR_SERVER environment variable is set.
1676         WEBKIT_INSPECTOR_SERVER needs to be set in the form of <ip>:port e.g. WEBKIT_INSPECTOR_SERVER=127.0.0.1:1234.
1677
1678         Updated the protocol handler to update the target list with DOM manipulation.
1679
1680         * UIProcess/socket/RemoteInspectorClient.cpp:
1681         * UIProcess/socket/RemoteInspectorClient.h:
1682         * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
1683         * UIProcess/socket/RemoteInspectorProtocolHandler.h:
1684         * UIProcess/win/WebView.cpp:
1685
1686 2019-09-24  Kate Cheney  <katherine_cheney@apple.com>
1687
1688         Enable LayoutTests using ResourceLoadStatistics SQLite backend (195420)
1689         https://bugs.webkit.org/show_bug.cgi?id=195420
1690         <rdar://problem/54213551>
1691
1692         Reviewed by Brent Fulgham.
1693
1694         Changed all RELEASE_LOG_ERROR() calls involving domain strings to
1695         RELEASE_LOG_ERROR_IF_ALLOWED() to prevent leaking information about
1696         the domain strings only if sessionID.isAlwaysOnLoggingAllowed().
1697
1698         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1699         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
1700         Added autovacuuming to the constructor to avoid manually calling
1701         runVacuumCommand(). Changed constructor to take in sessionID so it
1702         can use RELEASE_LOG_ERROR_IF_ALLOWED which requires the sessionID.
1703
1704         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
1705         Added 2 statements that were not being prepared.
1706
1707         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
1708         Corrected incorrect capitalization. Added check for nullopt in case
1709         domainID is for a domain not in the database yet.
1710
1711         (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
1712         Changed return value to Optional<unsigned>. Some tests were directly
1713         checking for subframes under top frame domains on domains that had
1714         not been inserted yet. Now, domainID() won't crash but will return
1715         a nullopt value which can be checked to know that the tests failed.
1716
1717         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
1718         Added a check to assure domainID exists and updated the domainID
1719         interactions to work as Optionals.
1720
1721         (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
1722         Moved the prepareStatements() call after the vacuum command in the case
1723         where the database is empty. Otherwise called it before returning.
1724
1725         (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
1726         Added a space to the SQL commands to correct the syntax.
1727
1728         (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
1729         Corrected a bug in the SQL command for querying
1730         subframeUnderTopFrameDomain. The old query was asking for subresource.
1731
1732         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
1733         Spelling fix.
1734
1735         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
1736         Changed string concatenation to binding.
1737
1738         (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
1739         The grandfathering.html test was failing because domains were being
1740         "set" to grandfathered in the database before being inserted. This fix
1741         ensures all domains before setting the grandfathering flag.
1742
1743         (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
1744         Multiple tests were failing because the query to insert the relationship
1745         for the source domain relies on the target domain being in the
1746         ObservedDomains table. This patch ensures all domains are added before
1747         performing the query.
1748
1749         (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
1750         Added a != SQLITE_OK check to make sure an error is logged if the
1751         statement fails to bind.
1752
1753         (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
1754         Changed string concatenation to binding.
1755
1756         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):   
1757         The SQL statement was being bound to a value and not being reset. This
1758         patch resets the statement after binding. Additionally, the step()
1759         function was being compared to SQLITE_DONE instead of SQLITE_ROW,
1760         causing an error if the query returned results. The
1761         ASSERT_NOT_REACHED() was causing null searches to crash instead of
1762         returning false (i.e. if a domain is not in the database it should
1763         return that it has no user interaction instead of crashing).
1764
1765         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource): 
1766         Updated domainID call to act as an Optional. 
1767         
1768         (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
1769         The SQL statement was being bound to a value and not being reset. This
1770         patch resets the statement after binding. SQLITE_DONE changed to
1771         SQLITE_ROW to return non-empty query results. ASSERT_NOT_REACHED()
1772         removed for the same reasons as above. 
1773
1774         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain):
1775         Fixed the release log statement which was logging the wrong function 
1776         name.
1777
1778         (WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents): 
1779         Clears the database and rebuilds the tables on a clear command to
1780         match the functionality in the Memory Store.
1781
1782         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):                   
1783         Call the clearDatabaseContents function to match the functionality 
1784         in the Memory Store. 
1785
1786         (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
1787         Updated domainID call to act as an Optional. 
1788
1789         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
1790         Tests were failing because shouldRemoveAllWebsiteDataFor() was not 
1791         checking for expired user interaction. Matched functionality in the
1792         Memory Store.
1793
1794         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
1795         Tests were failing because shouldRemoveAllWebsiteDataFor() was not 
1796         checking for expired user interaction. Matched functionality in the
1797         Memory Store. 
1798
1799         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
1800         Spelling fix. 
1801
1802         (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded): 
1803         Last seen should be sorted in ascending order because you want to 
1804         prune the older statistics first, which will have a lower lastSeen
1805         field (secondsSinceEpoch() will be lower for older values).
1806
1807         (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const): Deleted.
1808         Deleted const specifier because the function needs to clear the
1809         database. 
1810
1811         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:      
1812         Declared new functions. Updated spelling error (registerable --> 
1813         registrable). Updated constructor to take sessionID. 
1814
1815         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: 
1816         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1817         ITP database flag now is stored in the NetworkProcess.
1818         * NetworkProcess/NetworkProcess.cpp: 
1819
1820         (WebKit::NetworkProcess::initializeNetworkProcess): 
1821         Set the ITP database flag which is now stored in the Network Process. 
1822
1823         (WebKit::NetworkProcess::addWebsiteDataStore):
1824         SandboxExtension::consumePermanently was not getting called on the 
1825         WebKitTestRunner resourceLoadStatistics path. This was preventing
1826         the database file from opening. 
1827
1828         (WebKit::NetworkProcess::setUseITPDatabase): 
1829         * NetworkProcess/NetworkProcess.h:
1830         (WebKit::NetworkProcess::isITPDatabaseEnabled const):
1831         * NetworkProcess/NetworkProcess.messages.in:
1832         Passed the setUseITPDatabase flag to the initialization function 
1833         of the statistics store to enable the database backend.
1834
1835         * NetworkProcess/NetworkSession.cpp:
1836         (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
1837         Destroy old WebResourceLoadStatisticsStore and create a new one using
1838         the ITP database.
1839
1840         * NetworkProcess/NetworkSession.h:
1841         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1842         (WKWebsiteDataStoreSetUseITPDatabase):
1843         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1844         * UIProcess/Network/NetworkProcessProxy.cpp:
1845         (WebKit::NetworkProcessProxy::setUseITPDatabase):
1846         * UIProcess/Network/NetworkProcessProxy.h:
1847         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1848         (WebKit::WebsiteDataStore::setUseITPDatabase):
1849         * UIProcess/WebsiteData/WebsiteDataStore.h:
1850         Passed the setUseITPDatabase flag to the initialization function
1851         of the statistics store to enable the database backend. 
1852
1853 2019-09-24  Alex Christensen  <achristensen@webkit.org>
1854
1855         Make iOS WebProcessPool directory getters static
1856         https://bugs.webkit.org/show_bug.cgi?id=202157
1857
1858         Reviewed by Tim Horton.
1859
1860         No change in behavior.  This just cuts another dependency the NetworkProcessProxy has on its owning WebProcessPool.
1861
1862         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1863         (WebKit::WebProcessPool::cookieStorageDirectory):
1864         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
1865         (WebKit::WebProcessPool::parentBundleDirectory):
1866         (WebKit::WebProcessPool::networkingCachesDirectory):
1867         (WebKit::WebProcessPool::webContentCachesDirectory):
1868         (WebKit::WebProcessPool::containerTemporaryDirectory):
1869         (WebKit::WebProcessPool::cookieStorageDirectory const): Deleted.
1870         (WebKit::WebProcessPool::parentBundleDirectory const): Deleted.
1871         (WebKit::WebProcessPool::networkingCachesDirectory const): Deleted.
1872         (WebKit::WebProcessPool::webContentCachesDirectory const): Deleted.
1873         (WebKit::WebProcessPool::containerTemporaryDirectory const): Deleted.
1874         * UIProcess/WebProcessPool.cpp:
1875         (WebKit::WebProcessPool::ensureNetworkProcess):
1876         * UIProcess/WebProcessPool.h:
1877
1878 2019-09-24  Patrick Griffis  <pgriffis@igalia.com>
1879
1880         [GTK][WPE] Minor code cleanup in BubblewrapLauncher
1881         https://bugs.webkit.org/show_bug.cgi?id=201906
1882
1883         This just cleans up string handling and some
1884         whitespace fixes.
1885
1886         Reviewed by Carlos Garcia Campos.
1887
1888         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1889         (WebKit::XDGDBusProxyLauncher::setAddress):
1890         (WebKit::XDGDBusProxyLauncher::launch):
1891         (WebKit::XDGDBusProxyLauncher::makeProxyPath):
1892         (WebKit::XDGDBusProxyLauncher::dbusAddressToPath):
1893
1894 2019-09-24  Zalan Bujtas  <zalan@apple.com>
1895
1896         [iPadOs] The second click event is missing on double tap when dblclick handler is not present
1897         https://bugs.webkit.org/show_bug.cgi?id=202006
1898         <rdar://problem/51706828>
1899
1900         Reviewed by Wenson Hsieh.
1901
1902         While double tapping,
1903         1. the first tap triggers a click event through the normal _singleTapIdentified/_singleTapRecognized codepath.
1904         2. and the second tap should trigger either
1905           a second single click event or
1906           a second single click followed by a dblclick event when dblclick handler is present.
1907         However the second click is dropped on the floor when the node under the cursor does not have a dblclick handler (see handleDoubleTapForDoubleClickAtPoint()) -so we end up sending one click event.
1908
1909         This patch fixes this case by sending the second tap through the normal single tap flow when the dblclick handler is not present.
1910
1911         * Shared/ios/InteractionInformationAtPosition.h:
1912         * Shared/ios/InteractionInformationAtPosition.mm:
1913         (WebKit::InteractionInformationAtPosition::encode const):
1914         (WebKit::InteractionInformationAtPosition::decode):
1915         * UIProcess/ios/WKContentViewInteraction.h:
1916         * UIProcess/ios/WKContentViewInteraction.mm:
1917         (-[WKContentView setupInteraction]):
1918         (-[WKContentView gestureRecognizerShouldBegin:]):
1919         (WebKit::WebPage::positionInformation):
1920         (WebKit::WebPage::requestPositionInformation):
1921
1922 2019-09-24  Alex Christensen  <achristensen@webkit.org>
1923
1924         Move HSTS storage directory to LegacyGlobalSettings
1925         https://bugs.webkit.org/show_bug.cgi?id=202059
1926
1927         Reviewed by Tim Horton.
1928
1929         I continue my lamentation begun in r245075.
1930         Remove the glib setting of it on the WebKitWebContext because they use it on the WebsiteDataStore.  We should do that too when we can.
1931
1932         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1933         (API::ProcessPoolConfiguration::copy):
1934         * UIProcess/API/APIProcessPoolConfiguration.h:
1935         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1936         (-[_WKProcessPoolConfiguration setHSTSStorageDirectory:]):
1937         (-[_WKProcessPoolConfiguration hstsStorageDirectory]):
1938         * UIProcess/LegacyGlobalSettings.h:
1939         (WebKit::LegacyGlobalSettings::setHSTSStorageDirectory):
1940         (WebKit::LegacyGlobalSettings::hstsStorageDirectory const):
1941         * UIProcess/WebProcessPool.cpp:
1942         (WebKit::WebProcessPool::ensureNetworkProcess):
1943
1944 2019-09-24  Keith Rollin  <krollin@apple.com>
1945
1946         Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
1947         https://bugs.webkit.org/show_bug.cgi?id=202119
1948         <rdar://problem/55638792>
1949
1950         Reviewed by Alex Christensen.
1951
1952         After refactoring and other code evolution, some platform checks have
1953         ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
1954         vice-versa). These can be converted into the equivalent
1955         PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
1956         check can be removed altogether (along with any "#else" branches).
1957
1958         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1959         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1960         * WebProcess/WebCoreSupport/WebChromeClient.h:
1961
1962 2019-09-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1963
1964         FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState triggers a debug assertion
1965         https://bugs.webkit.org/show_bug.cgi?id=202145
1966         <rdar://problem/51273128>
1967
1968         Reviewed by Tim Horton.
1969
1970         Fixes an assertion in -tableView:cellForRowAtIndexPath: to only require the cell to have a non-zero
1971         width in the case where the table view itself has a non-empty width. When run under TestWebKitAPI,
1972         this assertion currently fires because the view controller used to show the popover isn't actually
1973         presented, so the view controller's view (i.e. the UITableView) ends up being empty. This causes all
1974         of its table view cells to subsequently become empty upon reuse.
1975
1976         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1977         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
1978
1979 2019-09-24  Alex Christensen  <achristensen@webkit.org>
1980
1981         Require a WebsiteDataStore when creating or resuming downloads
1982         https://bugs.webkit.org/show_bug.cgi?id=202081
1983
1984         Reviewed by Youenn Fablet.
1985
1986         No change in behavior, but I'll have to move Safari to the new SPI.
1987         This makes it so there are no cases where we guess we need to use the default session,
1988         and it allows downloads to function correctly once there is a NetworkProcess singleton.
1989         Removing the unused WebProcessPool& in the callbacks will allow us to eventually have
1990         downloads only associated with a WebsiteDataStore and not a WebProcessPool.
1991
1992         * UIProcess/API/APIDownloadClient.h:
1993         (API::DownloadClient::didStart):
1994         (API::DownloadClient::didReceiveAuthenticationChallenge):
1995         (API::DownloadClient::didReceiveResponse):
1996         (API::DownloadClient::didReceiveData):
1997         (API::DownloadClient::decideDestinationWithSuggestedFilename):
1998         (API::DownloadClient::didCreateDestination):
1999         (API::DownloadClient::didFinish):
2000         (API::DownloadClient::didFail):
2001         (API::DownloadClient::didCancel):
2002         (API::DownloadClient::processDidCrash):
2003         (API::DownloadClient::willSendRequest):
2004         * UIProcess/API/C/WKContext.cpp:
2005         (WKContextSetDownloadClient):
2006         (WKContextDownloadURLRequest):
2007         (WKContextResumeDownload):
2008         * UIProcess/API/C/WKContext.h:
2009         * UIProcess/API/Cocoa/WKProcessPool.mm:
2010         (-[WKProcessPool _setDownloadDelegate:]):
2011         (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
2012         (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
2013         (-[WKProcessPool _downloadURLRequest:websiteDataStore:originatingWebView:]):
2014         (-[WKProcessPool _resumeDownloadFromData:websiteDataStore:path:originatingWebView:]):
2015         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2016         * UIProcess/API/glib/WebKitDownloadClient.cpp:
2017         * UIProcess/API/glib/WebKitWebContext.cpp:
2018         (webkitWebContextDispose):
2019         (webkitWebContextStartDownload):
2020         * UIProcess/Cocoa/DownloadClient.h:
2021         * UIProcess/Cocoa/DownloadClient.mm:
2022         (WebKit::DownloadClient::didStart):
2023         (WebKit::DownloadClient::didReceiveResponse):
2024         (WebKit::DownloadClient::didReceiveData):
2025         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
2026         (WebKit::DownloadClient::didCreateDestination):
2027         (WebKit::DownloadClient::processDidCrash):
2028         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
2029         (WebKit::DownloadClient::didFinish):
2030         (WebKit::DownloadClient::didFail):
2031         (WebKit::DownloadClient::didCancel):
2032         (WebKit::DownloadClient::willSendRequest):
2033         * UIProcess/Downloads/DownloadProxy.cpp:
2034         (WebKit::DownloadProxy::create):
2035         (WebKit::DownloadProxy::DownloadProxy):
2036         (WebKit::DownloadProxy::invalidate):
2037         (WebKit::DownloadProxy::processDidClose):
2038         (WebKit::DownloadProxy::didStart):
2039         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
2040         (WebKit::DownloadProxy::willSendRequest):
2041         (WebKit::DownloadProxy::didReceiveResponse):
2042         (WebKit::DownloadProxy::didReceiveData):
2043         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
2044         (WebKit::DownloadProxy::didCreateDestination):
2045         (WebKit::DownloadProxy::didFinish):
2046         (WebKit::DownloadProxy::didFail):
2047         (WebKit::DownloadProxy::didCancel):
2048         * UIProcess/Downloads/DownloadProxy.h:
2049         * UIProcess/Downloads/DownloadProxyMap.cpp:
2050         (WebKit::DownloadProxyMap::createDownloadProxy):
2051         * UIProcess/Downloads/DownloadProxyMap.h:
2052         * UIProcess/Network/NetworkProcessProxy.cpp:
2053         (WebKit::NetworkProcessProxy::createDownloadProxy):
2054         * UIProcess/Network/NetworkProcessProxy.h:
2055         * UIProcess/WebPageProxy.cpp:
2056         (WebKit::WebPageProxy::receivedPolicyDecision):
2057         (WebKit::WebPageProxy::contextMenuItemSelected):
2058         * UIProcess/WebProcessPool.cpp:
2059         (WebKit::WebProcessPool::WebProcessPool):
2060         (WebKit::WebProcessPool::setDownloadClient):
2061         (WebKit::WebProcessPool::download):
2062         (WebKit::WebProcessPool::resumeDownload):
2063         (WebKit::WebProcessPool::createDownloadProxy):
2064         * UIProcess/WebProcessPool.h:
2065
2066 2019-09-24  Youenn Fablet  <youenn@apple.com>
2067
2068         Delay capture sandbox extension revocation to after the page close message is sent
2069         https://bugs.webkit.org/show_bug.cgi?id=202133
2070
2071         Reviewed by Eric Carlson.
2072
2073         This ensures that the sandbox extension is removed once no longer useful
2074         and makes our WebProcess assertions fine.
2075
2076         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2077         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
2078
2079 2019-09-23  Chris Dumez  <cdumez@apple.com>
2080
2081         Drop unnecessary SessionID.h header includes
2082         https://bugs.webkit.org/show_bug.cgi?id=202129
2083
2084         Reviewed by Alex Christensen.
2085
2086         * NetworkProcess/AdClickAttributionManager.h:
2087         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
2088         * NetworkProcess/NetworkLoadParameters.h:
2089         * NetworkProcess/RemoteNetworkingContext.h:
2090         * NetworkProcess/cache/CacheStorageEngine.cpp:
2091         * NetworkProcess/cache/CacheStorageEngine.h:
2092         * NetworkProcess/cache/NetworkCache.h:
2093         * NetworkProcess/webrtc/NetworkRTCProvider.h:
2094         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
2095         * Shared/Authentication/AuthenticationManager.h:
2096         * Shared/WebCoreArgumentCoders.cpp:
2097         * Shared/WebProcessCreationParameters.h:
2098         * UIProcess/API/APIPageConfiguration.h:
2099         * WebProcess/Cache/WebCacheStorageProvider.h:
2100         * WebProcess/Databases/WebDatabaseProvider.cpp:
2101         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2102         * WebProcess/InjectedBundle/InjectedBundle.h:
2103         * WebProcess/Network/WebSocketChannel.h:
2104         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2105         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2106         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2107         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2108         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h:
2109         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2110         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2111         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
2112         * WebProcess/WebPage/WebFrame.h:
2113
2114 2019-09-23  Chris Dumez  <cdumez@apple.com>
2115
2116         PlugInClient::didStartFromOrigin() does not need a sessionID
2117         https://bugs.webkit.org/show_bug.cgi?id=202127
2118
2119         Reviewed by Geoffrey Garen.
2120
2121         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
2122         (WebKit::WebPlugInClient::didStartFromOrigin):
2123         * WebProcess/WebCoreSupport/WebPlugInClient.h:
2124
2125 2019-09-23  Chris Dumez  <cdumez@apple.com>
2126
2127         FrameSpecificStorageAccessIdentifier does not need a sessionID
2128         https://bugs.webkit.org/show_bug.cgi?id=202093
2129
2130         Reviewed by Geoffrey Garen.
2131
2132         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2133         * WebProcess/WebPage/WebPage.cpp:
2134         (WebKit::WebPage::requestStorageAccess):
2135
2136 2019-09-23  Tim Horton  <timothy_horton@apple.com>
2137
2138         macOS: <datalist> dropdown shadow is cropped, looks nothing like NSComboBox
2139         https://bugs.webkit.org/show_bug.cgi?id=199350
2140
2141         Reviewed by Wenson Hsieh.
2142
2143         Improve the appearance of the macOS <datalist> dropdown, adopting the
2144         roundly-cornered and backdrop-ful appearance of the current NSComboBox style.
2145
2146         Use the proper window shadow instead of our own inside the window, both
2147         so that we match the system and so that it doesn't get clipped.
2148
2149         Allow vertical rubber-banding, because NSComboBox does.
2150
2151         Don't highlight on hover, because NSComboBox doesn't. Do use NSTableView's
2152         selection mechanism instead of rolling our own for highlights driven by
2153         keyboard-based navigation.
2154
2155         Make use of NSTableCellView, since it has some smarts around pixel alignment
2156         that we don't need to duplicate (and things are blurry on 1x displays without).
2157
2158         Also rename some classes to make it a bit more clear what's going on:
2159         WKDataListSuggestionCell -> WKDataListSuggestionView (it's a NSView, not an NSCell)
2160         WKDataListSuggestionsView -> WKDataListSuggestionsController (it's not a view at all)
2161
2162         * Platform/spi/mac/AppKitSPI.h:
2163         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
2164         (WebKit::WebDataListSuggestionsDropdownMac::show):
2165         (-[WKDataListSuggestionWindow initWithContentRect:styleMask:backing:defer:]):
2166         (-[WKDataListSuggestionWindow canBecomeKeyWindow]):
2167         (-[WKDataListSuggestionWindow hasKeyAppearance]):
2168         (-[WKDataListSuggestionWindow shadowOptions]):
2169         (-[WKDataListSuggestionView initWithFrame:]):
2170         (-[WKDataListSuggestionView setText:]):
2171         (-[WKDataListSuggestionView setBackgroundStyle:]):
2172         (-[WKDataListSuggestionTableRowView drawSelectionInRect:]):
2173         (-[WKDataListSuggestionTableView initWithElementRect:]):
2174         (-[WKDataListSuggestionTableView layout]):
2175         (-[WKDataListSuggestionTableView reload]):
2176         (-[WKDataListSuggestionsController initWithInformation:inView:]):
2177         (-[WKDataListSuggestionsController currentSelectedString]):
2178         (-[WKDataListSuggestionsController updateWithInformation:]):
2179         (-[WKDataListSuggestionsController moveSelectionByDirection:]):
2180         (-[WKDataListSuggestionsController invalidate]):
2181         (-[WKDataListSuggestionsController dropdownRectForElementRect:]):
2182         (-[WKDataListSuggestionsController showSuggestionsDropdown:]):
2183         (-[WKDataListSuggestionsController tableView:rowViewForRow:]):
2184         (-[WKDataListSuggestionsController tableView:viewForTableColumn:row:]):
2185         (-[WKDataListSuggestionCell initWithFrame:]): Deleted.
2186         (-[WKDataListSuggestionCell setText:]): Deleted.
2187         (-[WKDataListSuggestionCell setActive:]): Deleted.
2188         (-[WKDataListSuggestionCell drawRect:]): Deleted.
2189         (-[WKDataListSuggestionCell mouseEntered:]): Deleted.
2190         (-[WKDataListSuggestionCell mouseExited:]): Deleted.
2191         (-[WKDataListSuggestionCell acceptsFirstResponder]): Deleted.
2192         (-[WKDataListSuggestionTable initWithElementRect:]): Deleted.
2193         (-[WKDataListSuggestionTable setVisibleRect:]): Deleted.
2194         (-[WKDataListSuggestionTable currentActiveRow]): Deleted.
2195         (-[WKDataListSuggestionTable setActiveRow:]): Deleted.
2196         (-[WKDataListSuggestionTable reload]): Deleted.
2197         (-[WKDataListSuggestionTable acceptsFirstResponder]): Deleted.
2198         (-[WKDataListSuggestionTable enclosingScrollView]): Deleted.
2199         (-[WKDataListSuggestionTable removeFromSuperviewWithoutNeedingDisplay]): Deleted.
2200         (-[WKDataListSuggestionsView initWithInformation:inView:]): Deleted.
2201         (-[WKDataListSuggestionsView currentSelectedString]): Deleted.
2202         (-[WKDataListSuggestionsView updateWithInformation:]): Deleted.
2203         (-[WKDataListSuggestionsView moveSelectionByDirection:]): Deleted.
2204         (-[WKDataListSuggestionsView invalidate]): Deleted.
2205         (-[WKDataListSuggestionsView dropdownRectForElementRect:]): Deleted.
2206         (-[WKDataListSuggestionsView showSuggestionsDropdown:]): Deleted.
2207         (-[WKDataListSuggestionsView selectedRow:]): Deleted.
2208         (-[WKDataListSuggestionsView numberOfRowsInTableView:]): Deleted.
2209         (-[WKDataListSuggestionsView tableView:heightOfRow:]): Deleted.
2210         (-[WKDataListSuggestionsView tableView:viewForTableColumn:row:]): Deleted.
2211
2212 2019-09-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2213
2214         [iOS] Drop animation when dragging images from Photos to WebKit2 Mail compose is incorrect
2215         https://bugs.webkit.org/show_bug.cgi?id=201674
2216         <rdar://problem/51250952>
2217
2218         Reviewed by Tim Horton.
2219
2220         Our current logic for handling dropped content in editable elements on iOS works like this in the ideal case:
2221
2222         (1)     UIKit asks us for a targeted preview for each UIDragItem. We don't know (and can't determine this
2223                 synchronously without blocking on the web process) so we simply retarget the preview to animate to the
2224                 last known caret location.
2225
2226         (2)     Soonafter, UIKit hands us a drop preview update block, which may be used to retarget the drop preview
2227                 once, as long as the drop animation is less than 90% complete. We stash these update blocks for now.
2228
2229         (3)     -dropInteraction:performDrop: is then called, and we start loading item provider data right away.
2230
2231         (4)     When the data has finished loading, we perform the drop in the web process. After any inserted images
2232                 have finished loading, we take snapshots (of the dropped content as well as surrounding web content
2233                 minus the dropped content), and deliver these images to the UI process via TextIndicatorData.
2234
2235         (5)     Upon receiving the TextIndicatorData sent in (4), we use the image data to create updated targeted drag
2236                 previews, and use these to invoke the preview update blocks we stored earlier in (2). We also obscure
2237                 the entire web view with a snapshot of the view minus any dropped content, such that the updated drop
2238                 previews may animate into place without also showing the final content.
2239
2240         (6)     When the drop animation ends, we remove the unselected content snapshot view added in (5) simultaneously
2241                 as the targeted previews disappear, revealing the actual dropped content on the page. The drop is now
2242                 complete.
2243
2244         However, note that the drag update block we invoke in (5) doesn't work if the drop animation is already more
2245         than 90% complete. Since the lifecycle of the drop animation is distinct from that of item provider loading, if
2246         the delay between (3) and (4) exceeds 90% of the total drop animation time, we'll fail to update the targeted
2247         previews, such that the user only sees the initial drag preview fly on top of the caret and disappear. While we
2248         typically win this race for data dragged from other WebKit apps, we almost always lose when dragging from Photos
2249         and end up with a janky drop animation. This is especially true for any images that aren't locally available,
2250         and need to be fetched from iCloud. An additional problem is that in step (5), we use the same final snapshot to
2251         update the drop preview of every item, since we don't have a snapshot for the fragment corresponding to each
2252         individual dropped item.
2253
2254         To address these issues for Mail in the case where the user drops images with known sizes (i.e. -[NSItemProvider
2255         preferredPresentationSize] is specified), we introduce an alternate codepath for handling dropped images that
2256         performs the drop immediately upon receiving -dropInteraction:performDrop: in the UI process. Since the data has
2257         yet to arrive, we instead handle the drop by inserting placeholder image elements at the drag caret position,
2258         which initially have no source but are sized to fit their expected final image sizes. After doing so, we
2259         snapshot the page (minus the dropped content range, as usual) and deliver this snapshot to the UI process, along
2260         with the rects (in root view coordinates) of each placeholder image that was inserted. In the UI process, we
2261         then take this snapshot and obscure the content view with it, and also use each of the placeholder rects to
2262         provide an updated target for each drag preview, such that the drop previews now animate to their final
2263         locations on the page.
2264
2265         When the data eventually arrives, we handle the drop by detecting the placeholder elements we inserted earlier,
2266         and using the dropped data to update the source attribute and attachment backing for each of these placeholder
2267         elements instead of attempting to insert new content.
2268
2269         Note that this codepath is currently only enabled for SPI clients that set -[WKWebView _editable] to YES, since
2270         it involves us performing the editing action for the drop (thus changing the DOM) prior to the preventable drop
2271         event, and prior to us having any data at all. However, the drop event can't come before the editing action,
2272         since we need to have already loaded data from the item providers to expose it via the dataTransfer of the drop
2273         event. This contradiction means that this image placeholder hack is only for _editable SPI clients that, at the
2274         very least, will not require preventing default behavior when dropping only images with predetermined sizes.
2275
2276         Covered by 2 new API tests. See comments below for more detail.
2277
2278         * UIProcess/WebPageProxy.h:
2279         * UIProcess/ios/DragDropInteractionState.h:
2280         * UIProcess/ios/DragDropInteractionState.mm:
2281         (WebKit::DragDropInteractionState::setDefaultDropPreview):
2282
2283         Add a way to keep track of default drop previews that we observed during each call to
2284         -dropInteraction:previewForDroppingItem:withDefault:. In the image placeholder drop scenario, we use these
2285         default drop previews later on to create retargeted drop previews after the placeholders have been inserted.
2286
2287         (WebKit::DragDropInteractionState::defaultDropPreview const):
2288         (WebKit::DragDropInteractionState::deliverDelayedDropPreview):
2289
2290         Add an alternate version of deliverDelayedDropPreview that is used when inserting image placeholders. Rather
2291         than use text indicator data of the final dropped content on the page, use the root-view-coordinate rects of
2292         each of the placeholder elements to reposition the default drop previews.
2293
2294         There's additional logic here to handle the case where the final image is taller than the height of the
2295         unobscured content rect, in which case we clip the drop preview using UIDragPreviewParameter's visiblePath to
2296         prevent the drop preview from being shown outside of the bounds of the web view.
2297
2298         * UIProcess/ios/WKContentViewInteraction.h:
2299         * UIProcess/ios/WKContentViewInteraction.mm:
2300         (-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
2301         (sizesOfPlaceholderElementsToInsertWhenDroppingItems):
2302
2303         Collects the list of expected image sizes for the dropped item providers, or an empty list in the case where
2304         any of the item providers may not be represented as inline images or do not have predetermined sizes.
2305
2306         (-[WKContentView _handleDropByInsertingImagePlaceholders:session:]):
2307
2308         If possible, handles the drop by inserting image placeholders instead of waiting for the data to finish loading
2309         before dropping. Returns whether or not we decided to proceed with the image placeholder drop.
2310
2311         (-[WKContentView dropInteraction:performDrop:]):
2312         (-[WKContentView dropInteraction:item:willAnimateDropWithAnimator:]):
2313
2314         Fixes a bug where the unselected content snapshot view could linger around on the web view forever after a drop
2315         where the data doesn't load in time for the drop to finish by keeping track of whether there is an actively
2316         animating drag item, and only applying the unselected content snapshot if so.
2317
2318         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
2319
2320         Stash the default drop preview away here.
2321
2322         * UIProcess/ios/WebPageProxyIOS.mm:
2323         (WebKit::WebPageProxy::insertDroppedImagePlaceholders):
2324         * WebProcess/WebPage/WebPage.h:
2325         * WebProcess/WebPage/WebPage.messages.in:
2326         * WebProcess/WebPage/ios/WebPageIOS.mm:
2327         (WebKit::WebPage::insertDroppedImagePlaceholders):
2328
2329         See WebCore ChangeLog for more information.
2330
2331         (WebKit::WebPage::didFinishLoadingImageForElement):
2332
2333         If the image that finished loading is a dropped image placeholder, allow DragController to "finalize" it by
2334         stripping away some styles that were temporarily added.
2335
2336 2019-09-23  Alex Christensen  <achristensen@webkit.org>
2337
2338         REGRESSION(250143) Disk cache should be enabled for Safari
2339         https://bugs.webkit.org/show_bug.cgi?id=202117
2340
2341         Reviewed by Brady Eidson.
2342
2343         r250143 made it so in Safari, when setCacheModel is called for the first time in NetworkProcess::initializeNetworkProcess,
2344         it didn't have a path to check available disk space.  This resulted in disabling the disk cache in Safari, which caused a
2345         huge performance regression.
2346
2347         * NetworkProcess/NetworkProcess.cpp:
2348         (WebKit::NetworkProcess::initializeNetworkProcess):
2349         (WebKit::NetworkProcess::setCacheModel):
2350         * NetworkProcess/NetworkProcess.h:
2351         (WebKit::NetworkProcess::setCacheModel):
2352         * NetworkProcess/NetworkProcess.messages.in:
2353         * UIProcess/WebProcessPool.cpp:
2354         (WebKit::WebProcessPool::ensureNetworkProcess):
2355         (WebKit::WebProcessPool::setCacheModel):
2356
2357 2019-09-16  Jiewen Tan  <jiewen_tan@apple.com>
2358
2359         [WebAuthn] LocalAuthenticator tests are failing on internal bots
2360         https://bugs.webkit.org/show_bug.cgi?id=201844
2361         <rdar://problem/54278693>
2362
2363         Reviewed by Brent Fulgham.
2364
2365         This patch adds a way for mock tests to select a credential in getAssertion
2366         ceremonies such that a test can ensure it always uses the credential it manages.
2367         Credentials managed by other test could be deleted at anytime.
2368
2369         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2370         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
2371         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2372         (WebKit::LocalAuthenticator::getAssertion):
2373         * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
2374         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
2375         (WebKit::LocalConnection::selectCredential const):
2376         * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
2377         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
2378         (WebKit::MockLocalConnection::selectCredential const):
2379         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
2380
2381 2019-09-23  David Quesada  <david_quesada@apple.com>
2382
2383         [iOS] REGRESSION(r250151): Occasional assertion failures in ShareableBitmap::~ShareableBitmap()
2384         https://bugs.webkit.org/show_bug.cgi?id=202112
2385         rdar://problem/55624598
2386
2387         Reviewed by Chris Dumez.
2388
2389         * Shared/cg/ShareableBitmapCG.cpp:
2390         (WebKit::ShareableBitmap::releaseDataProviderData):
2391         It is possible and valid for a UIImage created from a ShareableBitmap's CGImage representation
2392         to be deallocated on a background thread. When this happens, releaseDataProviderData() should
2393         ensure it's running on the main thread before deref'ing the ShareableBitmap. Otherwise the
2394         bitmap can be deallocated on the background thread, violating an assertion added in r250151.
2395
2396 2019-09-23  Joseph Pecoraro  <pecoraro@apple.com>
2397
2398         Web Inspector: Improve the Uncaught Exception View file a bug link
2399         https://bugs.webkit.org/show_bug.cgi?id=201717
2400
2401         Reviewed by Devin Rousso.
2402
2403         * UIProcess/WebInspectorProxy.cpp:
2404         (WebKit::WebInspectorProxy::bringInspectedPageToFront):
2405         * UIProcess/WebInspectorProxy.h:
2406         * UIProcess/WebInspectorProxy.messages.in:
2407         Provide a way to bring the inspected page to the foreground.
2408
2409         * WebProcess/WebPage/WebInspectorUI.cpp:
2410         (WebKit::WebInspectorUI::openInNewTab):
2411         Use it when opening a new tab beside the inspected page.
2412
2413 2019-09-23  Brent Fulgham  <bfulgham@apple.com>
2414
2415         Unreviewed build fix after r250169 and r250236.
2416
2417         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2418         (WebKit::NetworkDataTaskCurl::createCurlRequest):
2419         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
2420         (WKWebsiteDataStoreEnableDefaultNetworkProxySettings):
2421         (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
2422         (WKWebsiteDataStoreDisableNetworkProxySettings):
2423
2424 2019-09-23  David Kilzer  <ddkilzer@apple.com>
2425
2426         clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WebKit
2427         <https://webkit.org/b/202096>
2428
2429         Reviewed by Darin Adler.
2430
2431         Fix unwanted copying/ref churn of loop variables by making them
2432         const references.
2433
2434         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2435         (WebKit::domainsToString):
2436         * UIProcess/ios/WKActionSheetAssistant.mm:
2437         (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
2438         * UIProcess/ios/WKContentViewInteraction.mm:
2439         (-[WKContentView _singleTapDidReset:]):
2440         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
2441         (-[WKDataListSuggestionsControl textSuggestions]):
2442
2443 2019-09-23  Chris Dumez  <cdumez@apple.com>
2444
2445         WebPage::sessionID() does not need to get the sessionID from there WebCore Page
2446         https://bugs.webkit.org/show_bug.cgi?id=202094
2447
2448         Reviewed by Youenn Fablet.
2449
2450         WebPage::sessionID() does not need to get the sessionID from there WebCore Page, it can
2451         simply get the sessionID from the WebProcess singleton, now that we have a single session
2452         per WebProcess. This will avoid potential crashes trying to dereference m_page to get the
2453         sessionID, since m_page can be null.
2454
2455         * WebProcess/WebPage/WebPage.cpp:
2456         (WebKit::WebPage::sessionID const):
2457         * WebProcess/WebPage/WebPage.h:
2458         (WebKit::WebPage::sessionID const): Deleted.
2459
2460 2019-09-23  Youenn Fablet  <youenn@apple.com>
2461
2462         Simplify UserMediaPermissionRequestManager management of UserMediaRequest
2463         https://bugs.webkit.org/show_bug.cgi?id=201688
2464
2465         Reviewed by Eric Carlson.
2466
2467         Instead of having two maps to go from ID to request and request to ID,
2468         Make request own its ID and keep a single ID to request map.
2469         Rename it to m_ongoingUserMediaRequests.
2470
2471         Rename requests that are not processed because the document cannot start media as m_pendingUserMediaRequests.
2472         In case the request is cancelled following the stopping of active dom objects, we just remove it from m_pendingUserMediaRequests
2473         instead of denying the request. This matches Chrome and Firefox behavior.
2474
2475         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2476         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
2477         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
2478         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest):
2479         (WebKit::UserMediaPermissionRequestManager::mediaCanStart):
2480         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
2481         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
2482         (WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
2483         (WebKit::generateRequestID): Deleted.
2484         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Deleted.
2485         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2486
2487 2019-09-23  Patrick Griffis  <pgriffis@igalia.com>
2488
2489         [GTK][WPE] Don't use prgname in dbus-proxy socket path
2490         https://bugs.webkit.org/show_bug.cgi?id=201979
2491
2492         The path length for the socket is limited to 108 bytes so it is easy for a long
2493         prgname to cause it to get truncated and fail. Since we only allow the socket
2494         path into the sandbox the unique directory isn't necessary.
2495
2496         Reviewed by Michael Catanzaro.
2497
2498         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2499         (WebKit::XDGDBusProxyLauncher::setAddress):
2500
2501 2019-09-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2502
2503         [SOUP] Stop setting G_TLS_GNUTLS_PRIORITY
2504         https://bugs.webkit.org/show_bug.cgi?id=172154
2505
2506         Reviewed by Carlos Garcia Campos.
2507
2508         Nowadays, I maintain glib-networking. WebKit doesn't need to override its defaults to be
2509         secure anymore. By overriding glib-networking's default priority, WebKit is force-reenabling
2510         TLS 1.0 and TLS 1.1 even when glib-networking has disabled them.
2511
2512         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
2513         (main):
2514         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
2515         (main):
2516
2517 2019-09-21  Dan Bernstein  <mitz@apple.com>
2518
2519         Fix an assertion failure introduced in r250186.
2520
2521         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2522         (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Corrected the
2523           assertion.
2524
2525 2019-09-21  Chris Dumez  <cdumez@apple.com>
2526
2527         Reduce use of SessionID::defaultSessionID() in WebKit
2528         https://bugs.webkit.org/show_bug.cgi?id=202080
2529
2530         Reviewed by Alex Christensen.
2531
2532         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2533         (WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload):
2534         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2535         * WebProcess/WebPage/WebFrame.cpp:
2536         (WebKit::WebFrame::convertMainResourceLoadToDownload):
2537         * WebProcess/WebPage/WebFrame.h:
2538
2539 2019-09-21  Chris Dumez  <cdumez@apple.com>
2540
2541         Drop unnecessary NetworkProcess::m_sessionByConnection
2542         https://bugs.webkit.org/show_bug.cgi?id=202088
2543
2544         Reviewed by Alex Christensen.
2545
2546         * NetworkProcess/NetworkProcess.cpp:
2547         * NetworkProcess/NetworkProcess.h:
2548
2549 2019-09-21  Chris Dumez  <cdumez@apple.com>
2550
2551         WebIDBConnectionToClient does not need to be RefCounted or a SessionID
2552         https://bugs.webkit.org/show_bug.cgi?id=202089
2553
2554         Reviewed by Alex Christensen.
2555
2556         WebIDBConnectionToClient does not need to be RefCounted, the ref() / deref() virtual function
2557         it implemented from its interface were dead code. We now stop subclassing RefCounted and have
2558         the NetworkConnectionToWebProcess fully own the WebIDBConnectionToClient. Instead of the
2559         WebIDBConnectionToClient having 3 data members for the NetworkProcess, the sessionID and the IPC
2560         connection, use a single data member to its NetworkConnectionToWebProcess parent. It can get
2561         everything it needs from its parent.
2562
2563         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2564         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
2565         (WebKit::WebIDBConnectionToClient::idbServer):
2566         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
2567         (WebKit::WebIDBConnectionToClient::messageSenderConnection const):
2568         (WebKit::WebIDBConnectionToClient::connectionToClient):
2569         (WebKit::WebIDBConnectionToClient::deleteDatabase):
2570         (WebKit::WebIDBConnectionToClient::openDatabase):
2571         (WebKit::WebIDBConnectionToClient::abortTransaction):
2572         (WebKit::WebIDBConnectionToClient::commitTransaction):
2573         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
2574         (WebKit::WebIDBConnectionToClient::createObjectStore):
2575         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
2576         (WebKit::WebIDBConnectionToClient::renameObjectStore):
2577         (WebKit::WebIDBConnectionToClient::clearObjectStore):
2578         (WebKit::WebIDBConnectionToClient::createIndex):
2579         (WebKit::WebIDBConnectionToClient::deleteIndex):
2580         (WebKit::WebIDBConnectionToClient::renameIndex):
2581         (WebKit::WebIDBConnectionToClient::putOrAdd):
2582         (WebKit::WebIDBConnectionToClient::getRecord):
2583         (WebKit::WebIDBConnectionToClient::getAllRecords):
2584         (WebKit::WebIDBConnectionToClient::getCount):
2585         (WebKit::WebIDBConnectionToClient::deleteRecord):
2586         (WebKit::WebIDBConnectionToClient::openCursor):
2587         (WebKit::WebIDBConnectionToClient::iterateCursor):
2588         (WebKit::WebIDBConnectionToClient::establishTransaction):
2589         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
2590         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
2591         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
2592         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
2593         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
2594         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
2595         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
2596         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
2597         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2598         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
2599         * NetworkProcess/NetworkConnectionToWebProcess.h:
2600
2601 2019-09-21  Chris Dumez  <cdumez@apple.com>
2602
2603         Regression(iOS 13) web views do not deal properly with their window's UIScene changing
2604         https://bugs.webkit.org/show_bug.cgi?id=202070
2605         <rdar://problem/55580699>
2606
2607         Reviewed by Tim Horton.
2608
2609         Web views do not deal properly with their window's UIScene changing. If a Safari window is in the
2610         background for 1 minute, its UIScene will be detached and the window will get a new UIScene if
2611         the user later switches to this window. Our web views listen to UIScene notifications to determine
2612         their visibility and currently stop receiving visibility updates once the window’s UIScene has
2613         changed. This causes view freezes because our WebContent process does not know its view is visible
2614         and keeps its layer tree frozen.
2615
2616         Previously, when our view would be added to a window, we would get this window's UIScene and listen
2617         for UISceneDidEnterBackgroundNotification / UISceneWillEnterForegroundNotification for this UIScene
2618         object. Instead, we now listen to these notifications for ALL the application's UIScenes. Our handler
2619         then checks if the notification's UIScene object matches the current window's UIScene before
2620         forwarding the notification to the rest of WebKit.
2621
2622         * UIProcess/ApplicationStateTracker.mm:
2623         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2624         (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
2625
2626 2019-09-21  Dan Bernstein  <mitz@apple.com>
2627
2628         Safari 13 may launch leftover 32-bit plug-in process from Safari 12’s WebKit, which crashes
2629         https://bugs.webkit.org/show_bug.cgi?id=202077
2630         <rdar://problem/55547063>
2631
2632         Reviewed by Sam Weinig.
2633
2634         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2635         (WebKit::getPluginArchitecture): Removed support for i386 plug-ins.
2636
2637         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2638         (WebKit::serviceName): Assert that the requested process type is not Plugin32.
2639
2640         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2641         (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes): Assert that the
2642           plug-in architecture is x86_64.
2643
2644 2019-09-21  Antoine Quint  <graouts@apple.com>
2645
2646         [Pointer Events] touch-action set to pan-x or pan-y alone should disable scrolling altogether if the intial gesture is in the disallowed direction
2647         https://bugs.webkit.org/show_bug.cgi?id=202053
2648         <rdar://problem/54542190>
2649
2650         Reviewed by Tim Horton.
2651
2652         Although the Pointer Events specification does not specify this clearly (see https://github.com/w3c/pointerevents/issues/303), setting "touch-action" to a value
2653         that only allows scrolling a specific direction ("pan-x" or "pan-y") should disable scrolling in the specified direction if the panning gesture initially is directed
2654         in the opposite direction. In practice, this means that setting "touch-action: pan-y" on an element should disable scrolling if the user initially pans horizontally,
2655         even if later on in the gesture the user pans vertically. This allows for sites that want to offer a programmatic horizontal scroller to disable vertical scrolling
2656         if the user pans horizontally.
2657
2658         In order to support this, we add four UISwipeGestureRecognizers, one for each direction, and we selectively allows touches to be recognizer for them based on the
2659         "touch-action" value specified at the initial touch location for a given gesture. In the case of "touch-action: pan-y" we only allow the left and right swipe recognizers
2660         to be enabled, and in the case of "touch-action: pan-x" we only allow the up and down swipe recognizers to be enabled. If any of those gesture recognizers is recognized,
2661         scrolling will be disabled for the duration of this gesture. If a UIScrollView panning gesture recognizer is recognized prior to a swipe, they won't have a chance to be
2662         recognized.
2663
2664         * UIProcess/ios/WKContentViewInteraction.h:
2665         * UIProcess/ios/WKContentViewInteraction.mm:
2666         (-[WKContentView setupInteraction]):
2667         (-[WKContentView cleanupInteraction]):
2668         (-[WKContentView _removeDefaultGestureRecognizers]):
2669         (-[WKContentView _addDefaultGestureRecognizers]):
2670         (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
2671
2672 2019-09-19  Andy Estes  <aestes@apple.com>
2673
2674         [Apple Pay] Clean up handling of summary items and payment method updates
2675         https://bugs.webkit.org/show_bug.cgi?id=202018
2676         <rdar://problem/55470632>
2677
2678         Reviewed by Tim Horton.
2679
2680         Now that PaymentMethodUpdate knows how to convert itself to a
2681         PKPaymentRequestPaymentMethodUpdate, PaymentAuthorizationPresenter can merely pass the
2682         converted update directly to the platform delegate rather than passing the individual
2683         components and relying on the delegate to instantiate the platform update itself. Added
2684         FIXMEs for applying a similar treatment to ShippingContactUpdate and ShippingMethodUpdate.
2685
2686         * Platform/cocoa/PaymentAuthorizationPresenter.h:
2687         * Platform/cocoa/PaymentAuthorizationPresenter.mm:
2688         (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection):
2689         (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
2690         (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection):
2691         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
2692         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
2693         (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
2694         (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]):
2695         (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
2696         (-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]):
2697         (-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]):
2698         (-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]):
2699         (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]): Deleted.
2700         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
2701         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
2702         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2703         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
2704         (WebKit::toPKPaymentSummaryItemType): Deleted.
2705         (WebKit::toPKPaymentSummaryItem): Deleted.
2706         (WebKit::toPKPaymentSummaryItems): Deleted.
2707         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2708         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
2709         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
2710
2711 2019-09-20  Keith Rollin  <krollin@apple.com>
2712
2713         Remove some support for < iOS 13
2714         https://bugs.webkit.org/show_bug.cgi?id=202027
2715         <rdar://problem/55547109>
2716
2717         Reviewed by Alex Christensen.
2718
2719         Remove some support for iOS versions less than 13.0.
2720
2721         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
2722         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
2723         values >= 130000. This means that expressions like
2724         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
2725         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
2726
2727         After version checks have been removed, there are some cases where the
2728         preprocessor conditional looks like "#if PLATFORM(MAC) ||
2729         PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
2730         PLATFORM(COCOA)". This additional cleanup will be performed in a
2731         subsequent patch.
2732
2733         This removal is part of a series of patches effecting the removal of
2734         dead code for old versions of iOS. This particular pass involves
2735         changes in which Joe Pecoraro was involved. These changes are isolated
2736         from other similar changes in order to facilitate the reviewing
2737         process.
2738
2739         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2740         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2741
2742 2019-09-20  Alex Christensen  <achristensen@webkit.org>
2743
2744         Remove unnecessary abstractions around WebsiteDataStore
2745         https://bugs.webkit.org/show_bug.cgi?id=201655
2746
2747         Reviewed by Chris Dumez.
2748
2749         * PlatformFTW.cmake:
2750         * PlatformWin.cmake:
2751         * Sources.txt:
2752         * SourcesCocoa.txt:
2753         * SourcesGTK.txt:
2754         * SourcesWPE.txt:
2755         * UIProcess/API/APIHTTPCookieStore.cpp:
2756         * UIProcess/API/APIHTTPCookieStore.h:
2757         * UIProcess/API/APIPageConfiguration.cpp:
2758         (API::PageConfiguration::websiteDataStore):
2759         (API::PageConfiguration::setWebsiteDataStore):
2760         * UIProcess/API/APIPageConfiguration.h:
2761         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2762         * UIProcess/API/APIWebsiteDataStore.cpp: Removed.
2763         * UIProcess/API/APIWebsiteDataStore.h: Removed.
2764         * UIProcess/API/APIWebsitePolicies.cpp:
2765         (API::WebsitePolicies::WebsitePolicies):
2766         (API::WebsitePolicies::setWebsiteDataStore):
2767         (API::WebsitePolicies::data):
2768         * UIProcess/API/APIWebsitePolicies.h:
2769         * UIProcess/API/C/WKAPICast.h:
2770         * UIProcess/API/C/WKContext.cpp:
2771         (WKContextSetCacheModel):
2772         (WKContextGetCacheModel):
2773         * UIProcess/API/C/WKFramePolicyListener.cpp:
2774         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2775         (WKWebsiteDataStoreGetTypeID):
2776         (WKWebsiteDataStoreGetDefaultDataStore):
2777         (WKWebsiteDataStoreCreateNonPersistentDataStore):
2778         (WKWebsiteDataStoreCreateWithConfiguration):
2779         (WKWebsiteDataStoreGetHTTPCookieStore):
2780         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
2781         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
2782         (WKWebsiteDataStoreSetStatisticsLastSeen):
2783         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
2784         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
2785         (WKWebsiteDataStoreDumpResourceLoadStatistics):
2786         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
2787         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
2788         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
2789         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
2790         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
2791         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
2792         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
2793         (WKWebsiteDataStoreSetStatisticsGrandfathered):
2794         (WKWebsiteDataStoreIsStatisticsGrandfathered):
2795         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
2796         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
2797         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
2798         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
2799         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
2800         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
2801         (WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
2802         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
2803         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
2804         (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
2805         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
2806         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
2807         (WKWebsiteDataStoreSetStatisticsIsRunningTest):
2808         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
2809         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
2810         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
2811         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
2812         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
2813         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
2814         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2815         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2816         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
2817         (WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
2818         (WKWebsiteDataStoreStatisticsHasLocalStorage):
2819         (WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
2820         (WKWebsiteDataStoreStatisticsHasIsolatedSession):
2821         (WKWebsiteDataStoreStatisticsResetToConsistentState):
2822         (WKWebsiteDataStoreRemoveAllFetchCaches):
2823         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
2824         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
2825         (WKWebsiteDataStoreRemoveLocalStorage):
2826         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
2827         (WKWebsiteDataStoreGetFetchCacheOrigins):
2828         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
2829         (WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
2830         (WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
2831         (WKWebsiteDataStoreClearAllDeviceOrientationPermissions):
2832         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
2833         (WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
2834         * UIProcess/API/C/WKWebsitePolicies.cpp:
2835         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Removed.
2836         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2837         (+[WKWebsiteDataStore defaultDataStore]):
2838         (+[WKWebsiteDataStore nonPersistentDataStore]):
2839         (-[WKWebsiteDataStore dealloc]):
2840         (-[WKWebsiteDataStore httpCookieStore]):
2841         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
2842         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2843         (+[WKWebsiteDataStore _defaultDataStoreExists]):
2844         (+[WKWebsiteDataStore _deleteDefaultDataStoreForTesting]):
2845         (-[WKWebsiteDataStore _initWithConfiguration:]):
2846         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
2847         (-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]):
2848         (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]):
2849         (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
2850         (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
2851         (-[WKWebsiteDataStore _cacheStorageDirectory]):
2852         (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
2853         (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
2854         (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
2855         (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
2856         (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
2857         (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
2858         (-[WKWebsiteDataStore _allowsCellularAccess]):
2859         (-[WKWebsiteDataStore _setProxyConfiguration:]):
2860         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
2861         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
2862         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
2863         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
2864         (-[WKWebsiteDataStore _proxyConfiguration]):
2865         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
2866         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]):
2867         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
2868         (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
2869         (-[WKWebsiteDataStore _scheduleCookieBlockingUpdate:]):
2870         (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
2871         (-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
2872         (-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
2873         (-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
2874         (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
2875         (-[WKWebsiteDataStore _delegate]):
2876         (-[WKWebsiteDataStore set_delegate:]):
2877         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
2878         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Removed.
2879         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2880         (webkitWebsiteDataManagerSetProperty):
2881         (webkitWebsiteDataManagerGetDataStore):
2882         (webkit_website_data_manager_get_local_storage_directory):
2883         (webkit_website_data_manager_get_disk_cache_directory):
2884         (webkit_website_data_manager_get_offline_application_cache_directory):
2885         (webkit_website_data_manager_get_indexeddb_directory):
2886         (webkit_website_data_manager_get_websql_directory):
2887         (webkit_website_data_manager_get_hsts_cache_directory):
2888         (webkit_website_data_manager_fetch):
2889         (webkit_website_data_manager_remove):
2890         (webkit_website_data_manager_clear):
2891         (webkitWebsiteDataManagerCreate): Deleted.
2892         * UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h:
2893         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Removed.
2894         * UIProcess/Cocoa/NavigationState.mm:
2895         * UIProcess/Network/NetworkProcessProxy.cpp:
2896         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
2897         (WebKit::NetworkProcessProxy::websiteDataStoreFromSessionID):
2898         * UIProcess/Network/NetworkProcessProxy.h:
2899         * UIProcess/WebFramePolicyListenerProxy.cpp:
2900         * UIProcess/WebPageProxy.cpp:
2901         (WebKit::WebPageProxy::WebPageProxy):
2902         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2903         * UIProcess/WebProcessPool.cpp:
2904         (WebKit::m_webProcessCache):
2905         (WebKit::WebProcessPool::ensureNetworkProcess):
2906         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
2907         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
2908         (WebKit::WebProcessPool::processDidFinishLaunching):
2909         (WebKit::WebProcessPool::processForRegistrableDomain):
2910         (WebKit::WebProcessPool::createWebPage):
2911         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
2912         * UIProcess/WebProcessPool.h:
2913         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2914         (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
2915         (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
2916         (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
2917         (WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
2918         (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2919         (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
2920         (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
2921         (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
2922         (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
2923         (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
2924         (WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
2925         (WebKit::WebsiteDataStore::tempDirectoryFileSystemRepresentation):
2926         (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
2927         (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
2928         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2929         (WebKit::globalDefaultDataStore):
2930         (WebKit::WebsiteDataStore::defaultDataStore):
2931         (WebKit::WebsiteDataStore::deleteDefaultDataStoreForTesting):
2932         (WebKit::WebsiteDataStore::defaultDataStoreExists):
2933         (WebKit::WebsiteDataStore::defaultDataStoreConfiguration):
2934         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
2935         (WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
2936         (WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
2937         (WebKit::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
2938         * UIProcess/WebsiteData/WebsiteDataStore.h:
2939         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
2940         * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
2941         (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
2942         (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
2943         (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
2944         (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2945         (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
2946         (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
2947         (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
2948         (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
2949         (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
2950         (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
2951         (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
2952         * UIProcess/glib/WebProcessProxyGLib.cpp:
2953         (WebKit::WebProcessProxy::platformGetLaunchOptions):
2954         * UIProcess/glib/WebsiteDataStoreGLib.cpp: Copied from Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp.
2955         (API::WebsiteDataStore::defaultApplicationCacheDirectory): Deleted.
2956         (API::WebsiteDataStore::defaultNetworkCacheDirectory): Deleted.
2957         (API::WebsiteDataStore::defaultCacheStorageDirectory): Deleted.
2958         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): Deleted.
2959         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): Deleted.
2960         (API::WebsiteDataStore::defaultLocalStorageDirectory): Deleted.
2961         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): Deleted.
2962         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
2963         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): Deleted.
2964         (API::WebsiteDataStore::defaultHSTSDirectory): Deleted.
2965         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Deleted.
2966         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): Deleted.
2967         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): Deleted.
2968         * WebKit.xcodeproj/project.pbxproj:
2969         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
2970         (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
2971
2972 2019-09-20  Chris Dumez  <cdumez@apple.com>
2973
2974         REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
2975         https://bugs.webkit.org/show_bug.cgi?id=201767
2976         <rdar://problem/55350854>
2977
2978         Reviewed by Tim Horton.
2979
2980         This is a follow-up to r249961 to address crashes when navigating back cross-origin to a page
2981         that uses requestAnimationFrame. r249961 took care of moving RemoteLayerTreeDisplayRefreshMonitor
2982         objects from one RemoteLayerTreeDrawingArea to another but failed to tell those monitors
2983         about their new drawingArea. As a result, RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor()
2984         would not get called on the new drawing area when it should have.
2985
2986         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
2987         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
2988         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::updateDrawingArea):
2989         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2990         (WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
2991
2992 2019-09-20  Keith Rollin  <krollin@apple.com>
2993
2994         Remove some support for < iOS 13
2995         https://bugs.webkit.org/show_bug.cgi?id=201967
2996         <rdar://problem/55504738>
2997
2998         Reviewed by Andy Estes.
2999
3000         Remove some support for iOS versions less than 13.0.
3001
3002         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
3003         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
3004         values >= 130000. This means that expressions like
3005         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
3006         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
3007
3008         After version checks have been removed, there are some cases where the
3009         preprocessor conditional looks like "#if PLATFORM(MAC) ||
3010         PLATFORM(IOS_FAMILY)". These can be collapsed into "#if
3011         PLATFORM(COCOA)". This additional cleanup will be performed in a
3012         subsequent patch.
3013
3014         This removal is part of a series of patches effecting the removal of
3015         dead code for old versions of iOS. This particular pass involves
3016         changes in which Andy Estes was involved. These changes are isolated
3017         from other similar changes in order to facilitate the reviewing
3018         process.
3019
3020         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3021         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3022         * UIProcess/ios/WKContentViewInteraction.mm:
3023         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3024         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3025         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
3026
3027 2019-09-20  Tim Horton  <timothy_horton@apple.com>
3028
3029         Sanitize suggested filenames used for saving PDFs
3030         https://bugs.webkit.org/show_bug.cgi?id=202034
3031         <rdar://problem/53183075>
3032
3033         Reviewed by Chris Dumez.
3034
3035         * UIProcess/WebPageProxy.cpp:
3036         (WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
3037         (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
3038         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
3039         * UIProcess/WebPageProxy.h:
3040         * UIProcess/ios/WebPageProxyIOS.mm:
3041         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
3042         * UIProcess/mac/WebPageProxyMac.mm:
3043         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
3044         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Deleted.
3045         Sanitize suggested filenames to ensure that they comprise only one path component
3046         when concatenated with their destination directory.
3047
3048 2019-09-20  Chris Dumez  <cdumez@apple.com>
3049
3050         Add release logging for when a view is added / removed from a window
3051         https://bugs.webkit.org/show_bug.cgi?id=202050
3052
3053         Reviewed by Tim Horton.
3054
3055         Add release logging for when a view is added / removed from a window to help determine the
3056         view's visibility in the logs.
3057
3058         * UIProcess/ios/WKApplicationStateTrackingView.mm:
3059         (-[WKApplicationStateTrackingView willMoveToWindow:]):
3060         (-[WKApplicationStateTrackingView didMoveToWindow]):
3061
3062 2019-09-20  Chris Dumez  <cdumez@apple.com>
3063
3064         ApplicationStateTracker::m_isBackground initialization does not account for UIScenes
3065         https://bugs.webkit.org/show_bug.cgi?id=202048
3066
3067         Reviewed by Geoffrey Garen.
3068
3069         ApplicationStateTracker::m_isBackground initialization does not account for UIScenes, it merely checks
3070         the visibility state of the whole app. It should instead check the visibility state of the window's
3071         UIScene.
3072
3073         This patch also refactors the code a little bit to reduce #ifdef'ing.
3074
3075         * UIProcess/ApplicationStateTracker.mm:
3076         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
3077
3078 2019-09-20  Chris Dumez  <cdumez@apple.com>
3079
3080         Document no longer needs to store a SessionID
3081         https://bugs.webkit.org/show_bug.cgi?id=202024
3082
3083         Reviewed by Geoffrey Garen.
3084
3085         Document no longer needs to store a SessionID, now that we have a single
3086         session per WebProcess. It can simply get its sessionID from its Page.
3087
3088         * WebProcess/WebPage/WebCookieJar.cpp:
3089         (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
3090         * WebProcess/WebPage/WebCookieJar.h:
3091
3092 2019-09-20  Chris Dumez  <cdumez@apple.com>
3093
3094         [iOS] ASSERTION FAILED: Unsafe to ref/deref of ShareableBitmap from different threads
3095         https://bugs.webkit.org/show_bug.cgi?id=201712
3096         <rdar://problem/55289916>
3097
3098         Reviewed by Tim Horton.
3099
3100         Make sure ShareableBitmap objects are always ref'd / deref'd on the main thread by dispatching to
3101         the main thread in ShareableBitmap::releaseBitmapContextData() before calling deref().
3102
3103         * Shared/ShareableBitmap.cpp:
3104         (WebKit::ShareableBitmap::ShareableBitmap):
3105         (WebKit::ShareableBitmap::~ShareableBitmap):
3106         * Shared/cg/ShareableBitmapCG.cpp:
3107         (WebKit::ShareableBitmap::createGraphicsContext):
3108         (WebKit::ShareableBitmap::releaseBitmapContextData):
3109
3110 2019-09-20  Alex Christensen  <achristensen@webkit.org>
3111
3112         Begin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration
3113         https://bugs.webkit.org/show_bug.cgi?id=202025
3114
3115         Reviewed by Chris Dumez.
3116
3117         Most of these were only needed before initNonPersistentConfiguration existed.
3118
3119         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp:
3120         (WKWebsiteDataStoreConfigurationGetPerOriginStorageQuota):
3121         (WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota):
3122         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h:
3123         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3124         (WKWebsiteDataStoreSetPerOriginStorageQuota):
3125         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3126         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3127         (-[WKWebsiteDataStore _initWithConfiguration:]):
3128         (-[WKWebsiteDataStore _perOriginStorageQuota]):
3129         (-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
3130         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3131         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
3132         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
3133         (-[_WKWebsiteDataStoreConfiguration perOriginStorageQuota]):
3134         (-[_WKWebsiteDataStoreConfiguration setPerOriginStorageQuota:]):
3135         (-[_WKWebsiteDataStoreConfiguration boundInterfaceIdentifier]):
3136         (-[_WKWebsiteDataStoreConfiguration setBoundInterfaceIdentifier:]):
3137         (-[_WKWebsiteDataStoreConfiguration allowsCellularAccess]):
3138         (-[_WKWebsiteDataStoreConfiguration setAllowsCellularAccess:]):
3139         (-[_WKWebsiteDataStoreConfiguration proxyConfiguration]):
3140         (-[_WKWebsiteDataStoreConfiguration setProxyConfiguration:]):
3141         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3142         (WebKit::WebsiteDataStore::parameters):
3143         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3144         (WebKit::WebsiteDataStore::WebsiteDataStore):
3145         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
3146         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
3147         * UIProcess/WebsiteData/WebsiteDataStore.h:
3148         (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
3149         (WebKit::WebsiteDataStore::boundInterfaceIdentifier):
3150         (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier const):
3151         (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier const):
3152         (WebKit::WebsiteDataStore::setAllowsCellularAccess):
3153         (WebKit::WebsiteDataStore::allowsCellularAccess):
3154         (WebKit::WebsiteDataStore::setProxyConfiguration):
3155         (WebKit::WebsiteDataStore::proxyConfiguration):
3156         (WebKit::WebsiteDataStore::setPerOriginStorageQuota): Deleted.
3157         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
3158         (WebKit::WebsiteDataStoreConfiguration::copy):
3159         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
3160         (WebKit::WebsiteDataStoreConfiguration::boundInterfaceIdentifier const):
3161         (WebKit::WebsiteDataStoreConfiguration::setBoundInterfaceIdentifier):
3162         (WebKit::WebsiteDataStoreConfiguration::allowsCellularAccess const):
3163         (WebKit::WebsiteDataStoreConfiguration::setAllowsCellularAccess):
3164         (WebKit::WebsiteDataStoreConfiguration::proxyConfiguration const):
3165         (WebKit::WebsiteDataStoreConfiguration::setProxyConfiguration):
3166
3167 2019-09-20  Alex Christensen  <achristensen@webkit.org>
3168
3169         Introduce LegacyGlobalSettings for settings the NetworkProcess needs from a WebProcessPool
3170         https://bugs.webkit.org/show_bug.cgi?id=201970
3171
3172         Reviewed by Geoff Garen.
3173
3174         I'm starting by moving the cache model to this new abstraction.
3175         We were using it in tests to disable the page cache, which should be done with a boolean on the pool configuration, not by changing the cache model.
3176         We were also using it in WKContextSetCacheModel which has several clients that won't change quickly, so this abstraction is used to maintain existing behavior.
3177         I need this so I can make a NetworkProcess not depend on anything from a WebProcessPool when starting.
3178
3179         * Sources.txt:
3180         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3181         (API::ProcessPoolConfiguration::copy):
3182         * UIProcess/API/APIProcessPoolConfiguration.h:
3183         * UIProcess/API/C/WKContext.cpp:
3184         (WKContextSetCacheModel):
3185         (WKContextGetCacheModel):
3186         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3187         (-[_WKProcessPoolConfiguration pageCacheEnabled]):
3188         (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
3189         * UIProcess/LegacyGlobalSettings.cpp: Added.
3190         (WebKit::LegacyGlobalSettings::singleton):
3191         (WebKit::LegacyGlobalSettings::setCacheModel):
3192         * UIProcess/LegacyGlobalSettings.h: Added.
3193         (WebKit::LegacyGlobalSettings::cacheModel const):
3194         * UIProcess/WebProcessCache.cpp:
3195         (WebKit::WebProcessCache::updateCapacity):
3196         * UIProcess/WebProcessPool.cpp:
3197         (WebKit::WebProcessPool::ensureNetworkProcess):
3198         (WebKit::WebProcessPool::initializeNewWebProcess):
3199         (WebKit::WebProcessPool::updateMaxSuspendedPageCount):
3200         (WebKit::WebProcessPool::setCacheModel):
3201         * UIProcess/WebProcessPool.h:
3202         * WebKit.xcodeproj/project.pbxproj:
3203
3204 2019-09-20  Alex Christensen  <achristensen@webkit.org>
3205
3206         Deprecate unused C API aliases for WebsiteDataStore
3207         https://bugs.webkit.org/show_bug.cgi?id=202029
3208
3209         Reviewed by Chris Dumez.
3210
3211         This is a piece of r249768.
3212
3213         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3214         (WKApplicationCacheManagerGetTypeID):
3215         (WKApplicationCacheManagerGetApplicationCacheOrigins):
3216         (WKApplicationCacheManagerDeleteEntriesForOrigin):
3217         (WKApplicationCacheManagerDeleteAllEntries):
3218         * UIProcess/API/C/WKApplicationCacheManager.h:
3219         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3220         (WKKeyValueStorageManagerGetTypeID):
3221         (WKKeyValueStorageManagerGetOriginKey):
3222         (WKKeyValueStorageManagerGetCreationTimeKey):
3223         (WKKeyValueStorageManagerGetModificationTimeKey):
3224         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
3225         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
3226         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
3227         (WKKeyValueStorageManagerDeleteAllEntries):
3228         * UIProcess/API/C/WKKeyValueStorageManager.h:
3229         * UIProcess/API/C/WKResourceCacheManager.cpp:
3230         (WKResourceCacheManagerGetTypeID):
3231         (WKResourceCacheManagerGetCacheOrigins):
3232         (WKResourceCacheManagerClearCacheForOrigin):
3233         (WKResourceCacheManagerClearCacheForAllOrigins):
3234         (toWebsiteDataTypes): Deleted.
3235         * UIProcess/API/C/WKResourceCacheManager.h:
3236
3237 2019-09-20  Alex Christensen  <achristensen@webkit.org>
3238
3239         Remove functionality to disable TLS fallback
3240         https://bugs.webkit.org/show_bug.cgi?id=201998
3241
3242         Reviewed by Geoff Garen.
3243
3244         Since r249019 it is not used.  It was a useful experiment and I'm glad we didn't see any regressions.
3245
3246         * NetworkProcess/NetworkSessionCreationParameters.cpp:
3247         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
3248         (WebKit::NetworkSessionCreationParameters::encode const):
3249         (WebKit::NetworkSessionCreationParameters::decode):
3250         * NetworkProcess/NetworkSessionCreationParameters.h:
3251         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3252         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3253         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3254         (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
3255         (-[WKWebsiteDataStore _allowsTLSFallback]):
3256         * UIProcess/WebProcessPool.cpp:
3257         (WebKit::WebProcessPool::ensureNetworkProcess):
3258         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3259         (WebKit::WebsiteDataStore::parameters):
3260         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3261         (WebKit::WebsiteDataStore::setAllowsTLSFallback): Deleted.
3262         * UIProcess/WebsiteData/WebsiteDataStore.h:
3263         (WebKit::WebsiteDataStore::allowsTLSFallback const): Deleted.
3264
3265 2019-09-20  Alex Christensen  <achristensen@webkit.org>
3266
3267         Remove unused storage paths on APIProcessPoolConfiguration
3268         https://bugs.webkit.org/show_bug.cgi?id=202028
3269
3270         Reviewed by Chris Dumez.
3271
3272         This is a piece of r249768.
3273         There is no way to set these paths and they have been replaced by WebsiteDataStore paths.
3274         There was one remaining use of the global disk cache directory in NetworkProcess::setCacheModel,
3275         which I replaced with the default session's disk cache directory, which is equivalent.
3276
3277         * NetworkProcess/NetworkProcess.cpp:
3278         (WebKit::NetworkProcess::setCacheModel):
3279         * NetworkProcess/NetworkProcess.h:
3280         (WebKit::NetworkProcess::diskCacheDirectory const): Deleted.
3281         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3282         (WebKit::NetworkProcessCreationParameters::encode const):
3283         (WebKit::NetworkProcessCreationParameters::decode):
3284         (WebKit::NetworkProcessCreationParameters::NetworkProcessCreationParameters): Deleted.
3285         * NetworkProcess/NetworkProcessCreationParameters.h:
3286         * NetworkProcess/NetworkSession.cpp:
3287         (WebKit::NetworkSession::NetworkSession):
3288         * NetworkProcess/cache/NetworkCache.cpp:
3289         (WebKit::NetworkCache::Cache::open):
3290         (WebKit::NetworkCache::Cache::Cache):
3291         * NetworkProcess/cache/NetworkCache.h:
3292         (WebKit::NetworkCache::Cache::storageDirectory):
3293         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3294         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3295         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3296         (API::ProcessPoolConfiguration::copy):
3297         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): Deleted.
3298         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Deleted.
3299         (API::ProcessPoolConfiguration::~ProcessPoolConfiguration): Deleted.
3300         * UIProcess/API/APIProcessPoolConfiguration.h:
3301         * UIProcess/API/glib/WebKitWebContext.cpp:
3302         (webkitWebContextConstructed):
3303         (webkit_web_context_set_disk_cache_directory):
3304         (websiteDataStoreConfigurationForWebProcessPoolConfiguration): Deleted.
3305         * UIProcess/WebProcessPool.cpp:
3306         (WebKit::WebProcessPool::ensureNetworkProcess):
3307         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
3308         (WebKit::WebProcessPool::webProcessDataStoreParameters):
3309         * UIProcess/WebProcessPool.h:
3310         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3311         (WebKit::WebsiteDataStore::processPools const):
3312         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
3313
3314 2019-09-20  Keith Rollin  <krollin@apple.com>
3315
3316         Remove some support for < iOS 13
3317         https://bugs.webkit.org/show_bug.cgi?id=202032
3318         <rdar://problem/55548468>
3319
3320         Reviewed by Alex Christensen.
3321
3322         Remove some support for iOS versions less than 13.0.
3323
3324         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
3325         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
3326         values >= 130000. This means that expressions like
3327         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
3328         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
3329
3330         This removal is part of a series of patches effecting the removal of
3331         dead code for old versions of iOS. This particular pass involves
3332         changes in which Dan Bates was involved. These changes are isolated
3333         from other similar changes in order to facilitate the reviewing
3334         process.
3335
3336         * UIProcess/ios/WKContentViewInteraction.mm:
3337         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
3338
3339 2019-09-20  Keith Rollin  <krollin@apple.com>
3340
3341         Remove some support for < iOS 13
3342         https://bugs.webkit.org/show_bug.cgi?id=201973
3343         <rdar://problem/55506966>
3344
3345         Reviewed by Alex Christensen.
3346
3347         Remove some support for iOS versions less than 13.0.
3348
3349         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
3350         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
3351         values >= 130000. This means that expressions like
3352         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
3353         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
3354
3355         This removal is part of a series of patches effecting the removal of
3356         dead code for old versions of iOS. This particular pass involves
3357         changes in which Chris Dumez was involved. These changes are isolated
3358         from other similar changes in order to facilitate the reviewing
3359         process.
3360
3361         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
3362         (WebKit::Download::resume):
3363
3364 2019-09-20  Chris Dumez  <cdumez@apple.com>
3365
3366         Unreviewed, fix confusing release logging under WebPageProxy::loadRequestWithNavigationShared().
3367
3368         * UIProcess/WebPageProxy.cpp:
3369         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
3370
3371 2019-09-20  Chris Dumez  <cdumez@apple.com>
3372
3373         Regression(r248832): Unable to quicklook HTML files in Mail
3374         https://bugs.webkit.org/show_bug.cgi?id=202012
3375         <rdar://problem/55285295>
3376
3377         Reviewed by Per Arne Vollan.
3378
3379         Follow-up to fix bug in r250110. Now that loadFile() calls
3380         maybeInitializeSandboxExtensionHandle(), it no longer needs to
3381         call assumeReadAccessToBaseURL(). This is because maybeInitializeSandboxExtensionHandle()
3382         already take care of it.
3383
3384         * UIProcess/WebPageProxy.cpp:
3385         (WebKit::WebPageProxy::loadFile):
3386
3387 2019-09-20  Joonghun Park  <pjh0718@gmail.com>
3388
3389         Unreviewed. Remove duplicated HashMap iteration since r248734.
3390
3391         ASSERT statement already exists for |storageNamespaceID|,
3392         so |HashMap.get| for the parameter is not needed.
3393
3394         * NetworkProcess/WebStorage/StorageManager.cpp:
3395         (WebKit::StorageManager::destroySessionStorageNamespace):
3396
3397 2019-09-20  Joonghun Park  <pjh0718@gmail.com>
3398
3399         Unreviewed. Fix Build warning below since r248734.
3400
3401         warning: unused variable ‘foo’ [-Wunused-variable]
3402
3403         * NetworkProcess/WebStorage/StorageManager.cpp:
3404         (WebKit::StorageManager::destroySessionStorageNamespace):
3405         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
3406         (WebKit::StorageManagerSet::add):
3407         (WebKit::StorageManagerSet::waitUntilTasksFinished):
3408
3409 2019-09-19  Brent Fulgham  <bfulgham@apple.com>
3410
3411         [FTW, WinCairo] Support running tests in Release mode
3412         https://bugs.webkit.org/show_bug.cgi?id=202021
3413
3414         Reviewed by Don Olmstead.
3415
3416         In Bug 201597, we added new features to better lock down JSC features in the
3417         potentially untrusted WebContent process.
3418
3419         Unfortunately, this change included XPC Dictionary items used at startup to
3420         lock down JSC features before entering the main execution of the process. These
3421         changes were not done for the WinCairo or FTW ports.
3422
3423         We need to pass the state of the JIT and whether to enable certain JSC features
3424         at process launch. Since the XPC mechanisms we use on macOS and iOS do not exist
3425         on Windows, I am implementing them as command-line flags.
3426
3427             -configure-jsc-for-testing: Sets the JSC in testing mode.
3428             -disable-jit: Disables the JIT.
3429
3430         See r249808 for the equivalent changes on macOS and iOS.
3431
3432         * PlatformFTW.cmake: Add some missing header files needed when building tests.
3433         * Shared/win/AuxiliaryProcessMainWin.cpp:
3434         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
3435         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
3436         (WebKit::ProcessLauncher::launchProcess):
3437
3438 2019-09-19  Chris Dumez  <cdumez@apple.com>
3439
3440         Add better logging for when the view visibility state changes
3441         https://bugs.webkit.org/show_bug.cgi?id=202008
3442
3443         Reviewed by Geoffrey Garen.
3444
3445         * UIProcess/ApplicationStateTracker.mm:
3446         * UIProcess/WebPageProxy.cpp:
3447         (WebKit::WebPageProxy::updateActivityState):
3448         * UIProcess/ios/WebPageProxyIOS.mm:
3449         (WebKit::WebPageProxy::applicationDidEnterBackground):
3450         (WebKit::WebPageProxy::applicationWillEnterForeground):
3451
3452 2019-09-19  Chris Dumez  <cdumez@apple.com>
3453
3454         Regression(r248832): Unable to quicklook HTML files in Mail
3455         https://bugs.webkit.org/show_bug.cgi?id=202012
3456         <rdar://problem/55285295>
3457
3458         Reviewed by Geoff Garen and Brent Fulgham.
3459
3460         r248832 inadvertently reverted the fix for Mail that landed in r247400 by not using
3461         the same logic to initialize the sandbox extension if the process had already
3462         finished launching or not. In particular, the new code path that happens on process
3463         launch unconditionally used '/' as resource directory for the sandbox extension if
3464         the client did not provide one. The logic in maybeInitializeSandboxExtensionHandle()
3465         would use the file URL's base URL as resource directory when creating a sandbox
3466         extension for '/' would fail (which it often does).
3467
3468         To address the issue, have the logic that runs on process launch call
3469         maybeInitializeSandboxExtensionHandle() so avoid duplicating code and make sure
3470         both cases now have the Mail fix.
3471
3472         * UIProcess/AuxiliaryProcessProxy.cpp:
3473         (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
3474         * UIProcess/AuxiliaryProcessProxy.h:
3475         (WebKit::AuxiliaryProcessProxy::isLaunching const):
3476         * UIProcess/WebPageProxy.cpp:
3477         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3478         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
3479         (WebKit::WebPageProxy::loadFile):
3480         * UIProcess/WebPageProxy.h:
3481         * WebProcess/WebPage/WebPage.messages.in:
3482
3483 2019-09-19  Tim Horton  <timothy_horton@apple.com>
3484
3485         macCatalyst apps crash under TextCheckingControllerProxy::replaceRelativeToSelection when spell checking
3486         https://bugs.webkit.org/show_bug.cgi?id=202010
3487         <rdar://problem/54974971>
3488
3489         Reviewed by Beth Dakin.
3490
3491         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
3492         (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
3493         relativeReplacementRange is in the coordinate space of the document's text,
3494         not the replacement string. We need to adjust into replacement string
3495         coordinates before slicing the replacement, or we'll throw an exception
3496         trying to read past the end of the string, in the case where the
3497         replacement string is shorter than the replaced string (by more than 2 characters).
3498
3499 2019-09-19  Yury Semikhatsky  <yurys@chromium.org>
3500
3501         WebStorageNamespaceProvider / StorageNamespaceImpl no longer need SessionIDs
3502         https://bugs.webkit.org/show_bug.cgi?id=201922
3503         <rdar://problem/55505906>
3504
3505         Reviewed by Chris Dumez.
3506
3507         Fix GTK Debug compilation after https://trac.webkit.org/changeset/250083:
3508         ../../Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:75:55: error: no member named 'singleton' in namespace 'WebCore::Process'
3509         ASSERT_UNUSED(sessionID, sessionID == WebProcess::singleton().sessionID());
3510                                           ~~~~~~~~~~~~^
3511
3512         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
3513
3514 2019-09-19  Chris Dumez  <cdumez@apple.com>
3515
3516         WorkerGlobalScope does not need a SessionID
3517         https://bugs.webkit.org/show_bug.cgi?id=201991
3518
3519         Reviewed by Alex Christensen.
3520
3521         WorkerGlobalScope does not need a SessionID, now that we have a single session
3522         per WebProcess.
3523
3524         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3525         (WebKit::WebSWContextManagerConnection::installServiceWorker):
3526         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3527         (WebKit::WebServiceWorkerProvider::serviceWorkerConnection):
3528         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnection):
3529         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession): Deleted.
3530         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession): Deleted.
3531         * WebProcess/Storage/WebServiceWorkerProvider.h:
3532         * WebProcess/WebPage/WebPage.cpp:
3533         (WebKit::WebPage::updateThrottleState):
3534
3535 2019-09-19  Brent Fulgham  <bfulgham@apple.com>
3536
3537         Create InjectedBundle SPI to better support NSSecureCoding
3538         https://bugs.webkit.org/show_bug.cgi?id=201810
3539         <rdar://problem/55265713>
3540
3541         The encoding/decoding routines used by WebKit’s InjectedBundles are based on NSCoding.
3542         While we have changed WebKit internals to use NSSecureCoding, there are a number of
3543         injected bundles that need to serialize custom classes between the InjectedBundle and
3544         the relevant WebKit UIProcess.
3545
3546         We need to lock down this communications channel by enforcing NSSecureCoding.
3547
3548         This patch creates new SPI to allow the UIProcess to specify classes that it will accept
3549         in messages from the WebContet Process (and Injected Bundle).
3550
3551         It adds the following property to the WKProcessPoolConfiguration:
3552
3553             @property (nonatomic, copy) NSSet<Class> *customClassesForParameterCoder;
3554
3555         If no custom classes are specified, the standard serialization primitives are supported:
3556             NSArray, NSData, NSDate, NSDictionary, NSNull, NSNumber, NSSet, NSString,
3557             NSTimeZone, NSURL, and NSUUID.
3558
3559         Reviewed by Brady Eidson.
3560
3561         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3562         (API::ProcessPoolConfiguration::copy): Copy any custom classes.
3563         * UIProcess/API/APIProcessPoolConfiguration.h:
3564         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3565         (WKContextConfigurationCopyCustomClassesForParameterCoder): Added.
3566         (WKContextConfigurationSetCustomClassesForParameterCoder): Added.
3567         * UIProcess/API/C/WKContextConfigurationRef.h:
3568         * UIProcess/API/Cocoa/WKProcessGroup.h:
3569         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3570         (toStringVector): Added.
3571         (-[WKProcessGroup initWithInjectedBundleURL:andCustomClassesForParameterCoder:]):
3572         * UIProcess/API/Cocoa/WKWebView.mm:
3573         (-[WKWebView _setInputDelegate:]): Restrict serialization to allowed classes.
3574         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3575         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3576         (-[_WKProcessPoolConfiguration customClassesForParameterCoder]): Added.
3577         (-[_WKProcessPoolConfiguration setCustomClassesForParameterCoder:]): Added.
3578         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3579         (WebKit::WebProcessPool::platformInitialize): Register any custom classes
3580         provided in the configuraton.
3581         (WebKit::WebProcessPool::initializeClassesForParameterCoding): Added.
3582         (WebKit::WebProcessPool::allowedClassesForParameterCoding const): Added.
3583         * UIProcess/WebProcessPool.h:
3584         * UIProcess/ios/PageClientImplIOS.mm:
3585         (WebKit::PageClientImpl::elementDidFocus): Restrict serialization to allowed
3586         classes only.
3587
3588 2019-09-18  Chris Dumez  <cdumez@apple.com>
3589
3590         AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPC should not need to pass a SessionID
3591         https://bugs.webkit.org/show_bug.cgi?id=201962
3592
3593         Reviewed by Geoffrey Garen.
3594
3595         AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPC from the WebProcess to the UIProcess
3596         should not need to pass a SessionID, since the UIProcess already knows the SessionID of a given WebProcess.
3597
3598         * UIProcess/WebProcessPool.cpp:
3599         (WebKit::WebProcessPool::addPlugInAutoStartOriginHash): Deleted.
3600         (WebKit::WebProcessPool::plugInDidReceiveUserInteraction): Deleted.
3601         * UIProcess/WebProcessPool.h:
3602         * UIProcess/WebProcessPool.messages.in:
3603         * UIProcess/WebProcessProxy.cpp:
3604         (WebKit::WebProcessProxy::addPlugInAutoStartOriginHash):
3605         (WebKit::WebProcessProxy::plugInDidReceiveUserInteraction):
3606         * UIProcess/WebProcessProxy.h:
3607         * UIProcess/WebProcessProxy.messages.in:
3608         * WebProcess/WebProcess.cpp:
3609         (WebKit::WebProcess::plugInDidStartFromOrigin):
3610         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
3611
3612 2019-09-18  Chris Dumez  <cdumez@apple.com>
3613
3614         WebStorageNamespaceProvider / StorageNamespaceImpl no longer need SessionIDs
3615         https://bugs.webkit.org/show_bug.cgi?id=201922
3616
3617         Reviewed by Geoffrey Garen.
3618
3619         WebStorageNamespaceProvider / StorageNamespaceImpl no longer need SessionIDs, now that
3620         we have a single session per WebProcess.
3621
3622         * WebProcess/WebStorage/StorageAreaMap.cpp:
3623         (WebKit::StorageAreaMap::connect):
3624         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
3625         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
3626         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
3627         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
3628         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
3629         (WebKit::StorageNamespaceImpl::sessionID const):
3630         (WebKit::StorageNamespaceImpl::copy):
3631         * WebProcess/WebStorage/StorageNamespaceImpl.h:
3632         (): Deleted.
3633         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
3634         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
3635         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
3636         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
3637
3638 2019-09-18  Chris Dumez  <cdumez@apple.com>
3639
3640         Decrease use of sessionID in WebLoaderStrategy
3641         https://bugs.webkit.org/show_bug.cgi?id=201961
3642
3643         Reviewed by Geoffrey Garen.
3644
3645         * WebProcess/Network/WebLoaderStrategy.cpp:
3646         (WebKit::WebLoaderStrategy::loadResource):
3647         (WebKit::WebLoaderStrategy::scheduleLoad):
3648         (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
3649         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3650         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3651         * WebProcess/Network/WebLoaderStrategy.h:
3652
3653 2019-09-18  Chris Dumez  <cdumez@apple.com>
3654
3655         WebSocketStream does not need a SessionID
3656         https://bugs.webkit.org/show_bug.cgi?id=201960
3657
3658         Reviewed by Geoffrey Garen.
3659
3660         WebSocketStream does not need a SessionID, now that we have a single session per WebProcess.
3661
3662         * WebProcess/Network/WebSocketProvider.cpp:
3663         (WebKit::WebSocketProvider::createSocketStreamHandle):
3664         * WebProcess/Network/WebSocketStream.cpp:
3665         (WebKit::WebSocketStream::create):
3666         (WebKit::WebSocketStream::WebSocketStream):
3667         * WebProcess/Network/WebSocketStream.h:
3668
3669 2019-09-18  Chris Dumez  <cdumez@apple.com>
3670
3671         LibWebRTCProvider does not need sessionIDs anymore
3672         https://bugs.webkit.org/show_bug.cgi?id=201959
3673
3674         Reviewed by Geoffrey Garen.
3675
3676         LibWebRTCProvider does not need sessionIDs anymore, now that we have a single session per WebProcess.
3677
3678         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3679         (WebKit::LibWebRTCProvider::registerMDNSName):
3680         (WebKit::LibWebRTCProvider::createSocketFactory):
3681         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
3682
3683 2019-09-18  Yury Semikhatsky  <yurys@chromium.org>
3684
3685         [GTK] Compilation errors when GL is disabled
3686         https://bugs.webkit.org/show_bug.cgi?id=200223
3687
3688         Fix following compilation error when building with ENABLE_OPENGL=OFF
3689         ../../Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp:123:51: error: use of undeclared identifier 'WaylandCompositor'
3690         parameters.waylandCompositorDisplayName = WaylandCompositor::singleton().displayName();
3691                                                   ^
3692         Reviewed by Philippe Normand.
3693
3694         * UIProcess/glib/WebProcessPoolGLib.cpp:
3695         (WebKit::WebProcessPool::platformInitializeWebProcess): only make a call when using EGL, this matches
3696         guards in WaylandCompositor.h. The condition was changed in r245807.
3697
3698 2019-09-18  Timothy Hatcher  <timothy@apple.com>
3699
3700         Eagerly create and add the m_layerHostingView to WKWebView.
3701         https://bugs.webkit.org/show_bug.cgi?id=201942
3702
3703         Reviewed by Tim Horton.
3704
3705         Some apps will add subviews to WKWebView, and by the time we add our m_layerHostingView view we might be
3706         adding it behind a view that should have been added behind our layer hosting view subview. This affected
3707         the Spark email app, due to changes in order of loading delegate calls and when compositing is enabled.
3708         Instead of delayed creation of m_layerHostingView, always create it and add it to to the WKWebView.
3709         This ensures proper ordering of subviews when clients add a view behind all existing subviews.
3710
3711         * UIProcess/Cocoa/WebViewImpl.mm:
3712         (WebKit::WebViewImpl::WebViewImpl): Create and add m_layerHostingView here.
3713         (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer): Remove creation and removal of m_layerHostingView.
3714         Just set the sublayers of m_layerHostingView's layer here.
3715
3716 2019-09-18  Joseph Pecoraro  <pecoraro@apple.com>
3717
3718         Web Inspector: Can't drag undocked Inspector window by its title text
3719         https://bugs.webkit.org/show_bug.cgi?id=190886
3720         <rdar://problem/44574547>
3721
3722         Reviewed by Tim Horton.
3723
3724         * UIProcess/mac/WKInspectorWKWebView.mm:
3725         (-[WKInspectorWKWebView _opaqueRectForWindowMoveWhenInTitlebar]):
3726         Legendary.
3727
3728 2019-09-18  Chris Dumez  <cdumez@apple.com>
3729
3730         BlobRegistry no longer needs SessionIDs
3731         https://bugs.webkit.org/show_bug.cgi?id=201936
3732
3733         Reviewed by Geoffrey Garen.
3734
3735         BlobRegistry no longer needs SessionIDs, now that we have a single session per WebProcess.
3736
3737         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
3738         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
3739         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3740         (WebKit::BlobRegistryProxy::registerFileBlobURL):
3741         (WebKit::BlobRegistryProxy::registerBlobURL):
3742         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
3743         (WebKit::BlobRegistryProxy::unregisterBlobURL):
3744         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
3745         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
3746         * WebProcess/FileAPI/BlobRegistryProxy.h:
3747
3748 2019-09-18  Benjamin Nham  <nham@apple.com>
3749
3750         NetworkLoadParameters shouldn't store sessionID
3751         https://bugs.webkit.org/show_bug.cgi?id=201921
3752
3753         Reviewed by Chris Dumez.
3754
3755         Now that there's a single session id per WebProcess, we don't need to
3756         store the session id in NetworkLoadParameters anymore. Clients can just
3757         directly ask NetworkConnectionToWebProcess for the WebProcess's session
3758         ID instead.
3759
3760         * NetworkProcess/AdClickAttributionManager.cpp:
3761         (WebKit::AdClickAttributionManager::fireConversionRequest):
3762         * NetworkProcess/Downloads/DownloadManager.cpp:
3763         (WebKit::DownloadManager::startDownload):
3764         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3765         (WebKit::NetworkCORSPreflightChecker::startPreflight):
3766         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3767         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
3768         * NetworkProcess/NetworkLoadParameters.h:
3769         * NetworkProcess/NetworkResourceLoadMap.h:
3770         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3771         (WebKit::NetworkResourceLoadParameters::encode const):
3772         (WebKit::NetworkResourceLoadParameters::decode):
3773         * NetworkProcess/NetworkResourceLoadParameters.h:
3774         * NetworkProcess/NetworkResourceLoader.cpp:
3775         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
3776         (WebKit::NetworkResourceLoader::startNetworkLoad):
3777         (WebKit::NetworkResourceLoader::convertToDownload):
3778         * NetworkProcess/NetworkResourceLoader.h:
3779         * NetworkProcess/NetworkSession.cpp:
3780         (WebKit::NetworkSession::NetworkSession):
3781         * NetworkProcess/PingLoad.cpp:
3782         (WebKit::PingLoad::PingLoad):
3783         (WebKit::PingLoad::loadRequest):
3784         (WebKit::PingLoad::didReceiveChallenge):
3785         * NetworkProcess/PingLoad.h:
3786         * NetworkProcess/PreconnectTask.cpp:
3787         (WebKit::PreconnectTask::PreconnectTask):
3788         * NetworkProcess/PreconnectTask.h:
3789         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3790         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3791         * WebProcess/Network/WebLoaderStrategy.cpp:
3792         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3793         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3794         (WebKit::WebLoaderStrategy::startPingLoad):
3795         (WebKit::WebLoaderStrategy::preconnectTo):
3796
3797 2019-09-18  Andy Estes  <aestes@apple.com>
3798
3799         [Apple Pay] Tell websites why a session was cancelled
3800         https://bugs.webkit.org/show_bug.cgi?id=201912
3801         <rdar://problem/55469706>
3802
3803         Reviewed by Brady Eidson.
3804
3805         Remembered the error passed to -[WKPaymentAuthorizationDelegate _willFinishWithError:] and
3806         sent it to the WebContent process in Messages::WebPaymentCoordinator::DidCancelPaymentSession.
3807
3808         * Platform/cocoa/PaymentAuthorizationPresenter.h:
3809         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
3810         (-[WKPaymentAuthorizationDelegate _didFinish]):
3811         (-[WKPaymentAuthorizationDelegate _willFinishWithError:]):
3812         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
3813         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
3814         (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish):
3815         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
3816         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
3817         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
3818         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3819         (IPC::ArgumentCoder<WebCore::PaymentSessionError>::encode):
3820         (IPC::ArgumentCoder<WebCore::PaymentSessionError>::decode):
3821         * Shared/WebCoreArgumentCoders.h:
3822         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
3823         (WebKit::WebPaymentCoordinator::networkProcessConnectionClosed):
3824         (WebKit::WebPaymentCoordinator::didCancelPaymentSession):
3825         * WebProcess/ApplePay/WebPaymentCoordinator.h:
3826         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
3827
3828 2019-09-18  Chris Dumez  <cdumez@apple.com>
3829
3830         WebSWContextManagerConnection::installServiceWorker IPC no longer need a sessionID
3831         https://bugs.webkit.org/show_bug.cgi?id=201882
3832
3833         Reviewed by Geoffrey Garen.
3834
3835         WebSWContextManagerConnection::installServiceWorker IPC no longer need a sessionID now that we have a single
3836         sessionID per WebProcess.
3837
3838         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3839         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
3840         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
3841         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3842         (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
3843         (WebKit::ServiceWorkerFrameLoaderClient::sessionID const):
3844         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
3845         (WebKit::WebSWContextManagerConnection::installServiceWorker):
3846         * WebProcess/Storage/WebSWContextManagerConnection.h:
3847         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3848         * WebProcess/WebProcess.cpp:
3849         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
3850
3851 2019-09-18  Chris Dumez  <cdumez@apple.com>
3852
3853         Stop passing sessionIDs to NetworkProcessConnection methods
3854         https://bugs.webkit.org/show_bug.cgi?id=201886
3855
3856         Reviewed by Geoffrey Garen.
3857
3858         Stop passing sessionIDs to NetworkProcessConnection methods. This is no longer
3859         necessary now that we have a single session per WebProcess.
3860
3861         * NetworkProcess/NetworkResourceLoader.cpp:
3862         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
3863         * WebProcess/Databases/WebDatabaseProvider.cpp:
3864         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
3865         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3866         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
3867         * WebProcess/Network/NetworkProcessConnection.cpp:
3868         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
3869         (WebKit::NetworkProcessConnection::didCacheResource):
3870         (WebKit::NetworkProcessConnection::idbConnectionToServer):
3871         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession): Deleted.
3872         * WebProcess/Network/NetworkProcessConnection.h:
3873         * WebProcess/Network/NetworkProcessConnection.messages.in:
3874
3875 2019-09-18  Chris Dumez  <cdumez@apple.com>
3876
3877         CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID
3878         https://bugs.webkit.org/show_bug.cgi?id=201920
3879
3880         Reviewed by Geoffrey Garen.
3881
3882         CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID.
3883         This sessionID is no longer used now that we have a session per WebProcess.
3884
3885         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
3886         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
3887         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3888         (WebKit::WebCacheStorageConnection::sessionID const): Deleted.
3889         * WebProcess/Cache/WebCacheStorageConnection.h:
3890         * WebProcess/Cache/WebCacheStorageProvider.cpp:
3891         (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
3892         * WebProcess/Cache/WebCacheStorageProvider.h:
3893         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3894         (WebKit::BlobRegistryProxy::blobSize):
3895         * WebProcess/FileAPI/BlobRegistryProxy.h:
3896
3897 2019-09-18  Chris Dumez  <cdumez@apple.com>
3898
3899         Drop FrameLoaderClient::sessionID()
3900         https://bugs.webkit.org/show_bug.cgi?id=201916
3901
3902         Reviewed by Geoffrey Garen.
3903
3904         Drop FrameLoaderClient::sessionID(). The Frame can get the sessionID from its page (Which is
3905         what the FrameLoaderClient::sessionID() ended up doing) and other call sites at WebKit2 layer
3906         can get the sessionID from the WebProcess singleton.
3907
3908         * WebProcess/Network/WebLoaderStrategy.cpp:
3909         (WebKit::WebLoaderStrategy::scheduleLoad):
3910         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3911         (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
3912         (WebKit::WebSWContextManagerConnection::installServiceWorker):
3913         * WebProcess/Storage/WebSWContextManagerConnection.h:
3914         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3915         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3916
3917 2019-09-18  Chris Dumez  <cdumez@apple.com>
3918
3919         WebServiceWorkerProvider::handleFetch() does not need to take in a sessionID
3920         https://bugs.webkit.org/show_bug.cgi?id=201917
3921
3922         Reviewed by Geoffrey Garen.
3923
3924         * WebProcess/Network/WebLoaderStrategy.cpp:
3925         (WebKit::WebLoaderStrategy::scheduleLoad):
3926         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3927         (WebKit::WebServiceWorkerProvider::handleFetch):
3928         * WebProcess/Storage/WebServiceWorkerProvider.h:
3929
3930 2019-09-18  Chris Dumez  <cdumez@apple.com>
3931
3932         Web