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