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