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