[WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWi...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-08-18  Yusuke Suzuki  <ysuzuki@apple.com>
2
3         [WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part
4         https://bugs.webkit.org/show_bug.cgi?id=200620
5
6         Reviewed by Geoffrey Garen.
7
8         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
9         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
10         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
11         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
12         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
13         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
14         * NetworkProcess/Downloads/DownloadManager.cpp:
15         (WebKit::DownloadManager::startDownload):
16         (WebKit::DownloadManager::convertNetworkLoadToDownload):
17         (WebKit::DownloadManager::resumeDownload):
18         * NetworkProcess/Downloads/DownloadMap.cpp:
19         (WebKit::DownloadMap::add):
20         * NetworkProcess/Downloads/PendingDownload.cpp:
21         (WebKit::PendingDownload::PendingDownload):
22         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
23         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
24         * NetworkProcess/NetworkContentRuleListManager.cpp:
25         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
26         * NetworkProcess/NetworkDataTaskBlob.cpp:
27         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
28         (WebKit::NetworkDataTaskBlob::download):
29         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
30         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
31         * NetworkProcess/NetworkLoad.cpp:
32         (WebKit::NetworkLoad::didReceiveResponse):
33         * NetworkProcess/NetworkLoadChecker.cpp:
34         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
35         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
36         * NetworkProcess/NetworkProcess.cpp:
37         (WebKit::NetworkProcess::switchToNewTestingSession):
38         (WebKit::NetworkProcess::ensureSession):
39         (WebKit::NetworkProcess::swServerForSession):
40         (WebKit::NetworkProcess::initializeQuotaUsers):
41         (WebKit::NetworkProcess::storageQuotaManager):
42         * NetworkProcess/NetworkProcess.h:
43         (WebKit::NetworkProcess::addSupplement):
44         * NetworkProcess/NetworkResourceLoader.cpp:
45         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
46         (WebKit::NetworkResourceLoader::startNetworkLoad):
47         * NetworkProcess/NetworkSocketChannel.cpp:
48         (WebKit::NetworkSocketChannel::create):
49         * NetworkProcess/PreconnectTask.cpp:
50         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
51         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
52         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
53         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
54         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
55         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
56         * NetworkProcess/WebStorage/StorageArea.cpp:
57         (WebKit::StorageArea::clone const):
58         * NetworkProcess/WebStorage/StorageManager.cpp:
59         (WebKit::StorageManager::createSessionStorageNamespace):
60         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
61         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
62         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
63         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
64         (WebKit::StorageManagerSet::add):
65         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
66         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
67         * NetworkProcess/cache/NetworkCache.cpp:
68         (WebKit::NetworkCache::Cache::Cache):
69         (WebKit::NetworkCache::Cache::makeEntry):
70         (WebKit::NetworkCache::Cache::makeRedirectEntry):
71         (WebKit::NetworkCache::Cache::update):
72         * NetworkProcess/cache/NetworkCacheEntry.cpp:
73         (WebKit::NetworkCache::Entry::decodeStorageRecord):
74         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
75         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
76         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
77         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad):
78         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
79         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
80         (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests):
81         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
82         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
83         * NetworkProcess/cache/NetworkCacheStorage.cpp:
84         (WebKit::NetworkCache::Storage::synchronize):
85         (WebKit::NetworkCache::Storage::readRecord):
86         (WebKit::NetworkCache::retrieveFromMemory):
87         (WebKit::NetworkCache::Storage::retrieve):
88         (WebKit::NetworkCache::Storage::store):
89         (WebKit::NetworkCache::Storage::traverse):
90         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
91         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
92         * NetworkProcess/cache/PrefetchCache.cpp:
93         (WebKit::PrefetchCache::store):
94         (WebKit::PrefetchCache::storeRedirect):
95         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
96         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
97         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
98         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
99         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
100         (WebKit::NetworkSessionCocoa::create):
101         (WebKit::NetworkSessionCocoa::createWebSocketTask):
102         * NetworkProcess/curl/NetworkProcessCurl.cpp:
103         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
104         * NetworkProcess/curl/NetworkSessionCurl.h:
105         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
106         (WebKit::NetworkConnectionToWebProcess::paymentCoordinator):
107         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter):
108         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
109         (WebKit::NetworkDataTaskSoup::download):
110         * NetworkProcess/soup/NetworkProcessSoup.cpp:
111         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
112         * NetworkProcess/soup/NetworkSessionSoup.cpp:
113         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
114         (WebKit::NetworkSessionSoup::createWebSocketTask):
115         * NetworkProcess/soup/NetworkSessionSoup.h:
116         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
117         (webkitSoupRequestInputStreamReadAsync):
118         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
119         (WebKit::NetworkMDNSRegister::registerMDNSName):
120         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
121         (WebKit::NetworkRTCMonitor::startUpdating):
122         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
123         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
124         (WebKit::NetworkRTCProvider::createSocket):
125         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
126         * Platform/IPC/Connection.cpp:
127         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
128         (IPC::Connection::createSyncMessageEncoder):
129         (IPC::Connection::enableIncomingMessagesThrottling):
130         (IPC::Connection::dispatchSyncMessage):
131         * Platform/IPC/Connection.h:
132         (IPC::Connection::send):
133         (IPC::Connection::sendWithAsyncReply):
134         * Platform/IPC/Decoder.cpp:
135         (IPC::Decoder::unwrapForTesting):
136         * Platform/IPC/HandleMessage.h:
137         (IPC::handleMessageAsync):
138         * Platform/IPC/MessageSender.h:
139         * Platform/IPC/cocoa/ConnectionCocoa.mm:
140         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
141         (IPC::Connection::open):
142         (IPC::createMessageDecoder):
143         (IPC::Connection::receiveSourceEventHandler):
144         * Platform/IPC/unix/ConnectionUnix.cpp:
145         (IPC::Connection::processMessage):
146         (IPC::Connection::sendOutputMessage):
147         * Platform/IPC/win/ConnectionWin.cpp:
148         (IPC::Connection::readEventHandler):
149         * Platform/mac/LayerHostingContext.mm:
150         (WebKit::LayerHostingContext::createForPort):
151         (WebKit::LayerHostingContext::createForExternalHostingProcess):
152         (WebKit::LayerHostingContext::createForExternalPluginHostingProcess):
153         * PluginProcess/WebProcessConnection.cpp:
154         (WebKit::WebProcessConnection::createPluginInternal):
155         * Shared/API/APIURL.h:
156         (API::URL::create):
157         (API::URL::parseURLIfNecessary const):
158         * Shared/API/Cocoa/RemoteObjectInvocation.mm:
159         (WebKit::RemoteObjectInvocation::decode):
160         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
161         (-[_WKRemoteObjectRegistry _initWithWebPage:]):
162         (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
163         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
164         * Shared/API/glib/WebKitContextMenuItem.cpp:
165         (webkitContextMenuItemCreate):
166         (webkit_context_menu_item_new):
167         (webkit_context_menu_item_new_from_gaction):
168         (webkit_context_menu_item_new_from_stock_action):
169         (webkit_context_menu_item_new_from_stock_action_with_label):
170         (webkit_context_menu_item_new_with_submenu):
171         (webkit_context_menu_item_new_separator):
172         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
173         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
174         * Shared/Cocoa/SandboxExtensionCocoa.mm:
175         (WebKit::SandboxExtension::Handle::decode):
176         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
177         (WebKit::texmapLayer):
178         (WebKit::CoordinatedGraphicsScene::ensureRootLayer):
179         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
180         (WebKit::ThreadedCompositor::ThreadedCompositor):
181         * Shared/Plugins/NPRemoteObjectMap.cpp:
182         (WebKit::NPRemoteObjectMap::registerNPObject):
183         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
184         (WebKit::NetscapePluginModule::tryLoad):
185         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
186         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
187         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
188         (WebKit::RemoteLayerTreeTransaction::decode):
189         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
190         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
191         * Shared/cairo/ShareableBitmapCairo.cpp:
192         (WebKit::ShareableBitmap::createGraphicsContext):
193         * Shared/cg/ShareableBitmapCG.cpp:
194         (WebKit::ShareableBitmap::createGraphicsContext):
195         * Shared/win/ShareableBitmapDirect2D.cpp:
196         (WebKit::ShareableBitmap::createGraphicsContext):
197         * UIProcess/API/APIHTTPCookieStore.cpp:
198         (API::HTTPCookieStore::registerObserver):
199         * UIProcess/API/C/WKContext.cpp:
200         (WKContextSetInjectedBundleClient):
201         (WKContextSetHistoryClient):
202         (WKContextSetDownloadClient):
203         * UIProcess/API/C/WKGeolocationManager.cpp:
204         (WKGeolocationManagerSetProvider):
205         * UIProcess/API/C/WKNotificationManager.cpp:
206         (WKNotificationManagerSetProvider):
207         * UIProcess/API/C/WKPage.cpp:
208         (WKPageSetPageContextMenuClient):
209         (WKPageSetPageDiagnosticLoggingClient):
210         (WKPageSetPageFindClient):
211         (WKPageSetPageFindMatchesClient):
212         (WKPageSetPageFormClient):
213         (WKPageSetPageLoaderClient):
214         (WKPageSetPagePolicyClient):
215         (WKPageSetPageUIClient):
216         (WKPageSetPageStateClient):
217         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
218         (-[WKObservablePageState initWithPage:]):
219         * UIProcess/API/C/wpe/WKView.cpp:
220         (WKViewSetViewClient):
221         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
222         (-[WKBrowsingContextController _initWithPageRef:]):
223         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
224         (-[WKHTTPCookieStore addObserver:]):
225         * UIProcess/API/Cocoa/WKProcessPool.mm:
226         (-[WKProcessPool _setDownloadDelegate:]):
227         (-[WKProcessPool _setAutomationDelegate:]):
228         * UIProcess/API/Cocoa/WKUserContentController.mm:
229         (-[WKUserContentController addScriptMessageHandler:name:]):
230         (-[WKUserContentController _addScriptMessageHandler:name:userContentWorld:]):
231         * UIProcess/API/Cocoa/WKWebView.mm:
232         (-[WKWebView _initializeWithConfiguration:]):
233         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
234         (-[WKWebView _setInputDelegate:]):
235         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
236         (-[_WKAutomationSession setDelegate:]):
237         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
238         (-[_WKRemoteWebInspectorViewController init]):
239         * UIProcess/API/glib/IconDatabase.cpp:
240         (WebKit::readySQLiteStatement):
241         * UIProcess/API/glib/WebKitAutomationSession.cpp:
242         (webkitAutomationSessionConstructed):
243         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
244         (attachContextMenuClientToView):
245         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp:
246         (attachCustomProtocolManagerClientToContext):
247         * UIProcess/API/glib/WebKitDownloadClient.cpp:
248         (attachDownloadClientToContext):
249         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
250         (webkitFaviconDatabaseOpen):
251         * UIProcess/API/glib/WebKitFindController.cpp:
252         (webkitFindControllerConstructed):
253         * UIProcess/API/glib/WebKitFormClient.cpp:
254         (attachFormClientToView):
255         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
256         (webkitGeolocationManagerCreate):
257         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
258         (attachIconLoadingClientToView):
259         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
260         (attachInjectedBundleClientToContext):
261         * UIProcess/API/glib/WebKitNotificationProvider.cpp:
262         (WebKitNotificationProvider::WebKitNotificationProvider):
263         * UIProcess/API/glib/WebKitUIClient.cpp:
264         (attachUIClientToView):
265         * UIProcess/API/glib/WebKitUserContentManager.cpp:
266         (webkit_user_content_manager_register_script_message_handler):
267         (webkit_user_content_manager_register_script_message_handler_in_world):
268         * UIProcess/API/glib/WebKitWebContext.cpp:
269         (webkitWebContextConstructed):
270         (webkit_web_context_set_automation_allowed):
271         * UIProcess/API/glib/WebKitWebView.cpp:
272         (webkitWebViewConstructed):
273         * UIProcess/API/gtk/PageClientImpl.cpp:
274         (WebKit::PageClientImpl::createDrawingAreaProxy):
275         * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
276         (webkitEmojiChooserSetupEmojiSections):
277         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
278         (WebKit::RemoteInspectorProtocolHandler::handleRequest):
279         * UIProcess/API/gtk/WebKitWebInspector.cpp:
280         (webkitWebInspectorCreate):
281         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
282         (webkitWebViewBaseConstructed):
283         (webkitWebViewBaseGestureController):
284         (webkitWebViewBaseDragAndDropHandler):
285         (webkitWebViewBaseDidRelaunchWebProcess):
286         * UIProcess/API/mac/WKView.mm:
287         (-[WKView maybeInstallIconLoadingClient]):
288         (-[WKView initWithFrame:processPool:configuration:]):
289         * UIProcess/API/wpe/PageClientImpl.cpp:
290         (WebKit::PageClientImpl::PageClientImpl):
291         (WebKit::PageClientImpl::createDrawingAreaProxy):
292         * UIProcess/API/wpe/WPEView.cpp:
293         (WKWPE::View::View):
294         (WKWPE::View::setClient):
295         * UIProcess/API/wpe/qt/WPEQtView.cpp:
296         (WPEQtView::notifyLoadChangedCallback):
297         (WPEQtView::notifyLoadFailedCallback):
298         (WPEQtView::runJavaScript):
299         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
300         (WPEQtViewBackend::create):
301         * UIProcess/Automation/WebAutomationSession.cpp:
302         (WebKit::WebAutomationSession::WebAutomationSession):
303         * UIProcess/AuxiliaryProcessProxy.h:
304         (WebKit::AuxiliaryProcessProxy::send):
305         * UIProcess/Cocoa/IconLoadingDelegate.mm:
306         (WebKit::IconLoadingDelegate::createIconLoadingClient):
307         * UIProcess/Cocoa/UIDelegate.mm:
308         (WebKit::UIDelegate::createContextMenuClient):
309         (WebKit::UIDelegate::createUIClient):
310         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
311         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
312         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
313         (WebKit::WebProcessPool::platformInitialize):
314         (WebKit::WebProcessPool::startDisplayLink):
315         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
316         (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
317         * UIProcess/Cocoa/WebViewImpl.mm:
318         (WebKit::WebViewImpl::WebViewImpl):
319         (WebKit::WebViewImpl::createDrawingAreaProxy):
320         (WebKit::WebViewImpl::setTextIndicator):
321         (WebKit::WebViewImpl::ensureGestureController):
322         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
323         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
324         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
325         * UIProcess/DeviceIdHashSaltStorage.cpp:
326         (WebKit::DeviceIdHashSaltStorage::getDataFromDecoder const):
327         (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall):
328         * UIProcess/Downloads/DownloadProxyMap.cpp:
329         (WebKit::DownloadProxyMap::createDownloadProxy):
330         * UIProcess/Gamepad/UIGamepadProvider.cpp:
331         (WebKit::UIGamepadProvider::setInitialConnectedGamepads):
332         (WebKit::UIGamepadProvider::platformGamepadConnected):
333         * UIProcess/Network/NetworkProcessProxy.cpp:
334         (WebKit::NetworkProcessProxy::createDownloadProxy):
335         (WebKit::NetworkProcessProxy::takeUploadAssertion):
336         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
337         (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
338         (WebKit::WebNotificationManagerProxy::setProvider):
339         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
340         (WebKit::pluginRequiresGtk2):
341         * UIProcess/ProcessThrottler.cpp:
342         (WebKit::ProcessThrottler::didConnectToProcess):
343         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
344         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
345         (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
346         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
347         (WebKit::RemoteLayerTreeHost::makeNode):
348         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
349         (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
350         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
351         (WebKit::RemoteLayerTreeHost::makeNode):
352         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
353         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
354         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
355         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
356         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
357         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac):
358         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
359         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
360         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
361         (WebKit::HidService::deviceAdded):
362         * UIProcess/WebGeolocationManagerProxy.cpp:
363         (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
364         (WebKit::WebGeolocationManagerProxy::setProvider):
365         * UIProcess/WebMediaSessionFocusManager.cpp:
366         (WebKit::WebMediaSessionFocusManager::setFocusedMediaElement):
367         * UIProcess/WebPageInspectorController.cpp:
368         (WebKit::WebPageInspectorController::WebPageInspectorController):
369         * UIProcess/WebPageProxy.cpp:
370         (WebKit::WebPageProxy::WebPageProxy):
371         (WebKit::m_resetRecentCrashCountTimer):
372         (WebKit::WebPageProxy::setFormClient):
373         (WebKit::WebPageProxy::setUIClient):
374         (WebKit::WebPageProxy::setIconLoadingClient):
375         (WebKit::WebPageProxy::setFindClient):
376         (WebKit::WebPageProxy::setFindMatchesClient):
377         (WebKit::WebPageProxy::setContextMenuClient):
378         (WebKit::WebPageProxy::setInjectedBundleClient):
379         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
380         (WebKit::WebPageProxy::didAttachToRunningProcess):
381         (WebKit::WebPageProxy::setDrawingArea):
382         (WebKit::WebPageProxy::close):
383         (WebKit::WebPageProxy::loadData):
384         (WebKit::WebPageProxy::handleWheelEvent):
385         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
386         (WebKit::WebPageProxy::continueNavigationInNewProcess):
387         (WebKit::WebPageProxy::setFullscreenClient):
388         (WebKit::WebPageProxy::userMediaPermissionRequestManager):
389         (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled):
390         (WebKit::WebPageProxy::speechSynthesisData):
391         * UIProcess/WebProcessCache.cpp:
392         (WebKit::WebProcessCache::addProcessIfPossible):
393         * UIProcess/WebProcessPool.cpp:
394         (WebKit::WebProcessPool::WebProcessPool):
395         (WebKit::WebProcessPool::setInjectedBundleClient):
396         (WebKit::WebProcessPool::setHistoryClient):
397         (WebKit::WebProcessPool::setDownloadClient):
398         (WebKit::WebProcessPool::setAutomationClient):
399         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
400         (WebKit::WebProcessPool::ensureNetworkProcess):
401         (WebKit::WebProcessPool::didCollectPrewarmInformation):
402         (WebKit::WebProcessPool::setWebProcessHasUploads):
403         (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
404         * UIProcess/WebProcessProxy.cpp:
405         * UIProcess/cairo/BackingStoreCairo.cpp:
406         (WebKit::BackingStore::createBackend):
407         * UIProcess/glib/RemoteInspectorClient.cpp:
408         (WebKit::RemoteInspectorClient::inspect):
409         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
410         (WebKit::AcceleratedBackingStoreWayland::checkRequirements):
411         * UIProcess/gtk/DragAndDropHandler.cpp:
412         (WebKit::DragAndDropHandler::dragDataSelection):
413         * UIProcess/gtk/WaylandCompositor.cpp:
414         (WebKit::WaylandCompositor::initializeEGL):
415         * UIProcess/ios/EditableImageController.mm:
416         (WebKit::EditableImageController::ensureEditableImage):
417         * UIProcess/ios/WKApplicationStateTrackingView.mm:
418         (-[WKApplicationStateTrackingView didMoveToWindow]):
419         * UIProcess/ios/WKContentView.mm:
420         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
421         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
422         (-[WKContentView _createDrawingAreaProxy:]):
423         * UIProcess/ios/WKContentViewInteraction.mm:
424         (-[WKContentView setupInteraction]):
425         (-[WKContentView becomeFirstResponderForWebView]):
426         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
427         * UIProcess/ios/WebPageProxyIOS.mm:
428         (WebKit::WebPageProxy::elementDidFocus):
429         (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter):
430         * UIProcess/mac/PageClientImplMac.mm:
431         (WebKit::PageClientImpl::PageClientImpl):
432         * UIProcess/mac/WKFullScreenWindowController.mm:
433         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
434         * UIProcess/mac/WKTextFinderClient.mm:
435         (-[WKTextFinderClient initWithPage:view:usePlatformFindUI:]):
436         * UIProcess/socket/RemoteInspectorClient.cpp:
437         (WebKit::RemoteInspectorClient::inspect):
438         * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
439         (WebKit::RemoteInspectorProtocolHandler::platformStartTask):
440         * UIProcess/win/BackingStoreDirect2D.cpp:
441         (WebKit::BackingStore::createBackend):
442         * UIProcess/win/PageClientImpl.cpp:
443         (WebKit::PageClientImpl::createDrawingAreaProxy):
444         * UIProcess/win/WebView.cpp:
445         (WebKit::WebView::WebView):
446         * WebProcess/Gamepad/WebGamepadProvider.cpp:
447         (WebKit::WebGamepadProvider::setInitialGamepads):
448         (WebKit::WebGamepadProvider::gamepadConnected):
449         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
450         (WKBundleSetClient):
451         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
452         (WKBundlePageSetContextMenuClient):
453         (WKBundlePageSetEditorClient):
454         (WKBundlePageSetFormClient):
455         (WKBundlePageSetPageLoaderClient):
456         (WKBundlePageSetResourceLoadClient):
457         (WKBundlePageSetUIClient):
458         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
459         (WKBundlePageOverlayCreate):
460         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
461         (WKBundlePageBannerCreateBannerWithCALayer):
462         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp:
463         (WebKit::getOrCreateDOMObjectCacheFrameObserver):
464         (WebKit::DOMObjectCache::put):
465         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
466         (WebKit::WebKitExtensionManager::initialize):
467         * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp:
468         (webkitWebEditorCreate):
469         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
470         (webkitWebExtensionCreate):
471         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
472         (webkitFrameGetOrCreate):
473         (webkitWebPageCreate):
474         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
475         (-[WKDOMTextIterator initWithRange:]):
476         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
477         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
478         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
479         * WebProcess/InjectedBundle/InjectedBundle.cpp:
480         (WebKit::InjectedBundle::InjectedBundle):
481         (WebKit::InjectedBundle::setClient):
482         * WebProcess/Network/WebSocketChannel.cpp:
483         (WebKit::PendingMessage::PendingMessage):
484         (WebKit::WebSocketChannel::send):
485         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
486         (WebKit::LibWebRTCProvider::createPeerConnection):
487         (WebKit::LibWebRTCProvider::createSocketFactory):
488         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
489         (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
490         (WebKit::LibWebRTCSocketFactory::createUdpSocket):
491         (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
492         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
493         (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
494         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
495         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
496         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
497         (WebKit::NetscapePlugin::scheduleTimer):
498         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
499         (WebKit::NetscapePluginStream::deliverData):
500         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
501         (WebKit::NetscapePluginX11::create):
502         * WebProcess/Plugins/PluginProxy.cpp:
503         (WebKit::PluginProxy::initialize):
504         * WebProcess/Plugins/PluginView.cpp:
505         (WebKit::PluginView::createWebEvent const):
506         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
507         (WebKit::WebSWContextManagerConnection::installServiceWorker):
508         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
509         (WebKit::WebChromeClient::createColorChooser):
510         (WebKit::WebChromeClient::createDataListSuggestionPicker):
511         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
512         (WebKit::WebInspectorClient::showPaintRect):
513         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
514         (WebKit::WebPasteboardOverrides::addOverride):
515         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
516         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
517         * WebProcess/WebPage/DrawingArea.cpp:
518         (WebKit::DrawingArea::create):
519         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
520         (WebKit::PlatformCALayerRemote::ensureBackingStore):
521         (WebKit::PlatformCALayerRemote::setTransform):
522         (WebKit::PlatformCALayerRemote::setSublayerTransform):
523         (WebKit::PlatformCALayerRemote::setFilters):
524         (WebKit::PlatformCALayerRemote::setShapeRoundedRect):
525         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp:
526         (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
527         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
528         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
529         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
530         * WebProcess/WebPage/WebFrame.cpp:
531         (WebKit::WebFrame::createSubframe):
532         * WebProcess/WebPage/WebPage.cpp:
533         (WebKit::m_textAutoSizingAdjustmentTimer):
534         (WebKit::WebPage::setInjectedBundleContextMenuClient):
535         (WebKit::WebPage::setInjectedBundleEditorClient):
536         (WebKit::WebPage::setInjectedBundleFormClient):
537         (WebKit::WebPage::setInjectedBundlePageLoaderClient):
538         (WebKit::WebPage::setInjectedBundleResourceLoadClient):
539         (WebKit::WebPage::setInjectedBundleUIClient):
540         (WebKit::WebPage::close):
541         (WebKit::WebPage::beginPrinting):
542         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
543         (WebKit::WebPrintOperationGtk::print):
544         * WebProcess/WebPage/ios/FindControllerIOS.mm:
545         (WebKit::FindController::updateFindIndicator):
546         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
547         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
548         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
549         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
550         * WebProcess/WebProcess.cpp:
551         (WebKit::WebProcess::markAllLayersVolatile):
552         (WebKit::WebProcess::ensureAutomationSessionProxy):
553         (WebKit::WebProcess::libWebRTCNetwork):
554         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
555         * WebProcess/WebProcess.h:
556         (WebKit::WebProcess::addSupplement):
557         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
558         (WebKit::UserMediaCaptureManager::Source::Source):
559         * WebProcess/cocoa/WebProcessCocoa.mm:
560         (WebKit::WebProcess::processTaskStateDidChange):
561         (WebKit::WebProcess::updateCPUMonitorState):
562
563 2019-08-18  Per Arne Vollan  <pvollan@apple.com>
564
565         [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
566         https://bugs.webkit.org/show_bug.cgi?id=200543
567         <rdar://problem/49394015>
568         
569         Reviewed by Brent Fulgham.
570
571         Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process
572         identifier of the WebContent process.
573         
574         * Shared/Cocoa/SandboxExtensionCocoa.mm:
575         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
576         (WebKit::SandboxExtension::createHandleForReadByPid):
577         * Shared/SandboxExtension.h:
578         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
579         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
580         * UIProcess/WebPageProxy.cpp:
581         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
582         (WebKit::WebPageProxy::loadFile):
583
584 2019-08-17  Tim Horton  <timothy_horton@apple.com>
585
586         Layout tests that call resizeTo() crash when run on iOS with IOSurface support enabled
587         https://bugs.webkit.org/show_bug.cgi?id=200866
588         <rdar://problem/50254021>
589
590         Reviewed by Simon Fraser.
591
592         * UIProcess/ios/PageClientImplIOS.mm:
593         (WebKit::PageClientImpl::convertToDeviceSpace):
594         (WebKit::PageClientImpl::convertToUserSpace):
595         Implement convertTo{Device,User}Space in PageClientImplIOS.
596         We don't actually do any conversion. For our purposes, the window is
597         "device" space, and we never allow iOS WebKit clients to resize the window...
598         except for in tests! So just pass the rects straight through, instead of
599         returning an empty rect.
600
601 2019-08-17  Eric Liang  <ericliang@apple.com>
602
603         Use bundlePath SPI in AccessibilitySupport for WebProcessLoader
604         https://bugs.webkit.org/show_bug.cgi?id=200367
605
606         Reviewed by Darin Adler.
607
608         * Platform/spi/ios/AccessibilitySupportSPI.h:
609         * WebProcess/cocoa/WebProcessCocoa.mm:
610         (WebKit::accessibilityWebProcessLoaderBundlePath):
611         (WebKit::registerWithAccessibility):
612
613 2019-08-17  Sam Weinig  <weinig@apple.com>
614
615         Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...)
616         https://bugs.webkit.org/show_bug.cgi?id=200756
617
618         Reviewed by Darin Adler.
619
620         Update call sites for rename from StringBuilder::flexibleAppend(...) to 
621         StringBuilder::append(...).
622
623         * WebProcess/WebPage/WebPage.cpp:
624         (WebKit::dumpHistoryItem):
625         We have to explicitly access the underlying String of the URL rather than
626         relying on the implicit conversion since it is now ambiguous which append(...)
627         overload should be used.
628
629 2019-08-17  Devin Rousso  <drousso@apple.com>
630
631         Web Inspector: make the initial height bigger when attached
632         https://bugs.webkit.org/show_bug.cgi?id=200855
633
634         Reviewed by Joseph Pecoraro.
635
636         * Shared/WebPreferences.yaml:
637         Increase the default attached height from `300px` to `500px`, which is close to the same
638         amount of area given a 15" MacBook Pro's aspect ratio (default attached width is `750px`).
639
640 2019-08-17  Simon Fraser  <simon.fraser@apple.com>
641
642         [iOS WK2] Scroll indicators disappear sometimes
643         https://bugs.webkit.org/show_bug.cgi?id=200791
644
645         Reviewed by Tim Horton.
646         
647         _web_setSubviews: replaces all of the views subviews with the supplied array, but this blows
648         away views not managed by WebKit, including UIScrollViews scroll indicators. Fix by having
649         WebKit-managed views implement the WKWebKitControlled protocol, and only removing views
650         implementing that protocol.
651
652         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
653         (-[UIView _web_setSubviews:]):
654         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
655
656 2019-08-17  Antti Koivisto  <antti@apple.com>
657
658         Content in <iframe> should override "touch-action" set in embedding document
659         https://bugs.webkit.org/show_bug.cgi?id=200204
660         <rdar://problem/54355249>
661
662         Reviewed by Antoine Quint.
663
664         Subframes where content doesn't use any touch-action properties won't generate event region for their main layer.
665         As a result the touch-action property gets computed in UI process to the parent frames touch-action (instead of 'auto').
666
667         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
668         (WebKit::touchActionsForPoint):
669
670         If the topmost layer hit is a WKChildScrollView we know its content layer didn't have an event region.
671         This means we should return the default value 'auto'.
672
673 2019-08-16  Chris Dumez  <cdumez@apple.com>
674
675         Use strongly typed identifiers for StorageArea / StorageAreaImpl
676         https://bugs.webkit.org/show_bug.cgi?id=200835
677
678         Reviewed by Alex Christensen.
679
680         Use strongly typed identifiers for StorageArea / StorageAreaImpl. They currently both use uint64_t
681         and are used in the same code, it is therefore very easy to confused the 2 types of identifiers.
682
683         * NetworkProcess/WebStorage/StorageArea.cpp:
684         (WebKit::StorageArea::StorageArea):
685         (WebKit::StorageArea::setItem):
686         (WebKit::StorageArea::removeItem):
687         (WebKit::StorageArea::clear):
688         (WebKit::StorageArea::dispatchEvents const):
689         * NetworkProcess/WebStorage/StorageArea.h:
690         (WebKit::StorageArea::identifier):
691         * NetworkProcess/WebStorage/StorageAreaIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h.
692         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
693         (WebKit::StorageManagerSet::connectToLocalStorageArea):
694         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
695         (WebKit::StorageManagerSet::connectToSessionStorageArea):
696         (WebKit::StorageManagerSet::disconnectFromStorageArea):
697         (WebKit::StorageManagerSet::getValues):
698         (WebKit::StorageManagerSet::setItem):
699         (WebKit::StorageManagerSet::removeItem):
700         (WebKit::StorageManagerSet::clear):
701         * NetworkProcess/WebStorage/StorageManagerSet.h:
702         * NetworkProcess/WebStorage/StorageManagerSet.messages.in:
703         * Scripts/webkit/messages.py:
704         * WebKit.xcodeproj/project.pbxproj:
705         * WebProcess/Network/NetworkProcessConnection.cpp:
706         (WebKit::NetworkProcessConnection::didReceiveMessage):
707         * WebProcess/WebProcess.cpp:
708         (WebKit::WebProcess::registerStorageAreaMap):
709         (WebKit::WebProcess::unregisterStorageAreaMap):
710         (WebKit::WebProcess::storageAreaMap const):
711         * WebProcess/WebProcess.h:
712         * WebProcess/WebStorage/StorageAreaImpl.cpp:
713         (WebKit::StorageAreaImpl::StorageAreaImpl):
714         * WebProcess/WebStorage/StorageAreaImpl.h:
715         * WebProcess/WebStorage/StorageAreaImplIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h.
716         * WebProcess/WebStorage/StorageAreaMap.cpp:
717         (WebKit::StorageAreaMap::StorageAreaMap):
718         (WebKit::StorageAreaMap::setItem):
719         (WebKit::StorageAreaMap::removeItem):
720         (WebKit::StorageAreaMap::clear):
721         (WebKit::StorageAreaMap::loadValuesIfNeeded):
722         (WebKit::StorageAreaMap::dispatchStorageEvent):
723         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
724         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
725         (WebKit::StorageAreaMap::disconnect):
726         * WebProcess/WebStorage/StorageAreaMap.h:
727         (WebKit::StorageAreaMap::identifier const):
728         * WebProcess/WebStorage/StorageAreaMap.messages.in:
729
730 2019-08-16  Chris Dumez  <cdumez@apple.com>
731
732         Drop StorageArea::setWorkQueue() member function
733         https://bugs.webkit.org/show_bug.cgi?id=200832
734
735         Reviewed by Alex Christensen.
736
737         Drop StorageArea::setWorkQueue() member function and pass the WorkQueue to the StorageArea constructor instead.
738         The WorkQueue can never get updated so an explicit setter is not necessary. It also makes it clearer that the
739         m_queue data member can never be null.
740
741         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
742         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
743         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
744         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
745         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
746         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
747         * NetworkProcess/WebStorage/StorageArea.cpp:
748         (WebKit::StorageArea::StorageArea):
749         (WebKit::StorageArea::clone const):
750         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
751         * NetworkProcess/WebStorage/StorageArea.h:
752         (WebKit::StorageArea::setWorkQueue): Deleted.
753         * NetworkProcess/WebStorage/StorageManager.cpp:
754         (WebKit::StorageManager::createLocalStorageArea):
755         (WebKit::StorageManager::createTransientLocalStorageArea):
756         (WebKit::StorageManager::createSessionStorageArea):
757         * NetworkProcess/WebStorage/StorageManager.h:
758         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
759         (WebKit::StorageManagerSet::connectToLocalStorageArea):
760         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
761         (WebKit::StorageManagerSet::connectToSessionStorageArea):
762         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
763         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
764         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:
765
766 2019-08-16  Chris Dumez  <cdumez@apple.com>
767
768         LocalStorageDatabaseTracker does not need to subclass ThreadSafeRefCounted
769         https://bugs.webkit.org/show_bug.cgi?id=200825
770
771         Reviewed by Alex Christensen.
772
773         LocalStorageDatabaseTracker does not need to subclass ThreadSafeRefCounted. It is currently always
774         ref'd / deref'd from the com.apple.WebKit.WebStorage serial WorkQueue, save from inside
775         LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup() on iOS. However, it is probably
776         not a good idea to set FileSystem metadata from the main thread in platformMaybeExcludeFromBackup()
777         anyway.
778
779         Note that I had to get rid of an old linked-on-after check since those are currently only safe
780         to do on the main thread. I cleared this with Brady. It has been a while since we've shipped this
781         behavior now and apps have had a chance to update.
782
783         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
784         (WebKit::LocalStorageDatabaseTracker::databasePath const):
785         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
786         * NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
787         (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
788         * UIProcess/Cocoa/VersionChecks.h:
789
790 2019-08-16  Chris Dumez  <cdumez@apple.com>
791
792         LocalStorageDatabase should use inline initialization for its data members
793         https://bugs.webkit.org/show_bug.cgi?id=200828
794
795         Reviewed by John Wilander.
796
797         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
798         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
799         * NetworkProcess/WebStorage/LocalStorageDatabase.h:
800
801 2019-08-16  Kate Cheney  <katherine_cheney@apple.com>
802
803         Functions with no parameters in WebKit/Shared/API/c and WebKit/UIProcess/API/C are
804         missing a "void" specifier in their argument list
805         https://bugs.webkit.org/show_bug.cgi?id=200826
806
807         Reviewed by Chris Dumez.
808
809         Added void to indicate functions with no arguments to satisfy compiler errors.
810         This error came to light when fixing another patch.
811
812         * Shared/API/c/WKArray.h:
813         * Shared/API/c/WKConnectionRef.h:
814         * Shared/API/c/WKContextMenuItem.h:
815         * Shared/API/c/WKData.h:
816         * Shared/API/c/WKDictionary.h:
817         * Shared/API/c/WKErrorRef.h:
818         * Shared/API/c/WKMutableArray.h:
819         * Shared/API/c/WKMutableDictionary.h:
820         * Shared/API/c/WKNumber.h:
821         * Shared/API/c/WKPluginInformation.h:
822         * Shared/API/c/WKRenderLayer.h:
823         * Shared/API/c/WKRenderObject.h:
824         * Shared/API/c/WKSecurityOriginRef.h:
825         * Shared/API/c/WKSerializedScriptValue.h:
826         * Shared/API/c/WKString.h:
827         * Shared/API/c/WKURL.h:
828         * Shared/API/c/WKURLRequest.h:
829         * Shared/API/c/WKURLResponse.h:
830         * Shared/API/c/WKUserContentURLPattern.h:
831         * UIProcess/API/C/WKBackForwardListItemRef.h:
832         * UIProcess/API/C/WKBackForwardListRef.h:
833         * UIProcess/API/C/WKContext.h:
834         * UIProcess/API/C/WKFormSubmissionListener.h:
835         * UIProcess/API/C/WKFrame.h:
836         * UIProcess/API/C/WKFramePolicyListener.h:
837         * UIProcess/API/C/WKGeolocationManager.h:
838         * UIProcess/API/C/WKGeolocationPermissionRequest.h:
839         * UIProcess/API/C/WKGeolocationPosition.h:
840         * UIProcess/API/C/WKHitTestResult.h:
841         * UIProcess/API/C/WKNavigationDataRef.h:
842         * UIProcess/API/C/WKOpenPanelParametersRef.h:
843         * UIProcess/API/C/WKOpenPanelResultListener.h:
844         * UIProcess/API/C/WKPage.h:
845         * UIProcess/API/C/WKPageConfigurationRef.h:
846         * UIProcess/API/C/WKPageGroup.h:
847         * UIProcess/API/C/WKPageUIClient.h:
848         * UIProcess/API/C/WKPreferencesRef.h:
849         * UIProcess/API/C/WKUserContentControllerRef.h:
850         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
851         * UIProcess/API/C/WKUserScriptRef.h:
852
853 2019-08-16  Chris Dumez  <cdumez@apple.com>
854
855         LocalStorageDatabase does not need to subclass ThreadSafeRefCounted
856         https://bugs.webkit.org/show_bug.cgi?id=200822
857
858         Reviewed by Geoff Garen.
859
860         LocalStorageDatabase does not need to subclass ThreadSafeRefCounted, it is only ref'd / deref'd by the StorageArea
861         on the com.apple.WebKit.WebStorage serial WorkQueue, and in LocalStorageDatabase::scheduleDatabaseUpdate() on the
862         same WorkQueue.
863
864         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
865         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
866         (WebKit::LocalStorageDatabase::~LocalStorageDatabase):
867         * NetworkProcess/WebStorage/LocalStorageDatabase.h:
868
869 2019-08-16  Chris Dumez  <cdumez@apple.com>
870
871         Many WebStorage classes do not need to subclass ThreadSafeRefCounted
872         https://bugs.webkit.org/show_bug.cgi?id=200821
873
874         Reviewed by Geoffrey Garen.
875
876         Many WebStorage classes do not need to subclass ThreadSafeRefCounted. They never get ref'd or deref'd.
877
878         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
879         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
880         (WebKit::LocalStorageNamespace::clearAllStorageAreas):
881         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
882         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
883         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
884         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
885         * NetworkProcess/WebStorage/StorageArea.cpp:
886         (WebKit::StorageArea::clone const):
887         * NetworkProcess/WebStorage/StorageArea.h:
888         * NetworkProcess/WebStorage/StorageManager.cpp:
889         (WebKit::StorageManager::createSessionStorageNamespace):
890         (WebKit::StorageManager::createLocalStorageArea):
891         (WebKit::StorageManager::createTransientLocalStorageArea):
892         (WebKit::StorageManager::createSessionStorageArea):
893         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
894         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
895         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
896         * NetworkProcess/WebStorage/StorageManager.h:
897         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
898         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
899         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:
900
901 2019-08-16  Dean Jackson  <dino@apple.com>
902
903         Long pressing images with transparent backgrounds in dark mode causes a black background to appear around the image content
904         https://bugs.webkit.org/show_bug.cgi?id=200827
905         <rdar://53933379>
906
907         Reviewed by Tim Horton.
908
909         Set a clear color when there is no provided background.
910
911         * UIProcess/ios/WKContentViewInteraction.mm:
912         (createTargetedPreview):
913
914 2019-08-16  Ryosuke Niwa  <rniwa@webkit.org>
915
916         Split tabIndex computation for DOM and the rest of WebCore
917         https://bugs.webkit.org/show_bug.cgi?id=200806
918
919         Reviewed by Chris Dumez.
920
921         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
922         (webkit_dom_html_element_get_tab_index):
923         (webkit_dom_html_element_set_tab_index):
924
925 2019-08-16  Ross Kirsling  <ross.kirsling@sony.com>
926
927         Unreviewed restabilization of non-unified build.
928
929         * NetworkProcess/NetworkCORSPreflightChecker.h:
930         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
931         (WebKit::StorageManagerSet::StorageManagerSet):
932         * Shared/FrameInfoData.cpp:
933         (WebKit::FrameInfoData::decode):
934         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
935         * WebProcess/WebStorage/StorageNamespaceImpl.h:
936
937 2019-08-16  Chris Dumez  <cdumez@apple.com>
938
939         StorageManager does not need to subclass RefCounted
940         https://bugs.webkit.org/show_bug.cgi?id=200818
941
942         Reviewed by Geoffrey Garen.
943
944         StorageManager does not need to subclass RefCounted. It is owned by the StorageManagerSet
945         and is never ref'd / deref'd.
946
947         * NetworkProcess/WebStorage/StorageManager.h:
948         (WebKit::StorageManager::create): Deleted.
949         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
950         (WebKit::StorageManagerSet::add):
951         * NetworkProcess/WebStorage/StorageManagerSet.h:
952
953 2019-08-16  Chris Dumez  <cdumez@apple.com>
954
955         Clarify StorageManagerSet / StorageManager threading model after r248734
956         https://bugs.webkit.org/show_bug.cgi?id=200817
957
958         Reviewed by Geoffrey Garen.
959
960         Clarify StorageManagerSet / StorageManager threading model after r248734. StorageManager is now
961         a background thread object but it still calls its completion handlers on the main thread, which
962         is very error prone. The pattern in WebKit for thread safety is that methods should always call
963         their completion handler of the thread / queue they were called on themselves. Doing differently
964         has caused so many thread-safety bugs in the past.
965
966         * NetworkProcess/WebStorage/StorageManager.cpp:
967         (WebKit::StorageManager::getSessionStorageOrigins const):
968         (WebKit::StorageManager::deleteSessionStorageOrigins):
969         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
970         (WebKit::StorageManager::getLocalStorageOrigins const):
971         (WebKit::StorageManager::getLocalStorageOriginDetails const):
972         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
973         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
974         (WebKit::StorageManager::getSessionStorageOrigins): Deleted.
975         (WebKit::StorageManager::getLocalStorageOrigins): Deleted.
976         (WebKit::StorageManager::getLocalStorageOriginDetails): Deleted.
977         * NetworkProcess/WebStorage/StorageManager.h:
978         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
979         (WebKit::StorageManagerSet::getSessionStorageOrigins):
980         (WebKit::StorageManagerSet::deleteSessionStorage):
981         (WebKit::StorageManagerSet::deleteSessionStorageForOrigins):
982         (WebKit::StorageManagerSet::getLocalStorageOrigins):
983         (WebKit::StorageManagerSet::deleteLocalStorageModifiedSince):
984         (WebKit::StorageManagerSet::deleteLocalStorageForOrigins):
985         (WebKit::StorageManagerSet::getLocalStorageOriginDetails):
986
987 2019-08-16  Chris Dumez  <cdumez@apple.com>
988
989         StorageManagerSet constructor should not be public
990         https://bugs.webkit.org/show_bug.cgi?id=200816
991
992         Reviewed by Geoffrey Garen.
993
994         StorageManagerSet constructor should not be public since it subclasses ThreadSafeRefCounted and
995         has a factory method.
996
997         * NetworkProcess/WebStorage/StorageManagerSet.h:
998
999 2019-08-16  Timothy Hatcher  <timothy@apple.com>
1000
1001         REGRESSION (r248436): WKWebView doesn’t respect isOpaque setting in NIB.
1002         https://bugs.webkit.org/show_bug.cgi?id=200802
1003         rdar://problem/54357818
1004
1005         Reviewed by Tim Horton.
1006
1007         Tests: WKWebView.IsOpaqueDefault, WKWebView.SetOpaqueYes, WKWebView.SetOpaqueNo, WKWebView.IsOpaqueYesSubclassOverridden,
1008         WKWebView.IsOpaqueNoSubclassOverridden, WKWebView.IsOpaqueYesDecodedFromArchive, WKWebView.IsOpaqueNoDecodedFromArchive,
1009         WKWebView.IsOpaqueDrawsBackgroundYesConfiguration, WKWebView.IsOpaqueDrawsBackgroundNoConfiguration.
1010
1011         * UIProcess/API/Cocoa/WKWebView.mm:
1012         (-[WKWebView _initializeWithConfiguration:]): Call _setOpaqueInternal:NO instead of self.opaque = NO.
1013         (-[WKWebView _setOpaqueInternal:]): Added. Moved code from setOpaque:.
1014         (-[WKWebView setOpaque:]): Call _setOpaqueInternal:.
1015
1016 2019-08-15  Yusuke Suzuki  <ysuzuki@apple.com>
1017
1018         [WTF] Add makeUnique<T>, which ensures T is fast-allocated, WTF_MAKE_FAST_ALLOCATED annotation part
1019         https://bugs.webkit.org/show_bug.cgi?id=200620
1020
1021         Reviewed by Geoffrey Garen.
1022
1023         * NetworkProcess/AdClickAttributionManager.h:
1024         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
1025         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
1026         * NetworkProcess/Cookies/WebCookieManager.h:
1027         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
1028         * NetworkProcess/NetworkHTTPSUpgradeChecker.h:
1029         * NetworkProcess/NetworkProcess.cpp:
1030         * NetworkProcess/NetworkSession.h:
1031         * NetworkProcess/NetworkSocketChannel.h:
1032         * NetworkProcess/WebSocketTask.h:
1033         * NetworkProcess/cache/PrefetchCache.h:
1034         * NetworkProcess/cocoa/WebSocketTaskCocoa.h:
1035         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
1036         * NetworkProcess/soup/WebSocketTaskSoup.h:
1037         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
1038         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
1039         * Platform/Module.h:
1040         * PluginProcess/PluginControllerProxy.h:
1041         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
1042         * Shared/Authentication/AuthenticationManager.h:
1043         * Shared/Cocoa/SandboxExtensionCocoa.mm:
1044         * Shared/Plugins/NPObjectMessageReceiver.h:
1045         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1046         * UIProcess/API/APIAutomationClient.h:
1047         * UIProcess/API/APIAutomationSessionClient.h:
1048         * UIProcess/API/APIContextMenuClient.h:
1049         * UIProcess/API/APICustomProtocolManagerClient.h:
1050         * UIProcess/API/APIDiagnosticLoggingClient.h:
1051         * UIProcess/API/APIDownloadClient.h:
1052         * UIProcess/API/APIFindClient.h:
1053         * UIProcess/API/APIFindMatchesClient.h:
1054         * UIProcess/API/APIFormClient.h:
1055         * UIProcess/API/APIFullscreenClient.h:
1056         * UIProcess/API/APIGeolocationProvider.h:
1057         * UIProcess/API/APIHistoryClient.h:
1058         * UIProcess/API/APIIconDatabaseClient.h:
1059         * UIProcess/API/APIIconLoadingClient.h:
1060         * UIProcess/API/APIInjectedBundleClient.h:
1061         * UIProcess/API/APILegacyContextHistoryClient.h:
1062         * UIProcess/API/APILoaderClient.h:
1063         * UIProcess/API/APINavigationClient.h:
1064         * UIProcess/API/APIPolicyClient.h:
1065         * UIProcess/API/APIUIClient.h:
1066         * UIProcess/API/C/WKPage.cpp:
1067         (WKPageSetPageStateClient):
1068         * UIProcess/API/Cocoa/WKUserContentController.mm:
1069         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
1070         * UIProcess/API/glib/IconDatabase.h:
1071         * UIProcess/API/glib/WebKitAutomationSession.cpp:
1072         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
1073         * UIProcess/API/glib/WebKitNotificationProvider.h:
1074         * UIProcess/API/glib/WebKitUserContentManager.cpp:
1075         * UIProcess/API/glib/WebKitWebContext.cpp:
1076         * UIProcess/API/glib/WebKitWebView.cpp:
1077         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
1078         * UIProcess/API/gtk/WebKitWebInspector.cpp:
1079         * UIProcess/API/mac/WKView.mm:
1080         (-[WKView maybeInstallIconLoadingClient]):
1081         * UIProcess/API/wpe/APIViewClient.h:
1082         * UIProcess/API/wpe/ScrollGestureController.h:
1083         * UIProcess/ApplicationStateTracker.h:
1084         * UIProcess/Cocoa/AutomationSessionClient.h:
1085         * UIProcess/Cocoa/IconLoadingDelegate.h:
1086         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1087         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1088         * UIProcess/DrawingAreaProxy.h:
1089         * UIProcess/HighPerformanceGraphicsUsageSampler.h:
1090         * UIProcess/Network/NetworkProcessProxy.h:
1091         * UIProcess/PageClient.h:
1092         * UIProcess/PerActivityStateCPUUsageSampler.h:
1093         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h:
1094         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1095         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
1096         * UIProcess/SystemPreviewController.h:
1097         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1098         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
1099         * UIProcess/WebNavigationState.h:
1100         * UIProcess/WebPageInjectedBundleClient.h:
1101         * UIProcess/WebPageProxy.h:
1102         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
1103         * UIProcess/gtk/DragAndDropHandler.h:
1104         * UIProcess/ios/EditableImageController.h:
1105         * UIProcess/ios/InputViewUpdateDeferrer.h:
1106         * UIProcess/ios/SmartMagnificationController.h:
1107         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1108         * UIProcess/mac/WKFullScreenWindowController.mm:
1109         * UIProcess/mac/WKTextFinderClient.mm:
1110         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1111         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
1112         * WebProcess/Geolocation/WebGeolocationManager.h:
1113         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1114         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
1115         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp:
1116         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1117         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
1118         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1119         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
1120         * WebProcess/Network/webrtc/LibWebRTCResolver.h:
1121         * WebProcess/Notifications/WebNotificationManager.h:
1122         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1123         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
1124         * WebProcess/Plugins/PluginController.h:
1125         * WebProcess/Storage/WebSWOriginTable.h:
1126         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
1127         * WebProcess/WebCoreSupport/WebChromeClient.h:
1128         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1129         * WebProcess/WebCoreSupport/WebDragClient.h:
1130         * WebProcess/WebCoreSupport/WebEditorClient.h:
1131         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
1132         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1133         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
1134         * WebProcess/WebCoreSupport/WebNotificationClient.h:
1135         * WebProcess/WebCoreSupport/WebPlugInClient.h:
1136         * WebProcess/WebCoreSupport/WebProgressTrackerClient.h:
1137         * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.h:
1138         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
1139         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
1140         * WebProcess/WebPage/FindController.h:
1141         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
1142         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1143         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
1144         * WebProcess/WebProcess.h:
1145         * WebProcess/cocoa/UserMediaCaptureManager.h:
1146
1147 2019-08-15  Brent Fulgham  <bfulgham@apple.com>
1148
1149         [FTW] Enable CoreFoundation use if building for Apple target
1150         https://bugs.webkit.org/show_bug.cgi?id=200799
1151
1152         Reviewed by Alex Christensen.
1153
1154         Fix the build and remove an unused method.
1155
1156         * PlatformFTW.cmake:
1157         * Shared/ShareableBitmap.h:
1158         * Shared/win/ShareableBitmapDirect2D.cpp:
1159         (WebKit::ShareableBitmap::createDirect2DSurface):
1160         (WebKit::ShareableBitmap::releaseSurfaceData): Deleted.
1161
1162 2019-08-15  Sihui Liu  <sihui_liu@apple.com>
1163
1164         Some improvements on web storage
1165         https://bugs.webkit.org/show_bug.cgi?id=200373
1166
1167         Reviewed by Geoffrey Garen.
1168
1169         Fix some issues in web storage architecture. For example, sessionStorageNameSpace for web page is prepared and 
1170         destroyed in the network process when the page comes and goes, even though the page may not use sessionStorage 
1171         at all. The messages about page state sent from web process to network process can be waste.
1172
1173         Here are some general ideas of this patch:
1174         1. Network process owns the web storage, and web process keeps a small local copy (based on session and 
1175         origins that are visited). There is a virtual connection from the local copy in the web process to the original
1176         copy in the network process. The connection is created by web process when some page asks for web storage.
1177         2. If connection is lost because network process is gone, storage in memory will be lost. The local copy in web
1178         processs will be discarded.
1179         3. (SessionID, StorageNamespaceID, SecurityOrigin) is used to identify a storage area. If session is changed in
1180         web process (like enabling private browsing in layout test now), a re-connection with different sessionID would 
1181         suffice to load another copy of storage.
1182         4. localStorage in ephemeral session has the same behavior as localStorage instead of sessionStorage, which
1183         means different pages in the same ephemeral session share the same localStorage.
1184
1185         Also, this patch introduces StorageManagerSet to network process. It handles web storage stuff, including
1186         receiving storage messages from web process, on one background thread. Previously each session has its own
1187         StorageManager and each StorageManager has its own WorkQueue.
1188
1189         * CMakeLists.txt:
1190         * DerivedSources-input.xcfilelist:
1191         * DerivedSources-output.xcfilelist:
1192         * DerivedSources.make:
1193
1194         * NetworkProcess/NetworkConnectionToWebProcess.cpp: remove message handlers that are no longer needed. Network
1195         process no longer needs to know page states from web process.
1196         (WebKit::NetworkConnectionToWebProcess::didClose):
1197         (WebKit::NetworkConnectionToWebProcess::webPageWasAdded): Deleted.
1198         (WebKit::NetworkConnectionToWebProcess::webPageWasRemoved): Deleted.
1199         (WebKit::NetworkConnectionToWebProcess::webProcessSessionChanged): Deleted.
1200         * NetworkProcess/NetworkConnectionToWebProcess.h:
1201         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1202
1203         * NetworkProcess/NetworkProcess.cpp: NetworkProcess uses StorageManagerSet instead of StorageManager from 
1204         different sessions to deal with web storage.
1205         (WebKit::NetworkProcess::NetworkProcess):
1206         (WebKit::NetworkProcess::initializeNetworkProcess):
1207         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): StorageManagerSet starts handling 
1208         StorageManagerSet messages from the new connection.
1209         (WebKit::NetworkProcess::addWebsiteDataStore):
1210         (WebKit::NetworkProcess::destroySession):
1211         (WebKit::NetworkProcess::hasLocalStorage):
1212         (WebKit::NetworkProcess::fetchWebsiteData):
1213         (WebKit::NetworkProcess::deleteWebsiteData):
1214         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1215         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
1216         (WebKit::NetworkProcess::actualPrepareToSuspend):
1217         (WebKit::NetworkProcess::resume):
1218         (WebKit::NetworkProcess::syncLocalStorage):
1219         (WebKit::NetworkProcess::clearLegacyPrivateBrowsingLocalStorage): added for clearing in-memory ephemeral
1220         localStorage.
1221         (WebKit::NetworkProcess::getLocalStorageOriginDetails):
1222         (WebKit::NetworkProcess::connectionToWebProcessClosed):
1223         (WebKit::NetworkProcess::webPageWasAdded): Deleted.
1224         (WebKit::NetworkProcess::webPageWasRemoved): Deleted.
1225         (WebKit::NetworkProcess::webProcessWasDisconnected): Deleted.
1226         (WebKit::NetworkProcess::webProcessSessionChanged): Deleted.
1227         * NetworkProcess/NetworkProcess.h:
1228         * NetworkProcess/NetworkProcess.messages.in:
1229
1230         * NetworkProcess/NetworkSession.cpp: StorageManager is moved out of NetworkSession. It is now managed by 
1231         StorageManagerSet.
1232         (WebKit::NetworkSession::NetworkSession):
1233         (WebKit::NetworkSession::~NetworkSession):
1234         * NetworkProcess/NetworkSession.h:
1235         (WebKit::NetworkSession::storageManager): Deleted.
1236
1237         * NetworkProcess/NetworkSessionCreationParameters.cpp: creation parameters of StorageManager is moved out of
1238         NetworkSessionCreationParameters.
1239         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
1240         (WebKit::NetworkSessionCreationParameters::encode const):
1241         (WebKit::NetworkSessionCreationParameters::decode):
1242         * NetworkProcess/NetworkSessionCreationParameters.h:
1243
1244         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
1245         (WebKit::LocalStorageDatabase::updateDatabase): remove an assertion that is no longer true as we can force an
1246         update with syncLocalStorage now.
1247         * NetworkProcess/WebStorage/LocalStorageDatabase.h: make updateDatabase public for syncLocalStorage.
1248
1249         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: LocalStorageDatabaseTracker is created on the
1250         background thread now, so it does not hold WorkQueue to do the file operation.
1251         (WebKit::LocalStorageDatabaseTracker::create):
1252         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
1253         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
1254         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
1255         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
1256         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
1257         (WebKit::LocalStorageNamespace::cloneTo): Deleted.
1258         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
1259         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
1260         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
1261         (WebKit::SessionStorageNamespace::addAllowedConnection): Deleted.
1262         (WebKit::SessionStorageNamespace::removeAllowedConnection): Deleted.
1263         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
1264         (WebKit::SessionStorageNamespace::allowedConnections const): Deleted.
1265
1266         * NetworkProcess/WebStorage/StorageArea.cpp:
1267         (WebKit::generateStorageAreaIdentifier): each StorageArea has an identifier. StorageAreaMap in web process uses
1268         this identifier to indicate which StorageArea it is connecting to.
1269         (WebKit::StorageArea::StorageArea):
1270         (WebKit::StorageArea::~StorageArea): StorageArea may still have listeners because StorageArea should be 
1271         destroyed by requests from UI process, and listeners are connections to web processses.
1272         (WebKit::StorageArea::addListener): load localStorageDatabase in advance if there is some connection to this 
1273         LocalStorage area.
1274         (WebKit::StorageArea::removeListener):
1275         (WebKit::StorageArea::hasListener const):
1276         (WebKit::StorageArea::clear):
1277         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
1278         (WebKit::StorageArea::dispatchEvents const):
1279         (WebKit::StorageArea::syncToDatabase):
1280         (WebKit::StorageArea::setItems): Deleted. Stop syncing from web process to network process after network process
1281         is relaunched.
1282         * NetworkProcess/WebStorage/StorageArea.h:
1283         (WebKit::StorageArea::identifier):
1284         (WebKit::StorageArea::setWorkQueue):
1285
1286         * NetworkProcess/WebStorage/StorageManager.cpp: StorageManager should be accessed by only background thread now.
1287         (WebKit::StorageManager::StorageManager):
1288         (WebKit::StorageManager::~StorageManager):
1289         (WebKit::StorageManager::createSessionStorageNamespace):
1290         (WebKit::StorageManager::destroySessionStorageNamespace): this is not used now but keep it for future 
1291         improvement to remove in-memory sessionStorage in network process if we know some web page is gone forever.
1292         (WebKit::StorageManager::cloneSessionStorageNamespace): previously each page had its own ephemeral 
1293         localStorageNamespace and now all pages in the same session share one localStorage, so we don't need to clone
1294         localStorageNamespace.
1295         (WebKit::StorageManager::getSessionStorageOrigins):
1296         (WebKit::StorageManager::deleteSessionStorageOrigins):
1297         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
1298         (WebKit::StorageManager::getLocalStorageOrigins):
1299         (WebKit::StorageManager::getLocalStorageOriginDetails):
1300         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1301         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1302         (WebKit::StorageManager::createLocalStorageArea):
1303         (WebKit::StorageManager::createTransientLocalStorageArea):
1304         (WebKit::StorageManager::createSessionStorageArea):
1305         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
1306         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
1307         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
1308         (WebKit::StorageManager::clearStorageNamespaces):
1309         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection): Deleted.
1310         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection): Deleted.
1311         (WebKit::StorageManager::processDidCloseConnection): Deleted.
1312         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): Deleted.
1313         (WebKit::StorageManager::createLocalStorageMap): Deleted.
1314         (WebKit::StorageManager::createTransientLocalStorageMap): Deleted.
1315         (WebKit::StorageManager::createSessionStorageMap): Deleted.
1316         (WebKit::StorageManager::destroyStorageMap): Deleted.
1317         (WebKit::StorageManager::prewarm): Deleted.
1318         (WebKit::StorageManager::getValues): Deleted.
1319         (WebKit::StorageManager::setItem): Deleted.
1320         (WebKit::StorageManager::setItems): Deleted.
1321         (WebKit::StorageManager::removeItem): Deleted.
1322         (WebKit::StorageManager::clear): Deleted.
1323         (WebKit::StorageManager::waitUntilTasksFinished): Deleted.
1324         (WebKit::StorageManager::suspend): Deleted.
1325         (WebKit::StorageManager::resume): Deleted.
1326         (WebKit::StorageManager::findStorageArea const): Deleted.
1327         * NetworkProcess/WebStorage/StorageManager.h:
1328         (WebKit::StorageManager::workQueue const): Deleted.
1329         (): Deleted.
1330
1331         * NetworkProcess/WebStorage/StorageManager.messages.in: Removed. Moved to StorageManagerSet.messages.in.
1332
1333         * NetworkProcess/WebStorage/StorageManagerSet.cpp: Added.
1334         (WebKit::StorageManagerSet::create):
1335         (WebKit::StorageManagerSet::StorageManagerSet):
1336         (WebKit::StorageManagerSet::~StorageManagerSet):
1337         (WebKit::StorageManagerSet::add):
1338         (WebKit::StorageManagerSet::remove):
1339         (WebKit::StorageManagerSet::contains):
1340         (WebKit::StorageManagerSet::addConnection):
1341         (WebKit::StorageManagerSet::removeConnection):
1342         (WebKit::StorageManagerSet::waitUntilTasksFinished):
1343         (WebKit::StorageManagerSet::waitUntilSyncingLocalStorageFinished):
1344         (WebKit::StorageManagerSet::suspend):
1345         (WebKit::StorageManagerSet::resume):
1346         (WebKit::StorageManagerSet::getSessionStorageOrigins):
1347         (WebKit::StorageManagerSet::deleteSessionStorage):
1348         (WebKit::StorageManagerSet::deleteSessionStorageForOrigins):
1349         (WebKit::StorageManagerSet::getLocalStorageOrigins):
1350         (WebKit::StorageManagerSet::deleteLocalStorageModifiedSince):
1351         (WebKit::StorageManagerSet::deleteLocalStorageForOrigins):
1352         (WebKit::StorageManagerSet::getLocalStorageOriginDetails):
1353         (WebKit::StorageManagerSet::connectToLocalStorageArea):
1354         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
1355         (WebKit::StorageManagerSet::connectToSessionStorageArea):
1356         (WebKit::StorageManagerSet::disconnectFromStorageArea):
1357         (WebKit::StorageManagerSet::getValues):
1358         (WebKit::StorageManagerSet::setItem):
1359         (WebKit::StorageManagerSet::removeItem):
1360         (WebKit::StorageManagerSet::clear):
1361         (WebKit::StorageManagerSet::cloneSessionStorageNamespace):
1362         * NetworkProcess/WebStorage/StorageManagerSet.h: Added.
1363         * NetworkProcess/WebStorage/StorageManagerSet.messages.in: Added.
1364
1365         * Shared/WebsiteDataStoreParameters.cpp: creation parameters of StorageManager are moved to 
1366         WebsiteDataStoreParameters.
1367         (WebKit::WebsiteDataStoreParameters::encode const):
1368         (WebKit::WebsiteDataStoreParameters::decode):
1369         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1370         * Shared/WebsiteDataStoreParameters.h:
1371         * Sources.txt:
1372
1373         * UIProcess/API/C/WKContext.cpp: add SPI for tests.
1374         (WKContextSyncLocalStorage):
1375         (WKContextClearLegacyPrivateBrowsingLocalStorage):
1376         * UIProcess/API/C/WKContextPrivate.h:
1377         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1378         (WKWebsiteDataStoreRemoveLocalStorage):
1379         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1380         * UIProcess/WebProcessPool.cpp:
1381         (WebKit::WebProcessPool::ensureNetworkProcess):
1382         (WebKit::WebProcessPool::syncLocalStorage):
1383         (WebKit::WebProcessPool::clearLegacyPrivateBrowsingLocalStorage):
1384         * UIProcess/WebProcessPool.h:
1385         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1386         (WebKit::WebsiteDataStore::parameters):
1387         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1388         (WebKit::WebsiteDataStore::parameters):
1389         * WebKit.xcodeproj/project.pbxproj:
1390
1391         * WebProcess/InjectedBundle/InjectedBundle.cpp: session change of web storage is done via 
1392         WebStorageNamespaceProvider instead of WebProcess now.
1393         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
1394         * WebProcess/WebProcess.cpp: web process no longer sends messsages about page state to network process.
1395         (WebKit::WebProcess::createWebPage):
1396         (WebKit::WebProcess::removeWebPage):
1397         (WebKit::WebProcess::ensureNetworkProcessConnection):
1398         (WebKit::WebProcess::networkProcessConnectionClosed):
1399         (WebKit::WebProcess::storageAreaMap const):
1400         (WebKit::WebProcess::enablePrivateBrowsingForTesting): Deleted. This was used for changing session via 
1401         WebProcess.
1402         * WebProcess/WebProcess.h:
1403         * WebProcess/WebStorage/StorageAreaImpl.cpp:
1404         (WebKit::StorageAreaImpl::StorageAreaImpl):
1405         (WebKit::StorageAreaImpl::length):
1406         (WebKit::StorageAreaImpl::key):
1407         (WebKit::StorageAreaImpl::item):
1408         (WebKit::StorageAreaImpl::setItem):
1409         (WebKit::StorageAreaImpl::removeItem):
1410         (WebKit::StorageAreaImpl::clear):
1411         (WebKit::StorageAreaImpl::contains):
1412         (WebKit::StorageAreaImpl::storageType const):
1413         (WebKit::StorageAreaImpl::incrementAccessCount):
1414         (WebKit::StorageAreaImpl::decrementAccessCount):
1415         (WebKit::StorageAreaImpl::prewarm): Deleted.
1416         (WebKit::StorageAreaImpl::securityOrigin const): Deleted.
1417
1418         * WebProcess/WebStorage/StorageAreaImpl.h: make StorageAreaImpl hold a weak reference to StorageAreaMap and 
1419         StorageNamespaceImpl hold a strong reference. In this way lifeime of localStorage StorageAreraMap stays align 
1420         with StorageNameSpaceProvider and Page.
1421
1422         * WebProcess/WebStorage/StorageAreaMap.cpp: identifier of StorageAreaMap is the same as identifier of 
1423         StorageArea it connects to. If the identifier is 0, it means the StorageAreaMap is disconnected.
1424         (WebKit::StorageAreaMap::StorageAreaMap):
1425         (WebKit::StorageAreaMap::~StorageAreaMap):
1426         (WebKit::StorageAreaMap::setItem):
1427         (WebKit::StorageAreaMap::removeItem):
1428         (WebKit::StorageAreaMap::clear):
1429         (WebKit::StorageAreaMap::resetValues):
1430         (WebKit::StorageAreaMap::loadValuesIfNeeded):
1431         (WebKit::StorageAreaMap::applyChange):
1432         (WebKit::StorageAreaMap::dispatchStorageEvent):
1433         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1434         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1435         (WebKit::StorageAreaMap::connect):
1436         (WebKit::StorageAreaMap::disconnect):
1437         (WebKit::generateStorageMapID): Deleted.
1438         (WebKit::StorageAreaMap::prewarm): Deleted.
1439         (WebKit::StorageAreaMap::didGetValues): Deleted. This is useless as GetValues is a synchronous operation.
1440         * WebProcess/WebStorage/StorageAreaMap.h:
1441         (): Deleted.
1442
1443         * WebProcess/WebStorage/StorageAreaMap.messages.in: there are two synchronous messages, one for connection and 
1444         one for getting values. We may merge them into one in future improvement.
1445         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1446         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
1447         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
1448         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
1449         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
1450         (WebKit::StorageNamespaceImpl::storageArea):
1451         (WebKit::StorageNamespaceImpl::copy):
1452         (WebKit::StorageNamespaceImpl::setSessionIDForTesting):
1453         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace): Deleted.
1454         * WebProcess/WebStorage/StorageNamespaceImpl.h:
1455         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
1456         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
1457         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
1458         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
1459         (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): Deleted.
1460         * WebProcess/WebStorage/WebStorageNamespaceProvider.h:
1461
1462 2019-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1463
1464         Occasional hang under -[UIKeyboardTaskQueue lockWhenReadyForMainThread] when long-pressing non-editable text
1465         https://bugs.webkit.org/show_bug.cgi?id=200731
1466         <rdar://problem/54315371>
1467
1468         Reviewed by Tim Horton.
1469
1470         When handling a single tap in non-editable content, keyboards logic in UIKit may attempt to wait for all
1471         pending tasks in UIKeyboardTaskQueue to finish executing (e.g. by calling -waitUntilAllTasksAreFinished]). If
1472         the task queue has a pending task at this moment - for example, a text selection update that is waiting for a
1473         response from the web process - this will result in a permanent deadlock, since the main thread will be blocked,
1474         and therefore cannot receive any IPC communication from the web process.
1475
1476         One way to trigger this is to activate both the loupe gesture and non-editable text tap gesture simultaneously,
1477         by tapping in a non-editable part of the web page, while an ongoing loupe gesture is driving selection updates
1478         (see the layout test for more details).
1479
1480         To avoid getting into this scenario, prevent the text tap gesture recognizer from firing in a few edge cases
1481         that could lead to hangs under keyboard code in UIKit. See comments below.
1482
1483         Test: editing/selection/ios/tap-during-loupe-gesture.html
1484
1485         * UIProcess/ios/WKContentViewInteraction.h:
1486         * UIProcess/ios/WKContentViewInteraction.mm:
1487         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1488
1489         Don't allow the text tap gesture recognizer to fire if the user is actively modifying the text selection using
1490         the loupe gesture, or if there's other pending selection change updates that are pending responses from the web
1491         content process.
1492
1493         (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
1494         (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
1495
1496         Increment and decrement _suppressNonEditableSingleTapTextInteractionCount while handling these selection
1497         updates.
1498
1499 2019-08-15  Commit Queue  <commit-queue@webkit.org>
1500
1501         Unreviewed, rolling out r248440.
1502         https://bugs.webkit.org/show_bug.cgi?id=200772
1503
1504         Introduced regressions related to loading of local files.
1505         (Requested by perarne on #webkit).
1506
1507         Reverted changeset:
1508
1509         "[Mac] Use the PID of the WebContent process when issuing
1510         local file read sandbox extensions"
1511         https://bugs.webkit.org/show_bug.cgi?id=200543
1512         https://trac.webkit.org/changeset/248440
1513
1514 2019-08-15  Alex Christensen  <achristensen@webkit.org>
1515
1516         WKUIDelegate's webView:contextMenuDidEndForElement: should be called when context menus end
1517         https://bugs.webkit.org/show_bug.cgi?id=200750
1518         <rdar://problem/54232261> and <rdar://problem/52355829>
1519
1520         Reviewed by Tim Horton.
1521
1522         * UIProcess/ios/WKContentViewInteraction.mm:
1523         (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
1524
1525 2019-08-14  Brian Burg  <bburg@apple.com>
1526
1527         Web Automation: mouse buttons are not correctly printed in SimulatedInputDispatcher log spew
1528         https://bugs.webkit.org/show_bug.cgi?id=200729
1529
1530         Reviewed by Devin Rousso.
1531
1532         This was printing out gibberish because it was trying to decode a WebMouseEvent button
1533         as an Automation protocol button. The logging was less useful because of it.
1534
1535         To fix this, push usage of Automation protocol-based MouseButton type alias all the way
1536         to the platform-specific methods. The mouse buttons are the same for WebMouseEvent::Button
1537         and the Automation protocol type, except the automation type has an auto-generated toString.
1538
1539         * UIProcess/Automation/SimulatedInputDispatcher.h:
1540         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1541         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
1542         (WebKit::SimulatedInputDispatcher::run):
1543         Fix types.
1544
1545         * UIProcess/Automation/WebAutomationSession.h:
1546         * UIProcess/Automation/WebAutomationSession.cpp:
1547         (WebKit::WebAutomationSession::simulateMouseInteraction):
1548         (WebKit::WebAutomationSession::performMouseInteraction):
1549         (WebKit::WebAutomationSession::performInteractionSequence):
1550         (WebKit::protocolMouseButtonToWebMouseEventButton): Deleted.
1551         Fix types.
1552
1553         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1554         (WebKit::automationMouseButtonToPlatformMouseButton):
1555         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1556         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1557         (WebKit::mouseButtonToGdkButton):
1558         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1559         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
1560         (WebKit::mouseButtonToWPEButton):
1561         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1562         Move translation between MouseButton and native button values to platform methods.
1563
1564 2019-08-15  Simon Fraser  <simon.fraser@apple.com>
1565
1566         Use ObjectIdentifier<FrameIdentifierType> for frameIDs
1567         https://bugs.webkit.org/show_bug.cgi?id=199986
1568
1569         Reviewed by Ryosuke Niwa.
1570
1571         Use the strongly-typed FrameIdentifier instead of uint64_t as frame identifiers everywhere.
1572
1573         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1574         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
1575         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
1576         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
1577         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
1578         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
1579         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1580         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
1581         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
1582         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
1583         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
1584         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1585         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
1586         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1587         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1588         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
1589         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
1590         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1591         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
1592         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
1593         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1594         * NetworkProcess/NetworkCORSPreflightChecker.h:
1595         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1596         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1597         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
1598         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
1599         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
1600         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
1601         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
1602         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
1603         * NetworkProcess/NetworkConnectionToWebProcess.h:
1604         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1605         * NetworkProcess/NetworkLoadChecker.cpp:
1606         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1607         * NetworkProcess/NetworkLoadChecker.h:
1608         * NetworkProcess/NetworkLoadParameters.h:
1609         * NetworkProcess/NetworkProcess.h:
1610         * NetworkProcess/NetworkResourceLoader.cpp:
1611         (WebKit::NetworkResourceLoader::start):
1612         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1613         (WebKit::NetworkResourceLoader::startNetworkLoad):
1614         (WebKit::NetworkResourceLoader::convertToDownload):
1615         (WebKit::NetworkResourceLoader::abort):
1616         (WebKit::NetworkResourceLoader::didReceiveResponse):
1617         (WebKit::NetworkResourceLoader::didReceiveBuffer):
1618         (WebKit::NetworkResourceLoader::didFinishLoading):
1619         (WebKit::NetworkResourceLoader::didFailLoading):
1620         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1621         (WebKit::escapeIDForJSON):
1622         (WebKit::logBlockedCookieInformation):
1623         (WebKit::logCookieInformationInternal):
1624         (WebKit::NetworkResourceLoader::logCookieInformation):
1625         * NetworkProcess/NetworkResourceLoader.h:
1626         * NetworkProcess/cache/NetworkCache.h:
1627         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1628         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1629         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1630         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1631         * Scripts/webkit/messages.py:
1632         * Shared/API/APIFrameHandle.cpp:
1633         (API::FrameHandle::create):
1634         (API::FrameHandle::createAutoconverting):
1635         (API::FrameHandle::FrameHandle):
1636         (API::FrameHandle::decode):
1637         * Shared/API/APIFrameHandle.h:
1638         (API::FrameHandle::frameID const):
1639         * Shared/API/Cocoa/_WKFrameHandle.mm:
1640         (-[_WKFrameHandle hash]):
1641         (-[_WKFrameHandle _frameID]):
1642         (-[_WKFrameHandle initWithCoder:]):
1643         (-[_WKFrameHandle encodeWithCoder:]):
1644         * Shared/Authentication/AuthenticationManager.cpp:
1645         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1646         * Shared/Authentication/AuthenticationManager.h:
1647         * Shared/FrameInfoData.h:
1648         * UIProcess/API/C/WKFrameHandleRef.cpp:
1649         (WKFrameHandleGetFrameID):
1650         * UIProcess/API/Cocoa/WKWebView.mm:
1651         (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
1652         (-[WKWebView _canChangeFrameLayout:]):
1653         * UIProcess/API/Cocoa/_WKInspector.mm:
1654         (-[_WKInspector showMainResourceForFrame:]):
1655         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1656         (WebKit::SimulatedInputDispatcher::run):
1657         * UIProcess/Automation/SimulatedInputDispatcher.h:
1658         * UIProcess/Automation/WebAutomationSession.cpp:
1659         (WebKit::WebAutomationSession::webFrameIDForHandle):
1660         (WebKit::WebAutomationSession::handleForWebFrameID):
1661         (WebKit::WebAutomationSession::switchToBrowsingContext):
1662         (WebKit::WebAutomationSession::waitForNavigationToComplete):
1663         (WebKit::findPageForFrameID):
1664         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
1665         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1666         (WebKit::WebAutomationSession::resolveChildFrameHandle):
1667         (WebKit::WebAutomationSession::resolveParentFrameHandle):
1668         (WebKit::WebAutomationSession::computeElementLayout):
1669         (WebKit::WebAutomationSession::selectOptionElement):
1670         (WebKit::WebAutomationSession::getAllCookies):
1671         (WebKit::WebAutomationSession::deleteSingleCookie):
1672         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
1673         (WebKit::WebAutomationSession::takeScreenshot):
1674         * UIProcess/Automation/WebAutomationSession.h:
1675         * UIProcess/Cocoa/UIDelegate.mm:
1676         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
1677         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
1678         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
1679         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1680         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
1681         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrameShared):
1682         * UIProcess/Network/NetworkProcessProxy.cpp:
1683         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1684         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
1685         * UIProcess/Network/NetworkProcessProxy.h:
1686         * UIProcess/Network/NetworkProcessProxy.messages.in:
1687         * UIProcess/ProvisionalPageProxy.cpp:
1688         (WebKit::ProvisionalPageProxy::validateInput):
1689         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
1690         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
1691         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
1692         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
1693         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
1694         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
1695         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
1696         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
1697         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
1698         (WebKit::ProvisionalPageProxy::didPerformServerRedirect):
1699         (WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1700         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
1701         (WebKit::ProvisionalPageProxy::contentFilterDidBlockLoadForFrame):
1702         * UIProcess/ProvisionalPageProxy.h:
1703         * UIProcess/ServiceWorkerProcessProxy.cpp:
1704         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
1705         * UIProcess/ServiceWorkerProcessProxy.h:
1706         * UIProcess/SuspendedPageProxy.cpp:
1707         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1708         * UIProcess/SuspendedPageProxy.h:
1709         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1710         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy):
1711         * UIProcess/UserMediaPermissionCheckProxy.h:
1712         (WebKit::UserMediaPermissionCheckProxy::create):
1713         (WebKit::UserMediaPermissionCheckProxy::frameID const):
1714         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1715         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
1716         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const):
1717         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
1718         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1719         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
1720         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
1721         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1722         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1723         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1724         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
1725         * UIProcess/UserMediaPermissionRequestProxy.h:
1726         (WebKit::UserMediaPermissionRequestProxy::create):
1727         (WebKit::UserMediaPermissionRequestProxy::mainFrameID const):
1728         (WebKit::UserMediaPermissionRequestProxy::frameID const):
1729         * UIProcess/WebFrameProxy.cpp:
1730         (WebKit::WebFrameProxy::WebFrameProxy):
1731         * UIProcess/WebFrameProxy.h:
1732         (WebKit::WebFrameProxy::create):
1733         (WebKit::WebFrameProxy::frameID const):
1734         * UIProcess/WebPageProxy.cpp:
1735         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1736         (WebKit::WebPageProxy::commitProvisionalPage):
1737         (WebKit::WebPageProxy::runJavaScriptInFrame):
1738         (WebKit::WebPageProxy::didCreateMainFrame):
1739         (WebKit::WebPageProxy::didCreateSubframe):
1740         (WebKit::WebPageProxy::didCreateWindow):
1741         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1742         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
1743         (WebKit::WebPageProxy::didExplicitOpenForFrame):
1744         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1745         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
1746         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
1747         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
1748         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
1749         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
1750         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1751         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
1752         (WebKit::WebPageProxy::didCommitLoadForFrame):
1753         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1754         (WebKit::WebPageProxy::didFinishLoadForFrame):
1755         (WebKit::WebPageProxy::didFailLoadForFrame):
1756         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1757         (WebKit::WebPageProxy::didChangeMainDocument):
1758         (WebKit::WebPageProxy::didReceiveTitleForFrame):
1759         (WebKit::WebPageProxy::didFirstLayoutForFrame):
1760         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
1761         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
1762         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
1763         (WebKit::WebPageProxy::didDetectXSSForFrame):
1764         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
1765         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
1766         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
1767         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1768         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
1769         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1770         (WebKit::WebPageProxy::decidePolicyForResponse):
1771         (WebKit::WebPageProxy::decidePolicyForResponseShared):
1772         (WebKit::WebPageProxy::unableToImplementPolicy):
1773         (WebKit::WebPageProxy::willSubmitForm):
1774         (WebKit::WebPageProxy::didNavigateWithNavigationData):
1775         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
1776         (WebKit::WebPageProxy::didPerformClientRedirect):
1777         (WebKit::WebPageProxy::didPerformClientRedirectShared):
1778         (WebKit::WebPageProxy::didPerformServerRedirect):
1779         (WebKit::WebPageProxy::didPerformServerRedirectShared):
1780         (WebKit::WebPageProxy::didUpdateHistoryTitle):
1781         (WebKit::WebPageProxy::runJavaScriptAlert):
1782         (WebKit::WebPageProxy::runJavaScriptConfirm):
1783         (WebKit::WebPageProxy::runJavaScriptPrompt):
1784         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
1785         (WebKit::WebPageProxy::runOpenPanel):
1786         (WebKit::WebPageProxy::printFrame):
1787         (WebKit::WebPageProxy::focusedFrameChanged):
1788         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
1789         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
1790         (WebKit::WebPageProxy::exceededDatabaseQuota):
1791         (WebKit::WebPageProxy::requestStorageSpace):
1792         (WebKit::WebPageProxy::makeStorageSpaceRequest):
1793         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
1794         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
1795         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
1796         (WebKit::WebPageProxy::shouldAllowDeviceOrientationAndMotionAccess):
1797         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1798         * UIProcess/WebPageProxy.h:
1799         * UIProcess/WebPageProxy.messages.in:
1800         * UIProcess/WebProcessProxy.cpp:
1801         (WebKit::WebProcessProxy::webFrame const):
1802         (WebKit::WebProcessProxy::canCreateFrame const):
1803         (WebKit::WebProcessProxy::frameCreated):
1804         (WebKit::WebProcessProxy::didDestroyFrame):
1805         * UIProcess/WebProcessProxy.h:
1806         * UIProcess/WebProcessProxy.messages.in:
1807         * UIProcess/ios/WKContentView.mm:
1808         (-[WKContentView _wk_pageCountForPrintFormatter:]):
1809         * UIProcess/ios/WebPageProxyIOS.mm:
1810         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
1811         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1812         (WebKit::evaluateJavaScriptCallback):
1813         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
1814         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
1815         (WebKit::WebAutomationSessionProxy::didEvaluateJavaScriptFunction):
1816         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
1817         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
1818         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
1819         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
1820         (WebKit::WebAutomationSessionProxy::focusFrame):
1821         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1822         (WebKit::WebAutomationSessionProxy::selectOptionElement):
1823         (WebKit::WebAutomationSessionProxy::takeScreenshot):
1824         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
1825         (WebKit::WebAutomationSessionProxy::deleteCookie):
1826         * WebProcess/Automation/WebAutomationSessionProxy.h:
1827         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
1828         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1829         (+[WKWebProcessPlugInFrame lookUpFrameFromHandle:]):
1830         * WebProcess/Network/WebLoaderStrategy.cpp:
1831         (WebKit::WebLoaderStrategy::scheduleLoad):
1832         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1833         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1834         * WebProcess/Network/WebResourceLoader.cpp:
1835         (WebKit::WebResourceLoader::willSendRequest):
1836         (WebKit::WebResourceLoader::didReceiveResponse):
1837         (WebKit::WebResourceLoader::didReceiveData):
1838         (WebKit::WebResourceLoader::didFinishResourceLoad):
1839         (WebKit::WebResourceLoader::didFailResourceLoad):
1840         (WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
1841         (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
1842         (WebKit::WebResourceLoader::didReceiveResource):
1843         * WebProcess/Network/WebResourceLoader.h:
1844         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1845         (WebKit::WebSWContextManagerConnection::installServiceWorker):
1846         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1847         (WebKit::WebChromeClient::focusedFrameChanged):
1848         (WebKit::WebChromeClient::contentsSizeChanged const):
1849         (WebKit::WebChromeClient::hasStorageAccess):
1850         (WebKit::WebChromeClient::requestStorageAccess):
1851         * WebProcess/WebCoreSupport/WebChromeClient.h:
1852         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1853         (WebKit::WebFrameLoaderClient::frameID const):
1854         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
1855         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
1856         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1857         * WebProcess/WebPage/WebCookieJar.cpp:
1858         (WebKit::WebCookieJar::cookies const):
1859         (WebKit::WebCookieJar::setCookies):
1860         (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
1861         (WebKit::WebCookieJar::getRawCookies const):
1862         * WebProcess/WebPage/WebCookieJar.h:
1863         * WebProcess/WebPage/WebFrame.cpp:
1864         (WebKit::WebFrame::WebFrame):
1865         (WebKit::generateFrameID): Deleted.
1866         * WebProcess/WebPage/WebFrame.h:
1867         (WebKit::WebFrame::frameID const):
1868         * WebProcess/WebPage/WebInspector.cpp:
1869         (WebKit::WebInspector::showMainResourceForFrame):
1870         * WebProcess/WebPage/WebInspector.h:
1871         * WebProcess/WebPage/WebInspector.messages.in:
1872         * WebProcess/WebPage/WebPage.cpp:
1873         (WebKit::WebPage::loadURLInFrame):
1874         (WebKit::WebPage::loadDataInFrame):
1875         (WebKit::WebPage::stopLoadingFrame):
1876         (WebKit::WebPage::didReceivePolicyDecision):
1877         (WebKit::WebPage::continueWillSubmitForm):
1878         (WebKit::WebPage::runJavaScriptInFrame):
1879         (WebKit::WebPage::getSourceForFrame):
1880         (WebKit::WebPage::getMainResourceDataOfFrame):
1881         (WebKit::WebPage::getResourceDataFromFrame):
1882         (WebKit::WebPage::getWebArchiveOfFrame):
1883         (WebKit::WebPage::addConsoleMessage):
1884         (WebKit::WebPage::sendCSPViolationReport):
1885         (WebKit::WebPage::enqueueSecurityPolicyViolationEvent):
1886         (WebKit::WebPage::beginPrinting):
1887         (WebKit::WebPage::computePagesForPrinting):
1888         (WebKit::WebPage::computePagesForPrintingImpl):
1889         (WebKit::WebPage::drawRectToImage):
1890         (WebKit::WebPage::drawPagesToPDF):
1891         (WebKit::WebPage::drawPagesToPDFImpl):
1892         (WebKit::WebPage::drawPagesForPrinting):
1893         (WebKit::WebPage::frameBecameRemote):
1894         (WebKit::WebPage::hasStorageAccess):
1895         (WebKit::WebPage::requestStorageAccess):
1896         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
1897         * WebProcess/WebPage/WebPage.h:
1898         * WebProcess/WebPage/WebPage.messages.in:
1899         * WebProcess/WebPage/ios/WebPageIOS.mm:
1900         (WebKit::WebPage::computePagesForPrintingPDFDocument):
1901         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
1902         * WebProcess/WebPage/mac/WebPageMac.mm:
1903         (WebKit::WebPage::computePagesForPrintingPDFDocument):
1904         * WebProcess/WebProcess.cpp:
1905         (WebKit::WebProcess::webFrame const):
1906         (WebKit::WebProcess::addWebFrame):
1907         (WebKit::WebProcess::removeWebFrame):
1908         * WebProcess/WebProcess.h:
1909
1910 2019-08-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1911
1912         Remove m_blockRectForTextSelection (along with related code)
1913         https://bugs.webkit.org/show_bug.cgi?id=200695
1914
1915         Reviewed by Megan Gardner.
1916
1917         This member variable was consulted by block selection codepaths which no longer exist.
1918         No change in behavior.
1919
1920         * WebProcess/WebPage/WebPage.h:
1921         * WebProcess/WebPage/ios/WebPageIOS.mm:
1922         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1923         (WebKit::selectionBoxForRange): Deleted.
1924
1925 2019-08-14  Ryan Haddad  <ryanhaddad@apple.com>
1926
1927         Unreviewed, rolling out r248526.
1928
1929         Caused two IndexedDB perf tests to fail
1930
1931         Reverted changeset:
1932
1933         "Remove IDB-specific quota"
1934         https://bugs.webkit.org/show_bug.cgi?id=196545
1935         https://trac.webkit.org/changeset/248526
1936
1937 2019-08-14  Andy Estes  <aestes@apple.com>
1938
1939         Fix the build when ENABLE(APPLE_PAY) is false.
1940
1941         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1942
1943 2019-08-14  Keith Rollin  <krollin@apple.com>
1944
1945         Remove support for macOS < 10.13
1946         https://bugs.webkit.org/show_bug.cgi?id=200694
1947         <rdar://problem/54278851>
1948
1949         Reviewed by Youenn Fablet.
1950
1951         Update conditionals that reference __MAC_OS_X_VERSION_MIN_REQUIRED and
1952         __MAC_OS_X_VERSION_MAX_ALLOWED, assuming that they both have values >=
1953         101300. This means that expressions like
1954         "__MAC_OS_X_VERSION_MIN_REQUIRED < 101300" are always False and
1955         "__MAC_OS_X_VERSION_MIN_REQUIRED >= 101300" are always True.
1956
1957         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
1958         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
1959         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1960         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1961         * Shared/WebPreferencesDefaultValues.cpp:
1962         (WebKit::defaultCustomPasteboardDataEnabled):
1963         * Shared/WebPreferencesDefaultValues.h:
1964         * Shared/mac/AuxiliaryProcessMac.mm:
1965         * UIProcess/Cocoa/WebViewImpl.h:
1966         * UIProcess/Cocoa/WebViewImpl.mm:
1967         (-[WKTextTouchBarItemController itemForIdentifier:]):
1968         (WebKit::WebViewImpl::mediaPlaybackControlsView const):
1969         (WebKit::WebViewImpl::updateMediaTouchBar):
1970         * UIProcess/mac/WebColorPickerMac.mm:
1971         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
1972         * WebProcess/Plugins/PDF/PDFPlugin.h:
1973         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1974         (-[WKPDFPluginAccessibilityObject setPdfLayerController:]):
1975         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
1976         (-[WKPDFPluginAccessibilityObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
1977         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
1978         (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
1979         (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
1980         (WebKit::PDFPlugin::pdfDocumentDidLoad):
1981         (WebKit::PDFPlugin::handleMouseEvent):
1982         (WebKit::PDFPlugin::handleMouseEnterEvent):
1983         (WebKit::PDFPlugin::handleContextMenuEvent):
1984         (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest const):
1985         (WebKit::PDFPlugin::accessibilityAssociatedPluginParentForElement const):
1986         (WebKit::PDFPlugin::updateCursor): Deleted.
1987         * WebProcess/WebProcess.cpp:
1988         (WebKit::WebProcess::initializeWebProcess):
1989
1990 2019-08-14  Brian Burg  <bburg@apple.com>
1991
1992         REGRESSION(r245320): Web Automation: Perform Actions hangs when pointerdown happens near top of page
1993         https://bugs.webkit.org/show_bug.cgi?id=200728
1994         <rdar://problem/54260518>
1995
1996         Reviewed by Devin Rousso.
1997
1998         In the last major refactoring for this code, it seems that the argument to
1999         platformSimulateMouseInteraction was not unified to use viewport coordinates
2000         in all code paths. This patch fixes both callers to *not* add in topContentInset,
2001         and instead this is added back in when doing platform-specific event simulation.
2002
2003         This has no effect on iOS since it's guarded by ENABLE(WEBDRIVER_MOUSE_INTERACTIONS),
2004         which is only built on macOS.
2005
2006         * UIProcess/Automation/WebAutomationSession.h:
2007         * UIProcess/Automation/WebAutomationSession.cpp:
2008         (WebKit::WebAutomationSession::performMouseInteraction):
2009         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2010         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2011
2012 2019-08-14  Andy Estes  <aestes@apple.com>
2013
2014         [Cocoa] Add some WKA extension points
2015         https://bugs.webkit.org/show_bug.cgi?id=200506
2016         <rdar://problem/51682474>
2017
2018         Reviewed by Tim Horton.
2019
2020         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2021         (WebKit::finishCreating):
2022         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
2023         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2024         (IPC::finishDecoding):
2025         (IPC::finishEncoding):
2026         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
2027         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
2028         * Shared/WebCoreArgumentCoders.h:
2029
2030 2019-08-14  Luming Yin  <luming_yin@apple.com>
2031
2032         v3: CrashTracer: Regression : MobileSafari at UIKitCore: -[UITargetedPreview initWithView:parameters:]
2033         https://bugs.webkit.org/show_bug.cgi?id=200634
2034
2035         Reviewed by Simon Fraser.
2036
2037         Under rare race conditions, the WKContentView may no longer have an associated window. However, 
2038         UIContextMenuInteraction may still attempt initialize a UITargetedPreview with the orphaned 
2039         WKContentView. Speculative fix for crashes under such scenarios, so that we can continue without 
2040         a context menu configuration to prevent the UIKit exception.
2041
2042         * UIProcess/ios/WKContentViewInteraction.mm:
2043         (-[WKContentView continueContextMenuInteraction:]):
2044
2045 2019-08-14  Zalan Bujtas  <zalan@apple.com>
2046
2047         [ContentChangeObserver] Stop content change observation explicitly.
2048         https://bugs.webkit.org/show_bug.cgi?id=200689
2049         <rdar://problem/54274887>
2050
2051         Reviewed by Simon Fraser.
2052
2053         * WebProcess/WebPage/ios/WebPageIOS.mm:
2054         (WebKit::WebPage::handleSyntheticClick):
2055
2056 2019-08-14  Youenn Fablet  <youenn@apple.com>
2057
2058         Remove use of emptySessionID from NetworkLoadParameters
2059         https://bugs.webkit.org/show_bug.cgi?id=200712
2060
2061         Reviewed by Alex Christensen.
2062
2063         Make NetworkLoadParameters constructor take a session ID.
2064         Update call sites accordingly.
2065
2066         * NetworkProcess/AdClickAttributionManager.cpp:
2067         (WebKit::AdClickAttributionManager::fireConversionRequest):
2068         * NetworkProcess/Downloads/DownloadManager.cpp:
2069         (WebKit::DownloadManager::startDownload):
2070         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2071         (WebKit::NetworkCORSPreflightChecker::startPreflight):
2072         * NetworkProcess/NetworkLoadParameters.h:
2073         (WebKit::NetworkLoadParameters::NetworkLoadParameters):
2074         * NetworkProcess/NetworkProcess.cpp:
2075         (WebKit::NetworkProcess::preconnectTo):
2076         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2077         (WebKit::NetworkResourceLoadParameters::encode const):
2078         (WebKit::NetworkResourceLoadParameters::decode):
2079         * NetworkProcess/NetworkResourceLoadParameters.h:
2080         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
2081         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2082         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2083         * WebProcess/Network/WebLoaderStrategy.cpp:
2084         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2085         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
2086         (WebKit::WebLoaderStrategy::startPingLoad):
2087         (WebKit::WebLoaderStrategy::preconnectTo):
2088
2089 2019-08-14  Youenn Fablet  <youenn@apple.com>
2090
2091         Remove use of emptySessionID from WebPageCreationParameters
2092         https://bugs.webkit.org/show_bug.cgi?id=200708
2093
2094         Reviewed by Alex Christensen.
2095
2096         Make WebPageCreationParameters constructor take a SessionID.
2097         Update constructor call sites.
2098
2099         * Shared/WebPageCreationParameters.cpp:
2100         (WebKit::WebPageCreationParameters::decode):
2101         * Shared/WebPageCreationParameters.h:
2102         (WebKit::WebPageCreationParameters::WebPageCreationParameters):
2103         * UIProcess/WebPageProxy.cpp:
2104         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2105
2106 2019-08-14  Youenn Fablet  <youenn@apple.com>
2107
2108         Remove API::PageConfiguration::m_sessionID
2109         https://bugs.webkit.org/show_bug.cgi?id=200670
2110
2111         Reviewed by Alex Christensen.
2112
2113         We can remove this member since it is only accessed for a debug assertion that can be removed without any harm.
2114
2115         * UIProcess/API/APIPageConfiguration.cpp:
2116         (API::PageConfiguration::PageConfiguration):
2117         (API::PageConfiguration::copy const):
2118         (API::PageConfiguration::setWebsiteDataStore):
2119         * UIProcess/API/APIPageConfiguration.h:
2120         * UIProcess/API/glib/WebKitWebContext.cpp:
2121         (webkitWebContextCreatePageForWebView):
2122         * UIProcess/WebProcessPool.cpp:
2123         (WebKit::WebProcessPool::createWebPage):
2124
2125 2019-08-14  Youenn Fablet  <youenn@apple.com>
2126
2127         ThreadableBlobRegistry::blobSize should take a SessionID as parameter
2128         https://bugs.webkit.org/show_bug.cgi?id=200671
2129
2130         Reviewed by Alex Christensen.
2131
2132         Update WebCacheStorageConnection to implement sessionID getter.
2133         Update NetworkConnectionToWebProcess to get a sessionID as parameter to blobSize computation.
2134
2135         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2136         (WebKit::NetworkDataTaskCurl::createCurlRequest):
2137         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2138         (WebKit::NetworkConnectionToWebProcess::blobSize):
2139         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2140         * NetworkProcess/NetworkConnectionToWebProcess.h:
2141         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2142         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2143         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
2144         * WebProcess/Cache/WebCacheStorageConnection.h:
2145         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2146         (WebKit::BlobRegistryProxy::blobSize):
2147         * WebProcess/FileAPI/BlobRegistryProxy.h:
2148
2149 2019-08-14  Youenn Fablet  <youenn@apple.com>
2150
2151         Remove SessionID default constructor
2152         https://bugs.webkit.org/show_bug.cgi?id=200669
2153
2154         Reviewed by Alex Christensen.
2155
2156         Update IPC decoder to use an Optional<SessionID>.
2157         Update PageConfiguration to use emptySessionID instead of default constructor.
2158
2159         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2160         (WebKit::NetworkSessionCreationParameters::decode):
2161         * Shared/WebPageCreationParameters.h:
2162         * UIProcess/API/APIPageConfiguration.cpp:
2163         (API::PageConfiguration::PageConfiguration):
2164         (API::PageConfiguration::sessionID): Deleted.
2165         (API::PageConfiguration::setSessionID): Deleted.
2166
2167 2019-08-14  Youenn Fablet  <youenn@apple.com>
2168
2169         Make WebSWOriginStore::m_webSWServerConnections a WeakHashSet
2170         https://bugs.webkit.org/show_bug.cgi?id=200661
2171
2172         Reviewed by Alex Christensen.
2173
2174         * NetworkProcess/ServiceWorker/WebSWOriginStore.cpp:
2175         (WebKit::WebSWOriginStore::importComplete):
2176         (WebKit::WebSWOriginStore::registerSWServerConnection):
2177         (WebKit::WebSWOriginStore::unregisterSWServerConnection):
2178         (WebKit::WebSWOriginStore::didInvalidateSharedMemory):
2179         * NetworkProcess/ServiceWorker/WebSWOriginStore.h:
2180
2181 2019-08-14  Youenn Fablet  <youenn@apple.com>
2182
2183         NetworkProcess::m_swServerConnections should use WeakPtr
2184         https://bugs.webkit.org/show_bug.cgi?id=200660
2185
2186         Reviewed by Geoffrey Garen.
2187
2188         Use WeakPtr for SWServer connections as an extra safety measure.
2189
2190         * NetworkProcess/NetworkProcess.cpp:
2191         (WebKit::NetworkProcess::postMessageToServiceWorkerClient):
2192         (WebKit::NetworkProcess::postMessageToServiceWorker):
2193         (WebKit::NetworkProcess::registerSWServerConnection):
2194         (WebKit::NetworkProcess::unregisterSWServerConnection):
2195         * NetworkProcess/NetworkProcess.h:
2196
2197 2019-08-14  Youenn Fablet  <youenn@apple.com>
2198
2199         Move some WebRTC runtime flags from experimental to internal
2200         https://bugs.webkit.org/show_bug.cgi?id=200672
2201
2202         Reviewed by Eric Carlson.
2203
2204         * Shared/WebPreferences.yaml:
2205
2206 2019-08-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2207
2208         shouldRespectImageOrientation should be a value in ImageOrientation
2209         https://bugs.webkit.org/show_bug.cgi?id=200553
2210
2211         Reviewed by Simon Fraser.
2212
2213         * WebProcess/WebPage/ios/WebPageIOS.mm:
2214         (WebKit::imagePositionInformation):
2215
2216 2019-08-13  John Wilander  <wilander@apple.com>
2217
2218         Resource Load Statistics: Switch NSURLSession on top navigation to prevalent resource with user interaction
2219         https://bugs.webkit.org/show_bug.cgi?id=200642
2220         <rdar://problem/53962073>
2221
2222         Reviewed by Alex Christensen.
2223
2224         Since prevalent resources with user interaction get to keep their cookies and website
2225         data, we should use a different NSURLSessions for when they are first-party websites
2226         and have access to that data. This patch achieves that.
2227
2228         The WebKit::NetworkDataTaskCocoa constructor now checks with the network storage session
2229         if the first party for this load should be isolated. The category for which this is true
2230         is checked in the new function
2231         WebCore:NetworkStorageSession::shouldBlockThirdPartyCookiesButKeepFirstPartyCookiesFor()
2232         which in turn is backed by a new split of m_registrableDomainsToBlockCookieFor into:
2233         - m_registrableDomainsToBlockAndDeleteCookiesFor
2234         - m_registrableDomainsToBlockButKeepCookiesFor
2235         ... in WebCore:NetworkStorageSession.
2236
2237         Non-isolated sessions are now picked up through the convenience function
2238         WebKit::NetworkSessionCocoa::session() whereas isolated sessions are created lazily and
2239         picked up through WebKit::NetworkSessionCocoa::isolatedSession().
2240
2241         The number of isolated NSURLSessions in memory is capped to 10. When the cap is hit,
2242         the session that's been unused the longest is aged out.
2243
2244         The C API changes are test infrastructure.
2245
2246         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2247         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):
2248         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockAndDeleteCookiesFor const):
2249         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockButKeepCookiesFor const):
2250         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
2251         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const): Deleted.
2252         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2253         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2254         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
2255         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
2256         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
2257         (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
2258         (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
2259         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2260         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2261         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
2262         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains): Deleted.
2263         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains): Deleted.
2264             Dead code.
2265         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2266         (WebKit::RegistrableDomainsToBlockCookiesFor::isolatedCopy const):
2267         * NetworkProcess/NetworkProcess.cpp:
2268         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
2269         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
2270         (WebKit::NetworkProcess::hasIsolatedSession const):
2271         * NetworkProcess/NetworkProcess.h:
2272         * NetworkProcess/NetworkProcess.messages.in:
2273         * NetworkProcess/NetworkSession.h:
2274         (WebKit::NetworkSession::shouldIsolateSessionsForPrevalentTopFrames const):
2275         (WebKit::NetworkSession::hasIsolatedSession const):
2276         (WebKit::NetworkSession::clearIsolatedSessions):
2277         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2278         (WebKit::NetworkSessionCreationParameters::encode const):
2279         (WebKit::NetworkSessionCreationParameters::decode):
2280         * NetworkProcess/NetworkSessionCreationParameters.h:
2281         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2282         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2283         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2284         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2285         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2286         (WebKit::NetworkSessionCocoa::session):
2287         (WebKit::NetworkSessionCocoa::isolatedSession):
2288         (WebKit::NetworkSessionCocoa::hasIsolatedSession const):
2289         (WebKit::NetworkSessionCocoa::clearIsolatedSessions):
2290         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
2291         (WebKit::NetworkSessionCocoa::clearCredentials):
2292         * Shared/WebPreferences.yaml:
2293         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2294         (WKWebsiteDataStoreStatisticsHasIsolatedSession):
2295         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2296         * UIProcess/Network/NetworkProcessProxy.cpp:
2297         (WebKit::NetworkProcessProxy::hasIsolatedSession):
2298         * UIProcess/Network/NetworkProcessProxy.h:
2299         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2300         (WebKit::WebsiteDataStore::parameters):
2301         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2302         (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
2303         (WebKit::WebsiteDataStore::hasIsolatedSessionForTesting const):
2304         * UIProcess/WebsiteData/WebsiteDataStore.h:
2305
2306 2019-08-13  Chris Dumez  <cdumez@apple.com>
2307
2308         Fix potential thread safety issue under WebResourceLoadStatisticsStore::hasHadUserInteraction()
2309         https://bugs.webkit.org/show_bug.cgi?id=200688
2310
2311         Reviewed by Alex Christensen.
2312
2313         Fix potential thread safety issue under WebResourceLoadStatisticsStore::hasHadUserInteraction().
2314         It passes a RegistrableDomain to another thread without isolated copying it.
2315
2316         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2317         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2318
2319 2019-08-13  Chris Dumez  <cdumez@apple.com>
2320
2321         Fix potential thread safety issue under StorageManager::getSessionStorageOrigins()
2322         https://bugs.webkit.org/show_bug.cgi?id=200684
2323
2324         Reviewed by Geoffrey Garen.
2325
2326         Fix potential thread safety issue under StorageManager::getSessionStorageOrigins(). The origins are being
2327         passed from the background queue to the main thread without isolated copy.
2328
2329         * NetworkProcess/WebStorage/StorageManager.cpp:
2330         (WebKit::StorageManager::getSessionStorageOrigins):
2331
2332 2019-08-12  Jiewen Tan  <jiewen_tan@apple.com>
2333
2334         [WebAuthn] Make CtapHidAuthenticator/U2fHidAuthenticator to CtapAuthenticator/U2fAuthenticator
2335         https://bugs.webkit.org/show_bug.cgi?id=191527
2336         <rdar://problem/54237146>
2337
2338         Reviewed by Chris Dumez.
2339
2340         This patch makes an ABC CtapDriver, which services as an abstract interface for CtapAuthenticator/U2fAuthenticator to talk to
2341         the actual object that implement the specific CTAP protocol that mananges communications over different transports, for example,
2342         CtapHidDriver, such that CtapAuthenticator/U2fAuthenticator can be shared across different transports.
2343
2344         This patch also renames CtapHidAuthenticator/U2fHidAuthenticator to CtapAuthenticator/U2fAuthenticator correspondingly.
2345
2346         * Sources.txt:
2347         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2348         (WebKit::HidService::continueAddDeviceAfterGetInfo):
2349         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp.
2350         (WebKit::CtapAuthenticator::CtapAuthenticator):
2351         (WebKit::CtapAuthenticator::makeCredential):
2352         (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const):
2353         (WebKit::CtapAuthenticator::getAssertion):
2354         (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
2355         (WebKit::CtapAuthenticator::tryDowngrade):
2356         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: Copied from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h.
2357         * UIProcess/WebAuthentication/fido/CtapDriver.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h.
2358         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
2359         (WebKit::CtapHidDriver::setProtocol):
2360         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp.
2361         (WebKit::U2fAuthenticator::U2fAuthenticator):
2362         (WebKit::U2fAuthenticator::makeCredential):
2363         (WebKit::U2fAuthenticator::checkExcludeList):
2364         (WebKit::U2fAuthenticator::issueRegisterCommand):
2365         (WebKit::U2fAuthenticator::getAssertion):
2366         (WebKit::U2fAuthenticator::issueSignCommand):
2367         (WebKit::U2fAuthenticator::issueNewCommand):
2368         (WebKit::U2fAuthenticator::issueCommand):
2369         (WebKit::U2fAuthenticator::responseReceived):
2370         (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):
2371         (WebKit::U2fAuthenticator::continueCheckOnlyCommandAfterResponseReceived):
2372         (WebKit::U2fAuthenticator::continueBogusCommandAfterResponseReceived):
2373         (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived):
2374         * UIProcess/WebAuthentication/fido/U2fAuthenticator.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h.
2375         * WebKit.xcodeproj/project.pbxproj:
2376
2377 2019-08-13  Chris Dumez  <cdumez@apple.com>
2378
2379         Crash under IPC::Connection::markCurrentlyDispatchedMessageAsInvalid()
2380         https://bugs.webkit.org/show_bug.cgi?id=200674
2381         <rdar://problem/50692748>
2382
2383         Reviewed by Geoff Garen.
2384
2385         When the client terminates a provisional process (e.g. via the [WKWebView _killWebContentProcessAndResetState]
2386         SPI), the WebProcessProxy would notify its associated WebPageProxy objects that it had terminated but would fail
2387         to notify its associated ProvisionalPageProxy objects. As a result, those objects would not get destroyed and
2388         would still think that they were in the middle of a provisional load the next time a load started. This inconsistent
2389         state would lead to crashes such as the one in the radar.
2390
2391         * UIProcess/ProvisionalPageProxy.cpp:
2392         (WebKit::ProvisionalPageProxy::cancel):
2393         * UIProcess/WebProcessProxy.cpp:
2394         (WebKit::WebProcessProxy::requestTermination):
2395
2396 2019-08-13  Youenn Fablet  <youenn@apple.com>
2397
2398         Blob registries should be keyed by session IDs
2399         https://bugs.webkit.org/show_bug.cgi?id=200567
2400         <rdar://problem/54120212>
2401
2402         Reviewed by Alex Christensen.
2403
2404         Move blob registry to NetworkSession so that it is partitioned by session ID.
2405         In case session ID is not given through IPC, use the connection as key to get the network session.
2406         This is used for blobSize.
2407
2408         * NetworkProcess/Downloads/DownloadManager.cpp:
2409         (WebKit::DownloadManager::startDownload):
2410         * NetworkProcess/Downloads/DownloadManager.h:
2411         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2412         * NetworkProcess/FileAPI/NetworkBlobRegistry.h: Removed.
2413         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2414         (WebKit::NetworkConnectionToWebProcess::didClose):
2415         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
2416         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
2417         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2418         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
2419         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
2420         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
2421         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
2422         (WebKit::NetworkConnectionToWebProcess::blobSize):
2423         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2424         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
2425         * NetworkProcess/NetworkConnectionToWebProcess.h:
2426         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2427         * NetworkProcess/NetworkProcess.cpp:
2428         (WebKit::NetworkProcess::blobRegistry):
2429         * NetworkProcess/NetworkProcess.h:
2430         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2431         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
2432         * NetworkProcess/NetworkResourceLoader.cpp:
2433         (WebKit::NetworkResourceLoader::startNetworkLoad):
2434         * NetworkProcess/NetworkSession.h:
2435         (WebKit::NetworkSession::blobRegistry):
2436         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2437         (WebKit::NetworkDataTaskSoup::createRequest):
2438         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2439         (WebKit::NetworkSessionSoup::createWebSocketTask):
2440         * Sources.txt:
2441         * WebKit.xcodeproj/project.pbxproj:
2442         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2443         (WebKit::BlobRegistryProxy::registerFileBlobURL):
2444         (WebKit::BlobRegistryProxy::registerBlobURL):
2445         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
2446         (WebKit::BlobRegistryProxy::unregisterBlobURL):
2447         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
2448         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
2449         * WebProcess/FileAPI/BlobRegistryProxy.h:
2450         * WebProcess/Network/NetworkProcessConnection.cpp:
2451         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
2452         * WebProcess/Network/NetworkProcessConnection.h:
2453
2454 2019-08-13  Youenn Fablet  <youenn@apple.com>
2455
2456         User Agent and SessionID should be given to NetworkRTCProvider to set up the correct proxy information
2457         https://bugs.webkit.org/show_bug.cgi?id=200583
2458
2459         Reviewed by Eric Carlson.
2460
2461         Pass session id and user agent whenever creating a TCP client socket.
2462         Use this information to get the proxy information from NetworkSession and pass it to libwebrtc socket creation.
2463
2464         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2465         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2466         (WebKit::NetworkRTCProvider::proxyInfoFromSession):
2467         (WebKit::NetworkRTCProvider::createClientTCPSocket):
2468         * NetworkProcess/webrtc/NetworkRTCProvider.h:
2469         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
2470         * WebKit.xcodeproj/project.pbxproj:
2471         * NetworkProcess/webrtc/NetworkRTCProvider.mm: Added.
2472         (WebKit::NetworkRTCProvider::proxyInfoFromSession):
2473         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2474         (WebKit::LibWebRTCProvider::createPeerConnection):
2475         (WebKit::LibWebRTCProvider::createSocketFactory):
2476         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
2477         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
2478         (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
2479         (WebKit::LibWebRTCSocketFactory::createUdpSocket):
2480         (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
2481         (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
2482         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
2483
2484 2019-08-12  Chris Dumez  <cdumez@apple.com>
2485
2486         Fix bad RELEASE_LOG_ERROR under ProvisionalPageProxy::ProvisionalPageProxy()
2487         https://bugs.webkit.org/show_bug.cgi?id=200646
2488
2489         Reviewed by Alex Christensen.
2490
2491         Fix bad RELEASE_LOG_ERROR under ProvisionalPageProxy::ProvisionalPageProxy(). Should be a
2492         simple RELEASE_LOG() as this is not an error.
2493
2494         * UIProcess/ProvisionalPageProxy.cpp:
2495         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
2496
2497 2019-08-12  Sam Weinig  <weinig@apple.com>
2498
2499         Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
2500         https://bugs.webkit.org/show_bug.cgi?id=200614
2501
2502         Reviewed by Darin Adler.
2503
2504         Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and 
2505         StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
2506         
2507         Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to 
2508         StringBuilder::appendSubstring(...).
2509
2510         * Shared/mac/AuxiliaryProcessMac.mm:
2511         (WebKit::setAndSerializeSandboxParameters):
2512         * UIProcess/WebProcessPool.cpp:
2513         (WebKit::WebProcessPool::didReceiveInvalidMessage):
2514         Update for renames.
2515
2516 2019-08-12  Dean Jackson  <dino@apple.com>
2517
2518         Contextual menu Hide and Show Link Previews should not have a symbol
2519         https://bugs.webkit.org/show_bug.cgi?id=200645
2520         <rdar://problem/54129647>
2521
2522         Reviewed by Wenson Hsieh.
2523
2524         Don't use an image on the UIMenuItem.
2525
2526         * UIProcess/API/Cocoa/_WKElementAction.mm:
2527         (+[_WKElementAction imageForElementActionType:]): Return nil for Show/Hide Link Previews.
2528
2529 2019-08-12  Chris Dumez  <cdumez@apple.com>
2530
2531         Unreviewed, add missing WTF::initializeMainThread() call to fix some crashes on the bots after r248533.
2532
2533         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2534         (WebKit::XPCServiceMain):
2535
2536 2019-08-12  Megan Gardner  <megan_gardner@apple.com>
2537
2538         Fix Crash in Mail Search
2539         https://bugs.webkit.org/show_bug.cgi?id=200589
2540         <rdar://problem/53666720>
2541
2542         Reviewed by Tim Horton.
2543
2544         If we search in Mail backwards first, for AppKit reasons 
2545         we get a -1 for the index of the found item.
2546         Do not try and insert data in this case.
2547
2548         * UIProcess/mac/WKTextFinderClient.mm:
2549
2550 2019-08-12  Adrian Perez de Castro  <aperez@igalia.com>
2551
2552         [WPE][GTK] Fix building without unified sources
2553         https://bugs.webkit.org/show_bug.cgi?id=200641
2554
2555         Reviewed by Žan Doberšek.
2556
2557         * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp: Add missing inclusions for headers
2558         WebCore/GtkUtilities.h (for convertWidgetPointToScreenPoint), WebCore/IntPoint.h, and
2559         WebPageProxy.h (the two latter to avoid usage of undefined types).
2560         (WebKit::WebDataListSuggestionsDropdownGtk::show): Add namespace prefix to use
2561         WebCore::IntPoint.
2562
2563 2019-08-12  Sihui Liu  <sihui_liu@apple.com>
2564
2565         Clear m_sessionStorageNamespaces on the background thread
2566         https://bugs.webkit.org/show_bug.cgi?id=200631
2567         <rdar://problem/54149638>
2568
2569         Reviewed by Chris Dumez.
2570
2571         Network process receives messages about web page state from web process and destroys sessionStorageNamespace if 
2572         needed. It also receives messages about session state from UI process and destroys StorageManager, which owns 
2573         SessionStorageNamespaces, if needed. Because of the race in receiving the messages from different processes, 
2574         network process may decide to destroy StorageManager before destroying all SessionStorageNamespaces, and 
2575         SessionStorageNamespaces are destroyed with StorageManager on the main thread.
2576
2577         * NetworkProcess/WebStorage/StorageManager.cpp:
2578         (WebKit::StorageManager::waitUntilTasksFinished):
2579
2580 2019-08-12  Sihui Liu  <sihui_liu@apple.com>
2581
2582         Remove an assertion in ~StorageArea()
2583         https://bugs.webkit.org/show_bug.cgi?id=200630
2584         <rdar://problem/54097722>
2585
2586         Reviewed by Chris Dumez.
2587
2588         In r247370, we clear the LocalStorageNamespace before the destructor of LocalStorageNamespace is invoked, to 
2589         make sure StorageArea gets destroyed on the background thread. 
2590         StorageArea can get destroyed before LocalStorageNamespace, so the assertion in ~StorageArea() is not true any 
2591         more.
2592
2593         * NetworkProcess/WebStorage/StorageArea.cpp:
2594         (WebKit::StorageArea::~StorageArea):
2595
2596 2019-08-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2597
2598         [iPadOS] Web pages sometimes load at half width in Safari
2599         https://bugs.webkit.org/show_bug.cgi?id=200624
2600         <rdar://problem/52694257>
2601
2602         Reviewed by Simon Fraser.
2603
2604         Whenever WKWebView's size changes, it normally notifies the web content process by calling into WebPageProxy::
2605         setViewportConfigurationViewLayoutSize, which remembers this view layout size using a member variable,
2606         m_viewportConfigurationViewLayoutSize. Later, m_viewportConfigurationViewLayoutSize is consulted as a part of
2607         constructing the creation parameters used to set up a new page.
2608
2609         However, during animated resize, WKWebView avoids these calls to setViewportConfigurationViewLayoutSize via the
2610         dynamic viewport update mode check in -[WKWebView _frameOrBoundsChanged]. Instead, the new view layout size is
2611         pushed to the web process by calling WebPageProxy::dynamicViewportSizeUpdate.
2612
2613         Since dynamicViewportSizeUpdate doesn't update m_viewportConfigurationViewLayoutSize, the next
2614         WebPageCreationParameters that are created with this WebPageProxy (e.g. after a process swap, or after
2615         reloading, if the process was terminated) will use the size of the WKWebView prior to the most recent animated
2616         resize.
2617
2618         To fix the bug, we simply make sure that m_viewportConfigurationViewLayoutSize is updated in the dynamic
2619         viewport size update (i.e. animated resize) case as well.
2620
2621         Test: WebKit.CreateWebPageAfterAnimatedResize
2622
2623         * UIProcess/ios/WebPageProxyIOS.mm:
2624         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2625
2626 2019-08-12  Chris Dumez  <cdumez@apple.com>
2627
2628         Crash under NetworkResourceLoader::start()
2629         https://bugs.webkit.org/show_bug.cgi?id=200628
2630
2631         Reviewed by Youenn Fablet.
2632
2633         Make sure the NetworkResourceLoader is still alive when the lambda passed to NetworkLoadChecker::check()
2634         gets executed.
2635
2636         * NetworkProcess/NetworkResourceLoader.cpp:
2637         (WebKit::NetworkResourceLoader::start):
2638         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2639         * NetworkProcess/NetworkResourceLoader.h:
2640
2641 2019-08-12  Jonathan Bedard  <jbedard@apple.com>
2642
2643         Tapping buttons in Data Detectors lookup previews doesn't work (Follow-up fix)
2644         https://bugs.webkit.org/show_bug.cgi?id=200579
2645         <rdar://problem/54056519>
2646
2647         Reviewed by Megan Gardner.
2648
2649         * Platform/spi/ios/UIKitSPI.h: Add _UIContextMenuStyle SPI.
2650
2651 2019-08-12  Chris Dumez  <cdumez@apple.com>
2652
2653         Add threading assertions to RefCounted
2654         https://bugs.webkit.org/show_bug.cgi?id=200507
2655
2656         Reviewed by Ryosuke Niwa.
2657
2658         Enable new RefCounted threading assertions for WebKit2
2659         (UIProcess + auxiliary processes).
2660
2661         * Shared/AuxiliaryProcess.cpp:
2662         (WebKit::AuxiliaryProcess::initialize):
2663         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
2664         (WebKit::runInitializationCode):
2665         * Shared/WebKit2Initialize.cpp:
2666         (WebKit::InitializeWebKit2):
2667
2668 2019-08-12  Chris Dumez  <cdumez@apple.com>
2669
2670         Unreviewed, rolling out r248525.
2671
2672         Revert new threading assertions while I work on fixing the
2673         issues they exposed
2674
2675         Reverted changeset:
2676
2677         "Add threading assertions to RefCounted"
2678         https://bugs.webkit.org/show_bug.cgi?id=200507
2679         https://trac.webkit.org/changeset/248525
2680
2681 2019-08-12  Youenn Fablet  <youenn@apple.com>
2682
2683         Remove IDB-specific quota
2684         https://bugs.webkit.org/show_bug.cgi?id=196545
2685
2686         Reviewed by Alex Christensen.
2687
2688         * NetworkProcess/NetworkProcess.cpp:
2689         (WebKit::NetworkProcess::createIDBServer):
2690         (WebKit::NetworkProcess::addIndexedDatabaseSession):
2691         (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.
2692         * NetworkProcess/NetworkProcess.h:
2693         * NetworkProcess/NetworkProcess.messages.in:
2694         * UIProcess/API/C/WKContext.cpp:
2695         (WKContextSetIDBPerOriginQuota): Deleted.
2696         * UIProcess/API/C/WKContextPrivate.h:
2697         * UIProcess/WebProcessPool.cpp:
2698         (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.
2699         * UIProcess/WebProcessPool.h:
2700
2701 2019-08-11  Chris Dumez  <cdumez@apple.com>
2702
2703         Add threading assertions to RefCounted
2704         https://bugs.webkit.org/show_bug.cgi?id=200507
2705
2706         Reviewed by Ryosuke Niwa.
2707
2708         Enable new RefCounted threading assertions for WebKit2
2709         (UIProcess + auxiliary processes).
2710
2711         * Shared/AuxiliaryProcess.cpp:
2712         (WebKit::AuxiliaryProcess::initialize):
2713         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
2714         (WebKit::runInitializationCode):
2715         * Shared/WebKit2Initialize.cpp:
2716         (WebKit::InitializeWebKit2):
2717
2718 2019-08-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2719
2720         WebPage and ViewportConfiguration have differing notions of viewLayoutSize
2721         https://bugs.webkit.org/show_bug.cgi?id=200619
2722
2723         Reviewed by Tim Horton.
2724
2725         The notion of a "view layout size" exists on WebPage and WebPageProxy for the purpose of specifying an intrinsic
2726         content size for the entire web view on macOS. However, it also exists in ViewportConfiguration (as
2727         viewLayoutSize) and WebPageProxy (under the name m_viewportConfigurationViewLayoutSize) for the purposes of
2728         specifying the minimum layout size of the page's viewport.
2729
2730         This is especially confusing in WebPageProxy, which has both m_viewportConfigurationViewLayoutSize and
2731         m_viewLayoutSize. To remedy this, rename "*viewLayoutSize" for the purposes of specifying an intrinsic web view
2732         size to "*minimumSizeForAutoLayout" instead, which is consistent with the corresponding SPI property name on
2733         WKView.
2734
2735         No change in behavior.
2736
2737         * Shared/WebPageCreationParameters.cpp:
2738         (WebKit::WebPageCreationParameters::encode const):
2739         (WebKit::WebPageCreationParameters::decode):
2740         * Shared/WebPageCreationParameters.h:
2741         * UIProcess/API/Cocoa/WKWebView.mm:
2742         (-[WKWebView _minimumLayoutWidth]):
2743         (-[WKWebView _setMinimumLayoutWidth:]):
2744         * UIProcess/Cocoa/WebViewImpl.mm:
2745         (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
2746         (WebKit::WebViewImpl::minimumSizeForAutoLayout const):
2747         (WebKit::WebViewImpl::setIntrinsicContentSize):
2748         * UIProcess/DrawingAreaProxy.h:
2749         (WebKit::DrawingAreaProxy::minimumSizeForAutoLayoutDidChange):
2750         (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange): Deleted.
2751         * UIProcess/WebPageProxy.cpp:
2752         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2753         * UIProcess/WebPageProxy.h:
2754         (WebKit::WebPageProxy::minimumSizeForAutoLayout const):
2755         (WebKit::WebPageProxy::viewLayoutSize const): Deleted.
2756         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2757         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2758         (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumSizeForAutoLayoutDidChange):
2759         (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
2760         (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
2761         (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange): Deleted.
2762         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2763         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2764         * WebProcess/WebPage/WebPage.cpp:
2765         (WebKit::m_textAutoSizingAdjustmentTimer):
2766         (WebKit::WebPage::reinitializeWebPage):
2767         (WebKit::WebPage::setMinimumSizeForAutoLayout):
2768         (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
2769         (WebKit::WebPage::setViewLayoutSize): Deleted.
2770         * WebProcess/WebPage/WebPage.h:
2771         (WebKit::WebPage::minimumSizeForAutoLayout const):
2772         (WebKit::WebPage::viewLayoutSize const): Deleted.
2773         * WebProcess/WebPage/WebPage.messages.in:
2774         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2775         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
2776
2777 2019-08-10  Alex Christensen  <achristensen@webkit.org>
2778
2779         Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
2780         https://bugs.webkit.org/show_bug.cgi?id=200609
2781         <rdar://problem/54015403>
2782
2783         Reviewed by Maciej Stachowiak.
2784
2785         * Shared/WebsitePoliciesData.cpp:
2786         (WebKit::WebsitePoliciesData::encode const):
2787         (WebKit::WebsitePoliciesData::decode):
2788         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2789         * Shared/WebsitePoliciesData.h:
2790         * UIProcess/API/APIWebsitePolicies.cpp:
2791         (API::WebsitePolicies::copy const):
2792         (API::WebsitePolicies::data):
2793         * UIProcess/API/APIWebsitePolicies.h:
2794         * UIProcess/ios/WebPageProxyIOS.mm:
2795         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
2796
2797 2019-08-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
2798
2799         [iOS] Add a quirk for gmail.com messages on iPhone iOS13
2800         https://bugs.webkit.org/show_bug.cgi?id=200605
2801
2802         Reviewed by Maciej Stachowiak.
2803
2804         Use WebPage::platformUserAgent() to add the gmail.com quirk.
2805
2806         * UIProcess/ios/WebPageProxyIOS.mm:
2807         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
2808         * WebProcess/WebPage/ios/WebPageIOS.mm:
2809         (WebKit::WebPage::platformUserAgent const):
2810
2811 2019-08-10  Tim Horton  <timothy_horton@apple.com>
2812
2813         Remove some more unused 32-bit code
2814         https://bugs.webkit.org/show_bug.cgi?id=200607
2815
2816         Reviewed by Alexey Proskuryakov.
2817
2818         * Modules/OSX.modulemap:
2819
2820 2019-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2821
2822         [iOS 13] Google Docs/Slides/Sheets: paste often doesn't work and sometimes produces an error
2823         https://bugs.webkit.org/show_bug.cgi?id=200591
2824         <rdar://problem/54102238>
2825
2826         Reviewed by Ryosuke Niwa and Tim Horton.
2827
2828         Adopts UIKit SPI to avoid incrementing the general pasteboard's change count whenever an editable element is
2829         focused. This is due to how, in iOS 13, UIKit temporarily writes an image to the pasteboard when showing the
2830         keyboard, to determine whether or not to show the Memojis in the input view.
2831
2832         This causes UIPasteboard's changeCount to increment twice due to adding and then removing the image, which means
2833         that the changeCount sanity checks in the web process will race against the pasteboard gaining and then losing
2834         this temporary image.
2835
2836         Instead, the new -supportsImagePaste SPI may be used to short-circuit this step, and avoid updating the
2837         changeCount when UIKeyboardImpl's delegate changes.
2838
2839         * UIProcess/ios/WKContentViewInteraction.mm:
2840         (-[WKContentView supportsImagePaste]):
2841
2842 2019-08-09  Alex Christensen  <achristensen@webkit.org>
2843
2844         Remove unused Connection::sendWithReply
2845         https://bugs.webkit.org/show_bug.cgi?id=200590
2846
2847         Reviewed by Chris Dumez.
2848
2849         This was attempted in r245151, but rolled out in r245164 because my SecItemShim code didn't work well on non-main threads.
2850         Chris found a better solution for SecItemShim in r248014, making this unused code.  Let's remove it.
2851
2852         * Platform/IPC/Connection.cpp:
2853         (IPC::Connection::invalidate):
2854         (IPC::Connection::processIncomingSyncReply):
2855         (IPC::Connection::connectionDidClose):
2856         (IPC::Connection::sendMessageWithReply): Deleted.
2857         * Platform/IPC/Connection.h:
2858         (IPC::Connection::send):
2859         (IPC::Connection::sendWithReply): Deleted.
2860
2861 2019-08-09  Simon Fraser  <simon.fraser@apple.com>
2862
2863         [iOS WK2] Remove context menu hints on navigation
2864         https://bugs.webkit.org/show_bug.cgi?id=200588
2865         rdar://problem/54061796
2866
2867         Reviewed by Tim Horton.
2868
2869         Make sure the context menu hint doesn't linger across navigations by hosting it in its
2870         own container view (shared with drag previews), and hiding that view on navigation (unparenting
2871         may have bad consequences). We remove the view when the animation ends.
2872
2873         * UIProcess/ios/WKContentViewInteraction.h:
2874         * UIProcess/ios/WKContentViewInteraction.mm:
2875         (-[WKContentView _didCommitLoadForMainFrame]):
2876         (-[WKContentView containerViewForTargetedPreviews]):
2877         (-[WKContentView _hideContextMenu]):
2878         (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
2879
2880 2019-08-09  Alex Christensen  <achristensen@webkit.org>
2881
2882         Disable CSSOM View Scrolling API for IMDb iOS app
2883         https://bugs.webkit.org/show_bug.cgi?id=200586
2884         <rdar://problem/53645833>
2885
2886         Reviewed by Simon Fraser.
2887
2888         Change the CSSOMViewScrollingAPIEnabled default value to be off for the IMDb app's WKWebViews.
2889         I manually verified this is effective in those WKWebViews but no other WKWebViews and that it fixes the radar.
2890
2891         * Shared/WebPreferences.yaml:
2892         * Shared/WebPreferencesDefaultValues.cpp:
2893         (WebKit::defaultCSSOMViewScrollingAPIEnabled):
2894         * Shared/WebPreferencesDefaultValues.h:
2895
2896 2019-08-09  Tim Horton  <timothy_horton@apple.com>
2897
2898         Tapping buttons in Data Detectors lookup previews doesn't work
2899         https://bugs.webkit.org/show_bug.cgi?id=200579
2900         <rdar://problem/54056519>
2901
2902         Reviewed by Megan Gardner.
2903
2904         * Platform/spi/ios/UIKitSPI.h:
2905         * UIProcess/ios/WKContentViewInteraction.mm:
2906         (-[WKContentView _contextMenuInteraction:styleForMenuWithConfiguration:]):
2907         If a Data Detectors context menu wants the action menu style, provide it.
2908
2909         (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
2910         If a Data Detectors context menu provides a view controller to present
2911         on context menu commit, present it. We present on top of the same view
2912         controller that is currently presenting the context menu, but modally
2913         instead of inside the context menu.
2914
2915         If a Data Detectors context menu instead provides a URL to launch on
2916         context menu commit, call openURL.
2917
2918         In both cases, change the commit style to pop, since we're committing
2919         instead of dismissing.
2920
2921 2019-08-08  Dean Jackson  <dino@apple.com>
2922
2923         REGRESSION (52279987): Most of the WKUIDelegate contextMenu delegate methods are not being called
2924         https://bugs.webkit.org/show_bug.cgi?id=200557
2925         <rdar://problem/53717962>
2926
2927         Reviewed by Wenson Hsieh.
2928
2929         UIKit changed the name of delegates recently. We ignored the warning because
2930         it was still calling the old methods. However, it will only do so for applications
2931         authored by Apple, breaking 3rd parties.
2932
2933         The change here is just adopting the new methods in place of the old ones.
2934         It does not change the API that WebKit vends (they still use the older names).
2935
2936         * UIProcess/ios/WKContentViewInteraction.mm:
2937         (-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
2938         (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
2939         (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
2940         (-[WKContentView contextMenuInteractionWillPresent:]): Deleted.
2941         (-[WKContentView contextMenuInteraction:willCommitWithAnimator:]): Deleted.
2942         (-[WKContentView contextMenuInteractionDidEnd:]): Deleted.
2943
2944 2019-08-08  Simon Fraser  <simon.fraser@apple.com>
2945
2946         [iOS WK2] Hide previews when an inner overflow or frame scrollview scrolls
2947         https://bugs.webkit.org/show_bug.cgi?id=200552
2948         rdar://problem/54086338
2949
2950         Reviewed by Wenson Hsieh.
2951
2952         Give UITargetedPreview the UIScrollView that the target element is inside of,
2953         so it can clean up if the user starts to scroll that view.
2954
2955         * Platform/spi/ios/UIKitSPI.h:
2956         * UIProcess/ios/WKContentViewInteraction.mm:
2957         (-[WKContentView _createTargetedPreviewIfPossible]):
2958
2959 2019-08-08  Chris Dumez  <cdumez@apple.com>
2960
2961         Add threading assertions to WebStorage code
2962         https://bugs.webkit.org/show_bug.cgi?id=200550
2963
2964         Reviewed by Geoffrey Garen.
2965
2966         Add threading assertions to WebStorage code for extra safety.
2967
2968         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
2969         (WebKit::LocalStorageNamespace::LocalStorageNamespace):
2970         (WebKit::LocalStorageNamespace::~LocalStorageNamespace):
2971         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
2972         (WebKit::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
2973         (WebKit::LocalStorageNamespace::clearAllStorageAreas):
2974         (WebKit::LocalStorageNamespace::ephemeralOrigins const):
2975         (WebKit::LocalStorageNamespace::cloneTo):
2976         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
2977         (WebKit::SessionStorageNamespace::SessionStorageNamespace):
2978         (WebKit::SessionStorageNamespace::~SessionStorageNamespace):
2979         (WebKit::SessionStorageNamespace::addAllowedConnection):
2980         (WebKit::SessionStorageNamespace::removeAllowedConnection):
2981         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
2982         (WebKit::SessionStorageNamespace::cloneTo):
2983         (WebKit::SessionStorageNamespace::origins const):
2984         (WebKit::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
2985         (WebKit::SessionStorageNamespace::clearAllStorageAreas):
2986         * NetworkProcess/WebStorage/StorageArea.cpp:
2987         (WebKit::StorageArea::StorageArea):
2988         (WebKit::StorageArea::~StorageArea):
2989         (WebKit::StorageArea::addListener):
2990         (WebKit::StorageArea::removeListener):
2991         (WebKit::StorageArea::hasListener const):
2992         (WebKit::StorageArea::clone const):
2993         (WebKit::StorageArea::setItem):
2994         (WebKit::StorageArea::setItems):
2995         (WebKit::StorageArea::removeItem):
2996         (WebKit::StorageArea::clear):
2997         (WebKit::StorageArea::items const):
2998         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
2999         (WebKit::StorageArea::dispatchEvents const):
3000         * NetworkProcess/WebStorage/StorageManager.cpp:
3001         (WebKit::StorageManager::createSessionStorageNamespace):
3002         (WebKit::StorageManager::destroySessionStorageNamespace):
3003         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
3004         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
3005         (WebKit::StorageManager::cloneSessionStorageNamespace):
3006         (WebKit::StorageManager::processDidCloseConnection):
3007         (WebKit::StorageManager::getSessionStorageOrigins):
3008         (WebKit::StorageManager::deleteSessionStorageOrigins):
3009         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
3010         (WebKit::StorageManager::getLocalStorageOrigins):
3011         (WebKit::StorageManager::getLocalStorageOriginDetails):
3012         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
3013         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3014         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
3015         (WebKit::StorageManager::waitUntilTasksFinished):
3016         (WebKit::StorageManager::suspend):
3017         (WebKit::StorageManager::resume):
3018         (WebKit::StorageManager::findStorageArea const):
3019         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
3020         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
3021         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
3022         (WebKit::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
3023         (WebKit::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
3024         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
3025         (WebKit::TransientLocalStorageNamespace::origins const):
3026         (WebKit::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
3027         (WebKit::TransientLocalStorageNamespace::clearAllStorageAreas):
3028
3029 2019-08-08  Brent Fulgham  <bfulgham@apple.com>
3030
3031         [FTW] Get WebKit, WebKit2, and MiniBrowser building and executing
3032         https://bugs.webkit.org/show_bug.cgi?id=200539
3033         <rdar://problem/54082550>
3034
3035         Reviewed by Dean Jackson.
3036
3037         * PlatformFTW.cmake: Added.
3038         * Shared/ShareableBitmap.h:
3039         * Shared/win/ShareableBitmapDirect2D.cpp: Added.
3040         * UIProcess/BackingStore.cpp:
3041         * UIProcess/BackingStore.h:
3042         (WebKit::BackingStore::renderTarget):
3043         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
3044         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
3045         * UIProcess/win/BackingStoreDirect2D.cpp: Added.
3046         * UIProcess/win/WebInspectorProxyWin.cpp:
3047         (WebKit::WebInspectorProxy::inspectorPageURL):
3048         (WebKit::WebInspectorProxy::inspectorTestPageURL):
3049         (WebKit::WebInspectorProxy::inspectorBaseURL):
3050         * UIProcess/win/WebView.cpp:
3051         (WebKit::WebView::paint):
3052         * UIProcess/win/WebView.h:
3053         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
3054         (WebKit::DrawingAreaCoordinatedGraphics::display):
3055         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
3056         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
3057         (WebKit::WebInspectorUI::localizedStringsURL):
3058         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
3059         * WebProcess/win/WebProcessMainWin.cpp:
3060         (WebKit::WebProcessMainWin):
3061
3062 2019-08-08  Per Arne Vollan  <pvollan@apple.com>
3063
3064         [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
3065         https://bugs.webkit.org/show_bug.cgi?id=200543
3066
3067         Reviewed by Brent Fulgham.
3068
3069         Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process
3070         identifier of the WebContent process.
3071
3072         * Shared/Cocoa/SandboxExtensionCocoa.mm:
3073         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
3074         (WebKit::SandboxExtension::createHandleForReadByPid):
3075         * Shared/SandboxExtension.h:
3076         * UIProcess/WebPageProxy.cpp:
3077         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3078
3079 2019-08-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3080
3081         [iOS] Position image information should respect the image orientation
3082         https://bugs.webkit.org/show_bug.cgi?id=200487
3083
3084         Reviewed by Simon Fraser.
3085
3086         imagePositionInformation() should respect the image orientation when
3087         drawing an Image to a ShareableBitmap context.
3088
3089         boundsPositionInformation() already takes care of the image orientation
3090         because it gets RenderImage::enclosingBoundingBox().
3091
3092         * WebProcess/WebPage/ios/WebPageIOS.mm:
3093         (WebKit::imagePositionInformation):
3094
3095 2019-08-08  Timothy Hatcher  <timothy@apple.com>
3096
3097         Set WKWebView opaque based on drawsBackground in PageConfiguration.
3098         https://bugs.webkit.org/show_bug.cgi?id=200528
3099
3100         Reviewed by Tim Horton.
3101
3102         * UIProcess/API/Cocoa/WKWebView.mm:
3103         (-[WKWebView _initializeWithConfiguration:]): Set self.opaque = NO when !self.opaque || !pageConfiguration->drawsBackground().
3104         It is almost impossible to have !self.opaque be NO at this point, since we are still inside initWithFrame:. A subclass could
3105         override opaque and return NO, but checking pageConfiguration's drawsBackground is a good alternative.
3106         * WebProcess/WebPage/WebPage.h: Remove unused m_drawsBackground member.
3107
3108 2019-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3109
3110         [iOS 13] Taps that interrupt momentum scrolling are recognized as clicks
3111         https://bugs.webkit.org/show_bug.cgi?id=200516
3112         <rdar://problem/53889373>
3113
3114         Reviewed by Tim Horton.
3115
3116         After <https://trac.webkit.org/r247656>, the -tracksImmediatelyWhileDecelerating property of WKScrollView and
3117         WKChildScrollView is set to NO. This means that if a user interacts with the page while the scroll view is
3118         decelerating (e.g. after momentum scrolling), the pan gesture recognizer will not be immediately recognized.
3119         This gives other gesture recognizers, such as the synthetic click (single tap) gesture a chance to instead
3120         recognize first. In this particular bug, this causes taps on the web view that are intended to only stop
3121         momentum scrolling to instead activate clickable elements beneath the touch, such as links and buttons.
3122
3123         To mitigate this, we add some logic to prevent the click gesture recognizer from firing in the case where the
3124         tap also causes the scroll view to decelerate. This heuristic is similar to the one introduced in r219310, which
3125         has the same purpose of hiding gestures that stop momentum scrolling from the page, and also consults
3126         -[UIScrollView _isInterruptingDeceleration].
3127
3128         Tests:  fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
3129                 fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html
3130                 fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow.html
3131
3132         * UIProcess/ios/WKContentViewInteraction.mm:
3133         (-[WKContentView gestureRecognizerShouldBegin:]):
3134
3135         Return NO in the case of the single tap gesture if the UIScrollView most recently touched by the single tap
3136         gesture (or one of its enclosing scroll views, up to the main WKScrollView) is being interrupted while
3137         decelerating.
3138
3139         * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
3140         * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
3141         (-[WKSyntheticTapGestureRecognizer reset]):
3142         (-[WKSyntheticTapGestureRecognizer touchesBegan:withEvent:]):
3143
3144         Teach WKSyntheticTapGestureRecognizer to keep track of the last WKScrollView that was touched, for later use in
3145         -gestureRecognizerShouldBegin:. To do this, we keep a weak reference to the first UIScrollView we find in the
3146         set of touches.
3147
3148         (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
3149
3150 2019-08-08  Dean Jackson  <dino@apple.com>
3151
3152         Use "safari" glyph for "Show Link Previews" contextual menu
3153         https://bugs.webkit.org/show_bug.cgi?id=200544
3154         <rdar://problem/54087842>
3155
3156         Reviewed by Tim Horton.
3157
3158         Use the system image for the compass.
3159
3160         * UIProcess/API/Cocoa/_WKElementAction.mm:
3161         (+[_WKElementAction imageForElementActionType:]):
3162
3163 2019-08-08  Chris Dumez  <cdumez@apple.com>
3164
3165         Move classes declared inside StorageManager.cpp into their own headers
3166         https://bugs.webkit.org/show_bug.cgi?id=200527
3167
3168         Reviewed by Alex Christensen.
3169
3170         Move classes declared inside StorageManager.cpp into their own headers
3171         for clarity. StorageManager.cpp was getting really big.
3172
3173         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp: Added.
3174         (WebKit::LocalStorageNamespace::LocalStorageNamespace):
3175         (WebKit::LocalStorageNamespace::~LocalStorageNamespace):
3176         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
3177         (WebKit::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
3178         (WebKit::LocalStorageNamespace::clearAllStorageAreas):
3179         (WebKit::LocalStorageNamespace::ephemeralOrigins const):
3180         (WebKit::LocalStorageNamespace::cloneTo):
3181         * NetworkProcess/WebStorage/LocalStorageNamespace.h: Added.
3182         (WebKit::LocalStorageNamespace::create):
3183         (WebKit::LocalStorageNamespace::storageManager const):
3184         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp: Added.
3185         (WebKit::SessionStorageNamespace::SessionStorageNamespace):
3186         (WebKit::SessionStorageNamespace::~SessionStorageNamespace):
3187         (WebKit::SessionStorageNamespace::addAllowedConnection):
3188         (WebKit::SessionStorageNamespace::removeAllowedConnection):
3189         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
3190         (WebKit::SessionStorageNamespace::cloneTo):
3191         (WebKit::SessionStorageNamespace::origins const):
3192         (WebKit::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
3193         (WebKit::SessionStorageNamespace::clearAllStorageAreas):
3194         * NetworkProcess/WebStorage/SessionStorageNamespace.h: Added.
3195         (WebKit::SessionStorageNamespace::create):
3196         (WebKit::SessionStorageNamespace::isEmpty const):
3197         (WebKit::SessionStorageNamespace::allowedConnections const):
3198         * NetworkProcess/WebStorage/StorageArea.cpp: Added.
3199         (WebKit::StorageArea::StorageArea):
3200         (WebKit::StorageArea::~StorageArea):
3201         (WebKit::StorageArea::addListener):
3202         (WebKit::StorageArea::removeListener):
3203         (WebKit::StorageArea::hasListener const):
3204         (WebKit::StorageArea::clone const):
3205         (WebKit::StorageArea::setItem):
3206         (WebKit::StorageArea::setItems):
3207         (WebKit::StorageArea::removeItem):
3208         (WebKit::StorageArea::clear):
3209         (WebKit::StorageArea::items const):
3210         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
3211         (WebKit::StorageArea::dispatchEvents const):
3212         * NetworkProcess/WebStorage/StorageArea.h: Added.
3213         (WebKit::StorageArea::create):
3214         (WebKit::StorageArea::securityOrigin const):
3215         (WebKit::StorageArea::isEphemeral const):
3216         * NetworkProcess/WebStorage/StorageManager.cpp:
3217         (WebKit::StorageManager::createLocalStorageMap):
3218         (WebKit::StorageManager::findStorageArea const):
3219         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
3220         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
3221         * NetworkProcess/WebStorage/StorageManager.h:
3222         (WebKit::StorageManager::create):
3223         (WebKit::StorageManager::localStorageDatabaseTracker const):
3224         (WebKit::StorageManager::workQueue const):
3225         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp: Added.
3226         (WebKit::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
3227         (WebKit::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
3228         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
3229         (WebKit::TransientLocalStorageNamespace::origins const):
3230         (WebKit::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
3231         (WebKit::TransientLocalStorageNamespace::clearAllStorageAreas):
3232         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h: Added.
3233         (WebKit::TransientLocalStorageNamespace::create):
3234         * NetworkProcess/cache/NetworkCache.cpp:
3235         (WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):
3236         * Sources.txt:
3237         * WebKit.xcodeproj/project.pbxproj:
3238
3239 2019-08-08  Rob Buis  <rbuis@igalia.com>
3240
3241         Add runtime flag for lazy image loading
3242         https://bugs.webkit.org/show_bug.cgi?id=199794
3243
3244         Reviewed by Darin Adler.
3245
3246         Add LazyImageLoading preference.
3247
3248         * Shared/WebPreferences.yaml:
3249         * UIProcess/API/C/WKPreferences.cpp:
3250         (WKPreferencesSetLazyImageLoadingEnabled):
3251         (WKPreferencesGetLazyImageLoadingEnabled):
3252         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3253
3254 2019-08-07  Chris Dumez  <cdumez@apple.com>
3255
3256         Turn some ITP threading ASSERTs into RELEASE_ASSERTs
3257         https://bugs.webkit.org/show_bug.cgi?id=200521
3258
3259         Reviewed by Ryosuke Niwa.
3260
3261         Turn some ITP threading ASSERTs into RELEASE_ASSERTs to help catch more bugs.
3262
3263         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3264         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
3265         (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
3266         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
3267         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
3268         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
3269         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3270         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3271         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
3272         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
3273
3274 2019-08-07  Kate Cheney  <katherine_cheney@apple.com>
3275
3276         Adopt non-deprecated CGColorSpace API
3277         https://bugs.webkit.org/show_bug.cgi?id=184358
3278
3279         Reviewed by Darin Adler.
3280
3281         * Shared/mac/ColorSpaceData.mm:
3282         (WebKit::ColorSpaceData::decode):
3283
3284         We changed the deprecated CGColorSpaceCreateWithICCProfile function to 
3285         CGColorSpaceCreateWithICCData. 
3286
3287 2019-08-07  Alex Christensen  <achristensen@webkit.org>
3288
3289         Remove speculative workaround for upload crash
3290         https://bugs.webkit.org/show_bug.cgi?id=200514
3291
3292         Reviewed by Geoffrey Garen.
3293
3294         This workaround didn't help anyways, and the crash has been resolved.  Let's clean up.
3295
3296         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3297         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
3298
3299 2019-08-07  Chris Dumez  <cdumez@apple.com>
3300
3301         Regression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersistentStorage may get destroyed on the wrong thread
3302         https://bugs.webkit.org/show_bug.cgi?id=200517
3303
3304         Reviewed by Geoffrey Garen.
3305
3306         The issue is that WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore() is null checking
3307         m_persistentStorage and m_statisticsStore on the main thread, even though those members are initialized
3308         and destroyed on the background thread. As a result, if flushAndDestroyPersistentStore() is called *before*
3309         the background task to initialize those members has had a chance to run, then we'd return early without
3310         destroying those members. Later on, the background task would then initialize those data members and we
3311         would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
3312         main thread.
3313
3314         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3315         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
3316
3317 2019-08-06  Dean Jackson  <dino@apple.com>
3318
3319         Context menu on a universal link produces a blank preview
3320         https://bugs.webkit.org/show_bug.cgi?id=200485
3321         <rdar://problem/53699620>
3322
3323         Reviewed by Tim Horton.
3324
3325         If the context menu is activated on an iTunesStore URL, pass it
3326         on to DataDetectors, who should know how to handle it.
3327
3328         Two drive-by fixes:
3329         - make it clear that early returns do not produce a value. Instead call the
3330           completion handler first, then return.
3331         - The new API DataDetectors case doesn't need to worry about hiding link previews
3332           as DataDetectors itself will handle that.
3333
3334         * UIProcess/ios/WKContentViewInteraction.mm: If the URL is an iTunesStoreURL
3335         (as defined by CoreServices), let DataDetectors handle it.
3336         (-[WKContentView assignLegacyDataForContextMenuInteraction]):
3337         (-[WKContentView continueContextMenuInteraction:]):
3338         (-[WKContentView continueContextMenuInteractionWithDataDetectors:]): New method to
3339         use DataDetectors if possible.
3340
3341 2019-08-08  Simon Fraser  <simon.fraser@apple.com>
3342
3343         Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
3344         https://bugs.webkit.org/show_bug.cgi?id=200374
3345         rdar://problem/54095519
3346
3347         Reviewed by Tim Horton.
3348         
3349         Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
3350         by asking the scrolling coordinator.
3351         
3352         Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
3353         which gets the scrolling node and asks the delegate for the UIView.
3354
3355         * Shared/ios/InteractionInformationAtPosition.h:
3356         * Shared/ios/InteractionInformationAtPosition.mm:
3357         (WebKit::InteractionInformationAtPosition::encode const):
3358         (WebKit::InteractionInformationAtPosition::decode):
3359         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3360         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3361         (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
3362         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3363         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3364         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
3365         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
3366         * WebProcess/WebPage/ios/WebPageIOS.mm:
3367         (WebKit::elementPositionInformation):
3368
3369 2019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
3370
3371         Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining 
3372         a yellow auto-filled appearance
3373         https://bugs.webkit.org/show_bug.cgi?id=200037
3374         rdar://problem/51900961
3375
3376         Reviewed by Daniel Bates.
3377
3378         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
3379         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
3380         (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndViewable]):
3381         Accessor function for boolean which represents if the input element is autofilled and viewable.
3382
3383         (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndViewable:]):
3384         Setter function for boolean which represents if the input element is autofilled and viewable.
3385
3386         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
3387         (WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable):
3388         Accessor function for boolean which represents if the input element is autofilled and viewable.
3389
3390        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
3391         Creating function declaration for boolean setter.