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