REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-13  Chris Dumez  <cdumez@apple.com>
2
3         REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using Cmd-left/right arrow to navigate
4         https://bugs.webkit.org/show_bug.cgi?id=195684
5         <rdar://problem/48294714>
6
7         Reviewed by Antti Koivisto.
8
9         * Shared/NavigationActionData.cpp:
10         (WebKit::NavigationActionData::encode const):
11         (WebKit::NavigationActionData::decode):
12         * Shared/NavigationActionData.h:
13         * UIProcess/WebPageProxy.cpp:
14         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
15         (WebKit::WebPageProxy::backForwardAddItem):
16         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
17         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
18
19 2019-03-13  Chris Dumez  <cdumez@apple.com>
20
21         Drop legacy WebCore::toRegistrableDomain() utility function
22         https://bugs.webkit.org/show_bug.cgi?id=195637
23
24         Reviewed by Geoffrey Garen.
25
26         Drop legacy toRegistrableDomain() / registrableDomainAreEqual() utility functions.
27         Update call sites to use modern RegistrableDomain type instead.
28
29         * UIProcess/WebProcessPool.cpp:
30         (WebKit::WebProcessPool::processForNavigationInternal):
31
32 2019-03-12  Brady Eidson  <beidson@apple.com>
33
34         Take UnboundedNetworking assertion when a file upload is in progress.
35         https://bugs.webkit.org/show_bug.cgi?id=195497
36
37         Reviewed by Geoff Garen.
38
39         This patch implements whole bunch of bookkeeping in both the Networking and UI processes.
40
41         The TLDR of that bookkeeping is:
42         - Whenever any uploads are in progress, take an assertion for both Networking and UI processes.
43         - Whenever a particular WebProcess has an upload in progress, take an assertion for it.
44
45         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
46         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
47         (WebKit::NetworkConnectionToWebProcess::setProcessIdentifier):
48         (WebKit::NetworkConnectionToWebProcess::setConnectionHasUploads):
49         (WebKit::NetworkConnectionToWebProcess::clearConnectionHasUploads):
50         * NetworkProcess/NetworkConnectionToWebProcess.h:
51         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
52
53         * NetworkProcess/NetworkResourceLoadMap.cpp: Added.
54         (WebKit::NetworkResourceLoadMap::add):
55         (WebKit::NetworkResourceLoadMap::remove):
56         (WebKit::NetworkResourceLoadMap::get const):
57         * NetworkProcess/NetworkResourceLoadMap.h: Added.
58         (WebKit::NetworkResourceLoadMap::NetworkResourceLoadMap):
59         (WebKit::NetworkResourceLoadMap::isEmpty const):
60         (WebKit::NetworkResourceLoadMap::contains const):
61         (WebKit::NetworkResourceLoadMap::begin):
62         (WebKit::NetworkResourceLoadMap::values):
63
64         * NetworkProcess/NetworkSession.cpp:
65  
66        * Scripts/webkit/messages.py:
67
68         * Sources.txt:
69
70         * UIProcess/Network/NetworkProcessProxy.cpp:
71         (WebKit::NetworkProcessProxy::takeUploadAssertion):
72         (WebKit::NetworkProcessProxy::clearUploadAssertion):
73         * UIProcess/Network/NetworkProcessProxy.h:
74
75         * UIProcess/WebProcessPool.cpp:
76         (WebKit::WebProcessPool::setWebProcessHasUploads):
77         (WebKit::WebProcessPool::clearWebProcessHasUploads):
78         * UIProcess/WebProcessPool.h:
79         * UIProcess/WebProcessPool.messages.in:
80  
81        * WebKit.xcodeproj/project.pbxproj:
82
83         * WebProcess/WebProcess.cpp:
84         (WebKit::WebProcess::ensureNetworkProcessConnection):
85
86 2019-03-13  Chris Dumez  <cdumez@apple.com>
87
88         Use new RegistrableDomain type in PSON code
89         https://bugs.webkit.org/show_bug.cgi?id=195634
90
91         Reviewed by Youenn Fablet.
92
93         Use new RegistrableDomain type in PSON code instead of more error-prone String type.
94
95         * UIProcess/SuspendedPageProxy.cpp:
96         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
97         * UIProcess/SuspendedPageProxy.h:
98         * UIProcess/WebProcessCache.cpp:
99         (WebKit::WebProcessCache::canCacheProcess const):
100         (WebKit::WebProcessCache::addProcessIfPossible):
101         (WebKit::WebProcessCache::takeProcess):
102         (WebKit::WebProcessCache::clearAllProcessesForSession):
103         * UIProcess/WebProcessCache.h:
104         * UIProcess/WebProcessPool.cpp:
105         (WebKit::WebProcessPool::addProcessToOriginCacheSet):
106         (WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
107         (WebKit::WebProcessPool::processForNavigationInternal):
108         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
109         (WebKit::WebProcessPool::didCollectPrewarmInformation):
110         (WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
111         * UIProcess/WebProcessPool.h:
112         * UIProcess/WebProcessProxy.cpp:
113         (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
114         (WebKit::WebProcessProxy::maybeShutDown):
115         (WebKit::WebProcessProxy::didCollectPrewarmInformation):
116         (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
117         * UIProcess/WebProcessProxy.h:
118         (WebKit::WebProcessProxy::registrableDomain const):
119         * UIProcess/WebProcessProxy.messages.in:
120         * WebProcess/WebProcess.cpp:
121         (WebKit::WebProcess::sendPrewarmInformation):
122
123 2019-03-13  Fujii Hironori  <Hironori.Fujii@sony.com>
124
125         [Win][PlayStation] Remove WebCore::standardUserAgentForURL
126         https://bugs.webkit.org/show_bug.cgi?id=195662
127
128         Reviewed by Ryosuke Niwa.
129
130         * WebProcess/WebPage/win/WebPageWin.cpp:
131         (WebKit::WebPage::platformUserAgent const): Return an empty string as well as mac/ios ports.
132
133 2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
134
135         [Win] Fix a slew of simple clang-cl warnings.
136         https://bugs.webkit.org/show_bug.cgi?id=195652
137
138         Reviewed by Don Olmstead.
139
140         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
141         (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse): -Wswitch
142         * Platform/IPC/win/ConnectionWin.cpp:
143         (IPC::Connection::readEventHandler): -Wunused-variable
144         * Platform/win/LoggingWin.cpp:
145         (WebKit::logLevelString): -Wwritable-strings
146         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
147         (WebKit::ProcessLauncher::launchProcess): -Wunused-variable
148
149 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
150
151         Move the code for determining the need for touch bar quirks to Quirks class
152         https://bugs.webkit.org/show_bug.cgi?id=195654
153
154         Reviewed by Brent Fulgham.
155
156         Moved the code to determine whether touch bar quirks are needed or not to WebCore.
157
158         Also renamed HiddenContentEditableQuirk to IsTouchBarUpdateSupressedForHiddenContentEditable
159         and PlainTextQuirk to NeverRichlyEditableForTouchBar.
160
161         * UIProcess/Cocoa/WebViewImpl.h:
162         (WebKit::WebViewImpl::isRichlyEditableForTouchBar): Renamed.
163         * UIProcess/Cocoa/WebViewImpl.mm:
164         (WebKit::WebViewImpl::updateTouchBar):
165         (WebKit::WebViewImpl::candidateListTouchBarItem const):
166         (WebKit::WebViewImpl::isRichlyEditableForTouchBar const): Renamed from isRichlyEditable.
167         (WebKit::WebViewImpl::textTouchBar const):
168         (WebKit::WebViewImpl::updateTextTouchBar):
169         * UIProcess/WebPageProxy.cpp:
170         (WebKit::WebPageProxy::setIsTouchBarUpdateSupressedForHiddenContentEditable): Renamed from
171         setNeedsHiddenContentEditableQuirk.
172         (WebKit::WebPageProxy::setIsNeverRichlyEditableForTouchBar): Renamed from setNeedsPlainTextQuirk.
173         * UIProcess/WebPageProxy.h:
174         (WebKit::WebPageProxy::isTouchBarUpdateSupressedForHiddenContentEditable const): Renamed from
175         needsHiddenContentEditableQuirk.
176         (WebKit::WebPageProxy::isNeverRichlyEditableForTouchBar const): Renamed from needsPlainTextQuirk.
177         * UIProcess/WebPageProxy.messages.in: Renamed the IPC messages.
178         * WebProcess/WebPage/WebPage.cpp:
179         (WebKit::needsHiddenContentEditableQuirk): Deleted. Moved to WebCore.
180         (WebKit::needsPlainTextQuirk): Deleted. Moved to WebCore.
181         (WebKit::WebPage::didStartPageTransition):
182         (WebKit::WebPage::didChangeSelection):
183         * WebProcess/WebPage/WebPage.h:
184         (WebKit::WebPage):
185
186 2019-03-12  Jiewen Tan  <jiewen_tan@apple.com>
187
188         Add WebFrameProxy::loadData
189         https://bugs.webkit.org/show_bug.cgi?id=195647
190         <rdar://problem/48826856>
191
192         Reviewed by Youenn Fablet.
193
194         This patch adds WebFrameProxy::loadData which is a simplified version of WebPageProxy::loadData that
195         loads substitute data to an iframe. This is needed by the Load Optimizer.
196
197         * UIProcess/WebFrameProxy.cpp:
198         (WebKit::WebFrameProxy::loadData):
199         * UIProcess/WebFrameProxy.h:
200         * WebProcess/WebPage/WebPage.cpp:
201         (WebKit::WebPage::loadDataInFrame):
202         * WebProcess/WebPage/WebPage.h:
203         * WebProcess/WebPage/WebPage.messages.in:
204
205 2019-03-12  Wenson Hsieh  <wenson_hsieh@apple.com>
206
207         [iOS] Input view sometimes flickers when blurring and refocusing an element
208         https://bugs.webkit.org/show_bug.cgi?id=195639
209         <rdar://problem/48735337>
210
211         Reviewed by Tim Horton.
212
213         On iOS, if a focused element is blurred and immediately refocused in the scope of user interaction, we will end
214         up reloading interaction state (input views, autocorrection contexts, etc.) in the UI process. On certain well-
215         trafficked websites, this results in the input view and input accessory view flickering (or more egregiously,
216         scrolling to re-reveal the focused element) when changing selection.
217
218         To fix the issue, this patch refactors some focus management logic to suppress sending focused element updates
219         to the UI process in the case where the same element is being blurred and immediately refocused. To do this, we
220         track the most recently blurred element and bail when the recently blurred element is identical to the newly
221         focused element. See below for more detail.
222
223         Test: fast/forms/ios/keyboard-stability-when-refocusing-element.html
224
225         * UIProcess/WebPageProxy.h:
226         * UIProcess/ios/WKContentViewInteraction.mm:
227         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
228         (-[WKContentView _elementDidBlur]):
229
230         Update the web process' notion of whether an input view is showing. Importantly, this accounts for decisions
231         made by _WKUIDelegate. See below for more details.
232
233         (isAssistableInputType): Deleted.
234
235         Removed this helper function; this was only used in one place as a sanity check that the focused element's type
236         is not none, right before attempting to show an input view. Instead, we can just check the focused element's
237         type directly against InputType::None in the if statement of the early return.
238
239         * UIProcess/ios/WebPageProxyIOS.mm:
240         (WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):
241
242         Add a hook to notify the web process when an input view is showing or not (see below for more detail).
243
244         * WebProcess/WebPage/WebPage.cpp:
245         (WebKit::WebPage::didStartPageTransition):
246         (WebKit::WebPage::elementDidRefocus):
247         (WebKit::WebPage::shouldDispatchUpdateAfterFocusingElement const):
248
249         Add a helper to determine whether we notify the UI process about a newly focused element. On macOS, this is true
250         only when the new focused element is neither the currently focused element, nor the focused element that was
251         just blurred. On iOS, we have an additional constraint that when the input view is not showing, we still need to
252         notify the UI process, since the UI process might want to begin showing the keyboard for an element that has
253         only been programmatically focused, for which we aren't currently showing the input view.
254
255         (WebKit::WebPage::elementDidFocus):
256         (WebKit::WebPage::elementDidBlur):
257
258         Replace a couple of existing member variables in WebPage used for focus management:
259         -   Replace m_hasPendingBlurNotification with m_recentlyBlurredElement, a RefPtr to the Element that is being
260             blurred. Behavior here is the same as before (i.e. having a pending blur notification is equivalent to
261             having recently blurred a focused element). However, this allows us to check newly focused elements against
262             the recently blurred element in WebPage::elementDidFocus().
263         -   Replace m_isFocusingElementDueToUserInteraction with m_isShowingInputViewForFocusedElement. The flag
264             m_isFocusingElementDueToUserInteraction was originally added to fix <webkit.org/b/146735>, by ensuring that
265             we don't send redundant ElementDidFocus (formerly, StartAssistingNode) messages to the UI process even when
266             the keyboard is already up. In these simpler times, user interaction when focusing an element was equivalent
267             to showing an input view for the focused element. However, in today's world, there are a variety of reasons
268             why we might or might not show an input view for a given element (including, but not limited to activity
269             state changes and decisions made by _WKInputDelegate). As such, it doesn't make sense to continue relying on
270             m_isFocusingElementDueToUserInteraction in this early return. Instead, have the UI process propagate a
271             message back to the web process, to let it know whether there is a keyboard showing, and use this flag
272             instead.
273
274         * WebProcess/WebPage/WebPage.h:
275         * WebProcess/WebPage/WebPage.messages.in:
276         * WebProcess/WebPage/ios/WebPageIOS.mm:
277         (WebKit::WebPage::setIsShowingInputViewForFocusedElement):
278
279 2019-03-12  Tim Horton  <timothy_horton@apple.com>
280
281         More attempts at build fixing.
282
283         * UIProcess/ios/WKActionSheetAssistant.mm:
284         Yet more.
285
286 2019-03-12  Chris Dumez  <cdumez@apple.com>
287
288         Device Orientation access permission should be denied unless explicitly granted by the client
289         https://bugs.webkit.org/show_bug.cgi?id=195625
290
291         Reviewed by Youenn Fablet.
292
293         Device Orientation access permission should be denied unless explicitly granted by the client.
294         Previously, it was granted by default.
295
296         * UIProcess/API/APIUIClient.h:
297         (API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
298         * UIProcess/API/C/WKPage.cpp:
299         (WKPageSetPageUIClient):
300         * UIProcess/Cocoa/UIDelegate.mm:
301         (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
302
303 2019-03-12  Antti Koivisto  <antti@apple.com>
304
305         [iOS] Enable asynchronous frame scrolling by default
306         https://bugs.webkit.org/show_bug.cgi?id=195622
307         <rdar://problem/48658028>
308
309         Reviewed by Simon Fraser
310
311         * Shared/WebPreferences.yaml:
312         * Shared/WebPreferencesDefaultValues.h:
313
314 2019-03-12  Per Arne Vollan  <pvollan@apple.com>
315
316         [iOS] Block access to backboardd service
317         https://bugs.webkit.org/show_bug.cgi?id=195484
318
319         Reviewed by Brent Fulgham.
320
321         This patch is addressing blocking the backboardd service "com.apple.backboard.hid.services". Getting the
322         backlight level in the WebContent process will initiate a connection with this service. To be able to
323         block the service, the backlight level is queried in the UI process and sent to the WebContent process
324         when the WebContent process is started, and when the backlight level is changed. On the WebContent side,
325         the method getting the backlight level is swizzled to return the value sent from the UI process.
326
327         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
328         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
329         (WebKit::WebProcessPool::displayBrightness):
330         (WebKit::WebProcessPool::backlightLevelDidChangeCallback):
331         (WebKit::WebProcessPool::registerNotificationObservers):
332         (WebKit::WebProcessPool::unregisterNotificationObservers):
333         * UIProcess/WebProcessPool.cpp:
334         (WebKit::WebProcessPool::initializeNewWebProcess):
335         * UIProcess/WebProcessPool.h:
336         * WebProcess/WebProcess.h:
337         * WebProcess/WebProcess.messages.in:
338         * WebProcess/cocoa/WebProcessCocoa.mm:
339         (WebKit::currentBacklightLevel):
340         (WebKit::WebProcess::backlightLevelDidChange):
341
342 2019-03-12  Tim Horton  <timothy_horton@apple.com>
343
344         Fix the build after 242801
345
346         * UIProcess/ios/WKActionSheetAssistant.mm:
347         (-[WKActionSheetAssistant _elementActionForDDAction:]):
348         More.
349
350 2019-03-12  Tim Horton  <timothy_horton@apple.com>
351
352         Fix the build after 242801
353
354         * UIProcess/ios/WKActionSheetAssistant.mm:
355         (-[WKActionSheetAssistant _elementActionForDDAction:]):
356
357 2019-03-12  Eric Carlson  <eric.carlson@apple.com>
358
359         [iOS] Sandbox must allow mach lookup required to compress video
360         https://bugs.webkit.org/show_bug.cgi?id=195627
361         <rdar://problem/48811072>
362
363         Reviewed by Youenn Fablet.
364
365         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
366
367 2019-03-12  Jennifer Moore  <jennifer.moore@apple.com>
368
369         Check whether to launch a default action instead of action sheet
370         https://bugs.webkit.org/show_bug.cgi?id=195225
371         <rdar://problem/47715544>
372
373         Reviewed by Daniel Bates and Tim Horton.
374
375         Notify DataDetectors at the start of a touch on a link, and check whether to immediately
376         launch the default action instead of an action sheet.
377
378         * UIProcess/ios/WKActionSheetAssistant.h:
379         * UIProcess/ios/WKActionSheetAssistant.mm:
380         (-[WKActionSheetAssistant interactionDidStart]):
381         (-[WKActionSheetAssistant _createSheetWithElementActions:defaultTitle:showLinkTitle:]):
382         (-[WKActionSheetAssistant showImageSheet]):
383         (-[WKActionSheetAssistant showLinkSheet]):
384         (-[WKActionSheetAssistant showDataDetectorsSheet]):
385         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Deleted.
386         * UIProcess/ios/WKContentViewInteraction.mm:
387         (-[WKContentView _webTouchEventsRecognized:]):
388 :
389 2019-03-12  Zalan Bujtas  <zalan@apple.com>
390
391         [Synthetic Click] Dispatch mouseout soon after mouseup
392         https://bugs.webkit.org/show_bug.cgi?id=195575
393         <rdar://problem/47093049>
394
395         Reviewed by Simon Fraser.
396
397         * WebProcess/WebPage/ios/WebPageIOS.mm:
398         (WebKit::WebPage::completeSyntheticClick):
399
400 2019-03-12  Zalan Bujtas  <zalan@apple.com>
401
402         [ContentChangeObserver] Stop content change observation when the touch event turns into long press
403         https://bugs.webkit.org/show_bug.cgi?id=195601
404         <rdar://problem/48796324>
405
406         Reviewed by Wenson Hsieh.
407
408         Add didRecognizeLongPress() message to be able to cancel content observation (started at touchStart).
409
410         * UIProcess/WebPageProxy.h:
411         * UIProcess/ios/WKContentViewInteraction.mm:
412         (-[WKContentView _longPressRecognized:]):
413         * UIProcess/ios/WebPageProxyIOS.mm:
414         (WebKit::WebPageProxy::didRecognizeLongPress):
415         * WebProcess/WebPage/WebPage.h:
416         * WebProcess/WebPage/WebPage.messages.in:
417         * WebProcess/WebPage/ios/WebPageIOS.mm:
418         (WebKit::WebPage::didRecognizeLongPress):
419
420 2019-03-11  Andy Estes  <aestes@apple.com>
421
422         [Mac] Ensure Apple Pay is unavailable when PassKit.framework is missing
423         https://bugs.webkit.org/show_bug.cgi?id=195583
424         <rdar://problem/48420224>
425
426         Reviewed by Daniel Bates.
427
428         PassKit.framework is optionally soft-linked on Mac because it is missing from the Recovery
429         Partition. We need to check if the framework is available before calling into it.
430
431         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
432         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
433         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
434         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
435         (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
436         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
437         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
438
439 2019-03-12  Antti Koivisto  <antti@apple.com>
440
441         Compositing layer that renders two positioned elements should not hit test
442         https://bugs.webkit.org/show_bug.cgi?id=195371
443         <rdar://problem/48649586>
444
445         Reviewed by Simon Fraser.
446
447         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
448         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
449         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
450         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
451         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
452         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
453         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
454
455         Pass event region to UI process.
456
457         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
458         (WebKit::RemoteLayerTreeNode::layerID const):
459         (WebKit::RemoteLayerTreeNode::eventRegion const):
460         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
461         (WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
462         (WebKit::RemoteLayerTreeNode::~RemoteLayerTreeNode):
463         (WebKit::RemoteLayerTreeNode::setEventRegion):
464
465         Maintain event region in RemoteLayerTreeNodes.
466
467         (WebKit::RemoteLayerTreeNode::initializeLayer):
468         (WebKit::RemoteLayerTreeNode::layerID):
469         (WebKit::RemoteLayerTreeNode::forCALayer):
470
471         Move layerID to RemoteLayerTreeNode and store RemoteLayerTreeNode pointer to CALayers instead.
472         This makes it easy to find the matching RemoteLayerTreeNode from a layer, globally.
473
474         (WebKit::RemoteLayerTreeNode::setLayerID): Deleted.
475         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
476         (WebKit::collectDescendantViewsAtPoint):
477
478         If we have event region, use it for hit testing.
479
480         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
481         (collectDescendantViewsAtPoint): Deleted.
482         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
483         (WebKit::PlatformCALayerRemote::eventRegion const):
484         (WebKit::PlatformCALayerRemote::setEventRegion):
485         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
486
487 2019-03-12  Carlos Garcia Campos  <cgarcia@igalia.com>
488
489         [WPE][GTK] Load events may occur in unexpected order when JS redirects page before subresource load finishes
490         https://bugs.webkit.org/show_bug.cgi?id=194131
491
492         Reviewed by Michael Catanzaro.
493
494         Ensure we emit the load-failed and load-changed with finished event when there's still an ongoing load when a
495         new provisional load strarts. Previous load fails with cancelled error.
496
497         * UIProcess/API/glib/WebKitWebView.cpp:
498         (webkitWebViewWillStartLoad): Call webkitWebViewLoadFailed() if current page load state is not finished.
499         * UIProcess/API/glib/WebKitWebViewPrivate.h:
500         * UIProcess/API/gtk/PageClientImpl.cpp:
501         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Call webkitWebViewWillStartLoad().
502         * UIProcess/API/wpe/APIViewClient.h:
503         (API::ViewClient::willStartLoad): Add willStartLoad() to API::ViewClient
504         * UIProcess/API/wpe/PageClientImpl.cpp:
505         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Call WPEView::willStartLoad().
506         * UIProcess/API/wpe/PageClientImpl.h:
507         * UIProcess/API/wpe/WPEView.cpp:
508         (WKWPE::View::willStartLoad): Call API::ViewClient::willStartLoad().
509         * UIProcess/API/wpe/WPEView.h:
510         * UIProcess/PageLoadState.h:
511         (WebKit::PageLoadState::isProvisional const):
512         (WebKit::PageLoadState::isCommitted const):
513         (WebKit::PageLoadState::isFinished const):
514
515 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
516
517         Unreviewed, rolling out r242763.
518
519         Causes layout test crashes on iOS simulator
520
521         Reverted changeset:
522
523         "[Synthetic Click] Dispatch mouseout soon after mouseup"
524         https://bugs.webkit.org/show_bug.cgi?id=195575
525         https://trac.webkit.org/changeset/242763
526
527 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
528
529         Add Optional to Forward.h.
530         https://bugs.webkit.org/show_bug.cgi?id=195586
531
532         Reviewed by Darin Adler.
533
534         * Shared/RTCNetwork.cpp:
535         * Shared/RTCNetwork.h:
536         * Shared/RTCPacketOptions.cpp:
537         * Shared/RTCPacketOptions.h:
538         * UIProcess/API/APIWebsitePolicies.h:
539         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
540         Remove unnecessary includes from headers.
541
542 2019-03-11  Commit Queue  <commit-queue@webkit.org>
543
544         Unreviewed, rolling out r242745 and r242756.
545         https://bugs.webkit.org/show_bug.cgi?id=195606
546
547         Breaks internal builds (Requested by ryanhaddad on #webkit).
548
549         Reverted changesets:
550
551         "[iOS] Block access to backboardd service"
552         https://bugs.webkit.org/show_bug.cgi?id=195484
553         https://trac.webkit.org/changeset/242745
554
555         "Unreviewed build fix after r242745."
556         https://trac.webkit.org/changeset/242756
557
558 2019-03-11  Fujii Hironori  <Hironori.Fujii@sony.com>
559
560         [CoordinatedGraphics] ASSERTION FAILED: !m_state.isSuspended
561         https://bugs.webkit.org/show_bug.cgi?id=195550
562
563         Reviewed by Carlos Garcia Campos.
564
565         CompositingRunLoop::suspend() locks a mutex and stops the update
566         timer. But, the timer can be fired after the lock was acquired and
567         before the timer is stopped.
568
569         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
570         (WebKit::CompositingRunLoop::updateTimerFired): Removed the
571         assertion. Return early if m_state.isSuspended.
572
573 2019-03-11  Per Arne Vollan  <pvollan@apple.com>
574
575         [macOS] Remove the Kerberos rules from the WebContent sandbox
576         https://bugs.webkit.org/show_bug.cgi?id=195464
577         <rdar://problem/35369230>
578
579         Reviewed by Brent Fulgham.
580
581         Kerberos auth is done in the UIProcess or NetworkProcess now.
582
583         * WebProcess/com.apple.WebProcess.sb.in:
584
585 2019-03-11  Per Arne Vollan  <pvollan@apple.com>
586
587         [iOS] Add entitlement to enable use of graphics endpoint with limited capabilities
588         https://bugs.webkit.org/show_bug.cgi?id=195582
589         <rdar://problem/36082379>
590
591         Reviewed by Brent Fulgham.
592
593         This is a QuartzCore endpoint with a minimal set of capabilities.
594
595         * Configurations/WebContent-iOS.entitlements:
596
597 2019-03-11  John Wilander  <wilander@apple.com>
598
599         Move NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm functionality into UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
600         https://bugs.webkit.org/show_bug.cgi?id=195117
601         <rdar://problem/48448715>
602
603         Reviewed by Brent Fulgham.
604
605         Reading of user defaults on Cocoa platforms should be done in the UI process and
606         forwarded to Resource Load Statistics in the network process through the
607         WebKit::NetworkSessionCreationParameters struct.
608
609         This patch does away with some old user defaults we don't use anymore. It also
610         changes the developer-facing default name to ITPManualPrevalentResource.
611
612         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
613         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
614             Removed the call to the old registerUserDefaultsIfNeeded().
615         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
616         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
617             Removed the call to the old registerUserDefaultsIfNeeded().
618         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
619             Removed the declaration of the old registerUserDefaultsIfNeeded().
620         * NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Removed.
621         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
622             Added an enum class EnableResourceLoadStatisticsDebugMode.
623         * NetworkProcess/NetworkSession.cpp:
624         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
625         * NetworkProcess/NetworkSession.h:
626         * NetworkProcess/NetworkSessionCreationParameters.cpp:
627         (WebKit::NetworkSessionCreationParameters::encode const):
628         (WebKit::NetworkSessionCreationParameters::decode):
629         * NetworkProcess/NetworkSessionCreationParameters.h:
630            The struct now has two new fields:
631            - enableResourceLoadStatisticsDebugMode
632            - resourceLoadStatisticsManualPrevalentResource
633         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
634         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
635             Forwarding of the parameters.
636         * SourcesCocoa.txt:
637         * UIProcess/WebProcessPool.cpp:
638         (WebKit::WebProcessPool::ensureNetworkProcess):
639             Forwarding of the parameters.
640         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
641         (WebKit::WebsiteDataStore::parameters):
642             This is where user defaults for Resource Load Statistics are now read.
643         * WebKit.xcodeproj/project.pbxproj:
644
645 2019-03-11  Zalan Bujtas  <zalan@apple.com>
646
647         [Synthetic Click] Dispatch mouseout soon after mouseup
648         https://bugs.webkit.org/show_bug.cgi?id=195575
649         <rdar://problem/47093049>
650
651         Reviewed by Simon Fraser.
652
653         * WebProcess/WebPage/ios/WebPageIOS.mm:
654         (WebKit::WebPage::completeSyntheticClick):
655
656 2019-03-11  Tim Horton  <timothy_horton@apple.com>
657
658         API test WebKit.RequestTextInputContext fails on iOS
659         https://bugs.webkit.org/show_bug.cgi?id=195585
660
661         Reviewed by Wenson Hsieh and Simon Fraser.
662
663         * UIProcess/API/Cocoa/WKWebView.mm:
664         (-[WKWebView _convertRectFromRootViewCoordinates:]):
665         (-[WKWebView _convertRectToRootViewCoordinates:]):
666         (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
667         (-[WKWebView _focusTextInputContext:completionHandler:]):
668         * WebProcess/WebPage/WebPage.cpp:
669         (WebKit::elementRectInRootViewCoordinates):
670         (WebKit::WebPage::textInputContextsInRect):
671         (WebKit::elementRectInWindowCoordinates): Deleted.
672         Text input context SPI should be in terms of WKWebView coordinates,
673         for consistency's sake. This is a bit irritating; WebPage(Proxy) continue
674         to operate in "root view" coordinates, which means different things
675         depending on if delegatesScrolling is true or not. So, WKWebView does
676         the conversion, re-creating objects as needed.
677
678 2019-03-09  Jiewen Tan  <jiewen_tan@apple.com>
679
680         Optimizing loads when creating new pages
681         https://bugs.webkit.org/show_bug.cgi?id=195516
682         <rdar://problem/48738086>
683
684         Reviewed by Darin Adler.
685
686         This patch adds hooks in WebPageProxy::createNewPage to optimize loads, and moves the creationParameters
687         of API::NavigationAction from UI clients to WebPageProxy::createNewPage. Also, we now pass the whole
688         API::NavigationAction to the load optimizer instead of the request within.
689
690         * UIProcess/API/APINavigationAction.h:
691         * UIProcess/API/APIUIClient.h:
692         (API::UIClient::createNewPage):
693         * UIProcess/API/C/WKPage.cpp:
694         (WKPageSetPageUIClient):
695         * UIProcess/API/glib/WebKitUIClient.cpp:
696         * UIProcess/Cocoa/NavigationState.mm:
697         (WebKit::tryOptimizingLoad):
698         (WebKit::tryInterceptNavigation):
699         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
700         * UIProcess/Cocoa/UIDelegate.h:
701         * UIProcess/Cocoa/UIDelegate.mm:
702         (WebKit::UIDelegate::UIClient::createNewPage):
703         * UIProcess/WebPageProxy.cpp:
704         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
705         (WebKit::tryOptimizingLoad):
706         (WebKit::WebPageProxy::createNewPage):
707         * UIProcess/WebPageProxy.h:
708
709 2019-03-11  Dean Jackson  <dino@apple.com>
710
711         [iOS] Implement a faster click detection that intercepts double-tap-to-zoom if possible
712         https://bugs.webkit.org/show_bug.cgi?id=195473
713         <rdar://problem/48718396>
714
715         Reviewed by Wenson Hsieh (with some help from Dan Bates).
716
717         Adds a new algorithm, behind a flag FasterClicksEnabled, that can trigger a click
718         event without waiting to see if a double tap will occur. It does this by examining
719         the amount of zoom that would be triggered if it was a double tap, and if that value
720         doesn't exceed a set threshold, commits to the click event instead.
721
722         This is implemented by having the Web Process respond to the potential click with
723         some geometry information. If the UI Process receives the information before the
724         second tap in a double tap, it can decide to trigger a click.
725
726         * Shared/WebPreferences.yaml: New internal feature so this can be toggled in
727             a UI for testing.
728
729         * SourcesCocoa.txt: Renamed WKSyntheticTapGestureRecognizer.
730         * WebKit.xcodeproj/project.pbxproj: Ditto.
731
732         * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
733         * UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
734         (-[WKSyntheticTapGestureRecognizer setGestureIdentifiedTarget:action:]):
735         (-[WKSyntheticTapGestureRecognizer setGestureFailedTarget:action:]):
736         (-[WKSyntheticTapGestureRecognizer setResetTarget:action:]):
737         (-[WKSyntheticTapGestureRecognizer setState:]):
738         (-[WKSyntheticTapGestureRecognizer reset]):  Renamed WKSyntheticClickTapGestureRecognizer to
739             WKSyntheticTapGestureRecognizer, changed the signature of the main function to be a bit
740             more clear about what it does, and added a gesture failed target.
741
742         * UIProcess/API/Cocoa/WKWebViewInternal.h:
743         * UIProcess/API/Cocoa/WKWebView.mm:
744         (-[WKWebView _initialScaleFactor]):
745         (-[WKWebView _contentZoomScale]):
746         (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]):
747             Exposed the initial content scale, the current scale and added a declaration that
748             was missing from the .h.
749
750         * UIProcess/WebPageProxy.messages.in: Add a new message,
751             HandleSmartMagnificationInformationForPotentialTap, to
752             communicate the geometry of the clicked node to the UI Process.
753
754         * UIProcess/PageClient.h: Pure virtual function for the geometry message response.
755         * UIProcess/WebPageProxy.h: Ditto.
756
757         * UIProcess/ios/PageClientImplIOS.h: Calls into the WKContentView.
758         * UIProcess/ios/PageClientImplIOS.mm:
759         (WebKit::PageClientImpl::handleSmartMagnificationInformationForPotentialTap):
760
761         * UIProcess/ios/SmartMagnificationController.h:
762         * UIProcess/ios/SmartMagnificationController.mm:
763         (WebKit::SmartMagnificationController::calculatePotentialZoomParameters): A new method that
764             asks the WKContentView to work out what the zoom factor will be for a potential double
765             tap at a location.
766         (WebKit::SmartMagnificationController::smartMagnificationTargetRectAndZoomScales): New implementation
767             of this function to avoid multiple out-arguments.
768
769         * UIProcess/ios/WKContentView.h:
770         * UIProcess/ios/WKContentView.mm:
771         (-[WKContentView _initialScaleFactor]):
772         (-[WKContentView _contentZoomScale]):
773         (-[WKContentView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]):
774             Exposed the initial content scale, the current scale and the target zoom scale. These
775             all just call into the WKWebView implementation.
776
777         * UIProcess/ios/WKContentViewInteraction.h:
778         * UIProcess/ios/WKContentViewInteraction.mm:
779         (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]): Use a WKSyntheticTapGestureRecognizer instead
780             of a generic one, so we can capture the failure.
781         (-[WKContentView setupInteraction]):
782         (-[WKContentView cleanupInteraction]):
783         (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:origin:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
784             New method that responds to the incoming Web Process message, and decides if any
785             potential zoom would be "significant".
786         (-[WKContentView _singleTapIdentified:]):
787         (-[WKContentView _doubleTapDidFail:]):
788         (-[WKContentView _didCompleteSyntheticClick]):
789         (-[WKContentView _singleTapRecognized:]):
790         (-[WKContentView _doubleTapRecognized:]):
791             Add some release logging.
792         (-[WKContentView _singleTapCommited:]): Deleted.
793
794         * UIProcess/ios/WebPageProxyIOS.mm:
795         (WebKit::WebPageProxy::potentialTapAtPosition):
796         (WebKit::WebPageProxy::handleSmartMagnificationInformationForPotentialTap):
797         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
798         * WebProcess/WebPage/WebPage.h:
799         * WebProcess/WebPage/WebPage.messages.in:
800             Removed an unused parameter from the existing message.
801
802         * WebProcess/WebPage/ios/WebPageIOS.mm:
803         (WebKit::WebPage::potentialTapAtPosition): Calculates the geometry of the element
804         if requested, and sends it to the UIProcess.
805
806 2019-03-11  Per Arne Vollan  <pvollan@apple.com>
807
808         Unreviewed build fix after r242745.
809
810         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
811         (WebKit::WebProcessPool::registerNotificationObservers):
812         (WebKit::WebProcessPool::unregisterNotificationObservers):
813
814 2019-03-11  Chris Dumez  <cdumez@apple.com>
815
816         Assert in WebPageProxy::suspendCurrentPageIfPossible()
817         https://bugs.webkit.org/show_bug.cgi?id=195506
818         <rdar://problem/48733477>
819
820         Reviewed by Alex Christensen.
821
822         The crash was caused by the top-hit preloading logic in MobileSafari which creates a new Web view that is *related*
823         to the previous one, restores the session state onto it and then triggers a load in this new Web view.
824
825         Initially, the 2 Web views use the same process as they are related. However, if the new load's URL is cross-site
826         with regards to the first view's URL, then we decide to process swap in the new view. This process swap makes
827         sense from a security standpoint. However, when we commit the load in the new process and call
828         suspendCurrentPageIfPossible() we end up in an unexpected state because we have a fromItem (due to the session
829         state having been restored on the new view) but we haven't committed any load yet in this new view.
830
831         To address the issue, suspendCurrentPageIfPossible() now returns early and does not attempt to suspend anything
832         if we have not committed any load yet.
833
834         * UIProcess/WebPageProxy.cpp:
835         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
836         Do not attempt to suspend to current page if we have not committed any provisional load yet.
837
838 2019-03-11  Chris Dumez  <cdumez@apple.com>
839
840         Update device orientation & motion permission native SPI as per latest proposal
841         https://bugs.webkit.org/show_bug.cgi?id=195567
842
843         Reviewed by Youenn Fablet.
844
845         The native SPI is now:
846         +- (void)_webView:(WKWebView *)webView shouldAllowDeviceOrientationAndMotionAccessRequestedByFrame:(WKFrameInfo *)frameInfo decisionHandler:(void (^)(BOOL))decisionHandler;
847
848         * UIProcess/API/APIUIClient.h:
849         (API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
850         * UIProcess/API/C/WKPage.cpp:
851         (WKPageSetPageUIClient):
852         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
853         * UIProcess/Cocoa/UIDelegate.h:
854         * UIProcess/Cocoa/UIDelegate.mm:
855         (WebKit::UIDelegate::setDelegate):
856         (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
857         * UIProcess/WebPageProxy.cpp:
858         (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
859         * UIProcess/WebPageProxy.h:
860         * UIProcess/WebPageProxy.messages.in:
861         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
862         (WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
863         * WebProcess/WebCoreSupport/WebChromeClient.h:
864         * WebProcess/WebPage/WebPage.cpp:
865         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
866         * WebProcess/WebPage/WebPage.h:
867
868 2019-03-11  Andy Estes  <aestes@apple.com>
869
870         [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
871         https://bugs.webkit.org/show_bug.cgi?id=195530
872         <rdar://problem/48747164>
873
874         Reviewed by Alex Christensen.
875
876         * Configurations/Network-iOS.entitlements: Added the 'com.apple.payment.all-access'
877         entitlement and reordered the others.
878
879         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
880         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): Forwarded
881         WebPaymentCoordinatorProxy messages to the payment coordinator.
882         (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage): Ditto.
883         (WebKit::NetworkConnectionToWebProcess::didClose): Set m_paymentCoordinator to nullptr.
884         * NetworkProcess/NetworkConnectionToWebProcess.h: Inherited from
885         WebPaymentCoordinatorProxy::Client and added a unique_ptr<WebPaymentCoordinatorProxy> member.
886
887         * NetworkProcess/cocoa/NetworkSessionCocoa.h: Declared getters for source application bundle
888         and secondary identifiers, and CTDataConnectionServiceType on iOS.
889         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
890         (WebKit::NetworkSessionCocoa::sourceApplicationBundleIdentifier const): Defined getter.
891         (WebKit::NetworkSessionCocoa::sourceApplicationSecondaryIdentifier const): Ditto.
892         (WebKit::NetworkSessionCocoa::ctDataConnectionServiceType const): Ditto.
893         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Initialized
894         m_sourceApplicationBundleIdentifier and m_sourceApplicationSecondaryIdentifier with
895         corresponding NetworkSessionCreationParameters.
896
897         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm: Added.
898         (WebKit::NetworkConnectionToWebProcess::paymentCoordinator): Added. Returns
899         m_paymentCoordinator after lazily initializing it.
900         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorConnection): Added. Returns the
901         connection to the web process.
902         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorPresentingViewController): Added.
903         Returns nil.
904         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorCTDataConnectionServiceType):
905         Added. Returns the value from the network session identified by sessionID.
906         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationBundleIdentifier):
907         Ditto.
908         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationSecondaryIdentifier):
909         Ditto.
910         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter): Added.
911         Returns a new PaymentAuthorizationController.
912         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver): Added empty
913         definition. NetworkConnectionToWebProcess explicitly forwards WebPaymentCoordinatorProxy
914         messages to its payment coordinator, so there's no need to register with a MessageReceiverMap.
915         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver): Ditto.
916
917         * Platform/ios/PaymentAuthorizationController.h: Added. Declares a
918         PaymentAuthorizationPresenter subclass based on PKPaymentAuthorizationController.
919         * Platform/ios/PaymentAuthorizationController.mm: Added.
920         (-[WKPaymentAuthorizationControllerDelegate initWithRequest:presenter:]):
921         Initialized WKPaymentAuthorizationDelegate with request and presenter.
922         (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationControllerDidFinish:]):
923         Forwarded call to WKPaymentAuthorizationDelegate.
924         (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didAuthorizePayment:handler:]):
925         Ditto.
926         (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectShippingMethod:handler:]):
927         Ditto.
928         (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectShippingContact:handler:]):
929         Ditto.
930         (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectPaymentMethod:handler:]):
931         Ditto.
932         (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:willFinishWithError:]):
933         Ditto.
934         (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didRequestMerchantSession:]):
935         Ditto.
936         (WebKit::PaymentAuthorizationController::PaymentAuthorizationController):
937         Initialized m_controller with a new PKPaymentAuthorizationController and m_delegate with a
938         new WKPaymentAuthorizationControllerDelegate.
939         (WebKit::PaymentAuthorizationController::platformDelegate): Returned m_delegate.
940         (WebKit::PaymentAuthorizationController::dismiss): Dismissed the controller, set its
941         delegates to nil, set m_controller to nil, invalidated the delegate, and set m_delegate to
942         nil.
943         (WebKit::PaymentAuthorizationController::present): Called -presentWithCompletion: on the
944         controller, forwarding the passed-in completion handler.
945         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Allowed PassKit to look up
946         the "com.apple.passd.in-app-payment" and "com.apple.passd.library" service endpoints.
947
948         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
949         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Changed to call
950         paymentCoordinatorAddMessageReceiver.
951         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Changed to call
952         paymentCoordinatorRemoveMessageReceiver.
953         (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Deleted.
954         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Passed sessionID to
955         platformCanMakePaymentsWithActiveCard.
956         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): Stored destinationID and passed
957         sessionID to platformShowPaymentUI.
958         (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession): Changed to account for new
959         behavior of didCancelPaymentSession.
960         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Changed to call hidePaymentUI.
961         (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Changed to only call hidePaymentUI
962         when didReachFinalState is true, since didCancelPaymentSession is called otherwise.
963         (WebKit::WebPaymentCoordinatorProxy::didReachFinalState): Cleared m_destinationID.
964         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Added m_destionationID member.
965         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Changed
966         CanMakePaymentsWithActiveCard and ShowPaymentUI messages to take destinationID and sessionID
967         arguments.
968
969         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
970         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Passed
971         sessionID to paymentCoordinatorSourceApplicationSecondaryIdentifier.
972         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Passed sessionID to various
973         m_client call sites.
974
975         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
976         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Passed sessionID to
977         platformPaymentRequest.
978         (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Null-checked m_authorizationPresenter
979         before calling dismiss.
980
981         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
982         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Passed sessionID to
983         platformPaymentRequest.
984         (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Null-checked m_authorizationPresenter
985         before calling dismiss.
986
987         * Shared/WebPreferences.yaml: Added ApplePayRemoteUIEnabled as an internal preference.
988
989         * SourcesCocoa.txt: Added NetworkConnectionToWebProcessIOS.mm and
990         PaymentAuthorizationController.mm.
991
992         * UIProcess/AuxiliaryProcessProxy.h:
993         (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Deleted.
994
995         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
996         (WebKit::WebPageProxy::paymentCoordinatorConnection): Moved from WebPageProxy.cpp.
997         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
998         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
999         (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver): Ditto.
1000         (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver): Ditto.
1001
1002         * UIProcess/WebPageProxy.cpp:
1003         (WebKit::WebPageProxy::paymentCoordinatorConnection): Moved to WebPageProxyCocoa.mm.
1004         (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
1005         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
1006         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
1007         (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
1008         * UIProcess/WebPageProxy.h:
1009
1010         * UIProcess/ios/WebPageProxyIOS.mm:
1011         (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Asserted that
1012         sessionID equals the website data store's sessionID.
1013
1014         * WebKit.xcodeproj/project.pbxproj:
1015
1016         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1017         (WebKit::WebPaymentCoordinator::networkProcessConnectionClosed): Added. Cancels the current
1018         session if Apple Pay Remote UI is enabled and the network process connection closes.
1019         (WebKit::WebPaymentCoordinator::availablePaymentNetworks): Changed to account for
1020         WebPaymentCoordinator being an IPC::MessageSender.
1021         (WebKit::WebPaymentCoordinator::canMakePayments): Ditto.
1022         (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard): Ditto.
1023         (WebKit::WebPaymentCoordinator::openPaymentSetup): Ditto.
1024         (WebKit::WebPaymentCoordinator::showPaymentUI): Ditto.
1025         (WebKit::WebPaymentCoordinator::completeMerchantValidation): Ditto.
1026         (WebKit::WebPaymentCoordinator::completeShippingMethodSelection): Ditto.
1027         (WebKit::WebPaymentCoordinator::completeShippingContactSelection): Ditto.
1028         (WebKit::WebPaymentCoordinator::completePaymentMethodSelection): Ditto.
1029         (WebKit::WebPaymentCoordinator::completePaymentSession): Ditto.
1030         (WebKit::WebPaymentCoordinator::abortPaymentSession): Ditto.
1031         (WebKit::WebPaymentCoordinator::cancelPaymentSession): Ditto.
1032         (WebKit::WebPaymentCoordinator::messageSenderConnection const): Added. Returns a connection
1033         to the network process if Apple Pay Remote UI is enabled. Otherwise, returned the web
1034         process's parent connection.
1035         (WebKit::WebPaymentCoordinator::messageSenderDestinationID const): Added. Returns the web
1036         page's ID.
1037         (WebKit::WebPaymentCoordinator::remoteUIEnabled const): Added. Calls Settings::applePayRemoteUIEnabled.
1038         * WebProcess/ApplePay/WebPaymentCoordinator.h: Inherited from IPC::MessageSender.
1039
1040         * WebProcess/Network/NetworkProcessConnection.cpp:
1041         (WebKit::NetworkProcessConnection::didReceiveMessage): Forwarded WebPaymentCoordinator
1042         messages to the payment coordinator of the web page matching the decoder's destination ID.
1043         (WebKit::NetworkProcessConnection::didReceiveSyncMessage): Ditto for sync messages.
1044
1045         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1046         (WebKit::WebPage::paymentCoordinator): Added a payment coordinator getter.
1047         * WebProcess/WebPage/WebPage.h: Ditto.
1048
1049         * WebProcess/WebProcess.cpp:
1050         (WebKit::WebProcess::networkProcessConnectionClosed): Called
1051         WebPaymentCoordinator::networkProcessConnectionClosed when the network process connection
1052         closes.
1053
1054 2019-03-11  Per Arne Vollan  <pvollan@apple.com>
1055
1056         [iOS] Block access to backboardd service
1057         https://bugs.webkit.org/show_bug.cgi?id=195484
1058
1059         Reviewed by Brent Fulgham.
1060
1061         This patch is addressing blocking the backboardd service "com.apple.backboard.hid.services". Getting the
1062         backlight level in the WebContent process will initiate a connection with this service. To be able to
1063         block the service, the backlight level is queried in the UI process and sent to the WebContent process
1064         when the WebContent process is started, and when the backlight level is changed. On the WebContent side,
1065         the method getting the backlight level is swizzled to return the value sent from the UI process.
1066
1067         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1068         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1069         (WebKit::WebProcessPool::displayBrightness):
1070         (WebKit::WebProcessPool::backlightLevelDidChangeCallback):
1071         (WebKit::WebProcessPool::registerNotificationObservers):
1072         (WebKit::WebProcessPool::unregisterNotificationObservers):
1073         * UIProcess/WebProcessPool.cpp:
1074         (WebKit::WebProcessPool::initializeNewWebProcess):
1075         * UIProcess/WebProcessPool.h:
1076         * WebProcess/WebProcess.h:
1077         * WebProcess/WebProcess.messages.in:
1078         * WebProcess/cocoa/WebProcessCocoa.mm:
1079         (WebKit::currentBacklightLevel):
1080         (WebKit::WebProcess::backlightLevelDidChange):
1081
1082 2019-03-11  Brent Fulgham  <bfulgham@apple.com>
1083
1084         Remove obsolete runtime flag for StorageAccess API Prompt
1085         https://bugs.webkit.org/show_bug.cgi?id=195564
1086         <rdar://problem/37279014>
1087
1088         Reviewed by Chris Dumez.
1089
1090         This bug tracks the work of removing the obsolete flag that had been used to optionally
1091         prevent display of the StorageAccess API prompt. We have since shipped the final version
1092         of this feature with an always-on prompt, and should have removed this runtime flag.
1093
1094         No test changes because this has no change in behavior. Tests already assume the prompt
1095         behavior, and did not test turning the flag off.
1096
1097         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1098         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
1099         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
1100         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
1101         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1102         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
1103         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
1104         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1105         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
1106         (WebKit::ResourceLoadStatisticsStore::debugModeEnabled const):
1107         (WebKit::ResourceLoadStatisticsStore::storageAccessPromptsEnabled const): Deleted.
1108         (WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled): Deleted.
1109         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1110         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1111         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1112         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1113         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1114         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
1115         * NetworkProcess/NetworkConnectionToWebProcess.h:
1116         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1117         * NetworkProcess/NetworkProcess.cpp:
1118         (WebKit::NetworkProcess::requestStorageAccess):
1119         (WebKit::NetworkProcess::requestStorageAccessGranted):
1120         * NetworkProcess/NetworkProcess.h:
1121         * NetworkProcess/NetworkProcess.messages.in:
1122         * Shared/WebPreferences.yaml:
1123         * UIProcess/API/C/WKPreferences.cpp:
1124         (WKPreferencesSetStorageAccessPromptsEnabled): Deleted.
1125         (WKPreferencesGetStorageAccessPromptsEnabled): Deleted.
1126         * UIProcess/API/C/WKPreferencesRef.h:
1127         * UIProcess/API/Cocoa/WKPreferences.mm:
1128         (-[WKPreferences _storageAccessPromptsEnabled]): Deleted.
1129         (-[WKPreferences _setStorageAccessPromptsEnabled:]): Deleted.
1130         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1131         * UIProcess/Network/NetworkProcessProxy.cpp:
1132         (WebKit::NetworkProcessProxy::requestStorageAccess):
1133         * UIProcess/Network/NetworkProcessProxy.h:
1134         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1135         (WebKit::WebsiteDataStore::requestStorageAccess):
1136         * UIProcess/WebsiteData/WebsiteDataStore.h:
1137         * WebProcess/WebPage/WebPage.cpp:
1138         (WebKit::WebPage::requestStorageAccess):
1139
1140 2019-03-11  Alex Christensen  <achristensen@webkit.org>
1141
1142         Add a WKContentRuleList variant that uses copied memory instead of mmap'd shared memory for class A containerized apps
1143         https://bugs.webkit.org/show_bug.cgi?id=195511
1144         <rdar://problem/44873269>
1145
1146         Reviewed by Darin Adler.
1147
1148         * NetworkProcess/NetworkContentRuleListManager.cpp:
1149         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
1150         * NetworkProcess/NetworkContentRuleListManager.h:
1151         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1152         (WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting):
1153         (WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting):
1154         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
1155         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1156         * Shared/WebCompiledContentRuleList.cpp:
1157         (WebKit::WebCompiledContentRuleList::usesCopiedMemory const):
1158         (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
1159         (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
1160         (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
1161         (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
1162         (WebKit::WebCompiledContentRuleList::actions const):
1163         * Shared/WebCompiledContentRuleList.h:
1164         * Shared/WebCompiledContentRuleListData.cpp:
1165         (WebKit::WebCompiledContentRuleListData::size const):
1166         (WebKit::WebCompiledContentRuleListData::dataPointer const):
1167         (WebKit::WebCompiledContentRuleListData::encode const):
1168         (WebKit::WebCompiledContentRuleListData::decode):
1169         * Shared/WebCompiledContentRuleListData.h:
1170         (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
1171         * UIProcess/API/APIContentRuleList.cpp:
1172         (API::ContentRuleList::usesCopiedMemory const):
1173         * UIProcess/API/APIContentRuleList.h:
1174         * UIProcess/API/APIContentRuleListStore.cpp:
1175         (API::getData):
1176         (API::decodeContentRuleListMetaData):
1177         (API::ContentRuleListStore::readContentsOfFile):
1178         (API::MappedOrCopiedData::dataPointer const):
1179         (API::openAndMapOrCopyContentRuleList):
1180         (API::compiledToFile):
1181         (API::createExtension):
1182         (API::ContentRuleListStore::lookupContentRuleList):
1183         (API::ContentRuleListStore::compileContentRuleList):
1184         (API::ContentRuleListStore::getContentRuleListSource):
1185         (API::openAndMapContentRuleList): Deleted.
1186         * UIProcess/API/APIContentRuleListStore.h:
1187         * UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
1188         (API::ContentRuleListStore::readContentsOfFile):
1189         * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
1190         (+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]):
1191         * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
1192         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1193         (-[_WKUserContentFilter usesCopiedMemory]):
1194         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
1195         * WebProcess/UserContent/WebUserContentController.cpp:
1196         (WebKit::WebUserContentController::addContentRuleLists):
1197         * WebProcess/UserContent/WebUserContentController.h:
1198         * WebProcess/WebPage/WebPage.cpp:
1199         (WebKit::m_hostFileDescriptor):
1200
1201 2019-03-11  Chris Dumez  <cdumez@apple.com>
1202
1203         Unreviewed, fix assertions in layout tests on iOS Simulator after r242666.
1204
1205         Log an error but do not crash if we fail to acquire a ProcessAssertion.
1206
1207         * UIProcess/ios/ProcessAssertionIOS.mm:
1208         (WebKit::ProcessAssertion::ProcessAssertion):
1209
1210 2019-03-11  Chris Dumez  <cdumez@apple.com>
1211
1212         WebProcessCache should keep track of processes being added
1213         https://bugs.webkit.org/show_bug.cgi?id=195538
1214
1215         Reviewed by Geoffrey Garen.
1216
1217         WebProcessCache should keep track of processes being added, while they are being
1218         checked for responsiveness. This is useful so that:
1219         - Requests to clear the cache also clear processes being added
1220         - Requests to remove a given process from the cache (either because it crashed
1221           or because it is being used for a history navigation) actually remove the
1222           process if it is still being checked for responsiveness.
1223         - The cached process eviction timer applies to such processes in case something
1224           goes wrong with the code and the pending request does not get processed.
1225
1226         * UIProcess/WebProcessCache.cpp:
1227         (WebKit::generateAddRequestIdentifier):
1228         (WebKit::WebProcessCache::addProcessIfPossible):
1229         (WebKit::WebProcessCache::addProcess):
1230         (WebKit::WebProcessCache::clear):
1231         (WebKit::WebProcessCache::clearAllProcessesForSession):
1232         (WebKit::WebProcessCache::removeProcess):
1233         (WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
1234         (WebKit::WebProcessCache::evictProcess): Deleted.
1235         * UIProcess/WebProcessCache.h:
1236         (WebKit::WebProcessCache::size const):
1237         * UIProcess/WebProcessPool.cpp:
1238         (WebKit::WebProcessPool::processForNavigationInternal):
1239         * UIProcess/WebProcessProxy.cpp:
1240         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1241
1242 2019-03-11  Alex Christensen  <achristensen@webkit.org>
1243
1244         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
1245         https://bugs.webkit.org/show_bug.cgi?id=194523
1246
1247         Reviewed by Alexey Proskuryakov.
1248
1249         Attempt another workaround to prevent crashes.
1250
1251         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1252         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1253         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
1254         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1255         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
1256
1257 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
1258
1259         Unreviewed, rolling out r242688, r242643, r242624.
1260
1261         Caused multiple layout test failures and crashes on iOS and macOS.
1262
1263         Reverted changeset:
1264
1265         "requestAnimationFrame should execute before the next frame"
1266         https://bugs.webkit.org/show_bug.cgi?id=177484
1267         https://trac.webkit.org/changeset/242624/webkit
1268
1269         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1270         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
1271         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
1272         (WebKit::DrawingAreaCoordinatedGraphics::display):
1273         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1274         (WebKit::LayerTreeHost::layerFlushTimerFired):
1275         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1276         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1277         * WebProcess/WebPage/WebPage.cpp:
1278         (WebKit::WebPage::layoutIfNeeded):
1279         (WebKit::WebPage::willDisplayPage):
1280         (WebKit::WebPage::renderingUpdate): Deleted.
1281         * WebProcess/WebPage/WebPage.h:
1282         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1283         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1284
1285 2019-03-11  Darin Adler  <darin@apple.com>
1286
1287         Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
1288         https://bugs.webkit.org/show_bug.cgi?id=195533
1289
1290         Reviewed by Brent Fulgham.
1291
1292         * NetworkProcess/cache/NetworkCache.cpp:
1293         (WebKit::NetworkCache::Cache::dumpContentsToFile): Use appendFixedPrecisionNumber.
1294         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1295         (WebKit::NetworkCache::Entry::asJSON const): Ditto.
1296         * Shared/Gamepad/GamepadData.cpp:
1297         (WebKit::GamepadData::loggingString const): Ditto.
1298         * UIProcess/WebPageProxy.cpp:
1299         (WebKit::WebPageProxy::logDiagnosticMessageWithValue): Use numberToStringFixedPrecision.
1300
1301 2019-03-11  John Wilander  <wilander@apple.com>
1302
1303         Resource Load Statistics: Make it possible exclude localhost from classification
1304         https://bugs.webkit.org/show_bug.cgi?id=195474
1305         <rdar://problem/47520577>
1306
1307         Reviewed by Brent Fulgham.
1308
1309         This patch allows for localhost to be excluded from classification and
1310         treatment as a prevalent resource.
1311
1312         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1313         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
1314         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
1315             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1316         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
1317             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1318         (WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
1319             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1320         (WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
1321             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1322         (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
1323             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1324         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
1325         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1326         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
1327         (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
1328             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1329         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
1330             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1331         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
1332             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1333         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
1334             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1335         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
1336             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
1337         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1338         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
1339         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
1340             Now takes a ShouldIncludeLocalhost parameter.
1341         (WebKit::ResourceLoadStatisticsStore::shouldSkip const):
1342             Convenience function, currently supporting the localhost exclusion.
1343         (WebKit::ResourceLoadStatisticsStore::setIsRunningTest):
1344             Test infrastructure.
1345         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
1346         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1347         (WebKit::WebResourceLoadStatisticsStore::setIsRunningTest):
1348             Test infrastructure.
1349         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1350             Now takes a ShouldIncludeLocalhost parameter.
1351         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1352             Defines the new ShouldIncludeLocalhost boolean enum.
1353         * NetworkProcess/NetworkProcess.cpp:
1354         (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest):
1355             Test infrastructure.
1356         * NetworkProcess/NetworkProcess.h:
1357         * NetworkProcess/NetworkProcess.messages.in:
1358         * NetworkProcess/NetworkSession.cpp:
1359         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
1360             Forwards the localhost setting to the create function.
1361         * NetworkProcess/NetworkSession.h:
1362         * NetworkProcess/NetworkSessionCreationParameters.cpp:
1363         (WebKit::NetworkSessionCreationParameters::encode const):
1364         (WebKit::NetworkSessionCreationParameters::decode):
1365         * NetworkProcess/NetworkSessionCreationParameters.h:
1366             New parameter called shouldIncludeLocalhostInResourceLoadStatistics.
1367         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1368         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1369             Picks up the localhost setting from the parameters.
1370         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1371         (WKWebsiteDataStoreSetStatisticsIsRunningTest):
1372             Test infrastructure.
1373         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1374         * UIProcess/Network/NetworkProcessProxy.cpp:
1375         (WebKit::NetworkProcessProxy::setIsRunningResourceLoadStatisticsTest):
1376             Test infrastructure.
1377         * UIProcess/Network/NetworkProcessProxy.h:
1378         * UIProcess/WebProcessPool.cpp:
1379         (WebKit::WebProcessPool::ensureNetworkProcess):
1380             Picks up the localhost setting from the WebsiteDataStore parameters.
1381         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1382         (WebKit::WebsiteDataStore::parameters):
1383             Makes sure Safari does not exclude localhost.
1384         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1385         (WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest):
1386             Test infrastructure.
1387         * UIProcess/WebsiteData/WebsiteDataStore.h:
1388
1389 2019-03-11  Alex Christensen  <achristensen@webkit.org>
1390
1391         Unreviewed, rolling out r242698.
1392
1393         API test crashes on bots.
1394
1395         Reverted changeset:
1396
1397         "Add a WKContentRuleList variant that uses copied memory
1398         instead of mmap'd shared memory for class A containerized
1399         apps"
1400         https://bugs.webkit.org/show_bug.cgi?id=195511
1401         https://trac.webkit.org/changeset/242698
1402
1403 2019-03-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1404
1405         [WPE] Enable web process sandbox
1406         https://bugs.webkit.org/show_bug.cgi?id=195169
1407
1408         Reviewed by Daniel Bates.
1409
1410         * PlatformWPE.cmake:
1411         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
1412         (WebKit::bubblewrapSpawn):
1413
1414 2019-03-11  Truitt Savell  <tsavell@apple.com>
1415
1416         Unreviewed, rolling out r242697.
1417
1418         Broke internal builders.
1419
1420         Reverted changeset:
1421
1422         "Optimizing loads when creating new pages"
1423         https://bugs.webkit.org/show_bug.cgi?id=195516
1424         https://trac.webkit.org/changeset/242697
1425
1426 2019-03-10  Alex Christensen  <achristensen@webkit.org>
1427
1428         Add a WKContentRuleList variant that uses copied memory instead of mmap'd shared memory for class A containerized apps
1429         https://bugs.webkit.org/show_bug.cgi?id=195511
1430         <rdar://problem/44873269>
1431
1432         Reviewed by Darin Adler.
1433
1434         * NetworkProcess/NetworkContentRuleListManager.cpp:
1435         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
1436         * NetworkProcess/NetworkContentRuleListManager.h:
1437         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1438         (WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting):
1439         (WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting):
1440         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
1441         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1442         * Shared/WebCompiledContentRuleList.cpp:
1443         (WebKit::WebCompiledContentRuleList::usesCopiedMemory const):
1444         (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
1445         (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
1446         (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
1447         (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
1448         (WebKit::WebCompiledContentRuleList::actions const):
1449         * Shared/WebCompiledContentRuleList.h:
1450         * Shared/WebCompiledContentRuleListData.cpp:
1451         (WebKit::WebCompiledContentRuleListData::size const):
1452         (WebKit::WebCompiledContentRuleListData::dataPointer const):
1453         (WebKit::WebCompiledContentRuleListData::encode const):
1454         (WebKit::WebCompiledContentRuleListData::decode):
1455         * Shared/WebCompiledContentRuleListData.h:
1456         (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
1457         * UIProcess/API/APIContentRuleList.cpp:
1458         (API::ContentRuleList::usesCopiedMemory const):
1459         * UIProcess/API/APIContentRuleList.h:
1460         * UIProcess/API/APIContentRuleListStore.cpp:
1461         (API::getData):
1462         (API::decodeContentRuleListMetaData):
1463         (API::ContentRuleListStore::readContentsOfFile):
1464         (API::MappedOrCopiedData::dataPointer const):
1465         (API::openAndMapOrCopyContentRuleList):
1466         (API::compiledToFile):
1467         (API::createExtension):
1468         (API::ContentRuleListStore::lookupContentRuleList):
1469         (API::ContentRuleListStore::compileContentRuleList):
1470         (API::ContentRuleListStore::getContentRuleListSource):
1471         (API::openAndMapContentRuleList): Deleted.
1472         * UIProcess/API/APIContentRuleListStore.h:
1473         * UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
1474         (API::ContentRuleListStore::readContentsOfFile):
1475         * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
1476         (+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]):
1477         * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
1478         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1479         (-[_WKUserContentFilter usesCopiedMemory]):
1480         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
1481         * WebProcess/UserContent/WebUserContentController.cpp:
1482         (WebKit::WebUserContentController::addContentRuleLists):
1483         * WebProcess/UserContent/WebUserContentController.h:
1484         * WebProcess/WebPage/WebPage.cpp:
1485         (WebKit::m_hostFileDescriptor):
1486
1487 2019-03-10  Jiewen Tan  <jiewen_tan@apple.com>
1488
1489         Optimizing loads when creating new pages
1490         https://bugs.webkit.org/show_bug.cgi?id=195516
1491         <rdar://problem/48738086>
1492
1493         Reviewed by Darin Adler.
1494
1495         This patch adds hooks in WebPageProxy::createNewPage to optimize loads, and moves the creationParameters
1496         of API::NavigationAction from UI clients to WebPageProxy::createNewPage. Also, we now pass the whole
1497         API::NavigationAction to the load optimizer instead of the request within.
1498
1499         * UIProcess/API/APINavigationAction.h:
1500         * UIProcess/API/APIUIClient.h:
1501         (API::UIClient::createNewPage):
1502         * UIProcess/API/C/WKPage.cpp:
1503         (WKPageSetPageUIClient):
1504         * UIProcess/API/glib/WebKitUIClient.cpp:
1505         * UIProcess/Cocoa/NavigationState.mm:
1506         (WebKit::tryOptimizingLoad):
1507         (WebKit::tryInterceptNavigation):
1508         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1509         * UIProcess/Cocoa/UIDelegate.h:
1510         * UIProcess/Cocoa/UIDelegate.mm:
1511         (WebKit::UIDelegate::UIClient::createNewPage):
1512         * UIProcess/WebPageProxy.cpp:
1513         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1514         (WebKit::tryOptimizingLoad):
1515         (WebKit::WebPageProxy::createNewPage):
1516         * UIProcess/WebPageProxy.h:
1517
1518 2019-03-10  Tim Horton  <timothy_horton@apple.com>
1519
1520         Add SPI to retrieve the set of text inputs in a given rect, and later focus one
1521         https://bugs.webkit.org/show_bug.cgi?id=195499
1522
1523         Reviewed by Darin Adler.
1524
1525         * Scripts/webkit/messages.py:
1526         * Shared/TextInputContext.cpp: Added.
1527         (IPC::ArgumentCoder<WebKit::TextInputContext>::encode):
1528         (IPC::ArgumentCoder<WebKit::TextInputContext>::decode):
1529         * Shared/TextInputContext.h: Added.
1530         (WebKit::TextInputContext::operator== const):
1531         Add TextInputContext, which represents a minimal set of information
1532         about a text field.
1533
1534         * Sources.txt:
1535         * SourcesCocoa.txt:
1536         * UIProcess/API/Cocoa/WKWebView.mm:
1537         (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
1538         (-[WKWebView _focusTextInputContext:completionHandler:]):
1539         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1540         Add SPI that allows clients to asynchronously request text input
1541         contexts for a given rect, and later focus a given context.
1542
1543         * UIProcess/API/Cocoa/_WKTextInputContext.h: Added.
1544         * UIProcess/API/Cocoa/_WKTextInputContext.mm: Added.
1545         (-[_WKTextInputContext _initWithTextInputContext:]):
1546         (-[_WKTextInputContext boundingRect]):
1547         (-[_WKTextInputContext _textInputContext]):
1548         (-[_WKTextInputContext isEqual:]):
1549         (-[_WKTextInputContext hash]):
1550         (-[_WKTextInputContext copyWithZone:]):
1551         * UIProcess/API/Cocoa/_WKTextInputContextInternal.h: Added.
1552         Add an SPI object that exposes a read-only window on a TextInputContext to clients.
1553
1554         * UIProcess/WebPageProxy.cpp:
1555         (WebKit::WebPageProxy::textInputContextsInRect):
1556         (WebKit::WebPageProxy::focusTextInputContext):
1557         * UIProcess/WebPageProxy.h:
1558         Plumbing from WKWebView<->WebPage.
1559
1560         * WebKit.xcodeproj/project.pbxproj:
1561         * WebProcess/WebPage/WebPage.cpp:
1562         (WebKit::elementRectInWindowCoordinates):
1563         (WebKit::isEditableTextInputElement):
1564         (WebKit::WebPage::textInputContextsInRect):
1565         Search the DOM for text input contexts: <input type='text'> (or other
1566         form fields that fall back on text field behavior), <textarea>, and
1567         contenteditable roots. Store the WebPage, Document, and Element identifiers
1568         so that we can find the element again later.
1569
1570         (WebKit::WebPage::focusTextInputContext):
1571         Find the element for a given (web page, document, element) triple and focus it,
1572         if it's still available.
1573
1574         * WebProcess/WebPage/WebPage.h:
1575         * WebProcess/WebPage/WebPage.messages.in:
1576
1577 2019-03-10  Tim Horton  <timothy_horton@apple.com>
1578
1579         iOS: Using ⌥ to scroll horizontally is no different than arrow key
1580         https://bugs.webkit.org/show_bug.cgi?id=195268
1581         <rdar://problem/48326682>
1582
1583         Reviewed by Brent Fulgham.
1584
1585         * UIProcess/ios/WKContentViewInteraction.mm:
1586         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]):
1587         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]): Deleted.
1588         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
1589         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
1590         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
1591         (-[WKKeyboardScrollViewAnimator setDelegate:]):
1592         (-[WKKeyboardScrollViewAnimator distanceForIncrement:inDirection:]):
1593         (-[WKKeyboardScrollViewAnimator distanceForIncrement:]): Deleted.
1594         Add a direction parameter to -distanceForIncrement:, so the client
1595         can return a different page/document size based on the scrolling axis.
1596         Adopt it both in the default implementation and in WKContentViewInteraction.
1597         Make the option key scroll by page when scrolling horizontally, like it
1598         does when scrolling vertically.
1599
1600 2019-03-10  David Quesada  <david_quesada@apple.com>
1601
1602         ASSERT(m_downloads.isEmpty()) fails in DownloadProxyMap::~DownloadProxyMap()
1603         https://bugs.webkit.org/show_bug.cgi?id=152480
1604
1605         Reviewed by Chris Dumez.
1606
1607         * UIProcess/Downloads/DownloadProxyMap.cpp:
1608         (WebKit::DownloadProxyMap::downloadFinished):
1609             If the DownloadProxy is holding the last reference to the process pool, then
1610             invalidating the proxy will cause the process pool, the network process proxy,
1611             and this DownloadProxyMap to deallocate. Ensure that doesn't happen until this
1612             method has done everything it wants to do to clean up.
1613
1614 2019-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1615
1616         Fix some misleading function and variable names in WKContentViewInteraction.mm
1617         https://bugs.webkit.org/show_bug.cgi?id=195536
1618
1619         Reviewed by Tim Horton.
1620
1621         * UIProcess/ios/WKContentViewInteraction.mm:
1622         (shouldDeferZoomingToSelectionWhenRevealingFocusedElement):
1623
1624         Rename shouldZoomToRevealSelectionRect to shouldDeferZoomingToSelectionWhenRevealingFocusedElement; this
1625         function is used to determine whether we should zoom to the selection rect when revealing the focused element,
1626         and therefore affects whether we need to defer zooming until we get selection information.
1627
1628         (rectToRevealWhenZoomingToFocusedElement):
1629         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1630
1631         Rename shouldShowKeyboard to shouldShowInputView; this boolean indicates whether we should show not only the
1632         keyboard, but other UI for user input such as date and select pickers.
1633
1634         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
1635         (shouldZoomToRevealSelectionRect): Deleted.
1636
1637 2019-03-10  Simon Fraser  <simon.fraser@apple.com>
1638
1639         ScrollingTree should have the final say on where layers go
1640         https://bugs.webkit.org/show_bug.cgi?id=195507
1641
1642         Reviewed by Antti Koivisto.
1643
1644         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1645         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1646         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
1647         (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositions):
1648         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1649         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1650         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1651
1652 2019-03-09  Darin Adler  <darin@apple.com>
1653
1654         [Cocoa] Code signing fails because services are copied into XPCServices after the framework is signed
1655         https://bugs.webkit.org/show_bug.cgi?id=195523
1656
1657         Reviewed by Dan Bernstein.
1658
1659         * WebKit.xcodeproj/project.pbxproj: Make symbolic links while building the WebKit
1660         framework instead of copying in the services after the framework is built.
1661
1662 2019-03-09  Wenson Hsieh  <wenson_hsieh@apple.com>
1663
1664         REGRESSION (r242551): Sporadic hangs when tapping to change selection on iOS
1665         https://bugs.webkit.org/show_bug.cgi?id=195475
1666         <rdar://problem/48721153>
1667
1668         Reviewed by Chris Dumez.
1669
1670         r242551 refactored synchronous autocorrection context requests to send an async IPC message and then use
1671         waitForAndDispatchImmediately, instead of calling sendSync. However, this exposes a couple of existing issues in
1672         the implementation of waitForAndDispatchImmediately that causes sporadic IPC deadlocks when changing selection.
1673
1674         First, passing in InterruptWaitingIfSyncMessageArrives when synchronously waiting for an IPC message currently
1675         does not fulfill its intended behavior of interrupting waiting when a sync message arrives. This is because sync
1676         IPC messages, by default, may be dispatched while the receiver is waiting for a sync reply. This means that the
1677         logic in Connection::SyncMessageState::processIncomingMessage to dispatch an incoming sync message on the main
1678         thread will attempt to handle the incoming message by enqueueing it on the main thread, and then waking up the
1679         client runloop (i.e. signaling m_waitForSyncReplySemaphore). This works in the case of sendSync since the sync
1680         reply semaphore is used to block the main thread, but in the case of waitForAndDispatchImmediately, a different
1681         m_waitForMessageCondition is used instead, so SyncMessageState::processIncomingMessage will only enqueue the
1682         incoming sync message on the main thread, and not actually invoke it.
1683
1684         To fix this first issue, observe that there is pre-existing logic to enqueue the incoming message and signal
1685         m_waitForMessageCondition in Connection::processIncomingMessage. This codepath is currently not taken because we
1686         end up bailing early in the call to SyncMessageState::processIncomingMessage. Instead, we can move this early
1687         return further down in the function, such that if there is an incoming sync message and we're waiting with the
1688         InterruptWaitingIfSyncMessageArrives option, we will correctly enqueue the incoming message, wake the runloop,
1689         and proceed to handle the incoming message.
1690
1691         The second issue is more subtle; consider the scenario in which we send a sync message A from the web process to
1692         the UI process, and simultaneously, in the UI process, we schedule some work to be done on the main thread.
1693         Let's additionally suppose that this scheduled work will send an IPC message B to the web process and
1694         synchronously wait for a reply (in the case of this particular bug, this is the sync autocorrection context
1695         request). What happens upon receiving sync message A is that the IPC thread in the UI process will schedule A on
1696         the main thread; however, before the scheduled response to A is invoked, we will first invoke previously
1697         scheduled work that attempts to block synchronously until a message B is received. In summary:
1698
1699         1. (Web process)    sends sync IPC message A to UI process.
1700         2. (UI process)     schedules some main runloop task that will block synchronously on IPC message B.
1701         3. (UI process)     receives sync IPC message A and schedules A on the main runloop.
1702         4. (UI process)     carry out the task scheduled in (2) and block on B.
1703
1704         ...and then, the UI process and web process are now deadlocked because the UI process is waiting for B to
1705         arrive, but the web process can't send B because it's waiting for a reply for IPC message A! To fix this second
1706         deadlock, we first make an important observation: when using sendSync, we don't run into this problem because
1707         immediately before sending sync IPC, we will attempt to handle any incoming sync IPC messages that have been
1708         queued up. However, when calling waitForAndDispatchImmediately, we don't have this extra step, so a deadlock may
1709         occur in the manner described above. To fix this, we make waitForAndDispatchImmediately behave more like
1710         sendSync, by handling all incoming sync messages prior to blocking on an IPC response.
1711
1712         Test: editing/selection/ios/change-selection-by-tapping.html
1713
1714         * Platform/IPC/Connection.cpp:
1715         (IPC::Connection::waitForMessage):
1716         (IPC::Connection::processIncomingMessage):
1717
1718 2019-03-09  Andy Estes  <aestes@apple.com>
1719
1720         [Apple Pay] CanMakePaymentsWithActiveCard and OpenPaymentSetup should be async messages
1721         https://bugs.webkit.org/show_bug.cgi?id=195526
1722         <rdar://problem/48745636>
1723
1724         Reviewed by Chris Dumez.
1725
1726         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
1727         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
1728         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
1729         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
1730         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1731         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1732         (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
1733         (WebKit::WebPaymentCoordinator::openPaymentSetup):
1734         (WebKit::generateCanMakePaymentsWithActiveCardReplyID): Deleted.
1735         (WebKit::generateOpenPaymentSetupReplyID): Deleted.
1736         (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCardReply): Deleted.
1737         (WebKit::WebPaymentCoordinator::openPaymentSetupReply): Deleted.
1738         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1739         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
1740
1741 2019-03-09  Andy Estes  <aestes@apple.com>
1742
1743         [iOS] Remove unneeded entitlements and sandbox allowances from the Networking service
1744         https://bugs.webkit.org/show_bug.cgi?id=195527
1745
1746         Reviewed by Eric Carlson.
1747
1748         * Configurations/Network-iOS.entitlements:
1749         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1750
1751 2019-03-09  Chris Dumez  <cdumez@apple.com>
1752
1753         Use modern async IPC with reply for device orientation permission
1754         https://bugs.webkit.org/show_bug.cgi?id=195529
1755
1756         Reviewed by Ryosuke Niwa.
1757
1758         * UIProcess/WebPageProxy.cpp:
1759         (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
1760         * UIProcess/WebPageProxy.h:
1761         * UIProcess/WebPageProxy.messages.in:
1762         * WebProcess/WebPage/WebPage.cpp:
1763         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
1764         (WebKit::nextDeviceOrientationAndMotionPermissionCallbackID): Deleted.
1765         (WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision): Deleted.
1766         * WebProcess/WebPage/WebPage.h:
1767         * WebProcess/WebPage/WebPage.messages.in:
1768
1769 2019-03-09  Zalan Bujtas  <zalan@apple.com>
1770
1771         [ContentChangeObserver] Start observing for content change between touchEnd and mouseMoved start
1772         https://bugs.webkit.org/show_bug.cgi?id=195510
1773         <rdar://problem/48735695>
1774
1775         Reviewed by Simon Fraser.
1776
1777         * WebProcess/WebPage/ios/WebPageIOS.mm:
1778         (WebKit::WebPage::cancelPotentialTapInFrame):
1779
1780 2019-03-08  Chris Dumez  <cdumez@apple.com>
1781
1782         Enable ProcessAssertions on iOS Simulator
1783         https://bugs.webkit.org/show_bug.cgi?id=195479
1784
1785         Reviewed by Alexey Proskuryakov.
1786
1787         Enable ProcessAssertions on iOS Simulator. We have some layout tests timing out in the
1788         iOS Simulator due to the WebContent process suspending. Turning on ProcessAssertions in
1789         the iOS Simulator seems to make those tests pass.
1790
1791         * UIProcess/ProcessAssertion.cpp:
1792         * UIProcess/ProcessAssertion.h:
1793         * UIProcess/ios/ProcessAssertionIOS.mm:
1794
1795 2019-03-08  Chris Dumez  <cdumez@apple.com>
1796
1797         Add support for Device Orientation / Motion permission API
1798         https://bugs.webkit.org/show_bug.cgi?id=195329
1799         <rdar://problem/47645367>
1800
1801         Reviewed by Geoffrey Garen.
1802
1803         Add support for Device Orientation / Motion permission API:
1804         - https://github.com/w3c/deviceorientation/issues/57
1805
1806         This adds new SPI to WKUIDelegatePrivate, until we can make this API.
1807
1808         * Shared/WebPreferences.yaml:
1809         * UIProcess/API/APIUIClient.h:
1810         (API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
1811         * UIProcess/API/C/WKPage.cpp:
1812         (WKPageSetPageUIClient):
1813         * UIProcess/API/C/WKPageUIClient.h:
1814         * UIProcess/API/Cocoa/WKUIDelegate.h:
1815         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1816         * UIProcess/Cocoa/UIDelegate.h:
1817         * UIProcess/Cocoa/UIDelegate.mm:
1818         (WebKit::UIDelegate::setDelegate):
1819         (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
1820         * UIProcess/WebPageProxy.cpp:
1821         (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
1822         * UIProcess/WebPageProxy.h:
1823         * UIProcess/WebPageProxy.messages.in:
1824         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1825         (WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
1826         * WebProcess/WebCoreSupport/WebChromeClient.h:
1827         * WebProcess/WebPage/WebPage.cpp:
1828         (WebKit::nextDeviceOrientationAndMotionPermissionCallbackID):
1829         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
1830         (WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision):
1831         * WebProcess/WebPage/WebPage.h:
1832         * WebProcess/WebPage/WebPage.messages.in:
1833
1834 2019-03-08  Brady Eidson  <beidson@apple.com>
1835
1836         Have the UIProcess take the UnboundedNetworking assertion when downloads are in progress.
1837         https://bugs.webkit.org/show_bug.cgi?id=195468
1838
1839         Reviewed by Andy Estes.
1840
1841         * UIProcess/Downloads/DownloadProxyMap.cpp:
1842         (WebKit::DownloadProxyMap::DownloadProxyMap):
1843         (WebKit::DownloadProxyMap::createDownloadProxy): If this is the first download, and the process has the entitlement,
1844           take the assertion.
1845         (WebKit::DownloadProxyMap::downloadFinished):
1846         (WebKit::DownloadProxyMap::processDidClose):
1847         * UIProcess/Downloads/DownloadProxyMap.h:
1848
1849 2019-03-08  Chris Dumez  <cdumez@apple.com>
1850
1851         Add assertions to help debug a WebProcessCache crash
1852         https://bugs.webkit.org/show_bug.cgi?id=195469
1853
1854         Reviewed by Brady Eidson.
1855
1856         I suspect the process's registrableDomain in null when evictProcess() gets
1857         called, thus crashing when lookup it up in the HashMap. Confirm this and
1858         how this could happen via assertions.
1859
1860         * UIProcess/WebProcessCache.cpp:
1861         (WebKit::WebProcessCache::evictProcess):
1862         * UIProcess/WebProcessProxy.cpp:
1863         (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
1864
1865 2019-03-08  Brady Eidson  <beidson@apple.com>
1866
1867         Rename AssertionState::Download.
1868         https://bugs.webkit.org/show_bug.cgi?id=195465
1869
1870         Reviewed by Andy Estes.
1871
1872         It's (currently) about uploads and downloads.
1873         Let's call it "UnboundedNetworking"
1874
1875         * NetworkProcess/Downloads/DownloadMap.cpp:
1876         (WebKit::DownloadMap::add):
1877
1878         * UIProcess/ProcessAssertion.h:
1879
1880         * UIProcess/WebProcessProxy.cpp:
1881         (WebKit::WebProcessProxy::didSetAssertionState):
1882
1883         * UIProcess/ios/ProcessAssertionIOS.mm:
1884         (WebKit::flagsForState):
1885         (WebKit::reasonForState):
1886
1887 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
1888
1889         [macOS UI-side compositing] Mouse handling can trigger a crash before we have a scrolling tree root
1890         https://bugs.webkit.org/show_bug.cgi?id=195467
1891
1892         Reviewed by Antti Koivisto.
1893         
1894         When launching MiniBrowser with UI-side compositing enabled in a state where the window
1895         appears under the mouse, we can hit RemoteScrollingTree::handleMouseEvent() for a mouseEnter
1896         event before we have a scrolling tree root node, so add a null check.
1897
1898         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
1899         (WebKit::RemoteScrollingTree::handleMouseEvent):
1900
1901 2019-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1902
1903         REGRESSION(r242624): [GTK] New rAF code path assumes AC mode
1904         https://bugs.webkit.org/show_bug.cgi?id=195459
1905
1906         Reviewed by Žan Doberšek.
1907
1908         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1909         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
1910         The refresh monitor now calls scheduleLayerFlush() but when AC
1911         mode is disabled this method does nothing, so setNeedsDisplay()
1912         needs to be called instead.
1913
1914 2019-03-07  Tim Horton  <timothy_horton@apple.com>
1915
1916         Crash under RemoteLayerTreePropertyApplier::applyProperties
1917         https://bugs.webkit.org/show_bug.cgi?id=195448
1918         <rdar://problem/48588226>
1919
1920         Reviewed by Simon Fraser.
1921
1922         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1923         (WebKit::RemoteLayerTreeHost::updateLayerTree):
1924         Under some currently-unknown circumstances, the UI process is receiving
1925         commits referring to layers that it does not know about.
1926         One understood case of this was fixed in r241899, but there seem to be
1927         cases remaining that are not understood.
1928         Also, add a release log so that we can identify any downstream effects.
1929
1930 2019-03-07  Zalan Bujtas  <zalan@apple.com>
1931
1932         [ContentChangeObserver] Introduce fixed duration content observation
1933         https://bugs.webkit.org/show_bug.cgi?id=195295
1934         <rdar://problem/48579913>
1935
1936         Reviewed by Simon Fraser.
1937
1938         * WebProcess/WebPage/ios/WebPageIOS.mm:
1939         (WebKit::WebPage::handleSyntheticClick):
1940         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1941
1942 2019-03-07  Fujii Hironori  <Hironori.Fujii@sony.com>
1943
1944         [WinCairo][WebKit] Nothing is drawn after Web process crashed
1945         https://bugs.webkit.org/show_bug.cgi?id=195399
1946
1947         Reviewed by Alex Christensen.
1948
1949         PageClientImpl::viewSize returned 0x0 size after Web process
1950         crashed. Restored the original implementation using GetClientRect
1951         (Bug 52175).
1952
1953         * UIProcess/win/PageClientImpl.cpp:
1954         (WebKit::PageClientImpl::viewSize):
1955
1956 2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
1957
1958         requestAnimationFrame should execute before the next frame
1959         https://bugs.webkit.org/show_bug.cgi?id=177484
1960
1961         Reviewed by Simon Fraser.
1962
1963         Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
1964         a single call to Page::renderingUpdate(). This new function implements 
1965         "Update the rendering" step of the HTML Event Loop specification
1966         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
1967
1968         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1969         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
1970         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1971         (WebKit::LayerTreeHost::layerFlushTimerFired):
1972         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1973         (WebKit::DrawingAreaImpl::display):
1974         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1975         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1976         * WebProcess/WebPage/WebPage.cpp:
1977         (WebKit::WebPage::layoutIfNeeded):
1978         (WebKit::WebPage::renderingUpdate):
1979         (WebKit::WebPage::willDisplayPage): Deleted.
1980         * WebProcess/WebPage/WebPage.h:
1981         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1982         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1983
1984 2019-03-07  Zalan Bujtas  <zalan@apple.com>
1985
1986         [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
1987         https://bugs.webkit.org/show_bug.cgi?id=195353
1988         <rdar://problem/48626394>
1989
1990         Reviewed by Simon Fraser.
1991
1992         * Shared/WebPreferences.yaml:
1993         * UIProcess/API/C/WKPreferences.cpp:
1994         (WKPreferencesSetContentChangeObserverEnabled):
1995         (WKPreferencesGetContentChangeObserverEnabled):
1996         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1997         * UIProcess/API/Cocoa/WKPreferences.mm:
1998         (-[WKPreferences _contentChangeObserverEnabled]):
1999         (-[WKPreferences _setContentChangeObserverEnabled:]):
2000         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2001         * WebProcess/WebPage/ios/WebPageIOS.mm:
2002         (WebKit::WebPage::handleSyntheticClick):
2003
2004 2019-03-07  Andy Estes  <aestes@apple.com>
2005
2006         [Apple Pay] Untangle PKPaymentAuthorizationViewController from WebPaymentCoordinatorProxy
2007         https://bugs.webkit.org/show_bug.cgi?id=195349
2008         <rdar://problem/48625510>
2009
2010         Reviewed by Alex Christensen.
2011
2012         Introduced PaymentAuthorizationPresenter and WKPaymentAuthorizationDelegate to encapsulate
2013         PKPaymentAuthorizationViewController and its delegate. Taught WebPaymentCoordinatorProxy to
2014         interact with PaymentAuthorizationPresenter rather than PKPAVC directly.
2015
2016         These changes will allow us to swap out PKPaymentAuthorizationViewController with PKPaymentAuthorizationController in a follow-on patch.
2017
2018         * Platform/cocoa/PaymentAuthorizationPresenter.h: Added. Defined the abstract interface for
2019         payment authorization presenters that use PKPA(V)C.
2020         * Platform/cocoa/PaymentAuthorizationPresenter.mm: Added.
2021         (WebKit::toPKPaymentAuthorizationStatus): Moved from WebPaymentCoordinatorProxyCocoa.mm.
2022         (WebKit::toPKPaymentErrorCode): Ditto.
2023         (WebKit::toNSError): Ditto.
2024         (WebKit::toNSErrors): Ditto.
2025         (WebKit::toPKShippingMethods): Ditto.
2026         (WebKit::PaymentAuthorizationPresenter::completeMerchantValidation): Added. Implements the
2027         logic previously in WebPaymentCoordinatorProxy::platformCompleteMerchantValidation.
2028         (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): Ditto for
2029         WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection.
2030         (WebKit::PaymentAuthorizationPresenter::completePaymentSession): Ditto for 
2031         (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection): Ditto for
2032         WebPaymentCoordinatorProxy::platformCompletePaymentSession.
2033         (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): Ditto for
2034         WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection.
2035         * Platform/cocoa/PaymentAuthorizationViewController.h: Added. Defined a subclass of PaymentAuthorizationPresenter for PKPaymentAuthorizationViewController.
2036         * Platform/cocoa/PaymentAuthorizationViewController.mm: Added.
2037         (-[WKPaymentAuthorizationViewControllerDelegate initWithPresenter:]): Added a PKPAVC
2038         delegate that's a subclass of WKPaymentAuthorizationDelegate.
2039         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
2040         Called -[WKPaymentAuthorizationDelegate _didFinish].
2041         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Called
2042         -[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:].
2043         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Called
2044         -[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:].
2045         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Called
2046         -[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:].
2047         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Called
2048         -[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:].
2049         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]):
2050         Called -[WKPaymentAuthorizationDelegate _willFinishWithError:].
2051         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Called
2052         -[WKPaymentAuthorizationDelegate _didRequestMerchantSession:].
2053         * Platform/cocoa/WKPaymentAuthorizationDelegate.h: Added.
2054         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: Added.
2055         (-[WKPaymentAuthorizationDelegate summaryItems]): Added a summaryItems getter.
2056         (-[WKPaymentAuthorizationDelegate shippingMethods]): Ditto for shippingMethods.
2057         (-[WKPaymentAuthorizationDelegate completeMerchantValidation:error:]): Called
2058         _didRequestMerchantSessionCompletion then set it to nil.
2059         (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): Ditto for
2060         _didSelectPaymentMethodCompletion.
2061         (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]): Ditto
2062         for _didAuthorizePaymentCompletion.
2063         (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
2064         Ditto for _didSelectShippingContactCompletion.
2065         (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): Ditto for
2066         _didSelectShippingMethodCompletion.
2067         (-[WKPaymentAuthorizationDelegate invalidate]): If there's an outstanding authorization
2068         callback, called -completePaymentSession:errors:didReachFinalState: with a state of
2069         PKPaymentAuthorizationStatusFailure.
2070         (-[WKPaymentAuthorizationDelegate _initWithPresenter:]):
2071         (-[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:]): Added. Implements the
2072         logic previously in WKPaymentAuthorizationViewControllerDelegate.
2073         (-[WKPaymentAuthorizationDelegate _didFinish]): Ditto.
2074         (-[WKPaymentAuthorizationDelegate _didRequestMerchantSession:]): Ditto.
2075         (-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]): Ditto.
2076         (-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]): Ditto.
2077         (toShippingMethod): Moved from WebPaymentCoordinatorProxyCocoa.mm.
2078         (-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]): Added. Implements
2079         the logic previously in WKPaymentAuthorizationViewControllerDelegate.
2080         (-[WKPaymentAuthorizationDelegate _willFinishWithError:]): Ditto.
2081         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
2082         (WebKit::WebPaymentCoordinatorProxy::presenterWillValidateMerchant): To conform to
2083         PaymentAuthorizationPresenter::Client, renamed from validateMerchant.
2084         (WebKit::WebPaymentCoordinatorProxy::presenterDidAuthorizePayment): Renamed from
2085         didAuthorizePayment.
2086         (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Moved logic here that previously
2087         existed in WKPaymentAuthorizationViewControllerDelegate.
2088         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingMethod): Renamed from
2089         didSelectShippingMethod.
2090         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingContact): Renamed from
2091         didSelectShippingContact.
2092         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectPaymentMethod): Renamed from
2093         didSelectPaymentMethod.
2094         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Renamed to
2095         presenterWillValidateMerchant.
2096         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Renamed to
2097         presenterDidAuthorizePayment.
2098         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Renamed to
2099         presenterDidSelectShippingMethod.
2100         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Renamed to
2101         presenterDidSelectShippingContact.
2102         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Renamed to
2103         didSelectPaymentMethod.
2104         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Changed WebPaymentCoordinatorProxy to
2105         subclass PaymentAuthorizationPresenter::Client.
2106         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Removed WKPaymentAuthorizationViewControllerDelegate interface and declared some helper functions
2107         needed by PaymentAuthorizationPresenter.
2108         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2109         (WebKit::toPKPaymentSummaryItemType): Removed static keyword.
2110         (WebKit::toDecimalNumber): Ditto.
2111         (WebKit::toPKPaymentSummaryItem): Ditto.
2112         (WebKit::toPKPaymentSummaryItems): Ditto.
2113         (WebKit::toPKShippingMethod): Ditto.
2114         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Changed to call
2115         m_authorizationPresenter.
2116         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Ditto.
2117         (WebKit::WebPaymentCoordinatorProxy::platformCompleteMerchantValidation): Ditto.
2118         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): Ditto.
2119         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Ditto.
2120         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): Ditto.
2121         (-[WKPaymentAuthorizationViewControllerDelegate initWithPaymentCoordinatorProxy:]): Deleted.
2122         (-[WKPaymentAuthorizationViewControllerDelegate invalidate]): Deleted.
2123         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]): Deleted.
2124         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Deleted.
2125         (toShippingMethod): Deleted.
2126         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Deleted.
2127         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Deleted.
2128         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Deleted.
2129         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Deleted.
2130         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
2131         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
2132         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
2133         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
2134         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): Deleted.
2135         (WebKit::toPKPaymentAuthorizationStatus): Moved to PaymentAuthorizationPresenter.mm.
2136         (WebKit::toPKPaymentErrorCode): Ditto.
2137         (WebKit::toNSError): Ditto.
2138         (WebKit::toNSErrors): Ditto.
2139         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2140         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Changed to present a
2141         PaymentAuthorizationPresenter rather than a PKPAVC.
2142         (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Changed to dismiss a
2143         PaymentAuthorizationPresenter rather than a PKPAVC.
2144         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2145         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
2146         (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Ditto.
2147         * SourcesCocoa.txt:
2148         * UIProcess/WebPageProxy.h:
2149         * UIProcess/ios/WebPageProxyIOS.mm:
2150         (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter): Added. Returns a new
2151         PaymentAuthorizationViewController.
2152         * WebKit.xcodeproj/project.pbxproj:
2153
2154 2019-03-07  Chris Dumez  <cdumez@apple.com>
2155
2156         Regression(r242580) WebKit.NetworkProcessCrashWithPendingConnection API is crashing on iOS debug
2157         https://bugs.webkit.org/show_bug.cgi?id=195416
2158
2159         Reviewed by Antti Koivisto.
2160
2161         Drop ASSERT_NOT_REACHED() in WebPage::didCompletePageTransition() when the tree is still frozen due to
2162         LayerTreeFreezeReason::ProcessSuspended. As demonstrated by this API test, nothing prevents a load from
2163         completing and WebPage::didCompletePageTransition() to get called *after* WebProcess::prepareToSuspend()
2164         has been called. From the logging during the test, I can tell that WebProcess::processDidResume() gets
2165         called later on and the LayerTreeFreezeReason::ProcessSuspended freezing reason gets dropped, as expected.
2166
2167         * WebProcess/WebPage/WebPage.cpp:
2168         (WebKit::WebPage::didCompletePageTransition):
2169
2170 2019-03-07  Chris Dumez  <cdumez@apple.com>
2171
2172         Clean up / simplify ProcessAssertion code
2173         https://bugs.webkit.org/show_bug.cgi?id=195394
2174
2175         Reviewed by Geoffrey Garen.
2176
2177         Clean up / simplify ProcessAssertion code to facilitate its maintenance and make it
2178         less error-prone.
2179
2180         * Platform/IPC/mac/ConnectionMac.mm:
2181         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2182         * UIProcess/ProcessAssertion.cpp:
2183         (WebKit::ProcessAssertion::ProcessAssertion):
2184         (WebKit::ProcessAssertion::setState):
2185         * UIProcess/ProcessAssertion.h:
2186         (WebKit::ProcessAssertion::Client::~Client):
2187         (WebKit::ProcessAssertion::setClient):
2188         (WebKit::ProcessAssertion::client):
2189         * UIProcess/ProcessThrottler.cpp:
2190         (WebKit::ProcessThrottler::didConnectToProcess):
2191         * UIProcess/ProcessThrottler.h:
2192         * UIProcess/ios/ProcessAssertionIOS.mm:
2193         (-[WKProcessAssertionBackgroundTaskManager dealloc]):
2194         (-[WKProcessAssertionBackgroundTaskManager addAssertionNeedingBackgroundTask:]):
2195         (-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]):
2196         (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]):
2197         (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
2198         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2199         (WebKit::ProcessAssertion::ProcessAssertion):
2200         (WebKit::ProcessAssertion::processAssertionWasInvalidated):
2201         (WebKit::ProcessAssertion::setState):
2202         (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
2203         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
2204         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2205         (WebKit::ProcessAndUIAssertion::processAssertionWasInvalidated):
2206         (WebKit::ProcessAndUIAssertion::setState):
2207         (WebKit::ProcessAndUIAssertion::uiAssertionWillExpireImminently):
2208
2209 2019-03-07  Commit Queue  <commit-queue@webkit.org>
2210
2211         Unreviewed, rolling out r242297.
2212         https://bugs.webkit.org/show_bug.cgi?id=195430
2213
2214         Broke Microsoft Visio. (Requested by dydz on #webkit).
2215
2216         Reverted changeset:
2217
2218         "[iOS] Turn mouse event simulation on by default"
2219         https://bugs.webkit.org/show_bug.cgi?id=195218
2220         https://trac.webkit.org/changeset/242297
2221
2222 2019-03-07  John Wilander  <wilander@apple.com>
2223
2224         Resource Load Statistics: Log first-party navigations with link decoration
2225         https://bugs.webkit.org/show_bug.cgi?id=195301
2226         <rdar://problem/48569971>
2227
2228         Reviewed by Brent Fulgham.
2229
2230         This patch adds a call to the network process' resource load statistics to
2231         log cross-site navigations with link decoration. The logging checks if the
2232         source of the navigation is a prevalent resource and if so, sets the
2233         appropriate flag for the destination.
2234
2235         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2236         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
2237         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
2238         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
2239         (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
2240         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2241         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2242         (WebKit::ResourceLoadStatisticsMemoryStore::logCrossSiteLoadWithLinkDecoration):
2243         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2244         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2245         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2246         (WebKit::WebResourceLoadStatisticsStore::logCrossSiteLoadWithLinkDecoration):
2247         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2248         * NetworkProcess/NetworkProcess.cpp:
2249         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
2250             This now receives a completion handler. This is in preparation for
2251             test cases where we need to log such an event and wait for it to
2252             finish before continuing.
2253         * NetworkProcess/NetworkProcess.h:
2254         * NetworkProcess/NetworkProcess.messages.in:
2255         * UIProcess/Network/NetworkProcessProxy.cpp:
2256         (WebKit::NetworkProcessProxy::committedCrossSiteLoadWithLinkDecoration):
2257         * UIProcess/Network/NetworkProcessProxy.h:
2258         * UIProcess/WebPageProxy.cpp:
2259         (WebKit::WebPageProxy::didCommitLoadForFrame):
2260         * UIProcess/WebProcessPool.cpp:
2261         (WebKit::WebProcessPool::committedCrossSiteLoadWithLinkDecoration):
2262         * UIProcess/WebProcessPool.h:
2263
2264 2019-03-07  Per Arne Vollan  <pvollan@apple.com>
2265
2266         [iOS] Disable permissive call logging in sandbox
2267         https://bugs.webkit.org/show_bug.cgi?id=195288
2268         <rdar://problem/47683804>
2269
2270         Reviewed by Brent Fulgham.
2271
2272         As on macOS, we should enable strict call filtering in sandbox on iOS.
2273
2274         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2275
2276 2019-03-07  Youenn Fablet  <youenn@apple.com>
2277
2278         Introduce a quota manager for Cache API/Service Worker/IDB storage
2279         https://bugs.webkit.org/show_bug.cgi?id=195283
2280
2281         Reviewed by Chris Dumez.
2282
2283         Remove quota handling from Cache API storage and use StorageQuotaManager/StorageQuotaUser.
2284         CacheStorage::Caches becomes a quota user and has a StorageQuotaManager to check for space for any cache API write task.
2285         NetworkProcess is responsible to manage the quota managers.
2286         Quota managers will go through network process to ask UIProcess for quota extension.
2287
2288         Remove pending callback handling from CacheStorage since they are queued in QuotaManager now.
2289
2290         * NetworkProcess/NetworkProcess.cpp:
2291         (WebKit::NetworkProcess::~NetworkProcess):
2292         (WebKit::NetworkProcess::destroySession):
2293         (WebKit::NetworkProcess::cacheStorageRootPath):
2294         (WebKit::NetworkProcess::setCacheStorageParameters):
2295         (WebKit::NetworkProcess::storageQuotaManager):
2296         * NetworkProcess/NetworkProcess.h:
2297         * NetworkProcess/cache/CacheStorageEngine.cpp:
2298         (WebKit::CacheStorage::Engine::from):
2299         (WebKit::CacheStorage::Engine::Engine):
2300         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2301         * NetworkProcess/cache/CacheStorageEngine.h:
2302         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2303         (WebKit::CacheStorage::Cache::put):
2304         * NetworkProcess/cache/CacheStorageEngineCache.h:
2305         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2306         (WebKit::CacheStorage::Caches::Caches):
2307         (WebKit::CacheStorage::Caches::~Caches):
2308         (WebKit::CacheStorage::Caches::requestSpace):
2309         (WebKit::CacheStorage::Caches::writeRecord):
2310         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2311
2312 2019-03-07  John Wilander  <wilander@apple.com>
2313
2314         Resource Load Statistics: Make it possible to purge only script-accessible cookies
2315         https://bugs.webkit.org/show_bug.cgi?id=195383
2316         <rdar://problem/48570136>
2317
2318         Reviewed by Brent Fulgham.
2319
2320         This patch provides the ability to purge all script-accessible cookies while leaving
2321         HttpOnly cookies in place.
2322
2323         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
2324         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
2325         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2326         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2327             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
2328         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2329         * NetworkProcess/NetworkProcess.cpp:
2330         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2331             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
2332         (WebKit::NetworkProcess::deleteCookiesForTesting):
2333             Test infrastructure.
2334         * NetworkProcess/NetworkProcess.h:
2335         * NetworkProcess/NetworkProcess.messages.in:
2336         * NetworkProcess/NetworkSession.cpp:
2337         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2338             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
2339         * NetworkProcess/NetworkSession.h:
2340         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2341         (WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
2342             Test infrastructure.
2343         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2344         * UIProcess/Network/NetworkProcessProxy.cpp:
2345         (WebKit::NetworkProcessProxy::deleteCookiesForTesting):
2346             Test infrastructure.
2347         * UIProcess/Network/NetworkProcessProxy.h:
2348         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2349         (WebKit::WebsiteDataStore::deleteCookiesForTesting):
2350             Test infrastructure.
2351         * UIProcess/WebsiteData/WebsiteDataStore.h:
2352
2353 2019-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2354
2355         REGRESSION(r242364): [WPE] Do not stop the compositing run loop update timer on suspend
2356         https://bugs.webkit.org/show_bug.cgi?id=195410
2357
2358         Reviewed by Žan Doberšek.
2359
2360         Calling CompositingRunLoop::stopUpdates() on suspend is leaving the threaded compositor in an inconsistent
2361         state, failing to resume and stopping the updates forever. This is causing timeouts in WPE layout tests. Instead
2362         of calling stopUpdates(), a new suspend() is called, that stops the update timer, without changing the current
2363         updae tha compositing state. A new method resume() is also added to schedule an update if needed.
2364
2365         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2366         (WebKit::CompositingRunLoop::suspend): Set state as suspended and stop the update timer.
2367         (WebKit::CompositingRunLoop::resume): Set state as not suspended and start the update timer if it was scheduled
2368         while suspended.
2369         (WebKit::CompositingRunLoop::scheduleUpdate): Do not start the update timer when suspended.
2370         (WebKit::CompositingRunLoop::compositionCompleted): Ditto.
2371         (WebKit::CompositingRunLoop::updateCompleted): Ditto.
2372         (WebKit::CompositingRunLoop::updateTimerFired): Add an assert to ensure the update timer is not fired while suspended.
2373         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2374         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2375         (WebKit::ThreadedCompositor::suspend): Call CompositingRunLoop::suspend() instead of stopUpdates().
2376         (WebKit::ThreadedCompositor::resume): Call CompositingRunLoop::resume().
2377
2378 2019-03-06  Mark Lam  <mark.lam@apple.com>
2379
2380         Exception is a JSCell, not a JSObject.
2381         https://bugs.webkit.org/show_bug.cgi?id=195392
2382
2383         Reviewed by Saam Barati.
2384
2385         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2386         (WebKit::JSNPObject::throwInvalidAccessError):
2387         * WebProcess/Plugins/Netscape/JSNPObject.h:
2388
2389 2019-03-07  Commit Queue  <commit-queue@webkit.org>
2390
2391         Unreviewed, rolling out r242354.
2392         https://bugs.webkit.org/show_bug.cgi?id=195402
2393
2394         breaks layout tests in all configurations (Requested by
2395         zdobersek on #webkit).
2396
2397         Reverted changeset:
2398
2399         "[WPE] Enable web process sandbox"
2400         https://bugs.webkit.org/show_bug.cgi?id=195169
2401         https://trac.webkit.org/changeset/242354
2402
2403 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
2404
2405         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
2406         https://bugs.webkit.org/show_bug.cgi?id=195346
2407
2408         Reviewed by Fujii Hironori.
2409
2410         * Platform/IPC/win/ConnectionWin.cpp:
2411         (IPC::Connection::createServerAndClientIdentifiers):
2412         * Platform/win/ModuleWin.cpp:
2413         (WebKit::Module::load):
2414         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
2415         (WebKit::ProcessLauncher::launchProcess):
2416         * UIProcess/win/WebContextMenuProxyWin.cpp:
2417         (WebKit::createMenuItem):
2418         * UIProcess/win/WebView.cpp:
2419         (WebKit::WebView::setToolTip):
2420         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
2421         (WebKit::InjectedBundle::initialize):
2422         Use wchar helpers as needed.
2423
2424 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2425
2426         Crash when attempting to change input type while dismissing datalist suggestions
2427         https://bugs.webkit.org/show_bug.cgi?id=195384
2428         <rdar://problem/48563718>
2429
2430         Reviewed by Brent Fulgham.
2431
2432         See WebCore ChangeLog for more details.
2433
2434         * WebProcess/WebPage/WebPage.cpp:
2435         (WebKit::WebPage::setActiveDataListSuggestionPicker):
2436         (WebKit::WebPage::didSelectDataListOption):
2437         (WebKit::WebPage::didCloseSuggestions):
2438         * WebProcess/WebPage/WebPage.h:
2439
2440         Turn m_activeDataListSuggestionPicker from a raw pointer into a WeakPtr.
2441
2442 2019-03-06  Chris Dumez  <cdumez@apple.com>
2443
2444         [iOS] ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent
2445         https://bugs.webkit.org/show_bug.cgi?id=195382
2446         <rdar://problem/48642739>
2447
2448         Reviewed by Geoffrey Garen.
2449
2450         ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent. Previously,
2451         we only send ProcessDidResume() to the WebProcess if PrepareToSuspend() was sent, not when the more urgent
2452         ProcessWillSuspendImminently() IPC was sent.
2453
2454         This mismatch has lead to bugs because the WebProcess does not know it got resumed and failed to unfreeze the
2455         layers it froze upon suspension.
2456
2457         * UIProcess/ProcessAssertion.h:
2458         (WebKit::ProcessAssertionClient::~ProcessAssertionClient):
2459
2460         * UIProcess/ProcessThrottler.cpp:
2461         (WebKit::ProcessThrottler::updateAssertion):
2462         (WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
2463         (WebKit::ProcessThrottler::assertionWillExpireImminently): Deleted.
2464
2465         * UIProcess/ProcessThrottler.h:
2466         * UIProcess/ios/ProcessAssertionIOS.mm:
2467         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
2468         (WebKit::ProcessAssertion::~ProcessAssertion):
2469         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
2470         (WebKit::ProcessAndUIAssertion::setClient):
2471
2472         * WebProcess/WebPage/WebPage.cpp:
2473         (WebKit::WebPage::didCompletePageTransition):
2474         Revert change that was landed in r242098 to work around this ProcessThrottler bug.
2475
2476         * WebProcess/WebPage/ios/WebPageIOS.mm:
2477         (WebKit::WebPage::applicationWillEnterForeground):
2478         Revert change that was landed in r242554 to work around this ProcessThrottler bug.
2479
2480 2019-03-06  Alex Christensen  <achristensen@webkit.org>
2481
2482         Add gettid to allowed syscalls on Mac
2483         https://bugs.webkit.org/show_bug.cgi?id=195386
2484         <rdar://problem/48651255>
2485
2486         Reviewed by Brent Fulgham.
2487
2488         * WebProcess/com.apple.WebProcess.sb.in:
2489
2490 2019-03-06  Per Arne Vollan  <pvollan@apple.com>
2491
2492         [macOS] Sandbox call violation causes WebContent process to crash
2493         https://bugs.webkit.org/show_bug.cgi?id=195379
2494         <rdar://problem/48647263>
2495
2496         Reviewed by Brent Fulgham.
2497
2498         A new call needs to be added to the allow list in the WebContent process' sandbox.
2499
2500         * WebProcess/com.apple.WebProcess.sb.in:
2501
2502 2019-03-06  Antti Koivisto  <antti@apple.com>
2503
2504         [iOS] Basic hit testing for content overlapping fast-scrollable overflow
2505         https://bugs.webkit.org/show_bug.cgi?id=195360
2506
2507         Reviewed by Simon Fraser.
2508
2509         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2510         (WebKit::RemoteLayerTreeHost::makeNode):
2511
2512         Use new UIView subclass for tiled layer hosting (so we know they have content even when contents property is nil).
2513
2514         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
2515         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
2516         (collectDescendantViewsAtPoint):
2517
2518         Factor collection step into a function.
2519         Do basic skipping of event-transparent layers.
2520
2521         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
2522
2523         To handle overlap cases, find the scroll view that has the deepest non-transparent view hit as its descendant.
2524
2525         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]): Deleted.
2526
2527 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2528
2529         Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
2530         https://bugs.webkit.org/show_bug.cgi?id=195300
2531
2532         Reviewed by Simon Fraser.
2533
2534         Refactor some logic to use isTransparentOrFullyClippedRespectingParentFrames on RenderLayer rather than
2535         RenderObject; introduce a helper method to ask whether the enclosing layer of a renderer is transparent or
2536         clipped.
2537
2538         * WebProcess/WebPage/ios/WebPageIOS.mm:
2539         (WebKit::enclosingLayerIsTransparentOrFullyClipped):
2540         (WebKit::WebPage::platformEditorState const):
2541         (WebKit::WebPage::requestEvasionRectsAboveSelection):
2542         (WebKit::WebPage::getFocusedElementInformation):
2543
2544 2019-03-06  Chris Dumez  <cdumez@apple.com>
2545
2546         REGRESSION (r238490): YouTube.com: Returning PiP to Safari after sleeping device loses page
2547         https://bugs.webkit.org/show_bug.cgi?id=195364
2548         <rdar://problem/48538837>
2549
2550         Reviewed by Geoffrey Garen.
2551
2552         Make sure we unset the LayerTreeFreezeReason::ProcessSuspended layer tree freeze reason
2553         when WebPage::applicationWillEnterForeground() is called. This restores pre-r238490
2554         behavior and addresses the issue with PiP on youtube.com.
2555
2556         * WebProcess/WebPage/ios/WebPageIOS.mm:
2557         (WebKit::WebPage::applicationWillEnterForeground):
2558
2559 2019-03-05  Dean Jackson  <dino@apple.com>
2560
2561         Fix WKPasswordView compilation on iOS
2562         https://bugs.webkit.org/show_bug.cgi?id=195344
2563         <rdar://problem/48620066>
2564
2565         Reviewed by Dan Bates.
2566
2567         Use WebKitAdditions.
2568
2569         * UIProcess/ios/WKPasswordView.mm:
2570         (-[WKPasswordView showInScrollView:]):
2571
2572 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2573
2574         [iOS] Frequent 1 second IPC deadlocks when showing a paste callout
2575         https://bugs.webkit.org/show_bug.cgi?id=195354
2576         <rdar://problem/48624675>
2577
2578         Reviewed by Tim Horton.
2579
2580         When triggering programmatic paste, we frequently hit deadlocks due to sync IPC going from the UI process to the
2581         web process and vice versa. What happens in this scenario is that prior to triggering programmatic paste, the
2582         page may try to move focus to a different element (e.g. a hidden editable area) before calling `execCommand`.
2583         This causes us to send an ElementDidFocus message to the UI process, followed by RequestDOMPasteAccess.
2584
2585         However, upon receiving ElementDidFocus, we reload input views and (in the process) UIKit requests the
2586         autocorrection context, which we implement in WebKit using a sync message to the web process due to
2587         <rdar://problem/16207002> and its blocking bug <rdar://problem/48383001>. This means we'll end up in a state
2588         where both the UI process and web process are blocked on each other waiting for a sync IPC response, and the UI
2589         process is hung for a second until the IPC message times out.
2590
2591         Ideally, we should fix this by addressing <rdar://problem/16207002>. However, this requires potentially large
2592         changes in UIKit (<rdar://problem/48383001>); for the time being, work around this deadlock by refactoring
2593         synchronous autocorrection context requests such that they can be resolved by an out-of-band IPC response
2594         (HandleAutocorrectionContext). Then prior to requesting DOM paste access, preemptively send a
2595         HandleAutocorrectionContext message to the UI process to unblock any pending synchronous autocorrection context
2596         requests.
2597
2598         * UIProcess/PageClient.h:
2599         * UIProcess/WebPageProxy.h:
2600         * UIProcess/WebPageProxy.messages.in:
2601         * UIProcess/ios/PageClientImplIOS.h:
2602         * UIProcess/ios/PageClientImplIOS.mm:
2603         (WebKit::PageClientImpl::handleAutocorrectionContext):
2604         * UIProcess/ios/WKContentViewInteraction.h:
2605
2606         Make it possible for WKContentView to remember its current pending autocorrection context completion handler.
2607         This is invoked and cleared out in `-_invokePendingAutocorrectionContextHandler:`.
2608
2609         * UIProcess/ios/WKContentViewInteraction.mm:
2610         (-[WKContentView _invokePendingAutocorrectionContextHandler:]):
2611         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
2612         (-[WKContentView _handleAutocorrectionContext:]):
2613
2614         Handle an autocorrection context response. This is invoked when the web process either handles an autocorrection
2615         context message, or when it preemptively sends an autocorrection context before requesting DOM paste access.
2616
2617         (+[WKAutocorrectionContext emptyAutocorrectionContext]):
2618
2619         Add a helper to create an empty autocorrection context.
2620
2621         * UIProcess/ios/WebPageProxyIOS.mm:
2622         (WebKit::WebPageProxy::requestAutocorrectionContext):
2623         (WebKit::WebPageProxy::handleAutocorrectionContext):
2624         (WebKit::WebPageProxy::autocorrectionContextSync): Deleted.
2625
2626         Removed this sync version, since we now only have requestAutocorrectionContext.
2627
2628         * WebProcess/WebPage/WebPage.cpp:
2629         (WebKit::WebPage::requestDOMPasteAccess):
2630
2631         Send WebPageProxy::HandleAutocorrectionContext, and add a FIXME referencing <rdar://problem/16207002>.
2632
2633         * WebProcess/WebPage/WebPage.h:
2634         * WebProcess/WebPage/WebPage.messages.in:
2635
2636         Split AutocorrectionContextSync into RequestAutocorrectionContext and HandleAutocorrectionContext; additionally,
2637         remove the existing RequestAutocorrectionContext message.
2638
2639         * WebProcess/WebPage/ios/WebPageIOS.mm:
2640         (WebKit::WebPage::requestAutocorrectionContext):
2641         (WebKit::WebPage::autocorrectionContextSync): Deleted.
2642
2643 2019-03-06  Rob Buis  <rbuis@igalia.com>
2644
2645         Consider supporting the `referrerpolicy` attribute.
2646         https://bugs.webkit.org/show_bug.cgi?id=179053
2647
2648         Reviewed by Darin Adler.
2649
2650         Add a runtime flag for referrerpolicy attribute.
2651
2652         * Shared/WebPreferences.yaml:
2653         * UIProcess/API/C/WKPreferences.cpp:
2654         (WKPreferencesSetReferrerPolicyAttributeEnabled):
2655         (WKPreferencesGetReferrerPolicyAttributeEnabled):
2656         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2657         * WebProcess/Network/WebLoaderStrategy.cpp:
2658         (WebKit::WebLoaderStrategy::loadResource): do not hardcode choosing
2659         the document referrer policy.
2660
2661 2019-03-06  Philippe Normand  <pnormand@igalia.com>
2662
2663         Unreviewed, WPE build fix after r242503
2664
2665         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2666         ServiceWorker messages moved from network process to another
2667         header, so it needs to be included.
2668
2669 2019-03-05  David Quesada  <david_quesada@apple.com>
2670
2671         [WK2] It should be possible to follow links with 'download' attributes
2672         https://bugs.webkit.org/show_bug.cgi?id=195145
2673         rdar://problem/48462642
2674
2675         Reviewed by Alex Christensen.
2676
2677         When a link with a 'download' attribute is clicked and the navigation client
2678         says to allow the navigation (i.e. provides PolicyAction::Use),
2679         WebPageProxy::receivedNavigationPolicyDecision() should stop overriding this
2680         decision and downloading the link instead. Instead, web view should honor the
2681         policy chosen by the navigation delegate. This supports clients that want to
2682         offer the user the ability to view, rather than download, the contents of
2683         such links, which is permitted per the HTML spec.
2684
2685         This change is only made on Cocoa platforms for now since no other ports
2686         expose an API on their navigation action to express whether the page intends
2687         to download the linked resource.
2688
2689         * UIProcess/API/APINavigation.h:
2690         (API::Navigation::shouldPerformDownload const):
2691             Rename this to be in line with APINavigationAction's shouldPerformDownload()
2692             for consistency. 'Force' seems like too strong of a word for this property
2693             considering that 'forcing' the download isn't really an attribute inherent
2694             to the navigation, but a behavior implemented by the web page proxy.
2695         (API::Navigation::shouldForceDownload const): Deleted.
2696         * UIProcess/Cocoa/VersionChecks.h:
2697         * UIProcess/WebPageProxy.cpp:
2698         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2699
2700 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
2701
2702         [Curl] Implement Cookie Accept Policy.
2703         https://bugs.webkit.org/show_bug.cgi?id=191645
2704
2705         Reviewed by Fujii Hironori.
2706
2707         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
2708         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
2709         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
2710         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2711         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
2712         (WebKit::NetworkDataTaskCurl::handleCookieHeaders):
2713         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2714
2715 2019-03-05  Youenn Fablet  <youenn@apple.com>
2716
2717         Introduce ServiceWorkerFetchTask
2718         https://bugs.webkit.org/show_bug.cgi?id=195130
2719
2720         Reviewed by Chris Dumez.
2721
2722         ServiceWorkerFetchTask is added to represent NetworkProcess side of an ongoing fetch intercepted by service worker.
2723         This patch should not change existing behavior.
2724
2725         * CMakeLists.txt:
2726         * DerivedSources-input.xcfilelist:
2727         * DerivedSources-output.xcfilelist:
2728         * DerivedSources.make:
2729         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2730         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
2731         * NetworkProcess/NetworkProcess.cpp:
2732         (WebKit::NetworkProcess::didFailFetch): Deleted.
2733         (WebKit::NetworkProcess::didNotHandleFetch): Deleted.
2734         (WebKit::NetworkProcess::didReceiveFetchRedirectResponse): Deleted.
2735         (WebKit::NetworkProcess::didReceiveFetchResponse): Deleted.
2736         (WebKit::NetworkProcess::didReceiveFetchData): Deleted.
2737         (WebKit::NetworkProcess::didReceiveFetchFormData): Deleted.
2738         (WebKit::NetworkProcess::didFinishFetch): Deleted.
2739         * NetworkProcess/NetworkProcess.h:
2740         * NetworkProcess/NetworkProcess.messages.in:
2741         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
2742         (WebKit::WebSWServerConnection::cancelFetch):
2743         (WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
2744         (WebKit::WebSWServerConnection::startFetch):
2745         (WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse): Deleted.
2746         (WebKit::WebSWServerConnection::didReceiveFetchResponse): Deleted.
2747         (WebKit::WebSWServerConnection::didReceiveFetchData): Deleted.
2748         (WebKit::WebSWServerConnection::didReceiveFetchFormData): Deleted.
2749         (WebKit::WebSWServerConnection::didFinishFetch): Deleted.
2750         (WebKit::WebSWServerConnection::didFailFetch): Deleted.
2751         (WebKit::WebSWServerConnection::didNotHandleFetch): Deleted.
2752         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
2753         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2754         (WebKit::WebSWServerToContextConnection::connectionClosed):
2755         (WebKit::WebSWServerToContextConnection::startFetch):
2756         (WebKit::WebSWServerToContextConnection::cancelFetch):
2757         (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
2758         (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
2759         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
2760         * SourcesCocoa.txt:
2761         * WebKit.xcodeproj/project.pbxproj:
2762         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2763         (WebKit::WebSWContextManagerConnection::startFetch):
2764         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2765         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
2766         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
2767         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
2768         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
2769         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
2770         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
2771         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
2772         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
2773         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: Added.
2774         (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
2775         (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
2776         (WebKit::ServiceWorkerFetchTask::didReceiveData):
2777         (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
2778         (WebKit::ServiceWorkerFetchTask::didFinish):
2779         (WebKit::ServiceWorkerFetchTask::didFail):
2780         (WebKit::ServiceWorkerFetchTask::didNotHandle):
2781         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: Added.
2782         (WebKit::ServiceWorkerFetchTask::create):
2783         (WebKit::ServiceWorkerFetchTask::Identifier::hash const):
2784         (WebKit::ServiceWorkerFetchTask::identifier const):
2785         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
2786         (WebKit::operator==):
2787         (WTF::ServiceWorkerFetchTaskIdentifierHash::hash):
2788         (WTF::ServiceWorkerFetchTaskIdentifierHash::equal):
2789         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::emptyValue):
2790         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::constructDeletedValue):
2791         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::isDeletedValue):
2792         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: Added.
2793
2794 2019-03-05  Youenn Fablet  <youenn@apple.com>
2795
2796         Rename requestCacheStorageSpace to requestStorageSpace
2797         https://bugs.webkit.org/show_bug.cgi?id=195282
2798
2799         Reviewed by Chris Dumez.
2800
2801         Make the name more abstract as it might be used in the future for other storage
2802         like IDB or service worker registrations.
2803
2804         * NetworkProcess/NetworkProcess.cpp:
2805         (WebKit::NetworkProcess::requestStorageSpace):
2806         (WebKit::NetworkProcess::requestCacheStorageSpace): Deleted.
2807         * NetworkProcess/NetworkProcess.h:
2808         * NetworkProcess/cache/CacheStorageEngine.cpp:
2809         (WebKit::CacheStorage::Engine::requestSpace):
2810         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2811         (WebsiteDataStoreClient::WebsiteDataStoreClient):
2812         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
2813         * UIProcess/Network/NetworkProcessProxy.cpp:
2814         (WebKit::NetworkProcessProxy::requestStorageSpace):
2815         (WebKit::NetworkProcessProxy::requestCacheStorageSpace): Deleted.
2816         * UIProcess/Network/NetworkProcessProxy.h:
2817         * UIProcess/Network/NetworkProcessProxy.messages.in:
2818         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
2819         (WebKit::WebsiteDataStoreClient::requestStorageSpace):
2820         (WebKit::WebsiteDataStoreClient::requestCacheStorageSpace): Deleted.
2821
2822 2019-03-05  Chris Dumez  <cdumez@apple.com>
2823
2824         Drop cached WebProcesses for a given session when this session is destroyed
2825         https://bugs.webkit.org/show_bug.cgi?id=195212
2826         <rdar://problem/48301483>
2827
2828         Reviewed by Geoffrey Garen.
2829
2830         Drop cached WebProcesses for a give session when this session is destroyed. This way, when you close
2831         your private browsing window, all the processes it used get cleared and it cannot leave any state
2832         behind.
2833
2834         * UIProcess/WebProcessCache.cpp:
2835         (WebKit::WebProcessCache::canCacheProcess const):
2836         (WebKit::WebProcessCache::addProcessIfPossible):
2837         (WebKit::WebProcessCache::addProcess):
2838         (WebKit::WebProcessCache::clearAllProcessesForSession):
2839         * UIProcess/WebProcessCache.h:
2840         (WebKit::WebProcessCache::capacity const):
2841         * UIProcess/WebProcessPool.cpp:
2842         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
2843         (WebKit::WebProcessPool::hasPagesUsingWebsiteDataStore const):
2844         * UIProcess/WebProcessPool.h:
2845
2846 2019-03-05  Brady Eidson  <beidson@apple.com>
2847
2848         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
2849         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
2850
2851         Reviewed by Tim Horton.
2852
2853         * WebProcess/WebPage/WebPage.cpp:
2854         (WebKit::WebPage::SandboxExtensionTracker::shouldReuseCommittedSandboxExtension): If there is a pendingProvisionalSandboxExtension
2855           then its existence should override our willingness to reuse the existing committed extension.
2856         (WebKit::shouldReuseCommittedSandboxExtension): Deleted.
2857         * WebProcess/WebPage/WebPage.h:
2858
2859 2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
2860
2861         Unreviewed, rolling out r242403.
2862
2863         Caused layout test crashes on iOS simulator.
2864
2865         Reverted changeset:
2866
2867         "[ContentChangeObserver] Introduce fixed duration content
2868         observation"
2869         https://bugs.webkit.org/show_bug.cgi?id=195295
2870         https://trac.webkit.org/changeset/242403
2871
2872 2019-03-05  Loïc Yhuel  <loic.yhuel@softathome.com>
2873
2874         [WPE] Do not create a PlatformDisplay in the Service Worker process
2875         https://bugs.webkit.org/show_bug.cgi?id=194830
2876
2877         Reviewed by Žan Doberšek.
2878
2879         It avoids opening the Wayland socket in this WPEWebProcess, which might cause issues
2880         depending on the platform, and allocates unneeded resources.
2881
2882         * Shared/WebProcessCreationParameters.cpp:
2883         (WebKit::WebProcessCreationParameters::encode const):
2884         (WebKit::WebProcessCreationParameters::decode):
2885         * Shared/WebProcessCreationParameters.h: Add new isServiceWorkerProcess parameter.
2886         * UIProcess/WebProcessPool.cpp:
2887         (WebKit::WebProcessPool::initializeNewWebProcess): Set isServiceWorkerProcess parameter.
2888         * UIProcess/glib/WebProcessPoolGLib.cpp:
2889         (WebKit::WebProcessPool::platformInitializeWebProcess): No implementationLibraryName and hostClientFileDescriptor for Service Worker.
2890         * WebProcess/glib/WebProcessGLib.cpp:
2891         (WebKit::WebProcess::platformInitializeWebProcess): No wpe_loader_init nor PlatformDisplayLibWPE for Service Worker.
2892
2893 2019-03-04  Brady Eidson  <beidson@apple.com>
2894
2895         Unreviewed, rolling out r242376.
2896
2897         Broke some tests
2898
2899         Reverted changeset:
2900
2901         "Correctly handle sandbox extensions when the same WKWebView
2902         loads multiple file:// URLs."
2903         https://bugs.webkit.org/show_bug.cgi?id=195291
2904         https://trac.webkit.org/changeset/242376
2905
2906 2019-03-04  Fujii Hironori  <Hironori.Fujii@sony.com>
2907
2908         Use a SQLite database to hold the ResourceLoadStatistics data
2909         https://bugs.webkit.org/show_bug.cgi?id=194867
2910         <rdar://problem/24240854>
2911
2912         Unreviewed build fix for WinCairo.
2913
2914         ResourceLoadStatisticsDebug and RELEASE_LOG_INFO_IF are not
2915         defined because WinCairo port defines RELEASE_LOG_DISABLED.
2916
2917         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2918         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): Enclosed RELEASE_LOG_INFO_IF with #if !RELEASE_LOG_DISABLED.
2919         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Ditto.
2920         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): Ditto.
2921
2922 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
2923
2924         Use a SQLite database to hold the ResourceLoadStatistics data
2925         https://bugs.webkit.org/show_bug.cgi?id=194867
2926         <rdar://problem/24240854>
2927
2928         Reviewed by Chris Dumez.
2929
2930         The ResourceLoadStatistics database plist is inefficient. It requires more memory use
2931         than it needs, and forces lots of looping and string comparisons to find information.
2932
2933         This problem has already been solved in the form of relational databases. We use them
2934         elsewhere in WebKit, and should do so for this storage as well.
2935
2936         This patch creates an optional SQLite database to handle ITP operations.
2937
2938         1. It adds a new internal experimental feature flag to activate it. It requires the user
2939            exit and restart the process to take effect.
2940         2. It populates itself from the existing plist file (if it exists).
2941         3. It stops using the plist in favor of the database.
2942         4. It does queries and other operations using the database instead of the old hash table
2943            implementation.
2944
2945         This patch refactors the exisiting ResourceLoadStatisticsMemoryStore class into a base
2946         ResourceLoadStatisticsStore class, which ResourceLoadStatisticsMemoryStore is based on.
2947         It adds a new ResourceLoadStatisticsDatabaseStore that is implemented in terms of SQL
2948         operations.
2949
2950         These code changes should not have any impact on existing operations, and when enabled
2951         should produce the same test results.
2952
2953         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: Added.
2954         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
2955         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
2956         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
2957         (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
2958         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
2959         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationship):
2960         (WebKit::ResourceLoadStatisticsDatabaseStore::confirmDomainDoesNotExist const):
2961         (WebKit::ResourceLoadStatisticsDatabaseStore::domainIDFromString const):
2962         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
2963         (WebKit::ResourceLoadStatisticsDatabaseStore::databaseIsEmpty const):
2964         (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
2965         (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
2966         (WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains):
2967         (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
2968         (WebKit::buildList):
2969         (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent):
2970         (WebKit::listToString):
2971         (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
2972         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
2973         (WebKit::ResourceLoadStatisticsDatabaseStore::classifyPrevalentResources):
2974         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageIfNeeded):
2975         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageImmediately):
2976         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
2977         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
2978         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
2979         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
2980         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
2981         (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
2982         (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
2983         (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
2984         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceLoading):
2985         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
2986         (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
2987         (WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
2988         (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
2989         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
2990         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
2991         (WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent):
2992         (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const):
2993         (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
2994         (WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
2995         (WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
2996         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubresourceUnder const):
2997         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubFrameUnder const):
2998         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsRedirectingTo const):
2999         (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
3000         (WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
3001         (WebKit::ResourceLoadStatisticsDatabaseStore::isGrandfathered const):
3002         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameOrigin):
3003         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameOrigin):
3004         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
3005         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
3006         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
3007         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
3008         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForPrimaryDomain):
3009         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):
3010         (WebKit::ResourceLoadStatisticsDatabaseStore::cookieTreatmentForOrigin const):
3011         (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
3012         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const):
3013         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
3014         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlockingForDomains):
3015         (WebKit::ResourceLoadStatisticsDatabaseStore::clearBlockingStateForDomains):
3016         (WebKit::ResourceLoadStatisticsDatabaseStore::processStatistics const):
3017         (WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains const):
3018         (WebKit::ResourceLoadStatisticsDatabaseStore::findExpiredUserInteractions const):
3019         (WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredUserInteractions):
3020         (WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering):
3021         (WebKit::ResourceLoadStatisticsDatabaseStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
3022         (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
3023         (WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen):
3024         (WebKit::ResourceLoadStatisticsDatabaseStore::setLastSeen):
3025         (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
3026         (WebKit::ResourceLoadStatisticsDatabaseStore::removeAllStorageAccess):
3027         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: Added.
3028         (WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const):
3029         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3030         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
3031         (WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
3032         (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
3033         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
3034         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
3035         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
3036         (WebKit::domainsToString): Deleted.
3037         (WebKit::OperatingDate::fromWallTime): Deleted.
3038         (WebKit::OperatingDate::today): Deleted.
3039         (WebKit::OperatingDate::secondsSinceEpoch const): Deleted.
3040         (WebKit::OperatingDate::operator== const): Deleted.
3041         (WebKit::OperatingDate::operator< const): Deleted.
3042         (WebKit::OperatingDate::operator<= const): Deleted.
3043         (WebKit::OperatingDate::OperatingDate): Deleted.
3044         (WebKit::mergeOperatingDates): Deleted.
3045         (WebKit::computeImportance): Deleted.
3046         (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore): Deleted.
3047         (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned): Deleted.
3048         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval): Deleted.
3049         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry): Deleted.
3050         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords): Deleted.
3051         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords): Deleted.
3052         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData): Deleted.
3053         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode): Deleted.
3054         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode): Deleted.
3055         (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary): Deleted.
3056         (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest): Deleted.
3057         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction): Deleted.
3058         (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval): Deleted.
3059         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime): Deleted.
3060         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap): Deleted.
3061         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap): Deleted.
3062         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies): Deleted.
3063         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap): Deleted.
3064         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const): Deleted.
3065         (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved): Deleted.
3066         (WebKit::debugLogDomainsInBatches): Deleted.
3067         (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary): Deleted.
3068         (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const): Deleted.
3069         (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries): Deleted.
3070         (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo): Deleted.
3071         (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues): Deleted.
3072         (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent): Deleted.
3073         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess): Deleted.
3074         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
3075         (WebKit::ResourceLoadStatisticsMemoryStore::data const):
3076         (WebKit::ResourceLoadStatisticsMemoryStore::isDebugModeEnabled const): Deleted.
3077         (WebKit::ResourceLoadStatisticsMemoryStore::store const): Deleted.
3078         (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled): Deleted.
3079         (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled): Deleted.
3080         (): Deleted.
3081         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Added.
3082         (WebKit::domainsToString):
3083         (WebKit::OperatingDate::fromWallTime):
3084         (WebKit::OperatingDate::today):
3085         (WebKit::OperatingDate::secondsSinceEpoch const):
3086         (WebKit::OperatingDate::operator== const):
3087         (WebKit::OperatingDate::operator< const):
3088         (WebKit::OperatingDate::operator<= const):
3089         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
3090         (WebKit::ResourceLoadStatisticsStore::~ResourceLoadStatisticsStore):
3091         (WebKit::ResourceLoadStatisticsStore::calculateAndSubmitTelemetry const):
3092         (WebKit::ResourceLoadStatisticsStore::computeImportance):
3093         (WebKit::ResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
3094         (WebKit::ResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3095         (WebKit::ResourceLoadStatisticsStore::setShouldSubmitTelemetry):
3096         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
3097         (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3098         (WebKit::ResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
3099         (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
3100         (WebKit::ResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
3101         (WebKit::ResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
3102         (WebKit::ResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
3103         (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
3104         (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
3105         (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
3106         (WebKit::ResourceLoadStatisticsStore::setCacheMaxAgeCap):
3107         (WebKit::ResourceLoadStatisticsStore::updateCacheMaxAgeCap):
3108         (WebKit::ResourceLoadStatisticsStore::setAgeCapForClientSideCookies):
3109         (WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
3110         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
3111         (WebKit::ResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
3112         (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
3113         (WebKit::ResourceLoadStatisticsStore::clearBlockingStateForDomains):
3114         (WebKit::ResourceLoadStatisticsStore::processStatistics const):
3115         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
3116         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
3117         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
3118         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
3119         (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
3120         (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
3121         (WebKit::ResourceLoadStatisticsStore::resetParametersToDefaultValues):
3122         (WebKit::ResourceLoadStatisticsStore::logTestingEvent):
3123         (WebKit::ResourceLoadStatisticsStore::removeAllStorageAccess):
3124         (WebKit::ResourceLoadStatisticsStore::didCreateNetworkProcess):
3125         (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
3126         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: Copied from Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h.
3127         (WebKit::OperatingDate::OperatingDate):
3128         (WebKit::ResourceLoadStatisticsStore::isEmpty const):
3129         (WebKit::ResourceLoadStatisticsStore::data const):
3130         (WebKit::ResourceLoadStatisticsStore::isDebugModeEnabled const):
3131         (WebKit::ResourceLoadStatisticsStore::store const):
3132         (WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled):
3133         (WebKit::ResourceLoadStatisticsStore::setDebugLogggingEnabled):
3134         * NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm.
3135         (WebKit::ResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3136         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3137         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
3138         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3139         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
3140         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3141         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
3142         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
3143         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
3144         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
3145         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
3146         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
3147         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
3148         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
3149         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
3150         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
3151         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
3152         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
3153         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
3154         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3155         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3156         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3157         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
3158         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3159         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
3160         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
3161         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
3162         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
3163         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
3164         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
3165         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3166         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
3167         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
3168         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3169         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3170         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3171         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
3172         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
3173         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
3174         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
3175         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
3176         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
3177         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3178         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
3179         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
3180         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
3181         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
3182         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
3183         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
3184         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3185         * NetworkProcess/NetworkProcess.cpp:
3186         (WebKit::NetworkProcess::initializeNetworkProcess):
3187         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3188         (WebKit::NetworkProcessCreationParameters::encode const):
3189         (WebKit::NetworkProcessCreationParameters::decode):
3190         * NetworkProcess/NetworkProcessCreationParameters.h:
3191         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3192         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
3193         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
3194         * Shared/WebPreferences.yaml:
3195         * Sources.txt:
3196         * SourcesCocoa.txt:
3197         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3198         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3199         * UIProcess/WebProcessPool.cpp:
3200         * WebKit.xcodeproj/project.pbxproj:
3201
3202 2019-03-04  Zalan Bujtas  <zalan@apple.com>
3203
3204         [ContentChangeObserver] Introduce fixed duration content observation
3205         https://bugs.webkit.org/show_bug.cgi?id=195295
3206         <rdar://problem/48579913>
3207
3208         Reviewed by Simon Fraser.
3209
3210         * WebProcess/WebPage/ios/WebPageIOS.mm:
3211         (WebKit::WebPage::handleSyntheticClick):
3212
3213 2019-03-04  Truitt Savell  <tsavell@apple.com>
3214
3215         Unreviewed, rolling out r242396.
3216
3217         Found issue to be unrelated. reverting my rollout.
3218
3219         Reverted changeset:
3220
3221         "Unreviewed, rolling out r242222."
3222         https://bugs.webkit.org/show_bug.cgi?id=193683
3223         https://trac.webkit.org/changeset/242396
3224
3225 2019-03-04  Jiewen Tan  <jiewen_tan@apple.com>
3226
3227         Unreviewed, a followup after r242336
3228
3229         * UIProcess/WebPageProxy.cpp:
3230         (WebKit::WebPageProxy::webViewDidMoveToWindow):
3231         Copy the list of observers before iterating it to avoid observers modifying the list.
3232
3233 2019-03-04  Truitt Savell  <tsavell@apple.com>
3234
3235         Unreviewed, rolling out r242222.
3236
3237         Broke internal debug testing
3238
3239         Reverted changeset:
3240
3241         "[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to
3242         the UI process."
3243         https://bugs.webkit.org/show_bug.cgi?id=193683
3244         https://trac.webkit.org/changeset/242222
3245
3246 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
3247
3248         Unreviewed build fix after r242378
3249
3250         * UIProcess/ios/EditableImageController.mm:
3251         (WebKit::EditableImageController::associateWithAttachment):
3252
3253 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
3254
3255         Check contextIDs when handling WebContent messages
3256         https://bugs.webkit.org/show_bug.cgi?id=195289
3257         <rdar://problem/48475870>
3258
3259         Reviewed by Alex Christensen.
3260
3261         The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
3262         We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
3263
3264         This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
3265
3266         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3267         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
3268         (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
3269         (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
3270         (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
3271         (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
3272         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
3273         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
3274         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
3275         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
3276         (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
3277         (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
3278         (WebKit::PlaybackSessionManagerProxy::mutedChanged):
3279         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
3280         (WebKit::PlaybackSessionManagerProxy::durationChanged):
3281         (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
3282         (WebKit::PlaybackSessionManagerProxy::rateChanged):
3283         (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
3284         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
3285         (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
3286         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3287         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
3288         (WebKit::UserMediaCaptureManagerProxy::startProducingData):
3289         (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
3290         (WebKit::UserMediaCaptureManagerProxy::end):
3291         (WebKit::UserMediaCaptureManagerProxy::capabilities):
3292         (WebKit::UserMediaCaptureManagerProxy::setMuted):
3293         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
3294         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3295         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
3296         (WebKit::VideoFullscreenManagerProxy::setHasVideo):
3297         (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
3298         (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
3299         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
3300         (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
3301         (WebKit::VideoFullscreenManagerProxy::setInlineRect):
3302         (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
3303         (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
3304         (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
3305         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
3306         * UIProcess/ios/EditableImageController.mm:
3307         (WebKit::EditableImageController::didCreateEditableImage):
3308         (WebKit::EditableImageController::didDestroyEditableImage):
3309         (WebKit::EditableImageController::associateWithAttachment):
3310
3311 2019-03-04  Alex Christensen  <achristensen@webkit.org>
3312
3313         Fix crashes when NetworkResourceLoader/NetworkLoadChecker are destroyed during HTTPS upgrade check
3314         https://bugs.webkit.org/show_bug.cgi?id=195238
3315         <rdar://problem/47598656>
3316
3317         Reviewed by Chris Dumez.
3318
3319         * NetworkProcess/NetworkLoadChecker.cpp:
3320         (WebKit::NetworkLoadChecker::checkRequest):
3321
3322 2019-03-04  Brady Eidson  <beidson@apple.com>
3323
3324         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
3325         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
3326
3327         Reviewed by Andy Estes.
3328
3329         * WebProcess/WebPage/WebPage.cpp:
3330         (WebKit::shouldReuseCommittedSandboxExtension): Only retain the previous sandbox extension if the file URL
3331           we're currently loading is functionally equivalent to the previous one.
3332
3333 2019-03-04  Chris Dumez  <cdumez@apple.com>
3334
3335         Drop legacy userAgentForURL injected bundle SPI
3336         https://bugs.webkit.org/show_bug.cgi?id=195222
3337         <rdar://problem/46734147>
3338
3339         Reviewed by Darin Adler.
3340
3341         Drop legacy userAgentForURL injected bundle SPI. There are no longer any clients, and using
3342         WebsitePolicies.customUserAgent is the way to go nowadays.
3343
3344         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
3345         (API::InjectedBundle::PageLoaderClient::willDestroyFrame):
3346         (API::InjectedBundle::PageLoaderClient::userAgentForURL const): Deleted.
3347         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
3348         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
3349         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3350         (setUpPageLoaderClient):
3351         (userAgentForURL): Deleted.
3352         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
3353         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL const): Deleted.
3354         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
3355         * WebProcess/WebPage/WebPage.cpp:
3356         (WebKit::WebPage::userAgent const):
3357
3358 2019-03-04  Chris Dumez  <cdumez@apple.com>
3359
3360         Do not share WebProcesses between private and regular sessions
3361         https://bugs.webkit.org/show_bug.cgi?id=195189
3362         <rdar://problem/48421064>
3363
3364         Reviewed by Alex Christensen.