Add support for Device Orientation / Motion permission API
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-08  Chris Dumez  <cdumez@apple.com>
2
3         Add support for Device Orientation / Motion permission API
4         https://bugs.webkit.org/show_bug.cgi?id=195329
5         <rdar://problem/47645367>
6
7         Reviewed by Geoffrey Garen.
8
9         Add support for Device Orientation / Motion permission API:
10         - https://github.com/w3c/deviceorientation/issues/57
11
12         This adds new SPI to WKUIDelegatePrivate, until we can make this API.
13
14         * Shared/WebPreferences.yaml:
15         * UIProcess/API/APIUIClient.h:
16         (API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
17         * UIProcess/API/C/WKPage.cpp:
18         (WKPageSetPageUIClient):
19         * UIProcess/API/C/WKPageUIClient.h:
20         * UIProcess/API/Cocoa/WKUIDelegate.h:
21         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
22         * UIProcess/Cocoa/UIDelegate.h:
23         * UIProcess/Cocoa/UIDelegate.mm:
24         (WebKit::UIDelegate::setDelegate):
25         (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
26         * UIProcess/WebPageProxy.cpp:
27         (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
28         * UIProcess/WebPageProxy.h:
29         * UIProcess/WebPageProxy.messages.in:
30         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
31         (WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
32         * WebProcess/WebCoreSupport/WebChromeClient.h:
33         * WebProcess/WebPage/WebPage.cpp:
34         (WebKit::nextDeviceOrientationAndMotionPermissionCallbackID):
35         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
36         (WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision):
37         * WebProcess/WebPage/WebPage.h:
38         * WebProcess/WebPage/WebPage.messages.in:
39
40 2019-03-08  Brady Eidson  <beidson@apple.com>
41
42         Have the UIProcess take the UnboundedNetworking assertion when downloads are in progress.
43         https://bugs.webkit.org/show_bug.cgi?id=195468
44
45         Reviewed by Andy Estes.
46
47         * UIProcess/Downloads/DownloadProxyMap.cpp:
48         (WebKit::DownloadProxyMap::DownloadProxyMap):
49         (WebKit::DownloadProxyMap::createDownloadProxy): If this is the first download, and the process has the entitlement,
50           take the assertion.
51         (WebKit::DownloadProxyMap::downloadFinished):
52         (WebKit::DownloadProxyMap::processDidClose):
53         * UIProcess/Downloads/DownloadProxyMap.h:
54
55 2019-03-08  Chris Dumez  <cdumez@apple.com>
56
57         Add assertions to help debug a WebProcessCache crash
58         https://bugs.webkit.org/show_bug.cgi?id=195469
59
60         Reviewed by Brady Eidson.
61
62         I suspect the process's registrableDomain in null when evictProcess() gets
63         called, thus crashing when lookup it up in the HashMap. Confirm this and
64         how this could happen via assertions.
65
66         * UIProcess/WebProcessCache.cpp:
67         (WebKit::WebProcessCache::evictProcess):
68         * UIProcess/WebProcessProxy.cpp:
69         (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
70
71 2019-03-08  Brady Eidson  <beidson@apple.com>
72
73         Rename AssertionState::Download.
74         https://bugs.webkit.org/show_bug.cgi?id=195465
75
76         Reviewed by Andy Estes.
77
78         It's (currently) about uploads and downloads.
79         Let's call it "UnboundedNetworking"
80
81         * NetworkProcess/Downloads/DownloadMap.cpp:
82         (WebKit::DownloadMap::add):
83
84         * UIProcess/ProcessAssertion.h:
85
86         * UIProcess/WebProcessProxy.cpp:
87         (WebKit::WebProcessProxy::didSetAssertionState):
88
89         * UIProcess/ios/ProcessAssertionIOS.mm:
90         (WebKit::flagsForState):
91         (WebKit::reasonForState):
92
93 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
94
95         [macOS UI-side compositing] Mouse handling can trigger a crash before we have a scrolling tree root
96         https://bugs.webkit.org/show_bug.cgi?id=195467
97
98         Reviewed by Antti Koivisto.
99         
100         When launching MiniBrowser with UI-side compositing enabled in a state where the window
101         appears under the mouse, we can hit RemoteScrollingTree::handleMouseEvent() for a mouseEnter
102         event before we have a scrolling tree root node, so add a null check.
103
104         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
105         (WebKit::RemoteScrollingTree::handleMouseEvent):
106
107 2019-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
108
109         REGRESSION(r242624): [GTK] New rAF code path assumes AC mode
110         https://bugs.webkit.org/show_bug.cgi?id=195459
111
112         Reviewed by Žan Doberšek.
113
114         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
115         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
116         The refresh monitor now calls scheduleLayerFlush() but when AC
117         mode is disabled this method does nothing, so setNeedsDisplay()
118         needs to be called instead.
119
120 2019-03-07  Tim Horton  <timothy_horton@apple.com>
121
122         Crash under RemoteLayerTreePropertyApplier::applyProperties
123         https://bugs.webkit.org/show_bug.cgi?id=195448
124         <rdar://problem/48588226>
125
126         Reviewed by Simon Fraser.
127
128         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
129         (WebKit::RemoteLayerTreeHost::updateLayerTree):
130         Under some currently-unknown circumstances, the UI process is receiving
131         commits referring to layers that it does not know about.
132         One understood case of this was fixed in r241899, but there seem to be
133         cases remaining that are not understood.
134         Also, add a release log so that we can identify any downstream effects.
135
136 2019-03-07  Zalan Bujtas  <zalan@apple.com>
137
138         [ContentChangeObserver] Introduce fixed duration content observation
139         https://bugs.webkit.org/show_bug.cgi?id=195295
140         <rdar://problem/48579913>
141
142         Reviewed by Simon Fraser.
143
144         * WebProcess/WebPage/ios/WebPageIOS.mm:
145         (WebKit::WebPage::handleSyntheticClick):
146         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
147
148 2019-03-07  Fujii Hironori  <Hironori.Fujii@sony.com>
149
150         [WinCairo][WebKit] Nothing is drawn after Web process crashed
151         https://bugs.webkit.org/show_bug.cgi?id=195399
152
153         Reviewed by Alex Christensen.
154
155         PageClientImpl::viewSize returned 0x0 size after Web process
156         crashed. Restored the original implementation using GetClientRect
157         (Bug 52175).
158
159         * UIProcess/win/PageClientImpl.cpp:
160         (WebKit::PageClientImpl::viewSize):
161
162 2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
163
164         requestAnimationFrame should execute before the next frame
165         https://bugs.webkit.org/show_bug.cgi?id=177484
166
167         Reviewed by Simon Fraser.
168
169         Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
170         a single call to Page::renderingUpdate(). This new function implements 
171         "Update the rendering" step of the HTML Event Loop specification
172         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
173
174         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
175         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
176         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
177         (WebKit::LayerTreeHost::layerFlushTimerFired):
178         * WebProcess/WebPage/DrawingAreaImpl.cpp:
179         (WebKit::DrawingAreaImpl::display):
180         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
181         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
182         * WebProcess/WebPage/WebPage.cpp:
183         (WebKit::WebPage::layoutIfNeeded):
184         (WebKit::WebPage::renderingUpdate):
185         (WebKit::WebPage::willDisplayPage): Deleted.
186         * WebProcess/WebPage/WebPage.h:
187         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
188         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
189
190 2019-03-07  Zalan Bujtas  <zalan@apple.com>
191
192         [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
193         https://bugs.webkit.org/show_bug.cgi?id=195353
194         <rdar://problem/48626394>
195
196         Reviewed by Simon Fraser.
197
198         * Shared/WebPreferences.yaml:
199         * UIProcess/API/C/WKPreferences.cpp:
200         (WKPreferencesSetContentChangeObserverEnabled):
201         (WKPreferencesGetContentChangeObserverEnabled):
202         * UIProcess/API/C/WKPreferencesRefPrivate.h:
203         * UIProcess/API/Cocoa/WKPreferences.mm:
204         (-[WKPreferences _contentChangeObserverEnabled]):
205         (-[WKPreferences _setContentChangeObserverEnabled:]):
206         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
207         * WebProcess/WebPage/ios/WebPageIOS.mm:
208         (WebKit::WebPage::handleSyntheticClick):
209
210 2019-03-07  Andy Estes  <aestes@apple.com>
211
212         [Apple Pay] Untangle PKPaymentAuthorizationViewController from WebPaymentCoordinatorProxy
213         https://bugs.webkit.org/show_bug.cgi?id=195349
214         <rdar://problem/48625510>
215
216         Reviewed by Alex Christensen.
217
218         Introduced PaymentAuthorizationPresenter and WKPaymentAuthorizationDelegate to encapsulate
219         PKPaymentAuthorizationViewController and its delegate. Taught WebPaymentCoordinatorProxy to
220         interact with PaymentAuthorizationPresenter rather than PKPAVC directly.
221
222         These changes will allow us to swap out PKPaymentAuthorizationViewController with PKPaymentAuthorizationController in a follow-on patch.
223
224         * Platform/cocoa/PaymentAuthorizationPresenter.h: Added. Defined the abstract interface for
225         payment authorization presenters that use PKPA(V)C.
226         * Platform/cocoa/PaymentAuthorizationPresenter.mm: Added.
227         (WebKit::toPKPaymentAuthorizationStatus): Moved from WebPaymentCoordinatorProxyCocoa.mm.
228         (WebKit::toPKPaymentErrorCode): Ditto.
229         (WebKit::toNSError): Ditto.
230         (WebKit::toNSErrors): Ditto.
231         (WebKit::toPKShippingMethods): Ditto.
232         (WebKit::PaymentAuthorizationPresenter::completeMerchantValidation): Added. Implements the
233         logic previously in WebPaymentCoordinatorProxy::platformCompleteMerchantValidation.
234         (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): Ditto for
235         WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection.
236         (WebKit::PaymentAuthorizationPresenter::completePaymentSession): Ditto for 
237         (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection): Ditto for
238         WebPaymentCoordinatorProxy::platformCompletePaymentSession.
239         (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): Ditto for
240         WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection.
241         * Platform/cocoa/PaymentAuthorizationViewController.h: Added. Defined a subclass of PaymentAuthorizationPresenter for PKPaymentAuthorizationViewController.
242         * Platform/cocoa/PaymentAuthorizationViewController.mm: Added.
243         (-[WKPaymentAuthorizationViewControllerDelegate initWithPresenter:]): Added a PKPAVC
244         delegate that's a subclass of WKPaymentAuthorizationDelegate.
245         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
246         Called -[WKPaymentAuthorizationDelegate _didFinish].
247         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Called
248         -[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:].
249         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Called
250         -[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:].
251         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Called
252         -[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:].
253         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Called
254         -[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:].
255         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]):
256         Called -[WKPaymentAuthorizationDelegate _willFinishWithError:].
257         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Called
258         -[WKPaymentAuthorizationDelegate _didRequestMerchantSession:].
259         * Platform/cocoa/WKPaymentAuthorizationDelegate.h: Added.
260         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: Added.
261         (-[WKPaymentAuthorizationDelegate summaryItems]): Added a summaryItems getter.
262         (-[WKPaymentAuthorizationDelegate shippingMethods]): Ditto for shippingMethods.
263         (-[WKPaymentAuthorizationDelegate completeMerchantValidation:error:]): Called
264         _didRequestMerchantSessionCompletion then set it to nil.
265         (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): Ditto for
266         _didSelectPaymentMethodCompletion.
267         (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]): Ditto
268         for _didAuthorizePaymentCompletion.
269         (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
270         Ditto for _didSelectShippingContactCompletion.
271         (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): Ditto for
272         _didSelectShippingMethodCompletion.
273         (-[WKPaymentAuthorizationDelegate invalidate]): If there's an outstanding authorization
274         callback, called -completePaymentSession:errors:didReachFinalState: with a state of
275         PKPaymentAuthorizationStatusFailure.
276         (-[WKPaymentAuthorizationDelegate _initWithPresenter:]):
277         (-[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:]): Added. Implements the
278         logic previously in WKPaymentAuthorizationViewControllerDelegate.
279         (-[WKPaymentAuthorizationDelegate _didFinish]): Ditto.
280         (-[WKPaymentAuthorizationDelegate _didRequestMerchantSession:]): Ditto.
281         (-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]): Ditto.
282         (-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]): Ditto.
283         (toShippingMethod): Moved from WebPaymentCoordinatorProxyCocoa.mm.
284         (-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]): Added. Implements
285         the logic previously in WKPaymentAuthorizationViewControllerDelegate.
286         (-[WKPaymentAuthorizationDelegate _willFinishWithError:]): Ditto.
287         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
288         (WebKit::WebPaymentCoordinatorProxy::presenterWillValidateMerchant): To conform to
289         PaymentAuthorizationPresenter::Client, renamed from validateMerchant.
290         (WebKit::WebPaymentCoordinatorProxy::presenterDidAuthorizePayment): Renamed from
291         didAuthorizePayment.
292         (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Moved logic here that previously
293         existed in WKPaymentAuthorizationViewControllerDelegate.
294         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingMethod): Renamed from
295         didSelectShippingMethod.
296         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingContact): Renamed from
297         didSelectShippingContact.
298         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectPaymentMethod): Renamed from
299         didSelectPaymentMethod.
300         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Renamed to
301         presenterWillValidateMerchant.
302         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Renamed to
303         presenterDidAuthorizePayment.
304         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Renamed to
305         presenterDidSelectShippingMethod.
306         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Renamed to
307         presenterDidSelectShippingContact.
308         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Renamed to
309         didSelectPaymentMethod.
310         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Changed WebPaymentCoordinatorProxy to
311         subclass PaymentAuthorizationPresenter::Client.
312         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Removed WKPaymentAuthorizationViewControllerDelegate interface and declared some helper functions
313         needed by PaymentAuthorizationPresenter.
314         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
315         (WebKit::toPKPaymentSummaryItemType): Removed static keyword.
316         (WebKit::toDecimalNumber): Ditto.
317         (WebKit::toPKPaymentSummaryItem): Ditto.
318         (WebKit::toPKPaymentSummaryItems): Ditto.
319         (WebKit::toPKShippingMethod): Ditto.
320         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Changed to call
321         m_authorizationPresenter.
322         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Ditto.
323         (WebKit::WebPaymentCoordinatorProxy::platformCompleteMerchantValidation): Ditto.
324         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): Ditto.
325         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Ditto.
326         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): Ditto.
327         (-[WKPaymentAuthorizationViewControllerDelegate initWithPaymentCoordinatorProxy:]): Deleted.
328         (-[WKPaymentAuthorizationViewControllerDelegate invalidate]): Deleted.
329         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]): Deleted.
330         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Deleted.
331         (toShippingMethod): Deleted.
332         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Deleted.
333         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Deleted.
334         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Deleted.
335         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Deleted.
336         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
337         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
338         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
339         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
340         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): Deleted.
341         (WebKit::toPKPaymentAuthorizationStatus): Moved to PaymentAuthorizationPresenter.mm.
342         (WebKit::toPKPaymentErrorCode): Ditto.
343         (WebKit::toNSError): Ditto.
344         (WebKit::toNSErrors): Ditto.
345         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
346         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Changed to present a
347         PaymentAuthorizationPresenter rather than a PKPAVC.
348         (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Changed to dismiss a
349         PaymentAuthorizationPresenter rather than a PKPAVC.
350         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
351         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
352         (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Ditto.
353         * SourcesCocoa.txt:
354         * UIProcess/WebPageProxy.h:
355         * UIProcess/ios/WebPageProxyIOS.mm:
356         (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter): Added. Returns a new
357         PaymentAuthorizationViewController.
358         * WebKit.xcodeproj/project.pbxproj:
359
360 2019-03-07  Chris Dumez  <cdumez@apple.com>
361
362         Regression(r242580) WebKit.NetworkProcessCrashWithPendingConnection API is crashing on iOS debug
363         https://bugs.webkit.org/show_bug.cgi?id=195416
364
365         Reviewed by Antti Koivisto.
366
367         Drop ASSERT_NOT_REACHED() in WebPage::didCompletePageTransition() when the tree is still frozen due to
368         LayerTreeFreezeReason::ProcessSuspended. As demonstrated by this API test, nothing prevents a load from
369         completing and WebPage::didCompletePageTransition() to get called *after* WebProcess::prepareToSuspend()
370         has been called. From the logging during the test, I can tell that WebProcess::processDidResume() gets
371         called later on and the LayerTreeFreezeReason::ProcessSuspended freezing reason gets dropped, as expected.
372
373         * WebProcess/WebPage/WebPage.cpp:
374         (WebKit::WebPage::didCompletePageTransition):
375
376 2019-03-07  Chris Dumez  <cdumez@apple.com>
377
378         Clean up / simplify ProcessAssertion code
379         https://bugs.webkit.org/show_bug.cgi?id=195394
380
381         Reviewed by Geoffrey Garen.
382
383         Clean up / simplify ProcessAssertion code to facilitate its maintenance and make it
384         less error-prone.
385
386         * Platform/IPC/mac/ConnectionMac.mm:
387         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
388         * UIProcess/ProcessAssertion.cpp:
389         (WebKit::ProcessAssertion::ProcessAssertion):
390         (WebKit::ProcessAssertion::setState):
391         * UIProcess/ProcessAssertion.h:
392         (WebKit::ProcessAssertion::Client::~Client):
393         (WebKit::ProcessAssertion::setClient):
394         (WebKit::ProcessAssertion::client):
395         * UIProcess/ProcessThrottler.cpp:
396         (WebKit::ProcessThrottler::didConnectToProcess):
397         * UIProcess/ProcessThrottler.h:
398         * UIProcess/ios/ProcessAssertionIOS.mm:
399         (-[WKProcessAssertionBackgroundTaskManager dealloc]):
400         (-[WKProcessAssertionBackgroundTaskManager addAssertionNeedingBackgroundTask:]):
401         (-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]):
402         (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]):
403         (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
404         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
405         (WebKit::ProcessAssertion::ProcessAssertion):
406         (WebKit::ProcessAssertion::processAssertionWasInvalidated):
407         (WebKit::ProcessAssertion::setState):
408         (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
409         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
410         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
411         (WebKit::ProcessAndUIAssertion::processAssertionWasInvalidated):
412         (WebKit::ProcessAndUIAssertion::setState):
413         (WebKit::ProcessAndUIAssertion::uiAssertionWillExpireImminently):
414
415 2019-03-07  Commit Queue  <commit-queue@webkit.org>
416
417         Unreviewed, rolling out r242297.
418         https://bugs.webkit.org/show_bug.cgi?id=195430
419
420         Broke Microsoft Visio. (Requested by dydz on #webkit).
421
422         Reverted changeset:
423
424         "[iOS] Turn mouse event simulation on by default"
425         https://bugs.webkit.org/show_bug.cgi?id=195218
426         https://trac.webkit.org/changeset/242297
427
428 2019-03-07  John Wilander  <wilander@apple.com>
429
430         Resource Load Statistics: Log first-party navigations with link decoration
431         https://bugs.webkit.org/show_bug.cgi?id=195301
432         <rdar://problem/48569971>
433
434         Reviewed by Brent Fulgham.
435
436         This patch adds a call to the network process' resource load statistics to
437         log cross-site navigations with link decoration. The logging checks if the
438         source of the navigation is a prevalent resource and if so, sets the
439         appropriate flag for the destination.
440
441         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
442         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
443         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
444         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
445         (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
446         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
447         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
448         (WebKit::ResourceLoadStatisticsMemoryStore::logCrossSiteLoadWithLinkDecoration):
449         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
450         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
451         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
452         (WebKit::WebResourceLoadStatisticsStore::logCrossSiteLoadWithLinkDecoration):
453         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
454         * NetworkProcess/NetworkProcess.cpp:
455         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
456             This now receives a completion handler. This is in preparation for
457             test cases where we need to log such an event and wait for it to
458             finish before continuing.
459         * NetworkProcess/NetworkProcess.h:
460         * NetworkProcess/NetworkProcess.messages.in:
461         * UIProcess/Network/NetworkProcessProxy.cpp:
462         (WebKit::NetworkProcessProxy::committedCrossSiteLoadWithLinkDecoration):
463         * UIProcess/Network/NetworkProcessProxy.h:
464         * UIProcess/WebPageProxy.cpp:
465         (WebKit::WebPageProxy::didCommitLoadForFrame):
466         * UIProcess/WebProcessPool.cpp:
467         (WebKit::WebProcessPool::committedCrossSiteLoadWithLinkDecoration):
468         * UIProcess/WebProcessPool.h:
469
470 2019-03-07  Per Arne Vollan  <pvollan@apple.com>
471
472         [iOS] Disable permissive call logging in sandbox
473         https://bugs.webkit.org/show_bug.cgi?id=195288
474         <rdar://problem/47683804>
475
476         Reviewed by Brent Fulgham.
477
478         As on macOS, we should enable strict call filtering in sandbox on iOS.
479
480         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
481
482 2019-03-07  Youenn Fablet  <youenn@apple.com>
483
484         Introduce a quota manager for Cache API/Service Worker/IDB storage
485         https://bugs.webkit.org/show_bug.cgi?id=195283
486
487         Reviewed by Chris Dumez.
488
489         Remove quota handling from Cache API storage and use StorageQuotaManager/StorageQuotaUser.
490         CacheStorage::Caches becomes a quota user and has a StorageQuotaManager to check for space for any cache API write task.
491         NetworkProcess is responsible to manage the quota managers.
492         Quota managers will go through network process to ask UIProcess for quota extension.
493
494         Remove pending callback handling from CacheStorage since they are queued in QuotaManager now.
495
496         * NetworkProcess/NetworkProcess.cpp:
497         (WebKit::NetworkProcess::~NetworkProcess):
498         (WebKit::NetworkProcess::destroySession):
499         (WebKit::NetworkProcess::cacheStorageRootPath):
500         (WebKit::NetworkProcess::setCacheStorageParameters):
501         (WebKit::NetworkProcess::storageQuotaManager):
502         * NetworkProcess/NetworkProcess.h:
503         * NetworkProcess/cache/CacheStorageEngine.cpp:
504         (WebKit::CacheStorage::Engine::from):
505         (WebKit::CacheStorage::Engine::Engine):
506         (WebKit::CacheStorage::Engine::readCachesFromDisk):
507         * NetworkProcess/cache/CacheStorageEngine.h:
508         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
509         (WebKit::CacheStorage::Cache::put):
510         * NetworkProcess/cache/CacheStorageEngineCache.h:
511         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
512         (WebKit::CacheStorage::Caches::Caches):
513         (WebKit::CacheStorage::Caches::~Caches):
514         (WebKit::CacheStorage::Caches::requestSpace):
515         (WebKit::CacheStorage::Caches::writeRecord):
516         * NetworkProcess/cache/CacheStorageEngineCaches.h:
517
518 2019-03-07  John Wilander  <wilander@apple.com>
519
520         Resource Load Statistics: Make it possible to purge only script-accessible cookies
521         https://bugs.webkit.org/show_bug.cgi?id=195383
522         <rdar://problem/48570136>
523
524         Reviewed by Brent Fulgham.
525
526         This patch provides the ability to purge all script-accessible cookies while leaving
527         HttpOnly cookies in place.
528
529         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
530         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
531         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
532         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
533             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
534         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
535         * NetworkProcess/NetworkProcess.cpp:
536         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
537             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
538         (WebKit::NetworkProcess::deleteCookiesForTesting):
539             Test infrastructure.
540         * NetworkProcess/NetworkProcess.h:
541         * NetworkProcess/NetworkProcess.messages.in:
542         * NetworkProcess/NetworkSession.cpp:
543         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
544             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
545         * NetworkProcess/NetworkSession.h:
546         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
547         (WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
548             Test infrastructure.
549         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
550         * UIProcess/Network/NetworkProcessProxy.cpp:
551         (WebKit::NetworkProcessProxy::deleteCookiesForTesting):
552             Test infrastructure.
553         * UIProcess/Network/NetworkProcessProxy.h:
554         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
555         (WebKit::WebsiteDataStore::deleteCookiesForTesting):
556             Test infrastructure.
557         * UIProcess/WebsiteData/WebsiteDataStore.h:
558
559 2019-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
560
561         REGRESSION(r242364): [WPE] Do not stop the compositing run loop update timer on suspend
562         https://bugs.webkit.org/show_bug.cgi?id=195410
563
564         Reviewed by Žan Doberšek.
565
566         Calling CompositingRunLoop::stopUpdates() on suspend is leaving the threaded compositor in an inconsistent
567         state, failing to resume and stopping the updates forever. This is causing timeouts in WPE layout tests. Instead
568         of calling stopUpdates(), a new suspend() is called, that stops the update timer, without changing the current
569         updae tha compositing state. A new method resume() is also added to schedule an update if needed.
570
571         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
572         (WebKit::CompositingRunLoop::suspend): Set state as suspended and stop the update timer.
573         (WebKit::CompositingRunLoop::resume): Set state as not suspended and start the update timer if it was scheduled
574         while suspended.
575         (WebKit::CompositingRunLoop::scheduleUpdate): Do not start the update timer when suspended.
576         (WebKit::CompositingRunLoop::compositionCompleted): Ditto.
577         (WebKit::CompositingRunLoop::updateCompleted): Ditto.
578         (WebKit::CompositingRunLoop::updateTimerFired): Add an assert to ensure the update timer is not fired while suspended.
579         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
580         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
581         (WebKit::ThreadedCompositor::suspend): Call CompositingRunLoop::suspend() instead of stopUpdates().
582         (WebKit::ThreadedCompositor::resume): Call CompositingRunLoop::resume().
583
584 2019-03-06  Mark Lam  <mark.lam@apple.com>
585
586         Exception is a JSCell, not a JSObject.
587         https://bugs.webkit.org/show_bug.cgi?id=195392
588
589         Reviewed by Saam Barati.
590
591         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
592         (WebKit::JSNPObject::throwInvalidAccessError):
593         * WebProcess/Plugins/Netscape/JSNPObject.h:
594
595 2019-03-07  Commit Queue  <commit-queue@webkit.org>
596
597         Unreviewed, rolling out r242354.
598         https://bugs.webkit.org/show_bug.cgi?id=195402
599
600         breaks layout tests in all configurations (Requested by
601         zdobersek on #webkit).
602
603         Reverted changeset:
604
605         "[WPE] Enable web process sandbox"
606         https://bugs.webkit.org/show_bug.cgi?id=195169
607         https://trac.webkit.org/changeset/242354
608
609 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
610
611         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
612         https://bugs.webkit.org/show_bug.cgi?id=195346
613
614         Reviewed by Fujii Hironori.
615
616         * Platform/IPC/win/ConnectionWin.cpp:
617         (IPC::Connection::createServerAndClientIdentifiers):
618         * Platform/win/ModuleWin.cpp:
619         (WebKit::Module::load):
620         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
621         (WebKit::ProcessLauncher::launchProcess):
622         * UIProcess/win/WebContextMenuProxyWin.cpp:
623         (WebKit::createMenuItem):
624         * UIProcess/win/WebView.cpp:
625         (WebKit::WebView::setToolTip):
626         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
627         (WebKit::InjectedBundle::initialize):
628         Use wchar helpers as needed.
629
630 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
631
632         Crash when attempting to change input type while dismissing datalist suggestions
633         https://bugs.webkit.org/show_bug.cgi?id=195384
634         <rdar://problem/48563718>
635
636         Reviewed by Brent Fulgham.
637
638         See WebCore ChangeLog for more details.
639
640         * WebProcess/WebPage/WebPage.cpp:
641         (WebKit::WebPage::setActiveDataListSuggestionPicker):
642         (WebKit::WebPage::didSelectDataListOption):
643         (WebKit::WebPage::didCloseSuggestions):
644         * WebProcess/WebPage/WebPage.h:
645
646         Turn m_activeDataListSuggestionPicker from a raw pointer into a WeakPtr.
647
648 2019-03-06  Chris Dumez  <cdumez@apple.com>
649
650         [iOS] ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent
651         https://bugs.webkit.org/show_bug.cgi?id=195382
652         <rdar://problem/48642739>
653
654         Reviewed by Geoffrey Garen.
655
656         ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent. Previously,
657         we only send ProcessDidResume() to the WebProcess if PrepareToSuspend() was sent, not when the more urgent
658         ProcessWillSuspendImminently() IPC was sent.
659
660         This mismatch has lead to bugs because the WebProcess does not know it got resumed and failed to unfreeze the
661         layers it froze upon suspension.
662
663         * UIProcess/ProcessAssertion.h:
664         (WebKit::ProcessAssertionClient::~ProcessAssertionClient):
665
666         * UIProcess/ProcessThrottler.cpp:
667         (WebKit::ProcessThrottler::updateAssertion):
668         (WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
669         (WebKit::ProcessThrottler::assertionWillExpireImminently): Deleted.
670
671         * UIProcess/ProcessThrottler.h:
672         * UIProcess/ios/ProcessAssertionIOS.mm:
673         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
674         (WebKit::ProcessAssertion::~ProcessAssertion):
675         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
676         (WebKit::ProcessAndUIAssertion::setClient):
677
678         * WebProcess/WebPage/WebPage.cpp:
679         (WebKit::WebPage::didCompletePageTransition):
680         Revert change that was landed in r242098 to work around this ProcessThrottler bug.
681
682         * WebProcess/WebPage/ios/WebPageIOS.mm:
683         (WebKit::WebPage::applicationWillEnterForeground):
684         Revert change that was landed in r242554 to work around this ProcessThrottler bug.
685
686 2019-03-06  Alex Christensen  <achristensen@webkit.org>
687
688         Add gettid to allowed syscalls on Mac
689         https://bugs.webkit.org/show_bug.cgi?id=195386
690         <rdar://problem/48651255>
691
692         Reviewed by Brent Fulgham.
693
694         * WebProcess/com.apple.WebProcess.sb.in:
695
696 2019-03-06  Per Arne Vollan  <pvollan@apple.com>
697
698         [macOS] Sandbox call violation causes WebContent process to crash
699         https://bugs.webkit.org/show_bug.cgi?id=195379
700         <rdar://problem/48647263>
701
702         Reviewed by Brent Fulgham.
703
704         A new call needs to be added to the allow list in the WebContent process' sandbox.
705
706         * WebProcess/com.apple.WebProcess.sb.in:
707
708 2019-03-06  Antti Koivisto  <antti@apple.com>
709
710         [iOS] Basic hit testing for content overlapping fast-scrollable overflow
711         https://bugs.webkit.org/show_bug.cgi?id=195360
712
713         Reviewed by Simon Fraser.
714
715         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
716         (WebKit::RemoteLayerTreeHost::makeNode):
717
718         Use new UIView subclass for tiled layer hosting (so we know they have content even when contents property is nil).
719
720         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
721         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
722         (collectDescendantViewsAtPoint):
723
724         Factor collection step into a function.
725         Do basic skipping of event-transparent layers.
726
727         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
728
729         To handle overlap cases, find the scroll view that has the deepest non-transparent view hit as its descendant.
730
731         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]): Deleted.
732
733 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
734
735         Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
736         https://bugs.webkit.org/show_bug.cgi?id=195300
737
738         Reviewed by Simon Fraser.
739
740         Refactor some logic to use isTransparentOrFullyClippedRespectingParentFrames on RenderLayer rather than
741         RenderObject; introduce a helper method to ask whether the enclosing layer of a renderer is transparent or
742         clipped.
743
744         * WebProcess/WebPage/ios/WebPageIOS.mm:
745         (WebKit::enclosingLayerIsTransparentOrFullyClipped):
746         (WebKit::WebPage::platformEditorState const):
747         (WebKit::WebPage::requestEvasionRectsAboveSelection):
748         (WebKit::WebPage::getFocusedElementInformation):
749
750 2019-03-06  Chris Dumez  <cdumez@apple.com>
751
752         REGRESSION (r238490): YouTube.com: Returning PiP to Safari after sleeping device loses page
753         https://bugs.webkit.org/show_bug.cgi?id=195364
754         <rdar://problem/48538837>
755
756         Reviewed by Geoffrey Garen.
757
758         Make sure we unset the LayerTreeFreezeReason::ProcessSuspended layer tree freeze reason
759         when WebPage::applicationWillEnterForeground() is called. This restores pre-r238490
760         behavior and addresses the issue with PiP on youtube.com.
761
762         * WebProcess/WebPage/ios/WebPageIOS.mm:
763         (WebKit::WebPage::applicationWillEnterForeground):
764
765 2019-03-05  Dean Jackson  <dino@apple.com>
766
767         Fix WKPasswordView compilation on iOS
768         https://bugs.webkit.org/show_bug.cgi?id=195344
769         <rdar://problem/48620066>
770
771         Reviewed by Dan Bates.
772
773         Use WebKitAdditions.
774
775         * UIProcess/ios/WKPasswordView.mm:
776         (-[WKPasswordView showInScrollView:]):
777
778 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
779
780         [iOS] Frequent 1 second IPC deadlocks when showing a paste callout
781         https://bugs.webkit.org/show_bug.cgi?id=195354
782         <rdar://problem/48624675>
783
784         Reviewed by Tim Horton.
785
786         When triggering programmatic paste, we frequently hit deadlocks due to sync IPC going from the UI process to the
787         web process and vice versa. What happens in this scenario is that prior to triggering programmatic paste, the
788         page may try to move focus to a different element (e.g. a hidden editable area) before calling `execCommand`.
789         This causes us to send an ElementDidFocus message to the UI process, followed by RequestDOMPasteAccess.
790
791         However, upon receiving ElementDidFocus, we reload input views and (in the process) UIKit requests the
792         autocorrection context, which we implement in WebKit using a sync message to the web process due to
793         <rdar://problem/16207002> and its blocking bug <rdar://problem/48383001>. This means we'll end up in a state
794         where both the UI process and web process are blocked on each other waiting for a sync IPC response, and the UI
795         process is hung for a second until the IPC message times out.
796
797         Ideally, we should fix this by addressing <rdar://problem/16207002>. However, this requires potentially large
798         changes in UIKit (<rdar://problem/48383001>); for the time being, work around this deadlock by refactoring
799         synchronous autocorrection context requests such that they can be resolved by an out-of-band IPC response
800         (HandleAutocorrectionContext). Then prior to requesting DOM paste access, preemptively send a
801         HandleAutocorrectionContext message to the UI process to unblock any pending synchronous autocorrection context
802         requests.
803
804         * UIProcess/PageClient.h:
805         * UIProcess/WebPageProxy.h:
806         * UIProcess/WebPageProxy.messages.in:
807         * UIProcess/ios/PageClientImplIOS.h:
808         * UIProcess/ios/PageClientImplIOS.mm:
809         (WebKit::PageClientImpl::handleAutocorrectionContext):
810         * UIProcess/ios/WKContentViewInteraction.h:
811
812         Make it possible for WKContentView to remember its current pending autocorrection context completion handler.
813         This is invoked and cleared out in `-_invokePendingAutocorrectionContextHandler:`.
814
815         * UIProcess/ios/WKContentViewInteraction.mm:
816         (-[WKContentView _invokePendingAutocorrectionContextHandler:]):
817         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
818         (-[WKContentView _handleAutocorrectionContext:]):
819
820         Handle an autocorrection context response. This is invoked when the web process either handles an autocorrection
821         context message, or when it preemptively sends an autocorrection context before requesting DOM paste access.
822
823         (+[WKAutocorrectionContext emptyAutocorrectionContext]):
824
825         Add a helper to create an empty autocorrection context.
826
827         * UIProcess/ios/WebPageProxyIOS.mm:
828         (WebKit::WebPageProxy::requestAutocorrectionContext):
829         (WebKit::WebPageProxy::handleAutocorrectionContext):
830         (WebKit::WebPageProxy::autocorrectionContextSync): Deleted.
831
832         Removed this sync version, since we now only have requestAutocorrectionContext.
833
834         * WebProcess/WebPage/WebPage.cpp:
835         (WebKit::WebPage::requestDOMPasteAccess):
836
837         Send WebPageProxy::HandleAutocorrectionContext, and add a FIXME referencing <rdar://problem/16207002>.
838
839         * WebProcess/WebPage/WebPage.h:
840         * WebProcess/WebPage/WebPage.messages.in:
841
842         Split AutocorrectionContextSync into RequestAutocorrectionContext and HandleAutocorrectionContext; additionally,
843         remove the existing RequestAutocorrectionContext message.
844
845         * WebProcess/WebPage/ios/WebPageIOS.mm:
846         (WebKit::WebPage::requestAutocorrectionContext):
847         (WebKit::WebPage::autocorrectionContextSync): Deleted.
848
849 2019-03-06  Rob Buis  <rbuis@igalia.com>
850
851         Consider supporting the `referrerpolicy` attribute.
852         https://bugs.webkit.org/show_bug.cgi?id=179053
853
854         Reviewed by Darin Adler.
855
856         Add a runtime flag for referrerpolicy attribute.
857
858         * Shared/WebPreferences.yaml:
859         * UIProcess/API/C/WKPreferences.cpp:
860         (WKPreferencesSetReferrerPolicyAttributeEnabled):
861         (WKPreferencesGetReferrerPolicyAttributeEnabled):
862         * UIProcess/API/C/WKPreferencesRefPrivate.h:
863         * WebProcess/Network/WebLoaderStrategy.cpp:
864         (WebKit::WebLoaderStrategy::loadResource): do not hardcode choosing
865         the document referrer policy.
866
867 2019-03-06  Philippe Normand  <pnormand@igalia.com>
868
869         Unreviewed, WPE build fix after r242503
870
871         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
872         ServiceWorker messages moved from network process to another
873         header, so it needs to be included.
874
875 2019-03-05  David Quesada  <david_quesada@apple.com>
876
877         [WK2] It should be possible to follow links with 'download' attributes
878         https://bugs.webkit.org/show_bug.cgi?id=195145
879         rdar://problem/48462642
880
881         Reviewed by Alex Christensen.
882
883         When a link with a 'download' attribute is clicked and the navigation client
884         says to allow the navigation (i.e. provides PolicyAction::Use),
885         WebPageProxy::receivedNavigationPolicyDecision() should stop overriding this
886         decision and downloading the link instead. Instead, web view should honor the
887         policy chosen by the navigation delegate. This supports clients that want to
888         offer the user the ability to view, rather than download, the contents of
889         such links, which is permitted per the HTML spec.
890
891         This change is only made on Cocoa platforms for now since no other ports
892         expose an API on their navigation action to express whether the page intends
893         to download the linked resource.
894
895         * UIProcess/API/APINavigation.h:
896         (API::Navigation::shouldPerformDownload const):
897             Rename this to be in line with APINavigationAction's shouldPerformDownload()
898             for consistency. 'Force' seems like too strong of a word for this property
899             considering that 'forcing' the download isn't really an attribute inherent
900             to the navigation, but a behavior implemented by the web page proxy.
901         (API::Navigation::shouldForceDownload const): Deleted.
902         * UIProcess/Cocoa/VersionChecks.h:
903         * UIProcess/WebPageProxy.cpp:
904         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
905
906 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
907
908         [Curl] Implement Cookie Accept Policy.
909         https://bugs.webkit.org/show_bug.cgi?id=191645
910
911         Reviewed by Fujii Hironori.
912
913         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
914         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
915         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
916         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
917         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
918         (WebKit::NetworkDataTaskCurl::handleCookieHeaders):
919         * NetworkProcess/curl/NetworkDataTaskCurl.h:
920
921 2019-03-05  Youenn Fablet  <youenn@apple.com>
922
923         Introduce ServiceWorkerFetchTask
924         https://bugs.webkit.org/show_bug.cgi?id=195130
925
926         Reviewed by Chris Dumez.
927
928         ServiceWorkerFetchTask is added to represent NetworkProcess side of an ongoing fetch intercepted by service worker.
929         This patch should not change existing behavior.
930
931         * CMakeLists.txt:
932         * DerivedSources-input.xcfilelist:
933         * DerivedSources-output.xcfilelist:
934         * DerivedSources.make:
935         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
936         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
937         * NetworkProcess/NetworkProcess.cpp:
938         (WebKit::NetworkProcess::didFailFetch): Deleted.
939         (WebKit::NetworkProcess::didNotHandleFetch): Deleted.
940         (WebKit::NetworkProcess::didReceiveFetchRedirectResponse): Deleted.
941         (WebKit::NetworkProcess::didReceiveFetchResponse): Deleted.
942         (WebKit::NetworkProcess::didReceiveFetchData): Deleted.
943         (WebKit::NetworkProcess::didReceiveFetchFormData): Deleted.
944         (WebKit::NetworkProcess::didFinishFetch): Deleted.
945         * NetworkProcess/NetworkProcess.h:
946         * NetworkProcess/NetworkProcess.messages.in:
947         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
948         (WebKit::WebSWServerConnection::cancelFetch):
949         (WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
950         (WebKit::WebSWServerConnection::startFetch):
951         (WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse): Deleted.
952         (WebKit::WebSWServerConnection::didReceiveFetchResponse): Deleted.
953         (WebKit::WebSWServerConnection::didReceiveFetchData): Deleted.
954         (WebKit::WebSWServerConnection::didReceiveFetchFormData): Deleted.
955         (WebKit::WebSWServerConnection::didFinishFetch): Deleted.
956         (WebKit::WebSWServerConnection::didFailFetch): Deleted.
957         (WebKit::WebSWServerConnection::didNotHandleFetch): Deleted.
958         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
959         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
960         (WebKit::WebSWServerToContextConnection::connectionClosed):
961         (WebKit::WebSWServerToContextConnection::startFetch):
962         (WebKit::WebSWServerToContextConnection::cancelFetch):
963         (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
964         (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
965         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
966         * SourcesCocoa.txt:
967         * WebKit.xcodeproj/project.pbxproj:
968         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
969         (WebKit::WebSWContextManagerConnection::startFetch):
970         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
971         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
972         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
973         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
974         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
975         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
976         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
977         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
978         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
979         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: Added.
980         (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
981         (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
982         (WebKit::ServiceWorkerFetchTask::didReceiveData):
983         (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
984         (WebKit::ServiceWorkerFetchTask::didFinish):
985         (WebKit::ServiceWorkerFetchTask::didFail):
986         (WebKit::ServiceWorkerFetchTask::didNotHandle):
987         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: Added.
988         (WebKit::ServiceWorkerFetchTask::create):
989         (WebKit::ServiceWorkerFetchTask::Identifier::hash const):
990         (WebKit::ServiceWorkerFetchTask::identifier const):
991         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
992         (WebKit::operator==):
993         (WTF::ServiceWorkerFetchTaskIdentifierHash::hash):
994         (WTF::ServiceWorkerFetchTaskIdentifierHash::equal):
995         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::emptyValue):
996         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::constructDeletedValue):
997         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::isDeletedValue):
998         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: Added.
999
1000 2019-03-05  Youenn Fablet  <youenn@apple.com>
1001
1002         Rename requestCacheStorageSpace to requestStorageSpace
1003         https://bugs.webkit.org/show_bug.cgi?id=195282
1004
1005         Reviewed by Chris Dumez.
1006
1007         Make the name more abstract as it might be used in the future for other storage
1008         like IDB or service worker registrations.
1009
1010         * NetworkProcess/NetworkProcess.cpp:
1011         (WebKit::NetworkProcess::requestStorageSpace):
1012         (WebKit::NetworkProcess::requestCacheStorageSpace): Deleted.
1013         * NetworkProcess/NetworkProcess.h:
1014         * NetworkProcess/cache/CacheStorageEngine.cpp:
1015         (WebKit::CacheStorage::Engine::requestSpace):
1016         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1017         (WebsiteDataStoreClient::WebsiteDataStoreClient):
1018         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
1019         * UIProcess/Network/NetworkProcessProxy.cpp:
1020         (WebKit::NetworkProcessProxy::requestStorageSpace):
1021         (WebKit::NetworkProcessProxy::requestCacheStorageSpace): Deleted.
1022         * UIProcess/Network/NetworkProcessProxy.h:
1023         * UIProcess/Network/NetworkProcessProxy.messages.in:
1024         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
1025         (WebKit::WebsiteDataStoreClient::requestStorageSpace):
1026         (WebKit::WebsiteDataStoreClient::requestCacheStorageSpace): Deleted.
1027
1028 2019-03-05  Chris Dumez  <cdumez@apple.com>
1029
1030         Drop cached WebProcesses for a given session when this session is destroyed
1031         https://bugs.webkit.org/show_bug.cgi?id=195212
1032         <rdar://problem/48301483>
1033
1034         Reviewed by Geoffrey Garen.
1035
1036         Drop cached WebProcesses for a give session when this session is destroyed. This way, when you close
1037         your private browsing window, all the processes it used get cleared and it cannot leave any state
1038         behind.
1039
1040         * UIProcess/WebProcessCache.cpp:
1041         (WebKit::WebProcessCache::canCacheProcess const):
1042         (WebKit::WebProcessCache::addProcessIfPossible):
1043         (WebKit::WebProcessCache::addProcess):
1044         (WebKit::WebProcessCache::clearAllProcessesForSession):
1045         * UIProcess/WebProcessCache.h:
1046         (WebKit::WebProcessCache::capacity const):
1047         * UIProcess/WebProcessPool.cpp:
1048         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
1049         (WebKit::WebProcessPool::hasPagesUsingWebsiteDataStore const):
1050         * UIProcess/WebProcessPool.h:
1051
1052 2019-03-05  Brady Eidson  <beidson@apple.com>
1053
1054         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
1055         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
1056
1057         Reviewed by Tim Horton.
1058
1059         * WebProcess/WebPage/WebPage.cpp:
1060         (WebKit::WebPage::SandboxExtensionTracker::shouldReuseCommittedSandboxExtension): If there is a pendingProvisionalSandboxExtension
1061           then its existence should override our willingness to reuse the existing committed extension.
1062         (WebKit::shouldReuseCommittedSandboxExtension): Deleted.
1063         * WebProcess/WebPage/WebPage.h:
1064
1065 2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
1066
1067         Unreviewed, rolling out r242403.
1068
1069         Caused layout test crashes on iOS simulator.
1070
1071         Reverted changeset:
1072
1073         "[ContentChangeObserver] Introduce fixed duration content
1074         observation"
1075         https://bugs.webkit.org/show_bug.cgi?id=195295
1076         https://trac.webkit.org/changeset/242403
1077
1078 2019-03-05  Loïc Yhuel  <loic.yhuel@softathome.com>
1079
1080         [WPE] Do not create a PlatformDisplay in the Service Worker process
1081         https://bugs.webkit.org/show_bug.cgi?id=194830
1082
1083         Reviewed by Žan Doberšek.
1084
1085         It avoids opening the Wayland socket in this WPEWebProcess, which might cause issues
1086         depending on the platform, and allocates unneeded resources.
1087
1088         * Shared/WebProcessCreationParameters.cpp:
1089         (WebKit::WebProcessCreationParameters::encode const):
1090         (WebKit::WebProcessCreationParameters::decode):
1091         * Shared/WebProcessCreationParameters.h: Add new isServiceWorkerProcess parameter.
1092         * UIProcess/WebProcessPool.cpp:
1093         (WebKit::WebProcessPool::initializeNewWebProcess): Set isServiceWorkerProcess parameter.
1094         * UIProcess/glib/WebProcessPoolGLib.cpp:
1095         (WebKit::WebProcessPool::platformInitializeWebProcess): No implementationLibraryName and hostClientFileDescriptor for Service Worker.
1096         * WebProcess/glib/WebProcessGLib.cpp:
1097         (WebKit::WebProcess::platformInitializeWebProcess): No wpe_loader_init nor PlatformDisplayLibWPE for Service Worker.
1098
1099 2019-03-04  Brady Eidson  <beidson@apple.com>
1100
1101         Unreviewed, rolling out r242376.
1102
1103         Broke some tests
1104
1105         Reverted changeset:
1106
1107         "Correctly handle sandbox extensions when the same WKWebView
1108         loads multiple file:// URLs."
1109         https://bugs.webkit.org/show_bug.cgi?id=195291
1110         https://trac.webkit.org/changeset/242376
1111
1112 2019-03-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1113
1114         Use a SQLite database to hold the ResourceLoadStatistics data
1115         https://bugs.webkit.org/show_bug.cgi?id=194867
1116         <rdar://problem/24240854>
1117
1118         Unreviewed build fix for WinCairo.
1119
1120         ResourceLoadStatisticsDebug and RELEASE_LOG_INFO_IF are not
1121         defined because WinCairo port defines RELEASE_LOG_DISABLED.
1122
1123         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1124         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): Enclosed RELEASE_LOG_INFO_IF with #if !RELEASE_LOG_DISABLED.
1125         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Ditto.
1126         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): Ditto.
1127
1128 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
1129
1130         Use a SQLite database to hold the ResourceLoadStatistics data
1131         https://bugs.webkit.org/show_bug.cgi?id=194867
1132         <rdar://problem/24240854>
1133
1134         Reviewed by Chris Dumez.
1135
1136         The ResourceLoadStatistics database plist is inefficient. It requires more memory use
1137         than it needs, and forces lots of looping and string comparisons to find information.
1138
1139         This problem has already been solved in the form of relational databases. We use them
1140         elsewhere in WebKit, and should do so for this storage as well.
1141
1142         This patch creates an optional SQLite database to handle ITP operations.
1143
1144         1. It adds a new internal experimental feature flag to activate it. It requires the user
1145            exit and restart the process to take effect.
1146         2. It populates itself from the existing plist file (if it exists).
1147         3. It stops using the plist in favor of the database.
1148         4. It does queries and other operations using the database instead of the old hash table
1149            implementation.
1150
1151         This patch refactors the exisiting ResourceLoadStatisticsMemoryStore class into a base
1152         ResourceLoadStatisticsStore class, which ResourceLoadStatisticsMemoryStore is based on.
1153         It adds a new ResourceLoadStatisticsDatabaseStore that is implemented in terms of SQL
1154         operations.
1155
1156         These code changes should not have any impact on existing operations, and when enabled
1157         should produce the same test results.
1158
1159         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: Added.
1160         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
1161         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
1162         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
1163         (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
1164         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
1165         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationship):
1166         (WebKit::ResourceLoadStatisticsDatabaseStore::confirmDomainDoesNotExist const):
1167         (WebKit::ResourceLoadStatisticsDatabaseStore::domainIDFromString const):
1168         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
1169         (WebKit::ResourceLoadStatisticsDatabaseStore::databaseIsEmpty const):
1170         (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
1171         (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
1172         (WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains):
1173         (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
1174         (WebKit::buildList):
1175         (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent):
1176         (WebKit::listToString):
1177         (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
1178         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
1179         (WebKit::ResourceLoadStatisticsDatabaseStore::classifyPrevalentResources):
1180         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageIfNeeded):
1181         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageImmediately):
1182         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
1183         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
1184         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
1185         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
1186         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
1187         (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
1188         (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
1189         (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
1190         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceLoading):
1191         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
1192         (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
1193         (WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
1194         (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
1195         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
1196         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
1197         (WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent):
1198         (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const):
1199         (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
1200         (WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
1201         (WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
1202         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubresourceUnder const):
1203         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubFrameUnder const):
1204         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsRedirectingTo const):
1205         (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
1206         (WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
1207         (WebKit::ResourceLoadStatisticsDatabaseStore::isGrandfathered const):
1208         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameOrigin):
1209         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameOrigin):
1210         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
1211         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
1212         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
1213         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
1214         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForPrimaryDomain):
1215         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):
1216         (WebKit::ResourceLoadStatisticsDatabaseStore::cookieTreatmentForOrigin const):
1217         (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
1218         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const):
1219         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
1220         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlockingForDomains):
1221         (WebKit::ResourceLoadStatisticsDatabaseStore::clearBlockingStateForDomains):
1222         (WebKit::ResourceLoadStatisticsDatabaseStore::processStatistics const):
1223         (WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains const):
1224         (WebKit::ResourceLoadStatisticsDatabaseStore::findExpiredUserInteractions const):
1225         (WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredUserInteractions):
1226         (WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering):
1227         (WebKit::ResourceLoadStatisticsDatabaseStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1228         (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
1229         (WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen):
1230         (WebKit::ResourceLoadStatisticsDatabaseStore::setLastSeen):
1231         (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
1232         (WebKit::ResourceLoadStatisticsDatabaseStore::removeAllStorageAccess):
1233         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: Added.
1234         (WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const):
1235         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1236         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
1237         (WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
1238         (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
1239         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
1240         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
1241         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
1242         (WebKit::domainsToString): Deleted.
1243         (WebKit::OperatingDate::fromWallTime): Deleted.
1244         (WebKit::OperatingDate::today): Deleted.
1245         (WebKit::OperatingDate::secondsSinceEpoch const): Deleted.
1246         (WebKit::OperatingDate::operator== const): Deleted.
1247         (WebKit::OperatingDate::operator< const): Deleted.
1248         (WebKit::OperatingDate::operator<= const): Deleted.
1249         (WebKit::OperatingDate::OperatingDate): Deleted.
1250         (WebKit::mergeOperatingDates): Deleted.
1251         (WebKit::computeImportance): Deleted.
1252         (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore): Deleted.
1253         (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned): Deleted.
1254         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval): Deleted.
1255         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry): Deleted.
1256         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords): Deleted.
1257         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords): Deleted.
1258         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData): Deleted.
1259         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode): Deleted.
1260         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode): Deleted.
1261         (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary): Deleted.
1262         (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest): Deleted.
1263         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction): Deleted.
1264         (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval): Deleted.
1265         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime): Deleted.
1266         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap): Deleted.
1267         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap): Deleted.
1268         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies): Deleted.
1269         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap): Deleted.
1270         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const): Deleted.
1271         (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved): Deleted.
1272         (WebKit::debugLogDomainsInBatches): Deleted.
1273         (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary): Deleted.
1274         (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const): Deleted.
1275         (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries): Deleted.
1276         (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo): Deleted.
1277         (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues): Deleted.
1278         (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent): Deleted.
1279         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess): Deleted.
1280         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1281         (WebKit::ResourceLoadStatisticsMemoryStore::data const):
1282         (WebKit::ResourceLoadStatisticsMemoryStore::isDebugModeEnabled const): Deleted.
1283         (WebKit::ResourceLoadStatisticsMemoryStore::store const): Deleted.
1284         (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled): Deleted.
1285         (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled): Deleted.
1286         (): Deleted.
1287         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Added.
1288         (WebKit::domainsToString):
1289         (WebKit::OperatingDate::fromWallTime):
1290         (WebKit::OperatingDate::today):
1291         (WebKit::OperatingDate::secondsSinceEpoch const):
1292         (WebKit::OperatingDate::operator== const):
1293         (WebKit::OperatingDate::operator< const):
1294         (WebKit::OperatingDate::operator<= const):
1295         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
1296         (WebKit::ResourceLoadStatisticsStore::~ResourceLoadStatisticsStore):
1297         (WebKit::ResourceLoadStatisticsStore::calculateAndSubmitTelemetry const):
1298         (WebKit::ResourceLoadStatisticsStore::computeImportance):
1299         (WebKit::ResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
1300         (WebKit::ResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1301         (WebKit::ResourceLoadStatisticsStore::setShouldSubmitTelemetry):
1302         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
1303         (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1304         (WebKit::ResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1305         (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
1306         (WebKit::ResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1307         (WebKit::ResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
1308         (WebKit::ResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
1309         (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1310         (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
1311         (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
1312         (WebKit::ResourceLoadStatisticsStore::setCacheMaxAgeCap):
1313         (WebKit::ResourceLoadStatisticsStore::updateCacheMaxAgeCap):
1314         (WebKit::ResourceLoadStatisticsStore::setAgeCapForClientSideCookies):
1315         (WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
1316         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
1317         (WebKit::ResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
1318         (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
1319         (WebKit::ResourceLoadStatisticsStore::clearBlockingStateForDomains):
1320         (WebKit::ResourceLoadStatisticsStore::processStatistics const):
1321         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
1322         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
1323         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
1324         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
1325         (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
1326         (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
1327         (WebKit::ResourceLoadStatisticsStore::resetParametersToDefaultValues):
1328         (WebKit::ResourceLoadStatisticsStore::logTestingEvent):
1329         (WebKit::ResourceLoadStatisticsStore::removeAllStorageAccess):
1330         (WebKit::ResourceLoadStatisticsStore::didCreateNetworkProcess):
1331         (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
1332         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: Copied from Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h.
1333         (WebKit::OperatingDate::OperatingDate):
1334         (WebKit::ResourceLoadStatisticsStore::isEmpty const):
1335         (WebKit::ResourceLoadStatisticsStore::data const):
1336         (WebKit::ResourceLoadStatisticsStore::isDebugModeEnabled const):
1337         (WebKit::ResourceLoadStatisticsStore::store const):
1338         (WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled):
1339         (WebKit::ResourceLoadStatisticsStore::setDebugLogggingEnabled):
1340         * NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm.
1341         (WebKit::ResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1342         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1343         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
1344         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1345         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
1346         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1347         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
1348         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
1349         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1350         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
1351         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1352         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1353         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
1354         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
1355         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1356         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
1357         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
1358         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
1359         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
1360         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1361         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1362         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1363         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1364         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1365         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1366         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1367         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1368         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
1369         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
1370         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
1371         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1372         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1373         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1374         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1375         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1376         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1377         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
1378         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
1379         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
1380         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
1381         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
1382         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
1383         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1384         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1385         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
1386         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
1387         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
1388         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
1389         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
1390         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1391         * NetworkProcess/NetworkProcess.cpp:
1392         (WebKit::NetworkProcess::initializeNetworkProcess):
1393         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1394         (WebKit::NetworkProcessCreationParameters::encode const):
1395         (WebKit::NetworkProcessCreationParameters::decode):
1396         * NetworkProcess/NetworkProcessCreationParameters.h:
1397         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1398         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1399         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
1400         * Shared/WebPreferences.yaml:
1401         * Sources.txt:
1402         * SourcesCocoa.txt:
1403         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1404         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1405         * UIProcess/WebProcessPool.cpp:
1406         * WebKit.xcodeproj/project.pbxproj:
1407
1408 2019-03-04  Zalan Bujtas  <zalan@apple.com>
1409
1410         [ContentChangeObserver] Introduce fixed duration content observation
1411         https://bugs.webkit.org/show_bug.cgi?id=195295
1412         <rdar://problem/48579913>
1413
1414         Reviewed by Simon Fraser.
1415
1416         * WebProcess/WebPage/ios/WebPageIOS.mm:
1417         (WebKit::WebPage::handleSyntheticClick):
1418
1419 2019-03-04  Truitt Savell  <tsavell@apple.com>
1420
1421         Unreviewed, rolling out r242396.
1422
1423         Found issue to be unrelated. reverting my rollout.
1424
1425         Reverted changeset:
1426
1427         "Unreviewed, rolling out r242222."
1428         https://bugs.webkit.org/show_bug.cgi?id=193683
1429         https://trac.webkit.org/changeset/242396
1430
1431 2019-03-04  Jiewen Tan  <jiewen_tan@apple.com>
1432
1433         Unreviewed, a followup after r242336
1434
1435         * UIProcess/WebPageProxy.cpp:
1436         (WebKit::WebPageProxy::webViewDidMoveToWindow):
1437         Copy the list of observers before iterating it to avoid observers modifying the list.
1438
1439 2019-03-04  Truitt Savell  <tsavell@apple.com>
1440
1441         Unreviewed, rolling out r242222.
1442
1443         Broke internal debug testing
1444
1445         Reverted changeset:
1446
1447         "[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to
1448         the UI process."
1449         https://bugs.webkit.org/show_bug.cgi?id=193683
1450         https://trac.webkit.org/changeset/242222
1451
1452 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
1453
1454         Unreviewed build fix after r242378
1455
1456         * UIProcess/ios/EditableImageController.mm:
1457         (WebKit::EditableImageController::associateWithAttachment):
1458
1459 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
1460
1461         Check contextIDs when handling WebContent messages
1462         https://bugs.webkit.org/show_bug.cgi?id=195289
1463         <rdar://problem/48475870>
1464
1465         Reviewed by Alex Christensen.
1466
1467         The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
1468         We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
1469
1470         This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
1471
1472         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1473         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
1474         (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
1475         (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
1476         (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
1477         (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
1478         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
1479         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
1480         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
1481         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
1482         (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
1483         (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
1484         (WebKit::PlaybackSessionManagerProxy::mutedChanged):
1485         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
1486         (WebKit::PlaybackSessionManagerProxy::durationChanged):
1487         (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
1488         (WebKit::PlaybackSessionManagerProxy::rateChanged):
1489         (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
1490         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
1491         (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
1492         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1493         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1494         (WebKit::UserMediaCaptureManagerProxy::startProducingData):
1495         (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
1496         (WebKit::UserMediaCaptureManagerProxy::end):
1497         (WebKit::UserMediaCaptureManagerProxy::capabilities):
1498         (WebKit::UserMediaCaptureManagerProxy::setMuted):
1499         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
1500         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1501         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
1502         (WebKit::VideoFullscreenManagerProxy::setHasVideo):
1503         (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
1504         (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
1505         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
1506         (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
1507         (WebKit::VideoFullscreenManagerProxy::setInlineRect):
1508         (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
1509         (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
1510         (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
1511         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
1512         * UIProcess/ios/EditableImageController.mm:
1513         (WebKit::EditableImageController::didCreateEditableImage):
1514         (WebKit::EditableImageController::didDestroyEditableImage):
1515         (WebKit::EditableImageController::associateWithAttachment):
1516
1517 2019-03-04  Alex Christensen  <achristensen@webkit.org>
1518
1519         Fix crashes when NetworkResourceLoader/NetworkLoadChecker are destroyed during HTTPS upgrade check
1520         https://bugs.webkit.org/show_bug.cgi?id=195238
1521         <rdar://problem/47598656>
1522
1523         Reviewed by Chris Dumez.
1524
1525         * NetworkProcess/NetworkLoadChecker.cpp:
1526         (WebKit::NetworkLoadChecker::checkRequest):
1527
1528 2019-03-04  Brady Eidson  <beidson@apple.com>
1529
1530         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
1531         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
1532
1533         Reviewed by Andy Estes.
1534
1535         * WebProcess/WebPage/WebPage.cpp:
1536         (WebKit::shouldReuseCommittedSandboxExtension): Only retain the previous sandbox extension if the file URL
1537           we're currently loading is functionally equivalent to the previous one.
1538
1539 2019-03-04  Chris Dumez  <cdumez@apple.com>
1540
1541         Drop legacy userAgentForURL injected bundle SPI
1542         https://bugs.webkit.org/show_bug.cgi?id=195222
1543         <rdar://problem/46734147>
1544
1545         Reviewed by Darin Adler.
1546
1547         Drop legacy userAgentForURL injected bundle SPI. There are no longer any clients, and using
1548         WebsitePolicies.customUserAgent is the way to go nowadays.
1549
1550         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1551         (API::InjectedBundle::PageLoaderClient::willDestroyFrame):
1552         (API::InjectedBundle::PageLoaderClient::userAgentForURL const): Deleted.
1553         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
1554         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
1555         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1556         (setUpPageLoaderClient):
1557         (userAgentForURL): Deleted.
1558         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1559         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL const): Deleted.
1560         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1561         * WebProcess/WebPage/WebPage.cpp:
1562         (WebKit::WebPage::userAgent const):
1563
1564 2019-03-04  Chris Dumez  <cdumez@apple.com>
1565
1566         Do not share WebProcesses between private and regular sessions
1567         https://bugs.webkit.org/show_bug.cgi?id=195189
1568         <rdar://problem/48421064>
1569
1570         Reviewed by Alex Christensen.
1571
1572         Do not share WebProcesses between private and regular sessions. There are some privacy concerns.
1573         Also, some of the WebsiteDataStore informations are passed via WebProcessCreationParameters (e.g.
1574         ApplicationCache path) and cannot be updated later.
1575
1576         There were 2 cases where this could happen and that are fixed in the patch:
1577         - A process may be prewarmed with a given website data store and then later on used for a page
1578           associated with a different data store. We now prevent this. While this is not necessary for
1579           privacy reasons, it is still useful because our code currently does not support well uses
1580           different sessions inside a single WebProcess, as mentioned above.
1581         - The client can force a WebsiteDataStore swap when responding to the decidePolicyForNavigationAction,
1582           via the WebsitePolicies. To address the issue, we now force a process swap whenever the client
1583           makes such a change.
1584
1585         As a result, WebProcessProxy::websiteDataStore() now makes sense and is always correct. It can
1586         also only contains pages whose WebPageProxy::websiteDataStore() returns the same store.
1587
1588         * UIProcess/API/C/WKContext.cpp:
1589         (WKContextWarmInitialProcess):
1590         * UIProcess/API/Cocoa/WKProcessPool.mm:
1591         (-[WKProcessPool _warmInitialProcess]):
1592         * UIProcess/ProvisionalPageProxy.cpp:
1593         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1594         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
1595         * UIProcess/WebPageProxy.cpp:
1596         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
1597         (WebKit::WebPageProxy::reattachToWebProcess):
1598         (WebKit::WebPageProxy::swapToWebProcess):
1599         (WebKit::WebPageProxy::close):
1600         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1601         (WebKit::WebPageProxy::commitProvisionalPage):
1602         (WebKit::WebPageProxy::creationParameters):
1603         * UIProcess/WebPageProxy.h:
1604         (WebKit::WebPageProxy::websiteDataStore):
1605         * UIProcess/WebProcessPool.cpp:
1606         (WebKit::WebProcessPool::ensureNetworkProcess):
1607         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
1608         (WebKit::WebProcessPool::prewarmProcess):
1609         (WebKit::WebProcessPool::createWebPage):
1610         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1611         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
1612         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
1613         (WebKit::WebProcessPool::processForNavigation):
1614         (WebKit::WebProcessPool::processForNavigationInternal):
1615         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
1616         * UIProcess/WebProcessPool.h:
1617         (WebKit::WebProcessPool::sendToOneProcess):
1618         * UIProcess/WebProcessProxy.cpp:
1619         (WebKit::WebProcessProxy::createWebPage):
1620         (WebKit::WebProcessProxy::addExistingWebPage):
1621         (WebKit::WebProcessProxy::removeWebPage):
1622         * UIProcess/WebProcessProxy.h:
1623
1624 2019-03-04  Chris Dumez  <cdumez@apple.com>
1625
1626         [iOS] Improve our file picker
1627         https://bugs.webkit.org/show_bug.cgi?id=195284
1628         <rdar://problem/45655856>
1629
1630         Reviewed by Tim Horton and Wenson Hsieh.
1631
1632         Improve our file picker on iOS so that:
1633         - Accepted file extensions specified in the HTML (e.g. <input type="file"> accept=".pdf">) are now
1634           properly reflected in the file picker. Previously, we only we only supported MIME types in the
1635           accept attribute that only Image / Video ones.
1636         - If accepted types are specified in the HTML and not of them are Video or Image types, then bypass
1637           the UIDocumentMenuViewController and show the file picker directly (as if the user had tapped on
1638           "Browse..." on that menu). Other menu items such as "Take Photo or Video" and "Photo Library" do
1639           not make sense if the page only accepts PDF files for example.
1640
1641         Things that we should do but are not fixed in this patch:
1642         - Stop using UIDocumentMenuViewController entirely since it was deprecated in favor of using
1643           UIDocumentPickerViewController directly.
1644         - Add multiple selection support, which is supported both on the HTML side and in the
1645           UIDocumentPickerViewController API.
1646
1647         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1648         (arrayContainsUTIThatConformsTo):
1649         (-[WKFileUploadPanel dealloc]):
1650         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
1651         (UTIsForMIMETypes):
1652         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
1653         (-[WKFileUploadPanel _cameraButtonLabelAllowingPhoto:allowingVideo:]):
1654         (-[WKFileUploadPanel _showDocumentPickerMenu]):
1655
1656 2019-03-04  Alex Christensen  <achristensen@webkit.org>
1657
1658         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
1659         https://bugs.webkit.org/show_bug.cgi?id=194523
1660
1661         Reviewed by Ryosuke Niwa.
1662
1663         Attempt to work around a CFNetwork bug in the timing of tearing down tasks with upload streams.
1664         See rdar://problem/28233746.
1665
1666         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1667         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1668         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
1669         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1670         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
1671
1672 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1673
1674         [CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
1675         https://bugs.webkit.org/show_bug.cgi?id=195270
1676
1677         Reviewed by Don Olmstead.
1678
1679         Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
1680         painting is resumed and layer flush enabled.
1681
1682         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1683         (WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
1684         (WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
1685         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1686         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1687         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
1688         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
1689         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1690         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
1691         (WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
1692         (WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().
1693
1694 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
1695
1696         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
1697         https://bugs.webkit.org/show_bug.cgi?id=195258
1698
1699         Reviewed by Antti Koivisto.
1700
1701         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
1702         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
1703         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
1704         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
1705
1706         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
1707         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
1708         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
1709         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
1710         references to GraphicsLayers before that becomes safe).
1711         
1712         The actual fix that allows overflow scrollbars to show is the change in
1713         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
1714         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
1715
1716         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1717         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
1718         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1719         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
1720         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1721         * SourcesCocoa.txt:
1722         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1723         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1724         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1725         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
1726         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
1727         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
1728         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
1729         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
1730         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: Copied from Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
1731         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::create):
1732         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
1733         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::~ScrollingTreeOverflowScrollingNodeRemoteMac):
1734         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):
1735         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::repositionRelatedLayers):
1736         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent):
1737         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleMouseEvent):
1738         * WebKit.xcodeproj/project.pbxproj:
1739
1740 2019-03-04  Andy Estes  <aestes@apple.com>
1741
1742         [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
1743         https://bugs.webkit.org/show_bug.cgi?id=195080
1744         <rdar://problem/48421558>
1745
1746         Reviewed by Antti Koivisto.
1747
1748         * CMakeLists.txt:
1749         * DerivedSources-input.xcfilelist:
1750         * DerivedSources.make:
1751         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
1752         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
1753         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
1754         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
1755         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
1756         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
1757         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
1758         * Shared/mac/WebHitTestResultData.mm:
1759         * SourcesCocoa.txt:
1760         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
1761         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
1762         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
1763         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
1764         * WebKit.xcodeproj/project.pbxproj:
1765
1766 2019-03-04  Jer Noble  <jer.noble@apple.com>
1767
1768         [iOS] Fullscreen "stay in page" option breaks video playback
1769         https://bugs.webkit.org/show_bug.cgi?id=195277
1770         <rdar://problem/48537317>
1771
1772         Reviewed by Eric Carlson.
1773
1774         Make sure we resume media playback when the user chooses "stay in page" from the deceptive
1775         website warning dialog.
1776
1777         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1778         (-[WKFullScreenViewController _showPhishingAlert]):
1779
1780 2019-03-04  Michael Catanzaro  <mcatanzaro@igalia.com>
1781
1782         [WPE] Enable web process sandbox
1783         https://bugs.webkit.org/show_bug.cgi?id=195169
1784
1785         Reviewed by Daniel Bates.
1786
1787         * PlatformWPE.cmake:
1788         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1789         (WebKit::bubblewrapSpawn):
1790         * UIProcess/glib/WebProcessPoolGLib.cpp:
1791         (WebKit::WebProcessPool::platformInitialize):
1792
1793 2019-03-04  Adrian Perez de Castro  <aperez@igalia.com>
1794
1795         [GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
1796         https://bugs.webkit.org/show_bug.cgi?id=195245
1797
1798         Reviewed by Carlos Garcia Campos.
1799
1800         Changed license headers to contain the LGPL, which is the correct one for the GTK
1801         and WPE ports. The change was agreed by the contributors to the files involved.
1802
1803         * UIProcess/API/gtk/WebKitAutocleanups.h:
1804         * UIProcess/API/wpe/WebKitAutocleanups.h:
1805         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
1806         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:
1807
1808 2019-03-04  Commit Queue  <commit-queue@webkit.org>
1809
1810         Unreviewed, rolling out r242045.
1811         https://bugs.webkit.org/show_bug.cgi?id=195273
1812
1813         WE not ready to enable PSON yet (Requested by KaL on #webkit).
1814
1815         Reverted changeset:
1816
1817         "[GTK] Enable PSON"
1818         https://bugs.webkit.org/show_bug.cgi?id=194979
1819         https://trac.webkit.org/changeset/242045
1820
1821 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1822
1823         [CoordinatedGraphics] Unify DrawingArea classes
1824         https://bugs.webkit.org/show_bug.cgi?id=195167
1825
1826         Reviewed by Žan Doberšek.
1827
1828         Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
1829
1830         * PlatformGTK.cmake:
1831         * PlatformWPE.cmake:
1832         * PlatformWin.cmake:
1833         * Shared/DrawingAreaInfo.h:
1834         * SourcesGTK.txt:
1835         * SourcesWPE.txt:
1836         * UIProcess/API/gtk/PageClientImpl.cpp:
1837         (WebKit::PageClientImpl::createDrawingAreaProxy):
1838         (WebKit::PageClientImpl::viewSize):
1839         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1840         (webkitWebViewBaseRealize):
1841         (webkitWebViewBaseUnrealize):
1842         (webkitWebViewBaseDraw):
1843         (webkitWebViewBaseSizeAllocate):
1844         (webkitWebViewBaseDidRelaunchWebProcess):
1845         (webkitWebViewBasePageClosed):
1846         * UIProcess/API/wpe/PageClientImpl.cpp:
1847         (WebKit::PageClientImpl::createDrawingAreaProxy):
1848         * UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
1849         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
1850         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
1851         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
1852         (WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
1853         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
1854         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
1855         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
1856         (WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
1857         (WebKit::DrawingAreaProxyCoordinatedGraphics::update):
1858         (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
1859         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
1860         (WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
1861         (WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
1862         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
1863         (WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
1864         (WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
1865         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
1866         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
1867         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
1868         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
1869         (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
1870         (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
1871         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
1872         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
1873         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
1874         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
1875         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
1876         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
1877         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
1878         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
1879         * UIProcess/DrawingAreaProxyImpl.cpp: Removed.
1880         * UIProcess/DrawingAreaProxyImpl.h: Removed.
1881         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
1882         (WebKit::AcceleratedBackingStoreX11::update):
1883         * UIProcess/win/PageClientImpl.cpp:
1884         (WebKit::PageClientImpl::createDrawingAreaProxy):
1885         * UIProcess/win/WebView.cpp:
1886         (WebKit::WebView::paint):
1887         * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
1888         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
1889         (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
1890         (WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
1891         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
1892         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
1893         (WebKit::DrawingAreaCoordinatedGraphics::scroll):
1894         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
1895         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
1896         (WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
1897         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
1898         (WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
1899         (WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
1900         (WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
1901         (WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
1902         (WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
1903         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
1904         (WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
1905         (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
1906         (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
1907         (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
1908         (WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
1909         (WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
1910         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
1911         (WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
1912         (WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
1913         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
1914         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
1915         (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
1916         (WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
1917         (WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
1918         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
1919         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
1920         (WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
1921         (WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
1922         (WebKit::DrawingAreaCoordinatedGraphics::display):
1923         (WebKit::shouldPaintBoundsRect):
1924         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
1925         * WebProcess/WebPage/DrawingArea.cpp:
1926         (WebKit::DrawingArea::create):
1927         * WebProcess/WebPage/DrawingArea.h:
1928         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
1929         * WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
1930         * WebProcess/WebPage/DrawingAreaImpl.h: Removed.
1931
1932 2019-03-03  Zalan Bujtas  <zalan@apple.com>
1933
1934         [ContentChangeObserver] Content observation should be limited to the current document.
1935         https://bugs.webkit.org/show_bug.cgi?id=195256
1936         <rdar://problem/48544402>
1937
1938         Reviewed by Simon Fraser.
1939
1940         * WebProcess/WebPage/WebPage.h:
1941         * WebProcess/WebPage/ios/WebPageIOS.mm:
1942         (WebKit::WebPage::handleSyntheticClick):
1943         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1944         (WebKit::WebPage::completeSyntheticClick):
1945         (WebKit::WebPage::handleTap):
1946         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1947         (WebKit::WebPage::commitPotentialTap):
1948
1949 2019-03-03  Tim Horton  <timothy_horton@apple.com>
1950
1951         Rid the world of WK_API_ENABLED
1952         https://bugs.webkit.org/show_bug.cgi?id=195263
1953
1954         Reviewed by Dan Bernstein.
1955
1956         List of changed files elided because it's useless.
1957
1958 2019-03-03  Jiewen Tan  <jiewen_tan@apple.com>
1959
1960         Add a WebViewDidMoveToWindowObserver for WKWebView
1961         https://bugs.webkit.org/show_bug.cgi?id=195223
1962         <rdar://problem/48520161>
1963
1964         Reviewed by Darin Adler.
1965
1966         The load optimizer would only allow itself to optimize loads whenever the web view
1967         who owns the page is (visible && focused), otherwises it will wait until the web view
1968         becomes (visible && focused). Therefore, we need a way to notify the load optimizer
1969         changes of statuses.
1970
1971         * UIProcess/API/Cocoa/WKWebView.mm:
1972         (-[WKWebView didMoveToWindow]):
1973         * UIProcess/Cocoa/WebViewImpl.mm:
1974         (WebKit::WebViewImpl::viewDidMoveToWindow):
1975         * UIProcess/WebPageProxy.cpp:
1976         (WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
1977         (WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
1978         (WebKit::WebPageProxy::webViewDidMoveToWindow):
1979         * UIProcess/WebPageProxy.h:
1980         * UIProcess/WebViewDidMoveToWindowObserver.h: Added.
1981         * WebKit.xcodeproj/project.pbxproj:
1982
1983 2019-03-03  Andy Estes  <aestes@apple.com>
1984
1985         [Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
1986         https://bugs.webkit.org/show_bug.cgi?id=195219
1987         <rdar://problem/48518082>
1988
1989         Reviewed by Darin Adler.
1990
1991         Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
1992         WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.
1993
1994         In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.
1995
1996         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1997         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
1998         m_webPageProxy with m_client.
1999         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
2000         (WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
2001         IPC::MessageSender via m_client.
2002         (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
2003         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
2004         m_webPageProxy with m_client.
2005         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
2006         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
2007         MessageSender::send rather than going through m_webPageProxy.
2008         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
2009         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
2010         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
2011         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
2012         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
2013         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
2014         changed m_webPageProxy to m_client.
2015         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
2016         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2017         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
2018         m_webPageProxy with m_client.
2019         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
2020         (WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
2021         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2022         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
2023         with m_client.
2024         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2025         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
2026         * UIProcess/AuxiliaryProcessProxy.h:
2027         (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
2028         * UIProcess/WebPageProxy.cpp:
2029         (WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
2030         (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
2031         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
2032         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
2033         (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
2034         * UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
2035         * UIProcess/ios/WebPageProxyIOS.mm:
2036         (WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
2037         (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
2038         * UIProcess/mac/WebPageProxyMac.mm:
2039         (WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
2040         * WebKit.xcodeproj/project.pbxproj:
2041
2042 2019-03-03  Tim Horton  <timothy_horton@apple.com>
2043
2044         Remove some more unused 32-bit code
2045         https://bugs.webkit.org/show_bug.cgi?id=195255
2046
2047         Reviewed by Darin Adler.
2048
2049         * Platform/Module.cpp:
2050         (WebKit::Module::Module):
2051         * Platform/Module.h:
2052         * Platform/cf/ModuleCF.cpp:
2053         (WebKit::Module::unload):
2054         (WebKit::Module::bundleResourceMap): Deleted.
2055         * PluginProcess/mac/PluginProcessMac.mm:
2056         (WebKit::initializeShim):
2057         (WebKit::PluginProcess::platformInitializeProcess):
2058         (WebKit::shouldCallRealDebugger): Deleted.
2059         (WebKit::isWindowActive): Deleted.
2060         (WebKit::getCurrentEventButtonState): Deleted.
2061         (WebKit::carbonWindowShown): Deleted.
2062         (WebKit::carbonWindowHidden): Deleted.
2063         (WebKit::openCFURLRef): Deleted.
2064         (WebKit::isMallocTinyMemoryTag): Deleted.
2065         (WebKit::shouldMapMemoryExecutable): Deleted.
2066         * PluginProcess/mac/PluginProcessShim.h:
2067         * PluginProcess/mac/PluginProcessShim.mm:
2068         (WebKit::shimDebugger): Deleted.
2069         (WebKit::shimGetCurrentEventButtonState): Deleted.
2070         (WebKit::shimIsWindowActive): Deleted.
2071         (WebKit::shimModalDialog): Deleted.
2072         (WebKit::shimAlert): Deleted.
2073         (WebKit::shimShowWindow): Deleted.
2074         (WebKit::shimHideWindow): Deleted.
2075         (WebKit::shimLSOpenCFURLRef): Deleted.
2076         (WebKit::shimMachVMMap): Deleted.
2077         * Shared/API/Cocoa/WKFoundation.h:
2078         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2079         (WebKit::XPCServiceMain):
2080         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2081         (WebKit::NetscapePluginModule::tryLoad):
2082         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2083         (WebKit::getPluginArchitecture):
2084         (WebKit::NetscapePluginModule::determineQuirks):
2085         * Shared/Plugins/PluginQuirks.h:
2086         * Shared/cf/ArgumentCodersCF.cpp:
2087         (IPC::sizeForNumberType):
2088         * Shared/mac/WebEventFactory.mm:
2089         (WebKit::mouseButtonForEvent):
2090         (WebKit::globalPointForEvent):
2091         (WebKit::pointForEvent):
2092         (WebKit::WebEventFactory::createWebMouseEvent):
2093         * UIProcess/API/C/mac/WKPagePrivateMac.h:
2094         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
2095         (WKPageLoadFileReturningNavigation):
2096         * UIProcess/Cocoa/WebViewImpl.mm:
2097         (WebKit::WebViewImpl::pressureChangeWithEvent):
2098         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
2099         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
2100         * UIProcess/mac/ServicesController.mm:
2101         (WebKit::ServicesController::ServicesController):
2102         * UIProcess/mac/WebContextMenuProxyMac.mm:
2103         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
2104         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2105         (WebKit::NPN_GetValue):
2106         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2107         (WebKit::NetscapePlugin::NetscapePlugin):
2108         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2109         (WebKit::NetscapePlugin::isWindowActive const): Deleted.
2110         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2111         (WebKit::NetscapePlugin::setDrawingModel):
2112         (WebKit::NetscapePlugin::setEventModel):
2113         (WebKit::NetscapePlugin::platformPostInitialize):
2114         (WebKit::NetscapePlugin::platformDestroy):
2115         (WebKit::NetscapePlugin::platformGeometryDidChange):
2116         (WebKit::NetscapePlugin::platformPaint):
2117         (WebKit::NetscapePlugin::platformHandleMouseEvent):
2118         (WebKit::NetscapePlugin::platformHandleWheelEvent):
2119         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
2120         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
2121         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
2122         (WebKit::NetscapePlugin::platformSetFocus):
2123         (WebKit::NetscapePlugin::windowFocusChanged):
2124         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
2125         (WebKit::NetscapePlugin::sendComplexTextInput):
2126         (): Deleted.
2127         (WebKit::windowMap): Deleted.
2128         (WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
2129         (WebKit::NetscapePlugin::windowRef const): Deleted.
2130         (WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
2131         (WebKit::NetscapePlugin::buttonState): Deleted.
2132         (WebKit::initializeEventRecord): Deleted.
2133         (WebKit::anyMouseButtonIsDown): Deleted.
2134         (WebKit::rightMouseButtonIsDown): Deleted.
2135         (WebKit::modifiersForEvent): Deleted.
2136         (WebKit::convertStringToKeyCodes): Deleted.
2137         (WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
2138         (WebKit::NetscapePlugin::nullEventTimerFired): Deleted.
2139
2140 2019-03-02  Zalan Bujtas  <zalan@apple.com>
2141
2142         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
2143         https://bugs.webkit.org/show_bug.cgi?id=195252
2144         <rdar://problem/48539446>
2145
2146         Reviewed by Simon Fraser.
2147
2148         * WebProcess/WebPage/ios/WebPageIOS.mm:
2149         (WebKit::WebPage::handleSyntheticClick):
2150
2151 2019-03-02  Tim Horton  <timothy_horton@apple.com>
2152
2153         Move EditingRange <-> Range methods to EditingRange instead of WebPage
2154         https://bugs.webkit.org/show_bug.cgi?id=195201
2155
2156         Reviewed by Sam Weinig.
2157
2158         * Shared/EditingRange.h:
2159         * Shared/EditingRange.cpp:
2160         Also, modernize the coders.
2161
2162         * Sources.txt:
2163         * WebKit.xcodeproj/project.pbxproj:
2164         * WebProcess/WebPage/WebPage.cpp:
2165         (WebKit::WebPage::insertTextAsync):
2166         (WebKit::WebPage::getMarkedRangeAsync):
2167         (WebKit::WebPage::getSelectedRangeAsync):
2168         (WebKit::WebPage::characterIndexForPointAsync):
2169         (WebKit::WebPage::firstRectForCharacterRangeAsync):
2170         (WebKit::WebPage::setCompositionAsync):
2171         (WebKit::WebPage::rangeFromEditingRange): Deleted.
2172         * WebProcess/WebPage/mac/WebPageMac.mm:
2173         (WebKit::WebPage::insertDictatedTextAsync):
2174         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
2175
2176 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2177
2178         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
2179         https://bugs.webkit.org/show_bug.cgi?id=195053
2180         <rdar://problem/48134710>
2181
2182         Reviewed by Ryosuke Niwa.
2183
2184         Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
2185         document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
2186         UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
2187         process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
2188         items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
2189         pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
2190         immediately invoke the programmatic paste handler.
2191
2192         * Scripts/webkit/messages.py:
2193         * UIProcess/API/gtk/PageClientImpl.cpp:
2194         (WebKit::PageClientImpl::requestDOMPasteAccess):
2195         * UIProcess/API/gtk/PageClientImpl.h:
2196         * UIProcess/API/wpe/PageClientImpl.cpp:
2197         (WebKit::PageClientImpl::requestDOMPasteAccess):
2198         * UIProcess/API/wpe/PageClientImpl.h:
2199         * UIProcess/PageClient.h:
2200         * UIProcess/WebPageProxy.cpp:
2201         (WebKit::WebPageProxy::requestDOMPasteAccess):
2202         * UIProcess/WebPageProxy.h:
2203         * UIProcess/WebPageProxy.messages.in:
2204
2205         Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
2206
2207         * UIProcess/ios/PageClientImplIOS.h:
2208         * UIProcess/ios/PageClientImplIOS.mm:
2209         (WebKit::PageClientImpl::requestDOMPasteAccess):
2210         * UIProcess/ios/WKContentViewInteraction.h:
2211         * UIProcess/ios/WKContentViewInteraction.mm:
2212         (-[WKContentView cleanupInteraction]):
2213         (-[WKContentView resignFirstResponderForWebView]):
2214         (-[WKContentView _webTouchEventsRecognized:]):
2215         (-[WKContentView _willHideMenu:]):
2216         (-[WKContentView pasteForWebView:]):
2217         (-[WKContentView _handleDOMPasteRequestWithResult:]):
2218         (-[WKContentView _willPerformAction:sender:]):
2219         (-[WKContentView _didPerformAction:sender:]):
2220         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
2221         (allPasteboardItemOriginsMatchOrigin):
2222         (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
2223         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
2224
2225         Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
2226         this happens, we only grant access for the current paste command, rather than granting access for the user
2227         gesture token.
2228
2229         * UIProcess/mac/PageClientImplMac.h:
2230         * UIProcess/win/PageClientImpl.cpp:
2231         (WebKit::PageClientImpl::requestDOMPasteAccess):
2232         * UIProcess/win/PageClientImpl.h:
2233         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2234         (WebKit::WebEditorClient::requestDOMPasteAccess):
2235         * WebProcess/WebCoreSupport/WebEditorClient.h:
2236         * WebProcess/WebPage/WebPage.cpp:
2237         (WebKit::WebPage::requestDOMPasteAccess):
2238         * WebProcess/WebPage/WebPage.h:
2239
2240 2019-02-27  Darin Adler  <darin@apple.com>
2241
2242         Fixed makeString(float) to do shortest-form serialization without first converting to double
2243         https://bugs.webkit.org/show_bug.cgi?id=195142
2244
2245         Reviewed by Daniel Bates.
2246
2247         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.
2248
2249 2019-03-02  Adrian Perez de Castro  <aperez@igalia.com>
2250
2251         [WPE] Public API headers are missing autocleanup definitions
2252         https://bugs.webkit.org/show_bug.cgi?id=195211
2253
2254         Reviewed by Philippe Normand.
2255
2256         * PlatformWPE.cmake: List new API headers as installable.
2257         * UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
2258         port, adapted to fit the WPE port.
2259         * UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
2260         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
2261         from the equivalent header of the GTK port.
2262         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
2263         WebKitWebExtensionAutocleanups.h
2264
2265 2019-03-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2266
2267         Remove unused WebPageProxy::m_navigationID
2268         https://bugs.webkit.org/show_bug.cgi?id=195209
2269
2270         Reviewed by Darin Adler.
2271
2272         WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
2273         debug LOG(). It must be a refactoring mistake.
2274
2275         * UIProcess/WebPageProxy.cpp:
2276         (WebKit::WebPageProxy::didCommitLoadForFrame):
2277         * UIProcess/WebPageProxy.h:
2278
2279 2019-03-01  Darin Adler  <darin@apple.com>
2280
2281         Finish removing String::format
2282         https://bugs.webkit.org/show_bug.cgi?id=194893
2283
2284         Reviewed by Daniel Bates.
2285
2286         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2287         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
2288         a problem where we passed an NSData * to format with a "%s"."
2289
2290 2019-03-01  Chris Dumez  <cdumez@apple.com>
2291
2292         Unreviewed Windows build fix after r242302.
2293
2294         * UIProcess/WebProcessPool.cpp:
2295         (WebKit::WebProcessPool::ensureNetworkProcess):
2296
2297 2019-03-01  Alex Christensen  <achristensen@webkit.org>
2298
2299         NetworkDataTask redirection should not keep alive its NetworkSession
2300         https://bugs.webkit.org/show_bug.cgi?id=194927
2301
2302         Reviewed by Darin Adler.
2303
2304         This should fix rdar://problem/47580502
2305
2306         * NetworkProcess/NetworkDataTask.h:
2307         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2308         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2309
2310 2019-03-01  Alex Christensen  <achristensen@webkit.org>
2311
2312         Revert r241223, r241235, and r241287
2313         https://bugs.webkit.org/show_bug.cgi?id=194427
2314         <rdar://48045861>
2315
2316         This caused crashes, and feature design has evolved away from needing the daemon in this form.
2317
2318         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
2319         (WebKit::DaemonMain):
2320         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2321         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2322         (WebKit::XPCServiceEventHandler):
2323         (WebKit::XPCServiceMain):
2324         (WebKit::XPCEventHandler): Deleted.
2325         (WebKit::XPCInitializationHandler): Deleted.
2326         * UIProcess/API/APIProcessPoolConfiguration.h:
2327         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2328         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2329         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
2330         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
2331         * UIProcess/AuxiliaryProcessProxy.cpp:
2332         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2333         * UIProcess/Launcher/ProcessLauncher.h:
2334         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2335         (WebKit::serviceName):
2336         (WebKit::ProcessLauncher::launchProcess):
2337         * UIProcess/Network/NetworkProcessProxy.cpp:
2338         (WebKit::NetworkProcessProxy::getLaunchOptions):
2339         * UIProcess/WebProcessPool.cpp:
2340         (WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
2341         * UIProcess/WebProcessPool.h:
2342
2343 2019-03-01  Alex Christensen  <achristensen@webkit.org>
2344
2345         Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
2346         https://bugs.webkit.org/show_bug.cgi?id=195229
2347         <rdar://problem/48520362>
2348
2349         Reviewed by Chris Dumez.
2350
2351         Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
2352         but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.
2353
2354         Functionality verified by manual testing.  See radar.
2355         Added an API test that verifies the setter restrictions work as expected.
2356
2357         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2358         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
2359         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
2360         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
2361         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
2362         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2363         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2364         (WebKit::toPKPaymentRequest):
2365         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2366         (WebKit::WebsiteDataStore::parameters):
2367         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2368         (WebKit::WebsiteDataStore::WebsiteDataStore):
2369         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
2370         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
2371         * UIProcess/WebsiteData/WebsiteDataStore.h:
2372         (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
2373         (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):
2374
2375 2019-03-01  Antoine Quint  <graouts@apple.com>
2376
2377         [iOS] Turn mouse event simulation on by default
2378         https://bugs.webkit.org/show_bug.cgi?id=195218
2379         <rdar://problem/48516794>
2380
2381         Reviewed by Dean Jackson.
2382
2383         * Shared/WebPreferences.yaml:
2384
2385 2019-03-01  Ross Kirsling  <ross.kirsling@sony.com>
2386
2387         EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
2388         https://bugs.webkit.org/show_bug.cgi?id=194612
2389
2390         Reviewed by Alex Christensen.
2391
2392         This API test really shouldn't be verifying that the actual environment was successfully modified.
2393
2394         At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
2395         simple functions -- one for string processing, one for environment processing -- the API test only needs to
2396         worry about the former.
2397
2398         * Platform/unix/EnvironmentUtilities.cpp:
2399         (WebKit::EnvironmentUtilities::stripEntriesEndingWith):
2400         (WebKit::EnvironmentUtilities::removeValuesEndingWith):
2401         (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
2402         * Platform/unix/EnvironmentUtilities.h:
2403         Replace old function with a pair of simpler ones.
2404
2405         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
2406         (NetworkServiceInitializer):
2407         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
2408         (PluginServiceInitializer):
2409         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
2410         (WebContentServiceInitializer):
2411         Update function name.
2412
2413 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
2414
2415         Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
2416         https://bugs.webkit.org/show_bug.cgi?id=194844
2417
2418         Reviewed by Youenn Fablet.
2419
2420         Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
2421         append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
2422         a crash in Windows when running a Service Worker.
2423
2424         * UIProcess/API/APIWebsiteDataStore.cpp:
2425         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
2426         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2427         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2428         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
2429         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
2430         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
2431         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
2432         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
2433         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
2434         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
2435
2436 2019-03-01  John Wilander  <wilander@apple.com>
2437
2438         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
2439         https://bugs.webkit.org/show_bug.cgi?id=195196
2440         <rdar://problem/48006419>
2441
2442         Reviewed by Brent Fulgham.
2443
2444         Trackers abuse link query parameters to transport user identifiers cross-site.
2445         This patch detects such navigations and applies further restrictions to
2446         client-site cookies on the destination page.
2447
2448         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2449         (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
2450         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
2451             Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
2452         * NetworkProcess/NetworkConnectionToWebProcess.h:
2453         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2454         * NetworkProcess/NetworkProcess.cpp:
2455         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
2456             Reporting IPC message when a link decorated cross-site navigation happens.
2457         (WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
2458         * NetworkProcess/NetworkProcess.h:
2459         * NetworkProcess/NetworkProcess.messages.in:
2460         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2461         (WKWebsiteDataStoreStatisticsResetToConsistentState):
2462             Added clearing of the new state between test runs.
2463         * UIProcess/Network/NetworkProcessProxy.cpp:
2464         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
2465             Test infrastructure.
2466         * UIProcess/Network/NetworkProcessProxy.h:
2467         * UIProcess/WebPageProxy.cpp:
2468         (WebKit::isNonUniqueNavigationWithLinkDecoration):
2469             Convenience function.
2470         (WebKit::WebPageProxy::didCommitLoadForFrame):
2471             This function now reports to the network process when a link decorated
2472             cross-site navigation happens.
2473         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2474         (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
2475             Test infrastructure.
2476         * UIProcess/WebsiteData/WebsiteDataStore.h:
2477         * WebProcess/WebPage/WebPage.cpp:
2478         (WebKit::WebPage::close):
2479             Name change of function called.
2480
2481 2019-03-01  Tim Horton  <timothy_horton@apple.com>
2482
2483         Remove unused code in WebKitLegacy
2484         https://bugs.webkit.org/show_bug.cgi?id=189614
2485
2486         Reviewed by Simon Fraser.
2487
2488         * mac/MigrateHeadersFromWebKitLegacy.make:
2489
2490 2019-03-01  Tim Horton  <timothy_horton@apple.com>
2491
2492         Modernize WebKit::AttributedString a little bit
2493         https://bugs.webkit.org/show_bug.cgi?id=195200
2494
2495         Reviewed by Wenson Hsieh.
2496
2497         * Shared/mac/AttributedString.h:
2498         (WebKit::AttributedString::AttributedString):
2499         (WebKit::AttributedString::operator NSAttributedString * const):
2500         * Shared/mac/AttributedString.mm:
2501         (IPC::ArgumentCoder<WebKit::AttributedString>::encode):
2502         (IPC::ArgumentCoder<WebKit::AttributedString>::decode):
2503         (WebKit::AttributedString::encode const): Deleted.
2504         (WebKit::AttributedString::decode): Deleted.
2505         * UIProcess/Cocoa/WebViewImpl.mm:
2506         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
2507         * WebProcess/WebPage/mac/WebPageMac.mm:
2508         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
2509         Modern coders, and a constructor and cast operator to/from NSAttributedString.
2510         Also adopt those in a few places just for fun.
2511
2512 2019-03-01  Youenn Fablet  <youenn@apple.com>
2513
2514         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
2515         https://bugs.webkit.org/show_bug.cgi?id=195213
2516
2517         Reviewed by Alex Christensen.
2518
2519         Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.
2520
2521         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2522         (WebKit::WebIDBConnectionToClient::putOrAdd):
2523         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
2524         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2525         * Scripts/webkit/messages.py:
2526         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2527         (WebKit::WebIDBConnectionToServer::putOrAdd):
2528
2529 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
2530
2531         [WinCairo] Enable service worker
2532         https://bugs.webkit.org/show_bug.cgi?id=188318
2533
2534         Reviewed by Youenn Fablet.
2535
2536         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2537         (WebKit::WebSWContextManagerConnection::terminateProcess):
2538         * WebProcess/Storage/WebSWContextManagerConnection.h:
2539         * config.h:
2540
2541 2019-03-01  Chris Dumez  <cdumez@apple.com>
2542
2543         Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
2544         https://bugs.webkit.org/show_bug.cgi?id=195110
2545
2546         Reviewed by Ryosuke Niwa.
2547
2548         The test was attempting to disable PageCache via view preferences instead of using the
2549         process pool configuration flag. This would fail to disable PageCache because the
2550         usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
2551         As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
2552         objects would get destroyed, which would lead to flakiness.
2553
2554         This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
2555         pages proxies when the usesPageCache preference is set to false.
2556
2557         * UIProcess/WebPageProxy.cpp:
2558         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2559
2560 2019-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2561
2562         [ThreadedCompositor] Simply the compositing run loop worker thread
2563         https://bugs.webkit.org/show_bug.cgi?id=195208
2564
2565         Reviewed by Don Olmstead.
2566
2567         We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
2568         process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
2569         so that the implementation is not specific to the generic WorkQueue implementation.
2570
2571         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2572         (WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
2573         (WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
2574         (WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
2575         (WebKit::CompositingRunLoop::performTask): Use m_runLoop.
2576         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
2577         (WebKit::WorkQueuePool::singleton): Deleted.
2578         (WebKit::WorkQueuePool::dispatch): Deleted.
2579         (WebKit::WorkQueuePool::runLoop): Deleted.
2580         (WebKit::WorkQueuePool::invalidate): Deleted.
2581         (WebKit::WorkQueuePool::WorkQueuePool): Deleted.
2582         (WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
2583         (): Deleted.
2584         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2585
2586 2019-03-01  Justin Fan  <justin_fan@apple.com>
2587
2588         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
2589         https://bugs.webkit.org/show_bug.cgi?id=195191
2590
2591         Rubber-stamped by Dean Jackson.
2592
2593         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
2594
2595         * Configurations/FeatureDefines.xcconfig:
2596
2597 2019-02-28  Chris Dumez  <cdumez@apple.com>
2598
2599         HTTPSUpgradeList.db database should be opened in readonly mode
2600         https://bugs.webkit.org/show_bug.cgi?id=195194
2601         <rdar://problem/47103889>
2602
2603         Reviewed by Youenn Fablet.
2604
2605         HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
2606         modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.
2607
2608         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
2609         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
2610
2611 2019-02-28  David Quesada  <david_quesada@apple.com>
2612
2613         Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
2614         https://bugs.webkit.org/show_bug.cgi?id=195121
2615         rdar://problem/48450302
2616
2617         Reviewed by Alex Christensen.
2618
2619         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2620         (-[WKNavigationAction _shouldPerformDownload]):
2621         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2622
2623 2019-02-28  Antoine Quint  <graouts@apple.com>
2624
2625         Disable Web Animations in Safari Technology Preview
2626         https://bugs.webkit.org/show_bug.cgi?id=194748
2627         <rdar://problem/48139481>
2628
2629         Reviewed by Dean Jackson.
2630
2631         The test runners already opt into that feature explicitly, so all that is needed is to turn
2632         the default setting value to false.
2633
2634         * Shared/WebPreferences.yaml:
2635
2636 2019-02-28  Antoine Quint  <graouts@apple.com>
2637
2638         Enable the Pointer Events runtime flag by default
2639         https://bugs.webkit.org/show_bug.cgi?id=195156
2640
2641         Reviewed by Dean Jackson.
2642
2643         * Shared/WebPreferences.yaml:
2644
2645 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
2646
2647         Revert r232263: it caused processes to crash because process was suspended with locked file
2648         https://bugs.webkit.org/show_bug.cgi?id=195122
2649         <rdar://problem/48444599>
2650
2651         Reviewed by Geoffrey Garen.
2652
2653         * NetworkProcess/NetworkProcess.cpp:
2654         (WebKit::NetworkProcess::NetworkProcess):
2655         * NetworkProcess/NetworkProcess.h:
2656         * Shared/WebSQLiteDatabaseTracker.cpp:
2657         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2658         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2659         * Shared/WebSQLiteDatabaseTracker.h:
2660         * WebProcess/WebProcess.cpp:
2661         (WebKit::m_webSQLiteDatabaseTracker):
2662         (WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
2663         * WebProcess/WebProcess.h:
2664
2665 2019-02-28  Per Arne Vollan  <pvollan@apple.com>
2666
2667         [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
2668         https://bugs.webkit.org/show_bug.cgi?id=193683
2669         <rdar://problem/47634345>
2670
2671         Reviewed by Brent Fulgham.
2672
2673         When a keyboard is attached/deattached or the application becomes foreground, send a message from
2674         the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
2675         cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
2676         to be expensive.
2677
2678         * UIProcess/API/Cocoa/WKWebView.mm:
2679         (hardwareKeyboardAvailabilityChangedCallback):
2680         * UIProcess/WebPageProxy.h:
2681         * UIProcess/WebProcessProxy.h:
2682         (WebKit::WebProcessProxy::setKeyboardIsAttached):
2683         (WebKit::WebProcessProxy::keyboardIsAttached const):
2684         * UIProcess/ios/WKContentViewInteraction.mm:
2685         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2686         * UIProcess/ios/WebPageProxyIOS.mm:
2687         (WebKit::WebPageProxy::applicationWillEnterForeground):
2688         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
2689         * WebProcess/WebPage/WebPage.h:
2690         * WebProcess/WebPage/WebPage.messages.in:
2691         * WebProcess/WebPage/ios/WebPageIOS.mm:
2692         (WebKit::WebPage::platformEditorState const):
2693         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
2694
2695 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2696
2697         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
2698         https://bugs.webkit.org/show_bug.cgi?id=195159
2699
2700         Reviewed by Don Olmstead.
2701
2702         Use COORDINATED_GRAPHICS instead.
2703
2704         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2705         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
2706         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2707         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
2708         * Shared/CoordinatedGraphics/SimpleViewportController.h:
2709         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2710         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2711         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2712         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2713         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
2714         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
2715         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2716         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
2717         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
2718         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
2719         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
2720         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2721         (WebKit::DrawingAreaImpl::updatePreferences):
2722         * WebProcess/WebPage/WebPage.cpp:
2723         (WebKit::WebPage::sendViewportAttributesChanged):
2724         (WebKit::WebPage::viewportPropertiesDidChange):
2725         * WebProcess/gtk/WebProcessMainGtk.cpp:
2726
2727 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
2728
2729         Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
2730         https://bugs.webkit.org/show_bug.cgi?id=194958
2731
2732         Reviewed by Geoffrey Garen.
2733
2734         ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.
2735
2736         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2737         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
2738         * UIProcess/API/APIWebsiteDataStore.cpp:
2739         (API::WebsiteDataStore::createLegacy):
2740         (API::indexedDBDatabaseDirectory):
2741         * UIProcess/API/APIWebsiteDataStore.h:
2742         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2743         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
2744         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2745         * UIProcess/WebProcessPool.cpp:
2746         (WebKit::legacyWebsiteDataStoreConfiguration):
2747
2748 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2749
2750         [CoordinatedGraphics] Unify all LayerTreeHost classes
2751         https://bugs.webkit.org/show_bug.cgi?id=195094
2752
2753         Reviewed by Žan Doberšek.
2754
2755         There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
2756         ports.
2757
2758         * PlatformWin.cmake:
2759         * SourcesGTK.txt:
2760         * SourcesWPE.txt:
2761         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2762         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
2763         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
2764         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2765         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
2766         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
2767         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
2768         (WebKit::LayerTreeHost::LayerTreeHost):
2769         (WebKit::LayerTreeHost::~LayerTreeHost):
2770         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
2771         (WebKit::LayerTreeHost::scheduleLayerFlush):
2772         (WebKit::LayerTreeHost::cancelPendingLayerFlush):
2773         (WebKit::LayerTreeHost::layerFlushTimerFired):
2774         (WebKit::LayerTreeHost::setRootCompositingLayer):
2775         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
2776         (WebKit::LayerTreeHost::invalidate):
2777         (WebKit::LayerTreeHost::scrollNonCompositedContents):
2778         (WebKit::LayerTreeHost::forceRepaint):
2779         (WebKit::LayerTreeHost::forceRepaintAsync):
2780         (WebKit::LayerTreeHost::sizeDidChange):
2781         (WebKit::LayerTreeHost::pauseRendering):
2782         (WebKit::LayerTreeHost::resumeRendering):
2783         (WebKit::LayerTreeHost::graphicsLayerFactory):
2784         (WebKit::LayerTreeHost::contentsSizeChanged):
2785         (WebKit::LayerTreeHost::didChangeViewportAttributes):
2786         (WebKit::LayerTreeHost::didChangeViewport):
2787         (WebKit::LayerTreeHost::setIsDiscardable):
2788         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
2789         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
2790         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
2791         (WebKit::LayerTreeHost::didFlushRootLayer):
2792         (WebKit::LayerTreeHost::commitSceneState):
2793         (WebKit::LayerTreeHost::frameComplete):
2794         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
2795         (WebKit::LayerTreeHost::didDestroyGLContext):
2796         (WebKit::LayerTreeHost::willRenderFrame):
2797         (WebKit::LayerTreeHost::didRenderFrame):
2798         (WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
2799         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
2800         (WebKit::LayerTreeHost::renderNextFrame):
2801         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
2802         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2803         (WebKit::DrawingAreaImpl::setNeedsDisplay):
2804         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
2805         * WebProcess/WebPage/LayerTreeHost.cpp: Removed.
2806         * WebProcess/WebPage/LayerTreeHost.h: Removed.
2807         * WebPage/win/LayerTreeHost.h: Added.
2808
2809 2019-02-28  Justin Fan  <justin_fan@apple.com>
2810
2811         [Web GPU] Enable Web GPU only on 64-bit
2812         https://bugs.webkit.org/show_bug.cgi?id=195139
2813
2814         Because Metal is only supported on 64 bit apps.
2815
2816         Unreviewed build fix.
2817
2818         * Configurations/FeatureDefines.xcconfig:
2819
2820 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
2821
2822         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
2823
2824         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2825         (WebKit::LocalAuthenticator::getAssertion):
2826
2827 2019-02-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2828
2829         Unreviewed, fix -Wformat warning
2830
2831         * WebProcess/WebPage/WebPage.cpp:
2832         (WebKit::WebPage::didCompletePageTransition):
2833
2834 2019-02-27  Brent Fulgham  <bfulgham@apple.com>
2835
2836         REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
2837         https://bugs.webkit.org/show_bug.cgi?id=195072
2838
2839         Reviewed by Ryosuke Niwa.
2840
2841         ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
2842         the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
2843         a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
2844         was disconnected), just like we do for other message send cases.
2845
2846         This patch switches from using the m_networkProcessConnection member (which might be null) to use the
2847         'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
2848
2849         * WebProcess/WebProcess.cpp:
2850         (WebKit::WebProcess::initializeWebProcess):
2851
2852 2019-02-27  Chris Dumez  <cdumez@apple.com>
2853
2854         Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
2855         https://bugs.webkit.org/show_bug.cgi?id=194480
2856
2857         Reviewed by Brady Eidson.
2858
2859         The StorageManager would only start listening for IPC on a given connection when
2860         StorageManager::processWillOpenConnection() is called. This gets called from
2861         WebsiteDataStore::webProcessWillOpenConnection() which gets called from
2862         WebProcessLifetimeTracker::webPageEnteringWebProcess().
2863
2864         webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
2865         after process-swapping. This means that IPC comming from the *provisional* process
2866         would not get processed and we would only start processing IPC on the provisional
2867         process's connection when it would get committed.
2868
2869         To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
2870         now have several processes. We also make sure that webPageEnteringWebProcess() gets
2871         called for the provisional process as soon as we create the provisional page, instead
2872         of waiting for it to get committed.
2873
2874         * UIProcess/ProvisionalPageProxy.cpp:
2875         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
2876         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
2877         (WebKit::ProvisionalPageProxy::connectionWillOpen):
2878         * UIProcess/ProvisionalPageProxy.h:
2879         * UIProcess/WebPageProxy.cpp:
2880         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2881         (WebKit::WebPageProxy::connectionWillOpen):
2882         (WebKit::WebPageProxy::webProcessWillShutDown):
2883         (WebKit::WebPageProxy::processDidTerminate):
2884         * UIProcess/WebPageProxy.h:
2885         (WebKit::WebPageProxy::webProcessLifetimeTracker):
2886         * UIProcess/WebProcessLifetimeObserver.cpp:
2887         (WebKit::WebProcessLifetimeObserver::addWebPage):
2888         (WebKit::WebProcessLifetimeObserver::removeWebPage):
2889         * UIProcess/WebProcessLifetimeObserver.h:
2890         * UIProcess/WebProcessLifetimeTracker.cpp:
2891         (WebKit::WebProcessLifetimeTracker::addObserver):
2892         (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
2893         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
2894         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
2895         (WebKit::WebProcessLifetimeTracker::processIsRunning):
2896         * UIProcess/WebProcessLifetimeTracker.h:
2897         * UIProcess/WebProcessProxy.cpp:
2898         (WebKit::WebProcessProxy::connectionWillOpen):
2899         * UIProcess/WebStorage/StorageManager.cpp:
2900         (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
2901         (WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
2902         (WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
2903         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
2904         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
2905         (WebKit::StorageManager::processWillOpenConnection):
2906         (WebKit::StorageManager::processDidCloseConnection):
2907         (WebKit::StorageManager::createSessionStorageMap):
2908         (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
2909         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
2910         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
2911         * UIProcess/WebStorage/StorageManager.h:
2912         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2913         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
2914         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
2915
2916 2019-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2917
2918         [iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
2919         https://bugs.webkit.org/show_bug.cgi?id=195118
2920         <rdar://problem/43411940>
2921
2922         Reviewed by Tim Horton.
2923
2924         It's currently possible for websites to redirect focus into an editable element on the page by programmatically
2925         requesting focus within the "blur" event handler. This is because our current heuristics:
2926
2927         (1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
2928             the case where the page moves focus between different elements on the page.
2929         (2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
2930             the case where a focused element should show the keyboard when first responder is restored on a web view
2931             (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
2932             again).
2933
2934         In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
2935         becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
2936         by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
2937         focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.
2938
2939         To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
2940         before showing the keyboard due to activity state change or focused element change.
2941
2942         Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html
2943
2944         * UIProcess/ios/WKContentViewInteraction.h:
2945         * UIProcess/ios/WKContentViewInteraction.mm:
2946         (-[WKContentView setupInteraction]):
2947         (-[WKContentView textInputTraits]):
2948
2949         Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
2950         terminology used in WebKit.
2951
2952         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2953
2954         Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
2955         logic into a lambda function and using early returns. See above for more details.
2956
2957         (-[WKContentView _elementDidBlur]):
2958         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
2959
2960 2019-02-27  John Wilander  <wilander@apple.com>
2961
2962         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
2963         https://bugs.webkit.org/show_bug.cgi?id=195071
2964         <rdar://problem/48417690>
2965
2966         Reviewed by Alex Christensen and Brent Fulgham.
2967
2968         This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
2969         and makes the necessary infrastructure changes to support that.
2970
2971         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
2972         HashSets since we never used the counts for anything. This change simplified
2973         the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.
2974
2975         The patch also makes WebCore::RegistrableDomain's String constructor private.
2976         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
2977         is introduced to better signal to users that creating a registrable domain
2978         object with a string may create an object that doesn't match a registrable
2979         domain in a valid HTTP-family URL.
2980
2981         Finally, this patch harmonizes parameter and variable naming, going from
2982         "origin" to "domain" and "mainFrame" to "topFrame."
2983
2984         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2985         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
2986         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
2987         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
2988         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
2989         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
2990         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
2991         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
2992         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
2993         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
2994         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
2995         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
2996         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
2997         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
2998         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
2999         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
3000         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
3001         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
3002         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
3003         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
3004         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
3005         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
3006         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
3007         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
3008         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3009         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
3010         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
3011         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
3012         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3013         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
3014         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
3015         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3016         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
3017         (WebKit::sortedPrevalentResourceTelemetry):
3018         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3019         * NetworkProcess/NetworkProcess.cpp:
3020         (WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
3021         (WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
3022         (WebKit::filterForRegistrableDomains):
3023         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3024         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
3025         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
3026         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
3027         * NetworkProcess/NetworkProcess.h:
3028         * NetworkProcess/NetworkProcess.messages.in:
3029         * NetworkProcess/NetworkSession.cpp:
3030         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3031         * NetworkProcess/NetworkSession.h:
3032         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3033         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
3034         * Shared/WebCoreArgumentCoders.cpp:
3035         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3036         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3037         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3038         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
3039         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
3040         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
3041         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
3042         * UIProcess/Network/NetworkProcessProxy.cpp:
3043         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3044         (WebKit::NetworkProcessProxy::isPrevalentResource):
3045         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
3046         (WebKit::NetworkProcessProxy::setPrevalentResource):
3047         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
3048         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
3049         (WebKit::NetworkProcessProxy::setLastSeen):
3050         (WebKit::NetworkProcessProxy::clearPrevalentResource):
3051         (WebKit::NetworkProcessProxy::logUserInteraction):
3052         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
3053         (WebKit::NetworkProcessProxy::clearUserInteraction):
3054         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
3055         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
3056         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
3057         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
3058         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
3059         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
3060         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
3061         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
3062         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
3063         (WebKit::NetworkProcessProxy::isGrandfathered):
3064         (WebKit::NetworkProcessProxy::setGrandfathered):
3065         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
3066         (WebKit::NetworkProcessProxy::hasStorageAccess):
3067         (WebKit::NetworkProcessProxy::requestStorageAccess):
3068         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
3069         (WebKit::NetworkProcessProxy::grantStorageAccess):
3070         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
3071         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
3072         * UIProcess/Network/NetworkProcessProxy.h:
3073         * UIProcess/Network/NetworkProcessProxy.messages.in:
3074         * UIProcess/WebPageProxy.cpp:
3075         (WebKit::WebPageProxy::requestStorageAccessConfirm):
3076         * UIProcess/WebPageProxy.h:
3077         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3078         (WebKit::WebsiteDataStore::isPrevalentResource):
3079         (WebKit::WebsiteDataStore::setPrevalentResource):
3080         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
3081         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
3082         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
3083         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
3084         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
3085         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
3086         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
3087         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
3088         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
3089         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
3090         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
3091         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
3092         (WebKit::WebsiteDataStore::clearPrevalentResource):
3093         (WebKit::WebsiteDataStore::setLastSeen):
3094         (WebKit::WebsiteDataStore::hasStorageAccess):
3095         (WebKit::WebsiteDataStore::requestStorageAccess):
3096         (WebKit::WebsiteDataStore::grantStorageAccess):
3097         (WebKit::WebsiteDataStore::logUserInteraction):
3098         (WebKit::WebsiteDataStore::hasHadUserInteraction):
3099         (WebKit::WebsiteDataStore::clearUserInteraction):
3100         (WebKit::WebsiteDataStore::setGrandfathered):
3101         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
3102         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
3103         * UIProcess/WebsiteData/WebsiteDataStore.h:
3104         * WebProcess/WebPage/WebPage.cpp:
3105         (WebKit::WebPage::hasStorageAccess):
3106         (WebKit::WebPage::requestStorageAccess):
3107
3108 2019-02-27  Keith Rollin  <krollin@apple.com>
3109
3110         Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
3111         https://bugs.webkit.org/show_bug.cgi?id=195109
3112         <rdar://problem/48442272>
3113
3114         Reviewed by Alexey Proskuryakov.
3115
3116         In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
3117         added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
3118         Z's in hexadecimal strings). While these UUIDs haven't caused any
3119         problems in practice over the last six years, they are indeed invalid,
3120         and were discovered via an Xcode-project processing tool that did not
3121         anticipate their format. Fix this by removing the files from the
3122         project and re-adding them.
3123
3124         * WebKit.xcodeproj/project.pbxproj:
3125
3126 2019-02-27  Youenn Fablet  <youenn@apple.com>
3127
3128         Remove UserMediaProcessManager processState map
3129         https://bugs.webkit.org/show_bug.cgi?id=195056
3130
3131         Reviewed by Eric Carlson.
3132
3133         Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
3134         To improve on this model, this patch does the following:
3135         - Move the process state to WebProcessProxy.
3136         - Remove the map and replace it by a set of all manager proxies.
3137
3138         This simplifies the handling.
3139         On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
3140         This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.
3141
3142         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3143         (WebKit::UserMediaPermissionRequestManagerProxy::forEach):
3144         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
3145         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
3146         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
3147         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3148         * UIProcess/UserMediaProcessManager.cpp:
3149         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
3150         (WebKit::UserMediaProcessManager::willCreateMediaStream):
3151         (WebKit::UserMediaProcessManager::endedCaptureSession):
3152         (WebKit::UserMediaProcessManager::setCaptureEnabled):
3153         (WebKit::UserMediaProcessManager::captureDevicesChanged):
3154         (WebKit::ProcessState::ProcessState): Deleted.
3155         (WebKit::ProcessState::hasVideoExtension const): Deleted.
3156         (WebKit::ProcessState::grantVideoExtension): Deleted.
3157         (WebKit::ProcessState::revokeVideoExtension): Deleted.
3158         (WebKit::ProcessState::hasAudioExtension const): Deleted.
3159         (WebKit::ProcessState::grantAudioExtension): Deleted.
3160         (WebKit::ProcessState::revokeAudioExtension): Deleted.
3161         (WebKit::stateMap): Deleted.
3162         (WebKit::processState): Deleted.
3163         (WebKit::ProcessState::addRequestManager): Deleted.
3164         (WebKit::ProcessState::removeRequestManager): Deleted.
3165         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
3166         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
3167         (WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
3168         * UIProcess/UserMediaProcessManager.h:
3169         * UIProcess/WebProcessProxy.h:
3170         (WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
3171         (WebKit::WebProcessProxy::hasVideoCaptureExtension const):
3172         (WebKit::WebProcessProxy::grantVideoCaptureExtension):
3173         (WebKit::WebProcessProxy::revokeVideoCaptureExtension):
3174         (WebKit::WebProcessProxy::hasAudioCaptureExtension const):
3175         (WebKit::WebProcessProxy::grantAudioCaptureExtension):
3176         (WebKit::WebProcessProxy::revokeAudioCaptureExtension):
3177         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3178         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
3179         (WebKit::UserMediaPermissionRequestManager::clear): Deleted.
3180         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
3181         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
3182         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3183         * WebProcess/WebPage/WebPage.cpp:
3184         (WebKit::WebPage::close):
3185         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
3186         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
3187         * WebProcess/WebPage/WebPage.h:
3188         * WebProcess/WebPage/WebPage.messages.in:
3189         * WebProcess/WebProcess.cpp:
3190         (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
3191         (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
3192         * WebProcess/WebProcess.h:
3193         * WebProcess/WebProcess.messages.in:
3194
3195 2019-02-27  Per Arne Vollan  <pvollan@apple.com>
3196
3197         [macOS] Disable permissive call logging in sandbox
3198         https://bugs.webkit.org/show_bug.cgi?id=194061
3199         <rdar://problem/47686253>
3200
3201         Reviewed by Brent Fulgham.
3202
3203         Strict call filtering should be reenabled.
3204
3205         * WebProcess/com.apple.WebProcess.sb.in:
3206
3207 2019-02-27  Chris Dumez  <cdumez@apple.com>
3208
3209         [HTTPSUpgrade] Use open source database until the feature is ready
3210         https://bugs.webkit.org/show_bug.cgi?id=195069
3211         <rdar://problem/47838224>
3212
3213         Reviewed by Geoffrey Garen.
3214
3215         * DerivedSources-input.xcfilelist:
3216         * DerivedSources.make:
3217
3218 2019-02-27  Antoine Quint  <graouts@apple.com>
3219
3220         Support Pointer Events on macOS
3221         https://bugs.webkit.org/show_bug.cgi?id=195008
3222         <rdar://problem/47454419>
3223
3224         Reviewed by Dean Jackson.
3225
3226         * Configurations/FeatureDefines.xcconfig:
3227
3228 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
3229
3230         Network Process is put to suspended when holding locked IndexedDB files
3231         https://bugs.webkit.org/show_bug.cgi?id=195024
3232         <rdar://problem/45194169>
3233
3234         Reviewed by Geoffrey Garen.
3235
3236         * NetworkProcess/NetworkProcess.cpp:
3237         (WebKit::NetworkProcess::idbServer):
3238         (WebKit::NetworkProcess::notifyHoldingLockedFiles):
3239         * NetworkProcess/NetworkProcess.h:
3240         * UIProcess/Network/NetworkProcessProxy.cpp:
3241         (WebKit::NetworkProcessProxy::didClose):
3242         (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
3243         * UIProcess/Network/NetworkProcessProxy.h:
3244         * UIProcess/Network/NetworkProcessProxy.messages.in:
3245
3246 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
3247
3248         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
3249         https://bugs.webkit.org/show_bug.cgi?id=194973
3250
3251         Reviewed by Antti Koivisto.
3252
3253         This patch cleans up how the scrolling tree responds to scrolls.
3254
3255         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
3256         UI process scroll position.
3257
3258         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
3259         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
3260         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
3261         updates related layers on this node (counter-scrolling layers etc), and then tells the
3262         scrolling tree, which recurses through descendant nodes so they can adjust their layer
3263         positions.
3264
3265         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
3266         which does the above other than setting scrolledContentsLayer (since we're reacting to
3267         layer state changes, not producing them).
3268
3269         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
3270         ScrollingTree does the tree walk so classes don't have to implement
3271         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
3272         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
3273         need to cross frame boundaries).
3274
3275         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
3276         since the fixed state was computed with the "layout" scroll position, so we have to account
3277         for the scroll delta since the last committed position. It's possible we could improve this
3278         in future.
3279
3280         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3281         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3282         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3283         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
3284         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
3285         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3286         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3287         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
3288         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
3289         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3290         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
3291         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
3292         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
3293         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
3294         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
3295         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
3296         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
3297         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
3298         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
3299         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
3300         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
3301         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
3302         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
3303         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3304         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3305         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
3306         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
3307         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
3308         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
3309         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
3310         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
3311         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3312         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
3313         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
3314         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
3315         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
3316         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
3317         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
3318         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
3319         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
3320         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
3321         (WebKit::ScrollerPairMac::updateValues):
3322         (WebKit::ScrollerPairMac::valuesForOrientation):
3323         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
3324         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
3325         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
3326         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
3327         * UIProcess/ios/WKContentView.mm:
3328         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3329
3330 2019-02-27  Alex Christensen  <achristensen@webkit.org>
3331
3332         Silence log after r242122
3333         https://bugs.webkit.org/show_bug.cgi?id=195074
3334
3335         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3336         (WebKit::LocalStorageDatabaseTracker::databasePath const):
3337         m_localStorageDirectory can now be null for ephemeral sessions.
3338         This is not a failure to create a directory and needs no log.
3339         This fixes the WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog API test.
3340
3341 2019-02-27  Timothy Hatcher  <timothy@apple.com>
3342
3343         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
3344         https://bugs.webkit.org/show_bug.cgi?id=195086
3345         rdar://problem/48419124
3346
3347         Reviewed by Tim Horton.
3348
3349         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
3350         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
3351
3352 2019-02-26  Chris Dumez  <cdumez@apple.com>
3353
3354         [PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
3355         https://bugs.webkit.org/show_bug.cgi?id=195089
3356
3357         Reviewed by Geoffrey Garen.
3358
3359         Add a convenient mechanism to clear suspended pages while bypassing the WebProcess
3360         cache since we need to do this on memory pressure and when clearing website data.
3361
3362         * UIProcess/WebPageProxy.cpp:
3363         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3364         * UIProcess/WebProcessCache.cpp: