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