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