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