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