Add SPI to use networking daemon instead of XPC service
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-02-08  Alex Christensen  <achristensen@webkit.org>
2
3         Add SPI to use networking daemon instead of XPC service
4         https://bugs.webkit.org/show_bug.cgi?id=194427
5
6         Reviewed by Geoffrey Garen.
7
8         There is still work to be done, but with the proper plist it starts and loads webpages!
9
10         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
11         (WebKit::DaemonMain):
12         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
13         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
14         (WebKit::XPCEventHandler):
15         (WebKit::XPCInitializationHandler):
16         (WebKit::XPCServiceMain):
17         (WebKit::XPCServiceEventHandler): Deleted.
18         * UIProcess/API/APIProcessPoolConfiguration.h:
19         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
20         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
21         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
22         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
23         * UIProcess/AuxiliaryProcessProxy.cpp:
24         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
25         * UIProcess/Launcher/ProcessLauncher.h:
26         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
27         (WebKit::serviceName):
28         (WebKit::ProcessLauncher::launchProcess):
29         * UIProcess/Network/NetworkProcessProxy.cpp:
30         (WebKit::NetworkProcessProxy::getLaunchOptions):
31         * UIProcess/WebProcessPool.cpp:
32         (WebKit::WebProcessPool::usesNetworkingDaemon const):
33         * UIProcess/WebProcessPool.h:
34
35 2019-02-08  Truitt Savell  <tsavell@apple.com>
36
37         Unreviewed, rolling out r241197.
38
39         Broke iOS Simulator Debug build and casued 1 API failure on
40         High Sierra
41
42         Reverted changeset:
43
44         "Add SPI to use networking daemon instead of XPC service"
45         https://bugs.webkit.org/show_bug.cgi?id=194427
46         https://trac.webkit.org/changeset/241197
47
48 2019-02-08  Beth Dakin  <bdakin@apple.com>
49
50         Abstract and discussion comments needed for afterScreenUpdates
51         https://bugs.webkit.org/show_bug.cgi?id=194442
52
53         Reviewed by Wenson Hsieh.
54
55         Forgot to add these comments with https://bugs.webkit.org/show_bug.cgi?id=194362
56         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
57
58 2019-02-08  Beth Dakin  <bdakin@apple.com>
59
60         Add afterScreenUpdates to WKSnapshotConfiguration
61         https://bugs.webkit.org/show_bug.cgi?id=194362
62         -and corresponding-
63         <rdar://problem/40655528> Please add an "after screen updates" property to 
64         WKSnapshotConfiguration (to solve blank snapshots)
65
66         Reviewed by Tim Horton.
67
68         This is the WebKit equivalent of - (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates;
69         This makes our snapshotting API more predictable and reliable on iOS devices, 
70         which is why the new configuration property defaults to YES.
71
72         New property that defaults to YES.
73         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
74         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
75         (-[WKSnapshotConfiguration init]):
76         (-[WKSnapshotConfiguration copyWithZone:]):
77
78         When afterScreenUpdates is set, invoke the snapshot via 
79         callAfterNextPresentationUpdate.
80         * UIProcess/API/Cocoa/WKWebView.mm:
81         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
82         (-[WKWebView _callCompletionHandler:withSnapshotImage:atDeviceScale:]):
83
84 2019-02-08  Alex Christensen  <achristensen@webkit.org>
85
86         Add SPI to use networking daemon instead of XPC service
87         https://bugs.webkit.org/show_bug.cgi?id=194427
88
89         Reviewed by Geoffrey Garen.
90
91         There is still work to be done, but with the proper plist it starts and loads webpages!
92
93         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
94         (WebKit::DaemonMain):
95         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
96         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
97         (WebKit::XPCEventHandler):
98         (WebKit::XPCInitializationHandler):
99         (WebKit::XPCServiceMain):
100         (WebKit::XPCServiceEventHandler): Deleted.
101         * UIProcess/API/APIProcessPoolConfiguration.h:
102         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
103         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
104         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
105         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
106         * UIProcess/AuxiliaryProcessProxy.cpp:
107         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
108         * UIProcess/Launcher/ProcessLauncher.h:
109         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
110         (WebKit::serviceName):
111         (WebKit::ProcessLauncher::launchProcess):
112         * UIProcess/Network/NetworkProcessProxy.cpp:
113         (WebKit::NetworkProcessProxy::getLaunchOptions):
114         * UIProcess/WebProcessPool.cpp:
115         (WebKit::WebProcessPool::usesNetworkingDaemon const):
116         * UIProcess/WebProcessPool.h:
117
118 2019-02-08  Keith Rollin  <krollin@apple.com>
119
120         Unreviewed build fix.
121
122         r241135 modified how entitlements were built up for the macOS. Those
123         changes broke the iOSMac builds. Bring back some deletions in order to
124         fix iOSMac.
125
126         * Configurations/PluginService.64.xcconfig:
127         * Configurations/PluginService.entitlements: Added.
128         * WebKit.xcodeproj/project.pbxproj:
129
130 2019-02-07  Chris Dumez  <cdumez@apple.com>
131
132         Mark more heap-allocated classes as fast allocated
133         https://bugs.webkit.org/show_bug.cgi?id=194422
134
135         Reviewed by Ryosuke Niwa.
136
137         * NetworkProcess/NetworkLoad.cpp:
138         * NetworkProcess/NetworkLoadChecker.h:
139         * NetworkProcess/NetworkResourceLoader.cpp:
140         * Platform/IPC/Connection.h:
141         * Platform/IPC/mac/ImportanceAssertion.h:
142         * PluginProcess/PluginCreationParameters.h:
143         * Shared/API/Cocoa/RemoteObjectRegistry.h:
144         * Shared/WebEvent.h:
145         * UIProcess/API/APIHTTPCookieStore.cpp:
146         * UIProcess/API/APINotificationProvider.h:
147         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
148         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
149         * UIProcess/API/Cocoa/WKWebView.mm:
150         (-[WKWebView _setInputDelegate:]):
151         * UIProcess/API/gtk/PageClientImpl.h:
152         * UIProcess/BackingStore.h:
153         * UIProcess/Cocoa/AutomationClient.h:
154         * UIProcess/Cocoa/DiagnosticLoggingClient.h:
155         * UIProcess/Cocoa/DownloadClient.h:
156         * UIProcess/Cocoa/FindClient.h:
157         * UIProcess/Cocoa/NavigationState.h:
158         * UIProcess/Cocoa/UIDelegate.h:
159         * UIProcess/Cocoa/ViewGestureController.h:
160         * UIProcess/DeviceIdHashSaltStorage.h:
161         * UIProcess/Downloads/DownloadProxyMap.h:
162         * UIProcess/Gamepad/UIGamepad.h:
163         * UIProcess/Notifications/WebNotificationProvider.h:
164         * UIProcess/ProcessAssertion.h:
165         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
166         * UIProcess/WebContextInjectedBundleClient.h:
167         * UIProcess/WebFormClient.h:
168         * UIProcess/WebGeolocationProvider.h:
169         * UIProcess/WebPageProxy.h:
170         * WebProcess/Automation/WebAutomationSessionProxy.h:
171         * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h:
172         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
173         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
174         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
175         * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h:
176         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
177         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
178         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
179         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
180         * WebProcess/Network/webrtc/WebRTCResolver.h:
181         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
182         * WebProcess/WebPage/DrawingArea.h:
183
184 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
185
186         [iOS] [WK2] Modernize code for applying autocorrection
187         https://bugs.webkit.org/show_bug.cgi?id=194397
188
189         Reviewed by Tim Horton.
190
191         * UIProcess/ios/WKContentViewInteraction.h:
192         * UIProcess/ios/WKContentViewInteraction.mm:
193         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
194         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
195
196         Use BlockPtr instead of temporarily storing the completion handler.
197
198         * WebProcess/WebPage/WebPage.h:
199         * WebProcess/WebPage/WebPage.messages.in:
200
201         Change a LegacySync to Delayed.
202
203         * WebProcess/WebPage/ios/WebPageIOS.mm:
204         (WebKit::WebPage::applyAutocorrection):
205         (WebKit::WebPage::syncApplyAutocorrection):
206         (WebKit::WebPage::applyAutocorrectionInternal):
207
208 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
209
210         [iOS] Clicking links in Safari using Apple Pencil is much more difficult after r238475
211         https://bugs.webkit.org/show_bug.cgi?id=194415
212         <rdar://problem/47550281>
213
214         Reviewed by Tim Horton.
215
216         Fix the bug by not firing the Apple-pencil-exclusive tap gesture recognizer in the case where editable images
217         are disabled. This gesture recognizer is only used for inserting editable images, and currently conflicts with
218         the synthetic click gesture recognizer used to recognize clicks from generic digitizer inputs.
219
220         * UIProcess/ios/WKContentViewInteraction.mm:
221         (-[WKContentView gestureRecognizerShouldBegin:]):
222         (-[WKContentView _stylusSingleTapRecognized:]):
223
224 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
225
226         [macOS] Block coreservicesd in sandbox.
227         https://bugs.webkit.org/show_bug.cgi?id=192670
228
229         Reviewed by Alexey Proskuryakov.
230
231         We should block CoreServices in newer versions of macOS. In order to achieve this we need to avoid calling
232         _RegisterApplication before entering the sandbox, since this call will open up a connection to CoreServices.
233         The call to _RegisterApplication is moved to ChildProcess::updateProcessName, since it is needed to
234         successfully update the process name. The call to ChildProcess::updateProcessName is made after entering
235         the sandbox.
236
237         * Shared/AuxiliaryProcess.cpp:
238         (WebKit::AuxiliaryProcess::initialize):
239         * WebProcess/cocoa/WebProcessCocoa.mm:
240         (WebKit::WebProcess::initializeProcessName):
241         (WebKit::WebProcess::platformInitializeProcess):
242         * WebProcess/com.apple.WebProcess.sb.in:
243
244 2019-02-07  Youenn Fablet  <youenn@apple.com>
245
246         Filter out Overconstrainederror.constraint when getUserMedia is not granted
247         https://bugs.webkit.org/show_bug.cgi?id=194240
248
249         Reviewed by Eric Carlson.
250
251         Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
252
253         Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
254
255         Covered by added test.
256
257         * UIProcess/UserMediaPermissionCheckProxy.cpp:
258         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
259         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
260         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
261         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
262         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
263         (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
264         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
265         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
266         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
267         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
268         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
269         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
270         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
271         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
272         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
273         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
274         * UIProcess/UserMediaPermissionRequestProxy.h:
275         (WebKit::UserMediaPermissionRequestProxy::isPending const):
276         (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
277         (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
278         (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
279         (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
280         (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
281         (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
282         (WebKit::UserMediaPermissionRequestProxy::userMediaID const):
283         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
284         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
285         (WebKit::UserMediaPermissionRequestProxy::userRequest const):
286         (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
287         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
288         (WebKit::UserMediaPermissionRequestProxy::audioDevice const):
289         (WebKit::UserMediaPermissionRequestProxy::videoDevice const):
290         * UIProcess/WebPageProxy.cpp:
291         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
292         * UIProcess/WebPageProxy.h:
293
294 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
295
296         [iOS] [WK2] Modernize autocorrection context code
297         https://bugs.webkit.org/show_bug.cgi?id=194373
298
299         Reviewed by Tim Horton.
300
301         * Shared/ios/WebAutocorrectionContext.h: Added.
302         (WebKit::WebAutocorrectionContext::encode const):
303         (WebKit::WebAutocorrectionContext::decode):
304
305         Introduce a WebAutocorrectionContext struct that encapsulates the individual pieces of autocorrection context.
306         Change to use this instead of a long list of arguments when propagating autocorrection context information over
307         IPC.
308
309         * UIProcess/AutoCorrectionCallback.h:
310         * UIProcess/WebPageProxy.h:
311         * UIProcess/WebPageProxy.messages.in:
312         * UIProcess/ios/WKContentViewInteraction.h:
313         * UIProcess/ios/WKContentViewInteraction.mm:
314         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
315         (+[WKAutocorrectionContext autocorrectionContextWithContext:]):
316         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): Deleted.
317
318         Change this constructor to take an entire WebAutocorrectionContext.
319
320         * UIProcess/ios/WebPageProxyIOS.mm:
321         (WebKit::WebPageProxy::autocorrectionContextCallback):
322         (WebKit::WebPageProxy::requestAutocorrectionContext):
323         (WebKit::WebPageProxy::autocorrectionContextSync):
324         (WebKit::WebPageProxy::getAutocorrectionContext): Deleted.
325         * WebKit.xcodeproj/project.pbxproj:
326         * WebProcess/WebPage/WebPage.h:
327         * WebProcess/WebPage/WebPage.messages.in:
328
329         Use Delayed instead of LegacySync.
330
331         * WebProcess/WebPage/ios/WebPageIOS.mm:
332         (WebKit::WebPage::autocorrectionContext):
333
334         Renamed from computeAutocorrectionContext. This is now a private method on WebPage that uses the focused or main
335         frame to compute and return a WebAutocorrectionContext.
336
337         (WebKit::WebPage::requestAutocorrectionContext):
338         (WebKit::WebPage::autocorrectionContextSync):
339
340         Renamed getAutocorrectionContext to autocorrectionContextSync.
341
342         (WebKit::computeAutocorrectionContext): Deleted.
343         (WebKit::WebPage::getAutocorrectionContext): Deleted.
344
345 2019-02-07  Youenn Fablet  <youenn@apple.com>
346
347         Simplify applyConstraints callbacks
348         https://bugs.webkit.org/show_bug.cgi?id=194297
349
350         Reviewed by Eric Carlson.
351
352         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
353         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
354         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
355         (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
356         (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
357         (WebKit::UserMediaCaptureManager::applyConstraintsFailed):
358         * WebProcess/cocoa/UserMediaCaptureManager.h:
359
360 2019-02-07  Brent Fulgham  <bfulgham@apple.com>
361
362         Permit additional IOKit Properties needed by Media PlugIns on older Mac Hardware
363         https://bugs.webkit.org/show_bug.cgi?id=194412
364         <rdar://problem/47820615>
365
366         Reviewed by Per Arne Vollan.
367
368         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
369
370 2019-02-07  Brent Fulgham  <bfulgham@apple.com>
371
372         Permit additional IOKit Properties needed by older Mac Hardware
373         https://bugs.webkit.org/show_bug.cgi?id=194410
374         <rdar://problem/47820620>
375
376         Reviewed by Per Arne Vollan.
377
378         * WebProcess/com.apple.WebProcess.sb.in:
379
380 2019-02-07  Brady Eidson  <beidson@apple.com>
381
382         Rename the TAKE_DOWNLOAD_ASSERTION macro.
383
384         Rubberstamped by Andy Estes.
385
386         * NetworkProcess/Downloads/DownloadMap.cpp:
387         * NetworkProcess/Downloads/DownloadMap.h:
388
389 2019-02-07  Keith Rollin  <krollin@apple.com>
390
391         Fix XCBuild issue related to codesigning WebContent process
392         https://bugs.webkit.org/show_bug.cgi?id=193799
393         <rdar://problem/47533890>
394
395         Reviewed by Brent Fulgham.
396
397         Building with XCBuild enabled results in the error message "cannot
398         read entitlement data" when trying to codesign the macOS XPC
399         processes. The reason for this error message is that there is a build
400         step that deletes any previous "stale" generated .xcent file before
401         building up a new one. With XCBuild enabled, the build steps got
402         re-ordered, such that the step that deletes this file could get
403         executed after the steps that build up the file. The built-up set of
404         entitlements is now gone, and the build process fails when `codesign`
405         tries to access it.
406
407         The apparent quick-fix to this problem -- of tweaking dependencies so
408         that the build steps execute in the desired order -- wouldn't work
409         with XCBuild. Establishing these dependencies would require both
410         having multiple build phases produce the same .xcent file as output,
411         as well as a build phase that has this file as an input and an output.
412         XCBuild either forbids or frowns upon these configurations.
413
414         Ultimately, the solution that worked was to take over complete control
415         of the codesigning process. This means (a) not specifying a base
416         .entitlements file that XCode uses to start with (and which was
417         subsequently altered via custom build scripts), (b) not letting XCode
418         automatically and silently inject a 'get-task-all' entitlement used to
419         facilitate debugging (we now add that entitlement by hand), and (c)
420         building up all of our entitlements by hand via a single custom
421         script. Because of the addition of this custom script, many other
422         scripts and entitlements files could now be removed.
423
424         * Configurations/BaseXPCService.xcconfig:
425         * Configurations/Databases-iOS.entitlements: Removed.
426         * Configurations/Network-OSX-restricted.entitlements: Removed.
427         * Configurations/Network-OSX-sandbox.entitlements: Removed.
428         * Configurations/Network-OSX.entitlements: Removed.
429         * Configurations/NetworkService.xcconfig:
430         * Configurations/PluginService.64.xcconfig:
431         * Configurations/PluginService.entitlements: Removed.
432         * Configurations/WebContent-OSX-sandbox.entitlements: Removed.
433         * Configurations/WebContent-OSX.entitlements: Removed.
434         * Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Removed.
435         * Configurations/WebContentService.xcconfig:
436         * Scripts/copy-webcontent-resources-to-private-headers.sh:
437         * Scripts/process-entitlements.sh: Added.
438         * Scripts/process-network-sandbox-entitlements.sh: Removed.
439         * Scripts/process-webcontent-or-plugin-entitlements.sh: Removed.
440         * Scripts/process-webcontent-sandbox-entitlements.sh: Removed.
441         * WebKit.xcodeproj/project.pbxproj:
442
443 2019-02-07  Alex Christensen  <achristensen@webkit.org>
444
445         Fix internal build after r241127
446         https://bugs.webkit.org/show_bug.cgi?id=191394
447
448         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
449         Add some (un)availability macros.
450
451 2019-02-07  Youenn Fablet  <youenn@apple.com>
452
453         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
454         https://bugs.webkit.org/show_bug.cgi?id=194312
455
456         Reviewed by Eric Carlson.
457
458         Sources in UserMediaCaptureManager and Proxy are never removed once added to their HashMap.
459         Use the 'ended' mechanism to do the clean-up on WebProcess side.
460         As part of this clean-up, send IPC to UIProcess to do clean-up on proxy side.
461         On WebProcess crash case, clean-up the proxy as well.
462
463         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
464         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
465         (WebKit::UserMediaCaptureManagerProxy::end):
466         (WebKit::UserMediaCaptureManagerProxy::clear):
467         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
468         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
469         * UIProcess/WebProcessProxy.cpp:
470         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
471         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
472         (WebKit::UserMediaCaptureManager::sourceEnded):
473         * WebProcess/cocoa/UserMediaCaptureManager.h:
474
475 2019-02-07  Alex Christensen  <achristensen@webkit.org>
476
477         Print backgrounds preference should be honored instead of WKWebViewConfiguration value
478         https://bugs.webkit.org/show_bug.cgi?id=194364
479         <rdar://problem/47627599>
480
481         Reviewed by Tim Horton.
482
483         Without this patch, changing the preference for printing the background has no effect.
484         This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
485         Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
486         or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
487         are used when printing.  Actually printing verifies this change fixes the bug.
488
489         * UIProcess/API/Cocoa/WKWebView.mm:
490         (-[WKWebView _initializeWithConfiguration:]):
491
492 2019-02-07  Chris Dumez  <cdumez@apple.com>
493
494         Mark DisplayLink as fast allocated
495         https://bugs.webkit.org/show_bug.cgi?id=194400
496
497         Reviewed by Geoffrey Garen.
498
499         * UIProcess/mac/DisplayLink.h:
500
501 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
502
503         [macOS] API test times out after r241026
504         https://bugs.webkit.org/show_bug.cgi?id=194372
505
506         Reviewed by Alex Christensen.
507
508         The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026.
509         A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order
510         for clients to decide which milestones they would like to listen for.
511
512         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
513         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
514         (layoutMilestones):
515         (setUpPageLoaderClient):
516         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
517         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
518         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
519
520 2019-02-07  Alex Christensen  <achristensen@webkit.org>
521
522         Deprecate WKBundlePageSetDefersLoading
523         https://bugs.webkit.org/show_bug.cgi?id=191394
524
525         Reviewed by Dean Jackson.
526
527         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
528         (WKBundlePageSetDefersLoading):
529         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
530         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
531         (-[WKWebProcessPlugInBrowserContextController _defersLoading]):
532         (-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]):
533         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
534
535 2019-02-07  Alex Christensen  <achristensen@webkit.org>
536
537         Digital crown should scroll safe browsing warning on watchOS
538         https://bugs.webkit.org/show_bug.cgi?id=194363
539         <rdar://problem/47348124>
540
541         Reviewed by Wenson Hsieh.
542
543         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
544         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
545         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
546         (-[WKSafeBrowsingWarning addContent]):
547
548 2019-02-07  Alex Christensen  <achristensen@webkit.org>
549
550         Shrink and hyphenate safe browsing warning text on watchOS
551         https://bugs.webkit.org/show_bug.cgi?id=194361
552         <rdar://problem/47466549>
553
554         Reviewed by Geoffrey Garen.
555
556         Some internationalizations use long words that didn't fit on small watches.
557
558         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
559         (fontOfSize):
560         (-[WKSafeBrowsingWarning addContent]):
561         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
562
563 2019-02-07  Miguel Gomez  <magomez@igalia.com>
564
565         [WPE] Implement GStreamer based holepunch
566         https://bugs.webkit.org/show_bug.cgi?id=193715
567
568         Reviewed by Xabier Rodriguez-Calvar.
569
570         Add a new parameter to the calls of TextureMapper::drawSolidColor().
571
572         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
573         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
574
575 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
576
577         Unreviewed, rolling out r240759 and r240944.
578
579         Some timer uses are done off the main thread, WebCore::Timer
580         cannot be used
581
582         Reverted changesets:
583
584         "<rdar://problem/47570443> Responsiveness timers are too
585         expensive for frequent events"
586         https://bugs.webkit.org/show_bug.cgi?id=194003
587         https://trac.webkit.org/changeset/240759
588
589         "Use deferrable timer to restart the Responsiveness Timer on
590         each wheel event"
591         https://bugs.webkit.org/show_bug.cgi?id=194135
592         https://trac.webkit.org/changeset/240944
593
594 2019-02-06  chris fleizach  <cfleizach@apple.com>
595
596         AX:  com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObjectCache]
597         https://bugs.webkit.org/show_bug.cgi?id=194306
598         <rdar://problem/47764549>
599
600         Reviewed by Zalan Bujtas.
601
602         Check the page reference is still valid.
603         Modernize code in this area.
604
605         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
606
607 2019-02-06  Daniel Bates  <dabates@apple.com>
608
609         Move toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm
610         https://bugs.webkit.org/show_bug.cgi?id=194321
611
612         Reviewed by Jer Noble.
613
614         Move some code to WebEventFactory so that it can be shared by both WKNavigationAction.mm
615         and UIDelegate.mm among other benefits.
616
617         * Shared/mac/WebEventFactory.h:
618         * Shared/mac/WebEventFactory.mm:
619         (WebKit::WebEventFactory::toNSEventModifierFlags):
620         (WebKit::WebEventFactory::toNSButtonNumber):
621         * UIProcess/API/Cocoa/WKNavigationAction.mm:
622         (-[WKNavigationAction modifierFlags]):
623         (-[WKNavigationAction buttonNumber]):
624         (toNSEventModifierFlags): Deleted.
625         (toNSButtonNumber): Deleted.
626         * UIProcess/Cocoa/UIDelegate.mm:
627         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
628         (WebKit::toNSEventModifierFlags): Deleted.
629
630 2019-02-06  Andy Estes  <aestes@apple.com>
631
632         [Payment Request] It should be possible to require a phonetic name for shipping contacts
633         https://bugs.webkit.org/show_bug.cgi?id=194311
634         <rdar://46733045>
635
636         Reviewed by Alex Christensen.
637
638         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
639         (WebKit::WebPaymentCoordinator::supportsVersion): Deleted.
640         * WebProcess/ApplePay/WebPaymentCoordinator.h:
641
642 2019-02-06  Keith Rollin  <krollin@apple.com>
643
644         Really enable the automatic checking and regenerations of .xcfilelists during builds
645         https://bugs.webkit.org/show_bug.cgi?id=194357
646         <rdar://problem/47861231>
647
648         Reviewed by Chris Dumez.
649
650         Bug 194124 was supposed to enable the automatic checking and
651         regenerating of .xcfilelist files during the build. While related
652         changes were included in that patch, the change to actually enable the
653         operation somehow was omitted. This patch actually enables the
654         operation. The check-xcfilelist.sh scripts now check
655         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
656         from the checking.
657
658         * Scripts/check-xcfilelists.sh:
659
660 2019-02-06  John Wilander  <wilander@apple.com>
661
662         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
663         https://bugs.webkit.org/show_bug.cgi?id=194325
664         <rdar://problem/47840283>
665
666         Reviewed by Chris Dumez.
667
668         * Shared/NavigationActionData.cpp:
669         (WebKit::NavigationActionData::encode const):
670         (WebKit::NavigationActionData::decode):
671         * Shared/NavigationActionData.h:
672             Now holds an optional WebCore::AdClickAttribution object.
673
674 2019-02-06  Daniel Bates  <dabates@apple.com>
675
676         Fix the Apple Internal build. See <rdar://problem/47860943> for more details.
677
678         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
679         (-[WKFullscreenStackView init]):
680
681 2019-02-06  Daniel Bates  <dabates@apple.com>
682
683         Standardize on ControlKey instead of CtrlKey
684         https://bugs.webkit.org/show_bug.cgi?id=194317
685
686         Reviewed by Tim Horton.
687
688         * Shared/WebEventConversion.cpp:
689         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
690         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
691         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
692         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
693         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
694         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
695         (WebKit::WebEditorClient::handleKeyboardEvent):
696         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
697         (WebKit::handleKeyPress):
698
699 2019-02-06  Per Arne Vollan  <pvollan@apple.com>
700
701         Roll out parts of r238819 since it is a PLT performance regression.
702         https://bugs.webkit.org/show_bug.cgi?id=194346
703
704         Unreviewed performance fix.
705
706         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
707         (didStartProvisionalLoadForFrame):
708         (didReceiveServerRedirectForProvisionalLoadForFrame):
709         (didFinishLoadForFrame):
710         (globalObjectIsAvailableForFrame):
711         (didRemoveFrameFromHierarchy):
712         (didCommitLoadForFrame):
713         (didFinishDocumentLoadForFrame):
714         (didFailProvisionalLoadWithErrorForFrame):
715         (didFailLoadWithErrorForFrame):
716         (didSameDocumentNavigationForFrame):
717         (didLayoutForFrame):
718         (didReachLayoutMilestone):
719         (didFirstVisuallyNonEmptyLayoutForFrame):
720         (didHandleOnloadEventsForFrame):
721         (userAgentForURL):
722         (setUpPageLoaderClient):
723         (willSendRequestForFrame):
724         (didInitiateLoadForResource):
725         (didFinishLoadForResource):
726         (didFailLoadForResource):
727         (setUpResourceLoadClient):
728         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
729         (ResourceLoadClient::ResourceLoadClient): Deleted.
730         (ResourceLoadClient::loadDelegate const): Deleted.
731         (ResourceLoadClient::pluginContextController const): Deleted.
732         (PageLoaderClient::PageLoaderClient): Deleted.
733         (PageLoaderClient::loadDelegate const): Deleted.
734         (PageLoaderClient::pluginContextController const): Deleted.
735         (PageLoaderClient::didStartProvisionalLoadForFrame): Deleted.
736         (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
737         (PageLoaderClient::didFinishLoadForFrame): Deleted.
738         (PageLoaderClient::globalObjectIsAvailableForFrame): Deleted.
739         (PageLoaderClient::didRemoveFrameFromHierarchy): Deleted.
740         (PageLoaderClient::didCommitLoadForFrame): Deleted.
741         (PageLoaderClient::didFinishDocumentLoadForFrame): Deleted.
742         (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): Deleted.
743         (PageLoaderClient::didFailLoadWithErrorForFrame): Deleted.
744         (PageLoaderClient::didSameDocumentNavigationForFrame): Deleted.
745         (PageLoaderClient::didLayoutForFrame): Deleted.
746         (PageLoaderClient::didReachLayoutMilestone): Deleted.
747         (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
748         (PageLoaderClient::layoutMilestones const): Deleted.
749         (PageLoaderClient::didHandleOnloadEventsForFrame): Deleted.
750         (PageLoaderClient::userAgentForURL const): Deleted.
751         (ResourceLoadClient::willSendRequestForFrame): Deleted.
752         (ResourceLoadClient::didInitiateLoadForResource): Deleted.
753         (ResourceLoadClient::didFinishLoadForResource): Deleted.
754         (ResourceLoadClient::didFailLoadForResource): Deleted.
755
756 2019-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
757
758         REGRESSION(r240785): [SOUP] Broke cookie persistent storage
759         https://bugs.webkit.org/show_bug.cgi?id=194209
760
761         Reviewed by Carlos Garcia Campos.
762
763         I missed a spot when moving the persistent storage parameters from NetworkProcess to
764         NetworkSession. They have to be initialized separately for the default session.
765
766         * UIProcess/soup/WebProcessPoolSoup.cpp:
767         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
768
769 2019-02-05  Alex Christensen  <achristensen@webkit.org>
770
771         Stop using blobRegistry in NetworkProcess
772         https://bugs.webkit.org/show_bug.cgi?id=194027
773
774         Reviewed by Youenn Fablet.
775
776         * NetworkProcess/Downloads/DownloadManager.cpp:
777         (WebKit::DownloadManager::startDownload):
778         * NetworkProcess/Downloads/PendingDownload.cpp:
779         (WebKit::PendingDownload::PendingDownload):
780         * NetworkProcess/Downloads/PendingDownload.h:
781         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
782         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
783         (WebKit::NetworkBlobRegistry::registerBlobURL):
784         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
785         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
786         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
787         (WebKit::NetworkBlobRegistry::blobSize):
788         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
789         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
790         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
791         (WebKit::NetworkBlobRegistry::filesInBlob):
792         (WebKit::NetworkBlobRegistry::singleton): Deleted.
793         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
794         (WebKit::NetworkBlobRegistry::blobRegistry):
795         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
796         (WebKit::NetworkConnectionToWebProcess::didClose):
797         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
798         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
799         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
800         (WebKit::NetworkConnectionToWebProcess::loadPing):
801         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
802         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
803         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
804         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
805         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
806         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
807         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
808         (WebKit::NetworkConnectionToWebProcess::blobSize):
809         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
810         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
811         (WebKit::NetworkConnectionToWebProcess::blobRegistry):
812         * NetworkProcess/NetworkConnectionToWebProcess.h:
813         * NetworkProcess/NetworkDataTask.cpp:
814         (WebKit::NetworkDataTask::create):
815         * NetworkProcess/NetworkDataTaskBlob.cpp:
816         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
817         * NetworkProcess/NetworkDataTaskBlob.h:
818         * NetworkProcess/NetworkLoad.cpp:
819         (WebKit::NetworkLoad::NetworkLoad):
820         (WebKit::NetworkLoad::initialize):
821         * NetworkProcess/NetworkLoad.h:
822         * NetworkProcess/NetworkProcess.cpp:
823         (WebKit::NetworkProcess::NetworkProcess):
824         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
825         * NetworkProcess/NetworkProcess.h:
826         (WebKit::NetworkProcess::networkBlobRegistry):
827         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
828         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
829         * NetworkProcess/NetworkResourceLoader.cpp:
830         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
831         (WebKit::NetworkResourceLoader::startNetworkLoad):
832         * NetworkProcess/PreconnectTask.cpp:
833         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
834         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
835
836 2019-02-05  Daniel Bates  <dabates@apple.com>
837
838         Fix a typo in r241006. Substitute Modifier for Modifiers.
839
840         * Shared/mac/NativeWebGestureEventMac.mm:
841         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
842
843 2019-02-05  Daniel Bates  <dabates@apple.com>
844
845         Attempt to fix the build following r241000
846         (https://bugs.webkit.org/show_bug.cgi?id=194241)
847
848         Substitute OptionSet<WebEvent::Modifier> for Modifiers.
849
850         * Shared/mac/NativeWebGestureEventMac.mm:
851         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
852         * Shared/mac/WebGestureEvent.h:
853         (WebKit::WebGestureEvent::WebGestureEvent):
854
855 2019-02-05  Truitt Savell  <tsavell@apple.com>
856
857         Unreviewed, rolling out r240984.
858
859         Revision casued two API timeouts
860
861         Reverted changeset:
862
863         "Stop using blobRegistry in NetworkProcess"
864         https://bugs.webkit.org/show_bug.cgi?id=194027
865         https://trac.webkit.org/changeset/240984
866
867 2019-02-05  Youenn Fablet  <youenn@apple.com>
868
869         UserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
870         https://bugs.webkit.org/show_bug.cgi?id=194246
871
872         Reviewed by Eric Carlson.
873
874         With PSON enabled, the manager proxy can be destroyed.
875         It is thus important for its callbacks to check for 'this' to be valid.
876
877         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
878         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
879         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
880         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
881
882 2019-02-05  Daniel Bates  <dabates@apple.com>
883
884         Attempt to fix the build following r241000
885         (https://bugs.webkit.org/show_bug.cgi?id=194241)
886
887         Substitute WebEvent::Modifier::CapsLockKey for WebEvent::CapsLockKey.
888
889         * Shared/gtk/WebEventFactory.cpp:
890         (WebKit::modifiersForEvent):
891         * Shared/mac/WebEventFactory.mm:
892         (WebKit::modifiersForEvent):
893         * UIProcess/API/Cocoa/WKNavigationAction.mm:
894         (toNSEventModifierFlags):
895         * UIProcess/Automation/WebAutomationSession.cpp:
896         (WebKit::protocolModifierToWebEventModifier):
897         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
898         (WebKit::modifiersToEventState):
899         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
900         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
901         * UIProcess/Cocoa/UIDelegate.mm:
902         (WebKit::toNSEventModifierFlags):
903
904 2019-02-05  Daniel Bates  <dabates@apple.com>
905
906         Make WebEvent::Modifiers an OptionSet
907         https://bugs.webkit.org/show_bug.cgi?id=194241
908
909         Reviewed by Simon Fraser.
910
911         Use an OptionSet to represent the bitmask of keyboard modifier flags. This improves type safety
912         and makes debugging more enjoyable because our LLDB pretty-printers have built-in support for
913         OptionSet.
914
915         While I am at it, make WebEvent::Modifier an enum class. It is currently an enum. This makes
916         this enum more closely match WebCore::PlatformEvent::Modifier.
917
918         * Shared/API/c/WKSharedAPICast.h:
919         (WebKit::toAPI):
920         * Shared/NavigationActionData.cpp:
921         (WebKit::NavigationActionData::encode const):
922         (WebKit::NavigationActionData::decode):
923         * Shared/NavigationActionData.h:
924         * Shared/WebEvent.cpp:
925         (WebKit::WebEvent::WebEvent):
926         * Shared/WebEvent.h:
927         (WebKit::WebEvent::shiftKey const):
928         (WebKit::WebEvent::controlKey const):
929         (WebKit::WebEvent::altKey const):
930         (WebKit::WebEvent::metaKey const):
931         (WebKit::WebEvent::capsLockKey const):
932         (WebKit::WebEvent::modifiers const):
933         (WebKit::WebTouchEvent::WebTouchEvent):
934         * Shared/WebEventConversion.cpp:
935         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
936         * Shared/WebKeyboardEvent.cpp:
937         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
938         * Shared/WebMouseEvent.cpp:
939         (WebKit::WebMouseEvent::WebMouseEvent):
940         * Shared/WebTouchEvent.cpp:
941         (WebKit::WebTouchEvent::WebTouchEvent):
942         * Shared/WebWheelEvent.cpp:
943         (WebKit::WebWheelEvent::WebWheelEvent):
944         * Shared/gtk/WebEventFactory.cpp:
945         (WebKit::modifiersForEvent):
946         * Shared/ios/NativeWebTouchEventIOS.mm:
947         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
948         * Shared/ios/WebIOSEventFactory.mm:
949         (modifiersForEvent):
950         (WebIOSEventFactory::createWebKeyboardEvent):
951         (WebIOSEventFactory::createWebMouseEvent):
952         * Shared/libwpe/WebEventFactory.cpp:
953         (WebKit::modifiersForEventModifiers):
954         (WebKit::WebEventFactory::createWebWheelEvent):
955         (WebKit::WebEventFactory::createWebTouchEvent):
956         * Shared/mac/WebEventFactory.mm:
957         (WebKit::modifiersForEvent):
958         (WebKit::WebEventFactory::createWebMouseEvent):
959         (WebKit::WebEventFactory::createWebWheelEvent):
960         (WebKit::WebEventFactory::createWebKeyboardEvent):
961         * Shared/win/WebEventFactory.cpp:
962         (WebKit::modifiersForEvent):
963         (WebKit::modifiersForCurrentKeyState):
964         (WebKit::WebEventFactory::createWebMouseEvent):
965         (WebKit::WebEventFactory::createWebWheelEvent):
966         (WebKit::WebEventFactory::createWebKeyboardEvent):
967         * UIProcess/API/APINavigationAction.h:
968         * UIProcess/API/APIUIClient.h:
969         (API::UIClient::mouseDidMoveOverElement):
970         * UIProcess/API/C/WKPage.cpp:
971         (WKPageSetPageUIClient):
972         * UIProcess/API/Cocoa/WKNavigationAction.mm:
973         (toNSEventModifierFlags):
974         * UIProcess/API/glib/WebKitPrivate.cpp:
975         (toPlatformModifiers):
976         * UIProcess/API/glib/WebKitPrivate.h:
977         * UIProcess/API/glib/WebKitUIClient.cpp:
978         * UIProcess/API/glib/WebKitWebView.cpp:
979         (webkitWebViewMouseTargetChanged):
980         * UIProcess/API/glib/WebKitWebViewPrivate.h:
981         * UIProcess/Automation/WebAutomationSession.cpp:
982         (WebKit::WebAutomationSession::simulateMouseInteraction):
983         (WebKit::protocolModifierToWebEventModifier):
984         (WebKit::WebAutomationSession::performMouseInteraction):
985         * UIProcess/Automation/WebAutomationSession.h:
986         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
987         (WebKit::modifiersToEventState):
988         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
989         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
990         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
991         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
992         (WebKit::modifiersToEventState):
993         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
994         * UIProcess/Cocoa/UIDelegate.h:
995         * UIProcess/Cocoa/UIDelegate.mm:
996         (WebKit::toNSEventModifierFlags):
997         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
998         * UIProcess/WebPageProxy.cpp:
999         (WebKit::WebPageProxy::mouseDidMoveOverElement):
1000         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
1001         (API::InjectedBundle::PageUIClient::mouseDidMoveOverElement):
1002         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1003         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
1004         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
1005         (WebKit::InjectedBundleNavigationAction::modifiers const):
1006         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1007         (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
1008         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1009         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1010         (WebKit::PDFPlugin::showContextMenuAtPoint):
1011         * WebProcess/Plugins/PluginView.cpp:
1012         (WebKit::PluginView::createWebEvent const):
1013         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1014         (WebKit::WebChromeClient::mouseDidMoveOverElement):
1015         * WebProcess/WebPage/WebPage.cpp:
1016         (WebKit::WebPage::simulateMouseDown):
1017         (WebKit::WebPage::simulateMouseUp):
1018         (WebKit::WebPage::simulateMouseMotion):
1019
1020 2019-02-05  Tim Horton  <timothy_horton@apple.com>
1021
1022         Reproducible crash under WKShareSheet presentWithParameters when cancelling a share
1023         https://bugs.webkit.org/show_bug.cgi?id=194301
1024         <rdar://problem/47719379>
1025
1026         Reviewed by Beth Dakin.
1027
1028         * UIProcess/Cocoa/WKShareSheet.mm:
1029         (-[WKShareSheet presentWithParameters:completionHandler:]):
1030         NSSharingServicePicker's delegate callbacks can be called synchronously.
1031         We release the WKShareSheet (which holds our reference to the NSSharingServicePicker)
1032         under sharingServicePicker:didChooseSharingService:. On older versions of macOS,
1033         there was nothing keeping the NSSharingServicePicker alive inside
1034         showRelativeToRect:ofView:preferredEdge:, thus the whole chain of references would
1035         fall and result in sending a message to a released NSSharingServicePicker.
1036         To resolve this, keep an extra reference to the WKShareSheet until
1037         presentation is complete.
1038
1039 2019-02-05  Keith Rollin  <krollin@apple.com>
1040
1041         Enable the automatic checking and regenerations of .xcfilelists during builds
1042         https://bugs.webkit.org/show_bug.cgi?id=194124
1043         <rdar://problem/47721277>
1044
1045         Reviewed by Tim Horton.
1046
1047         Bug 193790 add a facility for checking -- during build time -- that
1048         any needed .xcfilelist files are up-to-date and for updating them if
1049         they are not. This facility was initially opt-in by setting
1050         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
1051         the process seemed robust. Its now time to enable this facility and
1052         make it opt-out. If there is a need to disable this facility, set and
1053         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
1054         running `make` or `build-webkit`, or before running Xcode from the
1055         command line.
1056
1057         Additionally, remove the step that generates a list of source files
1058         going into the UnifiedSources build step. It's only necessarily to
1059         specify Sources.txt and SourcesCocoa.txt as inputs.
1060
1061         * UnifiedSources-input.xcfilelist: Removed.
1062         * WebKit.xcodeproj/project.pbxproj:
1063
1064 2019-02-05  Brady Eidson  <beidson@apple.com>
1065
1066         Add a new DownloadMap type that manages taking an assertion automatically.
1067         https://bugs.webkit.org/show_bug.cgi?id=194294
1068
1069         Reviewed by Alex Christensen.
1070
1071         If we don't need the download assertion, we use a vanilla HashMap like today.
1072         If we need the download assertion, we use the new DownloadMap class instead.
1073
1074         The new DownloadMap is a wrapper around a HashMap that also creates/destroys the assertion as needed.
1075
1076         * NetworkProcess/Downloads/DownloadManager.cpp:
1077         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
1078         (WebKit::DownloadManager::downloadFinished):
1079         * NetworkProcess/Downloads/DownloadManager.h:
1080
1081         * NetworkProcess/Downloads/DownloadMap.cpp: Added.
1082         (WebKit::DownloadMap::get const):
1083         (WebKit::DownloadMap::isEmpty const):
1084         (WebKit::DownloadMap::size const):
1085         (WebKit::DownloadMap::contains const):
1086         (WebKit::DownloadMap::add):
1087         (WebKit::DownloadMap::remove):
1088         * NetworkProcess/Downloads/DownloadMap.h: Added.
1089
1090         * Sources.txt:
1091
1092         * UIProcess/ios/ProcessAssertionIOS.mm:
1093         (WebKit::ProcessAssertion::ProcessAssertion):
1094
1095         * WebKit.xcodeproj/project.pbxproj:
1096
1097 2019-02-05  Brady Eidson  <beidson@apple.com>
1098
1099         Fix iOS simulator build after r240954
1100
1101         Unreviewed.
1102
1103         * UIProcess/ios/ProcessAssertionIOS.mm:
1104         (WebKit::ProcessAssertion::ProcessAssertion): Implement the new constructor.
1105
1106 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1107
1108         Stop using blobRegistry in NetworkProcess
1109         https://bugs.webkit.org/show_bug.cgi?id=194027
1110
1111         Reviewed by Youenn Fablet.
1112
1113         * NetworkProcess/Downloads/DownloadManager.cpp:
1114         (WebKit::DownloadManager::startDownload):
1115         * NetworkProcess/Downloads/PendingDownload.cpp:
1116         (WebKit::PendingDownload::PendingDownload):
1117         * NetworkProcess/Downloads/PendingDownload.h:
1118         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1119         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
1120         (WebKit::NetworkBlobRegistry::registerBlobURL):
1121         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
1122         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1123         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1124         (WebKit::NetworkBlobRegistry::blobSize):
1125         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
1126         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
1127         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
1128         (WebKit::NetworkBlobRegistry::filesInBlob):
1129         (WebKit::NetworkBlobRegistry::singleton): Deleted.
1130         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1131         (WebKit::NetworkBlobRegistry::blobRegistry):
1132         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1133         (WebKit::NetworkConnectionToWebProcess::didClose):
1134         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
1135         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
1136         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1137         (WebKit::NetworkConnectionToWebProcess::loadPing):
1138         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
1139         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
1140         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
1141         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
1142         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
1143         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
1144         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
1145         (WebKit::NetworkConnectionToWebProcess::blobSize):
1146         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1147         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
1148         (WebKit::NetworkConnectionToWebProcess::blobRegistry):
1149         * NetworkProcess/NetworkConnectionToWebProcess.h:
1150         * NetworkProcess/NetworkDataTask.cpp:
1151         (WebKit::NetworkDataTask::create):
1152         * NetworkProcess/NetworkDataTaskBlob.cpp:
1153         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1154         * NetworkProcess/NetworkDataTaskBlob.h:
1155         * NetworkProcess/NetworkLoad.cpp:
1156         (WebKit::NetworkLoad::NetworkLoad):
1157         (WebKit::NetworkLoad::initialize):
1158         * NetworkProcess/NetworkLoad.h:
1159         * NetworkProcess/NetworkProcess.cpp:
1160         (WebKit::NetworkProcess::NetworkProcess):
1161         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
1162         * NetworkProcess/NetworkProcess.h:
1163         (WebKit::NetworkProcess::networkBlobRegistry):
1164         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
1165         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
1166         * NetworkProcess/NetworkResourceLoader.cpp:
1167         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
1168         (WebKit::NetworkResourceLoader::startNetworkLoad):
1169         * NetworkProcess/PreconnectTask.cpp:
1170         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1171         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1172
1173 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
1174
1175         Unreviewed, rolling out r240742.
1176
1177         Causes crashes on iOS simulator.
1178
1179         Reverted changeset:
1180
1181         "[iOS] Keyups for non-modifier keys identified as "Dead" when
1182         not focused in a content-editable element"
1183         https://bugs.webkit.org/show_bug.cgi?id=192824
1184         https://trac.webkit.org/changeset/240742
1185
1186 2019-02-05  Alex Christensen  <achristensen@webkit.org>
1187
1188         Protect globalWebSocketStreamMap with a Lock
1189         https://bugs.webkit.org/show_bug.cgi?id=194224
1190         <rdar://problem/47581081>
1191
1192         Reviewed by Ryosuke Niwa.
1193
1194         * WebProcess/Network/WebSocketStream.cpp:
1195         (WebKit::WebSocketStream::streamWithIdentifier):
1196         (WebKit::WebSocketStream::networkProcessCrashed):
1197         (WebKit::WebSocketStream::WebSocketStream):
1198         (WebKit::WebSocketStream::~WebSocketStream):
1199
1200 2019-02-04  Alex Christensen  <achristensen@webkit.org>
1201
1202         Add Networking Daemon skeleton
1203         https://bugs.webkit.org/show_bug.cgi?id=194278
1204
1205         Reviewed by Zalan Bujtas.
1206
1207         Daemon skeletons? This is spooky stuff.
1208
1209         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added.
1210         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added.
1211         (WebKit::DaemonMain):
1212         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1213         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1214         (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
1215         * Shared/API/Cocoa/WKMain.h:
1216         * Shared/API/Cocoa/WKMain.mm:
1217         (WKDaemonMain):
1218         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:
1219         (main):
1220         * SourcesCocoa.txt:
1221         * UnifiedSources-input.xcfilelist:
1222         * WebKit.xcodeproj/project.pbxproj:
1223
1224 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
1225
1226         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
1227         https://bugs.webkit.org/show_bug.cgi?id=193993
1228
1229         Reviewed by Keith Miller.
1230
1231         * WebProcess/Plugins/Netscape/JSNPMethod.h:
1232         * WebProcess/Plugins/Netscape/JSNPObject.h:
1233
1234 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1235
1236         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
1237         https://bugs.webkit.org/show_bug.cgi?id=194245
1238
1239         Reviewed by Zalan Bujtas.
1240
1241         Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY).
1242
1243         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1244         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1245
1246 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
1247
1248         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
1249         https://bugs.webkit.org/show_bug.cgi?id=174816
1250
1251         Reviewed by Michael Catanzaro.
1252
1253         Add webkit_uri_for_display for GTK and WPE.
1254
1255         * PlatformGTK.cmake:
1256         * PlatformWPE.cmake:
1257         * SourcesGTK.txt:
1258         * SourcesWPE.txt:
1259         * UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
1260         (webkit_uri_for_display):
1261         * UIProcess/API/gtk/WebKitURIUtilities.h: Added.
1262         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1263         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1264         * UIProcess/API/gtk/webkit2.h:
1265         * UIProcess/API/wpe/WebKitURIUtilities.h: Added.
1266         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
1267         * UIProcess/API/wpe/docs/wpe-docs.sgml:
1268         * UIProcess/API/wpe/webkit.h:
1269
1270 2019-02-04  Alex Christensen  <achristensen@webkit.org>
1271
1272         Move XPCService main to a shared file calling a C function
1273         https://bugs.webkit.org/show_bug.cgi?id=194256
1274
1275         Reviewed by Brady Eidson.
1276
1277         This not only reduces a few kilobytes of duplicated binary from the XPCService executables,
1278         It will allow me to introduce a new kind of executable which will need to parse argv and call a different C function.
1279         This is similar to r236075 but more general.
1280
1281         * Shared/API/Cocoa/WKMain.h: Added.
1282         * Shared/API/Cocoa/WKMain.mm: Added.
1283         (WKXPCServiceMain):
1284         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
1285         (main):
1286         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1287         (main): Deleted.
1288         * SourcesCocoa.txt:
1289         * WebKit.xcodeproj/project.pbxproj:
1290
1291 2019-02-04  Alex Christensen  <achristensen@webkit.org>
1292
1293         Make MessageSender functions const
1294         https://bugs.webkit.org/show_bug.cgi?id=194247
1295
1296         Reviewed by Brady Eidson.
1297
1298         * NetworkProcess/Downloads/Download.cpp:
1299         (WebKit::Download::messageSenderConnection const):
1300         (WebKit::Download::messageSenderDestinationID const):
1301         (WebKit::Download::messageSenderConnection): Deleted.
1302         (WebKit::Download::messageSenderDestinationID): Deleted.
1303         * NetworkProcess/Downloads/Download.h:
1304         * NetworkProcess/Downloads/PendingDownload.cpp:
1305         (WebKit::PendingDownload::messageSenderConnection const):
1306         (WebKit::PendingDownload::messageSenderDestinationID const):
1307         (WebKit::PendingDownload::messageSenderConnection): Deleted.
1308         (WebKit::PendingDownload::messageSenderDestinationID): Deleted.
1309         * NetworkProcess/Downloads/PendingDownload.h:
1310         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1311         (WebKit::WebIDBConnectionToClient::messageSenderConnection const):
1312         (WebKit::WebIDBConnectionToClient::messageSenderConnection): Deleted.
1313         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
1314         * NetworkProcess/NetworkResourceLoader.cpp:
1315         (WebKit::NetworkResourceLoader::messageSenderConnection const):
1316         (WebKit::NetworkResourceLoader::messageSenderConnection): Deleted.
1317         * NetworkProcess/NetworkResourceLoader.h:
1318         * NetworkProcess/NetworkSocketStream.cpp:
1319         (WebKit::NetworkSocketStream::messageSenderConnection const):
1320         (WebKit::NetworkSocketStream::messageSenderDestinationID const):
1321         (WebKit::NetworkSocketStream::messageSenderConnection): Deleted.
1322         (WebKit::NetworkSocketStream::messageSenderDestinationID): Deleted.
1323         * NetworkProcess/NetworkSocketStream.h:
1324         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1325         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1326         (WebKit::WebSWServerToContextConnection::messageSenderConnection const):
1327         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID const):
1328         (WebKit::WebSWServerToContextConnection::messageSenderConnection): Deleted.
1329         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID): Deleted.
1330         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
1331         * Platform/IPC/MessageSender.h:
1332         * Shared/AuxiliaryProcess.cpp:
1333         (WebKit::AuxiliaryProcess::messageSenderConnection const):
1334         (WebKit::AuxiliaryProcess::messageSenderDestinationID const):
1335         (WebKit::AuxiliaryProcess::messageSenderConnection): Deleted.
1336         (WebKit::AuxiliaryProcess::messageSenderDestinationID): Deleted.
1337         * Shared/AuxiliaryProcess.h:
1338         * UIProcess/WebConnectionToWebProcess.cpp:
1339         (WebKit::WebConnectionToWebProcess::messageSenderConnection const):
1340         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID const):
1341         (WebKit::WebConnectionToWebProcess::messageSenderConnection): Deleted.
1342         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID): Deleted.
1343         * UIProcess/WebConnectionToWebProcess.h:
1344         * UIProcess/WebPageProxy.cpp:
1345         (WebKit::WebPageProxy::messageSenderConnection const):
1346         (WebKit::WebPageProxy::messageSenderDestinationID const):
1347         (WebKit::WebPageProxy::messageSenderConnection): Deleted.
1348         (WebKit::WebPageProxy::messageSenderDestinationID): Deleted.
1349         * UIProcess/WebPageProxy.h:
1350         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1351         (WebKit::WebIDBConnectionToServer::messageSenderConnection const):
1352         (WebKit::WebIDBConnectionToServer::messageSenderConnection): Deleted.
1353         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1354         * WebProcess/Network/WebResourceLoader.cpp:
1355         (WebKit::WebResourceLoader::messageSenderConnection const):
1356         (WebKit::WebResourceLoader::messageSenderDestinationID const):
1357         (WebKit::WebResourceLoader::messageSenderConnection): Deleted.
1358         (WebKit::WebResourceLoader::messageSenderDestinationID): Deleted.
1359         * WebProcess/Network/WebResourceLoader.h:
1360         * WebProcess/Network/WebSocketStream.cpp:
1361         (WebKit::WebSocketStream::messageSenderConnection const):
1362         (WebKit::WebSocketStream::messageSenderDestinationID const):
1363         (WebKit::WebSocketStream::messageSenderConnection): Deleted.
1364         (WebKit::WebSocketStream::messageSenderDestinationID): Deleted.
1365         * WebProcess/Network/WebSocketStream.h:
1366         * WebProcess/Storage/WebSWClientConnection.h:
1367         * WebProcess/WebConnectionToUIProcess.cpp:
1368         (WebKit::WebConnectionToUIProcess::messageSenderConnection const):
1369         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID const):
1370         (WebKit::WebConnectionToUIProcess::messageSenderConnection): Deleted.
1371         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID): Deleted.
1372         * WebProcess/WebConnectionToUIProcess.h:
1373         * WebProcess/WebPage/WebPage.cpp:
1374         (WebKit::WebPage::messageSenderConnection const):
1375         (WebKit::WebPage::messageSenderDestinationID const):
1376         (WebKit::WebPage::messageSenderConnection): Deleted.
1377         (WebKit::WebPage::messageSenderDestinationID): Deleted.
1378         * WebProcess/WebPage/WebPage.h:
1379
1380 2019-02-04  Brady Eidson  <beidson@apple.com>
1381
1382         Take additional process assertion while downloading.
1383         <rdar://problem/47741356> and https://bugs.webkit.org/show_bug.cgi?id=194239
1384
1385         Reviewed by Chris Dumez.
1386
1387         When the first download starts, grab this new assertion.
1388         When the last download ends, release it.
1389
1390         * Configurations/Network-iOS.entitlements:
1391
1392         * NetworkProcess/Downloads/DownloadManager.cpp:
1393         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
1394         (WebKit::DownloadManager::downloadFinished):
1395         * NetworkProcess/Downloads/DownloadManager.h:
1396
1397         * Platform/spi/ios/AssertionServicesSPI.h:
1398
1399         * UIProcess/ProcessAssertion.cpp:
1400         (WebKit::ProcessAssertion::ProcessAssertion):
1401         * UIProcess/ProcessAssertion.h:
1402         (WebKit::ProcessAssertion::ProcessAssertion):
1403
1404         * UIProcess/WebProcessProxy.cpp:
1405         (WebKit::WebProcessProxy::didSetAssertionState):
1406
1407         * UIProcess/ios/ProcessAssertionIOS.mm:
1408         (WebKit::flagsForState):
1409         (WebKit::reasonForState):
1410         (WebKit::ProcessAssertion::ProcessAssertion):
1411
1412 2019-02-04  Said Abou-Hallawa  <said@apple.com>
1413
1414         [CG] Enable setAdditionalSupportedImageTypes for WK1
1415         https://bugs.webkit.org/show_bug.cgi?id=194190
1416
1417         Reviewed by Tim Horton.
1418
1419         Move the function webCoreStringVectorFromNSStringArray from WebKit to
1420         WebCore so it can be used by both WebKit and WebKitLegacy.
1421
1422         * Platform/mac/StringUtilities.h:
1423         * Platform/mac/StringUtilities.mm:
1424         (WebKit::webCoreStringVectorFromNSStringArray): Deleted.
1425         * UIProcess/API/Cocoa/WKWebView.mm:
1426         (-[WKWebView _initializeWithConfiguration:]):
1427
1428 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
1429
1430         Use deferrable timer to restart the Responsiveness Timer on each wheel event
1431         https://bugs.webkit.org/show_bug.cgi?id=194135
1432
1433         Reviewed by Simon Fraser.
1434
1435         Simon Fraser suggested a neat improvement over my previous optimization
1436         of ResponsivenessTimer.
1437
1438         Instead of reseting the deadline with every event, we can let the timer
1439         fire and add the missing time from the last start.
1440
1441         I implemented that behavior in the new Deferrable Timer class and use
1442         it from ResponsivenessTimer.
1443
1444         * NetworkProcess/watchos/NetworkProximityAssertion.h:
1445         * UIProcess/ResponsivenessTimer.h:
1446         * WebProcess/Plugins/PluginView.h:
1447
1448 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
1449
1450         PageOverlayController's layers should be created lazily
1451         https://bugs.webkit.org/show_bug.cgi?id=194199
1452         rdar://problem/46571593
1453
1454         Reviewed by Tim Horton.
1455         
1456         Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
1457         and use them to only parent the overlay-hosting layers when necessary.
1458
1459         For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
1460         simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
1461         which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
1462         compositing updates that parents the layerWithDocumentOverlays().
1463
1464         View overlays are added to the layer tree via the DrawingArea. When we go between having
1465         none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
1466         on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
1467         compositing flush (this has to be done manually because view overlay layers are outside the
1468         subtree managed by RenderLayerCompositor).
1469         
1470         Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
1471         there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
1472         overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
1473         having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
1474
1475         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1476         (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
1477         * WebProcess/WebCoreSupport/WebChromeClient.h:
1478         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1479         (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
1480         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1481         * WebProcess/WebPage/DrawingArea.h:
1482         (WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
1483         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1484         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1485         (WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
1486         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1487         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1488         (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
1489         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
1490
1491 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1492
1493         Unreviewed, improve preprocessor guard
1494         https://bugs.webkit.org/show_bug.cgi?id=194166
1495         <rdar://problem/47694328>
1496
1497         AC mode is only optional in GTK port. Requested by Zan.
1498
1499         * WebProcess/WebPage/WebPage.cpp:
1500         (WebKit::WebPage::updatePreferences):
1501
1502 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
1503
1504         IndexedDB: leak WebIDBConnectionToServer in layout tests
1505         https://bugs.webkit.org/show_bug.cgi?id=193688
1506         <rdar://problem/47353263>
1507
1508         Reviewed by Geoffrey Garen.
1509
1510         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1511         (WebKit::NetworkConnectionToWebProcess::didClose):
1512         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
1513         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): Deleted.
1514         * NetworkProcess/NetworkConnectionToWebProcess.h:
1515         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1516         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1517         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
1518
1519 2019-02-04  Antoine Quint  <graouts@apple.com>
1520
1521         <rdar://problem/47788802>
1522
1523         Unreviewed build fix.
1524
1525         * Platform/spi/ios/UIKitSPI.h:
1526
1527 2019-02-04  Youenn Fablet  <youenn@apple.com>
1528
1529         Capture state should be managed consistently when doing process swapping
1530         https://bugs.webkit.org/show_bug.cgi?id=194122
1531         <rdar://problem/47609293>
1532
1533         Reviewed by Eric Carlson.
1534
1535         When doing PSON, WebPageProxy::resetState is called.
1536         It resets the media state, but does not call the client delegates.
1537         Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
1538
1539         Covered by new API test and layout test.
1540
1541         * UIProcess/API/Cocoa/WKWebView.mm:
1542         (-[WKWebView _mediaCaptureState]):
1543         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1544         * UIProcess/WebPageProxy.cpp:
1545         (WebKit::WebPageProxy::resetState):
1546         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1547         (WebKit::WebPageProxy::updatePlayingMediaDidChange):
1548         * UIProcess/WebPageProxy.h:
1549
1550 2019-02-04  Antoine Quint  <graouts@apple.com>
1551
1552         Use a dedicated type instead of int32_t for pointer identifiers
1553         https://bugs.webkit.org/show_bug.cgi?id=194217
1554
1555         Reviewed by Antti Koivisto.
1556
1557         * Scripts/webkit/messages.py:
1558         * UIProcess/WebPageProxy.cpp:
1559         (WebKit::WebPageProxy::cancelPointer):
1560         * UIProcess/WebPageProxy.h:
1561         * WebProcess/WebPage/WebPage.cpp:
1562         (WebKit::WebPage::cancelPointer):
1563         * WebProcess/WebPage/WebPage.h:
1564         * WebProcess/WebPage/WebPage.messages.in:
1565
1566 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1567
1568         Unreviewed, avoid -Wswitch warnings introduced in r240880
1569         https://bugs.webkit.org/show_bug.cgi?id=193740
1570         <rdar://problem/47527267>
1571
1572         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1573         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
1574
1575 2019-02-04  Alexander Mikhaylenko  <exalm7659@gmail.com>
1576
1577         [GTK] Allow pinch zoom on touchpad
1578         https://bugs.webkit.org/show_bug.cgi?id=194201
1579
1580         Reviewed by Michael Catanzaro.
1581
1582         Enable touchpad events for WebkitWebViewBase, then feed touchpad
1583         pinch events to GestureController.
1584
1585         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1586         (webkitWebViewBaseRealize): Added GDK_TOUCHPAD_GESTURE_MASK to event mask.
1587         (webkitWebViewBaseEvent): Added.
1588         (webkit_web_view_base_class_init): Override event vfunc.
1589
1590 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1591
1592         Unreviewed, only force settings.acceleratedCompositingEnabled() to true for Cocoa ports
1593         https://bugs.webkit.org/show_bug.cgi?id=194166
1594         <rdar://problem/47694328>
1595
1596         Accelerated compositing is broken for me at least. We're a long way from being able to force
1597         it.
1598
1599         * WebProcess/WebPage/WebPage.cpp:
1600         (WebKit::WebPage::updatePreferences):
1601
1602 2019-02-04  Abderrahim Kitouni  <akitouni@gnome.org>
1603
1604         [GTK] Remove last python2 dependency from CMake build process
1605         https://bugs.webkit.org/show_bug.cgi?id=194218
1606
1607         Reviewed by Michael Catanzaro.
1608
1609         * InspectorGResources.cmake:
1610
1611 2019-02-04  Antti Koivisto  <antti@apple.com>
1612
1613         Rename GraphicsLayer and PlatformCALayer type enum values to match "scroll container layer" convention
1614         https://bugs.webkit.org/show_bug.cgi?id=194215
1615
1616         Reviewed by Frédéric Wang.
1617
1618         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1619         (WebKit::RemoteLayerBackingStore::drawInContext):
1620         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1621         (WebKit::RemoteLayerTreeHost::makeNode):
1622         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1623         (WebKit::RemoteLayerTreeHost::makeNode):
1624
1625 2019-02-03  Antti Koivisto  <antti@apple.com>
1626
1627         [iOS] Tiles not created in large scrollable iframes
1628         https://bugs.webkit.org/show_bug.cgi?id=193665
1629
1630         Reviewed by Simon Fraser.
1631
1632         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
1633         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
1634         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1635         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
1636
1637         We now use scrollContainerLayer consistently so remove the special cases.
1638
1639 2019-02-03  Fujii Hironori  <Hironori.Fujii@sony.com>
1640
1641         [curl] [WebKit] Assertion failures of missing networkStorageSession for storage/indexeddb tests
1642         https://bugs.webkit.org/show_bug.cgi?id=194141
1643
1644         Reviewed by Ross Kirsling.
1645
1646         Implemented WebKit::NetworkProcess::switchToNewTestingSession and
1647         WebKit::NetworkProcess::ensureSession for curl port.
1648
1649         * NetworkProcess/NetworkProcess.cpp:
1650         (WebKit::NetworkProcess::switchToNewTestingSession):
1651         (WebKit::NetworkProcess::ensureSession):
1652
1653 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
1654
1655         Make setNeedsLayout on the root more explicitly about triggering its side-effects
1656         https://bugs.webkit.org/show_bug.cgi?id=194198
1657
1658         Reviewed by Antti Koivisto.
1659
1660         Call the newly named functions.
1661
1662         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1663         (WebKit::PDFPlugin::updateScrollbars):
1664         * WebProcess/Plugins/PluginView.cpp:
1665         (WebKit::PluginView::didInitializePlugin):
1666         * WebProcess/WebPage/WebPage.cpp:
1667         (WebKit::WebPage::setHeaderBannerHeightForTesting):
1668         (WebKit::WebPage::setFooterBannerHeightForTesting):
1669         * WebProcess/WebPage/mac/PageBannerMac.mm:
1670         (WebKit::PageBanner::addToPage):
1671         (WebKit::PageBanner::detachFromPage):
1672         (WebKit::PageBanner::hide):
1673
1674 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
1675
1676         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
1677         https://bugs.webkit.org/show_bug.cgi?id=194189
1678
1679         Reviewed by Geoffrey Garen.
1680
1681         Pass the policy check identifier around functions and store it in PolicyDecisionSender
1682         so that we can send it back to WebCore with the navigation policy decision.
1683
1684         We also store it in WebFrame in the case the policy decision had to be invalidated
1685         before the decision was received (via WebFrame::invalidatePolicyListener).
1686
1687         * Scripts/webkit/messages.py:
1688         * UIProcess/ProvisionalPageProxy.cpp:
1689         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
1690         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
1691         * UIProcess/ProvisionalPageProxy.h:
1692         * UIProcess/WebPageProxy.cpp:
1693         (WebKit::WebPageProxy::PolicyDecisionSender): Added PolicyCheckIdentifier as a member.
1694         (WebKit::WebPageProxy::PolicyDecisionSender::create):
1695         (WebKit::WebPageProxy::PolicyDecisionSender::send):
1696         (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
1697         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1698         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
1699         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
1700         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1701         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1702         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1703         (WebKit::WebPageProxy::decidePolicyForResponse):
1704         (WebKit::WebPageProxy::decidePolicyForResponseShared):
1705         * UIProcess/WebPageProxy.h:
1706         * UIProcess/WebPageProxy.messages.in:
1707         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1708         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1709         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1710         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1711         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1712         * WebProcess/WebPage/WebFrame.cpp:
1713         (WebKit::WebFrame::setUpPolicyListener):
1714         (WebKit::WebFrame::invalidatePolicyListener):
1715         (WebKit::WebFrame::didReceivePolicyDecision):
1716         * WebProcess/WebPage/WebFrame.h:
1717         * WebProcess/WebPage/WebPage.cpp:
1718         (WebKit::WebPage::didReceivePolicyDecision):
1719         * WebProcess/WebPage/WebPage.h:
1720         * WebProcess/WebPage/WebPage.messages.in:
1721
1722 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
1723
1724         Turn on Smart Paste
1725         https://bugs.webkit.org/show_bug.cgi?id=193786
1726
1727         Reviewed by Ryosuke Niwa.
1728
1729         * Platform/spi/ios/UIKitSPI.h:
1730         * UIProcess/ios/TextCheckerIOS.mm:
1731         (WebKit::TextChecker::isSmartInsertDeleteEnabled):
1732         Use the flag from UIKit to determine if smart copy paste should be
1733         turned on.
1734
1735 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
1736
1737         Tidy up data memebers of FrameView and related classes to shrink class sizes
1738         https://bugs.webkit.org/show_bug.cgi?id=194197
1739
1740         Reviewed by Zalan Bujtas.
1741
1742         * UIProcess/PageClient.h: Declare enum size.
1743
1744 2018-12-16  Darin Adler  <darin@apple.com>
1745
1746         Convert additional String::format clients to alternative approaches
1747         https://bugs.webkit.org/show_bug.cgi?id=192746
1748
1749         Reviewed by Alexey Proskuryakov.
1750
1751         * UIProcess/Cocoa/ViewGestureController.cpp:
1752         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
1753         Use makeString and FormattedNumber.
1754
1755         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1756         (WebKit::LocalAuthenticator::getAssertion): Added a comment about an
1757         incorrect format specifier and left this code as is for now.
1758
1759 2019-02-01  David Kilzer  <ddkilzer@apple.com>
1760
1761         Move soft-linking of TelephonyUtilities.framework out of TUCallSPI.h
1762         <https://webkit.org/b/193866>
1763
1764         Reviewed by Alex Christensen.
1765
1766         * Platform/mac/MenuUtilities.mm:
1767         - Update for rename of TUCallSPI.h to TelephonyUtilitiesSPI.h.
1768         - Add soft-linking code formerly in TUCallSPI.h.
1769
1770 2019-02-01  Alex Christensen  <achristensen@webkit.org>
1771
1772         Move XPCService entry points from mac directory to new Cocoa directory
1773         https://bugs.webkit.org/show_bug.cgi?id=194129
1774
1775         Reviewed by Chris Dumez.
1776
1777         * Configurations/NetworkService.xcconfig:
1778         * Configurations/PluginService.64.xcconfig:
1779         * Configurations/WebContentService.xcconfig:
1780         * NetworkProcess/EntryPoint/Cocoa: Copied from Source/WebKit/NetworkProcess/EntryPoint/mac.
1781         * NetworkProcess/EntryPoint/mac: Removed.
1782         * PluginProcess/EntryPoint/Cocoa: Copied from Source/WebKit/PluginProcess/EntryPoint/mac.
1783         * PluginProcess/EntryPoint/mac: Removed.
1784         * Shared/EntryPointUtilities/Cocoa: Copied from Source/WebKit/Shared/EntryPointUtilities/mac.
1785         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
1786         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
1787         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1788         * Shared/EntryPointUtilities/mac: Removed.
1789         * SourcesCocoa.txt:
1790         * WebKit.xcodeproj/project.pbxproj:
1791         * WebProcess/EntryPoint/Cocoa: Copied from Source/WebKit/WebProcess/EntryPoint/mac.
1792         * WebProcess/EntryPoint/mac: Removed.
1793
1794 2019-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1795
1796         [iOS] Consistent 1 sec hang when triggering modal alerts while handling synchronous touch events
1797         https://bugs.webkit.org/show_bug.cgi?id=194140
1798         <rdar://problem/47728098>
1799
1800         Reviewed by Tim Horton.
1801
1802         Currently, the UI process hangs when attempting to synchronously present modal UI from the web process while the
1803         UI process is waiting for sync IPC in the web process. While we have logic to generally mitigate IPC deadlock in
1804         this scenario by dispatching the web process' sync IPC immediately with the intention of allowing the web
1805         process to finish processing sync IPC (and consequently unblock the UI process), this fails in the case where
1806         the sync IPC message from the web process to the UI process requires main thread execution for an arbitrary
1807         amount of time (for instance, modal alert dialogs). In this case, we'll end up in a state where we've handled
1808         the web process' sync IPC in the UI process, yet we can't resume execution since the web process is still
1809         blocked.
1810
1811         By far the most egregious scenario in which this manifests is during synchronous gesture recognizer IPC, i.e.
1812         grabbing position information from the UI process, and handling touch events synchronously. Luckily, these are
1813         also cases where (1) we know sync IPC may safely time out, and (2) the presentation of modal UI from the web
1814         process should cause the gesture recognizers to fail anyways. As such, we can mitigate these scenarios in the
1815         web process by responding to the these pending sync IPC messages *before* sending our own sync IPC to the UI
1816         process.
1817
1818         Test: fast/events/touch/ios/show-modal-alert-during-touch-start.html
1819
1820         * Shared/ios/InteractionInformationAtPosition.h:
1821         (WebKit::InteractionInformationAtPosition::invalidInformation):
1822         * Shared/ios/InteractionInformationAtPosition.mm:
1823         (WebKit::InteractionInformationAtPosition::encode const):
1824         (WebKit::InteractionInformationAtPosition::decode):
1825
1826         Add a new flag to indicate whether an interaction information response can be valid. Interaction information
1827         cannot be valid in the case where the interaction information request was interrupted by certain sync IPC
1828         messages from the web process.
1829
1830         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1831         (WKContextConfigurationIgnoreSynchronousMessagingTimeoutsForTesting):
1832         (WKContextConfigurationSetIgnoreSynchronousMessagingTimeoutsForTesting):
1833
1834         Add some testing SPI to ignore sync IPC timeouts, for the purposes of testing. Rather than use the existing
1835         Objective-C SPI in WKWebProcessPoolConfiguration, I decided to add C API plumbing for this flag, so that other
1836         non-Cocoa ports may also support the new layout test option to ignore sync IPC timeouts.
1837
1838         * UIProcess/API/C/WKContextConfigurationRef.h:
1839         * UIProcess/ios/WKContentViewInteraction.mm:
1840         (-[WKContentView ensurePositionInformationIsUpToDate:]):
1841         (-[WKContentView _positionInformationDidChange:]):
1842         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1843         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
1844         (WebKit::WebChromeClient::runJavaScriptAlert):
1845         (WebKit::WebChromeClient::runJavaScriptConfirm):
1846         (WebKit::WebChromeClient::runJavaScriptPrompt):
1847         (WebKit::WebChromeClient::print):
1848         (WebKit::WebChromeClient::exceededDatabaseQuota):
1849         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1850
1851         Cancel any pending sync IPC replies prior to sending sync IPC messages to the UI process which may result in
1852         sync IPC deadlock, by using the new helper method, sendSyncWithDelayedReply, instead of just sendSync.
1853
1854         * WebProcess/WebPage/WebPage.cpp:
1855         (WebKit::WebPage::cancelGesturesBlockedOnSynchronousReplies):
1856
1857         Add a helper to cancel pending sync messages coming in from the UI process that are being called from within
1858         gesture recognizer delegate hooks.
1859
1860         (WebKit::WebPage::touchEventSync):
1861         * WebProcess/WebPage/WebPage.h:
1862
1863         Add a new helper, sendSyncWithDelayedReply, to be used when sending a sync IPC message to the UI process that
1864         cannot be immediately completed upon arrival. Importantly, this cancels pending sync replies, and also passes
1865         IPC::SendSyncOption::InformPlatformProcessWillSuspend.
1866
1867         * WebProcess/WebPage/WebPage.messages.in:
1868
1869         Change these from LegacySync to Delayed messages.
1870
1871         * WebProcess/WebPage/ios/WebPageIOS.mm:
1872         (WebKit::WebPage::getPositionInformation):
1873
1874         Make this sync IPC handler (as well as WebPage::touchEventSync) store the IPC reply during the scope of the
1875         method, and invoke the stored reply at the end of the method if it wasn't interrupted due to something calling
1876         cancelGesturesBlockedOnSynchronousReplies().
1877
1878         (WebKit::WebPage::positionInformation):
1879
1880         Refactor getPositionInformation by pulling out the logic for building an InteractionInformationAtPosition into
1881         a separate helper.
1882
1883         (WebKit::WebPage::requestPositionInformation):
1884
1885 2019-02-01  David Quesada  <david_quesada@apple.com>
1886
1887         Network Process crash when resuming downloads: '-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p'
1888         https://bugs.webkit.org/show_bug.cgi?id=194144
1889         rdar://problem/47553456
1890
1891         Reviewed by Geoffrey Garen.
1892
1893         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1894         (WebKit::Download::resume):
1895             Make a mutable copy of the root object decoded from the resume data.
1896             It might have been originally encoded as an immutable dictionary.
1897
1898 2019-02-01  Chris Dumez  <cdumez@apple.com>
1899
1900         REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
1901         https://bugs.webkit.org/show_bug.cgi?id=193740
1902         <rdar://problem/47527267>
1903
1904         Reviewed by Alex Christensen.
1905
1906         The issue was happening when the page is triggering a cross-site navigation while in the middle of parsing. This would cause us to
1907         start a new provisional load in a new process before the previous process sends the DidFinishLoadForFrame() IPC to the UIProcess.
1908         Getting such IPC after a provisional load has started would mess up our state machine and trip assertions.
1909
1910         This patch restores non-PSON behavior which is that the previous load in the old process now gets stopped so that no DidFinishLoadForFrame()
1911         / DidFailLoadForFrame() gets sent. To achieve this behavior, I introduced a new "StopAllLoads" PolicyAction that we now send the old
1912         process when the load is continuing in a new process, instead of sending it "Ignore".
1913
1914         * NetworkProcess/NetworkDataTaskBlob.cpp:
1915         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
1916         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1917         (toNSURLSessionResponseDisposition):
1918         * UIProcess/WebPageProxy.cpp:
1919         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1920
1921 2019-02-01  Jer Noble  <jer.noble@apple.com>
1922
1923         Unreviewed build fix; Respect the 'condition:' field in the WebPreferences.yaml when generating
1924         WebPreferencesStoreDefaultsMap.cpp.
1925
1926         * page/SettingsBase.h:
1927
1928 2019-02-01  Antoine Quint  <graouts@apple.com>
1929
1930         Dispatch pointercancel events when content is panned or zoomed on iOS
1931         https://bugs.webkit.org/show_bug.cgi?id=193962
1932         <rdar://problem/47629134>
1933
1934         Reviewed by Dean Jackson.
1935
1936         When a user-agent-provided interaction, such as panning or zooming on iOS, uses a set of touches, we should dispatch a pointercancel
1937         event for the pointer ids of the touches involved. To facilitate this, we add a new method on WKContentView to cancel all the pointers
1938         matching active touches for a provided UIGestureRecognizer through an async IPC call into the Web process using the new method
1939         PointerCaptureController::cancelPointer().
1940
1941         * Platform/spi/ios/UIKitSPI.h: Add the necessary forward declaration for a necessary UIKit SPI allowing us to get the set of last-seen
1942         UITouches by the identifier generated for the matching WebKit touch.
1943         * UIProcess/API/Cocoa/WKWebView.mm:
1944         (-[WKWebView scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a pinch gesture on the
1945         top-level UIScrollView.
1946         (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Dispatch
1947         touchcancel events for all pointers involved in a pan gesture on the top-level UIScrollView. We can infer this by looking at whether the
1948         adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
1949         * UIProcess/PageClient.h: Expose a new virtual cancelPointersForGestureRecognizer() method which will allow the iOS implementation to
1950         forward the call to WKContentViewInteraction.
1951         (WebKit::PageClient::cancelPointersForGestureRecognizer):
1952         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Expose the WebPageProxy such that we may access it to cancel pointers for
1953         a given gesture recognizer from within ScrollingTreeScrollingNodeDelegateIOS.
1954         (WebKit::RemoteScrollingCoordinatorProxy::webPageProxy const):
1955         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
1956         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1957         (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
1958         Dispatch touchcancel events for all pointers involved in a pan gesture on a nested UIScrollView. We can infer this by looking at
1959         whether the adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
1960         (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a
1961         pinch gesture on a nested UIScrollView.
1962         (-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]):
1963         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer):
1964         * UIProcess/WebPageProxy.cpp:
1965         (WebKit::WebPageProxy::cancelPointer):
1966         * UIProcess/WebPageProxy.h:
1967         * UIProcess/ios/PageClientImplIOS.h:
1968         * UIProcess/ios/PageClientImplIOS.mm:
1969         (WebKit::PageClientImpl::cancelPointersForGestureRecognizer):
1970         * UIProcess/ios/WKContentViewInteraction.h:
1971         * UIProcess/ios/WKContentViewInteraction.mm:
1972         (-[WKContentView cancelPointersForGestureRecognizer:]): Obtain all active UITouch objects for the view and dispatch a pointercancel event,
1973         through the WebPageProxy, for all touches associated with the provided gesture recognizer.
1974         * WebProcess/WebPage/WebPage.cpp:
1975         (WebKit::WebPage::cancelPointer):
1976         * WebProcess/WebPage/WebPage.h:
1977         * WebProcess/WebPage/WebPage.messages.in:
1978
1979 2019-02-01  Jer Noble  <jer.noble@apple.com>
1980
1981         Make the WebKit default for media source based on the WebCore default.
1982         https://bugs.webkit.org/show_bug.cgi?id=194172
1983
1984         Reviewed by Eric Carlson.
1985
1986         * Shared/WebPreferences.yaml:
1987         * UIProcess/API/Cocoa/WKPreferences.mm:
1988         (-[WKPreferences _setMediaSourceEnabled:]):
1989         (-[WKPreferences _mediaSourceEnabled]):
1990         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1991
1992 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
1993
1994         Force settings.acceleratedCompositingEnabled() to true for WebKit
1995         https://bugs.webkit.org/show_bug.cgi?id=194166
1996         rdar://problem/47694328
1997
1998         Reviewed by Tim Horton.
1999
2000         WebKit relies on accelerated compositing for its drawing areas to function correctly,
2001         and sometimes clients (*cough* Safari *cough*) have bugs where they clobber the settings,
2002         so force this setting to be always on (and release log if this happens).
2003
2004         * WebProcess/WebPage/WebPage.cpp:
2005         (WebKit::WebPage::updatePreferences):
2006
2007 2019-02-01  Antti Koivisto  <antti@apple.com>
2008
2009         Don't use base layer() as the scroll layer in scrolling tree.
2010         https://bugs.webkit.org/show_bug.cgi?id=194160
2011
2012         Reviewed by Simon Fraser.
2013
2014         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2015         (ArgumentCoder<ScrollingStateNode>::encode):
2016         (ArgumentCoder<ScrollingStateNode>::decode):
2017         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2018         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2019         (WebKit::dump):
2020         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2021         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2022         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2023         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2024         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2025         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2026         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2027         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
2028         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2029         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
2030         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
2031
2032 2019-02-01  Michael Catanzaro  <mcatanzaro@igalia.com>
2033
2034         [SOUP] Improve use of SoupCookiePersistentStorageType
2035         https://bugs.webkit.org/show_bug.cgi?id=194103
2036
2037         Reviewed by Carlos Garcia Campos.
2038
2039         Turn it into an enum class, and stop casting it to and from uint32_t.
2040
2041         * NetworkProcess/Cookies/WebCookieManager.h:
2042         * NetworkProcess/Cookies/WebCookieManager.messages.in:
2043         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2044         (WebKit::WebCookieManager::setCookiePersistentStorage):
2045         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2046         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2047         (WebKit::NetworkSessionCreationParameters::decode):
2048         * NetworkProcess/NetworkSessionCreationParameters.h:
2049         * Shared/soup/SoupCookiePersistentStorageType.h:
2050         (): Deleted.
2051         * UIProcess/API/glib/WebKitCookieManager.cpp:
2052         * UIProcess/WebCookieManagerProxy.h:
2053         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
2054         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
2055         (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
2056
2057 2019-02-01  Per Arne Vollan  <pvollan@apple.com>
2058
2059         [macOS] Revert parts of r240811, since it causes kernel panics.
2060         https://bugs.webkit.org/show_bug.cgi?id=194061
2061
2062         Unreviewed crash fix.
2063
2064         * WebProcess/com.apple.WebProcess.sb.in:
2065
2066 2019-02-01  Michael Catanzaro  <mcatanzaro@igalia.com>
2067
2068         [SOUP] Improve use of PAL::SessionID in WebKitCookieManager
2069         https://bugs.webkit.org/show_bug.cgi?id=194092
2070
2071         Reviewed by Carlos Garcia Campos.
2072
2073         Always get it from the data store instead of assuming the default session ID, and add a
2074         helper function for this.
2075
2076         * UIProcess/API/glib/WebKitCookieManager.cpp:
2077         (_WebKitCookieManagerPrivate::sessionID const):
2078         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
2079         (webkitCookieManagerCreate):
2080         (webkit_cookie_manager_set_persistent_storage):
2081         (webkit_cookie_manager_set_accept_policy):
2082         (webkit_cookie_manager_get_accept_policy):
2083         (webkit_cookie_manager_add_cookie):
2084         (webkit_cookie_manager_get_cookies):
2085         (webkit_cookie_manager_delete_cookie):
2086
2087 2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
2088
2089         [Curl] Remove unnecessary member from NetworkStorageSession.
2090         https://bugs.webkit.org/show_bug.cgi?id=194137
2091
2092         Reviewed by Don Olmstead.
2093
2094         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2095         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2096
2097 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
2098
2099         Unreviewed, build fix after r240805
2100
2101         This patch reverts the BlockPtr change since it breaks iOS builds.
2102
2103         * UIProcess/Cocoa/NavigationState.mm:
2104         (WebKit::tryInterceptNavigation):
2105
2106 2019-01-31  Chris Dumez  <cdumez@apple.com>
2107
2108         Page zoom level is lost after a process swap or a crash
2109         https://bugs.webkit.org/show_bug.cgi?id=194105
2110         <rdar://problem/47610781>
2111
2112         Reviewed by Alex Christensen.
2113
2114         Previously, when the client would call setPageAndTextZoomFactors() on the WebPageProxy,
2115         we would update the WebPageProxy's corresponding data members and send an IPC to the
2116         WebProcess to apply the zoom factors.
2117
2118         The issue is that on process crash or process-swap, we never communicate those zoom factors
2119         to the new WebProcess. Even if the client were to call setPageAndTextZoomFactors() with
2120         the same factors again, it would be a no-op since the WebPageProxy's data members already
2121         reflect the expected values.
2122
2123         To address the issue, pass both the page zoom and the text zoom factors to the WebProcess
2124         via WebPageCreationParameters. This way, there is no need to send an extra IPC and we're
2125         sure the WebPageProxy's factors are properly applied to the WebPage on WebContent process
2126         side upon creation (whether after a crash or a process swap).
2127
2128         * Shared/WebPageCreationParameters.cpp:
2129         (WebKit::WebPageCreationParameters::encode const):
2130         (WebKit::WebPageCreationParameters::decode):
2131         * Shared/WebPageCreationParameters.h:
2132         * UIProcess/WebPageProxy.cpp:
2133         (WebKit::WebPageProxy::creationParameters):
2134         * WebProcess/WebPage/WebPage.cpp:
2135
2136 2019-01-31  Per Arne Vollan  <pvollan@apple.com>
2137
2138         [macOS] Disable permissive call logging in sandbox
2139         https://bugs.webkit.org/show_bug.cgi?id=194061
2140
2141         Reviewed by Alexey Proskuryakov.
2142
2143         Strict call filtering should be reenabled.
2144
2145         * WebProcess/com.apple.WebProcess.sb.in:
2146
2147 2019-01-31  Per Arne Vollan  <pvollan@apple.com>
2148
2149         [macOS] Crash when control-clicking or copying text rendered with a web font
2150         https://bugs.webkit.org/show_bug.cgi?id=193913
2151         <rdar://problem/47541039>
2152
2153         Reviewed by Brent Fulgham.
2154
2155         On older versions of macOS, allowing mach lookup to com.apple.FontObjectsServer is needed.
2156
2157         * WebProcess/com.apple.WebProcess.sb.in:
2158
2159 2019-01-31  Benjamin Poulain  <benjamin@webkit.org>
2160
2161         Remove WKPageIsWebProcessResponsive
2162         https://bugs.webkit.org/show_bug.cgi?id=194096
2163
2164         Reviewed by Alex Christensen.
2165
2166         It is not used by any client.
2167
2168         It is also bad API. It is better to let WebKit track
2169         responsiveness and tell the client with processDidBecomeResponsive.
2170
2171         * UIProcess/API/C/WKPage.cpp:
2172         (WKPageIsWebProcessResponsive): Deleted.
2173         * UIProcess/API/C/WKPagePrivate.h:
2174         * UIProcess/WebPageProxy.cpp:
2175         (WebKit::WebPageProxy::isWebProcessResponsive): Deleted.
2176         * UIProcess/WebPageProxy.h:
2177
2178 2019-01-31  Alex Christensen  <achristensen@webkit.org>
2179
2180         Revert r238819 which is unneeded and caused a performance regression.
2181         https://bugs.webkit.org/show_bug.cgi?id=192272
2182         <rdar://problem/46664625>
2183
2184         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2185         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
2186         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2187         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2188         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2189         (PageLoaderClient::didStartProvisionalLoadForFrame):
2190         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2191         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
2192         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2193         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2194         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
2195         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2196
2197 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
2198
2199         Formalize WebKitAdditions mechanism of LoadOptimizer
2200         https://bugs.webkit.org/show_bug.cgi?id=193886
2201         <rdar://problem/47696809>
2202
2203         Reviewed by Brent Fulgham.
2204
2205         This patch does the following few things:
2206         1) formalizes WebKitAdditions mechanism of LoadOptimizer;
2207         2) modernizes AppLinks code in tryInterceptNavigation to use BlockPtr;
2208         3) lets AppLinks have higher precedence than LoadOptimizer.
2209
2210         * SourcesCocoa.txt:
2211         * UIProcess/Cocoa/LoadOptimizer.h: Removed.
2212         * UIProcess/Cocoa/LoadOptimizer.mm: Removed.
2213         * UIProcess/Cocoa/NavigationState.mm:
2214         (WebKit::tryOptimizingLoad):
2215         (WebKit::tryInterceptNavigation):
2216         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2217         (WebKit::WebsiteDataStore::WebsiteDataStore):
2218         * UIProcess/WebsiteData/WebsiteDataStore.h:
2219         (WebKit::WebsiteDataStore::loadOptimizer): Deleted.
2220         * WebKit.xcodeproj/project.pbxproj:
2221
2222 2019-01-31  Chris Dumez  <cdumez@apple.com>
2223
2224         Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess()
2225         https://bugs.webkit.org/show_bug.cgi?id=194094
2226         <rdar://problem/47580753>
2227
2228         Reviewed by Ryosuke Niwa.
2229
2230         If a SuspendedPageProxy gets destroyed while a WebPageProxy is waiting for its to finish to suspend,
2231         call the "failure to suspend" completion handler asynchronously instead of synchronouly to make sure
2232         the completion handler cannot try and use the suspended page proxy while it is being destroyed.
2233
2234         * UIProcess/SuspendedPageProxy.cpp:
2235         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2236
2237 2019-01-31  Timothy Hatcher  <timothy@apple.com>
2238
2239         Fix LSAppLink deprecation warnings.
2240         https://bugs.webkit.org/show_bug.cgi?id=194097
2241
2242         Unreviewed build fix.
2243
2244         * UIProcess/ios/WKActionSheetAssistant.mm:
2245         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
2246
2247 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
2248
2249         [Mac] Implement basic hit testing in the scrolling tree
2250         https://bugs.webkit.org/show_bug.cgi?id=172917
2251         <rdar://problem/34215516>
2252
2253         Reviewed by Antti Koivisto.
2254
2255         Changed return types, "using namespace WebCore" in ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
2256
2257         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2258         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2259         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2260         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h:
2261         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
2262         (WebKit::ScrollerPairMac::handleWheelEvent):
2263         (WebKit::ScrollerPairMac::handleMouseEvent):
2264         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
2265         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
2266         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
2267         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
2268
2269 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2270
2271         [SOUP] Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to NetworkSession
2272         https://bugs.webkit.org/show_bug.cgi?id=194075
2273
2274         Reviewed by Alex Christensen.
2275
2276         Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to
2277         NetworkSession to reduce globals. This removes two of the six soup-specific variables in
2278         NetworkProcessCreationParameters
2279
2280         * NetworkProcess/Cookies/WebCookieManager.h:
2281         * NetworkProcess/Cookies/WebCookieManager.messages.in:
2282         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2283         (WebKit::WebCookieManager::setCookiePersistentStorage):
2284         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2285         (WebKit::NetworkProcessCreationParameters::encode const):
2286         (WebKit::NetworkProcessCreationParameters::decode):
2287         * NetworkProcess/NetworkProcessCreationParameters.h:
2288         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2289         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2290         (WebKit::NetworkSessionCreationParameters::encode const):
2291         (WebKit::NetworkSessionCreationParameters::decode):
2292         * NetworkProcess/NetworkSessionCreationParameters.h:
2293         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2294         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2295         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2296         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
2297         * SourcesGTK.txt:
2298         * SourcesWPE.txt:
2299         * UIProcess/API/glib/WebKitCookieManager.cpp:
2300         (webkit_cookie_manager_set_persistent_storage):
2301         * UIProcess/WebCookieManagerProxy.cpp:
2302         (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
2303         * UIProcess/WebCookieManagerProxy.h:
2304         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2305         (WebKit::WebsiteDataStore::parameters):
2306         * UIProcess/WebsiteData/WebsiteDataStore.h:
2307         * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
2308         (WebKit::WebsiteDataStore::platformSetNetworkParameters):
2309         (WebKit::WebsiteDataStore::platformSetParameters): Deleted.
2310         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
2311         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
2312         (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
2313         * UIProcess/soup/WebProcessPoolSoup.cpp:
2314         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2315
2316 2019-01-31  Ryosuke Niwa  <rniwa@webkit.org>
2317
2318         iOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture
2319         https://bugs.webkit.org/show_bug.cgi?id=194083
2320
2321         Reviewed by Tim Horton.
2322
2323         We think this crash is a regression from r236966. Prior to r236966, we could only called
2324         removeSwipeSnapshot() only when m_provisionalOrSameDocumentLoadCallback was set but now
2325         we can call it either when m_snapshotRemovalTracker::start was called, or it had been reset.
2326         This can result in m_webPageProxyForBackForwardListForCurrentSwipe getting cleared before
2327         InteractiveUpdateHandler is called by UIGestureRecognizer, resulting in the crash.
2328
2329         This patch tries to restore the behavior prior to r236966 by only invoking removeSwipeSnapshot()
2330         when SnapshotRemovalTracker has a valid removal callback set.
2331
2332         Unfortunately no new tests since there is no reproducible test case, and neither API tests
2333         nor layout tests seem to have the capability to trigger swipe gestures via UIGestureRecognizer,
2334         which is required for this crash to occur. Notably, back-forward swipe tests I enabled in
2335         r240765 bypass UIKit and emulates the action instead.
2336
2337         * UIProcess/Cocoa/ViewGestureController.cpp:
2338         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
2339         * UIProcess/Cocoa/ViewGestureController.h:
2340         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
2341
2342 2019-01-30  Benjamin Poulain  <benjamin@webkit.org>
2343
2344         <rdar://problem/47570443> Responsiveness timers are too expensive for frequent events
2345         https://bugs.webkit.org/show_bug.cgi?id=194003
2346
2347         Reviewed by Geoffrey Garen.
2348
2349         The problem here is specific to wheel events.
2350
2351         For every wheel event, we start a responsiveness timer and send
2352         a ping to the WebProcess. When the WebProcess respond, we stop the timer.
2353
2354         The cost of setting up the timers adds up since we get many events.
2355
2356         The first step to improve the situation was to switch ResponsivenessTimer
2357         to WebCore::Timer. Since WebCore::Timer reuse the same CFRunLoopTimerRef,
2358         we save the allocation/deallocation, insertion in the event loop, etc.
2359
2360         Using WebCore::Timer saves some instructions but we were still hitting
2361         the kernel at 120hz to set up then kill each timer.
2362         The second improvement of the patch is to avoid that by not killing the timer
2363         when we hear back from the WebProcess.
2364
2365         Instead of killing the timer, we let it run and ignore the result.
2366         When the next event comes, we reschedule the existing timer.
2367         This brings down the timers to 60Hz, the same rate as the events.
2368
2369         The very last event does time out. In that case, we have a bad idle wake up:
2370         we wake up a sleeping CPU do do nothing.
2371         In the case of wheel events, this is fine since we saved a bunch of CPU already.
2372         For all the other cases, I kept the normal operating mode to avoid the idle wake.
2373
2374         * UIProcess/ResponsivenessTimer.cpp:
2375         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
2376         (WebKit::ResponsivenessTimer::invalidate):
2377         (WebKit::ResponsivenessTimer::timerFired):
2378         (WebKit::ResponsivenessTimer::start):
2379         (WebKit::ResponsivenessTimer::startWithLazyStop):
2380         (WebKit::ResponsivenessTimer::stop):
2381         (WebKit::ResponsivenessTimer::processTerminated):
2382         (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
2383         * UIProcess/ResponsivenessTimer.h:
2384         * UIProcess/WebPageProxy.cpp:
2385         (WebKit::WebPageProxy::sendWheelEvent):
2386         * UIProcess/WebProcessProxy.cpp:
2387         (WebKit::WebProcessProxy::isResponsiveWithLazyStop):
2388         * UIProcess/WebProcessProxy.h:
2389
2390 2019-01-30  Daniel Bates  <dabates@apple.com>
2391
2392         [iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard on support.apple.com
2393         https://bugs.webkit.org/show_bug.cgi?id=193987
2394         <rdar://problem/47230785>
2395
2396         Reviewed by Tim Horton.
2397
2398         It is unnecessary to relinquish first responder status when a user explicitly dismissing
2399         the keyboard. Moreover, doing so prevents key commands from being intercepted when a
2400         hardware keyboard is subsequently attached.
2401         
2402         Following r238635 a page becomes focused (accepting of keyboard input) and defocused
2403         when the WKContentView becomes first responder and resigns first responder, respectively.
2404         When a user explicitly dismisses the keyboard by tapping Done (iPhone) or the hide keyboard
2405         button (iPad) then UIKit tells WKContentView to resign its first responder status only
2406         to make its superview, WKWebView, first responder. When a person subsequently taps on the
2407         page again, the WKContentView requests to become the first responder. However changes to
2408         page focus are not guaranteed to be sent to the WebProcess immediately (WebPageProxy::activityStateDidChange()
2409         will schedule an update). In particular, they are not guaranteed to be sent before the
2410         WebProcess is told about a tap. Therefore, the WebProcess has out-of-date information on
2411         focus state of the page. Instead we should detect when WKWebView is being asked to resign
2412         as a result of the keyboard dismissal and refuse the request, taking care to end the current
2413         editing session, blur the focused element, and dismiss the on-screen keyboard.
2414
2415         * Platform/spi/ios/UIKitSPI.h: Expose some SPI.
2416         * UIProcess/ios/WKContentViewInteraction.h:
2417         * UIProcess/ios/WKContentViewInteraction.mm:
2418         (-[WKContentView setupInteraction]): Register to receive notifications whenever a user
2419         explicitly dismisses the keyboard.
2420         (-[WKContentView resignFirstResponderForWebView]): If we are being asked to resign as a
2421         result of a user explicitly dismissing the keyboard then refuse to resign.
2422         (-[WKContentView _keyboardDidRequestDismissal:]): Update state, if applicable.
2423
2424 2019-01-30  Keith Rollin  <krollin@apple.com>
2425
2426         Add default constructor for NetworkActivityTracker
2427         https://bugs.webkit.org/show_bug.cgi?id=194058
2428         <rdar://problem/47685457>
2429
2430         Reviewed by Chris Dumez.
2431
2432         ResourceNetworkActivityTracker has a default constructor. It also has
2433         a NetworkActivityTracker data member, which does not have a default
2434         constructor. This will cause some compilers to complain -- they can't
2435         default-create a ResourceNetworkActivityTracker because they can't
2436         default-create its data members. Address this by adding a default
2437         constructor for NetworkActivityTracker.
2438
2439         * NetworkProcess/NetworkActivityTracker.h:
2440
2441 2019-01-30  Daniel Steffen  <dsteffen@apple.com>
2442
2443         <rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers
2444         https://bugs.webkit.org/show_bug.cgi?id=193992
2445
2446         Reviewed by Geoffrey Garen.
2447
2448         The denap SPI is deprecated.
2449         The new way of staying out of AppNap is through a voucher.
2450
2451         * Platform/IPC/mac/ConnectionMac.mm:
2452         (IPC::readFromMachPort):
2453         * Platform/IPC/mac/ImportanceAssertion.h:
2454         (IPC::ImportanceAssertion::ImportanceAssertion):
2455         (IPC::ImportanceAssertion::~ImportanceAssertion):
2456
2457 2019-01-30  Chris Dumez  <cdumez@apple.com>
2458
2459         Fix crashes when trying to ref the CallbackAggregator in NetworkProcess
2460         https://bugs.webkit.org/show_bug.cgi?id=194054
2461
2462         Reviewed by Brent Fulgham.
2463
2464         The callback aggregators should be ThreadSafeRefCounted since they are passed to other threads.
2465
2466         * NetworkProcess/NetworkProcess.cpp:
2467         (WebKit::NetworkProcess::fetchWebsiteData):
2468         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
2469         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
2470
2471 2019-01-30  Daniel Bates  <dabates@apple.com>
2472
2473         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
2474         https://bugs.webkit.org/show_bug.cgi?id=192824
2475         <rdar://problem/47100332>
2476
2477         Reviewed by Wenson Hsieh.
2478
2479         Use the same code path for key events to editable elements and non-editable elements.
2480
2481         Currently we have different code paths for hardware key events depending on whether the active element
2482         is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
2483         presses this differentiation was a necessary workaround for UIKit's event processing precedence of
2484         interpreting key events for system text editing commands and app commands before dispatching unhandled
2485         key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
2486         WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
2487         is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
2488         empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
2489         that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
2490
2491         As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
2492         key events use the same code path.
2493
2494         * UIProcess/ios/WKContentViewInteraction.h:
2495         * UIProcess/ios/WKContentViewInteraction.mm:
2496         (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
2497         (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
2498         when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
2499         keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
2500         element (by returning NO in -_requiresKeyboardWhenFirstResponder).
2501         (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
2502         so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
2503         hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
2504         automatic keyboard UI.
2505         (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
2506         now that we require a keyboard when first responder even if the focused element is non-editable.
2507         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
2508         as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
2509         its chance to interpret the UIEvent, we intercepted, for app key commands.
2510         (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
2511         (e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
2512         responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
2513         no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
2514         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2515         (-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
2516         type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
2517         editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
2518         editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
2519         when the popover is presented.
2520
2521 2019-01-30  Per Arne Vollan  <pvollan@apple.com>
2522
2523         [macOS] Sandbox fails to compile on 10.12
2524         https://bugs.webkit.org/show_bug.cgi?id=194035
2525         <rdar://problem/47651260>
2526
2527         Reviewed by Brent Fulgham.
2528
2529         This was caused by the commit <https://trac.webkit.org/changeset/239994>, which is only valid for
2530         10.14 and later.
2531
2532         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2533         * WebProcess/com.apple.WebProcess.sb.in:
2534
2535 2019-01-29  Conrad Shultz  <conrad_shultz@apple.com>
2536
2537         Ensure image picker sourceType is set before cameraDevice
2538         https://bugs.webkit.org/show_bug.cgi?id=193998
2539
2540         Reviewed by Beth Dakin.
2541
2542         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2543         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
2544
2545 2019-01-30  Chris Dumez  <cdumez@apple.com>
2546
2547         Regression(PSON) Load hang can occur on history navigation
2548         https://bugs.webkit.org/show_bug.cgi?id=194030
2549         <rdar://problem/47656939>
2550
2551         Reviewed by Antti Koivisto.
2552
2553         We do not support having more than one WebPage in a WebProcess with the same page ID. As a result,
2554         if we decide to reuse an existing process on process-swap, we need to make sure that we either use
2555         its suspended page (when possible, meaning that it is for the right HistoryItem / page) or we need
2556         make sure we drop the existing suspended page for this process / pagePID combination, so that the
2557         WebPage on WebProcess side gets closed before we attempt to do the new load.
2558
2559         We were doing this correctly in 2 places in WebProcessPool::processForNavigationInternal() but failed
2560         to do so in a third place, when doing back to a HistoryItem which does not have a SuspendedPage but
2561         whose process is still alive (presumably because it is kept alive by another suspended page). This
2562         patch fixes this third place to remove any suspended page in the process for the current page before
2563         reusing the process. An assertion was also added to the call site in
2564         WebPageProxy::receivedNavigationPolicyDecision() to make sure we catch this more easily in the
2565         future.
2566
2567         * UIProcess/WebPageProxy.cpp:
2568         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2569         * UIProcess/WebProcessPool.cpp:
2570         (WebKit::WebProcessPool::processForNavigationInternal):
2571         (WebKit::WebProcessPool::removeAllSuspendedPagesForPage):
2572         (WebKit::WebProcessPool::hasSuspendedPageFor const):
2573         * UIProcess/WebProcessPool.h:
2574
2575 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2576
2577         [GTK][Wayland] REGRESSION(r240712): Clear the GL context if it's the current one on dispose
2578         https://bugs.webkit.org/show_bug.cgi?id=194024
2579
2580         Reviewed by Michael Catanzaro.
2581
2582         Fixes a crash in gdk_gl_context_dispose().
2583
2584         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2585         (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
2586
2587 2019-01-30  Antti Koivisto  <antti@apple.com>
2588
2589         Crash in WebKit::RemoteLayerTreePropertyApplier::updateChildren
2590         https://bugs.webkit.org/show_bug.cgi?id=193897
2591         <rdar://problem/47427750>
2592
2593         Reviewed by Simon Fraser.
2594
2595         There has been some null pointer crashes where we fail to find a remote layer tree node that matches
2596         the transaction properties.
2597
2598         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
2599         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
2600
2601         Null check the nodes.
2602
2603 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
2604
2605         Add some basic geometry information to the scrolling tree
2606         https://bugs.webkit.org/show_bug.cgi?id=194002
2607
2608         Reviewed by Antti Koivisto.
2609
2610         Add a comment explaining why we don't need to encode/decode ParentRelativeScrollableRect.
2611
2612         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2613         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
2614
2615 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2616
2617         [GTK] gdk_cairo_draw_from_gl() in AcceleratedBackingStoreWayland fails in GtkInspector's magnifier
2618         https://bugs.webkit.org/show_bug.cgi?id=193903
2619
2620         Reviewed by Michael Catanzaro.
2621
2622         The problem is that the GL context used by WaylandCompositor can't share resources with the one used by GTK+
2623         when painting with gdk_cairo_draw_from_gl(). Accelerated compositing in Wayland works only because
2624         WaylandCompositor makes the context current only once on initialization. So, when we render the first frame on
2625         accelerated compositing mode, GTK+ is rendering in non-GL mode, and switches to the GL mode when
2626         gdk_cairo_draw_from_gl() is called. Since GTK+ didn't have a GL context yet, the first frame is always rendered
2627         by GTK+ using the software fallback (glReadPixels). The thing is that the first time gdk_cairo_draw_from_gl() is
2628         called, GTK+ creates a GL context for painting that is made current, and it will remain the current one
2629         forever. The first frame fails to render with "GL_INVALID_OPERATION in glBindTexture(non-gen name)" because the
2630         texture created in WaylandCompositor GL context can't be accessed from GTK+ GL context. The following frames are
2631         handled with the GTK+ GL context. I would say this works by casuality and it could be the cause of other
2632         accelerated compositing issues in Wayland.
2633
2634         We need to create our own GdkGLContext for the WebView, and use that in the WaylandCompositor. When the
2635         GdkGLContext is created, the GTK+ GL context for painting is used as a shared context, ensuring that resources
2636         created in the new context will be accessible from the painting one.
2637
2638         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2639         (webkitWebViewBaseMakeGLContextCurrent): Call AcceleratedBackingStore::makeContextCurrent().
2640         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
2641         * UIProcess/WebPageProxy.h:
2642         * UIProcess/gtk/AcceleratedBackingStore.h:
2643         (WebKit::AcceleratedBackingStore::makeContextCurrent): New virtual method only implemented by Wayland backend.
2644         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2645         (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Try to create a GL context with
2646         gdk_window_create_gl_context(), falling back to a WebCore::GLContext if it fails or GTK+ version is not new enough.
2647         (WebKit::AcceleratedBackingStoreWayland::makeContextCurrent): Make the GL context current.
2648         (WebKit::AcceleratedBackingStoreWayland::paint): Check if we have a GdkGLContext before trying to use gdk_cairo_draw_from_gl().
2649         (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL const): Deleted.
2650         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
2651         * UIProcess/gtk/WaylandCompositor.cpp:
2652         (WebKit::WaylandCompositor::Surface::Surface): Move the texture creation to setWebPage(), since we need the
2653         WebView GL context.
2654         (WebKit::WaylandCompositor::Surface::~Surface): Move the code to destroy GL resources to setWebPage().
2655         (WebKit::WaylandCompositor::Surface::setWebPage): Create the texture when a new page is set and destroy GL
2656         resources when unset.
2657         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): Make WebView GL context current.
2658         (WebKit::WaylandCompositor::Surface::commit): Ditto.
2659         (WebKit::WaylandCompositor::initializeEGL): Use a temporary GLContext.
2660         * UIProcess/gtk/WaylandCompositor.h:
2661         * UIProcess/gtk/WebPageProxyGtk.cpp:
2662         (WebKit::WebPageProxy::makeGLContextCurrent): Call webkitWebViewBaseMakeGLContextCurrent().
2663
2664 2019-01-29  Ryosuke Niwa  <rniwa@webkit.org>
2665
2666         iOS: Nullptr crash in WebPage::getPositionInformation dereferencing an input element for data list
2667         https://bugs.webkit.org/show_bug.cgi?id=193996
2668
2669         Reviewed by Wenson Hsieh.
2670
2671         Added a missing nullptr check.
2672
2673         * WebProcess/WebPage/ios/WebPageIOS.mm:
2674         (WebKit::WebPage::getPositionInformation):
2675
2676 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
2677
2678         Add nodes to the scrolling tree in z-index order.
2679         https://bugs.webkit.org/show_bug.cgi?id=192529
2680         <rdar://problem/47402708>
2681
2682         Reviewed by Dean Jackson.
2683
2684         FrameHosting nodes have layers, so need to update them.
2685
2686         * Platform/Logging.cpp:
2687         (WebKit::initializeLogChannelsIfNecessary):
2688         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2689         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2690
2691 2019-01-29  Alex Christensen  <achristensen@webkit.org>
2692
2693         Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
2694         https://bugs.webkit.org/show_bug.cgi?id=193974
2695
2696         Reviewed by Tim Horton.
2697
2698         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2699         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
2700         (WebKit::NetworkBlobRegistry::registerBlobURL):
2701         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
2702         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
2703         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
2704         (WebKit::NetworkBlobRegistry::blobSize):
2705         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
2706         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2707         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2708         (WebKit::NetworkConnectionToWebProcess::didClose):
2709         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
2710         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2711         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
2712         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
2713         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
2714         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
2715         (WebKit::NetworkConnectionToWebProcess::blobSize):
2716         * NetworkProcess/NetworkProcess.cpp:
2717         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
2718         * NetworkProcess/NetworkProcess.h:
2719
2720 2019-01-29  Youenn Fablet  <youenn@apple.com>
2721
2722         Adopt new SPI to evaluate server certificate trust
2723         https://bugs.webkit.org/show_bug.cgi?id=193355
2724
2725         Reviewed by Alex Christensen.
2726
2727         Use new SPI provided in NSURLSession to evaluate server certificates.
2728         If successful, let loading proceed as usual.
2729         Otherwise, go to the UIProcess to ask for a decision on continuing the load or not.
2730
2731         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2732         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2733         (canNSURLSessionTrustEvaluate):
2734         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2735         (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
2736
2737 2019-01-29  Tim Horton  <timothy_horton@apple.com>
2738
2739         Fix the build
2740
2741         * UIProcess/ios/WKDrawingCoordinator.h:
2742         * UIProcess/ios/WKDrawingCoordinator.mm:
2743         * UIProcess/ios/WKDrawingView.mm:
2744
2745 2019-01-29  Alex Christensen  <achristensen@webkit.org>
2746
2747         Remove unused NetworkProcessProxy::writeBlobToFilePath
2748         https://bugs.webkit.org/show_bug.cgi?id=193990
2749
2750         Reviewed by Wenson Hsieh.
2751
2752         This code was only used in code that was introduced in r235202
2753         but that has since been refactored to not use blobs.  Its tests still pass.
2754         This removes the only UIProcess-controlled code that uses NetworkBlobRegistry::singleton.
2755
2756         * NetworkProcess/NetworkProcess.cpp:
2757         (WebKit::NetworkProcess::writeBlobToFilePath): Deleted.
2758         * NetworkProcess/NetworkProcess.h:
2759         * NetworkProcess/NetworkProcess.messages.in:
2760         * UIProcess/Cocoa/WebViewImpl.mm:
2761         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
2762         * UIProcess/Network/NetworkProcessProxy.cpp:
2763         (WebKit::NetworkProcessProxy::writeBlobToFilePath): Deleted.
2764         * UIProcess/Network/NetworkProcessProxy.h:
2765         * UIProcess/WebPageProxy.cpp:
2766         (WebKit::WebPageProxy::writeBlobToFilePath): Deleted.
2767         * UIProcess/WebPageProxy.h:
2768
2769 2019-01-29  Devin Rousso  <drousso@apple.com>
2770
2771         Web Inspector: expose a way of determining if a detached frontend is for a remote target
2772         https://bugs.webkit.org/show_bug.cgi?id=193951
2773         <rdar://problem/47621366>
2774
2775         Reviewed by Joseph Pecoraro.
2776
2777         * UIProcess/WebInspectorProxy.h:
2778         (WebKit::WebInspectorProxy::InspectionTargetType): Added.
2779         (WebKit::WebInspectorProxy::createFrontendWindow):
2780         * UIProcess/mac/WebInspectorProxyMac.mm:
2781         (WebKit::WebInspectorProxy::createFrontendWindow):
2782         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
2783         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
2784         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
2785
2786         * UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
2787         * UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.
2788         (-[WKInspectorWindow isRemote]): Added.
2789
2790         * Shared/API/Cocoa/_WKNSWindowExtras.mm:
2791         (-[NSWindow _web_isWebInspectorWindow]):
2792
2793         * PlatformMac.cmake:
2794         * SourcesCocoa.txt:
2795         * UnifiedSources-input.xcfilelist:
2796         * WebKit.xcodeproj/project.pbxproj:
2797
2798 2019-01-29  Alex Christensen  <achristensen@webkit.org>
2799
2800         Rename ChildProcess to AuxiliaryProcess
2801         https://bugs.webkit.org/show_bug.cgi?id=193943
2802
2803         Reviewed by Andy Estes.
2804
2805         "Child" implies that there is a parent, but I'm about to introduce a type of NetworkProcess that
2806         doesn't always have a parent, and may have many UIProcesses that it is the auxiliary for.
2807
2808         * CMakeLists.txt:
2809         * DerivedSources-input.xcfilelist:
2810         * DerivedSources-output.xcfilelist:
2811         * DerivedSources.make:
2812         * NetworkProcess/Cookies/WebCookieManager.cpp:
2813         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2814         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2815         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
2816         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
2817         * NetworkProcess/NetworkProcess.cpp:
2818         (WebKit::callExitSoon):
2819         (WebKit::NetworkProcess::NetworkProcess):
2820         (WebKit::NetworkProcess::didReceiveMessage):
2821         (WebKit::NetworkProcess::initializeConnection):
2822         (WebKit::NetworkProcess::terminate):
2823         (WebKit::NetworkProcess::initializeProcess):
2824         (WebKit::NetworkProcess::initializeProcessName):
2825         (WebKit::NetworkProcess::initializeSandbox):
2826         * NetworkProcess/NetworkProcess.h:
2827         * NetworkProcess/NetworkProcessSupplement.h:
2828         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2829         (WebKit::NetworkCache::Storage::deleteOldVersions):
2830         * NetworkProcess/ios/NetworkProcessIOS.mm:
2831         (WebKit::NetworkProcess::initializeProcess):
2832         (WebKit::NetworkProcess::initializeProcessName):
2833         (WebKit::NetworkProcess::initializeSandbox):
2834         * NetworkProcess/mac/NetworkProcessMac.mm:
2835         (WebKit::NetworkProcess::initializeProcess):
2836         (WebKit::NetworkProcess::initializeProcessName):
2837         (WebKit::NetworkProcess::initializeSandbox):
2838         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
2839         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
2840         (WebKit::NetworkProcessMainUnix):
2841         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
2842         * NetworkProcess/watchos/NetworkProximityManager.h:
2843         * NetworkProcess/watchos/NetworkProximityManager.mm:
2844         (WebKit::NetworkProximityManager::NetworkProximityManager):
2845         * NetworkProcess/win/NetworkProcessMainWin.cpp:
2846         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
2847         (WebKit::NetworkProcessMainWin):
2848         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
2849         * PlatformGTK.cmake:
2850         * PlatformMac.cmake:
2851         * PlatformWin.cmake:
2852         * PluginProcess/PluginProcess.cpp:
2853         (WebKit::PluginProcess::initializeProcess):
2854         (WebKit::PluginProcess::initializeConnection):
2855         (WebKit::PluginProcess::didReceiveMessage):
2856         (WebKit::PluginProcess::initializeProcessName):
2857         (WebKit::PluginProcess::initializeSandbox):
2858         * PluginProcess/PluginProcess.h:
2859         * PluginProcess/mac/PluginProcessMac.mm:
2860         (WebKit::PluginProcess::platformInitializeProcess):
2861         (WebKit::PluginProcess::initializeProcessName):
2862         (WebKit::PluginProcess::initializeSandbox):
2863         (WebKit::PluginProcess::stopRunLoop):
2864         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2865         (WebKit::PluginProcessMainUnix):
2866         * PluginProcess/unix/PluginProcessUnix.cpp:
2867         (WebKit::PluginProcess::platformInitializeProcess):
2868         * Shared/Authentication/AuthenticationManager.cpp:
2869         (WebKit::AuthenticationManager::AuthenticationManager):
2870         * Shared/Authentication/AuthenticationManager.h:
2871         * Shared/AuxiliaryProcess.cpp: Copied from Source/WebKit/Shared/ChildProcess.cpp.
2872         (WebKit::AuxiliaryProcess::AuxiliaryProcess):
2873         (WebKit::AuxiliaryProcess::~AuxiliaryProcess):
2874         (WebKit::AuxiliaryProcess::didClose):
2875         (WebKit::AuxiliaryProcess::initialize):
2876         (WebKit::AuxiliaryProcess::setProcessSuppressionEnabled):
2877         (WebKit::AuxiliaryProcess::initializeProcess):
2878         (WebKit::AuxiliaryProcess::initializeProcessName):
2879         (WebKit::AuxiliaryProcess::initializeConnection):
2880         (WebKit::AuxiliaryProcess::addMessageReceiver):
2881         (WebKit::AuxiliaryProcess::removeMessageReceiver):
2882         (WebKit::AuxiliaryProcess::disableTermination):
2883         (WebKit::AuxiliaryProcess::enableTermination):
2884         (WebKit::AuxiliaryProcess::messageSenderConnection):
2885         (WebKit::AuxiliaryProcess::messageSenderDestinationID):
2886         (WebKit::AuxiliaryProcess::terminationTimerFired):
2887         (WebKit::AuxiliaryProcess::stopRunLoop):
2888         (WebKit::AuxiliaryProcess::platformStopRunLoop):
2889         (WebKit::AuxiliaryProcess::terminate):
2890         (WebKit::AuxiliaryProcess::shutDown):
2891         (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
2892         (WebKit::AuxiliaryProcess::platformInitialize):
2893         (WebKit::AuxiliaryProcess::initializeSandbox):
2894         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
2895         (WebKit::AuxiliaryProcess::didReceiveMemoryPressureEvent):
2896         (WebKit::ChildProcess::ChildProcess): Deleted.
2897         (WebKit::ChildProcess::~ChildProcess): Deleted.
2898         (WebKit::ChildProcess::didClose): Deleted.
2899         (WebKit::ChildProcess::initialize): Deleted.
2900         (WebKit::ChildProcess::setProcessSuppressionEnabled): Deleted.
2901         (WebKit::ChildProcess::initializeProcess): Deleted.
2902         (WebKit::ChildProcess::initializeProcessName): Deleted.
2903         (WebKit::ChildProcess::initializeConnection): Deleted.
2904         (WebKit::ChildProcess::addMessageReceiver): Deleted.
2905         (WebKit::ChildProcess::removeMessageReceiver): Deleted.
2906         (WebKit::ChildProcess::disableTermination): Deleted.
2907         (WebKit::ChildProcess::enableTermination): Deleted.
2908         (WebKit::ChildProcess::messageSenderConnection): Deleted.
2909         (WebKit::ChildProcess::messageSenderDestinationID): Deleted.
2910         (WebKit::ChildProcess::terminationTimerFired): Deleted.
2911         (WebKit::ChildProcess::stopRunLoop): Deleted.
2912         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
2913         (WebKit::ChildProcess::terminate): Deleted.
2914         (WebKit::ChildProcess::shutDown): Deleted.
2915         (WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted.
2916         (WebKit::ChildProcess::platformInitialize): Deleted.
2917         (WebKit::ChildProcess::initializeSandbox): Deleted.
2918         (WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
2919         (WebKit::ChildProcess::didReceiveMemoryPressureEvent): Deleted.
2920         * Shared/AuxiliaryProcess.h: Copied from Source/WebKit/Shared/ChildProcess.h.
2921         (WebKit::ChildProcess::parentProcessConnection const): Deleted.
2922         (WebKit::ChildProcess::messageReceiverMap): Deleted.
2923         (WebKit::ChildProcess::setTerminationTimeout): Deleted.
2924         (WebKit::ChildProcess::shouldOverrideQuarantine): Deleted.
2925         * Shared/AuxiliaryProcess.messages.in: Copied from Source/WebKit/Shared/ChildProcess.messages.in.
2926         * Shared/AuxiliaryProcessSupplement.h: Copied from Source/WebKit/Shared/ChildProcessSupplement.h.
2927         (WebKit::AuxiliaryProcessSupplement::~AuxiliaryProcessSupplement):
2928         (WebKit::ChildProcessSupplement::~ChildProcessSupplement): Deleted.
2929         (WebKit::ChildProcessSupplement::initializeConnection): Deleted.
2930         * Shared/ChildProcess.cpp: Removed.
2931         * Shared/ChildProcess.h: Removed.
2932         * Shared/ChildProcess.messages.in: Removed.
2933         * Shared/ChildProcessSupplement.h: Removed.
2934         * Shared/Cocoa/AuxiliaryProcessCocoa.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
2935         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
2936         (WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
2937         * Shared/Cocoa/ChildProcessCocoa.mm: Removed.
2938         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2939         (WebKit::initializeAuxiliaryProcess):
2940         (WebKit::XPCServiceInitializer):
2941         (WebKit::initializeChildProcess): Deleted.
2942         * Shared/WebSQLiteDatabaseTracker.cpp:
2943         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2944         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2945         (WebKit::m_childProcessType): Deleted.
2946         * Shared/WebSQLiteDatabaseTracker.h:
2947         * Shared/ios/AuxiliaryProcessIOS.mm: Copied from Source/WebKit/Shared/ios/ChildProcessIOS.mm.
2948         (WebKit::AuxiliaryProcess::platformInitialize):
2949         (WebKit::AuxiliaryProcess::initializeSandbox):
2950         (WebKit::AuxiliaryProcess::setQOS):
2951         (WebKit::AuxiliaryProcess::platformStopRunLoop):
2952         (WebKit::ChildProcess::platformInitialize): Deleted.
2953         (WebKit::ChildProcess::initializeSandbox): Deleted.
2954         (WebKit::ChildProcess::setQOS): Deleted.
2955         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
2956         * Shared/ios/ChildProcessIOS.mm: Removed.
2957         * Shared/mac/AuxiliaryProcessMac.mm: Copied from Source/WebKit/Shared/mac/ChildProcessMac.mm.
2958         (WebKit::SandboxInfo::SandboxInfo):
2959         (WebKit::AuxiliaryProcess::launchServicesCheckIn):
2960         (WebKit::AuxiliaryProcess::platformInitialize):
2961         (WebKit::processStorageClass):
2962         (WebKit::sandboxDirectory):
2963         (WebKit::applySandbox):
2964         (WebKit::initializeSandboxParameters):
2965         (WebKit::AuxiliaryProcess::initializeSandbox):
2966         (WebKit::AuxiliaryProcess::stopNSAppRunLoop):
2967         (WebKit::AuxiliaryProcess::stopNSRunLoop):
2968         (WebKit::AuxiliaryProcess::platformStopRunLoop):
2969         (WebKit::AuxiliaryProcess::setQOS):
2970         (WebKit::AuxiliaryProcess::isSystemWebKit):
2971         (WebKit::ChildProcess::launchServicesCheckIn): Deleted.
2972         (WebKit::ChildProcess::platformInitialize): Deleted.
2973         (WebKit::ChildProcess::initializeSandbox): Deleted.
2974         (WebKit::ChildProcess::stopNSAppRunLoop): Deleted.
2975         (WebKit::ChildProcess::stopNSRunLoop): Deleted.
2976         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
2977         (WebKit::ChildProcess::setQOS): Deleted.
2978         (WebKit::ChildProcess::isSystemWebKit): Deleted.
2979         * Shared/mac/ChildProcessMac.mm: Removed.
2980         * Shared/mac/SecItemShim.cpp:
2981         (WebKit::globalNetworkProcess):
2982         (WebKit::sendSecItemRequest):
2983         (WebKit::initializeSecItemShim):
2984         * Shared/mac/SecItemShim.h:
2985         * Shared/unix/AuxiliaryProcessMain.cpp: Copied from Source/WebKit/Shared/unix/ChildProcessMain.cpp.
2986         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
2987         (WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
2988         * Shared/unix/AuxiliaryProcessMain.h: Copied from Source/WebKit/Shared/unix/ChildProcessMain.h.
2989         (WebKit::AuxiliaryProcessMainBase::takeInitializationParameters):
2990         (WebKit::initializeAuxiliaryProcess):
2991         (WebKit::AuxiliaryProcessMain):
2992         (WebKit::ChildProcessMainBase::platformInitialize): Deleted.
2993         (WebKit::ChildProcessMainBase::platformFinalize): Deleted.
2994         (WebKit::ChildProcessMainBase::takeInitializationParameters): Deleted.
2995         (WebKit::initializeChildProcess): Deleted.
2996         (WebKit::ChildProcessMain): Deleted.
2997         * Shared/unix/ChildProcessMain.cpp: Removed.
2998         * Shared/unix/ChildProcessMain.h: Removed.
2999         * Shared/win/AuxiliaryProcessMainWin.cpp: Copied from Source/WebKit/Shared/win/ChildProcessMainWin.cpp.
3000         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
3001         (WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
3002         * Shared/win/ChildProcessMainWin.cpp: Removed.
3003         * Sources.txt:
3004         * SourcesCocoa.txt:
3005         * SourcesGTK.txt:
3006         * SourcesWPE.txt:
3007         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
3008         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
3009         * UIProcess/AuxiliaryProcessProxy.cpp: Copied from Source/WebKit/UIProcess/ChildProcessProxy.cpp.
3010         (WebKit::AuxiliaryProcessProxy::AuxiliaryProcessProxy):
3011         (WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
3012         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
3013         (WebKit::AuxiliaryProcessProxy::connect):
3014         (WebKit::AuxiliaryProcessProxy::terminate):
3015         (WebKit::AuxiliaryProcessProxy::state const):
3016         (WebKit::AuxiliaryProcessProxy::sendMessage):
3017         (WebKit::AuxiliaryProcessProxy::addMessageReceiver):
3018         (WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
3019         (WebKit::AuxiliaryProcessProxy::dispatchMessage):
3020         (WebKit::AuxiliaryProcessProxy::dispatchSyncMessage):
3021         (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
3022         (WebKit::AuxiliaryProcessProxy::shutDownProcess):
3023         (WebKit::AuxiliaryProcessProxy::setProcessSuppressionEnabled):
3024         (WebKit::AuxiliaryProcessProxy::connectionWillOpen):
3025         (WebKit::ChildProcessProxy::ChildProcessProxy): Deleted.
3026         (WebKit::ChildProcessProxy::~ChildProcessProxy): Deleted.
3027         (WebKit::ChildProcessProxy::getLaunchOptions): Deleted.
3028         (WebKit::ChildProcessProxy::connect): Deleted.
3029         (WebKit::ChildProcessProxy::terminate): Deleted.
3030         (WebKit::ChildProcessProxy::state const): Deleted.
3031         (WebKit::ChildProcessProxy::sendMessage): Deleted.
3032         (WebKit::ChildProcessProxy::addMessageReceiver): Deleted.
3033         (WebKit::ChildProcessProxy::removeMessageReceiver): Deleted.
3034         (WebKit::ChildProcessProxy::dispatchMessage): Deleted.
3035         (WebKit::ChildProcessProxy::dispatchSyncMessage): Deleted.
3036         (WebKit::ChildProcessProxy::didFinishLaunching): Deleted.
3037         (WebKit::ChildProcessProxy::shutDownProcess): Deleted.
3038         (WebKit::ChildProcessProxy::setProcessSuppressionEnabled): Deleted.
3039         (WebKit::ChildProcessProxy::connectionWillOpen): Deleted.
3040         * UIProcess/AuxiliaryProcessProxy.h: Copied from Source/WebKit/UIProcess/ChildProcessProxy.h.
3041         (WebKit::AuxiliaryProcessProxy::send):
3042         (WebKit::AuxiliaryProcessProxy::sendSync):
3043         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
3044         (WebKit::ChildProcessProxy::send): Deleted.
3045         (WebKit::ChildProcessProxy::sendSync): Deleted.
3046         (WebKit::ChildProcessProxy::connection const): Deleted.
3047         (WebKit::ChildProcessProxy::hasConnection const): Deleted.
3048         (WebKit::ChildProcessProxy::processIdentifier const): Deleted.
3049         (WebKit::ChildProcessProxy::canSendMessage const): Deleted.
3050         (WebKit::ChildProcessProxy::coreProcessIdentifier const): Deleted.
3051         (WebKit::ChildProcessProxy::platformGetLaunchOptions): Deleted.
3052         (WebKit::ChildProcessProxy::sendWithAsyncReply): Deleted.
3053         * UIProcess/ChildProcessProxy.cpp: Removed.
3054         * UIProcess/ChildProcessProxy.h: Removed.
3055         * UIProcess/Downloads/DownloadProxyMap.cpp:
3056         (WebKit::DownloadProxyMap::DownloadProxyMap):
3057         * UIProcess/Downloads/DownloadProxyMap.h:
3058         * UIProcess/Network/NetworkProcessProxy.cpp:
3059         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
3060         (WebKit::NetworkProcessProxy::getLaunchOptions):
3061         (WebKit::NetworkProcessProxy::createDownloadProxy):
3062         (WebKit::NetworkProcessProxy::didFinishLaunching):
3063         * UIProcess/Network/NetworkProcessProxy.h:
3064         * UIProcess/Plugins/PluginProcessProxy.cpp:
3065         (WebKit::PluginProcessProxy::getLaunchOptions):
3066         (WebKit::PluginProcessProxy::sendMemoryPressureEvent):
3067         * UIProcess/Plugins/PluginProcessProxy.h:
3068         * UIProcess/ServiceWorkerProcessProxy.h:
3069         * UIProcess/WebPageProxy.cpp:
3070         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3071         * UIProcess/WebProcessPool.cpp:
3072         (WebKit::WebProcessPool::sendMemoryPressureEvent):
3073         (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle):
3074         * UIProcess/WebProcessProxy.cpp:
3075         (WebKit::WebProcessProxy::WebProcessProxy):
3076         (WebKit::WebProcessProxy::getLaunchOptions):
3077         (WebKit::WebProcessProxy::didFinishLaunching):
3078         (WebKit::WebProcessProxy::maybeShutDown):
3079         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
3080         (WebKit::WebProcessProxy::shouldTerminate):
3081         (WebKit::WebProcessProxy::requestTermination):
3082         (WebKit::WebProcessProxy::canTerminateChildProcess): Deleted.
3083         * UIProcess/WebProcessProxy.h:
3084         * UnifiedSources-input.xcfilelist:
3085         * WebKit.xcodeproj/project.pbxproj:
3086         * WebProcess/WebProcess.cpp:
3087         (WebKit::WebProcess::initializeProcess):
3088         (WebKit::WebProcess::initializeConnection):
3089         (WebKit::WebProcess::terminate):
3090         (WebKit::WebProcess::didReceiveMessage):
3091         (WebKit::WebProcess::initializeProcessName):
3092         (WebKit::WebProcess::initializeSandbox):
3093         (WebKit::WebProcess::platformInitializeProcess):
3094         * WebProcess/WebProcess.h:
3095         * WebProcess/WebProcessSupplement.h:
3096         * WebProcess/cocoa/WebProcessCocoa.mm:
3097         (WebKit::WebProcess::initializeProcessName):
3098         (WebKit::WebProcess::platformInitializeProcess):
3099         (WebKit::WebProcess::stopRunLoop):
3100         (WebKit::WebProcess::initializeSandbox):
3101         * WebProcess/gtk/WebProcessMainGtk.cpp:
3102         (WebKit::WebProcessMainUnix):
3103         * WebProcess/win/WebProcessMainWin.cpp:
3104         (WebKit::WebProcessMainWin):
3105         * WebProcess/wpe/WebProcessMainWPE.cpp:
3106         (WebKit::WebProcessMainUnix):
3107
3108 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
3109
3110         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
3111         https://bugs.webkit.org/show_bug.cgi?id=193907
3112
3113         Reviewed by Frédéric Wang.
3114
3115         Remove encode/decode of removedNodes.
3116
3117         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3118         (WebKit::RemoteScrollingCoordinatorTransaction::encode const):
3119         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
3120         (WebKit::dump):
3121
3122 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
3123
3124         StorageAccess API calls should be direct to the Network Process
3125         https://bugs.webkit.org/show_bug.cgi?id=193924
3126         <rdar://problem/47611249>
3127
3128         Reviewed by Alex Christensen.
3129
3130         Now that the ResourceLoadStatistics data lives in the Network Process, calls to Storage Access
3131         API should happen directly between the WebContent and Network processes.
3132
3133         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3134         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
3135         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3136         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3137         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
3138         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
3139         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
3140         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
3141         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
3142         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
3143         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
3144         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
3145         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
3146         * NetworkProcess/NetworkConnectionToWebProcess.h:
3147         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3148         * NetworkProcess/NetworkProcess.cpp:
3149         (WebKit::NetworkProcess::requestStorageAccess):
3150         (WebKit::NetworkProcess::requestStorageAccessGranted):
3151         * NetworkProcess/NetworkProcess.h:
3152         * UIProcess/Network/NetworkProcessProxy.cpp:
3153         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
3154         * UIProcess/Network/NetworkProcessProxy.h:
3155         * UIProcess/Network/NetworkProcessProxy.messages.in:
3156         * UIProcess/WebPageProxy.cpp:
3157         (WebKit::WebPageProxy::requestStorageAccessConfirm):
3158         (WebKit::WebPageProxy::hasStorageAccess): Deleted.
3159         (WebKit::WebPageProxy::requestStorageAccess): Deleted.
3160         * UIProcess/WebPageProxy.h:
3161         * UIProcess/WebPageProxy.messages.in:
3162         * WebProcess/WebPage/WebPage.cpp:
3163         (WebKit::WebPage::hasStorageAccess):
3164         (WebKit::WebPage::requestStorageAccess):
3165         (WebKit::nextRequestStorageAccessContextId): Deleted.
3166         (WebKit::WebPage::storageAccessResponse): Deleted.
3167         * WebProcess/WebPage/WebPage.h:
3168         * WebProcess/WebPage/WebPage.messages.in:
3169
3170 2019-01-29  Chris Dumez  <cdumez@apple.com>
3171
3172         Regression (r240046): [PSON] Spurious changes to [WKWebView url] and [WKWebView loading] after [WKWebView loadRequest]
3173         https://bugs.webkit.org/show_bug.cgi?id=193967
3174         <rdar://problem/47635348>
3175
3176         Reviewed by Alex Christensen.
3177
3178         Update WebPageProxy::receivedPolicyDecision() to no longer clear the pending URL when we send PolicyAction::Ignore to
3179         the old process when the load is continuing in a new process due to PSON.
3180
3181         * UIProcess/WebPageProxy.cpp:
3182         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3183         (WebKit::WebPageProxy::receivedPolicyDecision):
3184         * UIProcess/WebPageProxy.h:
3185
3186 2019-01-29  Keith Rollin  <krollin@apple.com>
3187
3188         Add .xcfilelists to Run Script build phases
3189         https://bugs.webkit.org/show_bug.cgi?id=193792
3190         <rdar://problem/47201785>
3191
3192         Reviewed by Alex Christensen.
3193
3194         As part of supporting XCBuild, update the necessary Run Script build
3195         phases in their Xcode projects to refer to their associated
3196         .xcfilelist files.
3197
3198         Note that the addition of these files bumps the Xcode project version
3199         number to something that's Xcode 10 compatible. This change means that
3200         older versions of the Xcode IDE can't read these projects. Nor can it
3201         fully load workspaces that refer to these projects (the updated
3202         projects are shown as non-expandable placeholders). `xcodebuild` can
3203         still build these projects; it's just that the IDE can't open them.
3204
3205         Make special accommodations for incorporating .xcfilelists from
3206         WebKitAdditions.
3207
3208         * Configurations/Base.xcconfig:
3209         * Configurations/DebugRelease.xcconfig:
3210         * WebKit.xcodeproj/project.pbxproj:
3211
3212 2019-01-29  Antti Koivisto  <antti@apple.com>
3213
3214         REGRESSION (PSON): Flash on link navigation on Mac
3215         https://bugs.webkit.org/show_bug.cgi?id=193961
3216         <rdar://problem/47482507>
3217
3218         Reviewed by Chris Dumez.
3219
3220         The target page sends EnterAcceleratedCompositingMode message too early, before we have a valid layer tree.
3221
3222         * WebProcess/WebPage/DrawingArea.h:
3223         (WebKit::DrawingArea::attach): Deleted.
3224
3225         Not needed anymore.
3226
3227         * WebProcess/WebPage/WebPage.cpp:
3228         (WebKit::WebPage::reinitializeWebPage):
3229         (WebKit::WebPage::didCompletePageTransition):
3230         (WebKit::m_shouldAttachDrawingAreaOnPageTransition): Deleted.
3231
3232         Move message sending logic fully to TiledCoreAnimationDrawingArea.
3233         Unfreezing the layer tree is sufficient to trigger the message.
3234
3235         * WebProcess/WebPage/WebPage.h:
3236         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3237         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3238         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3239
3240         There is no need to treat process swap case differently.
3241
3242         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
3243
3244         Send this after the first successful layer flush with the root layer set.
3245
3246         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3247         (WebKit::TiledCoreAnimationDrawingArea::attach): Deleted.
3248
3249 2019-01-29  Timothy Hatcher  <timothy@apple.com>
3250
3251         Add back some includes that got removed at some point.
3252         https://bugs.webkit.org/show_bug.cgi?id=193942
3253
3254         Reviewed by Tim Horton.
3255
3256         * UIProcess/API/Cocoa/WKWebView.mm:
3257         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3258         * UIProcess/ios/PageClientImplIOS.h:
3259         * UIProcess/ios/PageClientImplIOS.mm:
3260
3261 2019-01-29  Chris Dumez  <cdumez@apple.com>
3262
3263         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
3264         https://bugs.webkit.org/show_bug.cgi?id=193848
3265
3266         Reviewed by Youenn Fablet.
3267
3268         * Platform/IPC/Connection.cpp:
3269         (IPC::Connection::Connection):
3270         * UIProcess/ChildProcessProxy.h:
3271         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3272         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
3273         * UIProcess/WebBackForwardList.cpp:
3274         (WebKit::WebBackForwardList::restoreFromState):
3275         * UIProcess/WebProcessPool.cpp:
3276         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3277         (WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
3278
3279 2019-01-29  Chris Dumez  <cdumez@apple.com>
3280
3281         REGRESSION (PSON): Twitter link gets stuck at t.co after navigating back in tab
3282         https://bugs.webkit.org/show_bug.cgi?id=193932
3283         <rdar://problem/47598947>
3284
3285         Reviewed by Brady Eidson.
3286
3287         When doing a client side redirect from origin A to origin B, we would swap process and
3288         create a SuspendedPageProxy and save it on the source BackForwardListItem. The issue is
3289         that the BackForwardList is locked for such redirect so we end up updating the current
3290         BackForwardListItem with origin B's URL while origin A's suspended page remained on
3291         the item. When going to another URL in the same origin A, we would not create a suspended
3292         page since no process-swap would occur. When pressing the back button, we would go back
3293         to the previous BackForwardListItem and use its SuspendedPageProxy, which is for the
3294         wrong URL (The pre-client redirect one).
3295
3296         To address the issue, we no longer create a SuspendedPageProxy for cross-site client side
3297         redirects. There will be no way no go back to this suspended page anyway since the
3298         back/forward list item will be updated with the redirection URL.
3299
3300         * UIProcess/WebPageProxy.cpp:
3301         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
3302
3303 2019-01-29  Chris Dumez  <cdumez@apple.com>
3304
3305         Regression(r240046) VoiceOver is no longer working after a process swap
3306         https://bugs.webkit.org/show_bug.cgi?id=193953
3307         <rdar://problem/47612398>
3308
3309         Reviewed by Alex Christensen.
3310
3311         ProvisionalPageProxy used to forward the RegisterWebProcessAccessibilityToken IPC from
3312         the provisional WebProcess to the WebPageProxy right away. This in turn would notify
3313         the PageClient whose logic would rely on WebPageProxy::process(), which returns the
3314         committed process instead of the provisional one.
3315
3316         To address the issue, the ProvisionalPageProxy now stores the token sent by the
3317         provisional WebProcess and we only call registerWebProcessAccessibilityToken()
3318         on the WebPageProxy *after* we've swapped to the provisional process.
3319
3320         * UIProcess/ProvisionalPageProxy.cpp:
3321         (WebKit::ProvisionalPageProxy::registerWebProcessAccessibilityToken):
3322         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3323         * UIProcess/ProvisionalPageProxy.h:
3324         (WebKit::ProvisionalPageProxy::takeAccessibilityToken):
3325         * UIProcess/WebPageProxy.cpp:
3326         (WebKit::WebPageProxy::commitProvisionalPage):
3327
3328 2019-01-28  Ryosuke Niwa  <rniwa@webkit.org>
3329
3330         User agent string override for navigator.userAgent should be site specific quirks
3331         https://bugs.webkit.org/show_bug.cgi?id=193950
3332
3333         Reviewed by Brent Fulgham.
3334
3335         Renamed the various member variables, functions, properties and selectors.
3336
3337         * Shared/WebsitePoliciesData.cpp:
3338         (WebKit::WebsitePoliciesData::encode const):
3339         (WebKit::WebsitePoliciesData::decode):
3340         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
3341         * Shared/WebsitePoliciesData.h:
3342         * UIProcess/API/APIWebsitePolicies.cpp:
3343         (API::WebsitePolicies::data):
3344         * UIProcess/API/APIWebsitePolicies.h:
3345         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3346         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3347         (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgent.
3348         (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgent.
3349
3350 2019-01-28  Commit Queue  <commit-queue@webkit.org>
3351
3352         Unreviewed, rolling out r240630.
3353         https://bugs.webkit.org/show_bug.cgi?id=193958
3354
3355         Broke Apple internal builds (Requested by rniwa on #webkit).
3356
3357         Reverted changeset:
3358
3359         "Add back some includes that got removed at some point."
3360         https://bugs.webkit.org/show_bug.cgi?id=193942
3361         https://trac.webkit.org/changeset/240630
3362
3363 2019-01-28  Devin Rousso  <drousso@apple.com>
3364
3365         Web Inspector: provide a way to edit page WebRTC settings on a remote target
3366         https://bugs.webkit.org/show_bug.cgi?id=193863
3367         <rdar://problem/47572764>
3368
3369         Reviewed by Joseph Pecoraro.
3370
3371         * Shared/WebPreferences.yaml:
3372         Add page-level settings for WebRTC preferences.
3373
3374 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
3375
3376         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
3377         https://bugs.webkit.org/show_bug.cgi?id=193941
3378
3379         Reviewed by Alex Christensen.
3380
3381         * Shared/linux/WebMemorySamplerLinux.cpp:
3382
3383 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
3384
3385         [Win] WebCore/platform/Process.h is conflicting with process.h
3386         https://bugs.webkit.org/show_bug.cgi?id=193944
3387
3388         Reviewed by Ross Kirsling.
3389
3390         * Shared/ChildProcess.h:
3391         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3392         * Shared/unix/ChildProcessMain.cpp:
3393         * UIProcess/API/APINavigation.h:
3394         * UIProcess/ChildProcessProxy.h:
3395         * UIProcess/Launcher/ProcessLauncher.h:
3396         * UIProcess/WebProcessPool.cpp:
3397         * UIProcess/WebProcessProxy.h:
3398
3399 2019-01-28  Jon Lee  <jonlee@apple.com>
3400
3401         Update Screen Capture preference
3402         https://bugs.webkit.org/show_bug.cgi?id=193947
3403         rdar://problem/47620199
3404
3405         Reviewed by Youenn Fablet.
3406
3407         * Shared/WebPreferences.yaml:
3408
3409 2019-01-28  Andy Estes  <aestes@apple.com>
3410
3411         [watchOS] Enable Parental Controls content filtering
3412         https://bugs.webkit.org/show_bug.cgi?id=193939
3413         <rdar://problem/46641912>
3414
3415         Reviewed by Ryosuke Niwa.
3416
3417         * Configurations/FeatureDefines.xcconfig:
3418
3419 2019-01-28  David Kilzer  <ddkilzer@apple.com>
3420
3421         REGRESSION (r236481): Move soft-linking of LocalAuthentication.framework out of LocalAuthenticationSoftLink.h
3422         <https://webkit.org/b/193884>
3423
3424         Reviewed by Jiewen Tan.
3425
3426         * SourcesCocoa.txt:
3427         * UnifiedSources-input.xcfilelist:
3428         * WebKit.xcodeproj/project.pbxproj: