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