1b6fdf441d5e322e6ef3a12a89f9d794da674ae2
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-08-29  Keith Rollin  <krollin@apple.com>
2
3         Remove HAVE_PASSKIT_GRANULAR_ERRORS conditional
4         https://bugs.webkit.org/show_bug.cgi?id=201278
5         <rdar://problem/54821052>
6
7         Reviewed by Alex Christensen.
8
9         HAVE_PASSKIT_GRANULAR_ERRORS is always True, so remove the conditional
10         tests, keeping the True branches and removing the False branches.
11
12         * Platform/cocoa/PaymentAuthorizationPresenter.mm:
13         (WebKit::PaymentAuthorizationPresenter::completePaymentSession):
14         (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
15         * Platform/cocoa/PaymentAuthorizationViewController.mm:
16         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
17         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
18         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
19         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
20         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
21         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
22         (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
23         (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]):
24         (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
25         (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
26         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
27         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
28         (WebKit::toPKContactFields):
29         (WebKit::toNSSet):
30         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
31         (WebKit::toPKAddressField): Deleted.
32
33 2019-08-29  Chris Dumez  <cdumez@apple.com>
34
35         Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
36         https://bugs.webkit.org/show_bug.cgi?id=201318
37
38         Reviewed by Alex Christensen.
39
40         Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.
41
42         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
43         (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const):
44         (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const):
45         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
46         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
47         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
48         (WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const):
49         (WebKit::NetworkCache::BlobStorage::synchronize):
50         (WebKit::NetworkCache::BlobStorage::blobPathForHash const):
51         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
52         * NetworkProcess/cache/NetworkCacheStorage.cpp:
53         (WebKit::NetworkCache::Storage::basePathIsolatedCopy const):
54         (WebKit::NetworkCache::Storage::versionPath const):
55         (WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const):
56         (WebKit::NetworkCache::Storage::synchronize):
57         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey const):
58         (WebKit::NetworkCache::Storage::traverse):
59         (WebKit::NetworkCache::Storage::clear):
60         (WebKit::NetworkCache::Storage::shrink):
61         (WebKit::NetworkCache::Storage::deleteOldVersions):
62         * NetworkProcess/cache/NetworkCacheStorage.h:
63
64 2019-08-29  Keith Rollin  <krollin@apple.com>
65
66         Update .xcconfig symbols to reflect the current set of past and future product versions.
67         https://bugs.webkit.org/show_bug.cgi?id=200720
68         <rdar://problem/54305032>
69
70         Reviewed by Alex Christensen.
71
72         Remove version symbols related to old OS's we no longer support,
73         ensure that version symbols are defined for OS's we do support.
74
75         * Configurations/Base.xcconfig:
76         * Configurations/DebugRelease.xcconfig:
77         * Configurations/Version.xcconfig:
78
79 2019-08-29  Keith Rollin  <krollin@apple.com>
80
81         Invalid XPCServices symlinks are being created
82         https://bugs.webkit.org/show_bug.cgi?id=201320
83         <rdar://problem/54719612>
84
85         Reviewed by Dan Bernstein.
86
87         When performing incremental builds, errant XPCServices symlinks can be
88         created. For example, in the following, the second symlink is the
89         correct one. The first symlink gets created when the build process
90         tries to create the symlink and it already exists. When it already
91         exists, the command to create the symlink actually follows the
92         existing symlink and creates the (second) symlink at the location
93         where the first symlink points.
94
95             WebKit.framework/Versions/A/XPCServices/XPCServices@ -> Versions/Current/XPCServices
96             WebKit.framework/XPCServices@ -> Versions/Current/XPCServices
97
98         Address this by specifying -h to the `ln` command, which will cause it
99         to not follow symlinks if they already exist at the target.
100
101         Also, fix a benign issue where the Xcode build variable WRAPPER_NAME
102         was being referenced in a context where it wasn't defined.
103
104         * WebKit.xcodeproj/project.pbxproj:
105
106 2019-08-29  Alex Christensen  <achristensen@webkit.org>
107
108         Speculative loads should use the NetworkSession owning their Cache
109         https://bugs.webkit.org/show_bug.cgi?id=201314
110
111         Reviewed by Chris Dumez.
112
113         This provides a performance improvement when using non-default persistent WKWebsiteDataStores.
114
115         * NetworkProcess/NetworkSession.cpp:
116         (WebKit::NetworkSession::NetworkSession):
117         * NetworkProcess/cache/NetworkCache.cpp:
118         (WebKit::NetworkCache::Cache::open):
119         (WebKit::NetworkCache::Cache::Cache):
120         * NetworkProcess/cache/NetworkCache.h:
121         (WebKit::NetworkCache::Cache::sessionID const):
122         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
123         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
124
125 2019-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
126
127         [iOS 13] Caret does not appear in text field if the body element is translated completely out of the viewport
128         https://bugs.webkit.org/show_bug.cgi?id=201287
129         <rdar://problem/54780864>
130
131         Reviewed by Tim Horton.
132
133         During EditorState computation, we use the hidden editable element heuristic to determine whether we should
134         begin suppressing selection gestures and UI. Currently, we use the editable root of the selection range to
135         determine where in the layer tree we should start our ascent, in search of a completely transparent or
136         completely clipped container.
137
138         However, in the case where the selection is inside a focused text field, this causes us to walk up the layer
139         tree starting at the RenderLayer corresponding to the text field's inner contenteditable div, which is different
140         than the text field's enclosing RenderLayer in the case where the containing block is transformed, such that no
141         part of it is within the visible viewport. This scenario is exercised by the below test case, in which the caret
142         after transforming the body horizontally by -100vw is hidden due to a false positive in the hidden editable area
143         heuristic.
144
145         Fix this by starting the layer tree ascent from the enclosing layer of the text form control if applicable,
146         instead of the inner editable area under the shadow root of the form control.
147
148         Test: editing/selection/ios/show-selection-in-transformed-container.html
149
150         * WebProcess/WebPage/ios/WebPageIOS.mm:
151         (WebKit::WebPage::platformEditorState const):
152
153 2019-08-29  Youenn Fablet  <youenn@apple.com>
154
155         Skip fetch event dispatching if no fetch event handler is added at script evaluation time
156         https://bugs.webkit.org/show_bug.cgi?id=201174
157
158         Reviewed by Chris Dumez.
159
160         Store whether a fetch event handler is set at script evaluation time.
161         If not, we skip the fetch event entirely so that the network load can start sooner.
162         If fetch event is skipped, we trigger soft update, as defined in
163         https://w3c.github.io/ServiceWorker/#handle-fetch step 16.
164
165         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
166         (WebKit::WebSWServerConnection::startFetch):
167         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
168         (WebKit::WebSWServerToContextConnection::softUpdate):
169         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
170         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
171         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
172         (WebKit::WebSWContextManagerConnection::serviceWorkerStarted):
173         (WebKit::WebSWContextManagerConnection::serviceWorkerFailedToStart):
174         (WebKit::WebSWContextManagerConnection::softUpdate):
175         * WebProcess/Storage/WebSWContextManagerConnection.h:
176         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
177
178 2019-08-29  Keith Rollin  <krollin@apple.com>
179
180         Remove support for macOS < 10.13 (part 3)
181         https://bugs.webkit.org/show_bug.cgi?id=201224
182         <rdar://problem/54795934>
183
184         Reviewed by Darin Adler.
185
186         Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
187         10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
188         like _MACOS_SINCE_1013.
189
190         * Configurations/WebKitTargetConditionals.xcconfig:
191
192 2019-08-29  Youenn Fablet  <youenn@apple.com>
193
194         Use WebPageProxy callbacks in case of authentication challenge received from Service Worker
195         https://bugs.webkit.org/show_bug.cgi?id=201177
196
197         Reviewed by Alex Christensen.
198
199         Send topOrigin for every possible load to NetworkProcess.
200         Send topOrigin as part of authentication challenge to UIProcess.
201
202         If there is no corresponding page for the pageID, try getting a page
203         related to the service worker using the topOrigin and send the challenge to it.
204
205         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
206         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
207         * NetworkProcess/NetworkCORSPreflightChecker.h:
208         * NetworkProcess/NetworkLoad.cpp:
209         (WebKit::NetworkLoad::didReceiveChallenge):
210         * NetworkProcess/NetworkLoadChecker.cpp:
211         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
212         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
213         * NetworkProcess/NetworkLoadChecker.h:
214         * NetworkProcess/NetworkLoadParameters.h:
215         * NetworkProcess/NetworkResourceLoadParameters.cpp:
216         (WebKit::NetworkResourceLoadParameters::encode const):
217         (WebKit::NetworkResourceLoadParameters::decode):
218         * NetworkProcess/NetworkResourceLoadParameters.h:
219         * NetworkProcess/NetworkResourceLoader.cpp:
220         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
221         * NetworkProcess/PingLoad.cpp:
222         (WebKit::PingLoad::PingLoad):
223         (WebKit::PingLoad::didReceiveChallenge):
224         * Shared/Authentication/AuthenticationManager.cpp:
225         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
226         * Shared/Authentication/AuthenticationManager.h:
227         * UIProcess/Network/NetworkProcessProxy.cpp:
228         (WebKit::NetworkProcessProxy::processAuthenticationChallenge):
229         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
230         * UIProcess/Network/NetworkProcessProxy.h:
231         * UIProcess/Network/NetworkProcessProxy.messages.in:
232         * UIProcess/WebPageProxy.cpp:
233         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
234         * UIProcess/WebPageProxy.h:
235         * WebProcess/Network/WebLoaderStrategy.cpp:
236         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
237         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
238         (WebKit::WebLoaderStrategy::startPingLoad):
239
240 2019-08-29  Chris Dumez  <cdumez@apple.com>
241
242         Dissociate the WebPageProxy's identifier from the WebPage's
243         https://bugs.webkit.org/show_bug.cgi?id=201233
244
245         Reviewed by Alex Christensen.
246
247         Dissociate the WebPageProxy's identifier from the WebPage's. This will allow bumping the
248         WebPage's identifier everytime we create a WebPage in a new process in case of process
249         swap on navigation (Bug 201225).
250
251         * Shared/WebBackForwardListItem.cpp:
252         (WebKit::WebBackForwardListItem::create):
253         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
254         * Shared/WebBackForwardListItem.h:
255         (WebKit::WebBackForwardListItem::pageID const):
256         * UIProcess/API/C/WKPage.cpp:
257         (WKPageSetPageLoaderClient):
258         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
259         (-[WKBrowsingContextController handle]):
260         * UIProcess/API/Cocoa/WKWebView.mm:
261         (-[WKWebView dealloc]):
262         (-[WKWebView _didCommitLayerTree:]):
263         (-[WKWebView _dispatchSetViewLayoutSize:]):
264         (-[WKWebView _cancelAnimatedResize]):
265         (-[WKWebView _remoteObjectRegistry]):
266         (-[WKWebView _handle]):
267         (-[WKWebView _focusTextInputContext:completionHandler:]):
268         (-[WKWebView _endAnimatedResize]):
269         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
270         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
271         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
272         (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
273         * UIProcess/API/glib/WebKitWebContext.cpp:
274         (webkitWebContextGetWebViewForPage):
275         * UIProcess/API/glib/WebKitWebView.cpp:
276         (webkit_web_view_get_page_id):
277         * UIProcess/Automation/WebAutomationSession.cpp:
278         (WebKit::WebAutomationSession::handleForWebPageProxy):
279         (WebKit::WebAutomationSession::switchToBrowsingContext):
280         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
281         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
282         (WebKit::WebAutomationSession::navigationOccurredForFrame):
283         (WebKit::WebAutomationSession::documentLoadedForFrame):
284         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
285         (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
286         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
287         (WebKit::WebAutomationSession::willClosePage):
288         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
289         (WebKit::WebAutomationSession::resolveChildFrameHandle):
290         (WebKit::WebAutomationSession::resolveParentFrameHandle):
291         (WebKit::WebAutomationSession::computeElementLayout):
292         (WebKit::WebAutomationSession::selectOptionElement):
293         (WebKit::WebAutomationSession::getAllCookies):
294         (WebKit::WebAutomationSession::deleteSingleCookie):
295         (WebKit::WebAutomationSession::inputDispatcherForPage):
296         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
297         (WebKit::WebAutomationSession::simulateMouseInteraction):
298         (WebKit::WebAutomationSession::simulateKeyboardInteraction):
299         (WebKit::WebAutomationSession::performMouseInteraction):
300         (WebKit::WebAutomationSession::performKeyboardInteractions):
301         (WebKit::WebAutomationSession::takeScreenshot):
302         * UIProcess/Automation/WebAutomationSession.h:
303         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
304         (WebKit::WebAutomationSession::inspectBrowsingContext):
305         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
306         (WebKit::PlaybackSessionManagerProxy::PlaybackSessionManagerProxy):
307         (WebKit::PlaybackSessionManagerProxy::invalidate):
308         * UIProcess/Cocoa/TextCheckingController.mm:
309         (WebKit::TextCheckingController::replaceRelativeToSelection):
310         (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
311         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
312         (WebKit::VideoFullscreenManagerProxy::VideoFullscreenManagerProxy):
313         (WebKit::VideoFullscreenManagerProxy::invalidate):
314         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
315         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
316         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
317         (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver):
318         (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver):
319         (WebKit::WebPageProxy::speakingErrorOccurred):
320         (WebKit::WebPageProxy::boundaryEventOccurred):
321         (WebKit::WebPageProxy::voicesDidChange):
322         * UIProcess/Cocoa/WebViewImpl.mm:
323         (WebKit::WebViewImpl::~WebViewImpl):
324         (WebKit::WebViewImpl::windowDidOrderOffScreen):
325         (WebKit::WebViewImpl::windowDidOrderOnScreen):
326         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
327         (WebKit::WebViewImpl::viewDidHide):
328         (WebKit::WebViewImpl::viewDidUnhide):
329         (WebKit::WebViewImpl::activeSpaceDidChange):
330         (WebKit::WebViewImpl::remoteObjectRegistry):
331         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
332         (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
333         * UIProcess/InspectorTargetProxy.cpp:
334         (WebKit::InspectorTargetProxy::connect):
335         (WebKit::InspectorTargetProxy::disconnect):
336         (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
337         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
338         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
339         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
340         (WebKit::WebNotificationManagerProxy::show):
341         (WebKit::WebNotificationManagerProxy::cancel):
342         (WebKit::WebNotificationManagerProxy::didDestroyNotification):
343         (WebKit::pageIDsMatch):
344         (WebKit::pageAndNotificationIDsMatch):
345         (WebKit::WebNotificationManagerProxy::clearNotifications):
346         (WebKit::WebNotificationManagerProxy::providerDidShowNotification):
347         (WebKit::WebNotificationManagerProxy::providerDidClickNotification):
348         * UIProcess/Notifications/WebNotificationManagerProxy.h:
349         * UIProcess/ProvisionalPageProxy.cpp:
350         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
351         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
352         (WebKit::ProvisionalPageProxy::processDidTerminate):
353         (WebKit::ProvisionalPageProxy::cancel):
354         (WebKit::ProvisionalPageProxy::initializeWebPage):
355         (WebKit::ProvisionalPageProxy::loadData):
356         (WebKit::ProvisionalPageProxy::loadRequest):
357         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
358         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
359         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
360         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
361         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
362         * UIProcess/ProvisionalPageProxy.h:
363         * UIProcess/RemoteWebInspectorProxy.cpp:
364         (WebKit::RemoteWebInspectorProxy::load):
365         (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
366         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
367         (WebKit::RemoteWebInspectorProxy::closeFrontendPageAndWindow):
368         * UIProcess/SuspendedPageProxy.cpp:
369         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
370         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
371         (WebKit::SuspendedPageProxy::unsuspend):
372         (WebKit::SuspendedPageProxy::close):
373         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
374         (WebKit::SuspendedPageProxy::loggingString const):
375         * UIProcess/SuspendedPageProxy.h:
376         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
377         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
378         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
379         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
380         * UIProcess/ViewGestureController.cpp:
381         (WebKit::ViewGestureController::ViewGestureController):
382         (WebKit::ViewGestureController::~ViewGestureController):
383         (WebKit::ViewGestureController::disconnectFromProcess):
384         (WebKit::ViewGestureController::connectToProcess):
385         (WebKit::ViewGestureController::controllerForGesture):
386         (WebKit::ViewGestureController::forceRepaintIfNeeded):
387         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
388         * UIProcess/ViewGestureController.h:
389         * UIProcess/VisitedLinkStore.cpp:
390         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
391         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
392         (WebKit::WebAuthenticatorCoordinatorProxy::WebAuthenticatorCoordinatorProxy):
393         (WebKit::WebAuthenticatorCoordinatorProxy::~WebAuthenticatorCoordinatorProxy):
394         * UIProcess/WebBackForwardList.cpp:
395         (WebKit::WebBackForwardList::itemForID):
396         (WebKit::WebBackForwardList::restoreFromState):
397         * UIProcess/WebEditCommandProxy.cpp:
398         (WebKit::WebEditCommandProxy::unapply):
399         (WebKit::WebEditCommandProxy::reapply):
400         * UIProcess/WebFrameProxy.cpp:
401         (WebKit::WebFrameProxy::loadURL):
402         (WebKit::WebFrameProxy::loadData):
403         (WebKit::WebFrameProxy::stopLoading const):
404         (WebKit::WebFrameProxy::collapseSelection):
405         * UIProcess/WebFullScreenManagerProxy.cpp:
406         (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
407         (WebKit::WebFullScreenManagerProxy::~WebFullScreenManagerProxy):
408         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
409         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
410         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
411         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
412         (WebKit::WebFullScreenManagerProxy::setAnimatingFullScreen):
413         (WebKit::WebFullScreenManagerProxy::requestExitFullScreen):
414         (WebKit::WebFullScreenManagerProxy::saveScrollPosition):
415         (WebKit::WebFullScreenManagerProxy::restoreScrollPosition):
416         (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
417         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
418         (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
419         * UIProcess/WebInspectorProxy.cpp:
420         (WebKit::WebInspectorProxy::WebInspectorProxy):
421         (WebKit::WebInspectorProxy::invalidate):
422         (WebKit::WebInspectorProxy::sendMessageToFrontend):
423         (WebKit::WebInspectorProxy::connect):
424         (WebKit::WebInspectorProxy::close):
425         (WebKit::WebInspectorProxy::reset):
426         (WebKit::WebInspectorProxy::updateForNewPageProcess):
427         (WebKit::WebInspectorProxy::setFrontendConnection):
428         (WebKit::WebInspectorProxy::showConsole):
429         (WebKit::WebInspectorProxy::showResources):
430         (WebKit::WebInspectorProxy::showMainResourceForFrame):
431         (WebKit::WebInspectorProxy::attach):
432         (WebKit::WebInspectorProxy::detach):
433         (WebKit::WebInspectorProxy::togglePageProfiling):
434         (WebKit::WebInspectorProxy::toggleElementSelection):
435         (WebKit::WebInspectorProxy::createFrontendPage):
436         (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
437         (WebKit::WebInspectorProxy::open):
438         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
439         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
440         * UIProcess/WebPageProxy.cpp:
441         (WebKit::WebPageProxy::WebPageProxy):
442         (WebKit::m_resetRecentCrashCountTimer):
443         (WebKit::WebPageProxy::~WebPageProxy):
444         (WebKit::WebPageProxy::setUIClient):
445         (WebKit::WebPageProxy::setIconLoadingClient):
446         (WebKit::WebPageProxy::launchProcess):
447         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
448         (WebKit::WebPageProxy::swapToWebProcess):
449         (WebKit::WebPageProxy::launchProcessForReload):
450         (WebKit::WebPageProxy::launchProcessWithItem):
451         (WebKit::WebPageProxy::initializeWebPage):
452         (WebKit::WebPageProxy::close):
453         (WebKit::WebPageProxy::tryClose):
454         (WebKit::WebPageProxy::loadRequest):
455         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
456         (WebKit::WebPageProxy::loadFile):
457         (WebKit::WebPageProxy::loadData):
458         (WebKit::WebPageProxy::loadDataWithNavigationShared):
459         (WebKit::WebPageProxy::loadAlternateHTML):
460         (WebKit::WebPageProxy::loadWebArchiveData):
461         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
462         (WebKit::WebPageProxy::stopLoading):
463         (WebKit::WebPageProxy::reload):
464         (WebKit::WebPageProxy::goToBackForwardItem):
465         (WebKit::WebPageProxy::tryRestoreScrollPosition):
466         (WebKit::WebPageProxy::setControlledByAutomation):
467         (WebKit::WebPageProxy::setIndicating):
468         (WebKit::WebPageProxy::createInspectorTargets):
469         (WebKit::WebPageProxy::setBackgroundColor):
470         (WebKit::WebPageProxy::setTopContentInset):
471         (WebKit::WebPageProxy::setUnderlayColor):
472         (WebKit::WebPageProxy::viewWillStartLiveResize):
473         (WebKit::WebPageProxy::viewWillEndLiveResize):
474         (WebKit::WebPageProxy::activityStateDidChange):
475         (WebKit::WebPageProxy::viewDidEnterWindow):
476         (WebKit::WebPageProxy::dispatchActivityStateChange):
477         (WebKit::WebPageProxy::layerHostingModeDidChange):
478         (WebKit::WebPageProxy::setInitialFocus):
479         (WebKit::WebPageProxy::clearSelection):
480         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
481         (WebKit::WebPageProxy::validateCommand):
482         (WebKit::WebPageProxy::increaseListLevel):
483         (WebKit::WebPageProxy::decreaseListLevel):
484         (WebKit::WebPageProxy::changeListType):
485         (WebKit::WebPageProxy::setBaseWritingDirection):
486         (WebKit::WebPageProxy::setNeedsFontAttributes):
487         (WebKit::WebPageProxy::scheduleFullEditorStateUpdate):
488         (WebKit::WebPageProxy::selectAll):
489         (WebKit::WebPageProxy::executeEditCommand):
490         (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
491         (WebKit::WebPageProxy::setEditable):
492         (WebKit::WebPageProxy::performDragControllerAction):
493         (WebKit::WebPageProxy::dragEnded):
494         (WebKit::WebPageProxy::didStartDrag):
495         (WebKit::WebPageProxy::dragCancelled):
496         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
497         (WebKit::WebPageProxy::sendWheelEvent):
498         (WebKit::WebPageProxy::handleKeyboardEvent):
499         (WebKit::WebPageProxy::handleGestureEvent):
500         (WebKit::WebPageProxy::handleTouchEventSynchronously):
501         (WebKit::WebPageProxy::resetPotentialTapSecurityOrigin):
502         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
503         (WebKit::WebPageProxy::handleTouchEvent):
504         (WebKit::WebPageProxy::cancelPointer):
505         (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
506         (WebKit::WebPageProxy::scrollBy):
507         (WebKit::WebPageProxy::centerSelectionInVisibleArea):
508         (WebKit::WebPageProxy::commitProvisionalPage):
509         (WebKit::WebPageProxy::continueNavigationInNewProcess):
510         (WebKit::WebPageProxy::setUserAgent):
511         (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
512         (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
513         (WebKit::WebPageProxy::setCustomTextEncodingName):
514         (WebKit::WebPageProxy::restoreFromSessionState):
515         (WebKit::WebPageProxy::setTextZoomFactor):
516         (WebKit::WebPageProxy::setPageZoomFactor):
517         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
518         (WebKit::WebPageProxy::scalePage):
519         (WebKit::WebPageProxy::scalePageInViewCoordinates):
520         (WebKit::WebPageProxy::scaleView):
521         (WebKit::WebPageProxy::windowScreenDidChange):
522         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
523         (WebKit::WebPageProxy::setUseFixedLayout):
524         (WebKit::WebPageProxy::setFixedLayoutSize):
525         (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
526         (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
527         (WebKit::WebPageProxy::listenForLayoutMilestones):
528         (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
529         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
530         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
531         (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
532         (WebKit::WebPageProxy::setPaginationMode):
533         (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
534         (WebKit::WebPageProxy::setPageLength):
535         (WebKit::WebPageProxy::setGapBetweenPages):
536         (WebKit::WebPageProxy::setPaginationLineGridEnabled):
537         (WebKit::WebPageProxy::findStringMatches):
538         (WebKit::WebPageProxy::findString):
539         (WebKit::WebPageProxy::getImageForFindMatch):
540         (WebKit::WebPageProxy::selectFindMatch):
541         (WebKit::WebPageProxy::indicateFindMatch):
542         (WebKit::WebPageProxy::hideFindUI):
543         (WebKit::WebPageProxy::countStringMatches):
544         (WebKit::WebPageProxy::replaceMatches):
545         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
546         (WebKit::WebPageProxy::runJavaScriptInFrame):
547         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
548         (WebKit::WebPageProxy::getSourceForFrame):
549         (WebKit::WebPageProxy::getContentsAsString):
550         (WebKit::WebPageProxy::getContentsAsAttributedString):
551         (WebKit::WebPageProxy::getBytecodeProfile):
552         (WebKit::WebPageProxy::getSamplingProfilerOutput):
553         (WebKit::WebPageProxy::getContentsAsMHTMLData):
554         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
555         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
556         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
557         (WebKit::WebPageProxy::getResourceDataFromFrame):
558         (WebKit::WebPageProxy::getWebArchiveOfFrame):
559         (WebKit::WebPageProxy::forceRepaint):
560         (WebKit::WebPageProxy::preferencesDidChange):
561         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
562         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
563         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
564         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
565         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
566         (WebKit::WebPageProxy::didCommitLoadForFrame):
567         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
568         (WebKit::WebPageProxy::didFinishLoadForFrame):
569         (WebKit::WebPageProxy::didFailLoadForFrame):
570         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
571         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
572         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
573         (WebKit::WebPageProxy::decidePolicyForResponseShared):
574         (WebKit::WebPageProxy::willSubmitForm):
575         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
576         (WebKit::WebPageProxy::didPerformClientRedirectShared):
577         (WebKit::WebPageProxy::didPerformServerRedirectShared):
578         (WebKit::trySOAuthorization):
579         (WebKit::WebPageProxy::createNewPage):
580         (WebKit::WebPageProxy::showShareSheet):
581         (WebKit::WebPageProxy::setMediaVolume):
582         (WebKit::WebPageProxy::setMuted):
583         (WebKit::WebPageProxy::stopMediaCapture):
584         (WebKit::WebPageProxy::stopAllMediaPlayback):
585         (WebKit::WebPageProxy::suspendAllMediaPlayback):
586         (WebKit::WebPageProxy::resumeAllMediaPlayback):
587         (WebKit::WebPageProxy::handleMediaEvent):
588         (WebKit::WebPageProxy::setVolumeOfMediaElement):
589         (WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
590         (WebKit::WebPageProxy::didChooseColor):
591         (WebKit::WebPageProxy::didEndColorPicker):
592         (WebKit::WebPageProxy::didCloseSuggestions):
593         (WebKit::WebPageProxy::didSelectOption):
594         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
595         (WebKit::WebPageProxy::backForwardAddItem):
596         (WebKit::WebPageProxy::messageSenderDestinationID const):
597         (WebKit::WebPageProxy::valueChangedForPopupMenu):
598         (WebKit::WebPageProxy::setTextFromItemForPopupMenu):
599         (WebKit::WebPageProxy::postMessageToInjectedBundle):
600         (WebKit::WebPageProxy::failedToShowPopupMenu):
601         (WebKit::WebPageProxy::showContextMenu):
602         (WebKit::WebPageProxy::contextMenuItemSelected):
603         (WebKit::WebPageProxy::handleContextMenuKeyEvent):
604         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
605         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
606         (WebKit::WebPageProxy::didCancelForOpenPanel):
607         (WebKit::WebPageProxy::advanceToNextMisspelling):
608         (WebKit::WebPageProxy::changeSpellingToWord):
609         (WebKit::WebPageProxy::removeEditCommand):
610         (WebKit::WebPageProxy::didFinishCheckingText):
611         (WebKit::WebPageProxy::didCancelCheckingText):
612         (WebKit::WebPageProxy::didReceiveEvent):
613         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
614         (WebKit::WebPageProxy::processDidBecomeResponsive):
615         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
616         (WebKit::WebPageProxy::gamepadActivity):
617         (WebKit::WebPageProxy::updateWebsitePolicies):
618         (WebKit::WebPageProxy::backForwardRemovedItem):
619         (WebKit::WebPageProxy::setCanRunModal):
620         (WebKit::WebPageProxy::beginPrinting):
621         (WebKit::WebPageProxy::endPrinting):
622         (WebKit::WebPageProxy::computePagesForPrinting):
623         (WebKit::WebPageProxy::drawRectToImage):
624         (WebKit::WebPageProxy::drawPagesToPDF):
625         (WebKit::WebPageProxy::drawPagesForPrinting):
626         (WebKit::WebPageProxy::setMinimumSizeForAutoLayout):
627         (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
628         (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
629         (WebKit::WebPageProxy::handleAlternativeTextUIResult):
630         (WebKit::WebPageProxy::setComposition):
631         (WebKit::WebPageProxy::confirmComposition):
632         (WebKit::WebPageProxy::cancelComposition):
633         (WebKit::WebPageProxy::setScrollPinningBehavior):
634         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
635         (WebKit::WebPageProxy::addMIMETypeWithCustomContentProvider):
636         (WebKit::WebPageProxy::changeFontAttributes):
637         (WebKit::WebPageProxy::changeFont):
638         (WebKit::WebPageProxy::setTextAsync):
639         (WebKit::WebPageProxy::insertTextAsync):
640         (WebKit::WebPageProxy::hasMarkedText):
641         (WebKit::WebPageProxy::getMarkedRangeAsync):
642         (WebKit::WebPageProxy::getSelectedRangeAsync):
643         (WebKit::WebPageProxy::characterIndexForPointAsync):
644         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
645         (WebKit::WebPageProxy::setCompositionAsync):
646         (WebKit::WebPageProxy::confirmCompositionAsync):
647         (WebKit::WebPageProxy::takeSnapshot):
648         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
649         (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
650         (WebKit::WebPageProxy::immediateActionDidUpdate):
651         (WebKit::WebPageProxy::immediateActionDidCancel):
652         (WebKit::WebPageProxy::immediateActionDidComplete):
653         (WebKit::WebPageProxy::handleAcceptedCandidate):
654         (WebKit::WebPageProxy::setUseSystemAppearance):
655         (WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
656         (WebKit::WebPageProxy::setFooterBannerHeightForTesting):
657         (WebKit::WebPageProxy::setShouldDispatchFakeMouseMoveEvents):
658         (WebKit::WebPageProxy::setPlaybackTarget):
659         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
660         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
661         (WebKit::WebPageProxy::clearWheelEventTestTrigger):
662         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
663         (WebKit::WebPageProxy::getLoadDecisionForIcon):
664         (WebKit::WebPageProxy::setResourceCachingDisabled):
665         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
666         (WebKit::WebPageProxy::didAllowPointerLock):
667         (WebKit::WebPageProxy::didDenyPointerLock):
668         (WebKit::WebPageProxy::requestPointerUnlock):
669         (WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
670         (WebKit::WebPageProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
671         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
672         (WebKit::WebPageProxy::insertAttachment):
673         (WebKit::WebPageProxy::updateAttachmentAttributes):
674         (WebKit::WebPageProxy::getApplicationManifest):
675         (WebKit::WebPageProxy::setDefersLoadingForTesting):
676         (WebKit::WebPageProxy::updateCurrentModifierState):
677         (WebKit::WebPageProxy::simulateDeviceOrientationChange):
678         (WebKit::WebPageProxy::detectDataInAllFrames):
679         (WebKit::WebPageProxy::removeDataDetectedLinks):
680         (WebKit::WebPageProxy::textInputContextsInRect):
681         (WebKit::WebPageProxy::focusTextInputContext):
682         * UIProcess/WebPageProxy.h:
683         (WebKit::WebPageProxy::identifier const):
684         (WebKit::WebPageProxy::webPageID const):
685         * UIProcess/WebPageProxyIdentifier.h: Added.
686         * UIProcess/WebProcessPool.cpp:
687         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
688         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
689         * UIProcess/WebProcessPool.h:
690         * UIProcess/WebProcessProxy.cpp:
691         (WebKit::WebProcessProxy::webPage):
692         (WebKit::WebProcessProxy::addExistingWebPage):
693         (WebKit::WebProcessProxy::removeWebPage):
694         (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
695         (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
696         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
697         (WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
698         (WebKit::WebProcessProxy::transformObjectsToHandles):
699         * UIProcess/WebProcessProxy.h:
700         * UIProcess/WebURLSchemeHandler.cpp:
701         (WebKit::WebURLSchemeHandler::startTask):
702         (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
703         (WebKit::WebURLSchemeHandler::stopTask):
704         (WebKit::WebURLSchemeHandler::removeTaskFromPageMap):
705         * UIProcess/WebURLSchemeHandler.h:
706         * UIProcess/WebURLSchemeTask.cpp:
707         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
708         (WebKit::WebURLSchemeTask::didPerformRedirection):
709         (WebKit::WebURLSchemeTask::didReceiveResponse):
710         (WebKit::WebURLSchemeTask::didReceiveData):
711         (WebKit::WebURLSchemeTask::didComplete):
712         * UIProcess/WebURLSchemeTask.h:
713         (WebKit::WebURLSchemeTask::pageID const):
714         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
715         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
716         * UIProcess/WebsiteData/WebsiteDataStore.h:
717         * UIProcess/gtk/WebPageProxyGtk.cpp:
718         (WebKit::WebPageProxy::getCenterForZoomGesture):
719         * UIProcess/ios/EditableImageController.mm:
720         (WebKit::EditableImageController::EditableImageController):
721         (WebKit::EditableImageController::~EditableImageController):
722         * UIProcess/ios/SmartMagnificationController.mm:
723         (WebKit::SmartMagnificationController::SmartMagnificationController):
724         (WebKit::SmartMagnificationController::~SmartMagnificationController):
725         (WebKit::SmartMagnificationController::handleSmartMagnificationGesture):
726         * UIProcess/ios/ViewGestureControllerIOS.mm:
727         (WebKit::ViewGestureController::beginSwipeGesture):
728         (WebKit::ViewGestureController::endSwipeGesture):
729         * UIProcess/ios/WKContentView.mm:
730         (-[WKContentView _wk_printedDocument]):
731         * UIProcess/ios/WKContentViewInteraction.mm:
732         (-[WKContentView ensurePositionInformationIsUpToDate:]):
733         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
734         * UIProcess/ios/WebPageProxyIOS.mm:
735         (WebKit::WebPageProxy::requestFocusedElementInformation):
736         (WebKit::WebPageProxy::updateVisibleContentRects):
737         (WebKit::WebPageProxy::resendLastVisibleContentRects):
738         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
739         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
740         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
741         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
742         (WebKit::WebPageProxy::setDeviceOrientation):
743         (WebKit::WebPageProxy::setOverrideViewportArguments):
744         (WebKit::WebPageProxy::selectWithGesture):
745         (WebKit::WebPageProxy::updateSelectionWithTouches):
746         (WebKit::WebPageProxy::replaceDictatedText):
747         (WebKit::WebPageProxy::replaceSelectedText):
748         (WebKit::WebPageProxy::requestAutocorrectionData):
749         (WebKit::WebPageProxy::applyAutocorrection):
750         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
751         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
752         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
753         (WebKit::WebPageProxy::selectPositionAtPoint):
754         (WebKit::WebPageProxy::beginSelectionInDirection):
755         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
756         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
757         (WebKit::WebPageProxy::requestDictationContext):
758         (WebKit::WebPageProxy::requestAutocorrectionContext):
759         (WebKit::WebPageProxy::getSelectionContext):
760         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
761         (WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
762         (WebKit::WebPageProxy::selectWithTwoTouches):
763         (WebKit::WebPageProxy::requestPositionInformation):
764         (WebKit::WebPageProxy::startInteractionWithElementAtPosition):
765         (WebKit::WebPageProxy::stopInteraction):
766         (WebKit::WebPageProxy::performActionOnElement):
767         (WebKit::WebPageProxy::applicationDidEnterBackground):
768         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
769         (WebKit::WebPageProxy::applicationWillEnterForeground):
770         (WebKit::WebPageProxy::applicationWillResignActive):
771         (WebKit::WebPageProxy::applicationDidBecomeActive):
772         (WebKit::WebPageProxy::extendSelection):
773         (WebKit::WebPageProxy::selectWordBackward):
774         (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
775         (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
776         (WebKit::WebPageProxy::storeSelectionForAccessibility):
777         (WebKit::WebPageProxy::startAutoscrollAtPosition):
778         (WebKit::WebPageProxy::cancelAutoscroll):
779         (WebKit::WebPageProxy::moveSelectionByOffset):
780         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
781         (WebKit::WebPageProxy::willStartUserTriggeredZooming):
782         (WebKit::WebPageProxy::potentialTapAtPosition):
783         (WebKit::WebPageProxy::commitPotentialTap):
784         (WebKit::WebPageProxy::cancelPotentialTap):
785         (WebKit::WebPageProxy::tapHighlightAtPosition):
786         (WebKit::WebPageProxy::handleTap):
787         (WebKit::WebPageProxy::didRecognizeLongPress):
788         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
789         (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
790         (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
791         (WebKit::WebPageProxy::blurFocusedElement):
792         (WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
793         (WebKit::WebPageProxy::autofillLoginCredentials):
794         (WebKit::WebPageProxy::focusNextFocusedElement):
795         (WebKit::WebPageProxy::setFocusedElementValue):
796         (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
797         (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
798         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
799         (WebKit::WebPageProxy::contentSizeCategoryDidChange):
800         (WebKit::WebPageProxy::generateSyntheticEditingCommand):
801         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
802         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
803         (WebKit::WebPageProxy::updateSelectionWithDelta):
804         (WebKit::WebPageProxy::requestDocumentEditingContext):
805         (WebKit::WebPageProxy::requestDragStart):
806         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
807         (WebKit::WebPageProxy::didConcludeDrop):
808         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
809         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
810         (WebKit::RemoteWebInspectorProxy::platformSave):
811         (WebKit::RemoteWebInspectorProxy::platformAppend):
812         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
813         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
814         * UIProcess/mac/ViewGestureControllerMac.mm:
815         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
816         (WebKit::ViewGestureController::handleSmartMagnificationGesture):
817         * UIProcess/mac/WKImmediateActionController.mm:
818         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
819         * UIProcess/mac/WebInspectorProxyMac.mm:
820         (WebKit::WebInspectorProxy::platformSave):
821         (WebKit::WebInspectorProxy::platformAppend):
822         * UIProcess/mac/WebPageProxyMac.mm:
823         (WebKit::WebPageProxy::windowAndViewFramesChanged):
824         (WebKit::WebPageProxy::setMainFrameIsScrollable):
825         (WebKit::WebPageProxy::insertDictatedTextAsync):
826         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
827         (WebKit::WebPageProxy::fontAtSelection):
828         (WebKit::WebPageProxy::stringSelectionForPasteboard):
829         (WebKit::WebPageProxy::dataSelectionForPasteboard):
830         (WebKit::WebPageProxy::readSelectionFromPasteboard):
831         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
832         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
833         (WebKit::WebPageProxy::uppercaseWord):
834         (WebKit::WebPageProxy::lowercaseWord):
835         (WebKit::WebPageProxy::capitalizeWord):
836         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
837         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
838         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
839         (WebKit::WebPageProxy::acceptsFirstMouse):
840         * WebKit.xcodeproj/project.pbxproj:
841
842 2019-08-29  Chris Dumez  <cdumez@apple.com>
843
844         Use inline data member initialization in ProcessLauncher
845         https://bugs.webkit.org/show_bug.cgi?id=201247
846
847         Reviewed by Ryosuke Niwa.
848
849         * UIProcess/Launcher/ProcessLauncher.cpp:
850         (WebKit::ProcessLauncher::ProcessLauncher):
851         * UIProcess/Launcher/ProcessLauncher.h:
852
853 2019-08-28  Tim Horton  <timothy_horton@apple.com>
854
855         Reloading a web view with a fixed-width viewport and variable content width restores the previous page scale, shouldn't
856         https://bugs.webkit.org/show_bug.cgi?id=201256
857         <rdar://problem/54809509>
858
859         Reviewed by Simon Fraser.
860
861         * WebProcess/WebPage/ios/WebPageIOS.mm:
862         (WebKit::WebPage::restorePageState):
863         When restoring page state from a history item, if the saved scale was equal to the
864         initial scale at the time it was saved, ignore the saved scale and use the current
865         initial scale instead.
866
867         Normally this doesn't matter because a given page's initial scale doesn't usually change
868         between loads, but it totally can! See the test for one example of a way an API client
869         might cause this; you could also imagine something similar happening if the actual
870         page content changed.
871
872 2019-08-28  Megan Gardner  <megan_gardner@apple.com>
873
874         Null check webFrame when creating a print preview to prevent a crash.
875         https://bugs.webkit.org/show_bug.cgi?id=201237
876         <rdar://problem/51618863>
877
878         Reviewed by Tim Horton.
879
880         Move and expend a null check to keep from crashing when making a print preview.
881
882         * UIProcess/mac/WKPrintingView.mm:
883         (-[WKPrintingView _drawPreview:]):
884         (-[WKPrintingView drawRect:]):
885
886 2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
887
888         All image drawing functions should take an argument of type ImagePaintingOptions
889         https://bugs.webkit.org/show_bug.cgi?id=201059
890
891         Reviewed by Simon Fraser.
892
893         GraphicsContext::drawImage() now takes an ImagePaintingOptions.
894
895         * WebProcess/WebPage/ios/WebPageIOS.mm:
896         (WebKit::imagePositionInformation):
897
898 2019-08-28  Keith Rollin  <krollin@apple.com>
899
900         Remove support for macOS < 10.13 (part 2)
901         https://bugs.webkit.org/show_bug.cgi?id=201197
902         <rdar://problem/54759985>
903
904         Reviewed by Darin Adler.
905
906         Update conditionals that reference WK_MACOS_1013 and suffixes like
907         _MACOS_SINCE_1013, assuming that we're always building on 10.13 or
908         later and that these conditionals are always True or False.
909
910         See Bug 200694 for earlier changes in this area.
911
912         * Configurations/FeatureDefines.xcconfig:
913         * Configurations/WebKit.xcconfig:
914
915 2019-08-28  Chris Dumez  <cdumez@apple.com>
916
917         Have WebPageProxy generate the page identifier by itself
918         https://bugs.webkit.org/show_bug.cgi?id=201223
919
920         Reviewed by Ryosuke Niwa.
921
922         Have WebPageProxy generate the page identifier by itself instead of
923         having the WebProcessProxy do it.
924
925         * UIProcess/ServiceWorkerProcessProxy.cpp:
926         (WebKit::m_serviceWorkerPageID):
927         * UIProcess/WebPageProxy.cpp:
928         (WebKit::WebPageProxy::create):
929         (WebKit::WebPageProxy::WebPageProxy):
930         * UIProcess/WebPageProxy.h:
931         * UIProcess/WebProcessProxy.cpp:
932         (WebKit::WebProcessProxy::createWebPage):
933         (WebKit::WebProcessProxy::generatePageID): Deleted.
934         * UIProcess/WebProcessProxy.h:
935
936 2019-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
937
938         REGRESSION(r243434): Wrong URL passed to WebKitWebView::load-failed when cancelling previous load
939         https://bugs.webkit.org/show_bug.cgi?id=201176
940
941         Reviewed by Žan Doberšek.
942
943         Use the current provisional/committed url when faking an error event, instead of the current active URI that can
944         be the pending api request of a new load.
945
946         * UIProcess/API/glib/WebKitWebView.cpp:
947         (webkitWebViewWillStartLoad):
948
949 2019-08-28  Claudio Saavedra  <csaavedra@igalia.com>
950
951         [GTK][WPE] Implement HSTS for the soup network backend
952         https://bugs.webkit.org/show_bug.cgi?id=192074
953
954         Reviewed by Carlos Garcia Campos.
955
956         libsoup 2.67.1 introduced HSTS support via a SoupSessionFeature.
957         Add support to the soup network backend by adding the feature to
958         SoupNetworkSession and handling HSTS protocol upgrades, by
959         propagating the scheme change further to clients. This patch adds
960         the HSTS feature unconditionally, but it still possible to add
961         a boolean property to the web context class if desired.
962
963         Additionally, add API to the WebKitWebsiteDataManager to specify
964         the directory where the HSTS database is saved. If the directory
965         is not set or if the data manager is ephemeral, use a
966         non-persistent, memory only HSTS enforcer.
967
968         Implement as well the methods needed to clean-up and delete HSTS
969         policies from the storage and expose the feature in GTK+
970         MiniBrowser's about:data.
971
972         * NetworkProcess/NetworkProcess.cpp:
973         (WebKit::NetworkProcess::fetchWebsiteData):
974         (WebKit::NetworkProcess::deleteWebsiteData):
975         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
976         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
977         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
978         * NetworkProcess/NetworkProcess.h:
979         (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
980         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
981         (WebKit::NetworkDataTaskSoup::createRequest):
982         (WebKit::NetworkDataTaskSoup::clearRequest):
983         (WebKit::NetworkDataTaskSoup::shouldAllowHSTSPolicySetting const):
984         (WebKit::NetworkDataTaskSoup::shouldAllowHSTSProtocolUpgrade const):
985         (WebKit::NetworkDataTaskSoup::protocolUpgradedViaHSTS):
986         (WebKit::NetworkDataTaskSoup::hstsEnforced):
987         * NetworkProcess/soup/NetworkDataTaskSoup.h:
988         * NetworkProcess/soup/NetworkProcessSoup.cpp:
989         (WebKit::NetworkProcess::getHostNamesWithHSTSCache):
990         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
991         (WebKit::NetworkProcess::clearHSTSCache):
992         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
993         * UIProcess/API/APIWebsiteDataStore.h:
994         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
995         (API::WebsiteDataStore::defaultHSTSDirectory):
996         * UIProcess/API/glib/WebKitWebContext.cpp:
997         (webkitWebContextConstructed):
998         * UIProcess/API/glib/WebKitWebsiteData.cpp:
999         (recordContainsSupportedDataTypes):
1000         (toWebKitWebsiteDataTypes):
1001         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1002         (webkitWebsiteDataManagerGetProperty):
1003         (webkitWebsiteDataManagerSetProperty):
1004         (webkitWebsiteDataManagerConstructed):
1005         (webkit_website_data_manager_class_init):
1006         (webkitWebsiteDataManagerGetDataStore):
1007         (webkit_website_data_manager_get_hsts_cache_directory):
1008         (toWebsiteDataTypes):
1009         * UIProcess/API/gtk/WebKitWebsiteData.h:
1010         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1011         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1012         * UIProcess/API/wpe/WebKitWebsiteData.h:
1013         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
1014         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
1015         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
1016         (WebKit::WebsiteDataStoreConfiguration::copy):
1017         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
1018         (WebKit::WebsiteDataStoreConfiguration::hstsStorageDirectory const):
1019         (WebKit::WebsiteDataStoreConfiguration::setHSTSStorageDirectory):
1020
1021 2019-08-27  Mark Lam  <mark.lam@apple.com>
1022
1023         Refactor to use VM& instead of VM* at as many places as possible.
1024         https://bugs.webkit.org/show_bug.cgi?id=201172
1025
1026         Reviewed by Yusuke Suzuki.
1027
1028         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp:
1029         (webkit_dom_node_for_js_value):
1030         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1031         (WebKit::InjectedBundleNodeHandle::getOrCreate):
1032         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1033         (WebKit::JSNPObject::getOwnPropertyNames):
1034         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1035         (WebKit::identifierFromIdentifierRep):
1036         (WebKit::NPJSObject::enumerate):
1037         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1038         (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
1039         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
1040         * WebProcess/WebPage/WebFrame.cpp:
1041         (WebKit::WebFrame::counterValue):
1042
1043 2019-08-27  James Savage  <james.savage@apple.com>
1044
1045         Populate alternate URL for _WKActivatedElementInfo in UIContextMenu SPI.
1046         https://bugs.webkit.org/show_bug.cgi?id=201165.
1047         rdar://problem/54729648.
1048
1049         Reviewed by Dean Jackson.
1050
1051         * UIProcess/API/APIContextMenuElementInfo.h:
1052         * UIProcess/API/APIContextMenuElementInfo.cpp:
1053         (API::ContextMenuElementInfo::ContextMenuElementInfo): Initialize new memeber.
1054
1055         * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm:
1056         (-[WKContextMenuElementInfo _activatedElementInfo]): Use new initializer.
1057
1058         * UIProcess/API/Cocoa/WKWebView.mm:
1059         (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): Ditto.
1060
1061         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
1062         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1063         (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:userInfo:]):
1064             Ditto.
1065         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:userInfo:]): Set new ivar.
1066         (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:]): Deleted.
1067         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]): Deleted.
1068
1069         * UIProcess/ios/WKContentViewInteraction.mm:
1070         (-[WKContentView assignLegacyDataForContextMenuInteraction]): Use new initializer.
1071         (-[WKContentView continueContextMenuInteraction:]): If the context menu is being generated for
1072             an image, and we do not have a URL associated with the position information, try to
1073             generate one using existing SPI. This change also passes through the userInfo via a new
1074             property on _WKActivatedElementInfo. We only do this for the SPI version of this delegate
1075             method, because the API is not called for image previews.
1076         (-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]): Use new
1077             initializer.
1078
1079 2019-08-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1080
1081         [RemoteInspector][Socket] Restructuring the components of Socket implementation
1082         https://bugs.webkit.org/show_bug.cgi?id=201079
1083
1084         Reviewed by Ross Kirsling.
1085
1086         RemoteInspectorClient is now free from creation of SocketEndpoint. All communication
1087         to SocketEndpoint id now the duty of super class.
1088
1089         * UIProcess/socket/RemoteInspectorClient.cpp:
1090         (WebKit::RemoteInspectorClient::RemoteInspectorClient): Remove direct communication to Socket Endpoint.
1091         (WebKit::RemoteInspectorClient::sendWebInspectorEvent): Ditto.
1092         * UIProcess/socket/RemoteInspectorClient.h:
1093
1094 2019-08-27  Chris Dumez  <cdumez@apple.com>
1095
1096         Introduce subclasses to RemoteObjectRegistry for the UIProcess and the WebProcess
1097         https://bugs.webkit.org/show_bug.cgi?id=201153
1098
1099         Reviewed by Alex Christensen.
1100
1101         This better factoring improves code clarity.
1102
1103         * PlatformMac.cmake:
1104         * Shared/API/Cocoa/RemoteObjectRegistry.h:
1105         (WebKit::RemoteObjectRegistry::~RemoteObjectRegistry):
1106         (WebKit::RemoteObjectRegistry::takeBackgroundActivityToken):
1107         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
1108         (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
1109         (WebKit::RemoteObjectRegistry::sendInvocation):
1110         (WebKit::RemoteObjectRegistry::sendReplyBlock):
1111         (WebKit::RemoteObjectRegistry::sendUnusedReply):
1112         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1113         (-[_WKRemoteObjectRegistry _initWithWebPage:]):
1114         (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
1115         * SourcesCocoa.txt:
1116         * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp: Added.
1117         (WebKit::UIRemoteObjectRegistry::takeBackgroundActivityToken):
1118         (WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry):
1119         (WebKit::UIRemoteObjectRegistry::sendInvocation):
1120         (WebKit::UIRemoteObjectRegistry::messageSender):
1121         * UIProcess/Cocoa/UIRemoteObjectRegistry.h: Added.
1122         * WebKit.xcodeproj/project.pbxproj:
1123         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1124         (WebKit::WebPage::setRemoteObjectRegistry):
1125         (WebKit::WebPage::remoteObjectRegistry):
1126         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp: Added.
1127         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
1128         (WebKit::WebRemoteObjectRegistry::~WebRemoteObjectRegistry):
1129         (WebKit::WebRemoteObjectRegistry::close):
1130         (WebKit::WebRemoteObjectRegistry::messageSender):
1131         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.h: Added.
1132         * WebProcess/WebPage/WebPage.cpp:
1133         (WebKit::WebPage::close):
1134         * WebProcess/WebPage/WebPage.h:
1135
1136 2019-08-26  Jer Noble  <jer.noble@apple.com>
1137
1138         Removing fullscreen element in rAF() callback after requestFullscreen() can leave fullscreen in inconsistent state.
1139         https://bugs.webkit.org/show_bug.cgi?id=201101
1140         <rdar://problem/54164587>
1141
1142         Reviewed by Eric Carlson.
1143
1144         Add more state to track in which direction the animation is flowing to allow in-process
1145         animations to be cancelled more gracefully.
1146
1147         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1148         (-[WKFullScreenWindowController enterFullScreen]):
1149         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1150         (-[WKFullScreenWindowController requestExitFullScreen]):
1151         (-[WKFullScreenWindowController exitFullScreen]):
1152         * WebProcess/cocoa/VideoFullscreenManager.h:
1153         (WebKit::VideoFullscreenInterfaceContext::animationState const):
1154         (WebKit::VideoFullscreenInterfaceContext::setAnimationState):
1155         (WebKit::VideoFullscreenInterfaceContext::isAnimating const): Deleted.
1156         (WebKit::VideoFullscreenInterfaceContext::setIsAnimating): Deleted.
1157         * WebProcess/cocoa/VideoFullscreenManager.mm:
1158         (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
1159         (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):
1160         (WebKit::VideoFullscreenManager::didEnterFullscreen):
1161         (WebKit::VideoFullscreenManager::didCleanupFullscreen):
1162
1163 2019-08-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1164
1165         Do not clear the pending api request when there's no navigation ID
1166         https://bugs.webkit.org/show_bug.cgi?id=201175
1167
1168         Reviewed by Chris Dumez.
1169
1170         After r247851, the pending API request URL is cleared for subresources in some cases.
1171
1172         * UIProcess/WebPageProxy.cpp:
1173         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
1174         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1175
1176 2019-08-27  Zan Dobersek  <zdobersek@igalia.com>
1177
1178         [CoordGraphics] Delay LayerTreeHost creation in always-on AC until DrawingArea painting is enabled
1179         https://bugs.webkit.org/show_bug.cgi?id=201178
1180
1181         Reviewed by Carlos Garcia Campos.
1182
1183         When in always-on AC mode, the LayerTreeHost spawning should be delayed
1184         until the WebPage construction (which sets up the LayerTreeHost-owning
1185         DrawingArea implementation) is further done with initializing relevant
1186         state, and not immediately after the DrawingArea is done with preference
1187         updates.
1188
1189         This is necessary in order to enable the LayerTreeHost instance to take
1190         into account additional WebPage-creation attributes like the correct
1191         device scale factor. Until now, when the LayerTreeHost was spawned in
1192         always-on AC mode, the device scale factor was not yet updated in the
1193         WebPage construction to the appropriate value, leaving the LayerTreeHost
1194         with the default 1.0 value instead of the intended one.
1195
1196         DrawingArea::setPaintingEnabled() is repurposed into enablePainting()
1197         that is to be called once everything should be set for painting (i.e.
1198         when setPaintingEnabled(true) was being called until now). Inside the
1199         DrawingAreaProxyCoordinatedGraphics class (only one to provide an
1200         implementation for this method), the LayerTreeHost is now spawned if
1201         in always-on AC mode. At this point, all relevant state coming from
1202         the owning WebPage object should be readily available for the host
1203         to correctly set up initial graphics scene.
1204
1205         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1206         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
1207         (WebKit::DrawingAreaCoordinatedGraphics::enablePainting):
1208         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
1209         * WebProcess/WebPage/DrawingArea.h:
1210         (WebKit::DrawingArea::enablePainting):
1211         (WebKit::DrawingArea::setPaintingEnabled): Deleted.
1212         * WebProcess/WebPage/WebPage.cpp:
1213         (WebKit::m_textAutoSizingAdjustmentTimer):
1214         (WebKit::WebPage::reinitializeWebPage):
1215
1216 2019-08-26  Devin Rousso  <drousso@apple.com>
1217
1218         Web Inspector: use more C++ keywords for defining agents
1219         https://bugs.webkit.org/show_bug.cgi?id=200959
1220
1221         Reviewed by Joseph Pecoraro.
1222
1223          - make constructors `protected` when the agent isn't meant to be constructed directly
1224          - add `virtual` destructors that are defined in the *.cpp so forward-declarations work
1225          - use `final` wherever possible
1226          - add comments to indicate where any virtual functions come from
1227
1228         * UIProcess/WebPageInspectorTargetAgent.h:
1229         * UIProcess/WebPageInspectorTargetAgent.cpp:
1230
1231 2019-08-26  Chris Dumez  <cdumez@apple.com>
1232
1233         Regression: ITP started doing a lot more IPC after its logic was moved to the network process
1234         https://bugs.webkit.org/show_bug.cgi?id=201155
1235
1236         Reviewed by John Wilander.
1237
1238         * WebProcess/WebProcess.cpp:
1239         (WebKit::WebProcess::initializeWebProcess):
1240
1241 2019-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1242
1243         REGRESSION (iOS 13): Tests that simulate multiple back-to-back single taps fail or time out
1244         https://bugs.webkit.org/show_bug.cgi?id=201129
1245         <rdar://problem/51857277>
1246
1247         Reviewed by Tim Horton.
1248
1249         Adds a new SPI hook in WebKit to let clients know when a synthetic tap gesture that has ended has been reset.
1250         See Tools/ChangeLog and LayoutTests/ChangeLog for more details.
1251
1252         * UIProcess/API/Cocoa/WKWebView.mm:
1253         (-[WKWebView _doAfterResettingSingleTapGesture:]):
1254         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1255         * UIProcess/ios/WKContentViewInteraction.h:
1256         * UIProcess/ios/WKContentViewInteraction.mm:
1257         (-[WKContentView _singleTapDidReset:]):
1258         (-[WKContentView _doAfterResettingSingleTapGesture:]):
1259
1260 2019-08-26  Brent Fulgham  <bfulgham@apple.com>
1261
1262         [FTW] Go back to ID2D1Bitmap as our NativeImage type
1263         https://bugs.webkit.org/show_bug.cgi?id=201122
1264
1265         Reviewed by Alex Christensen.
1266
1267         In Bug 200093 I switched the OS type of NativeImagePtr from ID2D1Bitmap to IWICBitmap.
1268         However, this was an ill-advised approach, because it dramatically harmed performance due
1269         to the heavy use of software rendering.
1270
1271         I originally made this change because I thought this was the only way to get to the backing
1272         bits of the bitmaps, but it turns out that a more recent Direct2D data type (ID2D1Bitmap1)
1273         has the ability to map its memory to CPU-accessible memory, allowing software filter effects.
1274
1275         This patch switches back to the ID2D1Bitap data type, and hooks up the ID2D1Bitmap1 data type
1276         to access the underlying memory of the bitmaps when software filter effects are used.
1277
1278         Reviewed by Alex Christensen.
1279
1280         * Shared/ShareableBitmap.h:
1281         * Shared/win/ShareableBitmapDirect2D.cpp:
1282         * UIProcess/win/BackingStoreDirect2D.cpp:
1283         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1284
1285 2019-08-26  Jiewen Tan  <jiewen_tan@apple.com>
1286
1287         [WebAuthn] Support HID authenticators on iOS
1288         https://bugs.webkit.org/show_bug.cgi?id=201084
1289         <rdar://problem/51908390>
1290
1291         Reviewed by Youenn Fablet.
1292
1293         This patch makes the macOS HID implementation available in iOS as well.
1294         Mostly, it removes the PLATFORM(MAC) compile time flag.
1295
1296         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1297         (WebKit::AuthenticatorManagerInternal::collectTransports):
1298         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
1299         (WebKit::AuthenticatorTransportService::create):
1300         (WebKit::AuthenticatorTransportService::createMock):
1301         * UIProcess/WebAuthentication/Cocoa/HidConnection.h:
1302         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
1303         * UIProcess/WebAuthentication/Cocoa/HidService.h:
1304         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
1305         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
1306         (WebKit::NfcConnection::NfcConnection):
1307         A tentative solution before there is an official UI.
1308         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
1309         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
1310         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
1311         * UIProcess/WebAuthentication/Mock/MockHidService.h:
1312         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
1313         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
1314
1315 2019-08-26  Russell Epstein  <repstein@apple.com>
1316
1317         Unreviewed, rolling out r248961.
1318
1319         Same patch was re-landed after being rolled out. Patch is
1320         causing Catalina/iOS 13 test failures. Rolling out.
1321
1322         Reverted changeset:
1323
1324         "Verify Prefetch and credential behavior"
1325         https://bugs.webkit.org/show_bug.cgi?id=200000
1326         https://trac.webkit.org/changeset/248961
1327
1328 2019-08-26  Youenn Fablet  <youenn@apple.com>
1329
1330         Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
1331         https://bugs.webkit.org/show_bug.cgi?id=196870
1332
1333         Reviewed by Alex Christensen.
1334
1335         Make NetworkProcess provide the session ID for any authentication challenge.
1336         In case there is no associated page for the authentication challenge or this is related to a service worker,
1337         ask the website data store to take a decision.
1338         Add website data store delegate to allow applications to make the decision.
1339         Restrict using the delegate to server trust evaluation only.
1340
1341         Make ping loads reuse the same mechanism.
1342
1343         Covered by service worker tests and updated beacon test.
1344
1345         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1346         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1347         * NetworkProcess/NetworkDataTask.cpp:
1348         (WebKit::NetworkDataTask::sessionID const):
1349         * NetworkProcess/NetworkDataTask.h:
1350         * NetworkProcess/NetworkLoad.cpp:
1351         (WebKit::NetworkLoad::didReceiveChallenge):
1352         * NetworkProcess/NetworkLoadChecker.h:
1353         (WebKit::NetworkLoadChecker::networkProcess):
1354         * NetworkProcess/PingLoad.cpp:
1355         (WebKit::PingLoad::didReceiveChallenge):
1356         * Shared/Authentication/AuthenticationManager.cpp:
1357         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1358         * Shared/Authentication/AuthenticationManager.h:
1359         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
1360         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
1361         (WebKit::toAuthenticationChallengeDisposition):
1362         * SourcesCocoa.txt:
1363         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1364         (WebsiteDataStoreClient::WebsiteDataStoreClient):
1365         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
1366         * UIProcess/Cocoa/NavigationState.mm:
1367         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
1368         * UIProcess/Network/NetworkProcessProxy.cpp:
1369         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1370         * UIProcess/Network/NetworkProcessProxy.h:
1371         * UIProcess/Network/NetworkProcessProxy.messages.in:
1372         * UIProcess/ServiceWorkerProcessProxy.cpp:
1373         * UIProcess/ServiceWorkerProcessProxy.h:
1374         * UIProcess/WebPageProxy.cpp:
1375         * UIProcess/WebProcessPool.cpp:
1376         (WebKit::WebProcessPool::isServiceWorkerPageID const):
1377         * UIProcess/WebProcessPool.h:
1378         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
1379         (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
1380         * WebKit.xcodeproj/project.pbxproj:
1381
1382 2019-08-25  Simon Fraser  <simon.fraser@apple.com>
1383
1384         [iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs
1385         https://bugs.webkit.org/show_bug.cgi?id=199983
1386
1387         Reviewed by Dean Jackson.
1388         
1389         Add TransactionID which is a MonotonicObjectIdentifier<TransactionIDType>. This is modeled
1390         after ObjectIdentifier<>, but we can't use that because it doesn't have a guarantee of
1391         values always increasing by 1 (all derived classes share the same value source). Also, we
1392         need a per-RemoteLayerTreeDrawingArea set of values, but a static seed would cause values to
1393         be incremented by all RemoteLayerTreeDrawingAreas in a WebProcess.
1394
1395         Replace all the bare uint64_t with TransactionID, fixing message generation codegen.
1396
1397         * Scripts/webkit/messages.py:
1398         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1399         (WebKit::RemoteLayerTreeTransaction::transactionID const):
1400         (WebKit::RemoteLayerTreeTransaction::setTransactionID):
1401         * Shared/TransactionID.h: Added.
1402         (WebKit::MonotonicObjectIdentifier::MonotonicObjectIdentifier):
1403         (WebKit::MonotonicObjectIdentifier::isHashTableDeletedValue const):
1404         (WebKit::MonotonicObjectIdentifier::encode const):
1405         (WebKit::MonotonicObjectIdentifier::decode):
1406         (WebKit::MonotonicObjectIdentifier::operator== const):
1407         (WebKit::MonotonicObjectIdentifier::operator> const):
1408         (WebKit::MonotonicObjectIdentifier::operator>= const):
1409         (WebKit::MonotonicObjectIdentifier::operator< const):
1410         (WebKit::MonotonicObjectIdentifier::operator<= const):
1411         (WebKit::MonotonicObjectIdentifier::operator!= const):
1412         (WebKit::MonotonicObjectIdentifier::increment):
1413         (WebKit::MonotonicObjectIdentifier::next const):
1414         (WebKit::MonotonicObjectIdentifier::toUInt64 const):
1415         (WebKit::MonotonicObjectIdentifier::operator bool const):
1416         (WebKit::MonotonicObjectIdentifier::loggingString const):
1417         (WebKit::MonotonicObjectIdentifier::hashTableDeletedValue):
1418         (WebKit::MonotonicObjectIdentifier::isValidIdentifier):
1419         (WebKit::operator<<):
1420         * Shared/VisibleContentRectUpdateInfo.h:
1421         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1422         (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionID const):
1423         * UIProcess/API/Cocoa/WKWebView.mm:
1424         (-[WKWebView _processWillSwapOrDidExit]):
1425         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
1426         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
1427         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1428         (WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
1429         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1430         * UIProcess/WebPageProxy.cpp:
1431         (WebKit::WebPageProxy::resetState):
1432         * UIProcess/WebPageProxy.h:
1433         * UIProcess/ios/WKContentViewInteraction.h:
1434         * UIProcess/ios/WKContentViewInteraction.mm:
1435         (-[WKContentView cleanupInteraction]):
1436         * UIProcess/ios/WebPageProxyIOS.mm:
1437         (WebKit::WebPageProxy::commitPotentialTap):
1438         (WebKit::WebPageProxy::handleTap):
1439         * WebKit.xcodeproj/project.pbxproj:
1440         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1441         (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID const):
1442         (WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID const):
1443         (WebKit::RemoteLayerTreeDrawingArea::takeNextTransactionID):
1444         * WebProcess/WebPage/WebFrame.h:
1445         (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad const):
1446         (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
1447         * WebProcess/WebPage/WebPage.h:
1448         * WebProcess/WebPage/WebPage.messages.in:
1449         * WebProcess/WebPage/ios/WebPageIOS.mm:
1450         (WebKit::WebPage::handleTap):
1451         (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
1452         (WebKit::WebPage::commitPotentialTap):
1453
1454 2019-08-24  Chris Dumez  <cdumez@apple.com>
1455
1456         Make CacheStorageEngineCaches's decodeCachesNames() more robust against bad input data
1457         https://bugs.webkit.org/show_bug.cgi?id=201102
1458
1459         Reviewed by Antti Koivisto.
1460
1461         Use Vector::tryReserveCapacity() instead of Vector::reserveInitialCapacity() in CacheStorage::decodeCachesNames()
1462         since the size is read from disk and thus cannot be trusted. If the size is too large, reserveInitialCapacity()
1463         would end up crashing the network process. Now, we merely discard the data if tryReserveCapacity() fails because
1464         the size is too large.
1465
1466         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1467         (WebKit::CacheStorage::decodeCachesNames):
1468
1469 2019-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1470
1471         [iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing
1472         https://bugs.webkit.org/show_bug.cgi?id=201085
1473         <rdar://problem/53056118>
1474
1475         Reviewed by Tim Horton.
1476
1477         Currently, logic in applyAutocorrectionInternal only selects the range to autocorrect if the text of the range
1478         matches the string to replace (delivered to us from UIKit). In the case of changing "I’" to "I’m", the string to
1479         replace is "I'" (with a straight quote rather than an apostrophe), even though the DOM contains an apostrophe.
1480
1481         This is because kbd believes that the document context contains straight quotes (rather than apostrophes). For
1482         native text views, this works out because UIKit uses relative UITextPositions to determine the replacement
1483         range rather than by checking against the contents of the document. However, WKWebView does not have the ability
1484         to synchronously compute and reason about arbitrary UITextPositions relative to the selection, so we instead
1485         search for the string near the current selection when applying autocorrections.
1486
1487         Of course, this doesn't work in this scenario because the replacement string contains a straight quote, yet the
1488         text node contains an apostrophe, so we bail and don't end up replacing any text. To address this, we repurpose
1489         TextIterator helpers currently used to allow find-in-page to match straight quotes against apostrophes; instead
1490         of matching the replacement string exactly, we instead match the quote-folded versions of these strings when
1491         finding the range to replace.
1492
1493         Test: fast/events/ios/autocorrect-with-apostrophe.html
1494
1495         * WebProcess/WebPage/ios/WebPageIOS.mm:
1496         (WebKit::WebPage::applyAutocorrectionInternal):
1497
1498 2019-08-23  Jiewen Tan  <jiewen_tan@apple.com>
1499
1500         Unreviewed, build fix after r249059
1501
1502         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
1503         (WebKit::NfcConnection::NfcConnection):
1504         Remove the HAVE() macro.
1505
1506 2019-08-23  Chris Dumez  <cdumez@apple.com>
1507
1508         [geolocation] Rename interfaces and remove [NoInterfaceObject]
1509         https://bugs.webkit.org/show_bug.cgi?id=200885
1510
1511         Reviewed by Alex Christensen.
1512
1513         * Shared/WebGeolocationPosition.cpp:
1514         (WebKit::WebGeolocationPosition::create):
1515         * Shared/WebGeolocationPosition.h:
1516         (WebKit::WebGeolocationPosition::corePosition const):
1517         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
1518         * UIProcess/API/C/WKGeolocationPosition.cpp:
1519         (WKGeolocationPositionCreate_c):
1520         * UIProcess/WebGeolocationManagerProxy.h:
1521         (WebKit::WebGeolocationManagerProxy::lastPosition const):
1522         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1523         (-[WKLegacyCoreLocationProvider positionChanged:]):
1524         * WebProcess/Geolocation/WebGeolocationManager.cpp:
1525         (WebKit::WebGeolocationManager::didChangePosition):
1526         * WebProcess/Geolocation/WebGeolocationManager.h:
1527         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
1528         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
1529         (WebKit::WebGeolocationClient::lastPosition):
1530         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
1531
1532 2019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
1533
1534         Unreviewed, rolling out r249001.
1535
1536         Caused one layout test to fail on all configurations and
1537         another to time out on Catalina / iOS 13.
1538
1539         Reverted changeset:
1540
1541         "Add a WebsiteDataStore delegate to handle
1542         AuthenticationChallenge that do not come from pages"
1543         https://bugs.webkit.org/show_bug.cgi?id=196870
1544         https://trac.webkit.org/changeset/249001
1545
1546 2019-08-23  Brian Burg  <bburg@apple.com>
1547
1548         REGRESSION(r248713): WebDriver commands which target the implicit main frame now hit an ASSERT
1549         https://bugs.webkit.org/show_bug.cgi?id=200793
1550         <rdar://problem/54516988>
1551
1552         Reviewed by Chris Dumez.
1553
1554         SimulatedInputDispatcher and its callers need to support Optional<FrameIdentifier>
1555         and WTF::nullopt as an encoding for the implicit main frame.
1556
1557         * UIProcess/Automation/SimulatedInputDispatcher.h:
1558         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1559         (WebKit::SimulatedInputDispatcher::resolveLocation):
1560         (WebKit::SimulatedInputDispatcher::run):
1561
1562         * UIProcess/Automation/WebAutomationSession.h:
1563         * UIProcess/Automation/WebAutomationSession.cpp:
1564         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
1565         (WebKit::WebAutomationSession::performInteractionSequence):
1566         (WebKit::WebAutomationSession::cancelInteractionSequence):
1567
1568 2019-08-20  Jiewen Tan  <jiewen_tan@apple.com>
1569
1570         [WebAuthn] Support NFC authenticators for iOS
1571         https://bugs.webkit.org/show_bug.cgi?id=188624
1572         <rdar://problem/43354214>
1573
1574         Reviewed by Chris Dumez.
1575
1576         This patch implements support for NFC authenticators including both FIDO2 and U2F ones. It utilizes a private
1577         framework called NearField instead of CoreNFC to be able to supply a custom UI later if necessary.
1578
1579         The patch follows almost the same flow as previous HID and Local authenticator support.
1580         1) Discovery is via NfcService which will invoke NFHardwareManager to start a generic NFC reader session.
1581         2) Once a reader session is established, a NfcConnection is created to start the polling and register the WKNFReaderSessionDelegate
1582         to wait for 'didDetectTags'.
1583         3) When tags are detected, NfcConnection will determine if it meets our requriements: { type, connectability, fido applet availability }.
1584         The first tag that meets all requirement will then be returned for WebAuthn operations.
1585         4) The first WebAuthn operation is to send authenticatorGetInfo command to determine the supported protocol, and then initialize corresponding
1586         authenticators. Noted, the sending/receiving of this command is now abstracted into FidoService which will be shared across HidService and NfcService.
1587         5) From then, the actual WebAuthn request, either makeCredential or getAssertion will be sent.
1588
1589         For testing, this patch follows the same flow as well.
1590         1) MockNfcService overrides NfcService to mock the behavior of NFC Tags discovery.
1591         2) The same class also swizzles methods from NFReaderSession to mock tag connection and communication.
1592
1593         * Platform/spi/Cocoa/NearFieldSPI.h: Added.
1594         * Sources.txt:
1595         * SourcesCocoa.txt:
1596         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1597         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
1598         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1599         (WebKit::AuthenticatorManagerInternal::collectTransports):
1600         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
1601         (WebKit::AuthenticatorTransportService::create):
1602         (WebKit::AuthenticatorTransportService::createMock):
1603         * UIProcess/WebAuthentication/Cocoa/HidService.h:
1604         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
1605         (WebKit::HidService::HidService):
1606         (WebKit::HidService::deviceAdded):
1607         (WebKit::HidService::continueAddDeviceAfterGetInfo): Deleted.
1608         * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1609         * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1610         * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1611         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: Added.
1612         (WebKit::fido::compareVersion):
1613         (WebKit::NfcConnection::NfcConnection):
1614         (WebKit::NfcConnection::~NfcConnection):
1615         (WebKit::NfcConnection::transact const):
1616         (WebKit::NfcConnection::didDetectTags const):
1617         * UIProcess/WebAuthentication/Cocoa/NfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1618         * UIProcess/WebAuthentication/Cocoa/NfcService.mm: Added.
1619         (WebKit::NfcService::NfcService):
1620         (WebKit::NfcService::~NfcService):
1621         (WebKit::NfcService::didConnectTag):
1622         (WebKit::NfcService::startDiscoveryInternal):
1623         (WebKit::NfcService::platformStartDiscovery):
1624         * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1625         * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1626         (-[WKNFReaderSessionDelegate initWithConnection:]):
1627         (-[WKNFReaderSessionDelegate readerSession:didDetectTags:]):
1628         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
1629         (WebKit::MockHidConnection::send):
1630         (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
1631         (WebKit::MockHidConnection::parseRequest):
1632         (WebKit::MockHidConnection::feedReports):
1633         (WebKit::MockHidConnection::shouldContinueFeedReports):
1634         * UIProcess/WebAuthentication/Mock/MockNfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1635         * UIProcess/WebAuthentication/Mock/MockNfcService.mm: Added.
1636         (-[WKMockNFTag type]):
1637         (-[WKMockNFTag initWithNFTag:]):
1638         (-[WKMockNFTag description]):
1639         (-[WKMockNFTag isEqualToNFTag:]):
1640         (-[WKMockNFTag initWithType:]):
1641         (WebKit::MockNfcService::MockNfcService):
1642         (WebKit::MockNfcService::transceive):
1643         (WebKit::MockNfcService::platformStartDiscovery):
1644         (WebKit::MockNfcService::detectTags const):
1645         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
1646         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
1647         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
1648         * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: Added.
1649         (WebKit::CtapNfcDriver::CtapNfcDriver):
1650         (WebKit::CtapNfcDriver::transact):
1651         (WebKit::CtapNfcDriver::respondAsync const):
1652         * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1653         * UIProcess/WebAuthentication/fido/FidoService.cpp: Added.
1654         (WebKit::FidoService::FidoService):
1655         (WebKit::FidoService::getInfo):
1656         (WebKit::FidoService::continueAfterGetInfo):
1657         * UIProcess/WebAuthentication/fido/FidoService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
1658         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
1659         * UIProcess/WebAuthentication/fido/U2fAuthenticator.h:
1660         * UIProcess/ios/WebPageProxyIOS.mm:
1661         * WebKit.xcodeproj/project.pbxproj:
1662
1663 2019-08-23  Kate Cheney  <katherine_cheney@apple.com>
1664
1665         Support ITP on a per-session basis (198923)
1666         https://bugs.webkit.org/show_bug.cgi?id=198923
1667
1668         Reviewed by Chris Dumez.
1669
1670         The original implementation of resourceLoadStatisticsUpdated
1671         did not allow for ITP on a per session basis due to the sessionID
1672         not being passed to the resourceLoadStatisticsUpdated function.
1673         This patch allows access of the correct networkSession by passing
1674         all resourceLoadStatistics in a new data structure of key-value
1675         pairs, where the sessionID is the key.
1676
1677         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1678         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
1679         * NetworkProcess/NetworkConnectionToWebProcess.h:
1680         * WebProcess/WebProcess.cpp:
1681
1682 2019-08-23  Russell Epstein  <repstein@apple.com>
1683
1684         Unreviewed, rolling out r249031.
1685
1686         Causes multiple test failures on iOS simulator
1687
1688         Reverted changeset:
1689
1690         "[iOS] Should show input view when became first responder if
1691         keyboard was showing when the view was resigned"
1692         https://bugs.webkit.org/show_bug.cgi?id=200902
1693         https://trac.webkit.org/changeset/249031
1694
1695 2019-08-22  Andy Estes  <aestes@apple.com>
1696
1697         [watchOS] Disable Content Filtering in the simulator build
1698         https://bugs.webkit.org/show_bug.cgi?id=201047
1699
1700         Reviewed by Tim Horton.
1701
1702         * Configurations/FeatureDefines.xcconfig:
1703
1704 2019-08-22  Daniel Bates  <dabates@apple.com>
1705
1706         [iOS] Should show input view when became first responder if keyboard was showing when the view was resigned
1707         https://bugs.webkit.org/show_bug.cgi?id=200902
1708         <rdar://problem/54231756>
1709
1710         Reviewed by Wenson Hsieh.
1711
1712         When resigning first responder save whether the peripheral host has an input view on screen,
1713         including the software keyboard, so that we show the input view(s) again when the WKWebView
1714         is made first responder. In Safari, this avoids the need for a person to explicitly focus an
1715         editable element again to bring up the keyboard when returning to a tab they were previously
1716         typing in. It also makes the behavior of switching tabs in Safari with a software keyboard
1717         match the behavior of doing the same thing when a hardware keyboard attached.
1718
1719         * UIProcess/PageClient.h:
1720         * UIProcess/WebPageProxy.h:
1721         * UIProcess/WebPageProxy.messages.in:
1722         * UIProcess/ios/PageClientImplIOS.h:
1723         * UIProcess/ios/PageClientImplIOS.mm:
1724         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
1725         Pass a diff of the activity state from the web process to the UI process so that we can
1726         differentiate between an inputmode change as a result of page deactivation vs a change
1727         caused by some other means. We need to differentiate these cases because we want to
1728         ignore a page that sets inputmode "none" (i.e. a request to hide the keyboard) from inside
1729         a focus event handler if the handler was called as part of the process of page activation
1730         (i.e. switching to the tab). Google Docs is one example of a web site that sets inputmode
1731         to "none" as a result of the page activation process.
1732
1733         * UIProcess/ios/WKContentViewInteraction.h:
1734         * UIProcess/ios/WKContentViewInteraction.mm:
1735         (-[WKContentView cleanupInteraction]): Clear out state.
1736         (-[WKContentView resignFirstResponderForWebView]): Save whether the peripheral host is on screen
1737         into a local before ending the editing session. We then copy the local into the ivar if we
1738         actually will resign. This ordering is explicitly done because:
1739                 1. Ending the editing session may dismiss the keyboard => we need to query the peripheral
1740                    host first.
1741                 2. If the view is being resigned as a result of a keyboard dismissal (i.e. a person pressed
1742                    the hide keyboard button on iPad) then the user has indicated that they are finished
1743                    with the keyboard and we do not want to show the keyboard on page re-activation => we
1744                    do not want to copy the local to the ivar.
1745                 3. If the view refuses to resign itself then it does not make sense to save the keyboard
1746                    state as responder status hasn't changed.
1747         (-[WKContentView shouldShowAutomaticKeyboardUI]): Ignore inputmode="none", if needed.
1748         (-[WKContentView _didCommitLoadForMainFrame]): Clear out state.
1749         (-[WKContentView isFirstResponderOrBecomingFirstResponder]): Added.
1750         (-[WKContentView shouldShowInputViewOnPageActivation:]): Added.
1751         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
1752         Update ivar if this element is being focused as a result of page activation.
1753         (-[WKContentView _didUpdateInputMode:activityStateChanges:]): Modified to take the activity state
1754         diff. If the input mode was changed as a result of page activation then we want to update our ivar
1755         so that when we call -reloadInputViews and UIKit calls us back in -shouldShowAutomaticKeyboardUI we
1756         will know to ignore inputmode set to "none" when determining whether to show the automatic keyboard UI.
1757         Note that we do not need to check/track whether an earlier -_elementDidFocus actually started an
1758         input session as part of updating the value of our ivar because if an input session was not started,
1759         say the embedding client disallowed it, then we would not have a focused element => we early return from
1760         this function. Also remove duplication and improve code readbility by making use of the convenience function
1761         hasFocusedElement() instead of duplicating what it does.
1762         (-[WKContentView _didUpdateInputMode:]): Deleted.
1763         * UIProcess/ios/WebPageProxyIOS.mm:
1764         (WebKit::WebPageProxy::focusedElementDidChangeInputMode): Modified to take the activity state diff
1765         and pass it through.
1766         (WebKit::WebPageProxy::didReleaseAllTouchPoints): Pass the empty set for the activity state diff to
1767         keep our current behavior.
1768         * WebProcess/WebPage/WebPage.cpp:
1769         (WebKit::WebPage::focusedElementDidChangeInputMode): Send the activity state diff to the UI process.
1770 2019-08-22  Keith Rollin  <krollin@apple.com>
1771
1772         Remove logging that contains a URL
1773         https://bugs.webkit.org/show_bug.cgi?id=201052
1774         <rdar://problem/54613204>
1775
1776         Reviewed by Chris Dumez.
1777
1778         checkURLReceivedFromWebProcess in WebProcessProxy.cpp contains an old
1779         logging line that logs a URL. We don't log URLs any more for privacy
1780         reasons, so remove this.
1781
1782         A search for WTFLogAlways.*url turns up other matches, but those are
1783         either false positives or cases where the URLs are logged only on
1784         demand by the developer as part of debugging.
1785         checkURLReceivedFromWebProcess is the only place where a URL is logged
1786         as a matter of course.
1787
1788         * UIProcess/WebProcessProxy.cpp:
1789         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
1790
1791 2019-08-22  Adrian Perez de Castro  <aperez@igalia.com>
1792
1793         [GTK][WPE] Fixes for non-unified builds after r248547
1794         https://bugs.webkit.org/show_bug.cgi?id=201044
1795
1796         Reviewed by Philippe Normand.
1797
1798         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Add missing inclusion of
1799         the wtf/CrossThreadCopier.h header.
1800         * WebProcess/WebStorage/StorageNamespaceImpl.h: Add missing inclusion of the
1801         WebCore/PageIdentifier.h header.
1802
1803 2019-08-22  Alex Christensen  <achristensen@webkit.org>
1804
1805         Disable legacy TLS versions and add a temporary default to re-enable it
1806         https://bugs.webkit.org/show_bug.cgi?id=200945
1807
1808         Reviewed by Brady Eidson.
1809
1810         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1811         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
1812         (WebKit::NetworkSessionCreationParameters::encode const):
1813         (WebKit::NetworkSessionCreationParameters::decode):
1814         * NetworkProcess/NetworkSessionCreationParameters.h:
1815         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1816         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1817         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1818         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1819         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1820         (WebKit::WebsiteDataStore::parameters):
1821
1822 2019-08-17  Darin Adler  <darin@apple.com>
1823
1824         Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends
1825         https://bugs.webkit.org/show_bug.cgi?id=200862
1826
1827         Reviewed by Ryosuke Niwa.
1828
1829         * Shared/mac/AuxiliaryProcessMac.mm:
1830         (WebKit::setAndSerializeSandboxParameters): Use one append instead of multiple.
1831
1832 2019-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1833
1834         Typing Korean in title field after typing in the body inserts extraneous characters on blog.naver.com
1835         https://bugs.webkit.org/show_bug.cgi?id=201023
1836         <rdar://problem/54294794>
1837
1838         Reviewed by Ryosuke Niwa.
1839
1840         After r242833, we began to avoid sending redundant ElementDidFocus updates in the case where a focused element
1841         was blurred and refocused within the same runloop. This was done to prevent the input view from flickering due
1842         to input view reloading, as well as scrolling to reveal the focused element, when tapping to change selection on
1843         Microsoft Word online.
1844
1845         However, on blog.naver.com, these ElementDidFocus messages were necessary in order to ensure that the platform
1846         input context changes when moving between the title and body fields, or when tapping to change selection. This
1847         is because blog.naver.com uses a hidden contenteditable area under a subframe (see WebCore ChangeLog for more
1848         detail here). While text is never directly inserted into this hidden contenteditable, the events are observed
1849         and used to "play back" editing in the main visible content area.
1850
1851         Thus, when moving between the title and body fields (or when changing selection within either), the only hint we
1852         get is that the hidden editable element is blurred and immediately refocused. Since we no longer send
1853         ElementDidFocus updates in this scenario, UIKeyboardImpl and kbd are not aware that the page has effectively
1854         changed input contexts.
1855
1856         Combined with the fact that Korean IME on iOS may insert additional text given the document context (i.e. text
1857         that the input manager, kbd, thinks we've previously inserted), this means that when typing several characters
1858         into the body field on naver and then switching to edit the title, initial keystrokes may insert unexpected
1859         text in the title field.
1860
1861         To fix this, we add some hooks to notify the UI process when an element that was blurred has been immediately
1862         refocused. Upon receiving this message, the UI process then tells UIKeyboardImpl to re-retrieve its input
1863         context, which calls into -requestAutocorrectionContextWithCompletionHandler: in WKContentView. While notorious
1864         for being synchronous IPC, this is mitigated by (1) being limiting to only instances where we have a hidden
1865         editable area, and (2) being limited by a batching mechanism in the web process, such that if the focused
1866         element is blurred, refocused, re-blurred, and refocused many times in the same runloop, we'll only send a
1867         single UpdateInputContextAfterBlurringAndRefocusingElement message (as opposed to the many ElementDidFocus
1868         messages we would've sent in previous releases).
1869
1870         * Platform/spi/ios/UIKitSPI.h:
1871         * UIProcess/PageClient.h:
1872         * UIProcess/WebPageProxy.h:
1873         * UIProcess/WebPageProxy.messages.in:
1874
1875         Add a new mechanism to update the platform input context (on iOS, UIKeyboardImpl's document state) when focus
1876         moves away from and immediately returns to a hidden editable element.
1877
1878         * UIProcess/ios/PageClientImplIOS.h:
1879         * UIProcess/ios/PageClientImplIOS.mm:
1880         (WebKit::PageClientImpl::updateInputContextAfterBlurringAndRefocusingElement):
1881         * UIProcess/ios/WKContentViewInteraction.h:
1882         * UIProcess/ios/WKContentViewInteraction.mm:
1883         (-[WKContentView _updateInputContextAfterBlurringAndRefocusingElement]):
1884
1885         Tell the active UIKeyboardImpl to refetch document state from the WKContentView. While this does result in a new
1886         autocorrection context request (which, unfortunately, triggers synchronous IPC to the web process), this request
1887         would've still happened anyways in the case where we would previously have sent an ElementDidFocus message.
1888
1889         * UIProcess/ios/WebPageProxyIOS.mm:
1890         (WebKit::WebPageProxy::updateInputContextAfterBlurringAndRefocusingElement):
1891         * WebProcess/WebPage/WebPage.cpp:
1892         (WebKit::WebPage::elementDidFocus):
1893
1894         In the case where we avoid sending a full ElementDidFocus message to the UI process due to refocusing the same
1895         element, we should still notify the UI process so that it can synchronize state between the application process
1896         and kbd. See above for more details.
1897
1898         (WebKit::WebPage::elementDidBlur):
1899         (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
1900         * WebProcess/WebPage/WebPage.h:
1901         * WebProcess/WebPage/ios/WebPageIOS.mm:
1902         (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
1903
1904 2019-08-22  Youenn Fablet  <youenn@apple.com>
1905
1906         Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
1907         https://bugs.webkit.org/show_bug.cgi?id=196870
1908
1909         Reviewed by Alex Christensen.
1910
1911         Make NetworkProcess provide the session ID for any authentication challenge.
1912         In case there is no associated page for the authentication challenge or this is related to a service worker,
1913         ask the website data store to take a decision.
1914         Add website data store delegate to allow applications to make the decision.
1915         Restrict using the delegate to server trust evaluation only.
1916
1917         Make ping loads reuse the same mechanism.
1918
1919         Covered by service worker tests and updated beacon test.
1920
1921         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1922         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1923         * NetworkProcess/NetworkDataTask.cpp:
1924         (WebKit::NetworkDataTask::sessionID const):
1925         * NetworkProcess/NetworkDataTask.h:
1926         * NetworkProcess/NetworkLoad.cpp:
1927         (WebKit::NetworkLoad::didReceiveChallenge):
1928         * NetworkProcess/NetworkLoadChecker.h:
1929         (WebKit::NetworkLoadChecker::networkProcess):
1930         * NetworkProcess/PingLoad.cpp:
1931         (WebKit::PingLoad::didReceiveChallenge):
1932         * Shared/Authentication/AuthenticationManager.cpp:
1933         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1934         * Shared/Authentication/AuthenticationManager.h:
1935         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
1936         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
1937         (WebKit::toAuthenticationChallengeDisposition):
1938         * SourcesCocoa.txt:
1939         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1940         (WebsiteDataStoreClient::WebsiteDataStoreClient):
1941         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
1942         * UIProcess/Cocoa/NavigationState.mm:
1943         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
1944         * UIProcess/Network/NetworkProcessProxy.cpp:
1945         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1946         * UIProcess/Network/NetworkProcessProxy.h:
1947         * UIProcess/Network/NetworkProcessProxy.messages.in:
1948         * UIProcess/ServiceWorkerProcessProxy.cpp:
1949         * UIProcess/ServiceWorkerProcessProxy.h:
1950         * UIProcess/WebPageProxy.cpp:
1951         * UIProcess/WebProcessPool.cpp:
1952         (WebKit::WebProcessPool::isServiceWorkerPageID const):
1953         * UIProcess/WebProcessPool.h:
1954         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
1955         (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
1956         * WebKit.xcodeproj/project.pbxproj:
1957
1958 2019-08-22  Claudio Saavedra  <csaavedra@igalia.com>
1959
1960         [SOUP] NetworkProcessSoup does not initialize CacheOptions correctly
1961         https://bugs.webkit.org/show_bug.cgi?id=200886
1962
1963         Reviewed by Philippe Normand.
1964
1965         r247567 wrongly initializes CacheOptions in a local variable that is never used
1966         instead of using NetworkProcess's member variable, that is later used by the
1967         NetworkSession to initialize the cache.
1968
1969         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1970         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1971
1972 2019-08-21  Tim Horton  <timothy_horton@apple.com>
1973
1974         [Mail] Tapping top of message scrolls back to copied text instead of top of the message
1975         https://bugs.webkit.org/show_bug.cgi?id=200999
1976         <rdar://problem/54564878>
1977
1978         Reviewed by Wenson Hsieh.
1979
1980         In the case where you have a WebCore selection but are not first responder,
1981         when you tap the WKWebView to become first responder, EventHandler would
1982         bail from setting the selection, assuming UIKit was going to do it. This
1983         behavior was introduced in r233311.
1984
1985         However, since we are not first responder, UIKit does not change the
1986         selection, since it considers the view to not be editable.
1987
1988         Fix this by letting WebCore set the selection in this case, as it used to.
1989
1990         * WebProcess/WebCoreSupport/WebEditorClient.h:
1991         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
1992         (WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const):
1993         * WebProcess/WebPage/WebPage.h:
1994         (WebKit::WebPage::isShowingInputViewForFocusedElement const):
1995         Copy the logic from EventHandler, with the added caveat (which fixes the
1996         aforementioned behavior) that we will allow EventHandler to change the
1997         selection if we don't have a focused node in the UIKit sense, because
1998         we know that the platform text interaction code will *not* change the
1999         selection if that is the case, so it's up to us.
2000
2001 2019-08-21  Chris Dumez  <cdumez@apple.com>
2002
2003         Crash under NetworkCache::Data::mapToFile()
2004         https://bugs.webkit.org/show_bug.cgi?id=200996
2005         <rdar://problem/54570421>
2006
2007         Reviewed by Geoffrey Garen.
2008
2009         Make sure NetworkCache::Data::mapToFile() calls makeSafeToUseMemoryMapForPath() between
2010         creating the file and calling mmap().
2011
2012         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2013         (WebKit::NetworkCache::BlobStorage::add):
2014         * NetworkProcess/cache/NetworkCacheData.cpp:
2015         (WebKit::NetworkCache::Data::mapToFile const):
2016
2017 2019-08-21  Chris Dumez  <cdumez@apple.com>
2018
2019         Have NetworkCache::store() null check its completion handler before calling it
2020         https://bugs.webkit.org/show_bug.cgi?id=200994
2021
2022         Reviewed by Geoffrey Garen.
2023
2024         * NetworkProcess/NetworkResourceLoader.cpp:
2025         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2026         Stop passing nullptr for the completion handler now that the parameter has a default value.
2027         Note that passing nullptr here was likely wrong since the NetworkCache::store() implementation
2028         did not null-check the completion handler before calling it.
2029
2030         * NetworkProcess/cache/NetworkCache.cpp:
2031         (WebKit::NetworkCache::Cache::store):
2032         Have NetworkCache::store() null check its completion handler before calling it as calling
2033         a null WTF::Function crashes.
2034
2035         * NetworkProcess/cache/NetworkCache.h:
2036         Use nullptr as default parameter value for the completion handler.
2037
2038 2019-08-21  Rob Buis  <rbuis@igalia.com>
2039
2040         Verify Prefetch and credential behavior
2041         https://bugs.webkit.org/show_bug.cgi?id=200000
2042
2043         Reviewed by Youenn Fablet.
2044
2045         Cancel cross-origin prefetches for Vary: Cookie.
2046
2047         Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html
2048
2049         * NetworkProcess/NetworkResourceLoader.cpp:
2050         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2051         (WebKit::NetworkResourceLoader::didReceiveResponse):
2052         * NetworkProcess/cache/PrefetchCache.cpp:
2053         (WebKit::PrefetchCache::take):
2054
2055 2019-08-21  Ryosuke Niwa  <rniwa@webkit.org>
2056
2057         Put keygen element behind a runtime flag and disable it by default
2058         https://bugs.webkit.org/show_bug.cgi?id=200850
2059
2060         Reviewed by Antti Koivisto.
2061
2062         * Shared/WebPreferences.yaml:
2063         * UIProcess/API/C/WKPreferences.cpp:
2064         (WKPreferencesSetKeygenElementEnabled):
2065         (WKPreferencesGetKeygenElementEnabled):
2066         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2067
2068 2019-08-21  Chris Dumez  <cdumez@apple.com>
2069
2070         Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains()
2071         https://bugs.webkit.org/show_bug.cgi?id=200986
2072         <rdar://problem/32850192>
2073
2074         Reviewed by Brent Fulgham.
2075
2076         Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied.
2077         The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor
2078         does not take care of this for you, despite its name (the createCrossThreadTask() function does though).
2079
2080         * NetworkProcess/NetworkProcess.cpp:
2081         (WebKit::NetworkProcess::fetchWebsiteData):
2082         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2083         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2084
2085 2019-08-21  Chris Dumez  <cdumez@apple.com>
2086
2087         Add internal setting to disable SecureContext checks
2088         https://bugs.webkit.org/show_bug.cgi?id=200980
2089         <rdar://problem/54438512>
2090
2091         Reviewed by Alex Christensen.
2092
2093         Add internal setting to disable SecureContext checks, in order to facilitate development
2094         for features like Service workers or device orientation / motion.
2095
2096         * Shared/WebPreferences.yaml:
2097         * UIProcess/API/Cocoa/WKPreferences.mm:
2098         (-[WKPreferences _secureContextChecksEnabled]):
2099         (-[WKPreferences _setSecureContextChecksEnabled:]):
2100         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2101
2102 2019-08-21  Chris Dumez  <cdumez@apple.com>
2103
2104         registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap
2105         https://bugs.webkit.org/show_bug.cgi?id=200985
2106
2107         Reviewed by John Wilander.
2108
2109         registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap. It is more
2110         efficient to simply return a Vector since we never need to look up keys.
2111
2112         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2113         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
2114         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2115         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2116         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
2117         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2118         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
2119         (WebKit::domainsToString):
2120         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2121         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2122         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
2123         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2124         * NetworkProcess/NetworkProcess.cpp:
2125         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2126         (WebKit::NetworkProcess::deleteCookiesForTesting):
2127         * NetworkProcess/NetworkProcess.h:
2128         * NetworkProcess/NetworkSession.cpp:
2129         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
2130         * NetworkProcess/NetworkSession.h:
2131
2132 2019-08-21  Russell Epstein  <repstein@apple.com>
2133
2134         Unreviewed, rolling out r248942.
2135
2136         Causes multiple layout test crashes on MacOS Bots
2137
2138         Reverted changeset:
2139
2140         "Verify Prefetch and credential behavior"
2141         https://bugs.webkit.org/show_bug.cgi?id=200000
2142         https://trac.webkit.org/changeset/248942
2143
2144 2019-08-21  Keith Rollin  <krollin@apple.com>
2145
2146         Remove support for watchOS < 6.0
2147         https://bugs.webkit.org/show_bug.cgi?id=200937
2148         <rdar://problem/54524009>
2149
2150         Reviewed by Darin Adler.
2151
2152         Update conditionals that reference __WATCH_OS_VERSION_MIN_REQUIRED and
2153         __WATCH_OS_VERSION_MAX_ALLOWED, assuming that they both have values >=
2154         60000. This means that expressions like
2155         "__WATCH_OS_VERSION_MIN_REQUIRED < 60000" are always False and
2156         "__WATCH_OS_VERSION_MIN_REQUIRED >= 60000" are always True.
2157
2158         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2159         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2160
2161 2019-08-21  Adrian Perez de Castro  <aperez@igalia.com>
2162
2163         [GTK] Build failure due to unwieldy definition of “None” from X11 headers
2164         https://bugs.webkit.org/show_bug.cgi?id=200984
2165
2166         Reviewed by Carlos Alberto Lopez Perez.
2167
2168         * SourcesGTK.txt: Mark AcceleratedBackingStore.cpp with @no-unify
2169         because it includes AcceleratedSurfaceX11.h when building with
2170         ENABLE_X11_TARGET=ON, which in turn will include the X11 headers.
2171         It is just lucky that most of the time the order of the generated
2172         #include statements in the unified sources has been masking this
2173         problem.
2174
2175 2019-08-21  Rob Buis  <rbuis@igalia.com>
2176
2177         Verify Prefetch and credential behavior
2178         https://bugs.webkit.org/show_bug.cgi?id=200000
2179
2180         Reviewed by Youenn Fablet.
2181
2182         Cancel cross-origin prefetches for Vary: Cookie.
2183
2184         Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html
2185
2186         * NetworkProcess/NetworkResourceLoader.cpp:
2187         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2188         (WebKit::NetworkResourceLoader::didReceiveResponse):
2189         * NetworkProcess/cache/PrefetchCache.cpp:
2190         (WebKit::PrefetchCache::take):
2191
2192 2019-08-21  Pablo Saavedra  <psaavedra@igalia.com>
2193
2194         [WPE] Build failure after r248846 ([WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part)
2195         https://bugs.webkit.org/show_bug.cgi?id=200973
2196
2197         WPE fails to build with `-DENABLE_WPE_QT_API=ON` after changes done by r248846 in:
2198
2199           Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp
2200           Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp
2201
2202         ; to forces FastMalloc use.
2203
2204         Related to:
2205
2206           https://bugs.webkit.org/show_bug.cgi?id=200611
2207           https://bugs.webkit.org/show_bug.cgi?id=200620
2208
2209         This patch puts WPEQt... classes into FastMalloc in the same way it
2210         was done by many others in r248603.
2211
2212         Reviewed by Philippe Normand.
2213
2214         * UIProcess/API/wpe/qt/WPEQtView.cpp:
2215         (WPEQtView::runJavaScript):
2216         * UIProcess/API/wpe/qt/WPEQtViewBackend.h:
2217         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h:
2218
2219 2019-08-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2220
2221         [iOS] REGRESSION (248501): gmail.com images are still not shown on some versions of iPhone iOS13
2222         https://bugs.webkit.org/show_bug.cgi?id=200948
2223
2224         Reviewed by Tim Horton.
2225
2226         Apply the gmail.com quirk for all iPhone iOS versions till the gmail.com
2227         bug is fixed.
2228
2229         * WebProcess/WebPage/ios/WebPageIOS.mm:
2230         (WebKit::WebPage::platformUserAgent const):
2231
2232 2019-08-20  Chris Dumez  <cdumez@apple.com>
2233
2234         WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread
2235         https://bugs.webkit.org/show_bug.cgi?id=200925
2236
2237         Reviewed by Geoffrey Garen.
2238
2239         WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread,
2240         which is not safe. Use WeakPtr to address the issue.
2241
2242         * Shared/WebSQLiteDatabaseTracker.cpp:
2243         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2244         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
2245         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
2246         * Shared/WebSQLiteDatabaseTracker.h:
2247
2248 2019-08-20  Brent Fulgham  <bfulgham@apple.com>
2249
2250         [FTW] Fix scrolling in modern WebKit views
2251         https://bugs.webkit.org/show_bug.cgi?id=200923
2252
2253         Reviewed by Don Olmstead.
2254
2255         The initial implementation of scrolling in Direct2D had errors that
2256         caused hilarious rendering glitches. This patch corrects the logic
2257         so that page scroll is correct.
2258
2259         This patch also fixes a bug that would trigger when resizing windows.
2260
2261         * Shared/win/ShareableBitmapDirect2D.cpp:
2262         (WebKit::ShareableBitmap::paint):
2263         * UIProcess/BackingStore.h:
2264         (WebKit::BackingStore::renderTarget): Deleted.
2265         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
2266         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
2267         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
2268         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
2269         * UIProcess/win/BackingStoreDirect2D.cpp:
2270         (WebKit::BackingStore::paint):
2271         (WebKit::BackingStore::incorporateUpdate):
2272         (WebKit::BackingStore::scroll):
2273         * UIProcess/win/WebView.cpp:
2274         (WebKit::WebView::paint):
2275         (WebKit::WebView::onSizeEvent):
2276
2277 2019-08-20  Chris Dumez  <cdumez@apple.com>
2278
2279         Unsafe usage of CookieStorageObserver from a background thread
2280         https://bugs.webkit.org/show_bug.cgi?id=200920
2281
2282         Reviewed by Alex Christensen.
2283
2284         * UIProcess/API/APIHTTPCookieStore.h:
2285         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
2286         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
2287
2288 2019-08-20  Chris Dumez  <cdumez@apple.com>
2289
2290         Use a strongly typed identifier for StorageNamespace's identifier
2291         https://bugs.webkit.org/show_bug.cgi?id=200895
2292
2293         Reviewed by Alex Christensen and Youenn Fablet.
2294
2295         Use a strongly typed identifier for StorageNamespace's identifier instead of uint64_t, to
2296         avoid type confusion.
2297
2298         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
2299         (WebKit::LocalStorageNamespace::LocalStorageNamespace):
2300         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
2301         * NetworkProcess/WebStorage/StorageManager.cpp:
2302         (WebKit::StorageManager::createSessionStorageNamespace):
2303         (WebKit::StorageManager::destroySessionStorageNamespace):
2304         (WebKit::StorageManager::cloneSessionStorageNamespace):
2305         (WebKit::StorageManager::createLocalStorageArea):
2306         (WebKit::StorageManager::createTransientLocalStorageArea):
2307         (WebKit::StorageManager::createSessionStorageArea):
2308         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
2309         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
2310         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
2311         * NetworkProcess/WebStorage/StorageManager.h:
2312         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
2313         (WebKit::StorageManagerSet::connectToLocalStorageArea):
2314         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
2315         (WebKit::StorageManagerSet::connectToSessionStorageArea):
2316         (WebKit::StorageManagerSet::cloneSessionStorageNamespace):
2317         * NetworkProcess/WebStorage/StorageManagerSet.h:
2318         * NetworkProcess/WebStorage/StorageManagerSet.messages.in:
2319         * Scripts/webkit/messages.py:
2320         * WebKit.xcodeproj/project.pbxproj:
2321         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2322         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2323         * WebProcess/WebPage/WebPage.cpp:
2324         (WebKit::m_textAutoSizingAdjustmentTimer):
2325         * WebProcess/WebPage/WebPage.h:
2326         (WebKit::WebPage::sessionStorageNamespaceIdentifier const):
2327         * WebProcess/WebPage/WebPageGroupProxy.h:
2328         (WebKit::WebPageGroupProxy::localStorageNamespaceIdentifier const):
2329         * WebProcess/WebStorage/StorageAreaMap.cpp:
2330         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2331         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2332         * WebProcess/WebStorage/StorageNamespaceIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h.
2333         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2334         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
2335         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
2336         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
2337         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
2338         (WebKit::StorageNamespaceImpl::copy):
2339         (WebKit::StorageNamespaceImpl::sessionStoragePageID const):
2340         (WebKit::StorageNamespaceImpl::pageGroupID const):
2341         * WebProcess/WebStorage/StorageNamespaceImpl.h:
2342         (WebKit::StorageNamespaceImpl::storageNamespaceID const):
2343         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
2344         (WebKit::WebStorageNamespaceProvider::getOrCreate):
2345         (WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
2346         (WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
2347         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
2348         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
2349         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
2350         * WebProcess/WebStorage/WebStorageNamespaceProvider.h:
2351
2352 2019-08-20  Dean Jackson  <dino@apple.com>
2353
2354         REGRESSION: Open in New Tab is missing from context menu
2355         https://bugs.webkit.org/show_bug.cgi?id=200909
2356         <rdar://problem/54476169>
2357
2358         Reviewed by Simon Fraser.
2359
2360         Don't assume the new API if webView:contextMenuWillPresentForElement:
2361         is implemented.
2362
2363         * UIProcess/ios/WKContentViewInteraction.mm:
2364         (needsDeprecatedPreviewAPI):
2365
2366 2019-08-20  Joseph Pecoraro  <pecoraro@apple.com>
2367
2368         Web Inspector: Support for JavaScript BigInt
2369         https://bugs.webkit.org/show_bug.cgi?id=180731
2370         <rdar://problem/36298748>
2371
2372         Reviewed by Devin Rousso.
2373
2374         * WebProcess/WebPage/WebInspectorUI.cpp:
2375         (WebKit::WebInspectorUI::WebInspectorUI):
2376         Enable BigInt in the Web Inspector process. It only makes use of
2377         `globalThis.BigInt(...)` to hold the value.
2378
2379 2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
2380
2381         [CMake] WebKit2.dll can't link because of missing PAL's import symbols for WinCairo port
2382         https://bugs.webkit.org/show_bug.cgi?id=200910
2383
2384         Unreviewed build fix for Windows port.
2385
2386         * CMakeLists.txt: Added -DSTATICALLY_LINKED_WITH_PAL=1 if PAL_LIBRARY_TYPE is STATIC.
2387
2388 2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
2389
2390         Unreviewed build fix for WinCairo port.
2391
2392         The base class of NetworkDataTask has been changed in r248874.
2393
2394         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2395         (ref):
2396         (deref):
2397         Call 'ref' and 'deref' of NetworkDataTask instead of RefCounted<NetworkDataTask>.
2398
2399 2019-08-19  Keith Rollin  <krollin@apple.com>
2400
2401         Unreviewed build fix for security entitlements.
2402
2403         Bug 200242 (r248164) changed the way that entitlements were generated
2404         and applied during the build. In that refactoring, the codesign
2405         parameter "-o library" was dropped. This change adds it back.
2406
2407         * Configurations/BaseXPCService.xcconfig:
2408
2409 2019-08-19  Chris Dumez  <cdumez@apple.com>
2410
2411         NetworkDataTask is being ref'd / deref'd from several threads and is not ThreadSafeRefCounted
2412         https://bugs.webkit.org/show_bug.cgi?id=200897
2413
2414         Reviewed by Geoffrey Garen.
2415
2416         NetworkDataTask subclasses RefCounted and is ref'd / deref'd on the main thread. However, there
2417         is code in NetworkDataTaskCocoa::resume() that was ref'ing / deref'ing it on a background thread,
2418         which is unsafe. To address the issue, Have NetworkDataTask subclass ThreadSafeRefCounted, and
2419         make sure it always gets destroyed on the main thread.
2420
2421         * NetworkProcess/NetworkDataTask.h:
2422
2423         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2424         (WebKit::NetworkDataTaskCocoa::resume):
2425         Avoid some unnecessary refcounting churn.
2426
2427 2019-08-19  Alex Christensen  <achristensen@webkit.org>
2428
2429         Move call to initializeMainThread introduced in r248549 to after WebKit.framework has been loaded
2430         https://bugs.webkit.org/show_bug.cgi?id=200896
2431         <rdar://problem/54479065>
2432
2433         Reviewed by Chris Dumez.
2434
2435         In XPCServiceMain we haven't been told which WebKit.framework to load yet, so when using staged frameworks it
2436         causes problems if we call a function from a WebKit framework.  We need to wait until after initializerFunctionPtr is called.
2437
2438         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
2439         (NetworkServiceInitializer):
2440         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
2441         (PluginServiceInitializer):
2442         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2443         (WebKit::XPCServiceMain):
2444         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
2445         (WebContentServiceInitializer):
2446
2447 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
2448
2449         Unreviewed, build fix for PLATFORM_DRIVEN_TEXT_CHECKING
2450         https://bugs.webkit.org/show_bug.cgi?id=200620
2451
2452         It is enabled if PLATFORM(MACCATALYST) is true.
2453
2454         * UIProcess/Cocoa/TextCheckingController.h:
2455
2456 2019-08-19  Sihui Liu  <sihui_liu@apple.com>
2457
2458         Remove IDB-specific quota
2459         https://bugs.webkit.org/show_bug.cgi?id=196545
2460         <rdar://problem/54201783>
2461
2462         Reviewed by Youenn Fablet.
2463
2464         * NetworkProcess/NetworkProcess.cpp:
2465         (WebKit::NetworkProcess::createIDBServer):
2466         (WebKit::NetworkProcess::addIndexedDatabaseSession):
2467         (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.
2468         * NetworkProcess/NetworkProcess.h:
2469         * NetworkProcess/NetworkProcess.messages.in:
2470         * UIProcess/API/C/WKContext.cpp:
2471         (WKContextSetIDBPerOriginQuota): Deleted.
2472         * UIProcess/API/C/WKContextPrivate.h:
2473         * UIProcess/WebProcessPool.cpp:
2474         (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.
2475         * UIProcess/WebProcessPool.h:
2476
2477 2019-08-19  Youenn Fablet  <youenn@apple.com>
2478
2479         Remove SessionID::emptySessionID()
2480         https://bugs.webkit.org/show_bug.cgi?id=200811
2481
2482         Reviewed by Alex Christensen.
2483
2484         Update SessionID call sites to use toUInt64.
2485         Remove debug asserts to isValid since construction of invalid session IDs can only happen in very specific cases
2486         typically for HashMaps.
2487
2488         * NetworkProcess/Downloads/DownloadManager.h:
2489         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2490         (WebKit::storageSession):
2491         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
2492         * NetworkProcess/NetworkProcess.cpp:
2493         (WebKit::NetworkProcess::networkSession const):
2494         (WebKit::NetworkProcess::networkSessionByConnection const):
2495         (WebKit::NetworkProcess::setSession):
2496         (WebKit::NetworkProcess::destroySession):
2497         (WebKit::NetworkProcess::fetchWebsiteData):
2498         (WebKit::NetworkProcess::deleteWebsiteData):
2499         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2500         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2501         (WebKit::NetworkProcess::existingSWOriginStoreForSession const):
2502         (WebKit::NetworkProcess::webProcessWasDisconnected):
2503         * NetworkProcess/NetworkProcess.h:
2504         * NetworkProcess/NetworkResourceLoader.cpp:
2505         (WebKit::NetworkResourceLoader::startNetworkLoad):
2506         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2507         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2508         * UIProcess/Network/NetworkProcessProxy.cpp:
2509         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
2510         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2511         (WebKit::WebsiteDataStore::~WebsiteDataStore):
2512         (WebKit::WebsiteDataStore::maybeRegisterWithSessionIDMap):
2513         (WebKit::WebsiteDataStore::existingNonDefaultDataStoreForSessionID):
2514         * WebProcess/Cache/WebCacheStorageProvider.cpp:
2515         (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
2516         * WebProcess/Cache/WebCacheStorageProvider.h:
2517         * WebProcess/Storage/WebSWClientConnection.cpp:
2518         (WebKit::WebSWClientConnection::WebSWClientConnection):
2519         (WebKit::WebSWClientConnection::initializeConnectionIfNeeded):
2520         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2521         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
2522         * WebProcess/WebPage/WebPage.cpp:
2523         (WebKit::m_textAutoSizingAdjustmentTimer):
2524
2525 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
2526
2527         Unreviewed, speculative build fix for GTK and WinCairo
2528         https://bugs.webkit.org/show_bug.cgi?id=200620
2529
2530         * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
2531
2532 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
2533
2534         Unreviewed, build fix in WinCairo and GTK ports
2535         https://bugs.webkit.org/show_bug.cgi?id=200767
2536
2537         * UIProcess/WebPageProxy.cpp:
2538         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2539
2540 2019-08-19  Youenn Fablet  <youenn@apple.com>
2541
2542         enumerateDevices should return the same JS objects if called twice
2543         https://bugs.webkit.org/show_bug.cgi?id=200767
2544
2545         Reviewed by Eric Carlson.
2546
2547         Update code as enumerate device request is now gone.
2548         Make use of async IPC to simplify code since we are now passing a completion handler directly.
2549
2550         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2551         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2552         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
2553         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2554         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2555         * UIProcess/WebPageProxy.cpp:
2556         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2557         * UIProcess/WebPageProxy.h:
2558         * UIProcess/WebPageProxy.messages.in:
2559         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2560         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
2561         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2562         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
2563         (WebKit::WebUserMediaClient::enumerateMediaDevices):
2564         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
2565         * WebProcess/WebPage/WebPage.cpp:
2566         * WebProcess/WebPage/WebPage.h:
2567         * WebProcess/WebPage/WebPage.messages.in:
2568
2569 2019-08-18  Yusuke Suzuki  <ysuzuki@apple.com>
2570
2571         [WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part
2572         https://bugs.webkit.org/show_bug.cgi?id=200620
2573
2574         Reviewed by Geoffrey Garen.
2575
2576         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
2577         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
2578         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
2579         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2580         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2581         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
2582         * NetworkProcess/Downloads/DownloadManager.cpp:
2583         (WebKit::DownloadManager::startDownload):
2584         (WebKit::DownloadManager::convertNetworkLoadToDownload):
2585         (WebKit::DownloadManager::resumeDownload):
2586         * NetworkProcess/Downloads/DownloadMap.cpp:
2587         (WebKit::DownloadMap::add):
2588         * NetworkProcess/Downloads/PendingDownload.cpp:
2589         (WebKit::PendingDownload::PendingDownload):
2590         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2591         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
2592         * NetworkProcess/NetworkContentRuleListManager.cpp:
2593         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
2594         * NetworkProcess/NetworkDataTaskBlob.cpp:
2595         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2596         (WebKit::NetworkDataTaskBlob::download):
2597         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
2598         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
2599         * NetworkProcess/NetworkLoad.cpp:
2600         (WebKit::NetworkLoad::didReceiveResponse):
2601         * NetworkProcess/NetworkLoadChecker.cpp:
2602         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
2603         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
2604         * NetworkProcess/NetworkProcess.cpp:
2605         (WebKit::NetworkProcess::switchToNewTestingSession):
2606         (WebKit::NetworkProcess::ensureSession):
2607         (WebKit::NetworkProcess::swServerForSession):
2608         (WebKit::NetworkProcess::initializeQuotaUsers):
2609         (WebKit::NetworkProcess::storageQuotaManager):
2610         * NetworkProcess/NetworkProcess.h:
2611         (WebKit::NetworkProcess::addSupplement):
2612         * NetworkProcess/NetworkResourceLoader.cpp:
2613         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
2614         (WebKit::NetworkResourceLoader::startNetworkLoad):
2615         * NetworkProcess/NetworkSocketChannel.cpp:
2616         (WebKit::NetworkSocketChannel::create):
2617         * NetworkProcess/PreconnectTask.cpp:
2618         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
2619         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
2620         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
2621         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
2622         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
2623         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
2624         * NetworkProcess/WebStorage/StorageArea.cpp:
2625         (WebKit::StorageArea::clone const):
2626         * NetworkProcess/WebStorage/StorageManager.cpp:
2627         (WebKit::StorageManager::createSessionStorageNamespace):
2628         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
2629         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
2630         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
2631         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
2632         (WebKit::StorageManagerSet::add):
2633         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
2634         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
2635         * NetworkProcess/cache/NetworkCache.cpp:
2636         (WebKit::NetworkCache::Cache::Cache):
2637         (WebKit::NetworkCache::Cache::makeEntry):
2638         (WebKit::NetworkCache::Cache::makeRedirectEntry):
2639         (WebKit::NetworkCache::Cache::update):
2640         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2641         (WebKit::NetworkCache::Entry::decodeStorageRecord):
2642         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2643         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2644         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2645         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad):
2646         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
2647         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
2648         (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests):
2649         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
2650         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
2651         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2652         (WebKit::NetworkCache::Storage::synchronize):
2653         (WebKit::NetworkCache::Storage::readRecord):
2654         (WebKit::NetworkCache::retrieveFromMemory):
2655         (WebKit::NetworkCache::Storage::retrieve):
2656         (WebKit::NetworkCache::Storage::store):
2657         (WebKit::NetworkCache::Storage::traverse):
2658         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
2659         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
2660         * NetworkProcess/cache/PrefetchCache.cpp:
2661         (WebKit::PrefetchCache::store):
2662         (WebKit::PrefetchCache::storeRedirect):
2663         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2664         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2665         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
2666         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2667         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2668         (WebKit::NetworkSessionCocoa::create):
2669         (WebKit::NetworkSessionCocoa::createWebSocketTask):
2670         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2671         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2672         * NetworkProcess/curl/NetworkSessionCurl.h:
2673         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
2674         (WebKit::NetworkConnectionToWebProcess::paymentCoordinator):
2675         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter):
2676         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2677         (WebKit::NetworkDataTaskSoup::download):
2678         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2679         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
2680         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2681         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
2682         (WebKit::NetworkSessionSoup::createWebSocketTask):
2683         * NetworkProcess/soup/NetworkSessionSoup.h:
2684         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
2685         (webkitSoupRequestInputStreamReadAsync):
2686         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
2687         (WebKit::NetworkMDNSRegister::registerMDNSName):
2688         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
2689         (WebKit::NetworkRTCMonitor::startUpdating):
2690         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2691         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
2692         (WebKit::NetworkRTCProvider::createSocket):
2693         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
2694         * Platform/IPC/Connection.cpp:
2695         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
2696         (IPC::Connection::createSyncMessageEncoder):
2697         (IPC::Connection::enableIncomingMessagesThrottling):
2698         (IPC::Connection::dispatchSyncMessage):
2699         * Platform/IPC/Connection.h:
2700         (IPC::Connection::send):
2701         (IPC::Connection::sendWithAsyncReply):
2702         * Platform/IPC/Decoder.cpp:
2703         (IPC::Decoder::unwrapForTesting):
2704         * Platform/IPC/HandleMessage.h:
2705         (IPC::handleMessageAsync):
2706         * Platform/IPC/MessageSender.h:
2707         * Platform/IPC/cocoa/ConnectionCocoa.mm:
2708         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2709         (IPC::Connection::open):
2710         (IPC::createMessageDecoder):
2711         (IPC::Connection::receiveSourceEventHandler):
2712         * Platform/IPC/unix/ConnectionUnix.cpp:
2713         (IPC::Connection::processMessage):
2714         (IPC::Connection::sendOutputMessage):
2715         * Platform/IPC/win/ConnectionWin.cpp:
2716         (IPC::Connection::readEventHandler):
2717         * Platform/mac/LayerHostingContext.mm:
2718         (WebKit::LayerHostingContext::createForPort):
2719         (WebKit::LayerHostingContext::createForExternalHostingProcess):
2720         (WebKit::LayerHostingContext::createForExternalPluginHostingProcess):
2721         * PluginProcess/WebProcessConnection.cpp:
2722         (WebKit::WebProcessConnection::createPluginInternal):
2723         * Shared/API/APIURL.h:
2724         (API::URL::create):
2725         (API::URL::parseURLIfNecessary const):
2726         * Shared/API/Cocoa/RemoteObjectInvocation.mm:
2727         (WebKit::RemoteObjectInvocation::decode):
2728         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
2729         (-[_WKRemoteObjectRegistry _initWithWebPage:]):
2730         (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
2731         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
2732         * Shared/API/glib/WebKitContextMenuItem.cpp:
2733         (webkitContextMenuItemCreate):
2734         (webkit_context_menu_item_new):
2735         (webkit_context_menu_item_new_from_gaction):
2736         (webkit_context_menu_item_new_from_stock_action):
2737         (webkit_context_menu_item_new_from_stock_action_with_label):
2738         (webkit_context_menu_item_new_with_submenu):
2739         (webkit_context_menu_item_new_separator):
2740         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2741         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2742         * Shared/Cocoa/SandboxExtensionCocoa.mm:
2743         (WebKit::SandboxExtension::Handle::decode):
2744         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2745         (WebKit::texmapLayer):
2746         (WebKit::CoordinatedGraphicsScene::ensureRootLayer):
2747         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2748         (WebKit::ThreadedCompositor::ThreadedCompositor):
2749         * Shared/Plugins/NPRemoteObjectMap.cpp:
2750         (WebKit::NPRemoteObjectMap::registerNPObject):
2751         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2752         (WebKit::NetscapePluginModule::tryLoad):
2753         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2754         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2755         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
2756         (WebKit::RemoteLayerTreeTransaction::decode):
2757         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2758         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2759         * Shared/cairo/ShareableBitmapCairo.cpp:
2760         (WebKit::ShareableBitmap::createGraphicsContext):
2761         * Shared/cg/ShareableBitmapCG.cpp:
2762         (WebKit::ShareableBitmap::createGraphicsContext):
2763         * Shared/win/ShareableBitmapDirect2D.cpp:
2764         (WebKit::ShareableBitmap::createGraphicsContext):
2765         * UIProcess/API/APIHTTPCookieStore.cpp:
2766         (API::HTTPCookieStore::registerObserver):
2767         * UIProcess/API/C/WKContext.cpp:
2768         (WKContextSetInjectedBundleClient):
2769         (WKContextSetHistoryClient):
2770         (WKContextSetDownloadClient):
2771         * UIProcess/API/C/WKGeolocationManager.cpp:
2772         (WKGeolocationManagerSetProvider):
2773         * UIProcess/API/C/WKNotificationManager.cpp:
2774         (WKNotificationManagerSetProvider):
2775         * UIProcess/API/C/WKPage.cpp:
2776         (WKPageSetPageContextMenuClient):
2777         (WKPageSetPageDiagnosticLoggingClient):
2778         (WKPageSetPageFindClient):
2779         (WKPageSetPageFindMatchesClient):
2780         (WKPageSetPageFormClient):
2781         (WKPageSetPageLoaderClient):
2782         (WKPageSetPagePolicyClient):
2783         (WKPageSetPageUIClient):
2784         (WKPageSetPageStateClient):
2785         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
2786         (-[WKObservablePageState initWithPage:]):
2787         * UIProcess/API/C/wpe/WKView.cpp:
2788         (WKViewSetViewClient):
2789         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2790         (-[WKBrowsingContextController _initWithPageRef:]):
2791         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2792         (-[WKHTTPCookieStore addObserver:]):
2793         * UIProcess/API/Cocoa/WKProcessPool.mm:
2794         (-[WKProcessPool _setDownloadDelegate:]):
2795         (-[WKProcessPool _setAutomationDelegate:]):
2796         * UIProcess/API/Cocoa/WKUserContentController.mm:
2797         (-[WKUserContentController addScriptMessageHandler:name:]):
2798         (-[WKUserContentController _addScriptMessageHandler:name:userContentWorld:]):
2799         * UIProcess/API/Cocoa/WKWebView.mm:
2800         (-[WKWebView _initializeWithConfiguration:]):
2801         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
2802         (-[WKWebView _setInputDelegate:]):
2803         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
2804         (-[_WKAutomationSession setDelegate:]):
2805         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
2806         (-[_WKRemoteWebInspectorViewController init]):
2807         * UIProcess/API/glib/IconDatabase.cpp:
2808         (WebKit::readySQLiteStatement):
2809         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2810         (webkitAutomationSessionConstructed):
2811         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
2812         (attachContextMenuClientToView):
2813         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp:
2814         (attachCustomProtocolManagerClientToContext):
2815         * UIProcess/API/glib/WebKitDownloadClient.cpp:
2816         (attachDownloadClientToContext):
2817         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
2818         (webkitFaviconDatabaseOpen):
2819         * UIProcess/API/glib/WebKitFindController.cpp:
2820         (webkitFindControllerConstructed):
2821         * UIProcess/API/glib/WebKitFormClient.cpp:
2822         (attachFormClientToView):
2823         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
2824         (webkitGeolocationManagerCreate):
2825         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
2826         (attachIconLoadingClientToView):
2827         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
2828         (attachInjectedBundleClientToContext):
2829         * UIProcess/API/glib/WebKitNotificationProvider.cpp:
2830         (WebKitNotificationProvider::WebKitNotificationProvider):
2831         * UIProcess/API/glib/WebKitUIClient.cpp:
2832         (attachUIClientToView):
2833         * UIProcess/API/glib/WebKitUserContentManager.cpp:
2834         (webkit_user_content_manager_register_script_message_handler):
2835         (webkit_user_content_manager_register_script_message_handler_in_world):
2836         * UIProcess/API/glib/WebKitWebContext.cpp:
2837         (webkitWebContextConstructed):
2838         (webkit_web_context_set_automation_allowed):
2839         * UIProcess/API/glib/WebKitWebView.cpp:
2840         (webkitWebViewConstructed):
2841         * UIProcess/API/gtk/PageClientImpl.cpp:
2842         (WebKit::PageClientImpl::createDrawingAreaProxy):
2843         * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
2844         (webkitEmojiChooserSetupEmojiSections):
2845         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2846         (WebKit::RemoteInspectorProtocolHandler::handleRequest):
2847         * UIProcess/API/gtk/WebKitWebInspector.cpp:
2848         (webkitWebInspectorCreate):
2849         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2850         (webkitWebViewBaseConstructed):
2851         (webkitWebViewBaseGestureController):
2852         (webkitWebViewBaseDragAndDropHandler):
2853         (webkitWebViewBaseDidRelaunchWebProcess):
2854         * UIProcess/API/mac/WKView.mm:
2855         (-[WKView maybeInstallIconLoadingClient]):
2856         (-[WKView initWithFrame:processPool:configuration:]):
2857         * UIProcess/API/wpe/PageClientImpl.cpp:
2858         (WebKit::PageClientImpl::PageClientImpl):
2859         (WebKit::PageClientImpl::createDrawingAreaProxy):
2860         * UIProcess/API/wpe/WPEView.cpp:
2861         (WKWPE::View::View):
2862         (WKWPE::View::setClient):
2863         * UIProcess/API/wpe/qt/WPEQtView.cpp:
2864         (WPEQtView::notifyLoadChangedCallback):
2865         (WPEQtView::notifyLoadFailedCallback):
2866         (WPEQtView::runJavaScript):
2867         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
2868         (WPEQtViewBackend::create):
2869         * UIProcess/Automation/WebAutomationSession.cpp:
2870         (WebKit::WebAutomationSession::WebAutomationSession):
2871         * UIProcess/AuxiliaryProcessProxy.h:
2872         (WebKit::AuxiliaryProcessProxy::send):
2873         * UIProcess/Cocoa/IconLoadingDelegate.mm:
2874         (WebKit::IconLoadingDelegate::createIconLoadingClient):
2875         * UIProcess/Cocoa/UIDelegate.mm:
2876         (WebKit::UIDelegate::createContextMenuClient):
2877         (WebKit::UIDelegate::createUIClient):
2878         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2879         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2880         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2881         (WebKit::WebProcessPool::platformInitialize):
2882         (WebKit::WebProcessPool::startDisplayLink):
2883         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2884         (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
2885         * UIProcess/Cocoa/WebViewImpl.mm:
2886         (WebKit::WebViewImpl::WebViewImpl):
2887         (WebKit::WebViewImpl::createDrawingAreaProxy):
2888         (WebKit::WebViewImpl::setTextIndicator):
2889         (WebKit::WebViewImpl::ensureGestureController):
2890         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
2891         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
2892         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
2893         * UIProcess/DeviceIdHashSaltStorage.cpp:
2894         (WebKit::DeviceIdHashSaltStorage::getDataFromDecoder const):
2895         (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall):
2896         * UIProcess/Downloads/DownloadProxyMap.cpp:
2897         (WebKit::DownloadProxyMap::createDownloadProxy):
2898         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2899         (WebKit::UIGamepadProvider::setInitialConnectedGamepads):
2900         (WebKit::UIGamepadProvider::platformGamepadConnected):
2901         * UIProcess/Network/NetworkProcessProxy.cpp:
2902         (WebKit::NetworkProcessProxy::createDownloadProxy):
2903         (WebKit::NetworkProcessProxy::takeUploadAssertion):
2904         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2905         (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
2906         (WebKit::WebNotificationManagerProxy::setProvider):
2907         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2908         (WebKit::pluginRequiresGtk2):
2909         * UIProcess/ProcessThrottler.cpp:
2910         (WebKit::ProcessThrottler::didConnectToProcess):
2911         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2912         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2913         (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
2914         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2915         (WebKit::RemoteLayerTreeHost::makeNode):
2916         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
2917         (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
2918         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2919         (WebKit::RemoteLayerTreeHost::makeNode):
2920         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2921         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
2922         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2923         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
2924         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
2925         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac):
2926         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
2927         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
2928         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2929         (WebKit::HidService::deviceAdded):
2930         * UIProcess/WebGeolocationManagerProxy.cpp:
2931         (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
2932         (WebKit::WebGeolocationManagerProxy::setProvider):
2933         * UIProcess/WebMediaSessionFocusManager.cpp:
2934         (WebKit::WebMediaSessionFocusManager::setFocusedMediaElement):
2935         * UIProcess/WebPageInspectorController.cpp:
2936         (WebKit::WebPageInspectorController::WebPageInspectorController):
2937         * UIProcess/WebPageProxy.cpp:
2938         (WebKit::WebPageProxy::WebPageProxy):
2939         (WebKit::m_resetRecentCrashCountTimer):
2940         (WebKit::WebPageProxy::setFormClient):
2941         (WebKit::WebPageProxy::setUIClient):
2942         (WebKit::WebPageProxy::setIconLoadingClient):
2943         (WebKit::WebPageProxy::setFindClient):
2944         (WebKit::WebPageProxy::setFindMatchesClient):
2945         (WebKit::WebPageProxy::setContextMenuClient):
2946         (WebKit::WebPageProxy::setInjectedBundleClient):
2947         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2948         (WebKit::WebPageProxy::didAttachToRunningProcess):
2949         (WebKit::WebPageProxy::setDrawingArea):
2950         (WebKit::WebPageProxy::close):
2951         (WebKit::WebPageProxy::loadData):
2952         (WebKit::WebPageProxy::handleWheelEvent):
2953         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
2954         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2955         (WebKit::WebPageProxy::setFullscreenClient):
2956         (WebKit::WebPageProxy::userMediaPermissionRequestManager):
2957         (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled):
2958         (WebKit::WebPageProxy::speechSynthesisData):
2959         * UIProcess/WebProcessCache.cpp:
2960         (WebKit::WebProcessCache::addProcessIfPossible):
2961         * UIProcess/WebProcessPool.cpp:
2962         (WebKit::WebProcessPool::WebProcessPool):
2963         (WebKit::WebProcessPool::setInjectedBundleClient):
2964         (WebKit::WebProcessPool::setHistoryClient):
2965         (WebKit::WebProcessPool::setDownloadClient):
2966         (WebKit::WebProcessPool::setAutomationClient):
2967         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
2968         (WebKit::WebProcessPool::ensureNetworkProcess):
2969         (WebKit::WebProcessPool::didCollectPrewarmInformation):
2970         (WebKit::WebProcessPool::setWebProcessHasUploads):
2971         (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
2972         * UIProcess/WebProcessProxy.cpp:
2973         * UIProcess/cairo/BackingStoreCairo.cpp:
2974         (WebKit::BackingStore::createBackend):
2975         * UIProcess/glib/RemoteInspectorClient.cpp:
2976         (WebKit::RemoteInspectorClient::inspect):
2977         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2978         (WebKit::AcceleratedBackingStoreWayland::checkRequirements):
2979         * UIProcess/gtk/DragAndDropHandler.cpp:
2980         (WebKit::DragAndDropHandler::dragDataSelection):
2981         * UIProcess/gtk/WaylandCompositor.cpp:
2982         (WebKit::WaylandCompositor::initializeEGL):
2983         * UIProcess/ios/EditableImageController.mm:
2984         (WebKit::EditableImageController::ensureEditableImage):
2985         * UIProcess/ios/WKApplicationStateTrackingView.mm:
2986         (-[WKApplicationStateTrackingView didMoveToWindow]):
2987         * UIProcess/ios/WKContentView.mm:
2988         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2989         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
2990         (-[WKContentView _createDrawingAreaProxy:]):
2991         * UIProcess/ios/WKContentViewInteraction.mm:
2992         (-[WKContentView setupInteraction]):
2993         (-[WKContentView becomeFirstResponderForWebView]):
2994         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
2995         * UIProcess/ios/WebPageProxyIOS.mm:
2996         (WebKit::WebPageProxy::elementDidFocus):
2997         (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter):
2998         * UIProcess/mac/PageClientImplMac.mm:
2999         (WebKit::PageClientImpl::PageClientImpl):
3000         * UIProcess/mac/WKFullScreenWindowController.mm:
3001         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
3002         * UIProcess/mac/WKTextFinderClient.mm:
3003         (-[WKTextFinderClient initWithPage:view:usePlatformFindUI:]):
3004         * UIProcess/socket/RemoteInspectorClient.cpp:
3005         (WebKit::RemoteInspectorClient::inspect):
3006         * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
3007         (WebKit::RemoteInspectorProtocolHandler::platformStartTask):
3008         * UIProcess/win/BackingStoreDirect2D.cpp:
3009         (WebKit::BackingStore::createBackend):
3010         * UIProcess/win/PageClientImpl.cpp:
3011         (WebKit::PageClientImpl::createDrawingAreaProxy):
3012         * UIProcess/win/WebView.cpp:
3013         (WebKit::WebView::WebView):
3014         * WebProcess/Gamepad/WebGamepadProvider.cpp:
3015         (WebKit::WebGamepadProvider::setInitialGamepads):
3016         (WebKit::WebGamepadProvider::gamepadConnected):
3017         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3018         (WKBundleSetClient):
3019         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3020         (WKBundlePageSetContextMenuClient):
3021         (WKBundlePageSetEditorClient):
3022         (WKBundlePageSetFormClient):
3023         (WKBundlePageSetPageLoaderClient):
3024         (WKBundlePageSetResourceLoadClient):
3025         (WKBundlePageSetUIClient):
3026         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3027         (WKBundlePageOverlayCreate):
3028         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
3029         (WKBundlePageBannerCreateBannerWithCALayer):
3030         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp:
3031         (WebKit::getOrCreateDOMObjectCacheFrameObserver):
3032         (WebKit::DOMObjectCache::put):
3033         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
3034         (WebKit::WebKitExtensionManager::initialize):
3035         * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp:
3036         (webkitWebEditorCreate):
3037         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
3038         (webkitWebExtensionCreate):
3039         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
3040         (webkitFrameGetOrCreate):
3041         (webkitWebPageCreate):
3042         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
3043         (-[WKDOMTextIterator initWithRange:]):
3044         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3045         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
3046         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
3047         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3048         (WebKit::InjectedBundle::InjectedBundle):
3049         (WebKit::InjectedBundle::setClient):
3050         * WebProcess/Network/WebSocketChannel.cpp:
3051         (WebKit::PendingMessage::PendingMessage):
3052         (WebKit::WebSocketChannel::send):
3053         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3054         (WebKit::LibWebRTCProvider::createPeerConnection):
3055         (WebKit::LibWebRTCProvider::createSocketFactory):
3056         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
3057         (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
3058         (WebKit::LibWebRTCSocketFactory::createUdpSocket):
3059         (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
3060         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
3061         (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
3062         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
3063         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
3064         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3065         (WebKit::NetscapePlugin::scheduleTimer):
3066         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
3067         (WebKit::NetscapePluginStream::deliverData):
3068         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3069         (WebKit::NetscapePluginX11::create):
3070         * WebProcess/Plugins/PluginProxy.cpp:
3071         (WebKit::PluginProxy::initialize):
3072         * WebProcess/Plugins/PluginView.cpp:
3073         (WebKit::PluginView::createWebEvent const):
3074         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3075         (WebKit::WebSWContextManagerConnection::installServiceWorker):
3076         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3077         (WebKit::WebChromeClient::createColorChooser):
3078         (WebKit::WebChromeClient::createDataListSuggestionPicker):
3079         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3080         (WebKit::WebInspectorClient::showPaintRect):
3081         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
3082         (WebKit::WebPasteboardOverrides::addOverride):
3083         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
3084         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
3085         * WebProcess/WebPage/DrawingArea.cpp:
3086         (WebKit::DrawingArea::create):
3087         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
3088         (WebKit::PlatformCALayerRemote::ensureBackingStore):
3089         (WebKit::PlatformCALayerRemote::setTransform):
3090         (WebKit::PlatformCALayerRemote::setSublayerTransform):
3091         (WebKit::PlatformCALayerRemote::setFilters):
3092         (WebKit::PlatformCALayerRemote::setShapeRoundedRect):
3093         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp:
3094         (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
3095         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3096         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3097         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3098         * WebProcess/WebPage/WebFrame.cpp:
3099         (WebKit::WebFrame::createSubframe):
3100         * WebProcess/WebPage/WebPage.cpp:
3101         (WebKit::m_textAutoSizingAdjustmentTimer):
3102         (WebKit::WebPage::setInjectedBundleContextMenuClient):
3103         (WebKit::WebPage::setInjectedBundleEditorClient):
3104         (WebKit::WebPage::setInjectedBundleFormClient):
3105         (WebKit::WebPage::setInjectedBundlePageLoaderClient):
3106         (WebKit::WebPage::setInjectedBundleResourceLoadClient):
3107         (WebKit::WebPage::setInjectedBundleUIClient):
3108         (WebKit::WebPage::close):
3109         (WebKit::WebPage::beginPrinting):
3110         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
3111         (WebKit::WebPrintOperationGtk::print):
3112         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3113         (WebKit::FindController::updateFindIndicator):
3114         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
3115         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
3116         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3117         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3118         * WebProcess/WebProcess.cpp:
3119         (WebKit::WebProcess::markAllLayersVolatile):
3120         (WebKit::WebProcess::ensureAutomationSessionProxy):
3121         (WebKit::WebProcess::libWebRTCNetwork):
3122         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
3123         * WebProcess/WebProcess.h:
3124         (WebKit::WebProcess::addSupplement):
3125         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3126         (WebKit::UserMediaCaptureManager::Source::Source):
3127         * WebProcess/cocoa/WebProcessCocoa.mm:
3128         (WebKit::WebProcess::processTaskStateDidChange):
3129         (WebKit::WebProcess::updateCPUMonitorState):
3130
3131 2019-08-18  Per Arne Vollan  <pvollan@apple.com>
3132
3133         [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
3134         https://bugs.webkit.org/show_bug.cgi?id=200543
3135         <rdar://problem/49394015>
3136         
3137         Reviewed by Brent Fulgham.
3138
3139         Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process
3140         identifier of the WebContent process.
3141         
3142         * Shared/Cocoa/SandboxExtensionCocoa.mm:
3143         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
3144         (WebKit::SandboxExtension::createHandleForReadByPid):
3145         * Shared/SandboxExtension.h:
3146         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3147         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
3148         * UIProcess/WebPageProxy.cpp:
3149         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3150         (WebKit::WebPageProxy::loadFile):
3151
3152 2019-08-17  Tim Horton  <timothy_horton@apple.com>
3153
3154         Layout tests that call resizeTo() crash when run on iOS with IOSurface support enabled
3155         https://bugs.webkit.org/show_bug.cgi?id=200866
3156         <rdar://problem/50254021>
3157
3158         Reviewed by Simon Fraser.
3159
3160         * UIProcess/ios/PageClientImplIOS.mm:
3161         (WebKit::PageClientImpl::convertToDeviceSpace):
3162         (WebKit::PageClientImpl::convertToUserSpace):
3163         Implement convertTo{Device,User}Space in PageClientImplIOS.
3164         We don't actually do any conversion. For our purposes, the window is
3165         "device" space, and we never allow iOS WebKit clients to resize the window...
3166         except for in tests! So just pass the rects straight through, instead of
3167         returning an empty rect.
3168
3169 2019-08-17  Eric Liang  <ericliang@apple.com>
3170
3171         Use bundlePath SPI in AccessibilitySupport for WebProcessLoader
3172         https://bugs.webkit.org/show_bug.cgi?id=200367
3173
3174         Reviewed by Darin Adler.
3175
3176         * Platform/spi/ios/AccessibilitySupportSPI.h:
3177         * WebProcess/cocoa/WebProcessCocoa.mm:
3178         (WebKit::accessibilityWebProcessLoaderBundlePath):
3179         (WebKit::registerWithAccessibility):
3180
3181 2019-08-17  Sam Weinig  <weinig@apple.com>
3182
3183         Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...)
3184         https://bugs.webkit.org/show_bug.cgi?id=200756
3185
3186         Reviewed by Darin Adler.
3187
3188         Update call sites for rename from StringBuilder::flexibleAppend(...) to 
3189         StringBuilder::append(...).
3190
3191         * WebProcess/WebPage/WebPage.cpp:
3192         (WebKit::dumpHistoryItem):
3193         We have to explicitly access the underlying String of the URL rather than
3194         relying on the implicit conversion since it is now ambiguous which append(...)
3195         overload should be used.
3196
3197 2019-08-17  Devin Rousso  <drousso@apple.com>
3198
3199         Web Inspector: make the initial height bigger when attached
3200         https://bugs.webkit.org/show_bug.cgi?id=200855
3201
3202         Reviewed by Joseph Pecoraro.
3203
3204         * Shared/WebPreferences.yaml:
3205         Increase the default attached height from `300px` to `500px`, which is close to the same
3206         amount of area given a 15" MacBook Pro's aspect ratio (default attached width is `750px`).
3207
3208 2019-08-17  Simon Fraser  <simon.fraser@apple.com>
3209
3210         [iOS WK2] Scroll indicators disappear sometimes
3211         https://bugs.webkit.org/show_bug.cgi?id=200791
3212
3213         Reviewed by Tim Horton.
3214         
3215         _web_setSubviews: replaces all of the views subviews with the supplied array, but this blows
3216         away views not managed by WebKit, including UIScrollViews scroll indicators. Fix by having
3217         WebKit-managed views implement the WKWebKitControlled protocol, and only removing views
3218         implementing that protocol.
3219
3220         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3221         (-[UIView _web_setSubviews:]):
3222         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
3223
3224 2019-08-17  Antti Koivisto  <antti@apple.com>
3225
3226         Content in <iframe> should override "touch-action" set in embedding document
3227         https://bugs.webkit.org/show_bug.cgi?id=200204
3228         <rdar://problem/54355249>
3229
3230         Reviewed by Antoine Quint.
3231
3232         Subframes where content doesn't use any touch-action properties won't generate event region for their main layer.
3233         As a result the touch-action property gets computed in UI process to the parent frames touch-action (instead of 'auto').
3234
3235         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3236         (WebKit::touchActionsForPoint):
3237
3238         If the topmost layer hit is a WKChildScrollView we know its content layer didn't have an event region.
3239         This means we should return the default value 'auto'.
3240
3241 2019-08-16  Chris Dumez  <cdumez@apple.com>
3242
3243         Use strongly typed identifiers for StorageArea / StorageAreaImpl
3244         https://bugs.webkit.org/show_bug.cgi?id=200835
3245
3246         Reviewed by Alex Christensen.
3247
3248         Use strongly typed identifiers for StorageArea / StorageAreaImpl. They currently both use uint64_t
3249         and are used in the same code, it is therefore very easy to confused the 2 types of identifiers.
3250
3251         * NetworkProcess/WebStorage/StorageArea.cpp:
3252         (WebKit::StorageArea::StorageArea):
3253         (WebKit::StorageArea::setItem):
3254         (WebKit::StorageArea::removeItem):
3255         (WebKit::StorageArea::clear):
3256         (WebKit::StorageArea::dispatchEvents const):
3257         * NetworkProcess/WebStorage/StorageArea.h:
3258         (WebKit::StorageArea::identifier):
3259         * NetworkProcess/WebStorage/StorageAreaIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h.
3260         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
3261         (WebKit::StorageManagerSet::connectToLocalStorageArea):
3262         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
3263         (WebKit::StorageManagerSet::connectToSessionStorageArea):
3264         (WebKit::StorageManagerSet::disconnectFromStorageArea):
3265         (WebKit::StorageManagerSet::getValues):
3266         (WebKit::StorageManagerSet::setItem):
3267         (WebKit::StorageManagerSet::removeItem):
3268         (WebKit::StorageManagerSet::clear):
3269         * NetworkProcess/WebStorage/StorageManagerSet.h:
3270         * NetworkProcess/WebStorage/StorageManagerSet.messages.in:
3271         * Scripts/webkit/messages.py:
3272         * WebKit.xcodeproj/project.pbxproj:
3273         * WebProcess/Network/NetworkProcessConnection.cpp:
3274         (WebKit::NetworkProcessConnection::didReceiveMessage):
3275         * WebProcess/WebProcess.cpp:
3276         (WebKit::WebProcess::registerStorageAreaMap):
3277         (WebKit::WebProcess::unregisterStorageAreaMap):
3278         (WebKit::WebProcess::storageAreaMap const):
3279         * WebProcess/WebProcess.h:
3280         * WebProcess/WebStorage/StorageAreaImpl.cpp:
3281         (WebKit::StorageAreaImpl::StorageAreaImpl):
3282         * WebProcess/WebStorage/StorageAreaImpl.h:
3283         * WebProcess/WebStorage/StorageAreaImplIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h.
3284         * WebProcess/WebStorage/StorageAreaMap.cpp:
3285         (WebKit::StorageAreaMap::StorageAreaMap):
3286         (WebKit::StorageAreaMap::setItem):
3287         (WebKit::StorageAreaMap::removeItem):
3288         (WebKit::StorageAreaMap::clear):
3289         (WebKit::StorageAreaMap::loadValuesIfNeeded):
3290         (WebKit::StorageAreaMap::dispatchStorageEvent):
3291         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3292         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3293         (WebKit::StorageAreaMap::disconnect):
3294         * WebProcess/WebStorage/StorageAreaMap.h:
3295         (WebKit::StorageAreaMap::identifier const):
3296         * WebProcess/WebStorage/StorageAreaMap.messages.in:
3297
3298 2019-08-16  Chris Dumez  <cdumez@apple.com>
3299
3300         Drop StorageArea::setWorkQueue() member function
3301         https://bugs.webkit.org/show_bug.cgi?id=200832
3302
3303         Reviewed by Alex Christensen.
3304
3305         Drop StorageArea::setWorkQueue() member function and pass the WorkQueue to the StorageArea constructor instead.
3306         The WorkQueue can never get updated so an explicit setter is not necessary. It also makes it clearer that the
3307         m_queue data member can never be null.
3308
3309         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
3310         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
3311         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
3312         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
3313         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
3314         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
3315         * NetworkProcess/WebStorage/StorageArea.cpp:
3316         (WebKit::StorageArea::StorageArea):
3317         (WebKit::StorageArea::clone const):
3318         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
3319         * NetworkProcess/WebStorage/StorageArea.h:
3320         (WebKit::StorageArea::setWorkQueue): Deleted.
3321         * NetworkProcess/WebStorage/StorageManager.cpp:
3322         (WebKit::StorageManager::createLocalStorageArea):
3323         (WebKit::StorageManager::createTransientLocalStorageArea):
3324         (WebKit::StorageManager::createSessionStorageArea):
3325         * NetworkProcess/WebStorage/StorageManager.h:
3326         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
3327         (WebKit::StorageManagerSet::connectToLocalStorageArea):
3328         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
3329         (WebKit::StorageManagerSet::connectToSessionStorageArea):
3330         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
3331         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
3332         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:
3333
3334 2019-08-16  Chris Dumez  <cdumez@apple.com>
3335
3336         LocalStorageDatabaseTracker does not need to subclass ThreadSafeRefCounted
3337         https://bugs.webkit.org/show_bug.cgi?id=200825
3338
3339         Reviewed by Alex Christensen.
3340
3341         LocalStorageDatabaseTracker does not need to subclass ThreadSafeRefCounted. It is currently always
3342         ref'd / deref'd from the com.apple.WebKit.WebStorage serial WorkQueue, save from inside
3343         LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup() on iOS. However, it is probably
3344         not a good idea to set FileSystem metadata from the main thread in platformMaybeExcludeFromBackup()
3345         anyway.
3346
3347         Note that I had to get rid of an old linked-on-after check since those are currently only safe
3348         to do on the main thread. I cleared this with Brady. It has been a while since we've shipped this
3349         behavior now and apps have had a chance to update.
3350
3351         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3352         (WebKit::LocalStorageDatabaseTracker::databasePath const):
3353         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
3354         * NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
3355         (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
3356         * UIProcess/Cocoa/VersionChecks.h:
3357
3358 2019-08-16  Chris Dumez  <cdumez@apple.com>
3359
3360         LocalStorageDatabase should use inline initialization for its data members
3361         https://bugs.webkit.org/show_bug.cgi?id=200828
3362
3363         Reviewed by John Wilander.
3364
3365         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
3366         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3367         * NetworkProcess/WebStorage/LocalStorageDatabase.h:
3368
3369 2019-08-16  Kate Cheney  <katherine_cheney@apple.com>
3370
3371         Functions with no parameters in WebKit/Shared/API/c and WebKit/UIProcess/API/C are
3372         missing a "void" specifier in their argument list
3373         https://bugs.webkit.org/show_bug.cgi?id=200826
3374
3375         Reviewed by Chris Dumez.
3376
3377         Added void to indicate functions with no arguments to satisfy compiler errors.
3378         This error came to light when fixing another patch.
3379
3380         * Shared/API/c/WKArray.h:
3381         * Shared/API/c/WKConnectionRef.h:
3382         * Shared/API/c/WKContextMenuItem.h:
3383         * Shared/API/c/WKData.h:
3384         * Shared/API/c/WKDictionary.h:
3385         * Shared/API/c/WKErrorRef.h:
3386         * Shared/API/c/WKMutableArray.h:
3387         * Shared/API/c/WKMutableDictionary.h:
3388         * Shared/API/c/WKNumber.h:
3389         * Shared/API/c/WKPluginInformation.h:
3390         * Shared/API/c/WKRenderLayer.h:
3391         * Shared/API/c/WKRenderObject.h:
3392         * Shared/API/c/WKSecurityOriginRef.h:
3393         * Shared/API/c/WKSerializedScriptValue.h:
3394         * Shared/API/c/WKString.h:
3395         * Shared/API/c/WKURL.h:
3396         * Shared/API/c/WKURLRequest.h:
3397         * Shared/API/c/WKURLResponse.h:
3398         * Shared/API/c/WKUserContentURLPattern.h:
3399         * UIProcess/API/C/WKBackForwardListItemRef.h:
3400         * UIProcess/API/C/WKBackForwardListRef.h:
3401         * UIProcess/API/C/WKContext.h:
3402         * UIProcess/API/C/WKFormSubmissionListener.h:
3403         * UIProcess/API/C/WKFrame.h:
3404         * UIProcess/API/C/WKFramePolicyListener.h:
3405         * UIProcess/API/C/WKGeolocationManager.h:
3406         * UIProcess/API/C/WKGeolocationPermissionRequest.h:
3407         * UIProcess/API/C/WKGeolocationPosition.h:
3408         * UIProcess/API/C/WKHitTestResult.h:
3409         * UIProcess/API/C/WKNavigationDataRef.h:
3410         * UIProcess/API/C/WKOpenPanelParametersRef.h:
3411         * UIProcess/API/C/WKOpenPanelResultListener.h:
3412         * UIProcess/API/C/WKPage.h:
3413         * UIProcess/API/C/WKPageConfigurationRef.h:
3414         * UIProcess/API/C/WKPageGroup.h:
3415         * UIProcess/API/C/WKPageUIClient.h:
3416         * UIProcess/API/C/WKPreferencesRef.h:
3417         * UIProcess/API/C/WKUserContentControllerRef.h:
3418         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
3419         * UIProcess/API/C/WKUserScriptRef.h:
3420
3421 2019-08-16  Chris Dumez  <cdumez@apple.com>
3422
3423         LocalStorageDatabase does not need to subclass ThreadSafeRefCounted
3424         https://bugs.webkit.org/show_bug.cgi?id=200822
3425
3426         Reviewed by Geoff Garen.
3427
3428         LocalStorageDatabase does not need to subclass ThreadSafeRefCounted, it is only ref'd / deref'd by the StorageArea
3429         on the com.apple.WebKit.WebStorage serial WorkQueue, and in LocalStorageDatabase::scheduleDatabaseUpdate() on the
3430         same WorkQueue.
3431
3432         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
3433         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3434         (WebKit::LocalStorageDatabase::~LocalStorageDatabase):
3435         * NetworkProcess/WebStorage/LocalStorageDatabase.h:
3436
3437 2019-08-16  Chris Dumez  <cdumez@apple.com>
3438
3439         Many WebStorage classes do not need to subclass ThreadSafeRefCounted
3440         https://bugs.webkit.org/show_bug.cgi?id=200821
3441
3442         Reviewed by Geoffrey Garen.
3443
3444         Many WebStorage classes do not need to subclass ThreadSafeRefCounted. They never get ref'd or deref'd.
3445
3446         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
3447         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
3448         (WebKit::LocalStorageNamespace::clearAllStorageAreas):
3449         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
3450         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
3451         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
3452         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
3453         * NetworkProcess/WebStorage/StorageArea.cpp:
3454         (WebKit::StorageArea::clone const):
3455         * NetworkProcess/WebStorage/StorageArea.h:
3456         * NetworkProcess/WebStorage/StorageManager.cpp:
3457         (WebKit::StorageManager::createSessionStorageNamespace):
3458         (WebKit::StorageManager::createLocalStorageArea):
3459         (WebKit::StorageManager::createTransientLocalStorageArea):
3460         (WebKit::StorageManager::createSessionStorageArea):
3461         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
3462         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
3463         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
3464         * NetworkProcess/WebStorage/StorageManager.h:
3465         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
3466         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
3467         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:
3468
3469 2019-08-16  Dean Jackson  <dino@apple.com>
3470
3471         Long pressing images with transparent backgrounds in dark mode causes a black background to appear around the image content
3472         https://bugs.webkit.org/show_bug.cgi?id=200827
3473         <rdar://53933379>
3474
3475         Reviewed by Tim Horton.
3476
3477         Set a clear color when there is no provided background.
3478
3479         * UIProcess/ios/WKContentViewInteraction.mm:
3480         (createTargetedPreview):
3481
3482 2019-08-16  Ryosuke Niwa  <rniwa@webkit.org>
3483
3484         Split tabIndex computation for DOM and the rest of WebCore
3485         https://bugs.webkit.org/show_bug.cgi?id=200806
3486
3487         Reviewed by Chris Dumez.
3488
3489         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
3490         (webkit_dom_html_element_get_tab_index):
3491         (webkit_dom_html_element_set_tab_index):
3492
3493 2019-08-16  Ross Kirsling  <ross.kirsling@sony.com>
3494
3495         Unreviewed restabilization of non-unified build.
3496
3497         * NetworkProcess/NetworkCORSPreflightChecker.h:
3498         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
3499         (WebKit::StorageManagerSet::StorageManagerSet):
3500         * Shared/FrameInfoData.cpp:
3501         (WebKit::FrameInfoData::decode):
3502         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
3503         * WebProcess/WebStorage/StorageNamespaceImpl.h:
3504
3505 2019-08-16  Chris Dumez  <cdumez@apple.com>
3506
3507         StorageManager does not need to subclass RefCounted
3508         https://bugs.webkit.org/show_bug.cgi?id=200818
3509
3510         Reviewed by Geoffrey Garen.
3511
3512         StorageManager does not need to subclass RefCounted. It is owned by the StorageManagerSet
3513         and is never ref'd / deref'd.
3514
3515         * NetworkProcess/WebStorage/StorageManager.h:
3516         (WebKit::StorageManager::create): Deleted.
3517         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
3518         (WebKit::StorageManagerSet::add):
3519         * NetworkProcess/WebStorage/StorageManagerSet.h:
3520
3521 2019-08-16  Chris Dumez  <cdumez@apple.com>
3522
3523         Clarify StorageManagerSet / StorageManager threading model after r248734
3524         https://bugs.webkit.org/show_bug.cgi?id=200817
3525
3526         Reviewed by Geoffrey Garen.
3527
3528         Clarify StorageManagerSet / StorageManager threading model after r248734. StorageManager is now
3529         a background thread object but it still calls its completion handlers on the main thread, which
3530         is very error prone. The pattern in WebKit for thread safety is that methods should always call
3531         their completion handler of the thread / queue they were called on themselves. Doing differently
3532         has caused so many thread-safety bugs in the past.
3533
3534         * NetworkProcess/WebStorage/StorageManager.cpp:
3535         (WebKit::StorageManager::getSessionStorageOrigins const):
3536         (WebKit::StorageManager::deleteSessionStorageOrigins):
3537         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
3538         (WebKit::StorageManager::getLocalStorageOrigins const):
3539         (WebKit::StorageManager::getLocalStorageOriginDetails const):
3540         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3541         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
3542         (WebKit::StorageManager::getSessionStorageOrigins): Deleted.
3543         (WebKit::StorageManager::getLocalStorageOrigins): Deleted.
3544         (WebKit::StorageManager::getLocalStorageOriginDetails): Deleted.
3545         * NetworkProcess/WebStorage/StorageManager.h:
3546         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
3547         (WebKit::StorageManagerSet::getSessionStorageOrigins):
3548         (WebKit::StorageManagerSet::deleteSessionStorage):
3549         (WebKit::StorageManagerSet::deleteSessionStorageForOrigins):
3550         (WebKit::StorageManagerSet::getLocalStorageOrigins):
3551         (WebKit::StorageManagerSet::deleteLocalStorageModifiedSince):
3552         (WebKit::StorageManagerSet::deleteLocalStorageForOrigins):
3553         (WebKit::StorageManagerSet::getLocalStorageOriginDetails):
3554
3555 2019-08-16  Chris Dumez  <cdumez@apple.com>
3556
3557         StorageManagerSet constructor should not be public
3558         https://bugs.webkit.org/show_bug.cgi?id=200816
3559
3560         Reviewed by Geoffrey Garen.
3561
3562         StorageManagerSet constructor should not be public since it subclasses ThreadSafeRefCounted and
3563         has a factory method.
3564
3565         * NetworkProcess/WebStorage/StorageManagerSet.h:
3566
3567 2019-08-16  Timothy Hatcher  <timothy@apple.com>
3568
3569         REGRESSION (r248436): WKWebView doesn’t respect isOpaque setting in NIB.
3570         https://bugs.webkit.org/show_bug.cgi?id=200802
3571         rdar://problem/54357818
3572
3573         Reviewed by Tim Horton.
3574
3575         Tests: WKWebView.IsOpaqueDefault, WKWebView.SetOpaqueYes, WKWebView.SetOpaqueNo, WKWebView.IsOpaqueYesSubclassOverridden,
3576         WKWebView.IsOpaqueNoSubclassOverridden, WKWebView.IsOpaqueYesDecodedFromArchive, WKWebView.IsOpaqueNoDecodedFromArchive,
3577         WKWebView.IsOpaqueDrawsBackgroundYesConfiguration, WKWebView.IsOpaqueDrawsBackgroundNoConfiguration.
3578
3579         * UIProcess/API/Cocoa/WKWebView.mm:
3580         (-[WKWebView _initializeWithConfiguration:]): Call _setOpaqueInternal:NO instead of self.opaque = NO.
3581         (-[WKWebView _setOpaqueInternal:]): Added. Moved code from setOpaque:.
3582         (-[WKWebView setOpaque:]): Call _setOpaqueInternal:.
3583
3584 2019-08-15  Yusuke Suzuki  <ysuzuki@apple.com>
3585
3586         [WTF] Add makeUnique<T>, which ensures T is fast-allocated, WTF_MAKE_FAST_ALLOCATED annotation part
3587         https://bugs.webkit.org/show_bug.cgi?id=200620
3588
3589         Reviewed by Geoffrey Garen.
3590
3591         * NetworkProcess/AdClickAttributionManager.h:
3592         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
3593         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
3594         * NetworkProcess/Cookies/WebCookieManager.h:
3595         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
3596         * NetworkProcess/NetworkHTTPSUpgradeChecker.h:
3597         * NetworkProcess/NetworkProcess.cpp:
3598         * NetworkProcess/NetworkSession.h:
3599         * NetworkProcess/NetworkSocketChannel.h:
3600         * NetworkProcess/WebSocketTask.h:
3601         * NetworkProcess/cache/PrefetchCache.h:
3602         * NetworkProcess/cocoa/WebSocketTaskCocoa.h:
3603         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
3604         * NetworkProcess/soup/WebSocketTaskSoup.h:
3605         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
3606         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
3607         * Platform/Module.h:
3608         * PluginProcess/PluginControllerProxy.h:
3609         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
3610         * Shared/Authentication/AuthenticationManager.h:
3611         * Shared/Cocoa/SandboxExtensionCocoa.mm:
3612         * Shared/Plugins/NPObjectMessageReceiver.h:
3613         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
3614         * UIProcess/API/APIAutomationClient.h:
3615         * UIProcess/API/APIAutomationSessionClient.h:
3616         * UIProcess/API/APIContextMenuClient.h:
3617         * UIProcess/API/APICustomProtocolManagerClient.h:
3618         * UIProcess/API/APIDiagnosticLoggingClient.h:
3619         * UIProcess/API/APIDownloadClient.h:
3620         * UIProcess/API/APIFindClient.h:
3621         * UIProcess/API/APIFindMatchesClient.h:
3622         * UIProcess/API/APIFormClient.h:
3623         * UIProcess/API/APIFullscreenClient.h:
3624         * UIProcess/API/APIGeolocationProvider.h:
3625         * UIProcess/API/APIHistoryClient.h:
3626         * UIProcess/API/APIIconDatabaseClient.h:
3627         * UIProcess/API/APIIconLoadingClient.h:
3628         * UIProcess/API/APIInjectedBundleClient.h:
3629         * UIProcess/API/APILegacyContextHistoryClient.h:
3630         * UIProcess/API/APILoaderClient.h:
3631         * UIProcess/API/APINavigationClient.h:
3632         * UIProcess/API/APIPolicyClient.h:
3633         * UIProcess/API/APIUIClient.h:
3634         * UIProcess/API/C/WKPage.cpp:
3635         (WKPageSetPageStateClient):
3636         * UIProcess/API/Cocoa/WKUserContentController.mm:
3637         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
3638         * UIProcess/API/glib/IconDatabase.h:
3639         * UIProcess/API/glib/WebKitAutomationSession.cpp:
3640         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
3641         * UIProcess/API/glib/WebKitNotificationProvider.h:
3642         * UIProcess/API/glib/WebKitUserContentManager.cpp:
3643         * UIProcess/API/glib/WebKitWebContext.cpp:
3644         * UIProcess/API/glib/WebKitWebView.cpp:
3645         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
3646         * UIProcess/API/gtk/WebKitWebInspector.cpp:
3647         * UIProcess/API/mac/WKView.mm:
3648         (-[WKView maybeInstallIconLoadingClient]):
3649         * UIProcess/API/wpe/APIViewClient.h:
3650         * UIProcess/API/wpe/ScrollGestureController.h:
3651         * UIProcess/ApplicationStateTracker.h:
3652         * UIProcess/Cocoa/AutomationSessionClient.h:
3653         * UIProcess/Cocoa/IconLoadingDelegate.h:
3654         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3655         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3656         * UIProcess/DrawingAreaProxy.h:
3657         * UIProcess/HighPerformanceGraphicsUsageSampler.h:
3658         * UIProcess/Network/NetworkProcessProxy.h:
3659         * UIProcess/PageClient.h:
3660         * UIProcess/PerActivityStateCPUUsageSampler.h:
3661         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h:
3662         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3663         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
3664         * UIProcess/SystemPreviewController.h:
3665         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3666         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
3667         * UIProcess/WebNavigationState.h:
3668         * UIProcess/WebPageInjectedBundleClient.h:
3669         * UIProcess/WebPageProxy.h:
3670         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
3671         * UIProcess/gtk/DragAndDropHandler.h:
3672         * UIProcess/ios/EditableImageController.h:
3673         * UIProcess/ios/InputViewUpdateDeferrer.h:
3674         * UIProcess/ios/SmartMagnificationController.h:
3675         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
3676         * UIProcess/mac/WKFullScreenWindowController.mm:
3677         * UIProcess/mac/WKTextFinderClient.mm:
3678         * WebProcess/ApplePay/WebPaymentCoordinator.h:
3679         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
3680         * WebProcess/Geolocation/WebGeolocationManager.h:
3681         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3682         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
3683         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp:
3684         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
3685         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
3686         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3687         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3688         * WebProcess/Network/webrtc/LibWebRTCResolver.h:
3689         * WebProcess/Notifications/WebNotificationManager.h:
3690         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3691         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
3692         * WebProcess/Plugins/PluginController.h:
3693         * WebProcess/Storage/WebSWOriginTable.h:
3694         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
3695         * WebProcess/WebCoreSupport/WebChromeClient.h:
3696         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
3697         * WebProcess/WebCoreSupport/WebDragClient.h:
3698         * WebProcess/WebCoreSupport/WebEditorClient.h:
3699         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
3700         * WebProcess/WebCoreSupport/WebInspectorClient.h:
3701         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
3702         * WebProcess/WebCoreSupport/WebNotificationClient.h:
3703         * WebProcess/WebCoreSupport/WebPlugInClient.h:
3704         * WebProcess/WebCoreSupport/WebProgressTrackerClient.h:
3705         * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.h:
3706         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
3707         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
3708         * WebProcess/WebPage/FindController.h:
3709         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
3710         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
3711         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
3712         * WebProcess/WebProcess.h:
3713         * WebProcess/cocoa/UserMediaCaptureManager.h:
3714
3715 2019-08-15  Brent Fulgham  <bfulgham@apple.com>
3716
3717         [FTW] Enable CoreFoundation use if building for Apple target
3718         https://bugs.webkit.org/show_bug.cgi?id=200799
3719
3720         Reviewed by Alex Christensen.
3721
3722         Fix the build and remove an unused method.
3723
3724         * PlatformFTW.cmake:
3725         * Shared/ShareableBitmap.h:
3726         * Shared/win/ShareableBitmapDirect2D.cpp:
3727         (WebKit::ShareableBitmap::createDirect2DSurface):
3728         (WebKit::ShareableBitmap::releaseSurfaceData): Deleted.
3729
3730 2019-08-15  Sihui Liu  <sihui_liu@apple.com>
3731
3732         Some improvements on web storage
3733         https://bugs.webkit.org/show_bug.cgi?id=200373
3734
3735         Reviewed by Geoffrey Garen.
3736
3737         Fix some issues in web storage architecture. For example, sessionStorageNameSpace for web page is prepared and 
3738         destroyed in the network process when the page comes and goes, even though the page may not use sessionStorage 
3739         at all. The messages about page state sent from web process to network process can be waste.
3740
3741         Here are some general ideas of this patch:
3742         1. Network process owns the web storage, and web process keeps a small local copy (based on session and 
3743         origins that are visited). There is a virtual connection from the local copy in the web process to the original
3744         copy in the network process. The connection is created by web process when some page asks for web storage.
3745         2. If connection is lost because network process is gone, storage in memory will be lost. The local copy in web
3746         processs will be discarded.
3747         3. (SessionID, StorageNamespaceID, SecurityOrigin) is used to identify a storage area. If session is changed in
3748         web process (like enabling private browsing in layout test now), a re-connection with different sessionID would 
3749         suffice to load another copy of storage.
3750         4. localStorage in ephemeral session has the same behavior as localStorage instead of sessionStorage, which
3751         means different pages in the same ephemeral session share the same localStorage.
3752
3753         Also, this patch introduces StorageManagerSet to network process. It handles web storage stuff, including
3754         receiving storage messages from web process, on one background thread. Previously each session has its own
3755         StorageManager and each StorageManager has its own WorkQueue.
3756
3757         * CMakeLists.txt:
3758         * DerivedSources-input.xcfilelist:
3759         * DerivedSources-output.xcfilelist:
3760         * DerivedSources.make:
3761
3762         * NetworkProcess/NetworkConnectionToWebProcess.cpp: remove message handlers that are no longer needed. Network
3763         process no longer needs to know page states from web process.
3764         (WebKit::NetworkConnectionToWebProcess::didClose):
3765         (WebKit::NetworkConnectionToWebProcess::webPageWasAdded): Deleted.
3766         (WebKit::NetworkConnectionToWebProcess::webPageWasRemoved): Deleted.
3767         (WebKit::NetworkConnectionToWebProcess::webProcessSessionChanged): Deleted.
3768         * NetworkProcess/NetworkConnectionToWebProcess.h:
3769         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3770
3771         * NetworkProcess/NetworkProcess.cpp: NetworkProcess uses StorageManagerSet instead of StorageManager from 
3772         different sessions to deal with web storage.
3773         (WebKit::NetworkProcess::NetworkProcess):
3774         (WebKit::NetworkProcess::initializeNetworkProcess):
3775         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): StorageManagerSet starts handling 
3776         StorageManagerSet messages from the new connection.
3777         (WebKit::NetworkProcess::addWebsiteDataStore):
3778         (WebKit::NetworkProcess::destroySession):
3779         (WebKit::NetworkProcess::hasLocalStorage):
3780         (WebKit::NetworkProcess::fetchWebsiteData):
3781         (WebKit::NetworkProcess::deleteWebsiteData):
3782         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
3783         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
3784         (WebKit::NetworkProcess::actualPrepareToSuspend):
3785         (WebKit::NetworkProcess::resume):
3786         (WebKit::NetworkProcess::syncLocalStorage):
3787         (WebKit::NetworkProcess::clearLegacyPrivateBrowsingLocalStorage): added for clearing in-memory ephemeral
3788         localStorage.
3789         (WebKit::NetworkProcess::getLocalStorageOriginDetails):
3790         (WebKit::NetworkProcess::connectionToWebProcessClosed):
3791         (WebKit::NetworkProcess::webPageWasAdded): Deleted.
3792         (WebKit::NetworkProcess::webPageWasRemoved): Deleted.
3793         (WebKit::NetworkProcess::webProcessWasDisconnected): Deleted.
3794         (WebKit::NetworkProcess::webProcessSessionChanged): Deleted.
3795         * NetworkProcess/NetworkProcess.h:
3796         * NetworkProcess/NetworkProcess.messages.in:
3797
3798         * NetworkProcess/NetworkSession.cpp: StorageManager is moved out of NetworkSession. It is now managed by 
3799         StorageManagerSet.
3800         (WebKit::NetworkSession::NetworkSession):
3801         (WebKit::NetworkSession::~NetworkSession):
3802         * NetworkProcess/NetworkSession.h:
3803         (WebKit::NetworkSession::storageManager): Deleted.
3804
3805         * NetworkProcess/NetworkSessionCreationParameters.cpp: creation parameters of StorageManager is moved out of
3806         NetworkSessionCreationParameters.
3807         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
3808         (WebKit::NetworkSessionCreationParameters::encode const):
3809         (WebKit::NetworkSessionCreationParameters::decode):
3810         * NetworkProcess/NetworkSessionCreationParameters.h:
3811
3812         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
3813         (WebKit::LocalStorageDatabase::updateDatabase): remove an assertion that is no longer true as we can force an
3814         update with syncLocalStorage now.
3815         * NetworkProcess/WebStorage/LocalStorageDatabase.h: make updateDatabase public for syncLocalStorage.
3816
3817         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: LocalStorageDatabaseTracker is created on the
3818         background thread now, so it does not hold WorkQueue to do the file operation.
3819         (WebKit::LocalStorageDatabaseTracker::create):
3820         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
3821         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
3822         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
3823         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
3824         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
3825         (WebKit::LocalStorageNamespace::cloneTo): Deleted.
3826         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
3827         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
3828         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
3829         (WebKit::SessionStorageNamespace::addAllowedConnection): Deleted.
3830         (WebKit::SessionStorageNamespace::removeAllowedConnection): Deleted.
3831         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
3832         (WebKit::SessionStorageNamespace::allowedConnections const): Deleted.
3833
3834         * NetworkProcess/WebStorage/StorageArea.cpp:
3835         (WebKit::generateStorageAreaIdentifier): each StorageArea has an identifier. StorageAreaMap in web process uses
3836         this identifier to indicate which StorageArea it is connecting to.
3837         (WebKit::StorageArea::StorageArea):
3838         (WebKit::StorageArea::~StorageArea): StorageArea may still have listeners because StorageArea should be 
3839         destroyed by requests from UI process, and listeners are connections to web processses.
3840         (WebKit::StorageArea::addListener): load localStorageDatabase in advance if there is some connection to this 
3841         LocalStorage area.
3842         (WebKit::StorageArea::removeListener):
3843         (WebKit::StorageArea::hasListener const):
3844         (WebKit::StorageArea::clear):
3845         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
3846         (WebKit::StorageArea::dispatchEvents const):
3847         (WebKit::StorageArea::syncToDatabase):
3848         (WebKit::StorageArea::setItems): Deleted. Stop syncing from web process to network process after network process
3849         is relaunched.
3850         * NetworkProcess/WebStorage/StorageArea.h:
3851         (WebKit::StorageArea::identifier):
3852         (WebKit::StorageArea::setWorkQueue):
3853
3854         * NetworkProcess/WebStorage/StorageManager.cpp: StorageManager should be accessed by only background thread now.
3855         (WebKit::StorageManager::StorageManager):
3856         (WebKit::StorageManager::~StorageManager):
3857         (WebKit::StorageManager::createSessionStorageNamespace):
3858         (WebKit::StorageManager::destroySessionStorageNamespace): this is not used now but keep it for future 
3859         improvement to remove in-memory sessionStorage in network process if we know some web page is gone forever.
3860         (WebKit::StorageManager::cloneSessionStorageNamespace): previously each page had its own ephemeral 
3861         localStorageNamespace and now all pages in the same session share one localStorage, so we don't need to clone
3862         localStorageNamespace.
3863         (WebKit::StorageManager::getSessionStorageOrigins):
3864         (WebKit::StorageManager::deleteSessionStorageOrigins):
3865         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
3866         (WebKit::StorageManager::getLocalStorageOrigins):
3867         (WebKit::StorageManager::getLocalStorageOriginDetails):
3868         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3869         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
3870         (WebKit::StorageManager::createLocalStorageArea):
3871         (WebKit::StorageManager::createTransientLocalStorageArea):
3872         (WebKit::StorageManager::createSessionStorageArea):
3873         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
3874         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
3875         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
3876         (WebKit::StorageManager::clearStorageNamespaces):
3877         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection): Deleted.
3878         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection): Deleted.
3879         (WebKit::StorageManager::processDidCloseConnection): Deleted.
3880         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): Deleted.
3881         (WebKit::StorageManager::createLocalStorageMap): Deleted.
3882         (WebKit::StorageManager::createTransientLocalStorageMap): Deleted.
3883         (WebKit::StorageManager::createSessionStorageMap): Deleted.
3884         (WebKit::StorageManager::destroyStorageMap): Deleted.
3885         (WebKit::StorageManager::prewarm): Deleted.
3886         (WebKit::StorageManager::getValues): Deleted.
3887         (WebKit::StorageManager::setItem): Deleted.
3888         (WebKit::StorageManager::setItems): Deleted.
3889         (WebKit::StorageManager::removeItem): Deleted.
3890         (WebKit::StorageManager::clear): Deleted.
3891         (WebKit::StorageManager::waitUntilTasksFinished): Deleted.
3892         (WebKit::StorageManager::suspend): Deleted.
3893         (WebKit::StorageManager::resume): Deleted.
3894         (WebKit::StorageManager::findStorageArea const): Deleted.
3895         * NetworkProcess/WebStorage/StorageManager.h:
3896         (WebKit::StorageManager::workQueue const): Deleted.
3897         (): Deleted.
3898
3899         * NetworkProcess/WebStorage/StorageManager.messages.in: Removed. Moved to StorageManagerSet.messages.in.
3900
3901         * NetworkProcess/WebStorage/StorageManagerSet.cpp: Added.
3902         (WebKit::StorageManagerSet::create):
3903         (WebKit::StorageManagerSet::StorageManagerSet):
3904         (WebKit::StorageManagerSet::~StorageManagerSet):
3905         (WebKit::StorageManagerSet::add):
3906         (WebKit::StorageManagerSet::remove):
3907         (WebKit::StorageManagerSet::contains):
3908         (WebKit::StorageManagerSet::addConnection):
3909         (WebKit::StorageManagerSet::removeConnection):
3910         (WebKit::StorageManagerSet::waitUntilTasksFinished):
3911         (WebKit::StorageManagerSet::waitUntilSyncingLocalStorageFinished):
3912         (WebKit::StorageManagerSet::suspend):
3913         (WebKit::StorageManagerSet::resume):
3914         (WebKit::StorageManagerSet::getSessionStorageOrigins):
3915         (WebKit::StorageManagerSet::deleteSessionStorage):
3916         (WebKit::StorageManagerSet::deleteSessionStorageForOrigins):
3917         (WebKit::StorageManagerSet::getLocalStorageOrigins):
3918         (WebKit::StorageManagerSet::deleteLocalStorageModifiedSince):
3919         (WebKit::StorageManagerSet::deleteLocalStorageForOrigins):
3920         (WebKit::StorageManagerSet::getLocalStorageOriginDetails):
3921         (WebKit::StorageManagerSet::connectToLocalStorageArea):
3922         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
3923         (WebKit::StorageManagerSet::connectToSessionStorageArea):
3924         (WebKit::StorageManagerSet::disconnectFromStorageArea):
3925         (WebKit::StorageManagerSet::getValues):
3926         (WebKit::StorageManagerSet::setItem):
3927         (WebKit::StorageManagerSet::removeItem):
3928         (WebKit::StorageManagerSet::clear):
3929         (WebKit::StorageManagerSet::cloneSessionStorageNamespace):
3930         * NetworkProcess/WebStorage/StorageManagerSet.h: Added.
3931         * NetworkProcess/WebStorage/StorageManagerSet.messages.in: Added.
<