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