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