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