62eb994d050002f5f5f672d7f5a3a69f01a3c91d
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-01-19  David Kilzer  <ddkilzer@apple.com>
2
3         Sort WebKit Xcode project file
4
5         * WebKit.xcodeproj/project.pbxproj:
6
7 2019-01-19  Antoine Quint  <graouts@apple.com>
8
9         Add a POINTER_EVENTS feature flag
10         https://bugs.webkit.org/show_bug.cgi?id=193577
11
12         Reviewed by Dean Jackson.
13
14         * Configurations/FeatureDefines.xcconfig:
15
16 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
17
18         iOS: Updating input mode should update the software keyboard
19         https://bugs.webkit.org/show_bug.cgi?id=193565
20         <rdar://problem/47376334>
21
22         Reviewed by Wenson Hsieh.
23
24         Update the software keyboard when the inputmode content attribute on the focused element had been mutated.
25
26         * Scripts/webkit/messages.py:
27         * Shared/WebCoreArgumentCoders.h:
28         * UIProcess/PageClient.h:
29         * UIProcess/WebPageProxy.h:
30         * UIProcess/WebPageProxy.messages.in:
31         * UIProcess/ios/PageClientImplIOS.h:
32         * UIProcess/ios/PageClientImplIOS.mm:
33         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
34         * UIProcess/ios/WKContentViewInteraction.h:
35         * UIProcess/ios/WKContentViewInteraction.mm:
36         (-[WKContentView _didUpdateInputMode:]):
37         * UIProcess/ios/WebPageProxyIOS.mm:
38         (WebKit::WebPageProxy::focusedElementDidChangeInputMode):
39         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
40         (WebKit::WebChromeClient::focusedElementDidChangeInputMode):
41         * WebProcess/WebCoreSupport/WebChromeClient.h:
42         * WebProcess/WebPage/WebPage.cpp:
43         (WebKit::WebPage::focusedElementDidChangeInputMode):
44         * WebProcess/WebPage/WebPage.h:
45
46 2019-01-18  Tim Horton  <timothy_horton@apple.com>
47
48         Adjust WKDrawingView protocol method name
49         https://bugs.webkit.org/show_bug.cgi?id=193604
50
51         Reviewed by Wenson Hsieh.
52
53         * UIProcess/ios/WKDrawingView.mm:
54         (-[WKDrawingView canvasViewDrawingDidChange:]):
55         (-[WKDrawingView drawingDidChange:]): Deleted.
56
57 2019-01-18  David Kilzer  <ddkilzer@apple.com>
58
59         [WebKit] Change Xcode folders to map to folders on disk
60
61         * WebKit.xcodeproj/project.pbxproj: Update these folders:
62         - Shared/Authentication
63         - Shared/Authentication/cocoa
64
65 2019-01-18  Brian Burg  <bburg@apple.com>
66
67         Automation.computeElementLayout should return visual viewport-aware coordinates
68         https://bugs.webkit.org/show_bug.cgi?id=193598
69         <rdar://problem/35325644>
70
71         Reviewed by Simon Fraser.
72
73         Previously I added CoordinateSystem::VisualViewport to stub out this for iOS.
74         But I think that it's a mistake for safaridriver to care about VisualViewport
75         being enabled or not, because it is a runtime-switchable setting.
76
77         This patch removes CoordinateSystem::VisualViewport. Make the existing
78         CoordinateSystem::LayoutViewport use visual viewport semantics if needed.
79
80         This is tested by WebDriver element clicking tests. There should not be any
81         difference in behavior until it is possible to zoom with gestures via WebDriver.
82
83         * Shared/CoordinateSystem.h:
84         * UIProcess/Automation/Automation.json:
85         * UIProcess/Automation/WebAutomationSession.cpp:
86         (WebKit::protocolStringToCoordinateSystem):
87         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
88         (WebKit::WebAutomationSessionProxy::computeElementLayout):
89
90 2019-01-18  Daniel Bates  <dabates@apple.com>
91
92         Fix some build issues.
93
94         Include missing header WKDrawingCoordinator.
95
96         * UIProcess/ios/WKInkPickerView.mm:
97
98 2019-01-18  Tim Horton  <timothy_horton@apple.com>
99
100         Get rid of ADVANCED_SPELL_CHECKING
101         https://bugs.webkit.org/show_bug.cgi?id=193592
102
103         Reviewed by Wenson Hsieh.
104
105         * UIProcess/Cocoa/WebViewImpl.mm:
106         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
107         (WebKit::WebViewImpl::insertText):
108         * UIProcess/mac/TextCheckerMac.mm:
109         (WebKit::TextChecker::checkTextOfParagraph):
110         (WebKit::TextChecker::getGuessesForWord):
111
112 2019-01-18  Chris Dumez  <cdumez@apple.com>
113
114         Regression(PSON) Content blockers are sometimes lost on back navigation cross-site
115         https://bugs.webkit.org/show_bug.cgi?id=193588
116         <rdar://problem/47131566>
117
118         Reviewed by Alex Christensen.
119
120         When the WebPageProxy needs to create initialization parameters for its WebPage in the
121         WebContent process, it calls WebProcessProxy::addWebUserContentControllerProxy()
122         which calls WebUserContentControllerProxy::addProcess(). This last call is supposed to
123         register the WebProcessProxy with the WebUserContentControllerProxy and adding the
124         contentRuleLists to the WebPageCreationParameters. The issue is that if the
125         WebUserContentControllerProxy already knows about this WebProcessProxy, it would return
126         early and not populate the WebPageCreationParameters.
127
128         In PSON world, when navigating back to a page that failed to enter page cache, we reuse
129         the process where we previously loaded the page but re-create a new WebPage on the
130         WebContent process site. When this happens, WebUserContentControllerProxy would not
131         add the contentRuleLists to the WebPageCreationParameters and the new WebPage in the
132         previously-suspended process would be missing them.
133
134         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
135         (WebKit::WebUserContentControllerProxy::addProcess):
136
137 2019-01-18  Jer Noble  <jer.noble@apple.com>
138
139         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
140         https://bugs.webkit.org/show_bug.cgi?id=189553
141
142         Reviewed by Tim Horton.
143
144         * Configurations/Base.xcconfig:
145         * Configurations/BaseTarget.xcconfig:
146         * Configurations/SDKVariant.xcconfig: Added.
147
148 2019-01-18  Antti Koivisto  <antti@apple.com>
149
150         Implement asynchronous frame scrolling for iOS
151         https://bugs.webkit.org/show_bug.cgi?id=193539
152         <rdar://problem/47379873>
153
154         Reviewed by Simon Fraser.
155
156         Add a scrolling node type that can handle UIScrollView backed frames.
157         It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.
158
159         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
160         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
161         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
162         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
163         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
164         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
165         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
166         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
167         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
168         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
169         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
170         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
171         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
172         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
173         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
174         * WebKit.xcodeproj/project.pbxproj:
175
176 2019-01-18  Chris Dumez  <cdumez@apple.com>
177
178         Regression(PSON) Scroll position is not always restored properly when navigating back
179         https://bugs.webkit.org/show_bug.cgi?id=193578
180         <rdar://problem/47386331>
181
182         Reviewed by Tim Horton.
183
184         Fix issues causing the scroll position to not be restored at all (or incorrectly) when
185         navigating back cross-site with PSON enabled. Also make sure that the swipe gesture
186         snapshot really stays up until we've restored the scroll position.
187
188         Note that even after those changes, I can still sometimes reproduce a white flash when
189         swiping back to Google search results (scroll position being correct now). This is
190         tracked by <rdar://problem/47071684> and happens even if I disable PSON entirely.
191
192         * Shared/SessionState.cpp:
193         (WebKit::FrameState::encode const):
194         (WebKit::FrameState::decode):
195         * Shared/SessionState.h:
196         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
197         (WebKit::toFrameState):
198         (WebKit::applyFrameState):
199         obscuredInsets is present on the HistoryItem in the WebProcess but was never passed to
200         or stored by the UIProcess on the WebBackForwardListItem. obscuredInsets is needed to
201         properly restore the scrollPosition (position was 70px off on my iPad without this).
202         With PSON enabled, if you swipe back cross-process and the previous page was not put
203         into PageCache, then the HistoryItem is gone on the WebProcess side. What happens is
204         that the UIProcess sends its WebBackForwardListItem to the WebProcess, which restores
205         the HistoryItem there, and then asks it to load it. The obscuredInsets was getting lost
206         in the process since the UIProcess never knew about it.
207
208         * UIProcess/Cocoa/ViewGestureController.cpp:
209         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
210         Drop logic that was causing the ViewGestureController to not wait for the scroll position
211         to be restored before taking down the snapshot, when UI-side compositing is enabled.
212         If you look at the comment above the code, you'll see that the code in question was meant
213         to impact only the non-UI side compositing code path. As a matter of fact, when the code
214         was reviewed at https://bugs.webkit.org/show_bug.cgi?id=151224, it was protected by a
215         #if PLATFORM(MAC), before getting modified the wrong way before landing. In practice, we
216         would have often restored the scroll position by the time the load is finished so it would
217         not cause a flash in most cases. However, with PSON enabled and the layer tree freezing we
218         do on process-swap, the first post-scroll restoration layer tree commit may now occur a
219         little bit later and we would lose the race more often.
220
221         * UIProcess/WebProcessProxy.cpp:
222         (WebKit::WebProcessProxy::updateBackForwardItem):
223         * UIProcess/WebProcessProxy.h:
224         When adding PageCache support to PSON, we used to navigate the "suspended" page to
225         about:blank. This would lead to unwanted WebProcessProxy::updateBackForwardItem()
226         calls from the WebProcess which we wanted to ignore. We thus added logic to ignore
227         updateBackForwardItem() IPC from the old WebProcess after a swap. The issue with this
228         is that we sometimes miss/ignore legit updates to the HistoryItem from the old process,
229         in particular with regards to the scroll position and the pageScaleFactor. So if you
230         swiped and then quickly enough did a cross-site navigation, the UIProcess'
231         WebBackForwardList would not get updated with the latest scroll position and we would
232         thus fail to restore it later on. To address the issue, we now stop ignoring updates
233         from the old WebProcess after a swap. This logic is no longer needed since we no longer
234         navigate the old page to about:blank after a swap, we merely suspend it "in place".
235
236 2019-01-18  Wenson Hsieh  <wenson_hsieh@apple.com>
237
238         Remove some last vestiges of assisted node terminology in WebKit
239         https://bugs.webkit.org/show_bug.cgi?id=193572
240
241         Reviewed by Tim Horton.
242
243         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
244         * UIProcess/ios/WKContentViewInteraction.mm:
245         (-[WKContentView gestureRecognizerShouldBegin:]):
246         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
247         (-[WKContentView _showKeyboard]):
248         (-[WKContentView _hideKeyboard]):
249
250         Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.
251
252         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
253         (-[WKContentView _elementDidBlur]):
254         (-[WKContentView updateCurrentFocusedElementInformation:]):
255         (-[WKContentView _startAssistingKeyboard]): Deleted.
256         (-[WKContentView _stopAssistingKeyboard]): Deleted.
257         * WebProcess/WebPage/ios/WebPageIOS.mm:
258         (WebKit::WebPage::getFocusedElementInformation):
259
260 2019-01-18  Youenn Fablet  <youenn@apple.com>
261
262         Add a new SPI to request for cache storage quota increase
263         https://bugs.webkit.org/show_bug.cgi?id=193323
264
265         Reviewed by Alex Christensen.
266
267         Add a delegate on the WebSiteDataStore for WebKit to ask for quota update.
268         The current SPI is currently CacheStorage specific but future work should
269         make it so that other storage like IDB use the same mechanism.
270         By default, quota remains unchanged if delegate is not implemented.
271
272         * NetworkProcess/NetworkProcess.cpp:
273         * UIProcess/API/Cocoa/WKStorageQuotaDelegatePrivate.h: Added.
274         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
275         (WebsiteDataStoreQuotaManager::WebsiteDataStoreQuotaManager):
276         (-[WKWebsiteDataStore _quotaDelegate]):
277         (-[WKWebsiteDataStore set_quotaDelegate:]):
278         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
279         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
280         * UIProcess/Network/NetworkProcessProxy.cpp:
281         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
282         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
283         (WebKit::WebsiteDataStore::WebsiteDataStore):
284         * UIProcess/WebsiteData/WebsiteDataStore.h:
285         (WebKit::WebsiteDataStore::quotaManager):
286         (WebKit::WebsiteDataStore::setQuotaManager):
287         * UIProcess/WebsiteData/WebsiteDataStoreQuotaManager.h: Added.
288         (WebKit::WebsiteDataStoreQuotaManager::~WebsiteDataStoreQuotaManager):
289         (WebKit::WebsiteDataStoreQuotaManager::requestCacheStorageSpace):
290         * WebKit.xcodeproj/project.pbxproj:
291
292 2019-01-18  Philippe Normand  <pnormand@igalia.com>
293
294         [WPE] Add Qt extension
295         https://bugs.webkit.org/show_bug.cgi?id=191464
296
297         Reviewed by Carlos Garcia Campos.
298
299         This new extension is a QML plugin embedding a WPE ViewBackend
300         implementation. It provides a public API very similar to Qt's
301         WebView module. It comes with a simple mini-browser implemented in
302         QML.
303
304         QtWPE is known to work with the Wayland-EGL (in GNOME and Weston
305         compositors) and EGLFS QPAs.
306
307         * PlatformWPE.cmake:
308         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: Added.
309         (WPEQmlExtensionPlugin::registerTypes):
310         * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h: Added.
311         * UIProcess/API/wpe/qt/WPEQtView.cpp: Added.
312         (WPEQtView::WPEQtView):
313         (WPEQtView::~WPEQtView):
314         (WPEQtView::geometryChanged):
315         (WPEQtView::configureWindow):
316         (WPEQtView::createOffscreen):
317         (WPEQtView::backendCreated):
318         (WPEQtView::notifyUrlChangedCallback):
319         (WPEQtView::notifyTitleChangedCallback):
320         (WPEQtView::notifyLoadProgressCallback):
321         (WPEQtView::notifyLoadChangedCallback):
322         (WPEQtView::notifyLoadFailedCallback):
323         (WPEQtView::updatePaintNode):
324         (WPEQtView::url const):
325         (WPEQtView::setUrl):
326         (WPEQtView::loadProgress const):
327         (WPEQtView::title const):
328         (WPEQtView::canGoBack const):
329         (WPEQtView::isLoading const):
330         (WPEQtView::canGoForward const):
331         (WPEQtView::goBack):
332         (WPEQtView::goForward):
333         (WPEQtView::reload):
334         (WPEQtView::stop):
335         (WPEQtView::loadHtml):
336         (WPEQtView::jsAsyncReadyCallback):
337         (WPEQtView::handleJsResult):
338         (WPEQtView::runJavaScript):
339         (WPEQtView::mousePressEvent):
340         (WPEQtView::mouseReleaseEvent):
341         (WPEQtView::hoverEnterEvent):
342         (WPEQtView::hoverLeaveEvent):
343         (WPEQtView::hoverMoveEvent):
344         (WPEQtView::wheelEvent):
345         (WPEQtView::keyPressEvent):
346         (WPEQtView::keyReleaseEvent):
347         (WPEQtView::touchEvent):
348         * UIProcess/API/wpe/qt/WPEQtView.h: Added.
349         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: Added.
350         (configureCallback):
351         (WPEQtViewBackend::WPEQtViewBackend):
352         (WPEQtViewBackend::~WPEQtViewBackend):
353         (WPEQtViewBackend::configureGlibEglDisplay):
354         (WPEQtViewBackend::configureEglDisplay):
355         (WPEQtViewBackend::initialize):
356         (WPEQtViewBackend::backend const):
357         (WPEQtViewBackend::resize):
358         (WPEQtViewBackend::getTexture):
359         (WPEQtViewBackend::initSurface):
360         (WPEQtViewBackend::displayImage):
361         (WPEQtViewBackend::modifiers const):
362         (WPEQtViewBackend::dispatchHoverEnterEvent):
363         (WPEQtViewBackend::dispatchHoverLeaveEvent):
364         (WPEQtViewBackend::dispatchHoverMoveEvent):
365         (WPEQtViewBackend::dispatchMousePressEvent):
366         (WPEQtViewBackend::dispatchMouseReleaseEvent):
367         (WPEQtViewBackend::dispatchWheelEvent):
368         (WPEQtViewBackend::dispatchKeyEvent):
369         (WPEQtViewBackend::dispatchTouchEvent):
370         * UIProcess/API/wpe/qt/WPEQtViewBackend.h: Added.
371         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: Added.
372         (WPEQtViewLoadRequest::WPEQtViewLoadRequest):
373         (WPEQtViewLoadRequest::~WPEQtViewLoadRequest):
374         (WPEQtViewLoadRequest::url const):
375         (WPEQtViewLoadRequest::status const):
376         (WPEQtViewLoadRequest::errorString const):
377         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: Added.
378         * UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h: Added.
379         (WPEQtViewLoadRequestPrivate::WPEQtViewLoadRequestPrivate):
380         (WPEQtViewLoadRequestPrivate::~WPEQtViewLoadRequestPrivate):
381         * UIProcess/API/wpe/qt/qmldir: Added.
382
383 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
384
385         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
386         https://bugs.webkit.org/show_bug.cgi?id=193494
387         <rdar://problem/46859627>
388
389         Reviewed by Simon Fraser and Tim Horton.
390
391         Adds `contentInsets` to `VisibleContentRectUpdateInfo`. This keeps track of the visible content insets
392         surrounding the unobscured content rect. See WebCore ChangeLog for more details.
393
394         * Shared/VisibleContentRectUpdateInfo.cpp:
395         (WebKit::VisibleContentRectUpdateInfo::encode const):
396         (WebKit::VisibleContentRectUpdateInfo::decode):
397         (WebKit::operator<<):
398         * Shared/VisibleContentRectUpdateInfo.h:
399         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
400         (WebKit::VisibleContentRectUpdateInfo::contentInsets const):
401         (WebKit::operator==):
402         * UIProcess/API/Cocoa/WKWebView.mm:
403         (-[WKWebView _computedObscuredInset]):
404         (-[WKWebView _computedContentInset]):
405         (-[WKWebView _computedUnobscuredSafeAreaInset]):
406
407         We don't care about source compatibility with iOS 10 and below anymore, so we should change these >= iOS 11
408         target checks to simply `PLATFORM(IOS)`.
409
410         (-[WKWebView _updateVisibleContentRects]):
411
412         Compute the visible content insets on all sides of the unobscured content rect. These insets are scaled to
413         content coordinates.
414
415         * UIProcess/ios/WKContentView.h:
416         * UIProcess/ios/WKContentView.mm:
417         (floatBoxExtent):
418
419         Add a helper to convert `UIEdgeInsets` to `WebCore::FloatBoxExtent`, and use it in a few places below.
420
421         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
422         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
423         * WebProcess/WebPage/ios/WebPageIOS.mm:
424         (WebKit::WebPage::updateVisibleContentRects):
425
426         Update the Page's content insets.
427
428 2019-01-17  Truitt Savell  <tsavell@apple.com>
429
430         Unreviewed, rolling out r240124.
431
432         This commit broke an internal build.
433
434         Reverted changeset:
435
436         "SDK_VARIANT build destinations should be separate from non-
437         SDK_VARIANT builds"
438         https://bugs.webkit.org/show_bug.cgi?id=189553
439         https://trac.webkit.org/changeset/240124
440
441 2019-01-17  John Wilander  <wilander@apple.com>
442
443         Add infrastructure to enable/disable ITP Debug Mode through Preferences
444         https://bugs.webkit.org/show_bug.cgi?id=193510
445         <rdar://problem/47330969>
446
447         Reviewed by Dean Jackson.
448
449         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
450         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
451         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
452         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
453             These functions are now suited for runtime switching of ITP Debug Mode.
454         * Shared/WebPreferences.yaml:
455             Changed name from ResourceLoadStatisticsDebugMode to ItpDebugModeEnabled.
456         * UIProcess/API/Cocoa/WKPreferences.mm:
457         (-[WKPreferences _setItpDebugModeEnabled:]):
458         (-[WKPreferences _itpDebugModeEnabled]):
459             New private preferences functions.
460         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
461         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
462         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
463             Removed support for old experimental user default. Added a new one that's
464             not connected to any UI, i.e. merely for command line debugging where
465             ITP Debug Mode needs to be on all the time.
466
467 2019-01-17  Tim Horton  <timothy_horton@apple.com>
468
469         Adopt NSTextCheckingSuppressInitialCapitalizationKey
470         https://bugs.webkit.org/show_bug.cgi?id=193545
471
472         Reviewed by Dean Jackson.
473
474         * UIProcess/mac/TextCheckerMac.mm:
475         (WebKit::TextChecker::checkTextOfParagraph):
476         (WebKit::TextChecker::getGuessesForWord):
477
478 2019-01-17  Jer Noble  <jer.noble@apple.com>
479
480         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
481         https://bugs.webkit.org/show_bug.cgi?id=189553
482
483         Reviewed by Tim Horton.
484
485         * Configurations/Base.xcconfig:
486         * Configurations/BaseTarget.xcconfig:
487         * Configurations/SDKVariant.xcconfig: Added.
488
489 2019-01-16  Dean Jackson  <dino@apple.com>
490
491         (iPad) Link tapping is sluggish on many sites
492         https://bugs.webkit.org/show_bug.cgi?id=193522
493         <rdar://problem/47102987>
494
495         Reviewed by Wenson Hsieh.
496
497         Some WKWebView clients might set the initial zoom scale of the page to
498         something other than 1, which disables the "fast tap" behaviour.
499         The fix is very simple -- just check against the initial scale rather
500         than 1.
501
502         The most likely regression from this would be pages designed for desktop,
503         but provide a viewport tag saying width=device-width and initial-scale.
504         They might stop allowing double-tap-to-zoom.
505
506         * UIProcess/API/Cocoa/WKWebView.mm:
507         (-[WKWebView _allowsDoubleTapGestures]): Check against initial page scale.
508
509 2019-01-17  Alex Christensen  <achristensen@webkit.org>
510
511         Stop using NetworkStorageSession::storageSession in WebCore
512         https://bugs.webkit.org/show_bug.cgi?id=193529
513
514         Reviewed by Tim Horton.
515
516         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
517         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
518         * NetworkProcess/NetworkProcess.h:
519         * NetworkProcess/NetworkSocketStream.cpp:
520         (WebKit::NetworkSocketStream::create):
521         (WebKit::NetworkSocketStream::NetworkSocketStream):
522         * NetworkProcess/NetworkSocketStream.h:
523         * NetworkProcess/NetworkStorageSessionProvider.h: Added.
524         * WebKit.xcodeproj/project.pbxproj:
525         * WebProcess/Network/WebSocketProvider.cpp:
526         (WebKit::WebSocketProvider::createSocketStreamHandle):
527         * WebProcess/Network/WebSocketProvider.h:
528         * WebProcess/WebPage/WebCookieJar.cpp:
529         (WebKit::WebCookieJar::WebCookieJar):
530         * WebProcess/WebPage/WebCookieJar.h:
531
532 2019-01-16  Youenn Fablet  <youenn@apple.com>
533
534         Add a new SPI for controlling getUserMedia
535         https://bugs.webkit.org/show_bug.cgi?id=192793
536
537         Reviewed by Eric Carlson.
538
539         Some weaknesses of the current getUserMedia/enumerateDevices SPI were found.
540         In particular:
541         - The hash salt should be handled by WebKit not by apps using WebKit.
542         - No need to expose the frame URL, only the top level origin is needed.
543         - The names of the callback are changed to improve the intent of these callbacks.
544         Addressed these by creating a new SPI which will replace the current one.
545         The current SPI will be removed later on.
546
547         Did some refactoring by making the callbacks not return false.
548         Instead, implement the default behavior inside the request objects as deny methods.
549         Some further refactoring will be done as a follow-up to better align the C API with the Cocoa API.
550
551         * UIProcess/API/APIUIClient.h:
552         (API::UIClient::decidePolicyForUserMediaPermissionRequest):
553         (API::UIClient::checkUserMediaPermissionForOrigin):
554         * UIProcess/API/C/WKPage.cpp:
555         (WKPageSetPageUIClient):
556         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
557         * UIProcess/API/Cocoa/WKWebView.mm:
558         (-[WKWebView _mediaCaptureState]):
559         (-[WKWebView _setMediaCaptureMuted:]):
560         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
561         * UIProcess/API/glib/WebKitUIClient.cpp:
562         * UIProcess/Cocoa/MediaCaptureUtilities.h: Added.
563         * UIProcess/Cocoa/MediaCaptureUtilities.mm: Added.
564         * UIProcess/Cocoa/UIDelegate.h:
565         * UIProcess/Cocoa/UIDelegate.mm:
566         (WebKit::UIDelegate::setDelegate):
567         (WebKit::requestUserMediaAuthorizationForFrame):
568         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
569         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
570         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
571         * UIProcess/UserMediaPermissionCheckProxy.h:
572         (WebKit::UserMediaPermissionCheckProxy::deny):
573         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
574         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
575         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
576         * UIProcess/UserMediaPermissionRequestProxy.h:
577
578 2019-01-16  Youenn Fablet  <youenn@apple.com>
579
580         Pipe cache quota request from Network Process to UIProcess
581         https://bugs.webkit.org/show_bug.cgi?id=193296
582
583         Reviewed by Alex Christensen.
584
585         When cache storage hits quota for a given origin, pipe the request back to NetworkProcess.
586         No record will be put until the quota request is answered.
587         The request is sent from CacheStorage::Caches to CacheStorage::Engine and to NetworkProcess.
588         NetworkProcess then sends it to NetworkProcessProxy.
589         Currently NetworkProcessProxy just answers by keeping the quota as it is.
590         In the future, NetworkProcessProxy should make a delegate call to let the app using WebKit
591         make a decision on the quota. This will allow prompting user to bump it as done for other data.
592
593         * NetworkProcess/NetworkProcess.cpp:
594         (WebKit::NetworkProcess::requestCacheStorageSpace):
595         * NetworkProcess/NetworkProcess.h:
596         * NetworkProcess/cache/CacheStorageEngine.cpp:
597         (WebKit::CacheStorage::Engine::~Engine):
598         (WebKit::CacheStorage::Engine::from):
599         (WebKit::CacheStorage::Engine::Engine):
600         (WebKit::CacheStorage::Engine::requestSpace):
601         (WebKit::CacheStorage::Engine::requestSpaceCompleted):
602         * NetworkProcess/cache/CacheStorageEngine.h:
603         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
604         (WebKit::CacheStorage::Cache::put):
605         (WebKit::CacheStorage::Cache::retryPuttingPendingRecords):
606         * NetworkProcess/cache/CacheStorageEngineCache.h:
607         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
608         (WebKit::CacheStorage::Caches::requestSpace):
609         (WebKit::CacheStorage::Caches::notifyCachesOfRequestSpaceEnd):
610         * NetworkProcess/cache/CacheStorageEngineCaches.h:
611         (WebKit::CacheStorage::Caches::isRequestingSpace const):
612         * UIProcess/Network/NetworkProcessProxy.cpp:
613         (WebKit::NetworkProcessProxy::requestCacheStorageSpace):
614         * UIProcess/Network/NetworkProcessProxy.h:
615         * UIProcess/Network/NetworkProcessProxy.messages.in:
616
617 2019-01-16  Alex Christensen  <achristensen@webkit.org>
618
619         sendBeacon to previously-unvisited https domain always fails
620         https://bugs.webkit.org/show_bug.cgi?id=193508
621
622         Reviewed by Geoffrey Garen.
623
624         * NetworkProcess/PingLoad.cpp:
625         (WebKit::PingLoad::didReceiveChallenge):
626         If a ping load is doing a TLS handshake, continue if the server has good certificates.
627
628 2019-01-16  Youenn Fablet  <youenn@apple.com>
629
630         ASSERTION FAILED: m_networkLoadInformationByID.contains(identifier) in WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics
631         https://bugs.webkit.org/show_bug.cgi?id=189097
632         <rdar://problem/43856423>
633
634         Reviewed by Alex Christensen.
635
636         In case where the inspector is launched, it will instruct the NetworkConnectionToWebProcess to start capturing network metrics.
637         If this happens in the middle of a load, addNetworkLoadInformationMetrics might fail since addNetworkLoadInformation will not be called.
638         To fix this issue, store whether to capture metrics at NetworkResourceLoader level.
639
640         To ensure that the case of switching back and forth capture of metrics, disable loader capture of metrics whenver NetworkConnectionToWebProcess is asked to.
641
642         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
643         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
644         * NetworkProcess/NetworkConnectionToWebProcess.h:
645         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
646         * NetworkProcess/NetworkResourceLoader.cpp:
647         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
648         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics const):
649         * NetworkProcess/NetworkResourceLoader.h:
650
651 2019-01-16  Alex Christensen  <achristensen@webkit.org>
652
653         Revert r239938
654         https://bugs.webkit.org/show_bug.cgi?id=193267
655         <rdar://problem/47297304>
656
657         * Configurations/WebContent-iOS.entitlements:
658
659 2019-01-16  Chris Dumez  <cdumez@apple.com>
660
661         Regression(r240046) Several API tests are crashing
662         https://bugs.webkit.org/show_bug.cgi?id=193509
663
664         Reviewed by Geoffrey Garen.
665
666         The crashes would happen because loadRequestShared() would take a WebProcessProxy& in parameter but
667         then call reattachToWebProcess() if the page is not valid, which would replace m_process and invalidate
668         our process reference.
669
670         To address the issue, move the reattachToWebProcess() call to loadRequest(), before calling
671         loadRequestShared(). Also, update *Shared() methods to take a Ref<WebProcessProxy>&& instead
672         of a WebProcessProxy& in parameter. Since we call client delegates, we need to make sure
673         our process stays alive.
674
675         * UIProcess/ProvisionalPageProxy.cpp:
676         (WebKit::ProvisionalPageProxy::loadData):
677         (WebKit::ProvisionalPageProxy::loadRequest):
678         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
679         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
680         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
681         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
682         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
683         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
684         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
685         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
686         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
687         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
688         * UIProcess/WebPageProxy.cpp:
689         (WebKit::WebPageProxy::loadRequest):
690         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
691         (WebKit::WebPageProxy::loadData):
692         (WebKit::WebPageProxy::loadDataWithNavigationShared):
693         (WebKit::WebPageProxy::didPerformDragControllerAction):
694         (WebKit::WebPageProxy::findPlugin):
695         (WebKit::WebPageProxy::didCreateMainFrame):
696         (WebKit::WebPageProxy::didCreateSubframe):
697         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
698         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
699         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
700         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
701         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
702         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
703         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
704         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
705         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
706         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
707         (WebKit::WebPageProxy::didCommitLoadForFrame):
708         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
709         (WebKit::WebPageProxy::didFinishLoadForFrame):
710         (WebKit::WebPageProxy::didFailLoadForFrame):
711         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
712         (WebKit::WebPageProxy::didReceiveTitleForFrame):
713         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
714         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
715         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
716         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
717         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
718         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
719         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
720         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
721         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
722         (WebKit::WebPageProxy::decidePolicyForResponse):
723         (WebKit::WebPageProxy::decidePolicyForResponseShared):
724         (WebKit::WebPageProxy::unableToImplementPolicy):
725         (WebKit::WebPageProxy::willSubmitForm):
726         (WebKit::WebPageProxy::didNavigateWithNavigationData):
727         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
728         (WebKit::WebPageProxy::didPerformClientRedirect):
729         (WebKit::WebPageProxy::didPerformClientRedirectShared):
730         (WebKit::WebPageProxy::didPerformServerRedirect):
731         (WebKit::WebPageProxy::didUpdateHistoryTitle):
732         (WebKit::WebPageProxy::createNewPage):
733         (WebKit::WebPageProxy::runJavaScriptAlert):
734         (WebKit::WebPageProxy::runJavaScriptConfirm):
735         (WebKit::WebPageProxy::runJavaScriptPrompt):
736         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
737         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
738         (WebKit::WebPageProxy::runOpenPanel):
739         (WebKit::WebPageProxy::printFrame):
740         (WebKit::WebPageProxy::backForwardGoToItem):
741         (WebKit::WebPageProxy::backForwardGoToItemShared):
742         (WebKit::WebPageProxy::learnWord):
743         (WebKit::WebPageProxy::ignoreWord):
744         (WebKit::WebPageProxy::didReceiveEvent):
745         (WebKit::WebPageProxy::editingRangeCallback):
746         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
747         (WebKit::WebPageProxy::focusedFrameChanged):
748         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
749         (WebKit::WebPageProxy::exceededDatabaseQuota):
750         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
751         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
752         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
753         (WebKit::WebPageProxy::startURLSchemeTask):
754         (WebKit::WebPageProxy::startURLSchemeTaskShared):
755         (WebKit::WebPageProxy::stopURLSchemeTask):
756         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
757         * UIProcess/WebPageProxy.h:
758
759 2019-01-16  Chris Dumez  <cdumez@apple.com>
760
761         Regression(PSON) View becomes blank after click a cross-site download link
762         https://bugs.webkit.org/show_bug.cgi?id=193361
763         <rdar://problem/47099573>
764
765         Reviewed by Geoffrey Garen.
766
767         The issue tracked by rdar://problem/47099573 is that a provisional load may get
768         canceled (or converted into a download) *after* we've decided to process-swap.
769         In such cases, the view should keep displaying the current site and it should
770         still be interactive. However, with the previous PSON model, the view (pageProxy)
771         would have already swapped to the new process and would end up displaying the
772         initially empty document.
773
774         To address the issue, this patch introduces the concept of a provisional load
775         in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
776         process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
777         provisional page until after the load was committed in the new process. This means
778         that the view / WebPageProxy keeps using the old process and displays the current
779         content until a load has committed in the provisional page. If no load commits
780         in the provisional process (e.g. because the load is cancelled or converted into
781         a download), then we merely destroy the ProvisionalPageProxy and terminate its
782         process, without impacting the WebPageProxy.
783
784         * Shared/WebPageCreationParameters.cpp:
785         (WebKit::WebPageCreationParameters::encode const):
786         (WebKit::WebPageCreationParameters::decode):
787         * Shared/WebPageCreationParameters.h:
788         Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
789         delay attaching the drawing area in case of a process-swap, no matter what
790         now that the previous process is kept alive until the provisional load is
791         committed in the new process.
792
793         * Shared/WebPolicyAction.h:
794         Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
795         process-swap, we now tell the previous process to simply ignore the load, while
796         we create a ProvisionalPageProxy to do the new load in a new process.
797         Suspension of the previous page in the old process, happens later, when a load
798         is actually committed in the new process.
799
800         * Sources.txt:
801         Add new ProvisionalPageProxy file.
802
803         * UIProcess/API/Cocoa/WKWebView.mm:
804         (-[WKWebView _killWebContentProcessAndResetState]):
805         When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
806         process and the provisional one, to maintain previous behavior in our API tests.
807
808         * UIProcess/API/gtk/PageClientImpl.cpp:
809         (WebKit::PageClientImpl::createDrawingAreaProxy):
810         * UIProcess/API/gtk/PageClientImpl.h:
811         * UIProcess/API/wpe/PageClientImpl.cpp:
812         (WebKit::PageClientImpl::createDrawingAreaProxy):
813         * UIProcess/API/wpe/PageClientImpl.h:
814         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
815         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
816         (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState):
817         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
818         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
819         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
820         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
821         * UIProcess/AcceleratedDrawingAreaProxy.h:
822         * UIProcess/Cocoa/WebViewImpl.h:
823         * UIProcess/Cocoa/WebViewImpl.mm:
824         (WebKit::WebViewImpl::createDrawingAreaProxy):
825         * UIProcess/DrawingAreaProxy.cpp:
826         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
827         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
828         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
829         * UIProcess/DrawingAreaProxy.h:
830         (WebKit::DrawingAreaProxy::process):
831         * UIProcess/DrawingAreaProxyImpl.cpp:
832         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
833         (WebKit::DrawingAreaProxyImpl::update):
834         * UIProcess/DrawingAreaProxyImpl.h:
835         * UIProcess/PageClient.h:
836         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
837         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
838         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
839         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
840         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
841         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
842         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
843         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
844         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
845         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
846         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
847         * UIProcess/ios/PageClientImplIOS.h:
848         * UIProcess/ios/PageClientImplIOS.mm:
849         (WebKit::PageClientImpl::createDrawingAreaProxy):
850         * UIProcess/ios/WKContentView.h:
851         * UIProcess/ios/WKContentView.mm:
852         (-[WKContentView _createDrawingAreaProxy:]):
853         * UIProcess/mac/PageClientImplMac.h:
854         * UIProcess/mac/PageClientImplMac.mm:
855         (WebKit::PageClientImpl::createDrawingAreaProxy):
856         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
857         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
858         (WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy):
859         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
860         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
861         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
862         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
863         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
864         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
865         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
866         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
867         * UIProcess/mac/WebPageProxyMac.mm:
868         * UIProcess/win/PageClientImpl.cpp:
869         (WebKit::PageClientImpl::createDrawingAreaProxy):
870         * UIProcess/win/PageClientImpl.h:
871         * UIProcess/win/PageClientImpl.cpp:
872         (WebKit::PageClientImpl::createDrawingAreaProxy):
873         * UIProcess/win/PageClientImpl.h:
874         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
875         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
876         Pass the drawing area's associated process when constructing it and store it as a member
877         in addition to the page. This is necessary now that a page can be associated with 2
878         WebProcesses at a time, each having its own drawing area.
879
880         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
881         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
882         Pass the process.
883
884         * UIProcess/ProvisionalPageProxy.cpp: Added.
885         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
886         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
887         (WebKit::ProvisionalPageProxy::processDidTerminate):
888         (WebKit::ProvisionalPageProxy::takeDrawingArea):
889         (WebKit::ProvisionalPageProxy::cancel):
890         (WebKit::ProvisionalPageProxy::processDidFinishLaunching):
891         (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch):
892         (WebKit::ProvisionalPageProxy::initializeWebPage):
893         (WebKit::ProvisionalPageProxy::loadData):
894         (WebKit::ProvisionalPageProxy::loadRequest):
895         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
896         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
897         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
898         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
899         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
900         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
901         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
902         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
903         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
904         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
905         (WebKit::ProvisionalPageProxy::startURLSchemeTask):
906         (WebKit::ProvisionalPageProxy::backForwardGoToItem):
907         (WebKit::ProvisionalPageProxy::didReceiveMessage):
908         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
909         * UIProcess/ProvisionalPageProxy.h: Added.
910         (WebKit::ProvisionalPageProxy::page):
911         (WebKit::ProvisionalPageProxy::mainFrame const):
912         (WebKit::ProvisionalPageProxy::process):
913         (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
914         (WebKit::ProvisionalPageProxy::navigationID const):
915         (WebKit::ProvisionalPageProxy::drawingArea const):
916         New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from
917         the provisional process.
918
919         * UIProcess/SuspendedPageProxy.cpp:
920         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
921         (WebKit::SuspendedPageProxy::unsuspend):
922         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
923         Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
924         when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
925         which tries to register itself as an IPC message receiver for the same pageID when
926         a process-swap occurs and we're switching to a suspended page.
927
928         * UIProcess/WebFrameProxy.cpp:
929         (WebKit::WebFrameProxy::isMainFrame const):
930         WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
931         Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
932         m_mainFrame to maintain previous behavior.
933
934         * UIProcess/WebPageProxy.cpp:
935         (WebKit::WebPageProxy::provisionalDrawingArea const):
936         Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but
937         the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot.
938
939         (WebKit::WebPageProxy::swapToWebProcess):
940         swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
941         later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
942         to initialize some data members such as the drawing area and the main frame as it is transferring them over from
943         the ProvisionalPageProxy which started the provisional load.
944
945         (WebKit::WebPageProxy::finishAttachingToWebProcess):
946         We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
947         committed in the provisional process.
948
949         (WebKit::WebPageProxy::setDrawingArea):
950         (WebKit::WebPageProxy::initializeWebPage):
951         - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
952           committed in the provisional process.
953         - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
954
955         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
956         (WebKit::WebPageProxy::loadRequest):
957         (WebKit::WebPageProxy::loadRequestWithNavigationShared):
958         Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
959         Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
960
961         (WebKit::WebPageProxy::loadData):
962         (WebKit::WebPageProxy::loadDataWithNavigationShared):
963         (WebKit::WebPageProxy::stopLoading):
964         (WebKit::WebPageProxy::reload):
965         (WebKit::WebPageProxy::didPerformDragControllerAction):
966         (WebKit::WebPageProxy::findPlugin):
967         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
968         In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
969         Suspension now happens later, only if we end up committing the provisional load in the new process.
970         Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
971         to happen a bit later but it is clearer if we do this as early as possible I think.
972
973         (WebKit::WebPageProxy::commitProvisionalPage):
974         When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
975         - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
976         - Suspending the current page.
977         - Letting the client know the load is comitted
978         - Destroy the ProvisionalPageProxy.
979         This work used to happen earlier in continueNavigationInNewProcess().
980
981         (WebKit::WebPageProxy::continueNavigationInNewProcess):
982         Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
983         without actually having the WebPageProxy switch to the new process yet.
984
985         (WebKit::WebPageProxy::didCreateMainFrame):
986         (WebKit::WebPageProxy::didCreateSubframe):
987         (WebKit::WebPageProxy::didCreateWindow):
988         Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
989
990         (WebKit::WebPageProxy::didDestroyNavigation):
991         On process-swap, when telling the previous process to ignore the load and starting the new load in a new
992         ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
993         the call since the navigation is merely taken over by the ProvisionalPageProxy.
994
995         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
996         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
997         Moved some PSON logic to the ProvisionalPageProxy instead.
998
999         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1000         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
1001         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
1002         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
1003         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
1004         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
1005
1006         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1007         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
1008         When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
1009
1010         (WebKit::WebPageProxy::didCommitLoadForFrame):
1011         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1012         (WebKit::WebPageProxy::didFinishLoadForFrame):
1013         (WebKit::WebPageProxy::didFailLoadForFrame):
1014         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1015         (WebKit::WebPageProxy::didReceiveTitleForFrame):
1016         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
1017         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
1018         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
1019         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
1020         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
1021         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
1022         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1023         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
1024         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1025         (WebKit::WebPageProxy::decidePolicyForResponse):
1026         (WebKit::WebPageProxy::decidePolicyForResponseShared):
1027         (WebKit::WebPageProxy::unableToImplementPolicy):
1028         (WebKit::WebPageProxy::willSubmitForm):
1029         (WebKit::WebPageProxy::didNavigateWithNavigationData):
1030         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
1031         (WebKit::WebPageProxy::didPerformClientRedirect):
1032         (WebKit::WebPageProxy::didPerformClientRedirectShared):
1033         (WebKit::WebPageProxy::didPerformServerRedirect):
1034         (WebKit::WebPageProxy::didUpdateHistoryTitle):
1035         (WebKit::WebPageProxy::createNewPage):
1036         (WebKit::WebPageProxy::runJavaScriptAlert):
1037         (WebKit::WebPageProxy::runJavaScriptConfirm):
1038         (WebKit::WebPageProxy::runJavaScriptPrompt):
1039         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
1040         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
1041         (WebKit::WebPageProxy::runOpenPanel):
1042         (WebKit::WebPageProxy::printFrame):
1043         (WebKit::WebPageProxy::backForwardGoToItem):
1044         (WebKit::WebPageProxy::backForwardGoToItemShared):
1045         (WebKit::WebPageProxy::learnWord):
1046         (WebKit::WebPageProxy::ignoreWord):
1047         (WebKit::WebPageProxy::didReceiveEvent):
1048         (WebKit::WebPageProxy::editingRangeCallback):
1049         (WebKit::WebPageProxy::rectForCharacterRangeCallback):
1050         (WebKit::WebPageProxy::focusedFrameChanged):
1051         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
1052
1053         (WebKit::WebPageProxy::provisionalProcessDidTerminate):
1054         Cancel the provisiona load and destroy the ProvisionalPageProxy if
1055         the provisional process crashes.
1056
1057         (WebKit::WebPageProxy::resetState):
1058         Drop some code that is no longer needed.
1059
1060         (WebKit::WebPageProxy::creationParameters):
1061         - Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
1062         more than one call site. This was just some bad factoring.
1063         - Take the process in parameter now that we page can be associated with several processes at a time.
1064
1065         (WebKit::WebPageProxy::exceededDatabaseQuota):
1066         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
1067         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
1068         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
1069         (WebKit::WebPageProxy::startURLSchemeTask):
1070         (WebKit::WebPageProxy::startURLSchemeTaskShared):
1071         (WebKit::WebPageProxy::stopURLSchemeTask):
1072         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
1073         (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
1074         (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
1075         * UIProcess/WebPageProxy.h:
1076         (WebKit::WebPageProxy::visitedLinkStore):
1077         (WebKit::WebPageProxy::provisionalPageProxy const):
1078
1079         * UIProcess/WebProcessProxy.cpp:
1080         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
1081         (WebKit::WebProcessProxy::updateBackForwardItem):
1082         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1083         (WebKit::WebProcessProxy::didFinishLaunching):
1084         (WebKit::WebProcessProxy::canTerminateChildProcess):
1085         * UIProcess/WebProcessProxy.h:
1086         (WebKit::WebProcessProxy::addProvisionalPageProxy):
1087         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
1088         Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
1089         item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
1090         associated with this process yet, because it is still a ProvisionalPageProxy.        
1091
1092         * UIProcess/WebURLSchemeHandler.cpp:
1093         (WebKit::WebURLSchemeHandler::startTask):
1094         * UIProcess/WebURLSchemeHandler.h:
1095         * UIProcess/WebURLSchemeTask.cpp:
1096         (WebKit::WebURLSchemeTask::create):
1097         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
1098         (WebKit::WebURLSchemeTask::didPerformRedirection):
1099         (WebKit::WebURLSchemeTask::didReceiveResponse):
1100         (WebKit::WebURLSchemeTask::didReceiveData):
1101         (WebKit::WebURLSchemeTask::didComplete):
1102         (WebKit::WebURLSchemeTask::pageDestroyed):
1103         * UIProcess/WebURLSchemeTask.h:
1104         Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to
1105         the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses.
1106
1107         * UIProcess/ios/ViewGestureControllerIOS.mm:
1108         (WebKit::ViewGestureController::endSwipeGesture):
1109         Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently
1110         associated with the page in case of process swap.
1111
1112         * WebKit.xcodeproj/project.pbxproj:
1113         Add ProvisionalPageProxy class.
1114
1115         * WebProcess/WebPage/WebFrame.cpp:
1116         (WebKit::toPolicyAction):
1117         (WebKit::WebFrame::didReceivePolicyDecision):
1118         * WebProcess/WebPage/WebPage.cpp:
1119         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1120         (WebKit::WebPage::reinitializeWebPage):
1121         (WebKit::WebPage::didReceivePolicyDecision):
1122         Stop dealing with WebPolicyAction::Suspend as it no longer exists.
1123
1124         (WebKit::WebPage::didCompletePageTransition):
1125
1126         (WebKit::WebPage::setIsSuspended):
1127         Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
1128         setIsSuspended(true) IPC is sent when we actually commit the provisional page.
1129
1130         * WebProcess/WebPage/WebPage.h:
1131
1132 2019-01-16  Tim Horton  <timothy_horton@apple.com>
1133
1134         Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
1135         https://bugs.webkit.org/show_bug.cgi?id=193468
1136         <rdar://problem/38645869>
1137
1138         Reviewed by Zalan Bujtas.
1139
1140         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1141         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
1142         Adjust the null-check a bit; Zalan pointed out that the layout could
1143         be responsible for the Frame/RenderView going away, so we should bail
1144         *after* layout, not before.
1145
1146 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
1147
1148         Unreviewed WinCairo build fix.
1149
1150         * WebProcess/WebPage/WebPageInspectorTargetController.cpp:
1151         (WebKit::WebPageInspectorTargetController::connectInspector): Use 'auto' instead of unprefixed InspectorTarget.
1152         (WebKit::WebPageInspectorTargetController::disconnectInspector): Ditto.
1153         (WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend): Ditto.
1154
1155 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1156
1157         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
1158         https://bugs.webkit.org/show_bug.cgi?id=193368
1159
1160         Reviewed by Geoff Garen.
1161
1162         * WebProcess/Plugins/PluginView.cpp:
1163         (WebKit::PluginView::getAuthenticationInfo):
1164
1165 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1166
1167         Remove more NetworkProcess::singleton use
1168         https://bugs.webkit.org/show_bug.cgi?id=193484
1169
1170         Reviewed by Geoffrey Garen.
1171
1172         This removes the use of NetworkProcess::singleton in the LegacyCustomProtocolManager.
1173         This is the kind of awful duct tape code that keeps me awake at night, but it's necessary
1174         because we can't quite remove LegacyCustomProtocolManager yet but we need to allow more than
1175         one NetworkProcess object.  To make it work well enough until we remove LegacyCustomProtocolManager,
1176         use the last NetworkProcess object that has been created.
1177
1178         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
1179         (newestNetworkProcess):
1180         (LegacyCustomProtocolManager::networkProcessCreated):
1181         (+[WKCustomProtocol canInitWithRequest:]):
1182         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
1183         (-[WKCustomProtocol startLoading]):
1184         (-[WKCustomProtocol stopLoading]):
1185         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
1186         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
1187         (WebKit::LegacyCustomProtocolManager::startLoading):
1188         (WebKit::LegacyCustomProtocolManager::stopLoading):
1189         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
1190         * NetworkProcess/NetworkProcess.cpp:
1191         (WebKit::NetworkProcess::NetworkProcess):
1192
1193 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1194
1195         Fix WinCairo build after r240014
1196         https://bugs.webkit.org/show_bug.cgi?id=161106
1197
1198         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1199
1200 2019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
1201
1202         VisualViewport API should be updated upon opening of keyboard
1203         https://bugs.webkit.org/show_bug.cgi?id=193475
1204
1205         Reviewed by Simon Fraser.
1206
1207         The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
1208         unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.
1209
1210         Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
1211         unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
1212         while the keyboard is getting brought up.
1213
1214         * Shared/VisibleContentRectUpdateInfo.h:
1215         (WebKit::operator==):
1216         * WebProcess/WebPage/ios/WebPageIOS.mm:
1217         (WebKit::WebPage::updateVisibleContentRects):
1218
1219 2019-01-15  Megan Gardner  <megan_gardner@apple.com>
1220
1221         Add Reveal support in iOSMac
1222         https://bugs.webkit.org/show_bug.cgi?id=193408
1223         <rdar://problem/47300699>
1224
1225         Reviewed by Tim Horton.
1226
1227         Add calls to DictionaryLookup from the appropriate places.
1228
1229         * UIProcess/PageClient.h:
1230         * UIProcess/ios/PageClientImplIOS.h:
1231         * UIProcess/ios/PageClientImplIOS.mm:
1232         (WebKit::PageClientImpl::didPerformDictionaryLookup):
1233         * UIProcess/ios/WebPageProxyIOS.mm:
1234         (WebKit::WebPageProxy::didPerformDictionaryLookup):
1235         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1236         (WebKit::WebPage::dictionaryPopupInfoForRange):
1237
1238 2019-01-15  Claudio Saavedra  <csaavedra@igalia.com>
1239
1240         [SOUP] Remove usage of NetworkProcess::singleton()
1241         https://bugs.webkit.org/show_bug.cgi?id=193444
1242
1243         Reviewed by Michael Catanzaro.
1244
1245         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1246         (WebKit::NetworkDataTaskSoup::download):
1247         (WebKit::NetworkDataTaskSoup::didWriteDownload):
1248         (WebKit::NetworkDataTaskSoup::didFinishDownload):
1249         (WebKit::NetworkDataTaskSoup::didFailDownload):
1250         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1251         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1252
1253 2019-01-15  Eric Carlson  <eric.carlson@apple.com>
1254
1255         Fix incorrect ASSERT added in r239840
1256         https://bugs.webkit.org/show_bug.cgi?id=193466
1257         <rdar://problem/47095142>
1258
1259         Reviewed by Youenn Fablet.
1260
1261         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1262         (WebKit::UserMediaCaptureManager::Source::Source):
1263
1264 2019-01-15  Tim Horton  <timothy_horton@apple.com>
1265
1266         Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
1267         https://bugs.webkit.org/show_bug.cgi?id=193468
1268         <rdar://problem/38645869>
1269
1270         Reviewed by Beth Dakin.
1271
1272         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1273         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
1274         I'm not sure why this got *worse*, but we should null-check RenderView.
1275         It's OK to bail from scaleViewToFitDocumentIfNeeded, we'll re-do it
1276         the next time we paint (which will surely happen if we gain a RenderView).
1277
1278 2019-01-15  Chris Dumez  <cdumez@apple.com>
1279
1280         Unreviewed, rolling out r239993, r239995, r239997, and
1281         r239999.
1282
1283         Caused assertions under
1284         ViewGestureController::disconnectFromProcess()
1285
1286         Reverted changesets:
1287
1288         "Regression(PSON) View becomes blank after click a cross-site
1289         download link"
1290         https://bugs.webkit.org/show_bug.cgi?id=193361
1291         https://trac.webkit.org/changeset/239993
1292
1293         "Unreviewed iOS build fix after r239993."
1294         https://trac.webkit.org/changeset/239995
1295
1296         "Fix iOS build after r239993"
1297         https://bugs.webkit.org/show_bug.cgi?id=193361
1298         https://trac.webkit.org/changeset/239997
1299
1300         "Unreviewed, revert part of r239997 as it is not needed to fix
1301         the build."
1302         https://trac.webkit.org/changeset/239999
1303
1304 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1305
1306         Stop using CookiesStrategy
1307         https://bugs.webkit.org/show_bug.cgi?id=161106
1308
1309         Reviewed by Don Olmstead and Antti Koivisto.
1310
1311         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
1312         (WebKit::NetworkProcessPlatformStrategies::createCookiesStrategy): Deleted.
1313         * NetworkProcess/NetworkProcessPlatformStrategies.h:
1314         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1315         * Scripts/webkit/messages.py:
1316         * Sources.txt:
1317         * WebKit.xcodeproj/project.pbxproj:
1318         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1319         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
1320         (WebKit::WebAutomationSessionProxy::deleteCookie):
1321         * WebProcess/Plugins/PluginView.cpp:
1322         (WebKit::PluginView::cookiesForURL):
1323         (WebKit::PluginView::setCookiesForURL):
1324         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1325         (WebKit::WebPlatformStrategies::createCookiesStrategy): Deleted.
1326         (WebKit::WebPlatformStrategies::cookiesForDOM): Deleted.
1327         (WebKit::WebPlatformStrategies::setCookiesFromDOM): Deleted.
1328         (WebKit::WebPlatformStrategies::cookiesEnabled): Deleted.
1329         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Deleted.
1330         (WebKit::WebPlatformStrategies::getRawCookies): Deleted.
1331         (WebKit::WebPlatformStrategies::deleteCookie): Deleted.
1332         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1333         * WebProcess/WebPage/WebCookieJar.cpp: Added.
1334         (WebKit::WebCookieJar::cookies const):
1335         (WebKit::WebCookieJar::setCookies):
1336         (WebKit::WebCookieJar::cookiesEnabled const):
1337         (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
1338         (WebKit::WebCookieJar::getRawCookies const):
1339         (WebKit::WebCookieJar::deleteCookie):
1340         * WebProcess/WebPage/WebCookieJar.h: Added.
1341         * WebProcess/WebPage/WebPage.cpp:
1342         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
1343
1344 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
1345
1346         Remove reporting for iOS mach lookups confirmed in-use
1347         https://bugs.webkit.org/show_bug.cgi?id=193455
1348         <rdar://problem/47259551>
1349
1350         Reviewed by Brent Fulgham.
1351
1352         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1353
1354 2019-01-15  Tim Horton  <timothy_horton@apple.com>
1355
1356         Cannot tab out of WKWebView on macOS
1357         https://bugs.webkit.org/show_bug.cgi?id=161448
1358         <rdar://problem/28100085>
1359
1360         Reviewed by Dean Jackson.
1361
1362         * UIProcess/WebPageProxy.cpp:
1363         (WebKit::WebPageProxy::takeFocus):
1364         If the UIDelegate doesn't implement takeFocus, provide a simple default
1365         implementation that just uses AppKit's key view loop to move the focus.
1366
1367         * UIProcess/API/APIUIClient.h:
1368         (API::UIClient::takeFocus):
1369         * UIProcess/API/C/WKPage.cpp:
1370         (WKPageSetPageUIClient):
1371         * UIProcess/Cocoa/UIDelegate.h:
1372         * UIProcess/Cocoa/UIDelegate.mm:
1373         (WebKit::UIDelegate::UIClient::takeFocus):
1374         Make API::UIClient's takeFocus return a bool indicating whether the
1375         client implements it or not.
1376
1377         * UIProcess/PageClient.h:
1378         * UIProcess/mac/PageClientImplMac.h:
1379         * UIProcess/mac/PageClientImplMac.mm:
1380         (WebKit::PageClientImpl::takeFocus):
1381         Plumb takeFocus to WebViewImpl.
1382
1383         * UIProcess/Cocoa/WebViewImpl.h:
1384         * UIProcess/Cocoa/WebViewImpl.mm:
1385         (WebKit::WebViewImpl::takeFocus):
1386         Borrow the relevant portion of WebKitLegacy's implementation of takeFocus,
1387         shifting focus to the next/previous key view in the window.
1388
1389 2019-01-15  Youenn Fablet  <youenn@apple.com>
1390
1391         Remove the specific handling of ephemeral sessions from CacheStorage::Engine::from
1392         https://bugs.webkit.org/show_bug.cgi?id=193400
1393
1394         Reviewed by Alex Christensen.
1395
1396         It is no longer needed as we correctly handle ephemeral sessions removal.
1397
1398         * NetworkProcess/cache/CacheStorageEngine.cpp:
1399         (WebKit::CacheStorage::Engine::from):
1400
1401 2019-01-15  Alex Christensen  <achristensen@webkit.org>
1402
1403         Fix iOS build after r239993
1404         https://bugs.webkit.org/show_bug.cgi?id=193361
1405
1406         * UIProcess/ProvisionalPageProxy.h:
1407         * UIProcess/SuspendedPageProxy.h:
1408
1409 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
1410
1411         [macOS] Adjust logging policy in WebKit's sandbox
1412         https://bugs.webkit.org/show_bug.cgi?id=193454
1413         <rdar://problem/47256325>
1414
1415         Reviewed by Brent Fulgham.
1416
1417         * WebProcess/com.apple.WebProcess.sb.in:
1418
1419 2019-01-15  Chris Dumez  <cdumez@apple.com>
1420
1421         Unreviewed iOS build fix after r239993.
1422
1423         * UIProcess/SuspendedPageProxy.h:
1424
1425 2019-01-15  Per Arne Vollan  <pvollan@apple.com>
1426
1427         Add allow directive for MTLCompilerService.xpc to PluginProcess and WebContent
1428         https://bugs.webkit.org/show_bug.cgi?id=193453
1429         <rdar://problem/47268166>
1430
1431         Reviewed by Brent Fulgham.
1432
1433         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1434         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1435         * WebProcess/com.apple.WebProcess.sb.in:
1436
1437 2019-01-15  Chris Dumez  <cdumez@apple.com>
1438
1439         Regression(PSON) View becomes blank after click a cross-site download link
1440         https://bugs.webkit.org/show_bug.cgi?id=193361
1441         <rdar://problem/47099573>
1442
1443         Reviewed by Geoff Garen.
1444
1445         The issue tracked by rdar://problem/47099573 is that a provisional load may get
1446         canceled (or converted into a download) *after* we've decided to process-swap.
1447         In such cases, the view should keep displaying the current site and it should
1448         still be interactive. However, with the previous PSON model, the view (pageProxy)
1449         would have already swapped to the new process and would end up displaying the
1450         initially empty document.
1451
1452         To address the issue, this patch introduces the concept of a provisional load
1453         in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
1454         process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
1455         provisional page until after the load was committed in the new process. This means
1456         that the view / WebPageProxy keeps using the old process and displays the current
1457         content until a load has committed in the provisional page. If no load commits
1458         in the provisional process (e.g. because the load is cancelled or converted into
1459         a download), then we merely destroy the ProvisionalPageProxy and terminate its
1460         process, without impacting the WebPageProxy.
1461
1462         * Shared/WebPageCreationParameters.cpp:
1463         (WebKit::WebPageCreationParameters::encode const):
1464         (WebKit::WebPageCreationParameters::decode):
1465         * Shared/WebPageCreationParameters.h:
1466         Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
1467         delay attaching the drawing area in case of a process-swap, no matter what
1468         now that the previous process is kept alive until the provisional load is
1469         committed in the new process.
1470
1471         * Shared/WebPolicyAction.h:
1472         Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
1473         process-swap, we now tell the previous process to simply ignore the load, while
1474         we create a ProvisionalPageProxy to do the new load in a new process.
1475         Suspension of the previous page in the old process, happens later, when a load
1476         is actually committed in the new process.
1477
1478         * Sources.txt:
1479         Add new ProvisionalPageProxy file.
1480
1481         * UIProcess/API/Cocoa/WKWebView.mm:
1482         (-[WKWebView _killWebContentProcessAndResetState]):
1483         When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
1484         process and the provisional one, to maintain previous behavior in our API tests.
1485
1486         * UIProcess/PageClient.h:
1487         Tiny build fix.
1488
1489         * UIProcess/ProvisionalPageProxy.cpp: Added.
1490         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1491         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
1492         (WebKit::ProvisionalPageProxy::takeDrawingArea):
1493         (WebKit::ProvisionalPageProxy::cancel):
1494         (WebKit::ProvisionalPageProxy::initializeWebPage):
1495         (WebKit::ProvisionalPageProxy::loadDataWithNavigation):
1496         (WebKit::ProvisionalPageProxy::loadRequestWithNavigation):
1497         (WebKit::ProvisionalPageProxy::goToBackForwardItem):
1498         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
1499         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
1500         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
1501         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
1502         (WebKit::ProvisionalPageProxy::didReceiveMessage):
1503         (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
1504         * UIProcess/ProvisionalPageProxy.h: Added.
1505         (WebKit::ProvisionalPageProxy::page):
1506         (WebKit::ProvisionalPageProxy::mainFrame const):
1507         (WebKit::ProvisionalPageProxy::process):
1508         (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
1509         (WebKit::ProvisionalPageProxy::navigationID const):
1510         Add new ProvisionalPageProxy class to wrap the provisional load in the new process
1511         after a swap. The provisional page is owned by the WebPageProxy and we only commit
1512         the provisional page when the load is committed. Until then, the WebPageProxy keeps
1513         using the old process and displaying the current content.
1514
1515         * UIProcess/SuspendedPageProxy.cpp:
1516         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1517         (WebKit::SuspendedPageProxy::unsuspend):
1518         (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
1519         Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
1520         when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
1521         which tries to register itself as an IPC message receiver for the same pageID when
1522         a process-swap occurs and we're switching to a suspended page.
1523
1524         * UIProcess/WebFrameProxy.cpp:
1525         (WebKit::WebFrameProxy::isMainFrame const):
1526         WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
1527         Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
1528         m_mainFrame to maintain previous behavior.
1529
1530         * UIProcess/WebPageProxy.cpp:
1531         (WebKit::WebPageProxy::swapToWebProcess):
1532         swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
1533         later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
1534         to initialize some data members such as the drawing area and the main frame as it is transferring them over from
1535         the ProvisionalPageProxy which started the provisional load.
1536
1537         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1538         We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
1539         committed in the provisional process.
1540
1541         (WebKit::WebPageProxy::initializeWebPage):
1542         - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
1543           committed in the provisional process.
1544         - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().
1545
1546         (WebKit::WebPageProxy::loadRequestWithNavigation):
1547         Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
1548         Yes. This avoids hitting some assertions as this was already called during the first API call if needed.
1549
1550         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1551         In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
1552         Suspension now happens later, only if we end up committing the provisional load in the new process.
1553         Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
1554         to happen a bit later but it is clearer if we do this as early as possible I think.
1555
1556         (WebKit::WebPageProxy::commitProvisionalPage):
1557         When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
1558         - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
1559         - Suspending the current page.
1560         - Letting the client know the load is comitted
1561         - Destroy the ProvisionalPageProxy.
1562         This work used to happen earlier in continueNavigationInNewProcess().
1563
1564         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1565         Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
1566         without actually having the WebPageProxy switch to the new process yet.
1567
1568         (WebKit::WebPageProxy::didCreateMainFrame):
1569         (WebKit::WebPageProxy::didCreateWindow):
1570         Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.
1571
1572         (WebKit::WebPageProxy::didDestroyNavigation):
1573         On process-swap, when telling the previous process to ignore the load and starting the new load in a new
1574         ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
1575         the call since the navigation is merely taken over by the ProvisionalPageProxy.
1576
1577         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1578         Moved some PSON logic to the ProvisionalPageProxy instead.
1579
1580         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1581         When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.
1582
1583         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
1584         (WebKit::WebPageProxy::decidePolicyForResponse):
1585         Capture the process in the lambda, to make sure we send the policy decision to the same process that
1586         asked for it, so as to not get confused by process swaps.
1587
1588         (WebKit::WebPageProxy::resetState):
1589         Drop some code that is no longer needed.
1590
1591         (WebKit::WebPageProxy::creationParameters):
1592         Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
1593         more than one call site. This was just some bad factoring.
1594
1595         (WebKit::WebPageProxy::PageProcessOverride::PageProcessOverride):
1596         (WebKit::WebPageProxy::PageProcessOverride::~PageProcessOverride):
1597         * UIProcess/WebPageProxy.h:
1598         (WebKit::WebPageProxy::temporarilyOverrideProcess):
1599         Add utility class to temporarily override the WebPageProxy's m_process with the provisional one when
1600         the ProvisionalPageProxy interacts with the WebPageProxy.
1601
1602         * UIProcess/WebProcessProxy.cpp:
1603         (WebKit::WebProcessProxy::hasProvisionalPageWithID const):
1604         (WebKit::WebProcessProxy::updateBackForwardItem):
1605         Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
1606         item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
1607         associated with this process yet, because it is still a ProvisionalPageProxy.
1608
1609         (WebKit::WebProcessProxy::canTerminateChildProcess):
1610         Do not terminate the WebProcess if there are ProvisionalPageProxy objects using it.
1611
1612         * UIProcess/WebProcessProxy.h:
1613         (WebKit::WebProcessProxy::addProvisionalPageProxy):
1614         (WebKit::WebProcessProxy::removeProvisionalPageProxy):
1615
1616         * WebKit.xcodeproj/project.pbxproj:
1617
1618         * WebProcess/WebPage/WebFrame.cpp:
1619         (WebKit::toPolicyAction):
1620         (WebKit::WebFrame::didReceivePolicyDecision):
1621         Stop dealing with WebPolicyAction::Suspend as it no longer exists.
1622
1623         * WebProcess/WebPage/WebPage.cpp:
1624         (WebKit::WebPage::reinitializeWebPage):
1625         (WebKit::WebPage::didReceivePolicyDecision):
1626
1627         (WebKit::WebPage::setIsSuspended):
1628         Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
1629         setIsSuspended(true) IPC is sent when we actually commit the provisional page.
1630
1631         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1632         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1633
1634 2019-01-15  Brian Burg  <bburg@apple.com>
1635
1636         WebDriver: update Create Window implementation to support newest specification
1637         https://bugs.webkit.org/show_bug.cgi?id=193333
1638         <rdar://problem/45649489>
1639
1640         Reviewed by Carlos Garcia Campos.
1641
1642         Spec link: https://w3c.github.io/webdriver/#create-window
1643
1644         The command as specified returns a value indicating whether the new browsing context
1645         was presented as a new tab or new window. Add a new delegate method to query the current
1646         'presentation' of the browsing context. The presentation can change over time due to
1647         things such as screen orientation, so the value that is returned by the command only
1648         reflects how the browsing context was initially presented to the user.
1649
1650         This is covered by existing WPT and internal tests. More will be added when Selenium
1651         exposes this command in its various bindings.
1652
1653         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1654         Add new SPI delegate method to query the 'presentation' (tab or window) for an automated WKWebView.
1655
1656         * UIProcess/API/APIAutomationSessionClient.h:
1657         (API::AutomationSessionClient::currentPresentationOfPage):
1658         * UIProcess/Cocoa/AutomationSessionClient.h:
1659         * UIProcess/Cocoa/AutomationSessionClient.mm:
1660         (WebKit::AutomationSessionClient::AutomationSessionClient):
1661         (WebKit::toImpl):
1662         (WebKit::AutomationSessionClient::currentPresentationOfPage):
1663         * UIProcess/Automation/WebAutomationSession.cpp:
1664         (WebKit::toProtocol):
1665         (WebKit::WebAutomationSession::createBrowsingContext):
1666         Add plumbing between ObjC delegate and C++.
1667
1668         * UIProcess/Automation/Automation.json:
1669         Include the initial presentation in the createBrowsingContext command result.
1670
1671 2019-01-14  Alex Christensen  <achristensen@webkit.org>
1672
1673         Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
1674         https://bugs.webkit.org/show_bug.cgi?id=193429
1675
1676         Reviewed by Joseph Pecoraro.
1677
1678         * NetworkProcess/cache/NetworkCache.cpp:
1679         (WebKit::NetworkCache::makeUseDecision):
1680         (WebKit::NetworkCache::Cache::retrieve):
1681         (WebKit::NetworkCache::Cache::makeEntry):
1682         (WebKit::NetworkCache::Cache::makeRedirectEntry):
1683         (WebKit::NetworkCache::Cache::update):
1684
1685 2019-01-14  Tim Horton  <timothy_horton@apple.com>
1686
1687         Fix a style mistake in PageClientImplMac
1688
1689         * UIProcess/mac/PageClientImplMac.h:
1690         Somehow these methods ended up above the members.
1691
1692 2019-01-14  Per Arne Vollan  <pvollan@apple.com>
1693
1694         [macOS] Remove reporting for mach lookups confirmed in-use
1695         https://bugs.webkit.org/show_bug.cgi?id=193415
1696         <rdar://problem/47266542>
1697
1698         Reviewed by Brent Fulgham.
1699
1700         Also, start denying the services which have not been confirmed to be in use.
1701
1702         * WebProcess/com.apple.WebProcess.sb.in:
1703
1704 2019-01-14  Commit Queue  <commit-queue@webkit.org>
1705
1706         Unreviewed, rolling out r239901, r239909, r239910, r239912,
1707         r239913, and r239914.
1708         https://bugs.webkit.org/show_bug.cgi?id=193407
1709
1710         These revisions caused an internal failure (Requested by
1711         Truitt on #webkit).
1712
1713         Reverted changesets:
1714
1715         "[Cocoa] Avoid importing directly from subumbrella frameworks"
1716         https://bugs.webkit.org/show_bug.cgi?id=186016
1717         https://trac.webkit.org/changeset/239901
1718
1719         "Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
1720         https://trac.webkit.org/changeset/239909
1721
1722         "Tried to fix the build."
1723         https://trac.webkit.org/changeset/239910
1724
1725         "Fixed iOS builds after r239910."
1726         https://trac.webkit.org/changeset/239912
1727
1728         "More build fixing."
1729         https://trac.webkit.org/changeset/239913
1730
1731         "Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
1732         https://trac.webkit.org/changeset/239914
1733
1734 2019-01-14  Mark Lam  <mark.lam@apple.com>
1735
1736         Re-enable ability to build --cloop builds.
1737         https://bugs.webkit.org/show_bug.cgi?id=192955
1738         <rdar://problem/46882363>
1739
1740         Reviewed by Saam barati and Keith Miller.
1741
1742         * Configurations/FeatureDefines.xcconfig:
1743
1744 2019-01-14  Alex Christensen  <achristensen@webkit.org>
1745
1746         Remove unused networking entitlement from iOS WebProcess entitlements
1747         https://bugs.webkit.org/show_bug.cgi?id=193267
1748
1749         Reviewed by Dean Jackson.
1750
1751         * Configurations/WebContent-iOS.entitlements:
1752         This gave access to VPN stuff.  It's not needed any more.
1753
1754 2019-01-14  Youenn Fablet  <youenn@apple.com>
1755
1756         Enable MDNS ICE candidate support by default
1757         https://bugs.webkit.org/show_bug.cgi?id=193358
1758
1759         Reviewed by Geoffrey Garen.
1760
1761         * Shared/WebPreferences.yaml:
1762
1763 2019-01-11  Matt Rajca  <mrajca@apple.com>
1764
1765         Expose preference for site-specific quirks on iOS
1766         https://bugs.webkit.org/show_bug.cgi?id=193353
1767
1768         Reviewed by Dean Jackson.
1769
1770         * UIProcess/API/Cocoa/WKPreferences.mm:
1771         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
1772         (-[WKPreferences _needsSiteSpecificQuirks]):
1773         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1774
1775 2019-01-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1776
1777         [iOS] Expose SPI to access the current sentence boundary and selection state
1778         https://bugs.webkit.org/show_bug.cgi?id=193398
1779         <rdar://problem/45893108>
1780
1781         Reviewed by Dean Jackson.
1782
1783         Expose SPI on WKWebView for internal clients to grab information about attributes at the current selection; so
1784         far, this only includes whether the selection is a caret or a range, and whether or not the start of the
1785         selection is at the start of a new sentence.
1786
1787         Test: EditorStateTests.ObserveSelectionAttributeChanges
1788
1789         * Shared/EditorState.cpp:
1790         (WebKit::EditorState::PostLayoutData::encode const):
1791         (WebKit::EditorState::PostLayoutData::decode):
1792         * Shared/EditorState.h:
1793
1794         Add a new bit in EditorState on iOS to compute whether or not the start of the selection is at the start of a
1795         new sentence. This is computed and set when sending post-layout data in `WebPageIOS.mm`.
1796
1797         * UIProcess/API/Cocoa/WKWebView.mm:
1798         (selectionAttributes):
1799         (-[WKWebView _didChangeEditorState]):
1800         (-[WKWebView _selectionAttributes]):
1801
1802         Make the new SPI property support KVO by invoking `-willChangeValueForKey:` and `-didChangeValueForKey:`
1803         whenever the selection attributes change.
1804
1805         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1806         * WebProcess/WebPage/ios/WebPageIOS.mm:
1807         (WebKit::WebPage::platformEditorState const):
1808
1809 2019-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1810
1811         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.3 release
1812
1813         * gtk/NEWS: Add release notes for 2.23.3.
1814
1815 2019-01-13  Dan Bernstein  <mitz@apple.com>
1816
1817         Fixed iOS builds after r239910.
1818
1819         * Platform/spi/ios/PDFKitSPI.h:
1820
1821 2019-01-13  Dan Bernstein  <mitz@apple.com>
1822
1823         Tried to fix the build.
1824
1825         * Platform/spi/ios/PDFKitSPI.h:
1826
1827 2019-01-13  Dan Bernstein  <mitz@apple.com>
1828
1829         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
1830
1831         Patch by Keith Rollin.
1832
1833         * Platform/IPC/mac/ConnectionMac.mm:
1834         * Shared/mac/ChildProcessMac.mm:
1835         (WebKit::ChildProcess::launchServicesCheckIn):
1836
1837 2019-01-12  Timothy Hatcher  <timothy@apple.com>
1838
1839         Have prefers-color-scheme: light always match on macOS versions before Mojave.
1840         https://bugs.webkit.org/show_bug.cgi?id=191655
1841         rdar://problem/46074680
1842
1843         Reviewed by Megan Gardner.
1844
1845         * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
1846         * UIProcess/Cocoa/WebViewImpl.mm:
1847         (WebKit::WebViewImpl::effectiveAppearanceIsDark):
1848         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
1849
1850 2019-01-12  Dan Bernstein  <mitz@apple.com>
1851
1852         [Cocoa] Avoid importing directly from subumbrella frameworks
1853         https://bugs.webkit.org/show_bug.cgi?id=186016
1854         <rdar://problem/40591038>
1855
1856         Reviewed by Sam Weinig.
1857
1858         * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
1859           OTHER_CPLUSPLUSFLAGS.
1860         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
1861           HIToolbox header.
1862         * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
1863         * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
1864         * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
1865           header.
1866         * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
1867           PDFKit header.
1868         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
1869         * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
1870         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
1871         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
1872         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
1873         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
1874         * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.
1875
1876 2019-01-11  Ryosuke Niwa  <rniwa@webkit.org>
1877
1878         Enable visual viewport API by default
1879         https://bugs.webkit.org/show_bug.cgi?id=193376
1880
1881         Reviewed by Simon Fraser.
1882
1883         Enable this feature by default since the remaining issue on iOS is mostly about test failures,
1884         not an issue with the core functionality of the API.
1885
1886         * Shared/WebPreferences.yaml:
1887
1888 2019-01-11  Brent Fulgham  <bfulgham@apple.com>
1889
1890         Allow WebContent process access to some drawing-related IOKit properties
1891         https://bugs.webkit.org/show_bug.cgi?id=193086
1892         <rdar://problem/46568088>
1893
1894         Reviewed by Eric Carlson.
1895
1896         Add one missing IOKit property, and revise the regexp used for another.
1897
1898         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1899
1900 2019-01-11  John Wilander  <wilander@apple.com>
1901
1902         Compile out Web API Statistics Collection
1903         https://bugs.webkit.org/show_bug.cgi?id=193370
1904         <rdar://problem/45388584>
1905
1906         Reviewed by Brent Fulgham.
1907
1908         * Configurations/FeatureDefines.xcconfig:
1909             Defined ENABLE_WEB_API_STATISTICS, off by default.
1910         * Shared/WebCoreArgumentCoders.cpp:
1911         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1912             Skipped encoding of web API statistics.
1913         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1914             Skipped decoding of web API statistics.
1915
1916 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
1917
1918         IndexedDB: leak WebIDBConnectionToClient for retain cycle
1919         https://bugs.webkit.org/show_bug.cgi?id=193097
1920         <rdar://problem/46899601>
1921
1922         Reviewed by Brady Eidson.
1923
1924         Let WebIDBConnectionToClient hold reference to IPC::Connection instead of NetworkConnectionToWebProcess to break
1925         the cycle.
1926
1927         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1928         (WebKit::WebIDBConnectionToClient::create):
1929         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1930         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
1931         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
1932         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1933         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
1934
1935 2019-01-11  Sihui Liu  <sihui_liu@apple.com>
1936
1937         Make "Disable Web SQL" on by default
1938         https://bugs.webkit.org/show_bug.cgi?id=193354
1939         <rdar://problem/46524584>
1940
1941         Reviewed by Geoffrey Garen.
1942
1943         * Shared/WebPreferences.yaml:
1944
1945 2019-01-11  Devin Rousso  <drousso@apple.com>
1946
1947         Fix style CFNetworkSPI style checker warnings from r239698
1948         https://bugs.webkit.org/show_bug.cgi?id=193369
1949
1950         Reviewed by Joseph Pecoraro.
1951
1952         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1953         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1954
1955 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1956
1957         [iOS] Precision drop state thrashes when dragging near the top edge of an editable element
1958         https://bugs.webkit.org/show_bug.cgi?id=193364
1959         <rdar://problem/47214117>
1960
1961         Reviewed by Tim Horton.
1962
1963         On iOS, marking a UIDropProposal as precise offsets the hit-testing location of the drop by a small distance
1964         either upwards or downwards from the actual location of the user's finger. When dragging over an editable
1965         element, WebKit currently marks the drop proposal as precise; however, when dragging over the top edge of an
1966         editable element, what happens is that the hit-testing location is offset to a location outside of the editable
1967         element, which causes us to turn off precision drop mode; subsequently, turning off precision drop mode removes
1968         the offset, which causes us to hit-test within the editable element once again and re-enable precision mode, and
1969         the cycle continues.
1970
1971         In order to mitigate this, bail out of precision drop mode when dragging near the top or bottom edges of the
1972         highest editable root that contains the current drop caret position (or, if the drop caret is inside of a text
1973         form control, use the form control as the editable element instead).
1974
1975         * UIProcess/WebPageProxy.cpp:
1976         (WebKit::WebPageProxy::didPerformDragControllerAction):
1977         * UIProcess/WebPageProxy.h:
1978         (WebKit::WebPageProxy::currentDragCaretEditableElementRect const):
1979         * UIProcess/WebPageProxy.messages.in:
1980         * UIProcess/ios/WKContentViewInteraction.mm:
1981         (-[WKContentView dropInteraction:sessionDidUpdate:]):
1982
1983         Avoid precise mode when we're less than 25pt away from the top and bottom edge of the editable element rect.
1984         Since the drag location offset amount is a fixed offset in window coordinates, we first convert this minimum
1985         distance to the content view's coordinate space by dividing by the content scale factor.
1986
1987         * WebProcess/WebPage/WebPage.cpp:
1988         (WebKit::WebPage::performDragControllerAction):
1989
1990 2019-01-11  Tim Horton  <timothy_horton@apple.com>
1991
1992         REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
1993         https://bugs.webkit.org/show_bug.cgi?id=193366
1994         <rdar://problem/46097212>
1995
1996         Reviewed by Simon Fraser.
1997
1998         A pair of unrelated changes broke Firefox's use of WKWebView internals
1999         to override the long-press menu. Maintain binary compatibility by
2000         introducing linked-on-or-after checks.
2001
2002         * UIProcess/Cocoa/VersionChecks.h:
2003         * UIProcess/WebProcessPool.cpp:
2004         (WebKit::WebProcessPool::createWebPage):
2005         Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
2006         Because gestures are very stateful, we always swap them out when swapping
2007         processes (changing that behavior is fairly risky). Also, we don't always
2008         inform the client when we swap processes (only when the process actually crashes),
2009         so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.
2010
2011         * UIProcess/ios/WKContentView.mm:
2012         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2013         Synchronously install gesture recognizers under -init when linked against
2014         an SDK before the version that introduces lazy gesture recognizer installation.
2015         r237331 is an optimization that made us lazily install gestures when the
2016         view is parented, but Firefox (and potentially other clients) depend
2017         on them being installed synchronously in order to find and override them.
2018
2019 2019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2020
2021         Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
2022         https://bugs.webkit.org/show_bug.cgi?id=193109
2023         <rdar://problem/44807048>
2024
2025         Reviewed by Ryosuke Niwa.
2026
2027         Add a new SPI configuration flag to enable the UndoManager API. This is off by default.
2028
2029         * Shared/WebPreferences.yaml:
2030         * UIProcess/API/Cocoa/WKWebView.mm:
2031         (-[WKWebView _initializeWithConfiguration:]):
2032         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2033         (-[WKWebViewConfiguration init]):
2034         (-[WKWebViewConfiguration copyWithZone:]):
2035         (-[WKWebViewConfiguration _setUndoManagerAPIEnabled:]):
2036         (-[WKWebViewConfiguration _undoManagerAPIEnabled]):
2037         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2038
2039 2019-01-10  Jiewen Tan  <jiewen_tan@apple.com>
2040
2041         [WebAuthN] Change the nonce in the CTAP kInit command to weak random values
2042         https://bugs.webkit.org/show_bug.cgi?id=192061
2043         <rdar://problem/46471091>
2044
2045         Reviewed by Chris Dumez.
2046
2047         Change the nonce in the CTAP kInit command to weak random values as the nonce is mainly
2048         for being a probabilistically unique global identifier for hand shakes, instead of
2049         preventing replay attacks. Otherwise, it might exhaust system entropy unnecessarily.
2050
2051         The patch also removes all logging when debugging the test case flakiness.
2052
2053         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
2054         (WebKit::AuthenticatorManager::respondReceived):
2055         (WebKit::AuthenticatorManager::initTimeOutTimer):
2056         (WebKit::AuthenticatorManager::timeOutTimerFired):
2057         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2058         (WebKit::HidService::deviceAdded):
2059         * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
2060         (WebKit::MockAuthenticatorManager::respondReceivedInternal):
2061         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2062         (WebKit::MockHidConnection::send):
2063         * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
2064         (WebKit::CtapHidAuthenticator::makeCredential):
2065         (WebKit::CtapHidAuthenticator::getAssertion):
2066         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
2067         (WebKit::CtapHidDriver::Worker::write):
2068         (WebKit::CtapHidDriver::Worker::read):
2069         (WebKit::CtapHidDriver::Worker::returnMessage):
2070         (WebKit::CtapHidDriver::transact):
2071         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
2072         (WebKit::CtapHidDriver::continueAfterResponseReceived):
2073
2074 2019-01-10  Timothy Hatcher  <timothy@apple.com>
2075
2076         Add WKBundlePage SPI to temporarily force light or dark appearance on a page.
2077         https://bugs.webkit.org/show_bug.cgi?id=193327
2078         rdar://problem/47093222
2079
2080         Reviewed by Tim Horton.
2081
2082         Tests: WebKit.ForceLightAppearanceInBundle API Test
2083
2084         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2085         (WKBundlePageSetUseDarkAppearance): Added.
2086         (WKBundlePageIsUsingDarkAppearance): Added.
2087         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
2088
2089 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
2090
2091         DeviceID hash salt manager can be NULL
2092         https://bugs.webkit.org/show_bug.cgi?id=193334
2093         <rdar://problem/47179650>
2094
2095         Reviewed by Youenn Fablet.
2096
2097         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2098         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): No need to
2099         NULL-check websiteDataStore.deviceIdHashSaltStorage, it is a Ref.
2100         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
2101         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
2102         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
2103
2104         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2105         (WebKit::WebsiteDataStore::WebsiteDataStore): m_deviceIdHashSaltStorage is a Ref.
2106         (WebKit::WebsiteDataStore::fetchDataAndApply): Ditto.
2107         (WebKit::WebsiteDataStore::removeData): Ditto.
2108         * UIProcess/WebsiteData/WebsiteDataStore.h:
2109         (WebKit::WebsiteDataStore::deviceIdHashSaltStorage): Ditto.
2110
2111 2019-01-10  Per Arne Vollan  <pvollan@apple.com>
2112
2113         [macOS] Add name of IORegistry key in sandbox.
2114         https://bugs.webkit.org/show_bug.cgi?id=193335
2115         <rdar://problem/47184951>
2116
2117         Reviewed by Alexey Proskuryakov.
2118
2119         The property IOGVAHEVCDecodeCapabilities was added in https://bugs.webkit.org/show_bug.cgi?id=193324.
2120         Also, the property IOGVAHEVCEncodeCapabilities needs to be added.
2121
2122         * WebProcess/com.apple.WebProcess.sb.in:
2123
2124 2019-01-10  Zalan Bujtas  <zalan@apple.com>
2125
2126         REGRESSION (r237658): Tap highlight limits cause the highlight to no longer show with legitimate button sizes
2127         https://bugs.webkit.org/show_bug.cgi?id=193294
2128         <rdar://problem/46006678>
2129
2130         Reviewed by Simon Fraser.
2131
2132         Input type elements should always paint tap highlight (ignore size heuristic). 
2133
2134         * UIProcess/PageClient.h:
2135         * UIProcess/WebPageProxy.h:
2136         * UIProcess/WebPageProxy.messages.in:
2137         * UIProcess/ios/PageClientImplIOS.h:
2138         * UIProcess/ios/PageClientImplIOS.mm:
2139         (WebKit::PageClientImpl::didGetTapHighlightGeometries):
2140         * UIProcess/ios/WKContentViewInteraction.h:
2141         * UIProcess/ios/WKContentViewInteraction.mm:
2142         (-[WKContentView _showTapHighlight]):
2143         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
2144         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
2145         * UIProcess/ios/WebPageProxyIOS.mm:
2146         (WebKit::WebPageProxy::didGetTapHighlightGeometries):
2147         * WebProcess/WebPage/ios/WebPageIOS.mm:
2148         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
2149
2150 2019-01-10  Alexey Proskuryakov  <ap@apple.com>
2151
2152         Remove unneeded XPCService variant for plugin service
2153         https://bugs.webkit.org/show_bug.cgi?id=193326
2154
2155         Reviewed by Tim Horton.
2156
2157         * Configurations/PluginService.32.xcconfig: Removed.
2158         * Configurations/PluginService.64.xcconfig:
2159         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Removed.
2160         * PluginProcess/EntryPoint/mac/XPCService/PluginService.64.Info.plist: Copied from Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist.
2161         * WebKit.xcodeproj/project.pbxproj:
2162
2163 2019-01-10  Eric Carlson  <eric.carlson@apple.com>
2164
2165         Define page media state flags for display capture.
2166         https://bugs.webkit.org/show_bug.cgi?id=193230
2167         <rdar://problem/47095142>
2168
2169         Reviewed by Youenn Fablet.
2170
2171         * UIProcess/API/C/WKPage.cpp:
2172         (WKPageGetMediaState):
2173         * UIProcess/API/C/WKPagePrivate.h:
2174         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2175         (WebKit::UserMediaCaptureManager::Source::Source):
2176         (WebKit::UserMediaCaptureManager::createCaptureSource):
2177
2178 2019-01-10  Alex Christensen  <achristensen@webkit.org>
2179
2180         REGRESSION(r239815) http/tests/workers/service/serviceworker-private-browsing.https.html test times out
2181         https://bugs.webkit.org/show_bug.cgi?id=193325
2182
2183         Reviewed by Joseph Pecoraro.
2184
2185         InjectedBundle::setPrivateBrowsingEnabled effectively didn't do anything when enabled was false.
2186         I made it destroy the legacy private browsing session in the NetworkProcess, which caused a test to time out.
2187         This functionality is only used for testing, so it's no big deal to revert that part of the patch.
2188
2189         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2190         (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession): Deleted.
2191         * NetworkProcess/NetworkConnectionToWebProcess.h:
2192         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2193         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2194         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2195         * WebProcess/WebProcess.cpp:
2196         (WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
2197         * WebProcess/WebProcess.h:
2198
2199 2019-01-10  Per Arne Vollan  <pvollan@apple.com>
2200
2201         [macOS] Add name of IORegistry key in sandbox.
2202         https://bugs.webkit.org/show_bug.cgi?id=193324
2203
2204         Reviewed by Brent Fulgham.
2205
2206         IOGVAVTCapabilities key has been changed to IOGVAHEVCDecodeCapabilities.
2207
2208         * WebProcess/com.apple.WebProcess.sb.in:
2209
2210 2019-01-10  John Wilander  <wilander@apple.com>
2211
2212         Override the session configuration for cookieAcceptPolicy
2213         https://bugs.webkit.org/show_bug.cgi?id=190925
2214         <rdar://problem/45497382>
2215
2216         Reviewed by Alexey Proskuryakov and Alex Christensen.
2217
2218         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2219         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2220             Now sets cookieStorage._overrideSessionCookieAcceptPolicy to YES.
2221
2222 2019-01-09  Matt Rajca  <mrajca@apple.com>
2223
2224         Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
2225         https://bugs.webkit.org/show_bug.cgi?id=193301
2226
2227         Reviewed by Jer Noble.
2228
2229         Register a new quirk that can be configured per-load for per-document media
2230         autoplay behaviors.
2231
2232         * Shared/WebsiteAutoplayQuirk.h:
2233         * Shared/WebsitePoliciesData.cpp:
2234         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2235         * UIProcess/API/C/WKWebsitePolicies.cpp:
2236         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
2237         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
2238         * UIProcess/API/C/WKWebsitePolicies.h:
2239         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2240         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2241         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
2242         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
2243
2244 2019-01-10  Tim Horton  <timothy_horton@apple.com>
2245
2246         Rename some entitlements files to be more clear about their target platform
2247         https://bugs.webkit.org/show_bug.cgi?id=193311
2248
2249         Reviewed by Alexey Proskuryakov.
2250
2251         * Configurations/Network-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/Network-iOS-minimalsimulator.entitlements.
2252         * Configurations/NetworkService.xcconfig:
2253         * Configurations/WebContent-iOSMac.entitlements: Renamed from Source/WebKit/Configurations/WebContent-iOS-minimalsimulator.entitlements.
2254         * Configurations/WebContentService.xcconfig:
2255         * WebKit.xcodeproj/project.pbxproj:
2256
2257 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
2258
2259         Unreviewed build fix after r239816.
2260
2261         Although EWS had no problem with the patch, I'm seeing build errors on the actual bots.
2262         This patch corrects the problem.
2263
2264         * NetworkProcess/NetworkProcess.cpp:
2265         (WebKit::NetworkProcess::logFrameNavigation):
2266         (WebKit::NetworkProcess::logUserInteraction):
2267
2268 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
2269
2270         Create a WebResourceLoadStatisticsStore attached to the NetworkSession
2271         https://bugs.webkit.org/show_bug.cgi?id=193261
2272         <rdar://problem/47158616>
2273
2274         Reviewed by Alex Christensen.
2275
2276         This patch modifies NetworkSession so that it owns a WebResourceLoadStatisticsStore
2277         object. This object is only created if the ResourceLoadStatistics feature is turned on.
2278
2279         The patch also modifies WebResourceLoadStatisticsStore so that it can be constructed
2280         with an owning NetworkSession as an alternative to the current practice of using a
2281         WebsiteDataStore object.
2282
2283         Two initial messages from the WebContent process are added (logFrameNavigation and
2284         logUserNavigation) that notify the network process of these actions. Currently they
2285         are called in addition the calls to the WebsiteDataStore object. These redundant calls
2286         will be removed in a future patch.
2287
2288         This patch forces the ResourceLoadStatistics code in the NetworkSession to be off by
2289         default, so there should be no change in behavior with this patch.
2290
2291         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2292         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap):
2293         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2294         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2295         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
2296         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
2297         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2298         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2299         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2300         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
2301         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2302         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCapForPrevalentResources):
2303         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
2304         (WebKit::WebResourceLoadStatisticsStore::updatePrevalentDomainsToBlockCookiesFor):
2305         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
2306         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
2307         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
2308         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2309         * NetworkProcess/NetworkProcess.cpp:
2310         (WebKit::NetworkProcess::initializeNetworkProcess):
2311         (WebKit::NetworkProcess::logFrameNavigation):
2312         (WebKit::NetworkProcess::logUserInteraction):
2313         * NetworkProcess/NetworkProcess.h:
2314         * NetworkProcess/NetworkProcess.messages.in:
2315         * NetworkProcess/NetworkSession.cpp:
2316         (WebKit::NetworkSession::enableResourceLoadStatistics):
2317         * NetworkProcess/NetworkSession.h:
2318         (WebKit::NetworkSession::resourceLoadStatistics const):
2319         * NetworkProcess/NetworkSessionCreationParameters.cpp:
2320         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2321         (WebKit::NetworkSessionCreationParameters::encode const):
2322         (WebKit::NetworkSessionCreationParameters::decode):
2323         * NetworkProcess/NetworkSessionCreationParameters.h:
2324         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2325         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2326         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2327         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2328         * UIProcess/Network/NetworkProcessProxy.cpp:
2329         (WebKit::NetworkProcessProxy::didLogUserInteraction):
2330         * UIProcess/Network/NetworkProcessProxy.h:
2331         * UIProcess/Network/NetworkProcessProxy.messages.in:
2332         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2333         (WebsiteDataStore::parameters):
2334         * UIProcess/WebPageProxy.cpp:
2335         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2336         (WebKit::WebPageProxy::logFrameNavigation):
2337         * UIProcess/WebPageProxy.h:
2338         * UIProcess/WebProcessPool.cpp:
2339         (WebKit::WebProcessPool::ensureNetworkProcess):
2340         (WebKit::WebProcessPool::initializeNewWebProcess):
2341
2342 2019-01-09  Alex Christensen  <achristensen@webkit.org>
2343
2344         Replace SessionTracker with HashMap member of NetworkProcess
2345         https://bugs.webkit.org/show_bug.cgi?id=193266
2346
2347         Reviewed by Joseph Pecoraro.
2348
2349         * NetworkProcess/Downloads/DownloadManager.cpp:
2350         (WebKit::DownloadManager::startDownload):
2351         * NetworkProcess/Downloads/DownloadManager.h:
2352         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2353         (WebKit::Download::resume):
2354         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2355         (WebKit::NetworkCORSPreflightChecker::startPreflight):
2356         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2357         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2358         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
2359         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
2360         (WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession):
2361         * NetworkProcess/NetworkConnectionToWebProcess.h:
2362         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2363         * NetworkProcess/NetworkProcess.cpp:
2364         (WebKit::NetworkProcess::initializeNetworkProcess):
2365         (WebKit::NetworkProcess::clearCachedCredentials):
2366         (WebKit::NetworkProcess::networkSession):
2367         (WebKit::NetworkProcess::setSession):
2368         (WebKit::NetworkProcess::destroySession):
2369         (WebKit::NetworkProcess::preconnectTo):
2370         * NetworkProcess/NetworkProcess.h:
2371         * NetworkProcess/NetworkResourceLoader.cpp:
2372         (WebKit::NetworkResourceLoader::startNetworkLoad):
2373         (WebKit::NetworkResourceLoader::didFinishLoading):
2374         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
2375         (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
2376         (WebKit::NetworkResourceLoader::logCookieInformation const):
2377         (WebKit::logBlockedCookieInformation):
2378         (WebKit::logCookieInformationInternal):
2379         (WebKit::NetworkResourceLoader::logCookieInformation):
2380         * NetworkProcess/NetworkResourceLoader.h:
2381         * NetworkProcess/PingLoad.cpp:
2382         (WebKit::PingLoad::loadRequest):
2383         * NetworkProcess/PingLoad.h:
2384         * NetworkProcess/PreconnectTask.cpp:
2385         (WebKit::PreconnectTask::PreconnectTask):
2386         * NetworkProcess/PreconnectTask.h:
2387         * NetworkProcess/RemoteNetworkingContext.h:
2388         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2389         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2390         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2391         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2392         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2393         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2394         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2395         * Shared/SessionTracker.cpp: Removed.
2396         * Shared/SessionTracker.h: Removed.
2397         * Sources.txt:
2398         * WebKit.xcodeproj/project.pbxproj:
2399         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2400         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2401         * WebProcess/Network/WebLoaderStrategy.cpp:
2402         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2403         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2404         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2405         * WebProcess/WebPage/WebPage.cpp:
2406         * WebProcess/WebProcess.cpp:
2407         (WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess):
2408         * WebProcess/WebProcess.h:
2409         * WebProcess/cocoa/WebProcessCocoa.mm:
2410
2411 2019-01-09  Alex Christensen  <achristensen@webkit.org>
2412
2413         Expand use of sourceApplicationAuditData
2414         https://bugs.webkit.org/show_bug.cgi?id=192995
2415         <rdar://problem/46627875>
2416
2417         Reviewed by Brady Eidson.
2418
2419         sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms.
2420         I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer.
2421         The NetworkProcess needed an additional entitlement on Mac to continue to load anything, which is desirable.
2422
2423         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2424         (WebKit::NetworkProcess::sourceApplicationAuditData const):
2425         * Platform/IPC/Connection.h:
2426         * Platform/IPC/mac/ConnectionMac.mm:
2427         (IPC::Connection::getAuditToken):
2428         * WebProcess/WebProcess.cpp:
2429         (WebKit::WebProcess::initializeWebProcess):
2430         * WebProcess/cocoa/WebProcessCocoa.mm:
2431         (WebKit::WebProcess::sourceApplicationAuditData const):
2432
2433 2019-01-09  Brent Fulgham  <bfulgham@apple.com>
2434
2435         [iOS] Update sandbox profile to use iconservices instead of lsdiconservice
2436         https://bugs.webkit.org/show_bug.cgi?id=193115
2437         <rdar://problem/44867379>
2438
2439         Reviewed by Eric Carlson.
2440
2441         Add access to the 'com.apple.iconservices' endpoint. We will remove access to
2442         the older name ('com.apple.lsdiconservices') once existing clients have completed
2443         the switch.
2444
2445         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2446
2447 2019-01-09  Antti Koivisto  <antti@apple.com>
2448
2449         [PSON] Flash of blank content while transitioning from page A to page B.
2450         https://bugs.webkit.org/show_bug.cgi?id=193283
2451
2452         Reviewed by Chris Dumez.
2453
2454         Layer tree is not frozen during WebPage construction. If the flush timer (started for the initial
2455         empty document) manages to run before the actual page load starts, we'll get a flash.
2456
2457         * Shared/WebPageCreationParameters.cpp:
2458         (WebKit::WebPageCreationParameters::encode const):
2459         (WebKit::WebPageCreationParameters::decode):
2460         * Shared/WebPageCreationParameters.h:
2461
2462         Rename shouldDelayAttachingDrawingArea bit to isSwapFromSuspended and make it available on all platforms.
2463
2464         * UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Removed.
2465         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Removed.
2466         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Removed.
2467         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Removed.
2468         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Removed.
2469         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Removed.
2470         * UIProcess/WebPageProxy.cpp:
2471         (WebKit::WebPageProxy::swapToWebProcess):
2472         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2473         (WebKit::WebPageProxy::initializeWebPage):
2474         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2475         * UIProcess/WebPageProxy.h:
2476         * WebProcess/WebPage/WebPage.cpp:
2477         (WebKit::m_shouldAttachDrawingAreaOnPageTransition):
2478
2479         Freeze the layer tree in WebPage constructor if this is a swap from a suspended process.
2480
2481         (WebKit::WebPage::reinitializeWebPage):
2482         (WebKit::WebPage::didCompletePageTransition):
2483
2484         Unfreeze on first non-initial empty document page transition.
2485
2486         * WebProcess/WebPage/WebPage.h:
2487         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2488         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2489
2490 2019-01-09  Chris Dumez  <cdumez@apple.com>
2491
2492         WebKit Networking process crashes if the HTTPSUpgradeList is not found in the bundle
2493         https://bugs.webkit.org/show_bug.cgi?id=193285
2494         <rdar://problem/47147610>
2495
2496         Reviewed by Geoffrey Garen.
2497
2498         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
2499         (WebKit::networkHTTPSUpgradeCheckerDatabasePath):
2500         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
2501
2502 2019-01-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2503
2504         [GTK] Add missing autocleanups
2505         https://bugs.webkit.org/show_bug.cgi?id=193068
2506
2507         Reviewed by Carlos Garcia Campos.
2508
2509         * UIProcess/API/gtk/WebKitAutocleanups.h:
2510
2511 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2512
2513         Fix CompletionHandler assertions introduced today.
2514         https://bugs.webkit.org/show_bug.cgi?id=193237
2515
2516         This reverts part of r239710 and all of r239725, r239738, and r239748 which unsuccessfully tried to fix all the assertions.
2517         This code is a mess that will have to be cleaned up later.
2518
2519         * NetworkProcess/NetworkResourceLoader.cpp:
2520         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
2521         * NetworkProcess/cache/CacheStorageEngine.cpp:
2522         (WebKit::CacheStorage::Engine::from):
2523         * NetworkProcess/cache/CacheStorageEngine.h:
2524         * NetworkProcess/cache/NetworkCache.cpp:
2525         (WebKit::NetworkCache::Cache::store):
2526         (WebKit::NetworkCache::Cache::remove):
2527         (WebKit::NetworkCache::Cache::traverse):
2528         (WebKit::NetworkCache::Cache::clear):
2529         (WebKit::NetworkCache::Cache::retrieveData):
2530         * NetworkProcess/cache/NetworkCache.h:
2531         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2532         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
2533         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2534         (WebKit::NetworkCache::Storage::store):
2535         (WebKit::NetworkCache::Storage::WriteOperation::~WriteOperation): Deleted.
2536         * NetworkProcess/cache/NetworkCacheStorage.h:
2537         (WebKit::NetworkCache::Storage::store):
2538
2539 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
2540
2541         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
2542         https://bugs.webkit.org/show_bug.cgi?id=192061
2543
2544         Reviewed by Dewei Zhu.
2545
2546         Part 6.
2547
2548         Add some additional temporary logging info to determine if data is actually sent.
2549         Once the bug is determined and fixed, we should remove all logging added in this patch.
2550
2551         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2552         (WebKit::MockHidConnection::send):
2553
2554 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
2555
2556         [WebAuthN] Support U2F HID Authenticators on macOS
2557         https://bugs.webkit.org/show_bug.cgi?id=191535
2558         <rdar://problem/47102027>
2559
2560         Reviewed by Brent Fulgham.
2561
2562         This patch implements the support for U2F authenticators, and enables it for hid devices.
2563         It follows the CTAP spec to map WebAuthN requests to U2F commands and return the responses:
2564         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
2565         Most of the parts are done before this patch, this patch focues on: 7.2.2 and 7.3.2.
2566
2567         Besides implementing the U2fHidAuthenticator, this patch also adds support in the mocking
2568         environment for U2F authenticators. It is done by extending the stages in MockHidConnection
2569         from 4 to indefinite as multi-round communications are expected to map WebAuthN requests
2570         to U2F requests.
2571
2572         * Sources.txt:
2573         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2574         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
2575         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
2576         (WebKit::HidService::continueAddDeviceAfterGetInfo):
2577         * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
2578         (WebKit::CtapHidDriver::continueAfterChannelAllocated):
2579         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
2580         (WebKit::CtapHidDriver::setProtocol):
2581         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp: Added.
2582         (WebKit::U2fHidAuthenticator::U2fHidAuthenticator):
2583         (WebKit::U2fHidAuthenticator::makeCredential):
2584         (WebKit::U2fHidAuthenticator::checkExcludeList):
2585         (WebKit::U2fHidAuthenticator::issueRegisterCommand):
2586         (WebKit::U2fHidAuthenticator::getAssertion):
2587         (WebKit::U2fHidAuthenticator::issueSignCommand):
2588         (WebKit::U2fHidAuthenticator::issueNewCommand):
2589         (WebKit::U2fHidAuthenticator::issueCommand):
2590         (WebKit::U2fHidAuthenticator::responseReceived):
2591         (WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived):
2592         (WebKit::U2fHidAuthenticator::continueCheckOnlyCommandAfterResponseReceived):
2593         (WebKit::U2fHidAuthenticator::continueBogusCommandAfterResponseReceived):
2594         (WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
2595         * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h: Added.
2596         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2597         (WebKit::MockHidConnection::parseRequest):
2598         (WebKit::MockHidConnection::feedReports):
2599         * UIProcess/WebAuthentication/Mock/MockHidConnection.h:
2600         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
2601         * WebKit.xcodeproj/project.pbxproj:
2602
2603 2019-01-08  Youenn Fablet  <youenn@apple.com>
2604
2605         service worker fetch handler results in bad referrer
2606         https://bugs.webkit.org/show_bug.cgi?id=188248
2607         <rdar://problem/47050478>
2608
2609         Reviewed by Alex Christensen.
2610
2611         NetworkDataTaskCocoa is sometimes updating the referrer on its own.
2612         Instead of updating the referrer when sending the request to WebProcess for evaluation,
2613         Update the referrer once the web process decides to follow the redirection.
2614         This ensures that any referrer that the WebProcess will set will be updated by NetworkDataTaskCocoa.
2615
2616         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2617         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2618         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2619         (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
2620         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2621
2622 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2623
2624         Fix more assertions after r239710
2625         https://bugs.webkit.org/show_bug.cgi?id=193237
2626
2627         * NetworkProcess/cache/NetworkCacheStorage.h:
2628         (WebKit::NetworkCache::Storage::store):
2629         Make default parameter an empty lambda instead of a null CompletionHandler.
2630         This way it can be called once instead of thinking it has already been called.
2631
2632 2019-01-08  Brent Fulgham  <bfulgham@apple.com>
2633
2634         Move ResourceLoadStatistics files from UIProcess to NetworkProcess
2635         https://bugs.webkit.org/show_bug.cgi?id=193252
2636         <rdar://problem/47125401>
2637
2638         Reviewed by Alex Christensen.
2639
2640         This patch is the first part of a refactoring to move the ResourceLoadStatistics logic from the UIProcess to the NetworkProcess.
2641
2642         This patch moves code into different folders and adjusts necessary build files, but does not change where the code executes. These
2643         changes have no impact on behavior or test results.
2644
2645         I also modified a few files to add missing include files uncovered by the unified build system.
2646
2647         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp.
2648         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h.
2649         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp.
2650         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h: Renamed from Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.h.
2651         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp.
2652         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h.
2653         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.cpp.
2654         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h: Renamed from Source/WebKit/UIProcess/WebResourceLoadStatisticsTelemetry.h.
2655         * NetworkProcess/Downloads/PendingDownload.cpp:
2656         * NetworkProcess/Downloads/PendingDownload.h:
2657         * CMakeLists.txt:
2658         * PlatformMac.cmake:
2659         * PlatformWin.cmake:
2660         * Shared/PersistencyUtils.cpp: Renamed from Source/WebKit/UIProcess/PersistencyUtils.cpp.
2661         * Shared/PersistencyUtils.h: Renamed from Source/WebKit/UIProcess/PersistencyUtils.h.
2662         * Sources.txt:
2663         * SourcesCocoa.txt:
2664         * SourcesGTK.txt:
2665         * SourcesWPE.txt:
2666         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2667         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): Add missing WebKit:: scope.
2668         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Add missing include.
2669         * UIProcess/WebDataListSuggestionsDropdown.cpp: Ditto.
2670         * UIProcess/mac/DisplayLink.cpp:
2671         * UnifiedSources-input.xcfilelist:
2672         * WebKit.xcodeproj/project.pbxproj:
2673
2674 2019-01-08  Chris Dumez  <cdumez@apple.com>
2675
2676         Mark SuspendedPageProxy as fast allocated
2677         https://bugs.webkit.org/show_bug.cgi?id=193248
2678
2679         Reviewed by Alex Christensen.
2680
2681         * UIProcess/SuspendedPageProxy.h:
2682
2683 2019-01-08  Chris Dumez  <cdumez@apple.com>
2684
2685         Prevent cross-site top-level navigations from third-party iframes
2686         https://bugs.webkit.org/show_bug.cgi?id=193076
2687         <rdar://problem/36074736>
2688
2689         Reviewed by Alex Christensen.
2690
2691         Add experimental feature flag, on by default.
2692
2693         * Shared/WebPreferences.yaml:
2694
2695 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2696
2697         Remove more use of NetworkProcess::singleton
2698         https://bugs.webkit.org/show_bug.cgi?id=193244
2699
2700         Reviewed by Brent Fulgham.
2701
2702         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2703         (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
2704         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
2705         * NetworkProcess/NetworkCORSPreflightChecker.h:
2706         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2707         (WebKit::NetworkConnectionToWebProcess::loadPing):
2708         * NetworkProcess/NetworkContentRuleListManager.cpp:
2709         (WebKit::NetworkContentRuleListManager::NetworkContentRuleListManager):
2710         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
2711         * NetworkProcess/NetworkContentRuleListManager.h:
2712         * NetworkProcess/NetworkLoadChecker.cpp:
2713         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2714         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const):
2715         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
2716         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
2717         * NetworkProcess/NetworkLoadChecker.h:
2718         * NetworkProcess/NetworkProcess.cpp:
2719         (WebKit::NetworkProcess::NetworkProcess):
2720         (WebKit::NetworkProcess::didReceiveMessage):
2721         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
2722         * NetworkProcess/NetworkProcess.h:
2723         (WebKit::NetworkProcess::networkContentRuleListManager):
2724         * NetworkProcess/NetworkResourceLoader.cpp:
2725         * NetworkProcess/PingLoad.cpp:
2726         (WebKit::PingLoad::PingLoad):
2727         * NetworkProcess/PingLoad.h:
2728         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2729         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2730         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
2731         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
2732
2733 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2734
2735         Stop using NetworkProcess::singleton in NetworkCache code
2736         https://bugs.webkit.org/show_bug.cgi?id=193243
2737
2738         Reviewed by Brent Fulgham.
2739
2740         * NetworkProcess/cache/NetworkCache.cpp:
2741         (WebKit::NetworkCache::Cache::open):
2742         (WebKit::NetworkCache::Cache::Cache):
2743         * NetworkProcess/cache/NetworkCache.h:
2744         (WebKit::NetworkCache::Cache::networkProcess):
2745         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2746         (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
2747         (WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve const):
2748         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
2749         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
2750         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
2751         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
2752         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2753         (WebKit::NetworkCache::Statistics::recordRetrievalRequest):
2754         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
2755         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
2756         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
2757         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
2758         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2759         (WebKit::NetworkCache::retrieveFromMemory):
2760         * NetworkProcess/cache/NetworkCacheStorage.h:
2761         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2762         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2763
2764 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2765
2766         Call CompletionHandler when destroying a NetworkCache::Storage::WriteOperation
2767         https://bugs.webkit.org/show_bug.cgi?id=193251
2768
2769         Reviewed by Chris Dumez.
2770
2771         This fixes another assertion introduced in r239710.
2772
2773         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2774         (WebKit::NetworkCache::Storage::WriteOperation::~WriteOperation):
2775
2776 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2777
2778         Stop using NetworkStorageSession in WebProcess
2779         https://bugs.webkit.org/show_bug.cgi?id=193236
2780
2781         Reviewed by Don Olmstead.
2782
2783         * Shared/WebProcessCreationParameters.cpp:
2784         (WebKit::WebProcessCreationParameters::encode const):
2785         (WebKit::WebProcessCreationParameters::decode):
2786         * Shared/WebProcessCreationParameters.h:
2787         * Shared/WebsitePoliciesData.cpp:
2788         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2789         * UIProcess/WebProcessPool.cpp:
2790         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2791         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
2792         (WebKit::WebProcessPool::initializeNewWebProcess):
2793         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2794         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
2795         (WebKit::WebProcessPool::processForNavigationInternal):
2796         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2797         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2798         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2799         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2800         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Deleted.
2801         (WebKit::WebFrameNetworkingContext::storageSession const): Deleted.
2802         * WebProcess/WebPage/WebPage.cpp:
2803         (WebKit::WebPage::setSessionID):
2804         * WebProcess/WebProcess.cpp:
2805         (WebKit::WebProcess::initializeWebProcess):
2806         (WebKit::WebProcess::fetchWebsiteData):
2807         (WebKit::WebProcess::addWebsiteDataStore): Deleted.
2808         (WebKit::WebProcess::destroySession): Deleted.
2809         * WebProcess/WebProcess.h:
2810         * WebProcess/WebProcess.messages.in:
2811
2812 2019-01-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2813
2814         Unreviewed, silence -Wformat warnings
2815
2816         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
2817         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
2818         (WebKit::NetworkHTTPSUpgradeChecker::query):
2819
2820 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2821
2822         Unreviewed, rolling out r239727.
2823
2824         Broke API tests
2825
2826         Reverted changeset:
2827
2828         "Stop using NetworkStorageSession in WebProcess"
2829         https://bugs.webkit.org/show_bug.cgi?id=193236
2830         https://trac.webkit.org/changeset/239727
2831
2832 2019-01-08  Brian Burg  <bburg@apple.com>
2833
2834         Remove WKPageRef-based SPI in _WKAutomationSessionDelegate
2835         https://bugs.webkit.org/show_bug.cgi?id=193202
2836         <rdar://problem/37408718>
2837
2838         Reviewed by Alex Christensen.
2839
2840         This code is no longer used, it should be deleted.
2841
2842         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2843         * UIProcess/Cocoa/AutomationSessionClient.h:
2844         * UIProcess/Cocoa/AutomationSessionClient.mm:
2845         (WebKit::AutomationSessionClient::AutomationSessionClient):
2846         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
2847         (WebKit::AutomationSessionClient::requestSwitchToPage):
2848         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
2849         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
2850         (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
2851         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
2852         (WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
2853         (WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
2854         (WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
2855         (WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
2856         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
2857         Clean up the delegate bridging methods now that only one delegate implementation is possible.
2858
2859 2019-01-08  Patrick Griffis  <pgriffis@igalia.com>
2860
2861         [GTK][WPE] Remove DConf permissions from sandbox
2862         https://bugs.webkit.org/show_bug.cgi?id=193021
2863
2864         Reviewed by Michael Catanzaro.
2865
2866         The latest development releases of xdg-desktop-portal and gtk3 use a
2867         new portal for settings on Wayland org.freedesktop.portal.Settings.
2868
2869         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2870         (WebKit::bubblewrapSpawn):
2871
2872 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2873
2874         Stop using NetworkStorageSession in WebProcess
2875         https://bugs.webkit.org/show_bug.cgi?id=193236
2876
2877         Reviewed by Don Olmstead.
2878
2879         * Shared/WebProcessCreationParameters.cpp:
2880         (WebKit::WebProcessCreationParameters::encode const):
2881         (WebKit::WebProcessCreationParameters::decode):
2882         * Shared/WebProcessCreationParameters.h:
2883         * Shared/WebsitePoliciesData.cpp:
2884         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2885         * UIProcess/WebProcessPool.cpp:
2886         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2887         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
2888         (WebKit::WebProcessPool::initializeNewWebProcess):
2889         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2890         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
2891         (WebKit::WebProcessPool::processForNavigationInternal):
2892         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2893         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2894         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2895         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2896         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Deleted.
2897         (WebKit::WebFrameNetworkingContext::storageSession const): Deleted.
2898         * WebProcess/WebPage/WebPage.cpp:
2899         (WebKit::WebPage::setSessionID):
2900         * WebProcess/WebProcess.cpp:
2901         (WebKit::WebProcess::initializeWebProcess):
2902         (WebKit::WebProcess::fetchWebsiteData):
2903         (WebKit::WebProcess::addWebsiteDataStore): Deleted.
2904         (WebKit::WebProcess::destroySession): Deleted.
2905         * WebProcess/WebProcess.h:
2906         * WebProcess/WebProcess.messages.in:
2907
2908 2019-01-08  Alex Christensen  <achristensen@webkit.org>
2909
2910         Always call CompletionHandler in Cache::store
2911         https://bugs.webkit.org/show_bug.cgi?id=193237
2912
2913         Reviewed by Chris Dumez.
2914
2915         No change in behavior. This just fixes an assertion introduced in r239710 when the speculative loader finishes.
2916
2917         * NetworkProcess/NetworkResourceLoader.cpp:
2918         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
2919         * NetworkProcess/cache/NetworkCache.cpp:
2920         (WebKit::NetworkCache::Cache::store):
2921         * NetworkProcess/cache/NetworkCache.h:
2922         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2923         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
2924
2925 2019-01-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2926
2927         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.2 release
2928
2929         * gtk/NEWS: Add release notes for 2.23.2.
2930
2931 2019-01-07  Chris Dumez  <cdumez@apple.com>
2932
2933         Cannot scoll for 5 seconds after swiping back on quoteunquoteapps.com
2934         https://bugs.webkit.org/show_bug.cgi?id=193215
2935         <rdar://problem/45108222>
2936
2937         Reviewed by Tim Horton.
2938
2939         When doing the history navigation, if the source and destination history
2940         items are clones then we will not trigger a main frame load. We may
2941         however trigger loads in subframes if needed. This was an issue for the
2942         ViewGestureController because it was expecting a main frame load after
2943         calling WebPageProxy::goToBackForwardItem() in order to determine when
2944         taking down the view snapshot is appropriate.
2945
2946         To address the problem, the ViewGestureController now takes the snapshot
2947         down as soon as the swipe gesture ends when the source and destination
2948         items are clones.
2949
2950         * Shared/WebBackForwardListItem.cpp:
2951         (WebKit::childItemWithTarget):
2952         (WebKit::WebBackForwardListItem::itemIsInSameDocument const):
2953         (WebKit::hasSameFrames):
2954         (WebKit::WebBackForwardListItem::itemIsClone):
2955         * Shared/WebBackForwardListItem.h:
2956         * UIProcess/ios/ViewGestureControllerIOS.mm:
2957         (WebKit::ViewGestureController::endSwipeGesture):
2958         * UIProcess/mac/ViewGestureControllerMac.mm:
2959         (WebKit::ViewGestureController::endSwipeGesture):
2960
2961 2019-01-07  David Kilzer  <ddkilzer@apple.com>
2962
2963         Leak of ScrollCompletionCallbackData (16 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2964         <https://webkit.org/b/193222>
2965         <rdar://problem/46862309>
2966
2967         Reviewed by Joseph Pecoraro.
2968
2969         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2970         (WKBundlePageRegisterScrollOperationCompletionCallback): Change
2971         to return true if callback will be called, else false.
2972         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2973         (WKBundlePageRegisterScrollOperationCompletionCallback): Change
2974         to return `bool` value to denote whether callback will be called
2975         (true) or not called (false).
2976
2977 2019-01-07  Alex Christensen  <achristensen@webkit.org>
2978
2979         Remove use of NetworkProcess::singleton from CacheStorage::Engine::from
2980         https://bugs.webkit.org/show_bug.cgi?id=193220
2981
2982         Reviewed by Andy Estes.
2983
2984         This required passing the NetworkProcess& in from all its callers.
2985         While I was at it, I made them use CompletionHandlers where appropriate.
2986
2987         * NetworkProcess/NetworkProcess.cpp:
2988         (WebKit::NetworkProcess::destroySession):
2989         (WebKit::NetworkProcess::fetchWebsiteData):
2990         (WebKit::NetworkProcess::deleteWebsiteData):
2991         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2992         (WebKit::NetworkProcess::findCacheEngine):
2993         (WebKit::NetworkProcess::ensureCacheEngine):
2994         (WebKit::NetworkProcess::removeCacheEngine):
2995         * NetworkProcess/NetworkProcess.h:
2996         * NetworkProcess/cache/CacheStorageEngine.cpp:
2997         (WebKit::CacheStorage::Engine::from):
2998         (WebKit::CacheStorage::Engine::destroyEngine):
2999         (WebKit::CacheStorage::Engine::fetchEntries):
3000         (WebKit::CacheStorage::Engine::open):
3001         (WebKit::CacheStorage::Engine::remove):
3002         (WebKit::CacheStorage::Engine::retrieveCaches):
3003         (WebKit::CacheStorage::Engine::retrieveRecords):
3004         (WebKit::CacheStorage::Engine::putRecords):
3005         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
3006         (WebKit::CacheStorage::Engine::lock):
3007         (WebKit::CacheStorage::Engine::unlock):
3008         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
3009         (WebKit::CacheStorage::Engine::representation):
3010         (WebKit::CacheStorage::Engine::clearAllCaches):
3011         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
3012         (WebKit::CacheStorage::globalEngineMap): Deleted.
3013         * NetworkProcess/cache/CacheStorageEngine.h:
3014         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3015         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
3016         (WebKit::CacheStorageEngineConnection::open):
3017         (WebKit::CacheStorageEngineConnection::remove):
3018         (WebKit::CacheStorageEngineConnection::caches):
3019         (WebKit::CacheStorageEngineConnection::retrieveRecords):
3020         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
3021         (WebKit::CacheStorageEngineConnection::putRecords):
3022         (WebKit::CacheStorageEngineConnection::reference):
3023         (WebKit::CacheStorageEngineConnection::dereference):
3024         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
3025         (WebKit::CacheStorageEngineConnection::engineRepresentation):
3026         * NetworkProcess/cache/NetworkCache.cpp:
3027         (WebKit::NetworkCache::Cache::store):
3028         (WebKit::NetworkCache::Cache::remove):
3029         (WebKit::NetworkCache::Cache::traverse):
3030         (WebKit::NetworkCache::Cache::clear):
3031         (WebKit::NetworkCache::Cache::retrieveData):
3032         * NetworkProcess/cache/NetworkCache.h:
3033
3034 2019-01-07  David Kilzer  <ddkilzer@apple.com>
3035
3036         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
3037         <https://webkit.org/b/193056>
3038
3039         Reviewed by Alex Christensen.
3040
3041         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
3042         (WebKit::XPCServiceMain):
3043         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
3044         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
3045         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3046         * UIProcess/Plugins/PluginProcessProxy.h:
3047         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3048         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
3049         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
3050         (WebKit::PlatformCALayerRemoteCustom::clone const):
3051         - Remove '*' from RetainPtr<> type.
3052
3053 2019-01-07  Dean Jackson  <dino@apple.com>
3054
3055         Turn on Pointer Events by default for iOS
3056         https://bugs.webkit.org/show_bug.cgi?id=193214
3057         <rdar://problem/46974878>
3058
3059         Reviewed by Wenson Hsieh.
3060
3061         Turn on Pointer Events.
3062
3063         * Shared/WebPreferences.yaml:
3064         * Shared/WebPreferencesDefaultValues.h: Make a new #define for iOS.
3065
3066 2019-01-07  Alex Christensen  <achristensen@webkit.org>
3067
3068         Remove use of NetworkProcess::singleton in ServiceWorker code
3069         https://bugs.webkit.org/show_bug.cgi?id=193209
3070
3071         Reviewed by Megan Gardner.
3072
3073         Use a member Ref<NetworkProcess> instead to avoid global singleton use.
3074
3075         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3076         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
3077         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
3078         (WebKit::WebSWServerConnection::WebSWServerConnection):
3079         (WebKit::WebSWServerConnection::~WebSWServerConnection):
3080         (WebKit::WebSWServerConnection::startFetch):
3081         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
3082         (WebKit::WebSWServerConnection::scheduleJobInServer):
3083         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
3084
3085 2019-01-07  Alex Christensen  <achristensen@webkit.org>
3086
3087         Remove use of NetworkProcess::singleton in NetworkLoad/NetworkDataTask code
3088         https://bugs.webkit.org/show_bug.cgi?id=193212
3089
3090         Reviewed by Andy Estes.
3091
3092         * NetworkProcess/NetworkDataTaskBlob.cpp:
3093         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3094         (WebKit::NetworkDataTaskBlob::download):
3095         (WebKit::NetworkDataTaskBlob::writeDownload):
3096         (WebKit::NetworkDataTaskBlob::didFailDownload):
3097         (WebKit::NetworkDataTaskBlob::didFinishDownload):
3098         * NetworkProcess/NetworkDataTaskBlob.h:
3099         * NetworkProcess/NetworkLoad.cpp:
3100         (WebKit::NetworkLoad::NetworkLoad):
3101         (WebKit::NetworkLoad::convertTaskToDownload):
3102         (WebKit::NetworkLoad::didReceiveChallenge):
3103         (WebKit::NetworkLoad::didReceiveResponse):
3104         * NetworkProcess/NetworkLoad.h:
3105
3106 2019-01-07  Alex Christensen  <achristensen@webkit.org>
3107
3108         Remove use of NetworkProcess::singleton for downloads
3109         https://bugs.webkit.org/show_bug.cgi?id=193207
3110
3111         Reviewed by Brady Eidson.
3112
3113         No change in behavior.  The DownloadManager is now a member of the NetworkProcess instead of a static singleton.
3114
3115         * NetworkProcess/Downloads/Download.cpp:
3116         (WebKit::Download::Download):
3117         (WebKit::Download::didReceiveChallenge):
3118         * NetworkProcess/Downloads/Download.h:
3119         * NetworkProcess/Downloads/DownloadManager.cpp:
3120         (WebKit::DownloadManager::startDownload):
3121         (WebKit::DownloadManager::convertNetworkLoadToDownload):
3122         * NetworkProcess/Downloads/DownloadManager.h:
3123         (WebKit::DownloadManager::client):
3124         * NetworkProcess/Downloads/PendingDownload.cpp:
3125         (WebKit::PendingDownload::PendingDownload):
3126         (WebKit::PendingDownload::messageSenderConnection):
3127         * NetworkProcess/Downloads/PendingDownload.h:
3128         * NetworkProcess/NetworkLoadChecker.cpp:
3129         * NetworkProcess/NetworkProcess.cpp:
3130         (WebKit::NetworkProcess::NetworkProcess):
3131         (WebKit::NetworkProcess::downloadManager):
3132         * NetworkProcess/NetworkProcess.h:
3133
3134 2019-01-07  Devin Rousso  <drousso@apple.com>
3135
3136         Web Inspector: Network: show secure connection details per-request
3137         https://bugs.webkit.org/show_bug.cgi?id=191539
3138         <rdar://problem/45979891>
3139
3140         Reviewed by Joseph Pecoraro.
3141
3142         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3143         (stringForSSLProtocol): Added.
3144         (stringForSSLCipher): Added.
3145         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
3146
3147 2019-01-07  Joseph Pecoraro  <pecoraro@apple.com>
3148
3149         Web Inspector: Remote inspector can crash if attempting to navigate inspector page
3150         https://bugs.webkit.org/show_bug.cgi?id=193204
3151         <rdar://problem/45550428>
3152
3153         Reviewed by Devin Rousso.
3154
3155         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3156         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
3157         * UIProcess/mac/WKInspectorViewController.mm:
3158         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
3159
3160 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
3161
3162         Deactivate audio session whenever possible
3163         https://bugs.webkit.org/show_bug.cgi?id=193188
3164         <rdar://problem/42678977>
3165
3166         Reviewed by Jer Noble.
3167
3168         * WebProcess/WebPage/WebPage.cpp:
3169         (WebKit::WebPage::WebPage):
3170
3171 2019-01-07  Joseph Pecoraro  <pecoraro@apple.com>
3172
3173         [Cocoa] Add SPI to check if a WKWebView has an inspector frontend
3174         https://bugs.webkit.org/show_bug.cgi?id=193162
3175         <rdar://problem/24267143>
3176
3177         Reviewed by Alex Christensen.
3178
3179         * UIProcess/API/Cocoa/WKWebView.mm:
3180         (-[WKWebView _hasInspectorFrontend]):
3181         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3182         * UIProcess/WebPageProxy.h:
3183         (WebKit::WebPageProxy::hasInspectorFrontend const):
3184
3185 2019-01-07  Antti Koivisto  <antti@apple.com>
3186
3187         UI process side scrollbars for UI side compositing on Mac
3188         https://bugs.webkit.org/show_bug.cgi?id=193106
3189
3190         Reviewed by Tim Horton.
3191
3192         This patch implements Mac scrollbars on UI process side using the low level NSScrollerImp/NSScrollerPairImp
3193         SPIs. With this patch scrollbars mostly work for the main frame and also render (but can't be interacted with)
3194         for the subframes.
3195
3196         This is based on the similar code for web process side scrollbars in ScrollAnimatorMac. There is quite a bit of
3197         copy code as there is no way to share nicely. One of these will eventually go away anyway.
3198
3199         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
3200         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
3201         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
3202         * Shared/WebCoreArgumentCoders.cpp:
3203         (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
3204         (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
3205         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3206         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3207         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3208         (WebKit::RemoteScrollingCoordinatorProxy::handleMouseEvent):
3209         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3210         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3211         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
3212         (WebKit::RemoteScrollingTree::handleMouseEvent):
3213         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
3214         * UIProcess/RemoteLayerTree/mac: Added.
3215         * UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Added.
3216
3217         Wraps NSScrollerImp for vertical or horizontal scrollbar.
3218
3219         (WebKit::ScrollerMac::pair):
3220         (WebKit::ScrollerMac::orientation const):
3221         (WebKit::ScrollerMac::hostLayer const):
3222         (WebKit::ScrollerMac::scrollerImp):
3223         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Added.
3224         (-[WKScrollbarPartAnimation initWithScroller:featureToAnimate:animateFrom:animateTo:duration:]):
3225         (-[WKScrollbarPartAnimation startAnimation]):
3226         (-[WKScrollbarPartAnimation setStartValue:]):
3227         (-[WKScrollbarPartAnimation setEndValue:]):
3228         (-[WKScrollbarPartAnimation setCurrentProgress:]):
3229         (-[WKScrollbarPartAnimation invalidate]):
3230         (-[WKScrollerImpDelegate initWithScroller:]):
3231         (-[WKScrollerImpDelegate cancelAnimations]):
3232         (-[WKScrollerImpDelegate scrollerPair]):
3233         (-[WKScrollerImpDelegate convertRectToBacking:]):
3234         (-[WKScrollerImpDelegate convertRectFromBacking:]):
3235         (-[WKScrollerImpDelegate layer]):
3236         (-[WKScrollerImpDelegate mouseLocationInScrollerForScrollerImp:]):
3237         (-[WKScrollerImpDelegate convertRectToLayer:]):
3238         (-[WKScrollerImpDelegate shouldUseLayerPerPartForScrollerImp:]):
3239         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
3240         (-[WKScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
3241         (-[WKScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
3242         (-[WKScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
3243         (-[WKScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
3244         (-[WKScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
3245         (-[WKScrollerImpDelegate scrollerImp:overlayScrollerStateChangedTo:]):
3246         (-[WKScrollerImpDelegate invalidate]):
3247         (WebKit::ScrollerMac::ScrollerMac):
3248         (WebKit::ScrollerMac::~ScrollerMac):
3249         (WebKit::ScrollerMac::attach):
3250         (WebKit::ScrollerMac::setHostLayer):
3251         (WebKit::ScrollerMac::updatePosition):
3252         (WebKit::ScrollerMac::convertFromContent const):
3253         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Added.
3254         (WebKit::ScrollerPairMac::verticalScroller):
3255         (WebKit::ScrollerPairMac::horizontalScroller):
3256         (WebKit::ScrollerPairMac::scrollerImpPair):
3257         (WebKit::ScrollerPairMac::lastKnownMousePosition const):
3258         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Added.
3259
3260         Wraps NSScrollerPairImp and owns the vertical and horizontal scrollers.
3261
3262         (-[WKScrollerImpPairDelegate initWithScrollerPair:]):
3263         (-[WKScrollerImpPairDelegate invalidate]):
3264         (-[WKScrollerImpPairDelegate contentAreaRectForScrollerImpPair:]):
3265         (-[WKScrollerImpPairDelegate inLiveResizeForScrollerImpPair:]):
3266         (-[WKScrollerImpPairDelegate mouseLocationInContentAreaForScrollerImpPair:]):
3267         (-[WKScrollerImpPairDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
3268         (-[WKScrollerImpPairDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
3269         (-[WKScrollerImpPairDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
3270         (WebKit::ScrollerPairMac::ScrollerPairMac):
3271         (WebKit::ScrollerPairMac::~ScrollerPairMac):
3272         (WebKit::ScrollerPairMac::handleWheelEvent):
3273         (WebKit::ScrollerPairMac::handleMouseEvent):
3274         (WebKit::ScrollerPairMac::updatePositions):
3275         (WebKit::ScrollerPairMac::contentsSize const):
3276         (WebKit::ScrollerPairMac::visibleContentsRect const):
3277         (WebKit::ScrollerPairMac::useDarkAppearance const):
3278         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Added.
3279
3280         Special node for UI side Mac scrolling. Owns ScrollerPairMac instance.
3281
3282         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac):
3283         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::~ScrollingTreeFrameScrollingNodeRemoteMac):
3284         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::create):
3285         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
3286         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition):
3287         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
3288         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
3289         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::scrollingTree const):
3290         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Added.
3291         * UIProcess/WebPageProxy.cpp:
3292         (WebKit::WebPageProxy::handleMouseEvent):
3293         * WebKit.xcodeproj/project.pbxproj:
3294
3295 2019-01-07  Brian Burg  <bburg@apple.com>
3296
3297         Unwanted page navigation after showing & dismissing contextual menu with control-click
3298         https://bugs.webkit.org/show_bug.cgi?id=192912
3299         <rdar://problem/46318508>
3300
3301         Reviewed by Timothy Hatcher.
3302
3303         After the conversion to use a mouse event queue, this behavior was observed rarely, especially
3304         when CPU is under load and lots of things are going on in the page. In other words, it's racy.
3305
3306         Based on NSEvent logging, it seems that when the system is under load, we simply take too long
3307         to enter the nested runloop that AppKit uses to handle events when the context menu is present.
3308         AppKit doesn't care whether or not the MouseDown triggered a nested runloop; on my machine it delivers
3309         the MouseUp event about 130ms after the MouseDown event. If we haven't show the context menu in
3310         that time, then the MouseUp is enqueued as a normal mouse event. If the Ctrl-click is on a link,
3311         then the MouseUp will be interpreted by EventHandler as a click event, which in the simplest case
3312         will initiate a main frame navigation. When the context menu is dismissed and the nested runloop
3313         is torn down, the navigation IPC message is handled in UIProcess and the page navigates away.
3314
3315         We can't do much to change AppKit's inherently racy behavior, but we can avoid processing
3316         mouse events that are delivered whilst we are processing the context menu-initiating event.
3317         From the WebProcess point of view, there is no race anymore because it does not receive the
3318         MouseUp event.
3319
3320         * UIProcess/WebPageProxy.cpp:
3321         (WebKit::WebPageProxy::showContextMenu):
3322         If new events come in, drop them on the floor. Based on testing, the nested runloop will discard
3323         the unpaired MouseUp event anyway, so this does not cause a change in behavior.
3324
3325 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3326
3327         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
3328         https://bugs.webkit.org/show_bug.cgi?id=193180
3329         <rdar://problem/45971041>
3330
3331         Reviewed by Tim Horton.
3332
3333         JSFiddle uses CodeMirror; CodeMirror's editor works by capturing keystrokes and input in a hidden textarea
3334         element, and then drawing its own selection caret using web content. This textarea is hidden by being placed
3335         underneath an empty div with `overflow: hidden;`.
3336
3337         When requesting desktop site on iOS, both CodeMirror's caret and the native iOS caret are shown because iOS
3338         selection UI consists of native views overlaid on the page, whereas on macOS, the entire textarea (along with
3339         the caret) are occluded by the hidden overflow container. Additionally, various iOS behaviors related to
3340         selection and editing, such as zooming to reveal the focused element and showing the platform callout bar, are
3341         active when focusing this hidden editable area; these don't work as intended, and just interfere with the page's
3342         custom editing UI.
3343
3344         To fix this, we augment the text interaction suppression mechanism added in r238146 to detect when the focused
3345         element is in an empty `overflow: hidden` container, and bail out of native text editing behaviors.
3346
3347         * Shared/EditorState.cpp:
3348         (WebKit::EditorState::PostLayoutData::encode const):
3349         (WebKit::EditorState::PostLayoutData::decode):
3350         * Shared/EditorState.h:
3351
3352         Rename elementIsTransparent to elementIsTransparentOrFullyClipped.
3353
3354         * Shared/FocusedElementInformation.cpp:
3355         (WebKit::FocusedElementInformation::encode const):
3356         (WebKit::FocusedElementInformation::decode):
3357         * Shared/FocusedElementInformation.h:
3358         * UIProcess/ios/WKContentViewInteraction.h:
3359
3360         Rename FocusedElementIsTransparent to FocusedElementIsTransparentOrFullyClipped.
3361
3362         * UIProcess/ios/WKContentViewInteraction.mm:
3363         (-[WKContentView _zoomToRevealFocusedElement]):
3364         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3365         (-[WKContentView _elementDidBlur]):
3366
3367         Make an additional tweak here to only stop suppressing text interaction assistant in `-_elementDidBlur` if we're
3368         not also in the middle of changing the focused element. Without this, focusing a hidden editable element while
3369         another hidden editable element is currently focused causes us to zoom to reveal the newly focused hidden
3370         editable element, when we should be avoiding this behavior.
3371
3372         (-[WKContentView _updateChangedSelection:]):
3373         * WebProcess/WebPage/ios/WebPageIOS.mm:
3374         (WebKit::WebPage::platformEditorState const):
3375         (WebKit::WebPage::getFocusedElementInformation):
3376
3377 2019-01-07  Alex Christensen  <achristensen@webkit.org>
3378
3379         Move identifierBase from SessionTracker to NetworkProcess/WebProcess
3380         https://bugs.webkit.org/show_bug.cgi?id=193201
3381
3382         Reviewed by Tim Horton.
3383
3384         No change in behavior.  This just reduces process-global state.
3385
3386         * NetworkProcess/NetworkProcess.h:
3387         (WebKit::NetworkProcess::uiProcessBundleIdentifier const):
3388         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3389         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3390         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3391         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3392         * Shared/SessionTracker.cpp:
3393         (WebKit::identifierBase): Deleted.
3394         (WebKit::SessionTracker::getIdentifierBase): Deleted.
3395         (WebKit::SessionTracker::setIdentifierBase): Deleted.
3396         * Shared/SessionTracker.h:
3397         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3398         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3399         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier const):
3400         * WebProcess/WebProcess.h:
3401         (WebKit::WebProcess::uiProcessBundleIdentifier const):
3402         * WebProcess/cocoa/WebProcessCocoa.mm:
3403         (WebKit::WebProcess::platformInitializeWebProcess):
3404
3405 2019-01-07  Alex Christensen  <achristensen@webkit.org>
3406
3407         Reduce use of NetworkProcess::singleton
3408         https://bugs.webkit.org/show_bug.cgi?id=193197
3409
3410         Reviewed by Brady Eidson.
3411
3412         Pass it around as a Ref<NetworkProcess> as a step towards reducing global state.
3413         Soup's WebFrameNetworkingContext no longer makes a NetworkSession like all other ports
3414         because networking is no longer done in the WebProcess.
3415
3416         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3417         (WebKit::WebIDBConnectionToClient::create):
3418         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
3419         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
3420         (WebKit::WebIDBConnectionToClient::deleteDatabase):
3421         (WebKit::WebIDBConnectionToClient::openDatabase):
3422         (WebKit::WebIDBConnectionToClient::abortTransaction):
3423         (WebKit::WebIDBConnectionToClient::commitTransaction):
3424         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
3425         (WebKit::WebIDBConnectionToClient::createObjectStore):
3426         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
3427         (WebKit::WebIDBConnectionToClient::renameObjectStore):
3428         (WebKit::WebIDBConnectionToClient::clearObjectStore):
3429         (WebKit::WebIDBConnectionToClient::createIndex):
3430         (WebKit::WebIDBConnectionToClient::deleteIndex):
3431         (WebKit::WebIDBConnectionToClient::renameIndex):
3432         (WebKit::WebIDBConnectionToClient::putOrAdd):
3433         (WebKit::WebIDBConnectionToClient::getRecord):
3434         (WebKit::WebIDBConnectionToClient::getAllRecords):
3435         (WebKit::WebIDBConnectionToClient::getCount):
3436         (WebKit::WebIDBConnectionToClient::deleteRecord):
3437         (WebKit::WebIDBConnectionToClient::openCursor):
3438         (WebKit::WebIDBConnectionToClient::iterateCursor):
3439         (WebKit::WebIDBConnectionToClient::establishTransaction):
3440         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
3441         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
3442         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
3443         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
3444         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
3445         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
3446         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
3447         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
3448         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3449         (WebKit::NetworkConnectionToWebProcess::create):
3450         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
3451         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
3452         (WebKit::NetworkConnectionToWebProcess::didClose):
3453         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
3454         (WebKit::NetworkConnectionToWebProcess::prefetchDNS):
3455         (WebKit::NetworkConnectionToWebProcess::startDownload):
3456         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
3457         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
3458         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
3459         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
3460         * NetworkProcess/NetworkConnectionToWebProcess.h:
3461         (WebKit::NetworkConnectionToWebProcess::networkProcess):
3462         * NetworkProcess/NetworkProcess.cpp:
3463         (WebKit::NetworkProcess::singleton):
3464         (WebKit::NetworkProcess::initializeNetworkProcess):
3465         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
3466         (WebKit::NetworkProcess::addWebsiteDataStore):
3467         (WebKit::fetchDiskCacheEntries):
3468         (WebKit::NetworkProcess::fetchWebsiteData):
3469         (WebKit::clearDiskCacheEntries):
3470         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
3471         (WebKit::NetworkProcess::getNetworkProcessStatistics):
3472         (WebKit::NetworkProcess::idbServer):
3473         * NetworkProcess/NetworkProcess.h:
3474         * NetworkProcess/NetworkResourceLoader.cpp:
3475         (WebKit::NetworkResourceLoader::startNetworkLoad):
3476         (WebKit::NetworkResourceLoader::convertToDownload):
3477         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const):
3478         * NetworkProcess/NetworkSession.cpp:
3479         (WebKit::NetworkSession::create):
3480         (WebKit::NetworkSession::NetworkSession):
3481         * NetworkProcess/NetworkSession.h:
3482         (WebKit::NetworkSession::networkProcess):
3483         * NetworkProcess/RemoteNetworkingContext.h:
3484         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3485         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3486         (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
3487         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3488         (WebKit::NetworkProcess::clearDiskCache):
3489         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3490         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3491         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3492         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
3493         (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
3494         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
3495         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
3496         (WebKit::NetworkSessionCocoa::create):
3497         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3498         * NetworkProcess/curl/NetworkSessionCurl.cpp:
3499         (WebKit::NetworkSessionCurl::NetworkSessionCurl):
3500         * NetworkProcess/curl/NetworkSessionCurl.h:
3501         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3502         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3503         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3504         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
3505         * NetworkProcess/soup/NetworkSessionSoup.h:
3506
3507 2019-01-07  Alex Christensen  <achristensen@webkit.org>
3508
3509         Modernize CacheModel and disk cache fetching and clearing
3510         https://bugs.webkit.org/show_bug.cgi?id=193164
3511
3512         Reviewed by Joseph Pecoraro.
3513
3514         fetchDiskCacheEntries and clearDiskCacheEntries now use an early-return model.
3515         CacheModel is now an enum class.
3516
3517         * NetworkProcess/NetworkProcess.cpp:
3518         (WebKit::NetworkProcess::NetworkProcess):
3519         (WebKit::NetworkProcess::initializeNetworkProcess):
3520         (WebKit::fetchDiskCacheEntries):
3521         (WebKit::NetworkProcess::fetchWebsiteData):
3522         (WebKit::clearDiskCacheEntries):
3523         (WebKit::NetworkProcess::setCacheModel):
3524         * NetworkProcess/NetworkProcess.h:
3525         * NetworkProcess/NetworkProcess.messages.in:
3526         * NetworkProcess/NetworkProcessCreationParameters.h:
3527         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3528         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
3529         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3530         (WebKit::NetworkProcess::clearDiskCache):
3531         * Shared/CacheModel.cpp:
3532         (WebKit::calculateMemoryCacheSizes):
3533         (WebKit::calculateURLCacheSizes):
3534         * Shared/CacheModel.h:
3535         (): Deleted.
3536         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3537         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3538         * UIProcess/API/APIProcessPoolConfiguration.h:
3539         * UIProcess/API/C/WKAPICast.h:
3540         (WebKit::toCacheModel):
3541         (WebKit::toAPI):
3542         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3543         (-[_WKProcessPoolConfiguration pageCacheEnabled]):
3544         (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):
3545         * WebProcess/WebProcess.cpp:
3546         (WebKit::WebProcess::initializeWebProcess):
3547         (WebKit::WebProcess::setCacheModel):
3548         (WebKit::WebProcess::clearResourceCaches):
3549         * WebProcess/WebProcess.h:
3550         * WebProcess/WebProcess.messages.in:
3551
3552 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
3553
3554         [WebAuthN] Import U2F command/response converters from Chromium
3555         https://bugs.webkit.org/show_bug.cgi?id=193150
3556         <rdar://problem/47054028>
3557
3558         Reviewed by Brent Fulgham.
3559
3560         Moves helper functions to WebAuthenticationUtils.
3561
3562         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
3563         (WebKit::LocalAuthenticatorInternal::produceHashSet):
3564         (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
3565         (): Deleted.
3566         (WebKit::LocalAuthenticatorInternal::buildAuthData): Deleted.
3567         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
3568         (WebKit::MockHidConnection::feedReports):
3569
3570 2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
3571
3572         Web Inspector: Use save sheet instead of dialog where possible
3573         https://bugs.webkit.org/show_bug.cgi?id=193160
3574         <rdar://problem/37399759>
3575
3576         Reviewed by Devin Rousso.
3577
3578         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3579         (WebKit::RemoteWebInspectorProxy::platformSave):
3580         * UIProcess/mac/WebInspectorProxyMac.mm:
3581         (WebKit::WebInspectorProxy::platformSave):
3582
3583 2019-01-04  Jer Noble  <jer.noble@apple.com>
3584
3585         [WebKitLegacy] Media playback pauses on scroll
3586         https://bugs.webkit.org/show_bug.cgi?id=192829
3587
3588         Reviewed by Eric Carlson.
3589
3590         Add a new WebPage, WebPageProxy, & WKWebView SPI to stop, suspend, and resume all
3591         existing media playback in the page.
3592
3593         * UIProcess/API/Cocoa/WKWebView.mm:
3594         (-[WKWebView _stopAllMediaPlayback]):
3595         (-[WKWebView _suspendAllMediaPlayback]):
3596         (-[WKWebView _resumeAllMediaPlayback]):
3597         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3598         * UIProcess/WebPageProxy.cpp:
3599         (WebKit::WebPageProxy::stopAllMediaPlayback):
3600         (WebKit::WebPageProxy::suspendAllMediaPlayback):
3601         (WebKit::WebPageProxy::resumeAllMediaPlayback):
3602         * UIProcess/WebPageProxy.h:
3603         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
3604         (-[WKFullScreenViewController _showPhishingAlert]):
3605         * WebProcess/WebPage/WebPage.cpp:
3606         (WebKit::WebPage::stopAllMediaPlayback):
3607         (WebKit::WebPage::suspendAllMediaPlayback):
3608         (WebKit::WebPage::resumeAllMediaPlayback):
3609         * WebProcess/WebPage/WebPage.h:
3610         * WebProcess/WebPage/WebPage.messages.in:
3611
3612 2019-01-04  Chris Dumez  <cdumez@apple.com>
3613
3614         Add support for toggling device orientation API support per site
3615         https://bugs.webkit.org/show_bug.cgi?id=193143
3616         <rdar://problem/46605724>
3617
3618         Reviewed by Alex Christensen.
3619
3620         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
3621
3622         * Shared/WebsitePoliciesData.cpp:
3623         (WebKit::WebsitePoliciesData::encode const):
3624         (WebKit::WebsitePoliciesData::decode):
3625         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
3626         * Shared/WebsitePoliciesData.h:
3627         * UIProcess/API/APIWebsitePolicies.cpp:
3628         (API::WebsitePolicies::data):
3629         * UIProcess/API/APIWebsitePolicies.h:
3630         * UIProcess/API/Cocoa/WKWebView.mm:
3631         (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]):
3632         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3633         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3634         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3635         (-[_WKWebsitePolicies setDeviceOrientationEventEnabled:]):
3636         (-[_WKWebsitePolicies deviceOrientationEventEnabled]):
3637         * UIProcess/WebPageProxy.cpp:
3638         (WebKit::WebPageProxy::simulateDeviceOrientationChange):
3639         * UIProcess/WebPageProxy.h:
3640         * WebProcess/WebPage/WebPage.cpp:
3641         (WebKit::WebPage::simulateDeviceOrientationChange):
3642         * WebProcess/WebPage/WebPage.h:
3643         * WebProcess/WebPage/WebPage.messages.in:
3644
3645 2019-01-04  Chris Dumez  <cdumez@apple.com>
3646
3647         Crash under WebPageProxy::continueNavigationInNewProcess()
3648         https://bugs.webkit.org/show_bug.cgi?id=193113
3649         <rdar://problem/46938686>
3650
3651         Reviewed by Brady Eidson.
3652
3653         The crash was happening in continueNavigationInNewProcess() when dereferencing
3654         the Optional<> value returned by API::Navigation::backForwardFrameLoadType(), after verifying
3655         that API::Navigation::targetItem() is not null.
3656
3657         When constructing an API::Navigation object with a targetItem, you HAVE to pass
3658         in a backForwardFrameLoadType as well so this normally is not possible. However,
3659         it can happen because API::Navigation::setTargetItem() can get called later on and
3660         set a target item on a Navigation object which potentially does not have a
3661         backForwardFrameLoadType. This setter was only called in one place in
3662         decidePolicyForNavigationAction() to update an existing Navigation object using
3663         the targetItem provided by a NavigationAction. This logic was added with PSON
3664         support.
3665
3666         Because I was unable to write a test case reproducing this and because I do not know
3667         how it can happen in practice that we'd have a NavigationAction with a targetItem
3668         even though the Navigation object itself is not for a back/forward navigation, I have
3669         chosen to drop the unsafe API::Navigation::setTargetItem() setter and the call site.
3670         When the call site was added, with ProcessSwap.NavigateToDataURLThenBack API test,
3671         the intention was to create a back/forward navigation object instead of a standard load
3672         navigation one if there is currently no existing Navigation object in the UIProcess.
3673         This can happen when the back/forward navigation is triggered by the WebProcess via
3674         JS (e.g. history.back()) and this is what the API test covers. The part of the logic
3675         that updates an existing Navigation object with a targetItem coming from the
3676         NavigationAction is untested and I have no evidence it does anything useful. However,
3677         we DO have evidence that it can cause crashes.
3678
3679         * UIProcess/API/APINavigation.h:
3680         * UIProcess/WebPageProxy.cpp:
3681         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3682
3683 2019-01-04  Tim Horton  <timothy_horton@apple.com>
3684
3685         Remove some nonexistent files from the WebKit Xcode project
3686
3687         * WebKit.xcodeproj/project.pbxproj:
3688         r238468 and r237205 forgot to remove some files from the project.
3689
3690 2019-01-04  Youenn Fablet  <youenn@apple.com>
3691
3692         CSP violation reports should bypass CSP checks
3693         https://bugs.webkit.org/show_bug.cgi?id=192857
3694         <rdar://problem/46887236>
3695
3696         Reviewed by Chris Dumez.
3697
3698         * WebProcess/Network/WebLoaderStrategy.cpp:
3699         (WebKit::WebLoaderStrategy::startPingLoad):
3700         * WebProcess/Network/WebLoaderStrategy.h:
3701
3702 2019-01-04  Alex Christensen  <achristensen@webkit.org>
3703
3704         Use WebsiteDataStoreParameters instead of NetworkProcessCreationParameters for IndexedDB directories
3705         https://bugs.webkit.org/show_bug.cgi?id=193114
3706
3707         Reviewed by Brady Eidson.
3708
3709         * NetworkProcess/NetworkProcess.cpp:
3710         (WebKit::NetworkProcess::initializeNetworkProcess):
3711         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3712         (WebKit::NetworkProcessCreationParameters::encode const):
3713         (WebKit::NetworkProcessCreationParameters::decode):
3714         * NetworkProcess/NetworkProcessCreationParameters.h:
3715         * UIProcess/WebProcessPool.cpp:
3716         (WebKit::WebProcessPool::ensureNetworkProcess):
3717
3718 2019-01-04  Alex Christensen  <achristensen@webkit.org>
3719
3720         Deprecate WKContextCreate
3721         https://bugs.webkit.org/show_bug.cgi?id=193118
3722
3723         Reviewed by Brady Eidson.
3724
3725         It has only one use that is being removed in rdar://problem/47030792
3726         This is a step towards removing ProcessPoolConfiguration::createWithLegacyOptions.
3727         Also make WKContextCreateWithConfiguration accept a null configuration to make it easier to use.
3728
3729         * UIProcess/API/C/WKContext.cpp:
3730         (WKContextCreateWithConfiguration):
3731         * UIProcess/API/C/WKContext.h:
3732
3733 2019-01-04  Tim Horton  <timothy_horton@apple.com>
3734
3735         Fix the build
3736
3737         * UIProcess/ios/WKContentViewInteraction.mm:
3738         (-[WKContentView cleanupInteraction]):
3739
3740 2019-01-04  Tim Horton  <timothy_horton@apple.com>
3741
3742         Share ink choice and ruler between all editable images
3743         https://bugs.webkit.org/show_bug.cgi?id=193130
3744         <rdar://problem/46826491>
3745
3746         Reviewed by Wenson Hsieh.
3747
3748         * SourcesCocoa.txt:
3749         Add WKDrawingCoordinator, which maintains WKWebView-wide drawing state,
3750         and manages a single shared ink picker.
3751
3752         * UIProcess/PageClient.h:
3753         (WebKit::PageClient::createDrawingView):
3754         * UIProcess/ios/EditableImageController.mm:
3755         (WebKit::EditableImageController::ensureEditableImage):
3756         * UIProcess/ios/PageClientImplIOS.h:
3757         * UIProcess/ios/PageClientImplIOS.mm:
3758         (WebKit::PageClientImpl::createDrawingView):
3759         Plumb WKDrawingView creation through PageClient, so that it can be instantiated
3760         with knowledge of its owning WKContentView.
3761
3762         * UIProcess/ios/WKContentViewInteraction.h:
3763         * UIProcess/ios/WKContentViewInteraction.mm:
3764         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3765         (-[WKContentView _elementDidBlur]):
3766         (-[WKContentView _drawingCoordinator]):
3767         (-[WKContentView _installInkPickerForDrawingViewWithID:]): Deleted.
3768         (-[WKContentView _uninstallInkPicker]): Deleted.
3769         Move ink picker management into WKDrawingCoordinator.
3770
3771         * UIProcess/ios/WKDrawingView.h:
3772         * UIProcess/ios/WKDrawingView.mm:
3773         (-[WKDrawingView initWithEmbeddedViewID:contentView:]):
3774         (-[WKDrawingView _canvasViewWillBeginDrawing:]):
3775         (-[WKDrawingView invalidateAttachment]):
3776         (-[WKDrawingView didChangeRulerState:]):
3777         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Deleted.
3778         (-[WKDrawingView canvasView]): Deleted.
3779         Use a shared ruler, owned by WKDrawingCoordinator.
3780         Update the editable image's ink when drawing begins. This way, we don't have
3781         to push ink changes to all drawings as they happen.
3782
3783         * UIProcess/ios/WKInkPickerView.h:
3784         * UIProcess/ios/WKInkPickerView.mm:
3785         (-[WKInkPickerView initWithContentView:]):
3786         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
3787         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
3788         (-[WKInkPickerView setInk:]):
3789         (-[WKInkPickerView ink]):
3790         (-[WKInkPickerView initWithDrawingView:]): Deleted.
3791         (-[WKInkPickerView didPickInk]): Deleted.
3792         (-[WKInkPickerView inlineInkPicker:didSelectTool:]): Deleted.
3793         (-[WKInkPickerView inlineInkPicker:didSelectColor:]): Deleted.
3794         * WebKit.xcodeproj/project.pbxproj:
3795
3796 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3797
3798         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
3799         https://bugs.webkit.org/show_bug.cgi?id=193129
3800
3801         Reviewed by Tim Horton.
3802
3803         Remove WebEditCommandProxy::nameForEditAction and use WebCore::nameForUndoRedo instead.
3804
3805         * UIProcess/Cocoa/WebViewImpl.mm:
3806         (WebKit::WebViewImpl::registerEditCommand):
3807         * UIProcess/WebEditCommandProxy.cpp:
3808         (WebKit::WebEditCommandProxy::WebEditCommandProxy):
3809         (WebKit::WebEditCommandProxy::~WebEditCommandProxy):
3810         (WebKit::WebEditCommandProxy::nameForEditAction): Deleted.
3811         * UIProcess/WebEditCommandProxy.h:
3812         * UIProcess/WebPageProxy.cpp:
3813         (WebKit::WebPageProxy::addEditCommand):
3814         (WebKit::WebPageProxy::removeEditCommand):
3815         (WebKit::WebPageProxy::isValidEditCommand): Deleted.
3816
3817         Bit of drive-by refactoring: remove an unused function, and make addEditCommand and removeEditCommand take
3818         references instead of pointers, since these are assumed to be nonnull.
3819
3820         * UIProcess/WebPageProxy.h:
3821         * UIProcess/ios/PageClientImplIOS.mm:
3822         (WebKit::PageClientImpl::registerEditCommand):
3823
3824 2019-01-03  Matt Rajca  <mrajca@apple.com>
3825
3826         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
3827         https://bugs.webkit.org/show_bug.cgi?id=193128
3828         rdar://34554231
3829
3830         Reviewed by Jer Noble.
3831
3832         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
3833         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
3834         event along with a flag that indicates whether or not autoplay was actually prevented.
3835
3836         Tests: existing API tests were updated to reflect the new names. New API tests
3837         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
3838
3839         * Shared/WebCoreArgumentCoders.h: Take into account new flags.
3840         * UIProcess/API/C/WKPage.cpp: Ditto.
3841         (WKPageSetPageUIClient):
3842         * UIProcess/API/C/WKPageUIClient.h: Ditto.
3843         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Ditto.
3844         * UIProcess/Cocoa/UIDelegate.mm: Ditto.
3845         (WebKit::toWKAutoplayEventFlags):
3846         (WebKit::toWKAutoplayEvent):
3847
3848 2019-01-04  Fujii Hironori  <Hironori.Fujii@sony.com>
3849
3850         [curl] Move cookiePersistentStorageFile from NetworkProcessCreationParameters to NetworkSessionCreationParameters
3851         https://bugs.webkit.org/show_bug.cgi?id=192970
3852
3853         Reviewed by Alex Christensen.
3854
3855         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3856         (WebKit::NetworkProcessCreationParameters::encode const): Removed code for cookiePersistentStorageFile.
3857         (WebKit::NetworkProcessCreationParameters::decode): Ditto.
3858         * NetworkProcess/NetworkProcessCreationParameters.h: Ditto.
3859         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3860         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Ditto.
3861
3862         * NetworkProcess/NetworkSessionCreationParameters.cpp:
3863         (WebKit::NetworkSessionCreationParameters::privateSessionParameters): Added code for cookiePersistentStorageFile.
3864         (WebKit::NetworkSessionCreationParameters::encode const): Ditto.
3865         (WebKit::NetworkSessionCreationParameters::decode): Ditto.
3866         * NetworkProcess/NetworkSessionCreationParameters.h: Ditto.
3867         * NetworkProcess/curl/NetworkSessionCurl.cpp:
3868         (WebKit::NetworkSessionCurl::NetworkSessionCurl): Ditto.
3869
3870         * NetworkProcess/Cookies/WebCookieManager.h: Removed setCookiePersistentStorage method of curl port extension.
3871         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
3872         (WebKit::WebCookieManager::setCookiePersistentStorage): Deleted.
3873
3874 2019-01-04  Chris Dumez  <cdumez@apple.com>
3875
3876         [PSON] Calling history.back() from inside the load event handler prevents process-swapping
3877         https://bugs.webkit.org/show_bug.cgi?id=193120
3878
3879         Reviewed by Alex Christensen.
3880
3881         A HistoryItem is created only *after* we've fired the load event. As a result, if you call
3882         history.back() in JS from inside the load event handler, the current HistoryItem and and
3883         the target HistoryItem will be the same. This is normally not an issue. However, there was
3884         logic inside of WebProcessPool::processForNavigationInternal() which would compare the
3885         processID of the source and destination BackForwardListItems and which would force a process
3886         reuse if both BackForwardListItems came from the same WebContent process. So even though
3887         we swapped when doing a standard load from site A to site B, we would fail to swap if site
3888         B called history.back() from inside its load event handler.
3889
3890         To address the issue, stop relying on the source backforward item's processID. Instead, just
3891         use the WebContent process matching the destination backforward item's processID if it still
3892         exists.
3893
3894         * UIProcess/WebProcessPool.cpp:
3895         (WebKit::WebProcessPool::processForNavigationInternal):
3896
3897 2019-01-04  Keith Rollin  <krollin@apple.com>
3898
3899         Bring back parent processID for logging
3900         https://bugs.webkit.org/show_bug.cgi?id=193121
3901         <rdar://problem/47031634>
3902
3903         Reviewed by Alex Christensen.
3904
3905         Bug 192961 removes presentingApplicationPID from
3906         NetworkProcessCreationParameters because it was (a) stored in some
3907         global state, the use of which is being minimized, and (b) it was
3908         largely unused. However, it was actually still being used in some
3909         useful logging in order to tie together child processes with their
3910         parent process. Re-introduce this value in NetworkLoadParameters so
3911         that we can log it.
3912
3913         * NetworkProcess/NetworkLoadParameters.h:
3914         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3915         (WebKit::NetworkResourceLoadParameters::encode const):
3916         (WebKit::NetworkResourceLoadParameters::decode):
3917         * NetworkProcess/NetworkResourceLoader.cpp:
3918         (WebKit::NetworkResourceLoader::start):
3919         * WebProcess/Network/WebLoaderStrategy.cpp:
3920         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3921         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3922         (WebKit::WebLoaderStrategy::startPingLoad):
3923         (WebKit::WebLoaderStrategy::preconnectTo):
3924
3925 2019-01-04  Youenn Fablet  <youenn@apple.com>
3926
3927         Make RestrictedHTTPResponseAccess an internal flag
3928         https://bugs.webkit.org/show_bug.cgi?id=193145
3929
3930         Reviewed by Chris Dumez.
3931
3932         * Shared/WebPreferences.yaml: This will ease debugging.
3933
3934 2019-01-04  Per Arne Vollan  <pvollan@apple.com>
3935
3936         [iOS] Enable logging for services in sandbox
3937         https://bugs.webkit.org/show_bug.cgi?id=192705
3938
3939         Reviewed by Brent Fulgham.
3940
3941         When running layout tests, we didn’t see 107 services being looked up through launchd. We should
3942         add logging to these services to determine which services we actually need in the sandbox.
3943
3944         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3945
3946 2019-01-04  Commit Queue  <commit-queue@webkit.org>
3947
3948         Unreviewed, rolling out r239603.
3949         https://bugs.webkit.org/show_bug.cgi?id=193146
3950
3951         Breaks shipping tests (Requested by bfulgha__ on #webkit).
3952
3953         Reverted changeset:
3954
3955         "[iOS] Update sandbox profile to use iconservices instead of
3956         lsdiconservice"
3957         https://bugs.webkit.org/show_bug.cgi?id=193115
3958         https://trac.webkit.org/changeset/239603
3959
3960 2019-01-04  Chris Dumez  <cdumez@apple.com>
3961
3962         Crash under WebProcessPool::addSuspendedPage()
3963         https://bugs.webkit.org/show_bug.cgi?id=193110
3964
3965         Reviewed by Youenn Fablet.
3966
3967         When PageCache is disabled, WebProcessPool::m_maxSuspendedPageCount is 0 and WebProcessPool::addSuspendedPage()
3968         would call m_suspendedPages.removeFirst() even though m_suspendedPages is empty, causing a crash.
3969         Do an early return when m_maxSuspendedPageCount is 0 since we do not want to add any suspended page in this
3970         case.
3971
3972         * UIProcess/WebProcessPool.cpp:
3973         (WebKit::WebProcessPool::addSuspendedPage):
3974
3975 2019-01-03  Brent Fulgham  <bfulgham@apple.com>
3976
3977         [iOS] Silently deny access to mail settings triggered by MessageUI framework
3978         https://bugs.webkit.org/show_bug.cgi?id=193123
3979         <rdar://problem/42485581>
3980
3981         Reviewed by Alexey Proskuryakov.
3982
3983         Remove unhelpful logging generated when we block access to non-WebKit preferences. These
3984         invalid checks are done by an system framework that we cannot modify.
3985
3986         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3987
3988 2019-01-03  Brent Fulgham  <bfulgham@apple.com>
3989
3990         [iOS] Update sandbox profile to use iconservices instead of lsdiconservice