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