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