6c49682bb55d2a4c8b3b7677d81d05583fc5e87b
[WebKit.git] / Source / WebKit / ChangeLog
1 2020-03-19  Per Arne Vollan  <pvollan@apple.com>
2
3         [iOS] Add telemetry for message filtering
4         https://bugs.webkit.org/show_bug.cgi?id=208925
5         <rdar://problem/58885485>
6
7         Reviewed by Darin Adler.
8
9         On iOS, add telemetry for message filtering in the WebContent process' sandbox.
10
11         No new tests, no behavior change.
12
13         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
14
15 2020-03-19  Charlie Turner  <cturner@igalia.com>
16
17         Fix many warnings with Clang 7.0 on GTK x86-64 in Debug.
18         https://bugs.webkit.org/show_bug.cgi?id=209146
19
20         Reviewed by Darin Adler.
21
22         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
23         (WebKit::NetworkHTTPSUpgradeChecker::query):
24         * NetworkProcess/NetworkLoadChecker.cpp: The m_isHTTPSUpgradeEnabled
25         ivar is only used on Cocoa platforms, on GTK it is causing warning
26         spam.
27         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
28         * NetworkProcess/NetworkLoadChecker.h:
29         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
30         (WebKit::CoordinatedGraphicsScene::updateSceneState):
31         *
32         Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
33         m_inForceRepaint is not being used anymore.
34         (WebKit::ThreadedCompositor::forceRepaint):
35         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
36         * UIProcess/API/glib/WebKitNavigationClient.cpp:
37         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
38         (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler):
39         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h:
40
41 2020-03-19  youenn fablet  <youenn@apple.com>
42
43         Make URL::path() return a StringView
44         https://bugs.webkit.org/show_bug.cgi?id=209173
45
46         Reviewed by Alex Christensen.
47
48         Update code according new path return type.
49
50         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
51         (WebKit::NetworkDataTaskSoup::didSendRequest):
52         * Shared/API/APIURL.h:
53         (API::URL::path const):
54         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
55         (webkitURISchemeRequestReadCallback):
56         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
57         (WebKit::WebFrameLoaderClient::objectContentType):
58         * WebProcess/WebPage/WebPage.cpp:
59         (WebKit::WebPage::createPlugin):
60
61 2020-03-19  Megan Gardner  <megan_gardner@apple.com>
62
63         Correctly set up context for Data Detectors
64         https://bugs.webkit.org/show_bug.cgi?id=209258
65         <rdar://problem/60612327>
66
67         Reviewed by Tim Horton.
68
69         Stop passing in a nil context. This is OK now, but won't be in the near future.
70         Also, call -updateContext:withSourceRect: so that DataDetectors can populate the context appropriately.
71
72         * UIProcess/ios/WKActionSheetAssistant.mm:
73         (-[WKActionSheetAssistant contextMenuInteraction:configurationForMenuAtLocation:]):
74         * UIProcess/ios/WKContentViewInteraction.mm:
75         (-[WKContentView dataDetectionContextForPositionInformation:]):
76
77 2020-03-18  Simon Fraser  <simon.fraser@apple.com>
78
79         eventSender.monitorWheelEvents() is very fragile
80         https://bugs.webkit.org/show_bug.cgi?id=197819
81         <rdar://problem/51319456>
82
83         Reviewed by Tim Horton.
84
85         Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
86         adding back changes from r257844 that were reverted in r258558.
87         
88         First, have EventSendingController keep track of whether it's seen then "end" event
89         for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
90         now waits until it sees these, which prevents premature triggering which was a common cause of
91         failure before.
92         
93         Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
94         for completion in a callout from the end of Page::updateRendering(), which makes it test
95         and fire at a more consistent time.
96         
97         Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
98         can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
99         used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
100         also resulting in a premature trigger.
101
102         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
103         (WKBundlePageRegisterScrollOperationCompletionCallback):
104         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
105
106 2020-03-18  Alex Christensen  <achristensen@webkit.org>
107
108         Add HTTP3 as an experimental feature
109         https://bugs.webkit.org/show_bug.cgi?id=209267
110         <rdar://problem/60245262> and <rdar://problem/60245168>
111
112         Reviewed by Brent Fulgham.
113
114         Manually verified this sets the CFNetwork SPI as expected.
115
116         * NetworkProcess/NetworkSessionCreationParameters.cpp:
117         (WebKit::NetworkSessionCreationParameters::encode const):
118         (WebKit::NetworkSessionCreationParameters::decode):
119         * NetworkProcess/NetworkSessionCreationParameters.h:
120         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
121         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
122         * Shared/WebPreferences.yaml:
123         * UIProcess/WebProcessPool.cpp:
124         (WebKit::WebProcessPool::ensureNetworkProcess):
125         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
126         (WebKit::WebsiteDataStore::parameters):
127         (WebKit::WebsiteDataStore::http3Enabled):
128         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
129         (WebKit::WebsiteDataStore::http3Enabled):
130         * UIProcess/WebsiteData/WebsiteDataStore.h:
131
132 2020-03-18  Saam Barati  <sbarati@apple.com>
133
134         SharedMemory::Handle::decode shouldn't check rounded size
135         https://bugs.webkit.org/show_bug.cgi?id=209263
136
137         Reviewed by Sam Weinig.
138
139         * Platform/cocoa/SharedMemoryCocoa.cpp:
140         (WebKit::SharedMemory::Handle::decode):
141         (WebKit::SharedMemory::map):
142
143 2020-03-18  Fujii Hironori  <Hironori.Fujii@sony.com>
144
145         WebCoreArgumentCoders should check bufferIsLargeEnoughToContain before allocating buffers
146         https://bugs.webkit.org/show_bug.cgi?id=209219
147
148         Reviewed by Darin Adler.
149
150         * Shared/WebCoreArgumentCoders.cpp:
151         (IPC::decodeSharedBuffer): Added checking of bufferIsLargeEnoughToContain.
152         (IPC::decodeTypesAndData): Don't allocate a buffer with the
153         decoded size. bufferIsLargeEnoughToContain can't be used in this
154         case because SharedBuffer is encoded as variable length data.
155         Instead, append items one-by-one.
156
157 2020-03-18  John Wilander  <wilander@apple.com>
158
159         WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener() should call its ephemeral counterpart when appropriate
160         https://bugs.webkit.org/show_bug.cgi?id=209245
161         <rdar://problem/60511121>
162
163         Reviewed by Chris Dumez.
164
165         This change makes sure that WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener()
166         calls WebResourceLoadStatisticsStore::requestStorageAccessUnderOpenerEphemeral() for ephemeral
167         sessions.
168
169         Tests: http/tests/storageAccess/deny-storage-access-under-opener-ephemeral.html
170                http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-ephemeral.html
171                http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-ephemeral.html
172
173         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
174         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
175
176 2020-03-18  Brent Fulgham  <bfulgham@apple.com>
177
178         Avoid calling 'notifyThisWebProcessPoolWasCreated' inside the constructor
179         https://bugs.webkit.org/show_bug.cgi?id=209254
180         <rdar://problem/60564526>
181
182         Reviewed by Alex Christensen and Chris Dumez.
183
184         Enqueue calls to 'notifyThisWebProcessPoolWasCreated' so they are not invoked until
185         after the process pool is finished with its constructor.
186
187         Behavior covered by existing tests.
188
189         * UIProcess/WebProcessPool.cpp:
190         (WebKit::WebProcessPool::WebProcessPool):
191
192 2020-03-18  Ross Kirsling  <ross.kirsling@sony.com>
193
194         Unreviewed WinCairo build fix following r258665.
195
196         * NetworkProcess/curl/NetworkProcessCurl.cpp:
197         (WebKit::NetworkProcess::clearCacheForAllOrigins): Deleted.
198
199 2020-03-18  Kate Cheney  <katherine_cheney@apple.com>
200
201         Pass isNavigatingToAppBoundDomain for speculative loads, preconnect tasks and downloads
202         https://bugs.webkit.org/show_bug.cgi?id=209246
203         <rdar://problem/60552712>
204
205         Reviewed by Alex Christensen.
206
207         Pass isNavigatingToAppBoundDomain in 4 new places:
208
209         1) Speculative Loads
210         2) Preconnect Tasks
211         3) Downloads
212         4) CORS preflight checker
213
214         These loads should happen in an app-bound session if isNavigatingToAppBoundDomain
215         is true.
216
217         * NetworkProcess/Downloads/DownloadManager.cpp:
218         (WebKit::DownloadManager::startDownload):
219         * NetworkProcess/Downloads/DownloadManager.h:
220         (WebKit::DownloadManager::startDownload):
221         * NetworkProcess/Downloads/PendingDownload.cpp:
222         (WebKit::PendingDownload::PendingDownload):
223         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
224         (WebKit::NetworkConnectionToWebProcess::startDownload):
225         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
226         * NetworkProcess/NetworkConnectionToWebProcess.h:
227         (WebKit::NetworkConnectionToWebProcess::startDownload):
228         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
229         * NetworkProcess/NetworkProcess.cpp:
230         (WebKit::NetworkProcess::preconnectTo):
231         (WebKit::NetworkProcess::downloadRequest):
232         * NetworkProcess/NetworkProcess.h:
233         * NetworkProcess/NetworkProcess.messages.in:
234         * NetworkProcess/NetworkResourceLoader.cpp:
235         (WebKit::NetworkResourceLoader::start):
236         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
237         (WebKit::NetworkResourceLoader::convertToDownload):
238         * NetworkProcess/PreconnectTask.cpp:
239         * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
240         (WebKit::ServiceWorkerSoftUpdateLoader::ServiceWorkerSoftUpdateLoader):
241         The service worker script should be considered an app-bound load.
242
243         * NetworkProcess/cache/AsyncRevalidation.cpp:
244         (WebKit::NetworkCache::AsyncRevalidation::AsyncRevalidation):
245         * NetworkProcess/cache/AsyncRevalidation.h:
246         * NetworkProcess/cache/NetworkCache.cpp:
247         (WebKit::NetworkCache::Cache::startAsyncRevalidationIfNeeded):
248         (WebKit::NetworkCache::Cache::retrieve):
249         * NetworkProcess/cache/NetworkCache.h:
250         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
251         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
252         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
253         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
254         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
255         (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource):
256         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
257         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
258         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
259         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
260         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
261         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
262         (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
263         * Shared/NavigatingToAppBoundDomain.h:
264         Separates NavigatingToAppBoundDomain to its own file to allow for
265         sending over IPC.
266
267         * Shared/PolicyDecision.h:
268         * UIProcess/Network/NetworkProcessProxy.cpp:
269         (WebKit::NetworkProcessProxy::preconnectTo):
270         * UIProcess/Network/NetworkProcessProxy.h:
271         * UIProcess/WebPageProxy.cpp:
272         (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
273         (WebKit::WebPageProxy::preconnectTo):
274         * UIProcess/WebPageProxy.h:
275         (WebKit::WebPageProxy::isNavigatingToAppBoundDomain const):
276         * UIProcess/WebProcessPool.cpp:
277         (WebKit::WebProcessPool::download):
278         * WebKit.xcodeproj/project.pbxproj:
279         * WebProcess/Network/WebLoaderStrategy.cpp:
280         (WebKit::WebLoaderStrategy::preconnectTo):
281         * WebProcess/WebPage/WebFrame.cpp:
282         (WebKit::WebFrame::startDownload):
283         (WebKit::WebFrame::convertMainResourceLoadToDownload):
284
285 2020-03-18  Sihui Liu  <sihui_liu@apple.com>
286
287         Remove unused IPC message NetworkProcess::ClearCacheForAllOrigins
288         https://bugs.webkit.org/show_bug.cgi?id=209152
289         <rdar://problem/59681717>
290
291         Reviewed by Chris Dumez.
292
293         * NetworkProcess/NetworkProcess.h:
294         * NetworkProcess/NetworkProcess.messages.in:
295         * NetworkProcess/ios/NetworkProcessIOS.mm:
296         (WebKit::NetworkProcess::clearCacheForAllOrigins): Deleted.
297         * NetworkProcess/mac/NetworkProcessMac.mm:
298         (WebKit::NetworkProcess::clearCacheForAllOrigins): Deleted.
299         * NetworkProcess/soup/NetworkProcessSoup.cpp:
300         (WebKit::NetworkProcess::clearCacheForAllOrigins): Deleted.
301         * Shared/ResourceCachesToClear.h: Removed.
302         * UIProcess/API/C/WKAPICast.h:
303         (WebKit::toResourceCachesToClear): Deleted.
304         * WebKit.xcodeproj/project.pbxproj:
305         * WebProcess/WebProcess.cpp:
306         (WebKit::WebProcess::clearResourceCaches): Deleted.
307         * WebProcess/WebProcess.h:
308
309 2020-03-18  youenn fablet  <youenn@apple.com>
310
311         WebPage should own a Ref<WebFrame>
312         https://bugs.webkit.org/show_bug.cgi?id=209235
313
314         Reviewed by Geoffrey Garen.
315
316         Update code since m_mainFrame is now a Ref and no longer a RefPtr.
317
318         Update WebPage constructor to set its m_mainFrame very early.
319         We update WebPage::didCompletePageTransition to compute whether this is initialization or not using the frame state machine state
320         instead of m_mainFrame being null.
321
322         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
323         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
324         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
325         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
326         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
327         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
328         (WebKit::WebAutomationSessionProxy::focusFrame):
329         (WebKit::WebAutomationSessionProxy::computeElementLayout):
330         (WebKit::WebAutomationSessionProxy::selectOptionElement):
331         (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload):
332         (WebKit::WebAutomationSessionProxy::takeScreenshot):
333         (WebKit::WebAutomationSessionProxy::snapshotRectForScreenshot):
334         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
335         (WebKit::WebAutomationSessionProxy::deleteCookie):
336         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
337         (WKBundlePageGetMainFrame):
338         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
339         (WebKit::findLargestFrameInFrameSet):
340         (WebKit::WebChromeClient::closeWindowSoon):
341         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
342         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
343         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
344         (WebKit::WebFrameLoaderClient::restoreViewState):
345         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
346         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
347         (WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture):
348         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
349         (WebKit::WebBackForwardListProxy::goToItem):
350         * WebProcess/WebPage/WebPage.cpp:
351         (WebKit::WebPage::WebPage):
352         (WebKit::m_processDisplayName):
353         (WebKit::WebPage::close):
354         (WebKit::WebPage::suspendForProcessSwap):
355         (WebKit::WebPage::loadDataInFrame):
356         (WebKit::WebPage::loadRequest):
357         (WebKit::WebPage::reload):
358         (WebKit::WebPage::didCompletePageTransition):
359         (WebKit::WebPage::runJavaScriptInFrameInScriptWorld):
360         (WebKit::WebPage::setIsSuspended):
361         (WebKit::WebPage::didLoadFromRegistrableDomain):
362         * WebProcess/WebPage/WebPage.h:
363         (WebKit::WebPage::mainWebFrame const):
364         * WebProcess/WebPage/ios/WebPageIOS.mm:
365         (WebKit::WebPage::cancelPotentialTap):
366         * WebProcess/cocoa/WebProcessCocoa.mm:
367         (WebKit::origin):
368
369 2020-03-18  Wenson Hsieh  <wenson_hsieh@apple.com>
370
371         REGRESSION (r257214): Targeted preview animates to the wrong place when dropping in editable content
372         https://bugs.webkit.org/show_bug.cgi?id=209218
373         <rdar://problem/60560831>
374
375         Reviewed by Tim Horton.
376
377         In r257214, we split out the context menu hint preview container view into two views: one for drag and drop, and
378         another for the context menu hint. The container view used for both drag and drop previews was removed under
379         -cleanUpDragSourceSessionState, which is invoked after both drag and drop sessions have ended; however, in the
380         case of a drop in editable content where the drop preview is delayed, the drop animation can end up finishing
381         after -cleanUpDragSourceSessionState is invoked. This means we end up prematurely unparenting the preview
382         container, which results in a broken drop animation.
383
384         To fix this, split the drag and drop container views further, into separate container views for dragging and for
385         dropping. The drag preview container will continue to be removed under -cleanUpDragSourceSessionState, and the
386         drop preview container will now be removed under the delegate call to -dropInteraction:concludeDrop:, which is
387         invoked by UIKit after all drop previews are finished animating.
388
389         Covered by adding additional test assertions while running existing API tests (see Tools/ChangeLog for more
390         details).
391
392         * UIProcess/ios/WKContentViewInteraction.h:
393         * UIProcess/ios/WKContentViewInteraction.mm:
394         (-[WKContentView _createPreviewContainerWithLayerName:]):
395
396         Pull out common logic for creating and setting up a preview container view into a helper method. This is used by
397         the three methods below, which ensure container views for each of the types of previews we create when showing
398         the context menu, dragging an element, and dropping.
399
400         (-[WKContentView containerForDropPreviews]):
401         (-[WKContentView containerForDragPreviews]):
402         (-[WKContentView containerForContextMenuHintPreviews]):
403
404         Add a third preview container view for drop previews, and factor duplicated code in these three methods into a
405         common helper (see above).
406
407         (-[WKContentView _hideTargetedPreviewContainerViews]):
408         (-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
409
410         Instead of using the container for drag previews, use the container for drop previews.
411
412         (-[WKContentView dropInteraction:concludeDrop:]):
413
414         Remove the drop preview container after the drop has concluded (i.e. all animations are complete).
415
416 2020-03-18  Chris Dumez  <cdumez@apple.com>
417
418         Unreviewed, fix iOS build with recent SDKs.
419
420         * Platform/cocoa/PaymentAuthorizationViewController.mm:
421
422 2020-03-18  Megan Gardner  <megan_gardner@apple.com>
423
424         Remove unneeded and incorrect respondsToSelector checks.
425         https://bugs.webkit.org/show_bug.cgi?id=209208
426         <rdar://problem/60512470>
427
428         Reviewed by Tim Horton.
429
430         No behaviour change, no tests needed.
431
432         * UIProcess/ios/WKContentViewInteraction.mm:
433         (-[WKContentView continueContextMenuInteractionWithDataDetectors:]):
434
435 2020-03-18  Brent Fulgham  <bfulgham@apple.com>
436
437         Switch from debug ASSERT to RELEASE_ASSERT in toNPObjectProxy
438         https://bugs.webkit.org/show_bug.cgi?id=209212
439         <rdar://problem/59595502>
440
441         Reviewed by Alex Christensen.
442
443         * Shared/Plugins/NPObjectProxy.h:
444         (WebKit::NPObjectProxy::toNPObjectProxy):
445
446 2020-03-18  Brent Fulgham  <bfulgham@apple.com>
447
448         Switch to release asserts for MediaDeviceSandboxExtension class
449         https://bugs.webkit.org/show_bug.cgi?id=209211
450         <rdar://problem/59595299>
451
452         Reviewed by Eric Carlson.
453
454         Switch from debug ASSERT to RELEASE_ASSERT.
455
456         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp:
457         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
458         (WebKit::MediaDeviceSandboxExtensions::operator[]):
459
460 2020-03-18  Brent Fulgham  <bfulgham@apple.com>
461
462         Switch from debug ASSERT to RELEASE_ASSERT in PluginQuirks.h
463         https://bugs.webkit.org/show_bug.cgi?id=209213
464         <rdar://problem/59595834>
465
466         Reviewed by Alex Christensen.
467
468         * Shared/Plugins/PluginQuirks.h:
469         (WebKit::PluginQuirks::add):
470
471 2020-03-18  youenn fablet  <youenn@apple.com>
472
473         REGRESSION (r257472): Can't start old Safari with new WebKit (dyld: Symbol not found: _WKContextConfigurationSetShouldCaptureAudioInUIProcess)
474         https://bugs.webkit.org/show_bug.cgi?id=209155
475
476         Reviewed by Eric Carlson.
477
478         Add a no-op WKContextConfigurationSetShouldCaptureAudioInUIProcess to allow latest WebKit being run on older Safari.
479
480         * UIProcess/API/C/WKContextConfigurationRef.cpp:
481         (WKContextConfigurationSetShouldCaptureAudioInUIProcess):
482         * UIProcess/API/C/WKContextConfigurationRef.h:
483
484 2020-03-18  youenn fablet  <youenn@apple.com>
485
486         FrameLoader should own its FrameLoaderClient
487         https://bugs.webkit.org/show_bug.cgi?id=208918
488
489         Reviewed by Geoff Garen.
490
491         Pass a UniqueRef to the PageConfiguration.
492         Update WebFrameLoaderClient according updated FrameLoaderClient interface.
493
494         WebFrame no longer needs to ref/unref itself to keep the loader client alive.
495         Update WebFrame construction to not need a static_cast at initialization of the main frame.
496
497         The ownership is now that a WebCore::FrameLoader owns a FrameLoaderClient who owns a WebFrame.
498
499         * WebProcess/Network/WebLoaderStrategy.cpp:
500         (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
501         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
502         (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
503         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
504         (WebKit::WebLoaderStrategy::startPingLoad):
505         (WebKit::WebLoaderStrategy::preconnectTo):
506         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
507         (WebKit::WebSWContextManagerConnection::installServiceWorker):
508         * WebProcess/Storage/WebSWContextManagerConnection.h:
509         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
510         (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
511         (WebKit::WebFrameLoaderClient::~WebFrameLoaderClient):
512         (WebKit::WebFrameLoaderClient::webPageProxyID const):
513         (WebKit::WebFrameLoaderClient::pageID const):
514         (WebKit::WebFrameLoaderClient::frameID const):
515         (WebKit::WebFrameLoaderClient::detachedFromParent2):
516         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
517         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
518         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
519         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
520         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
521         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
522         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
523         (WebKit::WebFrameLoaderClient::dispatchDidDispatchOnloadEvents):
524         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
525         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
526         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
527         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
528         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
529         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
530         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
531         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
532         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
533         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
534         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
535         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
536         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
537         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
538         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
539         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
540         (WebKit::WebFrameLoaderClient::dispatchShow):
541         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
542         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
543         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
544         (WebKit::WebFrameLoaderClient::allowsContentJavaScriptFromMostRecentNavigation const):
545         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
546         (WebKit::WebFrameLoaderClient::dispatchUnableToImplementPolicy):
547         (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent):
548         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
549         (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
550         (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
551         (WebKit::WebFrameLoaderClient::didDisplayInsecureContent):
552         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
553         (WebKit::WebFrameLoaderClient::didDetectXSS):
554         (WebKit::WebFrameLoaderClient::cancelledError const):
555         (WebKit::WebFrameLoaderClient::blockedError const):
556         (WebKit::WebFrameLoaderClient::blockedByContentBlockerError const):
557         (WebKit::WebFrameLoaderClient::cannotShowURLError const):
558         (WebKit::WebFrameLoaderClient::interruptedForPolicyChangeError const):
559         (WebKit::WebFrameLoaderClient::blockedByContentFilterError const):
560         (WebKit::WebFrameLoaderClient::cannotShowMIMETypeError const):
561         (WebKit::WebFrameLoaderClient::fileDoesNotExistError const):
562         (WebKit::WebFrameLoaderClient::pluginWillHandleLoadError const):
563         (WebKit::WebFrameLoaderClient::shouldFallBack const):
564         (WebKit::WebFrameLoaderClient::restoreViewState):
565         (WebKit::WebFrameLoaderClient::didFinishLoad):
566         (WebKit::WebFrameLoaderClient::userAgent const):
567         (WebKit::WebFrameLoaderClient::createPlugin):
568         (WebKit::WebFrameLoaderClient::webGLPolicyForURL const):
569         (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const):
570         (WebKit::WebFrameLoaderClient::objectContentType):
571         (WebKit::WebFrameLoaderClient::overrideMediaType const):
572         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
573         (WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable):
574         (WebKit::WebFrameLoaderClient::willInjectUserScript):
575         (WebKit::WebFrameLoaderClient::willCacheResponse const):
576         (WebKit::WebFrameLoaderClient::createNetworkingContext):
577         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
578         * WebProcess/WebPage/WebFrame.cpp:
579         (WebKit::WebFrame::initWithCoreMainFrame):
580         (WebKit::WebFrame::createSubframe):
581         (WebKit::WebFrame::WebFrame):
582         (WebKit::WebFrame::frameLoaderClient const):
583         (WebKit::WebFrame::fromCoreFrame):
584         (WebKit::WebFrame::didReceivePolicyDecision):
585         * WebProcess/WebPage/WebFrame.h:
586         (WebKit::WebFrame::create):
587         * WebProcess/WebPage/WebPage.cpp:
588         (WebKit::m_processDisplayName):
589
590 2020-03-17  David Kilzer  <ddkilzer@apple.com>
591
592         SharedMemory::Handle::m_size should be more consistent
593         <https://webkit.org/b/209007>
594         <rdar://problem/60340890>
595
596         Reviewed by Darin Adler.
597
598         * Platform/cocoa/SharedMemoryCocoa.cpp:
599         (WebKit::SharedMemory::Handle::decode):
600         - Return early if an invalid `size` is decoded.
601         (WebKit::SharedMemory::map):
602         - Drive-by fix to change '0' to 'nullptr'.
603         - Since all known methods of creating a SharedMemory::Handle()
604           set SharedMemory::Handle::m_size to a value of round_page(),
605           this means we can also change `round_page(handle.m_size)` to
606           `handle.m_size` in the call to mach_vm_map() since we know
607           they're equal.
608
609 2020-03-17  Commit Queue  <commit-queue@webkit.org>
610
611         Unreviewed, reverting r258496.
612         https://bugs.webkit.org/show_bug.cgi?id=209217
613
614         Introduced sandbox regression (Requested by perarne on
615         #webkit).
616
617         Reverted changeset:
618
619         "[iOS] Add telemetry for message filtering"
620         https://bugs.webkit.org/show_bug.cgi?id=208925
621         https://trac.webkit.org/changeset/258496
622
623 2020-03-17  Kate Cheney  <katherine_cheney@apple.com>
624
625         Expand In-App-Browser-Privacy testing
626         https://bugs.webkit.org/show_bug.cgi?id=209142
627         <rdar://problem/60496618>
628
629         Reviewed by Darin Adler.
630
631         Adds a testing API to check whether a navigation was classified as
632         app-bound.
633
634         * UIProcess/API/Cocoa/WKWebView.mm:
635         (-[WKWebView _isNavigatingToAppBoundDomain:]):
636         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
637         * UIProcess/WebPageProxy.cpp:
638         (WebKit::WebPageProxy::isNavigatingToAppBoundDomainTesting):
639         * UIProcess/WebPageProxy.h:
640
641 2020-03-17  Alex Christensen  <achristensen@webkit.org>
642
643         Fix API tests after r258574
644         https://bugs.webkit.org/show_bug.cgi?id=209192
645
646         * UIProcess/WebPageProxy.cpp:
647         (WebKit::WebPageProxy::printFrame):
648         I forgot to call the CompletionHandler from the IPC call.
649
650 2020-03-17  Jiewen Tan  <jiewen_tan@apple.com>
651
652         WebKit::LocalAuthenticator::deleteDuplicateCredential() should check buffer size before memcmp
653         https://bugs.webkit.org/show_bug.cgi?id=209156
654         <rdar://problem/60444655>
655
656         Reviewed by Alex Christensen.
657
658         Covered by existing tests.
659
660         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
661         (WebKit::LocalAuthenticator::deleteDuplicateCredential const):
662
663 2020-03-17  Kate Cheney  <katherine_cheney@apple.com>
664
665        Add internal debugging when initializing an app-bound session
666        https://bugs.webkit.org/show_bug.cgi?id=209190
667        <rdar://problem/60371620>
668
669         Reviewed by Brent Fulgham.
670
671         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
672         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
673         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
674         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
675         (WebKit::SessionWrapper::initialize):
676         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
677         (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessSession):
678         (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
679         (WebKit::NetworkSessionCocoa::appBoundSession):
680         (WebKit::NetworkSessionCocoa::isolatedSession):
681
682 2020-03-17  John Wilander  <wilander@apple.com>
683
684         Add quirk for cookie blocking latch mode ymail.com redirecting to yahoo.com under yahoo.com
685         https://bugs.webkit.org/show_bug.cgi?id=209193
686         <rdar://problem/60089022>
687
688         Reviewed by Brent Fulgham.
689
690         No new tests. Site-specific quirk tested manually on the site in question.
691
692         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
693         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
694         (WebKit::NetworkDataTaskCocoa::unblockCookies):
695         (WebKit::NetworkDataTaskCocoa::needsFirstPartyCookieBlockingLatchModeQuirk const):
696         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
697
698 2020-03-17  Brian Burg  <bburg@apple.com>
699
700         REGRESSION(r256882): WebDriver commands that run before initial navigation do not complete
701         https://bugs.webkit.org/show_bug.cgi?id=209185
702         <rdar://problem/60010248>
703
704         Reviewed by Brian Weinstein.
705
706         No new tests, covered by w3c/webdriver/tests/back/back.py.
707
708         * UIProcess/Automation/WebAutomationSession.cpp:
709         (WebKit::WebAutomationSession::createBrowsingContext):
710         Force eager creation of WebProcess when a browsing context is created. This allows
711         all subsequent commands that use WebProcess IPC to proceed instead of hanging.
712
713 2020-03-17  Alex Christensen  <achristensen@webkit.org>
714
715         Fix GTK build.
716         https://bugs.webkit.org/show_bug.cgi?id=209192
717
718         * UIProcess/API/glib/WebKitUIClient.cpp:
719         I committed r258574 too fast.
720
721 2020-03-17  Alex Christensen  <achristensen@webkit.org>
722
723         Add WKUIDelegatePrivate SPI _webView:printFrame:completionHandler:
724         https://bugs.webkit.org/show_bug.cgi?id=209192
725         <rdar://problem/51313336>
726
727         Reviewed by Geoff Garen.
728
729         This is just like the existing _webView:printFrame: but you tell it when you're done instead of just returning.
730         Covered by API tests.
731
732         * UIProcess/API/APIUIClient.h:
733         (API::UIClient::printFrame):
734         * UIProcess/API/C/WKPage.cpp:
735         (WKPageSetPageUIClient):
736         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
737         * UIProcess/Cocoa/UIDelegate.h:
738         * UIProcess/Cocoa/UIDelegate.mm:
739         (WebKit::UIDelegate::setDelegate):
740         (WebKit::UIDelegate::UIClient::printFrame):
741         * UIProcess/WebPageProxy.cpp:
742         (WebKit::WebPageProxy::printFrame):
743
744 2020-03-17  David Kilzer  <ddkilzer@apple.com>
745
746         REGRESSION (r258334): WebPasteboardProxy::setPasteboardBufferForType should allow zero-size buffers
747         <https://webkit.org/b/209167>
748         <rdar://problem/60516302>
749
750         Reviewed by Geoffrey Garen.
751
752         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
753         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
754         - Remove check for zero-size buffer to match
755           WebPageProxy::dataSelectionForPasteboard().
756
757 2020-03-17  Brent Fulgham  <bfulgham@apple.com>
758
759         Terminate the WebContent process when receiving invalid IPC from a WebInspector session
760         https://bugs.webkit.org/show_bug.cgi?id=209157
761         <rdar://problem/58961055>
762
763         Reviewed by Chris Dumez.
764
765         * UIProcess/WebPageProxy.cpp:
766         (WebKit::WebPageProxy::backForwardGoToItemShared): Add a message check that we are not receiving
767         the request from a WebInspector page.
768         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): Switch to a release assert.
769
770 2020-03-17  Per Arne Vollan  <pvollan@apple.com>
771
772         [Cocoa] Disable CF prefs direct mode
773         https://bugs.webkit.org/show_bug.cgi?id=209166
774         <rdar://problem/60517387>
775
776         Reviewed by Brent Fulgham.
777
778         Revert <https://trac.webkit.org/changeset/258064> by disabling the CF prefs direct mode feature,
779         since it caused performance regressions.
780
781         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
782         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
783         (WebKit::XPCServiceMain):
784         * UIProcess/Cocoa/PreferenceObserver.mm:
785         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
786         (WebKit::WebPageProxy::grantAccessToPreferenceService):
787         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
788         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
789         * UIProcess/WebProcessPool.h:
790         * UIProcess/WebProcessProxy.h:
791         * WebProcess/WebProcess.h:
792         * WebProcess/WebProcess.messages.in:
793
794 2020-03-17  Commit Queue  <commit-queue@webkit.org>
795
796         Unreviewed, reverting r258339.
797         https://bugs.webkit.org/show_bug.cgi?id=209179
798
799         "Is it sometimes breaking rendering" (Requested by youenn on
800         #webkit).
801
802         Reverted changeset:
803
804         "FrameLoader should own its FrameLoaderClient"
805         https://bugs.webkit.org/show_bug.cgi?id=208918
806         https://trac.webkit.org/changeset/258339
807
808 2020-03-16  Simon Fraser  <simon.fraser@apple.com>
809
810         Add a bit more UIHitTesting logging, and make it possible to dump EventRegions from WebKit
811         https://bugs.webkit.org/show_bug.cgi?id=209058
812
813         Reviewed by Antti Koivisto.
814
815         Add a UIHitTesting log.
816
817         * UIProcess/ios/WKContentViewInteraction.mm:
818         (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
819
820 2020-03-16  Chris Dumez  <cdumez@apple.com>
821
822         Crash under WebCookieCache::clearForHost()
823         https://bugs.webkit.org/show_bug.cgi?id=209149
824         <rdar://problem/60453086>
825
826         Reviewed by Darin Adler.
827
828         Alternative fix for Bug 209149 based on comments from Darin.
829
830         * WebProcess/WebPage/WebCookieCache.cpp:
831         (WebKit::WebCookieCache::clearForHost):
832         (WebKit::WebCookieCache::pruneCacheIfNecessary):
833
834 2020-03-16  Tim Horton  <timothy_horton@apple.com>
835
836         Fix the macCatalyst build after r258525
837
838         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
839         (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
840
841 2020-03-15  Darin Adler  <darin@apple.com>
842
843         Move most of TextIterator off of live ranges
844         https://bugs.webkit.org/show_bug.cgi?id=209129
845
846         Reviewed by Antti Koivisto.
847
848         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
849         (-[WKDOMTextIterator initWithRange:]): Leave _textIterator as a nullptr
850         if the passed-in range is nil since we no longer offer a way to create
851         an empty TextIterator; other clients don't seem to need one.
852         (-[WKDOMTextIterator advance]): Add a null check.
853         (-[WKDOMTextIterator atEnd]): Ditto.
854         (-[WKDOMTextIterator currentRange]): Ditto.
855         (-[WKDOMTextIterator currentTextPointer]): Ditto.
856         (-[WKDOMTextIterator currentTextLength]): Ditto.
857
858         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm: Removed include.
859
860         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
861         (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales): Pass
862         a reference to a range known not to be null.
863
864         * WebProcess/WebPage/WebPage.cpp: Removed an include.
865
866         * WebProcess/WebPage/ios/WebPageIOS.mm: Removed a "using naemsapce WebCore".
867         Added two local functions
868         (WebKit::plainTextForContext): Added. Helper for just this file where calling
869         plainTextReplacingNoBreakSpace on a possibly null Range is common.
870         (WebKit::plainTextForDisplay): Ditto. This one passes true for isDisplayString.
871         Not entirely clear how carefully we chose which of the two to call, or if there
872         is sufficient test coverage.
873         (WebKit::WebPage::platformEditorState const): Use plainTextForContext
874         and plainTextForDisplay.
875         (WebKit::WebPage::getSelectionContext): Ditto.
876         (WebKit::WebPage::getRectsAtSelectionOffsetWithText): Use plainTextForDisplay.
877         (WebKit::WebPage::requestDictationContext): Use plainTextForContext.
878         (WebKit::WebPage::replaceSelectedText): Ditto.
879         (WebKit::WebPage::replaceDictatedText): Ditto.
880         (WebKit::WebPage::requestAutocorrectionData): Ditto.
881         (WebKit::WebPage::applyAutocorrectionInternal): Ditto.
882         (WebKit::WebPage::autocorrectionContext): Ditto.
883         (WebKit::dataDetectorLinkPositionInformation): Use plainTextForDisplay.
884         (WebKit::WebPage::requestDocumentEditingContext): Use RetainPtr instead of
885         autorelease. Use makeBoundaryPoint to convert Position objects to SimpleRange.
886
887 2020-03-16  Chris Dumez  <cdumez@apple.com>
888
889         Crash under WebCookieCache::clearForHost()
890         https://bugs.webkit.org/show_bug.cgi?id=209149
891         <rdar://problem/60453086>
892
893         Reviewed by Alex Christensen.
894
895         Make sure WebCookieCache::pruneCacheIfNecessary() keeps alive the host String it is passing
896         to WebCookieCache::clearForHost(). Previously, it was merely deferencing a HashSet iterator
897         and passing that to clearForHost(). However, clearForHost() would then drop the String from
898         the HashSet and the host would no longer be valid.
899
900         Change covered by new API test.
901
902         * WebProcess/WebPage/WebCookieCache.cpp:
903         (WebKit::WebCookieCache::pruneCacheIfNecessary):
904
905 2020-03-16  Per Arne Vollan  <pvollan@apple.com>
906
907         [macOS] Accessibility sandbox regressions
908         https://bugs.webkit.org/show_bug.cgi?id=209065
909         <rdar://problem/60202450>
910
911         Reviewed by Brent Fulgham.
912
913         When Accessibility is enabled, the WebContent process needs access to the preference service, since Accessibility
914         is relying on some advanced features of the service. Also, when CF prefs direct mode is enabled, the WebContent
915         sandbox needs to explicitly allow reading of the various plist files.
916
917         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
918         (WebKit::WebProcessPool::registerNotificationObservers):
919         * WebProcess/com.apple.WebProcess.sb.in:
920
921 2020-03-16  Per Arne Vollan  <pvollan@apple.com>
922
923         [Cocoa] Crash under -[WKPreferenceObserver init]
924         https://bugs.webkit.org/show_bug.cgi?id=209145
925
926         Reviewed by Darin Adler.
927
928         Handle the case when calling [NSUserDefaults initWithSuiteName:] did not succeed.
929
930         No new tests, since I have not been able to reproduce.
931
932         * UIProcess/Cocoa/PreferenceObserver.mm:
933         (-[WKPreferenceObserver init]):
934
935 2020-03-16  Brent Fulgham  <bfulgham@apple.com>
936
937         Remove unused IPC messages from DrawingAreaProxy
938         https://bugs.webkit.org/show_bug.cgi?id=209090
939         <rdar://problem/60333300>
940
941         Reviewed by Wenson Hsieh.
942
943         Do not compile the following three unused messages in DrawingAreaProxy when
944         building for a Cocoa platform target.
945
946         DrawingAreaProxy::Update
947         DrawingAreaProxy::DidUpdateBackingStoreState
948         DrawingAreaProxy::ExitAcceleratedCompositingMode
949
950         * UIProcess/DrawingAreaProxy.h:
951         (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
952         (WebKit::DrawingAreaProxy::update):
953         (WebKit::DrawingAreaProxy::didUpdateBackingStoreState):
954         (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
955         * UIProcess/DrawingAreaProxy.messages.in:
956         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
957         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
958         (WebKit::TiledCoreAnimationDrawingAreaProxy::exitAcceleratedCompositingMode): Deleted.
959
960 2020-03-16  Per Arne Vollan  <pvollan@apple.com>
961
962         [Cocoa] Only set CF prefs direct mode for the WebContent process
963         https://bugs.webkit.org/show_bug.cgi?id=209091
964         <rdar://problem/60337842>
965
966         Reviewed by Brent Fulgham.
967
968         Currently, we enable CF prefs direct mode in XPCServiceMain. This is incorrect, it should only be enabled
969         for the WebContent process.
970
971         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
972         (WebKit::XPCServiceMain):
973
974 2020-03-16  David Kilzer  <ddkilzer@apple.com>
975
976         WebPage::GetDataSelectionForPasteboard should validate its `size` variable
977         <https://webkit.org/b/209092>
978         <rdar://problem/60181345>
979
980         Reviewed by Brent Fulgham.
981
982         * Platform/IPC/Connection.h:
983         (MESSAGE_CHECK_WITH_RETURN_VALUE_BASE): Add.
984         - Variant of MESSAGE_CHECK_BASE() that takes a return value.
985         * UIProcess/mac/WebPageProxyMac.mm:
986         (MESSAGE_CHECK_WITH_RETURN_VALUE): Add.
987         (WebKit::WebPageProxy::dataSelectionForPasteboard):
988         - Use new MESSAGE_CHECK_WITH_RETURN_VALUE() macro to update
989           check for handle.isNull() and to add check for `size`
990           variable.
991         - Add static_cast<size_t>() to `size` variable to denote type
992           change.
993
994 2020-03-16  Youenn Fablet  <youenn@apple.com>
995
996         Apply rotation at source level if WebRTC sink ask so
997         https://bugs.webkit.org/show_bug.cgi?id=205645
998
999         Reviewed by Eric Carlson.
1000
1001         Implement RealtimeMediaSource setShouldApplyRotation by sending IPC to capture process.
1002         In capture process, if rotation should be applied, use an ImageRotationSessionVT session to apply it before sending the video frame.
1003         This allows WebProcess to no longer need an ImageRotationSessionVT for WebRTC.
1004
1005         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1006         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::setShouldApplyRotation):
1007         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::rotatePixelBuffer):
1008         (WebKit::UserMediaCaptureManagerProxy::setShouldApplyRotation):
1009         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1010         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1011         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1012         (WebKit::UserMediaCaptureManager::Source::setShouldApplyRotation):
1013
1014         * WebProcess/WebPage/mac/WebPageMac.mm: Removed an include.
1015
1016 2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
1017
1018         [WebXR] IDLs, stubs and build configuration for WPE
1019         https://bugs.webkit.org/show_bug.cgi?id=208702
1020
1021         Reviewed by Dean Jackson.
1022
1023         Added WebXR to the list of experimental features.
1024
1025         * Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.
1026         * Shared/WebPreferences.yaml: Added WebXR feature.
1027         * Shared/WebPreferencesDefaultValues.cpp:
1028         (WebKit::defaultWebXREnabled): Set WebXR to off by default unless HAVE_SYSTEM_FEATURE_FLAGS.
1029         * Shared/WebPreferencesDefaultValues.h:
1030         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1031         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1032
1033 2020-03-16  Per Arne Vollan  <pvollan@apple.com>
1034
1035         [iOS] Add telemetry for message filtering
1036         https://bugs.webkit.org/show_bug.cgi?id=208925
1037         <rdar://problem/58885485>
1038
1039         Reviewed by Darin Adler.
1040
1041         On iOS, add telemetry for message filtering in the WebContent process' sandbox.
1042
1043         No new tests, no behavior change.
1044
1045         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1046
1047 2020-03-16  Per Arne Vollan  <pvollan@apple.com>
1048
1049         [Cocoa] Limit set of classes that can be decoded when a preference has changed
1050         https://bugs.webkit.org/show_bug.cgi?id=208012
1051
1052         Reviewed by Brent Fulgham.
1053
1054         As a hardening measure, limit the set of ObjectiveC classes that can be decoded in the WebContent process
1055         as a result of a preference change.
1056
1057         API tests: WebKit.PreferenceChangesDictionary
1058                    WebKit.PreferenceChangesData
1059                    WebKit.PreferenceChangesDate
1060
1061         * WebProcess/cocoa/WebProcessCocoa.mm:
1062         (WebKit::WebProcess::notifyPreferencesChanged):
1063
1064 2020-03-16  youenn fablet  <youenn@apple.com>
1065
1066         Unique origins should not be Potentially Trustworthy
1067         https://bugs.webkit.org/show_bug.cgi?id=209049
1068
1069         Reviewed by Darin Adler.
1070
1071         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1072         (WebKit::WebFrameLoaderClient::hasNavigatedAwayFromAppBoundDomain):
1073         We should only check this for the main frame since this is tied to the page.
1074
1075 2020-03-16  Rob Buis  <rbuis@igalia.com>
1076
1077         Simplify ChromeClient.createWindow
1078         https://bugs.webkit.org/show_bug.cgi?id=209123
1079
1080         Reviewed by Darin Adler.
1081
1082         Adapt to API change.
1083
1084         * WebProcess/Inspector/WebInspector.cpp:
1085         (WebKit::WebInspector::openInNewTab):
1086         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1087         (WebKit::WebChromeClient::createWindow):
1088         * WebProcess/WebCoreSupport/WebChromeClient.h:
1089         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1090         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1091
1092 2020-03-15  Yusuke Suzuki  <ysuzuki@apple.com>
1093
1094         Should not use variable-length-array (VLA)
1095         https://bugs.webkit.org/show_bug.cgi?id=209043
1096
1097         Reviewed by Mark Lam.
1098
1099         * Configurations/Base.xcconfig:
1100         * UIProcess/_WKTouchEventGenerator.mm:
1101         (-[_WKTouchEventGenerator touchDown:touchCount:]):
1102         (-[_WKTouchEventGenerator liftUp:touchCount:]):
1103         (-[_WKTouchEventGenerator moveToPoints:touchCount:duration:]):
1104
1105 2020-03-14  Brady Eidson  <beidson@apple.com>
1106
1107         Fix the "deliver cached ranges" logic in PDFPlugin (and other small cleanups)
1108         https://bugs.webkit.org/show_bug.cgi?id=209097
1109
1110         Reviewed by Tim Hatcher.
1111
1112         Streaming in data always appended to the buffer instead of first growing the buffer.
1113         This wasn't noticed earlier because we often did not grow the buffer for successful range request completion.
1114         But now we often do!
1115         
1116         So this cleans that all up.
1117         
1118         At the same time it revealed other interactions with PDFKit that force us to handle data requests on the main
1119         thread after the document load is complete - Which is fine!
1120
1121         * WebProcess/Plugins/PDF/PDFPlugin.h:
1122         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1123         (WebKit::dataProviderGetBytesAtPositionCallback): If on the main thread (and the document load is complete)
1124           handle the request directly!
1125         (WebKit::PDFPlugin::getResourceBytesAtPositionMainThread):
1126         (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
1127         (WebKit::PDFPlugin::ensureDataBufferLength):
1128         (WebKit::PDFPlugin::didFail):
1129         (WebKit::PDFPlugin::maybeClearHighLatencyDataProviderFlag):
1130         (WebKit::PDFPlugin::documentDataDidFinishLoading):
1131         (WebKit::PDFPlugin::installPDFDocument):
1132         (WebKit::PDFPlugin::manualStreamDidReceiveData): Grow the buffer instead of append.
1133
1134
1135 2020-03-14  Brent Fulgham  <bfulgham@apple.com>
1136
1137         Add missing checks needed for AppBound Quirk
1138         https://bugs.webkit.org/show_bug.cgi?id=209117
1139         <rdar://problem/60460097>
1140
1141         Reviewed by John Wilander.
1142
1143         The checks for the 'NeedsInAppBrowserPrivacyQuirks' flag added in r258101 was incomplete.
1144         These changes let the WebFrameLoaderClient report the quirk state to WebCore code. 
1145
1146         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1147         (WebKit::WebFrameLoaderClient::needsInAppBrowserPrivacyQuirks): Added.
1148         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1149         * WebProcess/WebPage/WebPage.h:
1150         (WebKit::WebPage::needsInAppBrowserPrivacyQuirks const): Added.
1151
1152 2020-03-10  Darin Adler  <darin@apple.com>
1153
1154         Change all return values in TextIterator header from live ranges to SimpleRange
1155         https://bugs.webkit.org/show_bug.cgi?id=208906
1156
1157         Reviewed by Antti Koivisto.
1158
1159         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: Removed unneeded include of
1160         TextIterator.h.
1161
1162         * WebProcess/WebPage/ios/WebPageIOS.mm:
1163         (WebKit::rangeNearPositionMatchesText): Removed unused originalRange argument,
1164         changed return type to Optional<SimpleRange> since findClosestPlainText now
1165         returns a SimpleRange.
1166         (WebKit::WebPage::getRectsAtSelectionOffsetWithText): Updated since
1167         rangeNearPositionMatchesText now returns Optional<SimpleRange>, use createLiveRange.
1168         (WebKit::WebPage::requestDocumentEditingContext): Updated since
1169         CharacterIterator::range returns SimpleRange, use createLiveRange.
1170
1171 2020-03-14  Brady Eidson  <beidson@apple.com>
1172
1173         Gather PDF scripts to run on a background thread.
1174         https://bugs.webkit.org/show_bug.cgi?id=209063
1175
1176         Reviewed by Geoff Garen.
1177         
1178         In incremental loading mode, gathering document scripts will sometimes require PDFKit/CG
1179         to lock and wait on data loads from our data provider.
1180         
1181         So if we gather them on the main thread, we will hang the main thread and therefore deadlock
1182         with our data provider thread/queue.
1183         
1184         So let's gather those scripts on a background thread!
1185
1186         * WebProcess/Plugins/PDF/PDFPlugin.h:
1187         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1188         (WebKit::PDFPlugin::threadEntry):
1189         (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
1190         (WebKit::PDFPlugin::documentDataDidFinishLoading):
1191         (WebKit::PDFPlugin::installPDFDocument):
1192         (WebKit::PDFPlugin::streamDidFinishLoading):
1193         (WebKit::PDFPlugin::manualStreamDidFinishLoading):
1194         (WebKit::PDFPlugin::tryRunScriptsInPDFDocument): Only actually gathers scripts to execute if there
1195           is a m_pdfDocument and the entire document data finished loading.
1196         (WebKit::PDFPlugin::pdfDocumentDidLoad): Deleted.
1197         (WebKit::PDFPlugin::runScriptsInPDFDocument): Deleted.
1198
1199 2020-03-13  Alex Christensen  <achristensen@webkit.org>
1200
1201         WKWebView._negotiatedLegacyTLS should be correct after back/forward navigations
1202         https://bugs.webkit.org/show_bug.cgi?id=209011
1203         <rdar://problem/59370588>
1204
1205         Reviewed by Youenn Fablet.
1206
1207         * NetworkProcess/NetworkDataTask.cpp:
1208         (WebKit::NetworkDataTask::didReceiveResponse):
1209         * NetworkProcess/NetworkLoad.cpp:
1210         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1211         * UIProcess/WebPageProxy.cpp:
1212         (WebKit::WebPageProxy::usedLegacyTLS): Deleted.
1213         * UIProcess/WebPageProxy.h:
1214         * UIProcess/WebPageProxy.messages.in:
1215         * WebProcess/Network/WebResourceLoader.cpp:
1216         (WebKit::WebResourceLoader::didReceiveResponse):
1217         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1218         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
1219
1220 2020-03-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1221
1222         [watchOS] Don’t display empty text suggestions in Quickboard when editing input fields
1223         https://bugs.webkit.org/show_bug.cgi?id=209089
1224
1225         Reviewed by Tim Horton.
1226
1227         Handle text suggestions that lack `displayText` gracefully in Quickboard by not showing them as AutoFill
1228         candidates. Currently, they are presented as blank collection view cells in Quickboard, which leads to a
1229         confusing user experience.
1230
1231         Test: WKWebViewAutoFillTests.DoNotShowBlankTextSuggestions
1232
1233         * UIProcess/ios/forms/WKFocusedFormControlView.mm:
1234         (-[WKFocusedFormControlView setSuggestions:]):
1235
1236 2020-03-13  Brent Fulgham  <bfulgham@apple.com>
1237
1238         Clean up sandbox violations found during testing
1239         https://bugs.webkit.org/show_bug.cgi?id=209096
1240         <rdar://problem/59931477>
1241
1242         Reviewed by Geoffrey Garen.
1243
1244         Remove telemetry from some items, and allow access to some IOKit properties
1245         needed for media playback on macOS and iOS.
1246
1247         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1248         * WebProcess/com.apple.WebProcess.sb.in:
1249
1250 2020-03-13  Chris Dumez  <cdumez@apple.com>
1251
1252         Unreviewed, drop unused variable in WebPageProxy::backForwardGoToItem().
1253
1254         * UIProcess/WebPageProxy.cpp:
1255
1256 2020-03-13  John Wilander  <wilander@apple.com>
1257
1258         Remove unused code related to removePrevalentDomains()
1259         https://bugs.webkit.org/show_bug.cgi?id=209078
1260         <rdar://problem/59681984>
1261
1262         Reviewed by Brent Fulgham.
1263
1264         The various removePrevalentDomains() functions and its IPC endpoint are unused and should be removed.
1265
1266         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
1267         (WebKit::ResourceLoadStatisticsStore::clearBlockingStateForDomains): Deleted.
1268         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1269         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains): Deleted.
1270         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler): Deleted.
1271         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1272         * NetworkProcess/NetworkProcess.cpp:
1273         (WebKit::NetworkProcess::removePrevalentDomains): Deleted.
1274         * NetworkProcess/NetworkProcess.h:
1275         * NetworkProcess/NetworkProcess.messages.in:
1276
1277 2020-03-13  Myles C. Maxfield  <mmaxfield@apple.com>
1278
1279         [Cocoa] Push applicationSDKVersion() down from WebCore into WTF
1280         https://bugs.webkit.org/show_bug.cgi?id=209030
1281
1282         Reviewed by Simon Fraser.
1283
1284         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1285         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1286         * Shared/WebPreferencesDefaultValues.cpp:
1287         (WebKit::defaultCSSOMViewScrollingAPIEnabled):
1288         * WebProcess/cocoa/WebProcessCocoa.mm:
1289         (WebKit::WebProcess::platformInitializeWebProcess):
1290
1291 2020-03-13  Brent Fulgham  <bfulgham@apple.com>
1292
1293         Remove unused IPC function UserMediaCaptureManagerProxy::SetMuted
1294         https://bugs.webkit.org/show_bug.cgi?id=209087
1295         <rdar://problem/59658963>
1296
1297         Reviewed by Eric Carlson.
1298
1299         Remove the unused UserMediaCaptureManagerProxy message 'SetMuted'.
1300
1301         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1302         (WebKit::UserMediaCaptureManagerProxy::setMuted): Deleted.
1303         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1304         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1305
1306 2020-03-13  Brent Fulgham  <bfulgham@apple.com>
1307
1308         Remove unused GetNetworkLoadInformationRequest call
1309         https://bugs.webkit.org/show_bug.cgi?id=209081
1310         <rdar://problem/59659064>
1311
1312         Reviewed by Geoffrey Garen.
1313
1314         Remove dead code associated with an unused IPC message.
1315
1316         * NetworkProcess/NetworkConnectionToWebProcess.h:
1317         (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest): Deleted.
1318         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1319
1320 2020-03-13  Jiewen Tan  <jiewen_tan@apple.com>
1321
1322         [WebAuthn] Customize a bit more on the macOS LocalAuthentication prompt
1323         https://bugs.webkit.org/show_bug.cgi?id=208703
1324         <rdar://problem/60136974>
1325
1326         Reviewed by Darin Adler.
1327
1328         On macOS, LocalAuthentication prompt can be shown anywhere that is probably not on top of
1329         our UI clients. Therefore, add a RP ID to the dialog to help users to identify what has
1330         happened. In addition, it removes the password fallback button.
1331
1332         * Platform/spi/Cocoa/LocalAuthenticationSPI.h:
1333         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1334         (WebKit::LocalAuthenticator::continueMakeCredentialAfterDecidePolicy):
1335         (WebKit::LocalAuthenticator::continueGetAssertionAfterResponseSelected):
1336         * UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
1337         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
1338         (WebKit::LocalConnection::verifyUser const):
1339         * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
1340         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
1341         (WebKit::MockLocalConnection::verifyUser const):
1342
1343 2020-03-13  Brent Fulgham  <bfulgham@apple.com>
1344
1345         Remove Unused IPC message PlaybackSessionManagerProxy::PictureInPictureActiveChanged
1346         https://bugs.webkit.org/show_bug.cgi?id=209085
1347         <rdar://problem/59658916>
1348
1349         Reviewed by Geoffrey Garen.
1350
1351         Remove the unused PlaybackSessionManagerProxy message 'PictureInPictureActiveChanged'.
1352
1353         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
1354         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
1355         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1356         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged): Deleted.
1357
1358 2020-03-13  Kate Cheney  <katherine_cheney@apple.com>
1359
1360         [ iOS and Mac wk2 ] http/tests/in-app-browser-privacy/ tests failing
1361         https://bugs.webkit.org/show_bug.cgi?id=209016
1362         <rdar://problem/60329530> 
1363
1364         Reviewed by Chris Dumez.
1365
1366         This patch adds a function to re-initialize app bound domains for
1367         in-app-browser-privacy tests, since they are only initialized once
1368         when the WebsiteDataStore is created. This causes issues if the tests
1369         are run in parallel with other tests with different app-bound domains.
1370
1371         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1372         (WKWebsiteDataStoreReinitializeAppBoundDomains):
1373         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1374         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1375         (WebKit::WebsiteDataStore::clearAppBoundDomains):
1376         (WebKit::WebsiteDataStore::reinitializeAppBoundDomains):
1377         * UIProcess/WebsiteData/WebsiteDataStore.h:
1378
1379 2020-03-13  Ryan Haddad  <ryanhaddad@apple.com>
1380
1381         Unreviewed, reverting r258391.
1382
1383         Breaks internal builds.
1384
1385         Reverted changeset:
1386
1387         "Apply rotation at source level if WebRTC sink ask so"
1388         https://bugs.webkit.org/show_bug.cgi?id=205645
1389         https://trac.webkit.org/changeset/258391
1390
1391 2020-03-13  Kate Cheney  <katherine_cheney@apple.com>
1392
1393         Report all third party loads on a per-page basis
1394         https://bugs.webkit.org/show_bug.cgi?id=209032
1395         <rdar://problem/60397323>
1396
1397         Reviewed by Chris Dumez.
1398
1399         Test: http/tests/resourceLoadStatistics/loaded-registrable-domains-get-reported.html
1400
1401         Removed IPC to the Network Process asking if a resource load is from
1402         a prevalent domain. This now stores and sends all loaded registrable
1403         domains. This patch is mostly updating naming to reflect this and
1404         deleting the unnecessary code to communicate with the
1405         ResourceLoadStatisticsStore.
1406
1407         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1408         (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
1409         (WebKit::NetworkConnectionToWebProcess::isPrevalentSubresourceLoad): Deleted.
1410         * NetworkProcess/NetworkConnectionToWebProcess.h:
1411         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1412         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1413         (-[WKWebsiteDataStore _loadedThirdPartyDomainsFor:completionHandler:]):
1414         (-[WKWebsiteDataStore _clearLoadedThirdPartyDomainsFor:]):
1415         (-[WKWebsiteDataStore _getPrevalentDomainsFor:completionHandler:]): Deleted.
1416         (-[WKWebsiteDataStore _clearPrevalentDomainsFor:]): Deleted.
1417         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1418         * UIProcess/WebPageProxy.cpp:
1419         * UIProcess/WebPageProxy.h:
1420         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1421         (WebKit::WebFrameLoaderClient::didLoadFromRegistrableDomain):
1422         (WebKit::WebFrameLoaderClient::addLoadedRegistrableDomain): Deleted.
1423         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1424         * WebProcess/WebPage/WebPage.cpp:
1425         (WebKit::WebPage::didCommitLoad):
1426         (WebKit::WebPage::didLoadFromRegistrableDomain):
1427         Add a check that this is a third party by comparing the target domain
1428         to the main frame domain.
1429
1430         (WebKit::WebPage::loadedThirdPartyDomains):
1431         (WebKit::WebPage::clearLoadedThirdPartyDomains):
1432         (WebKit::WebPage::addLoadedRegistrableDomain): Deleted.
1433         (WebKit::WebPage::getPrevalentDomains): Deleted.
1434         (WebKit::WebPage::clearPrevalentDomains): Deleted.
1435         * WebProcess/WebPage/WebPage.h:
1436         * WebProcess/WebPage/WebPage.messages.in:
1437
1438 2020-03-13  Brent Fulgham  <bfulgham@apple.com>
1439
1440         Remove unused SmartMagnificationController Magnify message
1441         https://bugs.webkit.org/show_bug.cgi?id=209036
1442         <rdar://problem/59678060>
1443
1444         Reviewed by Tim Horton.
1445
1446         Remove the unused Magnify message from the SmartMagnificationController, since this is dead code.
1447
1448         * UIProcess/ios/SmartMagnificationController.h:
1449         * UIProcess/ios/SmartMagnificationController.messages.in:
1450         * UIProcess/ios/SmartMagnificationController.mm:
1451         (WebKit::SmartMagnificationController::magnify): Deleted.
1452
1453 2020-03-13  David Kilzer  <ddkilzer@apple.com>
1454
1455         WebPageProxy::SetPromisedDataForImage should validate its `imageSize` and `archiveSize` parameters
1456         <https://webkit.org/b/209029>
1457         <rdar://problem/60181394>
1458
1459         Reviewed by Youenn Fablet.
1460
1461         * UIProcess/mac/WebPageProxyMac.mm:
1462         (WebKit::WebPageProxy::setPromisedDataForImage):
1463         - Validate `imageSize` and `archiveSize` using MESSAGE_CHECK().
1464         - Add static_cast<size_t>() to `imageSize` and `archiveSize`
1465           parameters to denote type change.
1466         - Add nullptr check for SharedMemory::map() result with
1467           `archiveHandle`.
1468
1469 2020-03-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1470
1471         [SOUP] Notify web process about WebSocket handshake request and response
1472         https://bugs.webkit.org/show_bug.cgi?id=208994
1473
1474         Reviewed by Youenn Fablet.
1475
1476         This makes WebSockets appear again in web inspector.
1477
1478         * NetworkProcess/soup/WebSocketTaskSoup.cpp:
1479         (WebKit::WebSocketTask::WebSocketTask): Save the handshake message and notify the channel when the request is sent.
1480         (WebKit::WebSocketTask::didConnect): Notify the channel that handshake response has been received.
1481         (WebKit::WebSocketTask::didFail): Notify the channel that handshake response has been received if handshake
1482         failed.
1483         * NetworkProcess/soup/WebSocketTaskSoup.h:
1484
1485 2020-03-13  Youenn Fablet  <youenn@apple.com>
1486
1487         Apply rotation at source level if WebRTC sink ask so
1488         https://bugs.webkit.org/show_bug.cgi?id=205645
1489
1490         Reviewed by Eric Carlson.
1491
1492         Implement RealtimeMediaSource setShouldApplyRotation by sending IPC to capture process.
1493         In capture process, if rotation should be applied, use an ImageRotationSessionVT session to apply it before sending the video frame.
1494         This allows WebProcess to no longer need an ImageRotationSessionVT for WebRTC.
1495
1496         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1497         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::setShouldApplyRotation):
1498         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::rotatePixelBuffer):
1499         (WebKit::UserMediaCaptureManagerProxy::setShouldApplyRotation):
1500         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1501         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1502         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1503         (WebKit::UserMediaCaptureManager::Source::setShouldApplyRotation):
1504
1505 2020-03-13  youenn fablet  <youenn@apple.com>
1506
1507         Remove use of PlatformMediaSession types in AudioSession
1508         https://bugs.webkit.org/show_bug.cgi?id=208995
1509
1510         Reviewed by Eric Carlson.
1511
1512         Update code according WebCore API changes.
1513         Make use of AudioSession current code path to make RemoteAudioSession notify its observers.
1514
1515         * GPUProcess/media/RemoteAudioSessionProxy.cpp:
1516         (WebKit::RemoteAudioSessionProxy::setCategory):
1517         (WebKit::RemoteAudioSessionProxy::beginInterruption):
1518         (WebKit::RemoteAudioSessionProxy::endInterruption):
1519         * GPUProcess/media/RemoteAudioSessionProxy.h:
1520         * GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
1521         (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess):
1522         (WebKit::RemoteAudioSessionProxyManager::beginAudioSessionInterruption):
1523         (WebKit::RemoteAudioSessionProxyManager::endAudioSessionInterruption):
1524         * GPUProcess/media/RemoteAudioSessionProxyManager.h:
1525         * WebProcess/GPU/media/RemoteAudioSession.cpp:
1526         (WebKit::RemoteAudioSession::beginInterruption): Deleted.
1527         (WebKit::RemoteAudioSession::endInterruption): Deleted.
1528         * WebProcess/GPU/media/RemoteAudioSession.h:
1529         * WebProcess/GPU/media/RemoteAudioSession.messages.in:
1530
1531 2020-03-13  Ryosuke Niwa  <rniwa@webkit.org>
1532
1533         Release build fix after r258384.
1534
1535         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1536         (WebKit::PDFPlugin::threadEntry):
1537         (WebKit::PDFPlugin::ByteRangeRequest::maybeComplete):
1538
1539 2020-03-12  Brady Eidson  <beidson@apple.com>
1540
1541         Add a very verbose logging mode for incremental PDF loading
1542         https://bugs.webkit.org/show_bug.cgi?id=208975
1543
1544         Reviewed by Simon Fraser.
1545
1546         Adds a verbose logging channel that includes a full dump of the PDFPlugin's loading status
1547         for each logging message.
1548         
1549         * Platform/Logging.h:
1550
1551         * WebProcess/Plugins/PDF/PDFPlugin.h:
1552         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1553         (WebKit::PDFPlugin::pdfLog):
1554         (WebKit::PDFPlugin::logStreamLoader):
1555         (WebKit::PDFPlugin::verboseLog):
1556         (WebKit::dataProviderGetBytesAtPositionCallback):
1557         (WebKit::dataProviderGetByteRangesCallback):
1558         (WebKit::PDFPlugin::getResourceBytesAtPosition):
1559         (WebKit::PDFPlugin::adoptBackgroundThreadDocument):
1560         (WebKit::PDFPlugin::ByteRangeRequest::completeWithBytes):
1561         (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
1562         (WebKit::PDFPlugin::forgetLoader):
1563
1564 2020-03-12  Brent Fulgham  <bfulgham@apple.com>
1565
1566         Correct preference handling and naming conventions in AppBound browsing preferences
1567         https://bugs.webkit.org/show_bug.cgi?id=209031
1568         <rdar://problem/60396298>
1569
1570         Reviewed by John Wilander.
1571
1572         I made a mistake in the handling of preferences related to the IsInAppBrowserPrivacyEnabled
1573         and the quirk flag, which led to some code not executing when expected.
1574
1575         This patch does the following:
1576
1577         1. Uses the correct naming scheme for WebKit Internal Debug flags. They should be
1578            'WebKitDebug', not 'WebKitInternal' or 'WebKitInternalDebug'.
1579         2. Updates the local quirk state in WebPage when page settings change.
1580
1581         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1582         (WebKit::WebsiteDataStore::parameters):
1583         * WebProcess/WebPage/WebPage.cpp:
1584         (WebKit::WebPage::updatePreferences):
1585
1586 2020-03-12  David Kilzer  <ddkilzer@apple.com>
1587
1588         WebPageProxy::SaveImageToLibrary should validate its `imageSize` parameter
1589         <https://webkit.org/b/209012>
1590         <rdar://problem/60181295>
1591
1592         Reviewed by Chris Dumez.
1593
1594         * UIProcess/ios/WebPageProxyIOS.mm:
1595         (WebKit::WebPageProxy::saveImageToLibrary):
1596         - Validate upper bound of `imageSize` parameter.
1597         - Add static_cast<size_t>() to `imageSize` parameter to denote
1598           type change.
1599
1600 2020-03-12  Chris Dumez  <cdumez@apple.com>
1601
1602         Check for overflows in MachMessage::messageSize()
1603         https://bugs.webkit.org/show_bug.cgi?id=209020
1604         <rdar://problem/58264215>
1605
1606         Reviewed by Alex Christensen.
1607
1608         * Platform/IPC/cocoa/ConnectionCocoa.mm:
1609         (IPC::Connection::sendOutgoingMessage):
1610         * Platform/IPC/cocoa/MachMessage.cpp:
1611         (IPC::MachMessage::messageSize):
1612         * Platform/IPC/cocoa/MachMessage.h:
1613
1614 2020-03-12  Per Arne Vollan  <pvollan@apple.com>
1615
1616         [macOS] _AXSApplicationAccessibilityEnabled should not be called
1617         https://bugs.webkit.org/show_bug.cgi?id=208953
1618
1619         Reviewed by Brent Fulgham.
1620
1621         On macOS, stop using the function _AXSApplicationAccessibilityEnabled and listening to the notification
1622         kAXSApplicationAccessibilityEnabledNotification, since they do not have the same behavior as on iOS.
1623
1624         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1625         (WebKit::WebProcessPool::platformInitializeWebProcess):
1626         (WebKit::WebProcessPool::registerNotificationObservers):
1627         (WebKit::WebProcessPool::unregisterNotificationObservers):
1628         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1629         (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
1630         * WebProcess/cocoa/WebProcessCocoa.mm:
1631         (WebKit::WebProcess::platformInitializeProcess):
1632         (WebKit::WebProcess::unblockAccessibilityServer):
1633
1634 2020-03-12  Kate Cheney  <katherine_cheney@apple.com>
1635
1636         Resource load statistics data summary should return all third party data
1637         https://bugs.webkit.org/show_bug.cgi?id=209000
1638         <rdar://problem/60348306>
1639
1640         Reviewed by John Wilander.
1641
1642         No new tests, this patch adjusts old tests to test this new behavior
1643
1644         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1645         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1646         (-[WKWebsiteDataStore _setThirdPartyCookieBlockingMode:onlyOnSitesWithoutUserInteraction:completionHandler:]):
1647         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1648         Added new function _setThirdPartyCookieBlockingMode so API tests can
1649         set this parameter.
1650
1651 2020-03-12  Alex Christensen  <achristensen@webkit.org>
1652
1653         WKWebView.hasOnlySecureContent should be correct after back/forward navigations
1654         https://bugs.webkit.org/show_bug.cgi?id=207609
1655
1656         Reviewed by Ryosuke Niwa.
1657
1658         * UIProcess/WebPageProxy.cpp:
1659         (WebKit::WebPageProxy::usedLegacyTLS):
1660         (WebKit::WebPageProxy::hasInsecureContent): Deleted.
1661         * UIProcess/WebPageProxy.h:
1662         * UIProcess/WebPageProxy.messages.in:
1663         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1664         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
1665
1666 2020-03-12  Chris Dumez  <cdumez@apple.com>
1667
1668         Drop unused WebProcess::UpdateActivePages IPC
1669         https://bugs.webkit.org/show_bug.cgi?id=209002
1670         <rdar://problem/59682658>
1671
1672         Reviewed by Geoffrey Garen.
1673
1674         * WebProcess/WebProcess.messages.in:
1675
1676 2020-03-12  youenn fablet  <youenn@apple.com>
1677
1678         FrameLoader should own its FrameLoaderClient
1679         https://bugs.webkit.org/show_bug.cgi?id=208918
1680
1681         Reviewed by Geoffrey Garen.
1682
1683         Pass a UniqueRef to the PageConfiguration.
1684         Update WebFrameLoaderClient according updated FrameLoaderClient interface.
1685
1686         WebFrame no longer needs to ref/unref itself to keep the loader client alive.
1687         Update WebFrame construction to not need a static_cast at initialization of the main frame.
1688
1689         The ownership is now that a WebCore::FrameLoader owns a FrameLoaderClient who owns a WebFrame.
1690
1691         * WebProcess/Network/WebLoaderStrategy.cpp:
1692         (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
1693         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1694         (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
1695         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1696         (WebKit::WebLoaderStrategy::startPingLoad):
1697         (WebKit::WebLoaderStrategy::preconnectTo):
1698         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1699         (WebKit::WebSWContextManagerConnection::installServiceWorker):
1700         * WebProcess/Storage/WebSWContextManagerConnection.h:
1701         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1702         (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
1703         (WebKit::WebFrameLoaderClient::~WebFrameLoaderClient):
1704         (WebKit::WebFrameLoaderClient::webPageProxyID const):
1705         (WebKit::WebFrameLoaderClient::pageID const):
1706         (WebKit::WebFrameLoaderClient::frameID const):
1707         (WebKit::WebFrameLoaderClient::detachedFromParent2):
1708         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
1709         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
1710         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
1711         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
1712         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
1713         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
1714         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
1715         (WebKit::WebFrameLoaderClient::dispatchDidDispatchOnloadEvents):
1716         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
1717         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
1718         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
1719         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
1720         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
1721         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
1722         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
1723         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
1724         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
1725         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
1726         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
1727         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
1728         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
1729         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
1730         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
1731         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1732         (WebKit::WebFrameLoaderClient::dispatchShow):
1733         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1734         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1735         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
1736         (WebKit::WebFrameLoaderClient::allowsContentJavaScriptFromMostRecentNavigation const):
1737         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1738         (WebKit::WebFrameLoaderClient::dispatchUnableToImplementPolicy):
1739         (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent):
1740         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
1741         (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
1742         (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
1743         (WebKit::WebFrameLoaderClient::didDisplayInsecureContent):
1744         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
1745         (WebKit::WebFrameLoaderClient::didDetectXSS):
1746         (WebKit::WebFrameLoaderClient::cancelledError const):
1747         (WebKit::WebFrameLoaderClient::blockedError const):
1748         (WebKit::WebFrameLoaderClient::blockedByContentBlockerError const):
1749         (WebKit::WebFrameLoaderClient::cannotShowURLError const):
1750         (WebKit::WebFrameLoaderClient::interruptedForPolicyChangeError const):
1751         (WebKit::WebFrameLoaderClient::blockedByContentFilterError const):
1752         (WebKit::WebFrameLoaderClient::cannotShowMIMETypeError const):
1753         (WebKit::WebFrameLoaderClient::fileDoesNotExistError const):
1754         (WebKit::WebFrameLoaderClient::pluginWillHandleLoadError const):
1755         (WebKit::WebFrameLoaderClient::shouldFallBack const):
1756         (WebKit::WebFrameLoaderClient::restoreViewState):
1757         (WebKit::WebFrameLoaderClient::didFinishLoad):
1758         (WebKit::WebFrameLoaderClient::userAgent const):
1759         (WebKit::WebFrameLoaderClient::createPlugin):
1760         (WebKit::WebFrameLoaderClient::webGLPolicyForURL const):
1761         (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const):
1762         (WebKit::WebFrameLoaderClient::objectContentType):
1763         (WebKit::WebFrameLoaderClient::overrideMediaType const):
1764         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
1765         (WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable):
1766         (WebKit::WebFrameLoaderClient::willInjectUserScript):
1767         (WebKit::WebFrameLoaderClient::willCacheResponse const):
1768         (WebKit::WebFrameLoaderClient::createNetworkingContext):
1769         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1770         * WebProcess/WebPage/WebFrame.cpp:
1771         (WebKit::WebFrame::initWithCoreMainFrame):
1772         (WebKit::WebFrame::createSubframe):
1773         (WebKit::WebFrame::WebFrame):
1774         (WebKit::WebFrame::frameLoaderClient const):
1775         (WebKit::WebFrame::fromCoreFrame):
1776         (WebKit::WebFrame::didReceivePolicyDecision):
1777         * WebProcess/WebPage/WebFrame.h:
1778         (WebKit::WebFrame::create):
1779         * WebProcess/WebPage/WebPage.cpp:
1780         (WebKit::m_processDisplayName):
1781
1782 2020-03-12  Brent Fulgham  <bfulgham@apple.com>
1783
1784         Drop unused LogGlobalDiagnosticMessageWithValue IPC message
1785         https://bugs.webkit.org/show_bug.cgi?id=208974
1786         <rdar://problem/59682189>
1787
1788         Reviewed by Chris Dumez.
1789
1790         I added these messages for ITP, but we later switched to tracking network sessions
1791         individually and no longer need this "global" message.
1792
1793         * UIProcess/Network/NetworkProcessProxy.cpp:
1794         (WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue): Deleted.
1795         * UIProcess/Network/NetworkProcessProxy.h:
1796         * UIProcess/Network/NetworkProcessProxy.messages.in:
1797
1798 2020-03-12  Chris Dumez  <cdumez@apple.com>
1799
1800         Networking process should kill the WebContent process if an invalid IPC message is received from it
1801         https://bugs.webkit.org/show_bug.cgi?id=208999
1802
1803         Reviewed by Geoffrey Garen.
1804
1805         If the NetworkProcess receives a bad IPC from a WebProcess, it now sends an IPC to the UIProcess
1806         asking for said WebProcess to be terminated.
1807
1808         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1809         (WebKit::NetworkConnectionToWebProcess::didReceiveInvalidMessage):
1810
1811         * Platform/IPC/HandleMessage.h:
1812         (IPC::handleMessage):
1813         (IPC::handleMessageSynchronous):
1814         (IPC::handleMessageSynchronousWantsConnection):
1815         (IPC::handleMessageAsync):
1816         I noticed when testing this patch that the decoder was sometimes not marked as invalid even though
1817         decoding failed (verified this by not decoding enough data or decoding too much data). As a result,
1818         the IPC message would get ignored but didReceiveInvalidMessage() would not get called. To address
1819         this, I know mark the decoder as invalid anytime decoding fails, instead of asserting that it is
1820         already invalid.
1821
1822         * Shared/ProcessTerminationReason.h:
1823         * UIProcess/API/C/WKAPICast.h:
1824         (WebKit::toAPI):
1825         * UIProcess/Cocoa/NavigationState.mm:
1826         (WebKit::wkProcessTerminationReason):
1827         * UIProcess/Network/NetworkProcessProxy.cpp:
1828         (WebKit::NetworkProcessProxy::terminateWebProcess):
1829         * UIProcess/Network/NetworkProcessProxy.h:
1830         * UIProcess/Network/NetworkProcessProxy.messages.in:
1831         * UIProcess/WebPageProxy.cpp:
1832         * UIProcess/WebProcessProxy.cpp:
1833         (WebKit::WebProcessProxy::requestTermination):
1834
1835 2020-03-12  Alex Christensen  <achristensen@webkit.org>
1836
1837         Remove unused GetWebCoreStatistics message
1838         https://bugs.webkit.org/show_bug.cgi?id=209001
1839         <rdar://problem/59682747>
1840
1841         Reviewed by Chris Dumez.
1842
1843         * WebProcess/WebProcess.cpp:
1844         (WebKit::fromCountedSetToHashMap): Deleted.
1845         (WebKit::getWebCoreMemoryCacheStatistics): Deleted.
1846         (WebKit::WebProcess::getWebCoreStatistics): Deleted.
1847         * WebProcess/WebProcess.h:
1848         * WebProcess/WebProcess.messages.in:
1849
1850 2020-03-12  David Kilzer  <ddkilzer@apple.com>
1851
1852         WebPasteboardProxy::SetPasteboardBufferForType should validate its `size` parameter
1853         <https://webkit.org/b/208902>
1854         <rdar://problem/60181117>
1855
1856         Reviewed by Chris Dumez.
1857
1858         * Platform/IPC/Connection.h:
1859         (MESSAGE_CHECK_BASE):
1860         - Define in terms of MESSAGE_CHECK_COMPLETION_BASE() with a
1861           no-op completion handler.
1862         (MESSAGE_CHECK_COMPLETION_BASE):
1863         - Rename from MESSAGE_CHECK_BASE() and add completion handler
1864           parameter.
1865
1866         * Platform/SharedMemory.h:
1867         (WebKit::SharedMemory::Handle::size const): Add.
1868
1869         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1870         (MESSAGE_CHECK):
1871         - Define macro to use in
1872           WebPasteboardProxy::setPasteboardBufferForType().
1873         - Undefine macro at end of source file due to unified sources.
1874         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
1875         - Add IPC::Connection& parameter after change to
1876           WebPasteboardProxy.messages.in.  Use with MESSAGE_CHECK().
1877         - Validate `size` parameter using MESSAGE_CHECK().  Because
1878           SharedMemory::Handle::size() returns a size_t value, we do not
1879           need to check `size <= std::numeric_limits<size_t>::max()`.
1880         - Add static_cast<size_t>() to size parameter to denote type
1881           change.
1882         * UIProcess/WebPasteboardProxy.h:
1883         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
1884         - Add IPC::Connection& parameter after change to
1885           WebPasteboardProxy.messages.in.
1886         * UIProcess/WebPasteboardProxy.messages.in:
1887         (SetPasteboardBufferForType):
1888         - Add 'WantsConnection' attribute to add IPC::Connection&
1889           parameter to WebPasteboardProxy::setPasteboardBufferForType().
1890
1891 2020-03-12  Youenn Fablet  <youenn@apple.com>
1892
1893         Provide orientation to GPUProcess when it will start to capture
1894         https://bugs.webkit.org/show_bug.cgi?id=208911
1895
1896         Reviewed by Eric Carlson.
1897
1898         Provide orientation to GPUProcess whenever starting to capture.
1899         This fixes the case of spinning the GPUProcess/starting capture in landscape mode.
1900         Do not send orientation to GPUProcess if it is not yet started as an optimization.
1901
1902         Manually tested.
1903
1904         * UIProcess/WebPageProxy.cpp:
1905
1906 2020-03-12  Eric Carlson  <eric.carlson@apple.com>
1907
1908         Remove TextTrackPrivateRemote.messages.in
1909         https://bugs.webkit.org/show_bug.cgi?id=208935
1910
1911         Reviewed by Don Olmstead.
1912
1913         No new tests, no functional change.
1914
1915         * CMakeLists.txt:
1916         * DerivedSources-input.xcfilelist:
1917         * WebKit.xcodeproj/project.pbxproj:
1918         * WebProcess/GPU/media/TextTrackPrivateRemote.messages.in: Removed.
1919
1920 2020-03-12  youenn fablet  <youenn@apple.com>
1921
1922         Move AudioSession interruption listener code to AudioSession
1923         https://bugs.webkit.org/show_bug.cgi?id=208714
1924
1925         Reviewed by Jer Noble.
1926
1927         Make RemoteAudioSessionProxyManager an observer for AudioSession interruptions.
1928         When being interrupted, notify all WebProcesses and trigger begin/end interruption mechanisms.
1929         We only send interruption to sessions that are active in RemoteAudioSessionProxyManager.
1930         Minor refactorting to move manager proxies from a map to a weak hash set.
1931
1932         * GPUProcess/GPUConnectionToWebProcess.cpp:
1933         (WebKit::GPUConnectionToWebProcess::didClose):
1934         (WebKit::GPUConnectionToWebProcess::audioSessionProxy):
1935         * GPUProcess/media/RemoteAudioSessionProxy.cpp:
1936         (WebKit::RemoteAudioSessionProxy::setCategory):
1937         (WebKit::RemoteAudioSessionProxy::setPreferredBufferSize):
1938         (WebKit::RemoteAudioSessionProxy::tryToSetActive):
1939         * GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
1940         (WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager):
1941         (WebKit::RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager):
1942         (WebKit::RemoteAudioSessionProxyManager::addProxy):
1943         (WebKit::RemoteAudioSessionProxyManager::removeProxy):
1944         (WebKit::RemoteAudioSessionProxyManager::setCategoryForProcess):
1945         (WebKit::RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess):
1946         (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess):
1947         (WebKit::RemoteAudioSessionProxyManager::beginAudioSessionInterruption):
1948         (WebKit::RemoteAudioSessionProxyManager::endAudioSessionInterruption):
1949         * GPUProcess/media/RemoteAudioSessionProxyManager.h:
1950         * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp:
1951         * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.h:
1952         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp:
1953         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.h:
1954         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.messages.in:
1955
1956 2020-03-12  Don Olmstead  <don.olmstead@sony.com>
1957
1958         [GPUP] Use standard int type in RemoteMediaPlayerState
1959         https://bugs.webkit.org/show_bug.cgi?id=208962
1960
1961         Reviewed by Eric Carlson.
1962
1963         An unsigned long long is at least 64-bits so use uint64_t instead. This issue
1964         was found when compiling out the GPU Process. No specialization of unsigned long
1965         long was found which resulted in errors. This appears to be a non-Cocoa problem.
1966
1967         * WebProcess/GPU/media/RemoteMediaPlayerState.h:
1968         (WebKit::RemoteMediaPlayerState::decode):
1969
1970 2020-03-12  youenn fablet  <youenn@apple.com>
1971
1972         GPUProcess should ensure UIProcess granted capture access to a WebProcess making a capture request
1973         https://bugs.webkit.org/show_bug.cgi?id=208910
1974
1975         Reviewed by Eric Carlson.
1976
1977         When UIProcess receives a getUserMedia request, it will send to GPUProcess a notification of what is allowed.
1978         GPUProcess stores for each connection to web process whether microphone, camera and/or display are allowed.
1979         We do not disable access for a given process for now.
1980         A future refactoring should probably streamline the implementation so that, in case capture happens in GPUProcess,
1981         GPUProcess receives the getUserMedia request, asks permission to UIProcess and, upon granted permission, creates directly the sources.
1982
1983         Covered by existing tests.
1984
1985         * GPUProcess/GPUConnectionToWebProcess.cpp:
1986         (WebKit::GPUConnectionToWebProcess::updateCaptureAccess):
1987         * GPUProcess/GPUConnectionToWebProcess.h:
1988         (WebKit::GPUConnectionToWebProcess::allowsAudioCapture const):
1989         (WebKit::GPUConnectionToWebProcess::allowsVideoCapture const):
1990         (WebKit::GPUConnectionToWebProcess::allowsDisplayCapture const):
1991         * GPUProcess/GPUProcess.cpp:
1992         (WebKit::GPUProcess::createGPUConnectionToWebProcess):
1993         (WebKit::GPUProcess::updateCaptureAccess):
1994         * GPUProcess/GPUProcess.h:
1995         * GPUProcess/GPUProcess.messages.in:
1996         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1997         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1998         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1999         * UIProcess/GPU/GPUProcessProxy.cpp:
2000         (WebKit::GPUProcessProxy::updateCaptureAccess):
2001         * UIProcess/GPU/GPUProcessProxy.h:
2002         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2003         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
2004         * UIProcess/WebPageProxy.cpp:
2005         * UIProcess/WebPageProxy.h:
2006         * UIProcess/WebProcessProxy.cpp:
2007
2008 2020-03-12  Brent Fulgham  <bfulgham@apple.com>
2009
2010         Drop unused EnableEnumeratingAllNetworkInterfaces / DisableEnumeratingAllNetworkInterfaces IPC messages
2011         https://bugs.webkit.org/show_bug.cgi?id=208973
2012         <rdar://problem/59683940>
2013
2014         Reviewed by Youenn Fablet.
2015
2016         Remove two unused IPC messages.
2017
2018         * WebProcess/WebPage/WebPage.cpp:
2019         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): Deleted.
2020         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): Deleted.
2021         * WebProcess/WebPage/WebPage.h:
2022         * WebProcess/WebPage/WebPage.messages.in:
2023
2024 2020-03-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
2025
2026         [GPU Process] encodeNativeImage() should pass imageSize to GraphicsContext::drawNativeImage()
2027         https://bugs.webkit.org/show_bug.cgi?id=208936
2028
2029         Reviewed by Myles C. Maxfield.
2030
2031         Passing an empty FloatSize makes drawNativeImage() draws nothing to
2032         the ShareableBitmap
2033
2034         * Shared/WebCoreArgumentCoders.cpp:
2035         (IPC::encodeNativeImage):
2036
2037 2020-03-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
2038
2039         RemoteImageBuffer::getImageData() has to clear its DisplayList after calling flushDrawingContext()
2040         https://bugs.webkit.org/show_bug.cgi?id=208931
2041
2042         Reviewed by Myles C. Maxfield.
2043
2044         Instead of letting every caller to flushDrawingContextAndWaitCommit() or
2045         flushDrawingContext() be responsible of clearing the DisplayList, we can
2046         make these functions take this responsibility.
2047
2048         * WebProcess/GPU/graphics/RemoteImageBuffer.h:
2049         * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp:
2050         (WebKit::RemoteImageBufferMessageHandler::flushDrawingContext):
2051         (WebKit::RemoteImageBufferMessageHandler::flushDrawingContextAndWaitCommit):
2052         * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.h:
2053
2054 2020-03-11  Don Olmstead  <don.olmstead@sony.com>
2055
2056         Non-unified build fixes early March 2020 edition Take 2
2057         https://bugs.webkit.org/show_bug.cgi?id=208968
2058
2059         Unreviewed build fix.
2060
2061         * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp:
2062         * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
2063         (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer):
2064
2065 2020-03-11  Don Olmstead  <don.olmstead@sony.com>
2066
2067         [GPUP] Add entry points for non-Cocoa ports
2068         https://bugs.webkit.org/show_bug.cgi?id=208965
2069
2070         Reviewed by Michael Catanzaro.
2071
2072         Add a CMake target for the GPU Process that is optionally defined based on
2073         whether the process is enabled.
2074
2075         Add an entry point for the GPU Process for unix and windows ports. Use this
2076         as the source for the GPU Process by specifying it in the Platform CMake file.
2077
2078         Add in hooks for both Windows and GLib to launch the GPU Process if it is
2079         enabled in the port.
2080
2081         * CMakeLists.txt:
2082         * GPUProcess/EntryPoint/unix/GPUProcessMain.cpp: Added.
2083         (main):
2084         * GPUProcess/EntryPoint/win/GPUProcessMain.cpp: Added.
2085         (main):
2086         * GPUProcess/GPUProcessMain.h: Added.
2087         * PlatformFTW.cmake:
2088         * PlatformGTK.cmake:
2089         * PlatformMac.cmake:
2090         * PlatformPlayStation.cmake:
2091         * PlatformWPE.cmake:
2092         * PlatformWin.cmake:
2093         * Shared/ProcessExecutablePath.h:
2094         * Shared/glib/ProcessExecutablePathGLib.cpp:
2095         (WebKit::executablePathOfGPUProcess):
2096         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2097         (WebKit::ProcessLauncher::launchProcess):
2098         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
2099         (WebKit::processName):
2100
2101 2020-03-11  Don Olmstead  <don.olmstead@sony.com>
2102
2103         [GPUP] Add special handling of MediaTime within message generator
2104         https://bugs.webkit.org/show_bug.cgi?id=208958
2105
2106         Reviewed by Eric Carlson.
2107
2108         When compiling the GPU Process sources without unified sources there were
2109         numerous compilation errors around MediaTime. Only GPU Process .messages.in
2110         files reference this type so there was no special handling within messages.py.
2111         Adding explicit references to MediaTime so the proper header is used and all
2112         sources compile.
2113
2114         * Scripts/webkit/messages.py:
2115
2116 2020-03-11  Per Arne Vollan  <pvollan@apple.com>
2117
2118         [macOS] Register with accessibility when the WebContent process starts
2119         https://bugs.webkit.org/show_bug.cgi?id=208960
2120
2121         Reviewed by Brent Fulgham.
2122
2123         When we reenabled CF prefs direct mode in <https://bugs.webkit.org/show_bug.cgi?id=208690>, we started to register
2124         with accessibility when we received a message to do so from the UI process. This would typically happen when the user
2125         enabled accessibility. On macOS, this notification does not work the same way as on iOS, and it is assumed that
2126         accessibility should always be enabled. Therefore we should go back to registering with accessibility on startup of
2127         the WebContent process on macOS.
2128
2129         * WebProcess/cocoa/WebProcessCocoa.mm:
2130         (WebKit::WebProcess::platformInitializeProcess):
2131         (WebKit::WebProcess::unblockAccessibilityServer):
2132
2133 2020-03-11  Don Olmstead  <don.olmstead@sony.com>
2134
2135         [GPUP] RemoteAudioDestination classes should require ENABLE(WEB_AUDIO)
2136         https://bugs.webkit.org/show_bug.cgi?id=208956
2137
2138         Reviewed by Dean Jackson.
2139
2140         RemoteAudioDestinationProxy uses AudioBus directly. For ports that don't 
2141         ENABLE(WEB_AUDIO) there is no implementation and linker errors will occur after
2142         building with ENABLE(GPU_PROCESS).
2143
2144         Add guards for ENABLE(WEB_AUDIO) around relevant implementations.
2145
2146         * GPUProcess/GPUConnectionToWebProcess.cpp:
2147         (WebKit::GPUConnectionToWebProcess::dispatchMessage):
2148         (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage):
2149         * GPUProcess/GPUConnectionToWebProcess.h:
2150         * GPUProcess/media/RemoteAudioDestinationManager.cpp:
2151         * GPUProcess/media/RemoteAudioDestinationManager.h:
2152         * GPUProcess/media/RemoteAudioDestinationManager.messages.in:
2153         * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:
2154         * WebProcess/GPU/media/RemoteAudioDestinationProxy.h:
2155         * WebProcess/GPU/media/RemoteAudioDestinationProxy.messages.in:
2156
2157 2020-03-11  Commit Queue  <commit-queue@webkit.org>
2158
2159         Unreviewed, reverting r258294.
2160         https://bugs.webkit.org/show_bug.cgi?id=208957
2161
2162         Introduced API failure (Requested by perarne on #webkit).
2163
2164         Reverted changeset:
2165
2166         "[macOS] _AXSApplicationAccessibilityEnabled should not be
2167         called"
2168         https://bugs.webkit.org/show_bug.cgi?id=208953
2169         https://trac.webkit.org/changeset/258294
2170
2171 2020-03-11  Kate Cheney  <katherine_cheney@apple.com>
2172
2173         Add a parameter to allow ignoring app-bound domain categorization
2174         https://bugs.webkit.org/show_bug.cgi?id=208949
2175         <rdar://problem/60239187>
2176
2177         Reviewed by Brent Fulgham.
2178
2179         Introduce a new parameter to ignore app-bound domain categorization
2180         for specific WebViews.
2181
2182         * UIProcess/API/APIPageConfiguration.h:
2183         (API::PageConfiguration::ignoresAppBoundDomains const):
2184         (API::PageConfiguration::setIgnoresAppBoundDomains):
2185         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2186         (-[WKWebViewConfiguration _ignoresAppBoundDomains]):
2187         (-[WKWebViewConfiguration _setIgnoresAppBoundDomains:]):
2188         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2189         * UIProcess/WebPageProxy.cpp:
2190         (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
2191
2192 2020-03-11  Per Arne Vollan  <pvollan@apple.com>
2193
2194         [macOS] _AXSApplicationAccessibilityEnabled should not be called
2195         https://bugs.webkit.org/show_bug.cgi?id=208953
2196
2197         Reviewed by Brent Fulgham.
2198
2199         This function should only be called on iOS, not on macOS.
2200
2201         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2202         (WebKit::WebProcessPool::platformInitializeWebProcess):
2203         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2204         (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
2205
2206 2020-03-11  Jiewen Tan  <jiewen_tan@apple.com>
2207
2208         [WebAuthn] Formalize the Keychain schema
2209         https://bugs.webkit.org/show_bug.cgi?id=183533
2210         <rdar://problem/43347926>
2211
2212         Reviewed by Brent Fulgham.
2213
2214         This patch formalizes the schema for the Keychain as follows:
2215         kSecAttrLabel: RP ID
2216         kSecAttrApplicationLabel: Credential ID (auto-gen by Keychain)
2217         kSecAttrApplicationTag: { "id": UserEntity.id, "name": UserEntity.name } (CBOR encoded)
2218         Noted, the vale of kSecAttrApplicationLabel is automatically generated by the Keychain, which is a SHA-1 hash of
2219         the public key.
2220
2221         According to the Step 7. from https://www.w3.org/TR/webauthn/#op-make-cred, the following fields are mandatory
2222         1. rpId (rpEntity.id);
2223         2. userHandle (userEntity.id), this is required for authenticators that support resident keys;
2224         3. credentialId.
2225
2226         Some other optional fields are:
2227         (from https://www.w3.org/TR/webauthn/#dictdef-publickeycredentialrpentity)
2228         1. rpEntity.name;
2229         2. rpEnitty.icon;
2230         (from https://www.w3.org/TR/webauthn/#dictdef-publickeycredentialuserentity)
2231         3. userEntity.displayName;
2232         4. userEntity.name;
2233         5. userEntity.icon;
2234         (from https://www.w3.org/TR/webauthn/#sign-counter)
2235         6. signature counter.
2236
2237         Among the six possible fields, only 4. is chosen to store. Here is why:
2238         For rpEntity, rpEntity.id which is either the domain or the eTLD + 1 of the website is
2239         sufficient enough to either classify the credential or serving the UI. Also, this is the only
2240         trustworthy information that the UserAgent produce. Others could potentially be used by
2241         malicious websites for attacking the Keychain or spoofing/phishing users when being displayed
2242         in the UI. Also, rpEnitty.icon is a URL to the website's favicon, which if not implemented
2243         correctly can be used for tracking.
2244
2245         For userEntity, userEntity.name is the human readable version of userEntity.id, and therefore
2246         is chosen to store such that later on WebKit can pass it to UI client to help users disambiguate
2247         different credentials. And it is necessary as userEntity.id is not guaranteed to be human
2248         readable. Others are abandoned for the very same reason as above.
2249
2250         We hard code a zero value for 'signature counter'. While this is a theoretically interesting
2251         technique for a RP to detect private key cloning, it is unlikely to be useful in practice.
2252         We store the private keys in our SEP. This counter would only be a meaningful protection if
2253         adversaries were able to extract private key data from the SEP without Apple noticing, but
2254         were not able to manipulate this counter to fool the RP.
2255
2256         In terms of the schema,
2257         1) RP ID is needed to query all credentials related, and therefore it needs a column and kSecAttrLabel
2258         is supposed to be human readable;
2259         2) kSecAttrApplicationLabel is the auto generated programmatical identifier for a SecItem, and
2260         therefore is suitable as the credential ID. Given the input to the SHA-1 is generated by us, and
2261         it is only needed to be powerful enough to be unique across the keychain within a device, and potentially
2262         to be unique across different other credential ID for the same user. The SHA-1 collision attack
2263         doesn't seem valid here.
2264         3) kSecAttrApplicationTag is the only other column Keychain allows applications to modify. Therefore,
2265         UserEntity.id and UserEntity.name is bundled to use this slot. The reason to use CBOR here is that
2266         it is more friendly then JSON to encode binaries, and it is used widely in WebAuthn.
2267
2268         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
2269         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2270         (WebKit::LocalAuthenticatorInternal::toArrayBuffer):
2271         (WebKit::LocalAuthenticatorInternal::getExistingCredentials):
2272         (WebKit::LocalAuthenticator::makeCredential):
2273         (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
2274         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
2275         (WebKit::LocalAuthenticator::getAssertion):
2276         (WebKit::LocalAuthenticator::deleteDuplicateCredential const):
2277         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
2278         (WebKit::MockLocalConnection::filterResponses const):
2279
2280 2020-03-11  Per Arne Vollan  <pvollan@apple.com>
2281
2282         [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
2283         https://bugs.webkit.org/show_bug.cgi?id=208945
2284
2285         Unreviewed temporary compile fix.
2286
2287         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2288         (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
2289
2290 2020-03-11  Per Arne Vollan  <pvollan@apple.com>
2291
2292         [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
2293         https://bugs.webkit.org/show_bug.cgi?id=208945
2294
2295         Reviewed by Tim Horton.
2296
2297         Check that accessibility library is present before attempting to call functions in it.
2298
2299         No new tests, since I am not able to reproduce.
2300
2301         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2302         (WebKit::WebProcessPool::platformInitializeWebProcess):
2303         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2304         (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
2305
2306 2020-03-11  Per Arne Vollan  <pvollan@apple.com>
2307
2308         [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
2309         https://bugs.webkit.org/show_bug.cgi?id=208945
2310         <rdar://problem/60330751>
2311         
2312         Reviewed by Brent Fulgham.
2313
2314         Check that accessibility library is present before attempting to use constants from it.
2315
2316         No new tests, since I am unable to reproduce.
2317
2318         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2319         (WebKit::WebProcessPool::registerNotificationObservers):
2320         (WebKit::WebProcessPool::unregisterNotificationObservers):
2321
2322 2020-03-11  Alex Christensen  <achristensen@webkit.org>
2323
2324         Enable safe browsing warnings in Mac Catalyst WebKit
2325         https://bugs.webkit.org/show_bug.cgi?id=208944
2326         <rdar://problem/58854302>
2327
2328         Reviewed by Tim Horton.
2329
2330         I manually verified using the steps in the radar that it works as one would hope.
2331
2332         * Configurations/WebKit.xcconfig:
2333
2334 2020-03-11  Alex Christensen  <achristensen@webkit.org>
2335
2336         Fix the macCatalyst build after r258250
2337
2338         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
2339         (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
2340
2341 2020-03-11  Chris Dumez  <cdumez@apple.com>
2342
2343         Terminate the Network / Plugin processes when receiving invalid IPC from them
2344         https://bugs.webkit.org/show_bug.cgi?id=208933
2345         <rdar://problem/58026473>
2346
2347         Reviewed by Geoffrey Garen.
2348
2349         * UIProcess/Network/NetworkProcessProxy.cpp:
2350         (WebKit::NetworkProcessProxy::didReceiveInvalidMessage):
2351         * UIProcess/Plugins/PluginProcessProxy.cpp:
2352         (WebKit::PluginProcessProxy::didReceiveInvalidMessage):
2353
2354 2020-03-11  Timothy Horton  <timothy_horton@apple.com>
2355
2356         Fix the macCatalyst build after r258250
2357
2358         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
2359
2360 2020-03-11  Chris Dumez  <cdumez@apple.com>
2361
2362         Assertion hit under WebPageProxy::suspendCurrentPageIfPossible() when bypassing certificate warning page
2363         https://bugs.webkit.org/show_bug.cgi?id=208927
2364         <rdar://problem/55448331>
2365
2366         Reviewed by Alex Christensen.
2367
2368         When suspending a previous page after a process-swap, we refuse to do the suspension if the currently
2369         committed URL does not match the url of the current back/forward list item. This makes sense since we
2370         will store the suspended page on the back/forward list item and restore that back when navigating back
2371         to that item. I had a debug assertion in there to help me figure out how this could happen. It turns
2372         out that calling loadAlternateHTML on the view will replace the content of the view with the provided
2373         HTML string, update the committed URL but not create a new back/forward list item. This is so that
2374         if you reload or go/back to this back/forward list item, we will attempt to load the original URL
2375         again. This would however trip my assertion. I am therefore removing my debug assertion and adding API
2376         test coverage.
2377
2378         * UIProcess/WebPageProxy.cpp:
2379         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2380
2381 2020-03-11  Alex Christensen  <achristensen@webkit.org>
2382
2383         Introduce ResourceLoadStatisticsParameters and move members from NetworkSessionCreationParameters
2384         https://bugs.webkit.org/show_bug.cgi?id=208895
2385
2386         Reviewed by Youenn Fablet.
2387
2388         No change in behavior yet, but this will help us organize things better.
2389
2390         * NetworkProcess/NetworkProcess.cpp:
2391         (WebKit::NetworkProcess::initializeNetworkProcess):
2392         * NetworkProcess/NetworkSession.cpp:
2393         (WebKit::NetworkSession::NetworkSession):
2394         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2395         (WebKit::NetworkSessionCreationParameters::encode const):
2396         (WebKit::NetworkSessionCreationParameters::decode):
2397         * NetworkProcess/NetworkSessionCreationParameters.h:
2398         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2399         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2400         * Shared/ResourceLoadStatisticsParameters.h: Added.
2401         (WebKit::ResourceLoadStatisticsParameters::encode const):
2402         (WebKit::ResourceLoadStatisticsParameters::decode):
2403         * UIProcess/WebProcessPool.cpp:
2404         (WebKit::WebProcessPool::ensureNetworkProcess):
2405         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2406         (WebKit::WebsiteDataStore::parameters):
2407         * WebKit.xcodeproj/project.pbxproj:
2408
2409 2020-03-11  Chris Dumez  <cdumez@apple.com>
2410
2411         Defer async scripts until DOMContentLoaded or first paint, whichever comes first
2412         https://bugs.webkit.org/show_bug.cgi?id=208896
2413
2414         Reviewed by Darin Adler.
2415
2416         Defer async scripts until DOMContentLoaded or first paint, whichever comes first. In
2417         Bug 207698, we deferred them until DOMContentLoaded, as a first-paint optimization.
2418         However, this seems overly aggressive on pages like wikipedia and it is sufficient
2419         to defer those scripts until first-paint to get the performance win.
2420
2421         * Shared/WebPreferences.yaml:
2422         * UIProcess/API/Cocoa/WKWebView.mm:
2423         (-[WKWebView _setupPageConfiguration:]):
2424
2425 2020-03-11  Commit Queue  <commit-queue@webkit.org>
2426
2427         Unreviewed, reverting r258263.
2428         https://bugs.webkit.org/show_bug.cgi?id=208922
2429
2430         it is breaking internal builds (Requested by youenn on
2431         #webkit).
2432
2433         Reverted changeset:
2434
2435         "Move AudioSession interruption listener code to AudioSession"
2436         https://bugs.webkit.org/show_bug.cgi?id=208714
2437         https://trac.webkit.org/changeset/258263
2438
2439 2020-03-11  youenn fablet  <youenn@apple.com>
2440
2441         Move AudioSession interruption listener code to AudioSession
2442         https://bugs.webkit.org/show_bug.cgi?id=208714
2443
2444         Reviewed by Jer Noble.
2445
2446         Make RemoteAudioSessionProxyManager an observer for AudioSession interruptions.
2447         When being interrupted, notify all WebProcesses and trigger begin/end interruption mechanisms.
2448         We only send interruption to sessions that are active in RemoteAudioSessionProxyManager.
2449         Minor refactorting to move manager proxies from a map to a weak hash set.
2450
2451         * GPUProcess/GPUConnectionToWebProcess.cpp:
2452         (WebKit::GPUConnectionToWebProcess::didClose):
2453         (WebKit::GPUConnectionToWebProcess::audioSessionProxy):
2454         * GPUProcess/media/RemoteAudioSessionProxy.cpp:
2455         (WebKit::RemoteAudioSessionProxy::setCategory):
2456         (WebKit::RemoteAudioSessionProxy::setPreferredBufferSize):
2457         (WebKit::RemoteAudioSessionProxy::tryToSetActive):
2458         * GPUProcess/media/RemoteAudioSessionProxyManager.cpp:
2459         (WebKit::RemoteAudioSessionProxyManager::RemoteAudioSessionProxyManager):
2460         (WebKit::RemoteAudioSessionProxyManager::~RemoteAudioSessionProxyManager):
2461         (WebKit::RemoteAudioSessionProxyManager::addProxy):
2462         (WebKit::RemoteAudioSessionProxyManager::removeProxy):
2463         (WebKit::RemoteAudioSessionProxyManager::setCategoryForProcess):
2464         (WebKit::RemoteAudioSessionProxyManager::setPreferredBufferSizeForProcess):
2465         (WebKit::RemoteAudioSessionProxyManager::tryToSetActiveForProcess):
2466         (WebKit::RemoteAudioSessionProxyManager::beginAudioSessionInterruption):
2467         (WebKit::RemoteAudioSessionProxyManager::endAudioSessionInterruption):
2468         * GPUProcess/media/RemoteAudioSessionProxyManager.h:
2469         * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp:
2470         * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.h:
2471         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp:
2472         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.h:
2473         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.messages.in:
2474
2475 2020-03-10  Don Olmstead  <don.olmstead@sony.com>
2476
2477         [GPU Process] Work towards compiling out on non-Cocoa ports
2478         https://bugs.webkit.org/show_bug.cgi?id=208899
2479
2480         Reviewed by Darin Adler.
2481
2482         Work through some compilation issues on non-Cocoa ports when attempting to build
2483         out the GPU Process. Fix platform guards for some methods. Fix compilation issues
2484         for non-unified builds.
2485
2486         Add in CMake listing of messages.in and include directories required for building
2487         with ENABLE_GPU_PROCESS.
2488
2489         * CMakeLists.txt:
2490         * GPUProcess/GPUConnectionToWebProcess.cpp:
2491         (WebKit::GPUConnectionToWebProcess::didClose):
2492         * GPUProcess/GPUConnectionToWebProcess.messages.in:
2493         * GPUProcess/GPUProcess.cpp:
2494         * GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.h:
2495         * GPUProcess/graphics/RemoteImageBufferProxy.h:
2496         (WebKit::RemoteImageBufferProxy::create):
2497         * GPUProcess/graphics/RemoteRenderingBackendProxy.cpp:
2498         * GPUProcess/graphics/RemoteRenderingBackendProxy.h:
2499         * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
2500         (WebKit::RemoteMediaPlayerProxy::getConfiguration):
2501         (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenGravity):
2502         (WebKit::RemoteMediaPlayerProxy::updateVideoFullscreenInlineImage):
2503         (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenMode):
2504         (WebKit::RemoteMediaPlayerProxy::videoFullscreenStandbyChanged):
2505         (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged):
2506         (WebKit::RemoteMediaPlayerProxy::notifyTrackModeChanged):
2507         * GPUProcess/media/RemoteMediaPlayerProxy.h:
2508         * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
2509         * UIProcess/GPU/GPUProcessProxy.h:
2510         * WebProcess/GPU/GPUProcessConnection.cpp:
2511         * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
2512         * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h:
2513         * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.h:
2514         * WebProcess/GPU/graphics/RemoteRenderingBackend.cpp:
2515         * WebProcess/GPU/media/AudioTrackPrivateRemote.h:
2516         * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
2517         * WebProcess/GPU/media/TextTrackPrivateRemote.h:
2518
2519 2020-03-10  Per Arne Vollan  <pvollan@apple.com>
2520
2521         [iOS] A syscall is denied by the sandbox
2522         https://bugs.webkit.org/show_bug.cgi?id=208892
2523         <rdar://problem/60294880>
2524
2525         Reviewed by Brent Fulgham.
2526
2527         Add denied syscall to sandbox on iOS.
2528
2529         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2530
2531 2020-03-08  Darin Adler  <darin@apple.com>
2532
2533         Make TextIterator::range return a SimpleRange
2534         https://bugs.webkit.org/show_bug.cgi?id=208797
2535
2536         Reviewed by Don Olmstead.
2537
2538         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
2539         (-[WKDOMTextIterator currentRange]): Use createLiveRange.
2540
2541         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: Added includes.
2542
2543 2020-03-10  Don Olmstead  <don.olmstead@sony.com>
2544
2545         Non-unified build fixes early March 2020 edition
2546         https://bugs.webkit.org/show_bug.cgi?id=208897
2547
2548         Unreviewed build fix.
2549
2550         * NetworkProcess/NetworkLoadChecker.h:
2551
2552 2020-03-10  Kate Cheney  <katherine_cheney@apple.com>
2553
2554         Some common domains should always be App-bound domains
2555         https://bugs.webkit.org/show_bug.cgi?id=208893
2556          <rdar://problem/60280943>
2557
2558         Reviewed by Brent Fulgham.
2559
2560         Some domains, like about:blank and pages loaded from files should
2561         always be considered app-bound.
2562
2563         * UIProcess/WebPageProxy.cpp:
2564         (WebKit::shouldBeTreatedAsAppBound):
2565         (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
2566
2567 2020-03-10  Devin Rousso  <drousso@apple.com>
2568
2569         Web Inspector: make `WebKit::WebInspectorProxy::m_isOpening` GTK only
2570         https://bugs.webkit.org/show_bug.cgi?id=208831
2571         <rdar://problem/57720692>
2572
2573         Reviewed by Brian Burg.
2574
2575         * UIProcess/Inspector/WebInspectorProxy.h:
2576         * UIProcess/Inspector/WebInspectorProxy.cpp:
2577         (WebKit::WebInspectorProxy::open):
2578
2579 2020-03-10  David Kilzer  <ddkilzer@apple.com>
2580
2581         [CoreIPC] WebPasteboardProxy::SetPasteboardBufferForType uses "0" for both uint64_t and a pointer value
2582         <https://webkit.org/b/208879>
2583         <rdar://problem/60165624>
2584
2585         Reviewed by Wenson Hsieh.
2586
2587         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2588         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
2589         - Change 0 to nullptr to make code easier to read.
2590
2591 2020-03-10  Andres Gonzalez  <andresg_22@apple.com>
2592
2593         Enable accessibility IsolatedTree in WebKit.
2594         https://bugs.webkit.org/show_bug.cgi?id=208881
2595
2596         Reviewed by Chris Fleizach.
2597
2598         Sets the default value of accessibility IsolatedTree support to true.
2599
2600         * Shared/WebPreferences.yaml:
2601
2602 2020-03-10  Megan Gardner  <megan_gardner@apple.com>
2603
2604         File upload cancels before files can be uploaded.
2605         https://bugs.webkit.org/show_bug.cgi?id=208846
2606         <rdar://problem/60244249>
2607
2608         Reviewed by Tim Horton.
2609
2610         With the new UIContextMenus, we needed to cancel in order for everything to be 
2611         reset correctly in WebCore. But this can only be done in the animation completion
2612         handler, but we only want to cancel if we aren't presenting a different picker.
2613
2614         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2615         (-[WKFileUploadPanel contextMenuInteraction:configurationForMenuAtLocation:]):
2616         (-[WKFileUploadPanel contextMenuInteraction:willEndForConfiguration:animator:]):
2617         (-[WKFileUploadPanel ensureContextMenuInteraction]):
2618
2619 2020-03-10  youenn fablet  <youenn@apple.com>
2620
2621         Make sure that ServiceWorkerFrameLoaderClient lifetime exceeds its frame lifetime
2622         https://bugs.webkit.org/show_bug.cgi?id=208855
2623         <rdar://problem/60187332>
2624
2625         Reviewed by Geoffrey Garen.
2626
2627         In case connection is destroyed, for instance due to network process crashing,
2628         we destroy all service worker frame loader clients.
2629         This is too soon as service worker thread proxy is refcounted and can last longer.
2630         For that reason, we now let the SWContextManager handle the lifetime of the frame loader clients.
2631         Drive-by fix: generate a new frame identifier instead of using an internal counter which can be wrong in case of new connection
2632         and might clash with other frame identifiers now that service workers can run in process with pages.
2633
2634         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2635         (WebKit::ServiceWorkerFrameLoaderClient::create):
2636         (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
2637         (WebKit::ServiceWorkerFrameLoaderClient::frameLoaderDestroyed):
2638         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2639         * WebProcess/Storage/WebSWContextManagerConnection.h:
2640
2641 2020-03-10  Youenn Fablet  <youenn@apple.com>
2642
2643         Do not create a service worker connection if service worker is not enabled in network process
2644         https://bugs.webkit.org/show_bug.cgi?id=208851
2645
2646         Reviewed by Simon Fraser.
2647
2648         In case of navigation redirection, we were trying to go to service worker without checking the service worker entitlement.
2649         Instead, we should check the service worker entitlement and return early in that case.
2650
2651         Covered by manually running minibrowser on simulator.
2652
2653         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2654         (WebKit::NetworkConnectionToWebProcess::isServiceWorkerAllowed const):
2655         (WebKit::NetworkConnectionToWebProcess::createFetchTask):
2656         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
2657         * NetworkProcess/NetworkConnectionToWebProcess.h:
2658         * NetworkProcess/NetworkResourceLoader.cpp:
2659         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2660         (WebKit::NetworkResourceLoader::startWithServiceWorker):
2661
2662 2020-03-10  youenn fablet  <youenn@apple.com>
2663
2664         Remove SampleBufferDisplayLayer sync IPC
2665         https://bugs.webkit.org/show_bug.cgi?id=208804
2666
2667         Reviewed by Eric Carlson.
2668
2669         Implement the initialize method as an async IPC.
2670
2671         * GPUProcess/GPUConnectionToWebProcess.cpp:
2672         (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage):
2673         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
2674         (WebKit::RemoteSampleBufferDisplayLayer::RemoteSampleBufferDisplayLayer):
2675         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp:
2676         (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer):
2677         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
2678         * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in:
2679         * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
2680         (WebKit::RemoteMediaPlayerManager::updatePreferences):
2681         * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
2682         (WebKit::SampleBufferDisplayLayer::create):
2683         (WebKit::SampleBufferDisplayLayer::SampleBufferDisplayLayer):
2684         (WebKit::SampleBufferDisplayLayer::initialize):
2685         * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:
2686         * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp:
2687         (WebKit::SampleBufferDisplayLayerManager::createLayer):
2688         * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h:
2689
2690 2020-03-10  youenn fablet  <youenn@apple.com>
2691
2692         [iOS] Make sure a MediStreamTrack clone does not interrupt the being cloned track
2693         https://bugs.webkit.org/show_bug.cgi?id=208634
2694
2695         Reviewed by Eric Carlson.
2696
2697         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2698         (WebKit::UserMediaCaptureManager::VideoFactory::setActiveSource):
2699         Do nothing since GPUProcess will handle the muting itself if it creates multiple sources.
2700         * WebProcess/cocoa/UserMediaCaptureManager.h:
2701
2702 2020-03-10  youenn fablet  <youenn@apple.com>
2703
2704         Remove sync IPC when creating a remote capture source
2705         https://bugs.webkit.org/show_bug.cgi?id=208816
2706
2707         Reviewed by Eric Carlson.
2708
2709         Use whenInitialized to wait for the async IPC that tells whether the remote source was created successfully.
2710         Use the async response to gather the capabilities so as to remove the corresponding sync IPC.
2711
2712         * Platform/IPC/Connection.h:
2713         (IPC::AsyncReplyError::create):
2714         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2715         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2716         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2717         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2718         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2719         (WebKit::UserMediaCaptureManager::Source::didFail):
2720         (WebKit::UserMediaCaptureManager::Source::setAsReady):
2721         (WebKit::UserMediaCaptureManager::Source::setCapabilities):
2722         (WebKit::UserMediaCaptureManager::createCaptureSource):
2723         (WebKit::UserMediaCaptureManager::Source::capabilities):
2724
2725 2020-03-10  youenn fablet  <youenn@apple.com>
2726
2727         Do not process RTC Network messages coming from NetworkProcess if LibWebRTCNetwork is not active
2728         https://bugs.webkit.org/show_bug.cgi?id=207376
2729
2730         Reviewed by Eric Carlson.
2731
2732         In case LibWebRTCNetwork is not active, we do not have instantiated any peer connection.
2733         We do not have started any related RTC thread so we are not expecting any RTC message from Network Process.
2734         Exit early in that case.
2735
2736         * WebProcess/Network/NetworkProcessConnection.cpp:
2737         (WebKit::NetworkProcessConnection::didReceiveMessage):
2738         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
2739         (WebKit::LibWebRTCNetwork::isActive const):
2740
2741 2020-03-10  Diego Pino Garcia  <dpino@igalia.com>
2742
2743         REGRESSION(r258182): [GTK] Remove reference to unrequestedTextCheckingSequence
2744         https://bugs.webkit.org/show_bug.cgi?id=208852
2745
2746         Reviewed by Carlos Garcia Campos.
2747         
2748         unrequestedTextCheckingSequence was removed in r258182. This variable
2749         was still used in an assertion, which broke GTK Debug build.
2750
2751         * UIProcess/gtk/TextCheckerGtk.cpp:
2752         (WebKit::TextChecker::requestCheckingOfString):
2753
2754 2020-03-10  Chris Dumez  <cdumez@apple.com>
2755
2756         Drop unused DisableICECandidateFiltering / EnableICECandidateFiltering IPC messages
2757         https://bugs.webkit.org/show_bug.cgi?id=208843
2758         <rdar://problem/59683940>
2759
2760         Reviewed by Youenn Fablet.
2761
2762         * WebProcess/WebPage/WebPage.cpp:
2763         (WebKit::m_processDisplayName):
2764         (WebKit::WebPage::disableICECandidateFiltering): Deleted.
2765         (WebKit::WebPage::enableICECandidateFiltering): Deleted.
2766         * WebProcess/WebPage/WebPage.h:
2767         * WebProcess/WebPage/WebPage.messages.in:
2768
2769 2020-03-09  Megan Gardner  <megan_gardner@apple.com>
2770
2771         Build Fix
2772         https://bugs.webkit.org/show_bug.cgi?id=208838
2773
2774         Build fix of older iOS.
2775
2776         Reviewed by Tim Horton.
2777
2778         * UIProcess/ios/WKActionSheetAssistant.mm:
2779         (-[WKActionSheetAssistant showDataDetectorsSheet]):
2780         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2781         (-[WKFileUploadPanel showDocumentPickerMenu]):
2782
2783 2020-03-09  Simon Fraser  <simon.fraser@apple.com>
2784
2785         ASSERT(!m_textCheckingRequest) on editing/spelling/spellcheck-async-remove-frame.html
2786         https://bugs.webkit.org/show_bug.cgi?id=126606
2787
2788         Reviewed by Wenson Hsieh.
2789
2790         SpellChecker's sequence numbers need to be unique between frames, because they are sent out
2791         to EditorClient which may be one per web view, so use a static to hold the current
2792         sequence number.
2793
2794         Also convert from int to TextCheckingSequence to make them easier to find, and use
2795         Markable and Optional in TextCheckingRequestData to represent the unset state.
2796
2797         * Shared/WebCoreArgumentCoders.cpp:
2798         (IPC::ArgumentCoder<TextCheckingRequestData>::encode):
2799         (IPC::ArgumentCoder<TextCheckingRequestData>::decode):
2800
2801 2020-03-09  Don Olmstead  <don.olmstead@sony.com>
2802
2803         Remove obsolete feature flags
2804         https://bugs.webkit.org/show_bug.cgi?id=208830
2805
2806         Reviewed by Alex Christensen.
2807
2808         Remove ENABLE_CUSTOM_SCHEME_HANDLER and ENABLE_MAC_VIDEO_TOOLBOX since they
2809         are no longer used.
2810
2811         * Configurations/FeatureDefines.xcconfig:
2812         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: ENABLE(WIRELESS_TARGET_PLAYBACK) -> ENABLE(WIRELESS_PLAYBACK_TARGET).
2813         (-[WKWebViewConfiguration copyWithZone:]):
2814
2815 2020-03-09  Chris Dumez  <cdumez@apple.com>
2816
2817         [iOS] Replace "unexpectedly resumed" observer with RunningBoard suspendible assertions
2818         https://bugs.webkit.org/show_bug.cgi?id=205687
2819         <rdar://problem/57890246>
2820
2821         Reviewed by Tim Horton.
2822
2823         Adopt new RunningBoard process assertion to indicate that WebContent processes depend on their
2824         UIProcess (and therefore, the UIProcess must be running if the WebContent process is). This
2825         replaces our "Unexpectedly resumed" assertion which was causing unexpected terminations in some
2826         cases.
2827
2828         * Configurations/WebKit.xcconfig:
2829         * Platform/spi/ios/RunningBoardServicesSPI.h: Added.
2830         * Scripts/process-entitlements.sh:
2831         * Shared/DependencyProcessAssertion.cpp: Added.
2832         (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):
2833         (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion):
2834         * Shared/DependencyProcessAssertion.h: Added.
2835         * Shared/ios/DependencyProcessAssertionIOS.mm: Added.
2836         (WebKit::DependencyProcessAssertion::DependencyProcessAssertion):
2837         (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion):
2838         * Sources.txt:
2839         * SourcesCocoa.txt:
2840         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2841         * UIProcess/WebProcessProxy.h:
2842         * UIProcess/WebProcessProxy.messages.in:
2843         * WebKit.xcodeproj/project.pbxproj:
2844         * WebProcess/WebProcess.cpp:
2845         (WebKit::WebProcess::initializeConnection):
2846         * WebProcess/WebProcess.h:
2847         * WebProcess/cocoa/WebProcessCocoa.mm:
2848
2849 2020-03-09  Per Arne Vollan  <pvollan@apple.com>
2850
2851         [macOS] Notification observer is not removed
2852         https://bugs.webkit.org/show_bug.cgi?id=208834
2853
2854         Reviewed by Tim Horton.
2855
2856         The Accessibility notification observer is not being removed on macOS.
2857
2858         API test: WebKit.EnableAccessibilityCrash
2859
2860         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2861         (WebKit::WebProcessPool::unregisterNotificationObservers):
2862
2863 2020-03-09  Per Arne Vollan  <pvollan@apple.com>
2864
2865         [iOS] Only map UTI from tags in Safari
2866         https://bugs.webkit.org/show_bug.cgi?id=208829
2867         <rdar://problem/60234672>
2868
2869         Reviewed by Tim Horton.
2870
2871         Since this mapping caused regressions in other apps, only enable it for Safari as a temporary workaround.
2872
2873         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2874         (WebKit::WebProcessPool::platformInitializeWebProcess):
2875         * WebProcess/cocoa/WebProcessCocoa.mm:
2876         (WebKit::WebProcess::platformInitializeWebProcess):
2877
2878 2020-03-09  Per Arne Vollan  <pvollan@apple.com>
2879
2880         Unreviewed build fix.
2881
2882         * Shared/WebProcessCreationParameters.cpp:
2883         (WebKit::WebProcessCreationParameters::decode):
2884
2885 2020-03-09  Jer Noble  <jer.noble@apple.com>
2886
2887         [GPUP] Implement Legacy EME API in the GPU Process
2888         https://bugs.webkit.org/show_bug.cgi?id=208402
2889         <rdar://problem/60178488>
2890
2891         Reviewed by Eric Carlson.
2892
2893         Follow-up: adding the RemoteLegacyCDMFactory as a suppliment got dropped from the initial patch by
2894         a merge/rebase mistake.
2895
2896         * WebProcess/WebProcess.cpp:
2897
2898 2020-03-09  David Kilzer  <ddkilzer@apple.com>
2899
2900         [IPC] WebPageProxy::dataSelectionForPasteboard should check the result of SharedMemory::map
2901         <https://webkit.org/b/208735>
2902         <rdar://problem/58701732>
2903
2904         Reviewed by Darin Adler.
2905
2906         * UIProcess/mac/WebPageProxyMac.mm:
2907         (WebKit::WebPageProxy::dataSelectionForPasteboard): Add null
2908         check.
2909
2910 2020-03-09  Antoine Quint  <graouts@apple.com>
2911
2912         Remove the compile-time flag for Pointer Events
2913         https://bugs.webkit.org/show_bug.cgi?id=208821
2914         <rdar://problem/60223471>
2915
2916         Reviewed by Dean Jackson.
2917
2918         * Configurations/FeatureDefines.xcconfig:
2919         * Shared/WebCoreArgumentCoders.h:
2920         * Shared/WebPreferencesDefaultValues.h:
2921         * UIProcess/API/ios/WKWebViewIOS.mm:
2922         (-[WKWebView scrollViewWillBeginZooming:withView:]):
2923         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2924         (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
2925         * UIProcess/PageClient.h:
2926         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2927         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2928         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
2929         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2930         (WebKit::touchActionsForPoint):
2931         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2932         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2933         (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2934         (-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]):
2935         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer):
2936         * UIProcess/WebPageProxy.cpp:
2937         (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
2938         * UIProcess/WebPageProxy.h:
2939         * UIProcess/ios/PageClientImplIOS.h:
2940         * UIProcess/ios/PageClientImplIOS.mm:
2941         (WebKit::PageClientImpl::activeTouchIdentifierForGestureRecognizer):
2942         * UIProcess/ios/WKContentViewInteraction.h:
2943         * UIProcess/ios/WKContentViewInteraction.mm:
2944         (-[WKContentView preventsPanningInYAxis]):
2945         (-[WKContentView setupInteraction]):
2946         (-[WKContentView cleanupInteraction]):
2947         (-[WKContentView _removeDefaultGestureRecognizers]):
2948         (-[WKContentView _addDefaultGestureRecognizers]):
2949         (-[WKContentView activeTouchIdentifierForGestureRecognizer:]):
2950         (-[WKContentView _webTouchEventsRecognized:]):
2951         (-[WKContentView _resetPanningPreventionFlags]):
2952         (-[WKContentView _singleTapDidReset:]):
2953         (-[WKContentView _commitPotentialTapFailed]):
2954         (-[WKContentView _didCompleteSyntheticClick]):
2955         (-[WKContentView _singleTapRecognized:]):
2956         (-[WKContentView _didEndScrollingOrZooming]):
2957         * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
2958         * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
2959         (-[WKSyntheticTapGestureRecognizer reset]):
2960         (-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
2961         * UIProcess/ios/WKTouchActionGestureRecognizer.h:
2962         * UIProcess/ios/WKTouchActionGestureRecognizer.mm:
2963         * WebProcess/WebPage/WebPage.cpp:
2964         (WebKit::WebPage::touchWithIdentifierWasRemoved):
2965         * WebProcess/WebPage/WebPage.h:
2966         * WebProcess/WebPage/WebPage.messages.in:
2967
2968 2020-03-09  Rob Buis  <rbuis@igalia.com>
2969
2970         Rename urlSelected to changeLocation
2971         https://bugs.webkit.org/show_bug.cgi?id=208529
2972
2973         Reviewed by Darin Adler.
2974
2975         Adapt to API change.
2976
2977         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2978         (WebKit::PDFPlugin::clickedLink):
2979         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2980         (WebKit::WebContextMenuClient::searchWithGoogle):
2981         * WebProcess/WebPage/WebPage.cpp:
2982         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2983
2984 2020-03-09  Jer Noble  <jer.noble@apple.com>
2985
2986         Unreviewed build fix after r258129: include WebCore/SimpleRange.h where VisibleSelection is used.
2987
2988         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2989
2990 2020-03-09  Zan Dobersek  <zdobersek@igalia.com>
2991
2992         [WPE] AsyncScrolling: scrolling with the mouse wheel over sub-scrollable areas scrolls the main frame
2993         https://bugs.webkit.org/show_bug.cgi?id=208635
2994
2995         Reviewed by Carlos Garcia Campos.
2996
2997         Rework the default values for the async frame and overflow scrolling
2998         so that the latter stays disabled for Nicosia-using ports as it
2999         undergoes bigger changes.
3000
3001         * Shared/WebPreferencesDefaultValues.cpp:
3002         (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled):
3003         (WebKit::defaultAsyncFrameScrollingEnabled):
3004
3005 2020-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3006
3007         [GTK][WPE] Surrounding text for input methods should not be limited to the current paragraph
3008         https://bugs.webkit.org/show_bug.cgi?id=208706
3009
3010         Reviewed by Žan Doberšek.
3011
3012         It should include all the text around the cursor position.
3013
3014         * Shared/EditorState.cpp:
3015         (WebKit::EditorState::PostLayoutData::encode const): Rename paragraphContext* as surroundingContext*.
3016         (WebKit::EditorState::PostLayoutData::decode): Ditto.
3017         * Shared/EditorState.h:
3018         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3019         (webkitWebViewBaseUpdateTextInputState): Ditto.
3020         * UIProcess/API/wpe/WPEView.cpp:
3021         (WKWPE::View::selectionDidChange): Ditto.
3022         * WebProcess/WebPage/WebPage.cpp:
3023         (WebKit::WebPage::deleteSurrounding): Use content editable text as context instead of just paragraph.
3024         * WebProcess/WebPage/glib/WebPageGLib.cpp:
3025         (WebKit::WebPage::platformEditorState const): Ditto.
3026
3027 2020-03-07  Darin Adler  <darin@apple.com>
3028
3029         Begin moving off of live ranges for WebKit internals
3030         https://bugs.webkit.org/show_bug.cgi?id=208432
3031
3032         Reviewed by Daniel Bates.
3033
3034         * Shared/EditingRange.cpp:
3035         (WebKit::EditingRange::fromRange): Initialize out arguments.
3036
3037         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: Added include.
3038         * WebProcess/WebPage/FindController.cpp: Ditto.
3039         * WebProcess/WebPage/WebPage.cpp: Ditto.
3040         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
3041
3042 2020-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3043
3044         CAN_SECURELY_ARCHIVE_FILE_WRAPPER incorrectly excludes watchOS and tvOS
3045         https://bugs.webkit.org/show_bug.cgi?id=208791
3046
3047         Reviewed by Tim Horton.
3048
3049         This is one of several places where a __IPHONE_OS_VERSION_MIN_REQUIRED check unintentionally caused a compiler
3050         flag to not be defined on watchOS, when it really should apply to all iOS family targets. Now that we don't
3051         care about building for any iOS family targets aligned with iOS 11 or prior, and also don't build for 10.13 and
3052         prior, we can simply remove the !CAN_SECURELY_ARCHIVE_FILE_WRAPPER codepath.
3053
3054         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
3055         (API::Attachment::createSerializedRepresentation const):
3056         (API::Attachment::updateFromSerializedRepresentation):
3057
3058 2020-03-08  Brent Fulgham  <bfulgham@apple.com>
3059
3060         Revise In-App Browser Privacy checks to better reflect the meaning of the flag
3061         https://bugs.webkit.org/show_bug.cgi?id=208793
3062         <rdar://problem/60206256>
3063
3064         Reviewed by John Wilander.
3065
3066         The 'isInAppBrowserPrivacyEnabled' seems like a feature, but it's really an internal debugging flag.
3067
3068         Revise the use of these calls to make it clearer.
3069
3070         Tested by existing test cases.
3071
3072         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3073         (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
3074         * UIProcess/WebPageProxy.cpp:
3075         (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
3076
3077 2020-03-08  Brady Eidson  <beidson@apple.com>
3078
3079         Remember completed subranges during incremental PDF loading.
3080         https://bugs.webkit.org/show_bug.cgi?id=208785
3081
3082         Reviewed by Tim Horton.
3083
3084         When a range request from a stream loader completes, we will now extend the main resource buffer
3085         to be large enough to hold that range, then we memcpy the data into the main buffer.
3086         
3087         We then keep a RangeSet to remember which ranges we've loaded.
3088         Any future range request that comes in we first check against that RangeSet to see if we can handle it from memory.
3089         
3090         This is a necessary optimization because PDFKit tends to ask for the same (or overlapping) ranges quite often.
3091         
3092         * WebProcess/Plugins/PDF/PDFPlugin.h:
3093         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3094         (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
3095         (WebKit::PDFPlugin::ByteRangeRequest::maybeComplete):
3096         (WebKit::PDFPlugin::pdfDocumentDidLoad):
3097         (WebKit::PDFPlugin::manualStreamDidReceiveData):
3098
3099 2020-02-28  Jer Noble  <jer.noble@apple.com>
3100
3101         [GPUP] Implement Legacy EME API in the GPU Process
3102         https://bugs.webkit.org/show_bug.cgi?id=208402
3103
3104         Reviewed by Eric Carlson.
3105
3106         Add support for RemoteLegacyCDMFactory, RemateLegacyCDM,RemoteLegacyCDMSession, and all
3107         of their associated Proxy objects.
3108
3109         * DerivedSources-input.xcfilelist:
3110         * DerivedSources-output.xcfilelist:
3111         * DerivedSources.make:
3112         * GPUProcess/GPUConnectionToWebProcess.cpp:
3113         (WebKit::GPUConnectionToWebProcess::legacyCdmFactoryProxy):
3114         (WebKit::GPUConnectionToWebProcess::dispatchMessage):
3115         (WebKit::GPUConnectionToWebProcess::dispatchSyncMessage):
3116         * GPUProcess/GPUConnectionToWebProcess.h:
3117         * GPUProcess/media/RemoteLegacyCDMFactoryProxy.cpp: Added.
3118         (WebKit::RemoteLegacyCDMFactoryProxy::RemoteLegacyCDMFactoryProxy):
3119         (WebKit::RemoteLegacyCDMFactoryProxy::createCDM):
3120         (WebKit::RemoteLegacyCDMFactoryProxy::supportsKeySystem):
3121         (WebKit::RemoteLegacyCDMFactoryProxy::didReceiveCDMMessage):
3122         (WebKit::RemoteLegacyCDMFactoryProxy::didReceiveCDMSessionMessage):
3123         (WebKit::RemoteLegacyCDMFactoryProxy::didReceiveSyncCDMMessage):
3124         (WebKit::RemoteLegacyCDMFactoryProxy::didReceiveSyncCDMSessionMessage):
3125         (WebKit::RemoteLegacyCDMFactoryProxy::addProxy):
3126         (WebKit::RemoteLegacyCDMFactoryProxy::removeProxy):
3127         (WebKit::RemoteLegacyCDMFactoryProxy::addSession):
3128         (WebKit::RemoteLegacyCDMFactoryProxy::removeSession):
3129         (WebKit::RemoteLegacyCDMFactoryProxy::getSession const):
3130         * GPUProcess/media/RemoteLegacyCDMFactoryProxy.h: Added.
3131         * GPUProcess/media/RemoteLegacyCDMFactoryProxy.messages.in: Added.
3132         * GPUProcess/media/RemoteLegacyCDMProxy.cpp: Added.
3133         (WebKit::RemoteLegacyCDMProxy::create):
3134         (WebKit::RemoteLegacyCDMProxy::RemoteLegacyCDMProxy):
3135         (WebKit::RemoteLegacyCDMProxy::supportsMIMEType):
3136         (WebKit::RemoteLegacyCDMProxy::createSession):
3137         (WebKit::RemoteLegacyCDMProxy::setPlayerId):
3138         (WebKit::RemoteLegacyCDMProxy::cdmMediaPlayer const):
3139         * GPUProcess/media/RemoteLegacyCDMProxy.h: Added.
3140         (WebKit::RemoteLegacyCDMProxy::factory const):
3141         * GPUProcess/media/RemoteLegacyCDMProxy.messages.in: Added.
3142         * GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp: Added.
3143         (WebKit::RemoteLegacyCDMSessionProxy::create):
3144         (WebKit::RemoteLegacyCDMSessionProxy::RemoteLegacyCDMSessionProxy):
3145         (WebKit::convertToUint8Array):
3146         (WebKit::convertToOptionalDataReference):
3147         (WebKit::RemoteLegacyCDMSessionProxy::generateKeyRequest):
3148         (WebKit::RemoteLegacyCDMSessionProxy::releaseKeys):
3149         (WebKit::RemoteLegacyCDMSessionProxy::update):
3150         (WebKit::RemoteLegacyCDMSessionProxy::getCachedKeyForKeyId):
3151         (WebKit::RemoteLegacyCDMSessionProxy::cachedKeyForKeyID):
3152         (WebKit::RemoteLegacyCDMSessionProxy::sendMessage):
3153         (WebKit::RemoteLegacyCDMSessionProxy::sendError):
3154         (WebKit::RemoteLegacyCDMSessionProxy::mediaKeysStorageDirectory const):
3155         * GPUProcess/media/RemoteLegacyCDMSessionProxy.h: Added.
3156         (WebKit::RemoteLegacyCDMSessionProxy::factory const):
3157         (WebKit::RemoteLegacyCDMSessionProxy::session const):
3158         (WebKit::RemoteLegacyCDMSessionProxy::setPlayer):
3159         * GPUProcess/media/RemoteLegacyCDMSessionProxy.messages.in: Added.
3160         * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp:
3161         (WebKit::RemoteMediaPlayerManagerProxy::getProxy):
3162         * GPUProcess/media/RemoteMediaPlayerManagerProxy.h:
3163         * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
3164         (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedKeyForKeyId const):
3165         (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded):
3166         (WebKit::RemoteMediaPlayerProxy::setLegacyCDMSession):
3167         * GPUProcess/media/RemoteMediaPlayerProxy.h:
3168         * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
3169         * GPUProcess/media/RemoteTextTrackProxy.cpp:
3170         * GPUProcess/media/RemoteTextTrackProxy.h:
3171         * Scripts/webkit/messages.py:
3172         * Sources.txt:
3173         * WebKit.xcodeproj/project.pbxproj:
3174         * WebProcess/GPU/GPUProcessConnection.cpp:
3175         (WebKit::GPUProcessConnection::mediaPlayerManager):
3176         (WebKit::GPUProcessConnection::legacyCDMFactory):
3177         * WebProcess/GPU/GPUProcessConnection.h:
3178         * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
3179         (WebKit::MediaPlayerPrivateRemote::setCDM):
3180         (WebKit::MediaPlayerPrivateRemote::setCDMSession):
3181         (WebKit::MediaPlayerPrivateRemote::mediaPlayerKeyNeeded):
3182         * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
3183         * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
3184         * WebProcess/GPU/media/RemoteLegacyCDM.cpp: Added.
3185         (WebKit::RemoteLegacyCDM::create):
3186         (WebKit::RemoteLegacyCDM::RemoteLegacyCDM):
3187         (WebKit::RemoteLegacyCDM::supportsMIMEType):
3188         (WebKit::RemoteLegacyCDM::createSession):
3189         (WebKit::RemoteLegacyCDM::setPlayerId):
3190         * WebProcess/GPU/media/RemoteLegacyCDM.h: Added.
3191         * WebProcess/GPU/media/RemoteLegacyCDMFactory.cpp: Added.
3192         (WebKit::RemoteLegacyCDMFactory::RemoteLegacyCDMFactory):
3193         (WebKit::RemoteLegacyCDMFactory::registerFactory):
3194         (WebKit::RemoteLegacyCDMFactory::supplementName):
3195         (WebKit::RemoteLegacyCDMFactory::gpuProcessConnection):
3196         (WebKit::RemoteLegacyCDMFactory::supportsKeySystem):
3197         (WebKit::RemoteLegacyCDMFactory::supportsKeySystemAndMimeType):
3198         (WebKit::RemoteLegacyCDMFactory::createCDM):
3199         (WebKit::RemoteLegacyCDMFactory::addSession):
3200         (WebKit::RemoteLegacyCDMFactory::removeSession):
3201         (WebKit::RemoteLegacyCDMFactory::findCDM const):
3202         (WebKit::RemoteLegacyCDMFactory::didReceiveSessionMessage):
3203         * WebProcess/GPU/media/RemoteLegacyCDMFactory.h: Added.
3204         * WebProcess/GPU/media/RemoteLegacyCDMIdentifier.h: Added.
3205         * WebProcess/GPU/media/RemoteLegacyCDMSession.cpp: Added.
3206         (WebKit::convertToArrayBuffer):
3207         (WebKit::convertToUint8Array):
3208         (WebKit::convertToOptionalDataReference):
3209         (WebKit::convertToDataReference):
3210         (WebKit::RemoteLegacyCDMSession::create):
3211         (WebKit::RemoteLegacyCDMSession::RemoteLegacyCDMSession):
3212         (WebKit::RemoteLegacyCDMSession::generateKeyRequest):
3213         (WebKit::RemoteLegacyCDMSession::releaseKeys):
3214         (WebKit::RemoteLegacyCDMSession::update):
3215         (WebKit::RemoteLegacyCDMSession::cachedKeyForKeyID const):
3216         (WebKit::RemoteLegacyCDMSession::sendMessage):
3217         (WebKit::RemoteLegacyCDMSession::sendError):
3218         * WebProcess/GPU/media/RemoteLegacyCDMSession.h: Added.
3219         * WebProcess/GPU/media/RemoteLegacyCDMSession.messages.in: Added.
3220         * WebProcess/GPU/media/RemoteLegacyCDMSessionIdentifier.h: Added.
3221         * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
3222         (WebKit::RemoteMediaPlayerManager::findRemotePlayerId):
3223         * WebProcess/GPU/media/RemoteMediaPlayerManager.h:
3224         * WebProcess/GPU/media/WebMediaStrategy.cpp:
3225         (WebKit::WebMediaStrategy::registerLegacyCDMFactories):
3226         * WebProcess/WebPage/WebPage.cpp:
3227         (WebKit::WebPage::updatePreferences):
3228         * WebProcess/WebProcess.cpp:
3229
3230 2020-03-08  Per Arne Vollan  <pvollan@apple.com>
3231
3232         [iOS] Mapping to UTI from tag and tag class should be performed in the UI process
3233         https://bugs.webkit.org/show_bug.cgi?id=208783
3234
3235         Reviewed by Brent Fulgham.
3236
3237         Send mapping from tag/tag class to UTI from the UI process to the WebContent process as part of the WebProcess
3238         creation parameters. Also, issue some mach-lookup extensions to the WebContent process if Accessibility is
3239         enabled.
3240
3241         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3242         * Shared/WebProcessCreationParameters.cpp:
3243         (WebKit::WebProcessCreationParameters::encode const):
3244         (WebKit::WebProcessCreationParameters::decode):
3245         * Shared/WebProcessCreationParameters.h:
3246         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3247         (WebKit::WebProcessPool::platformInitializeWebProcess):
3248         * WebProcess/cocoa/WebProcessCocoa.mm:
3249         (WebKit::WebProcess::platformInitializeWebProcess):
3250
3251 2020-03-08  Per Arne Vollan  <pvollan@apple.com>
3252
3253         REGRESSION (r258064): API tests intermittently crashing under WebKit::registerDefaultsOverride
3254         https://bugs.webkit.org/show_bug.cgi?id=208784
3255         <rdar://problem/60201631>
3256
3257         Reviewed by Darin Adler.
3258
3259         Speculative crash fix; swizzle [NSUserDefaults registerDefaults:] on the main thread, instead of on a worker thread.
3260
3261         No new tests, since I have not been able to reproduce this issue.
3262
3263         * UIProcess/Cocoa/PreferenceObserver.h:
3264         * UIProcess/Cocoa/PreferenceObserver.mm:
3265         (registerDefaultsOverride):
3266         (+[WKPreferenceObserver swizzleRegisterDefaults]):
3267         (-[WKPreferenceObserver init]):
3268         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3269         (WebKit::WebProcessPool::platformInitialize):
3270
3271 2020-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3272
3273         Lazily generate CGPaths for some simple types of paths, such as arcs and lines
3274         https://bugs.webkit.org/show_bug.cgi?id=208464
3275         <rdar://problem/59963226>
3276
3277         Reviewed by Daniel Bates, Darin Adler and Tim Horton.
3278
3279         Add argument coders for `WTF::Monostate`, so that Variants of the form: `Variant<Monostate, Foo, Bar>` can be
3280         encoded and decoded over IPC.
3281
3282         * Platform/IPC/ArgumentCoders.cpp:
3283         (IPC::ArgumentCoder<Monostate>::encode):
3284         (IPC::ArgumentCoder<Monostate>::decode):
3285         * Platform/IPC/ArgumentCoders.h:
3286
3287 2020-03-08  Brady Eidson  <beidson@apple.com>
3288
3289         Better stream loader management with incremental PDF loading.
3290         https://bugs.webkit.org/show_bug.cgi?id=208790
3291
3292         Reviewed by Tim Horton.
3293
3294         When a stream loader was completing normally, we were leaking it forever.
3295         This adds much better management of outstanding stream loaders
3296         (and logging to help verify the count is as expected)
3297
3298         * WebProcess/Plugins/PDF/PDFPlugin.h:
3299         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3300         (WebKit::PDFPlugin::getResourceBytesAtPosition):
3301         (WebKit::PDFPlugin::ByteRangeRequest::completeWithBytes):
3302         (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData):
3303         (WebKit::PDFPlugin::ByteRangeRequest::maybeComplete):
3304         (WebKit::PDFPlugin::ByteRangeRequest::completeUnconditionally):
3305         (WebKit::PDFPlugin::didReceiveResponse):
3306         (WebKit::PDFPlugin::didFinishLoading):
3307         (WebKit::PDFPlugin::forgetLoader):
3308         (WebKit::PDFPlugin::cancelAndForgetLoader):
3309
3310 2020-03-08  Konstantin Tokarev  <annulen@yandex.ru>
3311
3312         [CMake] Some fixes for building Mac port
3313         https://bugs.webkit.org/show_bug.cgi?id=208770
3314
3315         Reviewed by Don Olmstead.
3316
3317         * PlatformMac.cmake:
3318
3319 2020-03-08  Andres Gonzalez  <andresg_22@apple.com>
3320
3321         Implementation of AccessibilitySupport AXSIsolatedTreeMode.
3322         https://bugs.webkit.org/show_bug.cgi?id=208691
3323         <rdar://problem/60178602>
3324
3325         Reviewed by Chris Fleizach.
3326
3327         Honors system AccessibilitySupport IsolatedTreeMode setting.
3328
3329         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
3330         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
3331
3332 2020-03-08  Megan Gardner  <megan_gardner@apple.com>
3333
3334         Build Fix Watch
3335         https://bugs.webkit.org/show_bug.cgi?id=208789
3336
3337         Reviewed by Tim Horton.
3338
3339         * UIProcess/ios/WKActionSheetAssistant.mm:
3340         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3341         (-[WKFileUploadPanel dealloc]):
3342         (-[WKFileUploadPanel showDocumentPickerMenu]):
3343
3344 2020-03-08  Tim Horton  <timothy_horton@apple.com>
3345
3346         Fix the watchOS build
3347
3348         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3349         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
3350
3351 2020-03-08  Megan Gardner  <megan_gardner@apple.com>
3352
3353         Build Fix
3354         https://bugs.webkit.org/show_bug.cgi?id=208787
3355         <rdar://problem/60203011>
3356
3357         Reviewed by Tim Horton.
3358
3359         * Platform/spi/ios/UIKitSPI.h:
3360         * UIProcess/ios/WKActionSheetAssistant.mm:
3361         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3362         (-[WKFileUploadPanel showDocumentPickerMenu]):
3363
3364 2020-03-06  Jer Noble  <jer.noble@apple.com>
3365
3366         [GPUP] Move AVSystemController code into the GPU process
3367         https://bugs.webkit.org/show_bug.cgi?id=208727
3368
3369         Reviewed by Eric Carlson.
3370
3371         Add a new class pair RemoteMediaSessionHelper/Proxy.
3372
3373         * DerivedSources-input.xcfilelist:
3374         * DerivedSources-output.xcfilelist:
3375         * DerivedSources.make:
3376         * GPUProcess/GPUConnectionToWebProcess.cpp:
3377         (WebKit::GPUConnectionToWebProcess::mediaSessionHelperProxy):
3378         (WebKit::GPUConnectionToWebProcess::ensureMediaSessionHelper):
3379         * GPUProcess/GPUConnectionToWebProcess.h:
3380         * GPUProcess/GPUConnectionToWebProcess.messages.in:
3381         * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp: Added.
3382         (WebKit::RemoteMediaSessionHelperProxy::RemoteMediaSessionHelperProxy):
3383         (WebKit::RemoteMediaSessionHelperProxy::~RemoteMediaSessionHelperProxy):
3384         (WebKit::RemoteMediaSessionHelperProxy::startMonitoringWirelessRoutes):
3385         (WebKit::RemoteMediaSessionHelperProxy::stopMonitoringWirelessRoutes):
3386         (WebKit::RemoteMediaSessionHelperProxy::providePresentingApplicationPID):
3387         (WebKit::RemoteMediaSessionHelperProxy::receivedInterruption):
3388         (WebKit::RemoteMediaSessionHelperProxy::applicationWillEnterForeground):
3389         (WebKit::RemoteMediaSessionHelperProxy::applicationDidEnterBackground):
3390         (WebKit::RemoteMediaSessionHelperProxy::applicationWillBecomeInactive):
3391         (WebKit::RemoteMediaSessionHelperProxy::applicationDidBecomeActive):
3392         (WebKit::RemoteMediaSessionHelperProxy::externalOutputDeviceAvailableDidChange):
3393         (WebKit::RemoteMediaSessionHelperProxy::isPlayingToAutomotiveHeadUnitDidChange):
3394         (WebKit::RemoteMediaSessionHelperProxy::activeAudioRouteDidChange):
3395         (WebKit::RemoteMediaSessionHelperProxy::activeVideoRouteDidChange):
3396         * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.h: Added.
3397         * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.messages.in: Added.
3398         * Sources.txt:
3399         * SourcesCocoa.txt:
3400         * WebKit.xcodeproj/project.pbxproj:
3401         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.cpp: Added.
3402         (WebKit::RemoteMediaSessionHelper::RemoteMediaSessionHelper):
3403         (WebKit::RemoteMediaSessionHelper::connection):
3404         (WebKit::RemoteMediaSessionHelper::startMonitoringWirelessRoutes):
3405         (WebKit::RemoteMediaSessionHelper::stopMonitoringWirelessRoutes):
3406         (WebKit::RemoteMediaSessionHelper::providePresentingApplicationPID):
3407         (WebKit::RemoteMediaSessionHelper::receivedInterruption):
3408         (WebKit::RemoteMediaSessionHelper::applicationWillEnterForeground):
3409         (WebKit::RemoteMediaSessionHelper::applicationDidEnterBackground):
3410         (WebKit::RemoteMediaSessionHelper::applicationWillBecomeInactive):
3411         (WebKit::RemoteMediaSessionHelper::applicationDidBecomeActive):
3412         (WebKit::RemoteMediaSessionHelper::externalOutputDeviceAvailableDidChange):
3413         (WebKit::RemoteMediaSessionHelper::isPlayingToAutomotiveHeadUnitDidChange):
3414         (WebKit::RemoteMediaSessionHelper::activeAudioRouteDidChange):
3415         (WebKit::RemoteMediaSessionHelper::activeVideoRouteDidChange):
3416         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.h: Added.
3417         * WebProcess/GPU/media/ios/RemoteMediaSessionHelper.messages.in: Added.
3418         * WebProcess/WebProcess.cpp:
3419         (WebKit::WebProcess::setUseGPUProcessForMedia):
3420
3421 2020-03-08  Jer Noble  <jer.noble@apple.com>
3422
3423         [GPUP] Null-dereference crash in GPUProcessProxy::openGPUProcessConnection()
3424         https://bugs.webkit.org/show_bug.cgi?id=208772
3425
3426         Reviewed by Maciej Stachowiak.
3427
3428         AuxiliaryProcessProxy::connection() will return a null-pointer if called before the remote
3429         process has launched and a connection established. Rather than send a message directly to
3430         the proxy's IPC::Connection object (which can be null), just call sendWithAsyncReply()
3431         directly on the proxy inself, which will correctly enqueue the message for sending when the
3432         connection is fully established.
3433
3434         Because this crash occurs whenever the "useGPUProcessForMedia" setting is enabled, this is
3435         covered by existing WP2 tests when those tests are run with that setting enabled.
3436
3437         * UIProcess/GPU/GPUProcessProxy.cpp:
3438         (WebKit::GPUProcessProxy::openGPUProcessConnection):
3439
3440 2020-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3441
3442         Canvas drawing commands have to be flushed to the GPUProcess in batches
3443         https://bugs.webkit.org/show_bug.cgi?id=208597
3444
3445         Reviewed by Myles C. Maxfield.
3446
3447         RemoteImageBuffer, which is a superclass of DisplayList::ImageBuffer, will
3448         prevent growing its DisplayList more than some limit (512 for now).
3449         When this limit is reached, the recoded DisplayListItems will be flushed to
3450         the GPUProcess in a batch. Flushing this batch would not require GPUProcess
3451         to reply back. RemoteImageBuffer will have to run a full flush anyway
3452         when the pixels are needed because the batch flushing does not include the
3453         current DisplayList::Item.
3454
3455         * GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.h:
3456         * GPUProcess/graphics/RemoteImageBufferProxy.h:
3457         * GPUProcess/graphics/RemoteRenderingBackendProxy.cpp:
3458         (WebKit::RemoteRenderingBackendProxy::flushImageBufferDrawingContext):
3459         (WebKit::RemoteRenderingBackendProxy::flushImageBufferDrawingContextAndCommit):
3460         * GPUProcess/graphics/RemoteRenderingBackendProxy.h:
3461         * GPUProcess/graphics/RemoteRenderingBackendProxy.messages.in:
3462         * WebProcess/GPU/graphics/RemoteImageBuffer.h:
3463         * WebProcess/GPU/graphics/RemoteImageBufferMessageHandler.cpp:
3464         (WebKit::RemoteImageBufferMessageHandler::flushDrawingContext):
3465         (WebKit::RemoteImageBufferMessageHandler::flushDrawingContextAndWaitCommit):
3466
3467 2020-03-08  Konstantin Tokarev  <annulen@yandex.ru>
3468
3469         [GTK] Fix compilation with disabled OpenGL
3470         https://bugs.webkit.org/show_bug.cgi?id=208773
3471
3472         Reviewed by Yusuke Suzuki.
3473
3474         * UIProcess/API/glib/WebKitProtocolHandler.cpp:
3475         (WebKit::WebKitProtocolHandler::handleGPU):
3476
3477 2020-03-08  Megan Gardner  <megan_gardner@apple.com>
3478
3479         Adopt Context Menus for Data Detectors
3480         https://bugs.webkit.org/show_bug.cgi?id=208779
3481
3482         Switch to context menus for data detector action sheets.
3483
3484         Reviewed by Tim Horton.
3485
3486         * UIProcess/ios/WKActionSheetAssistant.h:
3487         * UIProcess/ios/WKActionSheetAssistant.mm:
3488         (-[WKActionSheetAssistant removeContextMenuInteraction]):
3489         (-[WKActionSheetAssistant ensureContextMenuInteraction]):
3490         (-[WKActionSheetAssistant showDataDetectorsSheet]):
3491         (-[WKActionSheetAssistant contextMenuInteraction:configurationForMenuAtLocation:]):
3492         (-[WKActionSheetAssistant contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
3493         (-[WKActionSheetAssistant _contextMenuInteraction:styleForMenuWithConfiguration:]):
3494         (-[WKActionSheetAssistant contextMenuInteraction:willEndForConfiguration:animator:]):
3495         * UIProcess/ios/WKContentViewInteraction.mm:
3496         (-[WKContentView contextMenuDisplayLocationForActionSheetAssistant:]):
3497
3498 2020-03-07  Brent Fulgham  <bfulgham@apple.com>
3499
3500         Create a flag to disable in-app browser quirks
3501         https://bugs.webkit.org/show_bug.cgi?id=208777
3502         <rdar://problem/60062197>
3503
3504         Reviewed by Simon Fraser.
3505
3506         This patch makes the following changes:
3507
3508         1. Adds a new flag 'NeedsInAppBrowserPrivacyQuirks' to allow quirks to be toggled
3509            during testing.
3510         2. Reclassify this new flag, and the existing 'InAppBrowserPrivacyEnabled' flag from 
3511            'settings' to Internal Debug settings
3512
3513         The renamed flags are covered by existing tests.
3514
3515         * FeatureFlags/WebKit.plist:
3516         * Shared/WebPageCreationParameters.cpp:
3517         (WebKit::WebPageCreationParameters::encode const):
3518         (WebKit::WebPageCreationParameters::decode):
3519         * Shared/WebPageCreationParameters.h:
3520         * Shared/WebPreferences.yaml:
3521         * Shared/WebPreferencesDefaultValues.cpp:
3522         (WebKit::defaultInAppBrowserPrivacy):
3523         (WebKit::defaultNeedsInAppBrowserPrivacyQuirks):
3524         * Shared/WebPreferencesDefaultValues.h:
3525         * UIProcess/API/Cocoa/WKPreferences.mm:
3526         (-[WKPreferences _needsInAppBrowserPrivacyQuirks]):
3527         (-[WKPreferences _setNeedsInAppBrowserPrivacyQuirks:]):
3528         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3529         * UIProcess/WebPageProxy.cpp:
3530         * WebProcess/WebPage/WebPage.cpp:
3531         (WebKit::WebPage::runJavaScript):
3532         * WebProcess/WebPage/WebPage.h:
3533
3534 2020-03-07  Simon Fraser  <simon.fraser@apple.com>
3535
3536         Generalize setSynchronousScrollingReasons() to take a ScrollingNodeID
3537         https://bugs.webkit.org/show_bug.cgi?id=208774
3538
3539         Reviewed by Zalan Bujtas.
3540
3541         Whitespace.
3542
3543         * WebProcess/WebPage/EventDispatcher.h:
3544
3545 2020-03-07  Brady Eidson  <beidson@apple.com>
3546
3547         Make PDF range requests to the network.
3548         https://bugs.webkit.org/show_bug.cgi?id=208776
3549
3550         Reviewed by Alex Christensen.
3551
3552         We already handle a set of range requests from our data provider callbacks.
3553         The current strategy is "wait until we've streamed enough of the entire resource, 
3554         perform that request's callback"
3555         
3556         For linearized PDFs the second request ever made is for the very end of the PDF document,
3557         so we have to wait for the entire document to load (which is what we already do in non-incremental mode)
3558         
3559       &