c7450894c5e7f627b28f03f563b6ba71d9734d11
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-10-22  Fujii Hironori  <Hironori.Fujii@sony.com>
2
3         Unreviewed build fix for non-unified source builds
4         https://bugs.webkit.org/show_bug.cgi?id=203055
5         <rdar://problem/56504295>
6
7         * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added #include <WebCore/RuntimeEnabledFeatures.h>.
8
9 2019-10-22  John Wilander  <wilander@apple.com>
10
11         Resource Load Statistics (experimental): Block all third-party cookies
12         https://bugs.webkit.org/show_bug.cgi?id=203266
13         <rdar://problem/56512858>
14
15         Reviewed by Alex Christensen.
16
17         This change updates the experimental change in
18         <https://trac.webkit.org/changeset/251213> to block all
19         third-party cookies, regardless of user interaction with
20         the first-party website.
21
22         * NetworkProcess/NetworkProcess.cpp:
23         (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
24         * NetworkProcess/NetworkSessionCreationParameters.cpp:
25         (WebKit::NetworkSessionCreationParameters::encode const):
26         (WebKit::NetworkSessionCreationParameters::decode):
27         * NetworkProcess/NetworkSessionCreationParameters.h:
28         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
29         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
30         * Shared/WebPreferences.yaml:
31         * UIProcess/WebProcessPool.cpp:
32         (WebKit::WebProcessPool::ensureNetworkProcess):
33         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
34         (WebKit::WebsiteDataStore::parameters):
35
36 2019-10-22  Tim Horton  <timothy_horton@apple.com>
37
38         Make it possible to not include IPC Messages headers in other headers
39         https://bugs.webkit.org/show_bug.cgi?id=203074
40
41         * Scripts/webkit/messages_unittest.py:
42         (GeneratedFileContentsTest.assertHeaderEqual):
43         (GeneratedFileContentsTest.assertImplementationEqual):
44         (UnsupportedPrecompilerDirectiveTest.test_error_at_else):
45         (UnsupportedPrecompilerDirectiveTest.test_error_at_elif):
46         Fix the message generator unit tests.
47
48 2019-10-22  Alex Christensen  <achristensen@webkit.org>
49
50         Re-enable legacy TLS by default, keep runtime switch
51         https://bugs.webkit.org/show_bug.cgi?id=203253
52
53         Reviewed by Geoffrey Garen.
54
55         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
56         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
57         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
58         (WebKit::WebsiteDataStore::parameters):
59
60 2019-10-22  Alex Christensen  <achristensen@webkit.org>
61
62         Revert r243010 on pre-Catalina macOS
63         https://bugs.webkit.org/show_bug.cgi?id=203265
64         <rdar://problem/55570995>
65
66         Reviewed by Per Arne Vollan.
67
68         * WebProcess/com.apple.WebProcess.sb.in:
69
70 2019-10-22  Tim Horton  <timothy_horton@apple.com>
71
72         Update xcfilelists
73
74         * DerivedSources-output.xcfilelist:
75
76 2019-10-22  Tim Horton  <timothy_horton@apple.com>
77
78         Make it possible to not include IPC Messages headers in other headers
79         https://bugs.webkit.org/show_bug.cgi?id=203074
80
81         Reviewed by Geoffrey Garen.
82
83         Make the Messages generator generate a new -MessagesReplies.h file, which
84         only includes headers for and definitions of DelayedReply/AsyncReply types,
85         which need to be mentioned as arguments to message hander methods, and
86         thus must be available in various headers throughout the project.
87
88         In order to do this, we have to de-nest them from the primary message
89         class, but we then 'using' them back into place inside the message class
90         so that most of the code doesn't need to change.
91
92         This helps to wildly decrease the header load of WebPage.h and WebPageProxy.h,
93         especially, because the number of headers needed for types in their replies
94         is much smaller than the number needed for all message receivers.
95
96         Also, only invoke the Messages generator once per source file, and
97         only parse the source file once, generating all three output files
98         in one invocation.
99
100         And then clean up all the missing indirect includes that we lost by doing this.
101
102         All-in-all this is worth roughly 8% on the WebKit2 Build Time Benchmark.
103
104         * CMakeLists.txt:
105         * DerivedSources-input.xcfilelist:
106         * DerivedSources.make:
107         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
108         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
109         * NetworkProcess/NetworkConnectionToWebProcess.h:
110         * NetworkProcess/NetworkResourceLoader.cpp:
111         * NetworkProcess/NetworkResourceLoader.h:
112         * PluginProcess/PluginControllerProxy.cpp:
113         * PluginProcess/PluginControllerProxy.h:
114         * PluginProcess/WebProcessConnection.h:
115         * Scripts/Makefile:
116         * Scripts/generate-message-receiver.py:
117         (main):
118         * Scripts/generate-messages-header.py: Removed.
119         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
120         * Scripts/webkit/LegacyMessages-expected.h:
121         * Scripts/webkit/LegacyMessagesReplies-expected.h: Added.
122         * Scripts/webkit/MessageReceiver-expected.cpp:
123         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
124         * Scripts/webkit/Messages-expected.h:
125         * Scripts/webkit/MessagesReplies-expected.h: Added.
126         * Scripts/webkit/MessagesRepliesSuperclassReplies-expected.h: Added.
127         * Scripts/webkit/MessagesSuperclass-expected.h:
128         * Scripts/webkit/messages.py:
129         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
130         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
131         * UIProcess/Downloads/DownloadProxy.h:
132         * UIProcess/Network/NetworkProcessProxy.cpp:
133         * UIProcess/Network/NetworkProcessProxy.h:
134         * UIProcess/Plugins/PluginProcessManager.cpp:
135         * UIProcess/Plugins/PluginProcessManager.h:
136         * UIProcess/Plugins/PluginProcessProxy.h:
137         * UIProcess/ProvisionalPageProxy.h:
138         * UIProcess/SuspendedPageProxy.h:
139         * UIProcess/WebPageProxy.cpp:
140         * UIProcess/WebPageProxy.h:
141         * UIProcess/WebProcessPool.cpp:
142         * UIProcess/WebProcessPool.h:
143         * UIProcess/WebProcessProxy.h:
144         * UIProcess/ios/WKContentView.mm:
145         * UIProcess/ios/WKContentViewInteraction.mm:
146         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
147         * WebKit.xcodeproj/project.pbxproj:
148         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
149         * WebProcess/Storage/WebSWContextManagerConnection.h:
150         * WebProcess/WebPage/WebPage.h:
151         * WebProcess/WebPage/ios/WebPageIOS.mm:
152         * WebProcess/cocoa/VideoFullscreenManager.h:
153         * WebProcess/cocoa/VideoFullscreenManager.mm:
154
155 2019-10-22  Chris Dumez  <cdumez@apple.com>
156
157         Simplify "Unexpectedly Resumed" assertion handling
158         https://bugs.webkit.org/show_bug.cgi?id=203254
159
160         Reviewed by Geoffrey Garen.
161
162         When the WebContent process gets resumed from suspension, it now unconditionally takes a
163         process assertion on behalf on the UIProcess and sends a ProcessDidResume IPC to the
164         UIProcess. The UIProcess then sends a DidHandleProcessWasResumed IPC back after handing
165         the ProcessDidResume IPC allowing the WebContent process to release its assertion on
166         behalf on the UIProcess.
167
168         The previous code was racy because it relied on the m_processIsSuspended flag, which was
169         queried and set from different threads. Also, the 'unexpectedly resumed' naming was
170         confusing since we'd often take this assertion whenever the WebProcess got resumed,
171         wether unexpected or not, simply because the processTaskStateDidChange IPC won the race
172         with the ProcessDidResume IPC from the UIProcess.
173
174         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
175         (WebKit::WebProcessProxy::processWasResumed):
176         (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended): Deleted.
177         * UIProcess/WebProcessProxy.h:
178         * UIProcess/WebProcessProxy.messages.in:
179         * WebProcess/WebProcess.cpp:
180         (WebKit::WebProcess::processDidResume):
181         * WebProcess/WebProcess.h:
182         * WebProcess/WebProcess.messages.in:
183         * WebProcess/cocoa/WebProcessCocoa.mm:
184         (WebKit::WebProcess::processTaskStateDidChange):
185         (WebKit::WebProcess::didHandleProcessWasResumed):
186
187 2019-10-22  youenn fablet  <youenn@apple.com>
188
189         Remove mayHaveServiceWorkerRegisteredForOrigin
190         https://bugs.webkit.org/show_bug.cgi?id=203055
191
192         Reviewed by Alex Christensen.
193
194         This optimization was used for ensuring we would not create a storage process when no service worker registration is stored on disk.
195         Now that we do not have a storage process and we are doing registration matching direclty in network process, we can safely remove that optimization.
196         We also move the throttle state handling in WK2 layer. This allows us to not create a network process connection to update throttle state until
197         there is a network process connection. This allows continuing passing an API test checking network process connections after crashes.
198
199         * Shared/WebPageCreationParameters.cpp:
200         (WebKit::WebPageCreationParameters::encode const):
201         (WebKit::WebPageCreationParameters::decode):
202         * Shared/WebPageCreationParameters.h:
203         * UIProcess/WebPageProxy.cpp:
204         (WebKit::WebPageProxy::creationParameters):
205         * UIProcess/WebProcessPool.cpp:
206         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
207         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
208         * UIProcess/WebProcessPool.h:
209         * WebProcess/Network/NetworkProcessConnection.h:
210         * WebProcess/Storage/WebSWClientConnection.h:
211         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
212         (WebKit::WebServiceWorkerProvider::serviceWorkerConnection):
213         (WebKit::WebServiceWorkerProvider::updateThrottleState):
214         * WebProcess/Storage/WebServiceWorkerProvider.h:
215         * WebProcess/WebPage/WebPage.cpp:
216         (WebKit::m_textAutoSizingAdjustmentTimer):
217         (WebKit::WebPage::updateThrottleState):
218
219 2019-10-22  Yury Semikhatsky  <yurys@chromium.org>
220
221         [GTK] Web Inspector: add an option for disabling minification and concatenation of inspector UI in release build
222         https://bugs.webkit.org/show_bug.cgi?id=203201
223
224         Reviewed by Carlos Garcia Campos.
225
226         Allow passing COMBINE_INSPECTOR_RESOURCES and COMBINE_TEST_RESOURCES as cmake arguments. This
227         enables to avoid minification of Web Inspector scripts in release binaries which is very
228         convenient during inspector UI development.
229
230         * InspectorGResources.cmake:
231
232 2019-10-22  Adrian Perez de Castro  <aperez@igalia.com>
233
234         [GTK][WPE] Fix non-unified builds after r251326
235         https://bugs.webkit.org/show_bug.cgi?id=203244
236
237         Reviewed by Youenn Fablet.
238
239         * Shared/UserData.cpp: Add missing inclusion of WebCoreArgumentCoders.h
240         * UIProcess/Automation/SimulatedInputDispatcher.cpp: Add missing inclusion of wtf/Variant.h
241         * UIProcess/ProvisionalPageProxy.h: Add missing inclusion of WebCore/ResourceRequest.h
242         * UIProcess/WebTextChecker.cpp: Add missing inclusion of WebPageProxy.h
243         * WebProcess/Databases/WebDatabaseProvider.cpp: Add missing inclusion of WebIDBConnectionToServer.h
244
245 2019-10-22  youenn fablet  <youenn@apple.com>
246
247         WebSWServerToContextConnection should not assert when failing loads at destruction time
248         https://bugs.webkit.org/show_bug.cgi?id=203243
249
250         Reviewed by Alex Christensen.
251
252         On WebSWServerToContextConnection destruction, we move the fetch task map and fail the tasks.
253         At destruction of the tasks, which happens synchronously, they will try to unregister themselves
254         and the assertion that the task is in the map will fail.
255         To fix that, add a specific contextClosed method that will clear the task connection weak pointer.
256
257         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
258         (WebKit::ServiceWorkerFetchTask::contextClosed):
259         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
260         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
261         (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
262
263 2019-10-22  youenn fablet  <youenn@apple.com>
264
265         ServiceWorkerFetchTask can use the NetworkConnectionToWebProcess sessionID
266         https://bugs.webkit.org/show_bug.cgi?id=202208
267
268         Reviewed by Alex Christensen.
269
270         No need to store the sessionID in ServiceWorkerFetchTask since we can get it from its loader.
271
272         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
273         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
274         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
275         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
276         (WebKit::WebSWServerConnection::createFetchTask):
277
278 2019-10-22  youenn fablet  <youenn@apple.com>
279
280         Remove the ability to fallback to custom scheme handlers after a service worker did not handle the load
281         https://bugs.webkit.org/show_bug.cgi?id=203239
282
283         Reviewed by Alex Christensen.
284
285         We remove the ability for service workers to intercept custom scheme handlers.
286         We can then remove the ability for loads that are not handled by service workers to go through custom scheme handlers.
287
288         * WebProcess/Network/WebLoaderStrategy.cpp:
289         (WebKit::WebLoaderStrategy::scheduleLoad):
290         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
291         * WebProcess/Network/WebResourceLoader.cpp:
292         (WebKit::WebResourceLoader::serviceWorkerDidNotHandle):
293
294 2019-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
295
296         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.2 release
297
298         * gtk/NEWS: Add release notes for 2.27.2.
299
300 2019-10-21  Yusuke Suzuki  <ysuzuki@apple.com>
301
302         [JSC] Thread JSGlobalObject* instead of ExecState*
303         https://bugs.webkit.org/show_bug.cgi?id=202392
304
305         Reviewed by Geoffrey Garen.
306
307         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
308         (webkit_frame_get_js_value_for_dom_object_in_script_world):
309         * WebProcess/InjectedBundle/InjectedBundle.cpp:
310         (WebKit::InjectedBundle::reportException):
311         (WebKit::InjectedBundle::createWebDataFromUint8Array):
312         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
313         (WebKit::callMethod):
314         * WebProcess/Plugins/Netscape/JSNPMethod.h:
315         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
316         (WebKit::JSNPObject::callMethod):
317         (WebKit::JSNPObject::callObject):
318         (WebKit::JSNPObject::callConstructor):
319         (WebKit::callNPJSObject):
320         (WebKit::constructWithConstructor):
321         (WebKit::JSNPObject::getOwnPropertySlot):
322         (WebKit::JSNPObject::put):
323         (WebKit::JSNPObject::deleteProperty):
324         (WebKit::JSNPObject::deletePropertyByIndex):
325         (WebKit::JSNPObject::getOwnPropertyNames):
326         (WebKit::JSNPObject::propertyGetter):
327         (WebKit::JSNPObject::methodGetter):
328         (WebKit::JSNPObject::throwInvalidAccessError):
329         * WebProcess/Plugins/Netscape/JSNPObject.h:
330         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
331         (WebKit::identifierFromIdentifierRep):
332         (WebKit::NPJSObject::hasMethod):
333         (WebKit::NPJSObject::invoke):
334         (WebKit::NPJSObject::invokeDefault):
335         (WebKit::NPJSObject::hasProperty):
336         (WebKit::NPJSObject::getProperty):
337         (WebKit::NPJSObject::setProperty):
338         (WebKit::NPJSObject::removeProperty):
339         (WebKit::NPJSObject::enumerate):
340         (WebKit::NPJSObject::construct):
341         * WebProcess/Plugins/Netscape/NPJSObject.h:
342         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
343         (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
344         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
345         (WebKit::NPRuntimeObjectMap::evaluate):
346         (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState):
347         (WebKit::NPRuntimeObjectMap::globalExec const): Deleted.
348         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
349         * WebProcess/Plugins/PluginView.cpp:
350         (WebKit::PluginView::performJavaScriptURLRequest):
351         * WebProcess/WebPage/WebFrame.cpp:
352         (WebKit::WebFrame::jsContext):
353         (WebKit::WebFrame::jsContextForWorld):
354         (WebKit::WebFrame::frameForContext):
355         (WebKit::WebFrame::jsWrapperForWorld):
356         * WebProcess/WebPage/WebPage.cpp:
357         (WebKit::WebPage::freezeLayerTree):
358         (WebKit::WebPage::unfreezeLayerTree):
359         (WebKit::WebPage::runJavaScript):
360         * WebProcess/WebProcess.cpp:
361         (WebKit::WebProcess::networkProcessConnectionClosed):
362
363 2019-10-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>
364
365         [GTK][WPE] Enable service workers by default
366         https://bugs.webkit.org/show_bug.cgi?id=200815
367
368         Reviewed by Carlos Garcia Campos.
369
370         Flip the run-time switch to be enabled by default and not only
371         when building with experimental features enabled.
372
373         * Shared/WebPreferencesDefaultValues.h:
374
375 2019-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
376
377         [GTK] C++ comments used in C header files
378         https://bugs.webkit.org/show_bug.cgi?id=203191
379
380         Reviewed by Žan Doberšek.
381
382         * UIProcess/API/gtk/WebKitAutocleanups.h:
383         * UIProcess/API/gtk/WebKitDefines.h:
384         * UIProcess/API/gtk/WebKitForwardDeclarations.h:
385         * UIProcess/API/gtk/WebKitWebViewBase.h:
386         * UIProcess/API/wpe/WebKitAutocleanups.h:
387         * UIProcess/API/wpe/WebKitDefines.h:
388         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h:
389         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
390         * WebProcess/InjectedBundle/API/wpe/WebKitWebEditor.h:
391         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:
392
393 2019-10-22  Wenson Hsieh  <wenson_hsieh@apple.com>
394
395         imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html is flaky
396         https://bugs.webkit.org/show_bug.cgi?id=203181
397
398         Reviewed by Ryosuke Niwa.
399
400         Add a changeCount argument to informationForItemAtIndex and allPasteboardItemInfo, and also make then return
401         optional values; also, adjust changeCount to be an `int64_t` in a few places. See WebCore ChangeLog for more
402         details.
403
404         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
405         (WebKit::WebPasteboardProxy::pasteboardCopy):
406         (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
407         (WebKit::WebPasteboardProxy::addPasteboardTypes):
408         (WebKit::WebPasteboardProxy::setPasteboardTypes):
409         (WebKit::WebPasteboardProxy::setPasteboardURL):
410         (WebKit::WebPasteboardProxy::setPasteboardColor):
411         (WebKit::WebPasteboardProxy::setPasteboardStringForType):
412         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
413         (WebKit::WebPasteboardProxy::writeCustomData):
414         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
415         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
416         * UIProcess/WebPasteboardProxy.cpp:
417         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
418         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
419         * UIProcess/WebPasteboardProxy.h:
420         * UIProcess/WebPasteboardProxy.messages.in:
421         * WebProcess/Plugins/PDF/PDFPlugin.mm:
422         (WebKit::PDFPlugin::writeItemsToPasteboard):
423         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
424         (WebKit::WebPlatformStrategies::changeCount):
425         (WebKit::WebPlatformStrategies::addTypes):
426         (WebKit::WebPlatformStrategies::setTypes):
427         (WebKit::WebPlatformStrategies::setBufferForType):
428         (WebKit::WebPlatformStrategies::setURL):
429         (WebKit::WebPlatformStrategies::setColor):
430         (WebKit::WebPlatformStrategies::setStringForType):
431         (WebKit::WebPlatformStrategies::writeCustomData):
432         (WebKit::WebPlatformStrategies::allPasteboardItemInfo):
433         (WebKit::WebPlatformStrategies::informationForItemAtIndex):
434         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
435
436 2019-10-21  Daniel Bates  <dabates@apple.com>
437
438         Add some PencilKit extension points
439         https://bugs.webkit.org/show_bug.cgi?id=202962
440         <rdar://problem/56269759>
441
442         Reviewed by Andy Estes.
443
444         This is the WebKit part corresponding to <rdar://problem/56261392>.
445
446         * UIProcess/ios/WKContentViewInteraction.mm:
447         (-[WKContentView setupInteraction]): Call extension point.
448         (-[WKContentView cleanupInteraction]): Ditto.
449
450 2019-10-21  Matt Lewis  <jlewis3@apple.com>
451
452         Unreviewed, rolling out r251381.
453
454         This broke an internal build.
455
456         Reverted changeset:
457
458         "Add some PencilKit extension points"
459         https://bugs.webkit.org/show_bug.cgi?id=202962
460         https://trac.webkit.org/changeset/251381
461
462 2019-10-21  Myles C. Maxfield  <mmaxfield@apple.com>
463
464         [Cocoa] Move ui-serif, ui-monospaced, and ui-rounded out from behind SPI
465         https://bugs.webkit.org/show_bug.cgi?id=203129
466
467         Reviewed by Tim Horton.
468
469         * Shared/WebPreferences.yaml:
470         * UIProcess/API/Cocoa/WKPreferences.mm:
471         (-[WKPreferences _shouldAllowDesignSystemUIFonts]): Deleted.
472         (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]): Deleted.
473         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
474
475 2019-10-21  youenn fablet  <youenn@apple.com>
476
477         Move service worker registration matching for navigation loads to network process
478         https://bugs.webkit.org/show_bug.cgi?id=203144
479
480         Reviewed by Chris Dumez.
481
482         Create a WebSWServerConnection whenever receiving a load request in NetworkProcess.
483         This connection is used to check for service worker registration in case of navigation loads.
484         Similarly, we create a WebSWClientConnection whenever WebProcess needs it, including when receiving WebSWClientConnection messages from NetworkProcess.
485         This for instance happens when service worker registration import is complete to fill the shared registration origin store.
486
487         Delay loads until SWServer has finished importing its registrations.
488         This is needed since we might otherwise not intercept loads that could be intercepted.
489         Waiting for importing registrations was previously ensured by WebProcess getting a matching registration in DocumentLoader.
490
491         NetworkResourceLoader is now checking for service worker interception in case of redirections for navigations.
492         This is needed as redirections could end up using a new registration.
493
494         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
495         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
496         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
497         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
498         (WebKit::NetworkConnectionToWebProcess::swConnection):
499         * NetworkProcess/NetworkConnectionToWebProcess.h:
500         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
501         * NetworkProcess/NetworkResourceLoader.cpp:
502         (WebKit::NetworkResourceLoader::continueWillSendRequest):
503         (WebKit::NetworkResourceLoader::startWithServiceWorker):
504         (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle):
505         * NetworkProcess/NetworkResourceLoader.h:
506         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
507         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
508         (WebKit::ServiceWorkerFetchTask::start):
509         (WebKit::ServiceWorkerFetchTask::startFetch):
510         (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith):
511         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
512         (WebKit::ServiceWorkerFetchTask::takeRequest):
513         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
514         (WebKit::WebSWServerConnection::controlClient):
515         (WebKit::WebSWServerConnection::createFetchTask):
516         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
517         * WebProcess/Network/NetworkProcessConnection.cpp:
518         (WebKit::NetworkProcessConnection::didReceiveMessage):
519         * WebProcess/Network/WebLoaderStrategy.cpp:
520         (WebKit::WebLoaderStrategy::scheduleLoad):
521         * WebProcess/Storage/WebSWClientConnection.cpp:
522         (WebKit::WebSWClientConnection::WebSWClientConnection):
523         (WebKit::WebSWClientConnection::registrationReady):
524         (WebKit::WebSWClientConnection::documentIsControlled):
525         * WebProcess/Storage/WebSWClientConnection.h:
526         * WebProcess/Storage/WebSWClientConnection.messages.in:
527
528 2019-10-21  Sihui Liu  <sihui_liu@apple.com>
529
530         Remove IDBBackingStoreTemporaryFileHandler
531         https://bugs.webkit.org/show_bug.cgi?id=203128
532
533         Reviewed by Alex Christensen.
534
535         * NetworkProcess/NetworkProcess.cpp:
536         (WebKit::NetworkProcess::createIDBServer):
537         (WebKit::NetworkProcess::accessToTemporaryFileComplete): Deleted.
538         * NetworkProcess/NetworkProcess.h:
539
540 2019-10-21  John Wilander  <wilander@apple.com>
541
542         Resource Load Statistics: Update cookie blocking in NetworkStorageSession after first user interaction
543         https://bugs.webkit.org/show_bug.cgi?id=203195
544         <rdar://problem/56464567>
545
546         Reviewed by Alex Christensen and Chris Dumez.
547
548         This change makes sure that the state of cookie blocking in
549         WebCore:: NetworkStorageSession is immediately updated if the logged
550         user interaction was new for this domain. It adds a completion
551         handler to WebResourceLoadStatisticsStore::logUserInteraction() so
552         that the call properly waits for everything to be updated.
553
554         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
555         (WebKit::CompletionHandler<void):
556         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
557         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
558         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
559         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
560         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
561         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
562         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
563
564 2019-10-21  Dean Jackson  <dino@apple.com>
565
566         Dispatch AR event on the originating anchor element
567         https://bugs.webkit.org/show_bug.cgi?id=203198
568         <rdar://55743929>
569
570         Reviewed by Simon Fraser.
571
572         Use the ElementContext on SystemPreviewInfo.
573
574         * UIProcess/API/Cocoa/WKWebView.mm:
575         (-[WKWebView _triggerSystemPreviewActionOnElement:frame:page:]):
576         (-[WKWebView _triggerSystemPreviewActionOnFrame:page:]): Deleted.
577         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
578         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
579         * UIProcess/SystemPreviewController.h:
580         * WebProcess/WebPage/WebPage.cpp:
581         (WebKit::WebPage::systemPreviewActionTriggered):
582
583 2019-10-21  Dean Jackson  <dino@apple.com>
584
585         Move ElementContext from WebKit to WebCore
586         https://bugs.webkit.org/show_bug.cgi?id=203210
587         <rdar://problem/56475682>
588
589         Reviewed by Simon Fraser.
590
591         * Scripts/webkit/messages.py:
592         * Shared/DocumentEditingContext.h:
593         * Shared/DocumentEditingContext.mm:
594         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
595         * Shared/ElementContext.cpp: Removed.
596         * Shared/ElementContext.h: Removed.
597         * Shared/WebPreferencesDefaultValues.cpp:
598         (WebKit::defaultCSSOMViewScrollingAPIEnabled):
599         * Shared/WebsitePoliciesData.cpp:
600         (WebKit::WebsitePoliciesData::decode):
601         * Shared/ios/InteractionInformationAtPosition.h:
602         * Sources.txt:
603         * UIProcess/API/Cocoa/WKWebView.mm:
604         (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
605         * UIProcess/API/Cocoa/_WKTextInputContext.mm:
606         (-[_WKTextInputContext _initWithTextInputContext:]):
607         (-[_WKTextInputContext _textInputContext]):
608         * UIProcess/API/Cocoa/_WKTextInputContextInternal.h:
609         * UIProcess/WebPageProxy.cpp:
610         (WebKit::WebPageProxy::textInputContextsInRect):
611         (WebKit::WebPageProxy::focusTextInputContext):
612         * UIProcess/WebPageProxy.h:
613         * WebKit.xcodeproj/project.pbxproj:
614         * WebProcess/WebPage/WebPage.cpp:
615         (WebKit::WebPage::textInputContextsInRect):
616         (WebKit::WebPage::focusTextInputContext):
617         (WebKit::WebPage::elementForContext const):
618         (WebKit::WebPage::contextForElement const):
619         * WebProcess/WebPage/WebPage.h:
620         * WebProcess/WebPage/WebPage.messages.in:
621         * WebProcess/WebPage/ios/WebPageIOS.mm:
622         (WebKit::WebPage::startInteractionWithElementContextOrPosition):
623
624 2019-10-21  Alex Christensen  <achristensen@webkit.org>
625
626         ServiceWorker tests should use TCPServer instead of WKURLSchemeHandler
627         https://bugs.webkit.org/show_bug.cgi?id=203141
628
629         Reviewed by Youenn Fablet.
630
631         * NetworkProcess/NetworkProcess.cpp:
632         (WebKit::NetworkProcess::initializeNetworkProcess):
633         (WebKit::NetworkProcess::addWebsiteDataStore):
634         (WebKit::NetworkProcess::swServerForSession):
635         (WebKit::NetworkProcess::addServiceWorkerSession):
636         * NetworkProcess/NetworkProcess.h:
637         * Shared/WebsiteDataStoreParameters.cpp:
638         (WebKit::WebsiteDataStoreParameters::encode const):
639         (WebKit::WebsiteDataStoreParameters::decode):
640         * Shared/WebsiteDataStoreParameters.h:
641         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
642         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
643         (-[_WKWebsiteDataStoreConfiguration registerURLSchemeServiceWorkersCanHandleForTesting:]): Deleted.
644         * UIProcess/WebProcessPool.cpp:
645         (WebKit::WebProcessPool::initializeNewWebProcess):
646         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
647         (WebKit::WebsiteDataStore::parameters):
648         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
649         (WebKit::WebsiteDataStoreConfiguration::copy):
650         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
651         (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegisteredSchemes const): Deleted.
652         (WebKit::WebsiteDataStoreConfiguration::registerServiceWorkerScheme): Deleted.
653
654 2019-10-21  Tim Horton  <timothy_horton@apple.com>
655
656         macCatalyst: Swipe navigation gestures do not work
657         https://bugs.webkit.org/show_bug.cgi?id=203205
658         <rdar://problem/54617473>
659
660         Reviewed by Wenson Hsieh.
661
662         * UIProcess/ios/ViewGestureControllerIOS.mm:
663         (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
664         Use a different gesture recognizer for swipe in macCatalyst that behaves
665         more like the macOS implementation, based on scrolling instead of the
666         gesture coming from a screen edge.
667
668 2019-10-21  Daniel Bates  <dabates@apple.com>
669
670         Add some PencilKit extension points
671         https://bugs.webkit.org/show_bug.cgi?id=202962
672         <rdar://problem/56269759>
673
674         Reviewed by Andy Estes.
675
676         This is the WebKit part corresponding to <rdar://problem/56261392>.
677
678         * UIProcess/ios/WKContentViewInteraction.mm:
679         (-[WKContentView setupInteraction]): Call extension point.
680         (-[WKContentView cleanupInteraction]): Ditto.
681
682 2019-10-21  Chris Dumez  <cdumez@apple.com>
683
684         Add more release logging for "Unexpectedly resumed" assertion
685         https://bugs.webkit.org/show_bug.cgi?id=203196
686
687         Reviewed by Geoffrey Garen.
688
689         * WebProcess/WebProcess.cpp:
690         (WebKit::WebProcess::processDidResume):
691         * WebProcess/cocoa/WebProcessCocoa.mm:
692         (WebKit::WebProcess::processTaskStateDidChange):
693
694 2019-10-21  Carlos Garcia Campos  <cgarcia@igalia.com>
695
696         [GTK] Objects category in emoji picker is empty
697         https://bugs.webkit.org/show_bug.cgi?id=203189
698
699         Reviewed by Adrian Perez de Castro.
700
701         There's a typo in the first emopi name of objects section.
702
703         * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
704         (webkitEmojiChooserSetupEmojiSections): uted speaker -> muted speaker
705
706 2019-10-21  Carlos Garcia Campos  <cgarcia@igalia.com>
707
708         [GTK][WPE] IconDatabase is not thread safe yet
709         https://bugs.webkit.org/show_bug.cgi?id=202980
710
711         Reviewed by Adrian Perez de Castro.
712
713         Current implementation is safer, but we still need to protect members used by both threads.
714
715         * UIProcess/API/glib/IconDatabase.cpp:
716         (WebKit::IconDatabase::populatePageURLToIconURLMap):
717         (WebKit::IconDatabase::clearLoadedIconsTimerFired):
718         (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded):
719         (WebKit::IconDatabase::loadIconForPageURL):
720         (WebKit::IconDatabase::iconURLForPageURL):
721         (WebKit::IconDatabase::setIconForPageURL):
722         (WebKit::IconDatabase::clear):
723         * UIProcess/API/glib/IconDatabase.h:
724
725 2019-10-21  Tim Horton  <timothy_horton@apple.com>
726
727         Clean up some includes to improve WebKit2 build speed
728         https://bugs.webkit.org/show_bug.cgi?id=203071
729
730         Reviewed by Wenson Hsieh.
731
732         This is worth about 6% on WebKit2, and unlocks another 8% improvement
733         down the line (but which is less mechanical).
734
735         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
736         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
737         * NetworkProcess/NetworkSocketChannel.h:
738         * NetworkProcess/WebStorage/StorageArea.h:
739         * NetworkProcess/WebStorage/StorageManager.cpp:
740         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
741         * Platform/IPC/Connection.h:
742         * Shared/API/APIURL.h:
743         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
744         * Shared/WebCoreArgumentCoders.cpp:
745         * Shared/WebCoreArgumentCoders.h:
746         * UIProcess/API/APIAttachment.h:
747         * UIProcess/API/Cocoa/_WKInspector.mm:
748         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
749         * UIProcess/TextCheckerCompletion.cpp:
750         * UIProcess/TextCheckerCompletion.h:
751         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
752         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
753         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
754         * UIProcess/UserContent/WebUserContentControllerProxy.h:
755         (WebKit::WebUserContentControllerProxy::addNetworkProcess): Deleted.
756         (WebKit::WebUserContentControllerProxy::removeNetworkProcess): Deleted.
757         * WebProcess/Automation/WebAutomationSessionProxy.h:
758         * WebProcess/Network/NetworkProcessConnection.cpp:
759         * WebProcess/Network/NetworkProcessConnection.h:
760         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
761         * WebProcess/Plugins/PDF/PDFPlugin.mm:
762         * WebProcess/Plugins/Plugin.cpp:
763         * WebProcess/Plugins/Plugin.h:
764         * WebProcess/WebProcess.cpp:
765
766 2019-10-20  Brent Fulgham  <bfulgham@apple.com>
767
768         Improve serialization logic
769         https://bugs.webkit.org/show_bug.cgi?id=203039
770         <rdar://problem/55631691>
771
772         Reviewed by Alex Christensen.
773
774         Check that the SecItemRequestData only contains relevant types for
775         CFNetwork uses. 
776
777         * Platform/spi/Cocoa/SecItemSPI.h: Added.
778         * Shared/mac/SecItemRequestData.cpp:
779         (WebKit::arrayContainsInvalidType): Added.
780         (WebKit::dictionaryContainsInvalidType): Added.
781         (WebKit::validTypeIDs): Added.
782         (WebKit::isValidType): Added.
783         (WebKit::SecItemRequestData::decode): Check types during decode.
784         * Shared/mac/SecItemRequestData.h:
785         * WebKit.xcodeproj/project.pbxproj:
786
787 2019-10-19  Adrian Perez de Castro  <aperez@igalia.com>
788
789         [GTK][WPE] Fix non-unified builds after r250857
790         https://bugs.webkit.org/show_bug.cgi?id=203145
791
792         Reviewed by Carlos Garcia Campos.
793
794         * UIProcess/WebProcessProxy.cpp: Add missing inclusion of the WebBackForwardCache.h header.
795
796 2019-10-18  Tim Horton  <timothy_horton@apple.com>
797
798         macCatalyst: Cursor should send mouse events, not touch events
799         https://bugs.webkit.org/show_bug.cgi?id=203175
800         <rdar://problem/56321134>
801
802         Reviewed by Simon Fraser.
803
804         * Platform/spi/ios/UIKitSPI.h:
805         * Shared/NativeWebMouseEvent.h:
806         * Shared/ios/NativeWebMouseEventIOS.mm:
807         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
808         Add a NativeWebMouseEvent constructor that doesn't actually wrap a native event,
809         for creating totally-synthetic events.
810
811         * UIProcess/ios/WKMouseGestureRecognizer.h: Added.
812         * UIProcess/ios/WKMouseGestureRecognizer.mm: Added.
813         (webEventModifiersForUIKeyModifierFlags):
814         (-[WKMouseGestureRecognizer initWithTarget:action:]):
815         (-[WKMouseGestureRecognizer setView:]):
816         (-[WKMouseGestureRecognizer lastMouseEvent]):
817         (-[WKMouseGestureRecognizer lastMouseLocation]):
818         (-[WKMouseGestureRecognizer mouseTouch]):
819         (-[WKMouseGestureRecognizer _wantsHoverEvents]):
820         (-[WKMouseGestureRecognizer reset]):
821         (-[WKMouseGestureRecognizer _shouldReceiveTouch:forEvent:recognizerView:]):
822         (-[WKMouseGestureRecognizer _shouldReceivePress:]):
823         (-[WKMouseGestureRecognizer createMouseEventWithType:]):
824         (-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
825         (-[WKMouseGestureRecognizer touchesMoved:withEvent:]):
826         (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
827         (-[WKMouseGestureRecognizer touchesCancelled:withEvent:]):
828         (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
829         (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]):
830         (-[WKMouseGestureRecognizer _hoverExited:withEvent:]):
831         (-[WKMouseGestureRecognizer _hoverCancelled:withEvent:]):
832         (-[WKMouseGestureRecognizer locationInView:]):
833         (-[WKMouseGestureRecognizer canPreventGestureRecognizer:]):
834         (-[WKMouseGestureRecognizer canBePreventedByGestureRecognizer:]):
835         Instead of just using UIHoverGestureRecognizer, introduce a new gesture
836         recognizer that does what it did, but also supports cases where the button
837         is pressed (so, mousedown and mouseup instead of just mousemove),
838         and synthesizes mouse events for all state transitions. These events
839         should look roughly identical to what a non-macCatalyst app would get
840         in AppKit's mouseUp/mouseDown/mouseMoved NSResponder methods.
841
842         * SourcesCocoa.txt:
843         * UIProcess/ios/WKContentViewInteraction.h:
844         * UIProcess/ios/WKContentViewInteraction.mm:
845         (-[WKContentView setupInteraction]):
846         (-[WKContentView cleanupInteraction]):
847         (-[WKContentView _removeDefaultGestureRecognizers]):
848         (-[WKContentView _addDefaultGestureRecognizers]):
849         (-[WKContentView gestureRecognizer:shouldReceiveTouch:]):
850         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
851         (-[WKContentView _showShareSheet:inRect:completionHandler:]):
852         (-[WKContentView _mouseGestureRecognizerChanged:]):
853         (webEventFlagsForUIKeyModifierFlags): Deleted.
854         (-[WKContentView _hoverGestureRecognizerChanged:]): Deleted.
855         * WebKit.xcodeproj/project.pbxproj:
856         Make use of WKMouseGestureRecognizer to plumb the synthesized events directly
857         to the macOS-style "handleMouseEvent" codepath, instead of going through
858         the touch events path (and then subsequently generating synthetic clicks).
859         Also, ensure that other gesture recognizers ignore the mouse "touch" entirely
860         by returning NO in shouldReceiveTouch.
861
862 2019-10-18  Jiewen Tan  <jiewen_tan@apple.com>
863
864         [WebAuthn] Warn users when no credentials are found
865         https://bugs.webkit.org/show_bug.cgi?id=203147
866         <rdar://problem/55931123>
867
868         Reviewed by Brent Fulgham.
869
870         This patch returns _WKWebAuthenticationPanelUpdateNoCredentialsFound to client via
871         -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] when either
872         CtapAuthenticator receives kCtap2ErrNoCredentials or U2fAuthenticator exhausts the
873         allow list.
874
875         This patch also enhances CtapAuthenticator::tryDowngrade to check if the CTAP command
876         can be converted to U2F commands to ensure kCtap2ErrNoCredentials is returned if it
877         is the case. Otherwise, after downgrading, U2fAuthenticator will return NotSupportedError
878         given it can't convert the commands.
879
880         * UIProcess/API/APIUIClient.h:
881         * UIProcess/API/APIWebAuthenticationPanelClient.h:
882         (API::WebAuthenticationPanelClient::updatePanel const):
883         * UIProcess/WebAuthentication/Authenticator.h:
884         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
885         (WebKit::AuthenticatorManager::authenticatorStatusUpdated):
886         * UIProcess/WebAuthentication/AuthenticatorManager.h:
887         * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
888         * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
889         (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
890         (WebKit::wkWebAuthenticationPanelUpdate):
891         (WebKit::WebAuthenticationPanelClient::updatePanel const):
892         * UIProcess/WebAuthentication/WebAuthenticationFlags.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationPanelFlags.h.
893         * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
894         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
895         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
896         (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
897         (WebKit::CtapAuthenticator::tryDowngrade):
898         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
899         (WebKit::U2fAuthenticator::issueSignCommand):
900         * WebKit.xcodeproj/project.pbxproj:
901
902 2019-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
903
904         [Clipboard API] Refactor Pasteboard::read() to take an optional item index
905         https://bugs.webkit.org/show_bug.cgi?id=203161
906
907         Reviewed by Tim Horton.
908
909         * Shared/mac/PasteboardTypes.mm:
910         (WebKit::PasteboardTypes::forEditing):
911         (WebKit::PasteboardTypes::forSelection):
912
913         Support "com.apple.webarchive" alongside the private "Apple Web Archive pasteboard type".
914
915         * UIProcess/Cocoa/WebViewImpl.mm:
916         (WebKit::WebViewImpl::setPromisedDataForImage):
917
918 2019-10-18  Ryosuke Niwa  <rniwa@webkit.org>
919
920         [iOS] REGRESSION(r251269): fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html and fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html fail
921         https://bugs.webkit.org/show_bug.cgi?id=203162
922         <rdar://problem/56418459>
923
924         Reviewed by Simon Fraser.
925
926         Synchronously update the rendering before the orientation change and other viewport size updates.
927
928         Otherwise, resize event will be dispatched in the middle of orientation animation,
929         and would result in non-determistic results.
930
931         * WebProcess/WebPage/ios/WebPageIOS.mm:
932         (WebKit::WebPage::dynamicViewportSizeUpdate):
933
934 2019-10-18  Chris Dumez  <cdumez@apple.com>
935
936         [iOS] "Unexpectedly Resumed" process assertion may cause us to get terminated
937         https://bugs.webkit.org/show_bug.cgi?id=203046
938         <rdar://problem/56179592>
939
940         Reviewed by Geoffrey Garen.
941
942         This patch implements the following to avoid getting terminated:
943         1. Schedule the task to release the assertion on a background thread instead of
944            the main thread so that we end up releasing the task even if the main thread
945            is somehow hung.
946         2. Add an invalidation handler to the process assertion which releases the assertion
947            upon expiration.
948
949         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
950         (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
951         * WebProcess/WebProcess.cpp:
952         (WebKit::WebProcess::processDidResume):
953         * WebProcess/WebProcess.h:
954         * WebProcess/cocoa/WebProcessCocoa.mm:
955         (WebKit::WebProcess::processTaskStateDidChange):
956
957 2019-10-18  Jer Noble  <jer.noble@apple.com>
958
959         Add experimental HDR MediaCapabilities support.
960         https://bugs.webkit.org/show_bug.cgi?id=203113
961
962         Reviewed by Eric Carlson.
963
964         Add experimental hdrMediaCapabilitiesEnabled preference.
965
966         * Shared/WebPreferences.yaml:
967
968 2019-10-18  Jiewen Tan  <jiewen_tan@apple.com>
969
970         [WebAuthn] Implement AuthenticatorCancel
971         https://bugs.webkit.org/show_bug.cgi?id=191523
972         <rdar://problem/55920204>
973
974         Reviewed by Brent Fulgham.
975
976         This patch implement two ways to cancel a pending WebAuthn ceremony:
977         1) Via navigation activities. Activities include i) main frame navigation, ii) main frame reload,
978         iii) main frame destruction, iv) sub frame navigation, and v) sub frame destruction. All the above
979         activities will cancel any pending WebAuthn ceremony that is associated with the frame. To prove
980         the association, a GlobalFrameIdentifier is bridged into WebAuthenticationRequestData. Navigation
981         cancel is done in WebPageProxy::didStartProvisionalLoadForFrameShared, and destruction cancel is done
982         in WebProcessProxy::didDestroyFrame and WebPageProxy::resetState.
983         2) Via UI. This path is simply bridged -[_WKWebAuthenticationPanel cancel] into AuthenticatorManager.
984         Noted, this patch follows the spec to wait until time out to notify RPs.
985         References: i) Step 20 of https://www.w3.org/TR/webauthn/#createCredential, ii) Step 18 of
986         https://www.w3.org/TR/webauthn/#getAssertion
987
988         As for what the cancel actually does, it:
989         1) stops any HID/NFC scanning;
990         2) sends CTAPHID_CANCEL to any HID authenticators that have been added. Reference:
991         https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#usb-hid-cancel
992         Sending CTAPHID_CANCEL, however, is not trivial. An abstract class FidoAuthenticator is crafted to
993         do this labor for both CtapAuthenticator and U2fAuthenticator during the time of destructions.
994         Noted: The CtapHidDriver is the only CtapDriver implements the cancel method. Since the message
995         is sent during state reset, lifecycle of the HidConenction and HidService which manage the underlying
996         IOHIDDeviceRef is very hard to hold. This is required for the regular async sender. Therefore,
997         HidConnection::sendSync is crafted to send the message synchronously to get rid of the tediousness
998         of managing those lifecycles.
999
1000         P.S. Vector::grow doesn't initialize POD types. Therefore, this patch also appends it with memset
1001         for FidoHidPacket.
1002
1003         P.S.S. This patch also simplifies AuthenticatorCoordinatorClient by: i) moving code from AuthenticatorCoordinatorClient
1004         to WebAuthenticatorCoordinatorClient, and ii) using sendWithAsyncReply. The latter allows us to
1005         get rid of the complex mechanism of ensuring the right reply is returned.
1006
1007         * DerivedSources.make:
1008         * Sources.txt:
1009         * UIProcess/API/APIWebAuthenticationPanel.cpp:
1010         (API::WebAuthenticationPanel::create):
1011         (API::WebAuthenticationPanel::WebAuthenticationPanel):
1012         (API::WebAuthenticationPanel::cancel const):
1013         * UIProcess/API/APIWebAuthenticationPanel.h:
1014         * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
1015         (-[_WKWebAuthenticationPanel cancel]):
1016         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
1017         (WebKit::AuthenticatorManager::cancelRequest):
1018         (WebKit::AuthenticatorManager::clearState):
1019         (WebKit::AuthenticatorManager::runPanel):
1020         (WebKit::AuthenticatorManager::resetState):
1021         * UIProcess/WebAuthentication/AuthenticatorManager.h:
1022         * UIProcess/WebAuthentication/Cocoa/HidConnection.h:
1023         (WebKit::HidConnection::isInitialized const):
1024         (WebKit::HidConnection::setIsInitialized):
1025         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
1026         (WebKit::HidConnection::~HidConnection):
1027         (WebKit::HidConnection::initialize):
1028         (WebKit::HidConnection::terminate):
1029         (WebKit::HidConnection::sendSync):
1030         (WebKit::HidConnection::send):
1031         (WebKit::HidConnection::registerDataReceivedCallback):
1032         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
1033         (WebKit::MockHidConnection::initialize):
1034         (WebKit::MockHidConnection::terminate):
1035         (WebKit::MockHidConnection::sendSync):
1036         (WebKit::MockHidConnection::send):
1037         (WebKit::MockHidConnection::feedReports):
1038         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
1039         * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
1040         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
1041         (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
1042         (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
1043         (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest):
1044         (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable):
1045         (WebKit::WebAuthenticatorCoordinatorProxy::requestReply): Deleted.
1046         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
1047         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
1048         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
1049         (WebKit::CtapAuthenticator::CtapAuthenticator):
1050         (WebKit::CtapAuthenticator::makeCredential):
1051         (WebKit::CtapAuthenticator::getAssertion):
1052         (WebKit::CtapAuthenticator::tryDowngrade):
1053         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
1054         * UIProcess/WebAuthentication/fido/CtapDriver.h:
1055         (WebKit::CtapDriver::cancel):
1056         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
1057         (WebKit::CtapHidDriver::Worker::write):
1058         (WebKit::CtapHidDriver::Worker::read):
1059         (WebKit::CtapHidDriver::Worker::returnMessage):
1060         (WebKit::CtapHidDriver::Worker::reset):
1061         (WebKit::CtapHidDriver::Worker::cancel):
1062         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
1063         (WebKit::CtapHidDriver::continueAfterResponseReceived):
1064         (WebKit::CtapHidDriver::returnResponse):
1065         (WebKit::CtapHidDriver::reset):
1066         (WebKit::CtapHidDriver::cancel):
1067         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
1068         * UIProcess/WebAuthentication/fido/FidoAuthenticator.cpp: Copied from Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp.
1069         (WebKit::FidoAuthenticator::FidoAuthenticator):
1070         (WebKit::FidoAuthenticator::~FidoAuthenticator):
1071         (WebKit::FidoAuthenticator::driver const):
1072         (WebKit::FidoAuthenticator::releaseDriver):
1073         * UIProcess/WebAuthentication/fido/FidoAuthenticator.h: Copied from Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp.
1074         * UIProcess/WebAuthentication/fido/FidoService.cpp:
1075         (WebKit::FidoService::continueAfterGetInfo):
1076         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
1077         (WebKit::U2fAuthenticator::U2fAuthenticator):
1078         (WebKit::U2fAuthenticator::issueCommand):
1079         * UIProcess/WebAuthentication/fido/U2fAuthenticator.h:
1080         * UIProcess/WebPageProxy.cpp:
1081         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
1082         (WebKit::WebPageProxy::resetState):
1083         * UIProcess/WebProcessProxy.cpp:
1084         (WebKit::WebProcessProxy::didDestroyFrame):
1085         * WebKit.xcodeproj/project.pbxproj:
1086         * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
1087         (WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator):
1088         (WebKit::WebAuthenticatorCoordinator::makeCredential):
1089         (WebKit::WebAuthenticatorCoordinator::getAssertion):
1090         (WebKit::WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable):
1091         (WebKit::WebAuthenticatorCoordinator::~WebAuthenticatorCoordinator): Deleted.
1092         * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h:
1093         * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in: Removed.
1094         * WebProcess/WebPage/WebFrame.cpp:
1095         (WebKit::WebFrame::fromCoreFrame):
1096         * WebProcess/WebPage/WebFrame.h:
1097
1098 2019-10-18  Zan Dobersek  <zdobersek@igalia.com>
1099
1100         Avoid crashes on GCC-compiled binaries by avoiding a use-after-move
1101         that's the result of differring call conventions.
1102
1103         Rubber-stamped by Carlos Garcia Campos.
1104
1105         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1106         (WebKit::WebSWServerConnection::startFetch): Copy the SW identifier from
1107         the ServiceWorkerFetchTask before it's moved into the lambda.
1108
1109 2019-10-17  Mark Lam  <mark.lam@apple.com>
1110
1111         Use constexpr in more places and remove some unnecessary external linkage.
1112         https://bugs.webkit.org/show_bug.cgi?id=203115
1113
1114         Reviewed by Yusuke Suzuki.
1115
1116         * UIProcess/API/APIContentRuleListStore.h:
1117         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
1118
1119 2019-10-17  Antoine Quint  <graouts@apple.com>
1120
1121         [Web Animations] Enable the Web Animations JavaScript API by default
1122         https://bugs.webkit.org/show_bug.cgi?id=203075
1123
1124         Reviewed by Antti Koivisto.
1125
1126         * Shared/WebPreferences.yaml:
1127
1128 2019-10-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1129
1130         [GTK][WPE] File and Directory Entries API is not enabled
1131         https://bugs.webkit.org/show_bug.cgi?id=202796
1132
1133         Reviewed by Adrian Perez de Castro.
1134
1135         Enable by default the DirectoryUpload runtime setting that is
1136         used to enable the APIs of the File and Directory Entries API.
1137
1138         Enable also the DataTransferItemsEnabled runtime setting that
1139         exposes the DataTransferItem API. This makes the manual tests
1140         available at https://w3c-test.org/entries-api mostly pass on
1141         platform GTK (those tests need also the DataTransferItem API
1142         to enable the drag-and-drop).
1143
1144         The bug <https://webkit.org/b/98940> for DataTransferItem API
1145         remains open because the layout test editing/pasteboard/data-transfer-items.html
1146         is still not passing completely. However other manual tests for
1147         DataTransferItem pass after enabling it.
1148
1149         * Shared/WebPreferencesDefaultValues.h:
1150
1151 2019-10-17  Devin Rousso  <drousso@apple.com>
1152
1153         Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
1154         https://bugs.webkit.org/show_bug.cgi?id=200384
1155         <rdar://problem/53850352>
1156
1157         Reviewed by Joseph Pecoraro.
1158
1159         * WebProcess/WebPage/RemoteWebInspectorUI.h:
1160         (WebKit::WebInspectorUI::backendCommandsURL const): Added.
1161         (WebKit::WebInspectorUI::debuggableType const): Added.
1162         (WebKit::WebInspectorUI::backendCommandsURL): Deleted.
1163         (WebKit::WebInspectorUI::debuggableType): Deleted.
1164         * WebProcess/WebPage/WebInspectorUI.h:
1165         (WebKit::WebInspectorUI::backendCommandsURL const): Added.
1166         (WebKit::WebInspectorUI::debuggableType const): Added.
1167         * UIProcess/WebPageDebuggable.h:
1168         (WebKit::WebPageDebuggable::type const):
1169         * UIProcess/glib/RemoteInspectorClient.cpp:
1170         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
1171         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
1172         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
1173         (debuggableTypeString):
1174         Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).
1175
1176 2019-10-16  Emilio Cobos Álvarez  <emilio@crisal.io>
1177
1178         Pass network cache directory in WebsiteDataStore::parameters() for non-Cocoa platforms.
1179         https://bugs.webkit.org/show_bug.cgi?id=203043
1180
1181         This was causing various errors in the network process that were
1182         visible in debug builds.
1183
1184         Reviewed by Alex Christensen.
1185
1186         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1187         (WebKit::WebsiteDataStore::parameters):
1188
1189 2019-10-16  Chris Dumez  <cdumez@apple.com>
1190
1191         Rename PageCache to BackForwardCache
1192         https://bugs.webkit.org/show_bug.cgi?id=203048
1193
1194         Reviewed by Alex Christensen.
1195
1196         Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache.
1197
1198         * Shared/CacheModel.cpp:
1199         (WebKit::calculateMemoryCacheSizes):
1200         * Shared/CacheModel.h:
1201         * Shared/WebPreferences.yaml:
1202         * UIProcess/API/APINavigationClient.h:
1203         (API::NavigationClient::willGoToBackForwardListItem):
1204         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1205         (API::ProcessPoolConfiguration::copy):
1206         * UIProcess/API/APIProcessPoolConfiguration.h:
1207         * UIProcess/API/C/WKPreferences.cpp:
1208         (WKPreferencesSetPageCacheEnabled):
1209         (WKPreferencesGetPageCacheEnabled):
1210         (WKPreferencesSetPageCacheSupportsPlugins):
1211         (WKPreferencesGetPageCacheSupportsPlugins):
1212         * UIProcess/API/Cocoa/WKPreferences.mm:
1213         (-[WKPreferences _setUsesPageCache:]):
1214         (-[WKPreferences _usesPageCache]):
1215         (-[WKPreferences _setPageCacheSupportsPlugins:]):
1216         (-[WKPreferences _pageCacheSupportsPlugins]):
1217         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1218         (-[_WKProcessPoolConfiguration pageCacheEnabled]):
1219         (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
1220         * UIProcess/API/glib/WebKitSettings.cpp:
1221         (webkit_settings_get_enable_page_cache):
1222         (webkit_settings_set_enable_page_cache):
1223         * UIProcess/Cocoa/NavigationState.h:
1224         * UIProcess/Cocoa/NavigationState.mm:
1225         (WebKit::NavigationState::setNavigationDelegate):
1226         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
1227         (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
1228         (WebKit::NavigationState::NavigationClient::didReceiveServerRedirectForProvisionalNavigation):
1229         (WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError):
1230         (WebKit::NavigationState::NavigationClient::didCommitNavigation):
1231         (WebKit::NavigationState::NavigationClient::didFinishDocumentLoad):
1232         (WebKit::NavigationState::NavigationClient::didFinishNavigation):
1233         (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
1234         (WebKit::NavigationState::NavigationClient::didSameDocumentNavigation):
1235         * UIProcess/ViewGestureController.cpp:
1236         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
1237         * UIProcess/WebPageProxy.cpp:
1238         (WebKit::WebPageProxy::shouldUseBackForwardCache const):
1239         (WebKit::WebPageProxy::willGoToBackForwardListItem):
1240         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
1241         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
1242         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
1243         (WebKit::WebPageProxy::didCommitLoadForFrame):
1244         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1245         (WebKit::WebPageProxy::didFinishLoadForFrame):
1246         (WebKit::WebPageProxy::didFailLoadForFrame):
1247         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1248         * UIProcess/WebPageProxy.h:
1249         * UIProcess/WebPageProxy.messages.in:
1250         * UIProcess/WebProcessPool.cpp:
1251         (WebKit::WebProcessPool::updateBackForwardCacheCapacity):
1252         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
1253         (WKBundleBackForwardListItemIsInBackForwardCache):
1254         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h:
1255         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1256         (WebKit::toBackForwardListItemState):
1257         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1258         (WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
1259         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
1260         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
1261         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1262         (WebKit::WebFrameLoaderClient::didRestoreFromBackForwardCache):
1263         (WebKit::WebFrameLoaderClient::createPlugin):
1264         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1265         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
1266         (WebKit::WebFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache):
1267         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1268         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1269         (WebKit::WebBackForwardListProxy::removeItem):
1270         * WebProcess/WebPage/WebPage.cpp:
1271         (WebKit::WebPage::suspendForProcessSwap):
1272         * WebProcess/WebProcess.cpp:
1273         (WebKit::WebProcess::initializeWebProcess):
1274         (WebKit::WebProcess::setCacheModel):
1275         (WebKit::WebProcess::deleteWebsiteData):
1276         (WebKit::WebProcess::setBackForwardCacheCapacity):
1277         (WebKit::WebProcess::clearCachedPage):
1278         * WebProcess/WebProcess.h:
1279
1280 2019-10-16  Per Arne Vollan  <pvollan@apple.com>
1281
1282         [iOS] Remove ubiquity client rule from sandbox
1283         https://bugs.webkit.org/show_bug.cgi?id=201347
1284
1285         Reviewed by Brent Fulgham.
1286
1287         This rule is most likely not needed, since we have already blocked all of its associated mach services,
1288         and no issues have been reported.
1289
1290         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1291
1292 2019-10-16  Tim Horton  <timothy_horton@apple.com>
1293
1294         iOS: inputmode=none is not respected with a hardware keyboard attached
1295         https://bugs.webkit.org/show_bug.cgi?id=203061
1296
1297         Reviewed by Daniel Bates.
1298
1299         * UIProcess/ios/WKContentViewInteraction.mm:
1300         (-[WKContentView shouldShowAutomaticKeyboardUI]):
1301         We can resolve this FIXME, as the underlying bug was fixed in <rdar://problem/52706523>.
1302         This now means that we will respect inputmode=none even when a hardware
1303         keyboard is attached, significantly improving the experience on sites that use it
1304         by avoiding an intermittent input bar.
1305
1306 2019-10-16  Per Arne Vollan  <pvollan@apple.com>
1307
1308         [iOS] Remove send-signal from mach-lookup rule
1309         https://bugs.webkit.org/show_bug.cgi?id=201203
1310
1311         Reviewed by Brent Fulgham.
1312
1313         The send-signal can be removed, since crashes have not been reported from this rule.
1314
1315         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1316
1317 2019-10-16  Dean Jackson  <dino@apple.com>
1318
1319         Add Swift modulemap for WebKit Private APIs
1320         https://bugs.webkit.org/show_bug.cgi?id=203059
1321
1322         Reviewed by Tim Horton.
1323
1324         Provide a Swift modulemap for WebKit_Private, and
1325         ensure WKPreferencesPrivate.h is exposed.
1326
1327         Renamed OSX.modulemap to macOS.modulemap while here.
1328
1329         * Configurations/WebKit.xcconfig:
1330         * Modules/iOS.private.modulemap: Added.
1331         * Modules/macOS.modulemap: Renamed from Source/WebKit/Modules/OSX.modulemap.
1332         * Modules/macOS.private.modulemap: Added.
1333         * Shared/API/Cocoa/WebKitPrivate.h: Include WKPreferencesPrivate.h.
1334
1335 2019-10-16  John Wilander  <wilander@apple.com>
1336
1337         Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction
1338         https://bugs.webkit.org/show_bug.cgi?id=203017
1339         <rdar://problem/56262708>
1340
1341         Reviewed by Alex Christensen.
1342
1343         This enhancement is off by default and controlled by an internal feature flag.
1344
1345         The functional change is in WebCore::NetworkStorageSession::shouldBlockCookies() which is
1346         called from:
1347         - NetworkDataTaskCocoa::NetworkDataTaskCocoa()
1348         - NetworkDataTaskCocoa::willPerformHTTPRedirection
1349
1350         shouldBlockCookies() now checks if the first-party website has received user interaction
1351         and if not, blocks all third-party cookies, regardless of the status of those third-party
1352         domains (prevalent or not).
1353
1354         The changes to ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore
1355         are about communicating which domains have received user interaction (prevalent or not)
1356         to the network storage session so that it can enforce the new restriction.
1357
1358         The C API change and piping through the WebsiteDataStore is test infrastructure.
1359
1360         Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.
1361
1362         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1363         (WebKit::CompletionHandler<void):
1364         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
1365         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1366         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
1367         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
1368         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1369         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
1370         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1371         (WebKit::RegistrableDomainsToBlockCookiesFor::isolatedCopy const):
1372         * NetworkProcess/NetworkProcess.cpp:
1373         (WebKit::NetworkProcess::initializeNetworkProcess):
1374         (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
1375         * NetworkProcess/NetworkProcess.messages.in:
1376         * NetworkProcess/NetworkSession.cpp:
1377         (WebKit::NetworkSession::NetworkSession):
1378         * NetworkProcess/NetworkSession.h:
1379         (WebKit::NetworkSession::setResourceLoadStatisticsLogTestingEvent):
1380         (WebKit::NetworkSession::shouldIsolateSessionsForPrevalentTopFrames const): Deleted.
1381         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1382         (WebKit::NetworkSessionCreationParameters::encode const):
1383         (WebKit::NetworkSessionCreationParameters::decode):
1384         * NetworkProcess/NetworkSessionCreationParameters.h:
1385         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1386         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1387         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1388         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1389         * Shared/WebPreferences.yaml:
1390         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1391         (WKWebsiteDataStoreSetResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
1392         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1393         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1394         * UIProcess/Network/NetworkProcessProxy.cpp:
1395         (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting):
1396         * UIProcess/Network/NetworkProcessProxy.h:
1397         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1398         (WebKit::WebsiteDataStore::parameters):
1399         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1400         (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting):
1401         * UIProcess/WebsiteData/WebsiteDataStore.h:
1402
1403 2019-10-16  Kate Cheney  <katherine_cheney@apple.com>
1404
1405         WKWebsiteDataStoreStatisticsResetToConsistentState() should call store.setUseITPDatabase(false)
1406         https://bugs.webkit.org/show_bug.cgi?id=203020
1407         <rdar://problem/56314484>
1408
1409         Reviewed by Chris Dumez.
1410
1411         The resourceLoadStatisticsStore should be reset between tests to use
1412         a memory store, and any test that needs to use the database store
1413         can use the setUseITPDatabase function.
1414
1415         * NetworkProcess/NetworkProcess.cpp:
1416         (WebKit::NetworkProcess::setUseITPDatabase):
1417         * NetworkProcess/NetworkProcess.h:
1418         * NetworkProcess/NetworkProcess.messages.in:
1419         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1420         (WKWebsiteDataStoreSetUseITPDatabase):
1421         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1422         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1423         * UIProcess/Network/NetworkProcessProxy.cpp:
1424         (WebKit::NetworkProcessProxy::setUseITPDatabase):
1425         * UIProcess/Network/NetworkProcessProxy.h:
1426         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1427         (WebKit::WebsiteDataStore::setUseITPDatabase):
1428         * UIProcess/WebsiteData/WebsiteDataStore.h:
1429
1430 2019-10-16  Chris Dumez  <cdumez@apple.com>
1431
1432         [WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
1433         https://bugs.webkit.org/show_bug.cgi?id=203034
1434         <rdar://problem/56332453>
1435
1436         Reviewed by Antti Koivisto.
1437
1438         Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess,
1439         now that back/forward cache management is done in the UIProcess.
1440
1441         * UIProcess/WebBackForwardCacheEntry.cpp:
1442         (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry):
1443         (WebKit::WebBackForwardCacheEntry::takeSuspendedPage):
1444         (WebKit::WebBackForwardCacheEntry::expirationTimerFired):
1445         * UIProcess/WebBackForwardCacheEntry.h:
1446         Add a Timer to WebBackForwardCacheEntry to make the entry expire after 30 minutes, which is what used
1447         to happen on WebContent process side. One difference in behavior is that when the entry expires we
1448         now remove it from the cache right away to free-up memory, instead of simply refusing to use it later
1449         on.
1450
1451         * WebProcess/WebPage/WebPage.cpp:
1452         Disable back forward cache expiration in the WebContent process when using modern
1453         WebKit.
1454
1455 2019-10-16  Chris Dumez  <cdumez@apple.com>
1456
1457         [iOS] Stop terminating the prewarmed process on application suspension
1458         https://bugs.webkit.org/show_bug.cgi?id=203033
1459
1460         Reviewed by Alex Christensen.
1461
1462         Stop terminating the prewarmed process on application suspension. Having no prewarmed process when the
1463         application resumes means the next cross-site load will be significantly slower. If the system needs
1464         memory, this process can be jetsammed.
1465
1466         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1467         (WebKit::WebProcessPool::applicationIsAboutToSuspend):
1468
1469 2019-10-16  Chris Dumez  <cdumez@apple.com>
1470
1471         Drop unused WKPageSetResourceCachingDisabled() SPI
1472         https://bugs.webkit.org/show_bug.cgi?id=203035
1473
1474         Reviewed by Alex Christensen.
1475
1476         * UIProcess/API/C/WKPage.cpp:
1477         (WKPageGetResourceCachingDisabled): Deleted.
1478         (WKPageSetResourceCachingDisabled): Deleted.
1479         * UIProcess/API/C/WKPagePrivate.h:
1480         * UIProcess/WebPageProxy.cpp:
1481         (WebKit::WebPageProxy::setResourceCachingDisabled): Deleted.
1482         * UIProcess/WebPageProxy.h:
1483         (WebKit::WebPageProxy::isResourceCachingDisabled const): Deleted.
1484         * WebProcess/WebPage/WebPage.cpp:
1485         (WebKit::WebPage::setResourceCachingDisabled): Deleted.
1486         * WebProcess/WebPage/WebPage.h:
1487         * WebProcess/WebPage/WebPage.messages.in:
1488
1489 2019-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1490
1491         Unreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171
1492
1493         * Platform/spi/mac/ApplicationServicesSPI.h: Guard SPI declarations that use AXClientType with HAVE(AX_CLIENT_TYPE).
1494
1495 2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1496
1497         [GTK][WPE] Add user messages API
1498         https://bugs.webkit.org/show_bug.cgi?id=202847
1499
1500         Reviewed by Adrian Perez de Castro.
1501
1502         We have never exposed an API to send/receive messages to/from Web extensions, to allow applications use their own
1503         IPC. Now, with PSON enabled, it's a lot more difficult to implement the custom IPC on the application side,
1504         because applications need to keep track of all the web processes launched, and the changes of web process in the
1505         web view to send the messages to the right extension. That's already done internally by WebKit, so it would be
1506         easier to provide a simple API so that apps don't need to worry about the web process being used. This patch adds
1507         WebKitUserMessage, a simple message API consisting on a message name, parameters and file descriptors. Messages
1508         can be sent from a WebKitWebContext to all the WebKitWebExtensions, or from a WebKitWebExtension to its
1509         WebKitWebContext, or from a WebKitWebView to its WebKitWebPage (and vice versa).
1510
1511         * PlatformGTK.cmake:
1512         * PlatformWPE.cmake:
1513         * Shared/API/glib/WebKitUserMessage.cpp: Added.
1514         (webkitUserMessageDispose):
1515         (webkitUserMessageGetProperty):
1516         (webkitUserMessageSetProperty):
1517         (webkit_user_message_class_init):
1518         (webkitUserMessageCreate):
1519         (webkitUserMessageGetMessage):
1520         (webkit_user_message_new):
1521         (webkit_user_message_new_with_fd_list):
1522         (webkit_user_message_get_name):
1523         (webkit_user_message_get_parameters):
1524         (webkit_user_message_get_fd_list):
1525         (webkit_user_message_send_reply):
1526         * Shared/API/glib/WebKitUserMessagePrivate.h: Added.
1527         * Shared/glib/ArgumentCodersGLib.cpp: Added.
1528         (IPC::encode):
1529         (IPC::decode):
1530         * Shared/glib/ArgumentCodersGLib.h: Added.
1531         * Shared/glib/UserMessage.cpp: Added.
1532         (WebKit::UserMessage::encode const):
1533         (WebKit::UserMessage::decode):
1534         * Shared/glib/UserMessage.h: Added.
1535         (WebKit::UserMessage::UserMessage):
1536         * SourcesGTK.txt:
1537         * SourcesWPE.txt:
1538         * UIProcess/API/glib/WebKitWebContext.cpp:
1539         (webkitWebContextConstructed):
1540         (webkit_web_context_class_init):
1541         (webkit_web_context_send_message_to_all_extensions):
1542         * UIProcess/API/glib/WebKitWebView.cpp:
1543         (webkit_web_view_class_init):
1544         (webkitWebViewDidReceiveUserMessage):
1545         (webkit_web_view_send_message_to_page):
1546         (webkit_web_view_send_message_to_page_finish):
1547         * UIProcess/API/glib/WebKitWebViewPrivate.h:
1548         * UIProcess/API/gtk/WebKitUserMessage.h: Added.
1549         * UIProcess/API/gtk/WebKitWebContext.h:
1550         * UIProcess/API/gtk/WebKitWebView.h:
1551         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1552         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1553         * UIProcess/API/gtk/webkit2.h:
1554         * UIProcess/API/wpe/APIViewClient.h:
1555         (API::ViewClient::didReceiveUserMessage):
1556         * UIProcess/API/wpe/PageClientImpl.cpp:
1557         (WebKit::PageClientImpl::sendMessageToWebView):
1558         * UIProcess/API/wpe/PageClientImpl.h:
1559         * UIProcess/API/wpe/WPEView.cpp:
1560         (WKWPE::View::didReceiveUserMessage):
1561         * UIProcess/API/wpe/WPEView.h:
1562         * UIProcess/API/wpe/WebKitUserMessage.h: Added.
1563         * UIProcess/API/wpe/WebKitWebContext.h:
1564         * UIProcess/API/wpe/WebKitWebView.h:
1565         * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
1566         * UIProcess/API/wpe/docs/wpe-docs.sgml:
1567         * UIProcess/API/wpe/webkit.h:
1568         * UIProcess/WebPageProxy.h:
1569         * UIProcess/WebPageProxy.messages.in:
1570         * UIProcess/WebProcessPool.h:
1571         * UIProcess/WebProcessProxy.h:
1572         * UIProcess/WebProcessProxy.messages.in:
1573         * UIProcess/glib/WebProcessProxyGLib.cpp:
1574         (WebKit::WebProcessProxy::sendMessageToWebContextWithReply):
1575         (WebKit::WebProcessProxy::sendMessageToWebContext):
1576         * UIProcess/gtk/WebPageProxyGtk.cpp:
1577         (WebKit::WebPageProxy::sendMessageToWebViewWithReply):
1578         (WebKit::WebPageProxy::sendMessageToWebView):
1579         * UIProcess/wpe/WebPageProxyWPE.cpp:
1580         (WebKit::WebPageProxy::sendMessageToWebViewWithReply):
1581         (WebKit::WebPageProxy::sendMessageToWebView):
1582         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
1583         (WebKit::WebKitExtensionManager::extension const):
1584         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
1585         (webkitWebExtensionDidReceiveUserMessage):
1586         (webkit_web_extension_send_message_to_context):
1587         (webkit_web_extension_send_message_to_context_finish):
1588         * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
1589         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1590         (webkit_web_page_class_init):
1591         (webkitWebPageDidReceiveUserMessage):
1592         (webkit_web_page_send_message_to_view):
1593         (webkit_web_page_send_message_to_view_finish):
1594         * WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h:
1595         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h:
1596         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
1597         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
1598         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h:
1599         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
1600         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt:
1601         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
1602         * WebProcess/WebPage/WebPage.h:
1603         * WebProcess/WebPage/WebPage.messages.in:
1604         * WebProcess/WebPage/glib/WebPageGLib.cpp: Added.
1605         (WebKit::WebPage::sendMessageToWebExtensionWithReply):
1606         (WebKit::WebPage::sendMessageToWebExtension):
1607         * WebProcess/WebProcess.h:
1608         * WebProcess/WebProcess.messages.in:
1609         * WebProcess/glib/WebProcessGLib.cpp:
1610         (WebKit::WebProcess::sendMessageToWebExtension):
1611
1612 2019-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1613
1614         Fix the internal macOS build after r251171
1615         https://bugs.webkit.org/show_bug.cgi?id=203022
1616
1617         Reviewed by Dan Bernstein.
1618
1619         Attempts to include <HIServices/AccessibilityPriv.h> in WebKit result in:
1620
1621         ```
1622         fatal error: 'HIServices/AccessibilityPriv.h' file not found
1623         ```
1624
1625         At least on macOS 10.15, it appears that HIServices.framework exists within the ApplicationServices framework.
1626         To fix this build error, we can instead turn AccessibilityPrivSPI.h into an SPI header for ApplicationServices,
1627         ApplicationServicesSPI.h, and use it in several places where we currently directly import <ApplicationServices/
1628         ApplicationServicesPriv.h>.
1629
1630         * Platform/IPC/cocoa/ConnectionCocoa.mm:
1631
1632         Bring some more constants that were defined in the !USE(APPLE_INTERNAL_SDK) case into the ApplicationServices
1633         SPI header.
1634
1635         * Platform/spi/mac/ApplicationServicesSPI.h: Renamed from Source/WebKit/Platform/spi/mac/AccessibilityPrivSPI.h.
1636         * Shared/mac/AuxiliaryProcessMac.mm:
1637         * WebKit.xcodeproj/project.pbxproj:
1638         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1639
1640 2019-10-15  Kate Cheney  <katherine_cheney@apple.com>
1641
1642         REGRESSION (~244100) [Mac WK2 Debug] Layout Test http/tests/resourceLoadStatistics/prune-statistics.html is a flaky failure (197285)
1643         https://bugs.webkit.org/show_bug.cgi?id=197285
1644         <rdar://problem/50208370>
1645
1646         Reviewed by Chris Dumez.
1647
1648         This patch fixes a flaky failure which was being caused by other
1649         resourceLoadStatistics tests scheduling processing checks which
1650         were called during execution of prune-statistics.html.
1651         Now, any pending processing checks are cancelled between tests.
1652
1653         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1654         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1655
1656 2019-10-15  Chris Dumez  <cdumez@apple.com>
1657
1658         [iOS] Maintain the last Back/Forward cache entry when the application gets suspended
1659         https://bugs.webkit.org/show_bug.cgi?id=203014
1660
1661         Reviewed by Geoffrey Garen.
1662
1663         Previously, we would clear all back/forward cache entries when the application is about to
1664         be suspended. This means that we would lose fast-back when coming back to the application.
1665         To be memory-friendly but maintain the fast-back when coming back to the application, we now
1666         maintain the last back/forward cache entry when the application gets suspended.
1667
1668         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1669         (WebKit::WebProcessPool::applicationIsAboutToSuspend):
1670         (WebKit::WebProcessPool::notifyProcessPoolsApplicationIsAboutToSuspend):
1671         * UIProcess/WebBackForwardCache.cpp:
1672         (WebKit::WebBackForwardCache::pruneToSize):
1673         * UIProcess/WebBackForwardCache.h:
1674         * UIProcess/WebProcessPool.h:
1675         * UIProcess/ios/ProcessAssertionIOS.mm:
1676         (-[WKProcessAssertionBackgroundTaskManager init]):
1677         (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
1678
1679         * WebProcess/WebProcess.cpp:
1680         (WebKit::WebProcess::initializeWebProcess):
1681         A WebProcess no longer clears its PageCache on suspension on iOS. We let the UIProcess's
1682         back/forward cache control when PageCache entries should get destroyed. The back/forward
1683         cache will properly wake up a suspended process to clear one of its PageCache entries if
1684         needed.
1685
1686 2019-10-15  Andres Gonzalez  <andresg_22@apple.com>
1687
1688         AX: Make AXIsolatedTree compile again
1689         https://bugs.webkit.org/show_bug.cgi?id=202702
1690         <rdar://problem/56084968>
1691
1692         Reviewed by Joanmarie Diggs.
1693
1694         Re-submitting r251045 with a fix for internal builds.
1695
1696         * Platform/spi/mac/AccessibilityPrivSPI.h:
1697         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1698         (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):
1699
1700 2019-10-15  Chris Dumez  <cdumez@apple.com>
1701
1702         Webview's drawing area may stay frozen on cross-site back/forward navigation
1703         https://bugs.webkit.org/show_bug.cgi?id=203004
1704
1705         Reviewed by Tim Horton.
1706
1707         Whenever the UIScene becomes foreground / background, the WebPageProxy notifies its currently associated
1708         WebPage in the committed WebProcess so that it can freeze / unfreeze its layer tree with the
1709         BackgroundApplication reason. The issue is that if a WebPage gets suspended on cross-site navigation
1710         (because the UIScene is in the background when the load commits), then the suspended WebPage kept its
1711         a BackgroundApplication freeze. When the UIScene becomes foreground, the WebPage only notifies its
1712         committed page so the suspended page keeps its BackgroundApplication freeze still. If the user now
1713         navigates back, it will restore the suspended WebPage and the view will stay frozen.
1714
1715         To address the issue, we now have the WebPage drop its BackgroundApplication freeze reason, whenever
1716         it transitions from committed to suspended.
1717
1718         * UIProcess/ios/WKApplicationStateTrackingView.mm:
1719         (-[WKApplicationStateTrackingView didMoveToWindow]):
1720         Fix logging, [self isBackground] needs to be called *after* _applicationStateTracker has been
1721         initialized, or it will return YES unconditionally.
1722
1723         * WebProcess/WebPage/WebPage.cpp:
1724         (WebKit::WebPage::setIsSuspended):
1725
1726 2019-10-15  Peng Liu  <peng.liu6@apple.com>
1727
1728         [Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture() / Document.exitPictureInPicture()
1729         https://bugs.webkit.org/show_bug.cgi?id=201024
1730
1731         Reviewed by Eric Carlson.
1732
1733         Add configurations for Picture-in-Picture API and add a preference option for it.
1734
1735         * Configurations/FeatureDefines.xcconfig:
1736         * Shared/WebPreferences.yaml:
1737
1738 2019-10-15  youenn fablet  <youenn@apple.com>
1739
1740         Move headers to keep from a HTTPHeaderNameSet to an OptionSet
1741         https://bugs.webkit.org/show_bug.cgi?id=202977
1742
1743         Reviewed by Anders Carlsson.
1744
1745         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1746         (WebKit::NetworkResourceLoadParameters::decode):
1747         * NetworkProcess/NetworkResourceLoadParameters.h:
1748
1749 2019-10-15  Jiewen Tan  <jiewen_tan@apple.com>
1750
1751         [WebAuthn] Rename -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] to -[WKUIDelegatePrivate _webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:]
1752         https://bugs.webkit.org/show_bug.cgi?id=202564
1753         <rdar://problem/55974027>
1754
1755         Reviewed by Brent Fulgham.
1756
1757         Rename the SPI to a proper SPI style.
1758
1759         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1760         * UIProcess/Cocoa/UIDelegate.mm:
1761         (WebKit::UIDelegate::setDelegate):
1762         (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel):
1763
1764 2019-10-15  youenn fablet  <youenn@apple.com>
1765
1766         Scheduling a service worker job in server should wait for finishing the registration import
1767         https://bugs.webkit.org/show_bug.cgi?id=202975
1768
1769         Reviewed by Chris Dumez.
1770
1771         * WebProcess/Storage/WebSWClientConnection.cpp:
1772         (WebKit::WebSWClientConnection::scheduleJobInServer):
1773         We should not schedule a job until the registrations are fully imported.
1774         Covered by ServiceWorkerBasic API test flakily hitting debug asserts.
1775
1776 2019-10-15  Alex Christensen  <achristensen@webkit.org>
1777
1778         Unreviewed, rolling out r251138.
1779
1780         Broke API tests
1781
1782         Reverted changeset:
1783
1784         "Pass CORS-enabled schemes through WebProcess instead of
1785         having them NetworkProcess-global"
1786         https://bugs.webkit.org/show_bug.cgi?id=202891
1787         https://trac.webkit.org/changeset/251138
1788
1789 2019-10-15  Chris Dumez  <cdumez@apple.com>
1790
1791         Stop using inheritance for WebBackForwardCacheEntry
1792         https://bugs.webkit.org/show_bug.cgi?id=202989
1793
1794         Reviewed by Alex Christensen.
1795
1796         Stop using inheritance for WebBackForwardCacheEntry. This simplifies the code a bit.
1797
1798         * Sources.txt:
1799         * UIProcess/WebBackForwardCache.cpp:
1800         (WebKit::WebBackForwardCache::addEntry):
1801         (): Deleted.
1802         * UIProcess/WebBackForwardCacheEntry.cpp: Copied from Source/WebKit/UIProcess/WebBackForwardCacheEntry.h.
1803         (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry):
1804         (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry):
1805         (WebKit::WebBackForwardCacheEntry::takeSuspendedPage):
1806         (WebKit::WebBackForwardCacheEntry::process const):
1807         * UIProcess/WebBackForwardCacheEntry.h:
1808         (WebKit::WebBackForwardCacheEntry::suspendedPage const):
1809         (WebKit::WebBackForwardCacheEntry::processIdentifier const):
1810         (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): Deleted.
1811         * WebKit.xcodeproj/project.pbxproj:
1812
1813 2019-10-15  Alex Christensen  <achristensen@webkit.org>
1814
1815         Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global
1816         https://bugs.webkit.org/show_bug.cgi?id=202891
1817
1818         Reviewed by Youenn Fablet.
1819
1820         No change in behavior.  Now the LegacySchemeRegistry is not used as much in the NetworkProcess, a step towards no use at all.
1821         This functionality is currently only available through the glib API webkit_security_manager_register_uri_scheme_as_cors_enabled
1822         but it has been requested in bug 201180 and bug 199064.
1823
1824         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1825         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
1826         (WebKit::NetworkConnectionToWebProcess::loadPing):
1827         (WebKit::NetworkConnectionToWebProcess::registerURLSchemesAsCORSEnabled):
1828         * NetworkProcess/NetworkConnectionToWebProcess.h:
1829         (WebKit::NetworkConnectionToWebProcess::schemeRegistry):
1830         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1831         * NetworkProcess/NetworkLoadChecker.cpp:
1832         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1833         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
1834         * NetworkProcess/NetworkLoadChecker.h:
1835         * NetworkProcess/NetworkProcess.cpp:
1836         (WebKit::NetworkProcess::initializeNetworkProcess):
1837         (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const): Deleted.
1838         * NetworkProcess/NetworkProcess.messages.in:
1839         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1840         (WebKit::NetworkProcessCreationParameters::encode const):
1841         (WebKit::NetworkProcessCreationParameters::decode):
1842         * NetworkProcess/NetworkProcessCreationParameters.h:
1843         * NetworkProcess/NetworkResourceLoader.cpp:
1844         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
1845         * NetworkProcess/NetworkSchemeRegistry.cpp: Added.
1846         (WebKit::NetworkSchemeRegistry::registerURLSchemeAsCORSEnabled):
1847         (WebKit::NetworkSchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
1848         * NetworkProcess/NetworkSchemeRegistry.h: Added.
1849         (WebKit::NetworkSchemeRegistry::create):
1850         * NetworkProcess/PingLoad.cpp:
1851         (WebKit::PingLoad::PingLoad):
1852         Use nullptr, indicating that the PingLoad constructor that is used in ad click attribution should not check the custom scheme registry.
1853         This is Ok because ad click attribution is only used for HTTP family schemes.
1854         (WebKit::m_blobFiles):
1855         * NetworkProcess/PingLoad.h:
1856         * Sources.txt:
1857         * UIProcess/WebProcessPool.cpp:
1858         (WebKit::WebProcessPool::ensureNetworkProcess):
1859         (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
1860         * WebKit.xcodeproj/project.pbxproj:
1861         * WebProcess/WebProcess.cpp:
1862         (WebKit::WebProcess::initializeWebProcess):
1863         (WebKit::WebProcess::registerURLSchemeAsCORSEnabled):
1864         (WebKit::WebProcess::ensureNetworkProcessConnection):
1865         (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const): Deleted.
1866         * WebProcess/WebProcess.h:
1867
1868 2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1869
1870         Unreviewed. Fix several GTK tests in /WebKit2Gtk/TestUIClient crashing since r241988
1871
1872         Show a warning message and return nullptr from WebKitWebView::create if the new web view is not related to the
1873         given one. Also make it clear in the documentation that the new web view should be related to the given one.
1874
1875         * UIProcess/API/glib/WebKitWebView.cpp:
1876         (webkit_web_view_class_init):
1877         (webkitWebViewCreateNewPage):
1878
1879 2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1880
1881         Unreviewed. Fix GTK test /webkit/Authentication/authentication-storage after r249962
1882
1883         * UIProcess/API/glib/WebKitWebView.cpp:
1884         (webkitWebViewHandleAuthenticationChallenge): Do not use webkit_settings_get_enable_private_browsing().
1885
1886 2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1887
1888         Unreviewed. Fix GTK test /webkit/WebKitSettings/webkit-settings after r249962.
1889
1890         Legacy private browsing was removed in r249962, so webkit_settings_set_enable_private_browsing() is now no-op.
1891
1892         * UIProcess/API/glib/WebKitSettings.cpp:
1893         (webKitSettingsSetProperty): Only call webkit_settings_set_enable_private_browsing() when trying to enable it.
1894         (webkit_settings_set_enable_private_browsing): Show a warning to let users know that it does nothing now.
1895
1896 2019-10-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1897
1898         [GTK][WPE] WebKitWebContext should identify web views by their WebPageProxy identifier
1899         https://bugs.webkit.org/show_bug.cgi?id=202924
1900
1901         Reviewed by Adrian Perez de Castro.
1902
1903         Instead of the WebPage identifier, since it maps WebPageProxy to WebKitWebView.
1904
1905         * UIProcess/API/glib/WebKitWebContext.cpp:
1906         (webkitWebContextCreatePageForWebView):
1907         (webkitWebContextWebViewDestroyed):
1908         (webkitWebContextGetWebViewForPage):
1909
1910 2019-10-15  youenn fablet  <youenn@apple.com>
1911
1912         Handle service worker loads through NetworkResourceLoader
1913         https://bugs.webkit.org/show_bug.cgi?id=202309
1914
1915         Unreviewed.
1916         Fix !ENABLE(SERVICE_WORKER) builds.
1917
1918         * NetworkProcess/NetworkResourceLoader.cpp:
1919         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1920         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
1921         (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle):
1922
1923 2019-10-14  Youenn Fablet  <youenn@apple.com>
1924
1925         Handle service worker loads through NetworkResourceLoader
1926         https://bugs.webkit.org/show_bug.cgi?id=202309
1927
1928         Reviewed by Alex Christensen.
1929
1930         Remove ServiceWorkerFetchClient.
1931         Instead we use the normal NetworkResourceLoader/WebResourceLoader communication channel.
1932         We pass additional parameters, in particular service worker mode and registration identifier.
1933
1934         Based on that information, network process will decide whether to load from service worker or network.
1935         The first advantage is that in case of service worker not handling the load, going to the network is faster.
1936         This will also allow us to do the registration matching in network process when receiving a navigation request.
1937
1938         ServiceWorkerFetchTask is now beefed up to do the link between service worker and NetworkResourceLoader/WebResourceLoader.
1939         To support the same console logging, we add a new message called DidFailServiceWorkerLoad.
1940
1941         To support API tests, we continue to go to the service worker before trying to go to URL scheme handlers.
1942         This adds some burden as we need to go to network process/service worker process and, in case load is not handled
1943         by service worker, we go back to the web process to do the load through URL scheme handlers.
1944         For that purpose we use ServiceWorkersMode::Only.
1945
1946         * CMakeLists.txt:
1947         * DerivedSources-input.xcfilelist:
1948         * DerivedSources-output.xcfilelist:
1949         * DerivedSources.make:
1950         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1951         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
1952         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1953         (WebKit::NetworkResourceLoadParameters::encode const):
1954         (WebKit::NetworkResourceLoadParameters::decode):
1955         * NetworkProcess/NetworkResourceLoadParameters.h:
1956         * NetworkProcess/NetworkResourceLoader.cpp:
1957         (WebKit::NetworkResourceLoader::abort):
1958         (WebKit::NetworkResourceLoader::didFailLoading):
1959         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1960         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
1961         (WebKit::NetworkResourceLoader::startWithServiceWorker):
1962         (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle):
1963         * NetworkProcess/NetworkResourceLoader.h:
1964         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
1965         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
1966         (WebKit::ServiceWorkerFetchTask::~ServiceWorkerFetchTask):
1967         (WebKit::ServiceWorkerFetchTask::sendToServiceWorker):
1968         (WebKit::ServiceWorkerFetchTask::sendToClient):
1969         (WebKit::ServiceWorkerFetchTask::start):
1970         (WebKit::ServiceWorkerFetchTask::startFetch):
1971         (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
1972         (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
1973         (WebKit::ServiceWorkerFetchTask::didReceiveData):
1974         (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
1975         (WebKit::ServiceWorkerFetchTask::didFinish):
1976         (WebKit::ServiceWorkerFetchTask::didFail):
1977         (WebKit::ServiceWorkerFetchTask::didNotHandle):
1978         (WebKit::ServiceWorkerFetchTask::cancelFromClient):
1979         (WebKit::ServiceWorkerFetchTask::continueDidReceiveFetchResponse):
1980         (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith):
1981         (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
1982         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
1983         (WebKit::ServiceWorkerFetchTask::fetchIdentifier const):
1984         (WebKit::ServiceWorkerFetchTask::serviceWorkerIdentifier const):
1985         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1986         (WebKit::WebSWServerConnection::cancelFetch):
1987         (WebKit::WebSWServerConnection::createFetchTask):
1988         (WebKit::WebSWServerConnection::startFetch):
1989         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1990         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
1991         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1992         (WebKit::WebSWServerToContextConnection::startFetch):
1993         (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
1994         (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
1995         (WebKit::WebSWServerToContextConnection::registerFetch):
1996         (WebKit::WebSWServerToContextConnection::unregisterFetch):
1997         (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut):
1998         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
1999         (WebKit::WebSWServerToContextConnection::ipcConnection const):
2000         * Sources.txt:
2001         * WebKit.xcodeproj/project.pbxproj:
2002         * WebProcess/Network/NetworkProcessConnection.cpp:
2003         (WebKit::NetworkProcessConnection::didReceiveMessage):
2004         * WebProcess/Network/WebLoaderStrategy.cpp:
2005         (WebKit::WebLoaderStrategy::scheduleLoad):
2006         * WebProcess/Network/WebResourceLoader.cpp:
2007         (WebKit::WebResourceLoader::didFailServiceWorkerLoad):
2008         (WebKit::WebResourceLoader::serviceWorkerDidNotHandle):
2009         * WebProcess/Network/WebResourceLoader.h:
2010         * WebProcess/Network/WebResourceLoader.messages.in:
2011         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed.
2012         * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed.
2013         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed.
2014         * WebProcess/Storage/WebSWClientConnection.cpp:
2015         * WebProcess/Storage/WebSWClientConnection.h:
2016         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2017         * WebProcess/Storage/WebServiceWorkerProvider.h:
2018
2019 2019-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2020
2021         [GTK] White pages in AC mode: Cannot get default EGL display: EGL_BAD_PARAMETER
2022         https://bugs.webkit.org/show_bug.cgi?id=202362
2023
2024         Reviewed by Carlos Alberto Lopez Perez.
2025
2026         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
2027         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): Disable accelerated compositing mode when we failed
2028         to reate the shared display for compositing.
2029         * WebProcess/glib/WebProcessGLib.cpp:
2030         (WebKit::WebProcess::platformInitializeWebProcess): Destroy the wpe display when initialization fails.
2031
2032 2019-10-14  Chris Dumez  <cdumez@apple.com>
2033
2034         [WK2] Have WebBackForwardCache class coordinate page caching in all WebProcesses
2035         https://bugs.webkit.org/show_bug.cgi?id=202929
2036         <rdar://problem/56250421>
2037
2038         Reviewed by Alex Christensen.
2039
2040         Have WebBackForwardCache class coordinate page caching in all WebProcesses. To achieve this, the
2041         following changes were made:
2042         1. Whenever HistoryItem::m_cachedPage changes in WebCore, we notify the client that the HistoryItem
2043            has changed. I added a "hasCachedPage" boolean to the item info being passed the the UIProcess
2044            that is set based on whether or not HistoryItem::m_cachedPage is null.
2045         2. The WebBackForwardCache now contains WebBackForwardCacheEntry objects instead of SuspendedPage
2046            objects. A WebBackForwardCacheEntry may have a SuspendedPage or not. As a result, we can now
2047            add the the back/forward cache CachedPage entries from the WebContent process, which do not have
2048            a SuspendedPageProxy in the UIProcess.
2049         3. Now that WebBackForwardCache is aware of all CachedPages, it can properly enforce a cache capacity
2050            across call processes. Whenever a WebBackForwardCacheEntry is pruned from the cache and this entry
2051            does not have a SuspendedPageProxy, we send an IPC to the WebContent process to remove this
2052            cached page from the PageCache in WebCore.
2053
2054         Previously, as soon as we would cache a page in the WebContent process, we would send an IPC to the
2055         UIProcess so that it would clear the PageCache in any previous WebContent process. This was a stop-gap
2056         measure to avoid blowing up memory in a multi-process model by keeping a PageCache around in all
2057         WebContent process. This would make sure only one process could have a PageCache at any point in time.
2058         This logic is now dropped since the WebBackForwardCache can keep track of all cached pages across all
2059         processes and enforce a cross-process limit on the number of cached pages. This means we can now have
2060         PageCache entries across several WebContent processes, as long as we do not exceed the maximum number
2061         of cached pages.
2062
2063         * Platform/Logging.h:
2064         Add new BackForwardCache logging channel.
2065
2066         * Shared/SessionState.cpp:
2067         (WebKit::BackForwardListItemState::encode const):
2068         (WebKit::BackForwardListItemState::decode):
2069         * Shared/SessionState.h:
2070         Add new bit to BackForwardListItemState to indicate whether a HistoryItem has an associated
2071         CachedPage or not.
2072
2073         * Shared/WebBackForwardListItem.cpp:
2074         (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
2075         (WebKit::WebBackForwardListItem::wasRemovedFromBackForwardList):
2076         (WebKit::WebBackForwardListItem::removeFromBackForwardCache):
2077         (WebKit::WebBackForwardListItem::setBackForwardCacheEntry):
2078         (WebKit::WebBackForwardListItem::suspendedPage const):
2079         (WebKit::WebBackForwardListItem::loggingString):
2080         * Shared/WebBackForwardListItem.h:
2081         (WebKit::WebBackForwardListItem::backForwardCacheEntry const):
2082         WebBackForwardListItem now own a WebBackForwardCacheEntry instead of simply a
2083         SuspendedPage. The WebBackForwardCacheEntry may have a SuspendedPage or not.
2084         Now, whenever a HistoryItem has a CachedPage in WebCore, its corresponding
2085         WebBackForwardListItem in the UIProcess has an associated WebBackForwardCacheEntry
2086         whether we have a SuspendedPageProxy for it in the UIProcess or not.
2087
2088         * Shared/WebProcessCreationParameters.cpp:
2089         (WebKit::WebProcessCreationParameters::encode const):
2090         (WebKit::WebProcessCreationParameters::decode):
2091         * Shared/WebProcessCreationParameters.h:
2092         Pass the PageCache capacity to the WebContent process on creation, so that it matches the
2093         capacity of the WebBackForwardCache in the UIProcess.
2094
2095         * UIProcess/ProvisionalPageProxy.cpp:
2096         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
2097         * UIProcess/SuspendedPageProxy.cpp:
2098         (WebKit::messageNamesToIgnoreWhileSuspended):
2099         (WebKit::SuspendedPageProxy::suspensionTimedOut):
2100         * UIProcess/SuspendedPageProxy.h:
2101         Stop storing the WebBackForwardListItem on the SuspendedPageProxy. This avoids having to
2102         keep this pointer up to date. We do not really need it as we can now ask the WebBackForwardCache
2103         to clear an entry by giving it a SuspendedPageProxy to match. Given how many entries we have at
2104         most in the cache (2), iterating over them to find the one with a given suspended page is cheap.
2105
2106         * UIProcess/WebBackForwardCache.cpp:
2107         (WebKit::WebBackForwardCache::WebBackForwardCache):
2108         (WebKit::WebBackForwardCache::~WebBackForwardCache):
2109
2110         (WebKit::WebBackForwardCache::setCapacity):
2111         Send an IPC of each WebProcess whenever the capacity of the WebBackForwardCache changes, in order
2112         to update the capacity of the PageCache in those processes.
2113
2114         (WebKit::WebBackForwardCache::addEntry):
2115         (WebKit::WebBackForwardCache::removeEntry):
2116         (WebKit::WebBackForwardCache::takeSuspendedPage):
2117         (WebKit::WebBackForwardCache::removeEntriesForProcess):
2118         (WebKit::WebBackForwardCache::removeEntriesForSession):
2119         (WebKit::WebBackForwardCache::removeEntriesMatching):
2120         (WebKit::WebBackForwardCache::clear):
2121
2122         * UIProcess/WebBackForwardCache.h:
2123         Use a Vector instead of a ListHashSet to store the entries. Given that we have at most 2 entries, using
2124         a Vector will likely be more efficient and definitely use less memory.
2125
2126         * UIProcess/WebBackForwardCacheEntry.h: Added.
2127         (WebKit::WebBackForwardCacheEntry::backForwardCache const):
2128         (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry):
2129         Add new WebBackForwardCacheEntry abstraction to match the concept of WebCore::CachedPage in the UIProcess.
2130         A WebBackForwardCacheEntry may have a SuspendedPageProxy associated with it in the UIProcess or not.
2131
2132         * UIProcess/WebPageProxy.cpp:
2133         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2134         * UIProcess/WebPageProxy.h:
2135         * UIProcess/WebPageProxy.messages.in:
2136         Drop didSaveToPageCache as it is no longer necessary.
2137
2138         * UIProcess/WebProcessPool.cpp:
2139         (WebKit::WebProcessPool::initializeNewWebProcess):
2140         (WebKit::WebProcessPool::disconnectProcess):
2141         * UIProcess/WebProcessPool.h:
2142
2143         * UIProcess/WebProcessProxy.cpp:
2144         (WebKit::WebProcessProxy::updateBackForwardItem):
2145         Whenever we get a BackForwardItem from the WebContent process, we now check it now has
2146         an associated CachedPage or not. If it does, we make sure we add a corresponding
2147         entry in the WebBackForwardCache so that the UIProcess knows about it. If it no longer
2148         has a CachedPage and we don't have a SuspendedPageProxy for this item in the UIProcess,
2149         then we remove the corresponding entry from the back/forward cache. Note that we don't
2150         drop SuspendedPageProxy objects in the UIProcess simply because their corresponding
2151         CachedPage in the WebProcess is gone, to maintain previous behavior. This is an
2152         optimization that is useful on iOS, where we do not have a WebProcessCache, since we
2153         can reuse processes from SuspendedPageProxies on navigation.
2154
2155         * UIProcess/WebProcessProxy.h:
2156         * WebKit.xcodeproj/project.pbxproj:
2157         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2158         (WebKit::toBackForwardListItemState):
2159         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2160         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2161         * WebProcess/WebProcess.cpp:
2162         (WebKit::WebProcess::initializeWebProcess):
2163         (WebKit::WebProcess::setBackForwardCacheCapacity):
2164         (WebKit::WebProcess::clearCachedPage):
2165         * WebProcess/WebProcess.h:
2166         * WebProcess/WebProcess.messages.in:
2167
2168 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2169
2170         [Clipboard API] Refactor custom pasteboard writing codepaths to handle multiple items
2171         https://bugs.webkit.org/show_bug.cgi?id=202916
2172
2173         Reviewed by Tim Horton.
2174
2175         Change more function and method signatures from `const PasteboardCustomData&` to
2176         `const Vector<PasteboardCustomData>&`.
2177
2178         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2179         (WebKit::WebPasteboardProxy::writeCustomData):
2180         * UIProcess/WebPasteboardProxy.cpp:
2181         (WebKit::WebPasteboardProxy::writeCustomData):
2182         * UIProcess/WebPasteboardProxy.h:
2183         * UIProcess/WebPasteboardProxy.messages.in:
2184         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2185         (WebKit::WebPlatformStrategies::writeCustomData):
2186         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2187
2188 2019-10-14  Per Arne Vollan  <pvollan@apple.com>
2189
2190         REGRESSION(251087): Several API tests are failing
2191         https://bugs.webkit.org/show_bug.cgi?id=202961
2192
2193         Reviewed by Brent Fulgham.
2194
2195         WebPageProxy::maybeInitializeSandboxExtensionHandle returns early if the WebContent process is currently launching,
2196         since the audit token is needed to create the sandbox extension. The audit token will not be available until the
2197         process has finished launching. In the same way, the method should return early if the WebContent process has
2198         terminated.
2199
2200         * UIProcess/WebPageProxy.cpp:
2201         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2202
2203 2019-10-14  Matt Mokary  <mmokary@apple.com>
2204
2205         FindController::findString always updates foundStringMatchIndex even if match is the same as before
2206         https://bugs.webkit.org/show_bug.cgi?id=201775
2207         <rdar://problem/55352425>
2208
2209         Reviewed by Tim Horton.
2210
2211         Allow an update to a find string without changing current match index, as is often the desired behavior when
2212         modifying a query rather than moving forward or backward through a match set.
2213
2214         * Shared/WebFindOptions.h:
2215         * UIProcess/API/Cocoa/WKWebView.mm:
2216         (toFindOptions):
2217         * UIProcess/API/Cocoa/_WKFindOptions.h:
2218         * WebProcess/WebPage/FindController.cpp:
2219         (WebKit::FindController::findString):
2220         Do not change match index if NoIndexChange bit is set. Otherwise, no change in behavior.
2221
2222 2019-10-14  David Quesada  <david_quesada@apple.com>
2223
2224         Remove WebCore::IOSApplication::isWebApp()
2225         https://bugs.webkit.org/show_bug.cgi?id=181259
2226
2227         Reviewed by Alex Christensen.
2228
2229         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2230         (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory):
2231             Remove the wording "this is not supported as of right now", as it seems to be supported
2232             since r247686, which added SPI on _WKWebsiteDataStoreConfiguration to set the application
2233             cache directory.
2234
2235 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2236
2237         [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard
2238         https://bugs.webkit.org/show_bug.cgi?id=202851
2239
2240         Reviewed by Darin Adler.
2241
2242         See WebCore ChangeLog for more details.
2243
2244         * Shared/WebCoreArgumentCoders.cpp:
2245         (IPC::ArgumentCoder<PasteboardCustomData::Entry>::encode):
2246         (IPC::ArgumentCoder<PasteboardCustomData::Entry>::decode):
2247
2248         Add helpers to encode and decode PasteboardCustomData::Entry.
2249
2250         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
2251         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
2252         * Shared/WebCoreArgumentCoders.h:
2253
2254         Add support for encoding and decoding PasteboardCustomData by encoding and decoding each of its items (see
2255         above).
2256
2257         * UIProcess/Cocoa/WebViewImpl.mm:
2258         (WebKit::WebViewImpl::requestDOMPasteAccess):
2259         * UIProcess/WebPasteboardProxy.h:
2260         * UIProcess/WebPasteboardProxy.messages.in:
2261         * UIProcess/ios/WKContentViewInteraction.mm:
2262         (-[WKContentView canPerformActionForWebView:withSender:]):
2263         (allPasteboardItemOriginsMatchOrigin):
2264         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
2265
2266         Tweak several methods to use the new methods on PasteboardCustomData instead of accessing the member variables
2267         directly.
2268
2269         (-[WKContentView cleanUpDragSourceSessionState]):
2270         (-[WKContentView _prepareToDragPromisedAttachment:]):
2271         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]):
2272         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2273         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]): Deleted.
2274
2275         Adjust these methods to handle multiple staged item providers (for now, it remains that iOS drag and drop
2276         codepaths will still only write a single item to the pasteboard).
2277
2278 2019-10-14  Per Arne Vollan  <pvollan@apple.com>
2279
2280         [macOS] Sandbox extensions should be created with audit tokens, not PIDs
2281         https://bugs.webkit.org/show_bug.cgi?id=201828
2282
2283         Reviewed by Brent Fulgham.
2284
2285         Stop issuing mach/read sandbox extensions by PID in the UI process, and use audit tokens instead.
2286         The audit tokens for the WebContent processes are retrieved from the IPC connection to the process.
2287
2288         * Shared/Cocoa/SandboxExtensionCocoa.mm:
2289         (WebKit::SandboxExtensionImpl::create):
2290         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
2291         (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
2292         (WebKit::SandboxExtension::createHandleForMachLookupByAuditToken):
2293         (WebKit::SandboxExtension::createHandleForReadByAuditToken):
2294         (WebKit::SandboxExtension::createHandleForMachLookupByPid): Deleted.
2295         (WebKit::SandboxExtension::createHandleForReadByPid): Deleted.
2296         * Shared/SandboxExtension.h:
2297         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2298         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
2299         * UIProcess/WebPageProxy.cpp:
2300         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2301         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
2302         (WebKit::WebPageProxy::loadFile):
2303         * UIProcess/WebProcessProxy.cpp:
2304         (WebKit::WebProcessProxy::shouldSendPendingMessage):
2305         (WebKit::WebProcessProxy::didFinishLaunching):
2306         * UIProcess/ios/WebProcessProxyIOS.mm:
2307         (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
2308
2309 2019-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
2310
2311         [Cocoa] REGRESSION (r245672): Contenteditable with optical sizing freezes Safari
2312         https://bugs.webkit.org/show_bug.cgi?id=202262
2313
2314         Reviewed by Tim Horton.
2315
2316         r250640 didn't go far enough. We need to apply the same fix everywhere [NSFontDescriptor fontDescriptorWithFontAttributes:] is called.
2317
2318         * Shared/Cocoa/ArgumentCodersCocoa.mm:
2319         (IPC::decodeFontInternal):
2320         * Shared/Cocoa/CoreTextHelpers.h: Added.
2321         * Shared/Cocoa/CoreTextHelpers.mm: Added.
2322         (fontDescriptorWithFontAttributes):
2323         * SourcesCocoa.txt:
2324         * UIProcess/Cocoa/WebViewImpl.mm:
2325         (WebKit::WebViewImpl::updateFontManagerIfNeeded):
2326         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2327         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2328         * WebKit.xcodeproj/project.pbxproj:
2329
2330 2019-10-14  Truitt Savell  <tsavell@apple.com>
2331
2332         Unreviewed, rolling out r251045.
2333
2334         Broke internal builds
2335
2336         Reverted changeset:
2337
2338         "AX: Make AXIsolatedTree compile again"
2339         https://bugs.webkit.org/show_bug.cgi?id=202702
2340         https://trac.webkit.org/changeset/251045
2341
2342 2019-10-14  youenn fablet  <youenn@apple.com>
2343
2344         Reuse existing web processes for running service workers
2345         https://bugs.webkit.org/show_bug.cgi?id=202195
2346
2347         Unreviewed.
2348
2349         * UIProcess/WebProcessProxy.cpp:
2350         (WebKit::WebProcessProxy::disableServiceWorkers):
2351         (WebKit::WebProcessProxy::enableServiceWorkers):
2352         Fix case where ENABLE_SERVICE_WORKER is not defined.
2353
2354 2019-10-14  Philippe Normand  <pnormand@igalia.com>
2355
2356         [GTK][WebInspector] Support for saving data
2357         https://bugs.webkit.org/show_bug.cgi?id=202894
2358
2359         Reviewed by Carlos Garcia Campos.
2360
2361         Implement the WebInspectorProxy::platformSave() method. This
2362         allows users to save the inspector performance measurements, for
2363         instance.
2364
2365         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2366         (WebKit::WebInspectorProxy::platformSave):
2367         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
2368         (WebKit::WebInspectorUI::canSave):
2369
2370 2019-10-14  youenn fablet  <youenn@apple.com>
2371
2372         Reuse existing web processes for running service workers
2373         https://bugs.webkit.org/show_bug.cgi?id=202195
2374
2375         Reviewed by Chris Dumez.
2376
2377         When network process asks for a service worker context connection,
2378         we now iterate through existing web processes and reuse one if both session
2379         and registrable domain match.
2380         We then ask the web process to create a context connection to the network process.
2381
2382         When network process no longer needs the connection, it instructs the UIProcess
2383         that will update its state so that the web process is no longer considered as running
2384         service workers.
2385         UIProcess then instructs the web process to stop its service workers and its connection.
2386
2387         Later on, the same web process may be reused for running service workers in which case
2388         a new connection will replace the stopped connection.
2389
2390         Similarly, on network process crash, all web process running service workers are updated
2391         so that they are no longer considered as running service workers.
2392
2393         Add a boolean state to WebProcessPool to control whether creating a separate service worker process.
2394
2395         We no longer terminate the web process when stopping service workers or when network process crash.
2396         We use the enableTermination/disableTermination at context connection start/stop time.
2397         We consider that the context connection is similar to running a page in the process and creating/removing a page
2398         calls disableTermination/enableTermination.
2399
2400         NetworkProcess is handling the management of service worker processes by checking for clients.
2401         In case there is no client, the process is terminated.
2402         This removes the need for the WebProcessPool service worker process timer.
2403         This patch removes this timer.
2404
2405         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2406         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
2407         (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection):
2408         (WebKit::NetworkConnectionToWebProcess::closeSWContextConnection):
2409         (WebKit::NetworkConnectionToWebProcess::serverToContextConnectionNoLongerNeeded):
2410         * NetworkProcess/NetworkConnectionToWebProcess.h:
2411         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2412         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
2413         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2414         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2415         (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection):
2416         (WebKit::WebSWServerToContextConnection::messageSenderConnection const):
2417         (WebKit::WebSWServerToContextConnection::connectionIsNoLongerNeeded):
2418         (WebKit::WebSWServerToContextConnection::startFetch):
2419         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
2420         * UIProcess/API/C/WKContext.cpp:
2421         (WKContextSetUseSeparateServiceWorkerProcess):
2422         * UIProcess/API/C/WKContextPrivate.h:
2423         * UIProcess/API/Cocoa/WKProcessPool.mm:
2424         (-[WKProcessPool _setUseSeparateServiceWorkerProcess:]):
2425         (-[WKProcessPool _webPageContentProcessCount]):
2426         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2427         * UIProcess/Network/NetworkProcessProxy.cpp:
2428         (WebKit::NetworkProcessProxy::workerContextConnectionNoLongerNeeded):
2429         * UIProcess/Network/NetworkProcessProxy.h:
2430         * UIProcess/Network/NetworkProcessProxy.messages.in:
2431         * UIProcess/WebProcessPool.cpp:
2432         (WebKit::WebProcessPool::networkProcessCrashed):
2433         (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
2434         (WebKit::WebProcessPool::removeFromServiceWorkerProcesses):
2435         (WebKit::WebProcessPool::disconnectProcess):
2436         (WebKit::WebProcessPool::createWebPage):
2437         (WebKit::WebProcessPool::terminateNetworkProcess):
2438         (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess):
2439         * UIProcess/WebProcessPool.h:
2440         * UIProcess/WebProcessProxy.cpp:
2441         (WebKit::WebProcessProxy::createForServiceWorkers):
2442         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
2443         (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
2444         (WebKit::WebProcessProxy::disableServiceWorkers):
2445         (WebKit::WebProcessProxy::enableServiceWorkers):
2446         * UIProcess/WebProcessProxy.h:
2447         (WebKit::WebProcessProxy::isMatchingRegistrableDomain const):
2448         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2449         (WebKit::m_userAgent):
2450         (WebKit::WebSWContextManagerConnection::terminateWorker):
2451         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
2452         (WebKit::WebSWContextManagerConnection::close):
2453         * WebProcess/Storage/WebSWContextManagerConnection.h:
2454         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2455         * WebProcess/WebProcess.cpp:
2456         (WebKit::WebProcess::networkProcessConnectionClosed):
2457         (WebKit::WebProcess::registerServiceWorkerClients):
2458
2459 2019-10-12  Chris Dumez  <cdumez@apple.com>
2460
2461         Back/Forward cache does not work after doing a favorite navigation
2462         https://bugs.webkit.org/show_bug.cgi?id=202762
2463         <rdar://problem/56126911>
2464
2465         Reviewed by Antti Koivisto.
2466
2467         When a process-swap was forced by the client, we would always close the page in the previous
2468         process after navigating. This would prevent leveraging the back/forward cache when navigating
2469         back after such a process-swap. The reason we were doing this is that other pages may have
2470         opener link to this page and closing the page was an easy way to break this opener link.
2471
2472         To address the issue, we no longer close the previous page when a process-swap is forced by the
2473         client. Instead, we make sure to disconnect the frames' openees from their opener then the opener
2474         enters the page cache.
2475
2476         * UIProcess/WebPageProxy.cpp:
2477         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2478         * WebProcess/WebPage/WebPage.cpp:
2479         (WebKit::WebPage::suspendForProcessSwap):
2480
2481 2019-10-12  Chris Dumez  <cdumez@apple.com>
2482
2483         Clearing Website data for a given session should not shut down cached processes for other sessions
2484         https://bugs.webkit.org/show_bug.cgi?id=202865
2485         <rdar://problem/56202912>
2486
2487         Reviewed by Antti Koivisto.
2488
2489         When clearing Website data for a given data store, we now only clear cached processes
2490         (either if BackForwardCache or WebProcessCache) if they are associated with this
2491         particular data store. It is very wasteful otherwise.
2492
2493         * UIProcess/ProvisionalPageProxy.cpp:
2494         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
2495         * UIProcess/SuspendedPageProxy.cpp:
2496         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2497         ProvisionalPageProxy & SuspendedPageProxy's destructors no longer call
2498         WebProcessProxy::maybeShutdown() asynchronously. We now call maybeShutdown()
2499         synchronously in WebProcessProxy::decrementSuspendedPageCount() and
2500         WebProcessProxy::removeProvisionalPageProxy() instead. This makes things a
2501         lot more predictable.
2502
2503         * UIProcess/WebBackForwardCache.cpp:
2504         (WebKit::WebBackForwardCache::removeEntriesForSession):
2505         Add new removeEntriesForSession() method to clear only back / forward cache
2506         entries associated with a particular session.
2507
2508         (WebKit::WebBackForwardCache::clear):
2509         Stop taking a parameter indicating if we allow the processes to enter the
2510         process cache. Now that we call maybeShutdown() synchronously when destroying
2511         a SuspendedPageProxy, we can simply allow the processes to enter the process
2512         cache unconditionally. If the caller does not want this processes in the page
2513         cache, they can clear the process cache afterwards.
2514
2515         * UIProcess/WebBackForwardCache.h:
2516         * UIProcess/WebPageProxy.cpp:
2517         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2518         Now that destroying a SuspendedPageProxy or a ProvisionalPageProxy may shutdown
2519         their process synchronously, add a scope here to prevent shutdown of the process
2520         for the duration of this scope, since we're about to use it for a navigation and
2521         we don't want it to get shutdown, even if there is no longer anything using it.
2522
2523         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2524         Add new assertion and rename parameter for consistency.
2525
2526         * UIProcess/WebProcessPool.cpp:
2527         (WebKit::WebProcessPool::handleMemoryPressureWarning):
2528
2529         * UIProcess/WebProcessProxy.cpp:
2530         (WebKit::WebProcessProxy::addProvisionalPageProxy):
2531         Add new assertion.
2532
2533         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
2534         Call maybeShutDown() if this was the last provisional page.
2535
2536         (WebKit::WebProcessProxy::maybeShutDown):
2537         Drop parameter indicating if we want to allow the process to enter the process
2538         cache and allow caching unconditionally.
2539
2540         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
2541         Prevent termination if there is a ScopePreventingShutdown.
2542
2543         (WebKit::WebProcessProxy::decrementSuspendedPageCount):
2544         Call maybeShutDown() if this was the last suspended page.
2545
2546         * UIProcess/WebProcessProxy.h:
2547         (WebKit::WebProcessProxy::ScopePreventingShutdown::ScopePreventingShutdown):
2548         (WebKit::WebProcessProxy::ScopePreventingShutdown::~ScopePreventingShutdown):
2549         (WebKit::WebProcessProxy::makeScopePreventingShutdown):
2550         Add new facility to prevent shutdown of a process for the duration of the scope.
2551
2552         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2553         (WebKit::WebsiteDataStore::removeData):
2554         When removing website data, only clear cached processes if they are associated with
2555         the current data store.
2556
2557 2019-10-12  Chris Fleizach  <cfleizach@apple.com>
2558
2559         AX: Make AXIsolatedTree compile again
2560         https://bugs.webkit.org/show_bug.cgi?id=202702
2561         <rdar://problem/56084968>
2562
2563         Reviewed by Joanmarie Diggs.
2564
2565         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2566         (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):
2567
2568 2019-10-11  Rob Buis  <rbuis@igalia.com>
2569
2570         Cleanup RuntimeEnabledFeatures includes
2571         https://bugs.webkit.org/show_bug.cgi?id=202857
2572
2573         Reviewed by Eric Carlson.
2574
2575         These classes must have had made use of runtime flags before
2576         but are not using them anymore.
2577
2578         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2579         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2580         * UIProcess/WebAuthentication/Cocoa/LocalService.mm:
2581         * UIProcess/WebProcessPool.cpp:
2582
2583 2019-10-11  Chris Dumez  <cdumez@apple.com>
2584
2585         Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class
2586         https://bugs.webkit.org/show_bug.cgi?id=202660
2587
2588         Reviewed by Antti Koivisto.
2589
2590         Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class. This is
2591         a first step towards implementing back / forward cache handling in the UIProcess.
2592
2593         The following changes were made:
2594         1. SuspendedPageProxy objects are now normally owned by their associated WebBackForwardListItem
2595            (Similarly to CachedPage objects being owned by their HistoryItem in WebCore) instead of the
2596            WebProcessPool.
2597         2. A new WebBackForwardCache class is introduced to cap the number of cached pages and clear
2598            them (similary to the PageCache in WebCore).
2599
2600         * Shared/WebBackForwardListItem.cpp:
2601         (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
2602         (WebKit::WebBackForwardListItem::wasRemovedFromBackForwardList):
2603         (WebKit::WebBackForwardListItem::setSuspendedPage):
2604         (WebKit::WebBackForwardListItem::takeSuspendedPage):
2605         (WebKit::WebBackForwardListItem::suspendedPage const):
2606         * Shared/WebBackForwardListItem.h:
2607         * Sources.txt:
2608         * UIProcess/API/Cocoa/WKProcessPool.mm:
2609         (-[WKProcessPool _maximumSuspendedPageCount]):
2610         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
2611         * UIProcess/SuspendedPageProxy.cpp:
2612         (WebKit::SuspendedPageProxy::findReusableSuspendedPageProcess):
2613         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2614         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2615         (WebKit::SuspendedPageProxy::setBackForwardListItem):
2616         (WebKit::SuspendedPageProxy::clearBackForwardListItem):
2617         (WebKit::SuspendedPageProxy::backForwardCache const):
2618         (WebKit::SuspendedPageProxy::suspensionTimedOut):
2619         * UIProcess/SuspendedPageProxy.h:
2620         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
2621         * UIProcess/WebAuthentication/Mock/MockHidService.h:
2622         * UIProcess/WebBackForwardCache.cpp: Added.
2623         (WebKit::WebBackForwardCache::removeOldestEntry):
2624         (WebKit::WebBackForwardCache::setCapacity):
2625         (WebKit::WebBackForwardCache::addEntry):
2626         (WebKit::WebBackForwardCache::removeEntry):
2627         (WebKit::WebBackForwardCache::takeEntry):
2628         (WebKit::WebBackForwardCache::removeEntriesForProcess):
2629         (WebKit::WebBackForwardCache::removeEntriesForPage):
2630         (WebKit::WebBackForwardCache::removeEntriesMatching):
2631         (WebKit::WebBackForwardCache::clear):
2632         * UIProcess/WebBackForwardCache.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidService.h.
2633         (WebKit::WebBackForwardCache::capacity const):
2634         (WebKit::WebBackForwardCache::size const):
2635         * UIProcess/WebBackForwardList.cpp:
2636         (WebKit::WebBackForwardList::didRemoveItem):
2637         * UIProcess/WebPageProxy.cpp:
2638         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2639         (WebKit::WebPageProxy::backForwardCache const):
2640         (WebKit::WebPageProxy::shouldUseBackForwardCache const):
2641         (WebKit::WebPageProxy::close):
2642         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2643         (WebKit::WebPageProxy::resetState):
2644         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2645         * UIProcess/WebPageProxy.h:
2646         (WebKit::WebPageProxy::process const):
2647         * UIProcess/WebProcessPool.cpp:
2648         (WebKit::m_webProcessCache):
2649         (WebKit::WebProcessPool::disconnectProcess):
2650         (WebKit::WebProcessPool::processForRegistrableDomain):
2651         (WebKit::WebProcessPool::handleMemoryPressureWarning):
2652         (WebKit::WebProcessPool::updateBackForwardCacheCapacity):
2653         (WebKit::WebProcessPool::setCacheModel):
2654         * UIProcess/WebProcessPool.h:
2655         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2656         (WebKit::WebsiteDataStore::removeData):
2657         (WebKit::WebsiteDataStore::setMockWebAuthenticationConfiguration):
2658         * WebKit.xcodeproj/project.pbxproj:
2659
2660 2019-10-11  Alex Christensen  <achristensen@webkit.org>
2661
2662         Only use CFNetwork SPI for metrics where needed
2663         https://bugs.webkit.org/show_bug.cgi?id=202825
2664
2665         Reviewed by Joseph Pecoraro.
2666
2667         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2668         (stringForSSLProtocolVersion):
2669         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2670
2671 2019-10-11  Kate Cheney  <katherine_cheney@apple.com>
2672
2673         Get StorageAccess API features working on SQLite database implementation (195422)
2674         https://bugs.webkit.org/show_bug.cgi?id=195422
2675         <rdar://problem/54213519>
2676
2677         Reviewed by Brent Fulgham.
2678
2679         This patch migrates the http/tests/storageAccess/ Layout tests to
2680         use the ITP database and uncovered 3 bugs in the process.
2681
2682         1. It was previously blocking cookies to a third party domain which
2683         was not marked as prevalent. Now it ensures that the user is prompted
2684         using the storage acess API regarding that third party domain.
2685
2686         2. It was not requesting storage access if cookies had previously been
2687         blocked. Now it will only return early from
2688         ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener
2689         if cookie access is allowed, and request storage access otherwise.
2690
2691         3. hasUserGrantedStorageAccessThroughPrompt was returning true even
2692         if the result was not previously granted storage access.
2693
2694         All of these fixes match behavior in
2695         ResourceLoadStatisticsMemoryStore.
2696
2697         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2698         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
2699         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
2700         (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
2701
2702 2019-10-11  Dean Jackson  <dino@apple.com>
2703
2704         REGRESSION: fast/events/touch/ios/long-press-on-image.html is failing
2705         https://bugs.webkit.org/show_bug.cgi?id=202845
2706
2707         Reviewed by Antoine Quint.
2708
2709         Update _contentsOfUserInterfaceItem so that it returns more information
2710         on a context menu.
2711
2712         * UIProcess/ios/WKContentViewInteraction.mm:
2713         (-[WKContentView _contentsOfUserInterfaceItem:]):
2714
2715 2019-10-11  Alex Christensen  <achristensen@webkit.org>
2716
2717         Use sendWithAsyncReply for cookie getting/clearing functions
2718         https://bugs.webkit.org/show_bug.cgi?id=202841
2719
2720         Reviewed by Carlos Garcia Campos.
2721
2722         No change in behavior.  This just simplifies the message sending a bit.
2723
2724         * NetworkProcess/Cookies/WebCookieManager.cpp:
2725         (WebKit::WebCookieManager::getHostnamesWithCookies):
2726         (WebKit::WebCookieManager::deleteAllCookies):
2727         (WebKit::WebCookieManager::deleteCookie):
2728         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
2729         (WebKit::WebCookieManager::getAllCookies):
2730         (WebKit::WebCookieManager::getCookies):
2731         (WebKit::WebCookieManager::setCookie):
2732         (WebKit::WebCookieManager::setCookies):
2733         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
2734         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
2735         * NetworkProcess/Cookies/WebCookieManager.h:
2736         * NetworkProcess/Cookies/WebCookieManager.messages.in:
2737         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
2738         * UIProcess/API/APIHTTPCookieStore.cpp:
2739         (API::HTTPCookieStore::cookies):
2740         (API::HTTPCookieStore::setCookies):
2741         (API::HTTPCookieStore::deleteCookie):
2742         (API::HTTPCookieStore::setHTTPCookieAcceptPolicy):
2743         * UIProcess/API/Cocoa/WKProcessPool.mm:
2744         (-[WKProcessPool _setCookieAcceptPolicy:]):
2745         * UIProcess/API/glib/WebKitCookieManager.cpp:
2746         (webkit_cookie_manager_set_accept_policy):
2747         (webkit_cookie_manager_get_accept_policy):
2748         (webkit_cookie_manager_add_cookie):
2749         (webkit_cookie_manager_get_cookies):
2750         (webkit_cookie_manager_delete_cookie):
2751         * UIProcess/Automation/WebAutomationSession.cpp:
2752         (WebKit::WebAutomationSession::addSingleCookie):
2753         * UIProcess/AuxiliaryProcessProxy.h:
2754         (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply):
2755         * UIProcess/WebCookieManagerProxy.cpp:
2756         (WebKit::WebCookieManagerProxy::processPoolDestroyed):
2757         (WebKit::WebCookieManagerProxy::processDidClose):
2758         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
2759         (WebKit::WebCookieManagerProxy::deleteCookie):
2760         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
2761         (WebKit::WebCookieManagerProxy::setCookies):
2762         (WebKit::WebCookieManagerProxy::getAllCookies):
2763         (WebKit::WebCookieManagerProxy::getCookies):
2764         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
2765         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
2766         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): Deleted.
2767         (WebKit::WebCookieManagerProxy::didSetCookies): Deleted.
2768         (WebKit::WebCookieManagerProxy::didGetCookies): Deleted.
2769         (WebKit::WebCookieManagerProxy::didDeleteCookies): Deleted.
2770         (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): Deleted.
2771         (WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy): Deleted.
2772         * UIProcess/WebCookieManagerProxy.h:
2773         * UIProcess/WebCookieManagerProxy.messages.in:
2774
2775 2019-10-10  Alex Christensen  <achristensen@webkit.org>
2776
2777         Remove unused WebProcessPool::requestNetworkingStatistics
2778         https://bugs.webkit.org/show_bug.cgi?id=202818
2779
2780         Reviewed by Chris Dumez.
2781
2782         Its only use was removed in rdar://problem/56160996
2783
2784         * NetworkProcess/Downloads/DownloadManager.h:
2785         (WebKit::DownloadManager::isDownloading const):
2786         (WebKit::DownloadManager::activeDownloadCount const): Deleted.
2787         * NetworkProcess/NetworkProcess.cpp:
2788         (WebKit::NetworkProcess::getNetworkProcessStatistics): Deleted.
2789         * NetworkProcess/NetworkProcess.h:
2790         * NetworkProcess/NetworkProcess.messages.in:
2791         * Shared/Authentication/AuthenticationManager.h:
2792         (WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount const): Deleted.
2793         * UIProcess/Network/NetworkProcessProxy.cpp:
2794         (WebKit::NetworkProcessProxy::didReceiveMessage):
2795         * UIProcess/WebProcessPool.cpp:
2796         (WebKit::WebProcessPool::getStatistics):
2797         (WebKit::WebProcessPool::requestNetworkingStatistics): Deleted.
2798         * UIProcess/WebProcessPool.h:
2799
2800 2019-10-10  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2801
2802         [WinCairo] Move remote communication handling from RemoteInspectorServer to RemoteInspector.
2803         https://bugs.webkit.org/show_bug.cgi?id=202763
2804
2805         Reviewed by Ross Kirsling.
2806
2807         Remove deleted method invocations.
2808
2809         * UIProcess/win/WebProcessPoolWin.cpp:
2810         (WebKit::initializeRemoteInspectorServer):
2811         (WebKit::WebProcessPool::platformInitialize):
2812
2813 2019-10-10  Youenn Fablet  <youenn@apple.com>
2814
2815         Do not timeout a load intercepted by service worker that receives a response
2816         https://bugs.webkit.org/show_bug.cgi?id=202787
2817
2818         Reviewed by Chris Dumez.
2819
2820         Stop making ServiceWorkerFetchTask ref counted since it is not needed and
2821         can potentially make ServiceWorkerFetchTask oulive its WebSWServerToContextConnection member.
2822
2823         Stop the ServiceWorkerFetchTask timeout timer whenever receiving a response so that the load will not timeout in that case.
2824         This ensures that a load that is starting in a service worker will not be failing.
2825         Instead the load will go to network process.
2826
2827         Removed m_didReachTerminalState which is not needed as WebSWServerToContextConnection unregisters the ServiceWorkerFetchTask
2828         as an IPC listener for all terminating messages.
2829
2830         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
2831         (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
2832         (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
2833         (WebKit::ServiceWorkerFetchTask::didReceiveData):
2834         (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
2835         (WebKit::ServiceWorkerFetchTask::didFinish):
2836         (WebKit::ServiceWorkerFetchTask::didFail):
2837         (WebKit::ServiceWorkerFetchTask::didNotHandle):
2838         (WebKit::ServiceWorkerFetchTask::timeoutTimerFired):
2839         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
2840         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2841         (WebKit::WebSWServerToContextConnection::startFetch):
2842         (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut):
2843         Use a Vector instead of a HasSet for performance reasons.
2844         Update according fetch map using unique_ptr instead of Ref<>.
2845         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
2846
2847 2019-10-10  Rob Buis  <rbuis@igalia.com>
2848
2849         SpeculativeLoad should use CompletionHandler
2850         https://bugs.webkit.org/show_bug.cgi?id=202795
2851
2852         Reviewed by Chris Dumez.
2853
2854         SpeculativeLoad should use CompletionHandler, as remarked in
2855         Bug 201641 review.
2856
2857         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2858
2859 2019-10-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2860
2861         Support programmatic paste requests on macOS
2862         https://bugs.webkit.org/show_bug.cgi?id=202773
2863         <rdar://problem/48957166>
2864
2865         Reviewed by Tim Horton.
2866
2867         Adds support for programmatic paste requests on macOS, as well as some testing SPI in WKWebView to allow
2868         WebKitTestRunner to grab the NSMenu used for the DOM paste request. This patch adopts the same strategy taken to
2869         allow programmatic paste on iOS, by allowing programmatic pastes coming from the page to show platform UI which
2870         the user must then interact with in order to proceed with the paste. See below for more details.
2871
2872         * Shared/WebPreferencesDefaultValues.h:
2873
2874         Make this available on both iOS and macOS (iOS family is omitted for now, since callout bar UI is not generally
2875         present on non-iOS iOS-family platforms such as Apple Watch).
2876
2877         * UIProcess/API/Cocoa/WKWebView.mm:
2878         (-[WKWebView _web_grantDOMPasteAccess]):
2879
2880         This selector is called when the user taps the Paste option in the presented NSMenu.
2881
2882         (-[WKWebView _activeMenu]):
2883
2884         Returns the currently active NSMenu. Only for testing purposes.
2885
2886         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2887         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2888         * UIProcess/API/mac/WKView.mm:
2889         (-[WKView _web_grantDOMPasteAccess]):
2890
2891         Same exercise as above, only for WKView instead of WKWebView.
2892
2893         * UIProcess/Cocoa/WebViewImpl.h:
2894         (WebKit::WebViewImpl::domPasteMenu const):
2895         * UIProcess/Cocoa/WebViewImpl.mm:
2896         (-[WKDOMPasteMenuDelegate initWithWebViewImpl:]):
2897         (-[WKDOMPasteMenuDelegate menuDidClose:]):
2898         (-[WKDOMPasteMenuDelegate numberOfItemsInMenu:]):
2899         (-[WKDOMPasteMenuDelegate confinementRectForMenu:onScreen:]):
2900
2901         Adds a new object, whose purpose is to be a delegate for the NSMenu that is presented when requesting DOM paste
2902         access. This object is used instead of WKWebView, since API clients may end up making the WKWebView the delegate
2903         for a different menu, in which case some implementations (either theirs or ours) of NSMenuDelegate methods would
2904         not be called. Avoiding this would require the client to be aware that WKWebView conforms to NSMenuDelegate,
2905         which is only declared privately.
2906
2907         (WebKit::WebViewImpl::handleProcessSwapOrExit):
2908
2909         On process swap or exit, automatically bail out of any pending DOM paste request by denying it.
2910
2911         (WebKit::WebViewImpl::requestDOMPasteAccess):
2912         (WebKit::WebViewImpl::handleDOMPasteRequestWithResult):
2913
2914         Handle the DOM paste request by showing an NSMenu near the mouse cursor with a single option to paste.
2915
2916         * UIProcess/mac/PageClientImplMac.h:
2917         * UIProcess/mac/PageClientImplMac.mm:
2918         (WebKit::PageClientImpl::requestDOMPasteAccess):
2919
2920 2019-10-10  youenn fablet  <youenn@apple.com>
2921
2922         Remove unified plan runtime flag
2923         https://bugs.webkit.org/show_bug.cgi?id=202721
2924
2925         Reviewed by Geoffrey Garen.
2926
2927         * Shared/WebPreferences.yaml:
2928         * UIProcess/API/glib/WebKitSettings.cpp:
2929         (webKitSettingsConstructed): Remove ability to disable unified plan.
2930
2931 2019-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2932
2933         Remove a "The " in "The The HTTP headers of the response"
2934         https://bugs.webkit.org/show_bug.cgi?id=194851
2935
2936         Reviewed by Carlos Garcia Campos.
2937
2938         * Shared/API/glib/WebKitURIResponse.cpp:
2939         (webkit_uri_response_class_init): Fix typo in description of the WebKitURIResponse::http-headers property.
2940
2941 2019-10-10  youenn fablet  <youenn@apple.com>
2942
2943         [Mac] Allow SYS___pthread_markcancel call
2944         https://bugs.webkit.org/show_bug.cgi?id=202723
2945
2946         Reviewed by Alex Christensen.
2947
2948         Allow this pthread call as libwebrtc uses it on the Mac as well.
2949
2950         * WebProcess/com.apple.WebProcess.sb.in:
2951
2952 2019-10-09  youenn fablet  <youenn@apple.com>
2953
2954         A service worker process should not be created when enqueuing a service worker job
2955         https://bugs.webkit.org/show_bug.cgi?id=202578
2956         <rdar://problem/55979690>
2957
2958         Reviewed by Chris Dumez.
2959
2960         Remove the calls to create service worker context connection.
2961         They are now done at SWServer level when trying to either run a service worker or install one.
2962
2963         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2964         (WebKit::WebSWServerConnection::startFetch):
2965         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2966         (WebKit::WebSWServerConnection::scheduleJobInServer):
2967
2968 2019-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2969
2970         [Clipboard API] Refactor Pasteboard item reading functions to work on both iOS and macOS
2971         https://bugs.webkit.org/show_bug.cgi?id=202647
2972
2973         Reviewed by Tim Horton.
2974
2975         Refactor iOS-specific pasteboard functions to be platform-agnostic. See WebCore ChangeLog for more details.
2976
2977         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2978         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
2979         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
2980         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
2981         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
2982         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
2983         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
2984         (WebKit::WebPasteboardProxy::writeURLToPasteboard):
2985         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
2986         (WebKit::WebPasteboardProxy::writeImageToPasteboard):
2987         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
2988         * UIProcess/WebPasteboardProxy.cpp:
2989         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
2990         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
2991         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
2992         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
2993         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
2994         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
2995         * UIProcess/WebPasteboardProxy.h:
2996         * UIProcess/WebPasteboardProxy.messages.in:
2997         * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
2998         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2999         (WebKit::WebPlatformStrategies::informationForItemAtIndex):
3000         (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
3001         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
3002         (WebKit::WebPlatformStrategies::readStringFromPasteboard):
3003         (WebKit::WebPlatformStrategies::writeToPasteboard):
3004         (WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers):
3005         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3006
3007 2019-10-09  John Wilander  <wilander@apple.com>
3008
3009         IsLoggedIn: Add as experimental feature
3010         https://bugs.webkit.org/show_bug.cgi?id=202707
3011         <rdar://problem/56095064>
3012
3013         Reviewed by Brent Fulgham and Chris Dumez.
3014
3015         IsLoggedIn was proposed to the WebAppSec WG at TPAC 2019.
3016         So far there is only an explainer posted to the mailing list:
3017         https://lists.w3.org/Archives/Public/public-webappsec/2019Sep/0004.html
3018
3019         * Shared/WebPreferences.yaml:
3020
3021 2019-10-09  Jiewen Tan  <jiewen_tan@apple.com>
3022
3023         [WebAuthn] Move the mock testing entrance to Internals
3024         https://bugs.webkit.org/show_bug.cgi?id=202560
3025         <rdar://problem/55973793>
3026
3027         Reviewed by Chris Dumez.
3028
3029         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3030         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): Deleted.
3031         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3032         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
3033         (WebKit::AuthenticatorTransportService::createMock):
3034         * UIProcess/WebAuthentication/AuthenticatorTransportService.h:
3035         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
3036         (WebKit::MockAuthenticatorManager::MockAuthenticatorManager):
3037         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h:
3038         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
3039         (WebKit::MockHidConnection::send):
3040         (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
3041         (WebKit::MockHidConnection::parseRequest):
3042         (WebKit::MockHidConnection::feedReports):
3043         (WebKit::MockHidConnection::shouldContinueFeedReports):
3044         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
3045         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
3046         (WebKit::MockHidService::MockHidService):
3047         * UIProcess/WebAuthentication/Mock/MockHidService.h:
3048         * UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
3049         * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
3050         (WebKit::MockLocalConnection::MockLocalConnection):
3051         * UIProcess/WebAuthentication/Mock/MockLocalService.h:
3052         * UIProcess/WebAuthentication/Mock/MockLocalService.mm:
3053         (WebKit::MockLocalService::MockLocalService):
3054         * UIProcess/WebAuthentication/Mock/MockNfcService.h:
3055         * UIProcess/WebAuthentication/Mock/MockNfcService.mm:
3056         (WebKit::MockNfcService::MockNfcService):
3057         (WebKit::MockNfcService::platformStartDiscovery):
3058         (WebKit::MockNfcService::detectTags const):
3059         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h: Removed.
3060         * UIProcess/WebPageProxy.cpp:
3061         (WebKit::WebPageProxy::setMockWebAuthenticationConfiguration):
3062         * UIProcess/WebPageProxy.h:
3063         * UIProcess/WebPageProxy.messages.in:
3064         * UIProcess/WebsiteData/WebsiteDataStore.h:
3065         * WebKit.xcodeproj/project.pbxproj:
3066         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3067         (WebKit::WebChromeClient::setMockWebAuthenticationConfiguration):
3068         * WebProcess/WebCoreSupport/WebChromeClient.h:
3069
3070 2019-10-09  Simon Fraser  <simon.fraser@apple.com>
3071
3072         Rename WheelEventTestTrigger and improve naming in related code
3073         https://bugs.webkit.org/show_bug.cgi?id=202772
3074
3075         Reviewed by Tim Horton.
3076
3077         Change the "test trigger" terminology to "monitor wheel events"; after all, tests
3078         call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering
3079         a test.
3080
3081         * UIProcess/API/C/WKPage.cpp:
3082         (WKPageClearWheelEventTestMonitor):
3083         (WKPageClearWheelEventTestTrigger): Deleted.
3084         * UIProcess/API/C/WKPage.h:
3085         * UIProcess/WebPageProxy.cpp:
3086         (WebKit::WebPageProxy::clearWheelEventTestMonitor):
3087         (WebKit::WebPageProxy::clearWheelEventTestTrigger): Deleted.
3088         * UIProcess/WebPageProxy.h:
3089         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3090         (WKBundlePageStartMonitoringScrollOperations):
3091         (WKBundlePageRegisterScrollOperationCompletionCallback):
3092         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3093         (WebKit::PDFPlugin::createScrollbar):
3094         * WebProcess/WebPage/EventDispatcher.cpp:
3095         * WebProcess/WebPage/WebPage.cpp:
3096         (WebKit::WebPage::clearWheelEventTestMonitor):
3097         (WebKit::WebPage::clearWheelEventTestTrigger): Deleted.
3098         * WebProcess/WebPage/WebPage.h:
3099         * WebProcess/WebPage/WebPage.messages.in:
3100
3101 2019-10-09  Andy Estes  <aestes@apple.com>
3102
3103         [Cocoa] IPC::decode should gracefully handle a nil allowed class
3104         https://bugs.webkit.org/show_bug.cgi?id=202753
3105
3106         Reviewed by Geoffrey Garen.
3107
3108         If IPC::decode is called with a nil allowed class, an NSInvalidArgumentException will be
3109         thrown when trying to create an NSArray literal with a nil value. Depending on who calls
3110         IPC::decode, this exception might or might not be caught, leading to dropped messages or
3111         crashes.
3112
3113         One case of this happening is tracked by rdar://problem/55839467. In this case, the nil
3114         allowed class was due to a build misconfiguration, and the exception caused the UI process
3115         to not respond to a synchronous IPC message, hanging the WebContent process.
3116
3117         rdar://problem/55839467 was resolved by fixing the build misconfiguration, but this patch
3118         improves IPC::decode so that a nil allowed class results in a message decoding failure
3119         rather than a maybe-caught NSException.
3120
3121         * Shared/Cocoa/ArgumentCodersCocoa.h:
3122         (IPC::decode):
3123
3124 2019-10-09  youenn fablet  <youenn@apple.com>
3125
3126         Remove testRunner.setWebRTCUnifiedPlanEnabled
3127         https://bugs.webkit.org/show_bug.cgi?id=202700
3128
3129         Reviewed by Eric Carlson.
3130
3131         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3132         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3133
3134 2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3135
3136         REGRESSION(r250597): [GTK][WPE] 2.27.1 shows HTML content as text/plain in custom protocols when passing a charset in content type
3137         https://bugs.webkit.org/show_bug.cgi?id=202633
3138
3139         Reviewed by Žan Doberšek.
3140
3141         This is a regression of the switch to use the new custom protocols implementation. Before r250597, we extracted
3142         the mime type and charset from content type in the network process, but we are now sending the response directly
3143         from the UI process, so we need to do that when building our response. Rename the mime_type parameter as
3144         content_type to avoid confusion, since it's documented as the content type.
3145
3146         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
3147         (webkitURISchemeRequestReadCallback):
3148         (webkit_uri_scheme_request_finish):
3149         * UIProcess/API/gtk/WebKitURISchemeRequest.h:
3150         * UIProcess/API/wpe/WebKitURISchemeRequest.h:
3151
3152 2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3153
3154         [GTK][WPE] about:gpu should also show the client EGL extensions
3155         https://bugs.webkit.org/show_bug.cgi?id=202690
3156
3157         Reviewed by Carlos Alberto Lopez Perez.
3158
3159         We are showing the extensions supported by the display.
3160
3161         * UIProcess/API/glib/WebKitProtocolHandler.cpp:
3162         (WebKit::WebKitProtocolHandler::handleGPU):
3163
3164 2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3165
3166         CustomProtocols: convert log messages in WebURLSchemeTaskProxy to RELEASE_LOG
3167         https://bugs.webkit.org/show_bug.cgi?id=202686
3168
3169         Reviewed by Alex Christensen.
3170
3171         Instead of using WTFLogAlways, since those messages are confusing on stdout.
3172
3173         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
3174         (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
3175         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
3176         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
3177
3178 2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3179
3180         [WPE][GTK] WebKitSecurityManager should consider webkit:// to be a local URI scheme
3181         https://bugs.webkit.org/show_bug.cgi?id=202638
3182
3183         Reviewed by Michael Catanzaro.
3184
3185         * UIProcess/API/glib/WebKitProtocolHandler.cpp:
3186         (WebKit::WebKitProtocolHandler::WebKitProtocolHandler):
3187
3188 2019-10-08  Antti Koivisto  <antti@apple.com>
3189
3190         [CSS Shadow Parts] Enable by default
3191         https://bugs.webkit.org/show_bug.cgi?id=202644
3192
3193         Reviewed by Ryosuke Niwa.
3194
3195         * Shared/WebPreferences.yaml:
3196
3197         Flip the switch.
3198
3199 2019-10-08  Andy Estes  <aestes@apple.com>
3200
3201         [iOS] Add a fast path that avoids hit testing during context menu interactions on elements
3202         https://bugs.webkit.org/show_bug.cgi?id=202510
3203         <rdar://problem/55939313>
3204
3205         Reviewed by Tim Horton.
3206
3207         When computing position information for an element, we can store sufficient context
3208         information in InteractionInformationAtPosition such that the same element could be
3209         retrieved again without hit testing. The existing TextInputContext can already store an
3210         element's page identifier, document identifier, and element identifier, which is sufficient
3211         context for such a task.
3212
3213         This patch renames TextInputContext to ElementContext and uses it when populating new
3214         InteractionInformationAtPosition structs in elementPositionInformation(). When a context
3215         menu interaction occurs, WebPage::startInteractionWithElementContextOrPosition() uses this
3216         context to look up the interaction element by its identifier triplet, falling back to hit
3217         testing if this lookup fails.
3218
3219         * Scripts/webkit/messages.py:
3220         * Shared/DocumentEditingContext.h:
3221         * Shared/DocumentEditingContext.mm:
3222         (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
3223         * Shared/ElementContext.cpp: Renamed from Source/WebKit/Shared/TextInputContext.cpp.
3224         (IPC::ArgumentCoder<WebKit::ElementContext>::encode):
3225         (IPC::ArgumentCoder<WebKit::ElementContext>::decode):
3226         * Shared/ElementContext.h: Renamed from Source/WebKit/Shared/TextInputContext.h.
3227         (WebKit::operator==):
3228         * Shared/ios/InteractionInformationAtPosition.h:
3229         * Shared/ios/InteractionInformationAtPosition.mm:
3230         (WebKit::InteractionInformationAtPosition::encode const):
3231         (WebKit::InteractionInformationAtPosition::decode):
3232         * Sources.txt:
3233         * UIProcess/API/Cocoa/WKWebView.mm:
3234         (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
3235         * UIProcess/API/Cocoa/_WKTextInputContext.mm:
3236         (-[_WKTextInputContext _initWithTextInputContext:]):
3237         (-[_WKTextInputContext _textInputContext]):
3238         * UIProcess/API/Cocoa/_WKTextInputContextInternal.h:
3239         * UIProcess/WebPageProxy.cpp:
3240         (WebKit::WebPageProxy::textInputContextsInRect):
3241         (WebKit::WebPageProxy::focusTextInputContext):
3242         * UIProcess/WebPageProxy.h:
3243         * UIProcess/ios/WKContentViewInteraction.mm:
3244         (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
3245         (-[WKContentView assignLegacyDataForContextMenuInteraction]):
3246         (-[WKContentView continueContextMenuInteraction:]):
3247         (-[WKContentView continueContextMenuInteractionWithDataDetectors:]):
3248         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
3249         * UIProcess/ios/WebPageProxyIOS.mm:
3250         (WebKit::WebPageProxy::startInteractionWithPositionInformation):
3251         (WebKit::WebPageProxy::startInteractionWithElementAtPosition): Deleted.
3252         * WebKit.xcodeproj/project.pbxproj:
3253         * WebProcess/WebPage/WebPage.cpp:
3254         (WebKit::WebPage::textInputContextsInRect):
3255         (WebKit::WebPage::focusTextInputContext):
3256         (WebKit::WebPage::elementForContext const):
3257         (WebKit::WebPage::contextForElement const):
3258         (WebKit::WebPage::elementForTextInputContext): Deleted.
3259         * WebProcess/WebPage/WebPage.h:
3260         * WebProcess/WebPage/WebPage.messages.in:
3261         * WebProcess/WebPage/ios/WebPageIOS.mm:
3262         (WebKit::elementPositionInformation):
3263         (WebKit::WebPage::startInteractionWithElementContextOrPosition):
3264         (WebKit::WebPage::requestDocumentEditingContext):
3265         (WebKit::WebPage::startInteractionWithElementAtPosition): Deleted.
3266
3267 2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>
3268
3269         Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.1 release
3270
3271         * wpe/NEWS: Add release notes for 2.27.1
3272
3273 2019-10-08  Kate Cheney  <katherine_cheney@apple.com>
3274
3275         Implement Telemetry and Dumping Routines for SQLite backend (195088)
3276         https://bugs.webkit.org/show_bug.cgi?id=195088
3277         <rdar://problem/54213407>
3278
3279         Reviewed by John Wilander.
3280
3281         Implemented database telemetry calculating for ITP. Mimicked
3282         ResourceLoadStatisticsMemoryStore telemetry logging behavior using
3283         SQLite Queries as opposed to vector sorting/manipulation. Once fully
3284         integrated, this will simplify analysis of ITP data by transitioning
3285         ITP data storage from a plist to a SQLite database.
3286
3287         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
3288         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
3289         Added SQL queries to be initialized in the constructor. These queries
3290         are needed to mimic the telemetry calculations done in
3291         ResourceLoadStatisticsMemoryStore.
3292         
3293         (WebKit::resetStatement):
3294         To reduce code duplication, this function holds common code to reset
3295         a SQL query.
3296
3297         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
3298         Added SQL queries needed for telemetry calculations to be prepared.
3299         
3300         (WebKit::joinSubStatisticsForSorting):
3301         This function returns the query string for sorting resources that is
3302         shared by many queries.
3303
3304         (WebKit::ResourceLoadStatisticsDatabaseStore::getMedianOfPrevalentResourcesWithUserInteraction const):
3305         Implemented a function to take the median days since user interaction
3306         from all prevalent resources in the database with user interaction
3307         (sorted by max count of subframes, subresources and unique redirects under
3308         the top frame domain).
3309
3310         (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResources const):
3311         Executes a SQL query to get the number of prevalent resources to log as
3312         telemetry.
3313
3314         (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResourcesWithUI const):
3315         Executes a SQL query to get the number of prevalent resources with user
3316         interaction to log as telemetry.
3317
3318         (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const):
3319         Prepares and executes a SQL query to get the days since user
3320         interaction from the top prevalent resource to be recorded as
3321         telemetry data.
3322
3323         (WebKit::ResourceLoadStatisticsDatabaseStore::getMedianStatisticOfPrevalentResourceWithoutUserInteraction const):
3324         Implemented a function which takes a statistic and returns the value
3325         of that statistic for the median prevalent resource without user
3326         interaction to be recorded as telemetry data.
3327
3328         (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResourcesInTopResources const):
3329         Returns the count of prevalent resources in the top x resources
3330         sorted by sum of substatistics again to be logged as telemetry.
3331
3332         (WebKit::ResourceLoadStatisticsDatabaseStore::calculateTelemetryData const):
3333         Function which executes all functions which populate the struct with
3334         telemetry data. This struct will then be passed to
3335         WebResourceLoadStatisticsTelemetry to be logged.
3336
3337         (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
3338         Initializes the telemetry struct and calls the function to populate
3339         it, then passes it to the WebResourceLoadStatisticsTelemetry object
3340         to be recorded.
3341
3342         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
3343         Describe PrevalentResourceDatabaseTelemetry Struct to be passed and
3344         logged as telemetry data.
3345
3346         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
3347         (WebKit::databaseSubmitTopLists):
3348         Logging telemetry data by looping through 2D array of statistics for
3349         the top 1, 3, 10, 50, and 100 prevalent resources sorted by the sum
3350         of substatistics under the top frame domain. This matches the logging
3351         already done in ResourceLoadStatisticsMemoryStore.
3352
3353         (WebKit::WebResourceLoadStatisticsTelemetry::submitTelemetry):
3354         Submits data to the webPageProxy logs and plists.
3355
3356         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h:
3357         Added new submitTopList function to accomodate database telemetry
3358         logging.
3359         
3360         * NetworkProcess/NetworkSession.cpp:
3361         (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished):
3362         * NetworkProcess/NetworkSession.h:
3363         * UIProcess/Network/NetworkProcessProxy.cpp:
3364         (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished):
3365         * UIProcess/Network/NetworkProcessProxy.h:
3366         * UIProcess/Network/NetworkProcessProxy.messages.in:
3367         Updated the current testing for telemetry which only tested 3
3368         statistics. With this patch it now tests 10 statistics.
3369
3370 2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>
3371
3372         [GTK][WPE] Fix non-unified builds after r250486
3373         https://bugs.webkit.org/show_bug.cgi?id=202636
3374
3375         Reviewed by Youenn Fablet.
3376
3377         * NetworkProcess/NetworkConnectionToWebProcess.cpp: Add missing inclusion of the
3378         Logging.h header.
3379
3380 2019-10-08  Brady Eidson  <beidson@apple.com>
3381
3382         Service Worker Fetch events should time out.
3383         https://bugs.webkit.org/show_bug.cgi?id=202188
3384
3385         Reviewed by Alex Christensen.
3386
3387         When we start a fetch task in the server, we also start a timeout on that fetch task.
3388         
3389         "Time out" means the fetch task must continue to make progress at the given frequency (once every 60 seconds by default)
3390
3391         If any given fetch task times out in a service worker instance, that instance loses the right to handle fetches.
3392         
3393         * NetworkProcess/NetworkProcess.cpp:
3394         (WebKit::NetworkProcess::setServiceWorkerFetchTimeoutForTesting):
3395         (WebKit::NetworkProcess::resetServiceWorkerFetchTimeoutForTesting):
3396         * NetworkProcess/NetworkProcess.h:
3397         (WebKit::NetworkProcess::serviceWorkerFetchTimeout const):
3398         * NetworkProcess/NetworkProcess.messages.in:
3399
3400         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
3401         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
3402         (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): 
3403         (WebKit::ServiceWorkerFetchTask::didReceiveResponse): 
3404         (WebKit::ServiceWorkerFetchTask::didReceiveData): 
3405         (WebKit::ServiceWorkerFetchTask::didReceiveFormData): 
3406         (WebKit::ServiceWorkerFetchTask::didFinish): 
3407         (WebKit::ServiceWorkerFetchTask::didFail): 
3408         (WebKit::ServiceWorkerFetchTask::didNotHandle): 
3409         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
3410         (WebKit::ServiceWorkerFetchTask::create):
3411         (WebKit::ServiceWorkerFetchTask::serviceWorkerIdentifier const):
3412         (WebKit::ServiceWorkerFetchTask::wasHandled const):
3413         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): Deleted.
3414
3415         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
3416         (WebKit::WebSWServerConnection::startFetch):
3417         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
3418
3419         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3420         (WebKit::WebSWServerToContextConnection::startFetch):
3421         (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut):
3422         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
3423
3424         * UIProcess/API/C/WKContext.cpp:
3425         (WKContextSetServiceWorkerFetchTimeoutForTesting):
3426         (WKContextResetServiceWorkerFetchTimeoutForTesting):
3427         * UIProcess/API/C/WKContext.h:
3428
3429         * UIProcess/WebProcessPool.cpp:
3430         (WebKit::WebProcessPool::setServiceWorkerTimeoutForTesting):
3431         (WebKit::WebProcessPool::resetServiceWorkerTimeoutForTesting):
3432         * UIProcess/WebProcessPool.h:
3433
3434 2019-10-08  Ross Kirsling  <ross.kirsling@sony.com>
3435
3436         Unreviewed. Restabilize non-unified build.
3437
3438         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
3439
3440 2019-10-08  Dean Jackson  <dino@apple.com>
3441
3442         Sort Internal and Experimental features by human readable name
3443         https://bugs.webkit.org/show_bug.cgi?id=202667
3444
3445         Reviewed by Zalan Bujtas.
3446
3447         Sort the statically generated vectors of internal and
3448         experimental features by their human readable name, rather than
3449         the feature key, so that looking at them in the Settings app
3450         doesn't make people who like alphabetical order angry.
3451
3452         * Scripts/GeneratePreferences.rb: Add an extra sort call to the list generation.
3453
3454 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3455
3456         [Clipboard API] Introduce bindings for the async Clipboard API
3457         https://bugs.webkit.org/show_bug.cgi?id=202622
3458         <rdar://problem/56038126>
3459
3460         Reviewed by Ryosuke Niwa.
3461
3462         Adds a new experimental feature flag. See WebCore ChangeLog for more details.
3463
3464         * Shared/WebPreferences.yaml:
3465
3466 2019-10-08  Alexander Mikhaylenko  <alexm@gnome.org>
3467
3468         [GTK] Navigation gesture improvements
3469         https://bugs.webkit.org/show_bug.cgi?id=202645
3470
3471         Reviewed by Carlos Garcia Campos.
3472
3473         Measure velocity threshold in pixels per second rather than distance (range [0-1])
3474         per second. The value is the same as it was on touchpads, since a fixed distance is
3475         used, but is now consistent on touchscreens, regardless of the webview width.
3476
3477         Add a threshold for cancelling gesture when the page is more than halfway
3478         through, so that it's symmetric with the first half.
3479
3480         Align the moving page to pixel grid on hidpi devices correctly. Just
3481         rounding the position doesn't work correctly, since the cairo context is
3482         pre-scaled. Multiplying by scale factor, rounding and then dividing by
3483         scale factor fixes this.
3484
3485         * UIProcess/ViewGestureController.h:
3486         * UIProcess/gtk/ViewGestureControllerGtk.cpp:
3487         (WebKit::ViewGestureController::SwipeProgressTracker::reset):
3488         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
3489         (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel):
3490         (WebKit::ViewGestureController::draw):
3491
3492 2019-10-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3493
3494         Unreviewed. Remove unused WebKitSoupRequestGeneric after r250597
3495
3496         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
3497
3498 2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>
3499
3500         [WPE][GTK] Build fails with ENABLE_WEBDRIVER=OFF
3501         https://bugs.webkit.org/show_bug.cgi?id=202658
3502
3503         Reviewed by Carlos Garcia Campos.
3504
3505         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Add missing
3506         ENABLE(WEBDRIVER_MOUSE_INTERACTIONS) and ENABLE(WEBDRIVER_KEYBOARD_INTERACTIONS)
3507         preprocessor guards.
3508         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Ditto.
3509
3510 2019-10-07  Ryosuke Niwa  <rniwa@webkit.org>
3511
3512         Add IDL for requestIdleCallback
3513         https://bugs.webkit.org/show_bug.cgi?id=202653
3514
3515         Reviewed by Geoffrey Garen.
3516
3517         * Shared/WebPreferences.yaml:
3518
3519 2019-10-07  Kate Cheney  <katherine_cheney@apple.com>
3520
3521         Domain relationships in the ITP Database should be inserted in a single query and ignore repeat insert attempts. (202604)
3522         https://bugs.webkit.org/show_bug.cgi?id=202604
3523         <rdar://problem/55995831>
3524
3525         Reviewed by Chris Dumez. 
3526         
3527         This patch addresses two clean-ups for the ITP SQLite Database Store.
3528         First, by using INSERT OR IGNORE as opposed to INSERT, it eliminates
3529         the need to check if a relationship already exists in the database
3530         before inserting it. Second, instead of looping through domain lists
3531         and inserting each relationship as a separate query, this patch now
3532         converts lists to a string which SQLite can use to insert multiple
3533         rows into a database using a single query.
3534
3535         Some Exists queries could not be deleted because they were being
3536         used for testing.
3537
3538         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
3539         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
3540         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
3541         Removed old insert queries and replaced them with queries able to
3542         insert string-lists of domains in a single query. Also reorganized
3543         the queries by functionality to make them easier to find and edit.
3544
3545         (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices):
3546         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
3547         In order to properly take advantage of the INSERT OR IGNORE
3548         functionality, unique indices must be established so the SQLite table
3549         is aware of what patterns to look for when ignoring a new insert.
3550
3551         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndmakeDomainList):
3552         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
3553         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
3554         Looping through the domain list is no longer needed with the new query
3555         changes. Additionally, ensuring a domain is in the Observed Domains
3556         table of the database must be done before utilizing any inserting of 
3557         relationships because the relationship queries rely on fetching the
3558         topFrame domainID from the ObservedDomains table.
3559
3560         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
3561         (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
3562         (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
3563         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameDomain):
3564         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameDomain):
3565         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
3566         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
3567         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
3568         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
3569         With the ensure check being done once in the ensureAndmakeDomainList
3570         function, these functions no longer have to make that check before
3571         inserting.
3572         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
3573
3574         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3575         (WebKit::WebResourceLoadStatisticsStore::mergeStatisticForTesting):
3576         (WebKit::WebResourceLoadStatisticsStore::isRelationshipOnlyInDatabaseOnce):
3577         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3578         Changes in WeResourceLoadStatisticsStore were for testing only. This
3579         patch updated the merge statistic testing to also test this change by
3580         having a topFrameDomain list with more than one domain.
3581
3582         * NetworkProcess/NetworkProcess.cpp:
3583         (WebKit::NetworkProcess::mergeStatisticForTesting):
3584         (WebKit::NetworkProcess::isRelationshipOnlyInDatabaseOnce):
3585         * NetworkProcess/NetworkProcess.h:
3586         * NetworkProcess/NetworkProcess.messages.in:
3587         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3588         (WKWebsiteDataStoreSetStatisticsMergeStatistic):
3589         (WKWebsiteDataStoreIsStatisticsOnlyInDatabaseOnce):
3590         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3591         * UIProcess/Network/NetworkProcessProxy.cpp:
3592         (WebKit::NetworkProcessProxy::mergeStatisticForTesting):
3593         (WebKit::NetworkProcessProxy::isRelationshipOnlyInDatabaseOnce):
3594         * UIProcess/Network/NetworkProcessProxy.h:
3595         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3596         (WebKit::WebsiteDataStore::mergeStatisticForTesting):
3597         (WebKit::WebsiteDataStore::isRelationshipOnlyInDatabaseOnce):
3598         * UIProcess/WebsiteData/WebsiteDataStore.h:
3599         Added a new function for testing that there are no repeat inserts
3600         into the database. Updated mergeStatistics to test the list-insert
3601         functionality.
3602
3603 2019-10-07  Yusuke Suzuki  <ysuzuki@apple.com>
3604
3605         [JSC] Change signature of HostFunction to (JSGlobalObject*, CallFrame*)
3606         https://bugs.webkit.org/show_bug.cgi?id=202569
3607
3608         Reviewed by Saam Barati.
3609
3610         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3611         (WebKit::callMethod):
3612         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3613         (WebKit::callNPJSObject):
3614         (WebKit::constructWithConstructor):
3615         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
3616
3617 2019-10-07  Megan Gardner  <megan_gardner@apple.com>
3618
3619         Switch to WKShareSheet for WKPDFView
3620         https://bugs.webkit.org/show_bug.cgi?id=202338
3621
3622         Reviewed by Tim Horton.
3623
3624         Switch to WKShareSheet from the share sheet in UIWKSelectionAssistant, since this is the only instance
3625         of UIWKSelectionAssistant any more. This will keep all our share sheet code together, and allow
3626         us to eliminate this class that will be completely unused with this change.
3627
3628         * Platform/spi/ios/UIKitSPI.h:
3629         * UIProcess/ios/WKPDFView.h:
3630         * UIProcess/ios/WKPDFView.mm:
3631         (-[WKPDFView dealloc]):
3632         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
3633         (-[WKPDFView shareSheetDidDismiss:]):
3634
3635 2019-10-07  Per Arne Vollan  <pvollan@apple.com>
3636
3637         [macOS] Layering violation in AuxiliaryProcessProxy::didFinishLaunching
3638         https://bugs.webkit.org/show_bug.cgi?id=201617
3639
3640         Reviewed by Brent Fulgham.
3641
3642         The commit <https://trac.webkit.org/changeset/249649> introduced a layering violation in AuxiliaryProcessProxy::didFinishLaunching
3643         where we inspect the pending message queue looking for a local file load message which needs the PID to create a sandbox extension
3644         for the WebContent process. The layering violation can be fixed by creating a virtual method in AuxiliaryProcessProxy and override
3645         the method in the WebProcessProxy to do the work needed to replace the message with a load request message containing a sandbox
3646         extension created using the PID of the WebContent process. No new tests have been created, since this is covered by existing tests.
3647
3648         * UIProcess/AuxiliaryProcessProxy.cpp:
3649         (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
3650         * UIProcess/AuxiliaryProcessProxy.h:
3651         (WebKit::AuxiliaryProcessProxy::shouldSendPendingMessage):
3652         * UIProcess/WebProcessProxy.cpp:
3653         (WebKit::WebProcessProxy::shouldSendPendingMessage):
3654         * UIProcess/WebProcessProxy.h:
3655
3656 2019-10-07  Dean Jackson  <dino@apple.com>
3657
3658         Provide options for DTTZ to happen in more situations
3659         https://bugs.webkit.org/show_bug.cgi?id=202634
3660         <rdar://problem/55732762>
3661
3662         Reviewed by Antoine Quint.
3663
3664         Add two options that can be enabled to trigger double tap zooming 
3665         in more places.
3666
3667         Firstly, an option to keep listening for a double-tap-to-zoom if the
3668         first tap found a click handler on the body or document element. The
3669         tap will still be dispatched. This is probably the most common case
3670         for disabling a DTTZ.
3671
3672         Secondly, an option to always keep listening for a double-tap-to-zoom,
3673         even if there was a clickable (non-root) element under the first tap.
3674
3675         * Shared/WebPreferences.yaml: Add ZoomOnDoubleTapWhenRoot and AlwaysZoomOnDoubleTap.
3676         * UIProcess/PageClient.h: The message from the WebProcess now tells the UIProcess if
3677         the tapped element was a root-level (document or body).
3678         * UIProcess/WebPageProxy.h:
3679         * UIProcess/WebPageProxy.messages.in:
3680         * UIProcess/ios/PageClientImplIOS.h:
3681         * UIProcess/ios/PageClientImplIOS.mm:
3682         (WebKit::PageClientImpl::handleSmartMagnificationInformationForPotentialTap):
3683         * UIProcess/ios/WKContentViewInteraction.h:
3684         * UIProcess/ios/WKContentViewInteraction.mm:
3685         (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]):
3686         (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:nodeIsRootLevel:]):
3687         Handle the two new options.
3688
3689         * UIProcess/ios/WebPageProxyIOS.mm:
3690         (WebKit::WebPageProxy::handleSmartMagnificationInformationForPotentialTap):
3691         * WebProcess/WebPage/ios/WebPageIOS.mm:
3692         (WebKit::WebPage::potentialTapAtPosition): Check if the tap was on a root-level element.
3693
3694 2019-10-07  Matt Mokary  <mmokary@apple.com>
3695
3696         foundStringMatchIndex in FindController::findString gets reset on page scroll
3697         https://bugs.webkit.org/show_bug.cgi?id=201773
3698         <rdar://problem/55351892>
3699
3700         Reviewed by Tim Horton.
3701
3702         Decouple hiding of the find indicator from resetting match index, and only reset match index when there is not
3703         an active match.
3704
3705         * WebProcess/WebPage/FindController.cpp:
3706         (WebKit::FindController::updateFindUIAfterPageScroll):
3707         (WebKit::FindController::hideFindUI):
3708         (WebKit::FindController::hideFindIndicator):
3709         (WebKit::FindController::resetMatchIndex):
3710         * WebProcess/WebPage/FindController.h:
3711         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3712         (WebKit::FindController::hideFindIndicator):
3713         (WebKit::FindController::resetMatchIndex):
3714
3715 2019-10-07  youenn fablet  <youenn@apple.com>
3716
3717         WebPageProxy::updatePlayingMediaDidChange should protect from a null m_userMediaPermissionRequestManager
3718         https://bugs.webkit.org/show_bug.cgi?id=202628
3719         <rdar://problem/55935091>
3720
3721         Reviewed by Eric Carlson.
3722
3723         On process swap on navigation or process crash, m_userMediaPermissionRequestManager is made null.
3724         At the same time, the media state is set back to not playing.
3725         Future calls of updatePlayingMediaDidChange should not have any capture state change until getUserMedia/getDisplayMedia
3726         is called, which would create m_userMediaPermissionRequestManager.
3727         But this assumption is not always true given that the media state is computed as process-wide in MediaStreamTrack::captureState on iOS.
3728         The above behavior is fixed as part of https://bugs.webkit.org/show_bug.cgi?id=202627.
3729         Since the call to updatePlayingMediaDidChange is triggered straight from IPC, it should not be trusted and a null check should be added.
3730
3731         * UIProcess/WebPageProxy.cpp:
3732         (WebKit::WebPageProxy::updatePlayingMediaDidChange):
3733
3734 2019-10-04  Dean Jackson  <dino@apple.com>
3735
3736         Use a better name than allowFastClicksEverywhere
3737         https://bugs.webkit.org/show_bug.cgi?id=202607
3738         <rdar://problem/55997133>
3739
3740         Reviewed by Tim Horton.
3741
3742         This preference name is quite confusing. Change it to
3743         PreferFasterClickOverDoubleTap.
3744
3745         * Shared/WebPreferences.yaml:
3746         * Shared/WebPreferencesDefaultValues.h:
3747         * UIProcess/WebPageProxy.h:
3748         (WebKit::WebPageProxy::preferFasterClickOverDoubleTap const):
3749         (WebKit::WebPageProxy::allowsFastClicksEverywhere const): Deleted.
3750         * UIProcess/ios/WKContentViewInteraction.mm:
3751         (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
3752         * UIProcess/ios/WebPageProxyIOS.mm:
3753         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
3754
3755 2019-10-04  Ross Kirsling  <ross.kirsling@sony.com>
3756
3757         Socket-based RWI should base64-encode backend commands on client, not server
3758         https://bugs.webkit.org/show_bug.cgi?id=202605
3759
3760         Reviewed by Don Olmstead.
3761
3762         * UIProcess/socket/RemoteInspectorClient.cpp:
3763         (WebKit::RemoteInspectorClient::setBackendCommands):
3764
3765 2019-10-04  Jiewen Tan  <jiewen_tan@apple.com>
3766
3767         Unreviewed, build fix after r250729
3768
3769         * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
3770         * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h:
3771
3772 2019-10-04  Keith Rollin  <krollin@apple.com>
3773
3774         Fix determination of the top-level resource
3775         https://bugs.webkit.org/show_bug.cgi?id=202491
3776         <rdar://problem/50780648>
3777
3778         Reviewed by Youenn Fablet.
3779
3780         When loading the resources associated with a page, the Networking
3781         process needs to know the main resource for the main frame. It uses
3782         this information to keep track of page loads and the resources that
3783         are loaded in those pages. By keeping track of this information,
3784         WebKit can track and report difficult (slow or incomplete) resource
3785         loads and their impact on the overall page.
3786
3787         The initial determination of the top resource only looked at whether
3788         the resource was the "main" resource of a frame or not. However, this
3789         determination was insufficient, and would confuse the tracking
3790         mechanism when sub-frames also had main frames. Therefore, augment the
3791         test by also looking to see if the hosting frame is the main frame.
3792
3793         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3794         (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
3795         * NetworkProcess/NetworkConnectionToWebProcess.h:
3796         * NetworkProcess/NetworkResourceLoader.cpp:
3797         (WebKit::NetworkResourceLoader::start):
3798
3799 2019-10-04  Ross Kirsling  <ross.kirsling@sony.com>
3800
3801         Unreviewed WinCairo build fix for r250717.
3802
3803         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
3804         (WebKit::LayerTreeHost::invalidate): Deleted.
3805
3806 2019-10-04  Alex Christensen  <achristensen@webkit.org>
3807
3808         Stop sending list of display-isolated schemes to NetworkProcess
3809         https://bugs.webkit.org/show_bug.cgi?id=202557
3810
3811         Reviewed by Youenn Fablet.
3812
3813         * NetworkProcess/NetworkProcess.cpp:
3814         (WebKit::NetworkProcess::initializeNetworkProcess):
3815         (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const): Deleted.
3816         * NetworkProcess/NetworkProcess.h:
3817         * NetworkProcess/NetworkProcess.messages.in:
3818         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3819         (WebKit::NetworkProcessCreationParameters::encode const):
3820         (WebKit::NetworkProcessCreationParameters::decode):
3821         * NetworkProcess/NetworkProcessCreationParameters.h:
3822         * UIProcess/WebProcessPool.cpp:
3823         (WebKit::WebProcessPool::ensureNetworkProcess):
3824         (WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated):
3825
3826 2019-10-04  Alex Christensen  <achristensen@webkit.org>
3827
3828         Rename SchemeRegistry to LegacySchemeRegistry
3829         https://bugs.webkit.org/show_bug.cgi?id=202586
3830
3831         Reviewed by Tim Horton.
3832
3833         * NetworkProcess/NetworkLoadChecker.cpp:
3834         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
3835         * NetworkProcess/NetworkProcess.cpp:
3836         (WebKit::NetworkProcess::registerURLSchemeAsSecure const):
3837         (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
3838         (WebKit::NetworkProcess::registerURLSchemeAsLocal const):
3839         (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
3840         (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
3841         (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
3842         (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
3843         * Shared/AuxiliaryProcess.cpp:
3844         (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const):
3845         * UIProcess/API/Cocoa/WKWebView.mm:
3846         (+[WKWebView handlesURLScheme:]):
3847         * UIProcess/API/glib/WebKitSecurityManager.cpp:
3848         (registerSecurityPolicyForURIScheme):
3849         (checkSecurityPolicyForURIScheme):
3850         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3851         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
3852         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3853         (WebKit::WebServiceWorkerProvider::handleFetch):
3854         * WebProcess/WebPage/WebPage.cpp:
3855         (WebKit::WebPage::canHandleRequest):
3856         * WebProcess/WebProcess.cpp:
3857         (WebKit::WebProcess::registerURLSchemeAsEmptyDocument):
3858         (WebKit::WebProcess::registerURLSchemeAsSecure const):
3859         (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
3860         (WebKit::WebProcess::setDomainRelaxationForbiddenForURLScheme const):
3861         (WebKit::WebProcess::registerURLSchemeAsLocal const):
3862         (WebKit::WebProcess::registerURLSchemeAsNoAccess const):
3863         (WebKit::WebProcess::registerURLSchemeAsDisplayIsolated const):
3864         (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const):
3865         (WebKit::WebProcess::registerURLSchemeAsAlwaysRevalidated const):
3866         (WebKit::WebProcess::registerURLSchemeAsCachePartitioned const):
3867         (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
3868         * WebProcess/WebStorage/StorageAreaImpl.cpp:
3869
3870 2019-10-04  Jiewen Tan  <jiewen_tan@apple.com>
3871
3872         [WebAuthn] Implement _WKWebAuthenticationPanel SPI
3873         https://bugs.webkit.org/show_bug.cgi?id=202559
3874         <rdar://problem/55932094>
3875
3876         Reviewed by Brent Fulgham.
3877
3878         This patch implements _WKWebAuthenticationPanel SPI. Here is the structure:
3879         1) API::WebAuthenticationPanel is the APIObject of _WKWebAuthenticationPanel. It is owned by AuthenticatorManager.
3880         The lifetime of _WKWebAuthenticationPanel on the other hand is managed by clients. This binding is the surface
3881         where clients could interact with WebKit's WebAuthentication implementation.
3882         2) API::WebAuthenticationPanelClient is a base class representing _WKWebAuthenticationPanelDelegate. Its subclass
3883         WebKit::WebAuthenticationPanelClient implements bridges to _WKWebAuthenticationPanelDelegate methods. It is owned by
3884         API::WebAuthenticationPanel. A weak pointer of WebKit::WebAuthenticationPanelClient is kept in _WKWebAuthenticationPanel
3885         to get the _WKWebAuthenticationPanelDelegate set by clients or nil otherwise. This binding is the surface where WebKit
3886         interacts with clients.
3887         3) WebAuthenticationPanelFlags is the mirror of enums within _WKWebAuthenticationPanel.
3888
3889         Implementation wise, this patch implements:
3890         1) -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:], this is bridged from
3891         the regular UIDelegate route. Noted, WKFrameInfo is nil for now, a follow up on Bug 202563 will take care of it. This
3892         will be called from AuthenticatorManager::runPanel() which gates the start of discovery on the callback. For clients
3893         that don't implement the delegate, the callback will always be called with _WKWebAuthenticationPanelResultUnavailable
3894         to allow WebKit run on non-UI mode. A specific C API hack is added to always return _WKWebAuthenticationPanelResultPresented
3895         in WebKitTestRunner for layout tests.
3896         2) -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] will be implemented in Bug 200932.
3897         3) -[_WKWebAuthenticationPanelDelegate panel:dismissWebAuthenticationPanelWithResult:], this is bridged from
3898         API::WebAuthenticationPanel/API::WebAuthenticationPanelClient. This will be called whenever AuthenticatorManager::m_pendingCompletionHandler
3899         is invoked. Depending on the respond, _WKWebAuthenticationResult will be returned accordingly. To facilitate that,
3900         invokePendingCompletionHandler is crafted to bundle those two operations.
3901         4) -[_WKWebAuthenticationPanel cancel] will be implemented in Bug 191523.
3902
3903         Besides the above, this patch also silents the NFC action sheet.
3904
3905         * Platform/spi/Cocoa/NearFieldSPI.h:
3906         * Shared/API/APIObject.h:
3907         * Shared/Cocoa/APIObject.mm:
3908         (API::Object::newObject):
3909         * Sources.txt:
3910         * SourcesCocoa.txt:
3911         * UIProcess/API/APIUIClient.h:
3912         (API::UIClient::runWebAuthenticationPanel):
3913         * UIProcess/API/APIWebAuthenticationPanel.cpp: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm.
3914         (API::WebAuthenticationPanel::create):
3915         (API::WebAuthenticationPanel::WebAuthenticationPanel):
3916         (API::WebAuthenticationPanel::setClient):
3917         * UIProcess/API/APIWebAuthenticationPanel.h: Copied from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h.
3918         * UIProcess/API/APIWebAuthenticationPanelClient.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h.
3919         (API::WebAuthenticationPanelClient::dismissPanel const):
3920         * UIProcess/API/C/WKPage.cpp:
3921         (WKPageSetPageUIClient):
3922         * UIProcess/API/C/WKPageUIClient.h:
3923         * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
3924         (-[_WKWebAuthenticationPanel dealloc]):
3925         (-[_WKWebAuthenticationPanel relyingPartyID]):
3926         (-[_WKWebAuthenticationPanel delegate]):
3927         (-[_WKWebAuthenticationPanel setDelegate:]):
3928         (-[_WKWebAuthenticationPanel _apiObject]):
3929         (-[_WKWebAuthenticationPanel _initWithRelayingPartyID:]): Deleted.
3930         * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h:
3931         * UIProcess/Cocoa/UIDelegate.h:
3932         * UIProcess/Cocoa/UIDelegate.mm:
3933         (WebKit::UIDelegate::setDelegate):
3934         (WebKit::webAuthenticationPanelResult):
3935         (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel):
3936         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
3937         (WebKit::WebCore::isFeatureEnabled):
3938         (WebKit::WebCore::getRpId):
3939         (WebKit::AuthenticatorManager::handleRequest):
3940         (WebKit::AuthenticatorManager::respondReceived):
3941         (WebKit::AuthenticatorManager::startDiscovery):
3942         (WebKit::AuthenticatorManager::initTimeOutTimer):
3943         (WebKit::AuthenticatorManager::timeOutTimerFired):
3944         (WebKit::AuthenticatorManager::runPanel):
3945         (WebKit::AuthenticatorManager::startRequest):
3946         (WebKit::AuthenticatorManager::invokePendingCompletionHandler):
3947         (WebKit::AuthenticatorManagerInternal::collectTransports): Deleted.
3948         (WebKit::AuthenticatorManagerInternal::processGoogleLegacyAppIdSupportExtension): Deleted.
3949         * UIProcess/WebAuthentication/AuthenticatorManager.h:
3950         (WebKit::AuthenticatorManager::pendingCompletionHandler): Deleted.
3951         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
3952         (WebKit::NfcConnection::NfcConnection):
3953         * UIProcess/WebAuthentication/Cocoa/NfcService.mm:
3954         (WebKit::NfcService::platformStartDiscovery):
3955         * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: Copied from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h.
3956         * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp.
3957         (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
3958         (WebKit::wkWebAuthenticationResult):
3959         (WebKit::WebAuthenticationPanelClient::dismissPanel const):
3960         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
3961         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
3962         * UIProcess/WebAuthentication/WebAuthenticationPanelFlags.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h.
3963         * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
3964         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
3965         (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
3966         (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
3967         * WebKit.xcodeproj/project.pbxproj:
3968
3969 2019-10-04  Alex Christensen  <achristensen@webkit.org>
3970
3971         Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration
3972         https://bugs.webkit.org/show_bug.cgi?id=202553
3973
3974         Reviewed by Youenn Fablet.
3975
3976         It was only used for testing, and all the tests that use it still pass with the new SPI.