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