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