Move XPCService main to a shared file calling a C function
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-02-04  Alex Christensen  <achristensen@webkit.org>
2
3         Move XPCService main to a shared file calling a C function
4         https://bugs.webkit.org/show_bug.cgi?id=194256
5
6         Reviewed by Brady Eidson.
7
8         This not only reduces a few kilobytes of duplicated binary from the XPCService executables,
9         It will allow me to introduce a new kind of executable which will need to parse argv and call a different C function.
10         This is similar to r236075 but more general.
11
12         * Shared/API/Cocoa/WKMain.h: Added.
13         * Shared/API/Cocoa/WKMain.mm: Added.
14         (WKXPCServiceMain):
15         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
16         (main):
17         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
18         (main): Deleted.
19         * SourcesCocoa.txt:
20         * WebKit.xcodeproj/project.pbxproj:
21
22 2019-02-04  Alex Christensen  <achristensen@webkit.org>
23
24         Make MessageSender functions const
25         https://bugs.webkit.org/show_bug.cgi?id=194247
26
27         Reviewed by Brady Eidson.
28
29         * NetworkProcess/Downloads/Download.cpp:
30         (WebKit::Download::messageSenderConnection const):
31         (WebKit::Download::messageSenderDestinationID const):
32         (WebKit::Download::messageSenderConnection): Deleted.
33         (WebKit::Download::messageSenderDestinationID): Deleted.
34         * NetworkProcess/Downloads/Download.h:
35         * NetworkProcess/Downloads/PendingDownload.cpp:
36         (WebKit::PendingDownload::messageSenderConnection const):
37         (WebKit::PendingDownload::messageSenderDestinationID const):
38         (WebKit::PendingDownload::messageSenderConnection): Deleted.
39         (WebKit::PendingDownload::messageSenderDestinationID): Deleted.
40         * NetworkProcess/Downloads/PendingDownload.h:
41         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
42         (WebKit::WebIDBConnectionToClient::messageSenderConnection const):
43         (WebKit::WebIDBConnectionToClient::messageSenderConnection): Deleted.
44         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
45         * NetworkProcess/NetworkResourceLoader.cpp:
46         (WebKit::NetworkResourceLoader::messageSenderConnection const):
47         (WebKit::NetworkResourceLoader::messageSenderConnection): Deleted.
48         * NetworkProcess/NetworkResourceLoader.h:
49         * NetworkProcess/NetworkSocketStream.cpp:
50         (WebKit::NetworkSocketStream::messageSenderConnection const):
51         (WebKit::NetworkSocketStream::messageSenderDestinationID const):
52         (WebKit::NetworkSocketStream::messageSenderConnection): Deleted.
53         (WebKit::NetworkSocketStream::messageSenderDestinationID): Deleted.
54         * NetworkProcess/NetworkSocketStream.h:
55         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
56         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
57         (WebKit::WebSWServerToContextConnection::messageSenderConnection const):
58         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID const):
59         (WebKit::WebSWServerToContextConnection::messageSenderConnection): Deleted.
60         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID): Deleted.
61         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
62         * Platform/IPC/MessageSender.h:
63         * Shared/AuxiliaryProcess.cpp:
64         (WebKit::AuxiliaryProcess::messageSenderConnection const):
65         (WebKit::AuxiliaryProcess::messageSenderDestinationID const):
66         (WebKit::AuxiliaryProcess::messageSenderConnection): Deleted.
67         (WebKit::AuxiliaryProcess::messageSenderDestinationID): Deleted.
68         * Shared/AuxiliaryProcess.h:
69         * UIProcess/WebConnectionToWebProcess.cpp:
70         (WebKit::WebConnectionToWebProcess::messageSenderConnection const):
71         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID const):
72         (WebKit::WebConnectionToWebProcess::messageSenderConnection): Deleted.
73         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID): Deleted.
74         * UIProcess/WebConnectionToWebProcess.h:
75         * UIProcess/WebPageProxy.cpp:
76         (WebKit::WebPageProxy::messageSenderConnection const):
77         (WebKit::WebPageProxy::messageSenderDestinationID const):
78         (WebKit::WebPageProxy::messageSenderConnection): Deleted.
79         (WebKit::WebPageProxy::messageSenderDestinationID): Deleted.
80         * UIProcess/WebPageProxy.h:
81         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
82         (WebKit::WebIDBConnectionToServer::messageSenderConnection const):
83         (WebKit::WebIDBConnectionToServer::messageSenderConnection): Deleted.
84         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
85         * WebProcess/Network/WebResourceLoader.cpp:
86         (WebKit::WebResourceLoader::messageSenderConnection const):
87         (WebKit::WebResourceLoader::messageSenderDestinationID const):
88         (WebKit::WebResourceLoader::messageSenderConnection): Deleted.
89         (WebKit::WebResourceLoader::messageSenderDestinationID): Deleted.
90         * WebProcess/Network/WebResourceLoader.h:
91         * WebProcess/Network/WebSocketStream.cpp:
92         (WebKit::WebSocketStream::messageSenderConnection const):
93         (WebKit::WebSocketStream::messageSenderDestinationID const):
94         (WebKit::WebSocketStream::messageSenderConnection): Deleted.
95         (WebKit::WebSocketStream::messageSenderDestinationID): Deleted.
96         * WebProcess/Network/WebSocketStream.h:
97         * WebProcess/Storage/WebSWClientConnection.h:
98         * WebProcess/WebConnectionToUIProcess.cpp:
99         (WebKit::WebConnectionToUIProcess::messageSenderConnection const):
100         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID const):
101         (WebKit::WebConnectionToUIProcess::messageSenderConnection): Deleted.
102         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID): Deleted.
103         * WebProcess/WebConnectionToUIProcess.h:
104         * WebProcess/WebPage/WebPage.cpp:
105         (WebKit::WebPage::messageSenderConnection const):
106         (WebKit::WebPage::messageSenderDestinationID const):
107         (WebKit::WebPage::messageSenderConnection): Deleted.
108         (WebKit::WebPage::messageSenderDestinationID): Deleted.
109         * WebProcess/WebPage/WebPage.h:
110
111 2019-02-04  Brady Eidson  <beidson@apple.com>
112
113         Take additional process assertion while downloading.
114         <rdar://problem/47741356> and https://bugs.webkit.org/show_bug.cgi?id=194239
115
116         Reviewed by Chris Dumez.
117
118         When the first download starts, grab this new assertion.
119         When the last download ends, release it.
120
121         * Configurations/Network-iOS.entitlements:
122
123         * NetworkProcess/Downloads/DownloadManager.cpp:
124         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
125         (WebKit::DownloadManager::downloadFinished):
126         * NetworkProcess/Downloads/DownloadManager.h:
127
128         * Platform/spi/ios/AssertionServicesSPI.h:
129
130         * UIProcess/ProcessAssertion.cpp:
131         (WebKit::ProcessAssertion::ProcessAssertion):
132         * UIProcess/ProcessAssertion.h:
133         (WebKit::ProcessAssertion::ProcessAssertion):
134
135         * UIProcess/WebProcessProxy.cpp:
136         (WebKit::WebProcessProxy::didSetAssertionState):
137
138         * UIProcess/ios/ProcessAssertionIOS.mm:
139         (WebKit::flagsForState):
140         (WebKit::reasonForState):
141         (WebKit::ProcessAssertion::ProcessAssertion):
142
143 2019-02-04  Said Abou-Hallawa  <said@apple.com>
144
145         [CG] Enable setAdditionalSupportedImageTypes for WK1
146         https://bugs.webkit.org/show_bug.cgi?id=194190
147
148         Reviewed by Tim Horton.
149
150         Move the function webCoreStringVectorFromNSStringArray from WebKit to
151         WebCore so it can be used by both WebKit and WebKitLegacy.
152
153         * Platform/mac/StringUtilities.h:
154         * Platform/mac/StringUtilities.mm:
155         (WebKit::webCoreStringVectorFromNSStringArray): Deleted.
156         * UIProcess/API/Cocoa/WKWebView.mm:
157         (-[WKWebView _initializeWithConfiguration:]):
158
159 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
160
161         Use deferrable timer to restart the Responsiveness Timer on each wheel event
162         https://bugs.webkit.org/show_bug.cgi?id=194135
163
164         Reviewed by Simon Fraser.
165
166         Simon Fraser suggested a neat improvement over my previous optimization
167         of ResponsivenessTimer.
168
169         Instead of reseting the deadline with every event, we can let the timer
170         fire and add the missing time from the last start.
171
172         I implemented that behavior in the new Deferrable Timer class and use
173         it from ResponsivenessTimer.
174
175         * NetworkProcess/watchos/NetworkProximityAssertion.h:
176         * UIProcess/ResponsivenessTimer.h:
177         * WebProcess/Plugins/PluginView.h:
178
179 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
180
181         PageOverlayController's layers should be created lazily
182         https://bugs.webkit.org/show_bug.cgi?id=194199
183         rdar://problem/46571593
184
185         Reviewed by Tim Horton.
186         
187         Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
188         and use them to only parent the overlay-hosting layers when necessary.
189
190         For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
191         simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
192         which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
193         compositing updates that parents the layerWithDocumentOverlays().
194
195         View overlays are added to the layer tree via the DrawingArea. When we go between having
196         none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
197         on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
198         compositing flush (this has to be done manually because view overlay layers are outside the
199         subtree managed by RenderLayerCompositor).
200         
201         Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
202         there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
203         overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
204         having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
205
206         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
207         (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
208         * WebProcess/WebCoreSupport/WebChromeClient.h:
209         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
210         (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
211         * WebProcess/WebPage/AcceleratedDrawingArea.h:
212         * WebProcess/WebPage/DrawingArea.h:
213         (WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
214         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
215         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
216         (WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
217         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
218         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
219         (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
220         (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
221
222 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
223
224         Unreviewed, improve preprocessor guard
225         https://bugs.webkit.org/show_bug.cgi?id=194166
226         <rdar://problem/47694328>
227
228         AC mode is only optional in GTK port. Requested by Zan.
229
230         * WebProcess/WebPage/WebPage.cpp:
231         (WebKit::WebPage::updatePreferences):
232
233 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
234
235         IndexedDB: leak WebIDBConnectionToServer in layout tests
236         https://bugs.webkit.org/show_bug.cgi?id=193688
237         <rdar://problem/47353263>
238
239         Reviewed by Geoffrey Garen.
240
241         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
242         (WebKit::NetworkConnectionToWebProcess::didClose):
243         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
244         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): Deleted.
245         * NetworkProcess/NetworkConnectionToWebProcess.h:
246         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
247         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
248         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
249
250 2019-02-04  Antoine Quint  <graouts@apple.com>
251
252         <rdar://problem/47788802>
253
254         Unreviewed build fix.
255
256         * Platform/spi/ios/UIKitSPI.h:
257
258 2019-02-04  Youenn Fablet  <youenn@apple.com>
259
260         Capture state should be managed consistently when doing process swapping
261         https://bugs.webkit.org/show_bug.cgi?id=194122
262         <rdar://problem/47609293>
263
264         Reviewed by Eric Carlson.
265
266         When doing PSON, WebPageProxy::resetState is called.
267         It resets the media state, but does not call the client delegates.
268         Instead of directly updating the media state, call the routine used to update it so that client delegates are called.
269
270         Covered by new API test and layout test.
271
272         * UIProcess/API/Cocoa/WKWebView.mm:
273         (-[WKWebView _mediaCaptureState]):
274         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
275         * UIProcess/WebPageProxy.cpp:
276         (WebKit::WebPageProxy::resetState):
277         (WebKit::WebPageProxy::isPlayingMediaDidChange):
278         (WebKit::WebPageProxy::updatePlayingMediaDidChange):
279         * UIProcess/WebPageProxy.h:
280
281 2019-02-04  Antoine Quint  <graouts@apple.com>
282
283         Use a dedicated type instead of int32_t for pointer identifiers
284         https://bugs.webkit.org/show_bug.cgi?id=194217
285
286         Reviewed by Antti Koivisto.
287
288         * Scripts/webkit/messages.py:
289         * UIProcess/WebPageProxy.cpp:
290         (WebKit::WebPageProxy::cancelPointer):
291         * UIProcess/WebPageProxy.h:
292         * WebProcess/WebPage/WebPage.cpp:
293         (WebKit::WebPage::cancelPointer):
294         * WebProcess/WebPage/WebPage.h:
295         * WebProcess/WebPage/WebPage.messages.in:
296
297 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
298
299         Unreviewed, avoid -Wswitch warnings introduced in r240880
300         https://bugs.webkit.org/show_bug.cgi?id=193740
301         <rdar://problem/47527267>
302
303         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
304         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
305
306 2019-02-04  Alexander Mikhaylenko  <exalm7659@gmail.com>
307
308         [GTK] Allow pinch zoom on touchpad
309         https://bugs.webkit.org/show_bug.cgi?id=194201
310
311         Reviewed by Michael Catanzaro.
312
313         Enable touchpad events for WebkitWebViewBase, then feed touchpad
314         pinch events to GestureController.
315
316         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
317         (webkitWebViewBaseRealize): Added GDK_TOUCHPAD_GESTURE_MASK to event mask.
318         (webkitWebViewBaseEvent): Added.
319         (webkit_web_view_base_class_init): Override event vfunc.
320
321 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
322
323         Unreviewed, only force settings.acceleratedCompositingEnabled() to true for Cocoa ports
324         https://bugs.webkit.org/show_bug.cgi?id=194166
325         <rdar://problem/47694328>
326
327         Accelerated compositing is broken for me at least. We're a long way from being able to force
328         it.
329
330         * WebProcess/WebPage/WebPage.cpp:
331         (WebKit::WebPage::updatePreferences):
332
333 2019-02-04  Abderrahim Kitouni  <akitouni@gnome.org>
334
335         [GTK] Remove last python2 dependency from CMake build process
336         https://bugs.webkit.org/show_bug.cgi?id=194218
337
338         Reviewed by Michael Catanzaro.
339
340         * InspectorGResources.cmake:
341
342 2019-02-04  Antti Koivisto  <antti@apple.com>
343
344         Rename GraphicsLayer and PlatformCALayer type enum values to match "scroll container layer" convention
345         https://bugs.webkit.org/show_bug.cgi?id=194215
346
347         Reviewed by Frédéric Wang.
348
349         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
350         (WebKit::RemoteLayerBackingStore::drawInContext):
351         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
352         (WebKit::RemoteLayerTreeHost::makeNode):
353         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
354         (WebKit::RemoteLayerTreeHost::makeNode):
355
356 2019-02-03  Antti Koivisto  <antti@apple.com>
357
358         [iOS] Tiles not created in large scrollable iframes
359         https://bugs.webkit.org/show_bug.cgi?id=193665
360
361         Reviewed by Simon Fraser.
362
363         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
364         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
365         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
366         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
367
368         We now use scrollContainerLayer consistently so remove the special cases.
369
370 2019-02-03  Fujii Hironori  <Hironori.Fujii@sony.com>
371
372         [curl] [WebKit] Assertion failures of missing networkStorageSession for storage/indexeddb tests
373         https://bugs.webkit.org/show_bug.cgi?id=194141
374
375         Reviewed by Ross Kirsling.
376
377         Implemented WebKit::NetworkProcess::switchToNewTestingSession and
378         WebKit::NetworkProcess::ensureSession for curl port.
379
380         * NetworkProcess/NetworkProcess.cpp:
381         (WebKit::NetworkProcess::switchToNewTestingSession):
382         (WebKit::NetworkProcess::ensureSession):
383
384 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
385
386         Make setNeedsLayout on the root more explicitly about triggering its side-effects
387         https://bugs.webkit.org/show_bug.cgi?id=194198
388
389         Reviewed by Antti Koivisto.
390
391         Call the newly named functions.
392
393         * WebProcess/Plugins/PDF/PDFPlugin.mm:
394         (WebKit::PDFPlugin::updateScrollbars):
395         * WebProcess/Plugins/PluginView.cpp:
396         (WebKit::PluginView::didInitializePlugin):
397         * WebProcess/WebPage/WebPage.cpp:
398         (WebKit::WebPage::setHeaderBannerHeightForTesting):
399         (WebKit::WebPage::setFooterBannerHeightForTesting):
400         * WebProcess/WebPage/mac/PageBannerMac.mm:
401         (WebKit::PageBanner::addToPage):
402         (WebKit::PageBanner::detachFromPage):
403         (WebKit::PageBanner::hide):
404
405 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
406
407         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
408         https://bugs.webkit.org/show_bug.cgi?id=194189
409
410         Reviewed by Geoffrey Garen.
411
412         Pass the policy check identifier around functions and store it in PolicyDecisionSender
413         so that we can send it back to WebCore with the navigation policy decision.
414
415         We also store it in WebFrame in the case the policy decision had to be invalidated
416         before the decision was received (via WebFrame::invalidatePolicyListener).
417
418         * Scripts/webkit/messages.py:
419         * UIProcess/ProvisionalPageProxy.cpp:
420         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
421         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
422         * UIProcess/ProvisionalPageProxy.h:
423         * UIProcess/WebPageProxy.cpp:
424         (WebKit::WebPageProxy::PolicyDecisionSender): Added PolicyCheckIdentifier as a member.
425         (WebKit::WebPageProxy::PolicyDecisionSender::create):
426         (WebKit::WebPageProxy::PolicyDecisionSender::send):
427         (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
428         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
429         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
430         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
431         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
432         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
433         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
434         (WebKit::WebPageProxy::decidePolicyForResponse):
435         (WebKit::WebPageProxy::decidePolicyForResponseShared):
436         * UIProcess/WebPageProxy.h:
437         * UIProcess/WebPageProxy.messages.in:
438         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
439         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
440         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
441         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
442         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
443         * WebProcess/WebPage/WebFrame.cpp:
444         (WebKit::WebFrame::setUpPolicyListener):
445         (WebKit::WebFrame::invalidatePolicyListener):
446         (WebKit::WebFrame::didReceivePolicyDecision):
447         * WebProcess/WebPage/WebFrame.h:
448         * WebProcess/WebPage/WebPage.cpp:
449         (WebKit::WebPage::didReceivePolicyDecision):
450         * WebProcess/WebPage/WebPage.h:
451         * WebProcess/WebPage/WebPage.messages.in:
452
453 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
454
455         Turn on Smart Paste
456         https://bugs.webkit.org/show_bug.cgi?id=193786
457
458         Reviewed by Ryosuke Niwa.
459
460         * Platform/spi/ios/UIKitSPI.h:
461         * UIProcess/ios/TextCheckerIOS.mm:
462         (WebKit::TextChecker::isSmartInsertDeleteEnabled):
463         Use the flag from UIKit to determine if smart copy paste should be
464         turned on.
465
466 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
467
468         Tidy up data memebers of FrameView and related classes to shrink class sizes
469         https://bugs.webkit.org/show_bug.cgi?id=194197
470
471         Reviewed by Zalan Bujtas.
472
473         * UIProcess/PageClient.h: Declare enum size.
474
475 2018-12-16  Darin Adler  <darin@apple.com>
476
477         Convert additional String::format clients to alternative approaches
478         https://bugs.webkit.org/show_bug.cgi?id=192746
479
480         Reviewed by Alexey Proskuryakov.
481
482         * UIProcess/Cocoa/ViewGestureController.cpp:
483         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
484         Use makeString and FormattedNumber.
485
486         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
487         (WebKit::LocalAuthenticator::getAssertion): Added a comment about an
488         incorrect format specifier and left this code as is for now.
489
490 2019-02-01  David Kilzer  <ddkilzer@apple.com>
491
492         Move soft-linking of TelephonyUtilities.framework out of TUCallSPI.h
493         <https://webkit.org/b/193866>
494
495         Reviewed by Alex Christensen.
496
497         * Platform/mac/MenuUtilities.mm:
498         - Update for rename of TUCallSPI.h to TelephonyUtilitiesSPI.h.
499         - Add soft-linking code formerly in TUCallSPI.h.
500
501 2019-02-01  Alex Christensen  <achristensen@webkit.org>
502
503         Move XPCService entry points from mac directory to new Cocoa directory
504         https://bugs.webkit.org/show_bug.cgi?id=194129
505
506         Reviewed by Chris Dumez.
507
508         * Configurations/NetworkService.xcconfig:
509         * Configurations/PluginService.64.xcconfig:
510         * Configurations/WebContentService.xcconfig:
511         * NetworkProcess/EntryPoint/Cocoa: Copied from Source/WebKit/NetworkProcess/EntryPoint/mac.
512         * NetworkProcess/EntryPoint/mac: Removed.
513         * PluginProcess/EntryPoint/Cocoa: Copied from Source/WebKit/PluginProcess/EntryPoint/mac.
514         * PluginProcess/EntryPoint/mac: Removed.
515         * Shared/EntryPointUtilities/Cocoa: Copied from Source/WebKit/Shared/EntryPointUtilities/mac.
516         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
517         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
518         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
519         * Shared/EntryPointUtilities/mac: Removed.
520         * SourcesCocoa.txt:
521         * WebKit.xcodeproj/project.pbxproj:
522         * WebProcess/EntryPoint/Cocoa: Copied from Source/WebKit/WebProcess/EntryPoint/mac.
523         * WebProcess/EntryPoint/mac: Removed.
524
525 2019-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
526
527         [iOS] Consistent 1 sec hang when triggering modal alerts while handling synchronous touch events
528         https://bugs.webkit.org/show_bug.cgi?id=194140
529         <rdar://problem/47728098>
530
531         Reviewed by Tim Horton.
532
533         Currently, the UI process hangs when attempting to synchronously present modal UI from the web process while the
534         UI process is waiting for sync IPC in the web process. While we have logic to generally mitigate IPC deadlock in
535         this scenario by dispatching the web process' sync IPC immediately with the intention of allowing the web
536         process to finish processing sync IPC (and consequently unblock the UI process), this fails in the case where
537         the sync IPC message from the web process to the UI process requires main thread execution for an arbitrary
538         amount of time (for instance, modal alert dialogs). In this case, we'll end up in a state where we've handled
539         the web process' sync IPC in the UI process, yet we can't resume execution since the web process is still
540         blocked.
541
542         By far the most egregious scenario in which this manifests is during synchronous gesture recognizer IPC, i.e.
543         grabbing position information from the UI process, and handling touch events synchronously. Luckily, these are
544         also cases where (1) we know sync IPC may safely time out, and (2) the presentation of modal UI from the web
545         process should cause the gesture recognizers to fail anyways. As such, we can mitigate these scenarios in the
546         web process by responding to the these pending sync IPC messages *before* sending our own sync IPC to the UI
547         process.
548
549         Test: fast/events/touch/ios/show-modal-alert-during-touch-start.html
550
551         * Shared/ios/InteractionInformationAtPosition.h:
552         (WebKit::InteractionInformationAtPosition::invalidInformation):
553         * Shared/ios/InteractionInformationAtPosition.mm:
554         (WebKit::InteractionInformationAtPosition::encode const):
555         (WebKit::InteractionInformationAtPosition::decode):
556
557         Add a new flag to indicate whether an interaction information response can be valid. Interaction information
558         cannot be valid in the case where the interaction information request was interrupted by certain sync IPC
559         messages from the web process.
560
561         * UIProcess/API/C/WKContextConfigurationRef.cpp:
562         (WKContextConfigurationIgnoreSynchronousMessagingTimeoutsForTesting):
563         (WKContextConfigurationSetIgnoreSynchronousMessagingTimeoutsForTesting):
564
565         Add some testing SPI to ignore sync IPC timeouts, for the purposes of testing. Rather than use the existing
566         Objective-C SPI in WKWebProcessPoolConfiguration, I decided to add C API plumbing for this flag, so that other
567         non-Cocoa ports may also support the new layout test option to ignore sync IPC timeouts.
568
569         * UIProcess/API/C/WKContextConfigurationRef.h:
570         * UIProcess/ios/WKContentViewInteraction.mm:
571         (-[WKContentView ensurePositionInformationIsUpToDate:]):
572         (-[WKContentView _positionInformationDidChange:]):
573         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
574         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
575         (WebKit::WebChromeClient::runJavaScriptAlert):
576         (WebKit::WebChromeClient::runJavaScriptConfirm):
577         (WebKit::WebChromeClient::runJavaScriptPrompt):
578         (WebKit::WebChromeClient::print):
579         (WebKit::WebChromeClient::exceededDatabaseQuota):
580         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
581
582         Cancel any pending sync IPC replies prior to sending sync IPC messages to the UI process which may result in
583         sync IPC deadlock, by using the new helper method, sendSyncWithDelayedReply, instead of just sendSync.
584
585         * WebProcess/WebPage/WebPage.cpp:
586         (WebKit::WebPage::cancelGesturesBlockedOnSynchronousReplies):
587
588         Add a helper to cancel pending sync messages coming in from the UI process that are being called from within
589         gesture recognizer delegate hooks.
590
591         (WebKit::WebPage::touchEventSync):
592         * WebProcess/WebPage/WebPage.h:
593
594         Add a new helper, sendSyncWithDelayedReply, to be used when sending a sync IPC message to the UI process that
595         cannot be immediately completed upon arrival. Importantly, this cancels pending sync replies, and also passes
596         IPC::SendSyncOption::InformPlatformProcessWillSuspend.
597
598         * WebProcess/WebPage/WebPage.messages.in:
599
600         Change these from LegacySync to Delayed messages.
601
602         * WebProcess/WebPage/ios/WebPageIOS.mm:
603         (WebKit::WebPage::getPositionInformation):
604
605         Make this sync IPC handler (as well as WebPage::touchEventSync) store the IPC reply during the scope of the
606         method, and invoke the stored reply at the end of the method if it wasn't interrupted due to something calling
607         cancelGesturesBlockedOnSynchronousReplies().
608
609         (WebKit::WebPage::positionInformation):
610
611         Refactor getPositionInformation by pulling out the logic for building an InteractionInformationAtPosition into
612         a separate helper.
613
614         (WebKit::WebPage::requestPositionInformation):
615
616 2019-02-01  David Quesada  <david_quesada@apple.com>
617
618         Network Process crash when resuming downloads: '-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p'
619         https://bugs.webkit.org/show_bug.cgi?id=194144
620         rdar://problem/47553456
621
622         Reviewed by Geoffrey Garen.
623
624         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
625         (WebKit::Download::resume):
626             Make a mutable copy of the root object decoded from the resume data.
627             It might have been originally encoded as an immutable dictionary.
628
629 2019-02-01  Chris Dumez  <cdumez@apple.com>
630
631         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
632         https://bugs.webkit.org/show_bug.cgi?id=193740
633         <rdar://problem/47527267>
634
635         Reviewed by Alex Christensen.
636
637         The issue was happening when the page is triggering a cross-site navigation while in the middle of parsing. This would cause us to
638         start a new provisional load in a new process before the previous process sends the DidFinishLoadForFrame() IPC to the UIProcess.
639         Getting such IPC after a provisional load has started would mess up our state machine and trip assertions.
640
641         This patch restores non-PSON behavior which is that the previous load in the old process now gets stopped so that no DidFinishLoadForFrame()
642         / DidFailLoadForFrame() gets sent. To achieve this behavior, I introduced a new "StopAllLoads" PolicyAction that we now send the old
643         process when the load is continuing in a new process, instead of sending it "Ignore".
644
645         * NetworkProcess/NetworkDataTaskBlob.cpp:
646         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
647         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
648         (toNSURLSessionResponseDisposition):
649         * UIProcess/WebPageProxy.cpp:
650         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
651
652 2019-02-01  Jer Noble  <jer.noble@apple.com>
653
654         Unreviewed build fix; Respect the 'condition:' field in the WebPreferences.yaml when generating
655         WebPreferencesStoreDefaultsMap.cpp.
656
657         * page/SettingsBase.h:
658
659 2019-02-01  Antoine Quint  <graouts@apple.com>
660
661         Dispatch pointercancel events when content is panned or zoomed on iOS
662         https://bugs.webkit.org/show_bug.cgi?id=193962
663         <rdar://problem/47629134>
664
665         Reviewed by Dean Jackson.
666
667         When a user-agent-provided interaction, such as panning or zooming on iOS, uses a set of touches, we should dispatch a pointercancel
668         event for the pointer ids of the touches involved. To facilitate this, we add a new method on WKContentView to cancel all the pointers
669         matching active touches for a provided UIGestureRecognizer through an async IPC call into the Web process using the new method
670         PointerCaptureController::cancelPointer().
671
672         * Platform/spi/ios/UIKitSPI.h: Add the necessary forward declaration for a necessary UIKit SPI allowing us to get the set of last-seen
673         UITouches by the identifier generated for the matching WebKit touch.
674         * UIProcess/API/Cocoa/WKWebView.mm:
675         (-[WKWebView scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a pinch gesture on the
676         top-level UIScrollView.
677         (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Dispatch
678         touchcancel events for all pointers involved in a pan gesture on the top-level UIScrollView. We can infer this by looking at whether the
679         adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
680         * UIProcess/PageClient.h: Expose a new virtual cancelPointersForGestureRecognizer() method which will allow the iOS implementation to
681         forward the call to WKContentViewInteraction.
682         (WebKit::PageClient::cancelPointersForGestureRecognizer):
683         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Expose the WebPageProxy such that we may access it to cancel pointers for
684         a given gesture recognizer from within ScrollingTreeScrollingNodeDelegateIOS.
685         (WebKit::RemoteScrollingCoordinatorProxy::webPageProxy const):
686         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
687         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
688         (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
689         Dispatch touchcancel events for all pointers involved in a pan gesture on a nested UIScrollView. We can infer this by looking at
690         whether the adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
691         (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a
692         pinch gesture on a nested UIScrollView.
693         (-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]):
694         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer):
695         * UIProcess/WebPageProxy.cpp:
696         (WebKit::WebPageProxy::cancelPointer):
697         * UIProcess/WebPageProxy.h:
698         * UIProcess/ios/PageClientImplIOS.h:
699         * UIProcess/ios/PageClientImplIOS.mm:
700         (WebKit::PageClientImpl::cancelPointersForGestureRecognizer):
701         * UIProcess/ios/WKContentViewInteraction.h:
702         * UIProcess/ios/WKContentViewInteraction.mm:
703         (-[WKContentView cancelPointersForGestureRecognizer:]): Obtain all active UITouch objects for the view and dispatch a pointercancel event,
704         through the WebPageProxy, for all touches associated with the provided gesture recognizer.
705         * WebProcess/WebPage/WebPage.cpp:
706         (WebKit::WebPage::cancelPointer):
707         * WebProcess/WebPage/WebPage.h:
708         * WebProcess/WebPage/WebPage.messages.in:
709
710 2019-02-01  Jer Noble  <jer.noble@apple.com>
711
712         Make the WebKit default for media source based on the WebCore default.
713         https://bugs.webkit.org/show_bug.cgi?id=194172
714
715         Reviewed by Eric Carlson.
716
717         * Shared/WebPreferences.yaml:
718         * UIProcess/API/Cocoa/WKPreferences.mm:
719         (-[WKPreferences _setMediaSourceEnabled:]):
720         (-[WKPreferences _mediaSourceEnabled]):
721         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
722
723 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
724
725         Force settings.acceleratedCompositingEnabled() to true for WebKit
726         https://bugs.webkit.org/show_bug.cgi?id=194166
727         rdar://problem/47694328
728
729         Reviewed by Tim Horton.
730
731         WebKit relies on accelerated compositing for its drawing areas to function correctly,
732         and sometimes clients (*cough* Safari *cough*) have bugs where they clobber the settings,
733         so force this setting to be always on (and release log if this happens).
734
735         * WebProcess/WebPage/WebPage.cpp:
736         (WebKit::WebPage::updatePreferences):
737
738 2019-02-01  Antti Koivisto  <antti@apple.com>
739
740         Don't use base layer() as the scroll layer in scrolling tree.
741         https://bugs.webkit.org/show_bug.cgi?id=194160
742
743         Reviewed by Simon Fraser.
744
745         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
746         (ArgumentCoder<ScrollingStateNode>::encode):
747         (ArgumentCoder<ScrollingStateNode>::decode):
748         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
749         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
750         (WebKit::dump):
751         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
752         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
753         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
754         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
755         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
756         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
757         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
758         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
759         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
760         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren):
761         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
762
763 2019-02-01  Michael Catanzaro  <mcatanzaro@igalia.com>
764
765         [SOUP] Improve use of SoupCookiePersistentStorageType
766         https://bugs.webkit.org/show_bug.cgi?id=194103
767
768         Reviewed by Carlos Garcia Campos.
769
770         Turn it into an enum class, and stop casting it to and from uint32_t.
771
772         * NetworkProcess/Cookies/WebCookieManager.h:
773         * NetworkProcess/Cookies/WebCookieManager.messages.in:
774         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
775         (WebKit::WebCookieManager::setCookiePersistentStorage):
776         * NetworkProcess/NetworkSessionCreationParameters.cpp:
777         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
778         (WebKit::NetworkSessionCreationParameters::decode):
779         * NetworkProcess/NetworkSessionCreationParameters.h:
780         * Shared/soup/SoupCookiePersistentStorageType.h:
781         (): Deleted.
782         * UIProcess/API/glib/WebKitCookieManager.cpp:
783         * UIProcess/WebCookieManagerProxy.h:
784         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
785         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
786         (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
787
788 2019-02-01  Per Arne Vollan  <pvollan@apple.com>
789
790         [macOS] Revert parts of r240811, since it causes kernel panics.
791         https://bugs.webkit.org/show_bug.cgi?id=194061
792
793         Unreviewed crash fix.
794
795         * WebProcess/com.apple.WebProcess.sb.in:
796
797 2019-02-01  Michael Catanzaro  <mcatanzaro@igalia.com>
798
799         [SOUP] Improve use of PAL::SessionID in WebKitCookieManager
800         https://bugs.webkit.org/show_bug.cgi?id=194092
801
802         Reviewed by Carlos Garcia Campos.
803
804         Always get it from the data store instead of assuming the default session ID, and add a
805         helper function for this.
806
807         * UIProcess/API/glib/WebKitCookieManager.cpp:
808         (_WebKitCookieManagerPrivate::sessionID const):
809         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
810         (webkitCookieManagerCreate):
811         (webkit_cookie_manager_set_persistent_storage):
812         (webkit_cookie_manager_set_accept_policy):
813         (webkit_cookie_manager_get_accept_policy):
814         (webkit_cookie_manager_add_cookie):
815         (webkit_cookie_manager_get_cookies):
816         (webkit_cookie_manager_delete_cookie):
817
818 2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
819
820         [Curl] Remove unnecessary member from NetworkStorageSession.
821         https://bugs.webkit.org/show_bug.cgi?id=194137
822
823         Reviewed by Don Olmstead.
824
825         * NetworkProcess/curl/NetworkProcessCurl.cpp:
826         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
827
828 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
829
830         Unreviewed, build fix after r240805
831
832         This patch reverts the BlockPtr change since it breaks iOS builds.
833
834         * UIProcess/Cocoa/NavigationState.mm:
835         (WebKit::tryInterceptNavigation):
836
837 2019-01-31  Chris Dumez  <cdumez@apple.com>
838
839         Page zoom level is lost after a process swap or a crash
840         https://bugs.webkit.org/show_bug.cgi?id=194105
841         <rdar://problem/47610781>
842
843         Reviewed by Alex Christensen.
844
845         Previously, when the client would call setPageAndTextZoomFactors() on the WebPageProxy,
846         we would update the WebPageProxy's corresponding data members and send an IPC to the
847         WebProcess to apply the zoom factors.
848
849         The issue is that on process crash or process-swap, we never communicate those zoom factors
850         to the new WebProcess. Even if the client were to call setPageAndTextZoomFactors() with
851         the same factors again, it would be a no-op since the WebPageProxy's data members already
852         reflect the expected values.
853
854         To address the issue, pass both the page zoom and the text zoom factors to the WebProcess
855         via WebPageCreationParameters. This way, there is no need to send an extra IPC and we're
856         sure the WebPageProxy's factors are properly applied to the WebPage on WebContent process
857         side upon creation (whether after a crash or a process swap).
858
859         * Shared/WebPageCreationParameters.cpp:
860         (WebKit::WebPageCreationParameters::encode const):
861         (WebKit::WebPageCreationParameters::decode):
862         * Shared/WebPageCreationParameters.h:
863         * UIProcess/WebPageProxy.cpp:
864         (WebKit::WebPageProxy::creationParameters):
865         * WebProcess/WebPage/WebPage.cpp:
866
867 2019-01-31  Per Arne Vollan  <pvollan@apple.com>
868
869         [macOS] Disable permissive call logging in sandbox
870         https://bugs.webkit.org/show_bug.cgi?id=194061
871
872         Reviewed by Alexey Proskuryakov.
873
874         Strict call filtering should be reenabled.
875
876         * WebProcess/com.apple.WebProcess.sb.in:
877
878 2019-01-31  Per Arne Vollan  <pvollan@apple.com>
879
880         [macOS] Crash when control-clicking or copying text rendered with a web font
881         https://bugs.webkit.org/show_bug.cgi?id=193913
882         <rdar://problem/47541039>
883
884         Reviewed by Brent Fulgham.
885
886         On older versions of macOS, allowing mach lookup to com.apple.FontObjectsServer is needed.
887
888         * WebProcess/com.apple.WebProcess.sb.in:
889
890 2019-01-31  Benjamin Poulain  <benjamin@webkit.org>
891
892         Remove WKPageIsWebProcessResponsive
893         https://bugs.webkit.org/show_bug.cgi?id=194096
894
895         Reviewed by Alex Christensen.
896
897         It is not used by any client.
898
899         It is also bad API. It is better to let WebKit track
900         responsiveness and tell the client with processDidBecomeResponsive.
901
902         * UIProcess/API/C/WKPage.cpp:
903         (WKPageIsWebProcessResponsive): Deleted.
904         * UIProcess/API/C/WKPagePrivate.h:
905         * UIProcess/WebPageProxy.cpp:
906         (WebKit::WebPageProxy::isWebProcessResponsive): Deleted.
907         * UIProcess/WebPageProxy.h:
908
909 2019-01-31  Alex Christensen  <achristensen@webkit.org>
910
911         Revert r238819 which is unneeded and caused a performance regression.
912         https://bugs.webkit.org/show_bug.cgi?id=192272
913         <rdar://problem/46664625>
914
915         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
916         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
917         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
918         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
919         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
920         (PageLoaderClient::didStartProvisionalLoadForFrame):
921         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
922         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
923         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
924         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
925         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
926         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
927
928 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
929
930         Formalize WebKitAdditions mechanism of LoadOptimizer
931         https://bugs.webkit.org/show_bug.cgi?id=193886
932         <rdar://problem/47696809>
933
934         Reviewed by Brent Fulgham.
935
936         This patch does the following few things:
937         1) formalizes WebKitAdditions mechanism of LoadOptimizer;
938         2) modernizes AppLinks code in tryInterceptNavigation to use BlockPtr;
939         3) lets AppLinks have higher precedence than LoadOptimizer.
940
941         * SourcesCocoa.txt:
942         * UIProcess/Cocoa/LoadOptimizer.h: Removed.
943         * UIProcess/Cocoa/LoadOptimizer.mm: Removed.
944         * UIProcess/Cocoa/NavigationState.mm:
945         (WebKit::tryOptimizingLoad):
946         (WebKit::tryInterceptNavigation):
947         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
948         (WebKit::WebsiteDataStore::WebsiteDataStore):
949         * UIProcess/WebsiteData/WebsiteDataStore.h:
950         (WebKit::WebsiteDataStore::loadOptimizer): Deleted.
951         * WebKit.xcodeproj/project.pbxproj:
952
953 2019-01-31  Chris Dumez  <cdumez@apple.com>
954
955         Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess()
956         https://bugs.webkit.org/show_bug.cgi?id=194094
957         <rdar://problem/47580753>
958
959         Reviewed by Ryosuke Niwa.
960
961         If a SuspendedPageProxy gets destroyed while a WebPageProxy is waiting for its to finish to suspend,
962         call the "failure to suspend" completion handler asynchronously instead of synchronouly to make sure
963         the completion handler cannot try and use the suspended page proxy while it is being destroyed.
964
965         * UIProcess/SuspendedPageProxy.cpp:
966         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
967
968 2019-01-31  Timothy Hatcher  <timothy@apple.com>
969
970         Fix LSAppLink deprecation warnings.
971         https://bugs.webkit.org/show_bug.cgi?id=194097
972
973         Unreviewed build fix.
974
975         * UIProcess/ios/WKActionSheetAssistant.mm:
976         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
977
978 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
979
980         [Mac] Implement basic hit testing in the scrolling tree
981         https://bugs.webkit.org/show_bug.cgi?id=172917
982         <rdar://problem/34215516>
983
984         Reviewed by Antti Koivisto.
985
986         Changed return types, "using namespace WebCore" in ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
987
988         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
989         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
990         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
991         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h:
992         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
993         (WebKit::ScrollerPairMac::handleWheelEvent):
994         (WebKit::ScrollerPairMac::handleMouseEvent):
995         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
996         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
997         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
998         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
999
1000 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
1001
1002         [SOUP] Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to NetworkSession
1003         https://bugs.webkit.org/show_bug.cgi?id=194075
1004
1005         Reviewed by Alex Christensen.
1006
1007         Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to
1008         NetworkSession to reduce globals. This removes two of the six soup-specific variables in
1009         NetworkProcessCreationParameters
1010
1011         * NetworkProcess/Cookies/WebCookieManager.h:
1012         * NetworkProcess/Cookies/WebCookieManager.messages.in:
1013         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1014         (WebKit::WebCookieManager::setCookiePersistentStorage):
1015         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1016         (WebKit::NetworkProcessCreationParameters::encode const):
1017         (WebKit::NetworkProcessCreationParameters::decode):
1018         * NetworkProcess/NetworkProcessCreationParameters.h:
1019         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1020         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
1021         (WebKit::NetworkSessionCreationParameters::encode const):
1022         (WebKit::NetworkSessionCreationParameters::decode):
1023         * NetworkProcess/NetworkSessionCreationParameters.h:
1024         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1025         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1026         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1027         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1028         * SourcesGTK.txt:
1029         * SourcesWPE.txt:
1030         * UIProcess/API/glib/WebKitCookieManager.cpp:
1031         (webkit_cookie_manager_set_persistent_storage):
1032         * UIProcess/WebCookieManagerProxy.cpp:
1033         (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
1034         * UIProcess/WebCookieManagerProxy.h:
1035         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1036         (WebKit::WebsiteDataStore::parameters):
1037         * UIProcess/WebsiteData/WebsiteDataStore.h:
1038         * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp:
1039         (WebKit::WebsiteDataStore::platformSetNetworkParameters):
1040         (WebKit::WebsiteDataStore::platformSetParameters): Deleted.
1041         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
1042         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage):
1043         (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const):
1044         * UIProcess/soup/WebProcessPoolSoup.cpp:
1045         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1046
1047 2019-01-31  Ryosuke Niwa  <rniwa@webkit.org>
1048
1049         iOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture
1050         https://bugs.webkit.org/show_bug.cgi?id=194083
1051
1052         Reviewed by Tim Horton.
1053
1054         We think this crash is a regression from r236966. Prior to r236966, we could only called
1055         removeSwipeSnapshot() only when m_provisionalOrSameDocumentLoadCallback was set but now
1056         we can call it either when m_snapshotRemovalTracker::start was called, or it had been reset.
1057         This can result in m_webPageProxyForBackForwardListForCurrentSwipe getting cleared before
1058         InteractiveUpdateHandler is called by UIGestureRecognizer, resulting in the crash.
1059
1060         This patch tries to restore the behavior prior to r236966 by only invoking removeSwipeSnapshot()
1061         when SnapshotRemovalTracker has a valid removal callback set.
1062
1063         Unfortunately no new tests since there is no reproducible test case, and neither API tests
1064         nor layout tests seem to have the capability to trigger swipe gestures via UIGestureRecognizer,
1065         which is required for this crash to occur. Notably, back-forward swipe tests I enabled in
1066         r240765 bypass UIKit and emulates the action instead.
1067
1068         * UIProcess/Cocoa/ViewGestureController.cpp:
1069         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
1070         * UIProcess/Cocoa/ViewGestureController.h:
1071         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
1072
1073 2019-01-30  Benjamin Poulain  <benjamin@webkit.org>
1074
1075         <rdar://problem/47570443> Responsiveness timers are too expensive for frequent events
1076         https://bugs.webkit.org/show_bug.cgi?id=194003
1077
1078         Reviewed by Geoffrey Garen.
1079
1080         The problem here is specific to wheel events.
1081
1082         For every wheel event, we start a responsiveness timer and send
1083         a ping to the WebProcess. When the WebProcess respond, we stop the timer.
1084
1085         The cost of setting up the timers adds up since we get many events.
1086
1087         The first step to improve the situation was to switch ResponsivenessTimer
1088         to WebCore::Timer. Since WebCore::Timer reuse the same CFRunLoopTimerRef,
1089         we save the allocation/deallocation, insertion in the event loop, etc.
1090
1091         Using WebCore::Timer saves some instructions but we were still hitting
1092         the kernel at 120hz to set up then kill each timer.
1093         The second improvement of the patch is to avoid that by not killing the timer
1094         when we hear back from the WebProcess.
1095
1096         Instead of killing the timer, we let it run and ignore the result.
1097         When the next event comes, we reschedule the existing timer.
1098         This brings down the timers to 60Hz, the same rate as the events.
1099
1100         The very last event does time out. In that case, we have a bad idle wake up:
1101         we wake up a sleeping CPU do do nothing.
1102         In the case of wheel events, this is fine since we saved a bunch of CPU already.
1103         For all the other cases, I kept the normal operating mode to avoid the idle wake.
1104
1105         * UIProcess/ResponsivenessTimer.cpp:
1106         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
1107         (WebKit::ResponsivenessTimer::invalidate):
1108         (WebKit::ResponsivenessTimer::timerFired):
1109         (WebKit::ResponsivenessTimer::start):
1110         (WebKit::ResponsivenessTimer::startWithLazyStop):
1111         (WebKit::ResponsivenessTimer::stop):
1112         (WebKit::ResponsivenessTimer::processTerminated):
1113         (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
1114         * UIProcess/ResponsivenessTimer.h:
1115         * UIProcess/WebPageProxy.cpp:
1116         (WebKit::WebPageProxy::sendWheelEvent):
1117         * UIProcess/WebProcessProxy.cpp:
1118         (WebKit::WebProcessProxy::isResponsiveWithLazyStop):
1119         * UIProcess/WebProcessProxy.h:
1120
1121 2019-01-30  Daniel Bates  <dabates@apple.com>
1122
1123         [iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard on support.apple.com
1124         https://bugs.webkit.org/show_bug.cgi?id=193987
1125         <rdar://problem/47230785>
1126
1127         Reviewed by Tim Horton.
1128
1129         It is unnecessary to relinquish first responder status when a user explicitly dismissing
1130         the keyboard. Moreover, doing so prevents key commands from being intercepted when a
1131         hardware keyboard is subsequently attached.
1132         
1133         Following r238635 a page becomes focused (accepting of keyboard input) and defocused
1134         when the WKContentView becomes first responder and resigns first responder, respectively.
1135         When a user explicitly dismisses the keyboard by tapping Done (iPhone) or the hide keyboard
1136         button (iPad) then UIKit tells WKContentView to resign its first responder status only
1137         to make its superview, WKWebView, first responder. When a person subsequently taps on the
1138         page again, the WKContentView requests to become the first responder. However changes to
1139         page focus are not guaranteed to be sent to the WebProcess immediately (WebPageProxy::activityStateDidChange()
1140         will schedule an update). In particular, they are not guaranteed to be sent before the
1141         WebProcess is told about a tap. Therefore, the WebProcess has out-of-date information on
1142         focus state of the page. Instead we should detect when WKWebView is being asked to resign
1143         as a result of the keyboard dismissal and refuse the request, taking care to end the current
1144         editing session, blur the focused element, and dismiss the on-screen keyboard.
1145
1146         * Platform/spi/ios/UIKitSPI.h: Expose some SPI.
1147         * UIProcess/ios/WKContentViewInteraction.h:
1148         * UIProcess/ios/WKContentViewInteraction.mm:
1149         (-[WKContentView setupInteraction]): Register to receive notifications whenever a user
1150         explicitly dismisses the keyboard.
1151         (-[WKContentView resignFirstResponderForWebView]): If we are being asked to resign as a
1152         result of a user explicitly dismissing the keyboard then refuse to resign.
1153         (-[WKContentView _keyboardDidRequestDismissal:]): Update state, if applicable.
1154
1155 2019-01-30  Keith Rollin  <krollin@apple.com>
1156
1157         Add default constructor for NetworkActivityTracker
1158         https://bugs.webkit.org/show_bug.cgi?id=194058
1159         <rdar://problem/47685457>
1160
1161         Reviewed by Chris Dumez.
1162
1163         ResourceNetworkActivityTracker has a default constructor. It also has
1164         a NetworkActivityTracker data member, which does not have a default
1165         constructor. This will cause some compilers to complain -- they can't
1166         default-create a ResourceNetworkActivityTracker because they can't
1167         default-create its data members. Address this by adding a default
1168         constructor for NetworkActivityTracker.
1169
1170         * NetworkProcess/NetworkActivityTracker.h:
1171
1172 2019-01-30  Daniel Steffen  <dsteffen@apple.com>
1173
1174         <rdar://problem/29471922> Safari should switch from the legacy denap SPI to handling vouchers
1175         https://bugs.webkit.org/show_bug.cgi?id=193992
1176
1177         Reviewed by Geoffrey Garen.
1178
1179         The denap SPI is deprecated.
1180         The new way of staying out of AppNap is through a voucher.
1181
1182         * Platform/IPC/mac/ConnectionMac.mm:
1183         (IPC::readFromMachPort):
1184         * Platform/IPC/mac/ImportanceAssertion.h:
1185         (IPC::ImportanceAssertion::ImportanceAssertion):
1186         (IPC::ImportanceAssertion::~ImportanceAssertion):
1187
1188 2019-01-30  Chris Dumez  <cdumez@apple.com>
1189
1190         Fix crashes when trying to ref the CallbackAggregator in NetworkProcess
1191         https://bugs.webkit.org/show_bug.cgi?id=194054
1192
1193         Reviewed by Brent Fulgham.
1194
1195         The callback aggregators should be ThreadSafeRefCounted since they are passed to other threads.
1196
1197         * NetworkProcess/NetworkProcess.cpp:
1198         (WebKit::NetworkProcess::fetchWebsiteData):
1199         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1200         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
1201
1202 2019-01-30  Daniel Bates  <dabates@apple.com>
1203
1204         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
1205         https://bugs.webkit.org/show_bug.cgi?id=192824
1206         <rdar://problem/47100332>
1207
1208         Reviewed by Wenson Hsieh.
1209
1210         Use the same code path for key events to editable elements and non-editable elements.
1211
1212         Currently we have different code paths for hardware key events depending on whether the active element
1213         is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key
1214         presses this differentiation was a necessary workaround for UIKit's event processing precedence of
1215         interpreting key events for system text editing commands and app commands before dispatching unhandled
1216         key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a
1217         WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that
1218         is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have
1219         empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state
1220         that is necessary to manufacture the correct WebEvent corresponding to a UIEvent.
1221
1222         As a side benefit of this change, with the exception of modifier flag changes, both hardware and software
1223         key events use the same code path.
1224
1225         * UIProcess/ios/WKContentViewInteraction.h:
1226         * UIProcess/ios/WKContentViewInteraction.mm:
1227         (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder
1228         (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI
1229         when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the
1230         keyboard UI was disabled as a side effect of not becoming first responder when there was no focused
1231         element (by returning NO in -_requiresKeyboardWhenFirstResponder).
1232         (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS)
1233         so that we always accept key events. Instead of selectively replying to create a keyboard as a means of
1234         hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the
1235         automatic keyboard UI.
1236         (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed
1237         now that we require a keyboard when first responder even if the focused element is non-editable.
1238         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit
1239         as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit
1240         its chance to interpret the UIEvent, we intercepted, for app key commands.
1241         (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls
1242         (e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder
1243         responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will
1244         no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>.
1245         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1246         (-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise,
1247         type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non-
1248         editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for
1249         editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate
1250         when the popover is presented.
1251
1252 2019-01-30  Per Arne Vollan  <pvollan@apple.com>
1253
1254         [macOS] Sandbox fails to compile on 10.12
1255         https://bugs.webkit.org/show_bug.cgi?id=194035
1256         <rdar://problem/47651260>
1257
1258         Reviewed by Brent Fulgham.
1259
1260         This was caused by the commit <https://trac.webkit.org/changeset/239994>, which is only valid for
1261         10.14 and later.
1262
1263         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1264         * WebProcess/com.apple.WebProcess.sb.in:
1265
1266 2019-01-29  Conrad Shultz  <conrad_shultz@apple.com>
1267
1268         Ensure image picker sourceType is set before cameraDevice
1269         https://bugs.webkit.org/show_bug.cgi?id=193998
1270
1271         Reviewed by Beth Dakin.
1272
1273         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1274         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
1275
1276 2019-01-30  Chris Dumez  <cdumez@apple.com>
1277
1278         Regression(PSON) Load hang can occur on history navigation
1279         https://bugs.webkit.org/show_bug.cgi?id=194030
1280         <rdar://problem/47656939>
1281
1282         Reviewed by Antti Koivisto.
1283
1284         We do not support having more than one WebPage in a WebProcess with the same page ID. As a result,
1285         if we decide to reuse an existing process on process-swap, we need to make sure that we either use
1286         its suspended page (when possible, meaning that it is for the right HistoryItem / page) or we need
1287         make sure we drop the existing suspended page for this process / pagePID combination, so that the
1288         WebPage on WebProcess side gets closed before we attempt to do the new load.
1289
1290         We were doing this correctly in 2 places in WebProcessPool::processForNavigationInternal() but failed
1291         to do so in a third place, when doing back to a HistoryItem which does not have a SuspendedPage but
1292         whose process is still alive (presumably because it is kept alive by another suspended page). This
1293         patch fixes this third place to remove any suspended page in the process for the current page before
1294         reusing the process. An assertion was also added to the call site in
1295         WebPageProxy::receivedNavigationPolicyDecision() to make sure we catch this more easily in the
1296         future.
1297
1298         * UIProcess/WebPageProxy.cpp:
1299         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1300         * UIProcess/WebProcessPool.cpp:
1301         (WebKit::WebProcessPool::processForNavigationInternal):
1302         (WebKit::WebProcessPool::removeAllSuspendedPagesForPage):
1303         (WebKit::WebProcessPool::hasSuspendedPageFor const):
1304         * UIProcess/WebProcessPool.h:
1305
1306 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1307
1308         [GTK][Wayland] REGRESSION(r240712): Clear the GL context if it's the current one on dispose
1309         https://bugs.webkit.org/show_bug.cgi?id=194024
1310
1311         Reviewed by Michael Catanzaro.
1312
1313         Fixes a crash in gdk_gl_context_dispose().
1314
1315         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1316         (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):
1317
1318 2019-01-30  Antti Koivisto  <antti@apple.com>
1319
1320         Crash in WebKit::RemoteLayerTreePropertyApplier::updateChildren
1321         https://bugs.webkit.org/show_bug.cgi?id=193897
1322         <rdar://problem/47427750>
1323
1324         Reviewed by Simon Fraser.
1325
1326         There has been some null pointer crashes where we fail to find a remote layer tree node that matches
1327         the transaction properties.
1328
1329         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1330         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
1331
1332         Null check the nodes.
1333
1334 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
1335
1336         Add some basic geometry information to the scrolling tree
1337         https://bugs.webkit.org/show_bug.cgi?id=194002
1338
1339         Reviewed by Antti Koivisto.
1340
1341         Add a comment explaining why we don't need to encode/decode ParentRelativeScrollableRect.
1342
1343         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1344         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
1345
1346 2019-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1347
1348         [GTK] gdk_cairo_draw_from_gl() in AcceleratedBackingStoreWayland fails in GtkInspector's magnifier
1349         https://bugs.webkit.org/show_bug.cgi?id=193903
1350
1351         Reviewed by Michael Catanzaro.
1352
1353         The problem is that the GL context used by WaylandCompositor can't share resources with the one used by GTK+
1354         when painting with gdk_cairo_draw_from_gl(). Accelerated compositing in Wayland works only because
1355         WaylandCompositor makes the context current only once on initialization. So, when we render the first frame on
1356         accelerated compositing mode, GTK+ is rendering in non-GL mode, and switches to the GL mode when
1357         gdk_cairo_draw_from_gl() is called. Since GTK+ didn't have a GL context yet, the first frame is always rendered
1358         by GTK+ using the software fallback (glReadPixels). The thing is that the first time gdk_cairo_draw_from_gl() is
1359         called, GTK+ creates a GL context for painting that is made current, and it will remain the current one
1360         forever. The first frame fails to render with "GL_INVALID_OPERATION in glBindTexture(non-gen name)" because the
1361         texture created in WaylandCompositor GL context can't be accessed from GTK+ GL context. The following frames are
1362         handled with the GTK+ GL context. I would say this works by casuality and it could be the cause of other
1363         accelerated compositing issues in Wayland.
1364
1365         We need to create our own GdkGLContext for the WebView, and use that in the WaylandCompositor. When the
1366         GdkGLContext is created, the GTK+ GL context for painting is used as a shared context, ensuring that resources
1367         created in the new context will be accessible from the painting one.
1368
1369         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1370         (webkitWebViewBaseMakeGLContextCurrent): Call AcceleratedBackingStore::makeContextCurrent().
1371         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1372         * UIProcess/WebPageProxy.h:
1373         * UIProcess/gtk/AcceleratedBackingStore.h:
1374         (WebKit::AcceleratedBackingStore::makeContextCurrent): New virtual method only implemented by Wayland backend.
1375         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1376         (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Try to create a GL context with
1377         gdk_window_create_gl_context(), falling back to a WebCore::GLContext if it fails or GTK+ version is not new enough.
1378         (WebKit::AcceleratedBackingStoreWayland::makeContextCurrent): Make the GL context current.
1379         (WebKit::AcceleratedBackingStoreWayland::paint): Check if we have a GdkGLContext before trying to use gdk_cairo_draw_from_gl().
1380         (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL const): Deleted.
1381         * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
1382         * UIProcess/gtk/WaylandCompositor.cpp:
1383         (WebKit::WaylandCompositor::Surface::Surface): Move the texture creation to setWebPage(), since we need the
1384         WebView GL context.
1385         (WebKit::WaylandCompositor::Surface::~Surface): Move the code to destroy GL resources to setWebPage().
1386         (WebKit::WaylandCompositor::Surface::setWebPage): Create the texture when a new page is set and destroy GL
1387         resources when unset.
1388         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): Make WebView GL context current.
1389         (WebKit::WaylandCompositor::Surface::commit): Ditto.
1390         (WebKit::WaylandCompositor::initializeEGL): Use a temporary GLContext.
1391         * UIProcess/gtk/WaylandCompositor.h:
1392         * UIProcess/gtk/WebPageProxyGtk.cpp:
1393         (WebKit::WebPageProxy::makeGLContextCurrent): Call webkitWebViewBaseMakeGLContextCurrent().
1394
1395 2019-01-29  Ryosuke Niwa  <rniwa@webkit.org>
1396
1397         iOS: Nullptr crash in WebPage::getPositionInformation dereferencing an input element for data list
1398         https://bugs.webkit.org/show_bug.cgi?id=193996
1399
1400         Reviewed by Wenson Hsieh.
1401
1402         Added a missing nullptr check.
1403
1404         * WebProcess/WebPage/ios/WebPageIOS.mm:
1405         (WebKit::WebPage::getPositionInformation):
1406
1407 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
1408
1409         Add nodes to the scrolling tree in z-index order.
1410         https://bugs.webkit.org/show_bug.cgi?id=192529
1411         <rdar://problem/47402708>
1412
1413         Reviewed by Dean Jackson.
1414
1415         FrameHosting nodes have layers, so need to update them.
1416
1417         * Platform/Logging.cpp:
1418         (WebKit::initializeLogChannelsIfNecessary):
1419         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1420         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1421
1422 2019-01-29  Alex Christensen  <achristensen@webkit.org>
1423
1424         Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
1425         https://bugs.webkit.org/show_bug.cgi?id=193974
1426
1427         Reviewed by Tim Horton.
1428
1429         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1430         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
1431         (WebKit::NetworkBlobRegistry::registerBlobURL):
1432         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
1433         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1434         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1435         (WebKit::NetworkBlobRegistry::blobSize):
1436         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
1437         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1438         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1439         (WebKit::NetworkConnectionToWebProcess::didClose):
1440         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
1441         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
1442         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
1443         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
1444         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
1445         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
1446         (WebKit::NetworkConnectionToWebProcess::blobSize):
1447         * NetworkProcess/NetworkProcess.cpp:
1448         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
1449         * NetworkProcess/NetworkProcess.h:
1450
1451 2019-01-29  Youenn Fablet  <youenn@apple.com>
1452
1453         Adopt new SPI to evaluate server certificate trust
1454         https://bugs.webkit.org/show_bug.cgi?id=193355
1455
1456         Reviewed by Alex Christensen.
1457
1458         Use new SPI provided in NSURLSession to evaluate server certificates.
1459         If successful, let loading proceed as usual.
1460         Otherwise, go to the UIProcess to ask for a decision on continuing the load or not.
1461
1462         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1463         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1464         (canNSURLSessionTrustEvaluate):
1465         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1466         (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
1467
1468 2019-01-29  Tim Horton  <timothy_horton@apple.com>
1469
1470         Fix the build
1471
1472         * UIProcess/ios/WKDrawingCoordinator.h:
1473         * UIProcess/ios/WKDrawingCoordinator.mm:
1474         * UIProcess/ios/WKDrawingView.mm:
1475
1476 2019-01-29  Alex Christensen  <achristensen@webkit.org>
1477
1478         Remove unused NetworkProcessProxy::writeBlobToFilePath
1479         https://bugs.webkit.org/show_bug.cgi?id=193990
1480
1481         Reviewed by Wenson Hsieh.
1482
1483         This code was only used in code that was introduced in r235202
1484         but that has since been refactored to not use blobs.  Its tests still pass.
1485         This removes the only UIProcess-controlled code that uses NetworkBlobRegistry::singleton.
1486
1487         * NetworkProcess/NetworkProcess.cpp:
1488         (WebKit::NetworkProcess::writeBlobToFilePath): Deleted.
1489         * NetworkProcess/NetworkProcess.h:
1490         * NetworkProcess/NetworkProcess.messages.in:
1491         * UIProcess/Cocoa/WebViewImpl.mm:
1492         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
1493         * UIProcess/Network/NetworkProcessProxy.cpp:
1494         (WebKit::NetworkProcessProxy::writeBlobToFilePath): Deleted.
1495         * UIProcess/Network/NetworkProcessProxy.h:
1496         * UIProcess/WebPageProxy.cpp:
1497         (WebKit::WebPageProxy::writeBlobToFilePath): Deleted.
1498         * UIProcess/WebPageProxy.h:
1499
1500 2019-01-29  Devin Rousso  <drousso@apple.com>
1501
1502         Web Inspector: expose a way of determining if a detached frontend is for a remote target
1503         https://bugs.webkit.org/show_bug.cgi?id=193951
1504         <rdar://problem/47621366>
1505
1506         Reviewed by Joseph Pecoraro.
1507
1508         * UIProcess/WebInspectorProxy.h:
1509         (WebKit::WebInspectorProxy::InspectionTargetType): Added.
1510         (WebKit::WebInspectorProxy::createFrontendWindow):
1511         * UIProcess/mac/WebInspectorProxyMac.mm:
1512         (WebKit::WebInspectorProxy::createFrontendWindow):
1513         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
1514         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1515         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
1516
1517         * UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
1518         * UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.
1519         (-[WKInspectorWindow isRemote]): Added.
1520
1521         * Shared/API/Cocoa/_WKNSWindowExtras.mm:
1522         (-[NSWindow _web_isWebInspectorWindow]):
1523
1524         * PlatformMac.cmake:
1525         * SourcesCocoa.txt:
1526         * UnifiedSources-input.xcfilelist:
1527         * WebKit.xcodeproj/project.pbxproj:
1528
1529 2019-01-29  Alex Christensen  <achristensen@webkit.org>
1530
1531         Rename ChildProcess to AuxiliaryProcess
1532         https://bugs.webkit.org/show_bug.cgi?id=193943
1533
1534         Reviewed by Andy Estes.
1535
1536         "Child" implies that there is a parent, but I'm about to introduce a type of NetworkProcess that
1537         doesn't always have a parent, and may have many UIProcesses that it is the auxiliary for.
1538
1539         * CMakeLists.txt:
1540         * DerivedSources-input.xcfilelist:
1541         * DerivedSources-output.xcfilelist:
1542         * DerivedSources.make:
1543         * NetworkProcess/Cookies/WebCookieManager.cpp:
1544         * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1545         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1546         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
1547         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
1548         * NetworkProcess/NetworkProcess.cpp:
1549         (WebKit::callExitSoon):
1550         (WebKit::NetworkProcess::NetworkProcess):
1551         (WebKit::NetworkProcess::didReceiveMessage):
1552         (WebKit::NetworkProcess::initializeConnection):
1553         (WebKit::NetworkProcess::terminate):
1554         (WebKit::NetworkProcess::initializeProcess):
1555         (WebKit::NetworkProcess::initializeProcessName):
1556         (WebKit::NetworkProcess::initializeSandbox):
1557         * NetworkProcess/NetworkProcess.h:
1558         * NetworkProcess/NetworkProcessSupplement.h:
1559         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1560         (WebKit::NetworkCache::Storage::deleteOldVersions):
1561         * NetworkProcess/ios/NetworkProcessIOS.mm:
1562         (WebKit::NetworkProcess::initializeProcess):
1563         (WebKit::NetworkProcess::initializeProcessName):
1564         (WebKit::NetworkProcess::initializeSandbox):
1565         * NetworkProcess/mac/NetworkProcessMac.mm:
1566         (WebKit::NetworkProcess::initializeProcess):
1567         (WebKit::NetworkProcess::initializeProcessName):
1568         (WebKit::NetworkProcess::initializeSandbox):
1569         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
1570         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
1571         (WebKit::NetworkProcessMainUnix):
1572         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
1573         * NetworkProcess/watchos/NetworkProximityManager.h:
1574         * NetworkProcess/watchos/NetworkProximityManager.mm:
1575         (WebKit::NetworkProximityManager::NetworkProximityManager):
1576         * NetworkProcess/win/NetworkProcessMainWin.cpp:
1577         (WebKit::initializeAuxiliaryProcess<NetworkProcess>):
1578         (WebKit::NetworkProcessMainWin):
1579         (WebKit::initializeChildProcess<NetworkProcess>): Deleted.
1580         * PlatformGTK.cmake:
1581         * PlatformMac.cmake:
1582         * PlatformWin.cmake:
1583         * PluginProcess/PluginProcess.cpp:
1584         (WebKit::PluginProcess::initializeProcess):
1585         (WebKit::PluginProcess::initializeConnection):
1586         (WebKit::PluginProcess::didReceiveMessage):
1587         (WebKit::PluginProcess::initializeProcessName):
1588         (WebKit::PluginProcess::initializeSandbox):
1589         * PluginProcess/PluginProcess.h:
1590         * PluginProcess/mac/PluginProcessMac.mm:
1591         (WebKit::PluginProcess::platformInitializeProcess):
1592         (WebKit::PluginProcess::initializeProcessName):
1593         (WebKit::PluginProcess::initializeSandbox):
1594         (WebKit::PluginProcess::stopRunLoop):
1595         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1596         (WebKit::PluginProcessMainUnix):
1597         * PluginProcess/unix/PluginProcessUnix.cpp:
1598         (WebKit::PluginProcess::platformInitializeProcess):
1599         * Shared/Authentication/AuthenticationManager.cpp:
1600         (WebKit::AuthenticationManager::AuthenticationManager):
1601         * Shared/Authentication/AuthenticationManager.h:
1602         * Shared/AuxiliaryProcess.cpp: Copied from Source/WebKit/Shared/ChildProcess.cpp.
1603         (WebKit::AuxiliaryProcess::AuxiliaryProcess):
1604         (WebKit::AuxiliaryProcess::~AuxiliaryProcess):
1605         (WebKit::AuxiliaryProcess::didClose):
1606         (WebKit::AuxiliaryProcess::initialize):
1607         (WebKit::AuxiliaryProcess::setProcessSuppressionEnabled):
1608         (WebKit::AuxiliaryProcess::initializeProcess):
1609         (WebKit::AuxiliaryProcess::initializeProcessName):
1610         (WebKit::AuxiliaryProcess::initializeConnection):
1611         (WebKit::AuxiliaryProcess::addMessageReceiver):
1612         (WebKit::AuxiliaryProcess::removeMessageReceiver):
1613         (WebKit::AuxiliaryProcess::disableTermination):
1614         (WebKit::AuxiliaryProcess::enableTermination):
1615         (WebKit::AuxiliaryProcess::messageSenderConnection):
1616         (WebKit::AuxiliaryProcess::messageSenderDestinationID):
1617         (WebKit::AuxiliaryProcess::terminationTimerFired):
1618         (WebKit::AuxiliaryProcess::stopRunLoop):
1619         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1620         (WebKit::AuxiliaryProcess::terminate):
1621         (WebKit::AuxiliaryProcess::shutDown):
1622         (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
1623         (WebKit::AuxiliaryProcess::platformInitialize):
1624         (WebKit::AuxiliaryProcess::initializeSandbox):
1625         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
1626         (WebKit::AuxiliaryProcess::didReceiveMemoryPressureEvent):
1627         (WebKit::ChildProcess::ChildProcess): Deleted.
1628         (WebKit::ChildProcess::~ChildProcess): Deleted.
1629         (WebKit::ChildProcess::didClose): Deleted.
1630         (WebKit::ChildProcess::initialize): Deleted.
1631         (WebKit::ChildProcess::setProcessSuppressionEnabled): Deleted.
1632         (WebKit::ChildProcess::initializeProcess): Deleted.
1633         (WebKit::ChildProcess::initializeProcessName): Deleted.
1634         (WebKit::ChildProcess::initializeConnection): Deleted.
1635         (WebKit::ChildProcess::addMessageReceiver): Deleted.
1636         (WebKit::ChildProcess::removeMessageReceiver): Deleted.
1637         (WebKit::ChildProcess::disableTermination): Deleted.
1638         (WebKit::ChildProcess::enableTermination): Deleted.
1639         (WebKit::ChildProcess::messageSenderConnection): Deleted.
1640         (WebKit::ChildProcess::messageSenderDestinationID): Deleted.
1641         (WebKit::ChildProcess::terminationTimerFired): Deleted.
1642         (WebKit::ChildProcess::stopRunLoop): Deleted.
1643         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
1644         (WebKit::ChildProcess::terminate): Deleted.
1645         (WebKit::ChildProcess::shutDown): Deleted.
1646         (WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted.
1647         (WebKit::ChildProcess::platformInitialize): Deleted.
1648         (WebKit::ChildProcess::initializeSandbox): Deleted.
1649         (WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
1650         (WebKit::ChildProcess::didReceiveMemoryPressureEvent): Deleted.
1651         * Shared/AuxiliaryProcess.h: Copied from Source/WebKit/Shared/ChildProcess.h.
1652         (WebKit::ChildProcess::parentProcessConnection const): Deleted.
1653         (WebKit::ChildProcess::messageReceiverMap): Deleted.
1654         (WebKit::ChildProcess::setTerminationTimeout): Deleted.
1655         (WebKit::ChildProcess::shouldOverrideQuarantine): Deleted.
1656         * Shared/AuxiliaryProcess.messages.in: Copied from Source/WebKit/Shared/ChildProcess.messages.in.
1657         * Shared/AuxiliaryProcessSupplement.h: Copied from Source/WebKit/Shared/ChildProcessSupplement.h.
1658         (WebKit::AuxiliaryProcessSupplement::~AuxiliaryProcessSupplement):
1659         (WebKit::ChildProcessSupplement::~ChildProcessSupplement): Deleted.
1660         (WebKit::ChildProcessSupplement::initializeConnection): Deleted.
1661         * Shared/ChildProcess.cpp: Removed.
1662         * Shared/ChildProcess.h: Removed.
1663         * Shared/ChildProcess.messages.in: Removed.
1664         * Shared/ChildProcessSupplement.h: Removed.
1665         * Shared/Cocoa/AuxiliaryProcessCocoa.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
1666         (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
1667         (WebKit::ChildProcess::didReceiveInvalidMessage): Deleted.
1668         * Shared/Cocoa/ChildProcessCocoa.mm: Removed.
1669         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1670         (WebKit::initializeAuxiliaryProcess):
1671         (WebKit::XPCServiceInitializer):
1672         (WebKit::initializeChildProcess): Deleted.
1673         * Shared/WebSQLiteDatabaseTracker.cpp:
1674         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
1675         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
1676         (WebKit::m_childProcessType): Deleted.
1677         * Shared/WebSQLiteDatabaseTracker.h:
1678         * Shared/ios/AuxiliaryProcessIOS.mm: Copied from Source/WebKit/Shared/ios/ChildProcessIOS.mm.
1679         (WebKit::AuxiliaryProcess::platformInitialize):
1680         (WebKit::AuxiliaryProcess::initializeSandbox):
1681         (WebKit::AuxiliaryProcess::setQOS):
1682         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1683         (WebKit::ChildProcess::platformInitialize): Deleted.
1684         (WebKit::ChildProcess::initializeSandbox): Deleted.
1685         (WebKit::ChildProcess::setQOS): Deleted.
1686         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
1687         * Shared/ios/ChildProcessIOS.mm: Removed.
1688         * Shared/mac/AuxiliaryProcessMac.mm: Copied from Source/WebKit/Shared/mac/ChildProcessMac.mm.
1689         (WebKit::SandboxInfo::SandboxInfo):
1690         (WebKit::AuxiliaryProcess::launchServicesCheckIn):
1691         (WebKit::AuxiliaryProcess::platformInitialize):
1692         (WebKit::processStorageClass):
1693         (WebKit::sandboxDirectory):
1694         (WebKit::applySandbox):
1695         (WebKit::initializeSandboxParameters):
1696         (WebKit::AuxiliaryProcess::initializeSandbox):
1697         (WebKit::AuxiliaryProcess::stopNSAppRunLoop):
1698         (WebKit::AuxiliaryProcess::stopNSRunLoop):
1699         (WebKit::AuxiliaryProcess::platformStopRunLoop):
1700         (WebKit::AuxiliaryProcess::setQOS):
1701         (WebKit::AuxiliaryProcess::isSystemWebKit):
1702         (WebKit::ChildProcess::launchServicesCheckIn): Deleted.
1703         (WebKit::ChildProcess::platformInitialize): Deleted.
1704         (WebKit::ChildProcess::initializeSandbox): Deleted.
1705         (WebKit::ChildProcess::stopNSAppRunLoop): Deleted.
1706         (WebKit::ChildProcess::stopNSRunLoop): Deleted.
1707         (WebKit::ChildProcess::platformStopRunLoop): Deleted.
1708         (WebKit::ChildProcess::setQOS): Deleted.
1709         (WebKit::ChildProcess::isSystemWebKit): Deleted.
1710         * Shared/mac/ChildProcessMac.mm: Removed.
1711         * Shared/mac/SecItemShim.cpp:
1712         (WebKit::globalNetworkProcess):
1713         (WebKit::sendSecItemRequest):
1714         (WebKit::initializeSecItemShim):
1715         * Shared/mac/SecItemShim.h:
1716         * Shared/unix/AuxiliaryProcessMain.cpp: Copied from Source/WebKit/Shared/unix/ChildProcessMain.cpp.
1717         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
1718         (WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
1719         * Shared/unix/AuxiliaryProcessMain.h: Copied from Source/WebKit/Shared/unix/ChildProcessMain.h.
1720         (WebKit::AuxiliaryProcessMainBase::takeInitializationParameters):
1721         (WebKit::initializeAuxiliaryProcess):
1722         (WebKit::AuxiliaryProcessMain):
1723         (WebKit::ChildProcessMainBase::platformInitialize): Deleted.
1724         (WebKit::ChildProcessMainBase::platformFinalize): Deleted.
1725         (WebKit::ChildProcessMainBase::takeInitializationParameters): Deleted.
1726         (WebKit::initializeChildProcess): Deleted.
1727         (WebKit::ChildProcessMain): Deleted.
1728         * Shared/unix/ChildProcessMain.cpp: Removed.
1729         * Shared/unix/ChildProcessMain.h: Removed.
1730         * Shared/win/AuxiliaryProcessMainWin.cpp: Copied from Source/WebKit/Shared/win/ChildProcessMainWin.cpp.
1731         (WebKit::AuxiliaryProcessMainBase::parseCommandLine):
1732         (WebKit::ChildProcessMainBase::parseCommandLine): Deleted.
1733         * Shared/win/ChildProcessMainWin.cpp: Removed.
1734         * Sources.txt:
1735         * SourcesCocoa.txt:
1736         * SourcesGTK.txt:
1737         * SourcesWPE.txt:
1738         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
1739         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
1740         * UIProcess/AuxiliaryProcessProxy.cpp: Copied from Source/WebKit/UIProcess/ChildProcessProxy.cpp.
1741         (WebKit::AuxiliaryProcessProxy::AuxiliaryProcessProxy):
1742         (WebKit::AuxiliaryProcessProxy::~AuxiliaryProcessProxy):
1743         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
1744         (WebKit::AuxiliaryProcessProxy::connect):
1745         (WebKit::AuxiliaryProcessProxy::terminate):
1746         (WebKit::AuxiliaryProcessProxy::state const):
1747         (WebKit::AuxiliaryProcessProxy::sendMessage):
1748         (WebKit::AuxiliaryProcessProxy::addMessageReceiver):
1749         (WebKit::AuxiliaryProcessProxy::removeMessageReceiver):
1750         (WebKit::AuxiliaryProcessProxy::dispatchMessage):
1751         (WebKit::AuxiliaryProcessProxy::dispatchSyncMessage):
1752         (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
1753         (WebKit::AuxiliaryProcessProxy::shutDownProcess):
1754         (WebKit::AuxiliaryProcessProxy::setProcessSuppressionEnabled):
1755         (WebKit::AuxiliaryProcessProxy::connectionWillOpen):
1756         (WebKit::ChildProcessProxy::ChildProcessProxy): Deleted.
1757         (WebKit::ChildProcessProxy::~ChildProcessProxy): Deleted.
1758         (WebKit::ChildProcessProxy::getLaunchOptions): Deleted.
1759         (WebKit::ChildProcessProxy::connect): Deleted.
1760         (WebKit::ChildProcessProxy::terminate): Deleted.
1761         (WebKit::ChildProcessProxy::state const): Deleted.
1762         (WebKit::ChildProcessProxy::sendMessage): Deleted.
1763         (WebKit::ChildProcessProxy::addMessageReceiver): Deleted.
1764         (WebKit::ChildProcessProxy::removeMessageReceiver): Deleted.
1765         (WebKit::ChildProcessProxy::dispatchMessage): Deleted.
1766         (WebKit::ChildProcessProxy::dispatchSyncMessage): Deleted.
1767         (WebKit::ChildProcessProxy::didFinishLaunching): Deleted.
1768         (WebKit::ChildProcessProxy::shutDownProcess): Deleted.
1769         (WebKit::ChildProcessProxy::setProcessSuppressionEnabled): Deleted.
1770         (WebKit::ChildProcessProxy::connectionWillOpen): Deleted.
1771         * UIProcess/AuxiliaryProcessProxy.h: Copied from Source/WebKit/UIProcess/ChildProcessProxy.h.
1772         (WebKit::AuxiliaryProcessProxy::send):
1773         (WebKit::AuxiliaryProcessProxy::sendSync):
1774         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
1775         (WebKit::ChildProcessProxy::send): Deleted.
1776         (WebKit::ChildProcessProxy::sendSync): Deleted.
1777         (WebKit::ChildProcessProxy::connection const): Deleted.
1778         (WebKit::ChildProcessProxy::hasConnection const): Deleted.
1779         (WebKit::ChildProcessProxy::processIdentifier const): Deleted.
1780         (WebKit::ChildProcessProxy::canSendMessage const): Deleted.
1781         (WebKit::ChildProcessProxy::coreProcessIdentifier const): Deleted.
1782         (WebKit::ChildProcessProxy::platformGetLaunchOptions): Deleted.
1783         (WebKit::ChildProcessProxy::sendWithAsyncReply): Deleted.
1784         * UIProcess/ChildProcessProxy.cpp: Removed.
1785         * UIProcess/ChildProcessProxy.h: Removed.
1786         * UIProcess/Downloads/DownloadProxyMap.cpp:
1787         (WebKit::DownloadProxyMap::DownloadProxyMap):
1788         * UIProcess/Downloads/DownloadProxyMap.h:
1789         * UIProcess/Network/NetworkProcessProxy.cpp:
1790         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
1791         (WebKit::NetworkProcessProxy::getLaunchOptions):
1792         (WebKit::NetworkProcessProxy::createDownloadProxy):
1793         (WebKit::NetworkProcessProxy::didFinishLaunching):
1794         * UIProcess/Network/NetworkProcessProxy.h:
1795         * UIProcess/Plugins/PluginProcessProxy.cpp:
1796         (WebKit::PluginProcessProxy::getLaunchOptions):
1797         (WebKit::PluginProcessProxy::sendMemoryPressureEvent):
1798         * UIProcess/Plugins/PluginProcessProxy.h:
1799         * UIProcess/ServiceWorkerProcessProxy.h:
1800         * UIProcess/WebPageProxy.cpp:
1801         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1802         * UIProcess/WebProcessPool.cpp:
1803         (WebKit::WebProcessPool::sendMemoryPressureEvent):
1804         (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle):
1805         * UIProcess/WebProcessProxy.cpp:
1806         (WebKit::WebProcessProxy::WebProcessProxy):
1807         (WebKit::WebProcessProxy::getLaunchOptions):
1808         (WebKit::WebProcessProxy::didFinishLaunching):
1809         (WebKit::WebProcessProxy::maybeShutDown):
1810         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
1811         (WebKit::WebProcessProxy::shouldTerminate):
1812         (WebKit::WebProcessProxy::requestTermination):
1813         (WebKit::WebProcessProxy::canTerminateChildProcess): Deleted.
1814         * UIProcess/WebProcessProxy.h:
1815         * UnifiedSources-input.xcfilelist:
1816         * WebKit.xcodeproj/project.pbxproj:
1817         * WebProcess/WebProcess.cpp:
1818         (WebKit::WebProcess::initializeProcess):
1819         (WebKit::WebProcess::initializeConnection):
1820         (WebKit::WebProcess::terminate):
1821         (WebKit::WebProcess::didReceiveMessage):
1822         (WebKit::WebProcess::initializeProcessName):
1823         (WebKit::WebProcess::initializeSandbox):
1824         (WebKit::WebProcess::platformInitializeProcess):
1825         * WebProcess/WebProcess.h:
1826         * WebProcess/WebProcessSupplement.h:
1827         * WebProcess/cocoa/WebProcessCocoa.mm:
1828         (WebKit::WebProcess::initializeProcessName):
1829         (WebKit::WebProcess::platformInitializeProcess):
1830         (WebKit::WebProcess::stopRunLoop):
1831         (WebKit::WebProcess::initializeSandbox):
1832         * WebProcess/gtk/WebProcessMainGtk.cpp:
1833         (WebKit::WebProcessMainUnix):
1834         * WebProcess/win/WebProcessMainWin.cpp:
1835         (WebKit::WebProcessMainWin):
1836         * WebProcess/wpe/WebProcessMainWPE.cpp:
1837         (WebKit::WebProcessMainUnix):
1838
1839 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
1840
1841         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
1842         https://bugs.webkit.org/show_bug.cgi?id=193907
1843
1844         Reviewed by Frédéric Wang.
1845
1846         Remove encode/decode of removedNodes.
1847
1848         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1849         (WebKit::RemoteScrollingCoordinatorTransaction::encode const):
1850         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1851         (WebKit::dump):
1852
1853 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
1854
1855         StorageAccess API calls should be direct to the Network Process
1856         https://bugs.webkit.org/show_bug.cgi?id=193924
1857         <rdar://problem/47611249>
1858
1859         Reviewed by Alex Christensen.
1860
1861         Now that the ResourceLoadStatistics data lives in the Network Process, calls to Storage Access
1862         API should happen directly between the WebContent and Network processes.
1863
1864         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1865         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1866         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1867         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1868         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
1869         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
1870         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1871         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
1872         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
1873         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
1874         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
1875         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
1876         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
1877         * NetworkProcess/NetworkConnectionToWebProcess.h:
1878         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1879         * NetworkProcess/NetworkProcess.cpp:
1880         (WebKit::NetworkProcess::requestStorageAccess):
1881         (WebKit::NetworkProcess::requestStorageAccessGranted):
1882         * NetworkProcess/NetworkProcess.h:
1883         * UIProcess/Network/NetworkProcessProxy.cpp:
1884         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
1885         * UIProcess/Network/NetworkProcessProxy.h:
1886         * UIProcess/Network/NetworkProcessProxy.messages.in:
1887         * UIProcess/WebPageProxy.cpp:
1888         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1889         (WebKit::WebPageProxy::hasStorageAccess): Deleted.
1890         (WebKit::WebPageProxy::requestStorageAccess): Deleted.
1891         * UIProcess/WebPageProxy.h:
1892         * UIProcess/WebPageProxy.messages.in:
1893         * WebProcess/WebPage/WebPage.cpp:
1894         (WebKit::WebPage::hasStorageAccess):
1895         (WebKit::WebPage::requestStorageAccess):
1896         (WebKit::nextRequestStorageAccessContextId): Deleted.
1897         (WebKit::WebPage::storageAccessResponse): Deleted.
1898         * WebProcess/WebPage/WebPage.h:
1899         * WebProcess/WebPage/WebPage.messages.in:
1900
1901 2019-01-29  Chris Dumez  <cdumez@apple.com>
1902
1903         Regression (r240046): [PSON] Spurious changes to [WKWebView url] and [WKWebView loading] after [WKWebView loadRequest]
1904         https://bugs.webkit.org/show_bug.cgi?id=193967
1905         <rdar://problem/47635348>
1906
1907         Reviewed by Alex Christensen.
1908
1909         Update WebPageProxy::receivedPolicyDecision() to no longer clear the pending URL when we send PolicyAction::Ignore to
1910         the old process when the load is continuing in a new process due to PSON.
1911
1912         * UIProcess/WebPageProxy.cpp:
1913         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1914         (WebKit::WebPageProxy::receivedPolicyDecision):
1915         * UIProcess/WebPageProxy.h:
1916
1917 2019-01-29  Keith Rollin  <krollin@apple.com>
1918
1919         Add .xcfilelists to Run Script build phases
1920         https://bugs.webkit.org/show_bug.cgi?id=193792
1921         <rdar://problem/47201785>
1922
1923         Reviewed by Alex Christensen.
1924
1925         As part of supporting XCBuild, update the necessary Run Script build
1926         phases in their Xcode projects to refer to their associated
1927         .xcfilelist files.
1928
1929         Note that the addition of these files bumps the Xcode project version
1930         number to something that's Xcode 10 compatible. This change means that
1931         older versions of the Xcode IDE can't read these projects. Nor can it
1932         fully load workspaces that refer to these projects (the updated
1933         projects are shown as non-expandable placeholders). `xcodebuild` can
1934         still build these projects; it's just that the IDE can't open them.
1935
1936         Make special accommodations for incorporating .xcfilelists from
1937         WebKitAdditions.
1938
1939         * Configurations/Base.xcconfig:
1940         * Configurations/DebugRelease.xcconfig:
1941         * WebKit.xcodeproj/project.pbxproj:
1942
1943 2019-01-29  Antti Koivisto  <antti@apple.com>
1944
1945         REGRESSION (PSON): Flash on link navigation on Mac
1946         https://bugs.webkit.org/show_bug.cgi?id=193961
1947         <rdar://problem/47482507>
1948
1949         Reviewed by Chris Dumez.
1950
1951         The target page sends EnterAcceleratedCompositingMode message too early, before we have a valid layer tree.
1952
1953         * WebProcess/WebPage/DrawingArea.h:
1954         (WebKit::DrawingArea::attach): Deleted.
1955
1956         Not needed anymore.
1957
1958         * WebProcess/WebPage/WebPage.cpp:
1959         (WebKit::WebPage::reinitializeWebPage):
1960         (WebKit::WebPage::didCompletePageTransition):
1961         (WebKit::m_shouldAttachDrawingAreaOnPageTransition): Deleted.
1962
1963         Move message sending logic fully to TiledCoreAnimationDrawingArea.
1964         Unfreezing the layer tree is sufficient to trigger the message.
1965
1966         * WebProcess/WebPage/WebPage.h:
1967         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1968         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1969         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1970
1971         There is no need to treat process swap case differently.
1972
1973         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
1974
1975         Send this after the first successful layer flush with the root layer set.
1976
1977         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1978         (WebKit::TiledCoreAnimationDrawingArea::attach): Deleted.
1979
1980 2019-01-29  Timothy Hatcher  <timothy@apple.com>
1981
1982         Add back some includes that got removed at some point.
1983         https://bugs.webkit.org/show_bug.cgi?id=193942
1984
1985         Reviewed by Tim Horton.
1986
1987         * UIProcess/API/Cocoa/WKWebView.mm:
1988         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1989         * UIProcess/ios/PageClientImplIOS.h:
1990         * UIProcess/ios/PageClientImplIOS.mm:
1991
1992 2019-01-29  Chris Dumez  <cdumez@apple.com>
1993
1994         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
1995         https://bugs.webkit.org/show_bug.cgi?id=193848
1996
1997         Reviewed by Youenn Fablet.
1998
1999         * Platform/IPC/Connection.cpp:
2000         (IPC::Connection::Connection):
2001         * UIProcess/ChildProcessProxy.h:
2002         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2003         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2004         * UIProcess/WebBackForwardList.cpp:
2005         (WebKit::WebBackForwardList::restoreFromState):
2006         * UIProcess/WebProcessPool.cpp:
2007         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2008         (WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver):
2009
2010 2019-01-29  Chris Dumez  <cdumez@apple.com>
2011
2012         REGRESSION (PSON): Twitter link gets stuck at t.co after navigating back in tab
2013         https://bugs.webkit.org/show_bug.cgi?id=193932
2014         <rdar://problem/47598947>
2015
2016         Reviewed by Brady Eidson.
2017
2018         When doing a client side redirect from origin A to origin B, we would swap process and
2019         create a SuspendedPageProxy and save it on the source BackForwardListItem. The issue is
2020         that the BackForwardList is locked for such redirect so we end up updating the current
2021         BackForwardListItem with origin B's URL while origin A's suspended page remained on
2022         the item. When going to another URL in the same origin A, we would not create a suspended
2023         page since no process-swap would occur. When pressing the back button, we would go back
2024         to the previous BackForwardListItem and use its SuspendedPageProxy, which is for the
2025         wrong URL (The pre-client redirect one).
2026
2027         To address the issue, we no longer create a SuspendedPageProxy for cross-site client side
2028         redirects. There will be no way no go back to this suspended page anyway since the
2029         back/forward list item will be updated with the redirection URL.
2030
2031         * UIProcess/WebPageProxy.cpp:
2032         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2033
2034 2019-01-29  Chris Dumez  <cdumez@apple.com>
2035
2036         Regression(r240046) VoiceOver is no longer working after a process swap
2037         https://bugs.webkit.org/show_bug.cgi?id=193953
2038         <rdar://problem/47612398>
2039
2040         Reviewed by Alex Christensen.
2041
2042         ProvisionalPageProxy used to forward the RegisterWebProcessAccessibilityToken IPC from
2043         the provisional WebProcess to the WebPageProxy right away. This in turn would notify
2044         the PageClient whose logic would rely on WebPageProxy::process(), which returns the
2045         committed process instead of the provisional one.
2046
2047         To address the issue, the ProvisionalPageProxy now stores the token sent by the
2048         provisional WebProcess and we only call registerWebProcessAccessibilityToken()
2049         on the WebPageProxy *after* we've swapped to the provisional process.
2050
2051         * UIProcess/ProvisionalPageProxy.cpp:
2052         (WebKit::ProvisionalPageProxy::registerWebProcessAccessibilityToken):
2053         (WebKit::ProvisionalPageProxy::didReceiveMessage):
2054         * UIProcess/ProvisionalPageProxy.h:
2055         (WebKit::ProvisionalPageProxy::takeAccessibilityToken):
2056         * UIProcess/WebPageProxy.cpp:
2057         (WebKit::WebPageProxy::commitProvisionalPage):
2058
2059 2019-01-28  Ryosuke Niwa  <rniwa@webkit.org>
2060
2061         User agent string override for navigator.userAgent should be site specific quirks
2062         https://bugs.webkit.org/show_bug.cgi?id=193950
2063
2064         Reviewed by Brent Fulgham.
2065
2066         Renamed the various member variables, functions, properties and selectors.
2067
2068         * Shared/WebsitePoliciesData.cpp:
2069         (WebKit::WebsitePoliciesData::encode const):
2070         (WebKit::WebsitePoliciesData::decode):
2071         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2072         * Shared/WebsitePoliciesData.h:
2073         * UIProcess/API/APIWebsitePolicies.cpp:
2074         (API::WebsitePolicies::data):
2075         * UIProcess/API/APIWebsitePolicies.h:
2076         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2077         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2078         (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgent.
2079         (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgent.
2080
2081 2019-01-28  Commit Queue  <commit-queue@webkit.org>
2082
2083         Unreviewed, rolling out r240630.
2084         https://bugs.webkit.org/show_bug.cgi?id=193958
2085
2086         Broke Apple internal builds (Requested by rniwa on #webkit).
2087
2088         Reverted changeset:
2089
2090         "Add back some includes that got removed at some point."
2091         https://bugs.webkit.org/show_bug.cgi?id=193942
2092         https://trac.webkit.org/changeset/240630
2093
2094 2019-01-28  Devin Rousso  <drousso@apple.com>
2095
2096         Web Inspector: provide a way to edit page WebRTC settings on a remote target
2097         https://bugs.webkit.org/show_bug.cgi?id=193863
2098         <rdar://problem/47572764>
2099
2100         Reviewed by Joseph Pecoraro.
2101
2102         * Shared/WebPreferences.yaml:
2103         Add page-level settings for WebRTC preferences.
2104
2105 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
2106
2107         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
2108         https://bugs.webkit.org/show_bug.cgi?id=193941
2109
2110         Reviewed by Alex Christensen.
2111
2112         * Shared/linux/WebMemorySamplerLinux.cpp:
2113
2114 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
2115
2116         [Win] WebCore/platform/Process.h is conflicting with process.h
2117         https://bugs.webkit.org/show_bug.cgi?id=193944
2118
2119         Reviewed by Ross Kirsling.
2120
2121         * Shared/ChildProcess.h:
2122         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2123         * Shared/unix/ChildProcessMain.cpp:
2124         * UIProcess/API/APINavigation.h:
2125         * UIProcess/ChildProcessProxy.h:
2126         * UIProcess/Launcher/ProcessLauncher.h:
2127         * UIProcess/WebProcessPool.cpp:
2128         * UIProcess/WebProcessProxy.h:
2129
2130 2019-01-28  Jon Lee  <jonlee@apple.com>
2131
2132         Update Screen Capture preference
2133         https://bugs.webkit.org/show_bug.cgi?id=193947
2134         rdar://problem/47620199
2135
2136         Reviewed by Youenn Fablet.
2137
2138         * Shared/WebPreferences.yaml:
2139
2140 2019-01-28  Andy Estes  <aestes@apple.com>
2141
2142         [watchOS] Enable Parental Controls content filtering
2143         https://bugs.webkit.org/show_bug.cgi?id=193939
2144         <rdar://problem/46641912>
2145
2146         Reviewed by Ryosuke Niwa.
2147
2148         * Configurations/FeatureDefines.xcconfig:
2149
2150 2019-01-28  David Kilzer  <ddkilzer@apple.com>
2151
2152         REGRESSION (r236481): Move soft-linking of LocalAuthentication.framework out of LocalAuthenticationSoftLink.h
2153         <https://webkit.org/b/193884>
2154
2155         Reviewed by Jiewen Tan.
2156
2157         * SourcesCocoa.txt:
2158         * UnifiedSources-input.xcfilelist:
2159         * WebKit.xcodeproj/project.pbxproj:
2160         - Add LocalAuthenticationSoftLink.mm to the project.
2161
2162         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
2163         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h.
2164         - Move soft-linking implementation to
2165           LocalAuthenticationSoftLink.mm.
2166
2167 2019-01-28  Timothy Hatcher  <timothy@apple.com>
2168
2169         Add back some includes that got removed at some point.
2170         https://bugs.webkit.org/show_bug.cgi?id=193942
2171
2172         Reviewed by Tim Horton.
2173
2174         * UIProcess/API/Cocoa/WKWebView.mm:
2175         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2176         * UIProcess/ios/PageClientImplIOS.h:
2177         * UIProcess/ios/PageClientImplIOS.mm:
2178
2179 2019-01-28  Timothy Hatcher  <timothy@apple.com>
2180
2181         Make it easier for non-Apple ports to enable dark mode CSS support.
2182         https://bugs.webkit.org/show_bug.cgi?id=193882
2183
2184         Reviewed by Megan Gardner.
2185
2186         Make modern WebKit code for dark mode usable by other ports, to match
2187         the WebCore parts that have been cross-platform all along.
2188
2189         * Shared/WebPageCreationParameters.cpp:
2190         (WebKit::WebPageCreationParameters::encode const):
2191         (WebKit::WebPageCreationParameters::decode):
2192         * Shared/WebPageCreationParameters.h:
2193         * UIProcess/PageClient.h:
2194         (WebKit::PageClient::effectiveAppearanceIsDark const):
2195         * UIProcess/WebPageProxy.cpp:
2196         (WebKit::WebPageProxy::creationParameters):
2197         (WebKit::WebPageProxy::useDarkAppearance const):
2198         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
2199         * UIProcess/WebPageProxy.h:
2200         * WebProcess/WebPage/WebPage.cpp:
2201         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2202         (WebKit::WebPage::setUseDarkAppearance):
2203         * WebProcess/WebPage/WebPage.h:
2204         * WebProcess/WebPage/WebPage.messages.in:
2205
2206 2019-01-28  Andy Estes  <aestes@apple.com>
2207
2208         [Cocoa] Add SPI to _WKUserContentExtensionStore to retrieve its underlying WKContentRuleListStore
2209         https://bugs.webkit.org/show_bug.cgi?id=193927
2210
2211         Reviewed by Tim Horton.
2212
2213         This is useful for clients migrating from _WKUserContentExtensionStore to the modern
2214         WKContentRuleList* APIs.
2215
2216         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
2217         (-[_WKUserContentExtensionStore _contentRuleListStore]):
2218         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2219
2220 2019-01-28  David Kilzer  <ddkilzer@apple.com>
2221
2222         Move soft-linking of ManagedConfiguration.framework out of ManagedConfigurationSPI.h
2223         <https://webkit.org/b/193868>
2224
2225         Reviewed by Daniel Bates.
2226
2227         * Platform/spi/ios/ManagedConfigurationSPI.h:
2228         - Remove soft-linking code from header.
2229         - Add PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC) guard.
2230
2231         * UIProcess/ios/WKContentViewInteraction.mm:
2232         (-[WKContentView canPerformActionForWebView:withSender:]):
2233         (-[WKContentView _defineForWebView:]):
2234         - Add soft-linking code formerly in ManagedConfigurationSPI.h.
2235         - Change MCFeatureDefinitionLookupAllowed to use soft-link
2236           function getMCFeatureDefinitionLookupAllowed() to remove the
2237           #define.
2238
2239 2019-01-28  Per Arne Vollan  <pvollan@apple.com>
2240
2241         REGRESSION (r240348): Loading netflix home page panics device
2242         https://bugs.webkit.org/show_bug.cgi?id=193936
2243
2244         Reviewed by Alexey Proskuryakov.
2245
2246         Temporarily enable permissive call filtering.
2247
2248         * WebProcess/com.apple.WebProcess.sb.in:
2249
2250 2019-01-28  Joseph Pecoraro  <pecoraro@apple.com>
2251
2252         [iOS] Attempting to open a Keynote document to iCloud.com from iCloud Files causes crash
2253         https://bugs.webkit.org/show_bug.cgi?id=193456
2254         <rdar://problem/47275642>
2255
2256         Reviewed by Brent Fulgham.
2257
2258         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2259         Allow access to iconservices.
2260
2261 2019-01-28  Daniel Bates  <dabates@apple.com>
2262
2263         [iOS] Make Window virtual key code computation match Mac
2264         https://bugs.webkit.org/show_bug.cgi?id=193452
2265
2266         Reviewed by Ryosuke Niwa.
2267
2268         Compute the Windows virtual key code from the WebEvent.
2269
2270         * Shared/ios/WebIOSEventFactory.mm:
2271         (WebIOSEventFactory::createWebKeyboardEvent):
2272
2273 2019-01-28  Brent Fulgham  <bfulgham@apple.com>
2274
2275         REGRESSION (r240498): Storage Access API prompts result is not remembered
2276         https://bugs.webkit.org/show_bug.cgi?id=193922
2277         <rdar://problem/47608767>
2278
2279         Reviewed by Chris Dumez.
2280
2281         The refactoring in r240498 bypassed bookkeeping in ResourceLoadStatisticsMemoryStore
2282         that kept track of whether a successful user prompt had been encountered. This
2283         patch corrects this codepath so the user is not prompted repeatedly after approving
2284         use of the Storage Access API.
2285
2286         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2287         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Switch from Move operator to
2288         const reference to allow the method to be called by the NetworkProcess.
2289         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2290         * NetworkProcess/NetworkProcess.cpp:
2291         (WebKit::NetworkProcess::grantStorageAccess): Request access through the WebResourceLoadStatistics
2292         object, rather than jumping directly to the NetworkStorageSession.
2293
2294 2019-01-28  Chris Dumez  <cdumez@apple.com>
2295
2296         Regression(PSON) Crash under WebPageProxy::didStartProgress()
2297         https://bugs.webkit.org/show_bug.cgi?id=193915
2298         <rdar://problem/47560907>
2299
2300         Reviewed by Alex Christensen.
2301
2302         * UIProcess/WebPageProxy.cpp:
2303         (WebKit::WebPageProxy::close):
2304         Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
2305         IPC after this or even worse, commit the provisional page.
2306
2307         (WebKit::WebPageProxy::didStartProgress):
2308         Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
2309         closed.
2310
2311 2019-01-28  Antoine Quint  <graouts@apple.com>
2312
2313         Limit user-agent interactions based on the touch-action property on iOS
2314         https://bugs.webkit.org/show_bug.cgi?id=193447
2315
2316         Unreviewed build fix.
2317
2318         * UIProcess/API/Cocoa/WKWebView.mm:
2319
2320 2019-01-28  Antoine Quint  <graouts@apple.com>
2321
2322         Limit user-agent interactions based on the touch-action property on iOS
2323         https://bugs.webkit.org/show_bug.cgi?id=193447
2324
2325         Unreviewed build fix.
2326
2327         * UIProcess/ios/WKContentViewInteraction.mm:
2328
2329 2019-01-28  Brent Fulgham  <bfulgham@apple.com>
2330
2331         Remove the UIProcess components of the ResourceLoadStatistics code
2332         https://bugs.webkit.org/show_bug.cgi?id=193303
2333         <rdar://problem/47160073>
2334
2335         Reviewed by Chris Dumez.
2336
2337         Now that the ResourceLoadStatistics code is running in the NetworkProcess, we can get rid
2338         of the UIProcess copies of these routines.
2339
2340         Tested by existing ResourceLoadStatistics and StorageAccess tests.
2341
2342         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2343         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
2344         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2345         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
2346         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2347         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2348         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
2349         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
2350         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
2351         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
2352         (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
2353         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
2354         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
2355         (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
2356         (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
2357         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2358         * UIProcess/WebProcessProxy.cpp:
2359         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2360         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2361         * UIProcess/WebProcessProxy.h:
2362         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2363         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
2364         (WebKit::WebsiteDataStore::removeData):
2365         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
2366         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
2367         (WebKit::WebsiteDataStore::setGrandfatheringTime):
2368         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
2369         (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
2370         (WebKit::WebsiteDataStore::isPrevalentResource):
2371         (WebKit::WebsiteDataStore::setPrevalentResource):
2372         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2373         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2374         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2375         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2376         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
2377         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2378         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
2379         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2380         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2381         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2382         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2383         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2384         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2385         (WebKit::WebsiteDataStore::clearPrevalentResource):
2386         (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
2387         (WebKit::WebsiteDataStore::submitTelemetry):
2388         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
2389         (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
2390         (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
2391         (WebKit::WebsiteDataStore::setLastSeen):
2392         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
2393         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
2394         (WebKit::WebsiteDataStore::hasStorageAccess):
2395         (WebKit::WebsiteDataStore::requestStorageAccess):
2396         (WebKit::WebsiteDataStore::grantStorageAccess):
2397         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
2398         (WebKit::WebsiteDataStore::logUserInteraction):
2399         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2400         (WebKit::WebsiteDataStore::clearUserInteraction):
2401         (WebKit::WebsiteDataStore::setGrandfathered):
2402         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
2403         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
2404         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
2405         (WebKit::WebsiteDataStore::didCreateNetworkProcess):
2406         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2407         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Deleted.
2408         (WebKit::WebsiteDataStore::setCacheMaxAgeCap): Deleted.
2409         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor): Deleted.
2410         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies): Deleted.
2411         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler): Deleted.
2412         (WebKit::WebsiteDataStore::grantStorageAccessHandler): Deleted.
2413         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler): Deleted.
2414         (WebKit::WebsiteDataStore::removePrevalentDomains): Deleted.
2415         (WebKit::WebsiteDataStore::isGrandfathered): Deleted.
2416         * UIProcess/WebsiteData/WebsiteDataStore.h:
2417
2418 2019-01-28  Antoine Quint  <graouts@apple.com>
2419
2420         Limit user-agent interactions based on the touch-action property on iOS
2421         https://bugs.webkit.org/show_bug.cgi?id=193447
2422         <rdar://problem/47283874>
2423
2424         Reviewed by Antti Koivisto and Simon Fraser.
2425
2426         Handle the "none", "pan-x", "pan-y" and "pinch-zoom" values for the touch-action property by querying the scrolling tree whenever a touch begins
2427         to identify whether its point is contained within the region of an element with a non-auto touch-action property. If it is, we use the list of
2428         permitted touch actions such to then customize the behavior of the nearest scroll view to pan or zoom only as instructed.
2429
2430         * Shared/WebCoreArgumentCoders.cpp:
2431         (IPC::ArgumentCoder<TouchActionData>::encode):
2432         (IPC::ArgumentCoder<TouchActionData>::decode):
2433         (IPC::ArgumentCoder<EventTrackingRegions>::encode):
2434         (IPC::ArgumentCoder<EventTrackingRegions>::decode):
2435         (IPC::ArgumentCoder<Region>::decode):
2436         * Shared/WebCoreArgumentCoders.h:
2437         * UIProcess/API/Cocoa/WKWebView.mm:
2438         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Account for panning constraints set on the content view to prevent deceleration
2439         to pan the view if it ought not.
2440         (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Implement an additional
2441         UIScrollView delegation method to apply the panning constraints set on the content view while panning.
2442         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2443         (WebKit::RemoteScrollingCoordinatorProxy::touchActionDataAtPoint const):
2444         (WebKit::RemoteScrollingCoordinatorProxy::touchActionDataForScrollNodeID const):
2445         (WebKit::RemoteScrollingCoordinatorProxy::setTouchDataForTouchIdentifier):
2446         (WebKit::RemoteScrollingCoordinatorProxy::clearTouchDataForTouchIdentifier):
2447         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2448         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2449         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2450         (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Apply the same logic as in WKWebView.
2451         (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Apply
2452         the same logic as in WKWebView.
2453         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::touchActionData const):
2454         * UIProcess/WebPageProxy.h:
2455         (WebKit::WebPageProxy::isScrollingOrZooming const):
2456         * UIProcess/ios/WKContentViewInteraction.h:
2457         * UIProcess/ios/WKContentViewInteraction.mm:
2458         (-[WKContentView preventsPanningInXAxis]):
2459         (-[WKContentView preventsPanningInYAxis]):
2460         (-[WKContentView cleanupInteraction]):
2461         (-[WKContentView _webTouchEventsRecognized:]):
2462         (-[WKContentView _handleTouchActionsForTouchEvent:]): As we process touches, check whether there are touch actions set for this touch's points' locations. Based
2463         on those touch actions, either setDefaultPrevented on the _touchEventGestureRecognizer if the touch action is "none" or selectively disable panning and zooming.
2464         (-[WKContentView _resetPanningPreventionFlags]):
2465         (-[WKContentView _didEndScrollingOrZooming]):
2466
2467 2019-01-28  Antti Koivisto  <antti@apple.com>
2468
2469         WebUserContentController::removeUserScriptMessageHandlerInternal may deref and delete itself
2470         https://bugs.webkit.org/show_bug.cgi?id=193901
2471         <rdar://problem/47338669>
2472
2473         Reviewed by David Kilzer.
2474
2475         Don't know how to repro.
2476
2477         * WebProcess/UserContent/WebUserContentController.cpp:
2478         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
2479
2480         Calling userMessageHandlers.removeFirstMatching() may remove the last ref to this
2481         (because WebUserMessageHandlerDescriptorProxy refs WebUserContentController).
2482         Fix by protecting this over the function.
2483
2484 2018-12-15  Darin Adler  <darin@apple.com>
2485
2486         Replace many uses of String::format with more type-safe alternatives
2487         https://bugs.webkit.org/show_bug.cgi?id=192742
2488
2489         Reviewed by Mark Lam.
2490
2491         * Shared/WebMemorySampler.cpp:
2492         (WebKit::WebMemorySampler::writeHeaders): Use makeString.
2493
2494         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2495         (WebKit::LocalAuthenticator::makeCredential): Use string concatentation.
2496
2497         * UIProcess/WebInspectorUtilities.cpp:
2498         (WebKit::inspectorPageGroupIdentifierForPage): Use makeString.
2499         * UIProcess/WebProcessPool.cpp:
2500         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
2501         (WebKit::WebProcessPool::startMemorySampler): Ditto.
2502
2503 2019-01-27  Jiewen Tan  <jiewen_tan@apple.com>
2504
2505         Use a load optimizer for some sites
2506         https://bugs.webkit.org/show_bug.cgi?id=193881
2507         <rdar://problem/46325455>
2508
2509         Reviewed by Brent Fulgham.
2510
2511         We will try to speed up some sites with a dedicated load optimizer. The load optimizer lives
2512         within the WebsiteDataStore as one client instance should have only one and it should live
2513         as long as the client lives. How does the load optimizer work? It intercepts every load in
2514         the navigation state. If a request meets some requirements, it will then fetch the request
2515         from its own cache. Once the fetch succeeds, the original load will be ignored and the
2516         optimizer will display the cached content.
2517
2518         Covered by API tests.
2519
2520         * SourcesCocoa.txt:
2521         * UIProcess/Cocoa/LoadOptimizer.h: Added.
2522         * UIProcess/Cocoa/LoadOptimizer.mm: Added.
2523         * UIProcess/Cocoa/MediaCaptureUtilities.h:
2524         * UIProcess/Cocoa/NavigationState.mm:
2525         (WebKit::tryInterceptNavigation):
2526         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2527         (WebKit::tryAppLink): Deleted.
2528         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2529         (WebKit::WebsiteDataStore::WebsiteDataStore):
2530         * UIProcess/WebsiteData/WebsiteDataStore.h:
2531         (WebKit::WebsiteDataStore::loadOptimizer):
2532         * WebKit.xcodeproj/project.pbxproj:
2533
2534 2019-01-25  Brian Burg  <bburg@apple.com>
2535
2536         Web Automation: add support for simulating single touches to Automation.performInteractionSequence
2537         https://bugs.webkit.org/show_bug.cgi?id=193852
2538         <rdar://problem/28360781>
2539
2540         Reviewed by Joseph Pecoraro and Simon Fraser.
2541
2542         This patch makes it possible to simulate touches via the Actions API. The approach is to
2543         use a stripped down version of HIDEventGenerator to send HID events to the UIWindow.
2544         The initial version supports a single touch point; this may be expanded if needed, but
2545         so far it hasn't been an impediment when running desktop-oriented WebDriver test suites.
2546
2547         As part of implementing this support, I went through and added [somewhat obnoxious] ENABLE()
2548         guards so that we don't mistakenly compile mouse support on iOS and touch on Mac,
2549         and vice versa. Each of the interaction methods---touch, mouse, keyboard---can be independently
2550         compiled out. If none is supported (i.e., Windows), then we don't even try to compile
2551         platformSimulate*Interaction methods or SimulatedInputDispatcher. This allows WebAutomationSession
2552         to not include members and code that are never going to be used on a particular platform.
2553
2554         This functionality is covered by existing WebDriver test suites that use Element Click command.
2555         Additional tests that explicitly include 'touch' pointerType will be submitted to WPT later.
2556
2557         * UIProcess/Automation/Automation.json: Update comment.
2558
2559         * UIProcess/Automation/SimulatedInputDispatcher.h:
2560         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2561         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
2562         - Add appropriate guards for code specific to each interaction type.
2563         - Handle SimulatedInputSourceType::Touch and call out to dispatch events.
2564
2565         * UIProcess/Automation/WebAutomationSession.h:
2566         * UIProcess/Automation/WebAutomationSession.cpp:
2567         (WebKit::WebAutomationSession::WebAutomationSession):
2568         (WebKit::WebAutomationSession::terminate):
2569         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
2570         (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
2571         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
2572         (WebKit::WebAutomationSession::willClosePage):
2573         Add appropriate guards for code specific to each interaction type.
2574
2575         (WebKit::WebAutomationSession::isSimulatingUserInteraction const):
2576         Add new hook so that we can detect when a touch simulation is in progress.
2577         We don't rely on checking WebKit's event queue, so use a flag.
2578
2579         (WebKit::WebAutomationSession::simulateTouchInteraction):
2580         (WebKit::WebAutomationSession::performMouseInteraction):
2581         (WebKit::WebAutomationSession::performKeyboardInteractions):
2582         (WebKit::WebAutomationSession::cancelInteractionSequence):
2583         (WebKit::WebAutomationSession::performInteractionSequence):
2584         - Add appropriate guards for code specific to each interaction type.
2585         - Bail out immediately if a requested interaction type is not supported.
2586         - Shim Touch input type to Mouse if mouse is not supported but touches are.
2587         Nearly all WebDriver tests in the wild will be requesting a 'mouse' pointerType,
2588         so this is necessary for compatibility. It's easier to shim at this level than try
2589         to implement platformSimulateMouseInteraction for iOS because
2590         platformSimulateMouseinteraction does not use a completion handler but the iOS
2591         implementation would require that.
2592
2593         (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Deleted.
2594         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Deleted.
2595         - Remove these stubs. Platform methods of this class are no longer being filled
2596         with stubs on unsupported platforms because we expect the command to fail earlier.
2597
2598         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
2599         (WebKit::WebAutomationSession::platformSimulateTouchInteraction):
2600         - Add appropriate guards for code specific to each interaction type.
2601         - Implement new platform method to simulate touches. This uses _WKTouchEventGenerator.
2602
2603         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2604         Add appropriate guards for code specific to each interaction type.
2605
2606         * UIProcess/_WKTouchEventGenerator.h: Added.
2607         * UIProcess/_WKTouchEventGenerator.mm: Added.
2608         (simpleCurveInterpolation):
2609         (calculateNextCurveLocation):
2610         (delayBetweenMove):
2611         (+[_WKTouchEventGenerator sharedTouchEventGenerator]):
2612         (+[_WKTouchEventGenerator nextEventCallbackID]):
2613         (-[_WKTouchEventGenerator init]):
2614         (-[_WKTouchEventGenerator dealloc]):
2615         (-[_WKTouchEventGenerator _createIOHIDEventType:]):
2616         (-[_WKTouchEventGenerator _sendHIDEvent:]):
2617         (-[_WKTouchEventGenerator _sendMarkerHIDEventWithCompletionBlock:]):
2618         (-[_WKTouchEventGenerator _updateTouchPoints:count:]):
2619         (-[_WKTouchEventGenerator touchDownAtPoints:touchCount:]):
2620         (-[_WKTouchEventGenerator touchDown:touchCount:]):
2621         (-[_WKTouchEventGenerator touchDown:]):
2622         (-[_WKTouchEventGenerator liftUpAtPoints:touchCount:]):
2623         (-[_WKTouchEventGenerator liftUp:touchCount:]):
2624         (-[_WKTouchEventGenerator liftUp:]):
2625         (-[_WKTouchEventGenerator moveToPoints:touchCount:duration:]):
2626         (-[_WKTouchEventGenerator touchDown:completionBlock:]):
2627         (-[_WKTouchEventGenerator liftUp:completionBlock:]):
2628         (-[_WKTouchEventGenerator moveToPoint:duration:completionBlock:]):
2629         (-[_WKTouchEventGenerator receivedHIDEvent:]):
2630         Copied and simplified from HIDEventGenerator in WebKitTestRunner.
2631
2632         * WebKit.xcodeproj/project.pbxproj:
2633         Add _WKTouchEventGenerator.{h,mm} and make it a private header. The client needs to
2634         route received HID events to -receivedHIDEvent: in order to detect when the marker
2635         HID event has been processed (and thus the interaction is completed).
2636
2637         * config.h: Add ENABLE(WEBDRIVER_*_INTERACTIONS) macros here.
2638
2639 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
2640
2641         Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
2642         https://bugs.webkit.org/show_bug.cgi?id=193879
2643
2644         Reviewed by Antti Koivisto.
2645
2646         Need a specialization of dump() for ScrollingStateFrameHostingNode to avoid infinite recursion.
2647
2648         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2649         (WebKit::dump):
2650
2651 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
2652
2653         AX: Introduce a static accessibility tree
2654         https://bugs.webkit.org/show_bug.cgi?id=193348
2655         <rdar://problem/47203295>
2656
2657         Reviewed by Ryosuke Niwa.
2658
2659         * Configurations/FeatureDefines.xcconfig:
2660         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2661         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
2662
2663 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
2664
2665         Allow scrolling tree nodes to exist in a detached state
2666         https://bugs.webkit.org/show_bug.cgi?id=193754
2667
2668         Reviewed by Zalan Bujtas.
2669
2670         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2671         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2672
2673 2019-01-25  Tim Horton  <timothy_horton@apple.com>
2674
2675         REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter
2676         https://bugs.webkit.org/show_bug.cgi?id=193860
2677         <rdar://problem/47535022>
2678
2679         Reviewed by Antti Koivisto.
2680
2681         * UIProcess/Cocoa/ViewGestureController.cpp:
2682         (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
2683         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
2684         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
2685         * UIProcess/Cocoa/ViewGestureController.h:
2686         Treat provisional load and same document load the same: they already both
2687         unpause the snapshot removal tracker, request render tree size notifications,
2688         but same-document navigation was missing the call to dispatchAfterEnsuringDrawing
2689         and thus would get stuck waiting for RepaintAfterNavigation.
2690
2691 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2692
2693         Need a mechanism to override navigator.userAgent
2694         https://bugs.webkit.org/show_bug.cgi?id=193762
2695         <rdar://problem/47504939>
2696
2697         Reviewed by Brent Fulgham.
2698
2699         This patch adds a new _WKWebsitePolicies SPI to specify the user agent string returned by
2700         navigator.userAgent without affecting the user agent string used to send network requests.
2701
2702         Tests: WebKit.WebsitePoliciesCustomJavaScriptUserAgent
2703                WebKit.WebsitePoliciesCustomUserAgents
2704
2705         * Shared/WebsitePoliciesData.cpp:
2706         (WebKit::WebsitePoliciesData::encode const):
2707         (WebKit::WebsitePoliciesData::decode):
2708         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2709         * Shared/WebsitePoliciesData.h:
2710         * UIProcess/API/APIWebsitePolicies.cpp:
2711         (API::WebsitePolicies::data):
2712         * UIProcess/API/APIWebsitePolicies.h:
2713         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2714         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2715         (-[_WKWebsitePolicies setCustomJavaScriptUserAgent:]):
2716         (-[_WKWebsitePolicies customJavaScriptUserAgent]):
2717
2718 2019-01-25  Devin Rousso  <drousso@apple.com>
2719
2720         Web Inspector: provide a way to edit page settings on a remote target
2721         https://bugs.webkit.org/show_bug.cgi?id=193813
2722         <rdar://problem/47359510>
2723
2724         Reviewed by Joseph Pecoraro.
2725
2726         * WebProcess/WebPage/WebInspectorUI.h:
2727         (WebKit::WebInspectorUI::isRemote() const): Added.
2728         * WebProcess/WebPage/RemoteWebInspectorUI.h:
2729         (WebKit::RemoteWebInspectorUI::isRemote() const): Added.
2730
2731 2019-01-25  Dean Jackson  <dino@apple.com>
2732
2733         REGRESSION: Some USDz from 3rd party websites don't go directly to AR QL
2734         https://bugs.webkit.org/show_bug.cgi?id=193831
2735         <rdar://problem/47399263>
2736
2737         Reviewed by Chris Dumez.
2738
2739         A System Preview (<a rel="ar">) displays in a modal and doesn't trigger
2740         a navigation. If the link was cross origin, it was causing a process swap,
2741         which meant that the response defaulted back to a navigation.
2742
2743         The fix is to not cause a PSON when the navigation is a system preview.
2744
2745         * UIProcess/API/APINavigation.h:
2746         (API::Navigation::shouldForceDownload const): This is now just tracking
2747         the "download" attribute, and not including System Preview.
2748         (API::Navigation::isSystemPreview const): New method to check for a
2749         navigation triggered as a System Preview.
2750         * UIProcess/WebPageProxy.cpp: Move the code from receivedPolicyDecision to
2751         receivedNavigationPolicyDecision, so that downloads and System Previews are
2752         detected before we decide to change process.
2753         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2754         (WebKit::WebPageProxy::receivedPolicyDecision):
2755
2756 2019-01-25  Tim Horton  <timothy_horton@apple.com>
2757
2758         Find-in-page on nyt.com scrolls around without touching the screen when find holes are visible
2759         https://bugs.webkit.org/show_bug.cgi?id=193853
2760
2761         Reviewed by Simon Fraser.
2762
2763         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2764         (WebKit::FindController::updateFindIndicator):
2765         There is no reason to scroll/zoom to the find indicator just because the
2766         holes are up, we should only do it on initial indicator presentation.
2767         This was a mistake in r178755 that was previously never exercised because
2768         isShowingOverlay was always false.
2769
2770 2019-01-25  Keith Rollin  <krollin@apple.com>
2771
2772         Update Xcode projects with "Check .xcfilelists" build phase
2773         https://bugs.webkit.org/show_bug.cgi?id=193790
2774         <rdar://problem/47201374>
2775
2776         Reviewed by Alex Christensen.
2777
2778         Support for XCBuild includes specifying inputs and outputs to various
2779         Run Script build phases. These inputs and outputs are specified as
2780         .xcfilelist files. Once created, these .xcfilelist files need to be
2781         kept up-to-date. In order to check that they are up-to-date or not,
2782         add an Xcode build step that invokes an external script that performs
2783         the checking. If the .xcfilelists are found to be out-of-date, update
2784         them, halt the build, and instruct the developer to restart the build
2785         with up-to-date files.
2786
2787         At this time, the checking and regenerating is performed only if the
2788         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
2789         who want to use this facility can set this variable and test out the
2790         checking/regenerating. Once it seems like there are no egregious
2791         issues that upset a developer's workflow, we'll unconditionally enable
2792         this facility.
2793
2794         * Scripts/check-xcfilelists.sh: Added.
2795         * WebKit.xcodeproj/project.pbxproj:
2796
2797 2019-01-25  Alex Christensen  <achristensen@webkit.org>
2798
2799         Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess
2800         https://bugs.webkit.org/show_bug.cgi?id=193844
2801
2802         Reviewed by Andy Estes.
2803
2804         This simplifies ChildProcess and removes NetworkProcess-specific code from this generic abstraction.
2805
2806         * NetworkProcess/mac/NetworkProcessMac.mm:
2807         (WebKit::NetworkProcess::initializeProcess):
2808         * Shared/ios/ChildProcessIOS.mm:
2809         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
2810         * Shared/mac/ChildProcessMac.mm:
2811         (WebKit::ChildProcess::setApplicationIsDaemon): Deleted.
2812
2813 2019-01-25  Keith Rollin  <krollin@apple.com>
2814
2815         Update Xcode projects with "Apply Configuration to XCFileLists" build target
2816         https://bugs.webkit.org/show_bug.cgi?id=193781
2817         <rdar://problem/47201153>
2818
2819         Reviewed by Alex Christensen.
2820
2821         Part of generating the .xcfilelists used as part of adopting XCBuild
2822         includes running `make DerivedSources.make` from a standalone script.
2823         It’s important for this invocation to have the same environment as
2824         when the actual build invokes `make DerivedSources.make`. If the
2825         environments are different, then the two invocations will provide
2826         different results. In order to get the same environment in the
2827         standalone script, have the script launch xcodebuild targeting the
2828         "Apply Configuration to XCFileLists" build target, which will then
2829         re-invoke our standalone script. The script is now running again, this
2830         time in an environment with all workspace, project, target, xcconfig
2831         and other environment variables established.
2832
2833         The "Apply Configuration to XCFileLists" build target accomplishes
2834         this task via a small embedded shell script that consists only of:
2835
2836             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
2837
2838         The process that invokes "Apply Configuration to XCFileLists" first
2839         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
2840         evaluated and exports it into the shell environment. When xcodebuild
2841         is invoked, it inherits the value of this variable and can `eval` the
2842         contents of that variable. Our external standalone script can then set
2843         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
2844         of command-line parameters needed to restart itself in the appropriate
2845         state.
2846
2847         * WebKit.xcodeproj/project.pbxproj:
2848
2849 2019-01-25  Alex Christensen  <achristensen@webkit.org>
2850
2851         Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning
2852         https://bugs.webkit.org/show_bug.cgi?id=193802
2853         <rdar://problem/46010580>
2854
2855         Reviewed by Andy Estes.
2856
2857         * UIProcess/API/APIUIClient.h:
2858         (API::UIClient::didClickGoBackFromSafeBrowsingWarning):
2859         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2860         * UIProcess/Cocoa/UIDelegate.h:
2861         * UIProcess/Cocoa/UIDelegate.mm:
2862         (WebKit::UIDelegate::setDelegate):
2863         (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning):
2864         * UIProcess/WebPageProxy.cpp:
2865         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2866
2867 2019-01-25  Daniel Bates  <dabates@apple.com>
2868
2869         [iOS] Pressing Tab key doesn't move to next cell with Google Sheets
2870         https://bugs.webkit.org/show_bug.cgi?id=193048
2871         <rdar://problem/46433836>
2872
2873         Reviewed by Brent Fulgham.
2874
2875         WebCore knows how interpret the Tab and Shift + Tab keys. When building with UIKit keyboard additions
2876         we do not need to register key commands for handling them from the UIProcess code. Instead UIKit will
2877         sends key events for these commands to us. This will make the behavior of these key commands when executed
2878         in an editable field match the behavior of these command when executed in a non-editable field since
2879         both code paths will now go through WebCore.
2880
2881         * UIProcess/ios/WKContentViewInteraction.mm:
2882         (-[WKContentView keyCommands]): Only compile when building with !USE(UIKIT_KEYBOARD_ADDITIONS).
2883
2884 2019-01-25  Alex Christensen  <achristensen@webkit.org>
2885
2886         Fix Linux build.
2887
2888         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2889         (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate):
2890
2891 2019-01-25  Keith Rollin  <krollin@apple.com>
2892
2893         Update WebKitAdditions.xcconfig with correct order of variable definitions
2894         https://bugs.webkit.org/show_bug.cgi?id=193793
2895         <rdar://problem/47532439>
2896
2897         Reviewed by Alex Christensen.
2898
2899         XCBuild changes the way xcconfig variables are evaluated. In short,
2900         all config file assignments are now considered in part of the
2901         evaluation. When using the new build system and an .xcconfig file
2902         contains multiple assignments of the same build setting:
2903
2904         - Later assignments using $(inherited) will inherit from earlier
2905           assignments in the xcconfig file.
2906         - Later assignments not using $(inherited) will take precedence over
2907           earlier assignments. An assignment to a more general setting will
2908           mask an earlier assignment to a less general setting. For example,
2909           an assignment without a condition ('FOO = bar') will completely mask
2910           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
2911
2912         This affects some of our .xcconfig files, in that sometimes platform-
2913         or sdk-specific definitions appear before the general definitions.
2914         Under the new evaluations rules, the general definitions alway take
2915         effect because they always overwrite the more-specific definitions. The
2916         solution is to swap the order, so that the general definitions are
2917         established first, and then conditionally overwritten by the
2918         more-specific definitions.
2919
2920         * Configurations/BaseTarget.xcconfig:
2921         * Configurations/Version.xcconfig:
2922         * Configurations/WebKit.xcconfig:
2923
2924 2019-01-25  Keith Rollin  <krollin@apple.com>
2925
2926         Update existing .xcfilelists
2927         https://bugs.webkit.org/show_bug.cgi?id=193791
2928         <rdar://problem/47201706>
2929
2930         Reviewed by Alex Christensen.
2931
2932         Many .xcfilelist files were added in r238824 in order to support
2933         XCBuild. Update these with recent changes to the set of build files
2934         and with the current generate-xcfilelist script.
2935
2936         * DerivedSources-input.xcfilelist:
2937         * DerivedSources-output.xcfilelist:
2938         * UnifiedSources-input.xcfilelist:
2939         * UnifiedSources-output.xcfilelist:
2940
2941 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
2942
2943         [iOS] Deny mach lookups to services not used.
2944         https://bugs.webkit.org/show_bug.cgi?id=193828
2945
2946         Reviewed by Brent Fulgham.
2947
2948         Start denying mach lookups to iOS services, which were previously allowed with reporting.
2949         Living-on has indicated that these services are not used.
2950
2951         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2952
2953 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
2954
2955         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
2956         https://bugs.webkit.org/show_bug.cgi?id=193297
2957         <rdar://problem/47158841>
2958
2959         Reviewed by Alex Christensen.
2960
2961         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
2962         it off in the UIProcess. It also updates test infrastructure to work with this change
2963         in architecture.
2964
2965         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2966         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
2967         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
2968         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
2969         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2970         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
2971         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
2972         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
2973         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2974         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
2975         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
2976         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2977         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2978         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
2979         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
2980         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
2981         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2982         * NetworkProcess/NetworkSession.cpp:
2983         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
2984         * UIProcess/WebProcessPool.cpp:
2985         (WebKit::WebProcessPool::ensureNetworkProcess):
2986         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2987         (WebKit::WebsiteDataStore::parameters):
2988         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2989         (WebKit::WebsiteDataStore::removeData):
2990         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2991         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2992         * Webprocess/WebProcess.cpp:
2993         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
2994
2995 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2996
2997         iOS: inputmode="none" disables hardware keyboard's globe key
2998         https://bugs.webkit.org/show_bug.cgi?id=193811
2999         <rdar://problem/47406553>
3000
3001         Reviewed by Wenson Hsieh.
3002
3003         Removed the support for inputmode="none" for now since we need a new SPI from UIKit
3004         to properly implement this feature some time in the future.
3005
3006         * UIProcess/ios/WKContentViewInteraction.mm:
3007         (-[WKContentView _zoomToRevealFocusedElement]):
3008         (-[WKContentView inputView]):
3009         (-[WKContentView requiresAccessoryView]):
3010         (-[WKContentView textInputTraits]):
3011
3012 2019-01-25  David Kilzer  <ddkilzer@apple.com>
3013
3014         Move soft-linking of Lookup.framework out of LookupSPI.h
3015         <https://webkit.org/b/193815>
3016
3017         Reviewed by Tim Horton.
3018
3019         * UIProcess/Cocoa/WebViewImpl.mm:
3020         (-[WKWindowVisibilityObserver dealloc]):
3021         (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
3022         - Move soft-linking to LookupSoftLink.{h,mm}.
3023
3024 2019-01-25  Antti Koivisto  <antti@apple.com>
3025
3026         REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recognized as swipe gestures
3027         https://bugs.webkit.org/show_bug.cgi?id=193818
3028         <rdar://problem/47456584>
3029
3030         Reviewed by Tim Horton.
3031
3032         We don't hit the RenderTreeSizeThreshold milestone to remove the snapshot and allow interaction because we request it
3033         from a wrong process (the one we are leaving behind).
3034
3035         * UIProcess/Cocoa/ViewGestureController.cpp:
3036         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
3037
3038         Request the RenderTreeSizeThreshold notification when the load has started and we know the process to use.
3039
3040         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
3041         * UIProcess/Cocoa/ViewGestureController.h:
3042         (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
3043         (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
3044         * UIProcess/mac/ViewGestureControllerMac.mm:
3045         (WebKit::ViewGestureController::endSwipeGesture):
3046
3047         Don't request immediately, save the threshold to SnapshotRemovalTracker.
3048
3049         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
3050
3051         Do the request to the right process.
3052
3053         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3054         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold):
3055
3056         Ensure we send the notification even if we reached the threshold before it was requested.
3057
3058         (WebKit::ViewGestureGeometryCollector::sendDidHitRenderTreeSizeThresholdIfNeeded):
3059         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
3060         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
3061         (WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold): Deleted.
3062
3063 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3064
3065         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
3066         https://bugs.webkit.org/show_bug.cgi?id=193829
3067
3068         Reviewed by Tim Horton.
3069
3070         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3071         (WebKit::WebPageProxy::setDragCaretRect):
3072         * UIProcess/PageClient.h:
3073         * UIProcess/WebPageProxy.h:
3074         * UIProcess/WebPageProxy.messages.in:
3075         * UIProcess/ios/PageClientImplIOS.h:
3076         * UIProcess/ios/PageClientImplIOS.mm:
3077         (WebKit::PageClientImpl::didHandleDragStartRequest):
3078         (WebKit::PageClientImpl::didConcludeEditDrag):
3079         (WebKit::PageClientImpl::didChangeDragCaretRect):
3080         (WebKit::PageClientImpl::didHandleStartDataInteractionRequest): Deleted.
3081         (WebKit::PageClientImpl::didConcludeEditDataInteraction): Deleted.
3082         (WebKit::PageClientImpl::didChangeDataInteractionCaretRect): Deleted.
3083         * UIProcess/ios/WKContentViewInteraction.h:
3084         * UIProcess/ios/WKContentViewInteraction.mm:
3085         (-[WKContentView setupInteraction]):
3086         (-[WKContentView cleanupInteraction]):
3087         (-[WKContentView setupDragAndDropInteractions]):
3088         (-[WKContentView teardownDragAndDropInteractions]):
3089         (-[WKContentView _didHandleDragStartRequest:]):
3090         (-[WKContentView _didConcludeEditDrag:]):
3091         (-[WKContentView _didChangeDragCaretRect:currentRect:]):
3092         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
3093         (-[WKContentView setupDataInteractionDelegates]): Deleted.
3094         (-[WKContentView teardownDataInteractionDelegates]): Deleted.
3095         (-[WKContentView _didHandleStartDataInteractionRequest:]): Deleted.
3096         (-[WKContentView _didConcludeEditDataInteraction:]): Deleted.
3097         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): Deleted.
3098         * UIProcess/ios/WebPageProxyIOS.mm:
3099         (WebKit::WebPageProxy::didHandleDragStartRequest):
3100         (WebKit::WebPageProxy::requestDragStart):
3101         (WebKit::WebPageProxy::didConcludeEditDrag):
3102         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest): Deleted.
3103         (WebKit::WebPageProxy::requestStartDataInteraction): Deleted.
3104         (WebKit::WebPageProxy::didConcludeEditDataInteraction): Deleted.
3105         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3106         (WebKit::WebDragClient::didConcludeEditDrag):
3107         * WebProcess/WebPage/WebPage.h:
3108         * WebProcess/WebPage/WebPage.messages.in:
3109         * WebProcess/WebPage/ios/WebPageIOS.mm:
3110         (WebKit::WebPage::requestDragStart):
3111         (WebKit::WebPage::requestAdditionalItemsForDragSession):
3112         (WebKit::WebPage::didConcludeEditDrag):
3113         (WebKit::WebPage::requestStartDataInteraction): Deleted.
3114         (WebKit::WebPage::didConcludeEditDataInteraction): Deleted.
3115
3116 2019-01-25  Alex Christensen  <achristensen@webkit.org>
3117
3118         WKWebView.goBack should reload if there is a safe browsing warning
3119         https://bugs.webkit.org/show_bug.cgi?id=193805
3120         <rdar://problem/46908216>
3121
3122         Reviewed by Geoff Garen.
3123
3124         If a WKWebView is showing a safe browsing warning and the user clicks a back button
3125         in the app which calls WKWebView.goBack, the WKWebView is in a state where it has not navigated yet,
3126         so actually going back will appear to the user to go back twice.  We can't just do nothing because the
3127         app is in a state where it is expecting a navigation to happen.  Reloading achieves what the user expects
3128         and makes the app work like the app expects.
3129
3130         * UIProcess/API/C/WKPage.cpp:
3131         (WKPageGoBack):
3132         * UIProcess/API/Cocoa/WKWebView.mm:
3133         (-[WKWebView goBack]):
3134         * UIProcess/PageClient.h:
3135         (WebKit::PageClient::hasSafeBrowsingWarning const):
3136         * UIProcess/mac/PageClientImplMac.h:
3137         * UIProcess/mac/PageClientImplMac.mm:
3138         (WebKit::PageClientImpl::hasSafeBrowsingWarning const):
3139
3140 2019-01-25  Chris Dumez  <cdumez@apple.com>
3141
3142         Regression(PSON) cross-site provisional page is not canceled if a new same-site one is started
3143         https://bugs.webkit.org/show_bug.cgi?id=193788
3144         <rdar://problem/47531231>
3145
3146         Reviewed by Alex Christensen.
3147
3148         When the page starts a new provisional load, make sure we cancel any pending one in the provisional
3149         process, as it would have happened in the first provisional load happened in the same process.
3150         Without this, we could have 2 parallel loads happening, one in the committed process and another
3151         in the provisional one, leading to assertion failures in debug.
3152
3153         * UIProcess/WebPageProxy.cpp:
3154         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
3155
3156 2019-01-25  Chris Dumez  <cdumez@apple.com>
3157
3158         Drop WebKit::WebKitPolicyAction type as it is no longer needed
3159         https://bugs.webkit.org/show_bug.cgi?id=193827
3160
3161         Reviewed by Antti Koivisto.
3162
3163         Drop WebKit::WebKitPolicyAction type as it is no longer needed. It is now identical to
3164         WebCore::PolicyAction.
3165
3166         * Shared/WebPolicyAction.h: Removed.
3167         * UIProcess/WebFramePolicyListenerProxy.cpp:
3168         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
3169         (WebKit::WebFramePolicyListenerProxy::use):
3170         (WebKit::WebFramePolicyListenerProxy::download):
3171         (WebKit::WebFramePolicyListenerProxy::ignore):
3172         * UIProcess/WebFramePolicyListenerProxy.h:
3173         * UIProcess/WebFrameProxy.cpp:
3174         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
3175         * UIProcess/WebFrameProxy.h:
3176         * UIProcess/WebPageProxy.cpp:
3177         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3178         (WebKit::WebPageProxy::receivedPolicyDecision):
3179         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3180         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3181         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3182         (WebKit::WebPageProxy::decidePolicyForResponseShared):
3183         * UIProcess/WebPageProxy.h:
3184         * WebKit.xcodeproj/project.pbxproj:
3185         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3186         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3187         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3188         * WebProcess/WebPage/WebFrame.cpp:
3189         (WebKit::WebFrame::didReceivePolicyDecision):
3190         (WebKit::toPolicyAction): Deleted.
3191         * WebProcess/WebPage/WebFrame.h:
3192         * WebProcess/WebPage/WebPage.cpp:
3193         (WebKit::WebPage::didReceivePolicyDecision):
3194         * WebProcess/WebPage/WebPage.h:
3195
3196 2019-01-25  Per Arne Vollan  <pvollan@apple.com>
3197
3198         [iOS] Add logging of calls
3199         https://bugs.webkit.org/show_bug.cgi?id=193784
3200
3201         Reviewed by Brent Fulgham.
3202
3203         Add permissive logging of calls on iOS.
3204
3205         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3206
3207 2019-01-25  Chris Dumez  <cdumez@apple.com>
3208
3209         Regression(PSON?) Crash under NavigationState::NavigationClient::decidePolicyForNavigationAction()
3210         https://bugs.webkit.org/show_bug.cgi?id=193779
3211         <rdar://problem/46170903>
3212
3213         Reviewed by Antti Koivisto.
3214
3215         * UIProcess/Cocoa/NavigationState.mm:
3216         (WebKit::tryAppLink):
3217         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3218         We were crashing when trying to get the URL of the main frame, which was sad because we never
3219         ended up using the main frame URL. Therefore, this patch drops the code in question.
3220
3221         * UIProcess/ProvisionalPageProxy.cpp:
3222         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
3223         Add assertion to make sure that the DecidePolicyForNavigationActionAsync IPC it is getting
3224         from the process is related to its main frame.
3225
3226 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3227
3228         Need a way for JavaScript (or bundle) code to participate in undo
3229         https://bugs.webkit.org/show_bug.cgi?id=190009
3230         <rdar://problem/44807048>
3231
3232         Reviewed by Ryosuke Niwa.
3233
3234         Invalidate undo steps when removing them from WebPage. Invalidation is a no-op for editing actions that come
3235         from the UA, but for custom undo steps backed by an UndoItem, we clear out the custom undo step's pointer to its
3236         UndoItem and additionally disconnect the UndoItem from its UndoManager.
3237
3238         * WebProcess/WebPage/WebPage.cpp:
3239         (WebKit::WebPage::addWebUndoStep):
3240         (WebKit::WebPage::removeWebEditCommand):
3241         * WebProcess/WebPage/WebUndoStep.h:
3242         (WebKit::WebUndoStep::invalidate):
3243
3244 2019-01-25  Patrick Griffis  <pgriffis@igalia.com>
3245
3246         [GTK][WPE] Add API to add paths to sandbox
3247         https://bugs.webkit.org/show_bug.cgi?id=193571
3248
3249         This allows applications to add paths to the web process
3250         if required by web extensions.
3251
3252         Reviewed by Michael Catanzaro.
3253
3254         * UIProcess/API/glib/WebKitWebContext.cpp:
3255         (webkit_web_context_add_path_to_sandbox):
3256         * UIProcess/API/gtk/WebKitWebContext.h:
3257         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3258         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
3259         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3260         (WebKit::bubblewrapSpawn):
3261         * UIProcess/WebProcessPool.h:
3262         * UIProcess/glib/WebProcessProxyGLib.cpp:
3263         (WebKit::WebProcessProxy::platformGetLaunchOptions):
3264
3265 2019-01-24  Ryosuke Niwa  <rniwa@webkit.org>
3266
3267         iOS: Split keyboard should not shrink visualViewport.height
3268         https://bugs.webkit.org/show_bug.cgi?id=193798
3269
3270         Reviewed by Tim Horton.
3271
3272         Treat a split keyboard like a floating keyboard and don't consider its input view bounds in computing the visible content rects.
3273
3274         No new tests since while it's possible to transition between split and merged keyboard using some SPI,
3275         there isn't a reliable mechanism to reset the keyboard state. e.g. we need to wait for a hard-coded amount of time.
3276
3277         * Platform/spi/ios/UIKitSPI.h:
3278         * UIProcess/API/Cocoa/WKWebView.mm:
3279         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
3280
3281 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
3282
3283         [iOS] Silence MediaPlayer compile warnings
3284         https://bugs.webkit.org/show_bug.cgi?id=193780
3285         <rdar://problem/47518428>
3286
3287         Reviewed by Jer Noble.
3288
3289         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3290
3291 2019-01-24  Truitt Savell  <tsavell@apple.com>
3292
3293         Unreviewed, rolling out r240446.
3294
3295         Casued 5 API failures
3296
3297         Reverted changeset:
3298
3299         "Activate the WebResourceLoadStatisticsStore in the
3300         NetworkProcess and deactivate it in the UIProcess."
3301         https://bugs.webkit.org/show_bug.cgi?id=193297
3302         https://trac.webkit.org/changeset/240446
3303
3304 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
3305
3306         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
3307         https://bugs.webkit.org/show_bug.cgi?id=193297
3308         <rdar://problem/47158841>
3309
3310         Reviewed by Alex Christensen.
3311
3312         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
3313         it off in the UIProcess. It also updates test infrastructure to work with this change
3314         in architecture.
3315
3316         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3317         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
3318         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
3319         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
3320         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3321         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
3322         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
3323         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
3324         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
3325         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
3326         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
3327         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3328         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3329         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
3330         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
3331         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
3332         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3333         * NetworkProcess/NetworkSession.cpp:
3334         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
3335         * UIProcess/WebProcessPool.cpp:
3336         (WebKit::WebProcessPool::ensureNetworkProcess):
3337         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3338         (WebKit::WebsiteDataStore::parameters):
3339         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3340         (WebKit::WebsiteDataStore::removeData):
3341         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
3342         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3343         * Webprocess/WebProcess.cpp:
3344         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
3345
3346 2019-01-24  John Wilander  <wilander@apple.com>
3347
3348         Add Ad Click Attribution as an internal/experimental feature
3349         https://bugs.webkit.org/show_bug.cgi?id=193685
3350         <rdar://problem/47450399>
3351
3352         Reviewed by Brent Fulgham.
3353
3354         * Shared/WebPreferences.yaml:
3355             Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
3356
3357 2019-01-24  Antti Koivisto  <antti@apple.com>
3358
3359         [PSON] Flash on back navigation on Mac
3360         https://bugs.webkit.org/show_bug.cgi?id=193716
3361         <rdar://problem/47148458>
3362
3363         Reviewed by Chris Dumez.
3364
3365         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
3366
3367         * UIProcess/SuspendedPageProxy.cpp:
3368         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
3369         (WebKit::SuspendedPageProxy::close):
3370
3371         Track closed state so we don't send the message twice, causing unhandled message errors in web process.
3372
3373         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3374
3375         Close the suspended page if the suspension fails.
3376         Skip this if we are using web process side compositing on Mac.
3377
3378         * UIProcess/SuspendedPageProxy.h:
3379         * UIProcess/WebPageProxy.cpp:
3380         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
3381
3382         On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
3383
3384         * UIProcess/WebProcessPool.cpp:
3385         (WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
3386         * UIProcess/WebProcessPool.h:
3387         * WebProcess/WebPage/WebPage.cpp:
3388         (WebKit::WebPage::suspendForProcessSwap):
3389
3390         Don't close the page on suspension failure. This is now managed by the UI process.
3391
3392 2019-01-24  Chris Dumez  <cdumez@apple.com>
3393
3394         Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
3395         https://bugs.webkit.org/show_bug.cgi?id=193761
3396         <rdar://problem/47456405>
3397
3398         Reviewed by Alex Christensen.
3399
3400         When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
3401         to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
3402         navigate to the expected back/forward list item.
3403
3404         WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
3405         toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
3406         BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).
3407
3408         Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
3409         (processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
3410         its constructor like so:
3411         `{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`
3412
3413         However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
3414         applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
3415         Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
3416         calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
3417         to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
3418         by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.
3419
3420         This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
3421         of subframes could end up as the WebBackForwardListItem's mainframe URL.
3422
3423         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3424         (WebKit::applyFrameState):
3425         Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
3426         Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.
3427
3428 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
3429
3430         Move FileSystem to WTF
3431         https://bugs.webkit.org/show_bug.cgi?id=193602
3432
3433         Reviewed by Yusuke Suzuki.
3434
3435         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
3436         * NetworkProcess/NetworkDataTaskBlob.h:
3437         * NetworkProcess/NetworkProcess.cpp:
3438         * NetworkProcess/cache/CacheStorageEngine.cpp:
3439         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3440         * NetworkProcess/cache/NetworkCache.cpp:
3441         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3442         * NetworkProcess/cache/NetworkCacheData.cpp:
3443         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3444         * NetworkProcess/cache/NetworkCacheFileSystem.h:
3445         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3446         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3447         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3448         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3449         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3450         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3451         * NetworkProcess/mac/NetworkProcessMac.mm:
3452         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3453         * PluginProcess/unix/PluginProcessMainUnix.cpp:
3454         * Shared/PersistencyUtils.cpp:
3455         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
3456         * Shared/Plugins/unix/PluginSearchPath.cpp:
3457         * Shared/WebMemorySampler.h:
3458         * Shared/glib/ProcessExecutablePathGLib.cpp:
3459         * Shared/ios/ChildProcessIOS.mm:
3460         * Shared/mac/ChildProcessMac.mm:
3461         * Shared/mac/SandboxExtensionMac.mm:
3462         * UIProcess/API/APIContentRuleListStore.cpp:
3463         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3464         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
3465         * UIProcess/API/glib/IconDatabase.cpp:
3466         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
3467         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
3468         * UIProcess/API/glib/WebKitWebContext.cpp:
3469         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
3470         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
3471         * UIProcess/Automation/WebAutomationSession.cpp:
3472         * UIProcess/Cocoa/DownloadClient.mm:
3473         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3474         * UIProcess/Cocoa/WebViewImpl.mm:
3475         * UIProcess/DeviceIdHashSaltStorage.cpp:
3476         * UIProcess/Downloads/DownloadProxy.cpp:
3477         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
3478         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3479         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
3480         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3481         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
3482         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
3483         * UIProcess/ServiceWorkerProcessProxy.cpp:
3484         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
3485         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3486         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3487         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3488         * UIProcess/glib/WebProcessProxyGLib.cpp:
3489         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3490         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3491         * UIProcess/ios/WKContentViewInteraction.mm:
3492         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3493         * UIProcess/mac/WebPageProxyMac.mm:
3494         * UIProcess/win/WebProcessPoolWin.cpp:
3495         * UIProcess/win/WebView.cpp:
3496         * UIProcess/wpe/WebProcessPoolWPE.cpp:
3497         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
3498         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
3499         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3500         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
3501         * WebProcess/Plugins/PluginProcessConnection.cpp:
3502         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3503         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
3504         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
3505         * WebProcess/cocoa/WebProcessCocoa.mm:
3506
3507 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
3508
3509         Create "frame hosting" nodes for the scrolling tree
3510         https://bugs.webkit.org/show_bug.cgi?id=193753
3511
3512         Reviewed by Antti Koivisto.
3513
3514         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
3515         require the iframe's scrolling node to get reparented in a new ancestor, which requires
3516         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
3517
3518         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
3519         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
3520         to provide a consistent parent node for the subframe's scrolling node.
3521
3522         This patch adds the node types, but does not instantiate them yet.
3523
3524         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3525         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
3526         (ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
3527         (WebKit::encodeNodeAndDescendants):
3528         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
3529         (WebKit::dump):
3530         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3531         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3532         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3533         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
3534         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3535         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3536
3537 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
3538
3539         [Curl] Unreviewed build fix for r240292 and friends.
3540
3541         WinCairo test stability must be restored in subsequent patch.
3542
3543         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3544         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3545         (WebKit::NetworkProcess::setNetworkProxySettings):
3546
3547 2019-01-23  Commit Queue  <commit-queue@webkit.org>
3548
3549         Unreviewed, rolling out r240403.
3550         https://bugs.webkit.org/show_bug.cgi?id=193757
3551
3552         "Causes multiple crashes on macOS port (probably used wrong
3553         ENABLE macro)" (Requested by ddkilzer on #webkit).
3554
3555         Reverted changeset:
3556
3557         "[Curl] Unreviewed build fix for r240292 and friends."
3558         https://trac.webkit.org/changeset/240403
3559
3560 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
3561
3562         [Curl] Unreviewed build fix for r240292 and friends.
3563
3564         WinCairo test stability must be restored in subsequent patch.
3565
3566         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3567         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3568         (WebKit::NetworkProcess::setNetworkProxySettings):
3569
3570 2019-01-23  Alex Christensen  <achristensen@webkit.org>
3571
3572         Stop using NetworkProcess::singleton
3573         https://bugs.webkit.org/show_bug.cgi?id=193700
3574
3575         Reviewed by Don Olmstead.
3576
3577         This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.
3578
3579         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
3580         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
3581         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
3582         * NetworkProcess/NetworkProcess.cpp:
3583         (WebKit::NetworkProcess::NetworkProcess):
3584         (WebKit::NetworkProcess::singleton): Deleted.
3585         * NetworkProcess/NetworkProcess.h:
3586         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
3587         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
3588         * NetworkProcess/win/NetworkProcessMainWin.cpp:
3589         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
3590         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
3591         (WebKit::initializeChildProcess):
3592         (WebKit::XPCServiceInitializer):
3593
3594 2019-01-23  Ryan Haddad  <ryanhaddad@apple.com>
3595
3596         Unreviewed, rolling out r240343.
3597
3598         Caused 4 PSON API test failures.
3599
3600         Reverted changeset:
3601
3602         "[PSON] Flash on back navigation on Mac"
3603         https://bugs.webkit.org/show_bug.cgi?id=193716
3604         https://trac.webkit.org/changeset/240343
3605
3606 2019-01-23  Chris Dumez  <cdumez@apple.com>
3607
3608         Deprecate API to limit the maximum number of WebProcesses
3609         https://bugs.webkit.org/show_bug.cgi?id=193725
3610         <rdar://problem/47464879>
3611
3612         Reviewed by Geoff Garen.
3613
3614         Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
3615         complexity and is not safe (conflicts with PSON).
3616
3617         Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
3618         Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
3619         Note that enabling the single WebProcess mode will disable PSON and process prewarming.
3620
3621         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3622         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3623         (API::ProcessPoolConfiguration::copy):
3624         * UIProcess/API/APIProcessPoolConfiguration.h:
3625         * UIProcess/API/C/WKContext.cpp:
3626         (WKContextSetMaximumNumberOfProcesses):
3627         (WKContextGetMaximumNumberOfProcesses):
3628         * UIProcess/API/C/WKContext.h:
3629         * UIProcess/API/Cocoa/WKProcessPool.mm:
3630         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3631         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3632         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3633         (-[_WKProcessPoolConfiguration maximumProcessCount]):
3634         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
3635         (-[_WKProcessPoolConfiguration usesSingleWebProcess]):
3636         (-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
3637         (-[_WKProcessPoolConfiguration description]):
3638         * UIProcess/API/glib/WebKitWebContext.cpp:
3639         (webkitWebContextConstructed):
3640         (webkit_web_context_set_process_model):
3641         (webkit_web_context_set_web_process_count_limit):
3642         * UIProcess/WebProcessPool.cpp:
3643         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3644         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
3645         (WebKit::WebProcessPool::processForNavigationInternal):
3646         * UIProcess/WebProcessPool.h:
3647
3648 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
3649
3650         Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
3651         https://bugs.webkit.org/show_bug.cgi?id=193659
3652         <rdar://problem/47433290>
3653
3654         Reviewed by Alex Christensen.
3655
3656         Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
3657         'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
3658         consistent, and should reduce the possibility of bookkeeping errors in the message handling
3659         implementations.
3660
3661         Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
3662         (and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
3663         'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.
3664
3665         This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
3666         'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
3667         a connection is established to the network process, causing initialization messages to get dropped
3668         leading to test system flakiness.
3669
3670         Finally: The WK API test code was updated to ensure that completion handlers are always called, even
3671         when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.
3672
3673         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3674         * NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
3675         * NetworkProcess/Classifier/StorageAccessStatus.h: Added.
3676         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3677         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3678         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3679         * NetworkProcess/NetworkProcess.cpp:
3680         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
3681         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
3682         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
3683         (WebKit::NetworkProcess::hasStorageAccessForFrame):
3684         (WebKit::NetworkProcess::requestStorageAccess):
3685         (WebKit::NetworkProcess::grantStorageAccess):
3686         (WebKit::NetworkProcess::removeAllStorageAccess):
3687         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
3688         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
3689         (WebKit::NetworkProcess::deleteWebsiteData):
3690         * NetworkProcess/NetworkProcess.h:
3691         * NetworkProcess/NetworkProcess.messages.in:
3692         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3693         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
3694         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
3695         (WKWebsiteDataStoreStatisticsResetToConsistentState):
3696         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3697         * UIProcess/Network/NetworkProcessProxy.cpp:
3698         (WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
3699         is now autogenerated.
3700         (WebKit::NetworkProcessProxy::didClose): Ditto.
3701         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3702         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
3703         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
3704         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
3705         (WebKit::NetworkProcessProxy::requestStorageAccess):
3706         (WebKit::NetworkProcessProxy::grantStorageAccess):
3707         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
3708         (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
3709         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
3710         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
3711         (WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
3712         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
3713         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
3714         (WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
3715         (WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
3716         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
3717         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
3718         * UIProcess/Network/NetworkProcessProxy.h:
3719         * UIProcess/Network/NetworkProcessProxy.messages.in:
3720         * UIProcess/WebPageProxy.cpp:
3721         * UIProcess/WebProcessPool.cpp:
3722         (WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
3723         to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
3724         causing initialization messages to get dropped.
3725         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
3726         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3727         (WebKit::WebsiteDataStore::removeData):
3728         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
3729         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
3730         (WebKit::WebsiteDataStore::setGrandfatheringTime):
3731         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
3732         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
3733         (WebKit::WebsiteDataStore::setPrevalentResource):
3734         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3735         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
3736         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
3737         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
3738         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
3739         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
3740         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
3741         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
3742         * UIProcess/WebsiteData/WebsiteDataStore.h:
3743         * WebKit.xcodeproj/project.pbxproj:
3744
3745 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
3746
3747         Clean up IndexedDB files between tests
3748         https://bugs.webkit.org/show_bug.cgi?id=192796
3749         <rdar://problem/46824999>
3750
3751         Reviewed by Geoffrey Garen.
3752
3753         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3754         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
3755         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3756
3757 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3758
3759         [iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
3760         https://bugs.webkit.org/show_bug.cgi?id=193182
3761         <rdar://problem/47452154>
3762
3763         Reviewed by Tim Horton.
3764
3765         Fix an existing bug where blurring an element doesn't always un-suppress text interactions.
3766
3767         * UIProcess/ios/WKContentViewInteraction.mm:
3768         (-[WKContentView _elementDidBlur]):
3769
3770 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3771
3772         Minor improvements to NetworkProcess
3773         https://bugs.webkit.org/show_bug.cgi?id=193708
3774
3775         Reviewed by Alex Christensen.
3776
3777         * NetworkProcess/NetworkProcess.cpp:
3778         (WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
3779         (WebKit::NetworkProcess::ensureSession): Add useful assertion.
3780         (WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
3781         (WebKit::NetworkProcess::destroySession): Add useful assertion.
3782         * NetworkProcess/NetworkProcess.h:
3783         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3784         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3785         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3786         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3787         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3788         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3789
3790 2019-01-23  Daniel Bates  <dabates@apple.com>
3791
3792         Fix the Apple Internal build. See <rdar://problem/47486758>.
3793
3794         * UIProcess/ios/WKContentViewInteraction.mm:
3795         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
3796
3797 2019-01-23  Per Arne Vollan  <pvollan@apple.com>
3798
3799         [macOS] Sandbox fails to compile
3800         https://bugs.webkit.org/show_bug.cgi?id=193727
3801         <rdar://problem/47476903>
3802
3803         Reviewed by Brent Fulgham.
3804
3805         Use '(with send-signal SIGKILL)' instead of '(with termination)'.
3806
3807         * WebProcess/com.apple.WebProcess.sb.in:
3808
3809 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
3810
3811         REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
3812         https://bugs.webkit.org/show_bug.cgi?id=193723
3813         <rdar://problem/47476802>
3814
3815         Reviewed by David Kilzer.
3816
3817         The new code added in r240243 could attempt to submit telemetry after the relevant
3818         WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
3819
3820         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
3821         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
3822
3823 2019-01-23  Antti Koivisto  <antti@apple.com>
3824
3825         [PSON] Flash on back navigation on Mac
3826         https://bugs.webkit.org/show_bug.cgi?id=193716
3827         <rdar://problem/47148458>
3828
3829         Reviewed by Chris Dumez.
3830
3831         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
3832
3833         * UIProcess/SuspendedPageProxy.cpp:
3834         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3835
3836         Remove the suspended page (so closing it on web process side) if the suspension fails.
3837         Skip this if we are using web process side compositing on Mac.
3838
3839         * UIProcess/WebPageProxy.cpp:
3840         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
3841
3842         On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
3843
3844         * UIProcess/WebProcessPool.cpp:
3845         (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
3846         * UIProcess/WebProcessPool.h:
3847         * WebProcess/WebPage/WebPage.cpp:
3848         (WebKit::WebPage::suspendForProcessSwap):
3849
3850         Don't close the page on suspension failure.
3851
3852 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3853
3854         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
3855         https://bugs.webkit.org/show_bug.cgi?id=193706
3856         <rdar://problem/44807048>
3857
3858         Reviewed by Ryosuke Niwa.
3859
3860         * UIProcess/Cocoa/WebViewImpl.mm:
3861         (WebKit::WebViewImpl::registerEditCommand):
3862         * UIProcess/WebEditCommandProxy.cpp:
3863         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
3864         * UIProcess/WebEditCommandProxy.h:
3865
3866         Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
3867         Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
3868         argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.
3869
3870         (WebKit::WebEditCommandProxy::create):
3871         (WebKit::WebEditCommandProxy::label const):
3872         (WebKit::WebEditCommandProxy::invalidate):
3873         (WebKit::WebEditCommandProxy::editAction const): Deleted.
3874
3875         Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.
3876
3877         * UIProcess/WebPageProxy.cpp:
3878         (WebKit::WebPageProxy::registerEditCommandForUndo):
3879         (WebKit::WebPageProxy::resetState):
3880
3881         Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
3882         and then iterating over the Vector.
3883
3884         * UIProcess/WebPageProxy.h:
3885         * UIProcess/WebPageProxy.messages.in:
3886
3887         Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.
3888
3889         * UIProcess/ios/PageClientImplIOS.mm:
3890         (WebKit::PageClientImpl::registerEditCommand):
3891         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3892         (WebKit::WebEditorClient::registerUndoStep):
3893
3894 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3895
3896         [SOUP] Remove libsoup cruft from WebProcess
3897         https://bugs.webkit.org/show_bug.cgi?id=193710
3898
3899         Reviewed by Carlos Garcia Campos.
3900
3901         SoupNetworkSession is no longer accessible from the web process because it's owned
3902         (indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
3903         code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
3904         removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
3905         WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there
3906
3907         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
3908         (AsyncReadData::AsyncReadData):
3909         (webkitSoupRequestInputStreamReadAsyncResultComplete):
3910         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
3911         (webkitSoupRequestInputStreamHasDataToRead):
3912         (webkitSoupRequestInputStreamIsWaitingForData):
3913         (webkitSoupRequestInputStreamReadAsync):
3914         (webkitSoupRequestInputStreamReadFinish):
3915         (webkitSoupRequestInputStreamFinalize):
3916         (webkit_soup_request_input_stream_init):
3917         (webkit_soup_request_input_stream_class_init):
3918         (webkitSoupRequestInputStreamNew):
3919         (webkitSoupRequestInputStreamAddData):
3920         (webkitSoupRequestInputStreamDidFailWithError):
3921         (webkitSoupRequestInputStreamFinished):
3922         * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
3923         * SourcesGTK.txt:
3924         * SourcesWPE.txt:
3925         * UIProcess/soup/WebProcessPoolSoup.cpp:
3926         (WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
3927         * WebProcess/WebProcess.h:
3928         * WebProcess/WebProcess.messages.in:
3929         * WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
3930         (WebKit::WebProcess::platformSetCacheModel):
3931         (WebKit::WebProcess::platformInitializeWebProcess):
3932         (WebKit::WebProcess::platformTerminate):
3933
3934 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3935
3936         [SOUP] Clean up NetworkStorageSession
3937         https://bugs.webkit.org/show_bug.cgi?id=193707
3938
3939         Reviewed by Carlos Garcia Campos.
3940
3941         Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
3942         adapt to NetworkStorageSessions API changes.
3943
3944         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
3945         (WebKit::LegacyCustomProtocolManager::registerScheme):
3946         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
3947         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3948         (WebKit::NetworkProcess::userPreferredLanguagesChanged):
3949         (WebKit::NetworkProcess::setNetworkProxySettings):
3950         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3951         (WebKit::