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