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