[iOS] Treat a two-finger single tap as if the user tapped with the Cmd key pressed
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-09-03  Antoine Quint  <graouts@apple.com>
2
3         [iOS] Treat a two-finger single tap as if the user tapped with the Cmd key pressed
4         https://bugs.webkit.org/show_bug.cgi?id=201420
5         <rdar://problem/53207786>
6
7         Reviewed by Simon Fraser.
8
9         Set the metaKey modifier to true when generating a click event based on a two-finger single tap. This is important so that sites like Google and DuckDuckGo
10         correctly open links in their search results page in a new tab in Safari on iOS. This currently doesn't work because those sites will call preventDefault()
11         if the metaKey flag isn't set on a "click" event, and if it is set, they let the browser handle the navigation themselves.
12
13         * UIProcess/ios/WKContentViewInteraction.mm:
14         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
15
16 2019-08-28  Brent Fulgham  <bfulgham@apple.com>
17
18         [macOS] Correct sandbox violation in Flash plugin
19         https://bugs.webkit.org/show_bug.cgi?id=201228
20         <rdar://problem/54347503>
21
22         Reviewed by Alex Christensen.
23
24         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
25
26 2019-09-03  Carlos Garcia Campos  <cgarcia@igalia.com>
27
28         [WPE][GTK] Deprecate nonfunctional process limit APIs
29         https://bugs.webkit.org/show_bug.cgi?id=193749
30
31         Reviewed by Žan Doberšek.
32
33         * UIProcess/API/glib/WebKitWebContext.cpp:
34         (webkitWebContextConstructed):
35         (webkit_web_context_set_process_model):
36         (webkit_web_context_get_process_model):
37         (webkit_web_context_set_web_process_count_limit):
38         (webkit_web_context_get_web_process_count_limit):
39         * UIProcess/API/gtk/WebKitWebContext.h:
40         * UIProcess/API/wpe/WebKitWebContext.h:
41
42 2019-09-02  Youenn Fablet  <youenn@apple.com>
43
44         Make NetworkConnectionToWebProcess keyed by their WebProcess identifier
45         https://bugs.webkit.org/show_bug.cgi?id=201300
46
47         Reviewed by Alex Christensen.
48
49         Make sure to create each NetworkConnectionToWebProcess for a given WebProcess.
50         Pass the process identifier at creation time.
51         This will allow to have the message registry be moved to NetworkProcess
52         so as to check port activity between processes.
53         This identifier might also be used in the future for other connections like
54         service worker context/client/server identifiers.
55
56         No observable change of behavior.
57
58         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
59         (WebKit::NetworkConnectionToWebProcess::create):
60         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
61         * NetworkProcess/NetworkConnectionToWebProcess.h:
62         (WebKit::NetworkConnectionToWebProcess::webProcessIdentifier const):
63         * NetworkProcess/NetworkProcess.cpp:
64         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
65         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
66         (WebKit::NetworkProcess::actualPrepareToSuspend):
67         (WebKit::NetworkProcess::resume):
68         * NetworkProcess/NetworkProcess.h:
69         * NetworkProcess/NetworkProcess.messages.in:
70         * Platform/IPC/Connection.h:
71         (IPC::Connection::sendWithAsyncReply):
72         Allow to pass send options.
73         * UIProcess/Network/NetworkProcessProxy.cpp:
74         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
75         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
76         Make use of async reply to simplify the handling of lambdas.
77         (WebKit::NetworkProcessProxy::openNetworkProcessConnection):
78         (WebKit::NetworkProcessProxy::didFinishLaunching):
79         * UIProcess/Network/NetworkProcessProxy.h:
80         * UIProcess/Network/NetworkProcessProxy.messages.in:
81
82 2019-09-02  Youenn Fablet  <youenn@apple.com>
83
84         Introduce WorkerMessagePortChannelRegistry
85         https://bugs.webkit.org/show_bug.cgi?id=201333
86
87         Reviewed by Alex Christensen.
88
89         By introducing WorkerMessagePortChannelRegistry, we are making
90         sure UIMessagePortChannelProvider is only called from the main thread.
91         This will help when moving the registry to network process.
92
93         * UIProcess/UIMessagePortChannelProvider.cpp:
94         (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
95         (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
96         * UIProcess/UIMessagePortChannelProvider.h:
97         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
98         (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
99         (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
100         (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
101         (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
102         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
103
104 2019-09-01  Youenn Fablet  <youenn@apple.com>
105
106         Abstract out LibWebRTCSocketClient so that rtc sockets can be implemented without libwebrtc sockets
107         https://bugs.webkit.org/show_bug.cgi?id=201302
108
109         Reviewed by Alex Christensen.
110
111         Introduce NetworkRTCProvider::Socket to be able to implement RTC socket support with non libwebrtc API
112
113         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
114         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
115         (WebKit::NetworkRTCProvider::createSocket):
116         (WebKit::NetworkRTCProvider::createUDPSocket):
117         (WebKit::NetworkRTCProvider::createServerTCPSocket):
118         (WebKit::NetworkRTCProvider::proxyInfoFromSession):
119         (WebKit::NetworkRTCProvider::createClientTCPSocket):
120         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
121         (WebKit::NetworkRTCProvider::addSocket):
122         (WebKit::NetworkRTCProvider::takeSocket):
123         (WebKit::NetworkRTCProvider::newConnection):
124         (WebKit::NetworkRTCProvider::closeListeningSockets):
125         (WebKit::NetworkRTCProvider::callSocket):
126         * NetworkProcess/webrtc/NetworkRTCProvider.h:
127         * NetworkProcess/webrtc/NetworkRTCProvider.mm:
128         (WebKit::NetworkRTCProvider::createClientTCPSocket):
129         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
130         (WebKit::NetworkRTCSocket::sendTo):
131         (WebKit::NetworkRTCSocket::close):
132         (WebKit::NetworkRTCSocket::setOption):
133
134 2019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>
135
136         [Cairo] out-of-bounds read in ShareableBitmap::paint if a fractional device scale factor is used
137         https://bugs.webkit.org/show_bug.cgi?id=196340
138
139         Reviewed by Brent Fulgham.
140
141         In ShareableBitmap::paint, srcRectScaled can be out-of-bounds of
142         the surface if a fractional device scale factor is used.
143
144         * Shared/cairo/ShareableBitmapCairo.cpp:
145         (WebKit::ShareableBitmap::paint): Use cairoSurfaceSetDeviceScale
146         to set a device scale factor to the surface instead of multiplying
147         srcRect with a device scale factor.
148
149 2019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>
150
151         Unreviewed, rolling out r249366.
152
153         WinCairo WebKit2 crashes in some websites and the device scale
154         factor is not correct in high DPI.
155
156         Reverted changeset:
157
158         "[WinCairo, FTW] Properly handle device scale factor"
159         https://bugs.webkit.org/show_bug.cgi?id=201361
160         https://trac.webkit.org/changeset/249366
161
162 2019-09-01  Wenson Hsieh  <wenson_hsieh@apple.com>
163
164         Long presses that interrupt accelerated scrolling dispatch clicks on apps linked against iOS 12 or earlier
165         https://bugs.webkit.org/show_bug.cgi?id=201346
166         <rdar://problem/54885784>
167
168         Reviewed by Dean Jackson.
169
170         For apps that are linked on or after iOS 13, we add a context menu interaction to the content view, which
171         requires us to disable (or avoid adding) the highlight long press gesture recognizer. However, for apps that are
172         linked on the iOS 12 SDK or prior, this gesture is still present, and fires when long pressing for (roughly) up
173         to 0.75 seconds if a tap gesture was not recognized instead. Firing this gesture sends a click event to the
174         page; this brings back some form of <rdar://problem/53889373>, but only when holding for slightly longer than a
175         normal tap, and also only in apps linked on iOS 12 or earlier. To fix this, we apply a similar solution as in
176         r248433 and detect whether a long press gesture interrupted scroll view deceleration in
177         -gestureRecognizerShouldBegin:. If so, we return NO to avoid clicking. See per-method comments below for more
178         details.
179
180         Testing this bug as-is was tricky, since there's no way in layout tests to simulate being linked on or before a
181         given SDK version. Luckily, recall that:
182         1. This bug occurs when the highlight gesture recognizer is enabled and added to the content view.
183         2. The highlight gesture recognizer only needs to be disabled or removed when context menu interaction is added.
184         As such, we should be able to restore the highlight gesture recognizer by suppressing the context menu
185         interaction in an app linked-on-or-after iOS 13, by setting allowsLinkPreview to NO. Unfortunately, this doesn't
186         quite work, since we currently always avoid adding the highlight gesture recognizer if the app is linked on
187         iOS 13 or later.
188
189         However, this means that the highlight gesture recognizer is absent from the content view in apps linked against
190         iOS 13 that disable link previews, even though its absence is not required. This means that long pressing a
191         clickable element in a web view that disables link previews does not show a tap highlight on iOS 13, whereas it
192         would on iOS 12; this is a regression, albeit a very subtle one. To fix this subtle issue and make it possible
193         to write a test for this bug, we refactor some logic for creating and configuring the highlight long press
194         gesture, such that we now unconditionally add the highlight gesture, but only enable it in apps linked on or
195         after iOS 13 if link previews (i.e. context menu interaction) are not allowed.
196
197         Test: fast/scrolling/ios/click-events-after-long-press-during-momentum-scroll-in-overflow.html
198
199         * SourcesCocoa.txt:
200         * UIProcess/API/Cocoa/WKWebView.mm:
201         (-[WKWebView setAllowsLinkPreview:]):
202         * UIProcess/ios/WKContentViewInteraction.h:
203         * UIProcess/ios/WKContentViewInteraction.mm:
204         (-[WKContentView setupInteraction]):
205
206         Refactor our gesture setup logic to always create and add the long press and highlight long press gestures, but
207         conditionally disable them based on whether or not (1) the context menu is available, and (2) WKWebView's
208         allowsLinkPreview property.
209
210         (-[WKContentView _didChangeLinkPreviewAvailability]):
211         (-[WKContentView _updateLongPressAndHighlightLongPressGestures]):
212
213         Add a new helper to update the enabled state of the long press and highlight long press gestures, by consulting
214         -_shouldUseContextMenu and -allowsLinkPreview. This is called when setting up the gestures, as well as whenever
215         -allowsLinkPreview changes.
216
217         (-[WKContentView gestureRecognizerShouldBegin:]):
218
219         Factor out logic to ascend the view hierarchy in search of a UIScrollView that was interrupted while
220         decelerating into a local lambda function; use this for both the highlight gesture and the single tap gesture,
221         to determine whether they should begin.
222
223         * UIProcess/ios/WKHighlightLongPressGestureRecognizer.h: Added.
224         * UIProcess/ios/WKHighlightLongPressGestureRecognizer.mm: Added.
225
226         In order to remember the UIScrollView (if any) tracked by the highlight long press gesture, we subclass
227         _UIWebHighlightLongPressGestureRecognizer. While UILongPressGestureRecognizer does have SPI to ask for a list of
228         UITouches, by the time the gesture has been recognized and the gesture delegates are invoked, these UITouches
229         no longer correspond to UIViews. As such, the only time we have access to the list of UITouches with their
230         UIViews is during the touches* subclass hooks.
231
232         (-[WKHighlightLongPressGestureRecognizer reset]):
233
234         Clear out the tracked UIScrollView here, when the gesture is reset (i.e. after ending, or being canceled).
235
236         (-[WKHighlightLongPressGestureRecognizer touchesBegan:withEvent:]):
237
238         Remember the last touched UIScrollView here.
239
240         (-[WKHighlightLongPressGestureRecognizer lastTouchedScrollView]):
241         * WebKit.xcodeproj/project.pbxproj:
242
243 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
244
245         [WinCairo, FTW] Properly handle device scale factor
246         https://bugs.webkit.org/show_bug.cgi?id=201361
247
248         Reviewed by Don Olmstead.
249
250         Update the WebView and WebProcess to correctly handle
251         the device scale factor.
252
253         * UIProcess/win/WebView.cpp:
254         (WebKit::WebView::WebView): Tell the page the current device scale factor.
255         * WebProcess/win/WebProcessMainWin.cpp:
256         (WebKit::WebProcessMainWin): Tell the process to be aware of device scale.
257
258 2019-08-31  Chris Dumez  <cdumez@apple.com>
259
260         DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID
261         https://bugs.webkit.org/show_bug.cgi?id=201364
262
263         Reviewed by John Wilander.
264
265         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
266         (WebKit::WebChromeClient::hasStorageAccess):
267         (WebKit::WebChromeClient::requestStorageAccess):
268         * WebProcess/WebCoreSupport/WebChromeClient.h:
269         * WebProcess/WebPage/WebPage.cpp:
270         (WebKit::WebPage::hasStorageAccess):
271         (WebKit::WebPage::requestStorageAccess):
272         * WebProcess/WebPage/WebPage.h:
273
274 2019-08-30  Chris Dumez  <cdumez@apple.com>
275
276         WebPage::fromCorePage() to take and return a C++ reference
277         https://bugs.webkit.org/show_bug.cgi?id=201367
278
279         Reviewed by Antti Koivisto.
280
281         * WebProcess/InjectedBundle/InjectedBundle.cpp:
282         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
283         * WebProcess/WebPage/VisitedLinkTableController.cpp:
284         (WebKit::VisitedLinkTableController::addVisitedLink):
285         * WebProcess/WebPage/WebFrame.cpp:
286         (WebKit::WebFrame::page const):
287         * WebProcess/WebPage/WebPage.cpp:
288         (WebKit::WebPage::fromCorePage):
289         * WebProcess/WebPage/WebPage.h:
290         * WebProcess/WebPage/WebPageOverlay.cpp:
291         (WebKit::WebPageOverlay::willMoveToPage):
292         (WebKit::WebPageOverlay::didMoveToPage):
293         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
294         (WebKit::StorageNamespaceImpl::copy):
295         * WebProcess/WebStorage/StorageNamespaceImpl.h:
296         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
297         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
298
299 2019-08-30  Chris Dumez  <cdumez@apple.com>
300
301         [PSON] We no longer need to throw away suspended pages in a process before using it for a navigation
302         https://bugs.webkit.org/show_bug.cgi?id=201344
303
304         Reviewed by Antti Koivisto.
305
306         We no longer need to throw away suspended pages in a process before using it for a navigation, now that
307         Bug 201225 has been fixed. WebPage objects (suspended or live) in the process now have distinct
308         identifiers and can coexist.
309
310         * Shared/API/Cocoa/RemoteObjectRegistry.h:
311         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
312         (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
313         * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp:
314         (WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry):
315         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
316         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
317         (WebKit::WebRemoteObjectRegistry::close):
318
319 2019-08-30  Chris Dumez  <cdumez@apple.com>
320
321         Assertion hit when saving to PDF from printing dialog
322         https://bugs.webkit.org/show_bug.cgi?id=201351
323
324         Reviewed by Tim Horton.
325
326         [WKPrintingView knowsPageRange:] may get called from a background thread and ends up calling
327         WeakPtr::get() which asserts because it is generally unsafe to get the raw pointer from a
328         WeakPtr to an object owned by another thread. However, the methods here merely want to null
329         check it so add a thread-safe method (pageIsClosed()) to WebFrameProxy for it.
330
331         * UIProcess/WebFrameProxy.h:
332         (WebKit::WebFrameProxy::pageIsClosed const):
333         * UIProcess/mac/WKPrintingView.mm:
334         (-[WKPrintingView knowsPageRange:]):
335
336 2019-08-30  Alex Christensen  <achristensen@webkit.org>
337
338         Remove HAVE_CFNETWORK_WITH_AUTO_ADDED_HTTP_HEADER_SUPPRESSION_SUPPORT conditional
339         https://bugs.webkit.org/show_bug.cgi?id=201280
340
341         Reviewed by Youenn Fablet.
342
343         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
344         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
345
346 2019-08-30  Alex Christensen  <achristensen@webkit.org>
347
348         Remove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional
349         https://bugs.webkit.org/show_bug.cgi?id=201279
350
351         Reviewed by Darin Adler.
352
353         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
354         (ignoreHSTS):
355         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
356         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
357         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
358
359 2019-08-30  Alex Christensen  <achristensen@webkit.org>
360
361         Allow process cache to cache processes when using a non-default persistent WebsiteDataStore
362         https://bugs.webkit.org/show_bug.cgi?id=201329
363
364         Reviewed by Chris Dumez.
365
366         Treat all persistent sessions the same when deciding whether to clear all cached web processes using a particular website data store.
367         This removes a huge performance regression on warm plt when switching to using a non-default persistent session.
368         I also removed a call to removeSession which is redundant with the one in the WebsiteDataStore destructor, which is where it should be.
369
370         * UIProcess/WebProcessCache.cpp:
371         (WebKit::WebProcessCache::canCacheProcess const):
372         * UIProcess/WebProcessPool.cpp:
373         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
374         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
375
376 2019-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>
377
378         Caret does not appear in text field inside a transformed, overflow: hidden container
379         https://bugs.webkit.org/show_bug.cgi?id=201317
380         <rdar://problem/54859264>
381
382         Reviewed by Simon Fraser.
383
384         Adjust isTransparentOrFullyClipped to use the new methods in RenderLayer and RenderObject. See WebCore ChangeLog
385         for more details.
386
387         * WebProcess/WebPage/ios/WebPageIOS.mm:
388         (WebKit::WebPage::isTransparentOrFullyClipped const):
389
390 2019-08-30  Simon Fraser  <simon.fraser@apple.com>
391
392         Add system tracing points for compositing updates, and touch-event dispatching
393         https://bugs.webkit.org/show_bug.cgi?id=201327
394
395         Reviewed by Alex Christensen.
396         
397         TraceScope in EventDispatcher::dispatchTouchEvents().
398
399         * WebProcess/WebPage/EventDispatcher.cpp:
400         (WebKit::EventDispatcher::dispatchTouchEvents):
401
402 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
403
404         [FTW] Use DirectX SharedResource as basis for SharedBitmap
405         https://bugs.webkit.org/show_bug.cgi?id=201157
406
407         Reviewed by Alex Christensen.
408
409         Currently an ID2D1Bitmap is used as the backing store for the SharedBitmap that is the
410         base type for sharing data between the WebContent Process and the UIProcess. However, this
411         involves moving GPU memory to local memory, copying that memory into the SharedMemory member
412         of the SharedBitmap, then building a new GPU bitmap on the UIProcess side from that SharedMemory.
413
414         Profiling indicates that this is the single largest place FTW WebKit spends its time.
415
416         Instead, we should use Direct2D's ability to render to an IDXGISurface, which can be shared
417         between multiple processes. This should avoid the GPU->CPU copy, the Direct2D-allocated
418         CPU->Shared Memory copy, and the shared memory to GPU copy.
419
420         Reviewed by Alex Christensen.
421
422         * Platform/SharedMemory.h:
423         * Platform/win/SharedMemoryWin.cpp:
424         (WebKit::SharedMemory::Handle::encodeHandle): Added.
425         (WebKit::SharedMemory::Handle::encode const): Use new helper function.
426         (WebKit::SharedMemory::Handle::decodeHandle): Added.
427         (WebKit::SharedMemory::Handle::decode): Use new helper function.
428         * PlatformFTW.cmake: Add D3X11 libraries.
429         * Shared/ShareableBitmap.cpp:
430         (WebKit::ShareableBitmap::Configuration::encode const): Encode shared resource handle for DX texture.
431         (WebKit::ShareableBitmap::Configuration::decode): Ditto (but decode).
432         (WebKit::ShareableBitmap::ShareableBitmap): Create SharedResource (if needed).
433         (WebKit::ShareableBitmap::~ShareableBitmap): Add cleanup code for SharedResoure.
434         (WebKit::ShareableBitmap::numBytesForSize): Only allocate a small memory store when using GPU textures.
435         * Shared/ShareableBitmap.h:
436         (WebKit::ShareableBitmap::dxSurface):
437         * Shared/win/ShareableBitmapDirect2D.cpp:
438         (WebKit::ShareableBitmap::createSharedResource): Added.
439         (WebKit::ShareableBitmap::disposeSharedResource): Added.
440         (WebKit::ShareableBitmap::leakSharedResource): Added.
441         (WebKit::ShareableBitmap::createGraphicsContext): Update for new data types.
442         (WebKit::ShareableBitmap::paint): Ditto.
443         (WebKit::ShareableBitmap::createDirect2DSurface): Update for new data types.
444         (WebKit::ShareableBitmap::createImage): Ditto.
445         (WebKit::createSurfaceFromData): Deleted.
446         (WebKit::ShareableBitmap::sync): Deleted.
447         * UIProcess/BackingStore.cpp:
448         * UIProcess/BackingStore.h:
449         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
450         * UIProcess/WebPageProxy.cpp:
451         * UIProcess/WebPageProxy.h:
452         * UIProcess/win/BackingStoreDirect2D.cpp:
453         (WebKit::BackingStore::createBackend):
454         (WebKit::BackingStore::paint):
455         (WebKit::BackingStore::incorporateUpdate):
456         * UIProcess/win/PageClientImpl.cpp:
457         * UIProcess/win/WebPageProxyWin.cpp:
458         (WebKit::WebPageProxy::device const):
459         (WebKit::WebPageProxy::setDevice):
460         * UIProcess/win/WebView.cpp:
461         (WebKit::WebView::WebView): Initialize DirectX stuff.
462         (WebKit::WebView::paint): Use new DiretX drawing logic.
463         (WebKit::WebView::onSizeEvent): Update SwapChain's buffer sizes when resizing.
464         (WebKit::WebView::setupSwapChain): Added.
465         (WebKit::WebView::configureBackingStore): Added.
466         * UIProcess/win/WebView.h:
467         (WebKit::WebView::d3dDevice):
468         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
469         (WebKit::DrawingAreaCoordinatedGraphics::display):
470
471 2019-08-30  Chris Dumez  <cdumez@apple.com>
472
473         [PSON] Bump the WebPage's identifier every time we process-swap
474         https://bugs.webkit.org/show_bug.cgi?id=201225
475
476         Reviewed by Alex Christensen.
477
478         Every time we create a new WebPage object in a provisional process, we now assign it a new
479         identifier, instead of using the identifier of the WebPage in the committed process. This
480         will address issues with IPC when navigating back and forth between processes since we will
481         no longer be confused as to which WebPage the IPC is coming from. Also, this will allow
482         suspended WebPages to keep living in the process, even if we use the process for a new load
483         (will be done in a follow-up patch) since we will no longer have an identifier conflict.
484
485         * Scripts/webkit/messages.py:
486         * Shared/API/APIPageHandle.cpp:
487         (API::PageHandle::create):
488         (API::PageHandle::createAutoconverting):
489         (API::PageHandle::PageHandle):
490         (API::PageHandle::encode const):
491         (API::PageHandle::decode):
492         * Shared/API/APIPageHandle.h:
493         (API::PageHandle::pageProxyID const):
494         (API::PageHandle::webPageID const):
495         * Shared/API/Cocoa/WKBrowsingContextHandle.mm:
496         (-[WKBrowsingContextHandle _initWithPageProxy:]):
497         (-[WKBrowsingContextHandle _initWithPage:]):
498         (-[WKBrowsingContextHandle _initWithPageProxyID:andWebPageID:]):
499         (-[WKBrowsingContextHandle hash]):
500         (-[WKBrowsingContextHandle isEqual:]):
501         (-[WKBrowsingContextHandle encodeWithCoder:]):
502         (-[WKBrowsingContextHandle initWithCoder:]):
503         * Shared/API/Cocoa/WKBrowsingContextHandleInternal.h:
504         * Shared/WebPageCreationParameters.cpp:
505         (WebKit::WebPageCreationParameters::encode const):
506         (WebKit::WebPageCreationParameters::decode):
507         * Shared/WebPageCreationParameters.h:
508         * Shared/mac/ObjCObjectGraph.mm:
509         (WebKit::ObjCObjectGraph::encode):
510         (WebKit::ObjCObjectGraph::decode):
511         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
512         (-[WKBrowsingContextController handle]):
513         * UIProcess/API/Cocoa/WKWebView.mm:
514         (-[WKWebView dealloc]):
515         (-[WKWebView _remoteObjectRegistry]):
516         (-[WKWebView _handle]):
517         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
518         (webkitURISchemeRequestCreate):
519         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
520         (WebKit::WebProcessProxy::transformHandlesToObjects):
521         * UIProcess/Cocoa/WebViewImpl.mm:
522         (WebKit::WebViewImpl::~WebViewImpl):
523         (WebKit::WebViewImpl::remoteObjectRegistry):
524         * UIProcess/Network/NetworkProcessProxy.cpp:
525         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
526         (WebKit::NetworkProcessProxy::logDiagnosticMessage):
527         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
528         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
529         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
530         (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
531         (WebKit::NetworkProcessProxy::testProcessIncomingSyncMessagesWhenWaitingForSyncReply):
532         * UIProcess/ProvisionalPageProxy.cpp:
533         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
534         (WebKit::ProvisionalPageProxy::loadData):
535         (WebKit::ProvisionalPageProxy::loadRequest):
536         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
537         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
538         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
539         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
540         * UIProcess/ProvisionalPageProxy.h:
541         (WebKit::ProvisionalPageProxy::webPageID const):
542         * UIProcess/SuspendedPageProxy.h:
543         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
544         (WebKit::WebUserContentControllerProxy::didPostMessage):
545         * UIProcess/UserContent/WebUserContentControllerProxy.h:
546         * UIProcess/UserContent/WebUserContentControllerProxy.messages.in:
547         * UIProcess/VisitedLinkStore.cpp:
548         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
549         * UIProcess/VisitedLinkStore.h:
550         * UIProcess/VisitedLinkStore.messages.in:
551         * UIProcess/WebInspectorProxy.cpp:
552         (WebKit::WebInspectorProxy::createFrontendPage):
553         (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
554         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
555         * UIProcess/WebPageProxy.cpp:
556         (WebKit::WebPageProxy::swapToWebProcess):
557         (WebKit::WebPageProxy::loadRequest):
558         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
559         (WebKit::WebPageProxy::loadData):
560         (WebKit::WebPageProxy::loadDataWithNavigationShared):
561         (WebKit::WebPageProxy::commitProvisionalPage):
562         (WebKit::WebPageProxy::continueNavigationInNewProcess):
563         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
564         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
565         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
566         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
567         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
568         (WebKit::WebPageProxy::decidePolicyForResponse):
569         (WebKit::WebPageProxy::decidePolicyForResponseShared):
570         (WebKit::WebPageProxy::createNewPage):
571         (WebKit::WebPageProxy::creationParameters):
572         (WebKit::WebPageProxy::startURLSchemeTask):
573         (WebKit::WebPageProxy::startURLSchemeTaskShared):
574         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
575         * UIProcess/WebPageProxy.h:
576         * UIProcess/WebPageProxy.messages.in:
577         * UIProcess/WebProcessProxy.cpp:
578         (WebKit::WebProcessProxy::webPageFromCorePageIdentifier):
579         (WebKit::WebProcessProxy::didReceiveMessage):
580         (WebKit::WebProcessProxy::transformHandlesToObjects):
581         (WebKit::WebProcessProxy::transformObjectsToHandles):
582         * UIProcess/WebProcessProxy.h:
583         * UIProcess/WebURLSchemeHandler.cpp:
584         (WebKit::WebURLSchemeHandler::startTask):
585         (WebKit::WebURLSchemeHandler::taskCompleted):
586         * UIProcess/WebURLSchemeHandler.h:
587         * UIProcess/WebURLSchemeTask.cpp:
588         (WebKit::WebURLSchemeTask::create):
589         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
590         (WebKit::WebURLSchemeTask::didPerformRedirection):
591         (WebKit::WebURLSchemeTask::didReceiveResponse):
592         (WebKit::WebURLSchemeTask::didReceiveData):
593         (WebKit::WebURLSchemeTask::didComplete):
594         (WebKit::WebURLSchemeTask::pageDestroyed):
595         * UIProcess/WebURLSchemeTask.h:
596         (WebKit::WebURLSchemeTask::pageProxyID const):
597         (WebKit::WebURLSchemeTask::webPageID const):
598         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
599         (-[WKWebProcessPlugInBrowserContextController handle]):
600         (+[WKWebProcessPlugInBrowserContextController lookUpBrowsingContextFromHandle:]):
601         * WebProcess/UserContent/WebUserContentController.cpp:
602         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
603         (WebKit::WebChromeClient::createWindow):
604         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
605         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
606         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp:
607         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
608         (WebKit::WebRemoteObjectRegistry::close):
609         * WebProcess/WebPage/VisitedLinkTableController.cpp:
610         (WebKit::VisitedLinkTableController::addVisitedLink):
611         * WebProcess/WebPage/WebInspectorUI.cpp:
612         (WebKit::WebInspectorUI::establishConnection):
613         * WebProcess/WebPage/WebInspectorUI.h:
614         * WebProcess/WebPage/WebInspectorUI.messages.in:
615         * WebProcess/WebPage/WebPage.cpp:
616         * WebProcess/WebPage/WebPage.h:
617         (WebKit::WebPage::sessionStorageNamespaceIdentifier const):
618         (WebKit::WebPage::webPageProxyIdentifier const):
619         * WebProcess/WebProcess.cpp:
620         (WebKit::WebProcess::didReceiveMessage):
621         (WebKit::WebProcess::transformHandlesToObjects):
622         (WebKit::WebProcess::transformObjectsToHandles):
623         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
624         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
625         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
626         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
627         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
628         (WebKit::StorageNamespaceImpl::copy):
629         (WebKit::StorageNamespaceImpl::sessionStoragePageID const):
630         * WebProcess/WebStorage/StorageNamespaceImpl.h:
631         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
632         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
633         * WebProcess/cocoa/WebProcessCocoa.mm:
634         (WebKit::WebProcess::transformHandlesToObjects):
635
636 2019-08-30  Keith Rollin  <krollin@apple.com>
637
638         Remove AppKitCompatibilityDeclarations.h
639         https://bugs.webkit.org/show_bug.cgi?id=201283
640         <rdar://problem/54822042>
641
642         Reviewed by Alexey Proskuryakov.
643
644         The two copies of these files -- on in WTF, one in MiniBrowser -- are
645         empty and can be removed.
646
647         * WebKit2Prefix.h:
648
649 2019-08-30  Adrian Perez de Castro  <aperez@igalia.com>
650
651         [WPE][GTK] New API to remove a filter from an user content manager given its identifier
652         https://bugs.webkit.org/show_bug.cgi?id=200479
653
654         Reviewed by Carlos Garcia Campos.
655
656         * UIProcess/API/glib/WebKitUserContentManager.cpp:
657         (webkit_user_content_manager_remove_filter_by_id): Add new public API function.
658         * UIProcess/API/gtk/WebKitUserContentManager.h: Add declaration for
659         webkit_user_content_manager_remove_filter_by_id().
660         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: List new function.
661         * UIProcess/API/wpe/WebKitUserContentManager.h: Add declaration for
662         webkit_user_content_manager_remove_filter_by_id().
663         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: List new function.
664
665 2019-08-30  Pablo Saavedra  <psaavedra@igalia.com>
666
667         [GTK] Build failure in Debian Stable and Ubuntu LTS bots
668         https://bugs.webkit.org/show_bug.cgi?id=201337
669
670         Reviewed by Carlos Garcia Campos.
671
672         * UIProcess/gtk/WaylandCompositor.cpp:
673         (WebKit::WaylandCompositor::bindSurfaceToWebPage):
674
675 2019-08-30  Philippe Normand  <pnormand@igalia.com>
676
677         [WPE][Qt] loadingChanged signal parameter is unusable
678         https://bugs.webkit.org/show_bug.cgi?id=201301
679
680         Reviewed by Carlos Garcia Campos.
681
682         * UIProcess/API/wpe/qt/WPEQtView.h: Explicitely name signal
683         parameter. It is a runtime requirement for QML.
684
685 2019-08-29  Keith Rollin  <krollin@apple.com>
686
687         Remove HAVE_PASSKIT_GRANULAR_ERRORS conditional
688         https://bugs.webkit.org/show_bug.cgi?id=201278
689         <rdar://problem/54821052>
690
691         Reviewed by Alex Christensen.
692
693         HAVE_PASSKIT_GRANULAR_ERRORS is always True, so remove the conditional
694         tests, keeping the True branches and removing the False branches.
695
696         * Platform/cocoa/PaymentAuthorizationPresenter.mm:
697         (WebKit::PaymentAuthorizationPresenter::completePaymentSession):
698         (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection):
699         * Platform/cocoa/PaymentAuthorizationViewController.mm:
700         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
701         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
702         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
703         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
704         * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
705         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
706         (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
707         (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]):
708         (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
709         (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
710         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
711         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
712         (WebKit::toPKContactFields):
713         (WebKit::toNSSet):
714         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
715         (WebKit::toPKAddressField): Deleted.
716
717 2019-08-29  Chris Dumez  <cdumez@apple.com>
718
719         Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
720         https://bugs.webkit.org/show_bug.cgi?id=201318
721
722         Reviewed by Alex Christensen.
723
724         Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.
725
726         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
727         (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPathIsolatedCopy const):
728         (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath const):
729         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
730         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
731         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
732         (WebKit::NetworkCache::BlobStorage::blobDirectoryPathIsolatedCopy const):
733         (WebKit::NetworkCache::BlobStorage::synchronize):
734         (WebKit::NetworkCache::BlobStorage::blobPathForHash const):
735         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
736         * NetworkProcess/cache/NetworkCacheStorage.cpp:
737         (WebKit::NetworkCache::Storage::basePathIsolatedCopy const):
738         (WebKit::NetworkCache::Storage::versionPath const):
739         (WebKit::NetworkCache::Storage::recordsPathIsolatedCopy const):
740         (WebKit::NetworkCache::Storage::synchronize):
741         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey const):
742         (WebKit::NetworkCache::Storage::traverse):
743         (WebKit::NetworkCache::Storage::clear):
744         (WebKit::NetworkCache::Storage::shrink):
745         (WebKit::NetworkCache::Storage::deleteOldVersions):
746         * NetworkProcess/cache/NetworkCacheStorage.h:
747
748 2019-08-29  Keith Rollin  <krollin@apple.com>
749
750         Update .xcconfig symbols to reflect the current set of past and future product versions.
751         https://bugs.webkit.org/show_bug.cgi?id=200720
752         <rdar://problem/54305032>
753
754         Reviewed by Alex Christensen.
755
756         Remove version symbols related to old OS's we no longer support,
757         ensure that version symbols are defined for OS's we do support.
758
759         * Configurations/Base.xcconfig:
760         * Configurations/DebugRelease.xcconfig:
761         * Configurations/Version.xcconfig:
762
763 2019-08-29  Keith Rollin  <krollin@apple.com>
764
765         Invalid XPCServices symlinks are being created
766         https://bugs.webkit.org/show_bug.cgi?id=201320
767         <rdar://problem/54719612>
768
769         Reviewed by Dan Bernstein.
770
771         When performing incremental builds, errant XPCServices symlinks can be
772         created. For example, in the following, the second symlink is the
773         correct one. The first symlink gets created when the build process
774         tries to create the symlink and it already exists. When it already
775         exists, the command to create the symlink actually follows the
776         existing symlink and creates the (second) symlink at the location
777         where the first symlink points.
778
779             WebKit.framework/Versions/A/XPCServices/XPCServices@ -> Versions/Current/XPCServices
780             WebKit.framework/XPCServices@ -> Versions/Current/XPCServices
781
782         Address this by specifying -h to the `ln` command, which will cause it
783         to not follow symlinks if they already exist at the target.
784
785         Also, fix a benign issue where the Xcode build variable WRAPPER_NAME
786         was being referenced in a context where it wasn't defined.
787
788         * WebKit.xcodeproj/project.pbxproj:
789
790 2019-08-29  Alex Christensen  <achristensen@webkit.org>
791
792         Speculative loads should use the NetworkSession owning their Cache
793         https://bugs.webkit.org/show_bug.cgi?id=201314
794
795         Reviewed by Chris Dumez.
796
797         This provides a performance improvement when using non-default persistent WKWebsiteDataStores.
798
799         * NetworkProcess/NetworkSession.cpp:
800         (WebKit::NetworkSession::NetworkSession):
801         * NetworkProcess/cache/NetworkCache.cpp:
802         (WebKit::NetworkCache::Cache::open):
803         (WebKit::NetworkCache::Cache::Cache):
804         * NetworkProcess/cache/NetworkCache.h:
805         (WebKit::NetworkCache::Cache::sessionID const):
806         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
807         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
808
809 2019-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>
810
811         [iOS 13] Caret does not appear in text field if the body element is translated completely out of the viewport
812         https://bugs.webkit.org/show_bug.cgi?id=201287
813         <rdar://problem/54780864>
814
815         Reviewed by Tim Horton.
816
817         During EditorState computation, we use the hidden editable element heuristic to determine whether we should
818         begin suppressing selection gestures and UI. Currently, we use the editable root of the selection range to
819         determine where in the layer tree we should start our ascent, in search of a completely transparent or
820         completely clipped container.
821
822         However, in the case where the selection is inside a focused text field, this causes us to walk up the layer
823         tree starting at the RenderLayer corresponding to the text field's inner contenteditable div, which is different
824         than the text field's enclosing RenderLayer in the case where the containing block is transformed, such that no
825         part of it is within the visible viewport. This scenario is exercised by the below test case, in which the caret
826         after transforming the body horizontally by -100vw is hidden due to a false positive in the hidden editable area
827         heuristic.
828
829         Fix this by starting the layer tree ascent from the enclosing layer of the text form control if applicable,
830         instead of the inner editable area under the shadow root of the form control.
831
832         Test: editing/selection/ios/show-selection-in-transformed-container.html
833
834         * WebProcess/WebPage/ios/WebPageIOS.mm:
835         (WebKit::WebPage::platformEditorState const):
836
837 2019-08-29  Youenn Fablet  <youenn@apple.com>
838
839         Skip fetch event dispatching if no fetch event handler is added at script evaluation time
840         https://bugs.webkit.org/show_bug.cgi?id=201174
841
842         Reviewed by Chris Dumez.
843
844         Store whether a fetch event handler is set at script evaluation time.
845         If not, we skip the fetch event entirely so that the network load can start sooner.
846         If fetch event is skipped, we trigger soft update, as defined in
847         https://w3c.github.io/ServiceWorker/#handle-fetch step 16.
848
849         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
850         (WebKit::WebSWServerConnection::startFetch):
851         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
852         (WebKit::WebSWServerToContextConnection::softUpdate):
853         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
854         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
855         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
856         (WebKit::WebSWContextManagerConnection::serviceWorkerStarted):
857         (WebKit::WebSWContextManagerConnection::serviceWorkerFailedToStart):
858         (WebKit::WebSWContextManagerConnection::softUpdate):
859         * WebProcess/Storage/WebSWContextManagerConnection.h:
860         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
861
862 2019-08-29  Keith Rollin  <krollin@apple.com>
863
864         Remove support for macOS < 10.13 (part 3)
865         https://bugs.webkit.org/show_bug.cgi?id=201224
866         <rdar://problem/54795934>
867
868         Reviewed by Darin Adler.
869
870         Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
871         10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
872         like _MACOS_SINCE_1013.
873
874         * Configurations/WebKitTargetConditionals.xcconfig:
875
876 2019-08-29  Youenn Fablet  <youenn@apple.com>
877
878         Use WebPageProxy callbacks in case of authentication challenge received from Service Worker
879         https://bugs.webkit.org/show_bug.cgi?id=201177
880
881         Reviewed by Alex Christensen.
882
883         Send topOrigin for every possible load to NetworkProcess.
884         Send topOrigin as part of authentication challenge to UIProcess.
885
886         If there is no corresponding page for the pageID, try getting a page
887         related to the service worker using the topOrigin and send the challenge to it.
888
889         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
890         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
891         * NetworkProcess/NetworkCORSPreflightChecker.h:
892         * NetworkProcess/NetworkLoad.cpp:
893         (WebKit::NetworkLoad::didReceiveChallenge):
894         * NetworkProcess/NetworkLoadChecker.cpp:
895         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
896         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
897         * NetworkProcess/NetworkLoadChecker.h:
898         * NetworkProcess/NetworkLoadParameters.h:
899         * NetworkProcess/NetworkResourceLoadParameters.cpp:
900         (WebKit::NetworkResourceLoadParameters::encode const):
901         (WebKit::NetworkResourceLoadParameters::decode):
902         * NetworkProcess/NetworkResourceLoadParameters.h:
903         * NetworkProcess/NetworkResourceLoader.cpp:
904         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
905         * NetworkProcess/PingLoad.cpp:
906         (WebKit::PingLoad::PingLoad):
907         (WebKit::PingLoad::didReceiveChallenge):
908         * Shared/Authentication/AuthenticationManager.cpp:
909         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
910         * Shared/Authentication/AuthenticationManager.h:
911         * UIProcess/Network/NetworkProcessProxy.cpp:
912         (WebKit::NetworkProcessProxy::processAuthenticationChallenge):
913         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
914         * UIProcess/Network/NetworkProcessProxy.h:
915         * UIProcess/Network/NetworkProcessProxy.messages.in:
916         * UIProcess/WebPageProxy.cpp:
917         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
918         * UIProcess/WebPageProxy.h:
919         * WebProcess/Network/WebLoaderStrategy.cpp:
920         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
921         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
922         (WebKit::WebLoaderStrategy::startPingLoad):
923
924 2019-08-29  Chris Dumez  <cdumez@apple.com>
925
926         Dissociate the WebPageProxy's identifier from the WebPage's
927         https://bugs.webkit.org/show_bug.cgi?id=201233
928
929         Reviewed by Alex Christensen.
930
931         Dissociate the WebPageProxy's identifier from the WebPage's. This will allow bumping the
932         WebPage's identifier everytime we create a WebPage in a new process in case of process
933         swap on navigation (Bug 201225).
934
935         * Shared/WebBackForwardListItem.cpp:
936         (WebKit::WebBackForwardListItem::create):
937         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
938         * Shared/WebBackForwardListItem.h:
939         (WebKit::WebBackForwardListItem::pageID const):
940         * UIProcess/API/C/WKPage.cpp:
941         (WKPageSetPageLoaderClient):
942         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
943         (-[WKBrowsingContextController handle]):
944         * UIProcess/API/Cocoa/WKWebView.mm:
945         (-[WKWebView dealloc]):
946         (-[WKWebView _didCommitLayerTree:]):
947         (-[WKWebView _dispatchSetViewLayoutSize:]):
948         (-[WKWebView _cancelAnimatedResize]):
949         (-[WKWebView _remoteObjectRegistry]):
950         (-[WKWebView _handle]):
951         (-[WKWebView _focusTextInputContext:completionHandler:]):
952         (-[WKWebView _endAnimatedResize]):
953         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
954         (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
955         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
956         (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
957         * UIProcess/API/glib/WebKitWebContext.cpp:
958         (webkitWebContextGetWebViewForPage):
959         * UIProcess/API/glib/WebKitWebView.cpp:
960         (webkit_web_view_get_page_id):
961         * UIProcess/Automation/WebAutomationSession.cpp:
962         (WebKit::WebAutomationSession::handleForWebPageProxy):
963         (WebKit::WebAutomationSession::switchToBrowsingContext):
964         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
965         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
966         (WebKit::WebAutomationSession::navigationOccurredForFrame):
967         (WebKit::WebAutomationSession::documentLoadedForFrame):
968         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
969         (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
970         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
971         (WebKit::WebAutomationSession::willClosePage):
972         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
973         (WebKit::WebAutomationSession::resolveChildFrameHandle):
974         (WebKit::WebAutomationSession::resolveParentFrameHandle):
975         (WebKit::WebAutomationSession::computeElementLayout):
976         (WebKit::WebAutomationSession::selectOptionElement):
977         (WebKit::WebAutomationSession::getAllCookies):
978         (WebKit::WebAutomationSession::deleteSingleCookie):
979         (WebKit::WebAutomationSession::inputDispatcherForPage):
980         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
981         (WebKit::WebAutomationSession::simulateMouseInteraction):
982         (WebKit::WebAutomationSession::simulateKeyboardInteraction):
983         (WebKit::WebAutomationSession::performMouseInteraction):
984         (WebKit::WebAutomationSession::performKeyboardInteractions):
985         (WebKit::WebAutomationSession::takeScreenshot):
986         * UIProcess/Automation/WebAutomationSession.h:
987         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
988         (WebKit::WebAutomationSession::inspectBrowsingContext):
989         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
990         (WebKit::PlaybackSessionManagerProxy::PlaybackSessionManagerProxy):
991         (WebKit::PlaybackSessionManagerProxy::invalidate):
992         * UIProcess/Cocoa/TextCheckingController.mm:
993         (WebKit::TextCheckingController::replaceRelativeToSelection):
994         (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
995         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
996         (WebKit::VideoFullscreenManagerProxy::VideoFullscreenManagerProxy):
997         (WebKit::VideoFullscreenManagerProxy::invalidate):
998         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
999         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
1000         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
1001         (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver):
1002         (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver):
1003         (WebKit::WebPageProxy::speakingErrorOccurred):
1004         (WebKit::WebPageProxy::boundaryEventOccurred):
1005         (WebKit::WebPageProxy::voicesDidChange):
1006         * UIProcess/Cocoa/WebViewImpl.mm:
1007         (WebKit::WebViewImpl::~WebViewImpl):
1008         (WebKit::WebViewImpl::windowDidOrderOffScreen):
1009         (WebKit::WebViewImpl::windowDidOrderOnScreen):
1010         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
1011         (WebKit::WebViewImpl::viewDidHide):
1012         (WebKit::WebViewImpl::viewDidUnhide):
1013         (WebKit::WebViewImpl::activeSpaceDidChange):
1014         (WebKit::WebViewImpl::remoteObjectRegistry):
1015         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
1016         (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
1017         * UIProcess/InspectorTargetProxy.cpp:
1018         (WebKit::InspectorTargetProxy::connect):
1019         (WebKit::InspectorTargetProxy::disconnect):
1020         (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
1021         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
1022         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
1023         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
1024         (WebKit::WebNotificationManagerProxy::show):
1025         (WebKit::WebNotificationManagerProxy::cancel):
1026         (WebKit::WebNotificationManagerProxy::didDestroyNotification):
1027         (WebKit::pageIDsMatch):
1028         (WebKit::pageAndNotificationIDsMatch):
1029         (WebKit::WebNotificationManagerProxy::clearNotifications):
1030         (WebKit::WebNotificationManagerProxy::providerDidShowNotification):
1031         (WebKit::WebNotificationManagerProxy::providerDidClickNotification):
1032         * UIProcess/Notifications/WebNotificationManagerProxy.h:
1033         * UIProcess/ProvisionalPageProxy.cpp:
1034         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1035         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
1036         (WebKit::ProvisionalPageProxy::processDidTerminate):
1037         (WebKit::ProvisionalPageProxy::cancel):
1038         (WebKit::ProvisionalPageProxy::initializeWebPage):
1039         (WebKit::ProvisionalPageProxy::loadData):
1040         (WebKit::ProvisionalPageProxy::loadRequest):
1041         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
1042         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
1043         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
1044         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
1045         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
1046         * UIProcess/ProvisionalPageProxy.h:
1047         * UIProcess/RemoteWebInspectorProxy.cpp:
1048         (WebKit::RemoteWebInspectorProxy::load):
1049         (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend):
1050         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
1051         (WebKit::RemoteWebInspectorProxy::closeFrontendPageAndWindow):
1052         * UIProcess/SuspendedPageProxy.cpp:
1053         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1054         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1055         (WebKit::SuspendedPageProxy::unsuspend):
1056         (WebKit::SuspendedPageProxy::close):
1057         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
1058         (WebKit::SuspendedPageProxy::loggingString const):
1059         * UIProcess/SuspendedPageProxy.h:
1060         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1061         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
1062         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
1063         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
1064         * UIProcess/ViewGestureController.cpp:
1065         (WebKit::ViewGestureController::ViewGestureController):
1066         (WebKit::ViewGestureController::~ViewGestureController):
1067         (WebKit::ViewGestureController::disconnectFromProcess):
1068         (WebKit::ViewGestureController::connectToProcess):
1069         (WebKit::ViewGestureController::controllerForGesture):
1070         (WebKit::ViewGestureController::forceRepaintIfNeeded):
1071         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
1072         * UIProcess/ViewGestureController.h:
1073         * UIProcess/VisitedLinkStore.cpp:
1074         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
1075         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
1076         (WebKit::WebAuthenticatorCoordinatorProxy::WebAuthenticatorCoordinatorProxy):
1077         (WebKit::WebAuthenticatorCoordinatorProxy::~WebAuthenticatorCoordinatorProxy):
1078         * UIProcess/WebBackForwardList.cpp:
1079         (WebKit::WebBackForwardList::itemForID):
1080         (WebKit::WebBackForwardList::restoreFromState):
1081         * UIProcess/WebEditCommandProxy.cpp:
1082         (WebKit::WebEditCommandProxy::unapply):
1083         (WebKit::WebEditCommandProxy::reapply):
1084         * UIProcess/WebFrameProxy.cpp:
1085         (WebKit::WebFrameProxy::loadURL):
1086         (WebKit::WebFrameProxy::loadData):
1087         (WebKit::WebFrameProxy::stopLoading const):
1088         (WebKit::WebFrameProxy::collapseSelection):
1089         * UIProcess/WebFullScreenManagerProxy.cpp:
1090         (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
1091         (WebKit::WebFullScreenManagerProxy::~WebFullScreenManagerProxy):
1092         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
1093         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
1094         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
1095         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
1096         (WebKit::WebFullScreenManagerProxy::setAnimatingFullScreen):
1097         (WebKit::WebFullScreenManagerProxy::requestExitFullScreen):
1098         (WebKit::WebFullScreenManagerProxy::saveScrollPosition):
1099         (WebKit::WebFullScreenManagerProxy::restoreScrollPosition):
1100         (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
1101         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
1102         (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
1103         * UIProcess/WebInspectorProxy.cpp:
1104         (WebKit::WebInspectorProxy::WebInspectorProxy):
1105         (WebKit::WebInspectorProxy::invalidate):
1106         (WebKit::WebInspectorProxy::sendMessageToFrontend):
1107         (WebKit::WebInspectorProxy::connect):
1108         (WebKit::WebInspectorProxy::close):
1109         (WebKit::WebInspectorProxy::reset):
1110         (WebKit::WebInspectorProxy::updateForNewPageProcess):
1111         (WebKit::WebInspectorProxy::setFrontendConnection):
1112         (WebKit::WebInspectorProxy::showConsole):
1113         (WebKit::WebInspectorProxy::showResources):
1114         (WebKit::WebInspectorProxy::showMainResourceForFrame):
1115         (WebKit::WebInspectorProxy::attach):
1116         (WebKit::WebInspectorProxy::detach):
1117         (WebKit::WebInspectorProxy::togglePageProfiling):
1118         (WebKit::WebInspectorProxy::toggleElementSelection):
1119         (WebKit::WebInspectorProxy::createFrontendPage):
1120         (WebKit::WebInspectorProxy::openLocalInspectorFrontend):
1121         (WebKit::WebInspectorProxy::open):
1122         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
1123         (WebKit::WebInspectorProxy::attachAvailabilityChanged):
1124         * UIProcess/WebPageProxy.cpp:
1125         (WebKit::WebPageProxy::WebPageProxy):
1126         (WebKit::m_resetRecentCrashCountTimer):
1127         (WebKit::WebPageProxy::~WebPageProxy):
1128         (WebKit::WebPageProxy::setUIClient):
1129         (WebKit::WebPageProxy::setIconLoadingClient):
1130         (WebKit::WebPageProxy::launchProcess):
1131         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1132         (WebKit::WebPageProxy::swapToWebProcess):
1133         (WebKit::WebPageProxy::launchProcessForReload):
1134         (WebKit::WebPageProxy::launchProcessWithItem):
1135         (WebKit::WebPageProxy::initializeWebPage):
1136         (WebKit::WebPageProxy::close):
1137         (WebKit::WebPageProxy::tryClose):
1138         (WebKit::WebPageProxy::loadRequest):
1139         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
1140         (WebKit::WebPageProxy::loadFile):
1141         (WebKit::WebPageProxy::loadData):
1142         (WebKit::WebPageProxy::loadDataWithNavigationShared):
1143         (WebKit::WebPageProxy::loadAlternateHTML):
1144         (WebKit::WebPageProxy::loadWebArchiveData):
1145         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
1146         (WebKit::WebPageProxy::stopLoading):
1147         (WebKit::WebPageProxy::reload):
1148         (WebKit::WebPageProxy::goToBackForwardItem):
1149         (WebKit::WebPageProxy::tryRestoreScrollPosition):
1150         (WebKit::WebPageProxy::setControlledByAutomation):
1151         (WebKit::WebPageProxy::setIndicating):
1152         (WebKit::WebPageProxy::createInspectorTargets):
1153         (WebKit::WebPageProxy::setBackgroundColor):
1154         (WebKit::WebPageProxy::setTopContentInset):
1155         (WebKit::WebPageProxy::setUnderlayColor):
1156         (WebKit::WebPageProxy::viewWillStartLiveResize):
1157         (WebKit::WebPageProxy::viewWillEndLiveResize):
1158         (WebKit::WebPageProxy::activityStateDidChange):
1159         (WebKit::WebPageProxy::viewDidEnterWindow):
1160         (WebKit::WebPageProxy::dispatchActivityStateChange):
1161         (WebKit::WebPageProxy::layerHostingModeDidChange):
1162         (WebKit::WebPageProxy::setInitialFocus):
1163         (WebKit::WebPageProxy::clearSelection):
1164         (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
1165         (WebKit::WebPageProxy::validateCommand):
1166         (WebKit::WebPageProxy::increaseListLevel):
1167         (WebKit::WebPageProxy::decreaseListLevel):
1168         (WebKit::WebPageProxy::changeListType):
1169         (WebKit::WebPageProxy::setBaseWritingDirection):
1170         (WebKit::WebPageProxy::setNeedsFontAttributes):
1171         (WebKit::WebPageProxy::scheduleFullEditorStateUpdate):
1172         (WebKit::WebPageProxy::selectAll):
1173         (WebKit::WebPageProxy::executeEditCommand):
1174         (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
1175         (WebKit::WebPageProxy::setEditable):
1176         (WebKit::WebPageProxy::performDragControllerAction):
1177         (WebKit::WebPageProxy::dragEnded):
1178         (WebKit::WebPageProxy::didStartDrag):
1179         (WebKit::WebPageProxy::dragCancelled):
1180         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
1181         (WebKit::WebPageProxy::sendWheelEvent):
1182         (WebKit::WebPageProxy::handleKeyboardEvent):
1183         (WebKit::WebPageProxy::handleGestureEvent):
1184         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1185         (WebKit::WebPageProxy::resetPotentialTapSecurityOrigin):
1186         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
1187         (WebKit::WebPageProxy::handleTouchEvent):
1188         (WebKit::WebPageProxy::cancelPointer):
1189         (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
1190         (WebKit::WebPageProxy::scrollBy):
1191         (WebKit::WebPageProxy::centerSelectionInVisibleArea):
1192         (WebKit::WebPageProxy::commitProvisionalPage):
1193         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1194         (WebKit::WebPageProxy::setUserAgent):
1195         (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
1196         (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
1197         (WebKit::WebPageProxy::setCustomTextEncodingName):
1198         (WebKit::WebPageProxy::restoreFromSessionState):
1199         (WebKit::WebPageProxy::setTextZoomFactor):
1200         (WebKit::WebPageProxy::setPageZoomFactor):
1201         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
1202         (WebKit::WebPageProxy::scalePage):
1203         (WebKit::WebPageProxy::scalePageInViewCoordinates):
1204         (WebKit::WebPageProxy::scaleView):
1205         (WebKit::WebPageProxy::windowScreenDidChange):
1206         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
1207         (WebKit::WebPageProxy::setUseFixedLayout):
1208         (WebKit::WebPageProxy::setFixedLayoutSize):
1209         (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
1210         (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
1211         (WebKit::WebPageProxy::listenForLayoutMilestones):
1212         (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
1213         (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
1214         (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
1215         (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
1216         (WebKit::WebPageProxy::setPaginationMode):
1217         (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
1218         (WebKit::WebPageProxy::setPageLength):
1219         (WebKit::WebPageProxy::setGapBetweenPages):
1220         (WebKit::WebPageProxy::setPaginationLineGridEnabled):
1221         (WebKit::WebPageProxy::findStringMatches):
1222         (WebKit::WebPageProxy::findString):
1223         (WebKit::WebPageProxy::getImageForFindMatch):
1224         (WebKit::WebPageProxy::selectFindMatch):
1225         (WebKit::WebPageProxy::indicateFindMatch):
1226         (WebKit::WebPageProxy::hideFindUI):
1227         (WebKit::WebPageProxy::countStringMatches):
1228         (WebKit::WebPageProxy::replaceMatches):
1229         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
1230         (WebKit::WebPageProxy::runJavaScriptInFrame):
1231         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
1232         (WebKit::WebPageProxy::getSourceForFrame):
1233         (WebKit::WebPageProxy::getContentsAsString):
1234         (WebKit::WebPageProxy::getContentsAsAttributedString):
1235         (WebKit::WebPageProxy::getBytecodeProfile):
1236         (WebKit::WebPageProxy::getSamplingProfilerOutput):
1237         (WebKit::WebPageProxy::getContentsAsMHTMLData):
1238         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
1239         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
1240         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
1241         (WebKit::WebPageProxy::getResourceDataFromFrame):
1242         (WebKit::WebPageProxy::getWebArchiveOfFrame):
1243         (WebKit::WebPageProxy::forceRepaint):
1244         (WebKit::WebPageProxy::preferencesDidChange):
1245         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
1246         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
1247         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
1248         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
1249         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
1250         (WebKit::WebPageProxy::didCommitLoadForFrame):
1251         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1252         (WebKit::WebPageProxy::didFinishLoadForFrame):
1253         (WebKit::WebPageProxy::didFailLoadForFrame):
1254         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1255         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
1256         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1257         (WebKit::WebPageProxy::decidePolicyForResponseShared):
1258         (WebKit::WebPageProxy::willSubmitForm):
1259         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
1260         (WebKit::WebPageProxy::didPerformClientRedirectShared):
1261         (WebKit::WebPageProxy::didPerformServerRedirectShared):
1262         (WebKit::trySOAuthorization):
1263         (WebKit::WebPageProxy::createNewPage):
1264         (WebKit::WebPageProxy::showShareSheet):
1265         (WebKit::WebPageProxy::setMediaVolume):
1266         (WebKit::WebPageProxy::setMuted):
1267         (WebKit::WebPageProxy::stopMediaCapture):
1268         (WebKit::WebPageProxy::stopAllMediaPlayback):
1269         (WebKit::WebPageProxy::suspendAllMediaPlayback):
1270         (WebKit::WebPageProxy::resumeAllMediaPlayback):
1271         (WebKit::WebPageProxy::handleMediaEvent):
1272         (WebKit::WebPageProxy::setVolumeOfMediaElement):
1273         (WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
1274         (WebKit::WebPageProxy::didChooseColor):
1275         (WebKit::WebPageProxy::didEndColorPicker):
1276         (WebKit::WebPageProxy::didCloseSuggestions):
1277         (WebKit::WebPageProxy::didSelectOption):
1278         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
1279         (WebKit::WebPageProxy::backForwardAddItem):
1280         (WebKit::WebPageProxy::messageSenderDestinationID const):
1281         (WebKit::WebPageProxy::valueChangedForPopupMenu):
1282         (WebKit::WebPageProxy::setTextFromItemForPopupMenu):
1283         (WebKit::WebPageProxy::postMessageToInjectedBundle):
1284         (WebKit::WebPageProxy::failedToShowPopupMenu):
1285         (WebKit::WebPageProxy::showContextMenu):
1286         (WebKit::WebPageProxy::contextMenuItemSelected):
1287         (WebKit::WebPageProxy::handleContextMenuKeyEvent):
1288         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
1289         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1290         (WebKit::WebPageProxy::didCancelForOpenPanel):
1291         (WebKit::WebPageProxy::advanceToNextMisspelling):
1292         (WebKit::WebPageProxy::changeSpellingToWord):
1293         (WebKit::WebPageProxy::removeEditCommand):
1294         (WebKit::WebPageProxy::didFinishCheckingText):
1295         (WebKit::WebPageProxy::didCancelCheckingText):
1296         (WebKit::WebPageProxy::didReceiveEvent):
1297         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
1298         (WebKit::WebPageProxy::processDidBecomeResponsive):
1299         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
1300         (WebKit::WebPageProxy::gamepadActivity):
1301         (WebKit::WebPageProxy::updateWebsitePolicies):
1302         (WebKit::WebPageProxy::backForwardRemovedItem):
1303         (WebKit::WebPageProxy::setCanRunModal):
1304         (WebKit::WebPageProxy::beginPrinting):
1305         (WebKit::WebPageProxy::endPrinting):
1306         (WebKit::WebPageProxy::computePagesForPrinting):
1307         (WebKit::WebPageProxy::drawRectToImage):
1308         (WebKit::WebPageProxy::drawPagesToPDF):
1309         (WebKit::WebPageProxy::drawPagesForPrinting):
1310         (WebKit::WebPageProxy::setMinimumSizeForAutoLayout):
1311         (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
1312         (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
1313         (WebKit::WebPageProxy::handleAlternativeTextUIResult):
1314         (WebKit::WebPageProxy::setComposition):
1315         (WebKit::WebPageProxy::confirmComposition):
1316         (WebKit::WebPageProxy::cancelComposition):
1317         (WebKit::WebPageProxy::setScrollPinningBehavior):
1318         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
1319         (WebKit::WebPageProxy::addMIMETypeWithCustomContentProvider):
1320         (WebKit::WebPageProxy::changeFontAttributes):
1321         (WebKit::WebPageProxy::changeFont):
1322         (WebKit::WebPageProxy::setTextAsync):
1323         (WebKit::WebPageProxy::insertTextAsync):
1324         (WebKit::WebPageProxy::hasMarkedText):
1325         (WebKit::WebPageProxy::getMarkedRangeAsync):
1326         (WebKit::WebPageProxy::getSelectedRangeAsync):
1327         (WebKit::WebPageProxy::characterIndexForPointAsync):
1328         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
1329         (WebKit::WebPageProxy::setCompositionAsync):
1330         (WebKit::WebPageProxy::confirmCompositionAsync):
1331         (WebKit::WebPageProxy::takeSnapshot):
1332         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
1333         (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
1334         (WebKit::WebPageProxy::immediateActionDidUpdate):
1335         (WebKit::WebPageProxy::immediateActionDidCancel):
1336         (WebKit::WebPageProxy::immediateActionDidComplete):
1337         (WebKit::WebPageProxy::handleAcceptedCandidate):
1338         (WebKit::WebPageProxy::setUseSystemAppearance):
1339         (WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
1340         (WebKit::WebPageProxy::setFooterBannerHeightForTesting):
1341         (WebKit::WebPageProxy::setShouldDispatchFakeMouseMoveEvents):
1342         (WebKit::WebPageProxy::setPlaybackTarget):
1343         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
1344         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
1345         (WebKit::WebPageProxy::clearWheelEventTestTrigger):
1346         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
1347         (WebKit::WebPageProxy::getLoadDecisionForIcon):
1348         (WebKit::WebPageProxy::setResourceCachingDisabled):
1349         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
1350         (WebKit::WebPageProxy::didAllowPointerLock):
1351         (WebKit::WebPageProxy::didDenyPointerLock):
1352         (WebKit::WebPageProxy::requestPointerUnlock):
1353         (WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
1354         (WebKit::WebPageProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
1355         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
1356         (WebKit::WebPageProxy::insertAttachment):
1357         (WebKit::WebPageProxy::updateAttachmentAttributes):
1358         (WebKit::WebPageProxy::getApplicationManifest):
1359         (WebKit::WebPageProxy::setDefersLoadingForTesting):
1360         (WebKit::WebPageProxy::updateCurrentModifierState):
1361         (WebKit::WebPageProxy::simulateDeviceOrientationChange):
1362         (WebKit::WebPageProxy::detectDataInAllFrames):
1363         (WebKit::WebPageProxy::removeDataDetectedLinks):
1364         (WebKit::WebPageProxy::textInputContextsInRect):
1365         (WebKit::WebPageProxy::focusTextInputContext):
1366         * UIProcess/WebPageProxy.h:
1367         (WebKit::WebPageProxy::identifier const):
1368         (WebKit::WebPageProxy::webPageID const):
1369         * UIProcess/WebPageProxyIdentifier.h: Added.
1370         * UIProcess/WebProcessPool.cpp:
1371         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1372         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
1373         * UIProcess/WebProcessPool.h:
1374         * UIProcess/WebProcessProxy.cpp:
1375         (WebKit::WebProcessProxy::webPage):
1376         (WebKit::WebProcessProxy::addExistingWebPage):
1377         (WebKit::WebProcessProxy::removeWebPage):
1378         (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
1379         (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
1380         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
1381         (WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
1382         (WebKit::WebProcessProxy::transformObjectsToHandles):
1383         * UIProcess/WebProcessProxy.h:
1384         * UIProcess/WebURLSchemeHandler.cpp:
1385         (WebKit::WebURLSchemeHandler::startTask):
1386         (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
1387         (WebKit::WebURLSchemeHandler::stopTask):
1388         (WebKit::WebURLSchemeHandler::removeTaskFromPageMap):
1389         * UIProcess/WebURLSchemeHandler.h:
1390         * UIProcess/WebURLSchemeTask.cpp:
1391         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
1392         (WebKit::WebURLSchemeTask::didPerformRedirection):
1393         (WebKit::WebURLSchemeTask::didReceiveResponse):
1394         (WebKit::WebURLSchemeTask::didReceiveData):
1395         (WebKit::WebURLSchemeTask::didComplete):
1396         * UIProcess/WebURLSchemeTask.h:
1397         (WebKit::WebURLSchemeTask::pageID const):
1398         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1399         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
1400         * UIProcess/WebsiteData/WebsiteDataStore.h:
1401         * UIProcess/gtk/WebPageProxyGtk.cpp:
1402         (WebKit::WebPageProxy::getCenterForZoomGesture):
1403         * UIProcess/ios/EditableImageController.mm:
1404         (WebKit::EditableImageController::EditableImageController):
1405         (WebKit::EditableImageController::~EditableImageController):
1406         * UIProcess/ios/SmartMagnificationController.mm:
1407         (WebKit::SmartMagnificationController::SmartMagnificationController):
1408         (WebKit::SmartMagnificationController::~SmartMagnificationController):
1409         (WebKit::SmartMagnificationController::handleSmartMagnificationGesture):
1410         * UIProcess/ios/ViewGestureControllerIOS.mm:
1411         (WebKit::ViewGestureController::beginSwipeGesture):
1412         (WebKit::ViewGestureController::endSwipeGesture):
1413         * UIProcess/ios/WKContentView.mm:
1414         (-[WKContentView _wk_printedDocument]):
1415         * UIProcess/ios/WKContentViewInteraction.mm:
1416         (-[WKContentView ensurePositionInformationIsUpToDate:]):
1417         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
1418         * UIProcess/ios/WebPageProxyIOS.mm:
1419         (WebKit::WebPageProxy::requestFocusedElementInformation):
1420         (WebKit::WebPageProxy::updateVisibleContentRects):
1421         (WebKit::WebPageProxy::resendLastVisibleContentRects):
1422         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1423         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
1424         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
1425         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
1426         (WebKit::WebPageProxy::setDeviceOrientation):
1427         (WebKit::WebPageProxy::setOverrideViewportArguments):
1428         (WebKit::WebPageProxy::selectWithGesture):
1429         (WebKit::WebPageProxy::updateSelectionWithTouches):
1430         (WebKit::WebPageProxy::replaceDictatedText):
1431         (WebKit::WebPageProxy::replaceSelectedText):
1432         (WebKit::WebPageProxy::requestAutocorrectionData):
1433         (WebKit::WebPageProxy::applyAutocorrection):
1434         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
1435         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
1436         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
1437         (WebKit::WebPageProxy::selectPositionAtPoint):
1438         (WebKit::WebPageProxy::beginSelectionInDirection):
1439         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
1440         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
1441         (WebKit::WebPageProxy::requestDictationContext):
1442         (WebKit::WebPageProxy::requestAutocorrectionContext):
1443         (WebKit::WebPageProxy::getSelectionContext):
1444         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1445         (WebKit::WebPageProxy::handleStylusSingleTapAtPoint):
1446         (WebKit::WebPageProxy::selectWithTwoTouches):
1447         (WebKit::WebPageProxy::requestPositionInformation):
1448         (WebKit::WebPageProxy::startInteractionWithElementAtPosition):
1449         (WebKit::WebPageProxy::stopInteraction):
1450         (WebKit::WebPageProxy::performActionOnElement):
1451         (WebKit::WebPageProxy::applicationDidEnterBackground):
1452         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
1453         (WebKit::WebPageProxy::applicationWillEnterForeground):
1454         (WebKit::WebPageProxy::applicationWillResignActive):
1455         (WebKit::WebPageProxy::applicationDidBecomeActive):
1456         (WebKit::WebPageProxy::extendSelection):
1457         (WebKit::WebPageProxy::selectWordBackward):
1458         (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
1459         (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
1460         (WebKit::WebPageProxy::storeSelectionForAccessibility):
1461         (WebKit::WebPageProxy::startAutoscrollAtPosition):
1462         (WebKit::WebPageProxy::cancelAutoscroll):
1463         (WebKit::WebPageProxy::moveSelectionByOffset):
1464         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
1465         (WebKit::WebPageProxy::willStartUserTriggeredZooming):
1466         (WebKit::WebPageProxy::potentialTapAtPosition):
1467         (WebKit::WebPageProxy::commitPotentialTap):
1468         (WebKit::WebPageProxy::cancelPotentialTap):
1469         (WebKit::WebPageProxy::tapHighlightAtPosition):
1470         (WebKit::WebPageProxy::handleTap):
1471         (WebKit::WebPageProxy::didRecognizeLongPress):
1472         (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
1473         (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
1474         (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
1475         (WebKit::WebPageProxy::blurFocusedElement):
1476         (WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
1477         (WebKit::WebPageProxy::autofillLoginCredentials):
1478         (WebKit::WebPageProxy::focusNextFocusedElement):
1479         (WebKit::WebPageProxy::setFocusedElementValue):
1480         (WebKit::WebPageProxy::setFocusedElementValueAsNumber):
1481         (WebKit::WebPageProxy::setFocusedElementSelectedIndex):
1482         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
1483         (WebKit::WebPageProxy::contentSizeCategoryDidChange):
1484         (WebKit::WebPageProxy::generateSyntheticEditingCommand):
1485         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
1486         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
1487         (WebKit::WebPageProxy::updateSelectionWithDelta):
1488         (WebKit::WebPageProxy::requestDocumentEditingContext):
1489         (WebKit::WebPageProxy::requestDragStart):
1490         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
1491         (WebKit::WebPageProxy::didConcludeDrop):
1492         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
1493         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1494         (WebKit::RemoteWebInspectorProxy::platformSave):
1495         (WebKit::RemoteWebInspectorProxy::platformAppend):
1496         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1497         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
1498         * UIProcess/mac/ViewGestureControllerMac.mm:
1499         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
1500         (WebKit::ViewGestureController::handleSmartMagnificationGesture):
1501         * UIProcess/mac/WKImmediateActionController.mm:
1502         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1503         * UIProcess/mac/WebInspectorProxyMac.mm:
1504         (WebKit::WebInspectorProxy::platformSave):
1505         (WebKit::WebInspectorProxy::platformAppend):
1506         * UIProcess/mac/WebPageProxyMac.mm:
1507         (WebKit::WebPageProxy::windowAndViewFramesChanged):
1508         (WebKit::WebPageProxy::setMainFrameIsScrollable):
1509         (WebKit::WebPageProxy::insertDictatedTextAsync):
1510         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
1511         (WebKit::WebPageProxy::fontAtSelection):
1512         (WebKit::WebPageProxy::stringSelectionForPasteboard):
1513         (WebKit::WebPageProxy::dataSelectionForPasteboard):
1514         (WebKit::WebPageProxy::readSelectionFromPasteboard):
1515         (WebKit::WebPageProxy::replaceSelectionWithPasteboardData):
1516         (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
1517         (WebKit::WebPageProxy::uppercaseWord):
1518         (WebKit::WebPageProxy::lowercaseWord):
1519         (WebKit::WebPageProxy::capitalizeWord):
1520         (WebKit::WebPageProxy::setSmartInsertDeleteEnabled):
1521         (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
1522         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
1523         (WebKit::WebPageProxy::acceptsFirstMouse):
1524         * WebKit.xcodeproj/project.pbxproj:
1525
1526 2019-08-29  Chris Dumez  <cdumez@apple.com>
1527
1528         Use inline data member initialization in ProcessLauncher
1529         https://bugs.webkit.org/show_bug.cgi?id=201247
1530
1531         Reviewed by Ryosuke Niwa.
1532
1533         * UIProcess/Launcher/ProcessLauncher.cpp:
1534         (WebKit::ProcessLauncher::ProcessLauncher):
1535         * UIProcess/Launcher/ProcessLauncher.h:
1536
1537 2019-08-28  Tim Horton  <timothy_horton@apple.com>
1538
1539         Reloading a web view with a fixed-width viewport and variable content width restores the previous page scale, shouldn't
1540         https://bugs.webkit.org/show_bug.cgi?id=201256
1541         <rdar://problem/54809509>
1542
1543         Reviewed by Simon Fraser.
1544
1545         * WebProcess/WebPage/ios/WebPageIOS.mm:
1546         (WebKit::WebPage::restorePageState):
1547         When restoring page state from a history item, if the saved scale was equal to the
1548         initial scale at the time it was saved, ignore the saved scale and use the current
1549         initial scale instead.
1550
1551         Normally this doesn't matter because a given page's initial scale doesn't usually change
1552         between loads, but it totally can! See the test for one example of a way an API client
1553         might cause this; you could also imagine something similar happening if the actual
1554         page content changed.
1555
1556 2019-08-28  Megan Gardner  <megan_gardner@apple.com>
1557
1558         Null check webFrame when creating a print preview to prevent a crash.
1559         https://bugs.webkit.org/show_bug.cgi?id=201237
1560         <rdar://problem/51618863>
1561
1562         Reviewed by Tim Horton.
1563
1564         Move and expend a null check to keep from crashing when making a print preview.
1565
1566         * UIProcess/mac/WKPrintingView.mm:
1567         (-[WKPrintingView _drawPreview:]):
1568         (-[WKPrintingView drawRect:]):
1569
1570 2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
1571
1572         All image drawing functions should take an argument of type ImagePaintingOptions
1573         https://bugs.webkit.org/show_bug.cgi?id=201059
1574
1575         Reviewed by Simon Fraser.
1576
1577         GraphicsContext::drawImage() now takes an ImagePaintingOptions.
1578
1579         * WebProcess/WebPage/ios/WebPageIOS.mm:
1580         (WebKit::imagePositionInformation):
1581
1582 2019-08-28  Keith Rollin  <krollin@apple.com>
1583
1584         Remove support for macOS < 10.13 (part 2)
1585         https://bugs.webkit.org/show_bug.cgi?id=201197
1586         <rdar://problem/54759985>
1587
1588         Reviewed by Darin Adler.
1589
1590         Update conditionals that reference WK_MACOS_1013 and suffixes like
1591         _MACOS_SINCE_1013, assuming that we're always building on 10.13 or
1592         later and that these conditionals are always True or False.
1593
1594         See Bug 200694 for earlier changes in this area.
1595
1596         * Configurations/FeatureDefines.xcconfig:
1597         * Configurations/WebKit.xcconfig:
1598
1599 2019-08-28  Chris Dumez  <cdumez@apple.com>
1600
1601         Have WebPageProxy generate the page identifier by itself
1602         https://bugs.webkit.org/show_bug.cgi?id=201223
1603
1604         Reviewed by Ryosuke Niwa.
1605
1606         Have WebPageProxy generate the page identifier by itself instead of
1607         having the WebProcessProxy do it.
1608
1609         * UIProcess/ServiceWorkerProcessProxy.cpp:
1610         (WebKit::m_serviceWorkerPageID):
1611         * UIProcess/WebPageProxy.cpp:
1612         (WebKit::WebPageProxy::create):
1613         (WebKit::WebPageProxy::WebPageProxy):
1614         * UIProcess/WebPageProxy.h:
1615         * UIProcess/WebProcessProxy.cpp:
1616         (WebKit::WebProcessProxy::createWebPage):
1617         (WebKit::WebProcessProxy::generatePageID): Deleted.
1618         * UIProcess/WebProcessProxy.h:
1619
1620 2019-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1621
1622         REGRESSION(r243434): Wrong URL passed to WebKitWebView::load-failed when cancelling previous load
1623         https://bugs.webkit.org/show_bug.cgi?id=201176
1624
1625         Reviewed by Žan Doberšek.
1626
1627         Use the current provisional/committed url when faking an error event, instead of the current active URI that can
1628         be the pending api request of a new load.
1629
1630         * UIProcess/API/glib/WebKitWebView.cpp:
1631         (webkitWebViewWillStartLoad):
1632
1633 2019-08-28  Claudio Saavedra  <csaavedra@igalia.com>
1634
1635         [GTK][WPE] Implement HSTS for the soup network backend
1636         https://bugs.webkit.org/show_bug.cgi?id=192074
1637
1638         Reviewed by Carlos Garcia Campos.
1639
1640         libsoup 2.67.1 introduced HSTS support via a SoupSessionFeature.
1641         Add support to the soup network backend by adding the feature to
1642         SoupNetworkSession and handling HSTS protocol upgrades, by
1643         propagating the scheme change further to clients. This patch adds
1644         the HSTS feature unconditionally, but it still possible to add
1645         a boolean property to the web context class if desired.
1646
1647         Additionally, add API to the WebKitWebsiteDataManager to specify
1648         the directory where the HSTS database is saved. If the directory
1649         is not set or if the data manager is ephemeral, use a
1650         non-persistent, memory only HSTS enforcer.
1651
1652         Implement as well the methods needed to clean-up and delete HSTS
1653         policies from the storage and expose the feature in GTK+
1654         MiniBrowser's about:data.
1655
1656         * NetworkProcess/NetworkProcess.cpp:
1657         (WebKit::NetworkProcess::fetchWebsiteData):
1658         (WebKit::NetworkProcess::deleteWebsiteData):
1659         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1660         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
1661         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
1662         * NetworkProcess/NetworkProcess.h:
1663         (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
1664         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1665         (WebKit::NetworkDataTaskSoup::createRequest):
1666         (WebKit::NetworkDataTaskSoup::clearRequest):
1667         (WebKit::NetworkDataTaskSoup::shouldAllowHSTSPolicySetting const):
1668         (WebKit::NetworkDataTaskSoup::shouldAllowHSTSProtocolUpgrade const):
1669         (WebKit::NetworkDataTaskSoup::protocolUpgradedViaHSTS):
1670         (WebKit::NetworkDataTaskSoup::hstsEnforced):
1671         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1672         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1673         (WebKit::NetworkProcess::getHostNamesWithHSTSCache):
1674         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
1675         (WebKit::NetworkProcess::clearHSTSCache):
1676         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1677         * UIProcess/API/APIWebsiteDataStore.h:
1678         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1679         (API::WebsiteDataStore::defaultHSTSDirectory):
1680         * UIProcess/API/glib/WebKitWebContext.cpp:
1681         (webkitWebContextConstructed):
1682         * UIProcess/API/glib/WebKitWebsiteData.cpp:
1683         (recordContainsSupportedDataTypes):
1684         (toWebKitWebsiteDataTypes):
1685         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1686         (webkitWebsiteDataManagerGetProperty):
1687         (webkitWebsiteDataManagerSetProperty):
1688         (webkitWebsiteDataManagerConstructed):
1689         (webkit_website_data_manager_class_init):
1690         (webkitWebsiteDataManagerGetDataStore):
1691         (webkit_website_data_manager_get_hsts_cache_directory):
1692         (toWebsiteDataTypes):
1693         * UIProcess/API/gtk/WebKitWebsiteData.h:
1694         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1695         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1696         * UIProcess/API/wpe/WebKitWebsiteData.h:
1697         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
1698         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
1699         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
1700         (WebKit::WebsiteDataStoreConfiguration::copy):
1701         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
1702         (WebKit::WebsiteDataStoreConfiguration::hstsStorageDirectory const):
1703         (WebKit::WebsiteDataStoreConfiguration::setHSTSStorageDirectory):
1704
1705 2019-08-27  Mark Lam  <mark.lam@apple.com>
1706
1707         Refactor to use VM& instead of VM* at as many places as possible.
1708         https://bugs.webkit.org/show_bug.cgi?id=201172
1709
1710         Reviewed by Yusuke Suzuki.
1711
1712         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp:
1713         (webkit_dom_node_for_js_value):
1714         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1715         (WebKit::InjectedBundleNodeHandle::getOrCreate):
1716         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1717         (WebKit::JSNPObject::getOwnPropertyNames):
1718         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1719         (WebKit::identifierFromIdentifierRep):
1720         (WebKit::NPJSObject::enumerate):
1721         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1722         (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
1723         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
1724         * WebProcess/WebPage/WebFrame.cpp:
1725         (WebKit::WebFrame::counterValue):
1726
1727 2019-08-27  James Savage  <james.savage@apple.com>
1728
1729         Populate alternate URL for _WKActivatedElementInfo in UIContextMenu SPI.
1730         https://bugs.webkit.org/show_bug.cgi?id=201165.
1731         rdar://problem/54729648.
1732
1733         Reviewed by Dean Jackson.
1734
1735         * UIProcess/API/APIContextMenuElementInfo.h:
1736         * UIProcess/API/APIContextMenuElementInfo.cpp:
1737         (API::ContextMenuElementInfo::ContextMenuElementInfo): Initialize new memeber.
1738
1739         * UIProcess/API/Cocoa/WKContextMenuElementInfo.mm:
1740         (-[WKContextMenuElementInfo _activatedElementInfo]): Use new initializer.
1741
1742         * UIProcess/API/Cocoa/WKWebView.mm:
1743         (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): Ditto.
1744
1745         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
1746         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1747         (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:userInfo:]):
1748             Ditto.
1749         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:userInfo:]): Set new ivar.
1750         (+[_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:]): Deleted.
1751         (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]): Deleted.
1752
1753         * UIProcess/ios/WKContentViewInteraction.mm:
1754         (-[WKContentView assignLegacyDataForContextMenuInteraction]): Use new initializer.
1755         (-[WKContentView continueContextMenuInteraction:]): If the context menu is being generated for
1756             an image, and we do not have a URL associated with the position information, try to
1757             generate one using existing SPI. This change also passes through the userInfo via a new
1758             property on _WKActivatedElementInfo. We only do this for the SPI version of this delegate
1759             method, because the API is not called for image previews.
1760         (-[WKContentView _contextMenuInteraction:overrideSuggestedActionsForConfiguration:]): Use new
1761             initializer.
1762
1763 2019-08-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1764
1765         [RemoteInspector][Socket] Restructuring the components of Socket implementation
1766         https://bugs.webkit.org/show_bug.cgi?id=201079
1767
1768         Reviewed by Ross Kirsling.
1769
1770         RemoteInspectorClient is now free from creation of SocketEndpoint. All communication
1771         to SocketEndpoint id now the duty of super class.
1772
1773         * UIProcess/socket/RemoteInspectorClient.cpp:
1774         (WebKit::RemoteInspectorClient::RemoteInspectorClient): Remove direct communication to Socket Endpoint.
1775         (WebKit::RemoteInspectorClient::sendWebInspectorEvent): Ditto.
1776         * UIProcess/socket/RemoteInspectorClient.h:
1777
1778 2019-08-27  Chris Dumez  <cdumez@apple.com>
1779
1780         Introduce subclasses to RemoteObjectRegistry for the UIProcess and the WebProcess
1781         https://bugs.webkit.org/show_bug.cgi?id=201153
1782
1783         Reviewed by Alex Christensen.
1784
1785         This better factoring improves code clarity.
1786
1787         * PlatformMac.cmake:
1788         * Shared/API/Cocoa/RemoteObjectRegistry.h:
1789         (WebKit::RemoteObjectRegistry::~RemoteObjectRegistry):
1790         (WebKit::RemoteObjectRegistry::takeBackgroundActivityToken):
1791         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
1792         (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
1793         (WebKit::RemoteObjectRegistry::sendInvocation):
1794         (WebKit::RemoteObjectRegistry::sendReplyBlock):
1795         (WebKit::RemoteObjectRegistry::sendUnusedReply):
1796         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1797         (-[_WKRemoteObjectRegistry _initWithWebPage:]):
1798         (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
1799         * SourcesCocoa.txt:
1800         * UIProcess/Cocoa/UIRemoteObjectRegistry.cpp: Added.
1801         (WebKit::UIRemoteObjectRegistry::takeBackgroundActivityToken):
1802         (WebKit::UIRemoteObjectRegistry::UIRemoteObjectRegistry):
1803         (WebKit::UIRemoteObjectRegistry::sendInvocation):
1804         (WebKit::UIRemoteObjectRegistry::messageSender):
1805         * UIProcess/Cocoa/UIRemoteObjectRegistry.h: Added.
1806         * WebKit.xcodeproj/project.pbxproj:
1807         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1808         (WebKit::WebPage::setRemoteObjectRegistry):
1809         (WebKit::WebPage::remoteObjectRegistry):
1810         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.cpp: Added.
1811         (WebKit::WebRemoteObjectRegistry::WebRemoteObjectRegistry):
1812         (WebKit::WebRemoteObjectRegistry::~WebRemoteObjectRegistry):
1813         (WebKit::WebRemoteObjectRegistry::close):
1814         (WebKit::WebRemoteObjectRegistry::messageSender):
1815         * WebProcess/WebPage/Cocoa/WebRemoteObjectRegistry.h: Added.
1816         * WebProcess/WebPage/WebPage.cpp:
1817         (WebKit::WebPage::close):
1818         * WebProcess/WebPage/WebPage.h:
1819
1820 2019-08-26  Jer Noble  <jer.noble@apple.com>
1821
1822         Removing fullscreen element in rAF() callback after requestFullscreen() can leave fullscreen in inconsistent state.
1823         https://bugs.webkit.org/show_bug.cgi?id=201101
1824         <rdar://problem/54164587>
1825
1826         Reviewed by Eric Carlson.
1827
1828         Add more state to track in which direction the animation is flowing to allow in-process
1829         animations to be cancelled more gracefully.
1830
1831         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1832         (-[WKFullScreenWindowController enterFullScreen]):
1833         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1834         (-[WKFullScreenWindowController requestExitFullScreen]):
1835         (-[WKFullScreenWindowController exitFullScreen]):
1836         * WebProcess/cocoa/VideoFullscreenManager.h:
1837         (WebKit::VideoFullscreenInterfaceContext::animationState const):
1838         (WebKit::VideoFullscreenInterfaceContext::setAnimationState):
1839         (WebKit::VideoFullscreenInterfaceContext::isAnimating const): Deleted.
1840         (WebKit::VideoFullscreenInterfaceContext::setIsAnimating): Deleted.
1841         * WebProcess/cocoa/VideoFullscreenManager.mm:
1842         (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
1843         (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):
1844         (WebKit::VideoFullscreenManager::didEnterFullscreen):
1845         (WebKit::VideoFullscreenManager::didCleanupFullscreen):
1846
1847 2019-08-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1848
1849         Do not clear the pending api request when there's no navigation ID
1850         https://bugs.webkit.org/show_bug.cgi?id=201175
1851
1852         Reviewed by Chris Dumez.
1853
1854         After r247851, the pending API request URL is cleared for subresources in some cases.
1855
1856         * UIProcess/WebPageProxy.cpp:
1857         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
1858         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1859
1860 2019-08-27  Zan Dobersek  <zdobersek@igalia.com>
1861
1862         [CoordGraphics] Delay LayerTreeHost creation in always-on AC until DrawingArea painting is enabled
1863         https://bugs.webkit.org/show_bug.cgi?id=201178
1864
1865         Reviewed by Carlos Garcia Campos.
1866
1867         When in always-on AC mode, the LayerTreeHost spawning should be delayed
1868         until the WebPage construction (which sets up the LayerTreeHost-owning
1869         DrawingArea implementation) is further done with initializing relevant
1870         state, and not immediately after the DrawingArea is done with preference
1871         updates.
1872
1873         This is necessary in order to enable the LayerTreeHost instance to take
1874         into account additional WebPage-creation attributes like the correct
1875         device scale factor. Until now, when the LayerTreeHost was spawned in
1876         always-on AC mode, the device scale factor was not yet updated in the
1877         WebPage construction to the appropriate value, leaving the LayerTreeHost
1878         with the default 1.0 value instead of the intended one.
1879
1880         DrawingArea::setPaintingEnabled() is repurposed into enablePainting()
1881         that is to be called once everything should be set for painting (i.e.
1882         when setPaintingEnabled(true) was being called until now). Inside the
1883         DrawingAreaProxyCoordinatedGraphics class (only one to provide an
1884         implementation for this method), the LayerTreeHost is now spawned if
1885         in always-on AC mode. At this point, all relevant state coming from
1886         the owning WebPage object should be readily available for the host
1887         to correctly set up initial graphics scene.
1888
1889         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1890         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
1891         (WebKit::DrawingAreaCoordinatedGraphics::enablePainting):
1892         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
1893         * WebProcess/WebPage/DrawingArea.h:
1894         (WebKit::DrawingArea::enablePainting):
1895         (WebKit::DrawingArea::setPaintingEnabled): Deleted.
1896         * WebProcess/WebPage/WebPage.cpp:
1897         (WebKit::m_textAutoSizingAdjustmentTimer):
1898         (WebKit::WebPage::reinitializeWebPage):
1899
1900 2019-08-26  Devin Rousso  <drousso@apple.com>
1901
1902         Web Inspector: use more C++ keywords for defining agents
1903         https://bugs.webkit.org/show_bug.cgi?id=200959
1904
1905         Reviewed by Joseph Pecoraro.
1906
1907          - make constructors `protected` when the agent isn't meant to be constructed directly
1908          - add `virtual` destructors that are defined in the *.cpp so forward-declarations work
1909          - use `final` wherever possible
1910          - add comments to indicate where any virtual functions come from
1911
1912         * UIProcess/WebPageInspectorTargetAgent.h:
1913         * UIProcess/WebPageInspectorTargetAgent.cpp:
1914
1915 2019-08-26  Chris Dumez  <cdumez@apple.com>
1916
1917         Regression: ITP started doing a lot more IPC after its logic was moved to the network process
1918         https://bugs.webkit.org/show_bug.cgi?id=201155
1919
1920         Reviewed by John Wilander.
1921
1922         * WebProcess/WebProcess.cpp:
1923         (WebKit::WebProcess::initializeWebProcess):
1924
1925 2019-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1926
1927         REGRESSION (iOS 13): Tests that simulate multiple back-to-back single taps fail or time out
1928         https://bugs.webkit.org/show_bug.cgi?id=201129
1929         <rdar://problem/51857277>
1930
1931         Reviewed by Tim Horton.
1932
1933         Adds a new SPI hook in WebKit to let clients know when a synthetic tap gesture that has ended has been reset.
1934         See Tools/ChangeLog and LayoutTests/ChangeLog for more details.
1935
1936         * UIProcess/API/Cocoa/WKWebView.mm:
1937         (-[WKWebView _doAfterResettingSingleTapGesture:]):
1938         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1939         * UIProcess/ios/WKContentViewInteraction.h:
1940         * UIProcess/ios/WKContentViewInteraction.mm:
1941         (-[WKContentView _singleTapDidReset:]):
1942         (-[WKContentView _doAfterResettingSingleTapGesture:]):
1943
1944 2019-08-26  Brent Fulgham  <bfulgham@apple.com>
1945
1946         [FTW] Go back to ID2D1Bitmap as our NativeImage type
1947         https://bugs.webkit.org/show_bug.cgi?id=201122
1948
1949         Reviewed by Alex Christensen.
1950
1951         In Bug 200093 I switched the OS type of NativeImagePtr from ID2D1Bitmap to IWICBitmap.
1952         However, this was an ill-advised approach, because it dramatically harmed performance due
1953         to the heavy use of software rendering.
1954
1955         I originally made this change because I thought this was the only way to get to the backing
1956         bits of the bitmaps, but it turns out that a more recent Direct2D data type (ID2D1Bitmap1)
1957         has the ability to map its memory to CPU-accessible memory, allowing software filter effects.
1958
1959         This patch switches back to the ID2D1Bitap data type, and hooks up the ID2D1Bitmap1 data type
1960         to access the underlying memory of the bitmaps when software filter effects are used.
1961
1962         Reviewed by Alex Christensen.
1963
1964         * Shared/ShareableBitmap.h:
1965         * Shared/win/ShareableBitmapDirect2D.cpp:
1966         * UIProcess/win/BackingStoreDirect2D.cpp:
1967         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1968
1969 2019-08-26  Jiewen Tan  <jiewen_tan@apple.com>
1970
1971         [WebAuthn] Support HID authenticators on iOS
1972         https://bugs.webkit.org/show_bug.cgi?id=201084
1973         <rdar://problem/51908390>
1974
1975         Reviewed by Youenn Fablet.
1976
1977         This patch makes the macOS HID implementation available in iOS as well.
1978         Mostly, it removes the PLATFORM(MAC) compile time flag.
1979
1980         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1981         (WebKit::AuthenticatorManagerInternal::collectTransports):
1982         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
1983         (WebKit::AuthenticatorTransportService::create):
1984         (WebKit::AuthenticatorTransportService::createMock):
1985         * UIProcess/WebAuthentication/Cocoa/HidConnection.h:
1986         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
1987         * UIProcess/WebAuthentication/Cocoa/HidService.h:
1988         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
1989         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
1990         (WebKit::NfcConnection::NfcConnection):
1991         A tentative solution before there is an official UI.
1992         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
1993         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
1994         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
1995         * UIProcess/WebAuthentication/Mock/MockHidService.h:
1996         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
1997         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
1998
1999 2019-08-26  Russell Epstein  <repstein@apple.com>
2000
2001         Unreviewed, rolling out r248961.
2002
2003         Same patch was re-landed after being rolled out. Patch is
2004         causing Catalina/iOS 13 test failures. Rolling out.
2005
2006         Reverted changeset:
2007
2008         "Verify Prefetch and credential behavior"
2009         https://bugs.webkit.org/show_bug.cgi?id=200000
2010         https://trac.webkit.org/changeset/248961
2011
2012 2019-08-26  Youenn Fablet  <youenn@apple.com>
2013
2014         Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
2015         https://bugs.webkit.org/show_bug.cgi?id=196870
2016
2017         Reviewed by Alex Christensen.
2018
2019         Make NetworkProcess provide the session ID for any authentication challenge.
2020         In case there is no associated page for the authentication challenge or this is related to a service worker,
2021         ask the website data store to take a decision.
2022         Add website data store delegate to allow applications to make the decision.
2023         Restrict using the delegate to server trust evaluation only.
2024
2025         Make ping loads reuse the same mechanism.
2026
2027         Covered by service worker tests and updated beacon test.
2028
2029         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2030         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
2031         * NetworkProcess/NetworkDataTask.cpp:
2032         (WebKit::NetworkDataTask::sessionID const):
2033         * NetworkProcess/NetworkDataTask.h:
2034         * NetworkProcess/NetworkLoad.cpp:
2035         (WebKit::NetworkLoad::didReceiveChallenge):
2036         * NetworkProcess/NetworkLoadChecker.h:
2037         (WebKit::NetworkLoadChecker::networkProcess):
2038         * NetworkProcess/PingLoad.cpp:
2039         (WebKit::PingLoad::didReceiveChallenge):
2040         * Shared/Authentication/AuthenticationManager.cpp:
2041         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2042         * Shared/Authentication/AuthenticationManager.h:
2043         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
2044         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
2045         (WebKit::toAuthenticationChallengeDisposition):
2046         * SourcesCocoa.txt:
2047         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2048         (WebsiteDataStoreClient::WebsiteDataStoreClient):
2049         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
2050         * UIProcess/Cocoa/NavigationState.mm:
2051         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
2052         * UIProcess/Network/NetworkProcessProxy.cpp:
2053         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2054         * UIProcess/Network/NetworkProcessProxy.h:
2055         * UIProcess/Network/NetworkProcessProxy.messages.in:
2056         * UIProcess/ServiceWorkerProcessProxy.cpp:
2057         * UIProcess/ServiceWorkerProcessProxy.h:
2058         * UIProcess/WebPageProxy.cpp:
2059         * UIProcess/WebProcessPool.cpp:
2060         (WebKit::WebProcessPool::isServiceWorkerPageID const):
2061         * UIProcess/WebProcessPool.h:
2062         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
2063         (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
2064         * WebKit.xcodeproj/project.pbxproj:
2065
2066 2019-08-25  Simon Fraser  <simon.fraser@apple.com>
2067
2068         [iOS WK2] Make a strongly-typed TransactionID to replace uint64_t transactionIDs
2069         https://bugs.webkit.org/show_bug.cgi?id=199983
2070
2071         Reviewed by Dean Jackson.
2072         
2073         Add TransactionID which is a MonotonicObjectIdentifier<TransactionIDType>. This is modeled
2074         after ObjectIdentifier<>, but we can't use that because it doesn't have a guarantee of
2075         values always increasing by 1 (all derived classes share the same value source). Also, we
2076         need a per-RemoteLayerTreeDrawingArea set of values, but a static seed would cause values to
2077         be incremented by all RemoteLayerTreeDrawingAreas in a WebProcess.
2078
2079         Replace all the bare uint64_t with TransactionID, fixing message generation codegen.
2080
2081         * Scripts/webkit/messages.py:
2082         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2083         (WebKit::RemoteLayerTreeTransaction::transactionID const):
2084         (WebKit::RemoteLayerTreeTransaction::setTransactionID):
2085         * Shared/TransactionID.h: Added.
2086         (WebKit::MonotonicObjectIdentifier::MonotonicObjectIdentifier):
2087         (WebKit::MonotonicObjectIdentifier::isHashTableDeletedValue const):
2088         (WebKit::MonotonicObjectIdentifier::encode const):
2089         (WebKit::MonotonicObjectIdentifier::decode):
2090         (WebKit::MonotonicObjectIdentifier::operator== const):
2091         (WebKit::MonotonicObjectIdentifier::operator> const):
2092         (WebKit::MonotonicObjectIdentifier::operator>= const):
2093         (WebKit::MonotonicObjectIdentifier::operator< const):
2094         (WebKit::MonotonicObjectIdentifier::operator<= const):
2095         (WebKit::MonotonicObjectIdentifier::operator!= const):
2096         (WebKit::MonotonicObjectIdentifier::increment):
2097         (WebKit::MonotonicObjectIdentifier::next const):
2098         (WebKit::MonotonicObjectIdentifier::toUInt64 const):
2099         (WebKit::MonotonicObjectIdentifier::operator bool const):
2100         (WebKit::MonotonicObjectIdentifier::loggingString const):
2101         (WebKit::MonotonicObjectIdentifier::hashTableDeletedValue):
2102         (WebKit::MonotonicObjectIdentifier::isValidIdentifier):
2103         (WebKit::operator<<):
2104         * Shared/VisibleContentRectUpdateInfo.h:
2105         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2106         (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionID const):
2107         * UIProcess/API/Cocoa/WKWebView.mm:
2108         (-[WKWebView _processWillSwapOrDidExit]):
2109         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
2110         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
2111         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2112         (WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree):
2113         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2114         * UIProcess/WebPageProxy.cpp:
2115         (WebKit::WebPageProxy::resetState):
2116         * UIProcess/WebPageProxy.h:
2117         * UIProcess/ios/WKContentViewInteraction.h:
2118         * UIProcess/ios/WKContentViewInteraction.mm:
2119         (-[WKContentView cleanupInteraction]):
2120         * UIProcess/ios/WebPageProxyIOS.mm:
2121         (WebKit::WebPageProxy::commitPotentialTap):
2122         (WebKit::WebPageProxy::handleTap):
2123         * WebKit.xcodeproj/project.pbxproj:
2124         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2125         (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID const):
2126         (WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID const):
2127         (WebKit::RemoteLayerTreeDrawingArea::takeNextTransactionID):
2128         * WebProcess/WebPage/WebFrame.h:
2129         (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad const):
2130         (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
2131         * WebProcess/WebPage/WebPage.h:
2132         * WebProcess/WebPage/WebPage.messages.in:
2133         * WebProcess/WebPage/ios/WebPageIOS.mm:
2134         (WebKit::WebPage::handleTap):
2135         (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint):
2136         (WebKit::WebPage::commitPotentialTap):
2137
2138 2019-08-24  Chris Dumez  <cdumez@apple.com>
2139
2140         Make CacheStorageEngineCaches's decodeCachesNames() more robust against bad input data
2141         https://bugs.webkit.org/show_bug.cgi?id=201102
2142
2143         Reviewed by Antti Koivisto.
2144
2145         Use Vector::tryReserveCapacity() instead of Vector::reserveInitialCapacity() in CacheStorage::decodeCachesNames()
2146         since the size is read from disk and thus cannot be trusted. If the size is too large, reserveInitialCapacity()
2147         would end up crashing the network process. Now, we merely discard the data if tryReserveCapacity() fails because
2148         the size is too large.
2149
2150         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2151         (WebKit::CacheStorage::decodeCachesNames):
2152
2153 2019-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2154
2155         [iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing
2156         https://bugs.webkit.org/show_bug.cgi?id=201085
2157         <rdar://problem/53056118>
2158
2159         Reviewed by Tim Horton.
2160
2161         Currently, logic in applyAutocorrectionInternal only selects the range to autocorrect if the text of the range
2162         matches the string to replace (delivered to us from UIKit). In the case of changing "I’" to "I’m", the string to
2163         replace is "I'" (with a straight quote rather than an apostrophe), even though the DOM contains an apostrophe.
2164
2165         This is because kbd believes that the document context contains straight quotes (rather than apostrophes). For
2166         native text views, this works out because UIKit uses relative UITextPositions to determine the replacement
2167         range rather than by checking against the contents of the document. However, WKWebView does not have the ability
2168         to synchronously compute and reason about arbitrary UITextPositions relative to the selection, so we instead
2169         search for the string near the current selection when applying autocorrections.
2170
2171         Of course, this doesn't work in this scenario because the replacement string contains a straight quote, yet the
2172         text node contains an apostrophe, so we bail and don't end up replacing any text. To address this, we repurpose
2173         TextIterator helpers currently used to allow find-in-page to match straight quotes against apostrophes; instead
2174         of matching the replacement string exactly, we instead match the quote-folded versions of these strings when
2175         finding the range to replace.
2176
2177         Test: fast/events/ios/autocorrect-with-apostrophe.html
2178
2179         * WebProcess/WebPage/ios/WebPageIOS.mm:
2180         (WebKit::WebPage::applyAutocorrectionInternal):
2181
2182 2019-08-23  Jiewen Tan  <jiewen_tan@apple.com>
2183
2184         Unreviewed, build fix after r249059
2185
2186         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
2187         (WebKit::NfcConnection::NfcConnection):
2188         Remove the HAVE() macro.
2189
2190 2019-08-23  Chris Dumez  <cdumez@apple.com>
2191
2192         [geolocation] Rename interfaces and remove [NoInterfaceObject]
2193         https://bugs.webkit.org/show_bug.cgi?id=200885
2194
2195         Reviewed by Alex Christensen.
2196
2197         * Shared/WebGeolocationPosition.cpp:
2198         (WebKit::WebGeolocationPosition::create):
2199         * Shared/WebGeolocationPosition.h:
2200         (WebKit::WebGeolocationPosition::corePosition const):
2201         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
2202         * UIProcess/API/C/WKGeolocationPosition.cpp:
2203         (WKGeolocationPositionCreate_c):
2204         * UIProcess/WebGeolocationManagerProxy.h:
2205         (WebKit::WebGeolocationManagerProxy::lastPosition const):
2206         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2207         (-[WKLegacyCoreLocationProvider positionChanged:]):
2208         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2209         (WebKit::WebGeolocationManager::didChangePosition):
2210         * WebProcess/Geolocation/WebGeolocationManager.h:
2211         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
2212         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2213         (WebKit::WebGeolocationClient::lastPosition):
2214         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
2215
2216 2019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
2217
2218         Unreviewed, rolling out r249001.
2219
2220         Caused one layout test to fail on all configurations and
2221         another to time out on Catalina / iOS 13.
2222
2223         Reverted changeset:
2224
2225         "Add a WebsiteDataStore delegate to handle
2226         AuthenticationChallenge that do not come from pages"
2227         https://bugs.webkit.org/show_bug.cgi?id=196870
2228         https://trac.webkit.org/changeset/249001
2229
2230 2019-08-23  Brian Burg  <bburg@apple.com>
2231
2232         REGRESSION(r248713): WebDriver commands which target the implicit main frame now hit an ASSERT
2233         https://bugs.webkit.org/show_bug.cgi?id=200793
2234         <rdar://problem/54516988>
2235
2236         Reviewed by Chris Dumez.
2237
2238         SimulatedInputDispatcher and its callers need to support Optional<FrameIdentifier>
2239         and WTF::nullopt as an encoding for the implicit main frame.
2240
2241         * UIProcess/Automation/SimulatedInputDispatcher.h:
2242         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2243         (WebKit::SimulatedInputDispatcher::resolveLocation):
2244         (WebKit::SimulatedInputDispatcher::run):
2245
2246         * UIProcess/Automation/WebAutomationSession.h:
2247         * UIProcess/Automation/WebAutomationSession.cpp:
2248         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
2249         (WebKit::WebAutomationSession::performInteractionSequence):
2250         (WebKit::WebAutomationSession::cancelInteractionSequence):
2251
2252 2019-08-20  Jiewen Tan  <jiewen_tan@apple.com>
2253
2254         [WebAuthn] Support NFC authenticators for iOS
2255         https://bugs.webkit.org/show_bug.cgi?id=188624
2256         <rdar://problem/43354214>
2257
2258         Reviewed by Chris Dumez.
2259
2260         This patch implements support for NFC authenticators including both FIDO2 and U2F ones. It utilizes a private
2261         framework called NearField instead of CoreNFC to be able to supply a custom UI later if necessary.
2262
2263         The patch follows almost the same flow as previous HID and Local authenticator support.
2264         1) Discovery is via NfcService which will invoke NFHardwareManager to start a generic NFC reader session.
2265         2) Once a reader session is established, a NfcConnection is created to start the polling and register the WKNFReaderSessionDelegate
2266         to wait for 'didDetectTags'.
2267         3) When tags are detected, NfcConnection will determine if it meets our requriements: { type, connectability, fido applet availability }.
2268         The first tag that meets all requirement will then be returned for WebAuthn operations.
2269         4) The first WebAuthn operation is to send authenticatorGetInfo command to determine the supported protocol, and then initialize corresponding
2270         authenticators. Noted, the sending/receiving of this command is now abstracted into FidoService which will be shared across HidService and NfcService.
2271         5) From then, the actual WebAuthn request, either makeCredential or getAssertion will be sent.
2272
2273         For testing, this patch follows the same flow as well.
2274         1) MockNfcService overrides NfcService to mock the behavior of NFC Tags discovery.
2275         2) The same class also swizzles methods from NFReaderSession to mock tag connection and communication.
2276
2277         * Platform/spi/Cocoa/NearFieldSPI.h: Added.
2278         * Sources.txt:
2279         * SourcesCocoa.txt:
2280         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2281         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
2282         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
2283         (WebKit::AuthenticatorManagerInternal::collectTransports):
2284         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
2285         (WebKit::AuthenticatorTransportService::create):
2286         (WebKit::AuthenticatorTransportService::createMock):
2287         * UIProcess/WebAuthentication/Cocoa/HidService.h:
2288         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2289         (WebKit::HidService::HidService):
2290         (WebKit::HidService::deviceAdded):
2291         (WebKit::HidService::continueAddDeviceAfterGetInfo): Deleted.
2292         * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2293         * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2294         * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2295         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: Added.
2296         (WebKit::fido::compareVersion):
2297         (WebKit::NfcConnection::NfcConnection):
2298         (WebKit::NfcConnection::~NfcConnection):
2299         (WebKit::NfcConnection::transact const):
2300         (WebKit::NfcConnection::didDetectTags const):
2301         * UIProcess/WebAuthentication/Cocoa/NfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2302         * UIProcess/WebAuthentication/Cocoa/NfcService.mm: Added.
2303         (WebKit::NfcService::NfcService):
2304         (WebKit::NfcService::~NfcService):
2305         (WebKit::NfcService::didConnectTag):
2306         (WebKit::NfcService::startDiscoveryInternal):
2307         (WebKit::NfcService::platformStartDiscovery):
2308         * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2309         * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2310         (-[WKNFReaderSessionDelegate initWithConnection:]):
2311         (-[WKNFReaderSessionDelegate readerSession:didDetectTags:]):
2312         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2313         (WebKit::MockHidConnection::send):
2314         (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
2315         (WebKit::MockHidConnection::parseRequest):
2316         (WebKit::MockHidConnection::feedReports):
2317         (WebKit::MockHidConnection::shouldContinueFeedReports):
2318         * UIProcess/WebAuthentication/Mock/MockNfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2319         * UIProcess/WebAuthentication/Mock/MockNfcService.mm: Added.
2320         (-[WKMockNFTag type]):
2321         (-[WKMockNFTag initWithNFTag:]):
2322         (-[WKMockNFTag description]):
2323         (-[WKMockNFTag isEqualToNFTag:]):
2324         (-[WKMockNFTag initWithType:]):
2325         (WebKit::MockNfcService::MockNfcService):
2326         (WebKit::MockNfcService::transceive):
2327         (WebKit::MockNfcService::platformStartDiscovery):
2328         (WebKit::MockNfcService::detectTags const):
2329         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
2330         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
2331         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
2332         * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: Added.
2333         (WebKit::CtapNfcDriver::CtapNfcDriver):
2334         (WebKit::CtapNfcDriver::transact):
2335         (WebKit::CtapNfcDriver::respondAsync const):
2336         * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2337         * UIProcess/WebAuthentication/fido/FidoService.cpp: Added.
2338         (WebKit::FidoService::FidoService):
2339         (WebKit::FidoService::getInfo):
2340         (WebKit::FidoService::continueAfterGetInfo):
2341         * UIProcess/WebAuthentication/fido/FidoService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
2342         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
2343         * UIProcess/WebAuthentication/fido/U2fAuthenticator.h:
2344         * UIProcess/ios/WebPageProxyIOS.mm:
2345         * WebKit.xcodeproj/project.pbxproj:
2346
2347 2019-08-23  Kate Cheney  <katherine_cheney@apple.com>
2348
2349         Support ITP on a per-session basis (198923)
2350         https://bugs.webkit.org/show_bug.cgi?id=198923
2351
2352         Reviewed by Chris Dumez.
2353
2354         The original implementation of resourceLoadStatisticsUpdated
2355         did not allow for ITP on a per session basis due to the sessionID
2356         not being passed to the resourceLoadStatisticsUpdated function.
2357         This patch allows access of the correct networkSession by passing
2358         all resourceLoadStatistics in a new data structure of key-value
2359         pairs, where the sessionID is the key.
2360
2361         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2362         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
2363         * NetworkProcess/NetworkConnectionToWebProcess.h:
2364         * WebProcess/WebProcess.cpp:
2365
2366 2019-08-23  Russell Epstein  <repstein@apple.com>
2367
2368         Unreviewed, rolling out r249031.
2369
2370         Causes multiple test failures on iOS simulator
2371
2372         Reverted changeset:
2373
2374         "[iOS] Should show input view when became first responder if
2375         keyboard was showing when the view was resigned"
2376         https://bugs.webkit.org/show_bug.cgi?id=200902
2377         https://trac.webkit.org/changeset/249031
2378
2379 2019-08-22  Andy Estes  <aestes@apple.com>
2380
2381         [watchOS] Disable Content Filtering in the simulator build
2382         https://bugs.webkit.org/show_bug.cgi?id=201047
2383
2384         Reviewed by Tim Horton.
2385
2386         * Configurations/FeatureDefines.xcconfig:
2387
2388 2019-08-22  Daniel Bates  <dabates@apple.com>
2389
2390         [iOS] Should show input view when became first responder if keyboard was showing when the view was resigned
2391         https://bugs.webkit.org/show_bug.cgi?id=200902
2392         <rdar://problem/54231756>
2393
2394         Reviewed by Wenson Hsieh.
2395
2396         When resigning first responder save whether the peripheral host has an input view on screen,
2397         including the software keyboard, so that we show the input view(s) again when the WKWebView
2398         is made first responder. In Safari, this avoids the need for a person to explicitly focus an
2399         editable element again to bring up the keyboard when returning to a tab they were previously
2400         typing in. It also makes the behavior of switching tabs in Safari with a software keyboard
2401         match the behavior of doing the same thing when a hardware keyboard attached.
2402
2403         * UIProcess/PageClient.h:
2404         * UIProcess/WebPageProxy.h:
2405         * UIProcess/WebPageProxy.messages.in:
2406         * UIProcess/ios/PageClientImplIOS.h:
2407         * UIProcess/ios/PageClientImplIOS.mm:
2408         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
2409         Pass a diff of the activity state from the web process to the UI process so that we can
2410         differentiate between an inputmode change as a result of page deactivation vs a change
2411         caused by some other means. We need to differentiate these cases because we want to
2412         ignore a page that sets inputmode "none" (i.e. a request to hide the keyboard) from inside
2413         a focus event handler if the handler was called as part of the process of page activation
2414         (i.e. switching to the tab). Google Docs is one example of a web site that sets inputmode
2415         to "none" as a result of the page activation process.
2416
2417         * UIProcess/ios/WKContentViewInteraction.h:
2418         * UIProcess/ios/WKContentViewInteraction.mm:
2419         (-[WKContentView cleanupInteraction]): Clear out state.
2420         (-[WKContentView resignFirstResponderForWebView]): Save whether the peripheral host is on screen
2421         into a local before ending the editing session. We then copy the local into the ivar if we
2422         actually will resign. This ordering is explicitly done because:
2423                 1. Ending the editing session may dismiss the keyboard => we need to query the peripheral
2424                    host first.
2425                 2. If the view is being resigned as a result of a keyboard dismissal (i.e. a person pressed
2426                    the hide keyboard button on iPad) then the user has indicated that they are finished
2427                    with the keyboard and we do not want to show the keyboard on page re-activation => we
2428                    do not want to copy the local to the ivar.
2429                 3. If the view refuses to resign itself then it does not make sense to save the keyboard
2430                    state as responder status hasn't changed.
2431         (-[WKContentView shouldShowAutomaticKeyboardUI]): Ignore inputmode="none", if needed.
2432         (-[WKContentView _didCommitLoadForMainFrame]): Clear out state.
2433         (-[WKContentView isFirstResponderOrBecomingFirstResponder]): Added.
2434         (-[WKContentView shouldShowInputViewOnPageActivation:]): Added.
2435         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
2436         Update ivar if this element is being focused as a result of page activation.
2437         (-[WKContentView _didUpdateInputMode:activityStateChanges:]): Modified to take the activity state
2438         diff. If the input mode was changed as a result of page activation then we want to update our ivar
2439         so that when we call -reloadInputViews and UIKit calls us back in -shouldShowAutomaticKeyboardUI we
2440         will know to ignore inputmode set to "none" when determining whether to show the automatic keyboard UI.
2441         Note that we do not need to check/track whether an earlier -_elementDidFocus actually started an
2442         input session as part of updating the value of our ivar because if an input session was not started,
2443         say the embedding client disallowed it, then we would not have a focused element => we early return from
2444         this function. Also remove duplication and improve code readbility by making use of the convenience function
2445         hasFocusedElement() instead of duplicating what it does.
2446         (-[WKContentView _didUpdateInputMode:]): Deleted.
2447         * UIProcess/ios/WebPageProxyIOS.mm:
2448         (WebKit::WebPageProxy::focusedElementDidChangeInputMode): Modified to take the activity state diff
2449         and pass it through.
2450         (WebKit::WebPageProxy::didReleaseAllTouchPoints): Pass the empty set for the activity state diff to
2451         keep our current behavior.
2452         * WebProcess/WebPage/WebPage.cpp:
2453         (WebKit::WebPage::focusedElementDidChangeInputMode): Send the activity state diff to the UI process.
2454 2019-08-22  Keith Rollin  <krollin@apple.com>
2455
2456         Remove logging that contains a URL
2457         https://bugs.webkit.org/show_bug.cgi?id=201052
2458         <rdar://problem/54613204>
2459
2460         Reviewed by Chris Dumez.
2461
2462         checkURLReceivedFromWebProcess in WebProcessProxy.cpp contains an old
2463         logging line that logs a URL. We don't log URLs any more for privacy
2464         reasons, so remove this.
2465
2466         A search for WTFLogAlways.*url turns up other matches, but those are
2467         either false positives or cases where the URLs are logged only on
2468         demand by the developer as part of debugging.
2469         checkURLReceivedFromWebProcess is the only place where a URL is logged
2470         as a matter of course.
2471
2472         * UIProcess/WebProcessProxy.cpp:
2473         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
2474
2475 2019-08-22  Adrian Perez de Castro  <aperez@igalia.com>
2476
2477         [GTK][WPE] Fixes for non-unified builds after r248547
2478         https://bugs.webkit.org/show_bug.cgi?id=201044
2479
2480         Reviewed by Philippe Normand.
2481
2482         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Add missing inclusion of
2483         the wtf/CrossThreadCopier.h header.
2484         * WebProcess/WebStorage/StorageNamespaceImpl.h: Add missing inclusion of the
2485         WebCore/PageIdentifier.h header.
2486
2487 2019-08-22  Alex Christensen  <achristensen@webkit.org>
2488
2489         Disable legacy TLS versions and add a temporary default to re-enable it
2490         https://bugs.webkit.org/show_bug.cgi?id=200945
2491
2492         Reviewed by Brady Eidson.
2493
2494         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2495         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2496         (WebKit::NetworkSessionCreationParameters::encode const):
2497         (WebKit::NetworkSessionCreationParameters::decode):
2498         * NetworkProcess/NetworkSessionCreationParameters.h:
2499         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2500         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2501         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2502         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2503         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2504         (WebKit::WebsiteDataStore::parameters):
2505
2506 2019-08-17  Darin Adler  <darin@apple.com>
2507
2508         Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends
2509         https://bugs.webkit.org/show_bug.cgi?id=200862
2510
2511         Reviewed by Ryosuke Niwa.
2512
2513         * Shared/mac/AuxiliaryProcessMac.mm:
2514         (WebKit::setAndSerializeSandboxParameters): Use one append instead of multiple.
2515
2516 2019-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2517
2518         Typing Korean in title field after typing in the body inserts extraneous characters on blog.naver.com
2519         https://bugs.webkit.org/show_bug.cgi?id=201023
2520         <rdar://problem/54294794>
2521
2522         Reviewed by Ryosuke Niwa.
2523
2524         After r242833, we began to avoid sending redundant ElementDidFocus updates in the case where a focused element
2525         was blurred and refocused within the same runloop. This was done to prevent the input view from flickering due
2526         to input view reloading, as well as scrolling to reveal the focused element, when tapping to change selection on
2527         Microsoft Word online.
2528
2529         However, on blog.naver.com, these ElementDidFocus messages were necessary in order to ensure that the platform
2530         input context changes when moving between the title and body fields, or when tapping to change selection. This
2531         is because blog.naver.com uses a hidden contenteditable area under a subframe (see WebCore ChangeLog for more
2532         detail here). While text is never directly inserted into this hidden contenteditable, the events are observed
2533         and used to "play back" editing in the main visible content area.
2534
2535         Thus, when moving between the title and body fields (or when changing selection within either), the only hint we
2536         get is that the hidden editable element is blurred and immediately refocused. Since we no longer send
2537         ElementDidFocus updates in this scenario, UIKeyboardImpl and kbd are not aware that the page has effectively
2538         changed input contexts.
2539
2540         Combined with the fact that Korean IME on iOS may insert additional text given the document context (i.e. text
2541         that the input manager, kbd, thinks we've previously inserted), this means that when typing several characters
2542         into the body field on naver and then switching to edit the title, initial keystrokes may insert unexpected
2543         text in the title field.
2544
2545         To fix this, we add some hooks to notify the UI process when an element that was blurred has been immediately
2546         refocused. Upon receiving this message, the UI process then tells UIKeyboardImpl to re-retrieve its input
2547         context, which calls into -requestAutocorrectionContextWithCompletionHandler: in WKContentView. While notorious
2548         for being synchronous IPC, this is mitigated by (1) being limiting to only instances where we have a hidden
2549         editable area, and (2) being limited by a batching mechanism in the web process, such that if the focused
2550         element is blurred, refocused, re-blurred, and refocused many times in the same runloop, we'll only send a
2551         single UpdateInputContextAfterBlurringAndRefocusingElement message (as opposed to the many ElementDidFocus
2552         messages we would've sent in previous releases).
2553
2554         * Platform/spi/ios/UIKitSPI.h:
2555         * UIProcess/PageClient.h:
2556         * UIProcess/WebPageProxy.h:
2557         * UIProcess/WebPageProxy.messages.in:
2558
2559         Add a new mechanism to update the platform input context (on iOS, UIKeyboardImpl's document state) when focus
2560         moves away from and immediately returns to a hidden editable element.
2561
2562         * UIProcess/ios/PageClientImplIOS.h:
2563         * UIProcess/ios/PageClientImplIOS.mm:
2564         (WebKit::PageClientImpl::updateInputContextAfterBlurringAndRefocusingElement):
2565         * UIProcess/ios/WKContentViewInteraction.h:
2566         * UIProcess/ios/WKContentViewInteraction.mm:
2567         (-[WKContentView _updateInputContextAfterBlurringAndRefocusingElement]):
2568
2569         Tell the active UIKeyboardImpl to refetch document state from the WKContentView. While this does result in a new
2570         autocorrection context request (which, unfortunately, triggers synchronous IPC to the web process), this request
2571         would've still happened anyways in the case where we would previously have sent an ElementDidFocus message.
2572
2573         * UIProcess/ios/WebPageProxyIOS.mm:
2574         (WebKit::WebPageProxy::updateInputContextAfterBlurringAndRefocusingElement):
2575         * WebProcess/WebPage/WebPage.cpp:
2576         (WebKit::WebPage::elementDidFocus):
2577
2578         In the case where we avoid sending a full ElementDidFocus message to the UI process due to refocusing the same
2579         element, we should still notify the UI process so that it can synchronize state between the application process
2580         and kbd. See above for more details.
2581
2582         (WebKit::WebPage::elementDidBlur):
2583         (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
2584         * WebProcess/WebPage/WebPage.h:
2585         * WebProcess/WebPage/ios/WebPageIOS.mm:
2586         (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
2587
2588 2019-08-22  Youenn Fablet  <youenn@apple.com>
2589
2590         Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
2591         https://bugs.webkit.org/show_bug.cgi?id=196870
2592
2593         Reviewed by Alex Christensen.
2594
2595         Make NetworkProcess provide the session ID for any authentication challenge.
2596         In case there is no associated page for the authentication challenge or this is related to a service worker,
2597         ask the website data store to take a decision.
2598         Add website data store delegate to allow applications to make the decision.
2599         Restrict using the delegate to server trust evaluation only.
2600
2601         Make ping loads reuse the same mechanism.
2602
2603         Covered by service worker tests and updated beacon test.
2604
2605         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2606         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
2607         * NetworkProcess/NetworkDataTask.cpp:
2608         (WebKit::NetworkDataTask::sessionID const):
2609         * NetworkProcess/NetworkDataTask.h:
2610         * NetworkProcess/NetworkLoad.cpp:
2611         (WebKit::NetworkLoad::didReceiveChallenge):
2612         * NetworkProcess/NetworkLoadChecker.h:
2613         (WebKit::NetworkLoadChecker::networkProcess):
2614         * NetworkProcess/PingLoad.cpp:
2615         (WebKit::PingLoad::didReceiveChallenge):
2616         * Shared/Authentication/AuthenticationManager.cpp:
2617         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2618         * Shared/Authentication/AuthenticationManager.h:
2619         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
2620         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
2621         (WebKit::toAuthenticationChallengeDisposition):
2622         * SourcesCocoa.txt:
2623         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2624         (WebsiteDataStoreClient::WebsiteDataStoreClient):
2625         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
2626         * UIProcess/Cocoa/NavigationState.mm:
2627         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
2628         * UIProcess/Network/NetworkProcessProxy.cpp:
2629         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2630         * UIProcess/Network/NetworkProcessProxy.h:
2631         * UIProcess/Network/NetworkProcessProxy.messages.in:
2632         * UIProcess/ServiceWorkerProcessProxy.cpp:
2633         * UIProcess/ServiceWorkerProcessProxy.h:
2634         * UIProcess/WebPageProxy.cpp:
2635         * UIProcess/WebProcessPool.cpp:
2636         (WebKit::WebProcessPool::isServiceWorkerPageID const):
2637         * UIProcess/WebProcessPool.h:
2638         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
2639         (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
2640         * WebKit.xcodeproj/project.pbxproj:
2641
2642 2019-08-22  Claudio Saavedra  <csaavedra@igalia.com>
2643
2644         [SOUP] NetworkProcessSoup does not initialize CacheOptions correctly
2645         https://bugs.webkit.org/show_bug.cgi?id=200886
2646
2647         Reviewed by Philippe Normand.
2648
2649         r247567 wrongly initializes CacheOptions in a local variable that is never used
2650         instead of using NetworkProcess's member variable, that is later used by the
2651         NetworkSession to initialize the cache.
2652
2653         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2654         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2655
2656 2019-08-21  Tim Horton  <timothy_horton@apple.com>
2657
2658         [Mail] Tapping top of message scrolls back to copied text instead of top of the message
2659         https://bugs.webkit.org/show_bug.cgi?id=200999
2660         <rdar://problem/54564878>
2661
2662         Reviewed by Wenson Hsieh.
2663
2664         In the case where you have a WebCore selection but are not first responder,
2665         when you tap the WKWebView to become first responder, EventHandler would
2666         bail from setting the selection, assuming UIKit was going to do it. This
2667         behavior was introduced in r233311.
2668
2669         However, since we are not first responder, UIKit does not change the
2670         selection, since it considers the view to not be editable.
2671
2672         Fix this by letting WebCore set the selection in this case, as it used to.
2673
2674         * WebProcess/WebCoreSupport/WebEditorClient.h:
2675         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
2676         (WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const):
2677         * WebProcess/WebPage/WebPage.h:
2678         (WebKit::WebPage::isShowingInputViewForFocusedElement const):
2679         Copy the logic from EventHandler, with the added caveat (which fixes the
2680         aforementioned behavior) that we will allow EventHandler to change the
2681         selection if we don't have a focused node in the UIKit sense, because
2682         we know that the platform text interaction code will *not* change the
2683         selection if that is the case, so it's up to us.
2684
2685 2019-08-21  Chris Dumez  <cdumez@apple.com>
2686
2687         Crash under NetworkCache::Data::mapToFile()
2688         https://bugs.webkit.org/show_bug.cgi?id=200996
2689         <rdar://problem/54570421>
2690
2691         Reviewed by Geoffrey Garen.
2692
2693         Make sure NetworkCache::Data::mapToFile() calls makeSafeToUseMemoryMapForPath() between
2694         creating the file and calling mmap().
2695
2696         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2697         (WebKit::NetworkCache::BlobStorage::add):
2698         * NetworkProcess/cache/NetworkCacheData.cpp:
2699         (WebKit::NetworkCache::Data::mapToFile const):
2700
2701 2019-08-21  Chris Dumez  <cdumez@apple.com>
2702
2703         Have NetworkCache::store() null check its completion handler before calling it
2704         https://bugs.webkit.org/show_bug.cgi?id=200994
2705
2706         Reviewed by Geoffrey Garen.
2707
2708         * NetworkProcess/NetworkResourceLoader.cpp:
2709         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2710         Stop passing nullptr for the completion handler now that the parameter has a default value.
2711         Note that passing nullptr here was likely wrong since the NetworkCache::store() implementation
2712         did not null-check the completion handler before calling it.
2713
2714         * NetworkProcess/cache/NetworkCache.cpp:
2715         (WebKit::NetworkCache::Cache::store):
2716         Have NetworkCache::store() null check its completion handler before calling it as calling
2717         a null WTF::Function crashes.
2718
2719         * NetworkProcess/cache/NetworkCache.h:
2720         Use nullptr as default parameter value for the completion handler.
2721
2722 2019-08-21  Rob Buis  <rbuis@igalia.com>
2723
2724         Verify Prefetch and credential behavior
2725         https://bugs.webkit.org/show_bug.cgi?id=200000
2726
2727         Reviewed by Youenn Fablet.
2728
2729         Cancel cross-origin prefetches for Vary: Cookie.
2730
2731         Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html
2732
2733         * NetworkProcess/NetworkResourceLoader.cpp:
2734         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2735         (WebKit::NetworkResourceLoader::didReceiveResponse):
2736         * NetworkProcess/cache/PrefetchCache.cpp:
2737         (WebKit::PrefetchCache::take):
2738
2739 2019-08-21  Ryosuke Niwa  <rniwa@webkit.org>
2740
2741         Put keygen element behind a runtime flag and disable it by default
2742         https://bugs.webkit.org/show_bug.cgi?id=200850
2743
2744         Reviewed by Antti Koivisto.
2745
2746         * Shared/WebPreferences.yaml:
2747         * UIProcess/API/C/WKPreferences.cpp:
2748         (WKPreferencesSetKeygenElementEnabled):
2749         (WKPreferencesGetKeygenElementEnabled):
2750         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2751
2752 2019-08-21  Chris Dumez  <cdumez@apple.com>
2753
2754         Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains()
2755         https://bugs.webkit.org/show_bug.cgi?id=200986
2756         <rdar://problem/32850192>
2757
2758         Reviewed by Brent Fulgham.
2759
2760         Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied.
2761         The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor
2762         does not take care of this for you, despite its name (the createCrossThreadTask() function does though).
2763
2764         * NetworkProcess/NetworkProcess.cpp:
2765         (WebKit::NetworkProcess::fetchWebsiteData):
2766         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2767         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2768
2769 2019-08-21  Chris Dumez  <cdumez@apple.com>
2770
2771         Add internal setting to disable SecureContext checks
2772         https://bugs.webkit.org/show_bug.cgi?id=200980
2773         <rdar://problem/54438512>
2774
2775         Reviewed by Alex Christensen.
2776
2777         Add internal setting to disable SecureContext checks, in order to facilitate development
2778         for features like Service workers or device orientation / motion.
2779
2780         * Shared/WebPreferences.yaml:
2781         * UIProcess/API/Cocoa/WKPreferences.mm:
2782         (-[WKPreferences _secureContextChecksEnabled]):
2783         (-[WKPreferences _setSecureContextChecksEnabled:]):
2784         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2785
2786 2019-08-21  Chris Dumez  <cdumez@apple.com>
2787
2788         registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap
2789         https://bugs.webkit.org/show_bug.cgi?id=200985
2790
2791         Reviewed by John Wilander.
2792
2793         registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap. It is more
2794         efficient to simply return a Vector since we never need to look up keys.
2795
2796         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2797         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
2798         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2799         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2800         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
2801         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2802         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
2803         (WebKit::domainsToString):
2804         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2805         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2806         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
2807         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2808         * NetworkProcess/NetworkProcess.cpp:
2809         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2810         (WebKit::NetworkProcess::deleteCookiesForTesting):
2811         * NetworkProcess/NetworkProcess.h:
2812         * NetworkProcess/NetworkSession.cpp:
2813         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
2814         * NetworkProcess/NetworkSession.h:
2815
2816 2019-08-21  Russell Epstein  <repstein@apple.com>
2817
2818         Unreviewed, rolling out r248942.
2819
2820         Causes multiple layout test crashes on MacOS Bots
2821
2822         Reverted changeset:
2823
2824         "Verify Prefetch and credential behavior"
2825         https://bugs.webkit.org/show_bug.cgi?id=200000
2826         https://trac.webkit.org/changeset/248942
2827
2828 2019-08-21  Keith Rollin  <krollin@apple.com>
2829
2830         Remove support for watchOS < 6.0
2831         https://bugs.webkit.org/show_bug.cgi?id=200937
2832         <rdar://problem/54524009>
2833
2834         Reviewed by Darin Adler.
2835
2836         Update conditionals that reference __WATCH_OS_VERSION_MIN_REQUIRED and
2837         __WATCH_OS_VERSION_MAX_ALLOWED, assuming that they both have values >=
2838         60000. This means that expressions like
2839         "__WATCH_OS_VERSION_MIN_REQUIRED < 60000" are always False and
2840         "__WATCH_OS_VERSION_MIN_REQUIRED >= 60000" are always True.
2841
2842         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2843         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2844
2845 2019-08-21  Adrian Perez de Castro  <aperez@igalia.com>
2846
2847         [GTK] Build failure due to unwieldy definition of “None” from X11 headers
2848         https://bugs.webkit.org/show_bug.cgi?id=200984
2849
2850         Reviewed by Carlos Alberto Lopez Perez.
2851
2852         * SourcesGTK.txt: Mark AcceleratedBackingStore.cpp with @no-unify
2853         because it includes AcceleratedSurfaceX11.h when building with
2854         ENABLE_X11_TARGET=ON, which in turn will include the X11 headers.
2855         It is just lucky that most of the time the order of the generated
2856         #include statements in the unified sources has been masking this
2857         problem.
2858
2859 2019-08-21  Rob Buis  <rbuis@igalia.com>
2860
2861         Verify Prefetch and credential behavior
2862         https://bugs.webkit.org/show_bug.cgi?id=200000
2863
2864         Reviewed by Youenn Fablet.
2865
2866         Cancel cross-origin prefetches for Vary: Cookie.
2867
2868         Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html
2869
2870         * NetworkProcess/NetworkResourceLoader.cpp:
2871         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2872         (WebKit::NetworkResourceLoader::didReceiveResponse):
2873         * NetworkProcess/cache/PrefetchCache.cpp:
2874         (WebKit::PrefetchCache::take):
2875
2876 2019-08-21  Pablo Saavedra  <psaavedra@igalia.com>
2877
2878         [WPE] Build failure after r248846 ([WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part)
2879         https://bugs.webkit.org/show_bug.cgi?id=200973
2880
2881         WPE fails to build with `-DENABLE_WPE_QT_API=ON` after changes done by r248846 in:
2882
2883           Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp
2884           Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp
2885
2886         ; to forces FastMalloc use.
2887
2888         Related to:
2889
2890           https://bugs.webkit.org/show_bug.cgi?id=200611
2891           https://bugs.webkit.org/show_bug.cgi?id=200620
2892
2893         This patch puts WPEQt... classes into FastMalloc in the same way it
2894         was done by many others in r248603.
2895
2896         Reviewed by Philippe Normand.
2897
2898         * UIProcess/API/wpe/qt/WPEQtView.cpp:
2899         (WPEQtView::runJavaScript):
2900         * UIProcess/API/wpe/qt/WPEQtViewBackend.h:
2901         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h:
2902
2903 2019-08-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2904
2905         [iOS] REGRESSION (248501): gmail.com images are still not shown on some versions of iPhone iOS13
2906         https://bugs.webkit.org/show_bug.cgi?id=200948
2907
2908         Reviewed by Tim Horton.
2909
2910         Apply the gmail.com quirk for all iPhone iOS versions till the gmail.com
2911         bug is fixed.
2912
2913         * WebProcess/WebPage/ios/WebPageIOS.mm:
2914         (WebKit::WebPage::platformUserAgent const):
2915
2916 2019-08-20  Chris Dumez  <cdumez@apple.com>
2917
2918         WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread
2919         https://bugs.webkit.org/show_bug.cgi?id=200925
2920
2921         Reviewed by Geoffrey Garen.
2922
2923         WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread,
2924         which is not safe. Use WeakPtr to address the issue.
2925
2926         * Shared/WebSQLiteDatabaseTracker.cpp:
2927         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2928         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
2929         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
2930         * Shared/WebSQLiteDatabaseTracker.h:
2931
2932 2019-08-20  Brent Fulgham  <bfulgham@apple.com>
2933
2934         [FTW] Fix scrolling in modern WebKit views
2935         https://bugs.webkit.org/show_bug.cgi?id=200923
2936
2937         Reviewed by Don Olmstead.
2938
2939         The initial implementation of scrolling in Direct2D had errors that
2940         caused hilarious rendering glitches. This patch corrects the logic
2941         so that page scroll is correct.
2942
2943         This patch also fixes a bug that would trigger when resizing windows.
2944
2945         * Shared/win/ShareableBitmapDirect2D.cpp:
2946         (WebKit::ShareableBitmap::paint):
2947         * UIProcess/BackingStore.h:
2948         (WebKit::BackingStore::renderTarget): Deleted.
2949         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
2950         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
2951         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
2952         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
2953         * UIProcess/win/BackingStoreDirect2D.cpp:
2954         (WebKit::BackingStore::paint):
2955         (WebKit::BackingStore::incorporateUpdate):
2956         (WebKit::BackingStore::scroll):
2957         * UIProcess/win/WebView.cpp:
2958         (WebKit::WebView::paint):
2959         (WebKit::WebView::onSizeEvent):
2960
2961 2019-08-20  Chris Dumez  <cdumez@apple.com>
2962
2963         Unsafe usage of CookieStorageObserver from a background thread
2964         https://bugs.webkit.org/show_bug.cgi?id=200920
2965
2966         Reviewed by Alex Christensen.
2967
2968         * UIProcess/API/APIHTTPCookieStore.h:
2969         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
2970         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
2971
2972 2019-08-20  Chris Dumez  <cdumez@apple.com>
2973
2974         Use a strongly typed identifier for StorageNamespace's identifier
2975         https://bugs.webkit.org/show_bug.cgi?id=200895
2976
2977         Reviewed by Alex Christensen and Youenn Fablet.
2978
2979         Use a strongly typed identifier for StorageNamespace's identifier instead of uint64_t, to
2980         avoid type confusion.
2981
2982         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
2983         (WebKit::LocalStorageNamespace::LocalStorageNamespace):
2984         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
2985         * NetworkProcess/WebStorage/StorageManager.cpp:
2986         (WebKit::StorageManager::createSessionStorageNamespace):
2987         (WebKit::StorageManager::destroySessionStorageNamespace):
2988         (WebKit::StorageManager::cloneSessionStorageNamespace):
2989         (WebKit::StorageManager::createLocalStorageArea):
2990         (WebKit::StorageManager::createTransientLocalStorageArea):
2991         (WebKit::StorageManager::createSessionStorageArea):
2992         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
2993         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
2994         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
2995         * NetworkProcess/WebStorage/StorageManager.h:
2996         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
2997         (WebKit::StorageManagerSet::connectToLocalStorageArea):
2998         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
2999         (WebKit::StorageManagerSet::connectToSessionStorageArea):
3000         (WebKit::StorageManagerSet::cloneSessionStorageNamespace):
3001         * NetworkProcess/WebStorage/StorageManagerSet.h:
3002         * NetworkProcess/WebStorage/StorageManagerSet.messages.in:
3003         * Scripts/webkit/messages.py:
3004         * WebKit.xcodeproj/project.pbxproj:
3005         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3006         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
3007         * WebProcess/WebPage/WebPage.cpp:
3008         (WebKit::m_textAutoSizingAdjustmentTimer):
3009         * WebProcess/WebPage/WebPage.h:
3010         (WebKit::WebPage::sessionStorageNamespaceIdentifier const):
3011         * WebProcess/WebPage/WebPageGroupProxy.h:
3012         (WebKit::WebPageGroupProxy::localStorageNamespaceIdentifier const):
3013         * WebProcess/WebStorage/StorageAreaMap.cpp:
3014         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3015         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3016         * WebProcess/WebStorage/StorageNamespaceIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h.
3017         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
3018         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
3019         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
3020         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
3021         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
3022         (WebKit::StorageNamespaceImpl::copy):
3023         (WebKit::StorageNamespaceImpl::sessionStoragePageID const):
3024         (WebKit::StorageNamespaceImpl::pageGroupID const):
3025         * WebProcess/WebStorage/StorageNamespaceImpl.h:
3026         (WebKit::StorageNamespaceImpl::storageNamespaceID const):
3027         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
3028         (WebKit::WebStorageNamespaceProvider::getOrCreate):
3029         (WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
3030         (WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
3031         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
3032         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
3033         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
3034         * WebProcess/WebStorage/WebStorageNamespaceProvider.h:
3035
3036 2019-08-20  Dean Jackson  <dino@apple.com>
3037
3038         REGRESSION: Open in New Tab is missing from context menu
3039         https://bugs.webkit.org/show_bug.cgi?id=200909
3040         <rdar://problem/54476169>
3041
3042         Reviewed by Simon Fraser.
3043
3044         Don't assume the new API if webView:contextMenuWillPresentForElement:
3045         is implemented.
3046
3047         * UIProcess/ios/WKContentViewInteraction.mm:
3048         (needsDeprecatedPreviewAPI):
3049
3050 2019-08-20  Joseph Pecoraro  <pecoraro@apple.com>
3051
3052         Web Inspector: Support for JavaScript BigInt
3053         https://bugs.webkit.org/show_bug.cgi?id=180731
3054         <rdar://problem/36298748>
3055
3056         Reviewed by Devin Rousso.
3057
3058         * WebProcess/WebPage/WebInspectorUI.cpp:
3059         (WebKit::WebInspectorUI::WebInspectorUI):
3060         Enable BigInt in the Web Inspector process. It only makes use of
3061         `globalThis.BigInt(...)` to hold the value.
3062
3063 2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
3064
3065         [CMake] WebKit2.dll can't link because of missing PAL's import symbols for WinCairo port
3066         https://bugs.webkit.org/show_bug.cgi?id=200910
3067
3068         Unreviewed build fix for Windows port.
3069
3070         * CMakeLists.txt: Added -DSTATICALLY_LINKED_WITH_PAL=1 if PAL_LIBRARY_TYPE is STATIC.
3071
3072 2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
3073
3074         Unreviewed build fix for WinCairo port.
3075
3076         The base class of NetworkDataTask has been changed in r248874.
3077
3078         * NetworkProcess/curl/NetworkDataTaskCurl.h:
3079         (ref):
3080         (deref):
3081         Call 'ref' and 'deref' of NetworkDataTask instead of RefCounted<NetworkDataTask>.
3082
3083 2019-08-19  Keith Rollin  <krollin@apple.com>
3084
3085         Unreviewed build fix for security entitlements.
3086
3087         Bug 200242 (r248164) changed the way that entitlements were generated
3088         and applied during the build. In that refactoring, the codesign
3089         parameter "-o library" was dropped. This change adds it back.
3090
3091         * Configurations/BaseXPCService.xcconfig:
3092
3093 2019-08-19  Chris Dumez  <cdumez@apple.com>
3094
3095         NetworkDataTask is being ref'd / deref'd from several threads and is not ThreadSafeRefCounted
3096         https://bugs.webkit.org/show_bug.cgi?id=200897
3097
3098         Reviewed by Geoffrey Garen.
3099
3100         NetworkDataTask subclasses RefCounted and is ref'd / deref'd on the main thread. However, there
3101         is code in NetworkDataTaskCocoa::resume() that was ref'ing / deref'ing it on a background thread,
3102         which is unsafe. To address the issue, Have NetworkDataTask subclass ThreadSafeRefCounted, and
3103         make sure it always gets destroyed on the main thread.
3104
3105         * NetworkProcess/NetworkDataTask.h:
3106
3107         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3108         (WebKit::NetworkDataTaskCocoa::resume):
3109         Avoid some unnecessary refcounting churn.
3110
3111 2019-08-19  Alex Christensen  <achristensen@webkit.org>
3112
3113         Move call to initializeMainThread introduced in r248549 to after WebKit.framework has been loaded
3114         https://bugs.webkit.org/show_bug.cgi?id=200896
3115         <rdar://problem/54479065>
3116
3117         Reviewed by Chris Dumez.
3118
3119         In XPCServiceMain we haven't been told which WebKit.framework to load yet, so when using staged frameworks it
3120         causes problems if we call a function from a WebKit framework.  We need to wait until after initializerFunctionPtr is called.
3121
3122         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
3123         (NetworkServiceInitializer):
3124         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
3125         (PluginServiceInitializer):
3126         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
3127         (WebKit::XPCServiceMain):
3128         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
3129         (WebContentServiceInitializer):
3130
3131 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
3132
3133         Unreviewed, build fix for PLATFORM_DRIVEN_TEXT_CHECKING
3134         https://bugs.webkit.org/show_bug.cgi?id=200620
3135
3136         It is enabled if PLATFORM(MACCATALYST) is true.
3137
3138         * UIProcess/Cocoa/TextCheckingController.h:
3139
3140 2019-08-19  Sihui Liu  <sihui_liu@apple.com>
3141
3142         Remove IDB-specific quota
3143         https://bugs.webkit.org/show_bug.cgi?id=196545
3144         <rdar://problem/54201783>
3145
3146         Reviewed by Youenn Fablet.
3147
3148         * NetworkProcess/NetworkProcess.cpp:
3149         (WebKit::NetworkProcess::createIDBServer):
3150         (WebKit::NetworkProcess::addIndexedDatabaseSession):
3151         (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.
3152         * NetworkProcess/NetworkProcess.h:
3153         * NetworkProcess/NetworkProcess.messages.in:
3154         * UIProcess/API/C/WKContext.cpp:
3155         (WKContextSetIDBPerOriginQuota): Deleted.
3156         * UIProcess/API/C/WKContextPrivate.h:
3157         * UIProcess/WebProcessPool.cpp:
3158         (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.
3159         * UIProcess/WebProcessPool.h:
3160
3161 2019-08-19  Youenn Fablet  <youenn@apple.com>
3162
3163         Remove SessionID::emptySessionID()
3164         https://bugs.webkit.org/show_bug.cgi?id=200811
3165
3166         Reviewed by Alex Christensen.
3167
3168         Update SessionID call sites to use toUInt64.
3169         Remove debug asserts to isValid since construction of invalid session IDs can only happen in very specific cases
3170         typically for HashMaps.
3171
3172         * NetworkProcess/Downloads/DownloadManager.h:
3173         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3174         (WebKit::storageSession):
3175         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
3176         * NetworkProcess/NetworkProcess.cpp:
3177         (WebKit::NetworkProcess::networkSession const):
3178         (WebKit::NetworkProcess::networkSessionByConnection const):
3179         (WebKit::NetworkProcess::setSession):
3180         (WebKit::NetworkProcess::destroySession):
3181         (WebKit::NetworkProcess::fetchWebsiteData):
3182         (WebKit::NetworkProcess::deleteWebsiteData):
3183         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
3184         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
3185         (WebKit::NetworkProcess::existingSWOriginStoreForSession const):
3186         (WebKit::NetworkProcess::webProcessWasDisconnected):
3187         * NetworkProcess/NetworkProcess.h:
3188         * NetworkProcess/NetworkResourceLoader.cpp:
3189         (WebKit::NetworkResourceLoader::startNetworkLoad):
3190         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3191         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3192         * UIProcess/Network/NetworkProcessProxy.cpp:
3193         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
3194         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3195         (WebKit::WebsiteDataStore::~WebsiteDataStore):
3196         (WebKit::WebsiteDataStore::maybeRegisterWithSessionIDMap):
3197         (WebKit::WebsiteDataStore::existingNonDefaultDataStoreForSessionID):
3198         * WebProcess/Cache/WebCacheStorageProvider.cpp:
3199         (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
3200         * WebProcess/Cache/WebCacheStorageProvider.h:
3201         * WebProcess/Storage/WebSWClientConnection.cpp:
3202         (WebKit::WebSWClientConnection::WebSWClientConnection):
3203         (WebKit::WebSWClientConnection::initializeConnectionIfNeeded):
3204         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3205         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
3206         * WebProcess/WebPage/WebPage.cpp:
3207         (WebKit::m_textAutoSizingAdjustmentTimer):
3208
3209 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
3210
3211         Unreviewed, speculative build fix for GTK and WinCairo
3212         https://bugs.webkit.org/show_bug.cgi?id=200620
3213
3214         * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
3215
3216 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
3217
3218         Unreviewed, build fix in WinCairo and GTK ports
3219         https://bugs.webkit.org/show_bug.cgi?id=200767
3220
3221         * UIProcess/WebPageProxy.cpp:
3222         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
3223
3224 2019-08-19  Youenn Fablet  <youenn@apple.com>
3225
3226         enumerateDevices should return the same JS objects if called twice
3227         https://bugs.webkit.org/show_bug.cgi?id=200767
3228
3229         Reviewed by Eric Carlson.
3230
3231         Update code as enumerate device request is now gone.
3232         Make use of async IPC to simplify code since we are now passing a completion handler directly.
3233
3234         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3235         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
3236         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
3237         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3238         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3239         * UIProcess/WebPageProxy.cpp:
3240         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3241         * UIProcess/WebPageProxy.h:
3242         * UIProcess/WebPageProxy.messages.in:
3243         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3244         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
3245         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3246         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
3247         (WebKit::WebUserMediaClient::enumerateMediaDevices):
3248         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
3249         * WebProcess/WebPage/WebPage.cpp:
3250         * WebProcess/WebPage/WebPage.h:
3251         * WebProcess/WebPage/WebPage.messages.in:
3252
3253 2019-08-18  Yusuke Suzuki  <ysuzuki@apple.com>
3254
3255         [WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part
3256         https://bugs.webkit.org/show_bug.cgi?id=200620
3257
3258         Reviewed by Geoffrey Garen.
3259
3260         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
3261         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
3262         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
3263         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3264         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3265         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
3266         * NetworkProcess/Downloads/DownloadManager.cpp:
3267         (WebKit::DownloadManager::startDownload):
3268         (WebKit::DownloadManager::convertNetworkLoadToDownload):
3269         (WebKit::DownloadManager::resumeDownload):
3270         * NetworkProcess/Downloads/DownloadMap.cpp:
3271         (WebKit::DownloadMap::add):
3272         * NetworkProcess/Downloads/PendingDownload.cpp:
3273         (WebKit::PendingDownload::PendingDownload):
3274         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3275         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
3276         * NetworkProcess/NetworkContentRuleListManager.cpp:
3277         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
3278         * NetworkProcess/NetworkDataTaskBlob.cpp:
3279         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3280         (WebKit::NetworkDataTaskBlob::download):
3281         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
3282         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
3283         * NetworkProcess/NetworkLoad.cpp:
3284         (WebKit::NetworkLoad::didReceiveResponse):
3285         * NetworkProcess/NetworkLoadChecker.cpp:
3286         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
3287         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
3288         * NetworkProcess/NetworkProcess.cpp:
3289         (WebKit::NetworkProcess::switchToNewTestingSession):
3290         (WebKit::NetworkProcess::ensureSession):
3291         (WebKit::NetworkProcess::swServerForSession):
3292         (WebKit::NetworkProcess::initializeQuotaUsers):
3293         (WebKit::NetworkProcess::storageQuotaManager):
3294         * NetworkProcess/NetworkProcess.h:
3295         (WebKit::NetworkProcess::addSupplement):
3296         * NetworkProcess/NetworkResourceLoader.cpp:
3297         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
3298         (WebKit::NetworkResourceLoader::startNetworkLoad):
3299         * NetworkProcess/NetworkSocketChannel.cpp:
3300         (WebKit::NetworkSocketChannel::create):
3301         * NetworkProcess/PreconnectTask.cpp:
3302         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
3303         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
3304         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
3305         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
3306         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
3307         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
3308         * NetworkProcess/WebStorage/StorageArea.cpp:
3309         (WebKit::StorageArea::clone const):
3310         * NetworkProcess/WebStorage/StorageManager.cpp:
3311         (WebKit::StorageManager::createSessionStorageNamespace):
3312         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
3313         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
3314         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
3315         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
3316         (WebKit::StorageManagerSet::add):
3317         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
3318         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
3319         * NetworkProcess/cache/NetworkCache.cpp:
3320         (WebKit::NetworkCache::Cache::Cache):
3321         (WebKit::NetworkCache::Cache::makeEntry):
3322         (WebKit::NetworkCache::Cache::makeRedirectEntry):
3323         (WebKit::NetworkCache::Cache::update):
3324         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3325         (WebKit::NetworkCache::Entry::decodeStorageRecord):
3326         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3327         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3328         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3329         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad):
3330         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
3331         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
3332         (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests):
3333         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
3334         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
3335         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3336         (WebKit::NetworkCache::Storage::synchronize):
3337         (WebKit::NetworkCache::Storage::readRecord):
3338         (WebKit::NetworkCache::retrieveFromMemory):
3339         (WebKit::NetworkCache::Storage::retrieve):
3340         (WebKit::NetworkCache::Storage::store):
3341         (WebKit::NetworkCache::Storage::traverse):
3342         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
3343         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
3344         * NetworkProcess/cache/PrefetchCache.cpp:
3345         (WebKit::PrefetchCache::store):
3346         (WebKit::PrefetchCache::storeRedirect):
3347         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3348         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3349         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
3350         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3351         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
3352         (WebKit::NetworkSessionCocoa::create):
3353         (WebKit::NetworkSessionCocoa::createWebSocketTask):
3354         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3355         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3356         * NetworkProcess/curl/NetworkSessionCurl.h:
3357         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
3358         (WebKit::NetworkConnectionToWebProcess::paymentCoordinator):
3359         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter):
3360         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3361         (WebKit::NetworkDataTaskSoup::download):
3362         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3363         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
3364         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3365         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
3366         (WebKit::NetworkSessionSoup::createWebSocketTask):
3367         * NetworkProcess/soup/NetworkSessionSoup.h:
3368         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
3369         (webkitSoupRequestInputStreamReadAsync):
3370         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
3371         (WebKit::NetworkMDNSRegister::registerMDNSName):
3372         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
3373         (WebKit::NetworkRTCMonitor::startUpdating):