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