2c1368403ef108321964dd77a3224382f1e1df62
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
2
3         [iOS] Silence MediaPlayer compile warnings
4         https://bugs.webkit.org/show_bug.cgi?id=193780
5         <rdar://problem/47518428>
6
7         Reviewed by Jer Noble.
8
9         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
10
11 2019-01-24  Truitt Savell  <tsavell@apple.com>
12
13         Unreviewed, rolling out r240446.
14
15         Casued 5 API failures
16
17         Reverted changeset:
18
19         "Activate the WebResourceLoadStatisticsStore in the
20         NetworkProcess and deactivate it in the UIProcess."
21         https://bugs.webkit.org/show_bug.cgi?id=193297
22         https://trac.webkit.org/changeset/240446
23
24 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
25
26         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
27         https://bugs.webkit.org/show_bug.cgi?id=193297
28         <rdar://problem/47158841>
29
30         Reviewed by Alex Christensen.
31
32         This patch activates the ResourceLoadStatistics code in the NetworkProcess, and turns
33         it off in the UIProcess. It also updates test infrastructure to work with this change
34         in architecture.
35
36         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
37         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading): Added.
38         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect): Added.
39         (WebKit::ResourceLoadStatisticsMemoryStore::logWebSocketLoading): Added.
40         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
41         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading): Added.
42         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect): Added.
43         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading): Added.
44         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
45         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
46         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources): Deleted.
47         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
48         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
49         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading): Added.
50         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect): Added.
51         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading): Added.
52         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
53         * NetworkProcess/NetworkSession.cpp:
54         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
55         * UIProcess/WebProcessPool.cpp:
56         (WebKit::WebProcessPool::ensureNetworkProcess):
57         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
58         (WebKit::WebsiteDataStore::parameters):
59         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
60         (WebKit::WebsiteDataStore::removeData):
61         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
62         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
63         * Webprocess/WebProcess.cpp:
64         (WebKit::WebProcess::initializeWebProcess): Register new ResourceLoadObserver callbacks.
65
66 2019-01-24  John Wilander  <wilander@apple.com>
67
68         Add Ad Click Attribution as an internal/experimental feature
69         https://bugs.webkit.org/show_bug.cgi?id=193685
70         <rdar://problem/47450399>
71
72         Reviewed by Brent Fulgham.
73
74         * Shared/WebPreferences.yaml:
75             Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
76
77 2019-01-24  Antti Koivisto  <antti@apple.com>
78
79         [PSON] Flash on back navigation on Mac
80         https://bugs.webkit.org/show_bug.cgi?id=193716
81         <rdar://problem/47148458>
82
83         Reviewed by Chris Dumez.
84
85         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
86
87         * UIProcess/SuspendedPageProxy.cpp:
88         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
89         (WebKit::SuspendedPageProxy::close):
90
91         Track closed state so we don't send the message twice, causing unhandled message errors in web process.
92
93         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
94
95         Close the suspended page if the suspension fails.
96         Skip this if we are using web process side compositing on Mac.
97
98         * UIProcess/SuspendedPageProxy.h:
99         * UIProcess/WebPageProxy.cpp:
100         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
101
102         On Mac, close the failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
103
104         * UIProcess/WebProcessPool.cpp:
105         (WebKit::WebProcessPool::closeFailedSuspendedPagesForPage):
106         * UIProcess/WebProcessPool.h:
107         * WebProcess/WebPage/WebPage.cpp:
108         (WebKit::WebPage::suspendForProcessSwap):
109
110         Don't close the page on suspension failure. This is now managed by the UI process.
111
112 2019-01-24  Chris Dumez  <cdumez@apple.com>
113
114         Regression(PSON) Back/Forward list items' URL sometimes gets replaced with the URL of a subframe
115         https://bugs.webkit.org/show_bug.cgi?id=193761
116         <rdar://problem/47456405>
117
118         Reviewed by Alex Christensen.
119
120         When doing a history navigation cross-process, the UIProcess would first send the back/forward list items
121         to the destination WebProcess via WebPage::updateBackForwardListForReattach(), then ask the process to
122         navigate to the expected back/forward list item.
123
124         WebPage::updateBackForwardListForReattach() would call restoreSessionInternal(), which would call
125         toHistoryItem() on each BackForwardListItem. This may end up creating more than one HistoryItem for each
126         BackForwardListItem because HistoryItems are part of a tree (each frame has its own list of history items).
127
128         Note that BackForwardListItems and HistoryItem share a BackForwardItemIdentifier which is a
129         (processIdentifier, itemIdentifier) pair. We normally generate the HistoryItem's identifier from inside
130         its constructor like so:
131         `{ Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }`
132
133         However, when calling updateBackForwardListForReattach() and constructing children HistoryItem,
134         applyFrameState() would generate the identifier by itself and passing it to the HistoryItem constructor.
135         Its genegates the ID the exact same way so this would in theory not be a problem. Unfortunately, both
136         calls to generateObjectIdentifier() get inlined and both call sites end up with their own static counter
137         to generate ids. As a result, we may end up with conflicts as HistoryItems for child frames (restored
138         by restoreSessionInternal()) can end up with the same identifier as HistoryItems for top frames.
139
140         This confusion would lead to the WebContent process sending the UIProcess bad information and the URL
141         of subframes could end up as the WebBackForwardListItem's mainframe URL.
142
143         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
144         (WebKit::applyFrameState):
145         Stop calling generateObjectIdentifier() explicitly and let the HistoryItem constructor take care of it.
146         Calling generateObjectIdentifier() for the same type from different places is not safe due to inlining.
147
148 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
149
150         Move FileSystem to WTF
151         https://bugs.webkit.org/show_bug.cgi?id=193602
152
153         Reviewed by Yusuke Suzuki.
154
155         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
156         * NetworkProcess/NetworkDataTaskBlob.h:
157         * NetworkProcess/NetworkProcess.cpp:
158         * NetworkProcess/cache/CacheStorageEngine.cpp:
159         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
160         * NetworkProcess/cache/NetworkCache.cpp:
161         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
162         * NetworkProcess/cache/NetworkCacheData.cpp:
163         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
164         * NetworkProcess/cache/NetworkCacheFileSystem.h:
165         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
166         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
167         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
168         * NetworkProcess/cache/NetworkCacheStorage.cpp:
169         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
170         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
171         * NetworkProcess/mac/NetworkProcessMac.mm:
172         * NetworkProcess/soup/NetworkProcessSoup.cpp:
173         * PluginProcess/unix/PluginProcessMainUnix.cpp:
174         * Shared/PersistencyUtils.cpp:
175         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
176         * Shared/Plugins/unix/PluginSearchPath.cpp:
177         * Shared/WebMemorySampler.h:
178         * Shared/glib/ProcessExecutablePathGLib.cpp:
179         * Shared/ios/ChildProcessIOS.mm:
180         * Shared/mac/ChildProcessMac.mm:
181         * Shared/mac/SandboxExtensionMac.mm:
182         * UIProcess/API/APIContentRuleListStore.cpp:
183         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
184         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
185         * UIProcess/API/glib/IconDatabase.cpp:
186         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
187         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
188         * UIProcess/API/glib/WebKitWebContext.cpp:
189         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
190         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
191         * UIProcess/Automation/WebAutomationSession.cpp:
192         * UIProcess/Cocoa/DownloadClient.mm:
193         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
194         * UIProcess/Cocoa/WebViewImpl.mm:
195         * UIProcess/DeviceIdHashSaltStorage.cpp:
196         * UIProcess/Downloads/DownloadProxy.cpp:
197         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
198         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
199         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
200         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
201         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
202         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
203         * UIProcess/ServiceWorkerProcessProxy.cpp:
204         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
205         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
206         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
207         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
208         * UIProcess/glib/WebProcessProxyGLib.cpp:
209         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
210         * UIProcess/gtk/WebProcessPoolGtk.cpp:
211         * UIProcess/ios/WKContentViewInteraction.mm:
212         * UIProcess/ios/forms/WKFileUploadPanel.mm:
213         * UIProcess/mac/WebPageProxyMac.mm:
214         * UIProcess/win/WebProcessPoolWin.cpp:
215         * UIProcess/win/WebView.cpp:
216         * UIProcess/wpe/WebProcessPoolWPE.cpp:
217         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
218         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
219         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
220         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
221         * WebProcess/Plugins/PluginProcessConnection.cpp:
222         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
223         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
224         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
225         * WebProcess/cocoa/WebProcessCocoa.mm:
226
227 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
228
229         Create "frame hosting" nodes for the scrolling tree
230         https://bugs.webkit.org/show_bug.cgi?id=193753
231
232         Reviewed by Antti Koivisto.
233
234         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
235         require the iframe's scrolling node to get reparented in a new ancestor, which requires
236         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
237
238         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
239         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
240         to provide a consistent parent node for the subframe's scrolling node.
241
242         This patch adds the node types, but does not instantiate them yet.
243
244         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
245         (ArgumentCoder<ScrollingStateFrameHostingNode>::encode):
246         (ArgumentCoder<ScrollingStateFrameHostingNode>::decode):
247         (WebKit::encodeNodeAndDescendants):
248         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
249         (WebKit::dump):
250         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
251         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
252         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
253         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
254         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
255         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
256
257 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
258
259         [Curl] Unreviewed build fix for r240292 and friends.
260
261         WinCairo test stability must be restored in subsequent patch.
262
263         * NetworkProcess/curl/NetworkProcessCurl.cpp:
264         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
265         (WebKit::NetworkProcess::setNetworkProxySettings):
266
267 2019-01-23  Commit Queue  <commit-queue@webkit.org>
268
269         Unreviewed, rolling out r240403.
270         https://bugs.webkit.org/show_bug.cgi?id=193757
271
272         "Causes multiple crashes on macOS port (probably used wrong
273         ENABLE macro)" (Requested by ddkilzer on #webkit).
274
275         Reverted changeset:
276
277         "[Curl] Unreviewed build fix for r240292 and friends."
278         https://trac.webkit.org/changeset/240403
279
280 2019-01-23  Ross Kirsling  <ross.kirsling@sony.com>
281
282         [Curl] Unreviewed build fix for r240292 and friends.
283
284         WinCairo test stability must be restored in subsequent patch.
285
286         * NetworkProcess/curl/NetworkProcessCurl.cpp:
287         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
288         (WebKit::NetworkProcess::setNetworkProxySettings):
289
290 2019-01-23  Alex Christensen  <achristensen@webkit.org>
291
292         Stop using NetworkProcess::singleton
293         https://bugs.webkit.org/show_bug.cgi?id=193700
294
295         Reviewed by Don Olmstead.
296
297         This replaces it with a NeverDestroyed<NetworkProcess> and paves the way for more interesting things.
298
299         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
300         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
301         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
302         * NetworkProcess/NetworkProcess.cpp:
303         (WebKit::NetworkProcess::NetworkProcess):
304         (WebKit::NetworkProcess::singleton): Deleted.
305         * NetworkProcess/NetworkProcess.h:
306         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
307         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
308         * NetworkProcess/win/NetworkProcessMainWin.cpp:
309         (WebKit::initializeChildProcess<WebKit::NetworkProcess>):
310         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
311         (WebKit::initializeChildProcess):
312         (WebKit::XPCServiceInitializer):
313
314 2019-01-23  Ryan Haddad  <ryanhaddad@apple.com>
315
316         Unreviewed, rolling out r240343.
317
318         Caused 4 PSON API test failures.
319
320         Reverted changeset:
321
322         "[PSON] Flash on back navigation on Mac"
323         https://bugs.webkit.org/show_bug.cgi?id=193716
324         https://trac.webkit.org/changeset/240343
325
326 2019-01-23  Chris Dumez  <cdumez@apple.com>
327
328         Deprecate API to limit the maximum number of WebProcesses
329         https://bugs.webkit.org/show_bug.cgi?id=193725
330         <rdar://problem/47464879>
331
332         Reviewed by Geoff Garen.
333
334         Deprecate API to limit the maximum number of WebProcesses and make it a no-op. It adds
335         complexity and is not safe (conflicts with PSON).
336
337         Add a new usesSingleWebProcess SPI to _WKProcessPoolConfiguration to be used by
338         Minibrowser / Safari in order to disable process per tab (can be useful for debugging).
339         Note that enabling the single WebProcess mode will disable PSON and process prewarming.
340
341         * UIProcess/API/APIProcessPoolConfiguration.cpp:
342         (API::ProcessPoolConfiguration::createWithLegacyOptions):
343         (API::ProcessPoolConfiguration::copy):
344         * UIProcess/API/APIProcessPoolConfiguration.h:
345         * UIProcess/API/C/WKContext.cpp:
346         (WKContextSetMaximumNumberOfProcesses):
347         (WKContextGetMaximumNumberOfProcesses):
348         * UIProcess/API/C/WKContext.h:
349         * UIProcess/API/Cocoa/WKProcessPool.mm:
350         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
351         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
352         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
353         (-[_WKProcessPoolConfiguration maximumProcessCount]):
354         (-[_WKProcessPoolConfiguration setMaximumProcessCount:]):
355         (-[_WKProcessPoolConfiguration usesSingleWebProcess]):
356         (-[_WKProcessPoolConfiguration setUsesSingleWebProcess:]):
357         (-[_WKProcessPoolConfiguration description]):
358         * UIProcess/API/glib/WebKitWebContext.cpp:
359         (webkitWebContextConstructed):
360         (webkit_web_context_set_process_model):
361         (webkit_web_context_set_web_process_count_limit):
362         * UIProcess/WebProcessPool.cpp:
363         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
364         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
365         (WebKit::WebProcessPool::processForNavigationInternal):
366         * UIProcess/WebProcessPool.h:
367
368 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
369
370         Switch NetworkStorageSession portions of ResourceLoadStatistics to Async message passing style
371         https://bugs.webkit.org/show_bug.cgi?id=193659
372         <rdar://problem/47433290>
373
374         Reviewed by Alex Christensen.
375
376         Change the implementations of ResourceLoadStatistics code in NetworkStorageSession to use the
377         'sendWithAsyncReply' so that more of the code is autogenerated. This should make test runs more
378         consistent, and should reduce the possibility of bookkeeping errors in the message handling
379         implementations.
380
381         Fix the implementation of NetworkProcessProxy::clearCallbackStates to remove the manually constructed
382         (and incomplete) message callbacks. These errors are a big reason to move to the auto-generated
383         'sendWithAsyncReply' implementatoin. Ditto for NetworkProcessProxy::didClose.
384
385         This patch also moves an initializaton call (WebsiteDataStore::didCreateNetworkProcess) from
386         'ensureNetworkProcess' to 'processDidFinishLaunching'. In current code, the call happens before
387         a connection is established to the network process, causing initialization messages to get dropped
388         leading to test system flakiness.
389
390         Finally: The WK API test code was updated to ensure that completion handlers are always called, even
391         when built without ENABLE_RESOURCE_LOAD_STATISTICS defined.
392
393         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
394         * NetworkProcess/Classifier/ShouldGrandfatherStatistics.h: Added.
395         * NetworkProcess/Classifier/StorageAccessStatus.h: Added.
396         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
397         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
398         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
399         * NetworkProcess/NetworkProcess.cpp:
400         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
401         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
402         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
403         (WebKit::NetworkProcess::hasStorageAccessForFrame):
404         (WebKit::NetworkProcess::requestStorageAccess):
405         (WebKit::NetworkProcess::grantStorageAccess):
406         (WebKit::NetworkProcess::removeAllStorageAccess):
407         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
408         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
409         (WebKit::NetworkProcess::deleteWebsiteData):
410         * NetworkProcess/NetworkProcess.h:
411         * NetworkProcess/NetworkProcess.messages.in:
412         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
413         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
414         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
415         (WKWebsiteDataStoreStatisticsResetToConsistentState):
416         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
417         * UIProcess/Network/NetworkProcessProxy.cpp:
418         (WebKit::NetworkProcessProxy::clearCallbackStates): Remove incomplete clean-up code that
419         is now autogenerated.
420         (WebKit::NetworkProcessProxy::didClose): Ditto.
421         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
422         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
423         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
424         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
425         (WebKit::NetworkProcessProxy::requestStorageAccess):
426         (WebKit::NetworkProcessProxy::grantStorageAccess):
427         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
428         (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
429         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
430         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
431         (WebKit::NetworkProcessProxy::didUpdateBlockCookies): Deleted.
432         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies): Deleted.
433         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings): Deleted.
434         (WebKit::NetworkProcessProxy::storageAccessRequestResult): Deleted.
435         (WebKit::NetworkProcessProxy::storageAccessOperationResult): Deleted.
436         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess): Deleted.
437         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources): Deleted.
438         * UIProcess/Network/NetworkProcessProxy.h:
439         * UIProcess/Network/NetworkProcessProxy.messages.in:
440         * UIProcess/WebPageProxy.cpp:
441         * UIProcess/WebProcessPool.cpp:
442         (WebKit::WebProcessPool::ensureNetworkProcess): Move WebsiteDataStore 'didCreateNetworkProcess'
443         to 'processDidFinishLaunching'. Currently the call happens before a connection is established,
444         causing initialization messages to get dropped.
445         (WebKit::WebProcessPool::processDidFinishLaunching): Ditto.
446         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
447         (WebKit::WebsiteDataStore::removeData):
448         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
449         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
450         (WebKit::WebsiteDataStore::setGrandfatheringTime):
451         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
452         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
453         (WebKit::WebsiteDataStore::setPrevalentResource):
454         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
455         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
456         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
457         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
458         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
459         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
460         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
461         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
462         * UIProcess/WebsiteData/WebsiteDataStore.h:
463         * WebKit.xcodeproj/project.pbxproj:
464
465 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
466
467         Clean up IndexedDB files between tests
468         https://bugs.webkit.org/show_bug.cgi?id=192796
469         <rdar://problem/46824999>
470
471         Reviewed by Geoffrey Garen.
472
473         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
474         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
475         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
476
477 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
478
479         [iOS] fast/events/touch/ios/hover-when-style-change-is-async.html times out
480         https://bugs.webkit.org/show_bug.cgi?id=193182
481         <rdar://problem/47452154>
482
483         Reviewed by Tim Horton.
484
485         Fix an existing bug where blurring an element doesn't always un-suppress text interactions.
486
487         * UIProcess/ios/WKContentViewInteraction.mm:
488         (-[WKContentView _elementDidBlur]):
489
490 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
491
492         Minor improvements to NetworkProcess
493         https://bugs.webkit.org/show_bug.cgi?id=193708
494
495         Reviewed by Alex Christensen.
496
497         * NetworkProcess/NetworkProcess.cpp:
498         (WebKit::NetworkProcess::switchToNewTestingSession): Fix a spelling error.
499         (WebKit::NetworkProcess::ensureSession): Add useful assertion.
500         (WebKit::NetworkProcess::defaultStorageSession const): Split into platform functions.
501         (WebKit::NetworkProcess::destroySession): Add useful assertion.
502         * NetworkProcess/NetworkProcess.h:
503         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
504         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
505         * NetworkProcess/curl/NetworkProcessCurl.cpp:
506         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
507         * NetworkProcess/soup/NetworkProcessSoup.cpp:
508         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
509
510 2019-01-23  Daniel Bates  <dabates@apple.com>
511
512         Fix the Apple Internal build. See <rdar://problem/47486758>.
513
514         * UIProcess/ios/WKContentViewInteraction.mm:
515         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
516
517 2019-01-23  Per Arne Vollan  <pvollan@apple.com>
518
519         [macOS] Sandbox fails to compile
520         https://bugs.webkit.org/show_bug.cgi?id=193727
521         <rdar://problem/47476903>
522
523         Reviewed by Brent Fulgham.
524
525         Use '(with send-signal SIGKILL)' instead of '(with termination)'.
526
527         * WebProcess/com.apple.WebProcess.sb.in:
528
529 2019-01-23  Brent Fulgham  <bfulgham@apple.com>
530
531         REGRESSION (r240243): CrashTracer: WebKitTestRunnerApp at com.apple.WebKit: WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const + 32
532         https://bugs.webkit.org/show_bug.cgi?id=193723
533         <rdar://problem/47476802>
534
535         Reviewed by David Kilzer.
536
537         The new code added in r240243 could attempt to submit telemetry after the relevant
538         WebResourceLoadStatisticsStore was destroyed. We should guard against this possibility.
539
540         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
541         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
542
543 2019-01-23  Antti Koivisto  <antti@apple.com>
544
545         [PSON] Flash on back navigation on Mac
546         https://bugs.webkit.org/show_bug.cgi?id=193716
547         <rdar://problem/47148458>
548
549         Reviewed by Chris Dumez.
550
551         We close the page immediately if we fail to suspend. Layers disappear and we get a flash.
552
553         * UIProcess/SuspendedPageProxy.cpp:
554         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
555
556         Remove the suspended page (so closing it on web process side) if the suspension fails.
557         Skip this if we are using web process side compositing on Mac.
558
559         * UIProcess/WebPageProxy.cpp:
560         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
561
562         On Mac, remove failed SuspendedPageProxy when entering compositing mode. At this point we don't need it to keep layers alive.
563
564         * UIProcess/WebProcessPool.cpp:
565         (WebKit::WebProcessPool::removeFailedSuspendedPagesForPage):
566         * UIProcess/WebProcessPool.h:
567         * WebProcess/WebPage/WebPage.cpp:
568         (WebKit::WebPage::suspendForProcessSwap):
569
570         Don't close the page on suspension failure.
571
572 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
573
574         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
575         https://bugs.webkit.org/show_bug.cgi?id=193706
576         <rdar://problem/44807048>
577
578         Reviewed by Ryosuke Niwa.
579
580         * UIProcess/Cocoa/WebViewImpl.mm:
581         (WebKit::WebViewImpl::registerEditCommand):
582         * UIProcess/WebEditCommandProxy.cpp:
583         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
584         * UIProcess/WebEditCommandProxy.h:
585
586         Drive-by tweak: make WebEditCommandProxy's backpointer to its WebPageProxy a WeakPtr instead of a raw pointer.
587         Additionally, call clear() instead of setting m_page to 0 upon invalidation. Also, turn the WebPageProxy*
588         argument into a WebPageProxy&, since the WebPageProxy must exist when it creates a new WebEditCommandProxy.
589
590         (WebKit::WebEditCommandProxy::create):
591         (WebKit::WebEditCommandProxy::label const):
592         (WebKit::WebEditCommandProxy::invalidate):
593         (WebKit::WebEditCommandProxy::editAction const): Deleted.
594
595         Adjust UI-side logic to just handle the undo/redo label, rather than map the edit action to a localized string.
596
597         * UIProcess/WebPageProxy.cpp:
598         (WebKit::WebPageProxy::registerEditCommandForUndo):
599         (WebKit::WebPageProxy::resetState):
600
601         Tweak this to use std::exchange instead of copying all the WebEditCommandProxy RefPtrs into a separate Vector
602         and then iterating over the Vector.
603
604         * UIProcess/WebPageProxy.h:
605         * UIProcess/WebPageProxy.messages.in:
606
607         Adjust this so that we only send the undo/redo label over IPC, rather than the edit action type.
608
609         * UIProcess/ios/PageClientImplIOS.mm:
610         (WebKit::PageClientImpl::registerEditCommand):
611         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
612         (WebKit::WebEditorClient::registerUndoStep):
613
614 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
615
616         [SOUP] Remove libsoup cruft from WebProcess
617         https://bugs.webkit.org/show_bug.cgi?id=193710
618
619         Reviewed by Carlos Garcia Campos.
620
621         SoupNetworkSession is no longer accessible from the web process because it's owned
622         (indirectly) by NetworkProcess after r240292. It doesn't make sense to have any libsoup
623         code under WebProcess anymore. The current libsoup code consists of (a) unused stuff to be
624         removed, (b) stuff unrelated to libsoup, which should move to a WebProcessGLib.cpp, and (c)
625         WebKitSoupRequestInputStream, which is only used by NetworkProcess and should move there
626
627         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.cpp.
628         (AsyncReadData::AsyncReadData):
629         (webkitSoupRequestInputStreamReadAsyncResultComplete):
630         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
631         (webkitSoupRequestInputStreamHasDataToRead):
632         (webkitSoupRequestInputStreamIsWaitingForData):
633         (webkitSoupRequestInputStreamReadAsync):
634         (webkitSoupRequestInputStreamReadFinish):
635         (webkitSoupRequestInputStreamFinalize):
636         (webkit_soup_request_input_stream_init):
637         (webkit_soup_request_input_stream_class_init):
638         (webkitSoupRequestInputStreamNew):
639         (webkitSoupRequestInputStreamAddData):
640         (webkitSoupRequestInputStreamDidFailWithError):
641         (webkitSoupRequestInputStreamFinished):
642         * NetworkProcess/soup/WebKitSoupRequestInputStream.h: Renamed from Source/WebKit/WebProcess/soup/WebKitSoupRequestInputStream.h.
643         * SourcesGTK.txt:
644         * SourcesWPE.txt:
645         * UIProcess/soup/WebProcessPoolSoup.cpp:
646         (WebKit::WebProcessPool::setNetworkProxySettings): Don't send message to web processes.
647         * WebProcess/WebProcess.h:
648         * WebProcess/WebProcess.messages.in:
649         * WebProcess/glib/WebProcessGLib.cpp: Renamed from Source/WebKit/WebProcess/soup/WebProcessSoup.cpp.
650         (WebKit::WebProcess::platformSetCacheModel):
651         (WebKit::WebProcess::platformInitializeWebProcess):
652         (WebKit::WebProcess::platformTerminate):
653
654 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
655
656         [SOUP] Clean up NetworkStorageSession
657         https://bugs.webkit.org/show_bug.cgi?id=193707
658
659         Reviewed by Carlos Garcia Campos.
660
661         Restore an important call to clearSoupNetworkSession that was removed in r240292. Also,
662         adapt to NetworkStorageSessions API changes.
663
664         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
665         (WebKit::LegacyCustomProtocolManager::registerScheme):
666         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
667         * NetworkProcess/soup/NetworkProcessSoup.cpp:
668         (WebKit::NetworkProcess::userPreferredLanguagesChanged):
669         (WebKit::NetworkProcess::setNetworkProxySettings):
670         * NetworkProcess/soup/NetworkSessionSoup.cpp:
671         (WebKit::NetworkSessionSoup::soupSession const):
672
673 2019-01-23  Philippe Normand  <pnormand@igalia.com>
674
675         [GTK] Crash when browsing inspector:// uri without port set
676         https://bugs.webkit.org/show_bug.cgi?id=193721
677
678         Reviewed by Michael Catanzaro.
679
680         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
681         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Return
682         back to caller after setting the error, if no port was provided
683         along with the inspector URL.
684
685 2019-01-23  David Kilzer  <ddkilzer@apple.com>
686
687         Switch remaining CoreMedia soft-linking in WebKit over to CoreMediaSoftLink.{cpp,h}
688         <https://webkit.org/b/193694>
689         <rdar://problem/47464025>
690
691         Reviewed by Tim Horton.
692
693         * Shared/ios/WebIconUtilities.mm:
694         - Switch to using CoreMediaSoftLink.{h,mm} in PAL.
695
696 2019-01-22  Chris Dumez  <cdumez@apple.com>
697
698         Regression(r240178) Some API tests are crashing
699         https://bugs.webkit.org/show_bug.cgi?id=193680
700
701         Reviewed by Alex Christensen.
702
703         r240178 made sure that userScripts / scriptMessageHandlers / contentExtensions are always
704         properly populated in the WebPageCreationParameters. This was needed in case we need to
705         reconstruct the WebUserContentController on the WebProcess side. However, this caused a
706         regression in the case we reuse a process where the WebUserContentController still exists
707         (because it was kept alive, e.g. by the WebPageGroup). In that case, we would add duplicate
708         entries to the existing WebUserContentController instance because its "add" methods did not
709         have duplicate checks. To address the issue, this patch adds duplicate checks to the
710         WebUserContentController "add" methods.
711
712         * WebProcess/UserContent/WebUserContentController.cpp:
713         (WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
714         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
715         (WebKit::WebUserContentController::addUserScriptInternal):
716         (WebKit::WebUserContentController::removeUserScriptInternal):
717         (WebKit::WebUserContentController::addUserStyleSheetInternal):
718         (WebKit::WebUserContentController::removeUserStyleSheetInternal):
719         (WebKit::WebUserContentController::forEachUserMessageHandler const):
720         * WebProcess/UserContent/WebUserContentController.h:
721
722 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
723
724         Unreviewed attempt to fix GTK/WPE bots
725         https://bugs.webkit.org/show_bug.cgi?id=193580
726         <rdar://problem/47457742>
727
728         Doesn't make sense to clear the storage session right after creating it. This should fix
729         network process crash on startup under G_DEBUG=fatal-criticals due to the storage session
730         not having a cookie jar.
731
732         * NetworkProcess/NetworkProcess.cpp:
733         (WebKit::NetworkProcess::NetworkProcess):
734
735 2019-01-22  Megan Gardner  <megan_gardner@apple.com>
736
737         Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
738         https://bugs.webkit.org/show_bug.cgi?id=193687
739         <rdar://problem/47056717>
740
741         Reviewed by Tim Horton.
742
743         Cancel web gestures when a long press is recognized.
744
745         * Platform/spi/ios/UIKitSPI.h:
746         * UIProcess/ios/WKContentViewInteraction.mm:
747         (-[WKContentView _cancelWebGestureRecognizer]):
748         (-[WKContentView _longPressRecognized:]):
749
750 2019-01-22  Alex Christensen  <achristensen@webkit.org>
751
752         Fix an internal build failure after r240292
753         https://bugs.webkit.org/show_bug.cgi?id=193580
754
755         Rubber-stamped by Wenson Hsieh.
756
757         * SourcesCocoa.txt:
758         * UIProcess/mac/WebContextMenuProxyMac.mm:
759         (-[WKMenuTarget forwardContextMenuAction:]):
760         * WebKit.xcodeproj/project.pbxproj:
761         It was apparently unclear to the compiler sometimes which "state" selector to use, and this apparently mattered.
762         Tell the compiler to use the NSMenuItem selector, but at runtime it doesn't matter.
763
764 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
765
766         Unreviewed, fix -Wunused-but-set-variable warning
767         https://bugs.webkit.org/show_bug.cgi?id=193660
768         <rdar://problem/47433602>
769
770         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
771         (WebKit::WebsiteDataStore::removeData):
772
773 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
774
775         Unreviewed, further build fixes after r240292
776         https://bugs.webkit.org/show_bug.cgi?id=193580
777         <rdar://problem/47457742>
778
779         Oops.
780
781         * NetworkProcess/NetworkProcess.cpp:
782         (WebKit::NetworkProcess::defaultStorageSession const):
783
784 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
785
786         Unreviewed, further build fixes after r240292
787         https://bugs.webkit.org/show_bug.cgi?id=193580
788         <rdar://problem/47457742>
789
790         This builds for libsoup. Doesn't work, but at least builds.
791
792         Also, speculative fixes for curl.
793
794         * NetworkProcess/NetworkProcess.cpp:
795         (WebKit::NetworkProcess::defaultStorageSession const):
796
797 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
798
799         Unreviewed, further build fixes after r240292
800         https://bugs.webkit.org/show_bug.cgi?id=193580
801         <rdar://problem/47457742>
802
803         Still not working yet.
804
805         * NetworkProcess/NetworkProcess.cpp:
806         (WebKit::NetworkProcess::NetworkProcess):
807         * UIProcess/API/APIHTTPCookieStore.h:
808
809 2019-01-22  Antti Koivisto  <antti@apple.com>
810
811         [iOS] Flash when swiping back to Google search result page
812         https://bugs.webkit.org/show_bug.cgi?id=193668
813         <rdar://problem/47071684>
814
815         Reviewed by Simon Fraser.
816
817         If the google page is scrolled, there is sometimes a short flash.
818
819         When restoring the page state we also restore exposedContentRect which is used to determine
820         which part of the page to create layers for. Scroll position is restored by the UI process
821         later so we rely on this to get the right layers for the initial view update.
822
823         A viewport configuration update may sometimes trample over the restored exposedContentRect,
824         moving it to top left. In this case the initial layer tree unfreeze commit may not have
825         layers to cover the actual visible view position.
826
827         * WebProcess/WebPage/WebPage.cpp:
828         (WebKit::WebPage::didCommitLoad):
829         * WebProcess/WebPage/WebPage.h:
830         * WebProcess/WebPage/ios/WebPageIOS.mm:
831         (WebKit::WebPage::restorePageState):
832
833         Set a bit to indicate we have already restored the exposedContentRect.
834
835         (WebKit::WebPage::viewportConfigurationChanged):
836
837         Only reset exposedContentRect if wasn't already set by restorePageState.
838
839 2019-01-22  Alex Christensen  <achristensen@webkit.org>
840
841         Fix more builds.
842
843         * SourcesCocoa.txt:
844         * WebKit.xcodeproj/project.pbxproj:
845
846 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
847
848         Another build fix after r240292
849         https://bugs.webkit.org/show_bug.cgi?id=193580
850         <rdar://problem/47457742>
851
852         Unreviewed, still not enough to fix soup builds, but closer.
853
854         * UIProcess/API/APIHTTPCookieStore.h:
855
856 2019-01-22  Alex Christensen  <achristensen@webkit.org>
857
858         Fix some builds after r240292
859         https://bugs.webkit.org/show_bug.cgi?id=193580
860
861         * NetworkProcess/NetworkProcess.cpp:
862         (WebKit::NetworkProcess::switchToNewTestingSession):
863         * NetworkProcess/cache/NetworkCache.cpp:
864         (WebKit::NetworkCache::Cache::retrieve):
865
866 2019-01-22  Brian Burg  <bburg@apple.com>
867
868         Automation.computeElementLayout should return visual viewport-aware coordinates
869         https://bugs.webkit.org/show_bug.cgi?id=193598
870         <rdar://problem/35325644>
871
872         Unreviewed, restore a mistakenly-deleted line whose absence causes hangs.
873
874         * Shared/CoordinateSystem.h:
875
876 2019-01-22  Alex Christensen  <achristensen@webkit.org>
877
878         Move NetworkStorageSession ownership to NetworkProcess
879         https://bugs.webkit.org/show_bug.cgi?id=193580
880
881         Reviewed by Geoff Garen.
882
883         * NetworkProcess/Cookies/WebCookieManager.cpp:
884         (WebKit::WebCookieManager::WebCookieManager):
885         (WebKit::WebCookieManager::getHostnamesWithCookies):
886         (WebKit::WebCookieManager::deleteCookiesForHostname):
887         (WebKit::WebCookieManager::deleteAllCookies):
888         (WebKit::WebCookieManager::deleteCookie):
889         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
890         (WebKit::WebCookieManager::getAllCookies):
891         (WebKit::WebCookieManager::getCookies):
892         (WebKit::WebCookieManager::setCookie):
893         (WebKit::WebCookieManager::setCookies):
894         (WebKit::WebCookieManager::startObservingCookieChanges):
895         (WebKit::WebCookieManager::stopObservingCookieChanges):
896         * NetworkProcess/Cookies/WebCookieManager.h:
897         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
898         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
899         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
900         (WebKit::storageSession):
901         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
902         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
903         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
904         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
905         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
906         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
907         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
908         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
909         * NetworkProcess/NetworkProcess.cpp:
910         (WebKit::NetworkProcess::initializeNetworkProcess):
911         (WebKit::NetworkProcess::clearCachedCredentials):
912         (WebKit::NetworkProcess::switchToNewTestingSession):
913         (WebKit::NetworkProcess::ensureSession):
914         (WebKit::NetworkProcess::storageSession const):
915         (WebKit::NetworkProcess::defaultStorageSession const):
916         (WebKit::NetworkProcess::forEachNetworkStorageSession):
917         (WebKit::NetworkProcess::destroySession):
918         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
919         (WebKit::NetworkProcess::setAgeCapForClientSideCookies):
920         (WebKit::NetworkProcess::hasStorageAccessForFrame):
921         (WebKit::NetworkProcess::getAllStorageAccessEntries):
922         (WebKit::NetworkProcess::grantStorageAccess):
923         (WebKit::NetworkProcess::removeAllStorageAccess):
924         (WebKit::NetworkProcess::removePrevalentDomains):
925         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
926         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
927         (WebKit::NetworkProcess::fetchWebsiteData):
928         (WebKit::NetworkProcess::deleteWebsiteData):
929         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
930         * NetworkProcess/NetworkProcess.h:
931         * NetworkProcess/NetworkResourceLoader.cpp:
932         (WebKit::NetworkResourceLoader::validateCacheEntryForMaxAgeCapValidation):
933         (WebKit::NetworkResourceLoader::logCookieInformation const):
934         * NetworkProcess/NetworkSession.cpp:
935         (WebKit::NetworkSession::networkStorageSession const):
936         * NetworkProcess/NetworkStorageSessionProvider.h:
937         * NetworkProcess/cache/NetworkCache.cpp:
938         (WebKit::NetworkCache::makeUseDecision):
939         (WebKit::NetworkCache::Cache::retrieve):
940         (WebKit::NetworkCache::Cache::makeEntry):
941         (WebKit::NetworkCache::Cache::makeRedirectEntry):
942         (WebKit::NetworkCache::Cache::update):
943         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
944         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
945         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
946         (WebKit::NetworkProcess::platformSyncAllCookies):
947         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
948         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
949         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
950         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
951         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
952         * NetworkProcess/mac/RemoteNetworkingContext.mm:
953         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
954         * SourcesCocoa.txt:
955         * UIProcess/API/APIHTTPCookieStore.cpp:
956         (API::HTTPCookieStore::~HTTPCookieStore):
957         (API::HTTPCookieStore::cookies):
958         (API::HTTPCookieStore::setCookie):
959         (API::HTTPCookieStore::deleteCookie):
960         (API::HTTPCookieStore::registerObserver):
961         (API::HTTPCookieStore::unregisterObserver):
962         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
963         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
964         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
965         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
966         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
967         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
968         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
969         * UIProcess/API/APIHTTPCookieStore.h:
970         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: Added.
971         (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
972         (API::HTTPCookieStore::getAllDefaultUIProcessCookieStoreCookies):
973         (API::HTTPCookieStore::setCookieInDefaultUIProcessCookieStore):
974         (API::HTTPCookieStore::deleteCookieFromDefaultUIProcessCookieStore):
975         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
976         (API::HTTPCookieStore::stopObservingChangesToDefaultUIProcessCookieStore):
977         * UIProcess/WebProcessPool.cpp:
978         (WebKit::WebProcessPool::clearCachedCredentials):
979         * WebKit.xcodeproj/project.pbxproj:
980         * WebProcess/Plugins/PluginView.cpp:
981         (WebKit::PluginView::getAuthenticationInfo):
982         * WebProcess/WebProcess.cpp:
983         (WebKit::WebProcess::deleteWebsiteData):
984         (WebKit::WebProcess::clearCachedCredentials): Deleted.
985         * WebProcess/WebProcess.h:
986         * WebProcess/WebProcess.messages.in:
987
988 2019-01-22  Per Arne Vollan  <pvollan@apple.com>
989
990         [macOS] Adjust logging policy in WebKit's sandbox
991         https://bugs.webkit.org/show_bug.cgi?id=193454
992
993         Reviewed by Brent Fulgham.
994
995         Add a rule to initially deny all calls, since the default is to allow every call.
996         Later rules allow syscalls that we determined are needed for proper WebKit function.
997         This reduces the API surface available to attackers.
998
999         * WebProcess/com.apple.WebProcess.sb.in:
1000
1001 2019-01-22  Daniel Bates  <dabates@apple.com>
1002
1003         [iOS] WebKit should handle shift state changes when using the software keyboard
1004         https://bugs.webkit.org/show_bug.cgi?id=191475
1005         <rdar://problem/45949246>
1006
1007         Reviewed by Brent Fulgham.
1008
1009         Implement UIKit SPI to be notified of shift state changes to the software keyboard
1010         and dispatch a synthetic keydown or keyup event for either the Shift key or Caps Lock
1011         key.
1012
1013         A side benefit of this change is that we now show and hide the caps lock indicator
1014         in a focused password field when caps lock is enabled or disabled using the software
1015         keyboard, respectively.
1016
1017         * Platform/spi/ios/UIKitSPI.h: Expose more SPI.
1018         * SourcesCocoa.txt:
1019         * UIProcess/ios/WKContentViewInteraction.mm:
1020         (-[WKContentView modifierFlagsDidChangeFrom:to:]): Create a synthetic flags changed
1021         web event based on the state change and dispatch it.
1022         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Early return if the event
1023         was a synethic flags change event so that we do not notify UIKit about this event
1024         as it does not know anything about such synthetic events.
1025         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.h: Added.
1026         * UIProcess/ios/WKSyntheticFlagsChangedWebEvent.mm: Added.
1027         (-[WKSyntheticFlagsChangedWebEvent initWithKeyCode:modifiers:keyDown:]):
1028         (-[WKSyntheticFlagsChangedWebEvent initWithCapsLockState:]):
1029         (-[WKSyntheticFlagsChangedWebEvent initWithShiftState:]):
1030         * WebKit.xcodeproj/project.pbxproj:
1031
1032 2019-01-22  Daniel Bates  <dabates@apple.com>
1033
1034         [iOS] Interpret text key commands on keydown and app key commands on keypress
1035         https://bugs.webkit.org/show_bug.cgi?id=192897
1036         <rdar://problem/46857378>
1037
1038         Reviewed by Brent Fulgham.
1039
1040         Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent
1041         is false) and keypress (isCharEvent is true), respectively.
1042
1043         * Platform/spi/ios/UIKitSPI.h: Add more SPI.
1044         * UIProcess/ios/WKContentViewInteraction.mm:
1045         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1046
1047 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1048
1049         C strings in ClientCertificateAuthenticationXPCConstants.h are duplicated
1050         <https://webkit.org/b/193607>
1051         <rdar://problem/47334613>
1052
1053         Reviewed by Alex Christensen.
1054
1055         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
1056         (WebKit::AuthenticationManager::initializeConnection):
1057         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
1058         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
1059         - Update name of constants.
1060
1061         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.cpp: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
1062         * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
1063         - Put constant values in a namespace, and move values to
1064           ClientCertificateAuthenticationXPCConstants.cpp.
1065
1066         * SourcesCocoa.txt:
1067         * UnifiedSources-input.xcfilelist:
1068         * WebKit.xcodeproj/project.pbxproj:
1069         - Add ClientCertificateAuthenticationXPCConstants.cpp.
1070
1071 2019-01-22  David Kilzer  <ddkilzer@apple.com>
1072
1073         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
1074         <https://webkit.org/b/193654>
1075         <rdar://problem/47430290>
1076
1077         Reviewed by Alex Christensen.
1078
1079         - Moves QuickLookSoftLink.{h,mm} to PAL.
1080         - Adds soft-link to 3 classes to consolidate QuickLook.framework
1081           soft-linking.
1082         - Updates existing source to work with above changes.
1083
1084         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1085         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
1086         (WebKit::SystemPreviewController::start):
1087         * UIProcess/ios/WKSystemPreviewView.mm:
1088         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
1089         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
1090
1091 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
1092
1093         [css-logical] Implement flow-relative margin, padding and border shorthands
1094         https://bugs.webkit.org/show_bug.cgi?id=188697
1095
1096         Reviewed by Simon Fraser and Antti Koivisto.
1097
1098         Add a CSSLogicalEnabled runtime flag.
1099
1100         * Shared/WebPreferences.yaml:
1101
1102 2019-01-22  Frederic Wang  <fwang@igalia.com>
1103
1104         Enable CSSOMViewScrollingAPI
1105         https://bugs.webkit.org/show_bug.cgi?id=189472
1106
1107         Reviewed by Simon Fraser.
1108
1109         This patch enables the CSSOMViewScrollingAPI option by default. This feature has already been
1110         enabled in tests since r235855. Basically, this change fixes an old compatibility issue
1111         regarding which scrolling element correspond to the viewport in standard mode (WebKit uses
1112         document.body while Gecko/Edge/Chromium use document.documentElement as described in the
1113         CSSOM View specification). WebKit developers writing tests can use document.scrollingElement
1114         for that purpose, so that they work independently of whether the option is enabled.
1115
1116         [1] https://lists.webkit.org/pipermail/webkit-dev/2018-January/029857.html
1117
1118         * Shared/WebPreferences.yaml: Enable by default and remove "experimental" category in
1119         accordance with the new policy. Instead, keep an internal flag only for developers.
1120
1121 2019-01-21  Antti Koivisto  <antti@apple.com>
1122
1123         [iOS] Handle hit testing for subframes
1124         https://bugs.webkit.org/show_bug.cgi?id=192303
1125
1126         Reviewed by Frédéric Wang.
1127
1128         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1129         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1130
1131         Only set delegatesScrolling for the main frame.
1132
1133 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1134
1135         Unreviewed test fix after r240243
1136         Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
1137         <rdar://problem/47433602>
1138
1139         The new ResourceLoadStatistics section of 'removeData' was incrementing the
1140         pending callback count before deciding whether to send a message to delete
1141         data. This left the count out-of-balance leading to the operation never
1142         completing.
1143
1144         This patch also prevents sending a second message to the NetworkProcess
1145         requesting data be deleted if the message was already sent in an earlier
1146         section of the method (e.g., as typically happens when all website data
1147         is being deleted).
1148
1149         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1150         (WebKit::WebsiteDataStore::removeData):
1151
1152 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
1153
1154         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
1155         https://bugs.webkit.org/show_bug.cgi?id=193556
1156         <rdar://problem/47368501>
1157
1158         Reviewed by Alex Christensen.
1159
1160         This patch adds a number of sibling methods for tracking ResourceLoadStatistics when the
1161         observations are being handled in the NetworkProcess, rather than the UIProcess. The
1162         original versions of these methods will be removed as part of Bug 193303.
1163
1164         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1165         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1166         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
1167         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
1168         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1169         (WebKit::ResourceLoadStatisticsMemoryStore::store const):
1170         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1171         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
1172         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured):
1173         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1174         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1175         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
1176         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1177         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
1178         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1179         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1180         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1181         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1182         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1183         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1184         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1185         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1186         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1187         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
1188         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
1189         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
1190         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1191         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1192         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1193         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1194         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1195         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1196         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
1197         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
1198         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
1199         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1200         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
1201         (WebKit::WebResourceLoadStatisticsStore::notifyResourceLoadStatisticsProcessed):
1202         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1203         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData):
1204         (WebKit::WebResourceLoadStatisticsStore::sendDiagnosticMessageWithValue const):
1205         (WebKit::WebResourceLoadStatisticsStore::notifyPageStatisticsTelemetryFinished const):
1206         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1207         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1208         (WebKit::submitTopList):
1209         (WebKit::submitTopLists):
1210         (WebKit::notifyPages):
1211         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1212         (WebKit::nonEphemeralWebPageProxy): Deleted.
1213         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1214         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1215         * NetworkProcess/NetworkConnectionToWebProcess.h:
1216         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1217         * NetworkProcess/NetworkProcess.cpp:
1218         (WebKit::NetworkProcess::dumpResourceLoadStatistics):
1219         (WebKit::NetworkProcess::isGrandfathered):
1220         (WebKit::NetworkProcess::isPrevalentResource):
1221         (WebKit::NetworkProcess::isVeryPrevalentResource):
1222         (WebKit::NetworkProcess::setGrandfathered):
1223         (WebKit::NetworkProcess::setPrevalentResource):
1224         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
1225         (WebKit::NetworkProcess::setVeryPrevalentResource):
1226         (WebKit::NetworkProcess::clearPrevalentResource):
1227         (WebKit::NetworkProcess::submitTelemetry):
1228         (WebKit::NetworkProcess::scheduleCookieBlockingUpdate):
1229         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
1230         (WebKit::NetworkProcess::resetParametersToDefaultValues):
1231         (WebKit::NetworkProcess::scheduleStatisticsAndDataRecordsProcessing):
1232         (WebKit::NetworkProcess::setNotifyPagesWhenDataRecordsWereScanned):
1233         (WebKit::NetworkProcess::setNotifyPagesWhenTelemetryWasCaptured):
1234         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
1235         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
1236         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
1237         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
1238         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
1239         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
1240         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
1241         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
1242         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
1243         (WebKit::NetworkProcess::setLastSeen):
1244         (WebKit::NetworkProcess::hasStorageAccess):
1245         (WebKit::NetworkProcess::requestStorageAccess):
1246         (WebKit::NetworkProcess::grantStorageAccess):
1247         (WebKit::NetworkProcess::logUserInteraction):
1248         (WebKit::NetworkProcess::hadUserInteraction):
1249         (WebKit::NetworkProcess::clearUserInteraction):
1250         (WebKit::NetworkProcess::setGrandfatheringTime):
1251         (WebKit::NetworkProcess::setMaxStatisticsEntries):
1252         (WebKit::NetworkProcess::setMinimumTimeBetweenDataRecordsRemoval):
1253         (WebKit::NetworkProcess::setPruneEntriesDownTo):
1254         (WebKit::NetworkProcess::setTimeToLiveUserInteraction):
1255         (WebKit::NetworkProcess::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1256         (WebKit::NetworkProcess::setResourceLoadStatisticsEnabled):
1257         (WebKit::NetworkProcess::setResourceLoadStatisticsDebugMode):
1258         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
1259         (WebKit::NetworkProcess::deleteWebsiteData):
1260         (WebKit::filterForTopLevelDomains):
1261         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1262         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData):
1263         * NetworkProcess/NetworkProcess.h:
1264         * NetworkProcess/NetworkProcess.messages.in:
1265         * NetworkProcess/NetworkSession.cpp:
1266         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
1267         (WebKit::NetworkSession::notifyResourceLoadStatisticsProcessed):
1268         (WebKit::NetworkSession::logDiagnosticMessageWithValue):
1269         (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
1270         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1271         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData):
1272         (WebKit::NetworkSession::enableResourceLoadStatistics): Deleted.
1273         * NetworkProcess/NetworkSession.h:
1274         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1275         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1276         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1277         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
1278         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
1279         (WKWebsiteDataStoreSetStatisticsLastSeen):
1280         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1281         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1282         (WKWebsiteDataStoreDumpResourceLoadStatistics):
1283         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1284         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1285         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
1286         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1287         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1288         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1289         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1290         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1291         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1292         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1293         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1294         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1295         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
1296         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
1297         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
1298         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1299         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1300         (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
1301         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1302         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1303         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1304         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1305         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1306         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1307         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1308         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1309         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1310         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1311         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1312         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1313         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
1314         * UIProcess/Network/NetworkProcessProxy.cpp:
1315         (WebKit::NetworkProcessProxy::clearCallbackStates):
1316         (WebKit::NetworkProcessProxy::didClose):
1317         (WebKit::nonEphemeralWebPageProxy):
1318         (WebKit::NetworkProcessProxy::logGlobalDiagnosticMessageWithValue):
1319         (WebKit::NetworkProcessProxy::dumpResourceLoadStatistics):
1320         (WebKit::NetworkProcessProxy::didDumpResourceLoadStatistics):
1321         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1322         (WebKit::NetworkProcessProxy::didUpdateBlockCookies):
1323         (WebKit::NetworkProcessProxy::isPrevalentResource):
1324         (WebKit::NetworkProcessProxy::isPrevalentResourceResult):
1325         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1326         (WebKit::NetworkProcessProxy::setPrevalentResource):
1327         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1328         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1329         (WebKit::NetworkProcessProxy::didSetResourceLoadStatisticData):
1330         (WebKit::NetworkProcessProxy::setLastSeen):
1331         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1332         (WebKit::NetworkProcessProxy::scheduleCookieBlockingUpdate):
1333         (WebKit::NetworkProcessProxy::didScheduleCookieBlockingUpdate):
1334         (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent):
1335         (WebKit::NetworkProcessProxy::didScheduleStatisticsProcessing):
1336         (WebKit::NetworkProcessProxy::scheduleStatisticsAndDataRecordsProcessing):
1337         (WebKit::NetworkProcessProxy::logUserInteraction):
1338         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1339         (WebKit::NetworkProcessProxy::didHaveUserInteraction):
1340         (WebKit::NetworkProcessProxy::clearUserInteraction):
1341         (WebKit::NetworkProcessProxy::setAgeCapForClientSideCookies):
1342         (WebKit::NetworkProcessProxy::didSetAgeCapForClientSideCookies):
1343         (WebKit::NetworkProcessProxy::setTimeToLiveUserInteraction):
1344         (WebKit::NetworkProcessProxy::didUpdateRuntimeSettings):
1345         (WebKit::NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured):
1346         (WebKit::NetworkProcessProxy::setNotifyPagesWhenDataRecordsWereScanned):
1347         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
1348         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1349         (WebKit::NetworkProcessProxy::didIsRegisteredAsRedirectingTo):
1350         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1351         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubFrameUnder):
1352         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
1353         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1354         (WebKit::NetworkProcessProxy::didIsRegisteredAsSubresourceUnder):
1355         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1356         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1357         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1358         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1359         (WebKit::NetworkProcessProxy::isGrandfathered):
1360         (WebKit::NetworkProcessProxy::didIsGrandfathered):
1361         (WebKit::NetworkProcessProxy::setGrandfathered):
1362         (WebKit::NetworkProcessProxy::hasStorageAccess):
1363         (WebKit::NetworkProcessProxy::requestStorageAccess):
1364         (WebKit::NetworkProcessProxy::grantStorageAccess):
1365         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
1366         (WebKit::NetworkProcessProxy::storageAccessOperationResult):
1367         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
1368         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
1369         (WebKit::NetworkProcessProxy::setCacheMaxAgeCap):
1370         (WebKit::NetworkProcessProxy::setGrandfatheringTime):
1371         (WebKit::NetworkProcessProxy::setMaxStatisticsEntries):
1372         (WebKit::NetworkProcessProxy::setMinimumTimeBetweenDataRecordsRemoval):
1373         (WebKit::NetworkProcessProxy::setPruneEntriesDownTo):
1374         (WebKit::NetworkProcessProxy::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1375         (WebKit::NetworkProcessProxy::setResourceLoadStatisticsDebugMode):
1376         (WebKit::NetworkProcessProxy::resetParametersToDefaultValues):
1377         (WebKit::NetworkProcessProxy::submitTelemetry):
1378         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsProcessed):
1379         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
1380         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
1381         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
1382         (WebKit::NetworkProcessProxy::didLogUserInteraction): Deleted.
1383         (WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources): Deleted.
1384         * UIProcess/Network/NetworkProcessProxy.h:
1385         * UIProcess/Network/NetworkProcessProxy.messages.in:
1386         * UIProcess/WebPageProxy.cpp:
1387         (WebKit::WebPageProxy::nonEphemeralWebPageProxy):
1388         * UIProcess/WebPageProxy.h:
1389         * UIProcess/WebProcessPool.cpp:
1390         (WebKit::WebProcessPool::ensureNetworkProcess):
1391         * UIProcess/WebProcessProxy.cpp:
1392         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished):
1393         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished):
1394         * UIProcess/WebProcessProxy.h:
1395         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1396         (WebKit::WebsiteDataStore::parameters):
1397         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1398         (WebKit::WebsiteDataStore::removeData):
1399         (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
1400         (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
1401         (WebKit::WebsiteDataStore::setGrandfatheringTime):
1402         (WebKit::WebsiteDataStore::setCacheMaxAgeCap):
1403         (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
1404         (WebKit::WebsiteDataStore::dumpResourceLoadStatistics):
1405         (WebKit::WebsiteDataStore::isPrevalentResource):
1406         (WebKit::WebsiteDataStore::setPrevalentResource):
1407         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
1408         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
1409         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
1410         (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1411         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
1412         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
1413         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
1414         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
1415         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
1416         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
1417         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
1418         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
1419         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
1420         (WebKit::WebsiteDataStore::clearPrevalentResource):
1421         (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
1422         (WebKit::WebsiteDataStore::submitTelemetry):
1423         (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
1424         (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
1425         (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
1426         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
1427         (WebKit::WebsiteDataStore::setAgeCapForClientSideCookies):
1428         (WebKit::WebsiteDataStore::setLastSeen):
1429         (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
1430         (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
1431         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
1432         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
1433         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
1434         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
1435         (WebKit::WebsiteDataStore::removePrevalentDomains):
1436         (WebKit::WebsiteDataStore::hasStorageAccess):
1437         (WebKit::WebsiteDataStore::requestStorageAccess):
1438         (WebKit::WebsiteDataStore::grantStorageAccess):
1439         (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
1440         (WebKit::WebsiteDataStore::logUserInteraction):
1441         (WebKit::WebsiteDataStore::hasHadUserInteraction):
1442         (WebKit::WebsiteDataStore::clearUserInteraction):
1443         (WebKit::WebsiteDataStore::isGrandfathered):
1444         (WebKit::WebsiteDataStore::setGrandfathered):
1445         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
1446         (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
1447         (WebKit::WebsiteDataStore::webPageWasAdded):
1448         (WebKit::WebsiteDataStore::webPageWasInvalidated):
1449         (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
1450         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
1451         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
1452         (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
1453         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
1454         (WebKit::WebsiteDataStore::processPools const):
1455         (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled const):
1456         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
1457         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1458         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1459         (WebKit::WebsiteDataStore::logTestingEvent):
1460         * UIProcess/WebsiteData/WebsiteDataStore.h:
1461         (WebKit::WebsiteDataStore::setStatisticsTestingCallback):
1462         * WebProcess/WebProcess.cpp:
1463         (WebKit::WebProcess::initializeWebProcess):
1464
1465 2019-01-15  Darin Adler  <darin@apple.com>
1466
1467         Use references rather than pointers for register/unregister functions, and more
1468         https://bugs.webkit.org/show_bug.cgi?id=175028
1469
1470         Reviewed by Daniel Bates.
1471
1472         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1473         (WebKit::WebFullScreenManager::willEnterFullScreen): Update for change to the
1474         functions in Document; pass a reference.
1475         (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto, don't pass the element.
1476         (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
1477         (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
1478
1479         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1480         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): Pass a reference.
1481         (WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto.
1482         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto.
1483         * WebProcess/Plugins/PluginView.cpp:
1484         (WebKit::PluginView::~PluginView): Ditto.
1485         (WebKit::PluginView::initializePlugin): Ditto.
1486
1487 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1488
1489         Unreviewed, fix -Wreturn-type warning
1490         https://bugs.webkit.org/show_bug.cgi?id=193333
1491         <rdar://problem/45649489>
1492
1493         * UIProcess/Automation/WebAutomationSession.cpp:
1494         (WebKit::toProtocol):
1495
1496 2019-01-20  chris fleizach  <cfleizach@apple.com>
1497
1498         AX: Support returning relative frames for accessibility
1499         https://bugs.webkit.org/show_bug.cgi?id=193414
1500         <rdar://problem/47268501>
1501
1502         Reviewed by Zalan Bujtas.
1503
1504         * UIProcess/API/Cocoa/WKWebView.mm:
1505         (-[WKWebView accessibilityAttributeValue:forParameter:]):
1506         (-[WKWebView IGNORE_WARNINGS_END]):
1507         * UIProcess/API/mac/WKView.mm:
1508         (-[WKView accessibilityAttributeValue:forParameter:]):
1509         (-[WKView IGNORE_WARNINGS_END]):
1510         * UIProcess/Cocoa/WebViewImpl.h:
1511         * UIProcess/Cocoa/WebViewImpl.mm:
1512         (WebKit::WebViewImpl::accessibilityAttributeValue):
1513         * UIProcess/ios/WKContentView.mm:
1514         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
1515
1516 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1517
1518         Unreviewed, rolling out r240209.
1519
1520         Broke GTK/WPE injected bundle
1521
1522         Reverted changeset:
1523
1524         "AX: Support returning relative frames for accessibility"
1525         https://bugs.webkit.org/show_bug.cgi?id=193414
1526         https://trac.webkit.org/changeset/240209
1527
1528 2019-01-12  Dan Bernstein  <mitz@apple.com>
1529
1530         [Cocoa] Avoid importing directly from subumbrella frameworks
1531         https://bugs.webkit.org/show_bug.cgi?id=186016
1532         <rdar://problem/40591038>
1533
1534         Reviewed by Sam Weinig.
1535
1536         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
1537           OTHER_CPLUSPLUSFLAGS.
1538         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
1539           HIToolbox header.
1540         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
1541         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
1542         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
1543           header.
1544         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
1545           PDFKit header.
1546         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
1547         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
1548         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
1549         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
1550         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
1551         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
1552         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
1553
1554 2019-01-20  chris fleizach  <cfleizach@apple.com>
1555
1556         AX: Support returning relative frames for accessibility
1557         https://bugs.webkit.org/show_bug.cgi?id=193414
1558         <rdar://problem/47268501>
1559
1560         Reviewed by Zalan Bujtas.
1561
1562         * UIProcess/API/Cocoa/WKWebView.mm:
1563         (-[WKWebView accessibilityAttributeValue:forParameter:]):
1564         (-[WKWebView IGNORE_WARNINGS_END]):
1565         * UIProcess/API/mac/WKView.mm:
1566         (-[WKView accessibilityAttributeValue:forParameter:]):
1567         (-[WKView IGNORE_WARNINGS_END]):
1568         * UIProcess/Cocoa/WebViewImpl.h:
1569         * UIProcess/Cocoa/WebViewImpl.mm:
1570         (WebKit::WebViewImpl::accessibilityAttributeValue):
1571         * UIProcess/ios/WKContentView.mm:
1572         (-[WKContentView accessibilityConvertRelativeFrameFromPage:]):
1573
1574 2019-01-20  Antoine Quint  <graouts@apple.com>
1575
1576         Add a POINTER_EVENTS feature flag
1577         https://bugs.webkit.org/show_bug.cgi?id=193577
1578         <rdar://problem/47408511>
1579
1580         Unreviewed. Also enable Pointer Events for iosmac.
1581
1582         * Configurations/FeatureDefines.xcconfig:
1583
1584 2019-01-19  David Kilzer  <ddkilzer@apple.com>
1585
1586         Follow-up: iOS: Updating input mode should update the software keyboard
1587         <https://bugs.webkit.org/show_bug.cgi?id=193565>
1588         <rdar://problem/47376334>
1589
1590         * WebProcess/WebPage/WebPage.cpp:
1591         (WebKit::WebPage::focusedElementDidChangeInputMode): Fix iOS
1592         Debug builds after r240199 by downcasting `element` to
1593         `HTMLElement` before calling canonicalInputMode().
1594
1595 2019-01-19  David Kilzer  <ddkilzer@apple.com>
1596
1597         Sort WebKit Xcode project file
1598
1599         * WebKit.xcodeproj/project.pbxproj:
1600
1601 2019-01-19  Antoine Quint  <graouts@apple.com>
1602
1603         Add a POINTER_EVENTS feature flag
1604         https://bugs.webkit.org/show_bug.cgi?id=193577
1605
1606         Reviewed by Dean Jackson.
1607
1608         * Configurations/FeatureDefines.xcconfig:
1609
1610 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
1611
1612         iOS: Updating input mode should update the software keyboard
1613         https://bugs.webkit.org/show_bug.cgi?id=193565
1614         <rdar://problem/47376334>
1615
1616         Reviewed by Wenson Hsieh.
1617
1618         Update the software keyboard when the inputmode content attribute on the focused element had been mutated.
1619
1620         * Scripts/webkit/messages.py:
1621         * Shared/WebCoreArgumentCoders.h:
1622         * UIProcess/PageClient.h:
1623         * UIProcess/WebPageProxy.h:
1624         * UIProcess/WebPageProxy.messages.in:
1625         * UIProcess/ios/PageClientImplIOS.h:
1626         * UIProcess/ios/PageClientImplIOS.mm:
1627         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
1628         * UIProcess/ios/WKContentViewInteraction.h:
1629         * UIProcess/ios/WKContentViewInteraction.mm:
1630         (-[WKContentView _didUpdateInputMode:]):
1631         * UIProcess/ios/WebPageProxyIOS.mm:
1632         (WebKit::WebPageProxy::focusedElementDidChangeInputMode):
1633         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1634         (WebKit::WebChromeClient::focusedElementDidChangeInputMode):
1635         * WebProcess/WebCoreSupport/WebChromeClient.h:
1636         * WebProcess/WebPage/WebPage.cpp:
1637         (WebKit::WebPage::focusedElementDidChangeInputMode):
1638         * WebProcess/WebPage/WebPage.h:
1639
1640 2019-01-18  Tim Horton  <timothy_horton@apple.com>
1641
1642         Adjust WKDrawingView protocol method name
1643         https://bugs.webkit.org/show_bug.cgi?id=193604
1644
1645         Reviewed by Wenson Hsieh.
1646
1647         * UIProcess/ios/WKDrawingView.mm:
1648         (-[WKDrawingView canvasViewDrawingDidChange:]):
1649         (-[WKDrawingView drawingDidChange:]): Deleted.
1650
1651 2019-01-18  David Kilzer  <ddkilzer@apple.com>
1652
1653         [WebKit] Change Xcode folders to map to folders on disk
1654
1655         * WebKit.xcodeproj/project.pbxproj: Update these folders:
1656         - Shared/Authentication
1657         - Shared/Authentication/cocoa
1658
1659 2019-01-18  Brian Burg  <bburg@apple.com>
1660
1661         Automation.computeElementLayout should return visual viewport-aware coordinates
1662         https://bugs.webkit.org/show_bug.cgi?id=193598
1663         <rdar://problem/35325644>
1664
1665         Reviewed by Simon Fraser.
1666
1667         Previously I added CoordinateSystem::VisualViewport to stub out this for iOS.
1668         But I think that it's a mistake for safaridriver to care about VisualViewport
1669         being enabled or not, because it is a runtime-switchable setting.
1670
1671         This patch removes CoordinateSystem::VisualViewport. Make the existing
1672         CoordinateSystem::LayoutViewport use visual viewport semantics if needed.
1673
1674         This is tested by WebDriver element clicking tests. There should not be any
1675         difference in behavior until it is possible to zoom with gestures via WebDriver.
1676
1677         * Shared/CoordinateSystem.h:
1678         * UIProcess/Automation/Automation.json:
1679         * UIProcess/Automation/WebAutomationSession.cpp:
1680         (WebKit::protocolStringToCoordinateSystem):
1681         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1682         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1683
1684 2019-01-18  Daniel Bates  <dabates@apple.com>
1685
1686         Fix some build issues.
1687
1688         Include missing header WKDrawingCoordinator.
1689
1690         * UIProcess/ios/WKInkPickerView.mm:
1691
1692 2019-01-18  Tim Horton  <timothy_horton@apple.com>
1693
1694         Get rid of ADVANCED_SPELL_CHECKING
1695         https://bugs.webkit.org/show_bug.cgi?id=193592
1696
1697         Reviewed by Wenson Hsieh.
1698
1699         * UIProcess/Cocoa/WebViewImpl.mm:
1700         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
1701         (WebKit::WebViewImpl::insertText):
1702         * UIProcess/mac/TextCheckerMac.mm:
1703         (WebKit::TextChecker::checkTextOfParagraph):
1704         (WebKit::TextChecker::getGuessesForWord):
1705
1706 2019-01-18  Chris Dumez  <cdumez@apple.com>
1707
1708         Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
1709         https://bugs.webkit.org/show_bug.cgi?id=193588
1710         <rdar://problem/47131566>
1711
1712         Reviewed by Alex Christensen.
1713
1714         When the WebPageProxy needs to create initialization parameters for its WebPage in the
1715         WebContent process, it calls WebProcessProxy::addWebUserContentControllerProxy()
1716         which calls WebUserContentControllerProxy::addProcess(). This last call is supposed to
1717         register the WebProcessProxy with the WebUserContentControllerProxy and adding the
1718         contentRuleLists to the WebPageCreationParameters. The issue is that if the
1719         WebUserContentControllerProxy already knows about this WebProcessProxy, it would return
1720         early and not populate the WebPageCreationParameters.
1721
1722         In PSON world, when navigating back to a page that failed to enter page cache, we reuse
1723         the process where we previously loaded the page but re-create a new WebPage on the
1724         WebContent process site. When this happens, WebUserContentControllerProxy would not
1725         add the contentRuleLists to the WebPageCreationParameters and the new WebPage in the
1726         previously-suspended process would be missing them.
1727
1728         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1729         (WebKit::WebUserContentControllerProxy::addProcess):
1730
1731 2019-01-18  Jer Noble  <jer.noble@apple.com>
1732
1733         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
1734         https://bugs.webkit.org/show_bug.cgi?id=189553
1735
1736         Reviewed by Tim Horton.
1737
1738         * Configurations/Base.xcconfig:
1739         * Configurations/BaseTarget.xcconfig:
1740         * Configurations/SDKVariant.xcconfig: Added.
1741
1742 2019-01-18  Antti Koivisto  <antti@apple.com>
1743
1744         Implement asynchronous frame scrolling for iOS
1745         https://bugs.webkit.org/show_bug.cgi?id=193539
1746         <rdar://problem/47379873>
1747
1748         Reviewed by Simon Fraser.
1749
1750         Add a scrolling node type that can handle UIScrollView backed frames.
1751         It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.
1752
1753         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1754         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
1755         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1756         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1757         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
1758         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
1759         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
1760         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
1761         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
1762         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
1763         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
1764         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
1765         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
1766         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
1767         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
1768         * WebKit.xcodeproj/project.pbxproj:
1769
1770 2019-01-18  Chris Dumez  <cdumez@apple.com>
1771
1772         Regression(PSON) Scroll position is not always restored properly when navigating back
1773         https://bugs.webkit.org/show_bug.cgi?id=193578
1774         <rdar://problem/47386331>
1775
1776         Reviewed by Tim Horton.
1777
1778         Fix issues causing the scroll position to not be restored at all (or incorrectly) when
1779         navigating back cross-site with PSON enabled. Also make sure that the swipe gesture
1780         snapshot really stays up until we've restored the scroll position.
1781
1782         Note that even after those changes, I can still sometimes reproduce a white flash when
1783         swiping back to Google search results (scroll position being correct now). This is
1784         tracked by <rdar://problem/47071684> and happens even if I disable PSON entirely.
1785
1786         * Shared/SessionState.cpp:
1787         (WebKit::FrameState::encode const):
1788         (WebKit::FrameState::decode):
1789         * Shared/SessionState.h:
1790         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1791         (WebKit::toFrameState):
1792         (WebKit::applyFrameState):
1793         obscuredInsets is present on the HistoryItem in the WebProcess but was never passed to
1794         or stored by the UIProcess on the WebBackForwardListItem. obscuredInsets is needed to
1795         properly restore the scrollPosition (position was 70px off on my iPad without this).
1796         With PSON enabled, if you swipe back cross-process and the previous page was not put
1797         into PageCache, then the HistoryItem is gone on the WebProcess side. What happens is
1798         that the UIProcess sends its WebBackForwardListItem to the WebProcess, which restores
1799         the HistoryItem there, and then asks it to load it. The obscuredInsets was getting lost
1800         in the process since the UIProcess never knew about it.
1801
1802         * UIProcess/Cocoa/ViewGestureController.cpp:
1803         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
1804         Drop logic that was causing the ViewGestureController to not wait for the scroll position
1805         to be restored before taking down the snapshot, when UI-side compositing is enabled.
1806         If you look at the comment above the code, you'll see that the code in question was meant
1807         to impact only the non-UI side compositing code path. As a matter of fact, when the code
1808         was reviewed at https://bugs.webkit.org/show_bug.cgi?id=151224, it was protected by a
1809         #if PLATFORM(MAC), before getting modified the wrong way before landing. In practice, we
1810         would have often restored the scroll position by the time the load is finished so it would
1811         not cause a flash in most cases. However, with PSON enabled and the layer tree freezing we
1812         do on process-swap, the first post-scroll restoration layer tree commit may now occur a
1813         little bit later and we would lose the race more often.
1814
1815         * UIProcess/WebProcessProxy.cpp:
1816         (WebKit::WebProcessProxy::updateBackForwardItem):
1817         * UIProcess/WebProcessProxy.h:
1818         When adding PageCache support to PSON, we used to navigate the "suspended" page to
1819         about:blank. This would lead to unwanted WebProcessProxy::updateBackForwardItem()
1820         calls from the WebProcess which we wanted to ignore. We thus added logic to ignore
1821         updateBackForwardItem() IPC from the old WebProcess after a swap. The issue with this
1822         is that we sometimes miss/ignore legit updates to the HistoryItem from the old process,
1823         in particular with regards to the scroll position and the pageScaleFactor. So if you
1824         swiped and then quickly enough did a cross-site navigation, the UIProcess'
1825         WebBackForwardList would not get updated with the latest scroll position and we would
1826         thus fail to restore it later on. To address the issue, we now stop ignoring updates
1827         from the old WebProcess after a swap. This logic is no longer needed since we no longer
1828         navigate the old page to about:blank after a swap, we merely suspend it "in place".
1829
1830 2019-01-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1831
1832         Remove some last vestiges of assisted node terminology in WebKit
1833         https://bugs.webkit.org/show_bug.cgi?id=193572
1834
1835         Reviewed by Tim Horton.
1836
1837         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
1838         * UIProcess/ios/WKContentViewInteraction.mm:
1839         (-[WKContentView gestureRecognizerShouldBegin:]):
1840         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1841         (-[WKContentView _showKeyboard]):
1842         (-[WKContentView _hideKeyboard]):
1843
1844         Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.
1845
1846         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1847         (-[WKContentView _elementDidBlur]):
1848         (-[WKContentView updateCurrentFocusedElementInformation:]):
1849         (-[WKContentView _startAssistingKeyboard]): Deleted.
1850         (-[WKContentView _stopAssistingKeyboard]): Deleted.
1851         * WebProcess/WebPage/ios/WebPageIOS.mm:
1852         (WebKit::WebPage::getFocusedElementInformation):
1853
1854 2019-01-18  Youenn Fablet  <youenn@apple.com>
1855
1856         Add a new SPI to request for cache storage quota increase
1857         https://bugs.webkit.org/show_bug.cgi?id=193323
1858
1859         Reviewed by Alex Christensen.
1860
1861         Add a delegate on the WebSiteDataStore for WebKit to ask for quota update.
1862         The current SPI is currently CacheStorage specific but future work should
1863         make it so that other storage like IDB use the same mechanism.
1864         By default, quota remains unchanged if delegate is not implemented.
1865
1866         * NetworkProcess/NetworkProcess.cpp:
1867         * UIProcess/API/Cocoa/WKStorageQuotaDelegatePrivate.h: Added.
1868         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1869         (WebsiteDataStoreQuotaManager::WebsiteDataStoreQuotaManager):
1870         (-[WKWebsiteDataStore _quotaDelegate]):
1871         (-[WKWebsiteDataStore set_quotaDelegate:]):
1872         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
1873         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1874         * UIProcess/Network/NetworkProcessProxy.cpp:
1875         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
1876         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1877         (WebKit::WebsiteDataStore::WebsiteDataStore):
1878         * UIProcess/WebsiteData/WebsiteDataStore.h:
1879         (WebKit::WebsiteDataStore::quotaManager):
1880         (WebKit::WebsiteDataStore::setQuotaManager):
1881         * UIProcess/WebsiteData/WebsiteDataStoreQuotaManager.h: Added.
1882         (WebKit::WebsiteDataStoreQuotaManager::~WebsiteDataStoreQuotaManager):
1883         (WebKit::WebsiteDataStoreQuotaManager::requestCacheStorageSpace):
1884         * WebKit.xcodeproj/project.pbxproj:
1885
1886 2019-01-18  Philippe Normand  <pnormand@igalia.com>
1887
1888         [WPE] Add Qt extension
1889         https://bugs.webkit.org/show_bug.cgi?id=191464
1890
1891         Reviewed by Carlos Garcia Campos.
1892
1893         This new extension is a QML plugin embedding a WPE ViewBackend
1894         implementation. It provides a public API very similar to Qt's
1895         WebView module. It comes with a simple mini-browser implemented in
1896         QML.
1897
1898         QtWPE is known to work with the Wayland-EGL (in GNOME and Weston
1899         compositors) and EGLFS QPAs.
1900
1901         * PlatformWPE.cmake:
1902         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: Added.
1903         (WPEQmlExtensionPlugin::registerTypes):
1904         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h: Added.
1905         * UIProcess/API/wpe/qt/WPEQtView.cpp: Added.
1906         (WPEQtView::WPEQtView):
1907         (WPEQtView::~WPEQtView):
1908         (WPEQtView::geometryChanged):
1909         (WPEQtView::configureWindow):
1910         (WPEQtView::createOffscreen):
1911         (WPEQtView::backendCreated):
1912         (WPEQtView::notifyUrlChangedCallback):
1913         (WPEQtView::notifyTitleChangedCallback):
1914         (WPEQtView::notifyLoadProgressCallback):
1915         (WPEQtView::notifyLoadChangedCallback):
1916         (WPEQtView::notifyLoadFailedCallback):
1917         (WPEQtView::updatePaintNode):
1918         (WPEQtView::url const):
1919         (WPEQtView::setUrl):
1920         (WPEQtView::loadProgress const):
1921         (WPEQtView::title const):
1922         (WPEQtView::canGoBack const):
1923         (WPEQtView::isLoading const):
1924         (WPEQtView::canGoForward const):
1925         (WPEQtView::goBack):
1926         (WPEQtView::goForward):
1927         (WPEQtView::reload):
1928         (WPEQtView::stop):
1929         (WPEQtView::loadHtml):
1930         (WPEQtView::jsAsyncReadyCallback):
1931         (WPEQtView::handleJsResult):
1932         (WPEQtView::runJavaScript):
1933         (WPEQtView::mousePressEvent):
1934         (WPEQtView::mouseReleaseEvent):
1935         (WPEQtView::hoverEnterEvent):
1936         (WPEQtView::hoverLeaveEvent):
1937         (WPEQtView::hoverMoveEvent):
1938         (WPEQtView::wheelEvent):
1939         (WPEQtView::keyPressEvent):
1940         (WPEQtView::keyReleaseEvent):
1941         (WPEQtView::touchEvent):
1942         * UIProcess/API/wpe/qt/WPEQtView.h: Added.
1943         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: Added.
1944         (configureCallback):
1945         (WPEQtViewBackend::WPEQtViewBackend):
1946         (WPEQtViewBackend::~WPEQtViewBackend):
1947         (WPEQtViewBackend::configureGlibEglDisplay):
1948         (WPEQtViewBackend::configureEglDisplay):
1949         (WPEQtViewBackend::initialize):
1950         (WPEQtViewBackend::backend const):
1951         (WPEQtViewBackend::resize):
1952         (WPEQtViewBackend::getTexture):
1953         (WPEQtViewBackend::initSurface):
1954         (WPEQtViewBackend::displayImage):
1955         (WPEQtViewBackend::modifiers const):
1956         (WPEQtViewBackend::dispatchHoverEnterEvent):
1957         (WPEQtViewBackend::dispatchHoverLeaveEvent):
1958         (WPEQtViewBackend::dispatchHoverMoveEvent):
1959         (WPEQtViewBackend::dispatchMousePressEvent):
1960         (WPEQtViewBackend::dispatchMouseReleaseEvent):
1961         (WPEQtViewBackend::dispatchWheelEvent):
1962         (WPEQtViewBackend::dispatchKeyEvent):
1963         (WPEQtViewBackend::dispatchTouchEvent):
1964         * UIProcess/API/wpe/qt/WPEQtViewBackend.h: Added.
1965         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: Added.
1966         (WPEQtViewLoadRequest::WPEQtViewLoadRequest):
1967         (WPEQtViewLoadRequest::~WPEQtViewLoadRequest):
1968         (WPEQtViewLoadRequest::url const):
1969         (WPEQtViewLoadRequest::status const):
1970         (WPEQtViewLoadRequest::errorString const):
1971         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: Added.
1972         * UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h: Added.
1973         (WPEQtViewLoadRequestPrivate::WPEQtViewLoadRequestPrivate):
1974         (WPEQtViewLoadRequestPrivate::~WPEQtViewLoadRequestPrivate):
1975         * UIProcess/API/wpe/qt/qmldir: Added.
1976
1977 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1978
1979         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
1980         https://bugs.webkit.org/show_bug.cgi?id=193494
1981         <rdar://problem/46859627>
1982
1983         Reviewed by Simon Fraser and Tim Horton.
1984
1985         Adds `contentInsets` to `VisibleContentRectUpdateInfo`. This keeps track of the visible content insets
1986         surrounding the unobscured content rect. See WebCore ChangeLog for more details.
1987
1988         * Shared/VisibleContentRectUpdateInfo.cpp:
1989         (WebKit::VisibleContentRectUpdateInfo::encode const):
1990         (WebKit::VisibleContentRectUpdateInfo::decode):
1991         (WebKit::operator<<):
1992         * Shared/VisibleContentRectUpdateInfo.h:
1993         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1994         (WebKit::VisibleContentRectUpdateInfo::contentInsets const):
1995         (WebKit::operator==):
1996         * UIProcess/API/Cocoa/WKWebView.mm:
1997         (-[WKWebView _computedObscuredInset]):
1998         (-[WKWebView _computedContentInset]):
1999         (-[WKWebView _computedUnobscuredSafeAreaInset]):
2000
2001         We don't care about source compatibility with iOS 10 and below anymore, so we should change these >= iOS 11
2002         target checks to simply `PLATFORM(IOS)`.
2003
2004         (-[WKWebView _updateVisibleContentRects]):
2005
2006         Compute the visible content insets on all sides of the unobscured content rect. These insets are scaled to
2007         content coordinates.
2008
2009         * UIProcess/ios/WKContentView.h:
2010         * UIProcess/ios/WKContentView.mm:
2011         (floatBoxExtent):
2012
2013         Add a helper to convert `UIEdgeInsets` to `WebCore::FloatBoxExtent`, and use it in a few places below.
2014
2015         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2016         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
2017         * WebProcess/WebPage/ios/WebPageIOS.mm:
2018         (WebKit::WebPage::updateVisibleContentRects):
2019
2020         Update the Page's content insets.
2021
2022 2019-01-17  Truitt Savell  <tsavell@apple.com>
2023
2024         Unreviewed, rolling out r240124.
2025
2026         This commit broke an internal build.
2027
2028         Reverted changeset:
2029
2030         "SDK_VARIANT build destinations should be separate from non-
2031         SDK_VARIANT builds"
2032         https://bugs.webkit.org/show_bug.cgi?id=189553
2033         https://trac.webkit.org/changeset/240124
2034
2035 2019-01-17  John Wilander  <wilander@apple.com>
2036
2037         Add infrastructure to enable/disable ITP Debug Mode through Preferences
2038         https://bugs.webkit.org/show_bug.cgi?id=193510
2039         <rdar://problem/47330969>
2040
2041         Reviewed by Dean Jackson.
2042
2043         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2044         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
2045         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
2046         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
2047             These functions are now suited for runtime switching of ITP Debug Mode.
2048         * Shared/WebPreferences.yaml:
2049             Changed name from ResourceLoadStatisticsDebugMode to ItpDebugModeEnabled.
2050         * UIProcess/API/Cocoa/WKPreferences.mm:
2051         (-[WKPreferences _setItpDebugModeEnabled:]):
2052         (-[WKPreferences _itpDebugModeEnabled]):
2053             New private preferences functions.
2054         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2055         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
2056         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2057             Removed support for old experimental user default. Added a new one that's
2058             not connected to any UI, i.e. merely for command line debugging where
2059             ITP Debug Mode needs to be on all the time.
2060
2061 2019-01-17  Tim Horton  <timothy_horton@apple.com>
2062
2063         Adopt NSTextCheckingSuppressInitialCapitalizationKey
2064         https://bugs.webkit.org/show_bug.cgi?id=193545
2065
2066         Reviewed by Dean Jackson.
2067
2068         * UIProcess/mac/TextCheckerMac.mm:
2069         (WebKit::TextChecker::checkTextOfParagraph):
2070         (WebKit::TextChecker::getGuessesForWord):
2071
2072 2019-01-17  Jer Noble  <jer.noble@apple.com>
2073
2074         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
2075         https://bugs.webkit.org/show_bug.cgi?id=189553
2076
2077         Reviewed by Tim Horton.
2078
2079         * Configurations/Base.xcconfig:
2080         * Configurations/BaseTarget.xcconfig:
2081         * Configurations/SDKVariant.xcconfig: Added.
2082
2083 2019-01-16  Dean Jackson  <dino@apple.com>
2084
2085         (iPad) Link tapping is sluggish on many sites
2086         https://bugs.webkit.org/show_bug.cgi?id=193522
2087         <rdar://problem/47102987>
2088
2089         Reviewed by Wenson Hsieh.
2090
2091         Some WKWebView clients might set the initial zoom scale of the page to
2092         something other than 1, which disables the "fast tap" behaviour.
2093         The fix is very simple -- just check against the initial scale rather
2094         than 1.
2095
2096         The most likely regression from this would be pages designed for desktop,
2097         but provide a viewport tag saying width=device-width and initial-scale.
2098         They might stop allowing double-tap-to-zoom.
2099
2100         * UIProcess/API/Cocoa/WKWebView.mm:
2101         (-[WKWebView _allowsDoubleTapGestures]): Check against initial page scale.
2102
2103 2019-01-17  Alex Christensen  <achristensen@webkit.org>
2104
2105         Stop using NetworkStorageSession::storageSession in WebCore
2106         https://bugs.webkit.org/show_bug.cgi?id=193529
2107
2108         Reviewed by Tim Horton.
2109
2110         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2111         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
2112         * NetworkProcess/NetworkProcess.h:
2113         * NetworkProcess/NetworkSocketStream.cpp:
2114         (WebKit::NetworkSocketStream::create):
2115         (WebKit::NetworkSocketStream::NetworkSocketStream):
2116         * NetworkProcess/NetworkSocketStream.h:
2117         * NetworkProcess/NetworkStorageSessionProvider.h: Added.
2118         * WebKit.xcodeproj/project.pbxproj:
2119         * WebProcess/Network/WebSocketProvider.cpp:
2120         (WebKit::WebSocketProvider::createSocketStreamHandle):
2121         * WebProcess/Network/WebSocketProvider.h:
2122         * WebProcess/WebPage/WebCookieJar.cpp:
2123         (WebKit::WebCookieJar::WebCookieJar):
2124         * WebProcess/WebPage/WebCookieJar.h:
2125
2126 2019-01-16  Youenn Fablet  <youenn@apple.com>
2127
2128         Add a new SPI for controlling getUserMedia
2129         https://bugs.webkit.org/show_bug.cgi?id=192793
2130
2131         Reviewed by Eric Carlson.
2132
2133         Some weaknesses of the current getUserMedia/enumerateDevices SPI were found.
2134         In particular:
2135         - The hash salt should be handled by WebKit not by apps using WebKit.
2136         - No need to expose the frame URL, only the top level origin is needed.
2137         - The names of the callback are changed to improve the intent of these callbacks.
2138         Addressed these by creating a new SPI which will replace the current one.
2139         The current SPI will be removed later on.
2140
2141         Did some refactoring by making the callbacks not return false.
2142         Instead, implement the default behavior inside the request objects as deny methods.
2143         Some further refactoring will be done as a follow-up to better align the C API with the Cocoa API.
2144
2145         * UIProcess/API/APIUIClient.h:
2146         (API::UIClient::decidePolicyForUserMediaPermissionRequest):
2147         (API::UIClient::checkUserMediaPermissionForOrigin):
2148         * UIProcess/API/C/WKPage.cpp:
2149         (WKPageSetPageUIClient):
2150         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2151         * UIProcess/API/Cocoa/WKWebView.mm:
2152         (-[WKWebView _mediaCaptureState]):
2153         (-[WKWebView _setMediaCaptureMuted:]):
2154         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2155         * UIProcess/API/glib/WebKitUIClient.cpp:
2156         * UIProcess/Cocoa/MediaCaptureUtilities.h: Added.
2157         * UIProcess/Cocoa/MediaCaptureUtilities.mm: Added.
2158         * UIProcess/Cocoa/UIDelegate.h:
2159         * UIProcess/Cocoa/UIDelegate.mm:
2160         (WebKit::UIDelegate::setDelegate):
2161         (WebKit::requestUserMediaAuthorizationForFrame):
2162         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2163         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2164         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
2165         * UIProcess/UserMediaPermissionCheckProxy.h:
2166         (WebKit::UserMediaPermissionCheckProxy::deny):
2167         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2168         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2169         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2170         * UIProcess/UserMediaPermissionRequestProxy.h:
2171
2172 2019-01-16  Youenn Fablet  <youenn@apple.com>
2173
2174         Pipe cache quota request from Network Process to UIProcess
2175         https://bugs.webkit.org/show_bug.cgi?id=193296
2176
2177         Reviewed by Alex Christensen.
2178
2179         When cache storage hits quota for a given origin, pipe the request back to NetworkProcess.
2180         No record will be put until the quota request is answered.
2181         The request is sent from CacheStorage::Caches to CacheStorage::Engine and to NetworkProcess.
2182         NetworkProcess then sends it to NetworkProcessProxy.
2183         Currently NetworkProcessProxy just answers by keeping the quota as it is.
2184         In the future, NetworkProcessProxy should make a delegate call to let the app using WebKit
2185         make a decision on the quota. This will allow prompting user to bump it as done for other data.
2186
2187         * NetworkProcess/NetworkProcess.cpp:
2188         (WebKit::NetworkProcess::requestCacheStorageSpace):
2189         * NetworkProcess/NetworkProcess.h:
2190         * NetworkProcess/cache/CacheStorageEngine.cpp:
2191         (WebKit::CacheStorage::Engine::~Engine):
2192         (WebKit::CacheStorage::Engine::from):
2193         (WebKit::CacheStorage::Engine::Engine):
2194         (WebKit::CacheStorage::Engine::requestSpace):
2195         (WebKit::CacheStorage::Engine::requestSpaceCompleted):
2196         * NetworkProcess/cache/CacheStorageEngine.h:
2197         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2198         (WebKit::CacheStorage::Cache::put):
2199         (WebKit::CacheStorage::Cache::retryPuttingPendingRecords):
2200         * NetworkProcess/cache/CacheStorageEngineCache.h:
2201         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2202         (WebKit::CacheStorage::Caches::requestSpace):
2203         (WebKit::CacheStorage::Caches::notifyCachesOfRequestSpaceEnd):
2204         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2205         (WebKit::CacheStorage::Caches::isRequestingSpace const):
2206         * UIProcess/Network/NetworkProcessProxy.cpp:
2207         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
2208         * UIProcess/Network/NetworkProcessProxy.h:
2209         * UIProcess/Network/NetworkProcessProxy.messages.in:
2210
2211 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2212
2213         sendBeacon to previously-unvisited https domain always fails
2214         https://bugs.webkit.org/show_bug.cgi?id=193508
2215
2216         Reviewed by Geoffrey Garen.
2217
2218         * NetworkProcess/PingLoad.cpp:
2219         (WebKit::PingLoad::didReceiveChallenge):
2220         If a ping load is doing a TLS handshake, continue if the server has good certificates.
2221
2222 2019-01-16  Youenn Fablet  <youenn@apple.com>
2223
2224         ASSERTION FAILED: m_networkLoadInformationByID.contains(identifier) in WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics
2225         https://bugs.webkit.org/show_bug.cgi?id=189097
2226         <rdar://problem/43856423>
2227
2228         Reviewed by Alex Christensen.
2229
2230         In case where the inspector is launched, it will instruct the NetworkConnectionToWebProcess to start capturing network metrics.
2231         If this happens in the middle of a load, addNetworkLoadInformationMetrics might fail since addNetworkLoadInformation will not be called.
2232         To fix this issue, store whether to capture metrics at NetworkResourceLoader level.
2233
2234         To ensure that the case of switching back and forth capture of metrics, disable loader capture of metrics whenver NetworkConnectionToWebProcess is asked to.
2235
2236         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2237         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
2238         * NetworkProcess/NetworkConnectionToWebProcess.h:
2239         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
2240         * NetworkProcess/NetworkResourceLoader.cpp:
2241         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
2242         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics const):
2243         * NetworkProcess/NetworkResourceLoader.h:
2244
2245 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2246
2247         Revert r239938
2248         https://bugs.webkit.org/show_bug.cgi?id=193267
2249         <rdar://problem/47297304>
2250
2251         * Configurations/WebContent-iOS.entitlements:
2252
2253 2019-01-16  Chris Dumez  <cdumez@apple.com>
2254
2255         Regression(r240046) Several API tests are crashing
2256         https://bugs.webkit.org/show_bug.cgi?id=193509
2257
2258         Reviewed by Geoffrey Garen.
2259
2260         The crashes would happen because loadRequestShared() would take a WebProcessProxy& in parameter but
2261         then call reattachToWebProcess() if the page is not valid, which would replace m_process and invalidate
2262         our process reference.
2263
2264         To address the issue, move the reattachToWebProcess() call to loadRequest(), before calling
2265         loadRequestShared(). Also, update *Shared() methods to take a Ref<WebProcessProxy>&& instead
2266         of a WebProcessProxy& in parameter. Since we call client delegates, we need to make sure
2267         our process stays alive.
2268
2269         * UIProcess/ProvisionalPageProxy.cpp:
2270         (WebKit::ProvisionalPageProxy::loadData):
2271         (WebKit::ProvisionalPageProxy::loadRequest):
2272         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
2273         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
2274         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
2275         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
2276         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
2277         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
2278         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2279         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
2280         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
2281         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
2282         * UIProcess/WebPageProxy.cpp:
2283         (WebKit::WebPageProxy::loadRequest):
2284         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2285         (WebKit::WebPageProxy::loadData):
2286         (WebKit::WebPageProxy::loadDataWithNavigationShared):
2287         (WebKit::WebPageProxy::didPerformDragControllerAction):
2288         (WebKit::WebPageProxy::findPlugin):
2289         (WebKit::WebPageProxy::didCreateMainFrame):
2290         (WebKit::WebPageProxy::didCreateSubframe):
2291         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2292         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2293         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2294         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
2295         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2296         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2297         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2298         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
2299         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2300         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
2301         (WebKit::WebPageProxy::didCommitLoadForFrame):
2302         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2303         (WebKit::WebPageProxy::didFinishLoadForFrame):
2304         (WebKit::WebPageProxy::didFailLoadForFrame):
2305         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2306         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2307         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2308         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2309         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2310         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2311         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2312         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
2313         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2314         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2315         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2316         (WebKit::WebPageProxy::decidePolicyForResponse):
2317         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2318         (WebKit::WebPageProxy::unableToImplementPolicy):
2319         (WebKit::WebPageProxy::willSubmitForm):
2320         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2321         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
2322         (WebKit::WebPageProxy::didPerformClientRedirect):
2323         (WebKit::WebPageProxy::didPerformClientRedirectShared):
2324         (WebKit::WebPageProxy::didPerformServerRedirect):
2325         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2326         (WebKit::WebPageProxy::createNewPage):
2327         (WebKit::WebPageProxy::runJavaScriptAlert):
2328         (WebKit::WebPageProxy::runJavaScriptConfirm):
2329         (WebKit::WebPageProxy::runJavaScriptPrompt):
2330         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2331         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2332         (WebKit::WebPageProxy::runOpenPanel):
2333         (WebKit::WebPageProxy::printFrame):
2334         (WebKit::WebPageProxy::backForwardGoToItem):
2335         (WebKit::WebPageProxy::backForwardGoToItemShared):
2336         (WebKit::WebPageProxy::learnWord):
2337         (WebKit::WebPageProxy::ignoreWord):
2338         (WebKit::WebPageProxy::didReceiveEvent):
2339         (WebKit::WebPageProxy::editingRangeCallback):
2340         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
2341         (WebKit::WebPageProxy::focusedFrameChanged):
2342         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
2343         (WebKit::WebPageProxy::exceededDatabaseQuota):
2344         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2345         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2346         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2347         (WebKit::WebPageProxy::startURLSchemeTask):
2348         (WebKit::WebPageProxy::startURLSchemeTaskShared):
2349         (WebKit::WebPageProxy::stopURLSchemeTask):
2350         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
2351         * UIProcess/WebPageProxy.h:
2352
2353 2019-01-16  Chris Dumez  <cdumez@apple.com>
2354
2355         Regression(PSON) View becomes blank after click a cross-site download link
2356         https://bugs.webkit.org/show_bug.cgi?id=193361
2357         <rdar://problem/47099573>
2358
2359         Reviewed by Geoffrey Garen.
2360
2361         The issue tracked by rdar://problem/47099573 is that a provisional load may get
2362         canceled (or converted into a download) *after* we've decided to process-swap.
2363         In such cases, the view should keep displaying the current site and it should
2364         still be interactive. However, with the previous PSON model, the view (pageProxy)
2365         would have already swapped to the new process and would end up displaying the
2366         initially empty document.
2367
2368         To address the issue, this patch introduces the concept of a provisional load
2369         in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
2370         process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
2371         provisional page until after the load was committed in the new process. This means
2372         that the view / WebPageProxy keeps using the old process and displays the current
2373         content until a load has committed in the provisional page. If no load commits
2374         in the provisional process (e.g. because the load is cancelled or converted into
2375         a download), then we merely destroy the ProvisionalPageProxy and terminate its
2376         process, without impacting the WebPageProxy.
2377
2378         * Shared/WebPageCreationParameters.cpp:
2379         (WebKit::WebPageCreationParameters::encode const):
2380         (WebKit::WebPageCreationParameters::decode):
2381         * Shared/WebPageCreationParameters.h:
2382         Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
2383         delay attaching the drawing area in case of a process-swap, no matter what
2384         now that the previous process is kept alive until the provisional load is
2385         committed in the new process.
2386
2387         * Shared/WebPolicyAction.h:
2388         Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
2389         process-swap, we now tell the previous process to simply ignore the load, while
2390         we create a ProvisionalPageProxy to do the new load in a new process.
2391         Suspension of the previous page in the old process, happens later, when a load
2392         is actually committed in the new process.
2393
2394         * Sources.txt:
2395         Add new ProvisionalPageProxy file.
2396
2397         * UIProcess/API/Cocoa/WKWebView.mm:
2398         (-[WKWebView _killWebContentProcessAndResetState]):
2399         When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
2400         process and the provisional one, to maintain previous behavior in our API tests.
2401
2402         * UIProcess/API/gtk/PageClientImpl.cpp:
2403         (WebKit::PageClientImpl::createDrawingAreaProxy):
2404         * UIProcess/API/gtk/PageClientImpl.h:
2405         * UIProcess/API/wpe/PageClientImpl.cpp:
2406         (WebKit::PageClientImpl::createDrawingAreaProxy):
2407         * UIProcess/API/wpe/PageClientImpl.h:
2408         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2409         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
2410         (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState):
2411         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
2412         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2413         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
2414         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
2415         * UIProcess/AcceleratedDrawingAreaProxy.h:
2416         * UIProcess/Cocoa/WebViewImpl.h:
2417         * UIProcess/Cocoa/WebViewImpl.mm:
2418         (WebKit::WebViewImpl::createDrawingAreaProxy):
2419         * UIProcess/DrawingAreaProxy.cpp:
2420         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
2421         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
2422         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
2423         * UIProcess/DrawingAreaProxy.h:
2424         (WebKit::DrawingAreaProxy::process):
2425         * UIProcess/DrawingAreaProxyImpl.cpp:
2426         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
2427         (WebKit::DrawingAreaProxyImpl::update):
2428         * UIProcess/DrawingAreaProxyImpl.h:
2429         * UIProcess/PageClient.h:
2430         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2431         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2432         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2433         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
2434         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
2435         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2436         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
2437         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
2438         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2439         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2440         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2441         * UIProcess/ios/PageClientImplIOS.h:
2442         * UIProcess/ios/PageClientImplIOS.mm:
2443         (WebKit::PageClientImpl::createDrawingAreaProxy):
2444         * UIProcess/ios/WKContentView.h:
2445         * UIProcess/ios/WKContentView.mm:
2446         (-[WKContentView _createDrawingAreaProxy:]):
2447         * UIProcess/mac/PageClientImplMac.h:
2448         * UIProcess/mac/PageClientImplMac.mm:
2449         (WebKit::PageClientImpl::createDrawingAreaProxy):
2450         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2451         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2452         (WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy):
2453         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
2454         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
2455         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2456         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
2457         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2458         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
2459         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
2460         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2461         * UIProcess/mac/WebPageProxyMac.mm:
2462         * UIProcess/win/PageClientImpl.cpp:
2463         (WebKit::PageClientImpl::createDrawingAreaProxy):
2464         * UIProcess/win/PageClientImpl.h:
2465         * UIProcess/win/PageClientImpl.cpp:
2466         (WebKit::PageClientImpl::createDrawingAreaProxy):
2467         * UIProcess/win/PageClientImpl.h:
2468         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2469         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2470         Pass the drawing area's associated process when constructing it and store it as a member
2471         in addition to the page. This is necessary now that a page can be associated with 2
2472         WebProcesses at a time, each having its own drawing area.
2473
2474         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2475         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
2476         Pass the process.
2477
2478         * UIProcess/ProvisionalPageProxy.cpp: Added.
2479         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
2480         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
2481         (WebKit::ProvisionalPageProxy::processDidTerminate):
2482         (WebKit::ProvisionalPageProxy::takeDrawingArea):
2483         (WebKit::ProvisionalPageProxy::cancel):
2484         (WebKit::ProvisionalPageProxy::processDidFinishLaunching):
2485         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch):
2486         (WebKit::ProvisionalPageProxy::initializeWebPage):
2487         (WebKit::ProvisionalPageProxy::loadData):
2488         (WebKit::ProvisionalPageProxy::loadRequest):
2489         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
2490         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
2491         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
2492         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
2493         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
2494         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
2495         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
2496         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
2497         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2498         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
2499         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
2500         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
2501         (WebKit::ProvisionalPageProxy::didReceiveMessage):
2502         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
2503         * UIProcess/ProvisionalPageProxy.h: Added.
2504         (WebKit::ProvisionalPageProxy::page):
2505         (WebKit::ProvisionalPageProxy::mainFrame const):
2506         (WebKit::ProvisionalPageProxy::process):
2507         (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
2508         (WebKit::ProvisionalPageProxy::navigationID const):
2509         (WebKit::ProvisionalPageProxy::drawingArea const):
2510         New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from
2511         the provisional process.
2512
2513         * UIProcess/SuspendedPageProxy.cpp:
2514         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2515         (WebKit::SuspendedPageProxy::unsuspend):
2516         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
2517         Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
2518         when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
2519         which tries to register itself as an IPC message receiver for the same pageID when
2520         a process-swap occurs and we're switching to a suspended page.
2521
2522         * UIProcess/WebFrameProxy.cpp:
2523         (WebKit::WebFrameProxy::isMainFrame const):
2524         WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
2525         Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
2526         m_mainFrame to maintain previous behavior.
2527
2528         * UIProcess/WebPageProxy.cpp:
2529         (WebKit::WebPageProxy::provisionalDrawingArea const):
2530         Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but
2531         the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot.
2532
2533         (WebKit::WebPageProxy::swapToWebProcess):
2534         swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
2535         later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
2536         to initialize some data members such as the drawing area and the main frame as it is transferring them over from
2537         the ProvisionalPageProxy which started the provisional load.
2538
2539         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2540         We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
2541         committed in the provisional process.
2542
2543         (WebKit::WebPageProxy::setDrawingArea):
2544         (WebKit::WebPageProxy::initializeWebPage):
2545         - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
2546           committed in the provisional process.
2547         - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
2548
2549         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2550         (WebKit::WebPageProxy::loadRequest):
2551         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2552         Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
2553         Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
2554
2555         (WebKit::WebPageProxy::loadData):
2556         (WebKit::WebPageProxy::loadDataWithNavigationShared):
2557         (WebKit::WebPageProxy::stopLoading):
2558         (WebKit::WebPageProxy::reload):
2559         (WebKit::WebPageProxy::didPerformDragControllerAction):
2560         (WebKit::WebPageProxy::findPlugin):
2561         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2562         In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
2563         Suspension now happens later, only if we end up committing the provisional load in the new process.
2564         Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
2565         to happen a bit later but it is clearer if we do this as early as possible I think.
2566
2567         (WebKit::WebPageProxy::commitProvisionalPage):
2568         When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
2569         - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
2570         - Suspending the current page.
2571         - Letting the client know the load is comitted
2572         - Destroy the ProvisionalPageProxy.
2573         This work used to happen earlier in continueNavigationInNewProcess().
2574
2575         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2576         Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
2577         without actually having the WebPageProxy switch to the new process yet.
2578
2579         (WebKit::WebPageProxy::didCreateMainFrame):
2580         (WebKit::WebPageProxy::didCreateSubframe):
2581         (WebKit::WebPageProxy::didCreateWindow):
2582         Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
2583
2584         (WebKit::WebPageProxy::didDestroyNavigation):
2585         On process-swap, when telling the previous process to ignore the load and starting the new load in a new
2586         ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
2587         the call since the navigation is merely taken over by the ProvisionalPageProxy.
2588
2589         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2590         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2591         Moved some PSON logic to the ProvisionalPageProxy instead.
2592
2593         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2594         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
2595         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2596         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2597         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2598         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
2599
2600         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2601         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
2602         When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
2603
2604         (WebKit::WebPageProxy::didCommitLoadForFrame):
2605         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2606         (WebKit::WebPageProxy::didFinishLoadForFrame):
2607         (WebKit::WebPageProxy::didFailLoadForFrame):
2608         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2609         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2610         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2611         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2612         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2613         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2614         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2615         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
2616         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2617         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2618         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2619         (WebKit::WebPageProxy::decidePolicyForResponse):
2620         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2621         (WebKit::WebPageProxy::unableToImplementPolicy):
2622         (WebKit::WebPageProxy::willSubmitForm):
2623         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2624         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
2625         (WebKit::WebPageProxy::didPerformClientRedirect):
2626         (WebKit::WebPageProxy::didPerformClientRedirectShared):
2627         (WebKit::WebPageProxy::didPerformServerRedirect):
2628         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2629         (WebKit::WebPageProxy::createNewPage):
2630         (WebKit::WebPageProxy::runJavaScriptAlert):
2631         (WebKit::WebPageProxy::runJavaScriptConfirm):
2632         (WebKit::WebPageProxy::runJavaScriptPrompt):
2633         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2634         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2635         (WebKit::WebPageProxy::runOpenPanel):
2636         (WebKit::WebPageProxy::printFrame):
2637         (WebKit::WebPageProxy::backForwardGoToItem):
2638         (WebKit::WebPageProxy::backForwardGoToItemShared):
2639         (WebKit::WebPageProxy::learnWord):
2640         (WebKit::WebPageProxy::ignoreWord):
2641         (WebKit::WebPageProxy::didReceiveEvent):
2642         (WebKit::WebPageProxy::editingRangeCallback):
2643         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
2644         (WebKit::WebPageProxy::focusedFrameChanged):
2645         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
2646
2647         (WebKit::WebPageProxy::provisionalProcessDidTerminate):
2648         Cancel the provisiona load and destroy the ProvisionalPageProxy if
2649         the provisional process crashes.
2650
2651         (WebKit::WebPageProxy::resetState):
2652         Drop some code that is no longer needed.
2653
2654         (WebKit::WebPageProxy::creationParameters):
2655         - Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
2656         more than one call site. This was just some bad factoring.
2657         - Take the process in parameter now that we page can be associated with several processes at a time.
2658
2659         (WebKit::WebPageProxy::exceededDatabaseQuota):
2660         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2661         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2662         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2663         (WebKit::WebPageProxy::startURLSchemeTask):
2664         (WebKit::WebPageProxy::startURLSchemeTaskShared):
2665         (WebKit::WebPageProxy::stopURLSchemeTask):
2666         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
2667         (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
2668         (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
2669         * UIProcess/WebPageProxy.h:
2670         (WebKit::WebPageProxy::visitedLinkStore):
2671         (WebKit::WebPageProxy::provisionalPageProxy const):
2672
2673         * UIProcess/WebProcessProxy.cpp:
2674         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
2675         (WebKit::WebProcessProxy::updateBackForwardItem):
2676         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2677         (WebKit::WebProcessProxy::didFinishLaunching):
2678         (WebKit::WebProcessProxy::canTerminateChildProcess):
2679         * UIProcess/WebProcessProxy.h:
2680         (WebKit::WebProcessProxy::addProvisionalPageProxy):
2681         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
2682         Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
2683         item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
2684         associated with this process yet, because it is still a ProvisionalPageProxy.        
2685
2686         * UIProcess/WebURLSchemeHandler.cpp:
2687         (WebKit::WebURLSchemeHandler::startTask):
2688         * UIProcess/WebURLSchemeHandler.h:
2689         * UIProcess/WebURLSchemeTask.cpp:
2690         (WebKit::WebURLSchemeTask::create):
2691         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
2692         (WebKit::WebURLSchemeTask::didPerformRedirection):
2693         (WebKit::WebURLSchemeTask::didReceiveResponse):
2694         (WebKit::WebURLSchemeTask::didReceiveData):
2695         (WebKit::WebURLSchemeTask::didComplete):
2696         (WebKit::WebURLSchemeTask::pageDestroyed):
2697         * UIProcess/WebURLSchemeTask.h:
2698         Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to
2699         the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses.
2700
2701         * UIProcess/ios/ViewGestureControllerIOS.mm:
2702         (WebKit::ViewGestureController::endSwipeGesture):
2703         Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently
2704         associated with the page in case of process swap.
2705
2706         * WebKit.xcodeproj/project.pbxproj:
2707         Add ProvisionalPageProxy class.
2708
2709         * WebProcess/WebPage/WebFrame.cpp:
2710         (WebKit::toPolicyAction):
2711         (WebKit::WebFrame::didReceivePolicyDecision):
2712         * WebProcess/WebPage/WebPage.cpp:
2713         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2714         (WebKit::WebPage::reinitializeWebPage):
2715         (WebKit::WebPage::didReceivePolicyDecision):
2716         Stop dealing with WebPolicyAction::Suspend as it no longer exists.
2717
2718         (WebKit::WebPage::didCompletePageTransition):
2719
2720         (WebKit::WebPage::setIsSuspended):
2721         Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
2722         setIsSuspended(true) IPC is sent when we actually commit the provisional page.
2723
2724         * WebProcess/WebPage/WebPage.h:
2725
2726 2019-01-16  Tim Horton  <timothy_horton@apple.com>
2727
2728         Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
2729         https://bugs.webkit.org/show_bug.cgi?id=193468
2730         <rdar://problem/38645869>
2731
2732         Reviewed by Zalan Bujtas.
2733
2734         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2735         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2736         Adjust the null-check a bit; Zalan pointed out that the layout could
2737         be responsible for the Frame/RenderView going away, so we should bail
2738         *after* layout, not before.
2739
2740 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
2741
2742         Unreviewed WinCairo build fix.
2743
2744         * WebProcess/WebPage/WebPageInspectorTargetController.cpp:
2745         (WebKit::WebPageInspectorTargetController::connectInspector): Use 'auto' instead of unprefixed InspectorTarget.
2746         (WebKit::WebPageInspectorTargetController::disconnectInspector): Ditto.
2747         (WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend): Ditto.
2748
2749 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2750
2751         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
2752         https://bugs.webkit.org/show_bug.cgi?id=193368
2753
2754         Reviewed by Geoff Garen.
2755
2756         * WebProcess/Plugins/PluginView.cpp:
2757         (WebKit::PluginView::getAuthenticationInfo):
2758
2759 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2760
2761         Remove more NetworkProcess::singleton use
2762         https://bugs.webkit.org/show_bug.cgi?id=193484
2763
2764         Reviewed by Geoffrey Garen.
2765
2766         This removes the use of NetworkProcess::singleton in the LegacyCustomProtocolManager.
2767         This is the kind of awful duct tape code that keeps me awake at night, but it's necessary
2768         because we can't quite remove LegacyCustomProtocolManager yet but we need to allow more than
2769         one NetworkProcess object.  To make it work well enough until we remove LegacyCustomProtocolManager,
2770         use the last NetworkProcess object that has been created.
2771
2772         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
2773         (newestNetworkProcess):
2774         (LegacyCustomProtocolManager::networkProcessCreated):
2775         (+[WKCustomProtocol canInitWithRequest:]):
2776         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
2777         (-[WKCustomProtocol startLoading]):
2778         (-[WKCustomProtocol stopLoading]):
2779         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
2780         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
2781         (WebKit::LegacyCustomProtocolManager::startLoading):
2782         (WebKit::LegacyCustomProtocolManager::stopLoading):
2783         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
2784         * NetworkProcess/NetworkProcess.cpp:
2785         (WebKit::NetworkProcess::NetworkProcess):
2786
2787 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2788
2789         Fix WinCairo build after r240014
2790         https://bugs.webkit.org/show_bug.cgi?id=161106
2791
2792         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2793
2794 2019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
2795
2796         VisualViewport API should be updated upon opening of keyboard
2797         https://bugs.webkit.org/show_bug.cgi?id=193475
2798
2799         Reviewed by Simon Fraser.
2800
2801         The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
2802         unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.
2803
2804         Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
2805         unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
2806         while the keyboard is getting brought up.
2807
2808         * Shared/VisibleContentRectUpdateInfo.h:
2809         (WebKit::operator==):
2810         * WebProcess/WebPage/ios/WebPageIOS.mm:
2811         (WebKit::WebPage::updateVisibleContentRects):
2812
2813 2019-01-15  Megan Gardner  <megan_gardner@apple.com>
2814
2815         Add Reveal support in iOSMac
2816         https://bugs.webkit.org/show_bug.cgi?id=193408
2817         <rdar://problem/47300699>
2818
2819         Reviewed by Tim Horton.
2820
2821         Add calls to DictionaryLookup from the appropriate places.
2822
2823         * UIProcess/PageClient.h:
2824         * UIProcess/ios/PageClientImplIOS.h:
2825         * UIProcess/ios/PageClientImplIOS.mm:
2826         (WebKit::PageClientImpl::didPerformDictionaryLookup):
2827         * UIProcess/ios/WebPageProxyIOS.mm:
2828         (WebKit::WebPageProxy::didPerformDictionaryLookup):
2829         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2830         (WebKit::WebPage::dictionaryPopupInfoForRange):
2831
2832 2019-01-15  Claudio Saavedra  <csaavedra@igalia.com>
2833
2834         [SOUP] Remove usage of NetworkProcess::singleton()
2835         https://bugs.webkit.org/show_bug.cgi?id=193444
2836
2837         Reviewed by Michael Catanzaro.
2838
2839         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2840         (WebKit::NetworkDataTaskSoup::download):
2841         (WebKit::NetworkDataTaskSoup::didWriteDownload):
2842         (WebKit::NetworkDataTaskSoup::didFinishDownload):
2843         (WebKit::NetworkDataTaskSoup::didFailDownload):
2844         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2845         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
2846
2847 2019-01-15  Eric Carlson  <eric.carlson@apple.com>
2848
2849         Fix incorrect ASSERT added in r239840
2850         https://bugs.webkit.org/show_bug.cgi?id=193466
2851         <rdar://problem/47095142>
2852
2853         Reviewed by Youenn Fablet.
2854
2855         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2856         (WebKit::UserMediaCaptureManager::Source::Source):
2857
2858 2019-01-15  Tim Horton  <timothy_horton@apple.com>
2859
2860         Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
2861         https://bugs.webkit.org/show_bug.cgi?id=193468
2862         <rdar://problem/38645869>
2863
2864         Reviewed by Beth Dakin.
2865
2866         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2867         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2868         I'm not sure why this got *worse*, but we should null-check RenderView.
2869         It's OK to bail from scaleViewToFitDocumentIfNeeded, we'll re-do it
2870         the next time we paint (which will surely happen if we gain a RenderView).
2871
2872 2019-01-15  Chris Dumez  <cdumez@apple.com>
2873
2874         Unreviewed, rolling out r239993, r239995, r239997, and
2875         r239999.
2876
2877         Caused assertions under
2878         ViewGestureController::disconnectFromProcess()
2879
2880         Reverted changesets:
2881
2882         "Regression(PSON) View becomes blank after click a cross-site
2883         download link"
2884         https://bugs.webkit.org/show_bug.cgi?id=193361
2885         https://trac.webkit.org/changeset/239993
2886
2887         "Unreviewed iOS build fix after r239993."
2888         https://trac.webkit.org/changeset/239995
2889
2890         "Fix iOS build after r239993"
2891         https://bugs.webkit.org/show_bug.cgi?id=193361
2892         https://trac.webkit.org/changeset/239997
2893
2894         "Unreviewed, revert part of r239997 as it is not needed to fix
2895         the build."
2896         https://trac.webkit.org/changeset/239999
2897
2898 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2899
2900         Stop using CookiesStrategy
2901         https://bugs.webkit.org/show_bug.cgi?id=161106
2902
2903         Reviewed by Don Olmstead and Antti Koivisto.
2904
2905         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2906         (WebKit::NetworkProcessPlatformStrategies::createCookiesStrategy): Deleted.
2907         * NetworkProcess/NetworkProcessPlatformStrategies.h:
2908         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2909         * Scripts/webkit/messages.py:
2910         * Sources.txt:
2911         * WebKit.xcodeproj/project.pbxproj:
2912         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2913         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
2914         (WebKit::WebAutomationSessionProxy::deleteCookie):
2915         * WebProcess/Plugins/PluginView.cpp:
2916         (WebKit::PluginView::cookiesForURL):
2917         (WebKit::PluginView::setCookiesForURL):
2918         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2919         (WebKit::WebPlatformStrategies::createCookiesStrategy): Deleted.
2920         (WebKit::WebPlatformStrategies::cookiesForDOM): Deleted.
2921         (WebKit::WebPlatformStrategies::setCookiesFromDOM): Deleted.
2922         (WebKit::WebPlatformStrategies::cookiesEnabled): Deleted.
2923         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
2924         (WebKit::WebPlatformStrategies::getRawCookies): Deleted.
2925         (WebKit::WebPlatformStrategies::deleteCookie): Deleted.
2926         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2927         * WebProcess/WebPage/WebCookieJar.cpp: Added.
2928         (WebKit::WebCookieJar::cookies const):
2929         (WebKit::WebCookieJar::setCookies):
2930         (WebKit::WebCookieJar::cookiesEnabled const):
2931         (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
2932         (WebKit::WebCookieJar::getRawCookies const):
2933         (WebKit::WebCookieJar::deleteCookie):
2934         * WebProcess/WebPage/WebCookieJar.h: Added.
2935         * WebProcess/WebPage/WebPage.cpp:
2936         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2937
2938 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
2939
2940         Remove reporting for iOS mach lookups confirmed in-use
2941         https://bugs.webkit.org/show_bug.cgi?id=193455
2942         <rdar://problem/47259551>
2943
2944         Reviewed by Brent Fulgham.
2945
2946         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2947
2948 2019-01-15  Tim Horton  <timothy_horton@apple.com>
2949
2950         Cannot tab out of WKWebView on macOS
2951         https://bugs.webkit.org/show_bug.cgi?id=161448
2952         <rdar://problem/28100085>
2953
2954         Reviewed by Dean Jackson.
2955
2956         * UIProcess/WebPageProxy.cpp:
2957         (WebKit::WebPageProxy::takeFocus):
2958         If the UIDelegate doesn't implement takeFocus, provide a simple default
2959         implementation that just uses AppKit's key view loop to move the focus.
2960
2961         * UIProcess/API/APIUIClient.h:
2962         (API::UIClient::takeFocus):
2963         * UIProcess/API/C/WKPage.cpp:
2964         (WKPageSetPageUIClient):
2965         * UIProcess/Cocoa/UIDelegate.h:
2966         * UIProcess/Cocoa/UIDelegate.mm:
2967         (WebKit::UIDelegate::UIClient::takeFocus):
2968         Make API::UIClient's takeFocus return a bool indicating whether the
2969         client implements it or not.
2970
2971         * UIProcess/PageClient.h:
2972         * UIProcess/mac/PageClientImplMac.h:
2973         * UIProcess/mac/PageClientImplMac.mm:
2974         (WebKit::PageClientImpl::takeFocus):
2975         Plumb takeFocus to WebViewImpl.
2976
2977         * UIProcess/Cocoa/WebViewImpl.h:
2978         * UIProcess/Cocoa/WebViewImpl.mm:
2979         (WebKit::WebViewImpl::takeFocus):
2980         Borrow the relevant portion of WebKitLegacy's implementation of takeFocus,
2981         shifting focus to the next/previous key view in the window.
2982
2983 2019-01-15  Youenn Fablet  <youenn@apple.com>
2984
2985         Remove the specific handling of ephemeral sessions from CacheStorage::Engine::from
2986         https://bugs.webkit.org/show_bug.cgi?id=193400
2987
2988         Reviewed by Alex Christensen.
2989
2990         It is no longer needed as we correctly handle ephemeral sessions removal.
2991
2992         * NetworkProcess/cache/CacheStorageEngine.cpp:
2993         (WebKit::CacheStorage::Engine::from):
2994
2995 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2996
2997         Fix iOS build after r239993
2998         https://bugs.webkit.org/show_bug.cgi?id=193361
2999
3000         * UIProcess/ProvisionalPageProxy.h:
3001         * UIProcess/SuspendedPageProxy.h:
3002
3003 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
3004
3005         [macOS] Adjust logging policy in WebKit's sandbox
3006         https://bugs.webkit.org/show_bug.cgi?id=193454
3007         <rdar://problem/47256325>
3008
3009         Reviewed by Brent Fulgham.
3010
3011         * WebProcess/com.apple.WebProcess.sb.in:
3012
3013 2019-01-15  Chris Dumez  <cdumez@apple.com>
3014
3015         Unreviewed iOS build fix after r239993.
3016
3017         * UIProcess/SuspendedPageProxy.h:
3018
3019 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
3020
3021         Add allow directive for MTLCompilerService.xpc to PluginProcess and WebContent
3022         https://bugs.webkit.org/show_bug.cgi?id=193453
3023         <rdar://problem/47268166>
3024
3025         Reviewed by Brent Fulgham.
3026
3027         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3028         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3029         * WebProcess/com.apple.WebProcess.sb.in:
3030
3031 2019-01-15  Chris Dumez  <cdumez@apple.com>
3032
3033         Regression(PSON) View becomes blank after click a cross-site download link
3034         https://bugs.webkit.org/show_bug.cgi?id=193361
3035         <rdar://problem/47099573>
3036
3037         Reviewed by Geoff Garen.
3038
3039         The issue tracked by rdar://problem/47099573 is that a provisional load may get
3040         canceled (or converted into a download) *after* we've decided to process-swap.
3041         In such cases, the view should keep displaying the current site and it should
3042         still be interactive. However, with the previous PSON model, the view (pageProxy)
3043         would have already swapped to the new process and would end up displaying the
3044         initially empty document.
3045
3046         To address the issue, this patch introduces the concept of a provisional load
3047         in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
3048         process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
3049         provisional page until after the load was committed in the new process. This means
3050         that the view / WebPageProxy keeps using the old process and displays the current
3051         content until a load has committed in the provisional page. If no load commits
3052         in the provisional process (e.g. because the load is cancelled or converted into
3053         a download), then we merely destroy the ProvisionalPageProxy and terminate its
3054         process, without impacting the WebPageProxy.
3055
3056         * Shared/WebPageCreationParameters.cpp:
3057         (WebKit::WebPageCreationParameters::encode const):
3058         (WebKit::WebPageCreationParameters::decode):
3059         * Shared/WebPageCreationParameters.h:
3060         Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
3061         delay attaching the drawing area in case of a process-swap, no matter what
3062         now that the previous process is kept alive until the provisional load is
3063         committed in the new process.
3064
3065         * Shared/WebPolicyAction.h:
3066         Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
3067         process-swap, we now tell the previous process to simply ignore the load, while
3068         we create a ProvisionalPageProxy to do the new load in a new process.
3069         Suspension of the previous page in the old process, happens later, when a load
3070         is actually committed in the new process.
3071
3072         * Sources.txt:
3073         Add new ProvisionalPageProxy file.
3074
3075         * UIProcess/API/Cocoa/WKWebView.mm:
3076         (-[WKWebView _killWebContentProcessAndResetState]):
3077         When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
3078         process and the provisional one, to maintain previous behavior in our API tests.
3079
3080         * UIProcess/PageClient.h:
3081         Tiny build fix.
3082
3083         * UIProcess/ProvisionalPageProxy.cpp: Added.
3084         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
3085         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
3086         (WebKit::ProvisionalPageProxy::takeDrawingArea):
3087         (WebKit::ProvisionalPageProxy::cancel):
3088         (WebKit::ProvisionalPageProxy::initializeWebPage):
3089         (WebKit::ProvisionalPageProxy::loadDataWithNavigation):
3090         (WebKit::ProvisionalPageProxy::loadRequestWithNavigation):
3091         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
3092         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
3093         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
3094         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
3095         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
3096         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3097         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
3098         * UIProcess/ProvisionalPageProxy.h: Added.
3099         (WebKit::ProvisionalPageProxy::page):
3100         (WebKit::ProvisionalPageProxy::mainFrame const):
3101         (WebKit::ProvisionalPageProxy::process):
3102         (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
3103         (WebKit::ProvisionalPageProxy::navigationID const):
3104         Add new ProvisionalPageProxy class to wrap the provisional load in the new process
3105         after a swap. The provisional page is owned by the WebPageProxy and we only commit
3106         the provisional page when the load is committed. Until then, the WebPageProxy keeps
3107         using the old process and displaying the current content.
3108
3109         * UIProcess/SuspendedPageProxy.cpp:
3110         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
3111         (WebKit::SuspendedPageProxy::unsuspend):
3112         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
3113         Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
3114         when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
3115         which tries to register itself as an IPC message receiver for the same pageID when
3116         a process-swap occurs and we're switching to a suspended page.
3117
3118         * UIProcess/WebFrameProxy.cpp:
3119         (WebKit::WebFrameProxy::isMainFrame const):
3120         WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
3121         Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
3122         m_mainFrame to maintain previous behavior.
3123
3124         * UIProcess/WebPageProxy.cpp:
3125         (WebKit::WebPageProxy::swapToWebProcess):
3126         swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
3127         later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
3128         to initialize some data members such as the drawing area and the main frame as it is transferring them over from
3129         the ProvisionalPageProxy which started the provisional load.
3130
3131         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3132         We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
3133         committed in the provisional process.
3134
3135         (WebKit::WebPageProxy::initializeWebPage):
3136         - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
3137           committed in the provisional process.
3138         - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
3139
3140         (WebKit::WebPageProxy::loadRequestWithNavigation):
3141         Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
3142         Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
3143
3144         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
3145         In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
3146         Suspension now happens later, only if we end up committing the provisional load in the new process.
3147         Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
3148         to happen a bit later but it is clearer if we do this as early as possible I think.
3149
3150         (WebKit::WebPageProxy::commitProvisionalPage):
3151         When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
3152         - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
3153         - Suspending the current page.
3154         - Letting the client know the load is comitted
3155         - Destroy the ProvisionalPageProxy.
3156         This work used to happen earlier in continueNavigationInNewProcess().
3157
3158         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3159         Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
3160         without actually having the WebPageProxy switch to the new process yet.
3161
3162         (WebKit::WebPageProxy::didCreateMainFrame):
3163         (WebKit::WebPageProxy::didCreateWindow):
3164         Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
3165
3166         (WebKit::WebPageProxy::didDestroyNavigation):
3167         On process-swap, when telling the previous process to ignore the load and starting the new load in a new
3168         ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
3169         the call since the navigation is merely taken over by the ProvisionalPageProxy.
3170
3171         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
3172         Moved some PSON logic to the ProvisionalPageProxy instead.
3173
3174         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
3175         When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
3176
3177         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3178         (WebKit::WebPageProxy::decidePolicyForResponse):
3179         Capture the process in the lambda, to make sure we send the policy decision to the same process that
3180         asked for it, so as to not get confused by process swaps.
3181
3182         (WebKit::WebPageProxy::resetState):
3183         Drop some code that is no longer needed.
3184
3185         (WebKit::WebPageProxy::creationParameters):
3186         Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
3187         more than one call site. This was just some bad factoring.
3188
3189         (WebKit::WebPageProxy::PageProcessOverride::PageProcessOverride):
3190         (WebKit::WebPageProxy::PageProcessOverride::~PageProcessOverride):
3191         * UIProcess/WebPageProxy.h:
3192         (WebKit::WebPageProxy::temporarilyOverrideProcess):
3193         Add utility class to temporarily override the WebPageProxy's m_process with the provisional one when
3194         the ProvisionalPageProxy interacts with the WebPageProxy.
3195
3196         * UIProcess/WebProcessProxy.cpp:
3197         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
3198         (WebKit::WebProcessProxy::updateBackForwardItem):
3199         Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
3200         item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
3201         associated with this process yet, because it is still a ProvisionalPageProxy.
3202
3203         (WebKit::WebProcessProxy::canTerminateChildProcess):
3204         Do not terminate the WebProcess if there are ProvisionalPageProxy objects using it.
3205
3206         * UIProcess/WebProcessProxy.h:
3207         (WebKit::WebProcessProxy::addProvisionalPageProxy):
3208         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
3209
3210         * WebKit.xcodeproj/project.pbxproj:
3211
3212         * WebProcess/WebPage/WebFrame.cpp:
3213         (WebKit::toPolicyAction):
3214         (WebKit::WebFrame::didReceivePolicyDecision):
3215         Stop dealing with WebPolicyAction::Suspend as it no longer exists.
3216
3217         * WebProcess/WebPage/WebPage.cpp:
3218         (WebKit::WebPage::reinitializeWebPage):
3219         (WebKit::WebPage::didReceivePolicyDecision):
3220
3221         (WebKit::WebPage::setIsSuspended):
3222         Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
3223         setIsSuspended(true) IPC is sent when we actually commit the provisional page.
3224
3225         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3226         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3227
3228 2019-01-15  Brian Burg  <bburg@apple.com>
3229
3230         WebDriver: update Create Window implementation to support newest specification
3231         https://bugs.webkit.org/show_bug.cgi?id=193333
3232         <rdar://problem/45649489>
3233
3234         Reviewed by Carlos Garcia Campos.
3235
3236         Spec link: https://w3c.github.io/webdriver/#create-window
3237
3238         The command as specified returns a value indicating whether the new browsing context
3239         was presented as a new tab or new window. Add a new delegate method to query the current
3240         'presentation' of the browsing context. The presentation can change over time due to
3241         things such as screen orientation, so the value that is returned by the command only
3242         reflects how the browsing context was initially presented to the user.
3243
3244         This is covered by existing WPT and internal tests. More will be added when Selenium
3245         exposes this command in its various bindings.
3246
3247         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
3248         Add new SPI delegate method to query the 'presentation' (tab or window) for an automated WKWebView.
3249
3250         * UIProcess/API/APIAutomationSessionClient.h:
3251         (API::AutomationSessionClient::currentPresentationOfPage):
3252         * UIProcess/Cocoa/AutomationSessionClient.h:
3253         * UIProcess/Cocoa/AutomationSessionClient.mm:
3254         (WebKit::AutomationSessionClient::AutomationSessionClient):
3255         (WebKit::toImpl):
3256         (WebKit::AutomationSessionClient::currentPresentationOfPage):
3257         * UIProcess/Automation/WebAutomationSession.cpp:
3258         (WebKit::toProtocol):
3259         (WebKit::WebAutomationSession::createBrowsingContext):
3260         Add plumbing between ObjC delegate and C++.
3261
3262         * UIProcess/Automation/Automation.json:
3263         Include the initial presentation in the createBrowsingContext command result.
3264
3265 2019-01-14  Alex Christensen  <achristensen@webkit.org>
3266
3267         Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
3268         https://bugs.webkit.org/show_bug.cgi?id=193429
3269
3270         Reviewed by Joseph Pecoraro.
3271
3272         * NetworkProcess/cache/NetworkCache.cpp:
3273         (WebKit::NetworkCache::makeUseDecision):
3274         (WebKit::NetworkCache::Cache::retrieve):
3275         (WebKit::NetworkCache::Cache::makeEntry):
3276         (WebKit::NetworkCache::Cache::makeRedirectEntry):
3277         (WebKit::NetworkCache::Cache::update):
3278
3279 2019-01-14  Tim Horton  <timothy_horton@apple.com>
3280
3281         Fix a style mistake in PageClientImplMac
3282
3283         * UIProcess/mac/PageClientImplMac.h:
3284         Somehow these methods ended up above the members.
3285
3286 2019-01-14  Per Arne Vollan  <pvollan@apple.com>
3287
3288         [macOS] Remove reporting for mach lookups confirmed in-use
3289         https://bugs.webkit.org/show_bug.cgi?id=193415
3290         <rdar://problem/47266542>
3291
3292         Reviewed by Brent Fulgham.
3293
3294         Also, start denying the services which have not been confirmed to be in use.
3295
3296         * WebProcess/com.apple.WebProcess.sb.in:
3297
3298 2019-01-14  Commit Queue  <commit-queue@webkit.org>
3299
3300         Unreviewed, rolling out r239901, r239909, r239910, r239912,
3301         r239913, and r239914.
3302         https://bugs.webkit.org/show_bug.cgi?id=193407
3303
3304         These revisions caused an internal failure (Requested by
3305         Truitt on #webkit).
3306
3307         Reverted changesets:
3308
3309         "[Cocoa] Avoid importing directly from subumbrella frameworks"
3310         https://bugs.webkit.org/show_bug.cgi?id=186016
3311         https://trac.webkit.org/changeset/239901
3312
3313         "Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
3314         https://trac.webkit.org/changeset/239909
3315
3316         "Tried to fix the build."
3317         https://trac.webkit.org/changeset/239910
3318
3319         "Fixed iOS builds after r239910."
3320         https://trac.webkit.org/changeset/239912
3321
3322         "More build fixing."
3323         https://trac.webkit.org/changeset/239913
3324
3325         "Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
3326         https://trac.webkit.org/changeset/239914
3327
3328 2019-01-14  Mark Lam  <mark.lam@apple.com>
3329
3330         Re-enable ability to build --cloop builds.
3331         https://bugs.webkit.org/show_bug.cgi?id=192955
3332         <rdar://problem/46882363>
3333
3334         Reviewed by Saam barati and Keith Miller.
3335
3336         * Configurations/FeatureDefines.xcconfig:
3337
3338 2019-01-14  Alex Christensen  <achristensen@webkit.org>
3339
3340         Remove unused networking entitlement from iOS WebProcess entitlements
3341         https://bugs.webkit.org/show_bug.cgi?id=193267
3342
3343         Reviewed by Dean Jackson.
3344
3345         * Configurations/WebContent-iOS.entitlements:
3346         This gave access to VPN stuff.  It's not needed any more.
3347
3348 2019-01-14  Youenn Fablet  <youenn@apple.com>
3349
3350         Enable MDNS ICE candidate support by default
3351         https://bugs.webkit.org/show_bug.cgi?id=193358
3352
3353         Reviewed by Geoffrey Garen.
3354
3355         * Shared/WebPreferences.yaml:
3356
3357 2019-01-11  Matt Rajca  <mrajca@apple.com>
3358
3359         Expose preference for site-specific quirks on iOS
3360         https://bugs.webkit.org/show_bug.cgi?id=193353
3361
3362         Reviewed by Dean Jackson.
3363
3364         * UIProcess/API/Cocoa/WKPreferences.mm:
3365         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
3366         (-[WKPreferences _needsSiteSpecificQuirks]):
3367         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3368
3369 2019-01-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3370
3371         [iOS] Expose SPI to access the current sentence boundary and selection state
3372         https://bugs.webkit.org/show_bug.cgi?id=193398
3373         <rdar://problem/45893108>
3374
3375         Reviewed by Dean Jackson.
3376
3377         Expose SPI on WKWebView for internal clients to grab information about attributes at the current selection; so
3378         far, this only includes whether the selection is a caret or a range, and whether or not the start of the
3379         selection is at the start of a new sentence.
3380
3381         Test: EditorStateTests.ObserveSelectionAttributeChanges
3382
3383         * Shared/EditorState.cpp:
3384         (WebKit::EditorState::PostLayoutData::encode const):
3385         (WebKit::EditorState::PostLayoutData::decode):
3386         * Shared/EditorState.h:
3387
3388         Add a new bit in EditorState on iOS to compute whether or not the start of the selection is at the start of a
3389         new sentence. This is computed and set when sending post-layout data in `WebPageIOS.mm`.
3390
3391         * UIProcess/API/Cocoa/WKWebView.mm:
3392         (selectionAttributes):
3393         (-[WKWebView _didChangeEditorState]):
3394         (-[WKWebView _selectionAttributes]):
3395
3396         Make the new SPI property support KVO by invoking `-willChangeValueForKey:` and `-didChangeValueForKey:`
3397         whenever the selection attributes change.
3398
3399         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3400         * WebProcess/WebPage/ios/WebPageIOS.mm:
3401         (WebKit::WebPage::platformEditorState const):
3402
3403 2019-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3404
3405         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.3 release
3406
3407         * gtk/NEWS: Add release notes for 2.23.3.
3408
3409 2019-01-13  Dan Bernstein  <mitz@apple.com>
3410
3411         Fixed iOS builds after r239910.
3412
3413         * Platform/spi/ios/PDFKitSPI.h:
3414
3415 2019-01-13  Dan Bernstein  <mitz@apple.com>
3416
3417         Tried to fix the build.
3418
3419         * Platform/spi/ios/PDFKitSPI.h:
3420
3421 2019-01-13  Dan Bernstein  <mitz@apple.com>
3422
3423         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
3424
3425         Patch by Keith Rollin.
3426
3427         * Platform/IPC/mac/ConnectionMac.mm:
3428         * Shared/mac/ChildProcessMac.mm:
3429         (WebKit::ChildProcess::launchServicesCheckIn):
3430
3431 2019-01-12  Timothy Hatcher  <timothy@apple.com>
3432
3433         Have prefers-color-scheme: light always match on macOS versions before Mojave.
3434         https://bugs.webkit.org/show_bug.cgi?id=191655
3435         rdar://problem/46074680
3436
3437         Reviewed by Megan Gardner.
3438
3439         * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
3440         * UIProcess/Cocoa/WebViewImpl.mm:
3441         (WebKit::WebViewImpl::effectiveAppearanceIsDark):
3442         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
3443
3444 2019-01-12  Dan Bernstein  <mitz@apple.com>
3445
3446         [Cocoa] Avoid importing directly from subumbrella frameworks
3447         https://bugs.webkit.org/show_bug.cgi?id=186016
3448         <rdar://problem/40591038>
3449
3450         Reviewed by Sam Weinig.
3451
3452         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
3453           OTHER_CPLUSPLUSFLAGS.
3454         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
3455           HIToolbox header.
3456         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
3457         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
3458         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
3459           header.
3460         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
3461           PDFKit header.
3462         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
3463         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
3464         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
3465         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
3466         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
3467         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
3468         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
3469
3470 2019-01-11  Ryosuke Niwa  <rniwa@webkit.org>
3471
3472         Enable visual viewport API by default
3473         https://bugs.webkit.org/show_bug.cgi?id=193376
3474
3475         Reviewed by Simon Fraser.
3476
3477         Enable this feature by default since the remaining issue on iOS is mostly about test failures,
3478         not an issue with the core functionality of the API.
3479
3480         * Shared/WebPreferences.yaml:
3481
3482 2019-01-11  Brent Fulgham  <bfulgham@apple.com>
3483
3484         Allow WebContent process access to some drawing-related IOKit properties
3485         https://bugs.webkit.org/show_bug.cgi?id=193086
3486         <rdar://problem/46568088>
3487
3488         Reviewed by Eric Carlson.
3489
3490         Add one missing IOKit property, and revise the regexp used for another.
3491
3492         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3493
3494 2019-01-11  John Wilander  <wilander@apple.com>
3495
3496         Compile out Web API Statistics Collection
3497         https://bugs.webkit.org/show_bug.cgi?id=193370
3498         <rdar://problem/45388584>
3499
3500         Reviewed by Brent Fulgham.
3501
3502         * Configurations/FeatureDefines.xcconfig:
3503             Defined ENABLE_WEB_API_STATISTICS, off by default.
3504         * Shared/WebCoreArgumentCoders.cpp:
3505         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3506             Skipped encoding of web API statistics.
3507         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3508             Skipped decoding of web API statistics.
3509
3510 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
3511
3512         IndexedDB: leak WebIDBConnectionToClient for retain cycle
3513         https://bugs.webkit.org/show_bug.cgi?id=193097
3514         <rdar://problem/46899601>
3515
3516         Reviewed by Brady Eidson.
3517
3518         Let WebIDBConnectionToClient hold reference to IPC::Connection instead of NetworkConnectionToWebProcess to break
3519         the cycle.
3520
3521         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3522         (WebKit::WebIDBConnectionToClient::create):
3523         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
3524         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
3525         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
3526         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3527         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
3528
3529 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
3530
3531         Make "Disable Web SQL" on by default
3532         https://bugs.webkit.org/show_bug.cgi?id=193354
3533         <rdar://problem/46524584>
3534
3535         Reviewed by Geoffrey Garen.
3536
3537         * Shared/WebPreferences.yaml:
3538
3539 2019-01-11  Devin Rousso  <drousso@apple.com>
3540
3541         Fix style CFNetworkSPI style checker warnings from r239698
3542         https://bugs.webkit.org/show_bug.cgi?id=193369
3543
3544         Reviewed by Joseph Pecoraro.
3545
3546         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3547         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
3548
3549 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3550
3551         [iOS] Precision drop state thrashes when dragging near the top edge of an editable element
3552         https://bugs.webkit.org/show_bug.cgi?id=193364
3553         <rdar://problem/47214117>
3554
3555         Reviewed by Tim Horton.
3556
3557         On iOS, marking a UIDropProposal as precise offsets the hit-testing location of the drop by a small distance
3558         either upwards or downwards from the actual location of the user's finger. When dragging over an editable
3559         element, WebKit currently marks the drop proposal as precise; however, when dragging over the top edge of an
3560         editable element, what happens is that the hit-testing location is offset to a location outside of the editable
3561         element, which causes us to turn off precision drop mode; subsequently, turning off precision drop mode removes
3562         the offset, which causes us to hit-test within the editable element once again and re-enable precision mode, and
3563         the cycle continues.
3564
3565         In order to mitigate this, bail out of precision drop mode when dragging near the top or bottom edges of the
3566         highest editable root that contains the current drop caret position (or, if the drop caret is inside of a text
3567         form control, use the form control as the editable element instead).
3568
3569         * UIProcess/WebPageProxy.cpp:
3570         (WebKit::WebPageProxy::didPerformDragControllerAction):
3571         * UIProcess/WebPageProxy.h:
3572         (WebKit::WebPageProxy::currentDragCaretEditableElementRect const):
3573         * UIProcess/WebPageProxy.messages.in:
3574         * UIProcess/ios/WKContentViewInteraction.mm:
3575         (-[WKContentView dropInteraction:sessionDidUpdate:]):
3576
3577         Avoid precise mode when we're less than 25pt away from the top and bottom edge of the editable element rect.
3578         Since the drag location offset amount is a fixed offset in window coordinates, we first convert this minimum
3579         distance to the content view's coordinate space by dividing by the content scale factor.
3580
3581         * WebProcess/WebPage/WebPage.cpp:
3582         (WebKit::WebPage::performDragControllerAction):
3583
3584 2019-01-11  Tim Horton  <timothy_horton@apple.com>
3585
3586         REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
3587         https://bugs.webkit.org/show_bug.cgi?id=193366
3588         <rdar://problem/46097212>
3589
3590         Reviewed by Simon Fraser.
3591
3592         A pair of unrelated changes broke Firefox's use of WKWebView internals
3593         to override the long-press menu. Maintain binary compatibility by
3594         introducing linked-on-or-after checks.
3595
3596         * UIProcess/Cocoa/VersionChecks.h:
3597         * UIProcess/WebProcessPool.cpp:
3598         (WebKit::WebProcessPool::createWebPage):
3599         Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
3600         Because gestures are very stateful, we always swap them out when swapping
3601         processes (changing that behavior is fairly risky). Also, we don't always
3602         inform the client when we swap processes (only when the process actually crashes),
3603         so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.
3604
3605         * UIProcess/ios/WKContentView.mm:
3606         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
3607         Synchronously install gesture recognizers under -init when linked against
3608         an SDK before the version that introduces lazy gesture recognizer installation.
3609         r237331 is an optimization that made us lazily install gestures when the
3610         view is parented, but Firefox (and potentially other clients) depend
3611         on them being installed synchronously in order to find and override them.
3612
3613 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3614
3615         Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
3616         https://bugs.webkit.org/show_bug.cgi?id=193109
3617         <rdar://problem/44807048>
3618
3619         Reviewed by Ryosuke Niwa.
3620
3621         Add a new SPI configuration flag to enable the UndoManager API. This is off by default.
3622
3623         * Shared/WebPreferences.yaml:
3624         * UIProcess/API/Cocoa/WKWebView.mm:
3625         (-[WKWebView _initializeWithConfiguration:]):
3626         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3627         (-[WKWebViewConfiguration init]):
3628         (-[WKWebViewConfiguration copyWithZone:]):
3629         (-[WKWebViewConfiguration _setUndoManagerAPIEnabled:]):
3630         (-[WKWebViewConfiguration _undoManagerAPIEnabled]):
3631         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3632
3633 2019-01-10  Jiewen Tan  <jiewen_tan@apple.com>
3634
3635         [WebAuthN] Change the nonce in the CTAP kInit command to weak random values
3636         https://bugs.webkit.org/show_bug.cgi?id=192061
3637         <rdar://problem/46471091>
3638
3639         Reviewed by Chris Dumez.
3640
3641         Change the nonce in the CTAP kInit command to weak random values as the nonce is mainly
3642         for being a probabilistically unique global identifier for hand shakes, instead of
3643         preventing replay attacks. Otherwise, it might exhaust system entropy unnecessarily.
3644
3645         The patch also removes all logging when debugging the test case flakiness.
3646
3647         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
3648         (WebKit::AuthenticatorManager::respondReceived):
3649         (WebKit::AuthenticatorManager::initTimeOutTimer):
3650         (WebKit::AuthenticatorManager::timeOutTimerFired):
3651         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
3652         (WebKit::HidService::deviceAdded):
3653         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
3654         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
3655         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
3656         (WebKit::MockHidConnection::send):
3657         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
3658         (WebKit::CtapHidAuthenticator::makeCredential):
3659         (WebKit::CtapHidAuthenticator::getAssertion):
3660         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
3661         (WebKit::CtapHidDriver::Worker::write):
3662         (WebKit::CtapHidDriver::Worker::read):
3663         (WebKit::CtapHidDriver::Worker::returnMessage):
3664         (WebKit::CtapHidDriver::transact):
3665         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
3666         (WebKit::CtapHidDriver::continueAfterResponseReceived):
3667
3668 2019-01-10  Timothy Hatcher  <timothy@apple.com>
3669
3670         Add WKBundlePage SPI to temporarily force light or dark appearance on a page.
3671         https://bugs.webkit.org/show_bug.cgi?id=193327
3672         rdar://problem/47093222
3673
3674         Reviewed by Tim Horton.
3675
3676         Tests: WebKit.ForceLightAppearanceInBundle API Test
3677
3678         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3679         (WKBundlePageSetUseDarkAppearance): Added.
3680         (WKBundlePageIsUsingDarkAppearance): Added.
3681         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
3682
3683 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
3684
3685         DeviceID hash salt manager can be NULL
3686         https://bugs.webkit.org/show_bug.cgi?id=193334
3687         <rdar://problem/47179650>
3688
3689         Reviewed by Youenn Fablet.
3690
3691         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3692         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): No need to
3693         NULL-check websiteDataStore.deviceIdHashSaltStorage, it is a Ref.
3694         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
3695         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
3696         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
3697
3698         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3699         (WebKit::WebsiteDataStore::WebsiteDataStore): m_deviceIdHashSaltStorage is a Ref.
3700         (WebKit::WebsiteDataStore::fetchDataAndApply): Ditto.
3701         (WebKit::WebsiteDataStore::removeData): Ditto.
3702         * UIProcess/WebsiteData/WebsiteDataStore.h:
3703         (WebKit::WebsiteDataStore::deviceIdHashSaltStorage): Ditto.
3704
3705 2019-01-10  Per Arne Vollan  <pvollan@apple.com>
3706
3707         [macOS] Add name of IORegistry key in sandbox.
3708         https://bugs.webkit.org/show_bug.cgi?id=193335
3709         <rdar://problem/47184951>
3710
3711         Reviewed by Alexey Proskuryakov.
3712
3713         The property IOGVAHEVCDecodeCapabilities was added in https://bugs.webkit.org/show_bug.cgi?id=193324.
3714         Also, the property IOGVAHEVCEncodeCapabilities needs to be added.
3715
3716         * WebProcess/com.apple.WebProcess.sb.in:
3717
3718 2019-01-10  Zalan Bujtas  <zalan@apple.com>
3719
3720         REGRESSION (r237658): Tap highlight limits cause the highlight to no longer show with legitimate button sizes
3721         https://bugs.webkit.org/show_bug.cgi?id=193294
3722         <rdar://problem/46006678>
3723
3724         Reviewed by Simon Fraser.
3725
3726         Input type elements should always paint tap highlight (ignore size heuristic). 
3727
3728         * UIProcess/PageClient.h:
3729         * UIProcess/WebPageProxy.h:
3730         * UIProcess/WebPageProxy.messages.in:
3731         * UIProcess/ios/PageClientImplIOS.h:
3732         * UIProcess/ios/PageClientImplIOS.mm:
3733         (WebKit::PageClientImpl::didGetTapHighlightGeometries):
3734         * UIProcess/ios/WKContentViewInteraction.h:
3735         * UIProcess/ios/WKContentViewInteraction.mm:
3736         (-[WKContentView _showTapHighlight]):
3737         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
3738         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
3739         * UIProcess/ios/WebPageProxyIOS.mm:
3740         (WebKit::WebPageProxy::didGetTapHighlightGeometries):
3741         * WebProcess/WebPage/ios/WebPageIOS.mm:
3742         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
3743
3744 2019-01-10  Alexey Proskuryakov  <ap@apple.com>
3745
3746         Remove unneeded XPCService variant for plugin service
3747         https://bugs.webkit.org/show_bug.cgi?id=193326
3748
3749         Reviewed by Tim Horton.
3750
3751         * Configurations/PluginService.32.xcconfig: Removed.
3752         * Configurations/PluginService.64.xcconfig:
3753         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Removed.
3754         * PluginProcess/EntryPoint/mac/XPCService/PluginService.64.Info.plist: Copied from Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist.
3755         * WebKit.xcodeproj/project.pbxproj:
3756
3757 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
3758
3759         Define page media state flags for display capture.
3760         https://bugs.webkit.org/show_bug.cgi?id=193230
3761         <rdar://problem/47095142>
3762
3763         Reviewed by Youenn Fablet.
3764
3765         * UIProcess/API/C/WKPage.cpp:
3766         (WKPageGetMediaState):
3767         * UIProcess/API/C/WKPagePrivate.h:
3768         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3769         (WebKit::UserMediaCaptureManager::Source::Source):
3770         (WebKit::UserMediaCaptureManager::createCaptureSource):
3771
3772 2019-01-10  Alex Christensen  <achristensen@webkit.org>
3773
3774         REGRESSION(r239815) http/tests/workers/service/serviceworker-private-browsing.https.html test times out
3775         https://bugs.webkit.org/show_bug.cgi?id=193325
3776
3777         Reviewed by Joseph Pecoraro.
3778
3779         InjectedBundle::setPrivateBrowsingEnabled effectively didn't do anything when enabled was false.
3780         I made it destroy the legacy private browsing session in the NetworkProcess, which caused a test to time out.
3781         This functionality is only used for testing, so it's no big deal to revert that part of the patch.
3782
3783         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3784         (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession): Deleted.
3785         * NetworkProcess/NetworkConnectionToWebProcess.h:
3786         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3787         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3788         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
3789         * WebProcess/WebProcess.cpp:
3790         (WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
3791         * WebProcess/WebProcess.h:
3792
3793 2019-01-10  Per Arne Vollan  <pvollan@apple.com>
3794
3795         [macOS] Add name of IORegistry key in sandbox.
3796         https://bugs.webkit.org/show_bug.cgi?id=193324
3797
3798         Reviewed by Brent Fulgham.
3799
3800         IOGVAVTCapabilities key has been changed to IOGVAHEVCDecodeCapabilities.
3801
3802         * WebProcess/com.apple.WebProcess.sb.in:
3803
3804 2019-01-10  John Wilander  <wilander@apple.com>
3805
3806         Override the session configuration for cookieAcceptPolicy
3807         https://bugs.webkit.org/show_bug.cgi?id=190925
3808         <rdar://problem/45497382>
3809
3810         Reviewed by Alexey Proskuryakov and Alex Christensen.
3811
3812         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3813         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3814             Now sets cookieStorage._overrideSessionCookieAcceptPolicy to YES.
3815
3816 2019-01-09  Matt Rajca  <mrajca@apple.com>
3817
3818         Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
3819         https://bugs.webkit.org/show_bug.cgi?id=193301
3820
3821         Reviewed by Jer Noble.
3822
3823         Register a new quirk that can be configured per-load for per-document media
3824         autoplay behaviors.
3825
3826         * Shared/WebsiteAutoplayQuirk.h:
3827         * Shared/WebsitePoliciesData.cpp:
3828         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
3829         * UIProcess/API/C/WKWebsitePolicies.cpp:
3830         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
3831         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
3832         * UIProcess/API/C/WKWebsitePolicies.h:
3833         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3834         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3835         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
3836         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
3837
3838 2019-01-10  Tim Horton  <timothy_horton@apple.com>
3839
3840         Rename some entitlements files to be more clear about their target platform
3841         https://bugs.webkit.org/show_bug.cgi?id=193311
3842
3843         Reviewed by Alexey Proskuryakov.
3844
3845         * Configurations/Network-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/Network-iOS-minimalsimulator.entitlements.
3846         * Configurations/NetworkService.xcconfig:
3847         * Configurations/WebContent-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/WebContent-iOS-minimalsimulator.entitlements.
3848         * Configurations/WebContentService.xcconfig:
3849         * WebKit.xcodeproj/project.pbxproj:
3850
3851 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
3852
3853         Unreviewed build fix after r239816.
3854
3855         Although EWS had no problem with the patch, I'm seeing build errors on the actual bots.
3856         This patch corrects the problem.
3857
3858         * NetworkProcess/NetworkProcess.cpp:
3859         (WebKit::NetworkProcess::logFrameNavigation):
3860         (WebKit::NetworkProcess::logUserInteraction):
3861
3862 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
3863
3864         Create a WebResourceLoadStatisticsStore attached to the NetworkSession
3865         https://bugs.webkit.org/show_bug.cgi?id=193261
3866         <rdar://problem/47158616>
3867
3868         Reviewed by Alex Christensen.
3869
3870         This patch modifies NetworkSession so that it owns a WebResourceLoadStatisticsStore
3871         object. This object is only created if the ResourceLoadStatistics feature is turned on.
3872
3873         The patch also modifies WebResourceLoadStatisticsStore so that it can be constructed
3874         with an owning NetworkSession as an alternative to the current practice of using a
3875         WebsiteDataStore object.
3876
3877         Two initial messages from the WebContent process are added (logFrameNavigation and
3878         logUserNavigation) that notify the network process of these actions. Currently they
3879         are called in addition the calls to the WebsiteDataStore object. These redundant calls
3880         will be removed in a future patch.
3881
3882         This patch forces the ResourceLoadStatistics code in the NetworkSession to be off by
3883         default, so there should be no change in behavior with this patch.
3884
3885         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3886         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
3887         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3888         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3889         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
3890         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
3891         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
3892         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
3893         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
3894         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
3895         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3896         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources):
3897         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
3898         (WebKit::WebResourceLoadStatisticsStore::updatePrevalentDomainsToBlockCookiesFor):
3899         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
3900         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
3901         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
3902         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3903         * NetworkProcess/NetworkProcess.cpp:
3904         (WebKit::NetworkProcess::initializeNetworkProcess):
3905         (WebKit::NetworkProcess::logFrameNavigation):
3906         (WebKit::NetworkProcess::logUserInteraction):
3907         * NetworkProcess/NetworkProcess.h:
3908         * NetworkProcess/NetworkProcess.messages.in:
3909         * NetworkProcess/NetworkSession.cpp:
3910         (WebKit::NetworkSession::enableResourceLoadStatistics):
3911         * NetworkProcess/NetworkSession.h:
3912         (WebKit::NetworkSession::resourceLoadStatistics const):
3913         * NetworkProcess/NetworkSessionCreationParameters.cpp:
3914         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
3915         (WebKit::NetworkSessionCreationParameters::encode const):
3916         (WebKit::NetworkSessionCreationParameters::decode):
3917         * NetworkProcess/NetworkSessionCreationParameters.h:
3918         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3919         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3920         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3921         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3922         * UIProcess/Network/NetworkProcessProxy.cpp:
3923         (WebKit::NetworkProcessProxy::didLogUserInteraction):
3924         * UIProcess/Network/NetworkProcessProxy.h:
3925         * UIProcess/Network/NetworkProcessProxy.messages.in:
3926         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3927         (WebsiteDataStore::parameters):
3928         * UIProcess/WebPageProxy.cpp:
3929         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3930         (WebKit::WebPageProxy::logFrameNavigation):
3931         * UIProcess/WebPageProxy.h:
3932         * UIProcess/WebProcessPool.cpp:
3933         (WebKit::WebProcessPool::ensureNetworkProcess):
3934         (WebKit::WebProcessPool::initializeNewWebProcess):
3935
3936 2019-01-09  Alex Christensen  <achristensen@webkit.org>
3937
3938         Replace SessionTracker with HashMap member of NetworkProcess
3939         https://bugs.webkit.org/show_bug.cgi?id=193266
3940
3941         Reviewed by Joseph Pecoraro.
3942
3943         * NetworkProcess/Downloads/DownloadManager.cpp:
3944         (WebKit::DownloadManager::startDownload):
3945         * NetworkProcess/Downloads/DownloadManager.h:
3946         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
3947         (WebKit::Download::resume):
3948         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3949         (WebKit::NetworkCORSPreflightChecker::startPreflight):
3950         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3951         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
3952         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3953         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
3954         (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession):
3955         * NetworkProcess/NetworkConnectionToWebProcess.h:
3956         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3957         * NetworkProcess/NetworkProcess.cpp:
3958         (WebKit::NetworkProcess::initializeNetworkProcess):
3959         (WebKit::NetworkProcess::clearCachedCredentials):
3960         (WebKit::NetworkProcess::networkSession):
3961         (WebKit::NetworkProcess::setSession):
3962         (WebKit::NetworkProcess::destroySession):
3963         (WebKit::NetworkProcess::preconnectTo):
3964         * NetworkProcess/NetworkProcess.h:
3965         * NetworkProcess/NetworkResourceLoader.cpp:
3966         (WebKit::NetworkResourceLoader::startNetworkLoad):
3967         (WebKit::NetworkResourceLoader::didFinishLoading):
3968         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
3969         (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
3970         (WebKit::NetworkResourceLoader::logCookieInformation const):
3971         (WebKit::logBlockedCookieInformation):
3972         (WebKit::logCookieInformationInternal):
3973         (WebKit::NetworkResourceLoader::logCookieInformation):
3974         * NetworkProcess/NetworkResourceLoader.h:
3975         * NetworkProcess/PingLoad.cpp:
3976         (WebKit::PingLoad::loadRequest):
3977         * NetworkProcess/PingLoad.h:
3978         * NetworkProcess/PreconnectTask.cpp:
3979         (WebKit::PreconnectTask::PreconnectTask):
3980         * NetworkProcess/PreconnectTask.h: