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