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