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