WebServiceWorkerProvider::handleFetch() does not need to take in a sessionID
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-09-18  Chris Dumez  <cdumez@apple.com>
2
3         WebServiceWorkerProvider::handleFetch() does not need to take in a sessionID
4         https://bugs.webkit.org/show_bug.cgi?id=201917
5
6         Reviewed by Geoffrey Garen.
7
8         * WebProcess/Network/WebLoaderStrategy.cpp:
9         (WebKit::WebLoaderStrategy::scheduleLoad):
10         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
11         (WebKit::WebServiceWorkerProvider::handleFetch):
12         * WebProcess/Storage/WebServiceWorkerProvider.h:
13
14 2019-09-18  Chris Dumez  <cdumez@apple.com>
15
16         WebSWServerToContextConnection::PostMessageToServiceWorkerClient IPC no longer needs to take a sessionID
17         https://bugs.webkit.org/show_bug.cgi?id=201883
18
19         Reviewed by Geoffrey Garen.
20
21         WebSWServerToContextConnection::PostMessageToServiceWorkerClient IPC no longer needs to take a sessionID,
22         now that we have a single session per WebProcess.
23
24         * NetworkProcess/NetworkProcess.cpp:
25         * NetworkProcess/NetworkProcess.h:
26         * NetworkProcess/NetworkProcess.messages.in:
27         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
28         (WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient):
29         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
30         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
31         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
32         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
33         * WebProcess/Storage/WebSWContextManagerConnection.h:
34
35 2019-09-18  Carlos Alberto Lopez Perez  <clopez@igalia.com>
36
37         [GTK][WPE] bubblewrap sandbox should be disabled when running inside docker
38         https://bugs.webkit.org/show_bug.cgi?id=201914
39
40         Reviewed by Michael Catanzaro.
41
42         Detect if running inside Docker by checking the file /.dockerenv
43         In that case, disable the sandbox.
44
45         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
46         (WebKit::isInsideDocker):
47         (WebKit::ProcessLauncher::launchProcess):
48
49 2019-09-17  Ross Kirsling  <ross.kirsling@sony.com>
50
51         Unreviewed WinCairo build fix following r249985.
52
53         * Shared/WebProcessDataStoreParameters.h:
54
55 2019-09-17  Dean Jackson  <dino@apple.com>
56
57         Remove the "Show Link Previews" and "Hide Link Previews" action menus in the preview platter
58         https://bugs.webkit.org/show_bug.cgi?id=201864
59         <rdar://55190038>
60
61         Reviewed by Simon Fraser.
62
63         * UIProcess/ios/WKActionSheetAssistant.mm: Remove the toggle action from the
64         default values.
65         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
66         * UIProcess/ios/WKContentViewInteraction.mm: No longer try to add a toggle when
67         it isn't there.
68         (-[WKContentView assignLegacyDataForContextMenuInteraction]):
69         (menuWithShowLinkPreviewAction): Deleted.
70
71 2019-09-17  Chris Dumez  <cdumez@apple.com>
72
73         Stop calling Page::setSessionID() from WebKit2
74         https://bugs.webkit.org/show_bug.cgi?id=201888
75
76         Reviewed by Alex Christensen.
77
78         Stop calling Page::setSessionID() from WebKit2 since Page's sessionID can never change when
79         using WebKit2 (We process-swap and create a new Page in a new process when changing data
80         store). Instead, we now pass the sessionID ID when constructing the Page, as part of the
81         PageConfiguration structure.
82
83         * Shared/WebsitePoliciesData.cpp:
84         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
85         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
86         (WebKit::WebSWContextManagerConnection::installServiceWorker):
87         * WebProcess/WebPage/WebPage.cpp:
88         (WebKit::m_textAutoSizingAdjustmentTimer):
89         (WebKit::WebPage::setSessionID): Deleted.
90         * WebProcess/WebPage/WebPage.h:
91
92 2019-09-17  Mark Lam  <mark.lam@apple.com>
93
94         Use constexpr instead of const in symbol definitions that are obviously constexpr.
95         https://bugs.webkit.org/show_bug.cgi?id=201879
96
97         Rubber-stamped by Joseph Pecoraro.
98
99         * WebProcess/Plugins/Netscape/JSNPObject.h:
100
101 2019-09-17  Ross Kirsling  <ross.kirsling@sony.com>
102
103         Unreviewed restabilization of non-unified build.
104
105         * UIProcess/WebProcessProxy.cpp:
106         * WebProcess/Network/WebLoaderStrategy.cpp:
107         * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
108
109 2019-09-17  Chris Dumez  <cdumez@apple.com>
110
111         WebProcess class methods should not need to take a sessionID
112         https://bugs.webkit.org/show_bug.cgi?id=201881
113
114         Reviewed by Geoffrey Garen.
115
116         WebProcess class methods should not need to take a sessionID given that we have a single
117         session per WebProcess now.
118
119         * Shared/WebProcessCreationParameters.cpp:
120         (WebKit::WebProcessCreationParameters::encode const):
121         (WebKit::WebProcessCreationParameters::decode):
122         * Shared/WebProcessCreationParameters.h:
123         * Shared/WebProcessDataStoreParameters.h:
124         (WebKit::WebProcessDataStoreParameters::encode const):
125         (WebKit::WebProcessDataStoreParameters::decode):
126         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
127         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
128         (WebKit::PlugInAutoStartProvider::autoStartOriginHashesCopy const):
129         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
130         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
131         * UIProcess/Plugins/PlugInAutoStartProvider.h:
132         * UIProcess/WebProcessPool.cpp:
133         (WebKit::WebProcessPool::webProcessDataStoreParameters):
134         (WebKit::WebProcessPool::initializeNewWebProcess):
135         * UIProcess/WebProcessPool.h:
136         (WebKit::WebProcessPool::sendToAllProcesses):
137         (WebKit::WebProcessPool::sendToAllProcessesForSession):
138         * UIProcess/WebProcessProxy.cpp:
139         (WebKit::WebProcessProxy::fetchWebsiteData):
140         (WebKit::WebProcessProxy::deleteWebsiteData):
141         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
142         (WebKit::WebProcessProxy::establishServiceWorkerContext):
143         * WebProcess/Plugins/PluginView.cpp:
144         (WebKit::PluginView::pluginDidReceiveUserInteraction):
145         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
146         (WebKit::WebPlugInClient::didStartFromOrigin):
147         * WebProcess/WebPage/WebPage.cpp:
148         (WebKit::WebPage::close):
149         * WebProcess/WebProcess.cpp:
150         (WebKit::WebProcess::initializeWebProcess):
151         (WebKit::WebProcess::setWebsiteDataStoreParameters):
152         (WebKit::WebProcess::removeWebPage):
153         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
154         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
155         (WebKit::WebProcess::plugInDidStartFromOrigin):
156         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
157         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
158         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
159         (WebKit::WebProcess::fetchWebsiteData):
160         (WebKit::WebProcess::deleteWebsiteData):
161         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
162         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
163         * WebProcess/WebProcess.h:
164         * WebProcess/WebProcess.messages.in:
165
166 2019-09-17  Chris Dumez  <cdumez@apple.com>
167
168         WebMDNSRegister no longer needs to be provided sessionIDs
169         https://bugs.webkit.org/show_bug.cgi?id=201876
170
171         Reviewed by Geoffrey Garen.
172
173         WebMDNSRegister no longer needs to be provided sessionIDs, now that we
174         have one session per WebProcess.
175
176         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
177         (WebKit::NetworkMDNSRegister::registerMDNSName):
178         (WebKit::NetworkMDNSRegister::sessionID const):
179         * NetworkProcess/webrtc/NetworkMDNSRegister.h:
180         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
181         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
182         (WebKit::LibWebRTCProvider::registerMDNSName):
183         (WebKit::LibWebRTCProvider::createSocketFactory):
184         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
185         (WebKit::WebMDNSRegister::registerMDNSName):
186         * WebProcess/Network/webrtc/WebMDNSRegister.h:
187
188 2019-09-17  Chris Dumez  <cdumez@apple.com>
189
190         WebSWServerConnection does not need to store a sessionID
191         https://bugs.webkit.org/show_bug.cgi?id=201878
192
193         Reviewed by Geoffrey Garen.
194
195         WebSWServerConnection does not need to store a sessionID, it can simply get it from its SWServer.
196
197         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
198         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
199         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
200         (WebKit::WebSWServerConnection::WebSWServerConnection):
201         (WebKit::WebSWServerConnection::startFetch):
202         (WebKit::WebSWServerConnection::sessionID const):
203         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
204
205 2019-09-17  Chris Dumez  <cdumez@apple.com>
206
207         WebPaymentCoordinatorProxy does not need sessionIDs
208         https://bugs.webkit.org/show_bug.cgi?id=201875
209
210         Reviewed by Geoffrey Garen.
211
212         WebPaymentCoordinatorProxy does not need sessionIDs so let's stop passing them around.
213
214         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
215         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
216         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
217         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
218         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
219         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
220         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
221         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
222         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
223         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
224         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
225         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
226         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
227         (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
228         (WebKit::WebPaymentCoordinator::showPaymentUI):
229
230 2019-09-17  Chris Dumez  <cdumez@apple.com>
231
232         There should be a single CacheStorageConnection per WebProcess
233         https://bugs.webkit.org/show_bug.cgi?id=201874
234
235         Reviewed by Geoffrey Garen.
236
237         There should be a single CacheStorageConnection per WebProcess now that we have a single session
238         per WebProcess. This invariant allows us to simplify the code.
239
240         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
241         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
242         (WebKit::CacheStorageEngineConnection::open):
243         (WebKit::CacheStorageEngineConnection::remove):
244         (WebKit::CacheStorageEngineConnection::caches):
245         (WebKit::CacheStorageEngineConnection::retrieveRecords):
246         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
247         (WebKit::CacheStorageEngineConnection::putRecords):
248         (WebKit::CacheStorageEngineConnection::reference):
249         (WebKit::CacheStorageEngineConnection::dereference):
250         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
251         (WebKit::CacheStorageEngineConnection::engineRepresentation):
252         (WebKit::CacheStorageEngineConnection::sessionID const):
253         * NetworkProcess/cache/CacheStorageEngineConnection.h:
254         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
255         * WebProcess/Cache/WebCacheStorageConnection.cpp:
256         (WebKit::WebCacheStorageConnection::WebCacheStorageConnection):
257         (WebKit::WebCacheStorageConnection::open):
258         (WebKit::WebCacheStorageConnection::remove):
259         (WebKit::WebCacheStorageConnection::retrieveCaches):
260         (WebKit::WebCacheStorageConnection::retrieveRecords):
261         (WebKit::WebCacheStorageConnection::batchDeleteOperation):
262         (WebKit::WebCacheStorageConnection::batchPutOperation):
263         (WebKit::WebCacheStorageConnection::reference):
264         (WebKit::WebCacheStorageConnection::dereference):
265         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
266         (WebKit::WebCacheStorageConnection::engineRepresentation):
267         (WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage):
268         (WebKit::WebCacheStorageConnection::sessionID const):
269         * WebProcess/Cache/WebCacheStorageConnection.h:
270         * WebProcess/Cache/WebCacheStorageProvider.cpp:
271         (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
272         * WebProcess/Cache/WebCacheStorageProvider.h:
273
274 2019-09-17  Chris Dumez  <cdumez@apple.com>
275
276         Unreviewed attempt to fix internal build after r249962.
277
278         * UIProcess/API/C/WKPreferencesRef.h:
279
280 2019-09-17  Chris Dumez  <cdumez@apple.com>
281
282         REGRESSION (r249923): ASSERTION FAILED: sessionID == WebProcess::singleton().sessionID() in WebCore::SWClientConnection *WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession(PAL::SessionID)
283         https://bugs.webkit.org/show_bug.cgi?id=201859
284         <rdar://problem/55426742>
285
286         Reviewed by Alex Christensen.
287
288         Drop support for the WKPreferencesSetPrivateBrowsingEnabled() C API (Mark as deprecated and make it a no-op) as it
289         was changing a WebContent process's sessionID, which is no longer supported. This was also using the legacy private
290         browsing session, which we're trying to get rid of. There is suitable C API to do private browsing (WKWebsiteDataStoreRef).
291
292         * Shared/WebPreferences.yaml:
293         * UIProcess/API/C/WKPreferences.cpp:
294         (WKPreferencesSetPrivateBrowsingEnabled):
295         (WKPreferencesGetPrivateBrowsingEnabled):
296         * UIProcess/API/C/WKPreferencesRef.h:
297         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
298         (WKPageIsURLKnownHSTSHost):
299         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
300         (WebKit::WebProcessPool::isURLKnownHSTSHost const):
301         * UIProcess/WebPreferences.cpp:
302         (WebKit::WebPreferences::addPage):
303         (WebKit::WebPreferences::removePage):
304         (WebKit::WebPreferences::updateBoolValueForKey):
305         * UIProcess/WebPreferences.h:
306         * UIProcess/WebProcessPool.cpp:
307         (WebKit::WebProcessPool::ensureNetworkProcess):
308         * UIProcess/WebProcessPool.h:
309         * WebProcess/WebPage/WebPage.cpp:
310         (WebKit::WebPage::updatePreferences):
311
312 2019-09-17  Chris Dumez  <cdumez@apple.com>
313
314         REGRESSION (iOS 13): rAF stops firing when navigating away cross-origin and then back
315         https://bugs.webkit.org/show_bug.cgi?id=201767
316         <rdar://problem/55350854>
317
318         Reviewed by Geoffrey Garen.
319
320         When navigating back and restoring a SuspendedPage, WebPage::reinitializeWebPage() ends up
321         reconstructing a new DrawingArea to match the identifier of the DrawingAreaProxy that the
322         UIProcess created. The issue is that when reconstructing the DrawingArea, we were losing
323         the DisplayRefreshMonitors that had been registered on the previous drawing area. To
324         address the issue, we now make sure to transfer the DisplayRefreshMonitors over from the
325         old to the new drawing area. This patch is kept as small as possible to faciliate cherry
326         picking to a branch. However, I think we should consider refactoring the code so that
327         we no longer need to re-create the DrawingArea in the WebProcess in this case.
328
329         * WebProcess/WebPage/DrawingArea.h:
330         (WebKit::DrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
331         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
332         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
333         (WebKit::RemoteLayerTreeDrawingArea::adoptDisplayRefreshMonitorsFromDrawingArea):
334         * WebProcess/WebPage/WebPage.cpp:
335         (WebKit::WebPage::reinitializeWebPage):
336
337 2019-09-17  Truitt Savell  <tsavell@apple.com>
338
339         Unreviewed, rolling out r249950.
340
341         Broke the iOS build.
342
343         Reverted changeset:
344
345         "Remove the "Show Link Previews" and "Hide Link Previews"
346         action menus in the preview platter"
347         https://bugs.webkit.org/show_bug.cgi?id=201864
348         https://trac.webkit.org/changeset/249950
349
350 2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
351
352         [GTK] Initial view loading is slow
353         https://bugs.webkit.org/show_bug.cgi?id=201451
354
355         Reviewed by Sergio Villar Senin.
356
357         The problem is that now we are always calling DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() after a
358         new process is launched and we used to do that only when launching a new process after a crash. This makes
359         m_hasReceivedFirstUpdate useless, because it's always set to true right after a process is launched. Then, we
360         wait up to half a second (which is usually the case for the initial load) until the first update. We only want
361         to do that when recovering from a crash or when swapping processes to avoid flashing effect.
362
363         * UIProcess/WebPageProxy.cpp:
364         (WebKit::WebPageProxy::launchProcess): Add ProcessLaunchReason parameter and pass it to
365         finishAttachingToWebProcess instead of IsProcessSwap.
366         (WebKit::WebPageProxy::swapToWebProcess): Pass ProcessLaunchReason::ProcessSwap to
367         finishAttachingToWebProcess().
368         (WebKit::WebPageProxy::finishAttachingToWebProcess): Do not call
369         DrawingAreaProxy::waitForBackingStoreUpdateOnNextPaint() when process launch reason is ProcessLaunchReason::InitialProcess.
370         (WebKit::WebPageProxy::launchProcessForReload): Pass ProcessLaunchReason::Reload to launchProcess().
371         * UIProcess/WebPageProxy.h: Remove IsProcessSwap and add ProcessLaunchReason instead that is passed to
372         launchProcess and finishAttachingToWebProcess.
373
374 2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
375
376         REGRESSION(r249275): [GTK][WPE] WebPage injected bundle messages no longer work
377         https://bugs.webkit.org/show_bug.cgi?id=201865
378
379         Reviewed by Žan Doberšek.
380
381         We use them to implement the web resources API. This is another regression of r249275 because we are using the
382         page proxy identifier when we really want to the web page identifier.
383
384         * UIProcess/API/glib/WebKitWebContext.cpp:
385         (webkitWebContextGetWebViewForPage): Use WebPageProxy::webPageID() instead of WebPageProxy::identifier().
386
387 2019-09-17  Dean Jackson  <dino@apple.com>
388
389         Remove the "Show Link Previews" and "Hide Link Previews" action menus in the preview platter
390         https://bugs.webkit.org/show_bug.cgi?id=201864
391         <rdar://55190038>
392
393         Reviewed by Simon Fraser.
394
395         * UIProcess/ios/WKActionSheetAssistant.mm: Remove the toggle action from the
396         default values.
397         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
398         * UIProcess/ios/WKContentViewInteraction.mm: No longer try to add a toggle when
399         it isn't there.
400         (-[WKContentView assignLegacyDataForContextMenuInteraction]):
401         (menuWithShowLinkPreviewAction): Deleted.
402
403 2019-09-17  Jiewen Tan  <jiewen_tan@apple.com>
404
405         [WebAuthn] Use WebPreferences instead of RuntimeEnabledFeatures in UIProcess
406         https://bugs.webkit.org/show_bug.cgi?id=198176
407         <rdar://problem/55285709>
408
409         Reviewed by Youenn Fablet.
410
411         This patch does the following two things:
412         1) It merges WebAuthenticationRequestData::creationOptions and requestOptions into a variant, and therefore
413         merges code paths that involve WebAuthenticationRequestData.
414         2) It teaches WebAuthenticationRequestData to store a WebPreferences such that AuthenticatorManager could utilize
415         runtime feature flags to turn features on or off.
416
417         * UIProcess/WebAuthentication/Authenticator.cpp:
418         (WebKit::Authenticator::handleRequest):
419         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
420         (WebKit::AuthenticatorManager::handleRequest):
421         (WebKit::AuthenticatorManager::clearState):
422         (WebKit::AuthenticatorManager::authenticatorAdded):
423         (WebKit::AuthenticatorManager::startDiscovery):
424         (WebKit::AuthenticatorManager::makeCredential): Deleted.
425         (WebKit::AuthenticatorManager::getAssertion): Deleted.
426         * UIProcess/WebAuthentication/AuthenticatorManager.h:
427         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
428         (WebKit::LocalAuthenticator::makeCredential):
429         (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
430         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
431         (WebKit::LocalAuthenticator::getAssertion):
432         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
433         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
434         (WebKit::LocalService::isAvailable):
435         Don't check RuntimeEnabledFeatures given it is for WebCore.
436         * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
437         (): Deleted.
438         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
439         (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
440         (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
441         (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest):
442         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
443         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
444         (WebKit::CtapAuthenticator::makeCredential):
445         (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const):
446         (WebKit::CtapAuthenticator::getAssertion):
447         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
448         (WebKit::U2fAuthenticator::makeCredential):
449         (WebKit::U2fAuthenticator::checkExcludeList):
450         (WebKit::U2fAuthenticator::issueRegisterCommand):
451         (WebKit::U2fAuthenticator::getAssertion):
452         (WebKit::U2fAuthenticator::issueSignCommand):
453         (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):
454         (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived):
455
456 2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
457
458         Keeps running obsolete WebProcess-es for too long
459         https://bugs.webkit.org/show_bug.cgi?id=201492
460
461         Reviewed by Chris Dumez.
462
463         That's how the web process cache is expected to work, but it's true that it probably only makes sense to use it
464         when cache model is primary web browser.
465
466         * UIProcess/WebProcessCache.cpp:
467         (WebKit::WebProcessCache::updateCapacity): Disable the web process cache when cache model is not primary web browser.
468
469 2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
470
471         [GTK] Crash closing web view while hardware acceleration is enabled
472         https://bugs.webkit.org/show_bug.cgi?id=200856
473
474         Reviewed by Michael Catanzaro.
475
476         The crash happens when destroying the WaylandCompositor::Surface because the web view GL context is used to
477         release the texture, but the GL context is no longer valid after web view
478         unrealize. AcceleratedBackingStoreWayland should handle the web view unrealize to destroy the GL context. It
479         will be created on demand again after the web view is realized.
480
481         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
482         (webkitWebViewBaseRealize): Notify AcceleratedBackingStore.
483         (webkitWebViewBaseUnrealize): Ditto.
484         * UIProcess/gtk/AcceleratedBackingStore.h:
485         (WebKit::AcceleratedBackingStore::realize): Added.
486         (WebKit::AcceleratedBackingStore::unrealize): Added.
487         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
488         (WebKit::AcceleratedBackingStoreWayland::realize): In case of using WaylandCompositor, call
489         WaylandCompositor::bindWebPage() to bind the WebPageProxy to the Wayland surface.
490         (WebKit::AcceleratedBackingStoreWayland::unrealize): Destroy GL resources and the GL context.
491         (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Do not try to create the GL context if the web
492         view is not realized.
493         (WebKit::AcceleratedBackingStoreWayland::displayBuffer): Remove the code to initialize the texture.
494         (WebKit::AcceleratedBackingStoreWayland::paint): And add it here.
495         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
496         * UIProcess/gtk/WaylandCompositor.cpp:
497         (WebKit::WaylandCompositor::Surface::setWebPage): Return early if given page is the current one already.
498         (WebKit::WaylandCompositor::bindWebPage): Set the surface WebPageProxy.
499         (WebKit::WaylandCompositor::unbindWebPage): Unset the surface WebPageProxy.
500         * UIProcess/gtk/WaylandCompositor.h:
501         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
502         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): When restoring a previous layer tree
503         host, always call resumeRendering() to balance the suspendRendering() called in exitAcceleratedCompositingMode().
504
505 2019-09-16  Ryan Haddad  <ryanhaddad@apple.com>
506
507         Unreviewed, rolling out r249910.
508
509         Caused layout test failures and timeouts on Catalina
510
511         Reverted changeset:
512
513         "REGRESSION(249649): Unable to open local files in MiniBrowser
514         on macOS"
515         https://bugs.webkit.org/show_bug.cgi?id=201798
516         https://trac.webkit.org/changeset/249910
517
518 2019-09-16  Chris Dumez  <cdumez@apple.com>
519
520         Drop sessionID / websiteDataStoreID from WebPageCreationParameters
521         https://bugs.webkit.org/show_bug.cgi?id=201847
522
523         Reviewed by Youenn Fablet.
524
525         Drop sessionID / websiteDataStoreID from WebPageCreationParameters now that we have
526         one session per WebProcess.
527
528         * Shared/WebPageCreationParameters.cpp:
529         (WebKit::WebPageCreationParameters::encode const):
530         (WebKit::WebPageCreationParameters::decode):
531         * Shared/WebPageCreationParameters.h:
532         (WebKit::WebPageCreationParameters::WebPageCreationParameters): Deleted.
533         * UIProcess/WebPageProxy.cpp:
534         (WebKit::WebPageProxy::creationParameters):
535         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
536         (WebKit::WebChromeClient::createWindow):
537         * WebProcess/WebPage/WebPage.cpp:
538         (WebKit::m_textAutoSizingAdjustmentTimer):
539         * WebProcess/WebProcess.cpp:
540         (WebKit::WebProcess::createWebPage):
541
542 2019-09-16  Dean Jackson  <dino@apple.com>
543
544         Provide a prototype for AR QuickLook to trigger processing in the originating page
545         https://bugs.webkit.org/show_bug.cgi?id=201371
546
547         Hopefully fix the public iOS 13 build.
548
549         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
550
551 2019-09-16  David Kilzer  <ddkilzer@apple.com>
552
553         [WebAuthn] Name instance variables consistently in WKMockNFTag
554         <https://webkit.org/b/201845>
555
556         Reviewed by Jiewen Tan.
557
558         * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
559         Make all @synthesize instance variables use a leading underscore
560         for their name.
561
562 2019-09-16  Dean Jackson  <dino@apple.com>
563
564         REGRESSION: iPad: Safari becomes unresponsive after context menu on 1-800-MY-APPLE phone number, tapping 'Add to Contacts'
565         https://bugs.webkit.org/show_bug.cgi?id=201816
566         <rdar://55105827>
567
568         Reviewed by Darin Adler.
569
570         When generating the DataDetectorsContext for a position, we should
571         also provide the source rectangle for the link in root view coordinates.
572         This allows DataDetectors to show any modal dialogs in the right
573         position.
574
575         * UIProcess/ios/WKContentViewInteraction.mm: Use either the bounds of the positionInformation
576         or the text bounding rectangle.
577         (-[WKContentView dataDetectionContextForPositionInformation:]):
578
579 2019-09-16  Chris Dumez  <cdumez@apple.com>
580
581         NetworkProcessConnection does not need HashMaps of sessionIDs for Service Workers and IDB
582         https://bugs.webkit.org/show_bug.cgi?id=201830
583
584         Reviewed by Geoffrey Garen.
585
586         NetworkProcessConnection does not need HashMaps of sessionIDs for Service Workers and IDB, since
587         we now have one sessionID per WebContent process.
588
589         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
590         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
591         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
592         (WebKit::WebIDBConnectionToServer::create):
593         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
594         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
595         * WebProcess/Databases/WebDatabaseProvider.cpp:
596         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
597         * WebProcess/Network/NetworkProcessConnection.cpp:
598         (WebKit::NetworkProcessConnection::didReceiveMessage):
599         (WebKit::NetworkProcessConnection::didClose):
600         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
601         (WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
602         * WebProcess/Network/NetworkProcessConnection.h:
603         (WebKit::NetworkProcessConnection::existingIDBConnectionToServer const):
604         (WebKit::NetworkProcessConnection::existingServiceWorkerConnectionForSession):
605         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
606         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
607         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
608         (WebKit::WebServiceWorkerProvider::handleFetch):
609         * WebProcess/WebProcess.cpp:
610         (WebKit::WebProcess::networkProcessConnectionClosed):
611
612 2019-09-16  Brent Fulgham  <bfulgham@apple.com>
613
614         [FTW] Correct lifespan of other SharedBitmaps
615         https://bugs.webkit.org/show_bug.cgi?id=201800
616
617         Reviewed by Dean Jackson.
618
619         The pop-up menu code creates its own SharedBitmap in the WebContent process,
620         which needs to release its handle before destruction, otherwise the UIProcess
621         will be unable to access the GPU texture (since it will have been cleaned up).
622
623         Since WebPopupMenuProxyWin has its own HWND and WinProc, it needs its own
624         swapChain to handle syncing of content to the screen.
625
626         This patch also audits other uses of SharedBitmap to make sure a similar
627         problem doesn't exist elsewhere.
628
629         * Shared/ShareableBitmap.h:
630         * Shared/win/ShareableBitmapDirect2D.cpp:
631         (WebKit::ShareableBitmap::paint):
632         (WebKit::ShareableBitmap::createDirect2DSurface):
633         * UIProcess/win/WebPopupMenuProxyWin.cpp:
634         (WebKit::WebPopupMenuProxyWin::showPopupMenu): Add Direct2D code paths.
635         (WebKit::WebPopupMenuProxyWin::paint): Update for Direct2D.
636         (WebKit::WebPopupMenuProxyWin::setupSwapChain): Added.
637         (WebKit::WebPopupMenuProxyWin::configureBackingStore): Added.
638         * UIProcess/win/WebPopupMenuProxyWin.h:
639         * UIProcess/win/WebView.cpp:
640         (WebKit::WebView::setupSwapChain): Move some implementation code to the
641         Direct2DUtilities file.
642         * UIProcess/win/WebView.h:
643         (WebKit::WebView::d3dDevice const):
644         (WebKit::WebView::d3dImmediateContext const):
645         (WebKit::WebView::d3dDevice): Deleted.
646         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
647         (WebKit::WebPopupMenu::show):
648         * WebProcess/WebPage/FindController.cpp:
649         (WebKit::FindController::getImageForFindMatch): Prevent WebContent process from
650         destroying SharedBitmap before the UIProcess can receive it.
651
652 2019-09-16  Chris Dumez  <cdumez@apple.com>
653
654         Simplify WebResourceLoadObserver now that we have one WebProcess per session
655         https://bugs.webkit.org/show_bug.cgi?id=201821
656
657         Reviewed by Brent Fulgham.
658
659         Simplify WebResourceLoadObserver now that we have one WebProcess per session.
660         No need to pass sessionIDs around or store statistics per sessionID.
661         Also, only initialize the WebResourceLoadObserver if both ITP is enabled and
662         we're not in a WebContent process used for an ephemeral session.
663
664         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
665         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
666         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
667         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
668         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
669         * NetworkProcess/NetworkConnectionToWebProcess.h:
670         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
671         * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
672         (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
673         (WebKit::WebResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
674         (WebKit::WebResourceLoadObserver::scheduleNotificationIfNeeded):
675         (WebKit::WebResourceLoadObserver::statisticsForURL):
676         (WebKit::WebResourceLoadObserver::takeStatistics):
677         (WebKit::WebResourceLoadObserver::clearState):
678         (WebKit::WebResourceLoadObserver::logFontLoad):
679         (WebKit::WebResourceLoadObserver::logCanvasRead):
680         (WebKit::WebResourceLoadObserver::logCanvasWriteOrMeasure):
681         (WebKit::WebResourceLoadObserver::logNavigatorAPIAccessed):
682         (WebKit::WebResourceLoadObserver::logScreenAPIAccessed):
683         (WebKit::WebResourceLoadObserver::logSubresourceLoading):
684         (WebKit::WebResourceLoadObserver::logWebSocketLoading):
685         (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
686         * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
687         * WebProcess/WebProcess.cpp:
688         (WebKit::WebProcess::setWebsiteDataStoreParameters):
689
690 2019-09-16  David Kilzer  <ddkilzer@apple.com>
691
692         Fix build failure in MockNfcService.mm
693         <https://webkit.org/b/201839>
694
695         Reviewed by Brady Eidson.
696
697         * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
698         Specify instance variable names for @synthesized variables that
699         need to be manually released in -dealloc under MRR.
700
701 2019-09-16  Per Arne Vollan  <pvollan@apple.com>
702
703         REGRESSION(249649): Unable to open local files in MiniBrowser on macOS
704         https://bugs.webkit.org/show_bug.cgi?id=201798
705
706         Reviewed by Brent Fulgham.
707
708         The commit <https://trac.webkit.org/changeset/249649> introduced a MiniBrowser regression on macOS where
709         MiniBrowser is not able to open local files. The change set r249649 fixed a problem where the WebContent
710         process PID was not ready to be used when creating a sandbox extension. This happened in the cases where
711         the WebContent process had not finished launching when the load started. The WebContent process is also
712         creating sandbox extensions for the Networking process for the files being loaded, and also needs to be
713         passing the PID of the Networking process when creating these. This patch is addressing this by getting
714         the PID of the Networking process when the WebContent process is initially getting the connection to the
715         Networking process. The PID is then stored in the NetworkProcessConnection class, from where it is passed
716         to the NetworkLoadParameters, and used when creating the sandbox extension for the Networking process.
717
718         * NetworkProcess/NetworkLoadParameters.h:
719         * NetworkProcess/NetworkResourceLoadParameters.cpp:
720         (WebKit::NetworkResourceLoadParameters::encode const):
721         * UIProcess/Network/NetworkProcessProxy.cpp:
722         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
723         (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
724         (WebKit::NetworkProcessProxy::networkProcessCrashed):
725         (WebKit::NetworkProcessProxy::didFinishLaunching):
726         * UIProcess/WebPageProxy.cpp:
727         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
728         * UIProcess/WebProcessProxy.messages.in:
729         * WebProcess/Network/NetworkProcessConnection.cpp:
730         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
731         * WebProcess/Network/NetworkProcessConnection.h:
732         (WebKit::NetworkProcessConnection::create):
733         (WebKit::NetworkProcessConnection::networkProcessPID const):
734         * WebProcess/Network/WebLoaderStrategy.cpp:
735         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
736         * WebProcess/WebProcess.cpp:
737         (WebKit::getNetworkProcessConnection):
738         (WebKit::WebProcess::ensureNetworkProcessConnection):
739
740 2019-09-16  David Kilzer  <ddkilzer@apple.com>
741
742         [WebAuthn] REGRESSION (r249059): Leak of WKMockNFTag objects and WKMockNFTag instance variables
743         <https://webkit.org/b/201813>
744
745         Reviewed by Darin Adler.
746
747         * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
748         (-[WKMockNFTag dealloc]): Add method and release instance
749         variables to fix leaks.
750         (WebKit::MockNfcService::detectTags const): Use adoptNS() to fix
751         leaks of WKMockNFTag objects.
752
753 2019-09-16  David Kilzer  <ddkilzer@apple.com>
754
755         REGRESSION (r243113): Leak of multiple instance variable blocks when deallocating _WKAttributedStringNavigationDelegate
756         <https://webkit.org/b/201812>
757
758         Reviewed by Timothy Hatcher.
759
760         * UIProcess/API/Cocoa/NSAttributedString.mm:
761         (-[_WKAttributedStringNavigationDelegate dealloc]): Add method
762         to release instance variable blocks to fix potential leaks.
763
764 2019-09-16  Adrian Perez de Castro  <aperez@igalia.com>
765
766         Unreviewed build fix.
767
768         * NetworkProcess/NetworkConnectionToWebProcess.h: Add missing forward
769         declaration of the NetworkSession class.
770
771 2019-09-16  Chris Dumez  <cdumez@apple.com>
772
773         Store sessionID on the NetworkConnectionToWebProcess now that there is one session per WebProcess
774         https://bugs.webkit.org/show_bug.cgi?id=201789
775
776         Reviewed by Alex Christensen.
777
778         Store sessionID on the NetworkConnectionToWebProcess now that there is one session per WebProcess.
779         As a result, we no longer need to pass the sessionID in each IPC from the WebProcess to the
780         NetworkProcess.
781
782         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
783         (WebKit::NetworkConnectionToWebProcess::create):
784         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
785         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
786         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
787         (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
788         (WebKit::NetworkConnectionToWebProcess::didClose):
789         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
790         (WebKit::NetworkConnectionToWebProcess::createSocketChannel):
791         (WebKit::NetworkConnectionToWebProcess::networkSession):
792         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
793         (WebKit::NetworkConnectionToWebProcess::storageSession):
794         (WebKit::NetworkConnectionToWebProcess::startDownload):
795         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
796         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
797         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
798         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
799         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
800         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
801         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
802         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
803         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
804         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
805         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
806         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
807         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
808         (WebKit::NetworkConnectionToWebProcess::blobSize):
809         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
810         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
811         (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
812         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
813         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
814         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
815         (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
816         (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
817         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
818         (WebKit::NetworkConnectionToWebProcess::unregisterSWConnection):
819         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
820         (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
821         * NetworkProcess/NetworkConnectionToWebProcess.h:
822         (WebKit::NetworkConnectionToWebProcess::sessionID const):
823         (WebKit::NetworkConnectionToWebProcess::startDownload):
824         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
825         * NetworkProcess/NetworkProcess.cpp:
826         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
827         * NetworkProcess/NetworkProcess.h:
828         * NetworkProcess/NetworkProcess.messages.in:
829         * NetworkProcess/NetworkResourceLoader.cpp:
830         (WebKit::NetworkResourceLoader::start):
831         * UIProcess/Network/NetworkProcessProxy.cpp:
832         (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
833         * UIProcess/WebProcessProxy.cpp:
834         (WebKit::WebProcessProxy::sessionID const):
835         * UIProcess/WebProcessProxy.h:
836         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
837         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
838         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
839         (WebKit::BlobRegistryProxy::registerFileBlobURL):
840         (WebKit::BlobRegistryProxy::registerBlobURL):
841         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
842         (WebKit::BlobRegistryProxy::unregisterBlobURL):
843         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
844         (WebKit::BlobRegistryProxy::blobSize):
845         * WebProcess/Network/NetworkProcessConnection.cpp:
846         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
847         * WebProcess/Network/WebSocketChannel.cpp:
848         (WebKit::WebSocketChannel::connect):
849         * WebProcess/Network/WebSocketStream.cpp:
850         (WebKit::WebSocketStream::WebSocketStream):
851         * WebProcess/Storage/WebSWClientConnection.cpp:
852         (WebKit::WebSWClientConnection::WebSWClientConnection):
853         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
854         (WebKit::m_userAgent):
855         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
856         (WebKit::WebFrameLoaderClient::detachedFromParent2):
857         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
858         * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
859         (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
860         (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
861         * WebProcess/WebPage/WebCookieJar.cpp:
862         (WebKit::WebCookieJar::cookies const):
863         (WebKit::WebCookieJar::setCookies):
864         (WebKit::WebCookieJar::cookiesEnabled const):
865         (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
866         (WebKit::WebCookieJar::getRawCookies const):
867         (WebKit::WebCookieJar::deleteCookie):
868         * WebProcess/WebPage/WebFrame.cpp:
869         (WebKit::WebFrame::startDownload):
870         (WebKit::WebFrame::convertMainResourceLoadToDownload):
871         * WebProcess/WebPage/WebPage.cpp:
872         (WebKit::WebPage::close):
873         (WebKit::WebPage::hasStorageAccess):
874         (WebKit::WebPage::requestStorageAccess):
875         * WebProcess/WebProcess.cpp:
876         (WebKit::WebProcess::createWebPage):
877         (WebKit::WebProcess::removeWebPage):
878         * WebProcess/WebProcess.h:
879         (WebKit::WebProcess::sessionID const):
880
881 2019-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
882
883         REGRESSION(r249142): [GTK] Epiphany delayed page loads continue indefinitely
884         https://bugs.webkit.org/show_bug.cgi?id=201544
885
886         Reviewed by Michael Catanzaro.
887
888         WebPageProxy::loadAlternateHTML() is an exception, because it's an API request but always sets the navigationID
889         to 0. We always want to reset the pending API request URL when alternate HTML load starts.
890
891         * UIProcess/WebPageProxy.cpp:
892         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Check also that it's an API alternate HTML load
893         to reset the pending API request URL.
894
895 2019-09-15  David Kilzer  <ddkilzer@apple.com>
896
897         REGRESSION (r248592): Leak of CFDictionaryRef in WebKit::NetworkRTCProvider::proxyInfoFromSession()
898         <https://webkit.org/b/201811>
899
900         Reviewed by Youenn Fablet.
901
902         * NetworkProcess/webrtc/NetworkRTCProvider.mm:
903         (WebKit::NetworkRTCProvider::proxyInfoFromSession): Use
904         RetainPtr<> to fix the leak.
905
906 2019-09-14  Adrian Perez de Castro  <aperez@igalia.com>
907
908         [GTK][WPE] Check for a Snap sandbox a bit harder
909         https://bugs.webkit.org/show_bug.cgi?id=201793
910
911         Reviewed by Michael Catanzaro.
912
913         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
914         (WebKit::isInsideSnap): Check whether the SNAP_NAME and SNAP_REVISION
915         environment variables are defined as well.
916
917 2019-09-14  Youenn Fablet  <youenn@apple.com>
918
919         Add release logging in WebLoaderStrategy to check that a load is going through service worker
920         https://bugs.webkit.org/show_bug.cgi?id=201761
921
922         Reviewed by Chris Dumez.
923
924         This allows identifying whether a load remains pending on the service worker fetch path.
925
926         * WebProcess/Network/WebLoaderStrategy.cpp:
927         (WebKit::WebLoaderStrategy::scheduleLoad):
928
929 2019-09-13  Youenn Fablet  <youenn@apple.com>
930
931         [MacOS/iOS] imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html is sometimes crashing in Debug
932         https://bugs.webkit.org/show_bug.cgi?id=201686
933
934         Reviewed by Alexey Proskuryakov.
935
936         A load might be cancelled shortly after being started in network process.
937         In that case, NetworkDataTaskCocoa might be destroyed, thus removed from the ID to task map
938         but some handlers might still be called until the NSURLSessionTask is finished cancelling.
939         This happens for authentication challenges.
940         In case where the NSURLSessionTask is cancelling, return early instead of processing the challenge.
941
942         Covered by LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https.html and LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https.html no longer crashing in debug.
943
944         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
945         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
946
947 2019-09-11  Dean Jackson  <dino@apple.com>
948
949         Provide a prototype for AR QuickLook to trigger processing in the originating page
950         https://bugs.webkit.org/show_bug.cgi?id=201371
951         <rdar://54904781>
952
953         Reviewed by Simon Fraser.
954
955         Provide a way for a Web page to know if an action in the AR scene
956         was performed, if and only if the system AR library calls a delegate with
957         particular parameters. Post a message to the originating frame so
958         the page can detect the action.
959
960         * Scripts/webkit/messages.py: Include the right header for SystemPreviewInfo.
961
962         * Shared/WebCoreArgumentCoders.cpp: Use SystemPreviewInfo.
963         (IPC::ArgumentCoder<ResourceRequest>::encode):
964         (IPC::ArgumentCoder<ResourceRequest>::decode):
965
966         * UIProcess/API/Cocoa/WKWebView.mm:
967         (-[WKWebView _triggerSystemPreviewActionOnFrame:page:]): New helper/test function
968         to trigger the system preview action.
969         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
970
971         * UIProcess/Cocoa/DownloadClient.mm: Use new type.
972         (WebKit::DownloadClient::didStart):
973
974         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the delegate so that
975         we can detect an action. When it happens, tell the WebPageProxy to send a message.
976
977         * UIProcess/Downloads/DownloadProxy.h: Use SystemPreviewInfo type.
978         (WebKit::DownloadProxy::systemPreviewDownloadInfo const):
979         (WebKit::DownloadProxy::systemPreviewDownloadRect const): Deleted.
980
981         * UIProcess/SystemPreviewController.h:
982         (WebKit::SystemPreviewController::previewInfo const):
983
984         * UIProcess/WebPageProxy.cpp: Send it over to the Web Process.
985         (WebKit::WebPageProxy::systemPreviewActionTriggered const):
986         * UIProcess/WebPageProxy.h:
987
988         * WebProcess/WebPage/WebPage.cpp: Check the destination still exists, and then talk
989         to the Document.
990         (WebKit::WebPage::systemPreviewActionTriggered):
991         * WebProcess/WebPage/WebPage.h:
992         * WebProcess/WebPage/WebPage.messages.in:
993
994 2019-09-13  Youenn Fablet  <youenn@apple.com>
995
996         Partition processes running service workers by session ID
997         https://bugs.webkit.org/show_bug.cgi?id=201643
998
999         Reviewed by Chris Dumez.
1000
1001         Remove the management of server context connections from NetworkProcess.
1002         The WebProcessPool service worker process map is now keyed by both registrable domain and sessionID.
1003         Update WebProcessPool to only expose the number of service worker processes instead of the full map.
1004
1005         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1006         (WebKit::NetworkConnectionToWebProcess::didClose):
1007         (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
1008         * NetworkProcess/NetworkConnectionToWebProcess.h:
1009         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1010         * NetworkProcess/NetworkProcess.cpp:
1011         (WebKit::NetworkProcess::swServerForSession):
1012         * NetworkProcess/NetworkProcess.h:
1013         (WebKit::NetworkProcess::swServerForSessionIfExists):
1014         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1015         (WebKit::WebSWServerConnection::startFetch):
1016         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
1017         (WebKit::WebSWServerConnection::scheduleJobInServer):
1018         (WebKit::WebSWServerConnection::updateThrottleState):
1019         (WebKit::WebSWServerConnection::contextConnectionCreated):
1020         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1021         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1022         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
1023         (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
1024         (WebKit::WebSWServerToContextConnection::connectionIsNoLongerNeeded):
1025         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
1026         * UIProcess/API/Cocoa/WKProcessPool.mm:
1027         (-[WKProcessPool _webPageContentProcessCount]):
1028         (-[WKProcessPool _serviceWorkerProcessCount]):
1029         * UIProcess/WebProcessPool.cpp:
1030         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
1031         (WebKit::WebProcessPool::disconnectProcess):
1032         * UIProcess/WebProcessPool.h:
1033         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1034         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
1035         (WebKit::m_userAgent):
1036         * WebProcess/Storage/WebSWContextManagerConnection.h:
1037         * WebProcess/WebProcess.cpp:
1038         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
1039
1040 2019-09-13  Alex Christensen  <achristensen@webkit.org>
1041
1042         AuxiliaryProcessProxy::sendWithAsyncReply should queue up messages if sent while the process is starting like it does messages without replies
1043         https://bugs.webkit.org/show_bug.cgi?id=201746
1044
1045         Reviewed by Youenn Fablet.
1046
1047         * UIProcess/AuxiliaryProcessProxy.cpp:
1048         (WebKit::AuxiliaryProcessProxy::sendMessage):
1049         (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
1050         * UIProcess/AuxiliaryProcessProxy.h:
1051         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
1052
1053 2019-09-13  Youenn Fablet  <youenn@apple.com>
1054
1055         Use WebProcess processIdentifier to identify Service Worker connections
1056         https://bugs.webkit.org/show_bug.cgi?id=201459
1057
1058         Reviewed by Chris Dumez.
1059
1060         Make WebSWServerConnection be stored in NetworkConnectionToWebProcess.
1061         They are now keyed by session IDs hence why WebSWClientConnection is using the session ID as message connection ID.
1062         Creation no longer requires a sync IPC since the connection is uniquely identified by its session ID and its process ID.
1063         These IDs are stable over network process crash.
1064         Within NetworkProcess, a server connection is managed by a SWServer which is session ID specific.
1065         In that case, the process identifier uniquely identifies the connection.
1066
1067         Move WebSWServerToContextConnection be owned by NetworkConnectionToWebProcess.
1068         Instead of creating it when webprocess is connecting to network process, use a dedicated IPC message.
1069         This is similar to WebSWServerConnection once WebProcess asks to create it.
1070         This will allow existing WebProcess, in cache or running pages, to run service workers as well.
1071         A context connection map is kept in Network Process to reuse context connections since these connections are not sessionID specific.
1072
1073         Migrate from a single boolean to a HashSet to track whether some connections are in the process of being created.
1074         Previously if two requests to create connections were done shortly one after the other on different registrable
1075         domains, the second request would not be processed.
1076
1077         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1078         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1079         (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
1080         (WebKit::NetworkConnectionToWebProcess::didClose):
1081         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
1082         (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
1083         * NetworkProcess/NetworkConnectionToWebProcess.h:
1084         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1085         * NetworkProcess/NetworkProcess.cpp:
1086         (WebKit::NetworkProcess::didReceiveMessage):
1087         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1088         (WebKit::NetworkProcess::forEachSWServer):
1089         (WebKit::NetworkProcess::needsServerToContextConnectionForRegistrableDomain const):
1090         (WebKit::NetworkProcess::createServerToContextConnection):
1091         (WebKit::NetworkProcess::postMessageToServiceWorkerClient):
1092         (WebKit::NetworkProcess::registerSWServerConnection):
1093         (WebKit::NetworkProcess::unregisterSWServerConnection):
1094         (WebKit::NetworkProcess::registerSWContextConnection):
1095         (WebKit::NetworkProcess::unregisterSWContextConnection):
1096         * NetworkProcess/NetworkProcess.h:
1097         * NetworkProcess/NetworkProcess.messages.in:
1098         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1099         (WebKit::WebSWServerConnection::WebSWServerConnection):
1100         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1101         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1102         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1103         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
1104         (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
1105         (WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient):
1106         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
1107         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
1108         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1109         * UIProcess/Network/NetworkProcessProxy.cpp:
1110         (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
1111         (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
1112         * UIProcess/Network/NetworkProcessProxy.h:
1113         * UIProcess/Network/NetworkProcessProxy.messages.in:
1114         * UIProcess/WebProcessPool.cpp:
1115         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
1116         * UIProcess/WebProcessPool.h:
1117         * UIProcess/WebProcessProxy.cpp:
1118         (WebKit::WebProcessProxy::establishServiceWorkerContext):
1119         * UIProcess/WebProcessProxy.h:
1120         * WebProcess/Network/NetworkProcessConnection.cpp:
1121         (WebKit::NetworkProcessConnection::didReceiveMessage):
1122         (WebKit::NetworkProcessConnection::didClose):
1123         (WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
1124         * WebProcess/Network/NetworkProcessConnection.h:
1125         * WebProcess/Storage/WebSWClientConnection.cpp:
1126         (WebKit::WebSWClientConnection::WebSWClientConnection):
1127         (WebKit::WebSWClientConnection::~WebSWClientConnection):
1128         (WebKit::WebSWClientConnection::messageSenderConnection const):
1129         (WebKit::WebSWClientConnection::scheduleJobInServer):
1130         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
1131         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
1132         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
1133         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
1134         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1135         (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
1136         (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
1137         (WebKit::WebSWClientConnection::matchRegistration):
1138         (WebKit::WebSWClientConnection::runOrDelayTaskForImport):
1139         (WebKit::WebSWClientConnection::whenRegistrationReady):
1140         (WebKit::WebSWClientConnection::getRegistrations):
1141         (WebKit::WebSWClientConnection::startFetch):
1142         (WebKit::WebSWClientConnection::cancelFetch):
1143         (WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
1144         (WebKit::WebSWClientConnection::connectionToServerLost):
1145         (WebKit::WebSWClientConnection::clear):
1146         (WebKit::WebSWClientConnection::syncTerminateWorker):
1147         (WebKit::WebSWClientConnection::updateThrottleState):
1148         (WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting):
1149         * WebProcess/Storage/WebSWClientConnection.h:
1150         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1151         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
1152         (WebKit::m_userAgent):
1153         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
1154         * WebProcess/Storage/WebSWContextManagerConnection.h:
1155         * WebProcess/WebProcess.cpp:
1156         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
1157         * WebProcess/WebProcess.h:
1158         * WebProcess/WebProcess.messages.in:
1159
1160 2019-09-12  Ryan Haddad  <ryanhaddad@apple.com>
1161
1162         Unreviewed, rolling out r249801.
1163
1164         Caused two servier worker layout tests to become flaky.
1165
1166         Reverted changeset:
1167
1168         "Use WebProcess processIdentifier to identify Service Worker
1169         connections"
1170         https://bugs.webkit.org/show_bug.cgi?id=201459
1171         https://trac.webkit.org/changeset/249801
1172
1173 2019-09-12  Chris Dumez  <cdumez@apple.com>
1174
1175         Pass sessionID to WebProcess with other WebProcessDataStoreParameters
1176         https://bugs.webkit.org/show_bug.cgi?id=201730
1177
1178         Reviewed by Alex Christensen.
1179
1180         Pass sessionID to WebProcess with other WebProcessDataStoreParameters and store
1181         it on the WebProcess object. In follow-up patches, I will use this sessionID
1182         more and leverage the fact that we have one sessionID per Webprocess to simplify
1183         the WebKit2-layer code.
1184
1185         * Shared/WebProcessCreationParameters.cpp:
1186         (WebKit::WebProcessCreationParameters::encode const):
1187         (WebKit::WebProcessCreationParameters::decode):
1188         * Shared/WebProcessCreationParameters.h:
1189         * Shared/WebProcessDataStoreParameters.h:
1190         (WebKit::WebProcessDataStoreParameters::encode const):
1191         (WebKit::WebProcessDataStoreParameters::decode):
1192         * UIProcess/WebProcessPool.cpp:
1193         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1194         (WebKit::WebProcessPool::webProcessDataStoreParameters):
1195         (WebKit::WebProcessPool::initializeNewWebProcess):
1196         (WebKit::WebProcessPool::sendWebProcessDataStoreParameters): Deleted.
1197         * UIProcess/WebProcessPool.h:
1198         * UIProcess/WebProcessProxy.cpp:
1199         (WebKit::WebProcessProxy::setWebsiteDataStore):
1200         * WebProcess/WebProcess.cpp:
1201         (WebKit::WebProcess::initializeWebProcess):
1202         (WebKit::WebProcess::setWebsiteDataStoreParameters):
1203         * WebProcess/WebProcess.h:
1204         (WebKit::WebProcess::sessionID const):
1205
1206 2019-09-12  Chris Dumez  <cdumez@apple.com>
1207
1208         [WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
1209         https://bugs.webkit.org/show_bug.cgi?id=201546
1210
1211         Reviewed by Alex Christensen.
1212
1213         Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
1214         the right thing for WebKit2 and tests have been rewritten to not use it.
1215
1216         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1217         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession): Deleted.
1218         * NetworkProcess/NetworkConnectionToWebProcess.h:
1219         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1220         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1221         (WKBundleSetPrivateBrowsingEnabled): Deleted.
1222         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1223         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1224         (WebKit::InjectedBundle::setPrivateBrowsingEnabled): Deleted.
1225         * WebProcess/InjectedBundle/InjectedBundle.h:
1226         * WebProcess/WebProcess.cpp:
1227         (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
1228         * WebProcess/WebProcess.h:
1229         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1230         (WebKit::StorageNamespaceImpl::setSessionIDForTesting):
1231
1232 2019-09-12  Adrian Perez de Castro  <aperez@igalia.com>
1233
1234         [GTK][WPE] webkit_settings_set_user_agent() allows content forbidden in HTTP headers
1235         https://bugs.webkit.org/show_bug.cgi?id=201077
1236
1237         Reviewed by Carlos Garcia Campos.
1238
1239         * UIProcess/API/glib/WebKitSettings.cpp:
1240         (webkit_settings_set_user_agent): Check the passed string using the new
1241         WebCore::isValidUserAgentHeaderValue() function, and return early without
1242         changing the setting if the string is not usable in the User-Agent HTTP
1243         header.
1244
1245 2019-09-12  Mark Lam  <mark.lam@apple.com>
1246
1247         Harden JSC against the abuse of runtime options.
1248         https://bugs.webkit.org/show_bug.cgi?id=201597
1249         <rdar://problem/55167068>
1250
1251         Reviewed by Filip Pizlo.
1252
1253         Linux parts contributed by Carlos Garcia Campos <cgarcia@igalia.com>.
1254
1255         1. Add plumbing to allow WK2 tests to configureJSCForTesting().
1256         2. Removed the call enable Options::useBigInt in WebInspectorUI.
1257            WebInspectorUI doesn't really need it for now.
1258
1259         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1260         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
1261         (WebKit::XPCServiceInitializer):
1262         * Shared/unix/AuxiliaryProcessMain.cpp:
1263         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
1264         * Shared/unix/AuxiliaryProcessMain.h:
1265         (WebKit::AuxiliaryProcessMain):
1266         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1267         (API::ProcessPoolConfiguration::copy):
1268         * UIProcess/API/APIProcessPoolConfiguration.h:
1269         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1270         (WKContextConfigurationSetShouldConfigureJSCForTesting):
1271         * UIProcess/API/C/WKContextConfigurationRef.h:
1272         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1273         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1274         (-[_WKProcessPoolConfiguration configureJSCForTesting]):
1275         (-[_WKProcessPoolConfiguration setConfigureJSCForTesting:]):
1276         * UIProcess/Launcher/ProcessLauncher.h:
1277         (WebKit::ProcessLauncher::Client::shouldConfigureJSCForTesting const):
1278         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1279         (WebKit::ProcessLauncher::launchProcess):
1280         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1281         (WebKit::ProcessLauncher::launchProcess):
1282         * UIProcess/WebProcessProxy.cpp:
1283         (WebKit::WebProcessProxy::shouldConfigureJSCForTesting const):
1284         * UIProcess/WebProcessProxy.h:
1285         * WebProcess/WebPage/WebInspectorUI.cpp:
1286         (WebKit::WebInspectorUI::WebInspectorUI):
1287
1288 2019-09-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1289
1290         Fix accidental copies in NetworkLoadChecker.cpp
1291         https://bugs.webkit.org/show_bug.cgi?id=199528
1292
1293         Reviewed by Youenn Fablet.
1294
1295         Coverity noticed that we are copying a ResourceRequest and a ContentExtensionResultOrError
1296         in NetworkLoadChecker::checkRequest by mistake, when the intent was to move them as rvalue
1297         references.
1298
1299         * NetworkProcess/NetworkLoadChecker.cpp:
1300         (WebKit::NetworkLoadChecker::checkRequest):
1301         * NetworkProcess/NetworkLoadChecker.h:
1302
1303 2019-09-12  Joseph Pecoraro  <pecoraro@apple.com>
1304
1305         Web Inspector: Crashes when intercept response continues with original content
1306         https://bugs.webkit.org/show_bug.cgi?id=201707
1307         <rdar://problem/55261857>
1308
1309         Reviewed by David Kilzer.
1310
1311         * WebProcess/Network/WebResourceLoader.cpp:
1312         (WebKit::WebResourceLoader::didReceiveData):
1313         Copy the data for the callback since the deferral may run it much later.
1314
1315 2019-09-12  Youenn Fablet  <youenn@apple.com>
1316
1317         Use typed identifiers for IDB connection identifiers
1318         https://bugs.webkit.org/show_bug.cgi?id=201682
1319
1320         Reviewed by Chris Dumez.
1321
1322         Remove no longer needed conversion from process identifier to idb connection identifier.
1323
1324         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
1325         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1326         (WebKit::WebIDBConnectionToServer::identifier const):
1327         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1328
1329 2019-09-12  Charlie Turner  <cturner@igalia.com>
1330
1331         [GTK] Allow CacheStore::destroyEngine to destroy default engine for soup.
1332         https://bugs.webkit.org/show_bug.cgi?id=201690
1333
1334         Reviewed by Carlos Garcia Campos.
1335
1336         * NetworkProcess/cache/CacheStorageEngine.cpp:
1337         (WebKit::CacheStorage::Engine::destroyEngine): As we do for
1338         NetworkProcess::destroySession, also allow destroying the engine
1339         for the default session for the same reason.
1340
1341 2019-09-12  Youenn Fablet  <youenn@apple.com>
1342
1343         Use WebProcess processIdentifier to identify Service Worker connections
1344         https://bugs.webkit.org/show_bug.cgi?id=201459
1345
1346         Reviewed by Chris Dumez.
1347
1348         Make WebSWServerConnection be stored in NetworkConnectionToWebProcess.
1349         They are now keyed by session IDs hence why WebSWClientConnection is using the session ID as message connection ID.
1350         Creation no longer requires a sync IPC since the connection is uniquely identified by its session ID and its process ID.
1351         These IDs are stable over network process crash.
1352         Within NetworkProcess, a server connection is managed by a SWServer which is session ID specific.
1353         In that case, the process identifier uniquely identifies the connection.
1354
1355         Move WebSWServerToContextConnection be owned by NetworkConnectionToWebProcess.
1356         Instead of creating it when webprocess is connecting to network process, use a dedicated IPC message.
1357         This is similar to WebSWServerConnection once WebProcess asks to create it.
1358         This will allow existing WebProcess, in cache or running pages, to run service workers as well.
1359         A context connection map is kept in Network Process to reuse context connections since these connections are not sessionID specific.
1360
1361         Migrate from a single boolean to a HashSet to track whether some connections are in the process of being created.
1362         Previously if two requests to create connections were done shortly one after the other on different registrable
1363         domains, the second request would not be processed.
1364
1365         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1366         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1367         (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
1368         (WebKit::NetworkConnectionToWebProcess::didClose):
1369         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
1370         (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
1371         * NetworkProcess/NetworkConnectionToWebProcess.h:
1372         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1373         * NetworkProcess/NetworkProcess.cpp:
1374         (WebKit::NetworkProcess::didReceiveMessage):
1375         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1376         (WebKit::NetworkProcess::forEachSWServer):
1377         (WebKit::NetworkProcess::needsServerToContextConnectionForRegistrableDomain const):
1378         (WebKit::NetworkProcess::createServerToContextConnection):
1379         (WebKit::NetworkProcess::postMessageToServiceWorkerClient):
1380         (WebKit::NetworkProcess::registerSWServerConnection):
1381         (WebKit::NetworkProcess::unregisterSWServerConnection):
1382         (WebKit::NetworkProcess::registerSWContextConnection):
1383         (WebKit::NetworkProcess::unregisterSWContextConnection):
1384         * NetworkProcess/NetworkProcess.h:
1385         * NetworkProcess/NetworkProcess.messages.in:
1386         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1387         (WebKit::WebSWServerConnection::WebSWServerConnection):
1388         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1389         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1390         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1391         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
1392         (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
1393         (WebKit::WebSWServerToContextConnection::postMessageToServiceWorkerClient):
1394         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
1395         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
1396         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1397         * UIProcess/Network/NetworkProcessProxy.cpp:
1398         (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
1399         (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
1400         * UIProcess/Network/NetworkProcessProxy.h:
1401         * UIProcess/Network/NetworkProcessProxy.messages.in:
1402         * UIProcess/WebProcessPool.cpp:
1403         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
1404         * UIProcess/WebProcessPool.h:
1405         * UIProcess/WebProcessProxy.cpp:
1406         (WebKit::WebProcessProxy::establishServiceWorkerContext):
1407         * UIProcess/WebProcessProxy.h:
1408         * WebProcess/Network/NetworkProcessConnection.cpp:
1409         (WebKit::NetworkProcessConnection::didReceiveMessage):
1410         (WebKit::NetworkProcessConnection::didClose):
1411         (WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
1412         * WebProcess/Network/NetworkProcessConnection.h:
1413         * WebProcess/Storage/WebSWClientConnection.cpp:
1414         (WebKit::WebSWClientConnection::WebSWClientConnection):
1415         (WebKit::WebSWClientConnection::~WebSWClientConnection):
1416         (WebKit::WebSWClientConnection::messageSenderConnection const):
1417         (WebKit::WebSWClientConnection::scheduleJobInServer):
1418         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
1419         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
1420         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
1421         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
1422         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1423         (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
1424         (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
1425         (WebKit::WebSWClientConnection::matchRegistration):
1426         (WebKit::WebSWClientConnection::runOrDelayTaskForImport):
1427         (WebKit::WebSWClientConnection::whenRegistrationReady):
1428         (WebKit::WebSWClientConnection::getRegistrations):
1429         (WebKit::WebSWClientConnection::startFetch):
1430         (WebKit::WebSWClientConnection::cancelFetch):
1431         (WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
1432         (WebKit::WebSWClientConnection::connectionToServerLost):
1433         (WebKit::WebSWClientConnection::clear):
1434         (WebKit::WebSWClientConnection::syncTerminateWorker):
1435         (WebKit::WebSWClientConnection::updateThrottleState):
1436         (WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting):
1437         * WebProcess/Storage/WebSWClientConnection.h:
1438         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1439         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
1440         (WebKit::m_userAgent):
1441         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
1442         * WebProcess/Storage/WebSWContextManagerConnection.h:
1443         * WebProcess/WebProcess.cpp:
1444         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
1445         * WebProcess/WebProcess.h:
1446         * WebProcess/WebProcess.messages.in:
1447
1448 2019-09-11  Keith Rollin  <krollin@apple.com>
1449
1450         Log timeoutValue passed on to CFNetwork
1451         https://bugs.webkit.org/show_bug.cgi?id=201701
1452         <rdar://problem/55279683>
1453
1454         Reviewed by Chris Dumez.
1455
1456         We occasionally see cases where resource-loads into CFNetwork take a
1457         long time. Rather than timing out after the default of 60s, they stay
1458         pending for many minutes. To better understand why this is happening,
1459         log the timeoutValue we pass to CFNetwork when loading resources.
1460
1461         * NetworkProcess/NetworkResourceLoader.cpp:
1462         (WebKit::NetworkResourceLoader::startNetworkLoad):
1463
1464 2019-09-11  Youenn Fablet  <youenn@apple.com>
1465
1466         Protect UserMediaRequest when stopping it
1467         https://bugs.webkit.org/show_bug.cgi?id=201687
1468         <rdar://problem/55241215>
1469
1470         Reviewed by Eric Carlson.
1471
1472         By removing the request from the map, we may destroy the request.
1473         To make sure it stays alive, take the request from the map.
1474
1475         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1476         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest):
1477
1478 2019-09-11  Ryan Haddad  <ryanhaddad@apple.com>
1479
1480         Unreviewed, rolling out r249768.
1481
1482         Caused 4 API tests to assert, perf test failures, and layout
1483         test crashes under ASan
1484
1485         Reverted changeset:
1486
1487         "Remove unnecessary abstractions around WebsiteDataStore"
1488         https://bugs.webkit.org/show_bug.cgi?id=201655
1489         https://trac.webkit.org/changeset/249768
1490
1491 2019-09-11  Simon Fraser  <simon.fraser@apple.com>
1492
1493         REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
1494         https://bugs.webkit.org/show_bug.cgi?id=201668
1495         rdar://problem/51934041
1496
1497         Reviewed by Frédéric Wang.
1498
1499         The UI process can have transient state that pushes scrolling-tree-managed layers into custom
1500         locations while pinch-zooming. We have to apply this state both when the visible rects
1501         in the UI process change (existing code in -[WKContentView didUpdateVisibleRect:...]) and when
1502         we get new layers from the web process (added in RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
1503         in this patch).
1504
1505         Move some code into WebPageProxy to create functions that we can call from both places.
1506
1507         For manual testing, visit a page with fixed banners, pinch in slightly, then pinch out and,
1508         while keeping your fingers down, move the contents around.
1509
1510         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1511         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1512         * UIProcess/WebPageProxy.h:
1513         * UIProcess/ios/WKContentView.mm:
1514         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1515         * UIProcess/ios/WebPageProxyIOS.mm:
1516         (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const):
1517         (WebKit::WebPageProxy::adjustLayersForLayoutViewport):
1518
1519 2019-09-11  Antti Koivisto  <antti@apple.com>
1520
1521         REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
1522         https://bugs.webkit.org/show_bug.cgi?id=201683
1523         <rdar://problem/54582602>
1524
1525         Reviewed by Simon Fraser.
1526
1527         Content <body> has 'overflow:hidden'.
1528
1529         * UIProcess/Cocoa/VersionChecks.h:
1530         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1531         (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
1532
1533         Fix by adding an app specific LinkedOnOrAfter quirk that always allows main frame scrolling.
1534
1535 2019-09-11  Alex Christensen  <achristensen@webkit.org>
1536
1537         Remove unnecessary abstractions around WebsiteDataStore
1538         https://bugs.webkit.org/show_bug.cgi?id=201655
1539
1540         Reviewed by Chris Dumez.
1541
1542         This patch does four things to simplify WebsiteDataStore code:
1543         1. It removes API::WebsiteDataStore, which was just an unnecessary wrapper around WebKit::WebsiteDataStore.
1544         2. It deprecates the unused aliases of WebsiteDataStore, WKApplicationCacheManagerRef and WKKeyValueStorageManagerRef
1545         3. It removes the unused APIProcessPoolConfiguration properties that have been moved to WebsiteDataStore.
1546         4. It makes WKWebsiteDataStore._delegate weak instead of strong, as already annotated in WKWebsiteDataStorePrivate.h
1547         There should be no change in behavior from this patch.
1548
1549         * PlatformFTW.cmake:
1550         * PlatformWin.cmake:
1551         * Sources.txt:
1552         * SourcesCocoa.txt:
1553         * SourcesGTK.txt:
1554         * SourcesWPE.txt:
1555         * UIProcess/API/APIHTTPCookieStore.cpp:
1556         * UIProcess/API/APIHTTPCookieStore.h:
1557         * UIProcess/API/APIPageConfiguration.cpp:
1558         (API::PageConfiguration::websiteDataStore):
1559         (API::PageConfiguration::setWebsiteDataStore):
1560         * UIProcess/API/APIPageConfiguration.h:
1561         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1562         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1563         (API::ProcessPoolConfiguration::copy):
1564         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): Deleted.
1565         * UIProcess/API/APIProcessPoolConfiguration.h:
1566         * UIProcess/API/APIWebsiteDataStore.cpp: Removed.
1567         * UIProcess/API/APIWebsiteDataStore.h: Removed.
1568         * UIProcess/API/APIWebsitePolicies.cpp:
1569         (API::WebsitePolicies::data):
1570         * UIProcess/API/APIWebsitePolicies.h:
1571         * UIProcess/API/C/WKAPICast.h:
1572         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1573         (WKApplicationCacheManagerGetTypeID):
1574         (WKApplicationCacheManagerGetApplicationCacheOrigins):
1575         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1576         (WKApplicationCacheManagerDeleteAllEntries):
1577         * UIProcess/API/C/WKApplicationCacheManager.h:
1578         * UIProcess/API/C/WKFramePolicyListener.cpp:
1579         (useWithPolicies):
1580         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1581         (WKKeyValueStorageManagerGetTypeID):
1582         (WKKeyValueStorageManagerGetOriginKey):
1583         (WKKeyValueStorageManagerGetCreationTimeKey):
1584         (WKKeyValueStorageManagerGetModificationTimeKey):
1585         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
1586         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1587         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1588         (WKKeyValueStorageManagerDeleteAllEntries):
1589         * UIProcess/API/C/WKKeyValueStorageManager.h:
1590         * UIProcess/API/C/WKResourceCacheManager.cpp:
1591         (WKResourceCacheManagerGetTypeID):
1592         (WKResourceCacheManagerGetCacheOrigins):
1593         (WKResourceCacheManagerClearCacheForOrigin):
1594         (WKResourceCacheManagerClearCacheForAllOrigins):
1595         (toWebsiteDataTypes): Deleted.
1596         * UIProcess/API/C/WKResourceCacheManager.h:
1597         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1598         (WKWebsiteDataStoreGetTypeID):
1599         (WKWebsiteDataStoreGetDefaultDataStore):
1600         (WKWebsiteDataStoreCreateNonPersistentDataStore):
1601         (WKWebsiteDataStoreCreateWithConfiguration):
1602         (WKWebsiteDataStoreGetHTTPCookieStore):
1603         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
1604         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
1605         (WKWebsiteDataStoreSetStatisticsLastSeen):
1606         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1607         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1608         (WKWebsiteDataStoreDumpResourceLoadStatistics):
1609         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1610         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1611         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
1612         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1613         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1614         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1615         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1616         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1617         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1618         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1619         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1620         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1621         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
1622         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
1623         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
1624         (WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
1625         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1626         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1627         (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
1628         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1629         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1630         (WKWebsiteDataStoreSetStatisticsIsRunningTest):
1631         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1632         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1633         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1634         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1635         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1636         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1637         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1638         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1639         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
1640         (WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
1641         (WKWebsiteDataStoreStatisticsHasLocalStorage):
1642         (WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
1643         (WKWebsiteDataStoreStatisticsHasIsolatedSession):
1644         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1645         (WKWebsiteDataStoreRemoveAllFetchCaches):
1646         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
1647         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
1648         (WKWebsiteDataStoreRemoveLocalStorage):
1649         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
1650         (WKWebsiteDataStoreGetFetchCacheOrigins):
1651         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
1652         (WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
1653         (WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
1654         (WKWebsiteDataStoreSetPerOriginStorageQuota):
1655         (WKWebsiteDataStoreClearAllDeviceOrientationPermissions):
1656         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
1657         (WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
1658         * UIProcess/API/C/WKWebsitePolicies.cpp:
1659         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Removed.
1660         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1661         (+[WKWebsiteDataStore defaultDataStore]):
1662         (+[WKWebsiteDataStore nonPersistentDataStore]):
1663         (-[WKWebsiteDataStore dealloc]):
1664         (-[WKWebsiteDataStore httpCookieStore]):
1665         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1666         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
1667         (+[WKWebsiteDataStore _defaultDataStoreExists]):
1668         (+[WKWebsiteDataStore _deleteDefaultDataStoreForTesting]):
1669         (-[WKWebsiteDataStore _initWithConfiguration:]):
1670         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
1671         (-[WKWebsiteDataStore _resourceLoadStatisticsEnabled]):
1672         (-[WKWebsiteDataStore _setResourceLoadStatisticsEnabled:]):
1673         (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
1674         (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
1675         (-[WKWebsiteDataStore _perOriginStorageQuota]):
1676         (-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
1677         (-[WKWebsiteDataStore _cacheStorageDirectory]):
1678         (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
1679         (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
1680         (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
1681         (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
1682         (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
1683         (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
1684         (-[WKWebsiteDataStore _allowsCellularAccess]):
1685         (-[WKWebsiteDataStore _setProxyConfiguration:]):
1686         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
1687         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
1688         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
1689         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
1690         (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
1691         (-[WKWebsiteDataStore _allowsTLSFallback]):
1692         (-[WKWebsiteDataStore _proxyConfiguration]):
1693         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
1694         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]):
1695         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
1696         (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
1697         (-[WKWebsiteDataStore _scheduleCookieBlockingUpdate:]):
1698         (-[WKWebsiteDataStore _setPrevalentDomain:completionHandler:]):
1699         (-[WKWebsiteDataStore _getIsPrevalentDomain:completionHandler:]):
1700         (-[WKWebsiteDataStore _clearPrevalentDomain:completionHandler:]):
1701         (-[WKWebsiteDataStore _processStatisticsAndDataRecords:]):
1702         (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
1703         (-[WKWebsiteDataStore _delegate]):
1704         (-[WKWebsiteDataStore set_delegate:]):
1705         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
1706         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Removed.
1707         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
1708         (API::WebsiteDataStore::defaultApplicationCacheDirectory): Deleted.
1709         (API::WebsiteDataStore::defaultCacheStorageDirectory): Deleted.
1710         (API::WebsiteDataStore::defaultNetworkCacheDirectory): Deleted.
1711         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): Deleted.
1712         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): Deleted.
1713         (API::WebsiteDataStore::defaultLocalStorageDirectory): Deleted.
1714         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): Deleted.
1715         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): Deleted.
1716         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Deleted.
1717         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): Deleted.
1718         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): Deleted.
1719         * UIProcess/Automation/WebAutomationSession.cpp:
1720         (WebKit::WebAutomationSession::addSingleCookie):
1721         (WebKit::WebAutomationSession::deleteAllCookies):
1722         * UIProcess/Cocoa/NavigationState.mm:
1723         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1724         * UIProcess/Network/NetworkProcessProxy.cpp:
1725         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
1726         (WebKit::NetworkProcessProxy::websiteDataStoreFromSessionID):
1727         * UIProcess/Network/NetworkProcessProxy.h:
1728         * UIProcess/WebFramePolicyListenerProxy.cpp:
1729         * UIProcess/WebPageProxy.cpp:
1730         (WebKit::WebPageProxy::WebPageProxy):
1731         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1732         * UIProcess/WebProcessPool.cpp:
1733         (WebKit::m_webProcessCache):
1734         (WebKit::WebProcessPool::ensureNetworkProcess):
1735         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
1736         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
1737         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1738         (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
1739         (WebKit::WebProcessPool::processDidFinishLaunching):
1740         (WebKit::WebProcessPool::processForRegistrableDomain):
1741         (WebKit::WebProcessPool::createWebPage):
1742         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
1743         * UIProcess/WebProcessPool.h:
1744         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1745         (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
1746         (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
1747         (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
1748         (WebKit::WebsiteDataStore::defaultMediaCacheDirectory):
1749         (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
1750         (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
1751         (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
1752         (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
1753         (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
1754         (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
1755         (WebKit::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
1756         (WebKit::WebsiteDataStore::tempDirectoryFileSystemRepresentation):
1757         (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
1758         (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
1759         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1760         (WebKit::globalDefaultDataStore):
1761         (WebKit::WebsiteDataStore::defaultDataStore):
1762         (WebKit::WebsiteDataStore::deleteDefaultDataStoreForTesting):
1763         (WebKit::WebsiteDataStore::defaultDataStoreExists):
1764         (WebKit::WebsiteDataStore::defaultDataStoreConfiguration):
1765         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
1766         (WebKit::WebsiteDataStore::processPools const):
1767         (WebKit::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
1768         * UIProcess/WebsiteData/WebsiteDataStore.h:
1769         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
1770         (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
1771         * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
1772         (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
1773         (WebKit::WebsiteDataStore::defaultCacheStorageDirectory):
1774         (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory):
1775         (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
1776         (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
1777         (WebKit::WebsiteDataStore::defaultLocalStorageDirectory):
1778         (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory):
1779         (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
1780         (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
1781         (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
1782         (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
1783         * UIProcess/glib/WebsiteDataStoreGLib.cpp: Copied from Source/WebKit/UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp.
1784         (API::WebsiteDataStore::defaultApplicationCacheDirectory): Deleted.
1785         (API::WebsiteDataStore::defaultNetworkCacheDirectory): Deleted.
1786         (API::WebsiteDataStore::defaultCacheStorageDirectory): Deleted.
1787         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): Deleted.
1788         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): Deleted.
1789         (API::WebsiteDataStore::defaultLocalStorageDirectory): Deleted.
1790         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory): Deleted.
1791         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
1792         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory): Deleted.
1793         (API::WebsiteDataStore::defaultHSTSDirectory): Deleted.
1794         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): Deleted.
1795         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): Deleted.
1796         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): Deleted.
1797         * WebKit.xcodeproj/project.pbxproj:
1798
1799 2019-09-11  Antoine Quint  <graouts@apple.com>
1800
1801         REGRESSION: Scrubbing on ted.com does not work well
1802         https://bugs.webkit.org/show_bug.cgi?id=201635
1803         <rdar://problem/51463649>
1804
1805         Reviewed by Dean Jackson.
1806
1807         This website uses custom media controls that simply don't work well on iOS when the User-Agent string is the desktop one, so we default to the mobile UA.
1808
1809         * UIProcess/ios/WebPageProxyIOS.mm:
1810         (WebKit::desktopClassBrowsingRecommendedForRequest):
1811
1812 2019-09-10  Tim Horton  <timothy_horton@apple.com>
1813
1814         REGRESSION (r233780): After swiping to navigate back, pinching to zoom in on webcontent snaps back to zoomed out when letting go
1815         https://bugs.webkit.org/show_bug.cgi?id=201671
1816         <rdar://problem/50488372>
1817
1818         Reviewed by Simon Fraser.
1819
1820         * WebProcess/WebPage/WebPage.cpp:
1821         (WebKit::WebPage::didCommitLoad):
1822         Reset m_lastTransactionIDWithScaleChange, since it is not guaranteed
1823         to only march forward. Otherwise, we can get stuck with a very large
1824         m_lastTransactionIDWithScaleChange, and will not allow stable-state
1825         user-driven zooms until the current transactionID exceeds it.
1826
1827 2019-09-10  Chris Dumez  <cdumez@apple.com>
1828
1829         Nullptr crash in Page::sessionID() via WebKit::WebFrameLoaderClient::detachedFromParent2()
1830         https://bugs.webkit.org/show_bug.cgi?id=201625
1831
1832         Reviewed by Ryosuke Niwa.
1833
1834         This is based on a patch from Ryosuke Niwa.
1835
1836         The crash was caused by WebFrameLoaderClient::sessionID() calling WebPage::sessionID() without
1837         checking the nullity of WebPage::m_page which can be null. Added a null check.
1838
1839         Because passing a wrong session to RemoveStorageAccessForFrame could result in a leak, this patch
1840         also replaces m_hasFrameSpecificStorageAccess boolean with an optioanl struct which stores
1841         session ID, frame ID, and page ID even after WebCore::Frame or WebCore::Page had been cleared
1842         or before WebFrameLoaderClient::m_frame is set.
1843
1844         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1845         (WebKit::WebFrameLoaderClient::sessionID const):
1846         (WebKit::WebFrameLoaderClient::setHasFrameSpecificStorageAccess):
1847         (WebKit::WebFrameLoaderClient::detachedFromParent2):
1848         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
1849         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1850         * WebProcess/WebPage/WebFrame.h:
1851         (WebKit::WebFrame::frameLoaderClient const):
1852         * WebProcess/WebPage/WebPage.cpp:
1853         (WebKit::WebPage::requestStorageAccess):
1854
1855 2019-09-10  Brady Eidson  <beidson@apple.com>
1856
1857         Add SPI to save a PDF from the contents of a WKWebView.
1858         <rdar://problem/48955900> and https://bugs.webkit.org/show_bug.cgi?id=195765
1859
1860         Reviewed by Tim Horton.
1861
1862         This is refactoring a combination of "snapshotFirstPage" PDF printing code and the
1863         "takeSnapshot" API code to capture the on-screen visible page to a PDF at full fidelity.
1864
1865         * UIProcess/API/Cocoa/WKWebView.mm:
1866         (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):
1867         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1868
1869         * UIProcess/WebPageProxy.cpp:
1870         (WebKit::WebPageProxy::drawToPDF):
1871         (WebKit::WebPageProxy::drawToPDFCallback):
1872         * UIProcess/WebPageProxy.h:
1873         * UIProcess/WebPageProxy.messages.in:
1874
1875         * UIProcess/ios/WKContentView.mm:
1876         (-[WKContentView _wk_pageCountForPrintFormatter:]):
1877
1878         * UIProcess/ios/WebPageProxyIOS.mm:
1879         (WebKit::WebPageProxy::drawToPDFCallback): Move to cross platform WebPageProxy.
1880
1881         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1882         (WebKit::WebPage::pdfSnapshotAtSize):
1883
1884         * WebProcess/WebPage/WebPage.cpp:
1885         (WebKit::WebPage::pdfSnapshotAtSize): Instead of assuming 1 page capped at 200 inches,
1886           paginate every 200 inches.
1887         (WebKit::WebPage::drawToPDF):
1888         (WebKit::paintSnapshotAtSize): Deleted.
1889         (WebKit::WebPage::pdfSnapshotAtSize): Deleted.
1890         * WebProcess/WebPage/WebPage.h:
1891         * WebProcess/WebPage/WebPage.messages.in:
1892
1893 2019-09-10  Chris Dumez  <cdumez@apple.com>
1894
1895         Hangs on Swiss.com due to the web process being blocked on StorageAreaMap::LoadValuesIfNeeded
1896         https://bugs.webkit.org/show_bug.cgi?id=201644
1897         <rdar://problem/54942761>
1898
1899         Reviewed by Geoffrey Garen.
1900
1901         Mark the StorageManagerSet::GetValues sync IPC from the WebContent process to the Network
1902         process with a UnboundedSynchronousIPCScope so that it will process critical sync IPC
1903         from the UIProcess (such as WebPage::GetPositionInformation) while waiting for a reply.
1904
1905         * WebProcess/WebStorage/StorageAreaMap.cpp:
1906         (WebKit::StorageAreaMap::loadValuesIfNeeded):
1907
1908 2019-09-10  David Quesada  <david_quesada@apple.com>
1909
1910         Remove a leftover reference to the StorageProcess
1911         https://bugs.webkit.org/show_bug.cgi?id=192759
1912
1913         Reviewed by Alex Christensen.
1914
1915         * WebKit.xcodeproj/project.pbxproj:
1916             Remove com.apple.WebKit.Storage.sb as an input file to the "Copy iOS Sandbox Profiles
1917             for Manual Sandboxing" build phase. The file no longer exists.
1918
1919 2019-09-10  Adrian Perez de Castro  <aperez@igalia.com>
1920
1921         [GTK][WPE] Fixes for non-unified builds after r249022
1922         https://bugs.webkit.org/show_bug.cgi?id=201610
1923
1924         Reviewed by Joseph Pecoraro.
1925
1926         * NetworkProcess/NetworkCORSPreflightChecker.h: Add missing inclusion of the WebPageProxyIdentifier.h header.
1927         * NetworkProcess/NetworkLoadChecker.h: Add missing inclusion of the WebPageProxyIdentifier.h header.
1928
1929 2019-09-10  Youenn Fablet  <youenn@apple.com>
1930
1931         UserMediaProcessManager is revoking sandbox extensions too aggressively
1932         https://bugs.webkit.org/show_bug.cgi?id=201638
1933
1934         Reviewed by Eric Carlson.
1935
1936         Sandbox revocation was sometimes happening when a page is being closed while another page from the same process is starting capture.
1937         In that case, revocation might happen while it should not.
1938         To prevent this, we do not revoke sandbox extensions if there are pending captures for a page of the process.
1939         Whenever a page does not have any pending capture, sandbox extensions may be revoked.
1940
1941         Covered by OnDeviceChangeCrash API test in debug mode.
1942
1943         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1944         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
1945         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1946         (WebKit::UserMediaPermissionRequestManagerProxy::hasPendingCapture const):
1947         * UIProcess/UserMediaProcessManager.cpp:
1948         (WebKit::UserMediaProcessManager::revokeSandboxExtensionsIfNeeded):
1949
1950 2019-09-09  Chris Dumez  <cdumez@apple.com>
1951
1952         [iOS] We sometimes attempt to use a terminated prewarmed WebContent process
1953         https://bugs.webkit.org/show_bug.cgi?id=201614
1954         <rdar://problem/54714507>
1955
1956         Reviewed by Geoffrey Garen.
1957
1958         On iOS, it is possible for our processes to get terminated (e.g. jetsammed) while the UIProcess
1959         is suspended. Upon resuming, it takes a little while for the UIProcess to get the notification
1960         that the mac connection to its child process has been severed and the UIProcess may try to use
1961         it for a load. This is especially problematic for prewarmed process because the client will end
1962         up showing a crash banner and reloading when we could have used a new process rather the prewarmed
1963         one if we had known it was dead.
1964
1965         This patch makes 2 improvements:
1966         1. It makes AuxiliaryProcessProxy::state() return Terminated if we still have a connection but
1967            the PID is not the PID of a running process. I also added a check in tryTakePrewarmedProcess()
1968            to not use the prewarmed process if it state() is Terminated.
1969         2. When the UIProcess is about to get suspended, have the process pools terminate their non-critical
1970            processes (i.e. prewarmed + the ones used for PageCache). This makes WebKit friendlier with
1971            other apps on the system when suspended with regards to memory. Also, it makes it less likely
1972            useful WebContent processes will get jetsammed.
1973
1974         * UIProcess/AuxiliaryProcessProxy.cpp:
1975         (WebKit::AuxiliaryProcessProxy::state const):
1976         (WebKit::AuxiliaryProcessProxy::isRunningProcessPID):
1977         * UIProcess/AuxiliaryProcessProxy.h:
1978         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1979         (WebKit::WebProcessPool::applicationIsAboutToSuspend):
1980         * UIProcess/WebProcessPool.cpp:
1981         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1982         * UIProcess/WebProcessPool.h:
1983         * UIProcess/ios/ProcessAssertionIOS.mm:
1984         (-[WKProcessAssertionBackgroundTaskManager init]):
1985         (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
1986
1987 2019-09-09  Chris Dumez  <cdumez@apple.com>
1988
1989         REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
1990         https://bugs.webkit.org/show_bug.cgi?id=201550
1991
1992         Reviewed by Alex Christensen.
1993
1994         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1995         (WKBundleResourceLoadStatisticsNotifyObserver):
1996         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1997
1998 2019-09-09  Alex Christensen  <achristensen@webkit.org>
1999
2000         Disable TLS 1.0 and 1.1 in WebSockets
2001         https://bugs.webkit.org/show_bug.cgi?id=201573
2002
2003         Reviewed by Youenn Fablet.
2004
2005         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2006         (WebKit::NetworkProcessCreationParameters::encode const):
2007         (WebKit::NetworkProcessCreationParameters::decode):
2008         * NetworkProcess/NetworkProcessCreationParameters.h:
2009         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2010         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2011         * UIProcess/API/Cocoa/WKProcessPool.mm:
2012         (-[WKProcessPool _allowAnyTLSCertificateForWebSocketTesting]):
2013         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2014         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2015         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2016
2017 2019-09-09  Tim Horton  <timothy_horton@apple.com>
2018
2019         Clarify some macCatalyst feature flags
2020         https://bugs.webkit.org/show_bug.cgi?id=201619
2021         <rdar://problem/54615618>
2022
2023         Reviewed by Megan Gardner.
2024
2025         * UIProcess/ios/WKContentViewInteraction.h:
2026         * UIProcess/ios/WKContentViewInteraction.mm:
2027         (-[WKContentView setupInteraction]):
2028         (-[WKContentView cleanupInteraction]):
2029         (-[WKContentView _removeDefaultGestureRecognizers]):
2030         (-[WKContentView _addDefaultGestureRecognizers]):
2031         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2032         (-[WKContentView _showShareSheet:inRect:completionHandler:]):
2033         We prefer specific flags over platform checks.
2034
2035 2019-09-09  Chris Dumez  <cdumez@apple.com>
2036
2037         Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html
2038         https://bugs.webkit.org/show_bug.cgi?id=201596
2039
2040         Reviewed by Alex Christensen.
2041
2042         Allow WKFramePolicyListenerUseWithPolicies() C API to switch to a persistent non-default session.
2043         This is important since WebKitTestRunner is not using the default session anymore and I need to
2044         be able to switch it back to its normal session after going to an ephemeral one.
2045
2046         * UIProcess/API/C/WKFramePolicyListener.cpp:
2047         (useWithPolicies):
2048
2049 2019-09-09  Alex Christensen  <achristensen@webkit.org>
2050
2051         Deprecate unused SPI to preconnect to a server
2052         https://bugs.webkit.org/show_bug.cgi?id=201558
2053
2054         Reviewed by Youenn Fablet.
2055
2056         * NetworkProcess/NetworkProcess.cpp:
2057         (WebKit::NetworkProcess::preconnectTo): Deleted.
2058         * NetworkProcess/NetworkProcess.h:
2059         * NetworkProcess/NetworkProcess.messages.in:
2060         * UIProcess/API/C/WKContext.cpp:
2061         (WKContextPreconnectToServer):
2062         * UIProcess/API/C/WKContextPrivate.h:
2063         * UIProcess/API/Cocoa/WKProcessPool.mm:
2064         (-[WKProcessPool _preconnectToServer:]):
2065         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2066         * UIProcess/WebProcessPool.cpp:
2067         (WebKit::WebProcessPool::preconnectToServer): Deleted.
2068         * UIProcess/WebProcessPool.h:
2069
2070 2019-09-09  Per Arne Vollan  <pvollan@apple.com>
2071
2072         Unreviewed Windows build fix.
2073
2074         * WebProcess/WebPage/WebPage.h:
2075
2076 2019-09-09  Per Arne Vollan  <pvollan@apple.com>
2077
2078         [macOS] Pid is sometimes invalid when creating sandbox extensions by pid.
2079         https://bugs.webkit.org/show_bug.cgi?id=201543
2080         <rdar://problem/54733465>
2081
2082         Reviewed by Brent Fulgham.
2083
2084         There is a race condition when starting a load of a local file, where the WebContent process has not finished
2085         launching yet, and its pid is not available. When we try to create a sandbox extension by using the pid of the
2086         WebContent process, it is not available in the cases where the WebContent process has just launched and has not
2087         finished launching yet. This patch creates a new dummy Web page message, 'LoadRequestWaitingForPID', which will
2088         be sent instead of a normal 'LoadRequest' message, and only when the WebContent process has not finished
2089         launching. When the WebContent process has finished launching, and we are about to actually send the pending
2090         messages, we can detect that a 'LoadRequestWaitingForPID' has been appended for sending, and replace it with a
2091         normal 'LoadReqest' message where we have created the sandbox extension issue with a valid pid. The message
2092         'LoadRequestWaitingForPID' is never intended to reach the WebContent process, it is just there to replace with
2093         a normal 'LoadRequest' message with a new sandbox extension. In the implementation of the message handler on
2094         the WebContent process side, we assert that the method is never called. This patch makes sure the ordering of
2095         the Web page messages are the same, even when we modify the message.
2096
2097         * UIProcess/AuxiliaryProcessProxy.cpp:
2098         (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
2099         * UIProcess/WebPageProxy.cpp:
2100         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2101         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2102         (WebKit::WebPageProxy::loadFile):
2103         * WebProcess/WebPage/WebPage.cpp:
2104         (WebKit::WebPage::fileLoadRequest):
2105         * WebProcess/WebPage/WebPage.h:
2106         * WebProcess/WebPage/WebPage.messages.in:
2107
2108 2019-09-09  Youenn Fablet  <youenn@apple.com>
2109
2110         Remove ServiceWorkerProcessProxy
2111         https://bugs.webkit.org/show_bug.cgi?id=201506
2112
2113         Reviewed by Chris Dumez.
2114
2115         Instead of using a specific ServiceWorkerProcessProxy, move the logic directly in WebProcessProxy.
2116         This will allow us in the future to run a service worker in a process that already runs a web page,
2117         thus saving the need to spin off a new process.
2118
2119         This patch adds a new WebProcessProxy::createForServiceWorkers method instead of creating a
2120         ServiceWorkerProcessProxy. The behavior is then similar: a process running a service worker cannot run a page.
2121
2122         * Sources.txt:
2123         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2124         (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
2125         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
2126         (WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):
2127         * UIProcess/Network/NetworkProcessProxy.cpp:
2128         (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
2129         * UIProcess/ServiceWorkerProcessProxy.cpp: Removed.
2130         * UIProcess/ServiceWorkerProcessProxy.h: Removed.
2131         * UIProcess/WebProcessPool.cpp:
2132         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
2133         (WebKit::WebProcessPool::disconnectProcess):
2134         (WebKit::WebProcessPool::processForRegistrableDomain):
2135         (WebKit::WebProcessPool::createWebPage):
2136         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
2137         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
2138         (WebKit::WebProcessPool::updateProcessAssertions):
2139         (WebKit::WebProcessPool::isServiceWorkerPageID const):
2140         * UIProcess/WebProcessPool.h:
2141         * UIProcess/WebProcessProxy.cpp:
2142         (WebKit::WebProcessProxy::createForServiceWorkers):
2143         (WebKit::WebProcessProxy::getLaunchOptions):
2144         (WebKit::WebProcessProxy::didBecomeUnresponsive):
2145         (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
2146         (WebKit::WebProcessProxy::didSetAssertionState):
2147         (WebKit::WebProcessProxy::didExceedCPULimit):
2148         (WebKit::WebProcessProxy::establishServiceWorkerContext):
2149         (WebKit::WebProcessProxy::setServiceWorkerUserAgent):
2150         (WebKit::WebProcessProxy::updateServiceWorkerPreferencesStore):
2151         * UIProcess/WebProcessProxy.h:
2152         (WebKit::WebProcessProxy::isRunningServiceWorkers const):
2153         (WebKit::WebProcessProxy::hasServiceWorkerPageProxy):
2154         * UIProcess/glib/WebProcessPoolGLib.cpp:
2155         (WebKit::WebProcessPool::platformInitializeWebProcess):
2156         * WebKit.xcodeproj/project.pbxproj:
2157
2158 2019-09-09  Youenn Fablet  <youenn@apple.com>
2159
2160         Use WebProcess processIdentifier to identify IDB connections between WebProcess and NetworkProcess
2161         https://bugs.webkit.org/show_bug.cgi?id=201419
2162
2163         Reviewed by Alex Christensen.
2164
2165         We change from an identifier generated by NetworkProcess to WebProcess identifier.
2166         A WebProcess identifier is unique globally and is stable even in case of NetworkProcess crash.
2167         This removes the need for a sync IPC and makes things more easy to handle in case of NetworkProcess crash.
2168
2169         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2170         (WebKit::WebIDBConnectionToClient::create):
2171         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
2172         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
2173         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
2174         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2175         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2176         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
2177         * NetworkProcess/NetworkConnectionToWebProcess.h:
2178         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2179         * WebKit.xcodeproj/project.pbxproj:
2180         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2181         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
2182         (WebKit::WebIDBConnectionToServer::identifier const):
2183         (WebKit::WebIDBConnectionToServer::coreConnectionToServer):
2184         (WebKit::WebIDBConnectionToServer::getAllDatabaseNames):
2185         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2186         * WebProcess/Network/NetworkProcessConnection.cpp:
2187         (WebKit::NetworkProcessConnection::didReceiveMessage):
2188         (WebKit::NetworkProcessConnection::didClose):
2189         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
2190         * WebProcess/Network/NetworkProcessConnection.h:
2191         (WebKit::NetworkProcessConnection::existingIDBConnectionToServer const):
2192         * WebProcess/WebProcess.cpp:
2193         (WebKit::WebProcess::networkProcessConnectionClosed):
2194
2195 2019-09-09  Youenn Fablet  <youenn@apple.com>
2196
2197         Move checkProcessLocalPortForActivity from provider to registry
2198         https://bugs.webkit.org/show_bug.cgi?id=201400
2199
2200         Reviewed by Alex Christensen.
2201
2202         Implement registry callback at NetworkProcess level.
2203         Remove NetworkMessagePortChannelProvider since only a registry is now needed.
2204
2205         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2206         * NetworkProcess/NetworkMessagePortChannelProvider.cpp: Removed.
2207         * NetworkProcess/NetworkMessagePortChannelProvider.h: Removed.
2208         * NetworkProcess/NetworkProcess.cpp:
2209         (WebKit::createMessagePortChannelRegistry):
2210         (WebKit::m_messagePortChannelRegistry):
2211         (WebKit::m_messagePortChannelProvider): Deleted.
2212         * NetworkProcess/NetworkProcess.h:
2213         (WebKit::NetworkProcess::messagePortChannelRegistry):
2214         * Sources.txt:
2215         * WebKit.xcodeproj/project.pbxproj:
2216         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
2217         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity): Deleted.
2218         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
2219
2220 2019-09-08  David Quesada  <david_quesada@apple.com>
2221
2222         Remove some unused constants in VersionChecks.h
2223         https://bugs.webkit.org/show_bug.cgi?id=201599
2224
2225         Reviewed by Youenn Fablet.
2226
2227         * UIProcess/Cocoa/VersionChecks.h:
2228             Remove two macros that are unused as of r244512.
2229
2230 2019-09-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2231
2232         [macCatalyst] The last typed character in password fields shouldn't be echoed
2233         https://bugs.webkit.org/show_bug.cgi?id=201595
2234         <rdar://problem/55166367>
2235
2236         Reviewed by Tim Horton.
2237
2238         Disable password echoing on macCatalyst, to better match behavior on macOS.
2239
2240         * Shared/WebPreferencesDefaultValues.h:
2241
2242 2019-09-07  Chris Dumez  <cdumez@apple.com>
2243
2244         Rewrite http/tests/workers/service/serviceworker-private-browsing.https.html as an API test
2245         https://bugs.webkit.org/show_bug.cgi?id=201574
2246
2247         Reviewed by Alex Christensen.
2248
2249         Update Service Workers so that they obey the "secureContextChecksEnabled" preference.
2250         This was needed to allow my service worker to access self.caches in my API test.
2251
2252         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2253         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
2254
2255 2019-09-07  Tim Horton  <timothy_horton@apple.com>
2256
2257         Marking up a note on iOS results in a PDF with no contents
2258         https://bugs.webkit.org/show_bug.cgi?id=201530
2259         <rdar://problem/53686019>
2260
2261         Unreviewed follow-up.
2262
2263         * UIProcess/ios/WKContentView.mm:
2264         (-[WKContentView _waitForDrawToPDFCallback]):
2265         Remove an ASSERT_NOT_REACHED that fires if the synchronous wait for printing
2266         times out. This is a totally legitimite situation that can occur if the process
2267         crashes; there's no need for an assert there.
2268
2269 2019-09-07  Alex Christensen  <achristensen@webkit.org>
2270
2271         Null check m_client in NetworkDataTask::didReceiveResponse
2272         https://bugs.webkit.org/show_bug.cgi?id=201587
2273         <rdar://problem/54743444>
2274
2275         Reviewed by Chris Dumez.
2276
2277         clearClient can be called at any time.  We null check it everyhere else we use it,
2278         and we are seeing crashes at this call site.  Let's not crash.
2279
2280         * NetworkProcess/NetworkDataTask.cpp:
2281         (WebKit::NetworkDataTask::didReceiveResponse):
2282
2283 2019-09-07  Alex Christensen  <achristensen@webkit.org>
2284
2285         Remove WebsiteDataStore::legacyDefaultDataStoreConfiguration
2286         https://bugs.webkit.org/show_bug.cgi?id=200054
2287
2288         Reviewed by Carlos Garcia Campos.
2289
2290         Its last needed use was removed in rdar://problem/47030981
2291         This changes WKContextConfigurationCreateWithLegacyOptions to be equal to WKContextConfigurationCreate,
2292         but it has no remaining clients so it is only being retained for binary compabibility.
2293         This also changes WKContextCreateWithInjectedBundlePath and WKContextCreate to be equal to WKContextCreateWithConfiguration,
2294         and after rdar://problem/47030981 there are no meaningful clients of those functions, also.
2295         There is one existing client of WKContextCreateWithInjectedBundlePath in rdar://problem/50323967 but our current implementation
2296         is compatible enough for them because it uses their injected bundle still.
2297
2298         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2299         (API::ProcessPoolConfiguration::copy):
2300         (API::ProcessPoolConfiguration::createWithLegacyOptions): Deleted.
2301         * UIProcess/API/APIProcessPoolConfiguration.h:
2302         * UIProcess/API/APIWebsiteDataStore.cpp:
2303         (API::WebsiteDataStore::createLegacy): Deleted.
2304         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration): Deleted.
2305         * UIProcess/API/APIWebsiteDataStore.h:
2306         * UIProcess/API/C/WKContext.cpp:
2307         (WKContextCreate):
2308         (WKContextCreateWithInjectedBundlePath):
2309         (WKContextGetWebsiteDataStore):
2310         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2311         (WKContextConfigurationCreate):
2312         (WKContextConfigurationCreateWithLegacyOptions):
2313         * UIProcess/API/C/WKContextConfigurationRef.h:
2314         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2315         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory): Deleted.
2316         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory): Deleted.
2317         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory): Deleted.
2318         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory): Deleted.
2319         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory): Deleted.
2320         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory): Deleted.
2321         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory): Deleted.
2322         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): Deleted.
2323         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory): Deleted.
2324         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2325         (-[WKProcessGroup initWithInjectedBundleURL:]):
2326         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2327         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory): Deleted.
2328         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory): Deleted.
2329         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory): Deleted.
2330         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory): Deleted.
2331         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory): Deleted.
2332         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory): Deleted.
2333         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory): Deleted.
2334         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): Deleted.
2335         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory): Deleted.
2336         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
2337         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory): Deleted.
2338         (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory): Deleted.
2339         (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory): Deleted.
2340         (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory): Deleted.
2341         (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory): Deleted.
2342         (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory): Deleted.
2343         (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory): Deleted.
2344         (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): Deleted.
2345         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory): Deleted.
2346         * UIProcess/WebInspectorUtilities.cpp:
2347         (WebKit::inspectorProcessPool):
2348         * UIProcess/WebProcessPool.cpp:
2349         (WebKit::m_webProcessCache):
2350         (WebKit::legacyWebsiteDataStoreConfiguration): Deleted.
2351         * UIProcess/WebProcessPool.h:
2352
2353 2019-09-07  Alex Christensen  <achristensen@webkit.org>
2354
2355         Fix Windows build
2356         https://bugs.webkit.org/show_bug.cgi?id=201517
2357
2358         * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
2359
2360 2019-09-07  Alex Christensen  <achristensen@webkit.org>
2361
2362         Remove calls to WKContextGetWebsiteDataStore missed in r249614
2363         https://bugs.webkit.org/show_bug.cgi?id=200050
2364
2365         It turns out I didn't need to introduce another way of clearing all cookies between tests.
2366         I just needed to make the call to WKHTTPCookieStoreDeleteAllCookies use the right WebsiteDataStore.
2367
2368         * NetworkProcess/NetworkProcess.cpp:
2369         (WebKit::NetworkProcess::clearCachedCredentials):
2370         * NetworkProcess/NetworkSession.h:
2371         (WebKit::NetworkSession::clearCredentials):
2372         (WebKit::NetworkSession::clearCookies): Deleted.
2373         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2374         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2375         (WebKit::NetworkSessionCocoa::clearCookies): Deleted.
2376
2377 2019-09-07  Alex Christensen  <achristensen@webkit.org>
2378
2379         Fix Windows build.
2380         https://bugs.webkit.org/show_bug.cgi?id=200050
2381
2382         * PlatformWin.cmake:
2383
2384 2019-09-07  Alex Christensen  <achristensen@webkit.org>
2385
2386         Fix Windows build.
2387         https://bugs.webkit.org/show_bug.cgi?id=201517
2388
2389         * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
2390
2391 2019-09-07  Alex Christensen  <achristensen@webkit.org>
2392
2393         Deprecate WKContextGetWebsiteDataStore
2394         https://bugs.webkit.org/show_bug.cgi?id=200050
2395
2396         Reviewed by Geoff Garen.
2397
2398         The last use of it was removed in rdar://problem/47030981
2399         In order to remove its use in WebKitTestRunner, I needed to make WKWebsiteDataStoreConfigurationRef
2400         to replace the WKContextConfigurationRef members that should've been associated with the WebsiteDataStore the whole time.
2401         There is one use of WKContextGetWebsiteDataStore in TestWebKitAPI still I'll investigate later.
2402
2403         * Shared/API/c/WKBase.h:
2404         * Sources.txt:
2405         * UIProcess/API/APIWebsiteDataStore.cpp:
2406         (API::WebsiteDataStore::create):
2407         * UIProcess/API/APIWebsiteDataStore.h:
2408         * UIProcess/API/C/WKAPICast.h:
2409         * UIProcess/API/C/WKContext.cpp:
2410         (WKContextGetApplicationCacheManager):
2411         (WKContextGetKeyValueStorageManager):
2412         (WKContextGetResourceCacheManager):
2413         * UIProcess/API/C/WKContext.h:
2414         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2415         (WKContextConfigurationCopyDiskCacheDirectory):
2416         (WKContextConfigurationSetDiskCacheDirectory):
2417         (WKContextConfigurationCopyApplicationCacheDirectory):
2418         (WKContextConfigurationSetApplicationCacheDirectory):
2419         (WKContextConfigurationCopyIndexedDBDatabaseDirectory):
2420         (WKContextConfigurationSetIndexedDBDatabaseDirectory):
2421         (WKContextConfigurationCopyLocalStorageDirectory):
2422         (WKContextConfigurationSetLocalStorageDirectory):
2423         (WKContextConfigurationCopyWebSQLDatabaseDirectory):
2424         (WKContextConfigurationSetWebSQLDatabaseDirectory):
2425         (WKContextConfigurationCopyMediaKeysStorageDirectory):
2426         (WKContextConfigurationSetMediaKeysStorageDirectory):
2427         (WKContextConfigurationCopyResourceLoadStatisticsDirectory):
2428         (WKContextConfigurationSetResourceLoadStatisticsDirectory):
2429         * UIProcess/API/C/WKContextConfigurationRef.h:
2430         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: Added.
2431         (WKWebsiteDataStoreConfigurationGetTypeID):
2432         (WKWebsiteDataStoreConfigurationCreate):
2433         (WKWebsiteDataStoreConfigurationCopyApplicationCacheDirectory):
2434         (WKWebsiteDataStoreConfigurationSetApplicationCacheDirectory):
2435         (WKWebsiteDataStoreConfigurationCopyNetworkCacheDirectory):
2436         (WKWebsiteDataStoreConfigurationSetNetworkCacheDirectory):
2437         (WKWebsiteDataStoreConfigurationCopyIndexedDBDatabaseDirectory):
2438         (WKWebsiteDataStoreConfigurationSetIndexedDBDatabaseDirectory):
2439         (WKWebsiteDataStoreConfigurationCopyLocalStorageDirectory):
2440         (WKWebsiteDataStoreConfigurationSetLocalStorageDirectory):
2441         (WKWebsiteDataStoreConfigurationCopyWebSQLDatabaseDirectory):
2442         (WKWebsiteDataStoreConfigurationSetWebSQLDatabaseDirectory):
2443         (WKWebsiteDataStoreConfigurationCopyMediaKeysStorageDirectory):
2444         (WKWebsiteDataStoreConfigurationSetMediaKeysStorageDirectory):
2445         (WKWebsiteDataStoreConfigurationCopyResourceLoadStatisticsDirectory):
2446         (WKWebsiteDataStoreConfigurationSetResourceLoadStatisticsDirectory):
2447         * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: Added.
2448         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2449         (WKWebsiteDataStoreCreateWithConfiguration):
2450         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2451         * WebKit.xcodeproj/project.pbxproj:
2452
2453 2019-09-06  Mark Lam  <mark.lam@apple.com>
2454
2455         Harden protection of the Gigacage Config parameters.
2456         https://bugs.webkit.org/show_bug.cgi?id=201570
2457         <rdar://problem/55134229>
2458
2459         Reviewed by Saam Barati.
2460
2461         Just renaming a function name here.
2462
2463         * WebProcess/WebProcess.cpp:
2464
2465 2019-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2466
2467         Incorrect selection rect revealed after pasting images in a contenteditable element
2468         https://bugs.webkit.org/show_bug.cgi?id=201549
2469         <rdar://problem/50956429>
2470
2471         Reviewed by Simon Fraser.
2472
2473         Tweak some existing logic to use the new visibleImageElementsInRangeWithNonLoadedImages helper function. See
2474         WebCore for more details.
2475
2476         * WebProcess/WebPage/ios/WebPageIOS.mm:
2477         (WebKit::WebPage::didConcludeEditDrag):
2478
2479 2019-09-06  Chris Dumez  <cdumez@apple.com>
2480
2481         Move the ResourceLoadObserver logic to WebKit2
2482         https://bugs.webkit.org/show_bug.cgi?id=201517
2483
2484         Reviewed by Brent Fulgham.
2485
2486         Move the ResourceLoadObserver logic to WebKit2 since it is not used by WebKit1. This allows us to simplify
2487         code.
2488
2489         In a follow-up patch, I will simplify the code even further by leveraging the fact that a WebContent process
2490         is always associated with a single WebsiteDataStore / sessionID:
2491         - No need for a HashMap of sessionIDs
2492         - No need to even allocate the ResourceLoadObserver if the WebProcess is associated with an ephemeral session.
2493
2494         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2495         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
2496         * NetworkProcess/NetworkConnectionToWebProcess.h:
2497         * Sources.txt:
2498         * WebKit.xcodeproj/project.pbxproj:
2499         * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp: Copied from Source/WebCore/loader/ResourceLoadObserver.cpp.
2500         (WebKit::is3xxRedirect):
2501         (WebKit::WebResourceLoadObserver::WebResourceLoadObserver):
2502         (WebKit::WebResourceLoadObserver::shouldLog const):
2503         (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener):
2504         (WebKit::WebResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
2505         (WebKit::WebResourceLoadObserver::scheduleNotificationIfNeeded):
2506         (WebKit::WebResourceLoadObserver::updateCentralStatisticsStore):
2507         (WebKit::WebResourceLoadObserver::statisticsForURL):
2508         (WebKit::WebResourceLoadObserver::takeStatistics):
2509         (WebKit::WebResourceLoadObserver::clearState):
2510         (WebKit::WebResourceLoadObserver::nonNullOwnerURL const):
2511         (WebKit::WebResourceLoadObserver::logFontLoad):
2512         (WebKit::WebResourceLoadObserver::logCanvasRead):
2513         (WebKit::WebResourceLoadObserver::logCanvasWriteOrMeasure):
2514         (WebKit::WebResourceLoadObserver::logNavigatorAPIAccessed):
2515         (WebKit::WebResourceLoadObserver::logScreenAPIAccessed):
2516         (WebKit::WebResourceLoadObserver::logSubresourceLoading):
2517         (WebKit::WebResourceLoadObserver::logWebSocketLoading):
2518         (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2519         * WebProcess/WebCoreSupport/WebResourceLoadObserver.h: Added.
2520         * WebProcess/WebProcess.cpp:
2521
2522 2019-09-06  Jiewen Tan  <jiewen_tan@apple.com>
2523
2524         [WebAuthn] Make WebAuthn default off and let clients turn it on at will
2525         https://bugs.webkit.org/show_bug.cgi?id=201439
2526         <rdar://problem/54998154>
2527
2528         Reviewed by Youenn Fablet.
2529
2530         This patch makes WebAuthn default off such that clients that have the right entitlements
2531         could turn it on and we don't risk at turning on a Web API that does nothing by default.
2532
2533         This patch doesn't add any SPI to turn the feature on as it is currently doable via
2534         - [WKPreferencesPrivate _setEnabled:forExperimentalFeature:].
2535
2536         * Shared/WebPreferences.yaml:
2537         * Shared/WebPreferencesDefaultValues.cpp:
2538         (WebKit::defaultWebAuthenticationEnabled): Deleted.
2539         * Shared/WebPreferencesDefaultValues.h:
2540
2541 2019-09-06  Alex Christensen  <achristensen@webkit.org>
2542
2543         Deprecate all WKCookieManagerRef functions
2544         https://bugs.webkit.org/show_bug.cgi?id=201473
2545
2546         Reviewed by Chris Dumez.
2547
2548         Their use was removed in rdar://problem/55039275
2549         Created replacement C API that more closely resembles the public ObjC API for WebKitTestRunner.
2550
2551         * Shared/API/c/WKBase.h:
2552         * Sources.txt:
2553         * UIProcess/API/APIHTTPCookieStore.cpp:
2554         (API::HTTPCookieStore::deleteAllCookies):
2555         (API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
2556         (API::HTTPCookieStore::deleteCookiesInDefaultUIProcessCookieStore):
2557         (API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore):
2558         * UIProcess/API/APIHTTPCookieStore.h:
2559         * UIProcess/API/C/WKAPICast.h:
2560         * UIProcess/API/C/WKContext.cpp:
2561         (WKContextSetStorageAccessAPIEnabled):
2562         * UIProcess/API/C/WKContext.h:
2563         * UIProcess/API/C/WKCookieManager.cpp:
2564         (WKCookieManagerGetTypeID):
2565         (WKCookieManagerSetClient):
2566         (WKCookieManagerGetHostnamesWithCookies):
2567         (WKCookieManagerDeleteCookiesForHostname):
2568         (WKCookieManagerDeleteAllCookies):
2569         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
2570         (WKCookieManagerSetHTTPCookieAcceptPolicy):
2571         (WKCookieManagerGetHTTPCookieAcceptPolicy):
2572         (WKCookieManagerSetStorageAccessAPIEnabled):
2573         (WKCookieManagerStartObservingCookieChanges):
2574         (WKCookieManagerStopObservingCookieChanges):
2575         * UIProcess/API/C/WKCookieManager.h:
2576         * UIProcess/API/C/WKHTTPCookieStoreRef.cpp: Added.
2577         (WKHTTPCookieStoreGetTypeID):
2578         (WKHTTPCookieStoreDeleteAllCookies):
2579         (WKHTTPCookieStoreSetHTTPCookieAcceptPolicy):
2580         * UIProcess/API/C/WKHTTPCookieStoreRef.h: Added.
2581         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2582         (WKWebsiteDataStoreGetHTTPCookieStore):
2583         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2584         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
2585         (API::HTTPCookieStore::deleteCookiesInDefaultUIProcessCookieStore):
2586         (API::toNSHTTPCookieAcceptPolicy):
2587         (API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore):
2588         * UIProcess/WebCookieManagerProxy.cpp:
2589         (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled): Deleted.
2590         * UIProcess/WebCookieManagerProxy.h:
2591         * WebKit.xcodeproj/project.pbxproj:
2592
2593 2019-09-06  Darryl Pogue  <darryl@dpogue.ca>
2594
2595         REGRESSION(iOS 12): Keyboard dismissal leaves WKWebView viewport-fit=cover content offscreen
2596         https://bugs.webkit.org/show_bug.cgi?id=192564
2597
2598         Reviewed by Tim Horton.
2599
2600         The new keyboard height was being read into a variable after the scrollview had already been
2601         adjusted. This worked when the keyboard was opening, because the scrollview is adjusted with
2602         the correct value a second time when the keyboard animation has finished. However, when the
2603         keyboard is closed, the adjustment was being made before the correct height was stored,
2604         leading to the scrollview being positioned as if the keyboard were still open.
2605
2606         * UIProcess/ios/WKScrollView.mm:
2607         (-[WKScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:]):
2608
2609 2019-09-06  Tim Horton  <timothy_horton@apple.com>
2610
2611         Marking up a note on iOS results in a PDF with no contents
2612         https://bugs.webkit.org/show_bug.cgi?id=201530
2613         <rdar://problem/53686019>
2614
2615         Reviewed by Andy Estes.
2616
2617         * Platform/IPC/Connection.cpp:
2618         (IPC::Connection::Connection):
2619         (IPC::Connection::waitForMessage):
2620         (IPC::Connection::connectionDidClose):
2621         * Platform/IPC/Connection.h:
2622         If the main thread is blocked when the Web Content process dies, and
2623         something eventually calls waitForAndDispatchImmediately without
2624         returning control to the main run loop, we will wait for the full timeout,
2625         because a) the code to mark the connection invalid is dispatched
2626         to the main thread, and b) the secondary thread that is informed of
2627         the Web Content process dying did not yet have a "waiting for" message
2628         to mark as interrupted (because it wasn't waiting yet).
2629
2630         Fix this race by adding a bit that is set under the waitForMessage lock
2631         on the secondary thread when the connection is invalidated, identically
2632         to m_shouldWaitForSyncReplies, which solves the same problem for sync
2633         messages.
2634
2635         Read the new bit when we are about to start waiting, and bail if it is set.
2636         It's OK to not read it inside the loop because we are guaranteed to have
2637         waitForMessage set at that point, so the normal interruption bit will work.
2638
2639         * UIProcess/ios/WKContentView.mm:
2640         (-[WKContentView _processDidExit]):
2641         Reset _isPrintingToPDF; the Web Content process is never going to get
2642         back to us if it crashes.
2643
2644         (-[WKContentView _wk_pageCountForPrintFormatter:]):
2645         Do not bail from starting a printing operation if one is already occurring.
2646         This fixes the original bug, because Markup ends up invalidating the page
2647         count at least one extra time before asking for the printed document.
2648         Instead of maintaining the fragile requirement that you cannot recompute
2649         the page count while printing, just let it happen. In order to make this
2650         work safely, synchronously wait for the previous printed result before
2651         continuing with the next print.
2652
2653         We could do more coalescing here if need be, but calls to -_recalcPageCount
2654         are not high in volume.
2655
2656 2019-09-06  Alex Christensen  <achristensen@webkit.org>
2657
2658         Fix unused argument warning from GCC.
2659
2660         * Platform/IPC/ArgumentCoders.h:
2661         (IPC::TupleDecoder<0>::decode):
2662         There was indeed an unused argument.
2663
2664 2019-09-06  Alex Christensen  <achristensen@webkit.org>
2665
2666         When disabling legacy private browsing for testing, change the SessionID back to what it was, not the defaultSessionID
2667         https://bugs.webkit.org/show_bug.cgi?id=201480
2668
2669         Reviewed by Youenn Fablet.
2670
2671         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2672         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2673         * WebProcess/InjectedBundle/InjectedBundle.h:
2674
2675 2019-09-06  Patrick Griffis  <pgriffis@igalia.com>
2676
2677         [GTK][WPE] Do not enable the sandbox in Snap
2678         https://bugs.webkit.org/show_bug.cgi?id=201486
2679
2680         Reviewed by Carlos Garcia Campos.
2681
2682         Running inside of Snap adds its own complications and is simply
2683         not supported for now.
2684
2685         Also update isInsideFlatpak() for consistency.
2686
2687         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2688         (WebKit::isInsideFlatpak):
2689         (WebKit::isInsideSnap):
2690         (WebKit::ProcessLauncher::launchProcess):
2691
2692 2019-09-05  Joseph Pecoraro  <pecoraro@apple.com>
2693
2694         Web Inspector: Crashes when intercept response is a 404
2695         https://bugs.webkit.org/show_bug.cgi?id=201514
2696
2697         Reviewed by Alex Christensen.
2698
2699         * WebProcess/Network/WebResourceLoader.cpp:
2700         (WebKit::WebResourceLoader::didReceiveResponse):
2701         Ensure the WebResourceLoader stays around during intercepts.
2702
2703         (WebKit::WebResourceLoader::didReceiveData):
2704         (WebKit::WebResourceLoader::didFinishResourceLoad):
2705         (WebKit::WebResourceLoader::didFailResourceLoad):
2706         Only perform the work if the m_coreLoader is still alive.
2707
2708 2019-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>
2709
2710         [Win] Add support for MouseEvent.buttons
2711         https://bugs.webkit.org/show_bug.cgi?id=201445
2712
2713         Reviewed by Brent Fulgham.
2714
2715         * Shared/win/WebEventFactory.cpp:
2716         (WebKit::WebEventFactory::createWebMouseEvent):
2717         Set m_buttons.
2718
2719 2019-09-05  Chris Dumez  <cdumez@apple.com>
2720
2721         REGRESSION: http/tests/adClickAttribution/second-attribution-converted-with-higher-priority.html and http/tests/adClickAttribution/second-attribution-converted-with-lower-priority.html are flaky timeouts
2722         https://bugs.webkit.org/show_bug.cgi?id=201440
2723         <rdar://problem/54998427>
2724
2725         Reviewed by Alex Christensen.
2726
2727         Add private WKBundlePage API to query if the WebPage is currently suspended or not.
2728
2729         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2730         (WKBundlePageIsSuspended):
2731         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2732
2733 2019-09-05  Sihui Liu  <sihui_liu@apple.com>
2734
2735         Remove StorageArea pointers in StorageManagerSet when removing StorageManagers that own them
2736         https://bugs.webkit.org/show_bug.cgi?id=201324
2737
2738         Reviewed by Alex Christensen.
2739
2740         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
2741         (WebKit::LocalStorageNamespace::storageAreaIdentifiers const):
2742         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
2743         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
2744         (WebKit::SessionStorageNamespace::storageAreaIdentifiers const):
2745         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
2746         * NetworkProcess/WebStorage/StorageManager.cpp:
2747         (WebKit::StorageManager::allStorageAreaIdentifiers const):
2748         * NetworkProcess/WebStorage/StorageManager.h:
2749         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
2750         (WebKit::StorageManagerSet::remove):
2751         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
2752         (WebKit::TransientLocalStorageNamespace::storageAreaIdentifiers const):
2753         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:
2754
2755 2019-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2756
2757         REGRESSION(r249275): [GTK][WPE] wrong page ID returned by webkit_web_view_get_page_id()
2758         https://bugs.webkit.org/show_bug.cgi?id=201504
2759
2760         Reviewed by Michael Catanzaro.
2761
2762         We want to return the page identifier not the web page proxy id.
2763
2764         * UIProcess/API/glib/WebKitWebView.cpp:
2765         (webkit_web_view_get_page_id):
2766
2767 2019-09-05  Pablo Saavedra  <psaavedra@igalia.com>
2768
2769         Build failure after r249501 for ports with SERVICE_WORKER set OFF
2770         https://bugs.webkit.org/show_bug.cgi?id=201503
2771
2772         Reviewed by Youenn Fablet.
2773
2774         * WebProcess/Network/WebLoaderStrategy.cpp:
2775         (WebKit::WebLoaderStrategy::scheduleLoad):
2776
2777 2019-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2778
2779         MobileSafari may crash when invoking the C++ lambda in -[WKContentView _shareForWebView:]
2780         https://bugs.webkit.org/show_bug.cgi?id=201479
2781         <rdar://problem/51511834>
2782
2783         Reviewed by Tim Horton.
2784
2785         Fix the crash by making -_shareForWebView: robust in the case where there are no selection rects
2786         known in the UI process when -[WKContentView _share:] is invoked.
2787
2788         * UIProcess/ios/WKContentViewInteraction.mm:
2789         (-[WKContentView _shareForWebView:]):
2790
2791 2019-09-04  Ryosuke Niwa  <rniwa@webkit.org>
2792
2793         Replace defaultCustomPasteboardDataEnabled by an equivalent macro
2794         https://bugs.webkit.org/show_bug.cgi?id=201477
2795
2796         Reviewed by Wenson Hsieh.
2797
2798         r227282 introduced defaultCustomPasteboardDataEnabled() to disable the custom pasteboard data on
2799         apps linked against old SDKs. However, this had a bug that the check inside WebContent process
2800         would always return true because WebContent process is always linked against the latest SDKs.
2801         Because WebPreferences values aren't propagated from UI process to WebContent process unless
2802         there is a value change, it meant that custom pasteboard data is always enabled.
2803
2804         This patch replaces this function with a simple macro which always enables the custom pasteboard
2805         data on iOS family and macOS as it has always been the case before and after r227282.
2806
2807         * Shared/WebPreferences.yaml:
2808         * Shared/WebPreferencesDefaultValues.cpp:
2809         (WebKit::defaultCustomPasteboardDataEnabled): Deleted.
2810         * Shared/WebPreferencesDefaultValues.h:
2811
2812 2019-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2813
2814         -[WKContentView selectedText] returns an empty string when selecting more than 200 characters
2815         https://bugs.webkit.org/show_bug.cgi?id=201471
2816         <rdar://problem/55039227>
2817
2818         Reviewed by Tim Horton.
2819
2820         The fix for <rdar://problem/54308019> is contingent on -[WKContentView selectedText] returning a non-empty
2821         result in the case where text is selected. However, in WebKit, if more than 200 characters are selected,
2822         -selectedText ends up returning nothing.
2823
2824         This is due to logic added in trac.webkit.org/r167624 that was intended to return the selected text in
2825         PostLayoutData's wordAtSelection, up to a maximum of 200 characters, likely for performance and/or security
2826         reasons. However, instead of truncating at 200 characters, the change simply drops wordAtSelection altogether.
2827         This patch fixes this issue by taking the first 200 characters of the selected text.
2828
2829         Test: EditorStateTests.SelectedText
2830
2831         * WebProcess/WebPage/ios/WebPageIOS.mm:
2832         (WebKit::WebPage::platformEditorState const):
2833
2834 2019-09-04  Joseph Pecoraro  <pecoraro@apple.com>
2835
2836         Web Inspector: Local Overrides - Provide substitution content for resource loads (URL based)
2837         https://bugs.webkit.org/show_bug.cgi?id=201262
2838         <rdar://problem/13108764>
2839
2840         Reviewed by Devin Rousso.
2841
2842         * Sources.txt:
2843         * WebKit.xcodeproj/project.pbxproj:
2844         New sources.
2845
2846         * WebProcess/Network/WebResourceLoader.h:
2847         * WebProcess/Network/WebResourceLoader.cpp:
2848         (WebKit::WebResourceLoader::didReceiveResponse):
2849         (WebKit::WebResourceLoader::didReceiveData):
2850         (WebKit::WebResourceLoader::didFinishResourceLoad):
2851         (WebKit::WebResourceLoader::didFailResourceLoad):
2852         On receiving a response, check with the inspector if an active
2853         frontend will override the response content.
2854
2855         * WebProcess/Network/WebResourceInterceptController.h:
2856         * WebProcess/Network/WebResourceInterceptController.cpp:
2857         (WebKit::WebResourceInterceptController::isIntercepting const):
2858         (WebKit::WebResourceInterceptController::beginInterceptingResponse):
2859         (WebKit::WebResourceInterceptController::continueResponse):
2860         (WebKit::WebResourceInterceptController::interceptedResponse):
2861         (WebKit::WebResourceInterceptController::defer):
2862         Buffer networking callbacks for an ongoing intercept.
2863
2864         * WebProcess/Network/WebLoaderStrategy.cpp:
2865         (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
2866         Handle new response source.
2867
2868 2019-09-04  Chris Dumez  <cdumez@apple.com>
2869
2870         Unreviewed minor follow-up fix after r249501 to address crashes in debug.
2871
2872         * NetworkProcess/cache/NetworkCache.h:
2873         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::constructDeletedValue):
2874         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::isDeletedValue):
2875
2876 2019-09-04  Chris Dumez  <cdumez@apple.com>
2877
2878         Expose WebPageProxy identifier to the Network Process
2879         https://bugs.webkit.org/show_bug.cgi?id=201467
2880
2881         Reviewed by Geoffrey Garen.
2882
2883         Expose WebPageProxy identifier to the Network Process (similarly to WebPage / WebFrame identifiers)
2884         so that it can use it whenever it IPCs the UIProcess. The IPCs from the network process were the
2885         last one requiring the UIProcess to lookup a WebPageProxy object from a WebPageIdentifier (rather
2886         than a WebPageProxyIdentifier).
2887
2888         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2889         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2890         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2891         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2892         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
2893         * NetworkProcess/NetworkCORSPreflightChecker.h:
2894         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2895         (WebKit::NetworkConnectionToWebProcess::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
2896         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
2897         * NetworkProcess/NetworkConnectionToWebProcess.h:
2898         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2899         * NetworkProcess/NetworkLoad.cpp:
2900         (WebKit::NetworkLoad::didReceiveChallenge):
2901         * NetworkProcess/NetworkLoadChecker.cpp:
2902         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2903         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
2904         * NetworkProcess/NetworkLoadChecker.h:
2905         * NetworkProcess/NetworkLoadParameters.h:
2906         * NetworkProcess/NetworkProcess.cpp:
2907         (WebKit::NetworkProcess::didCommitCrossSiteLoadWithDataTransfer):
2908         (WebKit::NetworkProcess::logDiagnosticMessage):
2909         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
2910         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
2911         * NetworkProcess/NetworkProcess.h:
2912         * NetworkProcess/NetworkProcess.messages.in:
2913         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2914         (WebKit::NetworkResourceLoadParameters::encode const):
2915         (WebKit::NetworkResourceLoadParameters::decode):
2916         * NetworkProcess/NetworkResourceLoader.cpp:
2917         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
2918         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2919         (WebKit::NetworkResourceLoader::startNetworkLoad):
2920         (WebKit::NetworkResourceLoader::didReceiveResponse):
2921         * NetworkProcess/NetworkResourceLoader.h:
2922         * NetworkProcess/PingLoad.cpp:
2923         (WebKit::PingLoad::PingLoad):
2924         (WebKit::PingLoad::didReceiveChallenge):
2925         * NetworkProcess/cache/NetworkCache.h:
2926         (WebKit::NetworkCache::GlobalFrameID::hash const):
2927         (WebKit::NetworkCache::operator==):
2928         (WTF::GlobalFrameIDHash::hash):
2929         (WTF::GlobalFrameIDHash::equal):
2930         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::emptyValue):
2931         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::constructDeletedValue):
2932         (WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::isDeletedValue):
2933         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2934         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2935         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2936         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
2937         * Shared/Authentication/AuthenticationManager.cpp:
2938         (WebKit::AuthenticationManager::shouldCoalesceChallenge const):
2939         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2940         * Shared/Authentication/AuthenticationManager.h:
2941         * UIProcess/Network/NetworkProcessProxy.cpp:
2942         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2943         (WebKit::NetworkProcessProxy::logDiagnosticMessage):
2944         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
2945         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
2946         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
2947         (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransfer):
2948         (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
2949         (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
2950         * UIProcess/Network/NetworkProcessProxy.h:
2951         * UIProcess/Network/NetworkProcessProxy.messages.in:
2952         * UIProcess/ServiceWorkerProcessProxy.cpp:
2953         (WebKit::ServiceWorkerProcessProxy::start):
2954         * UIProcess/ServiceWorkerProcessProxy.h:
2955         * UIProcess/WebPageProxy.cpp:
2956         (WebKit::WebPageProxy::didCommitLoadForFrame):
2957         * UIProcess/WebProcessPool.cpp:
2958         (WebKit::WebProcessPool::isServiceWorkerPageID const):
2959         (WebKit::WebProcessPool::didCommitCrossSiteLoadWithDataTransfer):
2960         * UIProcess/WebProcessPool.h:
2961         * UIProcess/WebProcessProxy.cpp:
2962         * UIProcess/WebProcessProxy.h:
2963         * WebProcess/Network/WebLoaderStrategy.cpp:
2964         (WebKit::WebLoaderStrategy::scheduleLoad):
2965         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2966         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
2967         (WebKit::WebLoaderStrategy::preconnectTo):
2968         * WebProcess/Network/WebResourceLoader.h:
2969         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2970         (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
2971         (WebKit::ServiceWorkerFrameLoaderClient::createDocumentLoader):
2972         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
2973         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2974         * WebProcess/Storage/WebSWContextManagerConnection.h:
2975         (isType):
2976         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2977         (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
2978         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2979         (WebKit::WebFrameLoaderClient::webPageProxyID const):
2980         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2981         * WebProcess/WebPage/WebPage.cpp:
2982         (WebKit::WebPage::requestStorageAccess):
2983         * WebProcess/WebProcess.cpp:
2984         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
2985         * WebProcess/WebProcess.h:
2986         * WebProcess/WebProcess.messages.in:
2987
2988 2019-09-04  Tim Horton  <timothy_horton@apple.com>
2989
2990         macCatalyst: Re-enable iOS WKWebView printing API
2991         https://bugs.webkit.org/show_bug.cgi?id=201392
2992         <rdar://problem/54690252>
2993
2994         Reviewed by Wenson Hsieh.
2995
2996         * UIProcess/API/Cocoa/WKWebView.mm:
2997         (-[WKWebView _webViewPrintFormatter]):
2998         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2999         * UIProcess/_WKWebViewPrintFormatter.mm:
3000         * UIProcess/_WKWebViewPrintFormatterInternal.h:
3001         * UIProcess/ios/WKContentView.mm:
3002         _WKWwebViewPrintFormatter was disabled during bringup because requisite
3003         UIKit bits were missing, but they are not anymore (and have not been for
3004         quite some time), so remove these unnecessary platform ifdefs.
3005
3006 2019-09-04  Patrick Griffis  <pgriffis@igalia.com>
3007
3008         [WPE][GTK] Fix sandbox parsing DISPLAY on X11
3009         https://bugs.webkit.org/show_bug.cgi?id=201462
3010
3011         Reviewed by Michael Catanzaro.
3012
3013         On some setups the DISPLAY env var was incorrectly parsed.
3014
3015         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3016         (WebKit::bindX11):
3017
3018 2019-09-04  Brian Burg  <bburg@apple.com>
3019
3020         Selenium test 'interactions_tests.py::testContextClick' is hanging
3021         https://bugs.webkit.org/show_bug.cgi?id=201161
3022         <rdar://problem/54728541>
3023
3024         Reviewed by Chris Dumez.
3025
3026         A web page should not show native context menus if user interactions are being simulated for WebDriver.
3027         Showing a native context menu spawns a nested run loop. Since there's no way to interact
3028         with native UI via WebDriver, the test will hang until the context menu is manually dismissed.
3029
3030         To fix this, pretend to show the context menu in UIProcess and dismiss it immediately.
3031         This is necessary to trigger oncontextmenu events appropriately and resume handling mouse events.
3032
3033         * UIProcess/WebPageProxy.cpp:
3034         (WebKit::WebPageProxy::showContextMenu): Hook into isControlledByAutomation here.
3035         We could short circuit this on the WebProcess side, but the check would be more crude
3036         and suppress context menus even if user interaction isn't being simulated. This would be
3037         problematic for a user who wants to interrupt their test session and interact with it.
3038         The main use case for this is right clicking on the test page and choose "Inspect".
3039
3040 2019-09-04  Youenn Fablet  <youenn@apple.com>
3041
3042         Abstract out WebSocketChannel message queue
3043         https://bugs.webkit.org/show_bug.cgi?id=201359
3044
3045         Reviewed by Alex Christensen.
3046
3047         Make use of newly added NetworkSendQueue.
3048
3049         * WebProcess/Network/WebSocketChannel.cpp:
3050         (WebKit::WebSocketChannel::createMessageQueue):
3051         (WebKit::WebSocketChannel::WebSocketChannel):
3052         (WebKit::WebSocketChannel::send):
3053         (WebKit::WebSocketChannel::disconnect):
3054         * WebProcess/Network/WebSocketChannel.h:
3055
3056 2019-09-04  Youenn Fablet  <youenn@apple.com>
3057
3058         Move MessageRegistry to NetworkProcess
3059         https://bugs.webkit.org/show_bug.cgi?id=201299
3060
3061         Reviewed by Alex Christensen.
3062
3063         Move message registry to NetworkProcess.
3064         Take benefit of this move to use async reply IPC as much as possible.
3065         This also allows to remove the IPC message to UIProcess when doing postMessage with service workers.
3066
3067         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3068         (WebKit::NetworkConnectionToWebProcess::createNewMessagePortChannel):
3069         (WebKit::NetworkConnectionToWebProcess::entangleLocalPortInThisProcessToRemote):
3070         (WebKit::NetworkConnectionToWebProcess::messagePortDisentangled):
3071         (WebKit::NetworkConnectionToWebProcess::messagePortClosed):
3072         (WebKit::NetworkConnectionToWebProcess::nextMessageBatchIdentifier):
3073         (WebKit::NetworkConnectionToWebProcess::takeAllMessagesForPort):
3074         (WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages):
3075         (WebKit::NetworkConnectionToWebProcess::postMessageToRemote):
3076         (WebKit::NetworkConnectionToWebProcess::checkRemotePortForActivity):
3077         (WebKit::NetworkConnectionToWebProcess::checkProcessLocalPortForActivity):
3078         * NetworkProcess/NetworkConnectionToWebProcess.h:
3079         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3080         * NetworkProcess/NetworkMessagePortChannelProvider.cpp: Added.
3081         (WebKit::NetworkMessagePortChannelProvider::NetworkMessagePortChannelProvider):
3082         (WebKit::NetworkMessagePortChannelProvider::createNewMessagePortChannel):
3083         (WebKit::NetworkMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
3084         (WebKit::NetworkMessagePortChannelProvider::messagePortDisentangled):
3085         (WebKit::NetworkMessagePortChannelProvider::messagePortClosed):
3086         (WebKit::NetworkMessagePortChannelProvider::takeAllMessagesForPort):
3087         (WebKit::NetworkMessagePortChannelProvider::postMessageToRemote):
3088         (WebKit::NetworkMessagePortChannelProvider::checkRemotePortForActivity):
3089         (WebKit::NetworkMessagePortChannelProvider::checkProcessLocalPortForActivity):
3090         * NetworkProcess/NetworkMessagePortChannelProvider.h: Added.
3091         * NetworkProcess/NetworkProcess.cpp:
3092         (WebKit::m_messagePortChannelProvider):
3093         (WebKit::NetworkProcess::webProcessConnection const):
3094         * NetworkProcess/NetworkProcess.h:
3095         (WebKit::NetworkProcess::messagePortChannelRegistry):
3096         * Sources.txt:
3097         * UIProcess/Downloads/DownloadProxyMap.cpp:
3098         * UIProcess/WebPageProxy.cpp:
3099         * UIProcess/WebProcessPool.cpp:
3100         * UIProcess/WebProcessPool.h:
3101         * UIProcess/WebProcessPool.messages.in:
3102         * UIProcess/WebProcessProxy.cpp:
3103         (WebKit::WebProcessProxy::~WebProcessProxy):
3104         (WebKit::WebProcessProxy::shutDown):
3105         * UIProcess/WebProcessProxy.h:
3106         * UIProcess/WebProcessProxy.messages.in:
3107         * WebKit.xcodeproj/project.pbxproj:
3108         * WebProcess/Network/NetworkProcessConnection.cpp:
3109         (WebKit::NetworkProcessConnection::initializeSWClientConnection):
3110         (WebKit::NetworkProcessConnection::messagesAvailableForPort):
3111         (WebKit::NetworkProcessConnection::checkProcessLocalPortForActivity):
3112         * WebProcess/Network/NetworkProcessConnection.h:
3113         * WebProcess/Network/NetworkProcessConnection.messages.in:
3114         * WebProcess/Storage/WebSWClientConnection.cpp:
3115         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
3116         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3117         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
3118         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
3119         (WebKit::networkProcessConnection):
3120         (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
3121         (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
3122         (WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
3123         (WebKit::WebMessagePortChannelProvider::messagePortClosed):
3124         (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
3125         (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
3126         (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
3127         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
3128         * WebProcess/WebProcess.cpp:
3129         * WebProcess/WebProcess.h:
3130         * WebProcess/WebProcess.messages.in:
3131
3132 2019-09-03  Per Arne Vollan  <pvollan@apple.com>
3133
3134         [macOS] Unable to open local file from favorites bar
3135         https://bugs.webkit.org/show_bug.cgi?id=201444
3136
3137         Reviewed by Brent Fulgham.
3138
3139         The sandbox extension handle should be created providing the pid of the receiving process.
3140
3141         * UIProcess/WebPageProxy.cpp:
3142         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3143
3144 2019-09-03  Chris Dumez  <cdumez@apple.com>
3145
3146         FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
3147         https://bugs.webkit.org/show_bug.cgi?id=201431
3148
3149         Reviewed by Antti Koivisto.
3150
3151         * WebProcess/Network/WebLoaderStrategy.cpp:
3152         (WebKit::WebLoaderStrategy::pageLoadCompleted):
3153         * WebProcess/Network/WebLoaderStrategy.h:
3154
3155 2019-09-03  Tim Horton  <timothy_horton@apple.com>
3156
3157         Null deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler block
3158         https://bugs.webkit.org/show_bug.cgi?id=201436
3159         <rdar://problem/40640475>
3160
3161         Reviewed by Simon Fraser.
3162
3163         * UIProcess/API/Cocoa/WKWebView.mm:
3164         (-[WKWebView dealloc]):
3165         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
3166         We crash sending a message to a deallocated WKWebView inside the handler block
3167         passed to +[CATransaction addCommitHandler:]. This seems impossible, because
3168         we carefully retain it, but it's possible that it could be the result of
3169         the handler block being installed under -dealloc (in which case retaining
3170         the WKWebView wouldn't actually extend its lifetime). -[WKWebView dealloc]
3171         is fairly sizable, and it's hard to follow all paths from it, so instead
3172         add a RELEASE_LOG_FAULT, so we'll get simulated crash logs, and bail,
3173         so we'll stop actually crashing (if this is the cause).
3174
3175         This is just a speculative fix, but a hopeful one, since intentionally calling
3176         -_addUpdateVisibleContentRectPreCommitHandler: from dealloc yields a similar-looking
3177         crash under the handler block.
3178
3179 2019-09-03  Jiewen Tan  <jiewen_tan@apple.com>
3180
3181         [WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
3182         https://bugs.webkit.org/show_bug.cgi?id=201369
3183         <rdar://problem/54903724>
3184
3185         Reviewed by Brent Fulgham.
3186
3187         Communications to security keys require entitlements, which are not guaranteed to be present in third party
3188         WKWebView clients. Therefore, only enable WebAuthn by default for MobileSafari and SafariViewService.
3189
3190         * Shared/WebPreferences.yaml:
3191         * Shared/WebPreferencesDefaultValues.cpp:
3192         (WebKit::defaultWebAuthenticationEnabled):
3193         * Shared/WebPreferencesDefaultValues.h:
3194
3195 2019-09-03  Chris Dumez  <cdumez@apple.com>
3196
3197         Rename WebPage::pageID() to WebPage::identifier()
3198         https://bugs.webkit.org/show_bug.cgi?id=201428
3199
3200         Reviewed by Antti Koivisto.
3201
3202         * Shared/API/Cocoa/WKBrowsingContextHandle.mm:
3203         (-[WKBrowsingContextHandle _initWithPage:]):
3204         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
3205         (WebKit::WebPaymentCoordinator::WebPaymentCoordinator):
3206         (WebKit::WebPaymentCoordinator::showPaymentUI):
3207         (WebKit::WebPaymentCoordinator::messageSenderDestinationID const):
3208         * WebProcess/Network/WebLoaderStrategy.cpp:
3209         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3210         (WebKit::WebLoaderStrategy::preconnectTo):
3211         * WebProcess/Notifications/WebNotificationManager.cpp:
3212         (WebKit::WebNotificationManager::show):
3213         (WebKit::WebNotificationManager::cancel):
3214         (WebKit::WebNotificationManager::clearNotifications):
3215         (WebKit::WebNotificationManager::didDestroyNotification):
3216         * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
3217         (WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator):
3218         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3219         (WebKit::WebChromeClient::windowRect):
3220         (WebKit::WebChromeClient::focusedFrameChanged):
3221         (WebKit::WebChromeClient::createWindow):
3222         (WebKit::WebChromeClient::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
3223         (WebKit::WebChromeClient::toolbarsVisible):
3224         (WebKit::WebChromeClient::statusbarVisible):
3225         (WebKit::WebChromeClient::menubarVisible):
3226         (WebKit::WebChromeClient::wrapCryptoKey const):
3227         (WebKit::WebChromeClient::unwrapCryptoKey const):
3228         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
3229         * WebProcess/WebCoreSupport/WebColorChooser.cpp:
3230         (WebKit::WebColorChooser::WebColorChooser):
3231         (WebKit::WebColorChooser::reattachColorChooser):
3232         (WebKit::WebColorChooser::setSelectedColor):
3233         (WebKit::WebColorChooser::endChooser):
3234         * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
3235         (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
3236         (WebKit::WebDataListSuggestionPicker::close):
3237         (WebKit::WebDataListSuggestionPicker::displayWithActivationType):
3238         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3239         (WebKit::WebFrameLoaderClient::pageID const):
3240         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
3241         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
3242         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
3243         (WebKit::WebPopupMenu::show):
3244         (WebKit::WebPopupMenu::hide):
3245         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
3246         (WebKit::WebSearchPopupMenu::saveRecentSearches):
3247         (WebKit::WebSearchPopupMenu::loadRecentSearches):
3248         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
3249         (WebKit::WebFrameLoaderClient::createPreviewLoaderClient):
3250         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
3251         (WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
3252         (WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
3253         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
3254         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
3255         (WebKit::WebRemoteObjectRegistry::close):
3256         * WebProcess/WebPage/EventDispatcher.cpp:
3257         (WebKit::EventDispatcher::addScrollingTreeForPage):
3258         (WebKit::EventDispatcher::removeScrollingTreeForPage):
3259         (WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
3260         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
3261         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3262         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3263         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3264         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
3265         (WebKit::RemoteScrollingCoordinator::RemoteScrollingCoordinator):
3266         (WebKit::RemoteScrollingCoordinator::~RemoteScrollingCoordinator):
3267         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
3268         (WebKit::RemoteWebInspectorUI::sendMessageToBackend):
3269         (WebKit::RemoteWebInspectorUI::changeSheetRect):
3270         (WebKit::RemoteWebInspectorUI::startWindowDrag):
3271         (WebKit::RemoteWebInspectorUI::bringToFront):
3272         (WebKit::RemoteWebInspectorUI::closeWindow):
3273         (WebKit::RemoteWebInspectorUI::reopen):
3274         (WebKit::RemoteWebInspectorUI::resetState):
3275         (WebKit::RemoteWebInspectorUI::openInNewTab):
3276         (WebKit::RemoteWebInspectorUI::save):
3277         (WebKit::RemoteWebInspectorUI::append):
3278         (WebKit::RemoteWebInspectorUI::showCertificate):
3279         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3280         (WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
3281         (WebKit::ViewGestureGeometryCollector::~ViewGestureGeometryCollector):
3282         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3283         (WebKit::WebBackForwardListProxy::itemAtIndex):
3284         (WebKit::WebBackForwardListProxy::backListCount const):
3285         (WebKit::WebBackForwardListProxy::forwardListCount const):
3286         * WebProcess/WebPage/WebInspector.cpp:
3287         (WebKit::WebInspector::openLocalInspectorFrontend):
3288         (WebKit::WebInspector::closeFrontendConnection):
3289         (WebKit::WebInspector::bringToFront):
3290         (WebKit::WebInspector::elementSelectionChanged):
3291         (WebKit::WebInspector::timelineRecordingChanged):
3292         (WebKit::WebInspector::setMockCaptureDevicesEnabledOverride):
3293         (WebKit::WebInspector::updateDockingAvailability):
3294         * WebProcess/WebPage/WebPage.cpp:
3295         (WebKit::WebPage::WebPage):
3296         (WebKit::m_textAutoSizingAdjustmentTimer):
3297         (WebKit::WebPage::messageSenderDestinationID const):
3298         (WebKit::WebPage::close):
3299         (WebKit::WebPage::goToBackForwardItem):
3300         (WebKit::WebPage::setFixedLayoutSize):
3301         (WebKit::WebPage::freezeLayerTree):
3302         (WebKit::WebPage::unfreezeLayerTree):
3303         (WebKit::WebPage::restoreSessionInternal):
3304         (WebKit::WebPage::setCurrentHistoryItemForReattach):
3305         (WebKit::WebPage::updateIsInWindow):
3306         (WebKit::WebPage::setActivityState):
3307         (WebKit::WebPage::mainFrameDidLayout):
3308         (WebKit::WebPage::didCommitLoad):
3309         (WebKit::WebPage::hasStorageAccess):
3310         (WebKit::WebPage::requestStorageAccess):
3311         (WebKit::WebPage::textInputContextsInRect):
3312         (WebKit::WebPage::elementForTextInputContext):
3313         * WebProcess/WebPage/WebPage.h:
3314         (WebKit::WebPage::identifier const):
3315         (WebKit::WebPage::pageID const): Deleted.
3316         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
3317         (WebKit::WebPageInspectorTarget::identifier const):
3318         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3319         (-[WKAccessibilityWebPageObjectBase setWebPage:]):
3320         * WebProcess/WebPage/mac/WebPageMac.mm:
3321         (WebKit::WebPage::executeKeypressCommandsInternal):
3322         * WebProcess/WebProcess.cpp:
3323         (WebKit::WebProcess::transformObjectsToHandles):
3324         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
3325         (WebKit::StorageNamespaceImpl::copy):
3326         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
3327         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
3328         * WebProcess/cocoa/PlaybackSessionManager.mm:
3329         (WebKit::PlaybackSessionManager::PlaybackSessionManager):
3330         (WebKit::PlaybackSessionManager::~PlaybackSessionManager):
3331         (WebKit::PlaybackSessionManager::invalidate):
3332         * WebProcess/cocoa/VideoFullscreenManager.mm:
3333         (WebKit::VideoFullscreenManager::VideoFullscreenManager):
3334         (WebKit::VideoFullscreenManager::~VideoFullscreenManager):
3335         (WebKit::VideoFullscreenManager::invalidate):
3336
3337 2019-09-03  Antoine Quint  <graouts@apple.com>
3338
3339         [iOS] Treat a two-finger single tap as if the user tapped with the Cmd key pressed
3340         https://bugs.webkit.org/show_bug.cgi?id=201420
3341         <rdar://problem/53207786>
3342
3343         Reviewed by Simon Fraser.
3344
3345         Set the metaKey modifier to true when generating a click event based on a two-finger single tap. This is important so that sites like Google and DuckDuckGo
3346         correctly open links in their search results page in a new tab in Safari on iOS. This currently doesn't work because those sites will call preventDefault()
3347         if the metaKey flag isn't set on a "click" event, and if it is set, they let the browser handle the navigation themselves.
3348
3349         * UIProcess/ios/WKContentViewInteraction.mm:
3350         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
3351
3352 2019-08-28  Brent Fulgham  <bfulgham@apple.com>
3353
3354         [macOS] Correct sandbox violation in Flash plugin
3355         https://bugs.webkit.org/show_bug.cgi?id=201228
3356         <rdar://problem/54347503>
3357
3358         Reviewed by Alex Christensen.
3359
3360         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3361
3362 2019-09-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3363
3364         [WPE][GTK] Deprecate nonfunctional process limit APIs
3365         https://bugs.webkit.org/show_bug.cgi?id=193749
3366
3367         Reviewed by Žan Doberšek.
3368
3369         * UIProcess/API/glib/WebKitWebContext.cpp:
3370         (webkitWebContextConstructed):
3371         (webkit_web_context_set_process_model):
3372         (webkit_web_context_get_process_model):
3373         (webkit_web_context_set_web_process_count_limit):
3374         (webkit_web_context_get_web_process_count_limit):
3375         * UIProcess/API/gtk/WebKitWebContext.h:
3376         * UIProcess/API/wpe/WebKitWebContext.h:
3377
3378 2019-09-02  Youenn Fablet  <youenn@apple.com>
3379
3380         Make NetworkConnectionToWebProcess keyed by their WebProcess identifier
3381         https://bugs.webkit.org/show_bug.cgi?id=201300
3382
3383         Reviewed by Alex Christensen.
3384
3385         Make sure to create each NetworkConnectionToWebProcess for a given WebProcess.
3386         Pass the process identifier at creation time.
3387         This will allow to have the message registry be moved to NetworkProcess
3388         so as to check port activity between processes.
3389         This identifier might also be used in the future for other connections like
3390         service worker context/