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