2e128747e0da44c6fbf1d681bacdec63547ab5fc
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-11-06  Alex Christensen  <achristensen@webkit.org>
2
3         Add ObjC SPI equivalent of WKContextHandlesSafeBrowsing
4         https://bugs.webkit.org/show_bug.cgi?id=191329
5
6         Reviewed by Tim Horton.
7
8         Like WKContextHandlesSafeBrowsing, this is so I can make one change in WebKit and enable safe browsing
9         in WKWebView and disable it in Safari at the same time without broken revisions between landing two changes
10         in two repositories.
11
12         * UIProcess/API/Cocoa/WKWebView.mm:
13         (+[WKWebView handlesSafeBrowsing]):
14         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
15
16 2018-11-06  Eric Carlson  <eric.carlson@apple.com>
17
18         [MediaStream] User should not be prompted again after denying getDisplayMedia request
19         https://bugs.webkit.org/show_bug.cgi?id=191227
20         <rdar://problem/45784512>
21
22         Reviewed by Youenn Fablet.
23
24         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
25         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
26         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
27         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
28         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
29
30 2018-11-06  Fujii Hironori  <Hironori.Fujii@sony.com>
31
32         [MediaStream] User should not be prompted again after denying getDisplayMedia request
33         https://bugs.webkit.org/show_bug.cgi?id=191227
34         <rdar://problem/45784512>
35
36         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
37
38         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
39         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
40
41 2018-11-03  Alex Christensen  <achristensen@webkit.org>
42
43         [Mac] Implement safe browsing in WebKit
44         https://bugs.webkit.org/show_bug.cgi?id=188871
45
46         Reviewed by Tim Horton.
47
48         * Platform/spi/Cocoa/SafeBrowsingSPI.h:
49         * Resources/SafeBrowsing.xcassets: Added.
50         * Resources/SafeBrowsing.xcassets/Contents.json: Added.
51         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset: Added.
52         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningBackground.colorset/Contents.json: Added.
53         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset: Added.
54         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningText.colorset/Contents.json: Added.
55         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset: Added.
56         * Resources/SafeBrowsing.xcassets/WKSafeBrowsingWarningTitle.colorset/Contents.json: Added.
57         * Shared/WebPreferences.yaml:
58         * Shared/WebPreferencesDefaultValues.h:
59         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
60         (WKContextHandlesSafeBrowsing):
61         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm:
62         (WebKit::malwareDetailsBase):
63         (WebKit::learnMore):
64         (WebKit::reportAnErrorBase):
65         (WebKit::localizedProvider):
66         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
67         * UIProcess/Cocoa/WKSafeBrowsingWarning.h: Added.
68         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: Added.
69         (confirmMalwareSentinel):
70         (visitUnsafeWebsiteSentinel):
71         (colorNamed):
72         (replace):
73         (addLinkAndReplace):
74         (-[WKSafeBrowsingExclamationPoint drawRect:]):
75         (-[WKSafeBrowsingExclamationPoint intrinsicContentSize]):
76         (reportAnErrorURL):
77         (malwareDetailsURL):
78         (titleText):
79         (warningText):
80         (detailsText):
81         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingResult:completionHandler:]):
82         (-[WKSafeBrowsingWarning dealloc]):
83         (-[WKSafeBrowsingWarning goBackClicked]):
84         (-[WKSafeBrowsingWarning clickedOnLink:]):
85         (-[WKSafeBrowsingWarning showDetailsClicked]):
86         (+[WKSafeBrowsingTextView viewWithAttributedString:linkTarget:]):
87         (+[WKSafeBrowsingTextView viewWithString:]):
88         (-[WKSafeBrowsingTextView intrinsicContentSize]):
89         (-[WKSafeBrowsingTextView clickedOnLink:atIndex:]):
90         * UIProcess/Cocoa/WebViewImpl.h:
91         * UIProcess/Cocoa/WebViewImpl.mm:
92         (WebKit::WebViewImpl::showSafeBrowsingWarning):
93         (WebKit::WebViewImpl::clearSafeBrowsingWarning):
94         (WebKit::WebViewImpl::setFrameSize):
95         * UIProcess/PageClient.h:
96         (WebKit::PageClient::showSafeBrowsingWarning):
97         (WebKit::PageClient::clearSafeBrowsingWarning):
98         * UIProcess/SafeBrowsingResult.h:
99         (WebKit::SafeBrowsingResult::url const):
100         (WebKit::SafeBrowsingResult::provider const):
101         (WebKit::SafeBrowsingResult::localizedProviderName const):
102         (WebKit::SafeBrowsingResult::malwareDetailsURLBase const):
103         (WebKit::SafeBrowsingResult::reportAnErrorURLBase const):
104         (WebKit::SafeBrowsingResult::learnMoreURL const):
105         (WebKit::SafeBrowsingResult::needsSafeBrowsingWarning const):
106         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const): Deleted.
107         * UIProcess/WebPageProxy.cpp:
108         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
109         * UIProcess/ios/PageClientImplIOS.h:
110         * UIProcess/ios/PageClientImplIOS.mm:
111         (WebKit::PageClientImpl::showSafeBrowsingWarning):
112         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
113         * UIProcess/mac/PageClientImplMac.h:
114         * UIProcess/mac/PageClientImplMac.mm:
115         (WebKit::PageClientImpl::setImpl):
116         (WebKit::PageClientImpl::showSafeBrowsingWarning):
117         (WebKit::PageClientImpl::clearSafeBrowsingWarning):
118         * WebKit.xcodeproj/project.pbxproj:
119
120 2018-11-05  Zan Dobersek  <zdobersek@igalia.com>
121
122         [WPE] Remove BackingStore, BackingStoreCairo implementation files from build
123         https://bugs.webkit.org/show_bug.cgi?id=191269
124
125         Reviewed by Michael Catanzaro.
126
127         * SourcesWPE.txt: Drop the BackingStore.cpp and BackingStoreCairo.cpp
128         files from the WPE build. These are not used at all in WPE configuration
129         as they are only used by the GTK+ port for non-AC functionality.
130
131 2018-11-05  Chris Dumez  <cdumez@apple.com>
132
133         Use same limit for page cache and suspended pages
134         https://bugs.webkit.org/show_bug.cgi?id=191266
135
136         Reviewed by Geoffrey Garen.
137
138         Use same limit for page cache and suspended pages as they serve the same purpose.
139
140         * UIProcess/API/Cocoa/WKProcessPool.mm:
141         (-[WKProcessPool _maximumSuspendedPageCount]):
142         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
143         * UIProcess/WebProcessPool.cpp:
144         (WebKit::WebProcessPool::updateMaxSuspendedPageCount):
145         (WebKit::WebProcessPool::setCacheModel):
146         (WebKit::WebProcessPool::addSuspendedPageProxy):
147         * UIProcess/WebProcessPool.h:
148
149 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
150
151         [iOS] Allow WKWebView clients to customize bar button item groups in the accessory view when editing
152         https://bugs.webkit.org/show_bug.cgi?id=191240
153         <rdar://problem/44872806>
154
155         Reviewed by Tim Horton.
156
157         Allow WKWebView clients to override WKContentView's default input assistant item by plumbing the call to
158         `-inputAssistantItem` through `-[WKWebView inputAssistantItem]`, such that if a client asks WKWebView for its
159         input assistant item and changes its leading or trailing bar button groups, the changes will be reflected by
160         WKContentView; additionally, this allows clients to achieve the same effect by overriding `-inputAssistantItem`
161         on WKWebView.
162
163         Test:   KeyboardInputTests.ModifyInputAssistantItemBarButtonGroups
164                 KeyboardInputTests.OverrideInputAssistantItemBarButtonGroups
165
166         * UIProcess/API/Cocoa/WKWebView.mm:
167         (-[WKWebView inputAssistantItem]):
168         * UIProcess/ios/WKContentViewInteraction.h:
169         * UIProcess/ios/WKContentViewInteraction.mm:
170         (-[WKContentView inputAssistantItem]):
171
172         Route the call to `[super inputAssistantItem]` through `-[WKWebView inputAssistantItem]`, so that the input
173         assistant item may be overridden via WKWebView.
174
175         (-[WKContentView inputAssistantItemForWebView]):
176
177 2018-11-05  Ryan Haddad  <ryanhaddad@apple.com>
178
179         Unreviewed, rolling out r237785.
180
181         Introduced layout test and API test failures on macOS and iOS.
182
183         Reverted changeset:
184
185         "[iOS] Issue initial paint soon after the visuallyNonEmpty
186         milestone is fired."
187         https://bugs.webkit.org/show_bug.cgi?id=191078
188         https://trac.webkit.org/changeset/237785
189
190 2018-11-05  Commit Queue  <commit-queue@webkit.org>
191
192         Unreviewed, rolling out r237784 and r237788.
193         https://bugs.webkit.org/show_bug.cgi?id=191270
194
195         Caused mediastream layout test failures (Requested by
196         ryanhaddad on #webkit).
197
198         Reverted changesets:
199
200         "[MediaStream] User should not be prompted again after denying
201         getDisplayMedia request"
202         https://bugs.webkit.org/show_bug.cgi?id=191227
203         https://trac.webkit.org/changeset/237784
204
205         "[MediaStream] User should not be prompted again after denying
206         getDisplayMedia request"
207         https://bugs.webkit.org/show_bug.cgi?id=191227
208         https://trac.webkit.org/changeset/237788
209
210 2018-11-04  Fujii Hironori  <Hironori.Fujii@sony.com>
211
212         [MediaStream] User should not be prompted again after denying getDisplayMedia request
213         https://bugs.webkit.org/show_bug.cgi?id=191227
214         <rdar://problem/45784512>
215
216         Unreviewed build fix of ports not ENABLE(MEDIA_STREAM).
217
218         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Define getRequestAction only if ENABLE(MEDIA_STREAM).
219         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto.
220
221 2018-11-04  Zalan Bujtas  <zalan@apple.com>
222
223         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
224         https://bugs.webkit.org/show_bug.cgi?id=191078
225         <rdar://problem/45736178>
226
227         Reviewed by Antti Koivisto.
228
229         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
230         (WebKit::WebChromeClient::layerFlushThrottlingIsActive const):
231         * WebProcess/WebCoreSupport/WebChromeClient.h:
232         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
233         (WebKit::AcceleratedDrawingArea::scheduleInitialDeferredPaint):
234         * WebProcess/WebPage/AcceleratedDrawingArea.h:
235         * WebProcess/WebPage/DrawingArea.h:
236         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
237         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
238         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
239         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
240         (WebKit::RemoteLayerTreeDrawingArea::setLayerTreeStateIsFrozen):
241         (WebKit::RemoteLayerTreeDrawingArea::initialDeferredPaint):
242         (WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint):
243         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
244         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
245         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
246         (WebKit::TiledCoreAnimationDrawingArea::scheduleInitialDeferredPaint):
247
248 2018-11-04  Eric Carlson  <eric.carlson@apple.com>
249
250         [MediaStream] User should not be prompted again after denying getDisplayMedia request
251         https://bugs.webkit.org/show_bug.cgi?id=191227
252         <rdar://problem/45784512>
253
254         Reviewed by Youenn Fablet.
255
256         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
257         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
258         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
259         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
260         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
261
262 2018-11-03  Alex Christensen  <achristensen@webkit.org>
263
264         Mac production builds should sign the network process xpc service with entitlements
265         https://bugs.webkit.org/show_bug.cgi?id=191209
266         <rdar://problem/45377609>
267
268         Reviewed by Geoff Garen.
269
270         * Configurations/Network-OSX.entitlements: Copied from Configurations/Network-OSX-sandbox.entitlements.
271         * Configurations/NetworkService.xcconfig:
272         Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
273         except with the corresponoding network process entitlements file.
274         * UIProcess/API/Cocoa/WKProcessPool.mm:
275         (-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
276         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
277         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
278         (WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
279         * UIProcess/WebProcessPool.h:
280         * WebKit.xcodeproj/project.pbxproj:
281         Add infrastructure to test that the network process actually has an entitlement.
282
283 2018-11-03  Philippe Normand  <pnormand@igalia.com>
284
285         [WPE] Add the WebKitVersion.h header
286         https://bugs.webkit.org/show_bug.cgi?id=191015
287         <rdar://problem/45647211>
288
289         Reviewed by Michael Catanzaro.
290
291         * PlatformWPE.cmake: Install the generated header as well.
292
293 2018-11-02  Alex Christensen  <achristensen@webkit.org>
294
295         Unreviewed, rolling out r237761.
296
297         Makes most API tests timeout and WK2 tests crash
298
299         Reverted changeset:
300
301         "Mac production builds should sign the network process xpc
302         service with entitlements"
303         https://bugs.webkit.org/show_bug.cgi?id=191209
304         https://trac.webkit.org/changeset/237761
305
306 2018-11-02  Ryan Haddad  <ryanhaddad@apple.com>
307
308         Unreviewed, attempt to fix the build with recent SDKs.
309
310         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
311         (WebKit::XPCServiceExit):
312
313 2018-11-02  Alex Christensen  <achristensen@webkit.org>
314
315         Mac production builds should sign the network process xpc service with entitlements
316         https://bugs.webkit.org/show_bug.cgi?id=191209
317         <rdar://problem/45377609>
318
319         Reviewed by Geoff Garen.
320
321         * Configurations/NetworkService.xcconfig:
322         Set CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO like we do for the web process,
323         except with the corresponoding network process entitlements file.
324         * UIProcess/API/Cocoa/WKProcessPool.mm:
325         (-[WKProcessPool _networkProcessHasEntitlementForTesting:]):
326         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
327         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
328         (WebKit::WebProcessPool::networkProcessHasEntitlementForTesting):
329         * UIProcess/WebProcessPool.h:
330         Add infrastructure to test that the network process actually has an entitlement.
331
332 2018-11-02  Daniel Bates  <dabates@apple.com>
333
334         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
335         https://bugs.webkit.org/show_bug.cgi?id=190487
336
337         Reviewed by Tim Horton.
338
339         Add support for modifier flags change events dispatched by UIKit.
340
341         * Shared/ios/WebIOSEventFactory.mm:
342         (modifiersForEvent): Update for renamed enumerations.
343         (WebIOSEventFactory::createWebKeyboardEvent): Modifier keys do not have an associated
344         character and do not participate in key repeat.
345         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
346         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Update for renamed enumerations.
347         * UIProcess/ios/WKContentViewInteraction.mm:
348         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Return NO if the event represents a
349         modifier flags change to allow the default handling.
350         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
351         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]): Update for renamed enumerations.
352
353 2018-11-02  Chris Dumez  <cdumez@apple.com>
354
355         [PSON] Reuse SuspendedPages' process when possible, for performance
356         https://bugs.webkit.org/show_bug.cgi?id=191166
357
358         Reviewed by Geoffrey Garen.
359
360         When process-swapping check if there is an existing SuspendedPage for the domain we're going to.
361         If there is, use this SuspendedPage's process for the navigation instead of a fresh new process.
362         This change should be beneficial for performance as it:
363         - Avoids spinning up a new process (CPU & memory cost)
364         - Likely better leverages caches since this process already loaded this domain in the past
365
366         Due to current limitations, using a SuspendedPage's proxy may consume the SuspendedPage, which
367         means that it can no longer be used for PageCache on history navigations. We need to do this when
368         the SuspendedPageProxy in question was created for the current WebPageProxy because:
369         - This SuspendedPageProxy's process already has a suspended WebPage with this WebPageProxy's pageID
370         and
371         - We do not currently support having more than one WebPage with a given pageID within a single
372           WebProcess.
373
374         * UIProcess/SuspendedPageProxy.cpp:
375         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
376         * UIProcess/SuspendedPageProxy.h:
377         * UIProcess/WebProcessPool.cpp:
378         (WebKit::WebProcessPool::processForNavigationInternal):
379
380 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
381
382         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
383         https://bugs.webkit.org/show_bug.cgi?id=189693
384
385         Reviewed by Yusuke Suzuki.
386
387         * Shared/API/APIString.h: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
388
389 2018-11-01  Daniel Bates  <dabates@apple.com>
390
391         Cleanup: Extraneous platform guarding of -_setUpSQLiteDatabaseTrackerClient
392         https://bugs.webkit.org/show_bug.cgi?id=191124
393
394         Reviewed by Tim Horton.
395
396         Remove the platform guard around the call to -_setUpSQLiteDatabaseTrackerClient as the
397         implementation of that message is already guarded.
398
399         * UIProcess/API/Cocoa/WKWebView.mm:
400         (-[WKWebView _initializeWithConfiguration:]):
401
402 2018-11-01  Ryan Haddad  <ryanhaddad@apple.com>
403
404         Unreviewed, attempt to fix the build with recent SDKs.
405
406         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
407         (WebKit::XPCServiceInitializer):
408
409 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
410
411         Add a storage limit for IndexedDB
412         https://bugs.webkit.org/show_bug.cgi?id=190598
413         <rdar://problem/44654715>
414
415         Reviewed by Chris Dumez.
416
417         Add SPI for testing.
418
419         * NetworkProcess/NetworkProcess.cpp:
420         (WebKit::NetworkProcess::NetworkProcess):
421         (WebKit::NetworkProcess::idbServer):
422         (WebKit::NetworkProcess::setIDBPerOriginQuota):
423         * NetworkProcess/NetworkProcess.h:
424         * NetworkProcess/NetworkProcess.messages.in:
425         * UIProcess/API/C/WKContext.cpp:
426         (WKContextSetIDBPerOriginQuota):
427         * UIProcess/API/C/WKContextPrivate.h:
428         * UIProcess/WebProcessPool.cpp:
429         (WebKit::WebProcessPool::setIDBPerOriginQuota):
430         * UIProcess/WebProcessPool.h:
431
432 2018-11-01  Chris Dumez  <cdumez@apple.com>
433
434         [PSON] WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping
435         https://bugs.webkit.org/show_bug.cgi?id=191076
436
437         Reviewed by Geoffrey Garen.
438
439         WebPageProxy::receivedNavigationPolicyDecision() should not schedule the new load asynchronously when process-swapping.
440         The client can request a new load synchronously after answering the policy decision, in which case we'd end up loading
441         the wrong URL.
442
443         * UIProcess/WebPageProxy.cpp:
444         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
445         * UIProcess/WebProcessPool.cpp:
446         (WebKit::WebProcessPool::processForNavigation):
447         (WebKit::WebProcessPool::processForNavigationInternal):
448         * UIProcess/WebProcessPool.h:
449
450 2018-11-01  Chris Dumez  <cdumez@apple.com>
451
452         [PSON] Unable to submit a file in FormData cross-site
453         https://bugs.webkit.org/show_bug.cgi?id=191138
454
455         Reviewed by Alex Christensen.
456
457         When PSON is enabled, we are unable to submit a file in FormData cross-site. Although we encode the
458         request body over IPC since r237639, we're missing the right sandbox extensions for its to work for
459         files.
460
461         Update FormDataReference encoder to pass along the necessary sandbox extensions for files in the
462         FormData, and have its decoder consume those extensions so that the recipient has access to those
463         files. Also update LoadParameters's IPC encoder / decoder to encoder an IPC::FormDataReference
464         (which encodes both FormData and sandbox extensions) instead of a FormData.
465
466         * Platform/IPC/FormDataReference.h:
467         (IPC::FormDataReference::encode const):
468         (IPC::FormDataReference::decode):
469         * Shared/LoadParameters.cpp:
470         (WebKit::LoadParameters::encode const):
471         (WebKit::LoadParameters::decode):
472
473 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
474
475         ERROR: ResourceLoadStatisticsPersistentStorage: Unable to delete statistics file
476         https://bugs.webkit.org/show_bug.cgi?id=191152
477
478         Reviewed by Chris Dumez.
479
480         The statistics file is not created unconditionally, so
481         make sure it exists before logging an error.
482
483         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
484         (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
485         Check that the file exists before logging an error.
486
487 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
488
489         [GLIB] Silent a build warning when not using Wayland
490
491         Unreviewed.
492
493         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
494
495 2018-11-01  Frederic Wang  <fwang@igalia.com>
496
497         [WebAuthN] Make AuthenticatorManager
498         https://bugs.webkit.org/show_bug.cgi?id=189279
499
500         Unreviewed build fix.
501
502         * UIProcess/WebAuthentication/Cocoa/LocalConnection.h: Add missing headers.
503
504 2018-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
505
506         API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
507         https://bugs.webkit.org/show_bug.cgi?id=191114
508         <rdar://problem/45700410>
509
510         Reviewed by Dean Jackson.
511
512         Followup to r237648: also make sure that we insecurely unarchive NSFileWrapper on platforms that don't support
513         secure archiving of file wrappers.
514
515         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
516         (API::Attachment::updateFromSerializedRepresentation):
517
518 2018-10-31  Dean Jackson  <dino@apple.com>
519
520         Forward original fragment identifier into System Preview
521         https://bugs.webkit.org/show_bug.cgi?id=191141
522         <rdar://problem/45717542>
523
524         Reviewed by Wenson Hsieh.
525
526         If the URL used by the page includes a fragment identifier, use
527         it when telling QuickLook to open a local file.
528
529         * UIProcess/Cocoa/DownloadClient.mm:
530         (WebKit::DownloadClient::didFinish): Append original fragment identifier
531         to the destination URL.
532
533 2018-10-31  Zalan Bujtas  <zalan@apple.com>
534
535         [iOS] Do not paint tap highlight unless it is above a certain threshold
536         https://bugs.webkit.org/show_bug.cgi?id=191134
537         <rdar://problem/43615142>
538
539         Flashing a large portion of the screen on every tap looks unpleasant.
540         This patch impoves the existing heuristic by adding area check and a % threshold.  
541
542         Reviewed by Tim Horton.
543
544         * UIProcess/ios/WKContentViewInteraction.mm:
545         (-[WKContentView _showTapHighlight]):
546         (highlightedQuadsAreSmallerThanRect): Deleted.
547
548 2018-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
549
550         API test WKAttachmentTests.CopyAndPasteBetweenWebViews fails on macOS 10.13
551         https://bugs.webkit.org/show_bug.cgi?id=191114
552         <rdar://problem/45700410>
553
554         Reviewed by Dean Jackson.
555
556         On macOS 10.12, we don't attempt secure archival at all because SECURE_ARCHIVER_API is turned off, and on macOS
557         10.14, NSFileWrapper supports secure coding. However, on macOS 10.13, SECURE_ARCHIVER_API is on despite
558         NSFileWrapper not being securely codable, so we're unable to serialize attachment data.
559
560         To fix this, we only use the secure archiver on ≥ macOS 10.14 and ≥ iOS 12.
561
562         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
563         (API::Attachment::createSerializedRepresentation const):
564
565 2018-10-31  Zach Li  <zacharyli323@gmail.com>
566
567         Add credit card autofill button
568         https://bugs.webkit.org/show_bug.cgi?id=191051
569         <rdar://problem/45657011>
570
571         Reviewed by Wenson Hsieh.
572
573         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
574         (toAutoFillButtonType):
575         (toWKAutoFillButtonType):
576         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
577         Introduce a new button type for credit card autofill.
578         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
579         (toAutoFillButtonType):
580         (toWKAutoFillButtonType):
581         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
582
583 2018-10-31  Chris Dumez  <cdumez@apple.com>
584
585         [PSON] When process-swapping for a POST request the HTTP body gets dropped
586         https://bugs.webkit.org/show_bug.cgi?id=191046
587         <rdar://problem/45229732>
588
589         Reviewed by Alex Christensen.
590
591         For performance reasons, the ResourceRequest IPC encoder does not encode the request's HTTP body (aka form data).
592         When we decide to process-swap for a POST request in WebPageProxy::decidePolicyForNavigationAction(), the request
593         we pass the new WebProcess thus no longer has a HTTP body and the load will likely fail in the new process.
594
595         To address the issue, we now pass the request body along with the request when sending the DecidePolicyForNavigationActionAsync
596         / DecidePolicyForNavigationActionSync IPC from the WebProcess to the UIProcess. No action is needed for the
597         LoadRequest IPC to the new WebProcess since the LoadParameters' IPC encoder takes care of encoding the request's
598         body already.
599
600         * UIProcess/WebPageProxy.cpp:
601         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
602         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
603         * UIProcess/WebPageProxy.h:
604         * UIProcess/WebPageProxy.messages.in:
605         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
606         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
607
608 2018-10-31  Antti Koivisto  <antti@apple.com>
609
610         Stop using LayerFlushScheduler in WK2
611         https://bugs.webkit.org/show_bug.cgi?id=191065
612
613         Reviewed by Tim Horton.
614
615         Code gets more understandable when TiledCoreAnimationDrawingArea simply uses RunLoopObserver
616         directly for flush scheduling. LayerFlushScheduler can be later moved to WK1.
617
618         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
619         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
620         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
621         (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
622         (WebKit::TiledCoreAnimationDrawingArea::setLayerTreeStateIsFrozen):
623         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlush):
624         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
625         (WebKit::TiledCoreAnimationDrawingArea::layerFlushRunLoopCallback):
626         (WebKit::TiledCoreAnimationDrawingArea::invalidateLayerFlushRunLoopObserver):
627         (WebKit::TiledCoreAnimationDrawingArea::scheduleLayerFlushRunLoopObserver):
628
629 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
630
631         [WPE][GTK] Certificates loaded from the cache don't include the certificate chain
632         https://bugs.webkit.org/show_bug.cgi?id=190956
633
634         Reviewed by Youenn Fablet.
635
636         Similarly to what was done for the IPC coders, serialize
637         the entire certificate chain in the cache coder. Bump
638         the cache version due to the caching format changes.
639
640         * NetworkProcess/cache/NetworkCacheCoders.h: Add GRefPtr<GByteArray> coders.
641         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
642         (WTF::Persistence::certificatesDataListFromCertificateInfo):
643         (WTF::Persistence::certificateFromCertificatesDataList): Helpers.
644         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
645         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
646         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode):
647         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode):
648         * NetworkProcess/cache/NetworkCacheStorage.h: Bump the cache version.
649
650 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
651
652         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
653         https://bugs.webkit.org/show_bug.cgi?id=190530
654         <rdar://problem/45232149>
655
656         Reviewed by Tim Horton.
657
658         See WebCore ChangeLog for more details.
659
660         * Shared/WebCoreArgumentCoders.cpp:
661         (IPC::ArgumentCoder<SerializedAttachmentData>::encode):
662         (IPC::ArgumentCoder<SerializedAttachmentData>::decode):
663         * Shared/WebCoreArgumentCoders.h:
664
665         Add IPC encoding/decoding support for SerializedAttachmentData.
666
667         * UIProcess/API/APIAttachment.cpp:
668         (API::Attachment::createSerializedRepresentation const):
669         (API::Attachment::updateFromSerializedRepresentation):
670         * UIProcess/API/APIAttachment.h:
671         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
672         (API::Attachment::createSerializedRepresentation const):
673
674         Add a method to serialize and return attachment info as a blob of data.
675
676         (API::Attachment::updateFromSerializedRepresentation):
677
678         Add a method to update the attachment, given a serialized blob of data. On Cocoa platforms, this fails
679         gracefully if the serialized data cannot be decoded.
680
681         * UIProcess/Cocoa/PageClientImplCocoa.h:
682         * UIProcess/Cocoa/PageClientImplCocoa.mm:
683         (WebKit::PageClientImplCocoa::allocFileWrapperInstance const):
684         (WebKit::PageClientImplCocoa::serializableFileWrapperClasses const):
685         (WebKit::PageClientImplCocoa::allocFileWrapperInstance): Deleted.
686
687         Add an additional hook to return the list of NSFileWrapper subclasses suitable for deserialization. This
688         array contains (at minimum) NSFileWrapper, but may additionally include a custom NSFileWrapper subclass, if
689         configured.
690
691         * UIProcess/PageClient.h:
692         (WebKit::PageClient::allocFileWrapperInstance const):
693         (WebKit::PageClient::serializableFileWrapperClasses const):
694         (WebKit::PageClient::allocFileWrapperInstance): Deleted.
695         * UIProcess/WebPageProxy.cpp:
696         (WebKit::WebPageProxy::registerAttachmentsFromSerializedData):
697
698         Registers the given serialized attachment data, creating new _WKAttachment instances if necessary. Currently,
699         this does not update the file wrappers of existing _WKAttachments; we should revisit this in the future to see
700         if we can additionally update file wrappers for existing attachments, without breaking the case where the user
701         copies and pastes or drags and drops attachments within a single web view and the client expects _WKAttachment
702         instances to be reused.
703
704         (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
705         * UIProcess/WebPageProxy.h:
706         * UIProcess/WebPageProxy.messages.in:
707         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
708         (WebKit::WebEditorClient::registerAttachments):
709         (WebKit::WebEditorClient::serializedAttachmentDataForIdentifiers):
710
711         Implement a new IPC hook to fetch an array of serialized attachment data blobs, given a list of attachment
712         identifiers.
713
714         * WebProcess/WebCoreSupport/WebEditorClient.h:
715
716 2018-10-30  Chris Dumez  <cdumez@apple.com>
717
718         [PSON] View gesture snapshot gets taken down early when process-swapping
719         https://bugs.webkit.org/show_bug.cgi?id=191083
720         <rdar://problem/45058738>
721
722         Reviewed by Alex Christensen.
723
724         When process-swapping, we would call WebViewImpl::processDidExit(), which would destroy
725         the ViewGestureController and thus take down the swipe navigation snapshot before it
726         should. We now call WebViewImpl::processDidSwap() instead, which does the same thing,
727         except for destroying the ViewGestureController. As a result, the view snapshot stays
728         visible as long as it is needed, even in case of process swap.
729
730         * UIProcess/Cocoa/WebViewImpl.h:
731         * UIProcess/Cocoa/WebViewImpl.mm:
732         (WebKit::WebViewImpl::handleProcessSwapOrExit):
733         (WebKit::WebViewImpl::processWillSwap):
734         (WebKit::WebViewImpl::processDidExit):
735         * UIProcess/mac/PageClientImplMac.mm:
736         (WebKit::PageClientImpl::processWillSwap):
737
738 2018-10-30  Chris Dumez  <cdumez@apple.com>
739
740         [PSON] WebView renders with incorrect dimensions after back or forward
741         https://bugs.webkit.org/show_bug.cgi?id=191071
742         <rdar://problem/45058950>
743
744         Reviewed by Alex Christensen.
745
746         Make sure WebPage::reinitializeWebPage() updates the page's dimensions if needed using the
747         WebPageCreationParameters it is provided.
748
749         * WebProcess/WebPage/WebPage.cpp:
750         (WebKit::WebPage::reinitializeWebPage):
751
752 2018-10-30  Dewei Zhu  <dewei_zhu@apple.com>
753
754         Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
755         https://bugs.webkit.org/show_bug.cgi?id=191049
756
757         Reviewed by Dean Jackson.
758
759         Move the feature flag to experimental feature section.
760
761         * Shared/WebPreferences.yaml:
762
763 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
764
765         Enable InstallAPI for iOS unconditionally
766         https://bugs.webkit.org/show_bug.cgi?id=191043
767         rdar://problem/32728423
768
769         Reviewed by Dan Bernstein.
770
771         * Configurations/Base.xcconfig: Enabled it. Added NSURLDownloadSPI.h as an
772         excluded header - WebKit doesn't export NSURLDownload, so the definition
773         shouldn't be processed by InstallAPI.
774
775 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
776
777         Clean up some obsolete MAX_ALLOWED macros
778         https://bugs.webkit.org/show_bug.cgi?id=190916
779
780         Reviewed by Tim Horton.
781
782         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
783         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
784         * Platform/spi/Cocoa/DeviceIdentitySPI.h:
785         * Platform/spi/ios/UIKitSPI.h:
786         * Shared/WebPreferencesDefaultValues.cpp:
787         (defaultCustomPasteboardDataEnabled):
788         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
789         (WebKit::toPKPaymentRequest):
790         * UIProcess/ios/WKContentViewInteraction.mm:
791         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
792
793 2018-10-30  Commit Queue  <commit-queue@webkit.org>
794
795         Unreviewed, rolling out r237600 and r237604.
796         https://bugs.webkit.org/show_bug.cgi?id=191086
797
798         Breaks internal iOS builds (Requested by ryanhadd_ on
799         #webkit).
800
801         Reverted changesets:
802
803         "Enable InstallAPI for iOS unconditionally"
804         https://bugs.webkit.org/show_bug.cgi?id=191043
805         https://trac.webkit.org/changeset/237600
806
807         "Build fix attempt after enabling InstallAPI for iOS."
808         https://bugs.webkit.org/show_bug.cgi?id=191043
809         https://trac.webkit.org/changeset/237604
810
811 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
812
813         Build fix attempt after enabling InstallAPI for iOS.
814         https://bugs.webkit.org/show_bug.cgi?id=191043
815         rdar://problem/32728423
816
817         * Configurations/WebKit.xcconfig: Skip NSURLDownloadSPI.h here too.
818
819 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
820
821         Enable InstallAPI for iOS unconditionally
822         https://bugs.webkit.org/show_bug.cgi?id=191043
823         rdar://problem/32728423
824
825         Reviewed by Dan Bernstein.
826
827         * Configurations/Base.xcconfig: Enabled it.
828
829 2018-10-30  Zan Dobersek  <zdobersek@igalia.com>
830
831         [CoordGraphics] CoordinatedLayerTreeHost::flushLayersAndForceRepaint() should schedule the flush
832         https://bugs.webkit.org/show_bug.cgi?id=191066
833
834         Reviewed by Michael Catanzaro.
835
836         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
837         (WebKit::CoordinatedLayerTreeHost::flushLayersAndForceRepaint):
838         Only schedule the layer flush in this call, don't perform it on the
839         spot. This avoids re-entry of the layer flushing process in cases when
840         the associated display refresh monitor is requested a callback during
841         the layout phase that's executed under the initial layer flush.
842
843 2018-10-29  Dewei Zhu  <dewei_zhu@apple.com>
844
845         Move 'ProcessSwapOnCrossSiteNavigationEnabled' to 'experimental' category.
846         https://bugs.webkit.org/show_bug.cgi?id=191049
847
848         Reviewed by Chris Dumez.
849
850         Move 'ProcessSwapOnCrossSiteNavigationEnabled' from 'internal' to 'experimental' category.
851
852         * Shared/WebPreferences.yaml:
853
854 2018-10-29  Youenn Fablet  <youenn@apple.com>
855
856         Handle MDNS resolution of candidates through libwebrtc directly
857         https://bugs.webkit.org/show_bug.cgi?id=190681
858
859         Reviewed by Eric Carlson.
860
861         Add support for AsyncResolver to resolve MDNS.
862         This basically reuse the code path used to resolve STUN server addresses.
863         Removed MDNS specific resolution.
864         Use existing CFHost resolution mechanism to do the actual resolution.
865
866         Make sure that a resolver is kept alive while iterating through its clients when signaling done.
867         Some of its clients may indeed call Destroy() on the resolver during that iteration.
868
869         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
870         (WebKit::NetworkMDNSRegister::registerMDNSName):
871         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
872         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
873         (WebKit::LibWebRTCResolver::Destroy):
874         (WebKit::LibWebRTCResolver::doDestroy):
875         (WebKit::LibWebRTCResolver::setResolvedAddress):
876         (WebKit::LibWebRTCResolver::setError):
877         (WebKit::LibWebRTCProvider::createPeerConnection):
878         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
879         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
880         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
881         * WebProcess/Network/webrtc/WebMDNSRegister.h:
882         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
883
884 2018-10-29  Tim Horton  <timothy_horton@apple.com>
885
886         Modernize WebKit nibs and lprojs for localization's sake
887         https://bugs.webkit.org/show_bug.cgi?id=190911
888         <rdar://problem/45349466>
889
890         Reviewed by Dan Bernstein.
891
892         * Resources/WebContentProcess.xib:
893         * WebKit.xcodeproj/project.pbxproj:
894         * en.lproj/InfoPlist.strings: Renamed from Source/WebKit/English.lproj/InfoPlist.strings.
895         English->en
896
897 2018-10-29  Tim Horton  <timothy_horton@apple.com>
898
899         Make FindOptionsShowOverlay work on iOS
900         https://bugs.webkit.org/show_bug.cgi?id=190551
901
902         Reviewed by Andy Estes.
903
904         * WebProcess/WebPage/FindController.cpp:
905         (WebKit::FindController::updateFindUIAfterPageScroll):
906         Update the find indicator after installing the page overlay for the find holes.
907         This ensures that if the find indicator mechanism also uses page overlays,
908         as it does on iOS, that they are installed in the correct order (because
909         order of installation directly affects z-order).
910
911         (WebKit::FindController::findIndicatorRadius const):
912         (WebKit::FindController::shouldHideFindIndicatorOnScroll const):
913         Add two getters for design differences between find-in-page on iOS vs. other platforms.
914
915         (WebKit::FindController::rectsForTextMatchesInRect):
916         Return FloatRects instead of IntRects for ease of use in the caller.
917         Don't clip rects for matches that intersect the current tile. We still
918         drop ones that don't intersect at all, but if they do intersect, we
919         provide the full rect (which may overlap a different tile), so that
920         e.g. border drawing will work correctly.
921
922         (WebKit::FindController::drawRect):
923         Adopt shrink-wrapping for find holes. This has minimal impact on macOS,
924         where the holes don't have rounded corners, but on iOS this makes
925         overlapping or adjacent holes look great. We already do this for the indicator,
926         so it only makes sense to do the same for the holes.
927
928         In order to support shrink-wrapping here, switch to using a Clear operator
929         with a path-fill instead of clearRect to clear out the holes.
930
931         Avoid hiding the find indicator on scroll if the platform says not to.
932
933         * WebProcess/WebPage/FindController.h:
934         * WebProcess/WebPage/ios/FindControllerIOS.mm:
935         (WebKit::FindController::findIndicatorRadius const):
936         (WebKit::FindController::shouldHideFindIndicatorOnScroll const):
937         Slightly adjust the find indicator's parameters to be compatible with having holes.
938         Reduce the horizontal margin by half a point so that it fits precisely in the hole.
939         Drop the "TightlyFitContent" text indicator parameter, because we want 
940         rects that match the holes, and they do not tightly fit the content's height.
941         This matches macOS's behavior.
942
943 2018-10-29  Jer Noble  <jer.noble@apple.com>
944
945         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
946         https://bugs.webkit.org/show_bug.cgi?id=190954
947
948         Reviewed by Simon Fraser.
949
950         * Shared/cg/ShareableBitmapCG.cpp:
951         (WebKit::ShareableBitmap::makeCGImage):
952
953 2018-10-29  Youenn Fablet  <youenn@apple.com>
954
955         Guard H264 simulcast with a runtime flag
956         https://bugs.webkit.org/show_bug.cgi?id=191025
957
958         Reviewed by Eric Carlson.
959
960         * Shared/WebPreferences.yaml:
961
962 2018-10-29  Chris Dumez  <cdumez@apple.com>
963
964         [PSON] When Safari restores session state after launching, going back and forward does not swap processes
965         https://bugs.webkit.org/show_bug.cgi?id=190975
966         <rdar://problem/45059256>
967
968         Reviewed by Antti Koivisto.
969
970         When deciding to process-swap or not on a history navigation, we normally check the BackForwardListItems'
971         process identifiers do check if they come from different WebProcesses or not. However, the check was invalid
972         in the case where the BackForwardListItems were restored by the client. After a session restore, the
973         items' process identifier is the UIProcess one. Therefore, we need to disable the BackForwardListItems'
974         process identifiers check if if the process identifier is the one of the UIProcess.
975
976         * UIProcess/WebProcessPool.cpp:
977         (WebKit::WebProcessPool::processForNavigationInternal):
978
979 2018-10-29  Youenn Fablet  <youenn@apple.com>
980
981         [WebRTC] Enable VP8 by default
982         https://bugs.webkit.org/show_bug.cgi?id=190672
983
984         Reviewed by Eric Carlson.
985
986         * Shared/WebPreferences.yaml:
987
988 2018-10-28  Zan Dobersek  <zdobersek@igalia.com>
989
990         [WPE] Add the WebKitVersion.h header
991         https://bugs.webkit.org/show_bug.cgi?id=191015
992
993         Reviewed by Michael Catanzaro.
994
995         Add the WebKitVersion.h API header for the WPE port. As with other
996         headers providing the GLib API, we have to provide a WPE-specific
997         version, but the implementation file can be shared with the GTK port,
998         and is moved under the UIProcess/API/glib/ directory accordingly.
999
1000         * PlatformWPE.cmake:
1001         * SourcesWPE.txt:
1002         * UIProcess/API/glib/WebKitVersion.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/WebKitVersion.cpp.
1003         * UIProcess/API/wpe/WebKitVersion.h.in: Added.
1004         * UIProcess/API/wpe/webkit.h:
1005
1006 2018-10-26  Megan Gardner  <megan_gardner@apple.com>
1007
1008         Remove Unused WebSelectionAssistant
1009         https://bugs.webkit.org/show_bug.cgi?id=190939
1010
1011         Reviewed by Tim Horton.
1012
1013         We made webSelectionAssistant alwasys nil last year when we moved to using
1014         the textSelectionAssistant for all text selection on the web. This patch merely 
1015         goes through and cleans out all the references to this object that is always nil.
1016         No functionality should change.
1017
1018         * UIProcess/ios/WKContentView.mm:
1019         (-[WKContentView _didExitStableState]):
1020         * UIProcess/ios/WKContentViewInteraction.h:
1021         * UIProcess/ios/WKContentViewInteraction.mm:
1022         (-[WKContentView cleanupInteraction]):
1023         (-[WKContentView resignFirstResponderForWebView]):
1024         (-[WKContentView _scrollingNodeScrollingWillBegin]):
1025         (-[WKContentView _scrollingNodeScrollingDidEnd]):
1026         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
1027         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1028         (-[WKContentView _uiTextSelectionRects]):
1029         (-[WKContentView _singleTapCommited:]):
1030         (-[WKContentView _willStartScrollingOrZooming]):
1031         (-[WKContentView _didEndScrollingOrZooming]):
1032         (-[WKContentView _lookupForWebView:]):
1033         (-[WKContentView _shareForWebView:]):
1034         (-[WKContentView _addShortcutForWebView:]):
1035         (-[WKContentView _showDictionary:]):
1036         (selectionChangedWithGesture):
1037         (selectionChangedWithTouch):
1038         (-[WKContentView selectionInteractionAssistant]):
1039         (-[WKContentView _stopAssistingNode]):
1040         (-[WKContentView _updateChangedSelection:]):
1041         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
1042         (-[WKContentView _restoreCalloutBarIfNeeded]):
1043         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1044         (-[WKContentView webSelectionAssistant]): Deleted.
1045
1046 2018-10-26  Commit Queue  <commit-queue@webkit.org>
1047
1048         Unreviewed, rolling out r237458.
1049         https://bugs.webkit.org/show_bug.cgi?id=190973
1050
1051         broke internal iOS builds (Requested by zalan on #webkit).
1052
1053         Reverted changeset:
1054
1055         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
1056         https://bugs.webkit.org/show_bug.cgi?id=190951
1057         https://trac.webkit.org/changeset/237458
1058
1059 2018-10-26  Chris Dumez  <cdumez@apple.com>
1060
1061         [PSON] Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake
1062         https://bugs.webkit.org/show_bug.cgi?id=190971
1063
1064         Reviewed by Geoffrey Garen.
1065
1066         Only delay attaching drawingArea in case of process swap and drop DidCompletePageTransition IPC handshake.
1067
1068         Since r236257, the WebProcess would always delay attaching the drawing area when a new WebPage is created. The
1069         WebProcess would send a DidCompletePageTransition IPC to the UIProcess when the page transition is complete and
1070         the UIProcess would then send an IPC back to attach the drawing area.
1071
1072         In the new design, WebPageCreationParameters contains a flag indicating if the WebPage should delay attaching
1073         the drawing area or not. We only delay attaching in case of process swap and we've successfuly suspended the
1074         previous page. Then when WebPage::didCompletePageTransition(), we stop sending the DidCompletePageTransition
1075         IPC to the UIProcess and instead have the WebProcess attach the drawing area right away if we've delayed
1076         attaching until then.
1077
1078         * Shared/WebPageCreationParameters.cpp:
1079         (WebKit::WebPageCreationParameters::encode const):
1080         (WebKit::WebPageCreationParameters::decode):
1081         * Shared/WebPageCreationParameters.h:
1082         * UIProcess/DrawingAreaProxy.h:
1083         * UIProcess/WebPageProxy.cpp:
1084         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1085         (WebKit::WebPageProxy::swapToWebProcess):
1086         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1087         (WebKit::WebPageProxy::initializeWebPage):
1088         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1089         * UIProcess/WebPageProxy.h:
1090         * UIProcess/WebPageProxy.messages.in:
1091         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
1092         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1093         * WebProcess/WebPage/DrawingArea.messages.in:
1094         * WebProcess/WebPage/WebPage.cpp:
1095         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1096         (WebKit::WebPage::reinitializeWebPage):
1097         (WebKit::WebPage::didCompletePageTransition):
1098         * WebProcess/WebPage/WebPage.h:
1099         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1100         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1101
1102 2018-10-26  Chris Dumez  <cdumez@apple.com>
1103
1104         [PSON] Avoid tearing down the drawing area when suspending a WebPage due to process-swap
1105         https://bugs.webkit.org/show_bug.cgi?id=190879
1106
1107         Reviewed by Antti Koivisto.
1108
1109         Avoid tearing down the drawing area when suspending a WebPage due to process-swap. We really only need to reset
1110         the drawing area upon resuming the WebPage. There is no strict need to destroy the drawing area on suspension
1111         and this has caused various crashes because code usually assumes we always have a drawing area.
1112
1113         This patch also drops various drawing area null checks that were added to address PSON crashes.
1114
1115         * UIProcess/SuspendedPageProxy.cpp:
1116         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess): Deleted.
1117         * UIProcess/SuspendedPageProxy.h:
1118         * UIProcess/WebPageProxy.cpp:
1119         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1120         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1121         (WebKit::WebPageProxy::didCompletePageTransition):
1122         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
1123         * UIProcess/WebPageProxy.h:
1124         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1125         (WebKit::WebChromeClient::invalidateContentsAndRootView):
1126         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
1127         (WebKit::WebChromeClient::contentsSizeChanged const):
1128         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1129         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1130         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
1131         (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
1132         * WebProcess/WebPage/WebPage.cpp:
1133         (WebKit::WebPage::reinitializeWebPage):
1134         (WebKit::WebPage::exitAcceleratedCompositingMode):
1135         (WebKit::WebPage::setIsSuspended):
1136         (WebKit::WebPage::tearDownDrawingAreaForSuspend): Deleted.
1137         * WebProcess/WebPage/WebPage.h:
1138         * WebProcess/WebPage/WebPage.messages.in:
1139
1140 2018-10-26  Antti Koivisto  <antti@apple.com>
1141
1142         Use random() instead of begin() to limit cache sizes
1143         https://bugs.webkit.org/show_bug.cgi?id=190957
1144
1145         Reviewed by Chris Dumez.
1146
1147         * UIProcess/WebProcessPool.cpp:
1148         (WebKit::WebProcessPool::didCollectPrewarmInformation):
1149
1150 2018-10-26  Chris Dumez  <cdumez@apple.com>
1151
1152         Modernize / Simplify IPC::Connection::sendOutgoingMessage()
1153         https://bugs.webkit.org/show_bug.cgi?id=190931
1154
1155         Reviewed by Alex Christensen.
1156
1157         * Platform/IPC/mac/ConnectionMac.mm:
1158         (IPC::Connection::sendOutgoingMessage):
1159
1160 2018-10-26  Jer Noble  <jer.noble@apple.com>
1161
1162         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
1163         https://bugs.webkit.org/show_bug.cgi?id=190951
1164         <rdar://problem/45213065>
1165
1166         Reviewed by Alex Christensen.
1167
1168         Add an asyncronous reply request to VideoFullscreenManager.
1169
1170         Drive-by fix: messages.py generates "WTFMove(*arg1, *arg2)" instead of "WTFMove(*arg1), WTFMove(*arg2)"
1171         in its reply handler generation.
1172
1173         * Platform/IPC/MessageSender.h:
1174         (IPC::MessageSender::sendWithAsyncReply):
1175         * Scripts/webkit/messages.py:
1176         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
1177         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1178         (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
1179         * WebProcess/cocoa/VideoFullscreenManager.h:
1180         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
1181         * WebProcess/cocoa/VideoFullscreenManager.mm:
1182         (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
1183
1184 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1185
1186         Unreviewed, another try at fixing the GTK build with sandbox enabled
1187
1188         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1189         (WebKit::memfd_create): Deleted.
1190
1191 2018-10-25  Antoine Quint  <graouts@apple.com>
1192
1193         [Web Animations] Turn Web Animations CSS Integration off by default
1194         https://bugs.webkit.org/show_bug.cgi?id=190901
1195
1196         Reviewed by Dean Jackson.
1197
1198         * Shared/WebPreferences.yaml:
1199
1200 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1201
1202         Unreviewed, try to fix GTK build with sandbox enabled
1203
1204         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1205
1206 2018-10-25  Claudio Saavedra  <csaavedra@igalia.com>
1207
1208         [WPE][GTK] Follow-up fixes to the certificate coders
1209         https://bugs.webkit.org/show_bug.cgi?id=190900
1210
1211         Reviewed by Michael Catanzaro.
1212
1213         Cleanup the GRefPtr mess I created earlier. Also we now bail out
1214         if any certificate in the chain has no data instead of returning a
1215         cropped chain.
1216
1217         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1218         (IPC::ArgumentCoder<CertificateInfo>::encode):
1219         (IPC::ArgumentCoder<CertificateInfo>::decode):
1220
1221 2018-10-25  Zan Dobersek  <zdobersek@igalia.com>
1222
1223         [GTK][AC] Resizing the window doesn't always update the visible rect
1224         https://bugs.webkit.org/show_bug.cgi?id=189743
1225
1226         Reviewed by Michael Catanzaro.
1227
1228         Disassociate resizing that can be done on an AcceleratedSurface object
1229         between "host resizes" and "client resizes".
1230
1231         The former is done from ThreadedCoordinatedLayerTreeHost directly, and
1232         is currently used only for GTK on X11, where a new pixmap object is
1233         created on each resize, which affects the context ID that is based on
1234         that pixmap object's address.
1235
1236         The latter is done from the composition thread. It's used for GTK on
1237         Wayland and WPE. In both cases, the underlying window object does not
1238         change on each resize, but it's necessary to perform the actual resize
1239         on the composition thread.
1240
1241         So far it hasn't been performed there, which ended up pushing sizes of
1242         the WebKit view and the underlying window object out of sync during
1243         resizing, leaving parts of window unrendered.
1244
1245         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1246         (WebKit::ThreadedCompositor::renderLayerTree):
1247         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1248         * WebProcess/WebPage/AcceleratedSurface.cpp:
1249         (WebKit::AcceleratedSurface::hostResize):
1250         (WebKit::AcceleratedSurface::resize): Deleted.
1251         * WebProcess/WebPage/AcceleratedSurface.h:
1252         (WebKit::AcceleratedSurface::clientResize):
1253         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1254         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
1255         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
1256         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1257         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
1258         (WebKit::AcceleratedSurfaceWayland::clientResize):
1259         (WebKit::AcceleratedSurfaceWayland::resize): Deleted.
1260         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
1261         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
1262         (WebKit::AcceleratedSurfaceX11::hostResize):
1263         (WebKit::AcceleratedSurfaceX11::resize): Deleted.
1264         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
1265         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1266         (WebKit::AcceleratedSurfaceWPE::clientResize):
1267         (WebKit::AcceleratedSurfaceWPE::resize): Deleted.
1268         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
1269
1270 2018-10-24  Alexey Proskuryakov  <ap@apple.com>
1271
1272         Clean up some obsolete macOS version guards
1273         https://bugs.webkit.org/show_bug.cgi?id=190887
1274
1275         Reviewed by Dan Bernstein.
1276
1277         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1278         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1279         (WebKit::WebProcessPool::platformInitializeWebProcess):
1280
1281 2018-10-24  Megan Gardner  <megan_gardner@apple.com>
1282
1283         Turn on Conic Gradients
1284         https://bugs.webkit.org/show_bug.cgi?id=190810
1285
1286         Reviewed by Tim Horton.
1287
1288         Remove conic gradients from experimental features and turn it on always.
1289
1290         * Configurations/FeatureDefines.xcconfig:
1291         * Shared/WebPreferences.yaml:
1292
1293 2018-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
1294
1295         Cleanup: MIMETypeRegistry functions
1296         https://bugs.webkit.org/show_bug.cgi?id=190838
1297
1298         Reviewed by Simon Fraser.
1299
1300         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1301         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
1302
1303 2018-10-24  Chris Dumez  <cdumez@apple.com>
1304
1305         REGRESSION (r237257): [iOS] Crashes in com.apple.WebKit: WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit
1306         https://bugs.webkit.org/show_bug.cgi?id=190804
1307
1308         Reviewed by Alex Christensen.
1309
1310         Fix null-dereference of the drawing area in RemoteScrollingCoordinator::scheduleTreeStateCommit.
1311         With process-swap-on-navigation enabled, suspended pages' drawing area gets torn down.
1312
1313         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
1314         (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
1315
1316 2018-10-24  Claudio Saavedra  <csaavedra@igalia.com>
1317
1318         [WPE][GTK] Cleanups to the certificate decoder
1319         https://bugs.webkit.org/show_bug.cgi?id=190867
1320
1321         Reviewed by Žan Doberšek.
1322
1323         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1324         (IPC::ArgumentCoder<CertificateInfo>::decode):
1325
1326 2018-10-24  Claudio Saavedra  <csaavedra@igalia.com>
1327
1328         [WPE][GTK] Cleanups to the certificate encoder
1329         https://bugs.webkit.org/show_bug.cgi?id=190865
1330
1331         Reviewed by Žan Doberšek.
1332
1333         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1334         (IPC::ArgumentCoder<CertificateInfo>::encode):
1335
1336 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
1337
1338         Unreviewed, rolling out r237261.
1339
1340         The layout test for this change crashes under GuardMalloc.
1341
1342         Reverted changeset:
1343
1344         "Handle MDNS resolution of candidates through libwebrtc
1345         directly"
1346         https://bugs.webkit.org/show_bug.cgi?id=190681
1347         https://trac.webkit.org/changeset/237261
1348
1349 2018-10-23  David Kilzer  <ddkilzer@apple.com>
1350
1351         Fix false positive leaks when using custom -init methods that don't start with -init
1352         <https://webkit.org/b/190818>
1353         <rdar://problem/45476042>
1354
1355         Reviewed by Dan Bernstein.
1356
1357         * UIProcess/Cocoa/WKWebViewContentProvider.h:
1358         (-[WKWebViewContentProvider web_initWithFrame:webView:mimeType:]):
1359         Add attribute to make this behave like an -init method.
1360
1361 2018-10-23  Chris Dumez  <cdumez@apple.com>
1362
1363         [PSON] Add support for cross-site client-side redirects
1364         https://bugs.webkit.org/show_bug.cgi?id=190806
1365         <rdar://problem/45047344>
1366
1367         Reviewed by Geoffrey Garen.
1368
1369         * Shared/LoadParameters.cpp:
1370         (WebKit::LoadParameters::encode const):
1371         (WebKit::LoadParameters::decode):
1372         * Shared/LoadParameters.h:
1373         * Shared/NavigationActionData.cpp:
1374         (WebKit::NavigationActionData::encode const):
1375         (WebKit::NavigationActionData::decode):
1376         * Shared/NavigationActionData.h:
1377         * Shared/WebBackForwardListItem.cpp:
1378         (WebKit::WebBackForwardListItem::setSuspendedPage):
1379         * UIProcess/API/APINavigation.h:
1380         (API::Navigation::setLockHistory):
1381         (API::Navigation::lockHistory const):
1382         (API::Navigation::setLockBackForwardList):
1383         (API::Navigation::lockBackForwardList const):
1384         (API::Navigation::setClientRedirectSourceForHistory):
1385         (API::Navigation::clientRedirectSourceForHistory const):
1386         * UIProcess/API/APINavigationClient.h:
1387         (API::NavigationClient::willPerformClientRedirect):
1388         (API::NavigationClient::didPerformClientRedirect):
1389         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1390         * UIProcess/Cocoa/NavigationState.h:
1391         * UIProcess/Cocoa/NavigationState.mm:
1392         (WebKit::NavigationState::setNavigationDelegate):
1393         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
1394         * UIProcess/FrameLoadState.h:
1395         (WebKit::FrameLoadState::setURL):
1396         * UIProcess/WebPageProxy.cpp:
1397         (WebKit::WebPageProxy::loadRequestWithNavigation):
1398         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1399         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1400         (WebKit::WebPageProxy::didPerformClientRedirect):
1401         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1402         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1403         * WebProcess/WebPage/WebPage.cpp:
1404         (WebKit::WebPage::loadRequest):
1405         (WebKit::WebPage::setCurrentHistoryItemForReattach):
1406         * WebProcess/WebPage/WebPage.h:
1407         * WebProcess/WebPage/WebPage.messages.in:
1408
1409 2018-10-23  Claudio Saavedra  <csaavedra@igalia.com>
1410
1411         [WPE][GTK] Pass full certificate chain in CertificateInfo coder
1412         https://bugs.webkit.org/show_bug.cgi?id=190789
1413
1414         Reviewed by Michael Catanzaro.
1415
1416         When the network process serializes certificate data to other
1417         processes through the argument coders, the certificate chain, if
1418         present, is lost. In practice this means that applications using
1419         the public API to process certificate info have no details on the
1420         certificate chain, other than the very basics included in the
1421         certificate. Serialize the entire chain if available in the
1422         certificate.
1423
1424         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1425         (IPC::ArgumentCoder<CertificateInfo>::encode): Encode the
1426         certificate chain if present.
1427         (IPC::ArgumentCoder<CertificateInfo>::decode): Decode the
1428         entire certificate chain and rebuild it.
1429
1430 2018-10-22  Keith Rollin  <krollin@apple.com>
1431
1432         Use Location = "Relative to Build Products" rather than "Relative to Group"
1433         https://bugs.webkit.org/show_bug.cgi?id=190781
1434
1435         Reviewed by Alexey Proskuryakov.
1436
1437         Almost all Derived Files are included in Xcode projects with the
1438         Location attribute set to "Relative to Group". While this currently
1439         works, the Derived Files can no longer be found when enabling XCBuild
1440         (which has stricter requirements). Fix this by setting the Location
1441         attribute to "Relative to Build Products".
1442
1443         * WebKit.xcodeproj/project.pbxproj:
1444
1445 2018-10-22  Tim Horton  <timothy_horton@apple.com>
1446
1447         Don't waste time under -setupInteraction under -initWithFrame for unparented WKWebViews
1448         https://bugs.webkit.org/show_bug.cgi?id=190801
1449         <rdar://problem/43674361>
1450
1451         Reviewed by Megan Gardner.
1452
1453         * UIProcess/ios/WKContentView.mm:
1454         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1455         (-[WKContentView didMoveToWindow]):
1456         Defer the first call to WKContentViewInteraction's -setupInteraction
1457         until the view is parented. This avoids a few milliseconds of unnecessary
1458         work for views that are never parented.
1459
1460         * UIProcess/ios/WKContentViewInteraction.h:
1461         * UIProcess/ios/WKContentViewInteraction.mm:
1462         (-[WKContentView setupInteraction]):
1463         (-[WKContentView cleanupInteraction]):
1464         Keep track of the current state of WKContentViewInteraction's gestures.
1465         Use this to make it OK to call -setupInteraction multiple times.
1466
1467 2018-10-22  Chris Dumez  <cdumez@apple.com>
1468
1469         Deque's contains() and findIf() should be const
1470         https://bugs.webkit.org/show_bug.cgi?id=190796
1471
1472         Reviewed by Antti Koivisto.
1473
1474         Mark method as const now that Deque's implementation allows it to be.
1475
1476         * UIProcess/WebProcessPool.cpp:
1477         (WebKit::WebProcessPool::hasSuspendedPageProxyFor const):
1478         (WebKit::WebProcessPool::hasSuspendedPageProxyFor): Deleted.
1479         * UIProcess/WebProcessPool.h:
1480
1481 2018-10-19  Brent Fulgham  <bfulgham@apple.com>
1482
1483         Allow WebContent process to check some file system features
1484         https://bugs.webkit.org/show_bug.cgi?id=190768
1485         <rdar://problem/45377609>
1486
1487         Reviewed by Alexey Proskuryakov.
1488
1489         This patch unblocks some IOKit properties that are needed by lower level frameworks to make decisions
1490         about how to efficiently use the file system.
1491
1492         * WebProcess/com.apple.WebProcess.sb.in:
1493
1494 2018-10-19  Stephan Szabo  <stephan.szabo@sony.com>
1495
1496         [WinCairo] Search terms are not saved for <input type="search">
1497         https://bugs.webkit.org/show_bug.cgi?id=188174
1498
1499         Reviewed by Fujii Hironori.
1500
1501         Add support for saving the search terms for <input
1502         type="search"> to a SQLite database, replacing the
1503         CF-based implementation for Windows and adding support
1504         for non-legacy WebKit.
1505
1506         * UIProcess/win/WebPageProxyWin.cpp:
1507         (WebKit::WebPageProxy::saveRecentSearches): Use SQLite database
1508         implementation in WebCore::SearchPopupMenuDB to save search
1509         terms
1510         (WebKit::WebPageProxy::loadRecentSearches): Use SQLite database
1511         implementation in WebCore::SearchPopupMenuDB to load search
1512         terms
1513
1514 2018-10-19  Alex Christensen  <achristensen@webkit.org>
1515
1516         WebDataListSuggestionsDropdown should use a WeakPtr
1517         https://bugs.webkit.org/show_bug.cgi?id=190763
1518         <rdar://problem/45417449>
1519
1520         Reviewed by Tim Horton.
1521
1522         Nothing suspicious here. It's just good practice to not keep raw pointers that aren't reset when the object they point to are destroyed.
1523
1524         * UIProcess/WebDataListSuggestionsDropdown.cpp:
1525         (WebKit::WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown):
1526         (WebKit::WebDataListSuggestionsDropdown::close):
1527         * UIProcess/WebDataListSuggestionsDropdown.h:
1528         (WebKit::WebDataListSuggestionsDropdown::Client::~Client): Deleted.
1529         * UIProcess/WebPageProxy.h:
1530         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
1531         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
1532         (WebKit::WebDataListSuggestionsDropdownIOS::create):
1533         (WebKit::WebDataListSuggestionsDropdownIOS::WebDataListSuggestionsDropdownIOS):
1534         (WebKit::WebDataListSuggestionsDropdownIOS::close):
1535         (WebKit::WebDataListSuggestionsDropdownIOS::didSelectOption):
1536         * UIProcess/mac/WebDataListSuggestionsDropdownMac.h:
1537         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
1538         (WebKit::WebDataListSuggestionsDropdownMac::create):
1539         (WebKit::WebDataListSuggestionsDropdownMac::WebDataListSuggestionsDropdownMac):
1540         (WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
1541         (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
1542
1543 2018-10-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1544
1545         [iOS] [Datalist] Can't pick datalist suggestions in a stock WKWebView
1546         https://bugs.webkit.org/show_bug.cgi?id=190621
1547         <rdar://problem/45310649>
1548
1549         Reviewed by Tim Horton.
1550
1551         Fixes the bug by refactoring datalist suggestion information on iOS; currently, we override text suggestions on
1552         _WKFormInputSession. This only works for a few internal clients (including Safari) that set a _WKInputDelegate
1553         and also implement either -_webView:willStartInputSession: or -_webView:didStartInputSession:, which is
1554         necessary in order to ensure that WebKit creates and maintains a form input session.
1555
1556         The two pieces of information that datalist code needs to vend to WKContentView are a list of UITextSuggestions
1557         and a custom input view, which are both currently properties of _WKFormInputSession. This patch lifts these out
1558         of the input session and makes them properties of WKContentView, which are used in
1559         WebDataListSuggestionsDropdownIOS.
1560
1561         Test: fast/forms/datalist/datalist-textinput-suggestions-order.html
1562
1563         * UIProcess/ios/WKContentViewInteraction.h:
1564         * UIProcess/ios/WKContentViewInteraction.mm:
1565
1566         Add new properties to WKContentView: an input view for datalist suggestions, and a list of text suggestions.
1567
1568         (-[WKFormInputSession setSuggestions:]):
1569         (-[WKContentView setupInteraction]):
1570         (-[WKContentView cleanupInteraction]):
1571         (-[WKContentView _endEditing]):
1572
1573         Pull out common logic when resigning first responder or tabbing to the next or previous text field into a new
1574         helper. This helper notifies `_inputPeripheral`, `_formInputSession`, and `_dataListTextSuggestionsInputView`
1575         when editing has ended; the input peripheral and suggestions input view use this chance to send the value of the
1576         form control to the web process.
1577
1578         (-[WKContentView resignFirstResponderForWebView]):
1579         (-[WKContentView inputView]):
1580
1581         If a custom input view is not set but we have an input view for a datalist's text suggestions, use the datalist
1582         input view.
1583
1584         (-[WKContentView accessoryTab:]):
1585         (-[WKContentView _stopAssistingNode]):
1586
1587         Clear datalist state on WKContentView.
1588
1589         (-[WKContentView dataListTextSuggestionsInputView]):
1590         (-[WKContentView dataListTextSuggestions]):
1591         (-[WKContentView setDataListTextSuggestionsInputView:]):
1592         (-[WKContentView setDataListTextSuggestions:]):
1593         (-[WKContentView updateTextSuggestionsForInputDelegate]):
1594
1595         Pull out logic for setting suggestions on UIKit's `inputDelegate` (i.e. UIKeyboardImpl). We now first consult
1596         internally-vended text suggestions from _WKFormInputSession; if an internal client has not overridden our text
1597         suggestions, then we simply use suggestions from the current datalist (if present).
1598
1599         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
1600         (-[WKDataListSuggestionsPicker updateWithInformation:]):
1601         (-[WKDataListSuggestionsPicker showSuggestionsDropdown:activationType:]):
1602         (-[WKDataListSuggestionsPicker invalidate]):
1603         (-[WKDataListSuggestionsPopover updateWithInformation:]):
1604         (-[WKDataListSuggestionsPopover showSuggestionsDropdown:activationType:]):
1605         (-[WKDataListSuggestionsPopover didSelectOptionAtIndex:]):
1606
1607         Change all the places that currently manipulate WKContentView's form input session to directly set text
1608         suggestions and the text suggestion input view on the content view instead.
1609
1610 2018-10-19  John Wilander  <wilander@apple.com>
1611
1612         Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
1613         https://bugs.webkit.org/show_bug.cgi?id=190687
1614         <rdar://problem/45349024>
1615
1616         Reviewed by Alex Christensen.
1617
1618         This patch adds the following:
1619         - The WebProcessPool now tells the WebsiteDataStore when a network process has
1620             been created.
1621         - The WebsiteDataStore in turn tells the WebResourceLoadStatisticsStore when
1622             a network process has been created.
1623         - The WebResourceLoadStatisticsStore makes sure to update the network processes
1624             with its cookie policy when it's notified that a network process has been
1625             created.
1626
1627         In addition, this patch changes the following:
1628         - The ResourceLoadStatisticsMemoryStore no longer keeps track of which domains
1629             it has told the network process to block cookies for. The reason is that
1630             we cannot assume that there is only one network process so we should
1631             always send complete blocking data.
1632         - The ResourceLoadStatisticsMemoryStore's functions for communicating cookie
1633             blocking state to the network process no longer take and forward the
1634             "clear first" parameter. This is because complete data is sent every time
1635             and thus the network process' set is always cleared on an update.
1636         - Removes WebsiteDataStore::networkProcessDidCrash() and
1637             WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset() since
1638             the call site---WebProcessPool::ensureNetworkProcess()---now calls
1639             WebsiteDataStore::didCreateNetworkProcess() after a network process
1640             crash and the state sync for cookie blocking is triggered.
1641
1642         * NetworkProcess/NetworkProcess.cpp:
1643         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
1644         (WebKit::NetworkProcess::setShouldCapLifetimeForClientSideCookies):
1645         * NetworkProcess/NetworkProcess.h:
1646         * NetworkProcess/NetworkProcess.messages.in:
1647         * UIProcess/Network/NetworkProcessProxy.cpp:
1648         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1649         (WebKit::NetworkProcessProxy::setShouldCapLifetimeForClientSideCookies):
1650         (WebKit::NetworkProcessProxy::didSetShouldCapLifetimeForClientSideCookies):
1651         * UIProcess/Network/NetworkProcessProxy.h:
1652         * UIProcess/Network/NetworkProcessProxy.messages.in:
1653         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1654         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
1655         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
1656         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
1657         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
1658         (WebKit::ResourceLoadStatisticsMemoryStore::resetCookieBlockingState): Deleted.
1659         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
1660         * UIProcess/WebProcessPool.cpp:
1661         (WebKit::WebProcessPool::ensureNetworkProcess):
1662         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1663         (WebKit::WebResourceLoadStatisticsStore::didCreateNetworkProcess):
1664         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
1665         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1666         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
1667         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset): Deleted.
1668         * UIProcess/WebResourceLoadStatisticsStore.h:
1669         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1670         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
1671         (WebKit::WebsiteDataStore::setShouldCapLifetimeForClientSideCookies):
1672         (WebKit::WebsiteDataStore::didCreateNetworkProcess):
1673         (WebKit::WebsiteDataStore::networkProcessDidCrash): Deleted.
1674         * UIProcess/WebsiteData/WebsiteDataStore.h:
1675
1676 2018-10-19  Alex Christensen  <achristensen@webkit.org>
1677
1678         Rebase python tests.
1679
1680         * Scripts/webkit/messages_unittest.py:
1681
1682 2018-10-19  Alex Christensen  <achristensen@webkit.org>
1683
1684         Rebase python tests.
1685
1686         * Scripts/Makefile:
1687         * Scripts/webkit/MessageReceiver-expected.cpp:
1688         * Scripts/webkit/Messages-expected.h:
1689
1690 2018-10-19  Alex Christensen  <achristensen@webkit.org>
1691
1692         Mark LegacySync IPC messages
1693         https://bugs.webkit.org/show_bug.cgi?id=190759
1694
1695         Reviewed by Tim Horton.
1696
1697         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1698         * NetworkProcess/NetworkProcess.messages.in:
1699         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
1700         * Platform/IPC/HandleMessage.h:
1701         (IPC::handleMessageLegacySync):
1702         * PluginProcess/PluginControllerProxy.messages.in:
1703         * Scripts/webkit/messages.py:
1704         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
1705         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1706         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1707         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1708         * UIProcess/WebFullScreenManagerProxy.messages.in:
1709         * UIProcess/WebPageProxy.messages.in:
1710         * UIProcess/WebPasteboardProxy.messages.in:
1711         * UIProcess/WebProcessPool.messages.in:
1712         * UIProcess/WebProcessProxy.messages.in:
1713         * UIProcess/WebStorage/StorageManager.messages.in:
1714         * UIProcess/mac/SecItemShimProxy.messages.in:
1715         * WebProcess/Plugins/PluginProcessConnection.messages.in:
1716         * WebProcess/Plugins/PluginProxy.messages.in:
1717         * WebProcess/WebPage/WebPage.messages.in:
1718         * WebProcess/WebProcess.messages.in:
1719
1720 2018-10-19  Alex Christensen  <achristensen@webkit.org>
1721
1722         Update and add python tests after r237294
1723         https://bugs.webkit.org/show_bug.cgi?id=190746
1724
1725         * Scripts/Makefile: Added to help updating expectations.
1726         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
1727         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
1728         (Messages::WebPage::TestAsyncMessage::callReply):
1729         (Messages::WebPage::TestAsyncMessage::cancelReply):
1730         (Messages::WebPage::TestAsyncMessage::send):
1731         (WebKit::WebPage::didReceiveMessage):
1732         * Scripts/webkit/MessagesSuperclass-expected.h:
1733         (Messages::WebPage::TestAsyncMessage::receiverName):
1734         (Messages::WebPage::TestAsyncMessage::name):
1735         (Messages::WebPage::TestAsyncMessage::asyncMessageReplyName):
1736         (Messages::WebPage::TestAsyncMessage::TestAsyncMessage):
1737         (Messages::WebPage::TestAsyncMessage::arguments const):
1738         * Scripts/webkit/test-superclass-messages.in:
1739         Adding the extra newline made python tests fail.
1740         I also added more tests for the new functionality introduced in r237924.
1741
1742 2018-10-19  Alex Christensen  <achristensen@webkit.org>
1743
1744         Introduce CompletionHandler-based Async IPC messages with replies
1745         https://bugs.webkit.org/show_bug.cgi?id=190746
1746
1747         Reviewed by Tim Horton.
1748
1749         Before this patch, to make an asynchronous IPC message with a reply you had to find two objects that
1750         can talk to each other, make two new message types, send a generated identifier, keep track of that
1751         identifier, make a HashMap somewhere to store the object waiting for the response, and hook it all up.
1752         What a mess.  No wonder people take shortcuts and make strange design decisions.
1753
1754         Now, you can just use a CompletionHandler and mark the reply as Async in *.messages.in.
1755         I've adopted this with a message whose behavior is covered by the storage/indexeddb/modern/blob-cursor.html
1756         layout test and many others.  I intent to refine and further adopt this incrementally.
1757
1758         * NetworkProcess/NetworkProcess.cpp:
1759         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
1760         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
1761         * NetworkProcess/NetworkProcess.h:
1762         * NetworkProcess/NetworkProcess.messages.in:
1763         This is representative of how code will be simplified with greater adoption. 
1764         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1765         (WebKit::NetworkResourceLoadParameters::decode):
1766         Modernize HandleArray decoding.
1767         * Platform/IPC/Connection.cpp:
1768         (IPC::Connection::dispatchMessage):
1769         (IPC::nextAsyncReplyHandlerID):
1770         (IPC::asyncReplyHandlerMap):
1771         Handle async replies when looking at incoming messages from the sending process.
1772         * Platform/IPC/Connection.h:
1773         (IPC::Connection::sendWithAsyncReply):
1774         Send a message with an async reply and prepare the reply receiver.
1775         * Platform/IPC/Encoder.h:
1776         Make the uint64_t encoder public so we can use it when encoding the listenerID.
1777         * Platform/IPC/HandleMessage.h:
1778         (IPC::handleMessageAsync):
1779         Handle an asynchronous message with a reply from the receiving process.
1780         This is similar to how DelayedReply messages are handled, but the listenerID is automatically captured and sent back.
1781         * Scripts/webkit/messages.py:
1782         Generate code for async message replies.
1783         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
1784         (WebKit::WebIDBResult::decode):
1785         * Shared/SandboxExtension.h:
1786         (WebKit::SandboxExtension::HandleArray::at):
1787         (WebKit::SandboxExtension::HandleArray::decode):
1788         * Shared/WebProcessCreationParameters.cpp:
1789         (WebKit::WebProcessCreationParameters::decode):
1790         * Shared/mac/SandboxExtensionMac.mm:
1791         (WebKit::SandboxExtension::HandleArray::decode):
1792         Modernize the decoding of HandleArray to work with generated decoding.
1793         * UIProcess/Network/NetworkProcessProxy.cpp:
1794         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
1795         * UIProcess/Network/NetworkProcessProxy.h:
1796         * UIProcess/Network/NetworkProcessProxy.messages.in:
1797         This is also representative of how code will be simplified with greater adoption.
1798         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp:
1799         (WebKit::MediaDeviceSandboxExtensions::decode):
1800         Modernize HandleArray decoding.
1801
1802 2018-10-19  Chris Dumez  <cdumez@apple.com>
1803
1804         [PSON] WebPageProxy::didCompletePageTransition() may interact with a SuspendedPageProxy from a previous navigation
1805         https://bugs.webkit.org/show_bug.cgi?id=190717
1806
1807         Reviewed by Antti Koivisto.
1808
1809         WebPageProxy::didCompletePageTransition() may interact with a SuspendedPageProxy from a previous navigation. We need
1810         to reset m_lastSuspendedPage whenever the page starts a new navigation as m_lastSuspendedPage is only updated when
1811         we process-swap otherwise.
1812
1813         Also rename the data member to m_pageSuspendedDueToCurrentNavigation for clarity.
1814
1815         In a follow-up, I will see if I can get rid of this data member entirely or maybe move it to the Navigation
1816         object.
1817
1818         * UIProcess/WebPageProxy.cpp:
1819         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1820         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1821         (WebKit::WebPageProxy::didCompletePageTransition):
1822         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
1823
1824 2018-10-18  Eric Carlson  <eric.carlson@apple.com>
1825
1826         [MediaStream] Allow ports to optionally do screen capture in the UI process
1827         https://bugs.webkit.org/show_bug.cgi?id=190728
1828         <rdar://problem/45376824>
1829
1830         Reviewed by Jer Noble and Tim Horton.
1831
1832         * Shared/WebProcessCreationParameters.cpp:
1833         (WebKit::WebProcessCreationParameters::encode const): Encode shouldCaptureDisplayInUIProcess.
1834         (WebKit::WebProcessCreationParameters::decode): Decode shouldCaptureDisplayInUIProcess.
1835         * Shared/WebProcessCreationParameters.h:
1836
1837         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1838         (API::ProcessPoolConfiguration::copy): Copy shouldCaptureDisplayInUIProcess.
1839         * UIProcess/API/APIProcessPoolConfiguration.h:
1840
1841         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1842         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable):
1843         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): Remove
1844         RealtimeMediaSource::Type parameter, CaptureDevice has the same information. Deal with display
1845         capture "devices".
1846         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1847         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1848
1849         * UIProcess/WebProcessPool.cpp:
1850         (WebKit::WebProcessPool::initializeNewWebProcess): Copy shouldCaptureDisplayInUIProcess.
1851
1852         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1853         (WebKit::UserMediaCaptureManager::Source::Source): Only allocate a ring buffer for Audio sources.
1854         (WebKit::UserMediaCaptureManager::Source::~Source): Same for deallocate.
1855         (WebKit::UserMediaCaptureManager::Source::storage): m_ringBuffer is a pointer.
1856         (WebKit::UserMediaCaptureManager::Source::setStorage): Ditto.
1857         (WebKit::UserMediaCaptureManager::Source::setRingBufferFrameBounds): Ditto.
1858         (WebKit::UserMediaCaptureManager::Source::audioSamplesAvailable): Ditto.
1859         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Create a 
1860         PixelBuffer-backed media sample and call videoSampleAvailable.
1861         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): Clear the audio and display capture
1862         factory overrides.
1863         (WebKit::UserMediaCaptureManager::initialize): Set the audio and display capture factory overrides.
1864         (WebKit::UserMediaCaptureManager::createCaptureSource):
1865         (WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
1866         * WebProcess/cocoa/UserMediaCaptureManager.h:
1867         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
1868
1869 2018-10-18  Truitt Savell  <tsavell@apple.com>
1870
1871         Unreviewed, rolling out r237272.
1872
1873         Broke on device iOS builds and Windows builds
1874
1875         Reverted changeset:
1876
1877         "[MediaStream] Allow ports to optionally do screen capture in
1878         the UI process"
1879         https://bugs.webkit.org/show_bug.cgi?id=190728
1880         https://trac.webkit.org/changeset/237272
1881
1882 2018-10-18  Jer Noble  <jer.noble@apple.com>
1883
1884         Enable WKPreferences._lowPowerVideoAudioBufferSizeEnabled by default
1885         https://bugs.webkit.org/show_bug.cgi?id=190315
1886
1887         Reviewed by Eric Carlson.
1888
1889         This preference is disabled for WebKitLegacy because it can interact poorly with clients' own use of audio.
1890         It can be enabled for WebKit since it will only affect the WebProcess and not the client process.
1891
1892         * Shared/WebPreferences.yaml:
1893
1894 2018-10-18  Eric Carlson  <eric.carlson@apple.com>
1895
1896         [MediaStream] Allow ports to optionally do screen capture in the UI process
1897         https://bugs.webkit.org/show_bug.cgi?id=190728
1898         <rdar://problem/45376824>
1899
1900         Reviewed by Jer Noble and Tim Horton.
1901
1902         * Shared/WebProcessCreationParameters.cpp:
1903         (WebKit::WebProcessCreationParameters::encode const): Encode shouldCaptureDisplayInUIProcess.
1904         (WebKit::WebProcessCreationParameters::decode): Decode shouldCaptureDisplayInUIProcess.
1905         * Shared/WebProcessCreationParameters.h:
1906
1907         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1908         (API::ProcessPoolConfiguration::copy): Copy shouldCaptureDisplayInUIProcess.
1909         * UIProcess/API/APIProcessPoolConfiguration.h:
1910
1911         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1912         (WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable):
1913         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): Remove
1914         RealtimeMediaSource::Type parameter, CaptureDevice has the same information. Deal with display
1915         capture "devices".
1916         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1917         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1918
1919         * UIProcess/WebProcessPool.cpp:
1920         (WebKit::WebProcessPool::initializeNewWebProcess): Copy shouldCaptureDisplayInUIProcess.
1921
1922         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1923         (WebKit::UserMediaCaptureManager::Source::Source): Only allocate a ring buffer for Audio sources.
1924         (WebKit::UserMediaCaptureManager::Source::~Source): Same for deallocate.
1925         (WebKit::UserMediaCaptureManager::Source::storage): m_ringBuffer is a pointer.
1926         (WebKit::UserMediaCaptureManager::Source::setStorage): Ditto.
1927         (WebKit::UserMediaCaptureManager::Source::setRingBufferFrameBounds): Ditto.
1928         (WebKit::UserMediaCaptureManager::Source::audioSamplesAvailable): Ditto.
1929         (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Create a 
1930         PixelBuffer-backed media sample and call videoSampleAvailable.
1931         (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): Clear the audio and display capture
1932         factory overrides.
1933         (WebKit::UserMediaCaptureManager::initialize): Set the audio and display capture factory overrides.
1934         (WebKit::UserMediaCaptureManager::createCaptureSource):
1935         (WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
1936         * WebProcess/cocoa/UserMediaCaptureManager.h:
1937         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
1938
1939 2018-10-18  Chris Dumez  <cdumez@apple.com>
1940
1941         [PSON] SuspendedPages do not report meaningful domains in Activity Monitor
1942         https://bugs.webkit.org/show_bug.cgi?id=190721
1943         <rdar://problem/45059699>
1944
1945         Reviewed by Alex Christensen.
1946
1947         SuspendedPages do not report meaningful domains in Activity Monitor, which makes
1948         debugging harder.
1949
1950         * WebProcess/cocoa/WebProcessCocoa.mm:
1951         (WebKit::origin):
1952         (WebKit::WebProcess::updateActivePages):
1953
1954 2018-10-18  Alexey Proskuryakov  <ap@apple.com>
1955
1956         Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY)
1957         https://bugs.webkit.org/show_bug.cgi?id=190729
1958
1959         Reviewed by Tim Horton.
1960
1961         * DerivedSources.make:
1962         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1963         (WebKit::Download::resume):
1964         * NetworkProcess/NetworkActivityTracker.h:
1965         * NetworkProcess/NetworkProcess.h:
1966         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1967         (WebKit::NetworkProcessCreationParameters::encode const):
1968         (WebKit::NetworkProcessCreationParameters::decode):
1969         * NetworkProcess/NetworkProcessCreationParameters.h:
1970         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1971         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
1972         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1973         (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
1974         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1975         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1976         (WebKit::NetworkProcess::sourceApplicationAuditData const):
1977         (WebKit::NetworkProcess::platformSyncAllCookies):
1978         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1979         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1980         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1981         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1982         * NetworkProcess/ios/NetworkProcessIOS.mm:
1983         * Platform/IPC/mac/ConnectionMac.mm:
1984         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
1985         (IPC::Connection::receiveSourceEventHandler):
1986         (IPC::AccessibilityProcessSuspendedNotification):
1987         * Platform/ios/AccessibilityIOS.mm:
1988         * Platform/mac/LayerHostingContext.mm:
1989         (WebKit::LayerHostingContext::createForExternalHostingProcess):
1990         * Platform/spi/Cocoa/DeviceIdentitySPI.h:
1991         * Platform/spi/ios/CelestialSPI.h:
1992         * Platform/spi/ios/FrontBoardServicesSPI.h:
1993         * PluginProcess/mac/PluginProcessShim.mm:
1994         * Shared/API/Cocoa/WKDataDetectorTypesInternal.h:
1995         * Shared/API/Cocoa/WebKit.m:
1996         * Shared/AssistedNodeInformation.cpp:
1997         * Shared/AssistedNodeInformation.h:
1998         * Shared/CacheModel.cpp:
1999         (WebKit::calculateURLCacheSizes):
2000         * Shared/ChildProcess.cpp:
2001         * Shared/Cocoa/APIObject.mm:
2002         (API::Object::newObject):
2003         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
2004         (WebKit::runInitializationCode):
2005         * Shared/DrawingAreaInfo.h:
2006         * Shared/EditorState.cpp:
2007         (WebKit::EditorState::encode const):
2008         (WebKit::EditorState::decode):
2009         (WebKit::EditorState::PostLayoutData::encode const):
2010         (WebKit::EditorState::PostLayoutData::decode):
2011         (WebKit::operator<<):
2012         * Shared/EditorState.h:
2013         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2014         (WebKit::XPCServiceInitializerDelegate::checkEntitlements):
2015         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2016         (WebKit::XPCServiceMain):
2017         * Shared/NativeWebKeyboardEvent.h:
2018         * Shared/NativeWebMouseEvent.h:
2019         * Shared/NativeWebTouchEvent.h:
2020         * Shared/PrintInfo.cpp:
2021         (WebKit::PrintInfo::encode const):
2022         (WebKit::PrintInfo::decode):
2023         * Shared/PrintInfo.h:
2024         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
2025         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
2026         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
2027         * Shared/SessionState.cpp:
2028         (WebKit::FrameState::encode const):
2029         (WebKit::FrameState::decode):
2030         * Shared/SessionState.h:
2031         * Shared/WebCoreArgumentCoders.cpp:
2032         * Shared/WebCoreArgumentCoders.h:
2033         * Shared/WebEvent.h:
2034         * Shared/WebEventConversion.cpp:
2035         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
2036         * Shared/WebKeyboardEvent.cpp:
2037         * Shared/WebPageCreationParameters.cpp:
2038         (WebKit::WebPageCreationParameters::encode const):
2039         (WebKit::WebPageCreationParameters::decode):
2040         * Shared/WebPageCreationParameters.h:
2041         * Shared/WebPlatformTouchPoint.cpp:
2042         * Shared/WebPreferences.yaml:
2043         * Shared/WebPreferencesDefaultValues.cpp:
2044         (defaultPassiveTouchListenersAsDefaultOnDocument):
2045         (defaultCustomPasteboardDataEnabled):
2046         * Shared/WebPreferencesDefaultValues.h:
2047         * Shared/WebProcessCreationParameters.cpp:
2048         (WebKit::WebProcessCreationParameters::encode const):
2049         (WebKit::WebProcessCreationParameters::decode):
2050         * Shared/WebProcessCreationParameters.h:
2051         * Shared/WebTouchEvent.cpp:
2052         * Shared/cf/ArgumentCodersCF.cpp:
2053         (IPC::encode):
2054         (IPC::decode):
2055         * Shared/cf/ArgumentCodersCF.h:
2056         * Shared/ios/ChildProcessIOS.mm:
2057         * Shared/ios/InteractionInformationAtPosition.h:
2058         * Shared/ios/InteractionInformationAtPosition.mm:
2059         * Shared/ios/InteractionInformationRequest.cpp:
2060         * Shared/ios/InteractionInformationRequest.h:
2061         * Shared/ios/NativeWebKeyboardEventIOS.mm:
2062         * Shared/ios/NativeWebMouseEventIOS.mm:
2063         * Shared/ios/NativeWebTouchEventIOS.mm:
2064         * Shared/ios/WebIOSEventFactory.h:
2065         * Shared/ios/WebIOSEventFactory.mm:
2066         * Shared/ios/WebIconUtilities.h:
2067         * Shared/ios/WebIconUtilities.mm:
2068         * Shared/mac/ArgumentCodersMac.h:
2069         * Shared/mac/ArgumentCodersMac.mm:
2070         * Shared/mac/SandboxExtensionMac.mm:
2071         * Shared/mac/SecItemShim.cpp:
2072         (WebKit::initializeSecItemShim):
2073         * UIProcess/API/APIPageConfiguration.cpp:
2074         (API::PageConfiguration::copy const):
2075         * UIProcess/API/APIPageConfiguration.h:
2076         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2077         (API::ProcessPoolConfiguration::copy):
2078         * UIProcess/API/APIProcessPoolConfiguration.h:
2079         * UIProcess/API/APIUIClient.h:
2080         * UIProcess/API/C/WKInspector.cpp:
2081         * UIProcess/API/C/WKPage.cpp:
2082         (WKPageSetIgnoresViewportScaleLimits):
2083         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2084         (WKContextIsPlugInUpdateAvailable):
2085         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
2086         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2087         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2088         (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
2089         (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
2090         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2091         (-[WKNavigationAction description]):
2092         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm:
2093         * UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
2094         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2095         (IGNORE_WARNINGS_BEGIN):
2096         * UIProcess/API/Cocoa/WKProcessPool.mm:
2097         (-[WKProcessPool _pluginProcessCount]):
2098         * UIProcess/API/Cocoa/WKWebView.mm:
2099         (shouldRequireUserGestureToLoadVideo):
2100         (validate):
2101         (-[WKWebView _initializeWithConfiguration:]):
2102         (-[WKWebView _setUpSQLiteDatabaseTrackerClient]):
2103         (-[WKWebView dealloc]):
2104         (-[WKWebView allowsLinkPreview]):
2105         (-[WKWebView setAllowsLinkPreview:]):
2106         (-[WKWebView _countStringMatches:options:maxCount:]):
2107         (-[WKWebView _findString:options:maxCount:]):
2108         (-[WKWebView _hideFindUI]):
2109         (-[WKWebView _scrollPerformanceData]):
2110         (-[WKWebView _allowsMediaDocumentInlinePlayback]):
2111         (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]):
2112         (-[WKWebView _contentsOfUserInterfaceItem:]):
2113         (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
2114         (-[WKWebView _doAfterNextVisibleContentRectUpdate:]):
2115         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2116         (-[WKWebViewConfiguration init]):
2117         (-[WKWebViewConfiguration encodeWithCoder:]):
2118         (-[WKWebViewConfiguration initWithCoder:]):
2119         (-[WKWebViewConfiguration copyWithZone:]):
2120         (defaultApplicationNameForUserAgent):
2121         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
2122         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2123         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
2124         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]):
2125         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
2126         * UIProcess/API/Cocoa/_WKAttachment.mm:
2127         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:
2128         * UIProcess/API/Cocoa/_WKElementAction.mm:
2129         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
2130         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2131         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
2132         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2133         (-[WKPaymentAuthorizationViewControllerDelegate invalidate]):
2134         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
2135         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
2136         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
2137         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
2138         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2139         (WebKit::toPKPaymentRequest):
2140         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
2141         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
2142         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
2143         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
2144         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2145         * UIProcess/ApplicationStateTracker.h:
2146         * UIProcess/ApplicationStateTracker.mm:
2147         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
2148         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
2149         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
2150         (WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):
2151         * UIProcess/ChildProcessProxy.cpp:
2152         (WebKit::ChildProcessProxy::shutDownProcess):
2153         * UIProcess/Cocoa/DownloadClient.h:
2154         * UIProcess/Cocoa/DownloadClient.mm:
2155         (WebKit::DownloadClient::takeActivityToken):
2156         (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
2157         * UIProcess/Cocoa/LayerRepresentation.h:
2158         * UIProcess/Cocoa/NavigationState.h:
2159         * UIProcess/Cocoa/NavigationState.mm:
2160         (WebKit::NavigationState::NavigationState):
2161         (WebKit::NavigationState::didChangeIsLoading):
2162         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
2163         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
2164         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2165         * UIProcess/Cocoa/UIDelegate.h:
2166         * UIProcess/Cocoa/UIDelegate.mm:
2167         (WebKit::UIDelegate::setDelegate):
2168         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2169         * UIProcess/Cocoa/VersionChecks.h:
2170         * UIProcess/Cocoa/VersionChecks.mm:
2171         (WebKit::linkedOnOrAfter):
2172         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2173         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
2174         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2175         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
2176         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
2177         (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
2178         (WebKit::VideoFullscreenManagerProxy::setVideoLayerFrame):
2179         * UIProcess/Cocoa/ViewGestureController.h:
2180         * UIProcess/Cocoa/WKShareSheet.mm:
2181         (-[WKShareSheet presentWithParameters:completionHandler:]):
2182         * UIProcess/Cocoa/WKWebViewContentProvider.h:
2183         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
2184         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2185         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2186         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2187         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2188         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
2189         (WebKit::WebProcessPool::platformInitializeWebProcess):
2190         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2191         (WebKit::WebProcessPool::registerNotificationObservers):
2192         (WebKit::WebProcessPool::unregisterNotificationObservers):
2193         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
2194         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
2195         * UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
2196         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2197         (WebKit::shouldLeakBoost):
2198         (WebKit::systemDirectoryPath):
2199         (WebKit::ProcessLauncher::launchProcess):
2200         * UIProcess/Network/NetworkProcessProxy.cpp:
2201         (WebKit::NetworkProcessProxy::didFinishLaunching):
2202         * UIProcess/PageClient.h:
2203         * UIProcess/ProcessAssertion.cpp:
2204         * UIProcess/ProcessAssertion.h:
2205         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2206         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2207         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2208         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2209         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation const):
2210         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
2211         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2212         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2213         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2214         (WebKit::RemoteLayerTreeHost::clearLayers):
2215         (WebKit::RemoteLayerTreeHost::detachRootLayer):
2216         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2217         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2218         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2219         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2220         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
2221         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
2222         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2223         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2224         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2225         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2226         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2227         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2228         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2229         * UIProcess/WKImagePreviewViewController.h:
2230         * UIProcess/WKImagePreviewViewController.mm:
2231         * UIProcess/WKInspectorHighlightView.h:
2232         * UIProcess/WKInspectorHighlightView.mm:
2233         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2234         (WebKit::LocalAuthenticatorInternal::buildAuthData):
2235         (WebKit::LocalAuthenticator::makeCredential):
2236         (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
2237         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
2238         (WebKit::LocalAuthenticator::getAssertion):
2239         (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
2240         * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
2241         (WebKit::LocalConnection::getUserConsent const):
2242         (WebKit::LocalConnection::getAttestation const):
2243         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
2244         (WebKit::LocalService::isAvailable):
2245         * UIProcess/WebFullScreenManagerProxy.cpp:
2246         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
2247         * UIProcess/WebGeolocationManagerProxy.cpp:
2248         * UIProcess/WebGeolocationManagerProxy.h:
2249         * UIProcess/WebInspectorProxy.cpp:
2250         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2251         * UIProcess/WebOpenPanelResultListenerProxy.h:
2252         * UIProcess/WebPageProxy.cpp:
2253         (WebKit::m_resetRecentCrashCountTimer):
2254         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2255         (WebKit::WebPageProxy::initializeWebPage):
2256         (WebKit::WebPageProxy::close):
2257         (WebKit::WebPageProxy::viewDidLeaveWindow):
2258         (WebKit::WebPageProxy::updateThrottleState):
2259         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
2260         (WebKit::WebPageProxy::didCommitLoadForFrame):
2261         (WebKit::WebPageProxy::exitFullscreenImmediately):
2262         (WebKit::WebPageProxy::runJavaScriptAlert):
2263         (WebKit::WebPageProxy::runJavaScriptConfirm):
2264         (WebKit::WebPageProxy::runJavaScriptPrompt):
2265         (WebKit::WebPageProxy::pageDidScroll):
2266         (WebKit::WebPageProxy::processDidTerminate):
2267         (WebKit::WebPageProxy::resetState):
2268         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2269         (WebKit::WebPageProxy::creationParameters):
2270         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2271         (WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
2272         (WebKit::WebPageProxy::requestControlledElementID const):
2273         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
2274         * UIProcess/WebPageProxy.h:
2275         * UIProcess/WebPageProxy.messages.in:
2276         * UIProcess/WebPasteboardProxy.h:
2277         * UIProcess/WebPasteboardProxy.messages.in:
2278         * UIProcess/WebProcessPool.cpp:
2279         (WebKit::WebProcessPool::ensureNetworkProcess):
2280         (WebKit::WebProcessPool::initializeNewWebProcess):
2281         (WebKit::WebProcessPool::updateProcessAssertions):
2282         (WebKit::WebProcessPool::reinstateNetworkProcessAssertionState):
2283         * UIProcess/WebProcessPool.h:
2284         * UIProcess/WebProcessProxy.cpp:
2285         (WebKit::isMainThreadOrCheckDisabled):
2286         (WebKit::WebProcessProxy::didFinishLaunching):
2287         (WebKit::WebProcessProxy::didSetAssertionState):
2288         * UIProcess/WebProcessProxy.h:
2289         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2290         (WebKit::LocalStorageDatabaseTracker::databasePath const):
2291         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
2292         * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
2293         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2294         * UIProcess/_WKWebViewPrintFormatter.mm:
2295         * UIProcess/_WKWebViewPrintFormatterInternal.h:
2296         * UIProcess/ios/DragDropInteractionState.h:
2297         * UIProcess/ios/DragDropInteractionState.mm:
2298         * UIProcess/ios/InputViewUpdateDeferrer.h:
2299         * UIProcess/ios/InputViewUpdateDeferrer.mm:
2300         * UIProcess/ios/LayerRepresentation.mm:
2301         * UIProcess/ios/PageClientImplIOS.h:
2302         * UIProcess/ios/PageClientImplIOS.mm:
2303         * UIProcess/ios/ProcessAssertionIOS.mm:
2304         * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm:
2305         * UIProcess/ios/SmartMagnificationController.h:
2306         * UIProcess/ios/SmartMagnificationController.messages.in:
2307         * UIProcess/ios/SmartMagnificationController.mm:
2308         * UIProcess/ios/TextCheckerIOS.mm:
2309         * UIProcess/ios/ViewGestureControllerIOS.mm:
2310         * UIProcess/ios/WKActionSheet.h:
2311         * UIProcess/ios/WKActionSheet.mm:
2312         * UIProcess/ios/WKActionSheetAssistant.h:
2313         * UIProcess/ios/WKActionSheetAssistant.mm:
2314         * UIProcess/ios/WKApplicationStateTrackingView.h:
2315         * UIProcess/ios/WKApplicationStateTrackingView.mm:
2316         * UIProcess/ios/WKContentView.mm:
2317         * UIProcess/ios/WKContentViewInteraction.h:
2318         * UIProcess/ios/WKContentViewInteraction.mm:
2319         * UIProcess/ios/WKGeolocationProviderIOS.h:
2320         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2321         * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
2322         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h:
2323         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm:
2324         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
2325         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
2326         * UIProcess/ios/WKPDFPageNumberIndicator.h:
2327         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
2328         * UIProcess/ios/WKPasswordView.h:
2329         * UIProcess/ios/WKPasswordView.mm:
2330         * UIProcess/ios/WKScrollView.h:
2331         * UIProcess/ios/WKScrollView.mm:
2332         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h:
2333         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m:
2334         * UIProcess/ios/WKWebEvent.h:
2335         * UIProcess/ios/WKWebEvent.mm:
2336         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
2337         * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
2338         * UIProcess/ios/WebPageProxyIOS.mm:
2339         * UIProcess/ios/WebProcessProxyIOS.mm:
2340         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2341         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2342         * UIProcess/ios/forms/WKFileUploadPanel.h:
2343         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2344         * UIProcess/ios/forms/WKFormColorControl.h:
2345         * UIProcess/ios/forms/WKFormColorControl.mm:
2346         * UIProcess/ios/forms/WKFormColorPicker.h:
2347         * UIProcess/ios/forms/WKFormColorPicker.mm:
2348         * UIProcess/ios/forms/WKFormInputControl.h:
2349         * UIProcess/ios/forms/WKFormInputControl.mm:
2350         * UIProcess/ios/forms/WKFormPopover.h:
2351         * UIProcess/ios/forms/WKFormPopover.mm:
2352         * UIProcess/ios/forms/WKFormSelectControl.h:
2353         * UIProcess/ios/forms/WKFormSelectControl.mm:
2354         * UIProcess/ios/forms/WKFormSelectPicker.h:
2355         * UIProcess/ios/forms/WKFormSelectPicker.mm:
2356         * UIProcess/ios/forms/WKFormSelectPopover.h:
2357         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2358         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
2359         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h:
2360         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
2361         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2362         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h:
2363         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2364         * UIProcess/ios/fullscreen/WKFullscreenStackView.h:
2365         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
2366         * UIProcess/mac/LegacySessionStateCoding.cpp:
2367         (WebKit::encodeFrameStateNode):
2368         (WebKit::decodeBackForwardTreeNode):
2369         * UIProcess/mac/PageClientImplMac.h:
2370         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2371         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2372         * UIProcess/mac/ViewSnapshotStore.mm:
2373         * UIProcess/mac/WKFullScreenWindowController.mm:
2374         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
2375         (WebContentServiceInitializer):
2376         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2377         (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
2378         (WebKit::WebFullScreenManager::willEnterFullScreen):
2379         (WebKit::WebFullScreenManager::didEnterFullScreen):
2380         (WebKit::WebFullScreenManager::willExitFullScreen):
2381         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2382         * WebProcess/Geolocation/WebGeolocationManager.h:
2383         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
2384         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2385         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2386         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
2387         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
2388         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2389         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
2390         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2391         (WebKit::toFrameState):
2392         (WebKit::applyFrameState):
2393         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
2394         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2395         (WebKit::WebChromeClient::windowRect):
2396         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
2397         * WebProcess/WebCoreSupport/WebChromeClient.h:
2398         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2399         * WebProcess/WebCoreSupport/WebEditorClient.h:
2400         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2401         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
2402         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
2403         (WebKit::WebFrameLoaderClient::restoreViewState):
2404         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2405         (WebKit::WebFrameLoaderClient::objectContentType):
2406         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2407         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2408         (WebKit::WebInspectorClient::highlight):
2409         (WebKit::WebInspectorClient::hideHighlight):
2410         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2411         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2412         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2413         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2414         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
2415         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
2416         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2417         * WebProcess/WebPage/DrawingArea.cpp:
2418         (WebKit::DrawingArea::create):
2419         * WebProcess/WebPage/DrawingArea.h:
2420         * WebProcess/WebPage/FindController.cpp:
2421         (WebKit::FindController::findString):
2422         * WebProcess/WebPage/FindController.h:
2423         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
2424         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
2425         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2426         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2427         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2428         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
2429         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2430         (WebKit::ViewGestureGeometryCollector::dispatchDidCollectGeometryForSmartMagnificationGesture):
2431         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
2432         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
2433         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
2434         * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
2435         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
2436         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.h:
2437         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
2438         * WebProcess/WebPage/WebFrame.h:
2439         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
2440         * WebProcess/WebPage/WebOpenPanelResultListener.h:
2441         * WebProcess/WebPage/WebPage.cpp:
2442         (WebKit::m_cpuLimit):
2443         (WebKit::WebPage::~WebPage):
2444         (WebKit::WebPage::scalePage):
2445         (WebKit::WebPage::setUseFixedLayout):
2446         (WebKit::WebPage::disabledAdaptationsDidChange):
2447         (WebKit::WebPage::viewportPropertiesDidChange):
2448         (WebKit::WebPage::pageDidScroll):
2449         (WebKit::WebPage::mouseEvent):
2450         (WebKit::WebPage::updatePreferences):
2451         (WebKit::WebPage::willCommitLayerTree):
2452         (WebKit::WebPage::didFlushLayerTreeAtTime):
2453         (WebKit::WebPage::mainFrameDidLayout):
2454         (WebKit::WebPage::resetAssistedNodeForFrame):
2455         (WebKit::WebPage::elementDidFocus):
2456         (WebKit::WebPage::elementDidBlur):
2457         (WebKit::WebPage::willReplaceMultipartContent):
2458         (WebKit::WebPage::didReplaceMultipartContent):
2459         (WebKit::WebPage::didCommitLoad):
2460         * WebProcess/WebPage/WebPage.h:
2461         * WebProcess/WebPage/WebPage.messages.in:
2462         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2463         * WebProcess/WebPage/ios/WebPageIOS.mm:
2464         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2465         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2466         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
2467         * WebProcess/WebPage/mac/WebPageMac.mm:
2468         * WebProcess/WebProcess.cpp:
2469         (WebKit::WebProcess::WebProcess):
2470         (WebKit::WebProcess::initializeConnection):
2471         (WebKit::WebProcess::initializeWebProcess):
2472         (WebKit::WebProcess::actualPrepareToSuspend):
2473         (WebKit::WebProcess::cancelPrepareToSuspend):
2474         (WebKit::WebProcess::processDidResume):
2475         * WebProcess/WebProcess.h:
2476         * WebProcess/cocoa/PlaybackSessionManager.h:
2477         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
2478         * WebProcess/cocoa/PlaybackSessionManager.mm:
2479         * WebProcess/cocoa/VideoFullscreenManager.h:
2480         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
2481         * WebProcess/cocoa/VideoFullscreenManager.mm:
2482         (WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
2483         (WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const):
2484         (WebKit::VideoFullscreenManager::didSetupFullscreen):
2485         (WebKit::VideoFullscreenManager::didExitFullscreen):
2486         * WebProcess/cocoa/WebProcessCocoa.mm:
2487         (WebKit::WebProcess::platformInitializeWebProcess):
2488         (WebKit::WebProcess::initializeProcessName):
2489         (WebKit::registerWithAccessibility):
2490         (WebKit::WebProcess::sourceApplicationAuditData const):
2491         (WebKit::WebProcess::initializeSandbox):
2492         * WebProcess/mac/SecItemShimLibrary.mm:
2493         * config.h:
2494
2495 2018-10-18  Alex Christensen  <achristensen@webkit.org>
2496
2497         Clean up FrameLoader two-state enums
2498         https://bugs.webkit.org/show_bug.cgi?id=190731
2499
2500         Reviewed by Chris Dumez.
2501
2502         * NetworkProcess/NetworkProcess.h:
2503         * NetworkProcess/NetworkProcess.messages.in:
2504         * Shared/WebCoreArgumentCoders.h:
2505         * UIProcess/WebPageProxy.cpp:
2506         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2507         * UIProcess/WebPageProxy.h:
2508         * UIProcess/WebPageProxy.messages.in:
2509         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2510         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
2511         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2512
2513 2018-10-18  Youenn Fablet  <youenn@apple.com>
2514
2515         Handle MDNS resolution of candidates through libwebrtc directly
2516         https://bugs.webkit.org/show_bug.cgi?id=190681
2517
2518         Reviewed by Eric Carlson.
2519
2520         Add support for AsyncResolver to resolve MDNS.
2521         This basically reuse the code path used to resolve STUN server addresses.
2522         Removed MDNS specific resolution.
2523         Use existing CFHost resolution mechanism to do the actual resolution.
2524
2525         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
2526         (WebKit::NetworkMDNSRegister::registerMDNSName):
2527         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in:
2528         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2529         (WebKit::LibWebRTCProvider::createPeerConnection):
2530         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
2531         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
2532         * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
2533         * WebProcess/Network/webrtc/WebMDNSRegister.h:
2534         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in:
2535
2536 2018-10-18  Chris Dumez  <cdumez@apple.com>
2537
2538         [PSON] Cap number of SuspendedPageProxy objects and allow a WebPageProxy to have more than one
2539         https://bugs.webkit.org/show_bug.cgi?id=190688
2540         <rdar://problem/45354095>
2541
2542         Reviewed by Antti Koivisto.
2543
2544         Cap number of SuspendedPageProxy objects to 3 to avoid accumulating too many "suspended" processes.
2545
2546         Also allow a WebPageProxy to have more than one SuspendedPageProxy so that PageCache now works for
2547         more than 1 history navigation (up to 3 with the suspended page limit in this patch).
2548
2549         The following cleanup / refactoring was made to support this:
2550         - The SuspendedPageProxy objects are now owned by the WebProcessPool instead of the WebPageProxy.
2551           The WebProcessPool is in charge of limiting the number of SuspendedPageProxy objects by dropping
2552           the oldest one whenever a WebPageProxy tries to add a new one and we've already reached the limit.
2553         - WebProcessProxy no longer needs to know anything about suspended pages, which simplifies the
2554           code quite a bit. Instead, the SuspendedPageProxy objects now register themselves as
2555           IPC::MessageReceivers with their WebProcessProxy. The SuspendedPageProxy also take care of
2556           calling maybeShutdown() on their WebProcessProxy when they get destroyed.
2557
2558         * UIProcess/SuspendedPageProxy.cpp:
2559         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2560         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):
2561         (WebKit::SuspendedPageProxy::unsuspend):
2562         (WebKit::SuspendedPageProxy::didFinishLoad):
2563         (WebKit::SuspendedPageProxy::didReceiveSyncMessage):
2564         * UIProcess/SuspendedPageProxy.h:
2565         * UIProcess/WebPageProxy.cpp:
2566         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2567         (WebKit::WebPageProxy::swapToWebProcess):
2568         (WebKit::WebPageProxy::close):
2569         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2570         (WebKit::WebPageProxy::didCompletePageTransition):
2571         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2572         * UIProcess/WebPageProxy.h:
2573         * UIProcess/WebProcessPool.cpp:
2574         (WebKit::WebProcessPool::disconnectProcess):
2575         (WebKit::WebProcessPool::processForNavigationInternal):
2576         (WebKit::WebProcessPool::addSuspendedPageProxy):
2577         (WebKit::WebProcessPool::removeAllSuspendedPageProxiesForPage):
2578         (WebKit::WebProcessPool::takeSuspendedPageProxy):
2579         (WebKit::WebProcessPool::hasSuspendedPageProxyFor):
2580         * UIProcess/WebProcessPool.h:
2581         * UIProcess/WebProcessProxy.cpp:
2582         (WebKit::WebProcessProxy::didReceiveMessage):
2583         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2584         (WebKit::WebProcessProxy::canTerminateChildProcess):
2585         (WebKit::WebProcessProxy::requestTermination):
2586         * UIProcess/WebProcessProxy.h:
2587
2588 2018-10-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2589
2590         Enable the datalist element by default on iOS and macOS
2591         https://bugs.webkit.org/show_bug.cgi?id=190594
2592         <rdar://problem/45281159>
2593
2594         Reviewed by Ryosuke Niwa and Tim Horton.
2595
2596         * Configurations/FeatureDefines.xcconfig:
2597         * Platform/spi/ios/UIKitSPI.h:
2598
2599         Add SPI to UITextSuggestion.
2600
2601         * Shared/WebPreferences.yaml:
2602         * Shared/WebPreferencesDefaultValues.h:
2603         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
2604         (-[WKDataListSuggestionCell setText:]):
2605         (-[WKDataListSuggestionTable initWithElementRect:]):
2606
2607         Fix the 32-bit macOS build with ENABLE(DATALIST_ELEMENT).
2608
2609 2018-10-17  Andy Estes  <aestes@apple.com>
2610
2611         [Apple Pay] Increment the API version to 5
2612         https://bugs.webkit.org/show_bug.cgi?id=190686
2613         <rdar://problem/45348523>
2614
2615         Reviewed by Simon Fraser.
2616
2617         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2618         (WebKit::WebPaymentCoordinator::supportsVersion):
2619
2620 2018-10-17  Alex Christensen  <achristensen@webkit.org>
2621
2622         BackForwardClient needs to be able to support UIProcess-only back/forward lists
2623         https://bugs.webkit.org/show_bug.cgi?id=190675
2624
2625         Reviewed by Chris Dumez.
2626
2627         * UIProcess/WebBackForwardList.cpp:
2628         (WebKit::WebBackForwardList::itemAtIndex const):
2629         (WebKit::WebBackForwardList::backListCount const):
2630         (WebKit::WebBackForwardList::forwardListCount const):
2631         * UIProcess/WebBackForwardList.h:
2632         * UIProcess/WebPageProxy.cpp:
2633         (WebKit::WebPageProxy::backForwardBackListCount):
2634         (WebKit::WebPageProxy::backForwardForwardListCount):
2635         * UIProcess/WebPageProxy.h:
2636         * UIProcess/WebPageProxy.messages.in:
2637         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2638         (WebKit::WebBackForwardListProxy::itemAtIndex):
2639         (WebKit::WebBackForwardListProxy::backListCount const):
2640         (WebKit::WebBackForwardListProxy::forwardListCount const):
2641         * WebProcess/WebPage/WebBackForwardListProxy.h:
2642         * WebProcess/WebPage/WebPage.cpp:
2643         (WebKit::WebPage::dumpHistoryForTesting):
2644
2645 2018-10-17  Ali Juma  <ajuma@chromium.org>
2646
2647         Flaky IntersectionObserver web platform tests involving style updates
2648         https://bugs.webkit.org/show_bug.cgi?id=189091
2649
2650         Reviewed by Simon Fraser.
2651
2652         Add a WebPage::willDisplayPage bottleneck that gets called when flushing layers
2653         or, in the non-composited case, when rendering the page into a bitmap.
2654
2655         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2656         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
2657         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2658         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
2659         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2660         (WebKit::DrawingAreaImpl::display):
2661         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2662         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2663         * WebProcess/WebPage/WebPage.cpp:
2664         (WebKit::WebPage::willDisplayPage):
2665         * WebProcess/WebPage/WebPage.h:
2666         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2667         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2668
2669 2018-10-16  Patrick Griffis  <pgriffis@igalia.com>
2670
2671         [GTK][WPE] Fix xdg-desktop-portal permissions from a sandbox
2672         https://bugs.webkit.org/show_bug.cgi?id=190619
2673
2674         Reviewed by Michael Catanzaro.
2675
2676         We have to generate a /.flatpak-info file for xdg-desktop-portal
2677         to properly treat us as a sandboxed application.
2678
2679         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2680         (WebKit::createSealedMemFdWithData):
2681         (WebKit::argsToFd):
2682         (WebKit::XDGDBusProxyLauncher::setPermissions):
2683         (WebKit::createFlatpakInfo):
2684         (WebKit::bubblewrapSpawn):
2685
2686 2018-10-16  Sihui Liu  <sihui_liu@apple.com>
2687
2688         Add a switch for Web SQL
2689         https://bugs.webkit.org/show_bug.cgi?id=190271
2690
2691         Reviewed by Ryosuke Niwa.
2692
2693         * Shared/WebPreferences.yaml:
2694         * UIProcess/API/C/WKPreferences.cpp:
2695         (WKPreferencesSetWebSQLDisabled):
2696         (WKPreferencesGetWebSQLDisabled):
2697         * UIProcess/API/C/WKPreferencesRef.h:
2698
2699 2018-10-16  Alex Christensen  <achristensen@webkit.org>
2700
2701         Remove InjectedBundleBackForwardList
2702         https://bugs.webkit.org/show_bug.cgi?id=190640
2703
2704         Reviewed by Chris Dumez.
2705
2706         These objects are only used in testing now, so I made a replacement to be used for testing,
2707         WKBundlePageDumpHistoryForTesting and WKBundleClearHistoryForTesting.
2708         The existence of these objects is problematic with process swapping and the true back/forward list being in the UIProcess.
2709
2710         * Sources.txt:
2711         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
2712         (WKBundleBackForwardListGetTypeID):
2713         (WKBundleBackForwardListCopyItemAtIndex):
2714         (WKBundleBackForwardListGetBackListCount):
2715         (WKBundleBackForwardListGetForwardListCount):
2716         (WKBundleBackForwardListClear):
2717         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h:
2718         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
2719         (WKBundleBackForwardListItemGetTypeID):
2720         (WKBundleBackForwardListItemIsSame):
2721         (WKBundleBackForwardListItemCopyURL):
2722         (WKBundleBackForwardListItemCopyTarget):
2723         (WKBundleBackForwardListItemIsTargetItem):
2724         (WKBundleBackForwardListItemCopyChildren):
2725         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
2726         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2727         (WKBundlePageDumpHistoryForTesting):
2728         (WKBundleClearHistoryForTesting):
2729         (WKBundlePageGetBackForwardList):
2730         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2731         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp: Removed.
2732         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h: Removed.
2733         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp: Removed.
2734         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h: Removed.
2735         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2736         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2737         * WebProcess/WebPage/WebPage.cpp:
2738         (WebKit::WebPage::~WebPage):
2739         (WebKit::dumpHistoryItem):
2740         (WebKit::WebPage::dumpHistoryForTesting):
2741         (WebKit::WebPage::clearHistory):
2742         (WebKit::WebPage::didReceiveSyncMessage):
2743         (WebKit::WebPage::backForwardList): Deleted.
2744         * WebProcess/WebPage/WebPage.h:
2745
2746 2018-10-16  Timothy Hatcher  <timothy@apple.com>
2747
2748         Add <meta name="supported-color-schemes"> to control what color schemes the page supports
2749         https://bugs.webkit.org/show_bug.cgi?id=190526
2750         rdar://problem/45230140
2751
2752         Reviewed by Dean Jackson.
2753
2754         * UIProcess/mac/WKPrintingView.mm:
2755         (-[WKPrintingView drawRect:]): Update use of LocalDefaultSystemAppearance.
2756         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2757         (WebKit::InjectedBundleRangeHandle::renderedImage): Ditto.
2758         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2759         (WebKit::PDFPlugin::paintControlForLayerInContext): Ditto.
2760         * WebProcess/WebPage/WebPage.cpp:
2761         (WebKit::WebPage::drawRect): Ditto.
2762
2763 2018-10-16  Justin Michaud  <justin_michaud@apple.com>
2764
2765         Implement feature flag and bindings for CSS Painting API
2766         https://bugs.webkit.org/show_bug.cgi?id=190237
2767
2768         Reviewed by Ryosuke Niwa.
2769
2770         * Configurations/FeatureDefines.xcconfig:
2771         * Shared/WebPreferences.yaml:
2772         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2773         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2774
2775 2018-10-16  Philippe Normand  <pnormand@igalia.com>
2776
2777         [GLib] Build error with RemoteInspector disabled
2778         https://bugs.webkit.org/show_bug.cgi?id=190623
2779
2780         Reviewed by Michael Catanzaro.
2781
2782         Compilation guards added to ensure the build still works when the
2783         Remote WebInspector has been disabled.
2784
2785         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2786         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
2787         * UIProcess/RemoteWebInspectorProxy.cpp:
2788
2789 2018-10-16  Patrick Griffis  <pgriffis@igalia.com>
2790
2791         [GTK][WPE] Fix sandbox on distros with suid bubblewrap
2792         https://bugs.webkit.org/show_bug.cgi?id=190616
2793
2794         Reviewed by Michael Catanzaro.
2795
2796         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2797         (WebKit::bubblewrapSpawn):
2798
2799 2018-10-16  Alex Christensen  <achristensen@webkit.org>
2800
2801         Replace HistoryItem* with HistoryItem& where possible
2802         https://bugs.webkit.org/show_bug.cgi?id=190617
2803
2804         Reviewed by Chris Dumez.
2805
2806         * WebProcess/WebCoreSupport/SessionStateConversion.h:
2807         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2808         (WebKit::WK2NotifyHistoryItemChanged):
2809         (WebKit::WebBackForwardListProxy::goToItem):
2810         * WebProcess/WebPage/WebBackForwardListProxy.h:
2811
2812 2018-10-16  Philippe Normand  <pnormand@igalia.com>
2813
2814         Unreviewed, another GTK build fix after r237146
2815
2816         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
2817         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
2818
2819 2018-10-15  Justin Fan  <justin_fan@apple.com>
2820
2821         Add WebGPU 2018 feature flag and experimental feature flag
2822         https://bugs.webkit.org/show_bug.cgi?id=190509
2823
2824         Reviewed by Dean Jackson.
2825
2826         Re-add ENABLE_WEBGPU, an experimental feature flag, and a RuntimeEnabledFeature
2827         for the 2018 WebGPU prototype.
2828
2829         * Configurations/FeatureDefines.xcconfig:
2830         * Shared/WebPreferences.yaml:
2831         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2832         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2833
2834 2018-10-15  Alex Christensen  <achristensen@webkit.org>
2835
2836         Fix API tests after r237146
2837
2838         * Shared/WebPageGroupData.cpp:
2839         (WebKit::WebPageGroupData::decode):
2840         I accidentally changed the decoder.
2841
2842 2018-10-15  Sihui Liu  <sihui_liu@apple.com>
2843
2844         HSTS cache entries cannot be removed by origin
2845         https://bugs.webkit.org/show_bug.cgi?id=190455
2846         <rdar://problem/45181322>
2847
2848         Reviewed by Chris Dumez.
2849
2850         The SPI _CFNetworkResetHSTS does not recognize url without protocol, so we need to add protocol manually.
2851
2852         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2853         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
2854
2855 2018-10-15  Alex Christensen  <achristensen@webkit.org>
2856
2857         Fix GTK build, even though bots are not working right now.
2858
2859         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2860         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2861
2862 2018-10-15  Alex Christensen  <achristensen@webkit.org>
2863
2864         Fix WinCairo build after r237146
2865
2866         * UIProcess/win/WebInspectorProxyWin.cpp:
2867         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2868
2869 2018-10-15  Chris Dumez  <cdumez@apple.com>
2870
2871         REGRESSION (r236512): [ Mac WK2 ] Layout Test editing/undo/undo-smart-delete-word.html is flaky
2872         https://bugs.webkit.org/show_bug.cgi?id=190375
2873         <rdar://problem/45177807>
2874
2875         Reviewed by Ryosuke Niwa.
2876
2877         The test is doing the following:
2878         > document.execCommand("Delete"); document.execCommand("Undo");
2879
2880         Both operation are synchronous and rely on synchronous IPC from the WebProcess to the UIProcess.
2881         However, for the undo operation to succeed, the first command need to have been registered with
2882         with the UIProcess via the WebPageProxy::RegisterEditCommandForUndo IPC to the UIProcess, which
2883         is asynchronous.
2884
2885         After r236512, the UIProcess no longer processes incoming sync / async IPC in order and thus,
2886         it is possible for the WebPageProxy::ExecuteUndoRedo synchronous IPC to get processed by the
2887         UIProcess *before* the WebPageProxy::RegisterEditCommandForUndo asynchronous IPC for the
2888         previous "Delete" command. As a result, canUndo would return false and we would fail to undo.
2889
2890         To address the issue, use SendOption::DispatchMessageEvenWhenWaitingForSyncReply flag when sending
2891         the WebPageProxy::RegisterEditCommandForUndo IPC, so that it gets processed in order with regards
2892         to surrounding synchronous IPC.
2893
2894         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2895         (WebKit::WebEditorClient::registerUndoStep):
2896
2897 2018-10-15  Alex Christensen  <achristensen@webkit.org>
2898
2899         Modernize BackForwardClient.h
2900         https://bugs.webkit.org/show_bug.cgi?id=190610
2901
2902         Reviewed by Chris Dumez.
2903
2904         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
2905         (WebKit::InjectedBundleBackForwardList::clear):
2906         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2907         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2908         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2909         (WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
2910         (WebKit::WebBackForwardListProxy::backListCount const):
2911         (WebKit::WebBackForwardListProxy::forwardListCount const):
2912         (WebKit::WebBackForwardListProxy::backListCount): Deleted.
2913         (WebKit::WebBackForwardListProxy::forwardListCount): Deleted.
2914         * WebProcess/WebPage/WebBackForwardListProxy.h:
2915         (WebKit::WebBackForwardListProxy::create):
2916         * WebProcess/WebPage/WebPage.cpp:
2917         (WebKit::m_cpuLimit):
2918         (WebKit::WebPage::restoreSessionInternal):
2919
2920 2018-10-15  Timothy Hatcher  <timothy@apple.com>
2921
2922         Add support for prefers-color-scheme media query
2923         https://bugs.webkit.org/show_bug.cgi?id=190499
2924         rdar://problem/45212025
2925
2926         Reviewed by Dean Jackson.
2927
2928         * Configurations/FeatureDefines.xcconfig: Added ENABLE_DARK_MODE_CSS.
2929         * Shared/WebPreferences.yaml: Added DarkModeCSSEnabled as experimental.
2930
2931 2018-10-15  Patrick Griffis  <pgriffis@igalia.com>
2932
2933         Remove StorageProcess leftover
2934         https://bugs.webkit.org/show_bug.cgi?id=190591
2935
2936         Reviewed by Michael Catanzaro.
2937
2938         The process was deleted.
2939
2940         * Shared/ChildProcess.h:
2941         * Shared/mac/ChildProcessMac.mm:
2942         (WebKit::processStorageClass):
2943         (WebKit::sandboxDirectory):
2944         * UIProcess/ChildProcessProxy.cpp:
2945         (WebKit::ChildProcessProxy::getLaunchOptions):
2946         * UIProcess/Launcher/ProcessLauncher.h:
2947         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2948         (WebKit::serviceName):
2949
2950 2018-10-15  Alex Christensen  <achristensen@webkit.org>
2951
2952         Remove unused parameters of WebPageGroupData
2953         https://bugs.webkit.org/show_bug.cgi?id=190600
2954
2955         Reviewed by Chris Dumez.
2956
2957         visibleToInjectedBundle and visibleToHistoryClient are both always true.
2958         This removes a mysterious check in the history code.
2959
2960         * Shared/WebPageGroupData.cpp:
2961         (WebKit::WebPageGroupData::encode const):
2962         (WebKit::WebPageGroupData::decode):
2963         * Shared/WebPageGroupData.h:
2964         * UIProcess/WebPageGroup.cpp:
2965         (WebKit::WebPageGroup::create):
2966         (WebKit::pageGroupData):
2967         (WebKit::WebPageGroup::WebPageGroup):
2968         * UIProcess/WebPageGroup.h:
2969         (WebKit::WebPageGroup::WebPageGroup):
2970         (WebKit::WebPageGroup::create):
2971         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2972         (WebKit::WebFrameLoaderClient::updateGlobalHistory):
2973         (WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
2974         (WebKit::WebFrameLoaderClient::setTitle):
2975         * WebProcess/WebPage/WebPage.cpp:
2976         (WebKit::WebPage::create):
2977         (WebKit::WebPage::close):
2978         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2979         (WebKit::WebPageGroupProxy::create):
2980         * WebProcess/WebPage/WebPageGroupProxy.h:
2981         (WebKit::WebPageGroupProxy::pageGroupID const):
2982         (WebKit::WebPageGroupProxy::isVisibleToInjectedBundle const): Deleted.
2983         (WebKit::WebPageGroupProxy::isVisibleToHistoryClient const): Deleted.
2984
2985 2018-10-15  Chris Dumez  <cdumez@apple.com>
2986
2987         Experiment: target=_blank on anchors should imply rel=noopener
2988         https://bugs.webkit.org/show_bug.cgi?id=190481
2989
2990         Reviewed by Alex Christensen.
2991
2992         * Shared/WebPreferences.yaml:
2993
2994 2018-10-15  Alex Christensen  <achristensen@webkit.org>
2995
2996         Remove unused parameters from FrameLoaderClient::createFrame
2997         https://bugs.webkit.org/show_bug.cgi?id=190587
2998
2999         Reviewed by Chris Dumez.
3000
3001         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3002         (WebKit::WebFrameLoaderClient::createFrame):
3003         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3004
3005 2018-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3006
3007         [iOS] Can't select text after dismissing the keyboard when changing focus
3008         https://bugs.webkit.org/show_bug.cgi?id=190563
3009         <rdar://problem/44613559>
3010
3011         Reviewed by Tim Horton.
3012
3013         In r230686, we switched from using UIWKSelectionAssistant to UIWKTextInteractionAssistant for handling selection
3014         in non-editable content on iOS; as such, when an editable element loses focus, instead of switching from the
3015         text interaction assistant to the web selection assistant as we've previously done, we now reset our text
3016         interaction assistant by calling `-[UIWKTextInteractionAssistant setGestureRecognizers]`, which removes all of
3017         the current text selection gesture recognizers from WKContentView and regenerates them by building up a tree of
3018         `UITextInteraction`s and adding them to the assistant (see `-[UITextInteractionAssistant
3019         addGestureRecognizersToView:]`). In particular, `_UITextSelectionForceGesture` is the gesture recognizer used to
3020         trigger text selection when long pressing.
3021
3022         After dismissing the keyboard by tapping the "Done" button, the UITextInteractions and gesture recognizers on
3023         the interaction assistant include:
3024
3025             <UITextInteraction>
3026                 …
3027                 <UITextIndirectNonEditableInteraction>
3028                     <_UIKeyboardBasedNonEditableTextSelectionInteraction>
3029                       ↳ "_UIKeyboardTextSelectionGestureForcePress" → <_UITextSelectionForceGesture>
3030
3031         However, after the keyboard dismisses due to an editable element losing focus, the UITextInteractions on the
3032         interaction assistant look like this:
3033
3034             <UITextInteraction>
3035                 …
3036                 <UITextIndirectNonEditableInteraction>
3037
3038         Subsequently, the lack of a `_UIKeyboardBasedNonEditableTextSelectionInteraction` makes text selection by long
3039         pressing impossible, since the `_UITextSelectionForceGesture` is never introduced to `WKContentView`. In UIKit,
3040         `UITextIndirectNonEditableInteraction` only adds `_UIKeyboardBasedNonEditableTextSelectionInteraction` as a
3041         child if the text input view — in our case, WKContentView — is missing an input delegate (see `-initWithView:`).
3042         In the case where the Done button is used to dismiss the keyboard, WKContentView loses first responder, and the
3043         input delegate of WKContentView is cleared out early on, before we call `-stopAssistingKeyboard`:
3044
3045             -[WKContentView(WKInteraction) setInputDelegate:]
3046             -[UIKeyboardImpl setDelegate:force:]
3047             -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:]
3048             -[UIResponder _finishResignFirstResponder]
3049             -[UIResponder resignFirstResponder]
3050             -[WKContentView(WKInteraction) resignFirstResponderForWebView]
3051             -[UIKeyboardImpl dismissKeyboard]
3052
3053         However, in the case where the focused element is blurred, we end up clearing out the delegate in
3054         `-_stopAssistingNode`, *after* we've already called `-setGestureRecognizers` on the interaction assistant. This
3055         means UIKit will skip adding `_UIKeyboardBasedNonEditableTextSelectionInteraction` to the text interaction
3056         assistant.
3057
3058             -[WKContentView(WKInteraction) setInputDelegate:]
3059             -[UIKeyboardImpl setDelegate:force:]
3060             -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:]
3061             -[UIResponder(UIResponderInputViewAdditions) reloadInputViews]
3062             -[WKContentView(WKInteraction) _stopAssistingNode]
3063
3064         To fix this, we simply reset our `inputDelegate` earlier in `_stopAssistingKeyboard` instead of waiting until
3065         we reload input views. This ensures that UIKit sets up the text interaction assistant's gestures when changing
3066         focus in the same way as we would when the keyboard is dismissed via `-resignFirstResponder` (e.g. when pressing
3067         the Done button).
3068
3069         Test: editing/selection/ios/select-text-after-changing-focus.html
3070
3071         * UIProcess/ios/WKContentViewInteraction.mm:
3072         (-[WKContentView setupInteraction]):
3073         (-[WKContentView setUpTextSelectionAssistant]):
3074         (-[WKContentView _startAssistingKeyboard]):
3075         (-[WKContentView _stopAssistingKeyboard]):
3076         (-[WKContentView useSelectionAssistantWithGranularity:]): Deleted.
3077
3078         Additionally rename this to -setUpTextSelectionAssistant and remove the selection granularity argument. This was
3079         previously used to switch between web and text interaction assistants.
3080
3081 2018-10-15  Remy Demarest  <rdemarest@apple.com>
3082
3083         Web Inspector: RDM: Toolbar hidden in when Inspector is docked to side.
3084         https://bugs.webkit.org/show_bug.cgi?id=190545
3085         rdar://problem/44674500
3086
3087         Reviewed by Brian Burg.
3088
3089         When the inspector is placed next to the web view it uses its _topContentInset and _totalHeightOfBanners
3090         to lay out the inspector so it does not underlap the window toolbar, but this technique does not work when
3091         in responsive design mode because of the different attachment view. This patch fixes the issue by using
3092         -[NSWindow contentLayoutRect] to figure out the height of the inspector instead of relying on the content
3093         insets of the web view. This requires observing -contentLayoutRect and ensure we only observe its changes
3094         when the view is actually on the screen.
3095
3096         * UIProcess/WebInspectorProxy.h:
3097         Declare helpers to add/remove observer on the attached inspector window.
3098
3099         * UIProcess/mac/WKInspectorViewController.h:
3100         * UIProcess/mac/WKInspectorViewController.mm:
3101         (-[WKInspectorViewController inspectorWKWebView:willMoveToWindow:]):
3102         (-[WKInspectorViewController inspectorWKWebViewDidMoveToWindow:]):
3103
3104         * UIProcess/mac/WKInspectorWKWebView.h:
3105         * UIProcess/mac/WKInspectorWKWebView.mm:
3106         (-[WKInspectorWKWebView viewWillMoveToWindow:]):
3107         (-[WKInspectorWKWebView viewDidMoveToWindow]):
3108
3109         * UIProcess/mac/WebInspectorProxyMac.mm:
3110         (-[WKWebInspectorProxyObjCAdapter observeValueForKeyPath:ofObject:change:context:]): Update inspector layout
3111         whenever the contentLayoutRect changes. Except when live resizing since the attachment view also sends
3112         notifications at the same time.
3113         (-[WKWebInspectorProxyObjCAdapter inspectorViewController:willMoveToWindow:]):
3114         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerDidMoveToWindow:]):
3115         (WebKit::WebInspectorProxy::attachmentWillMoveFromWindow): Remove the observer only if we set it up before.
3116         (WebKit::WebInspectorProxy::attachmentDidMoveToWindow): Set up the observer and immediately update the frame
3117         of the inspector since it just moved to its final destination.
3118         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Adjust the frame of the attached inspector based
3119         on the contentLayoutRect of the window rather than the topContentInset of the web view.
3120
3121 2018-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3122
3123         Changing view scale should zoom to initial scale if the page is already at initial scale
3124         https://bugs.webkit.org/show_bug.cgi?id=190570
3125         <rdar://problem/45261877>
3126
3127         Reviewed by Tim Horton.
3128
3129         r237087 added support for changing the view scale on iOS, by making it possible to let the minimum layout size
3130         be a factor of the view size; this allows internal clients to change page zoom levels on iOS. Currently,
3131         changing the page zoom level automatically zooms to the new initial scale only if the user has not manually
3132         scaled the page before, even if the page is already at initial scale (e.g. after the user double taps to zoom on
3133         a small element, and double taps again to zoom back out to initial scale).
3134
3135         This patch makes some minor adjustments to automatically zoom to the new initial scale after changing the view
3136         scale, as long as the page was at initial scale when changing zoom levels.
3137
3138         Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
3139
3140         * WebProcess/WebPage/WebPage.h:
3141         * WebProcess/WebPage/ios/WebPageIOS.mm:
3142         (WebKit::areEssentiallyEqualAsFloat):
3143
3144         Move this function further up in the file, so that we can use it in `setViewportConfigurationViewLayoutSize`.
3145
3146         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
3147
3148         If the page is near initial scale and the zoom level changes, zoom to the new initial scale.
3149
3150         (WebKit::WebPage::viewportConfigurationChanged):
3151
3152         Make this take a new enum argument that determines whether we want to zoom to initial scale as a result of the
3153         viewport configuration change (`No` by default).
3154
3155 2018-10-15  Chris Dumez  <cdumez@apple.com>
3156
3157         Restrict browsing context lookup by name to frames that are related to one another
3158         https://bugs.webkit.org/show_bug.cgi?id=190475
3159
3160         Reviewed by Alex Christensen.
3161
3162         * WebProcess/Plugins/PluginView.cpp:
3163         (WebKit::PluginView::performJavaScriptURLRequest):
3164
3165 2018-10-15  Alex Christensen  <achristensen@webkit.org>
3166
3167         Fix assertion after r237102
3168         https://bugs.webkit.org/show_bug.cgi?id=190459
3169
3170         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3171         (WebKit::InjectedBundlePageLoaderClient::InjectedBundlePageLoaderClient):
3172         Shipping Safari still uses shouldGoToBackForwardListItem, so only assert on
3173         newer platforms like we do in WKPageSetPageLoaderClient.
3174
3175 2018-10-15  Alex Christensen  <achristensen@webkit.org>
3176
3177         Shrink more enum classes
3178         https://bugs.webkit.org/show_bug.cgi?id=190540
3179
3180         Reviewed by Chris Dumez.
3181
3182         * NetworkProcess/NetworkConnectionToWebProcess.h:
3183         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3184         * NetworkProcess/NetworkDataTask.h:
3185         * NetworkProcess/NetworkProcess.h:
3186         * NetworkProcess/NetworkProcess.messages.in:
3187         * Shared/Authentication/AuthenticationChallengeDisposition.h:
3188         * Shared/Authentication/AuthenticationManager.h:
3189         * Shared/Authentication/AuthenticationManager.messages.in:
3190         * Shared/DragControllerAction.h:
3191         * Shared/LayerTreeContext.h:
3192         * Shared/UndoOrRedo.h:
3193         * UIProcess/Authentication/AuthenticationDecisionListener.h:
3194         * UIProcess/Cocoa/WebViewImpl.h:
3195         * UIProcess/Network/NetworkProcessProxy.h:
3196         * UIProcess/Network/NetworkProcessProxy.messages.in:
3197         * UIProcess/Notifications/WebNotification.h:
3198         * UIProcess/Notifications/WebNotificationManagerProxy.h:
3199         * UIProcess/PageClient.h:
3200         * UIProcess/UserContent/WebUserContentControllerProxy.h:
3201         * UIProcess/WebPageProxy.h:
3202         * UIProcess/WebPageProxy.messages.in:
3203         * UIProcess/ios/PageClientImplIOS.h:
3204         * UIProcess/ios/WKContentViewInteraction.h:
3205         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
3206         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
3207         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3208         * WebProcess/Storage/WebSWClientConnection.messages.in:
3209         * WebProcess/UserContent/InjectUserScriptImmediately.h:
3210         * WebProcess/UserContent/WebUserContentController.h:
3211         * WebProcess/UserContent/WebUserContentController.messages.in:
3212         * WebProcess/WebPage/WebPage.h:
3213         * WebProcess/WebPage/WebPage.messages.in:
3214
3215 2018-10-15  Michael Catanzaro  <mcatanzaro@igalia.com>
3216
3217         Add new files missing from previous commit.
3218
3219         * Source/cmake/FindLibseccomp.cmake: Added.
3220
3221 2018-10-15  Patrick Griffis  <pgriffis@igalia.com>
3222
3223         [GTK][WPE] Implement subprocess sandboxing
3224         https://bugs.webkit.org/show_bug.cgi?id=188568
3225
3226         Reviewed by Michael Catanzaro.
3227
3228         This implements sandboxing of WebKitWebProcesses.
3229
3230         The sandbox is opt-in at runtime as it is a behavior change.
3231         See webkit_web_context_set_sandbox_enabled() and the
3232         WEBKIT_FORCE_SANDBOX env var for developers.
3233
3234         This is Linux specific using Namespaces, Seccomp, and a DBus proxy service.
3235         This introduces three new dependencies:
3236
3237         - bwrap executable
3238         - libseccomp library
3239         - xdg-dbus-proxy executable
3240
3241         The use of xdg-dbus-proxy will ideally be replaced once upstream DBus
3242         gains the same filtering abilities which is a work in progress.
3243
3244         Currently the sandbox is not completed and there are a few large holes:
3245
3246         - Pulseaudio: The Pipewire project will solve this.
3247         - DRI device access: No immediate solutions planned.
3248         - Webcam device access: Pipewire will also solve this.
3249         - Webprocess network access: Will require GStreamer changes.
3250         - DConf access: Custom proxy planned.
3251         - X11 access: Wayland solves this.
3252
3253         That is not an exhaustive list but are the noteworthy ones. Filesystem access
3254         is still an evolving list as problems are found as is specific DBus name access.
3255
3256         * PlatformGTK.cmake:
3257         * PlatformWPE.cmake:
3258         * SourcesGTK.txt:
3259         * SourcesWPE.txt:
3260         * UIProcess/API/glib/WebKitWebContext.cpp:
3261         (webkit_web_context_set_sandbox_enabled):
3262         (webkit_web_context_get_sandbox_enabled):
3263         * UIProcess/API/gtk/WebKitWebContext.h:
3264         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3265         * UIProcess/API/wpe/WebKitWebContext.h:
3266         * UIProcess/ChildProcessProxy.cpp:
3267         (WebKit::ChildProcessProxy::getLaunchOptions):
3268         * UIProcess/ChildProcessProxy.h:
3269         (WebKit::ChildProcessProxy::platformGetLaunchOptions):
3270         * UIProcess/Launcher/ProcessLauncher.h:
3271         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: Added.
3272         (WebKit::memfd_create):
3273         (WebKit::argsToFd):
3274         (WebKit::XDGDBusProxyLauncher::setAddress):
3275         (WebKit::XDGDBusProxyLauncher::isRunning const):
3276         (WebKit::XDGDBusProxyLauncher::path const):
3277         (WebKit::XDGDBusProxyLauncher::proxyPath const):
3278         (WebKit::XDGDBusProxyLauncher::setPermissions):
3279         (WebKit::XDGDBusProxyLauncher::launch):
3280         (WebKit::XDGDBusProxyLauncher::childSetupFunc):
3281         (WebKit::XDGDBusProxyLauncher::makeProxyPath):
3282         (WebKit::XDGDBusProxyLauncher::dbusAddressToPath):
3283         (WebKit::bindIfExists):
3284         (WebKit::bindDBusSession):
3285         (WebKit::bindX11):
3286         (WebKit::bindDconf):
3287         (WebKit::bindWayland):
3288         (WebKit::bindPulse):
3289         (WebKit::bindFonts):
3290         (WebKit::bindGtkData):
3291         (WebKit::bindA11y):
3292         (WebKit::bindPathVar):
3293         (WebKit::bindGStreamerData):
3294         (WebKit::bindOpenGL):
3295         (WebKit::bindV4l):
3296         (WebKit::bindSymlinksRealPath):
3297         (WebKit::setupSeccomp):
3298         (WebKit::bubblewrapSpawn):
3299         * UIProcess/Launcher/glib/BubblewrapLauncher.h: Added.
3300         * UIProcess/Launcher/glib/FlatpakLauncher.cpp: Added.
3301         (WebKit::flatpakSpawn):
3302         * UIProcess/Launcher/glib/FlatpakLauncher.h: Added.
3303         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3304         (WebKit::isInsideFlatpak):
3305         (WebKit::ProcessLauncher::launchProcess):
3306         * UIProcess/Plugins/PluginProcessProxy.cpp:
3307         (WebKit::PluginProcessProxy::getLaunchOptions):
3308         * UIProcess/Plugins/PluginProcessProxy.h:
3309         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3310         (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
3311         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
3312         (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
3313         * UIProcess/WebProcessPool.h:
3314         * UIProcess/WebProcessProxy.cpp:
3315         (WebKit::WebProcessProxy::platformGetLaunchOptions):
3316         * UIProcess/WebProcessProxy.h:
3317         * UIProcess/glib/WebProcessProxyGLib.cpp: Added.
3318         (WebKit::WebProcessProxy::platformGetLaunchOptions):
3319
3320 2018-10-15  Alex Christensen  <achristensen@webkit.org>
3321
3322         Add a temporarily off by default preference for doing safe browsing checks
3323         https://bugs.webkit.org/show_bug.cgi?id=190522
3324
3325         Reviewed by Chris Dumez.
3326
3327         Safe browsing development has taken longer than anticipated.
3328         To prevent the unused possible contacting the safe browsing provider for no benefit, make this off by default for now.
3329         I'll make it on by default when it's actually used.
3330
3331         * Shared/WebPreferences.yaml:
3332         * UIProcess/API/Cocoa/WKPreferences.mm:
3333         (-[WKPreferences _setSafeBrowsingEnabled:]):
3334         (-[WKPreferences _safeBrowsingEnabled]):
3335         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3336         * UIProcess/WebPageProxy.cpp:
3337         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3338
3339 2018-10-15  Alex Christensen  <achristensen@webkit.org>
3340
3341         Include EnumTraits.h less
3342         https://bugs.webkit.org/show_bug.cgi?id=190535
3343
3344         Reviewed by Chris Dumez.
3345
3346         * NetworkProcess/NetworkSessionCreationParameters.h:
3347         * Shared/Authentication/AuthenticationChallengeDisposition.h:
3348         * Shared/CoordinateSystem.h:
3349         * Shared/LayerTreeContext.h:
3350         * Shared/UndoOrRedo.h:
3351         * Shared/WebsiteAutoplayPolicy.h:
3352         * Shared/WebsitePopUpPolicy.h:
3353         * UIProcess/API/APIWebsitePolicies.h:
3354         * WebProcess/UserContent/InjectUserScriptImmediately.h:
3355
3356 2018-10-15  Alex Christensen  <achristensen@webkit.org>
3357
3358         Remove InjectedBundle processing of back/forward lists
3359         https://bugs.webkit.org/show_bug.cgi?id=190459
3360
3361         Reviewed by Chris Dumez.
3362
3363         * Shared/API/c/WKDeprecated.h:
3364         * UIProcess/API/APINavigationClient.h:
3365         (API::NavigationClient::willGoToBackForwardListItem):
3366         * UIProcess/Cocoa/NavigationState.h:
3367         * UIProcess/Cocoa/NavigationState.mm:
3368         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
3369         * UIProcess/WebPageProxy.cpp:
3370         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3371         * UIProcess/WebPageProxy.h:
3372         * UIProcess/WebPageProxy.messages.in:
3373         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
3374         (API::InjectedBundle::PageLoaderClient::shouldGoToBackForwardListItem): Deleted.
3375         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
3376         (WKBundleBackForwardListItemCopyOriginalURL):
3377         (WKBundleBackForwardListItemCopyTitle):
3378         (WKBundleBackForwardListItemIsTargetItem):
3379         (WKBundleBackForwardListItemIsInPageCache):
3380         (WKBundleBackForwardListItemHasCachedPageExpired):
3381         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
3382         * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h:
3383         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
3384         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3385         (WebKit::InjectedBundlePageLoaderClient::InjectedBundlePageLoaderClient):
3386         (WebKit::InjectedBundlePageLoaderClient::shouldGoToBackForwardListItem): Deleted.
3387         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3388         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3389         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
3390         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3391
3392 2018-10-15  Alex Christensen  <achristensen@webkit.org>
3393
3394         WebPageProxy should always have a HistoryClient
3395         https://bugs.webkit.org/show_bug.cgi?id=190450
3396
3397         Reviewed by Chris Dumez.
3398
3399         This will make it so we don't forget to null check it.
3400         No change in behavior because the default HistoryClient does nothing.
3401
3402         * UIProcess/API/APIHistoryClient.h:
3403         * UIProcess/Cocoa/NavigationState.h:
3404         * UIProcess/Cocoa/NavigationState.mm:
3405         (WebKit::NavigationState::createHistoryClient):
3406         * UIProcess/WebPageProxy.cpp:
3407         (WebKit::WebPageProxy::WebPageProxy):
3408         (WebKit::WebPageProxy::setHistoryClient):
3409         (WebKit::WebPageProxy::didNavigateWithNavigationData):
3410         (WebKit::WebPageProxy::didPerformClientRedirect):
3411         (WebKit::WebPageProxy::didPerformServerRedirect):
3412         (WebKit::WebPageProxy::didUpdateHistoryTitle):
3413         * UIProcess/WebPageProxy.h:
3414
3415 2018-10-15  Alex Christensen  <achristensen@webkit.org>
3416
3417         Use std::optional<size_t> for a WebBackForwardList's current index
3418         https://bugs.webkit.org/show_bug.cgi?id=190448
3419
3420         Reviewed by Chris Dumez.
3421
3422         Also remove m_capacity, which was immutable.
3423
3424         * UIProcess/WebBackForwardList.cpp:
3425         (WebKit::WebBackForwardList::WebBackForwardList):
3426         (WebKit::WebBackForwardList::~WebBackForwardList):
3427         (WebKit::WebBackForwardList::pageClosed):
3428         (WebKit::WebBackForwardList::addItem):
3429         (WebKit::WebBackForwardList::goToItem):
3430         (WebKit::WebBackForwardList::currentItem const):
3431         (WebKit::WebBackForwardList::backItem const):
3432         (WebKit::WebBackForwardList::forwardItem const):
3433         (WebKit::WebBackForwardList::itemAtIndex const):
3434         (WebKit::WebBackForwardList::backListCount const):
3435         (WebKit::WebBackForwardList::forwardListCount const):
3436         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
3437         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
3438         (WebKit::WebBackForwardList::removeAllItems):
3439         (WebKit::WebBackForwardList::clear):
3440         (WebKit::WebBackForwardList::backForwardListState const):
3441         (WebKit::WebBackForwardList::restoreFromState):
3442         (WebKit::WebBackForwardList::loggingString):
3443         * UIProcess/WebBackForwardList.h:
3444         (WebKit::WebBackForwardList::currentIndex const): Deleted.
3445
3446 2018-10-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3447
3448         [JSC] Remove Option::useAsyncIterator
3449         https://bugs.webkit.org/show_bug.cgi?id=190567
3450
3451         Reviewed by Saam Barati.
3452
3453         * Configurations/FeatureDefines.xcconfig:
3454
3455 2018-10-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3456
3457         [iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view
3458         https://bugs.webkit.org/show_bug.cgi?id=190504
3459         <rdar://problem/45117760>
3460
3461         Reviewed by Tim Horton.
3462
3463         Add support for _setViewScale: and _viewScale on iOS. While similar in concept to macOS, changing this property
3464         on iOS uses viewport configurations to change the minimum layout size of the document and apply view scaling.
3465         Setting the view scale on iOS to a value `s` multiplies the minimium layout size by a factor `1 / s`, but also
3466         multiplies the initial, minimum and maximum scales by a factor of `s`. The net effect of applying this scale
3467         causes the page to lay out at a larger width and shrink (or a smaller width and expand) to fit the viewport.
3468
3469         * Shared/WebPageCreationParameters.cpp:
3470         (WebKit::WebPageCreationParameters::encode const):
3471         (WebKit::WebPageCreationParameters::decode):
3472         * Shared/WebPageCreationParameters.h:
3473
3474         Send `viewportConfigurationLayoutSizeScaleFactor` alongside `viewportConfigurationViewLayoutSize`.
3475
3476         (-[WKWebView _dispatchSetViewLayoutSize:]):
3477         (-[WKWebView _viewScale]):
3478         (-[WKWebView _setViewScale:]):
3479
3480         Provide a different implementation of `_setViewScale:` on iOS, by scaling the effective minimum layout size.
3481         (See above for more detail).
3482
3483         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3484
3485         Add missing API availability annotations for the _viewScale property.
3486
3487         * UIProcess/API/mac/WKView.mm:
3488         (-[WKView _setViewScale:]):
3489         * UIProcess/Cocoa/WebViewImpl.mm:
3490
3491         Both -[WKView _setViewScale:] and -[WKWebView _setViewScale:] throw Objective C exceptions upon receiving a bad
3492         argument (e.g. scale <= 0). However, logic for throwing this exception is specific to iOS in WKWebView, and
3493         handled in WebViewImpl on macOS. To make this less confusing, move the exception throwing code out of
3494         !PLATFORM(MAC) in WKWebView, and move the path for raising this exception in WKView on macOS from WebViewImpl to
3495         WKView.
3496
3497         * UIProcess/WebPageProxy.cpp:
3498         (WebKit::WebPageProxy::creationParameters):
3499         * UIProcess/WebPageProxy.h:
3500         (WebKit::WebPageProxy::layoutSizeScaleFactor const):
3501
3502         Tie the notion of "view scale" on iOS to `layoutSizeScaleFactor`. As its name suggests, this is a scale factor
3503         by which we transform the layout size.
3504
3505         * UIProcess/ios/WebPageProxyIOS.mm:
3506         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
3507         * WebProcess/WebPage/WebPage.cpp:
3508         * WebProcess/WebPage/WebPage.h:
3509         * WebProcess/WebPage/WebPage.messages.in:
3510
3511         Plumb the layout size scale factor over to the web process, along with the layout size.
3512
3513         * WebProcess/WebPage/ios/WebPageIOS.mm:
3514         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
3515
3516 2018-10-12  Alex Christensen  <achristensen@webkit.org>
3517
3518         Allow encoding of small enum classes
3519         https://bugs.webkit.org/show_bug.cgi?id=190531
3520
3521         Reviewed by Tim Horton.
3522
3523         * NetworkProcess/NetworkLoadClient.h:
3524         * Scripts/webkit/messages.py:
3525         * Scripts/webkit/parser.py:
3526         (parse_parameters_string):
3527         * UIProcess/API/APINavigation.h:
3528         * UIProcess/WebFramePolicyListenerProxy.h:
3529         * UIProcess/WebNavigationState.h:
3530         * UIProcess/WebPageProxy.h:
3531         * UIProcess/WebPageProxy.messages.in:
3532         * WebProcess/WebPage/WebPage.messages.in:
3533
3534 2018-10-12  Rob Buis  <rbuis@igalia.com>
3535
3536         Solve the confusion around blankURL() and isBlankURL() in URL
3537         https://bugs.webkit.org/show_bug.cgi?id=158988
3538
3539         Reviewed by Alex Christensen.
3540
3541         * NetworkProcess/NetworkResourceLoader.cpp:
3542         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3543         * UIProcess/WebProcessPool.cpp:
3544         (WebKit::WebProcessPool::processForNavigationInternal):
3545         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3546         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3547         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3548         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3549         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
3550         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3551         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
3552         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
3553         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
3554         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3555         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
3556         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
3557         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3558         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3559         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3560         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
3561         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
3562         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
3563
3564 2018-10-12  Youenn Fablet  <youenn@apple.com>
3565
3566         Cache API tests are flaky due to file writing failing from time to time
3567         https://bugs.webkit.org/show_bug.cgi?id=190321
3568
3569         Reviewed by Chris Dumez.
3570
3571         Make NetworkCache::Storage::store callback return an error in case of writing failure.
3572         Use this to surface this error at Cache API level.
3573
3574         Minor clean-up to make Storage::clear take a completion handler.
3575
3576         Make also sure to create the folder before writing the file in CacheStorageEngine.
3577         As can be seen from some logging, it does happen that writing the 'origin' file sometimes fail with Posix error 9,
3578         which might mean the folder is not present.
3579
3580         Changes are covered by current tests, flaky tests like http/wpt/cache-storage/cache-put-keys.https.any.worker.html
3581         will show a "failed writing data to the file system" error message.
3582
3583         * NetworkProcess/cache/CacheStorageEngine.cpp:
3584         (WebKit::CacheStorage::Engine::writeFile):
3585         * NetworkProcess/cache/CacheStorageEngine.h:
3586         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3587         (WebKit::CacheStorage::Caches::storeOrigin):
3588         (WebKit::CacheStorage::Caches::writeCachesToDisk):
3589         (WebKit::CacheStorage::Caches::writeRecord):
3590         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3591         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
3592         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
3593         (WebKit::NetworkCache::Storage::finishWriteOperation):
3594         (WebKit::NetworkCache::Storage::store):
3595         (WebKit::NetworkCache::Storage::clear):
3596         * NetworkProcess/cache/NetworkCacheStorage.h:
3597         (WebKit::NetworkCache::Storage::store):
3598
3599 2018-10-11  Youenn Fablet  <youenn@apple.com>
3600
3601         IOS 12 - Service worker cache not shared when added to homescreen
3602         https://bugs.webkit.org/show_bug.cgi?id=190269
3603         <rdar://problem/45009961>
3604
3605         Reviewed by Alex Christensen.
3606
3607         NetworkProcessProxy does not always have all its stores in its hash map.
3608         Make sure to check for the default web process pool store when grabbing cache storage parameters from a given session ID.
3609
3610         Add a way to remove the default website data for testing.
3611         This is used in the new API test.
3612
3613         * UIProcess/API/APIWebsiteDataStore.cpp:
3614         (API::WebsiteDataStore::deleteDefaultDataStoreForTesting):
3615         * UIProcess/API/APIWebsiteDataStore.h:
3616         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3617         (+[WKWebsiteDataStore _deleteDefaultDataStoreForTesting]):
3618         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3619         * UIProcess/Network/NetworkProcessProxy.cpp:
3620         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
3621
3622 2018-10-10  Simon Fraser  <simon.fraser@apple.com>
3623
3624         Hide RenderLayer z-order and normal flow lists behind iterators
3625         https://bugs.webkit.org/show_bug.cgi?id=190457
3626
3627         Reviewed by Zalan Bujtas.
3628
3629         Expose the positive z-order, negative z-order and normal flow lists
3630         from RenderLayer as iterators rather than vectors of raw pointers.
3631         
3632         Use a lambda function to get access to the private constructor, while not having
3633         to refer to the nested RenderLayer::LayerIterator class in the header.
3634
3635         * Shared/WebRenderLayer.cpp:
3636         (WebKit::WebRenderLayer::WebRenderLayer):
3637         (WebKit::WebRenderLayer::createArrayFromLayerList): Deleted.
3638         * Shared/WebRenderLayer.h:
3639
3640 2018-10-11  Tim Horton  <timothy_horton@apple.com>
3641
3642         iOS: Scrolling using the arrow keys doesn't show the scroll indicator like it does on macOS
3643         https://bugs.webkit.org/show_bug.cgi?id=190478
3644         <rdar://problem/22194031>
3645
3646         Reviewed by Megan Gardner.
3647
3648         * Platform/spi/ios/UIKitSPI.h:
3649         Add some SPI.
3650
3651         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
3652         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
3653         Do a persistent flash when scrolling continuously.
3654
3655         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
3656         Do a single flash when doing a scroll-to-top/bottom.
3657
3658 2018-10-11  Tim Horton  <timothy_horton@apple.com>
3659
3660         Clicking on bookmarklet crashes at NavigationState::willRecordNavigationSnapshot
3661         https://bugs.webkit.org/show_bug.cgi?id=190476
3662         <rdar://problem/32757191>
3663
3664         Reviewed by Megan Gardner.
3665
3666         * UIProcess/API/Cocoa/WKWebView.mm:
3667         (-[WKWebView _saveBackForwardSnapshotForItem:]):
3668         The WKBackForwardListItem can be nil. Then we retrieve a reference from it.
3669         An Objective-C method that returns a reference is a great way to get
3670         a null reference. Other code then assumes it's not null and crashes.
3671         Add a nil check.
3672
3673 2018-10-11  Tim Horton  <timothy_horton@apple.com>
3674
3675         Hardware keyboard arrow keys/spacebar don't scroll PDFs (works for web content)
3676         https://bugs.webkit.org/show_bug.cgi?id=190495
3677         <rdar://problem/22734616>
3678
3679         Reviewed by Andy Estes.
3680
3681         Hook up WKKeyboardScrollViewAnimator to the scroll view when
3682         WKPDFView is installed.
3683
3684         * Platform/spi/ios/UIKitSPI.h:
3685         Move _inputFlags to the IPI section so we can remove it
3686         from WKContentViewInteraction.
3687
3688         * SourcesCocoa.txt:
3689         * UIProcess/ios/WKWebEvent.h:
3690         * UIProcess/ios/WKWebEvent.mm:
3691         * UIProcess/ios/WKContentViewInteraction.mm:
3692         (-[WKContentView handleKeyEvent:]):
3693         (-[WKWebEvent dealloc]): Deleted.
3694         * WebKit.xcodeproj/project.pbxproj:
3695         Move WKWebEvent out of WKContentViewInteraction.
3696         We tend to prefer one file per class.
3697         Also, move the code to make a WKWebEvent from a UIEvent into
3698         -initWithEvent:, instead of being ad-hoc in WKContentViewInteraction.
3699         Adopt RetainPtr for the WKWebEvent's uiEvent property.
3700
3701         * UIProcess/API/Cocoa/WKWebView.mm:
3702         (-[WKWebView _handleKeyUIEvent:]):
3703         * UIProcess/Cocoa/WKWebViewContentProvider.h:
3704         Plumb hardware keyboard events to custom content views, if they want them.
3705
3706         * UIProcess/ios/WKPDFView.mm:
3707         (-[WKPDFView dealloc]):
3708         (-[WKPDFView web_handleKeyEvent:]):
3709         (-[WKPDFView web_initWithFrame:webView:mimeType:]):
3710         Install a WKKeyboardScrollViewAnimator and plumb key events to it.
3711
3712 2018-10-11  Antoine Quint  <graouts@apple.com>
3713
3714         [Web Animations] Allow iOS to also control toggling Web Animations CSS Integration
3715         https://bugs.webkit.org/show_bug.cgi?id=190489
3716
3717         Reviewed by Tim Horton.
3718
3719         * UIProcess/API/Cocoa/WKPreferences.mm:
3720         (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
3721         (-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
3722         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3723
3724 2018-10-11  Keith Rollin  <krollin@apple.com>
3725
3726         CURRENT_ARCH should not be used in Run Script phase.
3727         https://bugs.webkit.org/show_bug.cgi?id=190407
3728         <rdar://problem/45133556>
3729
3730         Reviewed by Alexey Proskuryakov.
3731
3732         CURRENT_ARCH is used in a number of Xcode Run Script phases. However,
3733         CURRENT_ARCH is not well-defined during this phase (and may even have
3734         the value "undefined") since this phase is run just once per build
3735         rather than once per supported architecture. Migrate away from
3736         CURRENT_ARCH in favor of ARCHS, either by iterating over ARCHS and
3737         performing an operation for each value, or by picking the first entry
3738         in ARCHS and using that as a representative value.
3739
3740         * DerivedSources.make: When forming TARGET_TRIPLE_FLAGS, grab the
3741         first entry in ARCHS rather than use CURRENT_ARCH.
3742
3743 2018-10-11  Chris Dumez  <cdumez@apple.com>
3744
3745         Regression(PSON): Deal with the drawing area potentially being null under WebChromeClient::contentsSizeChanged()
3746         https://bugs.webkit.org/show_bug.cgi?id=190474
3747
3748         Reviewed by Geoffrey Garen.
3749
3750         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3751         (WebKit::WebChromeClient::contentsSizeChanged const):
3752
3753 2018-10-11  Alejandro G. Castro  <alex@igalia.com>
3754
3755         [GTK][WPE] Add mediaDevices.enumerateDevices support
3756         https://bugs.webkit.org/show_bug.cgi?id=185761
3757
3758         Reviewed by Youenn Fablet.
3759
3760         Implemented the enumerateDevices API using a new WebKit class
3761         (DeviceIdHashSaltStorage) that generates and stores the device ids
3762         hash salts per origin, used to avoid fingerprinting in the
3763         webpages.
3764
3765         The patch also adds a new type of data for the WebsiteDataStore.
3766         That way the users can call the WebsiteDataStore to show what
3767         origins have hash salt generated and remove them at some point.
3768
3769         For the moment just GTK+ and WPE ports are using this class to
3770         generate the hash salts. The patch adds code to the
3771         checkUserMediaPermissionForOrigin API implementation, it was empty
3772         until now for these ports. In this function we create an instance
3773         of a new class WebKitDeviceInfoPermissionRequest that implements
3774         the WebKitPermissionRequestIface interface, that allows the ports
3775         to use the current permission managers implemented in the
3776         embedders to handle this new kind of request the way they like
3777         it. The default implementation is deny.
3778
3779         The class WebKitDeviceInfoPermissionRequest takes care of
3780         contacting the DeviceIdHashSaltStorage and request/regenerate the
3781         hash salts accordingly.
3782
3783         Persistency is still not implemented, we will add it in a
3784         future patch.
3785
3786         * Shared/WebsiteData/WebsiteDataType.h: Added the new type of
3787         webside data: DeviceIdHashSalt.
3788         * Sources.txt: Added new files to compilation.
3789         * SourcesGTK.txt: Ditto.
3790         * SourcesWPE.txt: Ditto.
3791         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp: Added
3792         this class to represent a request of permission to access the
3793         devices information. This is specific for glib ports and implements
3794         the policies regarding the hash salts when the embedder allows or
3795         denies the access using the DeviceIdHashSaltStorage class.
3796         (webkitDeviceInfoPermissionRequestAllow): Get the device hash salt
3797         when the origin is allowed and set it in the original request.
3798         (webkitDeviceInfoPermissionRequestDeny): Regenerate the device id
3799         hash salt when the user does not allow to access the device information.
3800         (webkit_permission_request_interface_init):
3801         (webkitDeviceInfoPermissionRequestDispose):
3802         (webkit_device_info_permission_request_class_init):
3803         (webkitDeviceInfoPermissionRequestCreate): Create the class using
3804         the proxy request from the webprocess and a reference to the
3805         DeviceIdHashSaltStorage.
3806         * UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:
3807         Ditto.
3808         * UIProcess/API/glib/WebKitUIClient.cpp: Added the implementation
3809         for the checkUserMediaPermissionForOrigin API for the glib ports,
3810         it creates the device info request and calls the permission
3811         request API.
3812         * UIProcess/API/glib/WebKitWebsiteData.cpp:
3813         (recordContainsSupportedDataTypes): Added the DeviceIdHashSalt
3814         type.
3815         (toWebKitWebsiteDataTypes): Added the conversion from the WebKit
3816         types to the glib types for the WebsiteDataType::DeviceIdHashSalt.
3817         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
3818         (toWebsiteDataTypes): Added the conversion from the glib type
3819         WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT to the WebKit type.
3820         (webkit_website_data_manager_remove): Make sure we remote the
3821         DeviceIdHashSalt if the Cookies are selected.
3822         * UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Added
3823         this new class that represents a permission request for the device
3824         information in the GTK+ port.
3825         * UIProcess/API/gtk/WebKitWebsiteData.h: Added the new type of
3826         website that in the GTK+ port:
3827         WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT.
3828         * UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Added
3829         this new class that represents a permission request for the device
3830         information in the WPE port.
3831         * UIProcess/API/wpe/WebKitWebsiteData.h: Added the new type of
3832         website that in the WPE port:
3833         WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT.
3834         * UIProcess/DeviceIdHashSaltStorage.cpp: Added this new class that
3835         handles how to generate and store the hash salts inside
3836         WebKit. Persistency is still not implemented, we will add it in a
3837         future patch.
3838         (WebKit::DeviceIdHashSaltStorage::create):
3839         (WebKit::DeviceIdHashSaltStorage::deviceIdentifierHashSaltForOrigin):
3840         Check the map to get the hash salt for an origin, if there is none
3841         create a new random one.
3842         (WebKit::DeviceIdHashSaltStorage::regenerateDeviceIdentifierHashSaltForOrigin):
3843         Delete the hash salt of an origin if it already exists and create a new one.
3844         (WebKit::DeviceIdHashSaltStorage::getDeviceIdHashSaltOrigins):
3845         Returns the list of origins that have a hash salt generated for
3846         them. It is used in the WebsiteDataStore.
3847         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins):
3848         Deletes the hash salts in the map for an origin.
3849         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltOriginsModifiedSince):
3850         Delete the origins that have not been modified since a time.
3851         * UIProcess/DeviceIdHashSaltStorage.h: Ditto.
3852         * UIProcess/UserMediaPermissionCheckProxy.h: Remove uneeded class
3853         definition.
3854         * UIProcess/WebsiteData/WebsiteDataStore.cpp: Added support to
3855         return and remove the origins with a generate hash salt used to
3856         generate the device ids.
3857         (WebKit::WebsiteDataStore::WebsiteDataStore): Added the new
3858         reference to the DeviceIdHashSaltStorage class, used to handle the
3859         hash salts.
3860         (WebKit::WebsiteDataStore::fetchDataAndApply): Get the list of
3861         origins with a hash salts in the DeviceIdHashSaltStorage.
3862         (WebKit::WebsiteDataStore::removeData): Remove the hash salts in
3863         DeviceIdHashSaltStorage for an origin.
3864         * UIProcess/WebsiteData/WebsiteDataStore.h: Ditto.
3865         (WebKit::WebsiteDataStore::deviceIdHashSaltStorage):
3866         * WebKit.xcodeproj/project.pbxproj: Added the
3867         DeviceIdHashSaltStorage to the compilation.
3868
3869 2018-10-10  Tim Horton  <timothy_horton@apple.com>
3870
3871         Safari crashes when attempting to share a YouTube video while in full-screen
3872         https://bugs.webkit.org/show_bug.cgi?id=190456
3873         <rdar://problem/45130748>
3874
3875         Reviewed by Wenson Hsieh.
3876
3877         * Platform/spi/ios/UIKitSPI.h:
3878         * UIProcess/Cocoa/WKShareSheet.mm:
3879         (-[WKShareSheet presentWithParameters:completionHandler:]):
3880         Allow the share sheet to present centered, since we don't have enough
3881         context to put it in a more sensible place.
3882
3883 2018-10-10  Tim Horton  <timothy_horton@apple.com>
3884
3885         REGRESSION (r236935): Layout test fast/events/ios/keyboard-scrolling-distance.html is timing out
3886         https://bugs.webkit.org/show_bug.cgi?id=190444
3887         <rdar://problem/45110698>
3888
3889         Reviewed by Simon Fraser.
3890
3891         There's a race in WKKeyboardScrollingAnimator that's exacerbated by HIDEventGenerator
3892         being much faster than a human finger. We get our "begin" events from interpretKeyEvent,
3893         after the Web Content process has had its way with it, but currently the
3894         back-channel "handle" events (e.g. for key up, which doesn't go to interpretKeyEvent)
3895         are retrieved from handleKeyWebEvent in the UI process, which is *before*
3896         the Web Content process has had a swing at it.
3897
3898         If you lose the race (an insanely short tap like you get from HIDEventGenerator,
3899         or with a very busy Web Content process), we see handle(keyDown), handle(keyUp), begin(keyDown),
3900         and get stuck scrolling!
3901
3902         Instead, retrieve the out-of-band "handle" events from _didHandleKeyEvent,
3903         so that they're sensibly and strictly ordered with respect to the timing of interpretKeyEvent/"begin".
3904
3905         Also, hook up didFinishScrolling, so that UIScriptController's callbacks work correctly.
3906
3907         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3908         * UIProcess/ios/WKContentViewInteraction.mm:
3909         (-[WKContentView handleKeyWebEvent:]):
3910         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]):
3911         (-[WKContentView keyboardScrollViewAnimatorDidFinishScrolling:]):
3912         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
3913         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
3914         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
3915         (-[WKKeyboardScrollingAnimator displayLinkFired:]):
3916         (-[WKKeyboardScrollViewAnimator setDelegate:]):
3917         (-[WKKeyboardScrollViewAnimator handleKeyEvent:]):
3918         (-[WKKeyboardScrollViewAnimator didFinishScrolling]):
3919
3920 2018-10-10  Tim Horton  <timothy_horton@apple.com>
3921
3922         Share more WKShareSheet code between macOS and iOS, and fix a few bugs
3923         https://bugs.webkit.org/show_bug.cgi?id=190420
3924
3925         Reviewed by Simon Fraser.
3926
3927         * UIProcess/API/Cocoa/WKWebView.mm:
3928         (-[WKWebView _resolutionForShareSheetImmediateCompletionForTesting]):
3929         (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]):
3930         (-[WKWebView _invokeShareSheetWithResolution:]): Deleted.
3931         Add a new mechanism to tell the share sheet up-front that it should
3932         immediately dismiss with a particular resolution, for testing.
3933         See the Tools ChangeLog for justification.
3934         We keep the bit on WKWebView instead of WKShareSheet so that it can be
3935         called prior to invoking the share sheet.
3936
3937         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3938         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3939         * UIProcess/Cocoa/WKShareSheet.h:
3940         * UIProcess/Cocoa/WKShareSheet.mm:
3941         (-[WKShareSheet initWithView:]):
3942         (-[WKShareSheet presentWithParameters:completionHandler:]):
3943         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
3944         (-[WKShareSheet _didCompleteWithSuccess:]):
3945         (-[WKShareSheet dismiss]):
3946         (-[WKShareSheet dispatchDidDismiss]):
3947         (-[WKShareSheet initWithView:initWithView:]): Deleted.
3948         (-[WKShareSheet _dispatchDidDismiss]): Deleted.
3949         (-[WKShareSheet _cancel]): Deleted.
3950         (-[WKShareSheet _dismissDisplayAnimated:]): Deleted.
3951         (-[WKShareSheet _presentFullscreenViewController:animated:]): Deleted.
3952         (-[WKShareSheet invokeShareSheetWithResolution:]): Deleted.
3953         Reduce the number of extraneous members, methods, and #ifdefs.
3954         Try to share as much of WKShareSheet between the platforms as makes sense.
3955         The interface is now totally identical on the two platforms.
3956
3957         * UIProcess/Cocoa/WebViewImpl.mm:
3958         (WebKit::WebViewImpl::showShareSheet):
3959         * UIProcess/ios/WKContentViewInteraction.h:
3960         * UIProcess/ios/WKContentViewInteraction.mm:
3961         (-[WKContentView _showShareSheet:completionHandler:]):
3962         (-[WKContentView invokeShareSheetWithResolution:]): Deleted.
3963         Instead of silently failing (without even calling the completion handler!)
3964         if we try to present one share sheet on top of another, dismiss the first
3965         and present the new one. This is important because there are (separately
3966         filed) bugs on both platforms where the completion handler is not called;
3967         now, instead of a tab getting stuck forever, we'll reject the promise
3968         when another share takes place.
3969
3970 2018-10-10  Tim Horton  <timothy_horton@apple.com>
3971
3972         REGRESSION (r236678): Keyboard scrolling with arrow keys doesn't work on iOS
3973         https://bugs.webkit.org/show_bug.cgi?id=190433
3974         <rdar://problem/45111986>
3975
3976         Reviewed by Simon Fraser.
3977
3978         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
3979         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
3980         (-[WKKeyboardScrollingAnimator beginWithEvent:]): Deleted.
3981         (-[WKKeyboardScrollViewAnimator beginWithEvent:]): Deleted.
3982         r236678 changes the characters in charactersIgnoringModifiers to match AppKit.
3983         We similarly need to update WKKeyboardScrollingAnimator's comparison.
3984
3985 2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
3986
3987         [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
3988         https://bugs.webkit.org/show_bug.cgi?id=190429
3989
3990         Reviewed by Saam Barati.
3991
3992         Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
3993
3994         * Shared/API/c/WKString.cpp:
3995         (WKStringCopyJSString):
3996         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3997         (WebKit::toJSValue):
3998         (WebKit::callPropertyFunction):
3999         (WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
4000         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
4001         * WebProcess/Plugins/PDF/PDFPlugin.mm:
4002         (WebKit::PDFPlugin::runScriptsInPDFDocument):
4003
4004 2018-10-10  Chris Dumez  <cdumez@apple.com>
4005
4006         Regression(PSON): Assertion hit under WebPageProxy::didNavigateWithNavigationData()
4007         https://bugs.webkit.org/show_bug.cgi?id=190418
4008         <rdar://problem/45059769>
4009
4010         Reviewed by Geoffrey Garen.
4011
4012         When process s