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