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