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