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