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