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