[Mac] WebInspectorUI.framework does not need to be soft-linked anymore
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-02-14  Brian Burg  <bburg@apple.com>
2
3         [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
4         https://bugs.webkit.org/show_bug.cgi?id=194411
5         <rdar://problem/47787614>
6
7         Reviewed by Joseph Pecoraro.
8
9         * Configurations/WebKit.xcconfig:
10         Conditionalize weak linking to WebInspectorUI.framework for Mac only.
11
12         * UIProcess/mac/WebInspectorProxyMac.mm:
13         (WebKit::WebInspectorProxy::inspectorPageURL):
14         (WebKit::WebInspectorProxy::inspectorTestPageURL):
15         (WebKit::WebInspectorProxy::inspectorBaseURL):
16         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
17         (WebKit::webInspectorUILocalizedStringsURL):
18         Rewrite uses of the bundle to exit early if bundle couldn't be loaded.
19
20 2019-02-14  Michael Catanzaro  <mcatanzaro@igalia.com>
21
22         [GTK] WebKitGTK+ -> WebKitGTK
23         https://bugs.webkit.org/show_bug.cgi?id=194658
24
25         Reviewed by Alex Christensen.
26
27         This renames WebKitGTK+ to WebKitGTK in a few user-visible places: the API documentation,
28         the pkg-config, and an error message.
29
30         In a couple places where it's exposed in WPE documentation, WPE is now mentioned, or the
31         reference to "WebKitGTK+" is changed to just "WebKit."
32
33         * UIProcess/API/glib/WebKitSettings.cpp:
34         (webkit_settings_class_init):
35         * UIProcess/API/glib/WebKitWebView.cpp:
36         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
37         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h:
38         * gtk/webkit2gtk-web-extension.pc.in:
39         * gtk/webkit2gtk.pc.in:
40
41 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
42
43         [WTF] Add environment variable helpers
44         https://bugs.webkit.org/show_bug.cgi?id=192405
45
46         Reviewed by Michael Catanzaro.
47
48         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
49         (main):
50         * Platform/unix/EnvironmentUtilities.cpp:
51         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
52         * Platform/unix/LoggingUnix.cpp:
53         (WebKit::logLevelString):
54         * Platform/win/LoggingWin.cpp:
55         (WebKit::logLevelString):
56         * PluginProcess/mac/PluginProcessMac.mm:
57         (WebKit::shouldCallRealDebugger):
58         * Shared/Plugins/unix/PluginSearchPath.cpp:
59         (WebKit::pluginsDirectories):
60         * Shared/glib/ProcessExecutablePathGLib.cpp:
61         (WebKit::findWebKitProcess):
62         * UIProcess/API/glib/WebKitSettings.cpp:
63         (webKitSettingsConstructed):
64         (webKitSettingsSetProperty):
65         * UIProcess/API/glib/WebKitWebContext.cpp:
66         (injectedBundleDirectory):
67         (webkitWebContextConstructed):
68         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
69         (webkitWebViewMaximizeWindow):
70         (webkitWebViewRestoreWindow):
71         * UIProcess/API/wpe/WPEView.cpp:
72         (WKWPE::m_backend):
73         * UIProcess/AuxiliaryProcessProxy.cpp:
74         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
75         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
76         (WebKit::XDGDBusProxyLauncher::launch):
77         (WebKit::bindDBusSession):
78         (WebKit::bindX11):
79         (WebKit::bindWayland):
80         (WebKit::bindPulse):
81         (WebKit::bindPathVar):
82         (WebKit::bindGStreamerData):
83         (WebKit::bubblewrapSpawn):
84         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
85         (WebKit::ProcessLauncher::launchProcess):
86         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
87         (WebKit::systemDirectoryPath):
88         (WebKit::ProcessLauncher::launchProcess):
89         * UIProcess/glib/WebProcessPoolGLib.cpp:
90         (WebKit::memoryPressureMonitorDisabled):
91         (WebKit::WebProcessPool::platformInitialize):
92         (WebKit::WebProcessPool::platformInitializeWebProcess):
93         * UIProcess/gtk/HardwareAccelerationManager.cpp:
94         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
95         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
96         (main):
97         * WebProcess/gtk/WebProcessMainGtk.cpp:
98         * WebProcess/wpe/WebProcessMainWPE.cpp:
99         Utilize WTF::Environment where possible.
100
101 2019-02-14  Jiewen Tan  <jiewen_tan@apple.com>
102
103         Handle _WKNavigationActionPolicyAllowWithoutTryingAppLink for LoadOptimizer
104         https://bugs.webkit.org/show_bug.cgi?id=194640
105         <rdar://problem/48064140>
106
107         Reviewed by Brent Fulgham.
108
109         * UIProcess/Cocoa/NavigationState.mm:
110         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
111
112 2019-02-14  Chris Dumez  <cdumez@apple.com>
113
114         [PSON] Introduce a WebContent Process cache
115         https://bugs.webkit.org/show_bug.cgi?id=194594
116         <rdar://problem/46793397>
117
118         Reviewed by Geoff Garen.
119
120         Introduce a WebContent Process cache to reduce the number of process launches when
121         process swap on navigation is enabled, and to reduce the power cost of the feature.
122
123         If a WebProcess loaded pages from a single registrable domain then it is eligible
124         for the cache. When process-swapping on navigation to a new registrable domain, we
125         now attempt to retrieve a process from the cache for the domain in question instead
126         of always launching a new one.
127
128         The WebProcess cache currently has the following attributes:
129         - It may contains 4 processes per GB of RAM the machine has, up to 30 processes.
130         - WebProcesses automatically get evicted from the cache after 30 minutes.
131         - If the application is no longer the active app, then the cache will get cleared
132           after 5 minutes.
133         - WebProcesses that are in the cache are reported as "(Cached)" in Activity Monitor.
134
135         The WebProcess cache is currently disabled by default and can by enabled by the
136         client via SPI.
137
138         * Shared/WebBackForwardListItem.cpp:
139         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
140         * Shared/WebBackForwardListItem.h:
141         (WebKit::WebBackForwardListItem::lastProcessIdentifier const):
142         (WebKit::WebBackForwardListItem::setLastProcessIdentifier):
143         Add new lastProcessIdentifier data member that reflects which process this item
144         was last loaded in. It is normally identical to the identifier of the process
145         that created the item but it gets overriden in case of cross-site client-side
146         redirect, since a new process takes over the item in this case.
147
148         * Sources.txt:
149         Add new source file.
150
151         * UIProcess/API/APIProcessPoolConfiguration.cpp:
152         (API::ProcessPoolConfiguration::copy):
153         * UIProcess/API/APIProcessPoolConfiguration.h:
154         * UIProcess/API/C/WKContextConfigurationRef.cpp:
155         (WKContextConfigurationUsesWebProcessCache):
156         (WKContextConfigurationSetUsesWebProcessCache):
157         * UIProcess/API/C/WKContextConfigurationRef.h:
158         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
159         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
160         (-[_WKProcessPoolConfiguration setUsesWebProcessCache:]):
161         (-[_WKProcessPoolConfiguration usesWebProcessCache]):
162         Add new SPI to enable the WebProcess cache.
163
164         * UIProcess/API/Cocoa/WKProcessPool.mm:
165         (-[WKProcessPool _webProcessCountIgnoringPrewarmedAndCached]):
166         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
167         Add new SPI for testing which returns the number of WebProcesses ignoring
168         both prewarmed and cached ones.
169
170         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
171         (WebKit::WebProcessPool::registerNotificationObservers):
172         (WebKit::WebProcessPool::unregisterNotificationObservers):
173         Add application active state observers as the WebProcess cache gets cleared
174         when the application resigns active state for more than 5 minutes.
175
176         * UIProcess/ProvisionalPageProxy.cpp:
177         (WebKit::ProvisionalPageProxy::loadRequest):
178         When doing a load in a new process with the BackForwardList locked (i.e. client-side
179         redirect), make sure we update the last process identifier for the BackForwardListItem.
180         This is important because the logic in WebProcessPool::processForNavigation() relies on
181         this identifier to select which process to do the history navigation into, and we want
182         to do the load in the post-redirect process, not the pre-redirect one.
183
184         * UIProcess/WebPageProxy.cpp:
185         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
186         Tell the WebProcess whenever a main frame provisional load is started, providing the URL.
187
188         * UIProcess/WebProcessCache.cpp: Added.
189         (WebKit::WebProcessCache::WebProcessCache):
190         (WebKit::WebProcessCache::addProcess):
191         (WebKit::WebProcessCache::takeProcess):
192         (WebKit::WebProcessCache::updateMaximumSize):
193         (WebKit::WebProcessCache::clear):
194         (WebKit::WebProcessCache::setApplicationIsActive):
195         (WebKit::WebProcessCache::evictProcess):
196         (WebKit::WebProcessCache::CachedProcess::CachedProcess):
197         (WebKit::WebProcessCache::CachedProcess::~CachedProcess):
198         (WebKit::WebProcessCache::CachedProcess::takeProcess):
199         (WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
200         * UIProcess/WebProcessCache.h: Added.
201         (WebKit::WebProcessCache::maximumSize):
202         (WebKit::WebProcessCache::size const):
203         (WebKit::WebProcessCache::CachedProcess::process):
204         Add process cache implementation.
205
206         * UIProcess/WebProcessPool.cpp:
207         (WebKit::m_webProcessCache):
208         WebProcessCache is stored on the WebProcessPool via m_webProcessCache data member.
209
210         (WebKit::WebProcessPool::~WebProcessPool):
211         Clear the WebProcess cache in the destructor.
212
213         (WebKit::WebProcessPool::setApplicationIsActive):
214         Notify the WebProcessCache whenever the application's active state changes.
215
216         (WebKit::WebProcessPool::createWebPage):
217         If the state of PSON changes via the experimental features menu, dynamically
218         update the WebProcessCache's size. This is needed because the cache is disabled
219         when PSON is disabled.
220
221         (WebKit::WebProcessPool::handleMemoryPressureWarning):
222         Clear the WebProcess cache on memory pressure.
223
224         (WebKit::WebProcessPool::processForNavigationInternal):
225         Query the WebProcessCache before attempting to create a new WebProcess for a cross-site
226         navigation.
227
228         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
229         This logic was split out of processForNavigationInternal() to reduce the size
230         of the method.
231
232         * UIProcess/WebProcessPool.h:
233         * UIProcess/WebProcessProxy.cpp:
234         (WebKit::WebProcessProxy::setIsInProcessCache):
235         Update the isInProcessCache flag on the WebProcessProxy and send an IPC to the WebContent
236         process so that it can update its name in Activity Monitor.
237         We also need to stop holding a strong reference to the WebProcessPool whenever the process
238         is in the cache, similarly to what we do for pre-warmed processes, given that such processes
239         should not keep the process pool alive.
240
241         (WebKit::WebProcessProxy::addExistingWebPage):
242         Assert that we never try to add a page to a cached process, it should be taken out of the
243         cache before use.
244
245         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
246         (WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const):
247         (WebKit::WebProcessProxy::updateBackForwardItem):
248         In case of client-side redirects, the previous process would sometimes send an IPC causing
249         the UIProcess' backforward list item to get updated with the pre-redirect URL after we've
250         already redirected. This previously would be unlikely to occur because we do not suspend
251         client-redirect pages and their process would normally exit before getting a chance to send
252         the IPC. However, with the process cache, the bug became obvious as the process would stay
253         alive and send up the "bad" IPC. To address the issue, we now only let the IPC update the
254         item if the item's page is (still) associated with the process. In the future, we may want
255         to update the IPC so that it gets sent to the WebPageProxy instead of the WebProcessProxy.
256
257         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
258         If a cached WebProcess crashes, remove it from the cache so that we do not attempt to use
259         it for a load later.
260
261         (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
262         Only cache WebProcesses that have loaded a single registrable domain. Also prevent caching
263         for service worker and inspector processes.
264
265         (WebKit::WebProcessProxy::maybeShutDown):
266         If the process is cacheable, add it to the cache instead of shutting it down right away.
267
268         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
269         Make sure we do not attempt to terminate a processes that is in the cache.
270
271         (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
272         Whenever a main frame provisional load starts, make sure we update the process's associated
273         registrable domain. nullopt indicates that there is no associated domain yet. Null string
274         indicates that the process is associated with several registrable domain and is therefore
275         not eligible for caching.
276
277         * UIProcess/WebProcessProxy.h:
278         (WebKit::WebProcessProxy::registrableDomain const):
279         (WebKit::WebProcessProxy::isInProcessCache const):
280         (WebKit::WebProcessProxy::provisionalPageCount const):
281         Add convenience getters.
282
283         * WebKit.xcodeproj/project.pbxproj:
284         Add new files to project.
285
286         * WebProcess/WebProcess.cpp:
287         (WebKit::WebProcess::setIsInProcessCache):
288         * WebProcess/WebProcess.h:
289         * WebProcess/WebProcess.messages.in:
290         * WebProcess/cocoa/WebProcessCocoa.mm:
291         (WebKit::WebProcess::updateProcessName):
292         Update the WebProcess' name in Activity Monitor whenever it goes into or out of the WebProcess
293         cache.
294
295 2019-02-14  Per Arne Vollan  <pvollan@apple.com>
296
297         [iOS] Open sandbox for certain calls.
298         https://bugs.webkit.org/show_bug.cgi?id=194626
299
300         Reviewed by Brent Fulgham.
301
302         Reporting shows that certain calls needs to be allowed in the sandbox.
303
304         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
305
306 2019-02-14  Chris Fleizach  <cfleizach@apple.com>
307
308         AX: ARIA Reflection was disabled in error
309         https://bugs.webkit.org/show_bug.cgi?id=194647
310         <rdar://problem/48068336>
311
312         Reviewed by Ryosuke Niwa.
313
314         * Shared/WebPreferences.yaml:
315
316 2019-02-14  Commit Queue  <commit-queue@webkit.org>
317
318         Unreviewed, rolling out r241486.
319         https://bugs.webkit.org/show_bug.cgi?id=194655
320
321         causing API failures in builds (Requested by ShawnRoberts on
322         #webkit).
323
324         Reverted changeset:
325
326         "[Cocoa] Media elements will restart network buffering just
327         before suspending"
328         https://bugs.webkit.org/show_bug.cgi?id=193691
329         https://trac.webkit.org/changeset/241486
330
331 2019-02-14  Youenn Fablet  <youenn@apple.com>
332
333         Do not add a caches to its engine if the salt cannot be initialized
334         https://bugs.webkit.org/show_bug.cgi?id=194604
335
336         Reviewed by Antti Koivisto.
337
338         This is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=194588.
339         We should return early if initialize fails.
340
341         * NetworkProcess/cache/CacheStorageEngine.cpp:
342         (WebKit::CacheStorage::Engine::readCachesFromDisk):
343
344 2019-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
345
346         [GTK] Use a scrolled window for script alerts text
347         https://bugs.webkit.org/show_bug.cgi?id=184875
348
349         Reviewed by Michael Catanzaro.
350
351         To ensure long text doesn't make the dialog bigger.
352
353         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
354         (webkitScriptDialogImplConstructed): Use PANGO_ELLIPSIZE_END for the title and add a scrolled window for the body.
355         (webkitScriptDialogImplSetText): Helper function to set the dialog body, ensuring the scrolled window fills the
356         dialog available size.
357         (webkitScriptDialogImplNew): It now receives the maximum size and uses webkitScriptDialogImplSetText().
358         * UIProcess/API/gtk/WebKitScriptDialogImpl.h:
359         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
360         (webkitWebViewScriptDialog): Pass the 80% of the web view size as the maximum size of script dialogs.
361
362 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
363
364         Crash in WKBundleFrameGetParentFrame when called inside didRemoveFrameFromHierarchy
365         https://bugs.webkit.org/show_bug.cgi?id=194641
366
367         Reviewed by Geoffrey Garen.
368
369         Fixed the bug by adding a null check to WebFrame::parentFrame.
370
371         * WebProcess/WebPage/WebFrame.cpp:
372         (WebKit::WebFrame::parentFrame const):
373
374 2019-02-13  Timothy Hatcher  <timothy@apple.com>
375
376         Allow some deprecations in WKDrawingView.
377         https://bugs.webkit.org/show_bug.cgi?id=194636
378
379         Reviewed by Wenson Hsieh.
380
381         * UIProcess/ios/WKDrawingView.mm:
382         (-[WKDrawingView PNGRepresentation]):
383         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
384         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
385         (-[WKDrawingView didChangeInk:]):
386
387 2019-02-13  Jer Noble  <jer.noble@apple.com>
388
389         [Cocoa] Media elements will restart network buffering just before suspending
390         https://bugs.webkit.org/show_bug.cgi?id=193691
391
392         Reviewed by Eric Carlson.
393
394         When the WebProcess receives a notification that the process is about to become
395         suspended, it tells the MemoryPressureHandler to release all critical memory. This
396         has the side effect of causing AVFoundation-backed media elements to dump their
397         in-memory caches and start downloading media data again. Instead, media elements
398         should all stop buffering media data during suspension. Add new testing SPI to
399         simulate suspension and resume messages.
400
401         * UIProcess/API/Cocoa/WKWebView.mm:
402         (-[WKWebView _processWillSuspendImminentlyForTesting]):
403         (-[WKWebView _processDidResumeForTesting]):
404         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
405         * UIProcess/WebProcessProxy.h:
406         * UIProcess/ios/WKInkPickerView.mm:
407         * WebProcess/WebPage/WebPage.cpp:
408         (WebKit::WebPage::suspendAllMediaBuffering):
409         (WebKit::WebPage::resumeAllMediaBuffering):
410         * WebProcess/WebPage/WebPage.h:
411         * WebProcess/WebProcess.cpp:
412         (WebKit::WebProcess::actualPrepareToSuspend):
413         (WebKit::WebProcess::cancelPrepareToSuspend):
414         (WebKit::WebProcess::processDidResume):
415         (WebKit::WebProcess::suspendAllMediaBuffering):
416         (WebKit::WebProcess::resumeAllMediaBuffering):
417         * WebProcess/WebProcess.h:
418
419 2019-02-13  Per Arne Vollan  <pvollan@apple.com>
420
421         [iOS] Fix sandbox violation during media playback
422         https://bugs.webkit.org/show_bug.cgi?id=194616
423         <rdar://problem/48049264>
424
425         Reviewed by Brent Fulgham.
426
427         Mach lookup to "com.apple.coremedia.figcontentkeysession.xpc" should be allowed.
428
429         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
430
431 2019-02-13  Tim Horton  <timothy_horton@apple.com>
432
433         Encrypted PDFs inside <embed> or <object> crash the Web Content process
434         https://bugs.webkit.org/show_bug.cgi?id=194605
435         <rdar://problem/19894818>
436
437         Reviewed by Andy Estes.
438
439         * WebProcess/Plugins/PDF/PDFPlugin.mm:
440         (WebKit::PDFPlugin::createPasswordEntryForm):
441         Don't try to create a password form field if we can't make form fields.
442
443         This means you will be left with a useless embedded PDF, but at least
444         the Web Content process won't crash.
445
446         We'll need to find an alternative implementation of PDF embedded form
447         fields that is compatible with <embed> and <object> if we want to support
448         this. Currently we piggy-back off the fact that we can just insert
449         <input>s into the PluginDocument's DOM, but we can't do that if there
450         is no PluginDocument, just a main document, like in the <embed> case.
451
452 2019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
453
454         Further restricting webarchive loads
455         https://bugs.webkit.org/show_bug.cgi?id=194567
456         <rdar://problem/47610130>
457
458         Reviewed by Youenn Fablet.
459
460         * WebProcess/WebPage/WebPage.cpp:
461         (WebKit::WebPage::loadRequest):
462         Set a flag to indicate a load is started from clients.
463
464 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
465
466         [WPE][GTK] Merge WebProcessPoolWPE.cpp and WebProcessPoolGtk.cpp
467         https://bugs.webkit.org/show_bug.cgi?id=194551
468
469         Reviewed by Carlos Garcia Campos.
470
471         * SourcesGTK.txt:
472         * SourcesWPE.txt:
473         * UIProcess/glib/WebProcessPoolGLib.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp.
474         (WebKit::initializeRemoteInspectorServer):
475         (WebKit::memoryPressureMonitorDisabled):
476         (WebKit::WebProcessPool::platformInitialize):
477         (WebKit::WebProcessPool::platformInitializeWebProcess):
478         (WebKit::WebProcessPool::platformInvalidateContext):
479         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
480         * UIProcess/wpe/WebProcessPoolWPE.cpp: Removed.
481
482 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
483
484         Fix -Wformat warning from r241401
485         https://bugs.webkit.org/show_bug.cgi?id=194584
486         <rdar://problem/47761293>
487
488         * WebProcess/WebPage/WebPage.cpp:
489         (WebKit::WebPage::setActivityState):
490
491 2019-02-13  Youenn Fablet  <youenn@apple.com>
492
493         Make WebRTCUnifiedPlanEnabled true by default
494         https://bugs.webkit.org/show_bug.cgi?id=194595
495
496         Reviewed by Eric Carlson.
497
498         * Shared/WebPreferences.yaml:
499
500 2019-02-13  John Wilander  <wilander@apple.com>
501
502         Store Ad Click Attribution requests in the network process
503         https://bugs.webkit.org/show_bug.cgi?id=194510
504         <rdar://problem/47650118>
505
506         Reviewed by Alex Christensen and Daniel Bates.
507
508         With this patch, WebPageProxy::didCommitLoadForFrame() now looks for
509         an AdClickAttribution object in its navigation state. If there is an
510         attribution, it sends it to the network process where the 
511         WebKit::NetworkSession stores it in an object of a new class,
512         WebKit::NetworkAdClickAttribution.
513
514         This patch also covers test infrastructure to support two new
515         TestRunner functions:
516         - dumpAdClickAttribution()
517         - clearAdClickAttribution()
518
519         * NetworkProcess/Cookies/WebCookieManager.cpp:
520             Added missing header include.
521         * NetworkProcess/Downloads/DownloadManager.cpp:
522             Added missing header include.
523         * NetworkProcess/NetworkAdClickAttribution.cpp: Added.
524         (WebKit::NetworkAdClickAttribution::ensureDestinationMapForSource):
525         (WebKit::NetworkAdClickAttribution::store):
526         (WebKit::NetworkAdClickAttribution::clear):
527         (WebKit::NetworkAdClickAttribution::toString const):
528         * NetworkProcess/NetworkAdClickAttribution.h: Added.
529             Stores WebCore::AdClickAttribution objects in a map structure.
530         * NetworkProcess/NetworkLoad.cpp:
531             Added missing header includes.
532         * NetworkProcess/NetworkProcess.cpp:
533         (WebKit::NetworkProcess::storeAdClickAttribution):
534         (WebKit::NetworkProcess::dumpAdClickAttribution):
535         (WebKit::NetworkProcess::clearAdClickAttribution):
536         * NetworkProcess/NetworkProcess.h:
537         * NetworkProcess/NetworkProcess.messages.in:
538         * NetworkProcess/NetworkSession.cpp:
539         (WebKit::NetworkSession::NetworkSession):
540         (WebKit::NetworkSession::storeAdClickAttribution):
541         (WebKit::NetworkSession::dumpAdClickAttribution):
542         (WebKit::NetworkSession::clearAdClickAttribution):
543         * NetworkProcess/NetworkSession.h:
544         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
545             Added missing header include.
546         * Sources.txt:
547             Added NetworkProcess/NetworkAdClickAttribution.cpp.
548         * UIProcess/API/APINavigation.h:
549         (API::Navigation::adClickAttribution const):
550         * UIProcess/API/C/WKPage.cpp:
551         (WKPageDumpAdClickAttribution):
552         (WKPageClearAdClickAttribution):
553             Test infrastructure.
554         * UIProcess/API/C/WKPagePrivate.h:
555         * UIProcess/Network/NetworkProcessProxy.cpp:
556         (WebKit::NetworkProcessProxy::dumpAdClickAttribution):
557         (WebKit::NetworkProcessProxy::clearAdClickAttribution):
558             Test infrastructure.
559         * UIProcess/Network/NetworkProcessProxy.h:
560         * UIProcess/WebPageProxy.cpp:
561         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
562             This is where pending Ad Click Attributions are forwarded to the
563             network process.
564         (WebKit::WebPageProxy::dumpAdClickAttribution):
565         (WebKit::WebPageProxy::clearAdClickAttribution):
566             Test infrastructure.
567         * UIProcess/WebPageProxy.h:
568         * UIProcess/WebProcessPool.cpp:
569         (WebKit::WebProcessPool::dumpAdClickAttribution):
570         (WebKit::WebProcessPool::clearAdClickAttribution):
571             Test infrastructure.
572         * UIProcess/WebProcessPool.h:
573         * WebKit.xcodeproj/project.pbxproj:
574         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
575         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
576             Added missing data copying from navigationAction to navigationActionData.
577
578 2019-02-13  Antti Koivisto  <antti@apple.com>
579
580         Crash in WebKit::CacheStorage::Engine::cachesRootPath
581         https://bugs.webkit.org/show_bug.cgi?id=194588
582         <rdar://problem/46363997>
583
584         Reviewed by Youenn Fablet.
585
586         * NetworkProcess/cache/CacheStorageEngine.cpp:
587         (WebKit::CacheStorage::Engine::cachesRootPath):
588
589         Salt may have not been initialized yet when the Engine is destroyed.
590
591 2019-02-13  Alex Christensen  <achristensen@webkit.org>
592
593         Remove legacy sync messaging in some IPC code
594         https://bugs.webkit.org/show_bug.cgi?id=194561
595
596         Reviewed by Geoffrey Garen.
597
598         Changing some LegacySync messages to Delayed messages.  We should probably rename Delayed to Sync.
599         There are too many ways to send messages.  Let's work to get rid of the old one.
600
601         * NetworkProcess/NetworkProcess.cpp:
602         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
603         (WebKit::NetworkProcess::processWillSuspendImminently):
604         * NetworkProcess/NetworkProcess.h:
605         * NetworkProcess/NetworkProcess.messages.in:
606         * PluginProcess/PluginControllerProxy.cpp:
607         (WebKit::PluginControllerProxy::handleWheelEvent):
608         (WebKit::PluginControllerProxy::handleMouseEnterEvent):
609         (WebKit::PluginControllerProxy::handleMouseLeaveEvent):
610         (WebKit::PluginControllerProxy::handleKeyboardEvent):
611         (WebKit::PluginControllerProxy::handleEditingCommand):
612         (WebKit::PluginControllerProxy::isEditingCommandEnabled):
613         (WebKit::PluginControllerProxy::handlesPageScaleFactor):
614         (WebKit::PluginControllerProxy::requiresUnifiedScaleFactor):
615         (WebKit::PluginControllerProxy::paintEntirePlugin):
616         (WebKit::PluginControllerProxy::supportsSnapshotting):
617         (WebKit::PluginControllerProxy::snapshot):
618         (WebKit::PluginControllerProxy::getPluginScriptableNPObject):
619         (WebKit::PluginControllerProxy::getFormValue):
620         * PluginProcess/PluginControllerProxy.h:
621         * PluginProcess/PluginControllerProxy.messages.in:
622         * Shared/Plugins/NPObjectMessageReceiver.cpp:
623         (WebKit::NPObjectMessageReceiver::deallocate):
624         (WebKit::NPObjectMessageReceiver::hasMethod):
625         (WebKit::NPObjectMessageReceiver::invoke):
626         (WebKit::NPObjectMessageReceiver::invokeDefault):
627         (WebKit::NPObjectMessageReceiver::hasProperty):
628         (WebKit::NPObjectMessageReceiver::getProperty):
629         (WebKit::NPObjectMessageReceiver::setProperty):
630         (WebKit::NPObjectMessageReceiver::removeProperty):
631         (WebKit::NPObjectMessageReceiver::enumerate):
632         (WebKit::NPObjectMessageReceiver::construct):
633         * Shared/Plugins/NPObjectMessageReceiver.h:
634         * Shared/Plugins/NPObjectMessageReceiver.messages.in:
635         * UIProcess/mac/SecItemShimProxy.cpp:
636         (WebKit::SecItemShimProxy::secItemRequest):
637         * UIProcess/mac/SecItemShimProxy.h:
638         * UIProcess/mac/SecItemShimProxy.messages.in:
639
640 2019-02-13  Truitt Savell  <tsavell@apple.com>
641
642         Unreviewed, rolling out r241433.
643
644         Broke internal builds.
645
646         Reverted changeset:
647
648         "Move
649         UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to
650         SPI"
651         https://bugs.webkit.org/show_bug.cgi?id=194531
652         https://trac.webkit.org/changeset/241433
653
654 2019-02-12  Antoine Quint  <graouts@apple.com>
655
656         Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
657         https://bugs.webkit.org/show_bug.cgi?id=194531
658         <rdar://problem/47714562>
659
660         Reviewed by Dean Jackson.
661
662         * Platform/spi/ios/UIKitSPI.h:
663         * UIProcess/ios/WKContentViewInteraction.mm:
664         (-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call
665         to respondsToSelector until the SPI has shipped for OpenSource builds to work.
666
667 2019-02-13  Antoine Quint  <graouts@apple.com>
668
669         Support simulated mouse events on iOS based on a PlatformTouchEvent
670         https://bugs.webkit.org/show_bug.cgi?id=194501
671         <rdar://problem/46910790>
672
673         Reviewed by Dean Jackson.
674
675         Add two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and whether
676         simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. We also ensure
677         that we correctly create touch tracking regions for mouse events.
678
679         * Shared/WebPreferences.yaml:
680         * UIProcess/WebPageProxy.cpp:
681         (WebKit::WebPageProxy::updateTouchEventTracking):
682
683 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
684
685         Crash in Page::setActivityState because m_page is null
686         https://bugs.webkit.org/show_bug.cgi?id=194584
687
688         Reviewed by Antti Koivisto.
689
690         Add a null check to avoid the crash. Also add a debug assertion to help diagnose this in the future.
691
692         * WebProcess/WebPage/WebPage.cpp:
693         (WebKit::WebPage::setActivityState):
694
695 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
696
697         Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
698         https://bugs.webkit.org/show_bug.cgi?id=194582
699
700         Reviewed by Antti Koivisto.
701
702         The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback
703         with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier
704         is invalid in that case, and we should be using requestIdentifier instead.
705
706         Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case.
707
708         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
709         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
710
711 2019-02-13  Benjamin Poulain  <benjamin@webkit.org>
712
713         Responsiveness timers are too expensive for frequent events
714         https://bugs.webkit.org/show_bug.cgi?id=194003
715
716         Reviewed by Geoffrey Garen.
717
718         With each event, we set a responsivness timer to check if the WebProcess
719         is responsive, and reset the timer when the WebProcess sends an answer.
720
721         For frequent events (e.g. wheel events, mouse force events, etc),
722         we are spamming the kernel with hundreds of timers per second.
723         That is a bit inefficient.
724
725         Another source of inefficiency comes from the timer implementation
726         itself. Stopping a RunLoop::Timer removes the timer from every mode
727         and invalidate the timer. It becomes costly since we do it a lot.
728
729         With this patch, I tweak ResponsivenessTimer and its use to minimize
730         how often we schedule system timers.
731
732         The first change is to not stop the timer when we get the stop()
733         calls if we expect more events to come in. Instead, we keep track
734         if we care about the timeout or not in the attribute "m_waitingForTimer".
735         When the next event starts, we can reschedule the timer without ever
736         having told the kernel about the stop.
737         If there are no next events, the timeout fires but m_waitingForTimer
738         is false. To avoid idle wake up, the lazy stop is only used when having
739         following events is common.
740
741         The second improvements comes from not even rescheduling the timer
742         when restarted. Instead of changing the timer, we let the original timer
743         fire and re-shedule a new one with the missing time.
744
745         For more context, also see patches r240759 and r240944.
746
747         * UIProcess/ResponsivenessTimer.cpp:
748         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
749         (WebKit::ResponsivenessTimer::invalidate):
750         (WebKit::ResponsivenessTimer::timerFired):
751         (WebKit::ResponsivenessTimer::start):
752         (WebKit::ResponsivenessTimer::startWithLazyStop):
753         (WebKit::ResponsivenessTimer::stop):
754         (WebKit::ResponsivenessTimer::processTerminated):
755         (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted.
756         * UIProcess/ResponsivenessTimer.h:
757         (WebKit::ResponsivenessTimer::hasActiveTimer const):
758         * UIProcess/WebPageProxy.cpp:
759         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
760         (WebKit::WebPageProxy::sendWheelEvent):
761         (WebKit::WebPageProxy::handleKeyboardEvent):
762         (WebKit::WebPageProxy::handleGestureEvent):
763         * UIProcess/WebProcessProxy.cpp:
764         (WebKit::WebProcessProxy::isResponsiveWithLazyStop):
765         * UIProcess/WebProcessProxy.h:
766
767 2019-02-12  Tim Horton  <timothy_horton@apple.com>
768
769         Null deref in userInterfaceLayoutDirection under ViewGestureController::handleSwipeGesture
770         https://bugs.webkit.org/show_bug.cgi?id=194569
771         <rdar://problem/46711049>
772
773         Reviewed by Wenson Hsieh.
774
775         * UIProcess/mac/ViewGestureControllerMac.mm:
776         (WebKit::ViewGestureController::handleSwipeGesture):
777         It is conceivable that we could get here if the client closes the page
778         e.g. in the callback from willEndSwipeGesture. We already guarded against
779         this ... one line too late! Rearrange the lines so we don't call into
780         WebPageProxy at all if we don't have a drawing area (which is a strict subset
781         of the time that isValid would return true). This is a speculative fix,
782         since I can no longer reproduce the crash on demand.
783
784 2019-02-12  Youenn Fablet  <youenn@apple.com>
785
786         WebServiceWorkerProvider::handleFetch no longer needs a CachedResource parameter
787         https://bugs.webkit.org/show_bug.cgi?id=194548
788
789         Reviewed by Alex Christensen.
790
791         * WebProcess/Network/WebLoaderStrategy.cpp:
792         (WebKit::WebLoaderStrategy::scheduleLoad):
793         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
794         (WebKit::WebServiceWorkerProvider::handleFetch):
795         * WebProcess/Storage/WebServiceWorkerProvider.h:
796
797 2019-02-12  Tim Horton  <timothy_horton@apple.com>
798
799         Remove WKLegacyPDFView
800         https://bugs.webkit.org/show_bug.cgi?id=194559
801
802         Reviewed by Andy Estes.
803
804         * Platform/spi/ios/CorePDFSPI.h: Removed.
805         * SourcesCocoa.txt:
806         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
807         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
808         * UIProcess/ios/WKLegacyPDFView.h: Removed.
809         * UIProcess/ios/WKLegacyPDFView.mm: Removed.
810         * WebKit.xcodeproj/project.pbxproj:
811
812 2019-02-12  Chris Dumez  <cdumez@apple.com>
813
814         Regression(PSON) MESSAGE_CHECK() hit under WebPageProxy::didFailProvisionalLoadForFrameShared()
815         https://bugs.webkit.org/show_bug.cgi?id=194568
816         <rdar://problem/47944490>
817
818         Reviewed by Ryosuke Niwa.
819
820         When the provisional process crashes, it is unsafe to call ProvisionalPageProxy::cancel() because
821         the WebProcessProxy clears its frame map as soon as the process crashes. Calling cancel() after
822         that would call WebPageProxy::didFailProvisionalLoadForFrameShared(), which would try to look up
823         the frame by ID and MESSAGE_CHECK() that the frame is not null. We would fail this check since
824         the frame has been removed from the WebProcessProxy at this point.
825
826         * UIProcess/API/Cocoa/WKWebView.mm:
827         (-[WKWebView _provisionalWebProcessIdentifier]):
828         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
829         * UIProcess/WebPageProxy.cpp:
830         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
831         (WebKit::WebPageProxy::provisionalProcessDidTerminate):
832
833 2019-02-12  Per Arne Vollan  <pvollan@apple.com>
834
835         [iOS] Youtube fails to play.
836         https://bugs.webkit.org/show_bug.cgi?id=194565
837         <rdar://problem/47974770>
838
839         Reviewed by Geoffrey Garen.
840
841         This is caused by sandbox violations and was introduced in r240500.
842
843         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
844
845 2019-02-12  Alex Christensen  <achristensen@webkit.org>
846
847         Remove firing assertion after r241317
848         https://bugs.webkit.org/show_bug.cgi?id=194506
849
850         * WebProcess/Network/WebLoaderStrategy.cpp:
851         (WebKit::WebLoaderStrategy::setDefersLoading):
852         The creation of a PageGroupLoadDeferrer in Chrome.cpp tries to defer loading.
853         See comments in Chrome::runJavaScriptAlert et al.
854         This was necessary with WebKitLegacy, so keep it, but it doesn't need to do anything in modern WebKit.
855
856 2019-02-12  Tim Horton  <timothy_horton@apple.com>
857
858         Find on Page shouldn't zoom in on matches
859         https://bugs.webkit.org/show_bug.cgi?id=194557
860         <rdar://problem/42087017>
861
862         Reviewed by Wenson Hsieh.
863
864         * UIProcess/ios/SmartMagnificationController.h:
865         * UIProcess/ios/SmartMagnificationController.messages.in:
866         * UIProcess/ios/SmartMagnificationController.mm:
867         (WebKit::SmartMagnificationController::scrollToRect):
868         * WebProcess/WebPage/ios/FindControllerIOS.mm:
869         (WebKit::FindController::updateFindIndicator):
870         Only scroll to reveal the find result, do not zoom in.
871
872 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
873
874         Allow pages to trigger programmatic paste from script on iOS
875         https://bugs.webkit.org/show_bug.cgi?id=194271
876         <rdar://problem/47808810>
877
878         Reviewed by Tim Horton.
879
880         Cancel the pending DOM paste access handler when the menu is about to hide, rather than when the hiding
881         animation has completed. This ensures that if the page (on behalf of the user) requests DOM paste again during
882         user interaction before the callout bar has finished fading after the previous DOM paste, we won't automatically
883         cancel the incoming DOM paste access request because the callout bar animation finished.
884
885         This scenario is exercised in the layout test editing/pasteboard/ios/dom-paste-consecutive-confirmations.html.
886
887         * Platform/spi/ios/UIKitSPI.h:
888         * UIProcess/ios/WKContentViewInteraction.mm:
889         (-[WKContentView setupInteraction]):
890         (-[WKContentView _willHideMenu:]):
891         (-[WKContentView _didHideMenu:]):
892
893 2019-02-12  Chris Fleizach  <cfleizach@apple.com>
894
895         AX: IsolatedTree: Implement more attributes
896         https://bugs.webkit.org/show_bug.cgi?id=193911
897         <rdar://problem/47599217>
898
899         Reviewed by Daniel Bates.
900
901         * Platform/spi/mac/AccessibilityPrivSPI.h: Added.
902         * WebKit.xcodeproj/project.pbxproj:
903         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
904         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
905         (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]):
906         (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]):
907         (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
908         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
909         (-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]):
910         (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
911         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
912         (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
913         (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
914         (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):
915         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
916         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
917
918 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
919
920         Allow pages to trigger programmatic paste from script on iOS
921         https://bugs.webkit.org/show_bug.cgi?id=194271
922         <rdar://problem/47808810>
923
924         Reviewed by Ryosuke Niwa.
925
926         * Shared/WebPreferences.yaml:
927         * Shared/WebPreferencesDefaultValues.h:
928
929         Add an internal setting to enable or disable DOM paste access requests. This is on by default in iOS only
930         (excluding watchOS and Apple TV), and is additionally disabled on macOS.
931
932         * UIProcess/API/gtk/PageClientImpl.cpp:
933         (WebKit::PageClientImpl::requestDOMPasteAccess):
934         * UIProcess/API/gtk/PageClientImpl.h:
935         * UIProcess/API/wpe/PageClientImpl.cpp:
936         (WebKit::PageClientImpl::requestDOMPasteAccess):
937
938         Plumb DOM paste access requests from the web process (WebEditorClient) to the view (WKContentView). As per the
939         usual, this involves WebEditorClient, WebPage, WebPageProxy, PageClient and finally WKContentView.
940
941         * UIProcess/API/wpe/PageClientImpl.h:
942         * UIProcess/PageClient.h:
943         * UIProcess/WebPageProxy.cpp:
944         (WebKit::WebPageProxy::requestDOMPasteAccess):
945         * UIProcess/WebPageProxy.h:
946         * UIProcess/WebPageProxy.messages.in:
947         * UIProcess/ios/PageClientImplIOS.h:
948         * UIProcess/ios/PageClientImplIOS.mm:
949         (WebKit::PageClientImpl::requestDOMPasteAccess):
950         * UIProcess/ios/WKContentViewInteraction.h:
951         * UIProcess/ios/WKContentViewInteraction.mm:
952         (-[WKContentView setupInteraction]):
953         (-[WKContentView cleanupInteraction]):
954         (-[WKContentView resignFirstResponderForWebView]):
955         (-[WKContentView _webTouchEventsRecognized:]):
956
957         Bail from any pending DOM paste access handler the moment we start handling touches on the web view, or if the
958         web view resigns first responder, or if the web process crashes.
959
960         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
961
962         Reject text selection gestures while waiting for DOM paste access.
963
964         (-[WKContentView canPerformAction:withSender:]):
965         (-[WKContentView canPerformActionForWebView:withSender:]):
966
967         If we're handling a DOM paste, always return YES to allow the callout bar to show the "Paste" option.
968
969         (-[WKContentView _didHideMenu:]):
970
971         If the menu is programmatically hidden by the app while handling a DOM paste request, immediately reject the DOM
972         paste request.
973
974         (-[WKContentView pasteForWebView:]):
975
976         Adjust -pasteForWebView: on WKContentView to first check whether there's an outstanding DOM paste completion
977         handler to invoke, instead of telling the page to execute a paste command.
978
979         (-[WKContentView _handleDOMPasteRequestWithResult:]):
980
981         Add a helper to take and invoke the current DOM paste completion handler (if it exists) with the given result,
982         and then dismiss the shared callout bar. Returns whether or not the paste completion handler exists. Invoked
983         from various sources of user interaction or significant state changes (e.g. following a web process crash in
984         -cleanupInteraction).
985
986         (-[WKContentView _willPerformAction:sender:]):
987         (-[WKContentView _didPerformAction:sender:]):
988
989         Add hooks to detect when WKContentView is executing an editing action. This is to ensure that the page doesn't
990         get stuck in a bad state in the case where WKWebView has been subclassed, overrides `-paste:`, and does not
991         invoke the superclass method (which calls back into `-[WKContentView pasteForWebView:]`). There are a few
992         possibilities here:
993         1. WKWebView's `-paste:` action is not overridden. In this case, we will call back into `-pasteForWebView:`,
994            which will notice that we have a pending paste completion handler and invoke it.
995         2. WKWebView's `-paste:` action is overridden and does not call back into the content view. In this case, we
996            will invoke the paste completion handler in `-_didPerformAction:sender:`.
997         3. WKWebView's `-canPerformAction:withSender:` is overridden to include additional actions. In this case, we may
998            get a call to invoke a different action selector while waiting for a potential paste action. If this happens,
999            prevent the DOM paste in `-_willPerformAction:sender:` prior to handling the other action.
1000
1001         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
1002
1003         Dismiss DOM paste UI upon handling any key event.
1004
1005         (-[WKContentView showGlobalMenuControllerInRect:]):
1006         (-[WKContentView hideGlobalMenuController]):
1007
1008         Helper methods to present and dismiss the global UIMenuController, that accounts for available platform APIs for
1009         presenting or dismissing the menu controller on iOS.
1010
1011         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]):
1012
1013         Attempt to find a good target presentation rect when showing the callout menu. First, we will try to use the
1014         rect of the element the user has interacted with when triggering the paste. If such an element is too large or
1015         does not exist, we fall back to presenting the callout menu near the user's last touch location (with a small
1016         amount of margin, such that the action doesn't overlap with the user's finger, stylus, etc.).
1017
1018         (-[WKContentView _resetShowingTextStyle:]): Deleted.
1019
1020         Rename this to `-_didHideMenu:`.
1021
1022         * UIProcess/mac/PageClientImplMac.h:
1023         * UIProcess/win/PageClientImpl.cpp:
1024         (WebKit::PageClientImpl::requestDOMPasteAccess):
1025         * UIProcess/win/PageClientImpl.h:
1026         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1027         (WebKit::WebEditorClient::requestDOMPasteAccess):
1028         * WebProcess/WebCoreSupport/WebEditorClient.h:
1029         * WebProcess/WebPage/WebPage.cpp:
1030         (WebKit::WebPage::requestDOMPasteAccess):
1031
1032         Add more plumbing and method stubs.
1033
1034         (WebKit::WebPage::updateCurrentModifierState):
1035         (WebKit::WebPage::rectForElementAtInteractionLocation const):
1036         * WebProcess/WebPage/WebPage.h:
1037         * WebProcess/WebPage/ios/WebPageIOS.mm:
1038         (WebKit::WebPage::rectForElementAtInteractionLocation const):
1039         (WebKit::WebPage::rectForElementAtInteractionLocation): Deleted.
1040
1041         Mark this method as const, add a platform-agnostic stub, and adopt it for the purposes of determining where to
1042         position the callout bar when pasting.
1043
1044 2019-02-12  Alex Christensen  <achristensen@webkit.org>
1045
1046         Remove setDefersLoading infrastructure from WebKit2
1047         https://bugs.webkit.org/show_bug.cgi?id=194506
1048
1049         Reviewed by Brady Eidson.
1050
1051         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1052         (WebKit::NetworkConnectionToWebProcess::setDefersLoading): Deleted.
1053         * NetworkProcess/NetworkConnectionToWebProcess.h:
1054         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1055         * NetworkProcess/NetworkDataTask.h:
1056         * NetworkProcess/NetworkDataTaskBlob.cpp:
1057         (WebKit::NetworkDataTaskBlob::suspend): Deleted.
1058         * NetworkProcess/NetworkDataTaskBlob.h:
1059         * NetworkProcess/NetworkLoad.cpp:
1060         (WebKit::NetworkLoad::initialize):
1061         (WebKit::NetworkLoad::setDefersLoading): Deleted.
1062         * NetworkProcess/NetworkLoad.h:
1063         * NetworkProcess/NetworkLoadParameters.h:
1064         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1065         (WebKit::NetworkResourceLoadParameters::encode const):
1066         (WebKit::NetworkResourceLoadParameters::decode):
1067         * NetworkProcess/NetworkResourceLoader.cpp:
1068         (WebKit::NetworkResourceLoader::start):
1069         (WebKit::NetworkResourceLoader::startNetworkLoad):
1070         (WebKit::NetworkResourceLoader::setDefersLoading): Deleted.
1071         * NetworkProcess/NetworkResourceLoader.h:
1072         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1073         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1074         (WebKit::NetworkDataTaskCocoa::suspend): Deleted.
1075         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1076         (WebKit::NetworkDataTaskCurl::suspend): Deleted.
1077         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1078         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1079         (WebKit::NetworkDataTaskSoup::suspend): Deleted.
1080         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1081         * WebProcess/Network/WebLoaderStrategy.cpp:
1082         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1083         (WebKit::WebLoaderStrategy::setDefersLoading):
1084
1085 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1086
1087         Unreviewed, fix build warnings after content extensions enablement
1088         https://bugs.webkit.org/show_bug.cgi?id=193622
1089         <rdar://problem/47982850>
1090
1091         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
1092         (toResult):
1093
1094 2019-02-12  Tim Horton  <timothy_horton@apple.com>
1095
1096         Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
1097         https://bugs.webkit.org/show_bug.cgi?id=194524
1098         <rdar://problem/35481797>
1099
1100         Reviewed by Wenson Hsieh.
1101
1102         * Platform/spi/ios/UIKitSPI.h:
1103         * UIProcess/ios/InputViewUpdateDeferrer.h:
1104         * UIProcess/ios/InputViewUpdateDeferrer.mm:
1105         (WebKit::InputViewUpdateDeferrer::InputViewUpdateDeferrer):
1106         (WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer):
1107         Make use of the per-responder and much safer input view pinning mechanism.
1108
1109         * UIProcess/ios/WKContentViewInteraction.mm:
1110         (-[WKContentView becomeFirstResponderForWebView]):
1111         (-[WKContentView _singleTapCommited:]):
1112         (-[WKContentView _attemptClickAtLocation:modifierFlags:]):
1113         Always temporarily pin input views when becoming first responder; there are
1114         many paths (such as through the text interaction assistant) that can
1115         focus us on tap, trying to cover them all is a fool's errand. We'll
1116         just get out the big hammer and call it in becomeFirstResponder.
1117         This also means we can remove it from _singleTapCommitted and _attemptClick...
1118
1119         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1120         Don't release the input view pinning until we return from _elementDidFocus;
1121         it does the rebuilding synchronously, so we need to have actually updated
1122         all of the prerequisites of -inputView before depinning.
1123
1124 2019-02-12  Youenn Fablet  <youenn@apple.com>
1125
1126         Make use of is<SubresourceLoader>
1127         https://bugs.webkit.org/show_bug.cgi?id=194541
1128
1129         Reviewed by Alex Christensen.
1130
1131         * WebProcess/Network/WebLoaderStrategy.cpp:
1132         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1133
1134 2019-02-12  Alex Christensen  <achristensen@webkit.org>
1135
1136         WebPage::close needs to remove all message receivers associated with that WebPage, not WebPage::~WebPage
1137         https://bugs.webkit.org/show_bug.cgi?id=194522
1138         <rdar://problem/47789393>
1139
1140         Reviewed by Chris Dumez.
1141
1142         The InjectedBundle SPI can retain the WebPage or wrapping objects (WKWebProcessPlugInBrowserContextController/WKBundlePageRef).
1143         This can make it so WebPage::close is called before WebPage::~WebPage, and if the SuspendedPageProxy is reused for a subsequent
1144         navigation to the same domain, the WebProcess is reused with a different WebPage instance with the same PageID, which causes problems
1145         when another WebPage registers message handlers and then the previous WebPage is destroyed, which removes both message handlers.
1146
1147         * WebProcess/WebPage/WebPage.cpp:
1148         (WebKit::WebPage::~WebPage):
1149         (WebKit::WebPage::close):
1150         (WebKit::WebPage::mainFrameDidLayout):
1151         * WebProcess/WebPage/WebPage.h:
1152         * WebProcess/WebProcess.h:
1153         (WebKit::WebProcess::eventDispatcher):
1154
1155 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1156
1157         [WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize
1158         https://bugs.webkit.org/show_bug.cgi?id=194370
1159
1160         Reviewed by Darin Adler.
1161
1162         It is incorrect to use g_unsetenv() here because it is MT-Unsafe. We know that it is
1163         impossible and unreasonable to expect the application has not started other threads at this
1164         point, and threads will be calling getenv(). WebKit itself has probably already started
1165         threads of its own.
1166
1167         Fortunately, the remote inspector in the web process is already prepared to deal with
1168         failure to connect to the inspector server, so we don't need to do anything except stop
1169         messing with the environment.
1170
1171         Note these files are copies of each other. I'll merge them together in a follow-up patch.
1172
1173         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1174         (WebKit::initializeRemoteInspectorServer):
1175         (WebKit::WebProcessPool::platformInitialize):
1176         * UIProcess/wpe/WebProcessPoolWPE.cpp:
1177         (WebKit::initializeRemoteInspectorServer):
1178         (WebKit::WebProcessPool::platformInitialize):
1179
1180 2019-02-08  Beth Dakin  <bdakin@apple.com>
1181
1182         Ensure old binaries have old snapshotting behaviors
1183         https://bugs.webkit.org/show_bug.cgi?id=194449
1184         -and corresponding-
1185         rdar://problem/47931954
1186
1187         Reviewed by Darin Adler.
1188
1189         Make sure that a nil configuration behaves the same way that it used to on apps 
1190         that were linked before FirstWithSnapshotAfterScreenUpdates
1191
1192         * UIProcess/API/Cocoa/WKWebView.mm:
1193         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
1194         * UIProcess/Cocoa/VersionChecks.h:
1195
1196 2019-02-12  Andy Estes  <aestes@apple.com>
1197
1198         [iOSMac] Enable Parental Controls Content Filtering
1199         https://bugs.webkit.org/show_bug.cgi?id=194521
1200         <rdar://39732376>
1201
1202         Reviewed by Tim Horton.
1203
1204         * Configurations/FeatureDefines.xcconfig:
1205
1206 2019-02-11  Alex Christensen  <achristensen@webkit.org>
1207
1208         Remove noisy and unnecessary logs added in r241223
1209         https://bugs.webkit.org/show_bug.cgi?id=194427
1210
1211         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1212         (WebKit::ProcessLauncher::launchProcess):
1213         Errors occur all the time in the XPC connection's event handler, like when a process terminates.
1214         We don't need to print an "error" every time any process terminates.
1215
1216 2019-02-11  Brian Burg  <bburg@apple.com>
1217
1218         [Cocoa] Web Automation: client callbacks are not called if delegate does not override
1219         https://bugs.webkit.org/show_bug.cgi?id=194519
1220         <rdar://problem/47981961>
1221
1222         Reviewed by Joseph Pecoraro.
1223
1224         Call the completion handler directly if the delegate does not implement the relevant method.
1225
1226         * UIProcess/Cocoa/AutomationSessionClient.mm:
1227         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
1228         (WebKit::AutomationSessionClient::requestSwitchToPage):
1229         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
1230         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
1231         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
1232
1233 2019-02-11  Daniel Bates  <dabates@apple.com>
1234
1235         [iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph
1236         https://bugs.webkit.org/show_bug.cgi?id=194505
1237         <rdar://problem/47743533>
1238
1239         Reviewed by Tim Horton.
1240
1241         * UIProcess/ios/WKContentViewInteraction.mm:
1242         (-[WKContentView _deleteToEndOfParagraph]): Added.
1243         (-[WKContentView _transpose]): Added.
1244
1245 2019-02-11  Adrian Perez de Castro  <aperez@igalia.com>
1246
1247         [GTK][WPE] Add content extensions support in WKTR and unskip layout tests
1248         https://bugs.webkit.org/show_bug.cgi?id=193622
1249
1250         Reviewed by Michael Catanzaro.
1251
1252         * NetworkProcess/cache/NetworkCacheData.h: Define an adoptAndMapFile() implementation
1253         for GFileIOStream objects.
1254         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
1255         (WebKit::NetworkCache::adoptAndMapFile): Added implementation, which extracts the file
1256         descriptor from a GFileIOStream, as it inherits from GFileDescriptorBased, and then
1257         reuses the version of adoptAndMapFile() which takes a file descritor for the actual work.
1258         * NetworkProcess/NetworkLoadChecker.cpp:
1259         (Webkit::NetworkLoadChecker::checkRequest): Use "this" when referring to
1260         processContentExtensionRulesForLoad() in order to avoid ambiguity.
1261         * Sources.txt: Add WKUserContentExtensionStoreRef.cpp, all ports use it now.
1262         * SourcesCocoa.txt: Remove WKUserContentExtensionStoreRef.cpp, because it is not
1263         Cocoa-specific anymore.
1264         * SourcesGTK.txt: Add APIContentRuleListStoreGLib.cpp.
1265         * SourcesWPE.txt: Ditto.
1266         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
1267         (WKUserContentExtensionStoreCreate): Added.
1268         (toResult): Added.
1269         (WKUserContentExtensionStoreCompile): Added.
1270         (WKUserContentExtensionStoreLookup): Added.
1271         (WKUserContentExtensionStoreRemove): Added.
1272         * UIProcess/API/C/WKUserContentExtensionStoreRef.h: Add declarations for the new C API
1273         functions and for the WKUserContentExtensionStoreResult status enum.
1274         * UIProcess/API/glib/APIContentRuleListStoreGLib.cpp: Added.
1275         (API::ContentRuleListStore::defaultStorePath): Add a dummy implementation. The public API
1276         for the GLib based ports (GTK+ and WPE) will not allow using the default store and will
1277         always indicating a path.
1278
1279 2019-02-11  Daniel Bates  <dabates@apple.com>
1280
1281         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1282         https://bugs.webkit.org/show_bug.cgi?id=191446
1283         <rdar://problem/45929460>
1284
1285         Reviewed by Tim Horton.
1286
1287         Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
1288         Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
1289         flags held when a navigation action was initiated.
1290
1291         * Platform/spi/ios/UIKitSPI.h: Expose SPI.
1292         * Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
1293         WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
1294         from both C++ and Objective-C source files. It only makes sense to expose this function when
1295         compiling as part of an Objective-C source file.
1296         * Shared/ios/NativeWebTouchEventIOS.mm:
1297         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
1298         when the platform touch event was received and pass them through to the base constructor.
1299         (WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
1300         OptionSet<WebKit::WebEvent::Modifier>.
1301         * Shared/ios/WebIOSEventFactory.h:
1302         * Shared/ios/WebIOSEventFactory.mm:
1303         (WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
1304         to the platform-specific UIKeyModifierFlags.
1305         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1306         (-[WKNavigationAction modifierFlags]): Added.
1307         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1308         * UIProcess/WebPageProxy.h:
1309         * UIProcess/ios/WKContentViewInteraction.h:
1310         * UIProcess/ios/WKContentViewInteraction.mm:
1311         (gestureRecognizerModifierFlags): Added.
1312
1313         (-[WKContentView _webTouchEventsRecognized:]):
1314         (-[WKContentView _highlightLongPressRecognized:]):
1315         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1316         (-[WKContentView _singleTapCommited:]):
1317         Pass modifier flags through.
1318
1319         (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
1320         (-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
1321         via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
1322         detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
1323         the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
1324         to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
1325         event perspective.
1326         (webEventFlagsForUIKeyModifierFlags): Added.
1327         (-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
1328         (-[WKContentView _attemptClickAtLocation:]): Deleted.
1329         * UIProcess/ios/WebPageProxyIOS.mm:
1330         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1331         (WebKit::WebPageProxy::commitPotentialTap):
1332         (WebKit::WebPageProxy::handleTap):
1333         * WebProcess/WebPage/WebPage.h:
1334         * WebProcess/WebPage/WebPage.messages.in:
1335         * WebProcess/WebPage/ios/WebPageIOS.mm:
1336         (WebKit::WebPage::handleSyntheticClick):
1337         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1338         (WebKit::WebPage::completeSyntheticClick):
1339         (WebKit::WebPage::handleTap):
1340         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1341         (WebKit::WebPage::commitPotentialTap):
1342         Pass modifier flags through.
1343
1344 2019-02-11  Jer Noble  <jer.noble@apple.com>
1345
1346         [Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
1347         https://bugs.webkit.org/show_bug.cgi?id=194504
1348
1349         Reviewed by Eric Carlson.
1350
1351         * WebKit.xcodeproj/project.pbxproj:
1352         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
1353         (WebKit::WebUserMediaClient::requestUserMediaAccess):
1354         * WebProcess/WebPage/WebPage.cpp:
1355         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.
1356         * WebProcess/WebPage/WebPage.h:
1357         (WebKit::WebPage::userMediaPermissionRequestManager):
1358         * WebProcess/WebPage/ios/WebPageIOS.mm:
1359         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted.
1360
1361 2019-02-11  Commit Queue  <commit-queue@webkit.org>
1362
1363         Unreviewed, rolling out r241272 and r241276.
1364         https://bugs.webkit.org/show_bug.cgi?id=194514
1365
1366         Broke the Apple Internal build and the fix requires human
1367         intervention :( (Requested by dydz on #webkit).
1368
1369         Reverted changesets:
1370
1371         "[iOS] Mouse/Touch/Pointer events are missing modifier keys"
1372         https://bugs.webkit.org/show_bug.cgi?id=191446
1373         https://trac.webkit.org/changeset/241272
1374
1375         "Fix internal iOS build after r241272"
1376         https://bugs.webkit.org/show_bug.cgi?id=191446
1377         https://trac.webkit.org/changeset/241276
1378
1379 2019-02-11  Alex Christensen  <achristensen@webkit.org>
1380
1381         Fix internal iOS build after r241272
1382         https://bugs.webkit.org/show_bug.cgi?id=191446
1383
1384         * Platform/spi/ios/UIKitSPI.h:
1385         Declare the _modifierFlags when using the internal SDK also.
1386
1387 2019-02-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1388
1389         fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work on iPad
1390         https://bugs.webkit.org/show_bug.cgi?id=194313
1391
1392         Reviewed by Tim Horton.
1393
1394         Make `-dateTimePickerCalendarType` work on iPad by handling the case where the date picker control is a
1395         WKDateTimePopover. This fixes UIScriptController::calendarType() returning null on iPad.
1396
1397         * UIProcess/ios/forms/WKFormInputControl.mm:
1398         (-[WKFormInputControl dateTimePickerCalendarType]):
1399         (-[WKDateTimePopover calendarType]):
1400
1401 2019-02-11  Daniel Bates  <dabates@apple.com>
1402
1403         [iOS] Mouse/Touch/Pointer events are missing modifier keys
1404         https://bugs.webkit.org/show_bug.cgi?id=191446
1405         <rdar://problem/45929460>
1406
1407         Reviewed by Tim Horton.
1408
1409         Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events.
1410         Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier
1411         flags held when a navigation action was initiated.
1412
1413         * Platform/spi/ios/UIKitSPI.h: Expose SPI.
1414         * Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function
1415         WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included
1416         from both C++ and Objective-C source files. It only makes sense to expose this function when
1417         compiling as part of an Objective-C source file.
1418         * Shared/ios/NativeWebTouchEventIOS.mm:
1419         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down
1420         when the platform touch event was received and pass them through to the base constructor.
1421         (WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to
1422         OptionSet<WebKit::WebEvent::Modifier>.
1423         * Shared/ios/WebIOSEventFactory.h:
1424         * Shared/ios/WebIOSEventFactory.mm:
1425         (WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet<WebKit::WebEvent::Modifier>
1426         to the platform-specific UIKeyModifierFlags.
1427         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1428         (-[WKNavigationAction modifierFlags]): Added.
1429         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1430         * UIProcess/WebPageProxy.h:
1431         * UIProcess/ios/WKContentViewInteraction.h:
1432         * UIProcess/ios/WKContentViewInteraction.mm:
1433         (gestureRecognizerModifierFlags): Added.
1434
1435         (-[WKContentView _webTouchEventsRecognized:]):
1436         (-[WKContentView _highlightLongPressRecognized:]):
1437         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1438         (-[WKContentView _singleTapCommited:]):
1439         Pass modifier flags through.
1440
1441         (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added.
1442         (-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link
1443         via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation
1444         detail that this action is implemented via mouse click and we should re-evaluate this decision in light of
1445         the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible
1446         to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse
1447         event perspective.
1448         (webEventFlagsForUIKeyModifierFlags): Added.
1449         (-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through.
1450         (-[WKContentView _attemptClickAtLocation:]): Deleted.
1451         * UIProcess/ios/WebPageProxyIOS.mm:
1452         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1453         (WebKit::WebPageProxy::commitPotentialTap):
1454         (WebKit::WebPageProxy::handleTap):
1455         * WebProcess/WebPage/WebPage.h:
1456         * WebProcess/WebPage/WebPage.messages.in:
1457         * WebProcess/WebPage/ios/WebPageIOS.mm:
1458         (WebKit::WebPage::handleSyntheticClick):
1459         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1460         (WebKit::WebPage::completeSyntheticClick):
1461         (WebKit::WebPage::handleTap):
1462         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1463         (WebKit::WebPage::commitPotentialTap):
1464         Pass modifier flags through.
1465
1466 2019-02-11  Youenn Fablet  <youenn@apple.com>
1467
1468         Filter out Overconstrainederror.constraint when getUserMedia is not granted
1469         https://bugs.webkit.org/show_bug.cgi?id=194240
1470
1471         Reviewed by Eric Carlson.
1472
1473         Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
1474
1475         Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
1476
1477         Covered by added test.
1478
1479         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1480         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
1481         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1482         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
1483         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1484         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
1485         (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
1486         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1487         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
1488         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
1489         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
1490         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
1491         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
1492         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
1493         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1494         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
1495         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1496         * UIProcess/UserMediaPermissionRequestProxy.h:
1497         (WebKit::UserMediaPermissionRequestProxy::isPending const):
1498         (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
1499         (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
1500         (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
1501         (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
1502         (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
1503         (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
1504         (WebKit::UserMediaPermissionRequestProxy::userMediaID const):
1505         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
1506         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
1507         (WebKit::UserMediaPermissionRequestProxy::userRequest const):
1508         (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
1509         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
1510         (WebKit::UserMediaPermissionRequestProxy::audioDevice const):
1511         (WebKit::UserMediaPermissionRequestProxy::videoDevice const):
1512         * UIProcess/WebPageProxy.cpp:
1513         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
1514         * UIProcess/WebPageProxy.h:
1515
1516 2019-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1517
1518         [WPE] Do not try to create empty egl windows
1519         https://bugs.webkit.org/show_bug.cgi?id=194497
1520
1521         Reviewed by Žan Doberšek.
1522
1523         In AcceleratedSurfaceWPE we ensure the size we pass to wpe is at least 0x0, but wl_egl_window_create() returns
1524         nullptr if 0 is passed as width or height. We should use at least 1x1 instead.
1525
1526         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1527         (WebKit::AcceleratedSurfaceWPE::initialize):
1528         (WebKit::AcceleratedSurfaceWPE::clientResize):
1529
1530 2019-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1531
1532         [WPE] Do not use a sync IPC message to send the host FD to the web process
1533         https://bugs.webkit.org/show_bug.cgi?id=194216
1534
1535         Reviewed by Darin Adler.
1536
1537         It can be sent as a web page creation parameter instead.
1538
1539         * PlatformWPE.cmake:
1540         * Shared/WebPageCreationParameters.cpp:
1541         (WebKit::WebPageCreationParameters::encode const):
1542         (WebKit::WebPageCreationParameters::decode):
1543         * Shared/WebPageCreationParameters.h:
1544         * SourcesWPE.txt:
1545         * UIProcess/API/wpe/CompositingManagerProxy.cpp: Removed.
1546         * UIProcess/API/wpe/CompositingManagerProxy.h: Removed.
1547         * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Removed.
1548         * UIProcess/API/wpe/PageClientImpl.cpp:
1549         (WebKit::PageClientImpl::hostFileDescriptor):
1550         * UIProcess/API/wpe/PageClientImpl.h:
1551         * UIProcess/API/wpe/WPEView.cpp:
1552         (WKWPE::m_backend):
1553         * UIProcess/API/wpe/WPEView.h:
1554         (WKWPE::View::create):
1555         * UIProcess/PageClient.h:
1556         * UIProcess/WebPageProxy.cpp:
1557         (WebKit::WebPageProxy::creationParameters):
1558         * WebProcess/WebPage/WebPage.cpp:
1559         (WebKit::m_hostFileDescriptor):
1560         * WebProcess/WebPage/WebPage.h:
1561         (WebKit::WebPage::releaseHostFileDescriptor):
1562         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1563         (WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE):
1564         (WebKit::AcceleratedSurfaceWPE::initialize):
1565         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h:
1566         * WebProcess/WebPage/wpe/CompositingManager.cpp: Removed.
1567         * WebProcess/WebPage/wpe/CompositingManager.h: Removed.
1568
1569 2019-02-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1570
1571         [GTK][WPE] Add enable-javascript-markup setting
1572         https://bugs.webkit.org/show_bug.cgi?id=193439
1573
1574         Reviewed by Michael Catanzaro.
1575
1576         Expose JavaScriptMarkupEnabled setting in the GLib API.
1577
1578         * UIProcess/API/glib/WebKitSettings.cpp:
1579         (webKitSettingsSetProperty):
1580         (webKitSettingsGetProperty):
1581         (webkit_settings_class_init):
1582         (webkit_settings_get_enable_javascript_markup):
1583         (webkit_settings_set_enable_javascript_markup):
1584         * UIProcess/API/gtk/WebKitSettings.h:
1585         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1586         * UIProcess/API/wpe/WebKitSettings.h:
1587         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
1588
1589 2019-02-10  Darin Adler  <darin@apple.com>
1590
1591         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
1592         https://bugs.webkit.org/show_bug.cgi?id=194485
1593
1594         Reviewed by Daniel Bates.
1595
1596         * UIProcess/DeviceIdHashSaltStorage.cpp:
1597         (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Use
1598         appendUnsignedAsHex instead of appendUnsigned64AsHex.
1599
1600         * UIProcess/WebBackForwardList.cpp:
1601         (WebKit::WebBackForwardList::loggingString): Use appendUnsignedAsHex and
1602         reinterpret_cast<uintptr_t> instead of String::format and "%p".
1603
1604 2019-02-10  Commit Queue  <commit-queue@webkit.org>
1605
1606         Unreviewed, rolling out r241167.
1607         https://bugs.webkit.org/show_bug.cgi?id=194482
1608
1609         Broke the GTK mediastream tests (Requested by philn on
1610         #webkit).
1611
1612         Reverted changeset:
1613
1614         "Filter out Overconstrainederror.constraint when getUserMedia
1615         is not granted"
1616         https://bugs.webkit.org/show_bug.cgi?id=194240
1617         https://trac.webkit.org/changeset/241167
1618
1619 2019-02-09  Darin Adler  <darin@apple.com>
1620
1621         Eliminate unnecessary String temporaries by using StringConcatenateNumbers
1622         https://bugs.webkit.org/show_bug.cgi?id=194021
1623
1624         Reviewed by Geoffrey Garen.
1625
1626         * NetworkProcess/NetworkResourceLoader.cpp:
1627         (WebKit::escapeIDForJSON): Use an ASCIILiteral to create a String.
1628
1629         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1630         (WebKit::NetworkCache::makeVersionedDirectoryPath): Remove String::number and let
1631         makeString do the conversion without allocating/destroying a String.
1632
1633         * NetworkProcess/mac/RemoteNetworkingContext.mm: Removed "using namespace WebCore".
1634         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): Remove String::number
1635         and let makeString do the conversion without allocating/destroying a String.
1636
1637         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Removed "using namespace WebCore".
1638         (WebKit::registerMDNSNameCallback): Added explicit WebCore prefix as needed.
1639         (WebKit::NetworkMDNSRegister::registerMDNSName): Ditto. Also remove String::number
1640         and let makeString do the conversion without allocating/destroying a String.
1641
1642         * UIProcess/WebPageGroup.cpp:
1643         (WebKit::pageGroupData): Remove String::number and let makeString do the conversion
1644         without allocating/destroying a String.
1645         * UIProcess/WebPageProxy.cpp:
1646         (WebKit::WebPageProxy::createInspectorTargets): Ditto.
1647         * UIProcess/ios/WKLegacyPDFView.mm:
1648         (-[WKLegacyPDFView _URLForLinkAnnotation:]): Ditto.
1649         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
1650         (WebKit::uniqueWorldName): Ditto.
1651         * WebProcess/WebPage/WebPageInspectorTarget.cpp:
1652         (WebKit::WebPageInspectorTarget::identifier const): Ditto.
1653
1654 2019-02-09  Alexander Mikhaylenko  <exalm7659@gmail.com>
1655
1656         [GTK] Fix typo in the newly added API
1657         https://bugs.webkit.org/show_bug.cgi?id=194472
1658
1659         Reviewed by Michael Catanzaro.
1660
1661         Fix a typo: enableed -> enabled.
1662
1663         * UIProcess/API/glib/WebKitSettings.cpp:
1664         (webkit_settings_set_enable_back_forward_navigation_gestures):
1665         * UIProcess/API/gtk/WebKitSettings.h:
1666
1667 2019-02-08  Alex Christensen  <achristensen@webkit.org>
1668
1669         Speculative fix for Mojave API test after r241223
1670         https://bugs.webkit.org/show_bug.cgi?id=194427
1671
1672         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1673         (WebKit::XPCInitializationHandler):
1674         (WebKit::XPCServiceMain):
1675         Set the __APPLEEVENTSSERVICENAME environment variable before handling any xpc messages like we used to.
1676         I'll worry about making things right in the daemon later.
1677
1678 2019-02-08  Chris Dumez  <cdumez@apple.com>
1679
1680         [WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess
1681         https://bugs.webkit.org/show_bug.cgi?id=194463
1682
1683         Reviewed by Tim Horton.
1684
1685         Avoid creating new CVDisplayLink objects for each WebProcess. We really only need one per
1686         display, creating such object is expensive and it is even worse in a PSON world where we
1687         swap process on navigation.
1688
1689         This patch moves the DisplayLink storing from WebProcessProxy to WebProcessPool. Also,
1690         a DisplayLink can now be associated to several IPC connections instead of having a 1:1
1691         mapping. When a DisplayLink no longer has any observers, we now merely stop it instead
1692         of destroying it.
1693
1694         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1695         (WebKit::WebProcessPool::startDisplayLink):
1696         (WebKit::WebProcessPool::stopDisplayLink):
1697         (WebKit::WebProcessPool::stopDisplayLinks):
1698         * UIProcess/WebProcessPool.h:
1699         * UIProcess/WebProcessProxy.cpp:
1700         (WebKit::WebProcessProxy::~WebProcessProxy):
1701         (WebKit::WebProcessProxy::processWillShutDown):
1702         (WebKit::WebProcessProxy::shutDown):
1703         * UIProcess/WebProcessProxy.h:
1704         * UIProcess/mac/DisplayLink.cpp:
1705         (WebKit::DisplayLink::DisplayLink):
1706         (WebKit::DisplayLink::addObserver):
1707         (WebKit::DisplayLink::removeObserver):
1708         (WebKit::DisplayLink::removeObservers):
1709         (WebKit::DisplayLink::hasObservers const):
1710         (WebKit::DisplayLink::displayLinkCallback):
1711         * UIProcess/mac/DisplayLink.h:
1712         * UIProcess/mac/WebProcessProxyMac.mm:
1713         (WebKit::WebProcessProxy::startDisplayLink):
1714         (WebKit::WebProcessProxy::stopDisplayLink):
1715
1716 2019-02-08  Alexander Mikhaylenko  <exalm7659@gmail.com>
1717
1718         [GTK] Implement back/forward touchpad gesture
1719         https://bugs.webkit.org/show_bug.cgi?id=193919
1720
1721         Reviewed by Michael Catanzaro.
1722
1723         Move ViewSnapshotStore and ViewGestureController from Cocoa/Mac directory
1724         to UIProcess/, also move some parts of mac/ViewGestreControllerMac.mm to
1725         ViewGestureController.cpp, split up Mac- and iOS-specific parts of
1726         ViewSnapshotStore.cpp into mac/ViewSnapshotMac.mm, then implement 2-finger
1727         touchpad swipe back-forward gesture for GTK based on that.
1728
1729         To avoid name conflict, rename existing ViewGestureController class inside
1730         UIProcess/API/gtk/WebKitWebViewBase.cpp into TouchGestureController.
1731
1732         Since GTK gestures can only work with 3 or 4 fingers, treat horizontal
1733         scrolling events as a swipe as long as there's nowhere to scroll in that
1734         direction and web page doesn't handle the scrolling.
1735
1736         This is only allowed for touchpads, even though it can theoretically work
1737         with touch mice and trackpoints.
1738
1739         The gesture requires every item in back-forward list to have a snapshot.
1740         There's already an existing infrastructure for that, so the patch changes
1741         a bunch of #if PLATFORM(COCOA) statements to also check for GTK platform.
1742         The snapshots have to be taken in sync, so the implementation draws webview
1743         widget into a Cairo image surface.
1744
1745         The gesture is disabled by default, and can be enabled by setting the newly
1746         added 'enable-back-forward-navigation-gestures' property in WebKitSettings to
1747         true.
1748
1749         Gesture drawing is implemented via Cairo. When the gesture is active, the
1750         actual page is drawn into a Cairo group, which is then drawn together with
1751         a given snapshot, as well as dimming and a drop shadow over the "lower" layer.
1752
1753         Also add a memory pressure handler that clears snapshot store when low on memory.
1754
1755         * DerivedSources-input.xcfilelist:
1756         * PlatformGTK.cmake:
1757         * PlatformMac.cmake:
1758         * Shared/SessionState.h: Add snapshot to back-forward items for GTK.
1759         * Shared/WebBackForwardListItem.h: Add snapshot to back-forward items for GTK.
1760         * SourcesCocoa.txt:
1761         * SourcesGTK.txt:
1762         * UIProcess/API/glib/WebKitSettings.cpp:
1763         Added 'enable-back-forward-navigation-gestures' property for enabling the gesture.
1764         (webKitSettingsSetProperty):
1765         (webKitSettingsGetProperty):
1766         (webkit_settings_class_init):
1767         (webkit_settings_get_enable_back_forward_navigation_gestures): Added, GTK only.
1768         (webkit_settings_set_enable_back_forward_navigation_gestures): Added, GTK only.
1769         * UIProcess/API/glib/WebKitWebView.cpp:
1770         (enableBackForwardNavigationGesturesChanged): Added, GTK only.
1771         (webkitWebViewUpdateSettings):
1772         (webkitWebViewDisconnectSettingsSignalHandlers):
1773         * UIProcess/API/gtk/PageClientImpl.cpp:
1774         (WebKit::PageClientImpl::setViewNeedsDisplay): Redraw the whole screen instead of a region during the gesture.
1775         (WebKit::PageClientImpl::takeViewSnapshot): Added.
1776         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Pass unhandled events to the gesture controller.
1777         (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): Redraw the widget immediately after removing snapshot.
1778         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Added, send a notification to the gesture controller.
1779         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):  Send a notification to the gesture controller.
1780         (WebKit::PageClientImpl::didFinishLoadForMainFrame):  Send a notification to the gesture controller.
1781         (WebKit::PageClientImpl::didFailLoadForMainFrame):  Added, send a notification to the gesture controller.
1782         (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):  Send a notification to the gesture controller.
1783         (WebKit::PageClientImpl::didRestoreScrollPosition):  Added, send a notification to the gesture controller.
1784         * UIProcess/API/gtk/PageClientImpl.h:
1785         * UIProcess/API/gtk/WebKitSettings.h:
1786         Add webkit_settings_get_enable_back_forward_navigation_gestures() and webkit_settings_get_enable_back_forward_navigation_gestures()
1787         to public API.
1788         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1789         (webkitWebViewBaseDraw): Pass drawing to ViewGestureController during the gesture.
1790         (webkitWebViewBaseScrollEvent): Pass scroll events to ViewGestureController during the gesture.
1791         (webkitWebViewBaseGestureController): Renamed ViewGestureController to TouchGestureController.
1792         (webkitWebViewBaseViewGestureController): Added.
1793         (webkitWebViewBaseCreateWebPage): Create an instance of ViewGestureController.
1794         (webkitWebViewBaseTakeViewSnapshot): Added.
1795         (webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Added.
1796         (webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame): Added.
1797         (webkitWebViewBaseDidFinishLoadForMainFrame): Added.
1798         (webkitWebViewBaseDidFailLoadForMainFrame): Added.
1799         (webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Added.
1800         (webkitWebViewBaseDidRestoreScrollPosition): Added.
1801         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1802         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Mentioned the added functions in docs.
1803         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1804         (WebKit::WebProcessPool::platformInitialize): Move the check from WebMemoryPressureHandlerCocoa.mm here.
1805         * UIProcess/PageClient.h: Add takeViewSnapshot() for GTK.
1806         * UIProcess/ViewGestureController.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp.
1807         (WebKit::ViewGestureController::ViewGestureController):
1808         (WebKit::ViewGestureController::~ViewGestureController):
1809         (WebKit::ViewGestureController::disconnectFromProcess):
1810         (WebKit::ViewGestureController::connectToProcess):
1811         (WebKit::ViewGestureController::controllerForGesture):
1812         (WebKit::ViewGestureController::takeNextGestureID):
1813         (WebKit::ViewGestureController::willBeginGesture):
1814         (WebKit::ViewGestureController::didEndGesture):
1815         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
1816         (WebKit::ViewGestureController::canSwipeInDirection const):
1817         (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame):
1818         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
1819         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
1820         (WebKit::ViewGestureController::didRepaintAfterNavigation):
1821         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
1822         (WebKit::ViewGestureController::didRestoreScrollPosition):
1823         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
1824         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
1825         (WebKit::ViewGestureController::checkForActiveLoads):
1826         (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
1827         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
1828         (WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
1829         (WebKit::ViewGestureController::SnapshotRemovalTracker::resume):
1830         (WebKit::ViewGestureController::SnapshotRemovalTracker::start):
1831         (WebKit::ViewGestureController::SnapshotRemovalTracker::reset):
1832         (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
1833         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
1834         (WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent):
1835         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
1836         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible):
1837         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately):
1838         (WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired):
1839         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
1840         (WebKit::deltaShouldCancelSwipe):
1841         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
1842         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
1843         (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent):
1844         (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore):
1845         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
1846         (WebKit::ViewGestureController::PendingSwipeTracker::reset):
1847         (WebKit::ViewGestureController::startSwipeGesture):
1848         (WebKit::ViewGestureController::isPhysicallySwipingLeft const):
1849         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
1850         (WebKit::ViewGestureController::forceRepaintIfNeeded):
1851         (WebKit::ViewGestureController::willEndSwipeGesture):
1852         (WebKit::ViewGestureController::endSwipeGesture):
1853         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):
1854         * UIProcess/ViewGestureController.h: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.h.
1855         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
1856         (WebKit::ViewGestureController::shouldIgnorePinnedState):
1857         (WebKit::ViewGestureController::setShouldIgnorePinnedState):
1858         (WebKit::ViewGestureController::hasActiveMagnificationGesture const):
1859         (WebKit::ViewGestureController::setCustomSwipeViews):
1860         (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset):
1861         (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
1862         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot const):
1863         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
1864         (WebKit::ViewGestureController::didFailLoadForMainFrame):
1865         (WebKit::ViewGestureController::setSwipeGestureEnabled):
1866         (WebKit::ViewGestureController::isSwipeGestureEnabled):
1867         (WebKit::ViewGestureController::SnapshotRemovalTracker::pause):
1868         (WebKit::ViewGestureController::SnapshotRemovalTracker::isPaused const):
1869         (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const):
1870         (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
1871         (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
1872         (WebKit::ViewGestureController::PendingSwipeTracker::shouldIgnorePinnedState):
1873         (WebKit::ViewGestureController::PendingSwipeTracker::setShouldIgnorePinnedState):
1874         (WebKit::ViewGestureController::SwipeProgressTracker::progress const):
1875         (WebKit::ViewGestureController::SwipeProgressTracker::direction const):
1876         * UIProcess/ViewGestureController.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.messages.in.
1877         * UIProcess/ViewSnapshotStore.cpp: Copied from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
1878         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
1879         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1880         (WebKit::ViewSnapshotStore::singleton):
1881         (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
1882         (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
1883         (WebKit::ViewSnapshotStore::pruneSnapshots):
1884         (WebKit::ViewSnapshotStore::recordSnapshot):
1885         (WebKit::ViewSnapshotStore::discardSnapshotImages):
1886         (WebKit::ViewSnapshot::~ViewSnapshot):
1887         * UIProcess/ViewSnapshotStore.h: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.h.
1888         (WebKit::ViewSnapshot::setRenderTreeSize):
1889         (WebKit::ViewSnapshot::renderTreeSize const):
1890         (WebKit::ViewSnapshot::setBackgroundColor):
1891         (WebKit::ViewSnapshot::backgroundColor const):
1892         (WebKit::ViewSnapshot::setViewScrollPosition):
1893         (WebKit::ViewSnapshot::viewScrollPosition const):
1894         (WebKit::ViewSnapshot::setDeviceScaleFactor):
1895         (WebKit::ViewSnapshot::deviceScaleFactor const):
1896         (WebKit::ViewSnapshot::surface const):
1897         (WebKit::ViewSnapshot::imageSizeInBytes const):
1898         (WebKit::ViewSnapshot::size const):
1899         (WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
1900         (WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting const):
1901         * UIProcess/WebBackForwardList.cpp:
1902         (WebKit::WebBackForwardList::didRemoveItem): Unset snapshot for GTK.
1903         * UIProcess/WebMemoryPressureHandler.cpp: Copied from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
1904         (WebKit::installMemoryPressureHandler):
1905         * UIProcess/WebMemoryPressureHandler.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.h.
1906         * UIProcess/WebPageProxy.cpp:
1907         (WebKit::WebPageProxy::recordNavigationSnapshot): Take snapshots for GTK.
1908         * UIProcess/WebPageProxy.h:
1909         * UIProcess/gtk/ViewGestureControllerGtk.cpp: Added. This is a port of
1910         UIProcess/mac/ViewGestureControllerMac.mm. SwipeProgressTracker class is a
1911         re-implementation of trackSwipeEventWithOptions.
1912         (WebKit::isEventStop):
1913         (WebKit::ViewGestureController::platformTeardown):
1914         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
1915         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
1916         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
1917         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
1918         (WebKit::ViewGestureController::handleScrollWheelEvent):
1919         (WebKit::ViewGestureController::trackSwipeGesture):
1920         (WebKit::ViewGestureController::SwipeProgressTracker::SwipeProgressTracker):
1921         (WebKit::ViewGestureController::SwipeProgressTracker::startTracking):
1922         (WebKit::ViewGestureController::SwipeProgressTracker::reset):
1923         (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
1924         (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):
1925         (WebKit::easeOutCubic):
1926         (WebKit::ViewGestureController::SwipeProgressTracker::onAnimationTick):
1927         (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation):
1928         (WebKit::ViewGestureController::beginSwipeGesture):
1929         (WebKit::ViewGestureController::handleSwipeGesture):
1930         (WebKit::ViewGestureController::draw):
1931         (WebKit::ViewGestureController::removeSwipeSnapshot):
1932         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
1933         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
1934         * UIProcess/gtk/ViewSnapshotStoreGtk.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm.
1935         (WebKit::ViewSnapshot::create):
1936         (WebKit::ViewSnapshot::ViewSnapshot):
1937         (WebKit::ViewSnapshot::hasImage const):
1938         (WebKit::ViewSnapshot::clearImage):
1939         (WebKit::ViewSnapshot::imageSizeInBytes const):
1940         (WebKit::ViewSnapshot::size const):
1941         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1942         (WebKit::memoryPressureMonitorDisabled): Added.
1943         (WebKit::WebProcessPool::platformInitialize): Install memory pressure handler.
1944         (WebKit::WebProcessPool::platformInitializeWebProcess): Use memoryPressureMonitorDisabled().
1945         * UIProcess/mac/ViewGestureControllerMac.mm:
1946         Moved many functions into UIProcess/ViewGestureController.cpp
1947         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe):
1948         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe):
1949         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
1950         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
1951         (WebKit::ViewGestureController::trackSwipeGesture):
1952         (WebKit::scrollEventCanInfluenceSwipe): Deleted.
1953         (WebKit::deltaShouldCancelSwipe): Deleted.
1954         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): Deleted.
1955         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): Deleted.
1956         (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent): Deleted.
1957         (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore): Deleted.
1958         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): Deleted.
1959         (WebKit::ViewGestureController::PendingSwipeTracker::reset): Deleted.
1960         (WebKit::ViewGestureController::willEndSwipeGesture): Deleted.
1961         (WebKit::ViewGestureController::shouldUseSnapshotForSize): Deleted.
1962         (WebKit::ViewGestureController::isPhysicallySwipingLeft const): Deleted.
1963         (WebKit::ViewGestureController::endSwipeGesture): Deleted.
1964         (WebKit::ViewGestureController::forceRepaintIfNeeded): Deleted.
1965         (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): Deleted.
1966         * UIProcess/mac/ViewSnapshotStoreMac.mm: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm.
1967         (WebKit::ViewSnapshotStore::snapshottingContext):
1968         (WebKit::ViewSnapshot::create):
1969         (WebKit::ViewSnapshot::ViewSnapshot):
1970         (WebKit::ViewSnapshot::setSurface):
1971         (WebKit::ViewSnapshot::hasImage const):
1972         (WebKit::ViewSnapshot::clearImage):
1973         (WebKit::ViewSnapshot::setVolatile):
1974         (WebKit::ViewSnapshot::asLayerContents):
1975         (WebKit::ViewSnapshot::asImageForTesting):
1976         * WebKit.xcodeproj/project.pbxproj:
1977         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
1978         Make SetRenderTreeSizeNotificationThreshold() cross-platform.
1979         (WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
1980         (WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):
1981         (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
1982         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
1983         * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
1984         * WebProcess/WebPage/WebPage.cpp:
1985         Start using ViewGestureGeometryCollector for GTK.
1986         (WebKit::WebPage::mainFrameDidLayout):
1987         * WebProcess/WebPage/WebPage.h:
1988
1989 2019-02-08  Alex Christensen  <achristensen@webkit.org>
1990
1991         Add SPI to use networking daemon instead of XPC service
1992         https://bugs.webkit.org/show_bug.cgi?id=194427
1993
1994         Reviewed by Geoffrey Garen.
1995
1996         There is still work to be done, but with the proper plist it starts and loads webpages!
1997
1998         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
1999         (WebKit::DaemonMain):
2000         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2001         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2002         (WebKit::XPCEventHandler):
2003         (WebKit::XPCInitializationHandler):
2004         (WebKit::XPCServiceMain):
2005         (WebKit::XPCServiceEventHandler): Deleted.
2006         * UIProcess/API/APIProcessPoolConfiguration.h:
2007         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2008         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2009         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
2010         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
2011         * UIProcess/AuxiliaryProcessProxy.cpp:
2012         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2013         * UIProcess/Launcher/ProcessLauncher.h:
2014         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2015         (WebKit::serviceName):
2016         (WebKit::ProcessLauncher::launchProcess):
2017         * UIProcess/Network/NetworkProcessProxy.cpp:
2018         (WebKit::NetworkProcessProxy::getLaunchOptions):
2019         * UIProcess/WebProcessPool.cpp:
2020         (WebKit::WebProcessPool::usesNetworkingDaemon const):
2021         * UIProcess/WebProcessPool.h:
2022
2023 2019-02-08  Truitt Savell  <tsavell@apple.com>
2024
2025         Unreviewed, rolling out r241197.
2026
2027         Broke iOS Simulator Debug build and casued 1 API failure on
2028         High Sierra
2029
2030         Reverted changeset:
2031
2032         "Add SPI to use networking daemon instead of XPC service"
2033         https://bugs.webkit.org/show_bug.cgi?id=194427
2034         https://trac.webkit.org/changeset/241197
2035
2036 2019-02-08  Beth Dakin  <bdakin@apple.com>
2037
2038         Abstract and discussion comments needed for afterScreenUpdates
2039         https://bugs.webkit.org/show_bug.cgi?id=194442
2040
2041         Reviewed by Wenson Hsieh.
2042
2043         Forgot to add these comments with https://bugs.webkit.org/show_bug.cgi?id=194362
2044         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2045
2046 2019-02-08  Beth Dakin  <bdakin@apple.com>
2047
2048         Add afterScreenUpdates to WKSnapshotConfiguration
2049         https://bugs.webkit.org/show_bug.cgi?id=194362
2050         -and corresponding-
2051         <rdar://problem/40655528> Please add an "after screen updates" property to 
2052         WKSnapshotConfiguration (to solve blank snapshots)
2053
2054         Reviewed by Tim Horton.
2055
2056         This is the WebKit equivalent of - (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates;
2057         This makes our snapshotting API more predictable and reliable on iOS devices, 
2058         which is why the new configuration property defaults to YES.
2059
2060         New property that defaults to YES.
2061         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2062         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
2063         (-[WKSnapshotConfiguration init]):
2064         (-[WKSnapshotConfiguration copyWithZone:]):
2065
2066         When afterScreenUpdates is set, invoke the snapshot via 
2067         callAfterNextPresentationUpdate.
2068         * UIProcess/API/Cocoa/WKWebView.mm:
2069         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
2070         (-[WKWebView _callCompletionHandler:withSnapshotImage:atDeviceScale:]):
2071
2072 2019-02-08  Alex Christensen  <achristensen@webkit.org>
2073
2074         Add SPI to use networking daemon instead of XPC service
2075         https://bugs.webkit.org/show_bug.cgi?id=194427
2076
2077         Reviewed by Geoffrey Garen.
2078
2079         There is still work to be done, but with the proper plist it starts and loads webpages!
2080
2081         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
2082         (WebKit::DaemonMain):
2083         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2084         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2085         (WebKit::XPCEventHandler):
2086         (WebKit::XPCInitializationHandler):
2087         (WebKit::XPCServiceMain):
2088         (WebKit::XPCServiceEventHandler): Deleted.
2089         * UIProcess/API/APIProcessPoolConfiguration.h:
2090         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2091         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2092         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]):
2093         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]):
2094         * UIProcess/AuxiliaryProcessProxy.cpp:
2095         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2096         * UIProcess/Launcher/ProcessLauncher.h:
2097         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2098         (WebKit::serviceName):
2099         (WebKit::ProcessLauncher::launchProcess):
2100         * UIProcess/Network/NetworkProcessProxy.cpp:
2101         (WebKit::NetworkProcessProxy::getLaunchOptions):
2102         * UIProcess/WebProcessPool.cpp:
2103         (WebKit::WebProcessPool::usesNetworkingDaemon const):
2104         * UIProcess/WebProcessPool.h:
2105
2106 2019-02-08  Keith Rollin  <krollin@apple.com>
2107
2108         Unreviewed build fix.
2109
2110         r241135 modified how entitlements were built up for the macOS. Those
2111         changes broke the iOSMac builds. Bring back some deletions in order to
2112         fix iOSMac.
2113
2114         * Configurations/PluginService.64.xcconfig:
2115         * Configurations/PluginService.entitlements: Added.
2116         * WebKit.xcodeproj/project.pbxproj:
2117
2118 2019-02-07  Chris Dumez  <cdumez@apple.com>
2119
2120         Mark more heap-allocated classes as fast allocated
2121         https://bugs.webkit.org/show_bug.cgi?id=194422
2122
2123         Reviewed by Ryosuke Niwa.
2124
2125         * NetworkProcess/NetworkLoad.cpp:
2126         * NetworkProcess/NetworkLoadChecker.h:
2127         * NetworkProcess/NetworkResourceLoader.cpp:
2128         * Platform/IPC/Connection.h:
2129         * Platform/IPC/mac/ImportanceAssertion.h:
2130         * PluginProcess/PluginCreationParameters.h:
2131         * Shared/API/Cocoa/RemoteObjectRegistry.h:
2132         * Shared/WebEvent.h:
2133         * UIProcess/API/APIHTTPCookieStore.cpp:
2134         * UIProcess/API/APINotificationProvider.h:
2135         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
2136         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2137         * UIProcess/API/Cocoa/WKWebView.mm:
2138         (-[WKWebView _setInputDelegate:]):
2139         * UIProcess/API/gtk/PageClientImpl.h:
2140         * UIProcess/BackingStore.h:
2141         * UIProcess/Cocoa/AutomationClient.h:
2142         * UIProcess/Cocoa/DiagnosticLoggingClient.h:
2143         * UIProcess/Cocoa/DownloadClient.h:
2144         * UIProcess/Cocoa/FindClient.h:
2145         * UIProcess/Cocoa/NavigationState.h:
2146         * UIProcess/Cocoa/UIDelegate.h:
2147         * UIProcess/Cocoa/ViewGestureController.h:
2148         * UIProcess/DeviceIdHashSaltStorage.h:
2149         * UIProcess/Downloads/DownloadProxyMap.h:
2150         * UIProcess/Gamepad/UIGamepad.h:
2151         * UIProcess/Notifications/WebNotificationProvider.h:
2152         * UIProcess/ProcessAssertion.h:
2153         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
2154         * UIProcess/WebContextInjectedBundleClient.h:
2155         * UIProcess/WebFormClient.h:
2156         * UIProcess/WebGeolocationProvider.h:
2157         * UIProcess/WebPageProxy.h:
2158         * WebProcess/Automation/WebAutomationSessionProxy.h:
2159         * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h:
2160         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
2161         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
2162         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2163         * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h:
2164         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2165         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
2166         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
2167         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
2168         * WebProcess/Network/webrtc/WebRTCResolver.h:
2169         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2170         * WebProcess/WebPage/DrawingArea.h:
2171
2172 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2173
2174         [iOS] [WK2] Modernize code for applying autocorrection
2175         https://bugs.webkit.org/show_bug.cgi?id=194397
2176
2177         Reviewed by Tim Horton.
2178
2179         * UIProcess/ios/WKContentViewInteraction.h:
2180         * UIProcess/ios/WKContentViewInteraction.mm:
2181         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
2182         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
2183
2184         Use BlockPtr instead of temporarily storing the completion handler.
2185
2186         * WebProcess/WebPage/WebPage.h:
2187         * WebProcess/WebPage/WebPage.messages.in:
2188
2189         Change a LegacySync to Delayed.
2190
2191         * WebProcess/WebPage/ios/WebPageIOS.mm:
2192         (WebKit::WebPage::applyAutocorrection):
2193         (WebKit::WebPage::syncApplyAutocorrection):
2194         (WebKit::WebPage::applyAutocorrectionInternal):
2195
2196 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2197
2198         [iOS] Clicking links in Safari using Apple Pencil is much more difficult after r238475
2199         https://bugs.webkit.org/show_bug.cgi?id=194415
2200         <rdar://problem/47550281>
2201
2202         Reviewed by Tim Horton.
2203
2204         Fix the bug by not firing the Apple-pencil-exclusive tap gesture recognizer in the case where editable images
2205         are disabled. This gesture recognizer is only used for inserting editable images, and currently conflicts with
2206         the synthetic click gesture recognizer used to recognize clicks from generic digitizer inputs.
2207
2208         * UIProcess/ios/WKContentViewInteraction.mm:
2209         (-[WKContentView gestureRecognizerShouldBegin:]):
2210         (-[WKContentView _stylusSingleTapRecognized:]):
2211
2212 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
2213
2214         [macOS] Block coreservicesd in sandbox.
2215         https://bugs.webkit.org/show_bug.cgi?id=192670
2216
2217         Reviewed by Alexey Proskuryakov.
2218
2219         We should block CoreServices in newer versions of macOS. In order to achieve this we need to avoid calling
2220         _RegisterApplication before entering the sandbox, since this call will open up a connection to CoreServices.
2221         The call to _RegisterApplication is moved to ChildProcess::updateProcessName, since it is needed to
2222         successfully update the process name. The call to ChildProcess::updateProcessName is made after entering
2223         the sandbox.
2224
2225         * Shared/AuxiliaryProcess.cpp:
2226         (WebKit::AuxiliaryProcess::initialize):
2227         * WebProcess/cocoa/WebProcessCocoa.mm:
2228         (WebKit::WebProcess::initializeProcessName):
2229         (WebKit::WebProcess::platformInitializeProcess):
2230         * WebProcess/com.apple.WebProcess.sb.in:
2231
2232 2019-02-07  Youenn Fablet  <youenn@apple.com>
2233
2234         Filter out Overconstrainederror.constraint when getUserMedia is not granted
2235         https://bugs.webkit.org/show_bug.cgi?id=194240
2236
2237         Reviewed by Eric Carlson.
2238
2239         Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access.
2240
2241         Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand.
2242
2243         Covered by added test.
2244
2245         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2246         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
2247         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2248         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2249         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2250         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
2251         (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
2252         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2253         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
2254         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
2255         (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
2256         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2257         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
2258         (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
2259         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2260         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted.
2261         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2262         * UIProcess/UserMediaPermissionRequestProxy.h:
2263         (WebKit::UserMediaPermissionRequestProxy::isPending const):
2264         (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs):
2265         (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs):
2266         (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const):
2267         (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const):
2268         (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const):
2269         (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess):
2270         (WebKit::UserMediaPermissionRequestProxy::userMediaID const):
2271         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const):
2272         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const):
2273         (WebKit::UserMediaPermissionRequestProxy::userRequest const):
2274         (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt):
2275         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const):
2276         (WebKit::UserMediaPermissionRequestProxy::audioDevice const):
2277         (WebKit::UserMediaPermissionRequestProxy::videoDevice const):
2278         * UIProcess/WebPageProxy.cpp:
2279         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2280         * UIProcess/WebPageProxy.h:
2281
2282 2019-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2283
2284         [iOS] [WK2] Modernize autocorrection context code
2285         https://bugs.webkit.org/show_bug.cgi?id=194373
2286
2287         Reviewed by Tim Horton.
2288
2289         * Shared/ios/WebAutocorrectionContext.h: Added.
2290         (WebKit::WebAutocorrectionContext::encode const):
2291         (WebKit::WebAutocorrectionContext::decode):
2292
2293         Introduce a WebAutocorrectionContext struct that encapsulates the individual pieces of autocorrection context.
2294         Change to use this instead of a long list of arguments when propagating autocorrection context information over
2295         IPC.
2296
2297         * UIProcess/AutoCorrectionCallback.h:
2298         * UIProcess/WebPageProxy.h:
2299         * UIProcess/WebPageProxy.messages.in:
2300         * UIProcess/ios/WKContentViewInteraction.h:
2301         * UIProcess/ios/WKContentViewInteraction.mm:
2302         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2303         (+[WKAutocorrectionContext autocorrectionContextWithContext:]):
2304         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): Deleted.
2305
2306         Change this constructor to take an entire WebAutocorrectionContext.
2307
2308         * UIProcess/ios/WebPageProxyIOS.mm:
2309         (WebKit::WebPageProxy::autocorrectionContextCallback):
2310         (WebKit::WebPageProxy::requestAutocorrectionContext):
2311         (WebKit::WebPageProxy::autocorrectionContextSync):
2312         (WebKit::WebPageProxy::getAutocorrectionContext): Deleted.
2313         * WebKit.xcodeproj/project.pbxproj:
2314         * WebProcess/WebPage/WebPage.h:
2315         * WebProcess/WebPage/WebPage.messages.in:
2316
2317         Use Delayed instead of LegacySync.
2318
2319         * WebProcess/WebPage/ios/WebPageIOS.mm:
2320         (WebKit::WebPage::autocorrectionContext):
2321
2322         Renamed from computeAutocorrectionContext. This is now a private method on WebPage that uses the focused or main
2323         frame to compute and return a WebAutocorrectionContext.
2324
2325         (WebKit::WebPage::requestAutocorrectionContext):
2326         (WebKit::WebPage::autocorrectionContextSync):
2327
2328         Renamed getAutocorrectionContext to autocorrectionContextSync.
2329
2330         (WebKit::computeAutocorrectionContext): Deleted.
2331         (WebKit::WebPage::getAutocorrectionContext): Deleted.
2332
2333 2019-02-07  Youenn Fablet  <youenn@apple.com>
2334
2335         Simplify applyConstraints callbacks
2336         https://bugs.webkit.org/show_bug.cgi?id=194297
2337
2338         Reviewed by Eric Carlson.
2339
2340         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2341         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
2342         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2343         (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
2344         (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
2345         (WebKit::UserMediaCaptureManager::applyConstraintsFailed):
2346         * WebProcess/cocoa/UserMediaCaptureManager.h:
2347
2348 2019-02-07  Brent Fulgham  <bfulgham@apple.com>
2349
2350         Permit additional IOKit Properties needed by Media PlugIns on older Mac Hardware
2351         https://bugs.webkit.org/show_bug.cgi?id=194412
2352         <rdar://problem/47820615>
2353
2354         Reviewed by Per Arne Vollan.
2355
2356         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2357
2358 2019-02-07  Brent Fulgham  <bfulgham@apple.com>
2359
2360         Permit additional IOKit Properties needed by older Mac Hardware
2361         https://bugs.webkit.org/show_bug.cgi?id=194410
2362         <rdar://problem/47820620>
2363
2364         Reviewed by Per Arne Vollan.
2365
2366         * WebProcess/com.apple.WebProcess.sb.in:
2367
2368 2019-02-07  Brady Eidson  <beidson@apple.com>
2369
2370         Rename the TAKE_DOWNLOAD_ASSERTION macro.
2371
2372         Rubberstamped by Andy Estes.
2373
2374         * NetworkProcess/Downloads/DownloadMap.cpp:
2375         * NetworkProcess/Downloads/DownloadMap.h:
2376
2377 2019-02-07  Keith Rollin  <krollin@apple.com>
2378
2379         Fix XCBuild issue related to codesigning WebContent process
2380         https://bugs.webkit.org/show_bug.cgi?id=193799
2381         <rdar://problem/47533890>
2382
2383         Reviewed by Brent Fulgham.
2384
2385         Building with XCBuild enabled results in the error message "cannot
2386         read entitlement data" when trying to codesign the macOS XPC
2387         processes. The reason for this error message is that there is a build
2388         step that deletes any previous "stale" generated .xcent file before
2389         building up a new one. With XCBuild enabled, the build steps got
2390         re-ordered, such that the step that deletes this file could get
2391         executed after the steps that build up the file. The built-up set of
2392         entitlements is now gone, and the build process fails when `codesign`
2393         tries to access it.
2394
2395         The apparent quick-fix to this problem -- of tweaking dependencies so
2396         that the build steps execute in the desired order -- wouldn't work
2397         with XCBuild. Establishing these dependencies would require both
2398         having multiple build phases produce the same .xcent file as output,
2399         as well as a build phase that has this file as an input and an output.
2400         XCBuild either forbids or frowns upon these configurations.
2401
2402         Ultimately, the solution that worked was to take over complete control
2403         of the codesigning process. This means (a) not specifying a base
2404         .entitlements file that XCode uses to start with (and which was
2405         subsequently altered via custom build scripts), (b) not letting XCode
2406         automatically and silently inject a 'get-task-all' entitlement used to
2407         facilitate debugging (we now add that entitlement by hand), and (c)
2408         building up all of our entitlements by hand via a single custom
2409         script. Because of the addition of this custom script, many other
2410         scripts and entitlements files could now be removed.
2411
2412         * Configurations/BaseXPCService.xcconfig:
2413         * Configurations/Databases-iOS.entitlements: Removed.
2414         * Configurations/Network-OSX-restricted.entitlements: Removed.
2415         * Configurations/Network-OSX-sandbox.entitlements: Removed.
2416         * Configurations/Network-OSX.entitlements: Removed.
2417         * Configurations/NetworkService.xcconfig:
2418         * Configurations/PluginService.64.xcconfig:
2419         * Configurations/PluginService.entitlements: Removed.
2420         * Configurations/WebContent-OSX-sandbox.entitlements: Removed.
2421         * Configurations/WebContent-OSX.entitlements: Removed.
2422         * Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Removed.
2423         * Configurations/WebContentService.xcconfig:
2424         * Scripts/copy-webcontent-resources-to-private-headers.sh:
2425         * Scripts/process-entitlements.sh: Added.
2426         * Scripts/process-network-sandbox-entitlements.sh: Removed.
2427         * Scripts/process-webcontent-or-plugin-entitlements.sh: Removed.
2428         * Scripts/process-webcontent-sandbox-entitlements.sh: Removed.
2429         * WebKit.xcodeproj/project.pbxproj:
2430
2431 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2432
2433         Fix internal build after r241127
2434         https://bugs.webkit.org/show_bug.cgi?id=191394
2435
2436         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2437         Add some (un)availability macros.
2438
2439 2019-02-07  Youenn Fablet  <youenn@apple.com>
2440
2441         Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
2442         https://bugs.webkit.org/show_bug.cgi?id=194312
2443
2444         Reviewed by Eric Carlson.
2445
2446         Sources in UserMediaCaptureManager and Proxy are never removed once added to their HashMap.
2447         Use the 'ended' mechanism to do the clean-up on WebProcess side.
2448         As part of this clean-up, send IPC to UIProcess to do clean-up on proxy side.
2449         On WebProcess crash case, clean-up the proxy as well.
2450
2451         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2452         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2453         (WebKit::UserMediaCaptureManagerProxy::end):
2454         (WebKit::UserMediaCaptureManagerProxy::clear):
2455         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2456         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2457         * UIProcess/WebProcessProxy.cpp:
2458         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
2459         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2460         (WebKit::UserMediaCaptureManager::sourceEnded):
2461         * WebProcess/cocoa/UserMediaCaptureManager.h:
2462
2463 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2464
2465         Print backgrounds preference should be honored instead of WKWebViewConfiguration value
2466         https://bugs.webkit.org/show_bug.cgi?id=194364
2467         <rdar://problem/47627599>
2468
2469         Reviewed by Tim Horton.
2470
2471         Without this patch, changing the preference for printing the background has no effect.
2472         This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu.
2473         Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences
2474         or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore
2475         are used when printing.  Actually printing verifies this change fixes the bug.
2476
2477         * UIProcess/API/Cocoa/WKWebView.mm:
2478         (-[WKWebView _initializeWithConfiguration:]):
2479
2480 2019-02-07  Chris Dumez  <cdumez@apple.com>
2481
2482         Mark DisplayLink as fast allocated
2483         https://bugs.webkit.org/show_bug.cgi?id=194400
2484
2485         Reviewed by Geoffrey Garen.
2486
2487         * UIProcess/mac/DisplayLink.h:
2488
2489 2019-02-07  Per Arne Vollan  <pvollan@apple.com>
2490
2491         [macOS] API test times out after r241026
2492         https://bugs.webkit.org/show_bug.cgi?id=194372
2493
2494         Reviewed by Alex Christensen.
2495
2496         The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026.
2497         A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order
2498         for clients to decide which milestones they would like to listen for.
2499
2500         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
2501         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2502         (layoutMilestones):
2503         (setUpPageLoaderClient):
2504         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2505         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
2506         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2507
2508 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2509
2510         Deprecate WKBundlePageSetDefersLoading
2511         https://bugs.webkit.org/show_bug.cgi?id=191394
2512
2513         Reviewed by Dean Jackson.
2514
2515         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2516         (WKBundlePageSetDefersLoading):
2517         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2518         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2519         (-[WKWebProcessPlugInBrowserContextController _defersLoading]):
2520         (-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]):
2521         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2522
2523 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2524
2525         Digital crown should scroll safe browsing warning on watchOS
2526         https://bugs.webkit.org/show_bug.cgi?id=194363
2527         <rdar://problem/47348124>
2528
2529         Reviewed by Wenson Hsieh.
2530
2531         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
2532         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2533         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
2534         (-[WKSafeBrowsingWarning addContent]):
2535
2536 2019-02-07  Alex Christensen  <achristensen@webkit.org>
2537
2538         Shrink and hyphenate safe browsing warning text on watchOS
2539         https://bugs.webkit.org/show_bug.cgi?id=194361
2540         <rdar://problem/47466549>
2541
2542         Reviewed by Geoffrey Garen.
2543
2544         Some internationalizations use long words that didn't fit on small watches.
2545
2546         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2547         (fontOfSize):
2548         (-[WKSafeBrowsingWarning addContent]):
2549         (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
2550
2551 2019-02-07  Miguel Gomez  <magomez@igalia.com>
2552
2553         [WPE] Implement GStreamer based holepunch
2554         https://bugs.webkit.org/show_bug.cgi?id=193715
2555
2556         Reviewed by Xabier Rodriguez-Calvar.
2557
2558         Add a new parameter to the calls of TextureMapper::drawSolidColor().
2559
2560         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2561         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
2562
2563 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
2564
2565         Unreviewed, rolling out r240759 and r240944.
2566
2567         Some timer uses are done off the main thread, WebCore::Timer
2568         cannot be used
2569
2570         Reverted changesets:
2571
2572         "<rdar://problem/47570443> Responsiveness timers are too
2573         expensive for frequent events"
2574         https://bugs.webkit.org/show_bug.cgi?id=194003
2575         https://trac.webkit.org/changeset/240759
2576
2577         "Use deferrable timer to restart the Responsiveness Timer on
2578         each wheel event"
2579         https://bugs.webkit.org/show_bug.cgi?id=194135
2580         https://trac.webkit.org/changeset/240944
2581
2582 2019-02-06  chris fleizach  <cfleizach@apple.com>
2583
2584         AX:  com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObjectCache]
2585         https://bugs.webkit.org/show_bug.cgi?id=194306
2586         <rdar://problem/47764549>
2587
2588         Reviewed by Zalan Bujtas.
2589
2590         Check the page reference is still valid.
2591         Modernize code in this area.
2592
2593         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2594
2595 2019-02-06  Daniel Bates  <dabates@apple.com>
2596
2597         Move toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm
2598         https://bugs.webkit.org/show_bug.cgi?id=194321
2599
2600         Reviewed by Jer Noble.
2601
2602         Move some code to WebEventFactory so that it can be shared by both WKNavigationAction.mm
2603         and UIDelegate.mm among other benefits.
2604
2605         * Shared/mac/WebEventFactory.h:
2606         * Shared/mac/WebEventFactory.mm:
2607         (WebKit::WebEventFactory::toNSEventModifierFlags):
2608         (WebKit::WebEventFactory::toNSButtonNumber):
2609         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2610         (-[WKNavigationAction modifierFlags]):
2611         (-[WKNavigationAction buttonNumber]):
2612         (toNSEventModifierFlags): Deleted.
2613         (toNSButtonNumber): Deleted.
2614         * UIProcess/Cocoa/UIDelegate.mm:
2615         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
2616         (WebKit::toNSEventModifierFlags): Deleted.
2617
2618 2019-02-06  Andy Estes  <aestes@apple.com>
2619
2620         [Payment Request] It should be possible to require a phonetic name for shipping contacts
2621         https://bugs.webkit.org/show_bug.cgi?id=194311
2622         <rdar://46733045>
2623
2624         Reviewed by Alex Christensen.
2625
2626         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2627         (WebKit::WebPaymentCoordinator::supportsVersion): Deleted.
2628         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2629
2630 2019-02-06  Keith Rollin  <krollin@apple.com>
2631
2632         Really enable the automatic checking and regenerations of .xcfilelists during builds
2633         https://bugs.webkit.org/show_bug.cgi?id=194357
2634         <rdar://problem/47861231>
2635
2636         Reviewed by Chris Dumez.
2637
2638         Bug 194124 was supposed to enable the automatic checking and
2639         regenerating of .xcfilelist files during the build. While related
2640         changes were included in that patch, the change to actually enable the
2641         operation somehow was omitted. This patch actually enables the
2642         operation. The check-xcfilelist.sh scripts now check
2643         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
2644         from the checking.
2645
2646         * Scripts/check-xcfilelists.sh:
2647
2648 2019-02-06  John Wilander  <wilander@apple.com>
2649
2650         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
2651         https://bugs.webkit.org/show_bug.cgi?id=194325
2652         <rdar://problem/47840283>
2653
2654         Reviewed by Chris Dumez.
2655
2656         * Shared/NavigationActionData.cpp:
2657         (WebKit::NavigationActionData::encode const):
2658         (WebKit::NavigationActionData::decode):
2659         * Shared/NavigationActionData.h:
2660             Now holds an optional WebCore::AdClickAttribution object.
2661
2662 2019-02-06  Daniel Bates  <dabates@apple.com>
2663
2664         Fix the Apple Internal build. See <rdar://problem/47860943> for more details.
2665
2666         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
2667         (-[WKFullscreenStackView init]):
2668
2669 2019-02-06  Daniel Bates  <dabates@apple.com>
2670
2671         Standardize on ControlKey instead of CtrlKey
2672         https://bugs.webkit.org/show_bug.cgi?id=194317
2673
2674         Reviewed by Tim Horton.
2675
2676         * Shared/WebEventConversion.cpp:
2677         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2678         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
2679         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
2680         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
2681         (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
2682         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2683         (WebKit::WebEditorClient::handleKeyboardEvent):
2684         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
2685         (WebKit::handleKeyPress):
2686
2687 2019-02-06  Per Arne Vollan  <pvollan@apple.com>
2688
2689         Roll out parts of r238819 since it is a PLT performance regression.
2690         https://bugs.webkit.org/show_bug.cgi?id=194346
2691
2692         Unreviewed performance fix.
2693
2694         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2695         (didStartProvisionalLoadForFrame):
2696         (didReceiveServerRedirectForProvisionalLoadForFrame):
2697         (didFinishLoadForFrame):
2698         (globalObjectIsAvailableForFrame):
2699         (didRemoveFrameFromHierarchy):
2700         (didCommitLoadForFrame):
2701         (didFinishDocumentLoadForFrame):
2702         (didFailProvisionalLoadWithErrorForFrame):
2703         (didFailLoadWithErrorForFrame):
2704         (didSameDocumentNavigationForFrame):
2705         (didLayoutForFrame):
2706         (didReachLayoutMilestone):
2707         (didFirstVisuallyNonEmptyLayoutForFrame):
2708         (didHandleOnloadEventsForFrame):
2709         (userAgentForURL):
2710         (setUpPageLoaderClient):
2711         (willSendRequestForFrame):
2712         (didInitiateLoadForResource):
2713         (didFinishLoadForResource):
2714         (didFailLoadForResource):
2715         (setUpResourceLoadClient):
2716         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
2717         (ResourceLoadClient::ResourceLoadClient): Deleted.
2718         (ResourceLoadClient::loadDelegate const): Deleted.
2719         (ResourceLoadClient::pluginContextController const): Deleted.
2720         (PageLoaderClient::PageLoaderClient): Deleted.
2721         (PageLoaderClient::loadDelegate const): Deleted.
2722         (PageLoaderClient::pluginContextController const): Deleted.
2723         (PageLoaderClient::didStartProvisionalLoadForFrame): Deleted.
2724         (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
2725         (PageLoaderClient::didFinishLoadForFrame): Deleted.
2726         (PageLoaderClient::globalObjectIsAvailableForFrame): Deleted.
2727         (PageLoaderClient::didRemoveFrameFromHierarchy): Deleted.
2728         (PageLoaderClient::didCommitLoadForFrame): Deleted.
2729         (PageLoaderClient::didFinishDocumentLoadForFrame): Deleted.
2730         (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): Deleted.
2731         (PageLoaderClient::didFailLoadWithErrorForFrame): Deleted.
2732         (PageLoaderClient::didSameDocumentNavigationForFrame): Deleted.
2733         (PageLoaderClient::didLayoutForFrame): Deleted.
2734         (PageLoaderClient::didReachLayoutMilestone): Deleted.
2735         (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
2736         (PageLoaderClient::layoutMilestones const): Deleted.
2737         (PageLoaderClient::didHandleOnloadEventsForFrame): Deleted.
2738         (PageLoaderClient::userAgentForURL const): Deleted.
2739         (ResourceLoadClient::willSendRequestForFrame): Deleted.
2740         (ResourceLoadClient::didInitiateLoadForResource): Deleted.
2741         (ResourceLoadClient::didFinishLoadForResource): Deleted.
2742         (ResourceLoadClient::didFailLoadForResource): Deleted.
2743
2744 2019-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
2745
2746         REGRESSION(r240785): [SOUP] Broke cookie persistent storage
2747         https://bugs.webkit.org/show_bug.cgi?id=194209
2748
2749         Reviewed by Carlos Garcia Campos.
2750
2751         I missed a spot when moving the persistent storage parameters from NetworkProcess to
2752         NetworkSession. They have to be initialized separately for the default session.
2753
2754         * UIProcess/soup/WebProcessPoolSoup.cpp:
2755         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2756
2757 2019-02-05  Alex Christensen  <achristensen@webkit.org>
2758
2759         Stop using blobRegistry in NetworkProcess
2760         https://bugs.webkit.org/show_bug.cgi?id=194027
2761
2762         Reviewed by Youenn Fablet.
2763
2764         * NetworkProcess/Downloads/DownloadManager.cpp:
2765         (WebKit::DownloadManager::startDownload):
2766         * NetworkProcess/Downloads/PendingDownload.cpp:
2767         (WebKit::PendingDownload::PendingDownload):
2768         * NetworkProcess/Downloads/PendingDownload.h:
2769         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2770         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
2771         (WebKit::NetworkBlobRegistry::registerBlobURL):
2772         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
2773         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
2774         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
2775         (WebKit::NetworkBlobRegistry::blobSize):
2776         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
2777         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
2778         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
2779         (WebKit::NetworkBlobRegistry::filesInBlob):
2780         (WebKit::NetworkBlobRegistry::singleton): Deleted.
2781         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2782         (WebKit::NetworkBlobRegistry::blobRegistry):
2783         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2784         (WebKit::NetworkConnectionToWebProcess::didClose):
2785         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
2786         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
2787         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
2788         (WebKit::NetworkConnectionToWebProcess::loadPing):
2789         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2790         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
2791         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2792         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
2793         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
2794         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
2795         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
2796         (WebKit::NetworkConnectionToWebProcess::blobSize):
2797         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2798         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
2799         (WebKit::NetworkConnectionToWebProcess::blobRegistry):
2800         * NetworkProcess/NetworkConnectionToWebProcess.h:
2801         * NetworkProcess/NetworkDataTask.cpp:
2802         (WebKit::NetworkDataTask::create):
2803         * NetworkProcess/NetworkDataTaskBlob.cpp:
2804         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2805         * NetworkProcess/NetworkDataTaskBlob.h:
2806         * NetworkProcess/NetworkLoad.cpp:
2807         (WebKit::NetworkLoad::NetworkLoad):
2808         (WebKit::NetworkLoad::initialize):
2809         * NetworkProcess/NetworkLoad.h:
2810         * NetworkProcess/NetworkProcess.cpp:
2811         (WebKit::NetworkProcess::NetworkProcess):
2812         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
2813         * NetworkProcess/NetworkProcess.h:
2814         (WebKit::NetworkProcess::networkBlobRegistry):
2815         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
2816         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
2817         * NetworkProcess/NetworkResourceLoader.cpp:
2818         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
2819         (WebKit::NetworkResourceLoader::startNetworkLoad):
2820         * NetworkProcess/PreconnectTask.cpp:
2821         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2822         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2823
2824 2019-02-05  Daniel Bates  <dabates@apple.com>
2825
2826         Fix a typo in r241006. Substitute Modifier for Modifiers.
2827
2828         * Shared/mac/NativeWebGestureEventMac.mm:
2829         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
2830
2831 2019-02-05  Daniel Bates  <dabates@apple.com>
2832
2833         Attempt to fix the build following r241000
2834         (https://bugs.webkit.org/show_bug.cgi?id=194241)
2835
2836         Substitute OptionSet<WebEvent::Modifier> for Modifiers.
2837
2838         * Shared/mac/NativeWebGestureEventMac.mm:
2839         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
2840         * Shared/mac/WebGestureEvent.h:
2841         (WebKit::WebGestureEvent::WebGestureEvent):
2842
2843 2019-02-05  Truitt Savell  <tsavell@apple.com>
2844
2845         Unreviewed, rolling out r240984.
2846
2847         Revision casued two API timeouts
2848
2849         Reverted changeset:
2850
2851         "Stop using blobRegistry in NetworkProcess"
2852         https://bugs.webkit.org/show_bug.cgi?id=194027
2853         https://trac.webkit.org/changeset/240984
2854
2855 2019-02-05  Youenn Fablet  <youenn@apple.com>
2856
2857         UserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid
2858         https://bugs.webkit.org/show_bug.cgi?id=194246
2859
2860         Reviewed by Eric Carlson.
2861
2862         With PSON enabled, the manager proxy can be destroyed.
2863         It is thus important for its callbacks to check for 'this' to be valid.
2864
2865         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2866         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
2867         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2868         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2869
2870 2019-02-05  Daniel Bates  <dabates@apple.com>
2871
2872         Attempt to fix the build following r241000
2873         (https://bugs.webkit.org/show_bug.cgi?id=194241)
2874
2875         Substitute WebEvent::Modifier::CapsLockKey for WebEvent::CapsLockKey.
2876
2877         * Shared/gtk/WebEventFactory.cpp:
2878         (WebKit::modifiersForEvent):
2879         * Shared/mac/WebEventFactory.mm:
2880         (WebKit::modifiersForEvent):
2881         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2882         (toNSEventModifierFlags):
2883         * UIProcess/Automation/WebAutomationSession.cpp:
2884         (WebKit::protocolModifierToWebEventModifier):
2885         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2886         (WebKit::modifiersToEventState):
2887         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2888         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2889         * UIProcess/Cocoa/UIDelegate.mm:
2890         (WebKit::toNSEventModifierFlags):
2891
2892 2019-02-05  Daniel Bates  <dabates@apple.com>
2893
2894         Make WebEvent::Modifiers an OptionSet
2895         https://bugs.webkit.org/show_bug.cgi?id=194241
2896
2897         Reviewed by Simon Fraser.
2898
2899         Use an OptionSet to represent the bitmask of keyboard modifier flags. This improves type safety
2900         and makes debugging more enjoyable because our LLDB pretty-printers have built-in support for
2901         OptionSet.
2902
2903         While I am at it, make WebEvent::Modifier an enum class. It is currently an enum. This makes
2904         this enum more closely match WebCore::PlatformEvent::Modifier.
2905
2906         * Shared/API/c/WKSharedAPICast.h:
2907         (WebKit::toAPI):
2908         * Shared/NavigationActionData.cpp:
2909         (WebKit::NavigationActionData::encode const):
2910         (WebKit::NavigationActionData::decode):
2911         * Shared/NavigationActionData.h:
2912         * Shared/WebEvent.cpp:
2913         (WebKit::WebEvent::WebEvent):
2914         * Shared/WebEvent.h:
2915         (WebKit::WebEvent::shiftKey const):
2916         (WebKit::WebEvent::controlKey const):
2917         (WebKit::WebEvent::altKey const):
2918         (WebKit::WebEvent::metaKey const):
2919         (WebKit::WebEvent::capsLockKey const):
2920         (WebKit::WebEvent::modifiers const):
2921         (WebKit::WebTouchEvent::WebTouchEvent):
2922         * Shared/WebEventConversion.cpp:
2923         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2924         * Shared/WebKeyboardEvent.cpp:
2925         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2926         * Shared/WebMouseEvent.cpp:
2927         (WebKit::WebMouseEvent::WebMouseEvent):
2928         * Shared/WebTouchEvent.cpp:
2929         (WebKit::WebTouchEvent::WebTouchEvent):
2930         * Shared/WebWheelEvent.cpp:
2931         (WebKit::WebWheelEvent::WebWheelEvent):
2932         * Shared/gtk/WebEventFactory.cpp:
2933         (WebKit::modifiersForEvent):
2934         * Shared/ios/NativeWebTouchEventIOS.mm:
2935         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
2936         * Shared/ios/WebIOSEventFactory.mm:
2937         (modifiersForEvent):
2938         (WebIOSEventFactory::createWebKeyboardEvent):
2939         (WebIOSEventFactory::createWebMouseEvent):
2940         * Shared/libwpe/WebEventFactory.cpp:
2941         (WebKit::modifiersForEventModifiers):
2942         (WebKit::WebEventFactory::createWebWheelEvent):
2943         (WebKit::WebEventFactory::createWebTouchEvent):
2944         * Shared/mac/WebEventFactory.mm:
2945         (WebKit::modifiersForEvent):
2946         (WebKit::WebEventFactory::createWebMouseEvent):
2947         (WebKit::WebEventFactory::createWebWheelEvent):
2948         (WebKit::WebEventFactory::createWebKeyboardEvent):
2949         * Shared/win/WebEventFactory.cpp:
2950         (WebKit::modifiersForEvent):
2951         (WebKit::modifiersForCurrentKeyState):
2952         (WebKit::WebEventFactory::createWebMouseEvent):
2953         (WebKit::WebEventFactory::createWebWheelEvent):
2954         (WebKit::WebEventFactory::createWebKeyboardEvent):
2955         * UIProcess/API/APINavigationAction.h:
2956         * UIProcess/API/APIUIClient.h:
2957         (API::UIClient::mouseDidMoveOverElement):
2958         * UIProcess/API/C/WKPage.cpp:
2959         (WKPageSetPageUIClient):
2960         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2961         (toNSEventModifierFlags):
2962         * UIProcess/API/glib/WebKitPrivate.cpp:
2963         (toPlatformModifiers):
2964         * UIProcess/API/glib/WebKitPrivate.h:
2965         * UIProcess/API/glib/WebKitUIClient.cpp:
2966         * UIProcess/API/glib/WebKitWebView.cpp:
2967         (webkitWebViewMouseTargetChanged):
2968         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2969         * UIProcess/Automation/WebAutomationSession.cpp:
2970         (WebKit::WebAutomationSession::simulateMouseInteraction):
2971         (WebKit::protocolModifierToWebEventModifier):
2972         (WebKit::WebAutomationSession::performMouseInteraction):
2973         * UIProcess/Automation/WebAutomationSession.h:
2974         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2975         (WebKit::modifiersToEventState):
2976         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2977         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2978         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2979         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
2980         (WebKit::modifiersToEventState):
2981         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2982         * UIProcess/Cocoa/UIDelegate.h:
2983         * UIProcess/Cocoa/UIDelegate.mm:
2984         (WebKit::toNSEventModifierFlags):
2985         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
2986         * UIProcess/WebPageProxy.cpp:
2987         (WebKit::WebPageProxy::mouseDidMoveOverElement):
2988         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2989         (API::InjectedBundle::PageUIClient::mouseDidMoveOverElement):
2990         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2991         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
2992         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
2993         (WebKit::InjectedBundleNavigationAction::modifiers const):
2994         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2995         (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
2996         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
2997         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2998         (WebKit::PDFPlugin::showContextMenuAtPoint):
2999         * WebProcess/Plugins/PluginView.cpp:
3000         (WebKit::PluginView::createWebEvent const):
3001         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3002         (WebKit::WebChromeClient::mouseDidMoveOverElement):
3003         * WebProcess/WebPage/WebPage.cpp:
3004         (WebKit::WebPage::simulateMouseDown):
3005         (WebKit::WebPage::simulateMouseUp):
3006         (WebKit::WebPage::simulateMouseMotion):
3007
3008 2019-02-05  Tim Horton  <timothy_horton@apple.com>
3009
3010         Reproducible crash under WKShareSheet presentWithParameters when cancelling a share
3011         https://bugs.webkit.org/show_bug.cgi?id=194301
3012         <rdar://problem/47719379>
3013
3014         Reviewed by Beth Dakin.
3015
3016         * UIProcess/Cocoa/WKShareSheet.mm:
3017         (-[WKShareSheet presentWithParameters:completionHandler:]):
3018         NSSharingServicePicker's delegate callbacks can be called synchronously.
3019         We release the WKShareSheet (which holds our reference to the NSSharingServicePicker)
3020         under sharingServicePicker:didChooseSharingService:. On older versions of macOS,
3021         there was nothing keeping the NSSharingServicePicker alive inside
3022         showRelativeToRect:ofView:preferredEdge:, thus the whole chain of references would
3023         fall and result in sending a message to a released NSSharingServicePicker.
3024         To resolve this, keep an extra reference to the WKShareSheet until
3025         presentation is complete.
3026
3027 2019-02-05  Keith Rollin  <krollin@apple.com>
3028
3029         Enable the automatic checking and regenerations of .xcfilelists during builds
3030         https://bugs.webkit.org/show_bug.cgi?id=194124
3031         <rdar://problem/47721277>
3032
3033         Reviewed by Tim Horton.
3034
3035         Bug 193790 add a facility for checking -- during build time -- that
3036         any needed .xcfilelist files are up-to-date and for updating them if
3037         they are not. This facility was initially opt-in by setting
3038         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
3039         the process seemed robust. Its now time to enable this facility and
3040         make it opt-out. If there is a need to disable this facility, set and
3041         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
3042         running `make` or `build-webkit`, or before running Xcode from the
3043         command line.
3044
3045         Additionally, remove the step that generates a list of source files
3046         going into the UnifiedSources build step. It's only necessarily to
3047         specify Sources.txt and SourcesCocoa.txt as inputs.
3048
3049         * UnifiedSources-input.xcfilelist: Removed.
3050         * WebKit.xcodeproj/project.pbxproj:
3051
3052 2019-02-05  Brady Eidson  <beidson@apple.com>
3053
3054         Add a new DownloadMap type that manages taking an assertion automatically.
3055         https://bugs.webkit.org/show_bug.cgi?id=194294
3056
3057         Reviewed by Alex Christensen.
3058
3059         If we don't need the download assertion, we use a vanilla HashMap like today.
3060         If we need the download assertion, we use the new DownloadMap class instead.
3061
3062         The new DownloadMap is a wrapper around a HashMap that also creates/destroys the assertion as needed.
3063
3064         * NetworkProcess/Downloads/DownloadManager.cpp:
3065         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
3066         (WebKit::DownloadManager::downloadFinished):
3067         * NetworkProcess/Downloads/DownloadManager.h:
3068
3069         * NetworkProcess/Downloads/DownloadMap.cpp: Added.
3070         (WebKit::DownloadMap::get const):
3071         (WebKit::DownloadMap::isEmpty const):
3072         (WebKit::DownloadMap::size const):
3073         (WebKit::DownloadMap::contains const):
3074         (WebKit::DownloadMap::add):
3075         (WebKit::DownloadMap::remove):
3076         * NetworkProcess/Downloads/DownloadMap.h: Added.
3077
3078         * Sources.txt:
3079
3080         * UIProcess/ios/ProcessAssertionIOS.mm:
3081         (WebKit::ProcessAssertion::ProcessAssertion):
3082
3083         * WebKit.xcodeproj/project.pbxproj:
3084
3085 2019-02-05  Brady Eidson  <beidson@apple.com>
3086
3087         Fix iOS simulator build after r240954
3088
3089         Unreviewed.
3090
3091         * UIProcess/ios/ProcessAssertionIOS.mm:
3092         (WebKit::ProcessAssertion::ProcessAssertion): Implement the new constructor.
3093
3094 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3095
3096         Stop using blobRegistry in NetworkProcess
3097         https://bugs.webkit.org/show_bug.cgi?id=194027
3098
3099         Reviewed by Youenn Fablet.
3100
3101         * NetworkProcess/Downloads/DownloadManager.cpp:
3102         (WebKit::DownloadManager::startDownload):
3103         * NetworkProcess/Downloads/PendingDownload.cpp:
3104         (WebKit::PendingDownload::PendingDownload):
3105         * NetworkProcess/Downloads/PendingDownload.h:
3106         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3107         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
3108         (WebKit::NetworkBlobRegistry::registerBlobURL):
3109         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
3110         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
3111         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
3112         (WebKit::NetworkBlobRegistry::blobSize):
3113         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
3114         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
3115         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
3116         (WebKit::NetworkBlobRegistry::filesInBlob):
3117         (WebKit::NetworkBlobRegistry::singleton): Deleted.
3118         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3119         (WebKit::NetworkBlobRegistry::blobRegistry):
3120         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3121         (WebKit::NetworkConnectionToWebProcess::didClose):
3122         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
3123         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
3124         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
3125         (WebKit::NetworkConnectionToWebProcess::loadPing):
3126         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
3127         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
3128         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3129         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
3130         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
3131         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
3132         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
3133         (WebKit::NetworkConnectionToWebProcess::blobSize):
3134         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
3135         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
3136         (WebKit::NetworkConnectionToWebProcess::blobRegistry):
3137         * NetworkProcess/NetworkConnectionToWebProcess.h:
3138         * NetworkProcess/NetworkDataTask.cpp:
3139         (WebKit::NetworkDataTask::create):
3140         * NetworkProcess/NetworkDataTaskBlob.cpp:
3141         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3142         * NetworkProcess/NetworkDataTaskBlob.h:
3143         * NetworkProcess/NetworkLoad.cpp:
3144         (WebKit::NetworkLoad::NetworkLoad):
3145         (WebKit::NetworkLoad::initialize):
3146         * NetworkProcess/NetworkLoad.h:
3147         * NetworkProcess/NetworkProcess.cpp:
3148         (WebKit::NetworkProcess::NetworkProcess):
3149         (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
3150         * NetworkProcess/NetworkProcess.h:
3151         (WebKit::NetworkProcess::networkBlobRegistry):
3152         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
3153         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
3154         * NetworkProcess/NetworkResourceLoader.cpp:
3155         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
3156         (WebKit::NetworkResourceLoader::startNetworkLoad):
3157         * NetworkProcess/PreconnectTask.cpp:
3158         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3159         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3160
3161 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
3162
3163         Unreviewed, rolling out r240742.
3164
3165         Causes crashes on iOS simulator.
3166
3167         Reverted changeset:
3168
3169         "[iOS] Keyups for non-modifier keys identified as "Dead" when
3170         not focused in a content-editable element"
3171         https://bugs.webkit.org/show_bug.cgi?id=192824
3172         https://trac.webkit.org/changeset/240742
3173
3174 2019-02-05  Alex Christensen  <achristensen@webkit.org>
3175
3176         Protect globalWebSocketStreamMap with a Lock
3177         https://bugs.webkit.org/show_bug.cgi?id=194224
3178         <rdar://problem/47581081>
3179
3180         Reviewed by Ryosuke Niwa.
3181
3182         * WebProcess/Network/WebSocketStream.cpp:
3183         (WebKit::WebSocketStream::streamWithIdentifier):
3184         (WebKit::WebSocketStream::networkProcessCrashed):
3185         (WebKit::WebSocketStream::WebSocketStream):
3186         (WebKit::WebSocketStream::~WebSocketStream):
3187
3188 2019-02-04  Alex Christensen  <achristensen@webkit.org>
3189
3190         Add Networking Daemon skeleton
3191         https://bugs.webkit.org/show_bug.cgi?id=194278
3192
3193         Reviewed by Zalan Bujtas.
3194
3195         Daemon skeletons? This is spooky stuff.
3196
3197         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added.
3198         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added.
3199         (WebKit::DaemonMain):
3200         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3201         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3202         (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
3203         * Shared/API/Cocoa/WKMain.h:
3204         * Shared/API/Cocoa/WKMain.mm:
3205         (WKDaemonMain):
3206         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:
3207         (main):
3208         * SourcesCocoa.txt:
3209         * UnifiedSources-input.xcfilelist:
3210         * WebKit.xcodeproj/project.pbxproj:
3211
3212 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
3213
3214         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
3215         https://bugs.webkit.org/show_bug.cgi?id=193993
3216
3217         Reviewed by Keith Miller.
3218
3219         * WebProcess/Plugins/Netscape/JSNPMethod.h:
3220         * WebProcess/Plugins/Netscape/JSNPObject.h:
3221
3222 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
3223
3224         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
3225         https://bugs.webkit.org/show_bug.cgi?id=194245
3226
3227         Reviewed by Zalan Bujtas.
3228
3229         Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY).
3230
3231         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3232         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3233
3234 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
3235
3236         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3237         https://bugs.webkit.org/show_bug.cgi?id=174816
3238
3239         Reviewed by Michael Catanzaro.
3240
3241         Add webkit_uri_for_display for GTK and WPE.
3242
3243         * PlatformGTK.cmake:
3244         * PlatformWPE.cmake:
3245         * SourcesGTK.txt:
3246         * SourcesWPE.txt:
3247         * UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
3248         (webkit_uri_for_display):
3249         * UIProcess/API/gtk/WebKitURIUtilities.h: Added.
3250         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3251         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3252         * UIProcess/API/gtk/webkit2.h:
3253         * UIProcess/API/wpe/WebKitURIUtilities.h: Added.
3254         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
3255         * UIProcess/API/wpe/docs/wpe-docs.sgml:
3256         * UIProcess/API/wpe/webkit.h:
3257
3258 2019-02-04  Alex Christensen  <achristensen@webkit.org>
3259
3260         Move XPCService main to a shared file calling a C function
3261         https://bugs.webkit.org/show_bug.cgi?id=194256
3262
3263         Reviewed by Brady Eidson.
3264
3265         This not only reduces a few kilobytes of duplicated binary from the XPCService executables,
3266         It will allow me to introduce a new kind of executable which will need to parse argv and call a different C function.
3267         This is similar to r236075 but more general.
3268
3269         * Shared/API/Cocoa/WKMain.h: Added.
3270         * Shared/API/Cocoa/WKMain.mm: Added.
3271         (WKXPCServiceMain):
3272         * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
3273         (main):
3274         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
3275         (main): Deleted.
3276         * SourcesCocoa.txt:
3277         * WebKit.xcodeproj/project.pbxproj:
3278
3279 2019-02-04  Alex Christensen  <achristensen@webkit.org>
3280
3281         Make MessageSender functions const
3282         https://bugs.webkit.org/show_bug.cgi?id=194247
3283
3284         Reviewed by Brady Eidson.
3285
3286         * NetworkProcess/Downloads/Download.cpp:
3287         (WebKit::Download::messageSenderConnection const):
3288         (WebKit::Download::messageSenderDestinationID const):
3289         (WebKit::Download::messageSenderConnection): Deleted.
3290         (WebKit::Download::messageSenderDestinationID): Deleted.
3291         * NetworkProcess/Downloads/Download.h:
3292         * NetworkProcess/Downloads/PendingDownload.cpp:
3293         (WebKit::PendingDownload::messageSenderConnection const):
3294         (WebKit::PendingDownload::messageSenderDestinationID const):
3295         (WebKit::PendingDownload::messageSenderConnection): Deleted.
3296         (WebKit::PendingDownload::messageSenderDestinationID): Deleted.
3297         * NetworkProcess/Downloads/PendingDownload.h:
3298         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3299         (WebKit::WebIDBConnectionToClient::messageSenderConnection const):
3300         (WebKit::WebIDBConnectionToClient::messageSenderConnection): Deleted.
3301         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
3302         * NetworkProcess/NetworkResourceLoader.cpp:
3303         (WebKit::NetworkResourceLoader::messageSenderConnection const):
3304         (WebKit::NetworkResourceLoader::messageSenderConnection): Deleted.
3305         * NetworkProcess/NetworkResourceLoader.h:
3306         * NetworkProcess/NetworkSocketStream.cpp:
3307         (WebKit::NetworkSocketStream::messageSenderConnection const):
3308         (WebKit::NetworkSocketStream::messageSenderDestinationID const):
3309         (WebKit::NetworkSocketStream::messageSenderConnection): Deleted.
3310         (WebKit::NetworkSocketStream::messageSenderDestinationID): Deleted.
3311         * NetworkProcess/NetworkSocketStream.h:
3312         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
3313         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3314         (WebKit::WebSWServerToContextConnection::messageSenderConnection const):
3315         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID const):
3316         (WebKit::WebSWServerToContextConnection::messageSenderConnection): Deleted.
3317         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID): Deleted.
3318         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
3319         * Platform/IPC/MessageSender.h:
3320         * Shared/AuxiliaryProcess.cpp:
3321         (WebKit::AuxiliaryProcess::messageSenderConnection const):
3322         (WebKit::AuxiliaryProcess::messageSenderDestinationID const):
3323         (WebKit::AuxiliaryProcess::messageSenderConnection): Deleted.
3324         (WebKit::AuxiliaryProcess::messageSenderDestinationID): Deleted.
3325         * Shared/AuxiliaryProcess.h:
3326         * UIProcess/WebConnectionToWebProcess.cpp:
3327         (WebKit::WebConnectionToWebProcess::messageSenderConnection const):
3328         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID const):
3329         (WebKit::WebConnectionToWebProcess::messageSenderConnection): Deleted.
3330         (WebKit::WebConnectionToWebProcess::messageSenderDestinationID): Deleted.
3331         * UIProcess/WebConnectionToWebProcess.h:
3332         * UIProcess/WebPageProxy.cpp:
3333         (WebKit::WebPageProxy::messageSenderConnection const):
3334         (WebKit::WebPageProxy::messageSenderDestinationID const):
3335         (WebKit::WebPageProxy::messageSenderConnection): Deleted.
3336         (WebKit::WebPageProxy::messageSenderDestinationID): Deleted.
3337         * UIProcess/WebPageProxy.h:
3338         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3339         (WebKit::WebIDBConnectionToServer::messageSenderConnection const):
3340         (WebKit::WebIDBConnectionToServer::messageSenderConnection): Deleted.
3341         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3342         * WebProcess/Network/WebResourceLoader.cpp:
3343         (WebKit::WebResourceLoader::messageSenderConnection const):
3344         (WebKit::WebResourceLoader::messageSenderDestinationID const):
3345         (WebKit::WebResourceLoader::messageSenderConnection): Deleted.
3346         (WebKit::WebResourceLoader::messageSenderDestinationID): Deleted.
3347         * WebProcess/Network/WebResourceLoader.h:
3348         * WebProcess/Network/WebSocketStream.cpp:
3349         (WebKit::WebSocketStream::messageSenderConnection const):
3350         (WebKit::WebSocketStream::messageSenderDestinationID const):
3351         (WebKit::WebSocketStream::messageSenderConnection): Deleted.
3352         (WebKit::WebSocketStream::messageSenderDestinationID): Deleted.
3353         * WebProcess/Network/WebSocketStream.h:
3354         * WebProcess/Storage/WebSWClientConnection.h:
3355         * WebProcess/WebConnectionToUIProcess.cpp:
3356         (WebKit::WebConnectionToUIProcess::messageSenderConnection const):
3357         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID const):
3358         (WebKit::WebConnectionToUIProcess::messageSenderConnection): Deleted.
3359         (WebKit::WebConnectionToUIProcess::messageSenderDestinationID): Deleted.
3360         * WebProcess/WebConnectionToUIProcess.h:
3361         * WebProcess/WebPage/WebPage.cpp:
3362         (WebKit::WebPage::messageSenderConnection const):
3363         (WebKit::WebPage::messageSenderDestinationID const):
3364         (WebKit::WebPage::messageSenderConnection): Deleted.
3365         (WebKit::WebPage::messageSenderDestinationID): Deleted.
3366         * WebProcess/WebPage/WebPage.h:
3367
3368 2019-02-04  Brady Eidson  <beidson@apple.com>
3369
3370         Take additional process assertion while downloading.
3371         <rdar://problem/47741356> and https://bugs.webkit.org/show_bug.cgi?id=194239
3372
3373         Reviewed by Chris Dumez.
3374
3375         When the first download starts, grab this new assertion.
3376         When the last download ends, release it.
3377
3378         * Configurations/Network-iOS.entitlements:
3379
3380         * NetworkProcess/Downloads/DownloadManager.cpp:
3381         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
3382         (WebKit::DownloadManager::downloadFinished):
3383         * NetworkProcess/Downloads/DownloadManager.h:
3384
3385         * Platform/spi/ios/AssertionServicesSPI.h:
3386
3387         * UIProcess/ProcessAssertion.cpp:
3388         (WebKit::ProcessAssertion::ProcessAssertion):
3389         * UIProcess/ProcessAssertion.h:
3390         (WebKit::ProcessAssertion::ProcessAssertion):
3391
3392         * UIProcess/WebProcessProxy.cpp:
3393         (WebKit::WebProcessProxy::didSetAssertionState):
3394
3395         * UIProcess/ios/ProcessAssertionIOS.mm:
3396         (WebKit::flagsForState):
3397         (WebKit::reasonForState):
3398         (WebKit::ProcessAssertion::ProcessAssertion):
3399
3400 2019-02-04  Said Abou-Hallawa  <said@apple.com>
3401
3402         [CG] Enable setAdditionalSupportedImageTypes for WK1
3403         https://bugs.webkit.org/show_bug.cgi?id=194190
3404
3405         Reviewed by Tim Horton.
3406
3407         Move the function webCoreStringVectorFromNSStringArray from WebKit to
3408         WebCore so it can be used by both WebKit and WebKitLegacy.
3409
3410         * Platform/mac/StringUtilities.h:
3411         * Platform/mac/StringUtilities.mm:
3412         (WebKit::webCoreStringVectorFromNSStringArray): Deleted.
3413         * UIProcess/API/Cocoa/WKWebView.mm:
3414         (-[WKWebView _initializeWithConfiguration:]):
3415
3416 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
3417
3418         Use deferrable timer to restart the Responsiveness Timer on each wheel event
3419         https://bugs.webkit.org/show_bug.cgi?id=194135
3420
3421         Reviewed by Simon Fraser.